工器具台账明细

main
weitingdong 12 months ago
parent 023f44e10f
commit a3808ed13b
  1. 38
      src/api/leger/inspectionstandards.js
  2. 828
      src/views/leger/toolinventoryrecordDetail.vue

@ -1,8 +1,8 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const getList = (current, size, params) => { export const inspection_getList = (current, size, params) => {
return request({ return request({
url: '/api/leger/inspectionstandards/list', url: '/api/inspectionstandards/list',
method: 'get', method: 'get',
params: { params: {
...params, ...params,
@ -12,9 +12,9 @@ export const getList = (current, size, params) => {
}) })
} }
export const getDetail = (id) => { export const inspection_getDetail = (id) => {
return request({ return request({
url: '/api/leger/inspectionstandards/detail', url: '/api/inspectionstandards/detail',
method: 'get', method: 'get',
params: { params: {
id id
@ -22,9 +22,9 @@ export const getDetail = (id) => {
}) })
} }
export const remove = (ids) => { export const inspection_remove = (ids) => {
return request({ return request({
url: '/api/leger/inspectionstandards/remove', url: '/api/inspectionstandards/remove',
method: 'post', method: 'post',
params: { params: {
ids, ids,
@ -32,19 +32,37 @@ export const remove = (ids) => {
}) })
} }
export const add = (row) => { export const inspection_add = (row) => {
return request({ return request({
url: '/api/leger/inspectionstandards/submit', url: '/api/inspectionstandards/submit',
method: 'post', method: 'post',
data: row data: row
}) })
} }
export const update = (row) => { export const inspection_update = (row) => {
return request({ return request({
url: '/api/leger/inspectionstandards/submit', url: '/api/inspectionstandards/submit',
method: 'post', method: 'post',
data: row data: row
}) })
} }
export const inspection_getListBylegerId = (toolsCodeId) => {
return request({
url: '/api/inspectionstandards/getList',
method: 'get',
params: {
toolsCodeId: toolsCodeId
}
})
}
export const inspection__Del = (toolsCodeId) => {
return request({
url: '/api/inspectionstandards/del',
method: 'post',
params: {
toolsCodeId: toolsCodeId
}
})
}

@ -0,0 +1,828 @@
<template>
<basic-container>
<avue-tabs :option="option"
@change="handleChange"></avue-tabs>
<span v-if="type.prop==='information'">
<avue-form :option="tab1_option"
v-model="tab1_form"
ref="tab1_form"
:class="frame_class">
</avue-form>
</span>
<span v-else-if="type.prop==='inspection'">
<div>
<avue-crud :data="inspection_data"
:table-loading="loading"
:option="optionInspection"
:permission="permissionList"
:before-open="beforeOpen"
:header-cell-class-name="headerClass"
v-model="inspection_form"
ref="crud"
@row-del="inspection_rowDel"
@row-update="inspection_rowUpdate"
@row-save="inspection_rowSave">
</avue-crud>
</div>
</span>
<span v-else-if="type.prop==='parameters'">
<div>
<avue-crud :data="parameters_data"
:table-loading="loading"
:option="optionParam"
:permission="permissionList"
:before-open="beforeOpen"
:header-cell-class-name="headerClass"
v-model="parameters_form"
ref="crud"
@row-del="parameters_rowDel"
@row-update="parameters_rowUpdate"
@row-save="parameters_rowSave">
</avue-crud>
</div>
</span>
<span v-else-if="type.prop==='document'">
<avue-crud :option="optionDoc"
:table-loading="loading"
:data="document_data"
:permission="permissionList"
:header-cell-class-name="headerClass"
v-model="document_form"
ref="crud2"
@row-update="document_rowUpdate"
@row-save="document_rowSave"
@row-del="document_rowDel"
:upload-after="uploadAfter"
:upload-preview="(file) => handleUploadPreview(file)"
:upload-delete="(file) => handleUploadDelete(file)">
<template #accessoryName="scope">
<el-link type="primary" :underline="false" @click="handleDownload(scope.row)">{{scope.row.prAccessoryName}}</el-link>
</template>
<template #menu="{row,index,size}">
<el-button size="small" type="text" @click="handleDownload(row)" icon="el-icon-download"> </el-button>
</template>
</avue-crud>
</span>
<div class="container">
<span >
<el-button type="text"
size="large"
@click="back"
v-if="addUpdateShowButton">
取消</el-button>
<el-button type="primary"
size="large"
@click="handleFormSubmit"
v-if="addUpdateShowButton">
确定</el-button>
<el-button type="primary"
size="small"
@click="auditing"
v-if="shouldShowButton">
审核</el-button>
<el-button type="primary"
size="small"
@click="reject"
v-if="shouldShowButton">
驳回</el-button>
<el-button type="primary"
size="small"
@click="seachToUpdate"
v-if="shouldShowButton">
修改</el-button>
<el-button type="primary"
size="small"
@click="del"
v-if="shouldShowButton">
删除</el-button>
</span>
</div>
</basic-container>
<!-- https://avuejs.com/form/form-rules.html#%E5%A4%96%E7%BD%AE%E9%AA%8C%E8%AF%81-->
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/leger/equipmentledger";
import {
inspection_add,
inspection_update,
inspection_remove,
inspection_getListBylegerId,
inspection_Del
} from "@/api/leger/inspectionstandards";
import {
parameters_add,
parameters_update,
parameters_remove,
parameters_getListBylegerId,
parameters_Del
} from "@/api/leger/techparameters";
import {
document_add,
document_update,
document_remove,
document_getListBylegerId,
document_Del
} from "@/api/leger/inventorydocument";
import {mapGetters} from "vuex";
import website from "@/config/website";
import {readonly} from "vue";
import {getToken} from "@/util/auth";
export default {
name: "equipmentledgerDetail",
data () {
return {
frame_class: '',
type: {},
shouldShowButton:{},
addUpdateShowButton:{},
readonlyForm:{},
document_form:{},
option: {
column: [{
label: '基本信息',
prop: 'information',
}
]
},
tab1_form: {},
tab1_option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "工器具编码",
prop: "toolsCodeId",
rules: [{
required: true,
message: "请输入工器具编码",
trigger: "blur"
}],
span: 24,
},
{
label: "工器具名称",
prop: "toolName",
rules: [{
required: true,
message: "请输入工器具名称",
trigger: "blur"
}],
span: 8,
},
{
label: "工器具类别",
prop: "toolCategory",
rules: [{
required: true,
message: "请输入工器具类别",
trigger: "blur"
}],
span: 8,
},
{
label: "工器具类别描述",
prop: "toolTypeDescription",
span: 8,
},
{
label: "规格型号",
prop: "modelSpecification",
span: 8,
},
{
label: "工器具状态",
prop: "toolStatus",
rules: [{
required: true,
message: "请输入工器具状态",
trigger: "blur"
}],
span: 8,
},
{
label: "工器具状态描述",
prop: "toolStatusDescription",
span: 8,
},
{
label: "配置日期",
prop: "configurationDate",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span: 8,
},
{
label: "已用年限",
prop: "yearsInUsed",
span: 8,
},
{
label: "出厂编号",
prop: "factoryNo",
span: 8,
},
{
label: "责任班组",
prop: "responsibleTeam",
span: 8,
},
{
label: "责任人",
prop: "responsiblPerson",
span: 8,
},
{
label: "是否检验周期内",
prop: "isInspectionPeriod",
span: 8,
},
{
label: "场站",
prop: "stations",
rules: [{
required: true,
message: "请输入场站",
trigger: "blur"
}],
span: 8,
},
]
},
inspection_data: [],
optionInspection: {
align: 'center',
menuAlign: 'center',
height: 'auto',
calcHeight: 210,
tip: false,
border: true,
indexLabel: "序号",
index: true,
column: [
{
label: "检验内容",
prop: "inspectionContent",
rules: [{
required: true,
message: "请输入检验内容",
trigger: "blur"
}]
},
{
label: "检验标准",
prop: "inspectionStandards",
rules: [{
required: true,
message: "请输入检验标准",
trigger: "blur"
}]
},
]
},
tab2_page: {
pageSize: 20,
pagerCount: 5
},
parameters_data: [],
optionParam: {
align: 'center',
menuAlign: 'center',
height: 'auto',
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,
border: true,
indexLabel: "序号",
index: true,
column: [
{
label: "分类",
prop: "classification",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "分类描述",
prop: "description",
span: 20,
type: "textarea",
rules: [{
trigger: "blur"
}]
},
{
label: "技术参数",
prop: "techParameters",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "参数",
prop: "parameters",
span: 20,
rules: [{
trigger: "blur"
}]
},
]
},
tab3_page: {
pageSize: 20,
pagerCount: 5
},
document_data: [],
optionDoc: {
align: 'center',
menuAlign: 'center',
height: 'auto',
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,
border: true,
indexLabel: "序号",
index: true,
column: [
{
label: "标题",
prop: "title",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "作者",
prop: "author",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "日期",
prop: "date",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "页数",
prop: "page",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "关键字",
prop: "keyword",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: "主题",
prop: "thead",
span: 20,
rules: [{
trigger: "blur"
}]
},
{
label: '附件',
prop: 'accessoryName',
dataType: 'object',
fileType: 'img',//img/video/audio
type: 'upload',
// hide: true,
limit: 1,
propsHttp: {
res: 'data',
},
data: {
fileType: "1"// -
},
headers: {
},
span: 20,
action: './api/system/file/upload'
}
]
}
}
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: true,
viewBtn: false,
delBtn: true,
editBtn: true
};
},
},
created () {
this.type = this.option.column[0];
this.option.column.push({ label: '检验标准', prop: 'inspection' },{ label: '技术参数', prop: 'parameters' },{ label: '文档清册', prop: 'document' });
if(this.$route.query.frameMode == "search"){
this.option.column.push({ label: '检验标准', prop: 'Inspection' },{ label: '技术参数', prop: 'parameters' },{ label: '文档清册', prop: 'document' });
this.readonlyForm=true;
this.shouldShowButton=true;
this.addUpdateShowButton=false;
this.frame_class = 'frame_class1';
}else{
this.readonlyForm=false;
this.shouldShowButton=false;
this.addUpdateShowButton=true;
this.frame_class = null;
}
this.SearchDetail();
},
methods: {
handleFormSubmit() {
const form = this.$refs.tab1_form;
form.validate((valid) => {
if (valid) {
this.Submit();
} else {
this.$message({
type: "warning",
message: "请输入必要信息!"
});
}
});
},
//
Submit() {
if(this.$route.query.frameMode=="add"){
this.$confirm("是否新增所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus="1"
add(this.tab1_form).then(()=>{
this.$router.push({
path: "/leger/equipmentledger",
query: {
},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
});
}else {
this.$confirm("是否修改所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
update(this.tab1_form).then(() => {
this.$router.push({
path: "/leger/equipmentledger",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
});
}
},
back() {
if(this.$route.query.frameMode=="add") {
this.$router.push({path: "/leger/equipmentledger"});
}else{
this.updateToSearch();
this.SearchDetail();
}
},
seachToUpdate () {
this.shouldShowButton=false;
this.addUpdateShowButton=true;
this.readonlyForm=false;
this.frame_class = null;
},
updateToSearch () {
this.readonlyForm=true;
this.shouldShowButton=true;
this.addUpdateShowButton=false;
this.frame_class = 'frame_class1';
},
handleChange (column) {
this.type = column
if (column.prop == 'parameters') {
this.parameters_onLoad();
}if (column.prop == 'document') {
this.document_onLoad();
}if (column.prop == 'inspection') {
this.inspection_onLoad();
}
},
//
inspection_rowSave (form, done, loading) {
loading();
form.toolsCodeId = '111';
inspection_add(form).then(() => {
done(form);
this.inspection_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
inspection_rowUpdate(form, index, done, loading) {
inspection_update(form).then(() => {
done(form);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
inspection_rowDel(form, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return inspection_remove(form.id);
})
.then(() => {
this.inspection_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
//
parameters_rowSave (form, done, loading) {
loading();
form.eqLedgerId = this.$route.query.id;
parameters_add(form).then(() => {
done(form);
this.parameters_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
parameters_rowUpdate(form, index, done, loading) {
parameters_update(form).then(() => {
done(form);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
parameters_rowDel(form, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return parameters_remove(form.id);
})
.then(() => {
this.parameters_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
//
document_rowSave(form, done, loading) {
loading();
form.eqLedgerId = this.$route.query.id;
document_add(form).then(() => {
done(form);
this.document_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
document_rowUpdate(form, index, done, loading) {
console.log(form)
document_update(form).then(() => {
done(form);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
document_rowDel(form, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return document_remove(form.id);
})
.then(() => {
this.document_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
SearchDetail() {
getDetail(this.$route.query.id).then(res => {
console.log(res);
this.tab1_form = res.data.data;
});
},
auditing() {
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus = "2"
this.submitRejectOrauditing();
});
},
reject() {
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus = "3"
this.submitRejectOrauditing();
});
},
submitRejectOrauditing() {
update(this.tab1_form).then(() => {
this.$router.push({
path: "/leger/equipmentledger",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
},
del() {
this.$confirm("是否将选择数据审核?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
remove(this.tab1_form.id).then(() => {
this.$router.push({
path: "/leger/equipmentledger",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
})
},
headerClass() {
return 'head-style'
},
inspection_onLoad(row, params = {}) {
this.loading = true;
inspection_getListBylegerId(this.$route.query.id).then(res => {
this.inspection_data = res.data.data;
this.loading = false;
});
},
parameters_onLoad(row, params = {}) {
this.loading = true;
parameters_getListBylegerId(this.$route.query.id).then(res => {
this.parameters_data = res.data.data;
this.loading = false;
});
},
document_onLoad(row, params = {}) {
this.loading = true;
document_getListBylegerId(this.$route.query.id).then(res => {
this.document_data = res.data.data;
this.loading = false;
});
},
handleDownload(row) {
window.open(`/api/system/file/download?daf-auth=${getToken()}&fileName=${row.accessoryName}`);
},
uploadAfter(response, done) {
// response
this.document_form.accessoryName = response.fileName;
this.document_form.prAccessoryName = response.name;
done();
},
handleUploadPreview(file) {
//
return false;
},
handleUploadDelete(file) {
this.document_form.accessoryName = '';
this.document_form.prAccessoryName = '';
}
}
}
</script>
<style>
.head-style {
background-color: #1e9fff !important;
color: #FFFFFF !important;
}
.frame_class1 input.el-input__inner {
border: none;
box-shadow: none;
outline: none;
pointer-events: none;
}
.frame_class1 .el-input__icon {
display: none;
}
.frame_class1 .el-input--prefix .el-input__inner {
padding-left: 15px;
}
.container {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
</style>
Loading…
Cancel
Save