|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
v-model:page="page" |
|
|
|
|
v-model:search="search" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
v-model="form" |
|
|
|
|
ref="crud" |
|
|
|
|
@ -24,8 +25,8 @@ |
|
|
|
|
<el-button type="primary" @click="handleSet">批量设置分类</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="{row}"> |
|
|
|
|
<el-button type="text" @click="editRow(row.timId)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row.timId)">删除</el-button> |
|
|
|
|
<el-button type="text" @click="editRow(row)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #userName="{row}"> |
|
|
|
|
{{ row.updateMan.userName}} |
|
|
|
|
@ -63,23 +64,22 @@ |
|
|
|
|
<el-table-column type="selection" width="55px"></el-table-column> |
|
|
|
|
<el-table-column label="项目编号" prop="inspectionTemplateCode"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-input v-model="scope.row.inspectionTemplateCode"></el-input> |
|
|
|
|
<el-input v-model="scope.row.itemCode" @blur="validateRow(scope.$index)"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="项目" prop="nameAmId"> |
|
|
|
|
<el-table-column label="项目" prop="inspectionItemId"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-select v-model="scope.row.nameAmId" @change="(value) =>changeProject(value,scope.$index)"> |
|
|
|
|
<el-option v-for="item in projectArr" :key="item.twoData" :value="item.oneData" :label="item.oneData + '-' + item.twoData"></el-option> |
|
|
|
|
<el-select v-model="scope.row.inspectionItemId" @change="(value) =>changeProject(value,scope.$index)"> |
|
|
|
|
<el-option v-for="item in projectArr" :key="item.id" :value="item.id" :label="item.name"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<!-- <el-input v-if="scope.row.tidName" v-model="scope.row.tidName"></el-input> --> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="标准" prop="tidCanon"> |
|
|
|
|
<el-table-column label="标准" prop="standardId"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-select v-if="!trialItemList.includes(scope.row.tidName)" v-model="scope.row.tidCanon"> |
|
|
|
|
<el-option></el-option> |
|
|
|
|
<el-select v-model="scope.row.standardId"> |
|
|
|
|
<el-option v-for="item in standardList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-input v-else v-model="scope.row.tidCanon"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
@ -91,18 +91,18 @@ |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog title="修改" append-to-body v-model="setDialog" width="500px"> |
|
|
|
|
<el-form ref="addForm" :rules="setRules" :model="setData" > |
|
|
|
|
<el-form-item label="分类"> |
|
|
|
|
<el-select v-model="setData.type"> |
|
|
|
|
<el-option v-for="item in typeData" :key="item.id" :label="item.label" :value="item.value"></el-option> |
|
|
|
|
<el-dialog title="批量设置分类" append-to-body v-model="setDialog" width="500px"> |
|
|
|
|
<el-form ref="typeForm" :rules="setRules" :model="setData" > |
|
|
|
|
<el-form-item label="分类" prop="category"> |
|
|
|
|
<el-select v-model="setData.category"> |
|
|
|
|
<el-option v-for="item in typeData" :key="item.id" :label="item.dictValue" :value="item.dictKey"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="setDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="setDialog = false">确 定</el-button> |
|
|
|
|
<el-button type="primary" @click="sunmitType">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
@ -110,7 +110,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getList,addTemplate} from '@/api/productionTesting/InspectionTemplate' |
|
|
|
|
import {getList,addTemplate,getStandard,getItem,getDetail,getCategory,setType,deleteItem} from '@/api/productionTesting/InspectionTemplate' |
|
|
|
|
export default { |
|
|
|
|
data(){ |
|
|
|
|
return{ |
|
|
|
|
@ -123,6 +123,7 @@ export default { |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
search:{}, |
|
|
|
|
showDialog:false, |
|
|
|
|
setDialog:false, |
|
|
|
|
formData:{}, |
|
|
|
|
@ -148,13 +149,17 @@ export default { |
|
|
|
|
'温冲试验检测', |
|
|
|
|
'其他检测' |
|
|
|
|
], |
|
|
|
|
setRules:{ |
|
|
|
|
category: [{ required: true, trigger: 'blur', message:'请选择分类' }], |
|
|
|
|
}, |
|
|
|
|
standardList:[], |
|
|
|
|
formRules:{ |
|
|
|
|
timCode: [{ required: true, message: '请输入模板编码', trigger: 'blur' }], |
|
|
|
|
timName: [{ required: true, trigger: 'blur', message:'请输入模板名称' }], |
|
|
|
|
inspectionTemplateCode: [{ required: true, message: '请输入模板编码', trigger: 'blur' }], |
|
|
|
|
name: [{ required: true, trigger: 'blur', message:'请输入模板名称' }], |
|
|
|
|
}, |
|
|
|
|
selectionList:[], |
|
|
|
|
typeData:[ |
|
|
|
|
{label:'A',value:'A',id:'001'} |
|
|
|
|
// {label:'A',value:'A',id:'001'} |
|
|
|
|
], |
|
|
|
|
setData:{}, |
|
|
|
|
option:{ |
|
|
|
|
@ -202,7 +207,7 @@ export default { |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: '模板编码', |
|
|
|
|
prop: 'timCode', |
|
|
|
|
prop: 'inspectionTemplateCode', |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
@ -218,7 +223,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '模板名称', |
|
|
|
|
prop: 'timName', |
|
|
|
|
prop: 'name', |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
@ -234,7 +239,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '工序数', |
|
|
|
|
prop: 'proQuantity', |
|
|
|
|
prop: 'processNum', |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
@ -266,22 +271,28 @@ export default { |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '分类', |
|
|
|
|
prop: 'timType', |
|
|
|
|
prop: 'category', |
|
|
|
|
type:'select', |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
search:true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入分类', |
|
|
|
|
trigger: 'click', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
dicUrl:'/api/blade-system/dict/dictionary?code=InspectionTemplate-Category', |
|
|
|
|
props:{ |
|
|
|
|
label:'dictValue', |
|
|
|
|
value:'dictKey' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '修改人', |
|
|
|
|
prop: 'userName', |
|
|
|
|
prop: 'updateUserRealName', |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
@ -298,9 +309,31 @@ export default { |
|
|
|
|
{ |
|
|
|
|
label: '修改时间', |
|
|
|
|
prop: 'updateTime', |
|
|
|
|
type:'date', |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
// search:true, |
|
|
|
|
width:200, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入修改时间', |
|
|
|
|
trigger: 'click', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '修改时间', |
|
|
|
|
prop: 'updateTime', |
|
|
|
|
type:'date', |
|
|
|
|
searchRange:true, |
|
|
|
|
format:'YYYY-MM-DD', |
|
|
|
|
valueFormat:"YYYY-MM-DD", |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
hide:true, |
|
|
|
|
search:true, |
|
|
|
|
width:200, |
|
|
|
|
rules: [ |
|
|
|
|
@ -316,46 +349,97 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted(){ |
|
|
|
|
this.projectArr = [ |
|
|
|
|
{ |
|
|
|
|
"amId": 4, |
|
|
|
|
"douOneData": null, |
|
|
|
|
"fourData": null, |
|
|
|
|
"keyValue": 4, |
|
|
|
|
"memo": null, |
|
|
|
|
"oneData": "003", |
|
|
|
|
"threeData": null, |
|
|
|
|
"twoData": "泄漏率检测", |
|
|
|
|
"type": 2, |
|
|
|
|
"updateTime": "2024-02-27 16:20:30" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"amId": 5, |
|
|
|
|
"douOneData": null, |
|
|
|
|
"fourData": null, |
|
|
|
|
"keyValue": 5, |
|
|
|
|
"memo": null, |
|
|
|
|
"oneData": "002", |
|
|
|
|
"threeData": null, |
|
|
|
|
"twoData": "外观检测", |
|
|
|
|
"type": 2, |
|
|
|
|
"updateTime": "2024-02-27 16:20:30" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"amId": 6, |
|
|
|
|
"douOneData": null, |
|
|
|
|
"fourData": null, |
|
|
|
|
"keyValue": 6, |
|
|
|
|
"memo": null, |
|
|
|
|
"oneData": "001", |
|
|
|
|
"threeData": null, |
|
|
|
|
"twoData": "厚度检测", |
|
|
|
|
"type": 2, |
|
|
|
|
"updateTime": "2024-02-27 16:20:30" |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.getItemList() |
|
|
|
|
this.getCategoryList() |
|
|
|
|
this.getStandardList() |
|
|
|
|
}, |
|
|
|
|
methods:{ |
|
|
|
|
getStandardList(){ |
|
|
|
|
getStandard().then(res =>{ |
|
|
|
|
this.standardList = res.data.data |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getCategoryList(){ |
|
|
|
|
getCategory().then(res =>{ |
|
|
|
|
this.typeData = res.data.data |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getItemList(){ |
|
|
|
|
getItem().then(res =>{ |
|
|
|
|
this.projectArr = res.data.data |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 校验单行(与上一行比较) |
|
|
|
|
// 校验指定行(向上 + 向下) |
|
|
|
|
validateRow(index) { |
|
|
|
|
const digitOnly = /^\d+$/; |
|
|
|
|
const row = this.tidList[index]; |
|
|
|
|
const id = (row?.itemCode || '').trim(); |
|
|
|
|
|
|
|
|
|
// 清除当前行错误(先清后设) |
|
|
|
|
// this.$delete(this.errors, index); |
|
|
|
|
|
|
|
|
|
// 如果当前行为空,不校验(或根据需求设为必填) |
|
|
|
|
if (!id) return; |
|
|
|
|
|
|
|
|
|
// 格式校验 |
|
|
|
|
if (!digitOnly.test(id)) { |
|
|
|
|
// this.$set(this.errors, index, '编号必须为纯数字'); |
|
|
|
|
this.$message.error(`第【${index + 1}】行编号必须为纯数字`) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const currentNum = Number(id); |
|
|
|
|
|
|
|
|
|
// 🔼 向上校验:当前行 vs 上一行 |
|
|
|
|
if (index > 0) { |
|
|
|
|
const prevId = (this.tidList[index - 1]?.itemCode || '').trim(); |
|
|
|
|
if (prevId) { |
|
|
|
|
if (!digitOnly.test(prevId)) { |
|
|
|
|
// this.$set(this.errors, index, '上一行编号格式无效'); |
|
|
|
|
this.$message.error(`第【${index + 1}】行编号格式无效`) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (currentNum <= Number(prevId)) { |
|
|
|
|
// this.$set( |
|
|
|
|
// this.errors, |
|
|
|
|
// index, |
|
|
|
|
// `必须大于上一行(${prevId})` |
|
|
|
|
// ); |
|
|
|
|
this.$message.error(`第【${index + 1}】行编号必须大于上一行`) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 🔽 向下校验:下一行 vs 当前行 |
|
|
|
|
if (index < this.tidList.length - 1) { |
|
|
|
|
const nextId = (this.tidList[index + 1]?.itemCode || '').trim(); |
|
|
|
|
if (nextId) { |
|
|
|
|
if (!digitOnly.test(nextId)) { |
|
|
|
|
// 下一行格式错,但错误应标在下一行 |
|
|
|
|
// this.$set(this.errors, index + 1, '编号必须为纯数字'); |
|
|
|
|
this.$message.error(`第【${index + 1}】行编号必须为纯数字`) |
|
|
|
|
} else { |
|
|
|
|
const nextNum = Number(nextId); |
|
|
|
|
if (nextNum <= currentNum) { |
|
|
|
|
// this.$set( |
|
|
|
|
// this.errors, |
|
|
|
|
// index + 1, |
|
|
|
|
// `必须大于上一行(${id})` |
|
|
|
|
// ); |
|
|
|
|
this.$message.error(`第【${index + 2}】行编号必须大于上一行`) |
|
|
|
|
} else { |
|
|
|
|
// 如果之前有错,现在合法了,清除下一行错误 |
|
|
|
|
// this.$delete(this.errors, index + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 下一行为空,清除其可能的历史错误 |
|
|
|
|
// this.$delete(this.errors, index + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
selectionChangeProject(list){ |
|
|
|
|
this.selectionProjectList = list |
|
|
|
|
}, |
|
|
|
|
@ -374,7 +458,7 @@ export default { |
|
|
|
|
} else if (tidCode.toString().length == 4) { |
|
|
|
|
tidCode = '' + tidCode; |
|
|
|
|
} |
|
|
|
|
const record = { tidCode,_select:false }; |
|
|
|
|
const record = { itemCode:tidCode,_select:false }; |
|
|
|
|
this.tidList.push(record) |
|
|
|
|
}, |
|
|
|
|
// 切换项目 |
|
|
|
|
@ -402,25 +486,124 @@ export default { |
|
|
|
|
this.$message.error('请至少选择一条数据进行操作!') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 输入框失焦时触发校验 |
|
|
|
|
handleIdBlur(index) { |
|
|
|
|
this.validateRow(index); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 全量校验(提交用) |
|
|
|
|
validateAll() { |
|
|
|
|
const newErrors = {}; |
|
|
|
|
const digitOnly = /^\d+$/; |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.tidList.length; i++) { |
|
|
|
|
const id = (this.tidList[i]?.itemCode || '').trim(); |
|
|
|
|
if (!id) continue; // 或设为必填 |
|
|
|
|
|
|
|
|
|
if (!digitOnly.test(id)) { |
|
|
|
|
// newErrors[i] = '编号必须为纯数字'; |
|
|
|
|
this.$message.error(`第【${i + 1}】行编号必须为纯数字`) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const num = Number(id); |
|
|
|
|
|
|
|
|
|
// 检查上一行 |
|
|
|
|
if (i > 0) { |
|
|
|
|
const prevId = (this.tidList[i - 1]?.itemCode || '').trim(); |
|
|
|
|
if (prevId) { |
|
|
|
|
if (!digitOnly.test(prevId)) { |
|
|
|
|
// newErrors[i] = '上一行编号格式无效'; |
|
|
|
|
this.$message.error(`第【${i + 1}】行编号格式无效`) |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (num <= Number(prevId)) { |
|
|
|
|
// newErrors[i] = `必须大于上一行(${prevId})`; |
|
|
|
|
this.$message.error(`第【${i + 1}】行编号必须大于上一行`) |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 检查下一行(其实全量校验只需检查“当前 > 上一行”即可保证全局有序) |
|
|
|
|
// 所以这里可简化:只校验 i > i-1 即可 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// // 更简洁的全量校验:遍历一次,确保递增 |
|
|
|
|
// let lastNum = -1; |
|
|
|
|
// for (let i = 0; i < this.tidList.length; i++) { |
|
|
|
|
// const id = (this.tidList[i]?.id || '').trim(); |
|
|
|
|
// if (!id) continue; |
|
|
|
|
// if (!digitOnly.test(id)) { |
|
|
|
|
// // newErrors[i] = '编号必须为纯数字'; |
|
|
|
|
// this.$message.error(`第【${i + 1}】行编号必须为纯数字`) |
|
|
|
|
// break; |
|
|
|
|
// } |
|
|
|
|
// const num = Number(id); |
|
|
|
|
// if (num <= lastNum) { |
|
|
|
|
// // newErrors[i] = i === 0 ? '编号无效' : `必须大于上一行(${this.tidList[i - 1].id})`; |
|
|
|
|
// this.$message.error(i === 0 ? '编号无效' : `第【${i + 1}】行编号必须为纯数字`) |
|
|
|
|
// break; |
|
|
|
|
// } |
|
|
|
|
// lastNum = num; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// this.errors = newErrors; |
|
|
|
|
return Object.keys(newErrors).length === 0; |
|
|
|
|
}, |
|
|
|
|
handleSave(){ |
|
|
|
|
this.$refs.addForm.validate(valid => { |
|
|
|
|
if(valid){ |
|
|
|
|
// if(this.tidList) |
|
|
|
|
const deleteIdArr = [] |
|
|
|
|
this.deleteTidArr.map(item =>{ |
|
|
|
|
deleteIdArr.push(item.tidId) |
|
|
|
|
}) |
|
|
|
|
console.log('dele----------------------',deleteIdArr) |
|
|
|
|
console.log('tidList----------------------',this.tidList) |
|
|
|
|
// let filteredObjArr = this.tidList.filter(item => !deleteIdArr.some(val => val === item.id)); |
|
|
|
|
// console.log('filteredObjArr====================',filteredObjArr) |
|
|
|
|
let params = { |
|
|
|
|
deleteIds:deleteIdArr, |
|
|
|
|
dsTrialitemModel:this.formData, |
|
|
|
|
list:this.tidList |
|
|
|
|
if(this.validateAll()){ |
|
|
|
|
let params = { |
|
|
|
|
inspectionTemplateCode:this.formData.inspectionTemplateCode, |
|
|
|
|
name:this.formData.name, |
|
|
|
|
priority:this.formData.priority, |
|
|
|
|
detailList:this.tidList.length > 0 ? this.tidList : [] |
|
|
|
|
} |
|
|
|
|
addTemplate(params).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
this.showDialog = false |
|
|
|
|
this.onLoad() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// // if(this.tidList) |
|
|
|
|
// const deleteIdArr = [] |
|
|
|
|
// this.deleteTidArr.map(item =>{ |
|
|
|
|
// deleteIdArr.push(item.tidId) |
|
|
|
|
// }) |
|
|
|
|
// console.log('dele----------------------',deleteIdArr) |
|
|
|
|
// console.log('tidList----------------------',this.tidList) |
|
|
|
|
// // let filteredObjArr = this.tidList.filter(item => !deleteIdArr.some(val => val === item.id)); |
|
|
|
|
// // console.log('filteredObjArr====================',filteredObjArr) |
|
|
|
|
// let params = { |
|
|
|
|
// deleteIds:deleteIdArr, |
|
|
|
|
// dsTrialitemModel:this.formData, |
|
|
|
|
// list:this.tidList |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// console.log('paramd--------------------',params) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
sunmitType(){ |
|
|
|
|
this.$refs.typeForm.validate(valid =>{ |
|
|
|
|
if(valid){ |
|
|
|
|
this.selectionList.map(item =>{ |
|
|
|
|
item.category = this.setData.category |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
console.log('paramd--------------------',params) |
|
|
|
|
setType(this.selectionList).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('设置成功') |
|
|
|
|
this.setDialog = false |
|
|
|
|
this.onLoad() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log('slee=================',this.selectionList) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -456,7 +639,12 @@ export default { |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() =>{ |
|
|
|
|
|
|
|
|
|
deleteItem({ids:val.id}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleAdd(){ |
|
|
|
|
@ -466,105 +654,33 @@ export default { |
|
|
|
|
this.deleteTidArr = [] |
|
|
|
|
}, |
|
|
|
|
handleSet(){ |
|
|
|
|
if(this.selectionChange.length == 0){ |
|
|
|
|
if(this.selectionList.length == 0){ |
|
|
|
|
this.$message.error('请至少选择一条数据') |
|
|
|
|
}else{ |
|
|
|
|
this.setDialog = true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
editRow(val){ |
|
|
|
|
console.log('val====================',val) |
|
|
|
|
this.selectId = val |
|
|
|
|
this.showDialog = true |
|
|
|
|
this.formData = { |
|
|
|
|
timCode: "002", |
|
|
|
|
timId: 2, |
|
|
|
|
timName: "化学镍含涂色标类试验项目", |
|
|
|
|
priority: 2 |
|
|
|
|
} |
|
|
|
|
this.tidList = [ |
|
|
|
|
{ |
|
|
|
|
"canonAmId": null, |
|
|
|
|
"createTime": "2023-02-17 17:19:57", |
|
|
|
|
"keyValue": 8, |
|
|
|
|
"nameAmId": '003', |
|
|
|
|
"tidCanon": "参照文件010-02235435《热表分厂表处理零件检验规范》执行", |
|
|
|
|
"tidCode": "003", |
|
|
|
|
"tidId": 8, |
|
|
|
|
"tidName": "厚度检测", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"canonAmId": null, |
|
|
|
|
"createTime": "2023-02-17 17:19:57", |
|
|
|
|
"keyValue": 8, |
|
|
|
|
"nameAmId": '003', |
|
|
|
|
"tidCanon": "参照文件010-02235435《热表分厂表处理零件检验规范》执行", |
|
|
|
|
"tidCode": "003", |
|
|
|
|
"tidId": 8, |
|
|
|
|
"tidName": "厚度检测", |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.dialogData = [ |
|
|
|
|
{ |
|
|
|
|
"canonAmId": null, |
|
|
|
|
"createTime": "2023-02-17 17:19:57", |
|
|
|
|
"keyValue": 8, |
|
|
|
|
"nameAmId": '003', |
|
|
|
|
"tidCanon": "参照文件010-02235435《热表分厂表处理零件检验规范》执行", |
|
|
|
|
"tidCode": "003", |
|
|
|
|
"tidId": 8, |
|
|
|
|
"tidName": "厚度检测", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"canonAmId": null, |
|
|
|
|
"createTime": "2023-02-17 17:19:57", |
|
|
|
|
"keyValue": 8, |
|
|
|
|
"nameAmId": '003', |
|
|
|
|
"tidCanon": "参照文件010-02235435《热表分厂表处理零件检验规范》执行", |
|
|
|
|
"tidCode": "003", |
|
|
|
|
"tidId": 8, |
|
|
|
|
"tidName": "厚度检测", |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
editRow(row){ |
|
|
|
|
getDetail({id:row.id}).then(res =>{ |
|
|
|
|
this.formData = res.data.data |
|
|
|
|
this.showDialog = true |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onLoad(){ |
|
|
|
|
this.loading = true |
|
|
|
|
getList({ |
|
|
|
|
current:this.page.currentPage, |
|
|
|
|
size:this.page.pageSize |
|
|
|
|
size:this.page.pageSize, |
|
|
|
|
inspectionTemplateCode:this.query.inspectionTemplateCode, |
|
|
|
|
name:this.query.name, |
|
|
|
|
processNum:this.query.processNum, |
|
|
|
|
category:this.query.category, |
|
|
|
|
updateUserRealName:this.query.updateUserRealName, |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.page.total = res.data.data.total |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
// this.data = [ |
|
|
|
|
// { |
|
|
|
|
// id:1,timId: 1,timCode:'001',timName:'化学镍不涂色标试验项目',proQuantity:7,priority:1, |
|
|
|
|
// timType:'A',updateMan:{ |
|
|
|
|
// userName:'崔殿龙', |
|
|
|
|
// }, |
|
|
|
|
// updateTime:'2024-01-22 12:35:40' |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// id:2,timId: 2,timCode:'002',timName:'化学镍不涂色标试验项目',proQuantity:7,priority:1, |
|
|
|
|
// timType:'A',updateMan:{ |
|
|
|
|
// userName:'崔殿龙', |
|
|
|
|
// }, |
|
|
|
|
// updateTime:'2024-01-22 12:35:40' |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// id:3,timId: 3,timCode:'003',timName:'化学镍不涂色标试验项目',proQuantity:7,priority:1, |
|
|
|
|
// timType:'A',updateMan:{ |
|
|
|
|
// userName:'崔殿龙', |
|
|
|
|
// }, |
|
|
|
|
// updateTime:'2024-01-22 12:35:40' |
|
|
|
|
// }, |
|
|
|
|
// ] |
|
|
|
|
// this.page.total = this.data.length |
|
|
|
|
// this.loading = false |
|
|
|
|
// setTimeout(() =>{ |
|
|
|
|
// this.selectionClear(); |
|
|
|
|
// },300) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|