|
|
|
|
@ -97,7 +97,7 @@ |
|
|
|
|
style="width: 220px; margin-right: 12px" |
|
|
|
|
clearable |
|
|
|
|
filterable |
|
|
|
|
:filter-method="handleFilter" |
|
|
|
|
:filter-method="handleFilter" |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="(item, index) in filteredList" |
|
|
|
|
@ -392,10 +392,10 @@ |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`tableData3[${scope.$index}].tool`" :rules="formRules3.tool"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="scope.row.tool" |
|
|
|
|
placeholder="请输入" |
|
|
|
|
style="width: 100%" |
|
|
|
|
></el-input> |
|
|
|
|
v-model="scope.row.tool" |
|
|
|
|
placeholder="请输入" |
|
|
|
|
style="width: 100%" |
|
|
|
|
></el-input> |
|
|
|
|
<!-- <el-select v-model="scope.row.tool" placeholder="请选择" clearable filterable> |
|
|
|
|
<el-option label="是" value="1"></el-option> |
|
|
|
|
<el-option label="否" value="2"></el-option> |
|
|
|
|
@ -544,7 +544,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
craftLoading:false, |
|
|
|
|
craftLoading: false, |
|
|
|
|
rank: '2', |
|
|
|
|
processLevel: '2', |
|
|
|
|
data: [], |
|
|
|
|
@ -624,9 +624,8 @@ export default { |
|
|
|
|
tempId: 0, |
|
|
|
|
projectOptions: [], //检验项目列表 |
|
|
|
|
standardList: [], //检验标准列表 |
|
|
|
|
filteredList:[], |
|
|
|
|
dictionaryData:[], |
|
|
|
|
|
|
|
|
|
filteredList: [], |
|
|
|
|
dictionaryData: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
@ -639,22 +638,22 @@ export default { |
|
|
|
|
this.getPqList(); |
|
|
|
|
this.getProject(); |
|
|
|
|
this.getStandardList(); |
|
|
|
|
this.getDictionary() |
|
|
|
|
this.getDictionary(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取涂色标、涂色带、涂箭头的系数 |
|
|
|
|
getDictionary(){ |
|
|
|
|
getDictionary({code:'part_info'}).then(res=>{ |
|
|
|
|
this.dictionaryData = res.data.data |
|
|
|
|
}) |
|
|
|
|
getDictionary() { |
|
|
|
|
getDictionary({ code: 'part_info' }).then(res => { |
|
|
|
|
this.dictionaryData = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取检验项目名字 |
|
|
|
|
projectChange(row,index) { |
|
|
|
|
projectChange(row, index) { |
|
|
|
|
let selectName = this.projectOptions.find(item => item.id == row.projectCode); |
|
|
|
|
this.form2.tableData2[index].projectName = selectName.name; |
|
|
|
|
}, |
|
|
|
|
// 获取检验标准名字 |
|
|
|
|
standardChange(row,index) { |
|
|
|
|
standardChange(row, index) { |
|
|
|
|
let selectName = this.standardList.find(item => item.id == row.projectStandard); |
|
|
|
|
this.form2.tableData2[index].projectStandardName = selectName.name; |
|
|
|
|
}, |
|
|
|
|
@ -672,24 +671,24 @@ export default { |
|
|
|
|
processChange(row, index) { |
|
|
|
|
let selectName = this.processSetOption.find(item => item.id == row.processCode); |
|
|
|
|
this.form1.tableData1[index].processName = selectName.name; |
|
|
|
|
if(this.form1.tableData1[index].processName.indexOf('涂色标') > -1){ |
|
|
|
|
console.log(this.partInfoData,this.dictionaryData,'this.partInfoData'); |
|
|
|
|
if (this.form1.tableData1[index].processName.indexOf('涂色标') > -1) { |
|
|
|
|
console.log(this.partInfoData, this.dictionaryData, 'this.partInfoData'); |
|
|
|
|
// tsbNum 涂色标个数 tsdNum 涂色带个数 涂箭头个数 |
|
|
|
|
let sum_ = 0 |
|
|
|
|
if(this.partInfoData.tsbNum){ |
|
|
|
|
let tsb=this.dictionaryData.find(item => item.dictValue == '涂色标') |
|
|
|
|
sum_ += parseInt(this.partInfoData.tsbNum)*tsb.dictKey |
|
|
|
|
let sum_ = 0; |
|
|
|
|
if (this.partInfoData.tsbNum) { |
|
|
|
|
let tsb = this.dictionaryData.find(item => item.dictValue == '涂色标'); |
|
|
|
|
sum_ += parseInt(this.partInfoData.tsbNum) * tsb.dictKey; |
|
|
|
|
} |
|
|
|
|
if(this.partInfoData.tsdNum){ |
|
|
|
|
let tsd=this.dictionaryData.find(item => item.dictValue == '涂色带') |
|
|
|
|
sum_ += parseInt(this.partInfoData.tsdNum)*tsd.dictKey |
|
|
|
|
if (this.partInfoData.tsdNum) { |
|
|
|
|
let tsd = this.dictionaryData.find(item => item.dictValue == '涂色带'); |
|
|
|
|
sum_ += parseInt(this.partInfoData.tsdNum) * tsd.dictKey; |
|
|
|
|
} |
|
|
|
|
if(this.partInfoData.tsjNum){ |
|
|
|
|
let tsj=this.dictionaryData.find(item => item.dictValue == '涂箭头') |
|
|
|
|
sum_ += parseInt(this.partInfoData.tsjNum)*tsj.dictKey |
|
|
|
|
if (this.partInfoData.tsjNum) { |
|
|
|
|
let tsj = this.dictionaryData.find(item => item.dictValue == '涂箭头'); |
|
|
|
|
sum_ += parseInt(this.partInfoData.tsjNum) * tsj.dictKey; |
|
|
|
|
} |
|
|
|
|
console.log(sum_,'sum_'); |
|
|
|
|
this.form1.tableData1[index].proHours = sum_ |
|
|
|
|
console.log(sum_, 'sum_'); |
|
|
|
|
this.form1.tableData1[index].proHours = sum_; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取工艺能力名字 |
|
|
|
|
@ -703,31 +702,31 @@ export default { |
|
|
|
|
this.rankList = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleFilter(keyword){ |
|
|
|
|
handleFilter(keyword) { |
|
|
|
|
// 1. 无关键词时,显示全部数据 |
|
|
|
|
if (!keyword) { |
|
|
|
|
this.filteredList = [...this.originList] |
|
|
|
|
return |
|
|
|
|
this.filteredList = [...this.modelOption]; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 2. 统一转为小写,实现不区分大小写过滤 |
|
|
|
|
const lowerKeyword = keyword.toLowerCase() |
|
|
|
|
const lowerKeyword = keyword; |
|
|
|
|
|
|
|
|
|
// 3. 同时匹配两个字段:name 或 pinyin 包含关键词即保留 |
|
|
|
|
this.filteredList = this.originList.filter(item => { |
|
|
|
|
this.filteredList = this.modelOption.filter(item => { |
|
|
|
|
// 字段1:姓名(转小写) |
|
|
|
|
const matchName = item.name.toLowerCase().includes(lowerKeyword) |
|
|
|
|
const matchName = item.name.includes(lowerKeyword); |
|
|
|
|
// 字段2:拼音(转小写) |
|
|
|
|
const matchPinyin = item.modelNameStr.toLowerCase().includes(lowerKeyword) |
|
|
|
|
const matchPinyin = item.modelNameStr.includes(lowerKeyword); |
|
|
|
|
// 只要有一个字段匹配,就保留该选项 |
|
|
|
|
return matchName || matchPinyin |
|
|
|
|
}) |
|
|
|
|
return matchName || matchPinyin; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 工艺模板列表 |
|
|
|
|
async getModelList() { |
|
|
|
|
await getModelList().then(res => { |
|
|
|
|
this.modelOption = res.data.data; |
|
|
|
|
this.filteredList = [...this.modelOption] |
|
|
|
|
this.filteredList = [...this.modelOption]; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 工序列表查询 |
|
|
|
|
@ -777,7 +776,7 @@ export default { |
|
|
|
|
partId: this.partId, |
|
|
|
|
taskId: this.updateRow.id, |
|
|
|
|
rank: this.rank, |
|
|
|
|
version:this.updateRow.version |
|
|
|
|
version: this.updateRow.version, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = this.transformCraftTree(res.data.data); |
|
|
|
|
this.partInfoData = res.data.data.partInfo; |
|
|
|
|
@ -856,7 +855,7 @@ export default { |
|
|
|
|
this.form2.deleteIds = []; |
|
|
|
|
this.form3.deleteIds = []; |
|
|
|
|
this.form4.deleteIds = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据节点层级切换标签页 |
|
|
|
|
if (this.treeLeave === 2) { |
|
|
|
|
this.activeName = '1'; |
|
|
|
|
@ -1042,7 +1041,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
saveInfo() { |
|
|
|
|
|
|
|
|
|
if (this.activeName == '1') { |
|
|
|
|
// 调用单个 Form 的校验方法 |
|
|
|
|
this.$refs.tableForm1.validate(async (isValid, invalidFields) => { |
|
|
|
|
@ -1081,7 +1079,7 @@ export default { |
|
|
|
|
if (isReturn == 1) { |
|
|
|
|
return this.$message.warning('涂色标的工时定额必须大于0,请修改!'); |
|
|
|
|
} |
|
|
|
|
console.log(898989,this.partInfoData) |
|
|
|
|
console.log(898989, this.partInfoData); |
|
|
|
|
// const res = await getPartDetail(this.partId); |
|
|
|
|
// console.log(res); |
|
|
|
|
let dsCraftMold = this.partInfoData; |
|
|
|
|
@ -1231,7 +1229,7 @@ export default { |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
this.craftLoading = true |
|
|
|
|
this.craftLoading = true; |
|
|
|
|
|
|
|
|
|
// 处理传参 |
|
|
|
|
if (this.treeNodes.rawData.qualityGradeCode) { |
|
|
|
|
@ -1247,20 +1245,22 @@ export default { |
|
|
|
|
deleteIds: this.form1.deleteIds, //删除ids |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
authorizedAccomplish2(query_).then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.craftLoading = false |
|
|
|
|
this.getDetails(); |
|
|
|
|
}).catch(err=>{ |
|
|
|
|
this.craftLoading = false |
|
|
|
|
}); |
|
|
|
|
authorizedAccomplish2(query_) |
|
|
|
|
.then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.craftLoading = false; |
|
|
|
|
this.getDetails(); |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
this.craftLoading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '2') { |
|
|
|
|
this.$refs.tableForm2.validate((isValid, invalidFields) => { |
|
|
|
|
if (isValid) { |
|
|
|
|
this.craftLoading = true |
|
|
|
|
this.craftLoading = true; |
|
|
|
|
let query_ = { |
|
|
|
|
processEntity: this.treeNodes.rawData.processInfo, //工序 |
|
|
|
|
processProjectEntityList: this.form2.tableData2, //项目 |
|
|
|
|
@ -1269,7 +1269,7 @@ export default { |
|
|
|
|
|
|
|
|
|
saveProcessProjectSave(query_).then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.craftLoading = false |
|
|
|
|
this.craftLoading = false; |
|
|
|
|
this.getDetails(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
@ -1278,7 +1278,7 @@ export default { |
|
|
|
|
if (this.activeName == '3') { |
|
|
|
|
this.$refs.tableForm3.validate((isValid, invalidFields) => { |
|
|
|
|
if (isValid) { |
|
|
|
|
this.craftLoading = true |
|
|
|
|
this.craftLoading = true; |
|
|
|
|
let query_ = { |
|
|
|
|
processEntity: this.treeNodes.rawData.processInfo, //工序 |
|
|
|
|
processMeasuringToolEntities: this.form3.tableData3, //尺寸量具 |
|
|
|
|
@ -1286,7 +1286,7 @@ export default { |
|
|
|
|
}; |
|
|
|
|
saveProcessMeasuringTool(query_).then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.craftLoading = false |
|
|
|
|
this.craftLoading = false; |
|
|
|
|
this.getDetails(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
@ -1295,7 +1295,7 @@ export default { |
|
|
|
|
if (this.activeName == '4') { |
|
|
|
|
this.$refs.tableForm4.validate((isValid, invalidFields) => { |
|
|
|
|
if (isValid) { |
|
|
|
|
this.craftLoading = true |
|
|
|
|
this.craftLoading = true; |
|
|
|
|
let query_ = { |
|
|
|
|
processEntity: this.treeNodes.rawData.processInfo, //工序 |
|
|
|
|
processMoldToolEntities: this.form4.tableData4, //尺寸量具 |
|
|
|
|
@ -1303,7 +1303,7 @@ export default { |
|
|
|
|
}; |
|
|
|
|
saveProcessMoldTool(query_).then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.craftLoading = false |
|
|
|
|
this.craftLoading = false; |
|
|
|
|
this.getDetails(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|