|
|
|
|
@ -20,8 +20,8 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
<!-- style="width: 240px" --> |
|
|
|
|
<el-tree |
|
|
|
|
style="width: 240px" |
|
|
|
|
:data="data" |
|
|
|
|
:props="defaultProps" |
|
|
|
|
@node-click="handleNodeClick" |
|
|
|
|
@ -105,7 +105,7 @@ |
|
|
|
|
:value="item.id" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button type="primary" @change="modelLevelChange()">导入模板</el-button> |
|
|
|
|
<el-button type="primary" @click="modelLevelChange()">导入模板</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 工序 --> |
|
|
|
|
@ -116,7 +116,11 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '1'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form1.tableData1" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form1.tableData1" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange1" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="processNo" label="工序号"> |
|
|
|
|
<template #header> |
|
|
|
|
@ -242,7 +246,11 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '2'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form2.tableData2" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form2.tableData2" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange2" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="trialNo" label="工序号"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
@ -326,7 +334,12 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '3'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form3.tableData3" class="tableHeight" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form3.tableData3" |
|
|
|
|
class="tableHeight" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange3" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="trialNo" label="工序号"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
@ -394,7 +407,11 @@ |
|
|
|
|
label-width="0px" |
|
|
|
|
v-if="activeName == '4'" |
|
|
|
|
> |
|
|
|
|
<el-table :data="form4.tableData4" style="width: 100%"> |
|
|
|
|
<el-table |
|
|
|
|
:data="form4.tableData4" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@selection-change="handleSelectionChange4" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
<el-table-column prop="trialNo" label="工序号"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
@ -474,7 +491,7 @@ import { |
|
|
|
|
saveProcessMoldTool, |
|
|
|
|
getProcessSetList, |
|
|
|
|
getCraftAbilityList, |
|
|
|
|
getPartDetail |
|
|
|
|
getPartDetail, |
|
|
|
|
} from '@/api/processManagement/taskProcessing'; |
|
|
|
|
import { getPqList } from '@/api/qualityManagement/remindRedeem/remindRedeem'; |
|
|
|
|
export default { |
|
|
|
|
@ -540,15 +557,23 @@ export default { |
|
|
|
|
modelLevel: null, //模板选择 |
|
|
|
|
form1: { |
|
|
|
|
tableData1: [], //工序 |
|
|
|
|
deleteIds: [], |
|
|
|
|
selectIds: [], //选中ID |
|
|
|
|
}, |
|
|
|
|
form2: { |
|
|
|
|
tableData2: [], //项目 |
|
|
|
|
deleteIds: [], |
|
|
|
|
selectIds: [], //选中ID |
|
|
|
|
}, |
|
|
|
|
form3: { |
|
|
|
|
tableData3: [], //量具 |
|
|
|
|
deleteIds: [], |
|
|
|
|
selectIds: [], //选中ID |
|
|
|
|
}, |
|
|
|
|
form4: { |
|
|
|
|
tableData4: [], //工装 |
|
|
|
|
deleteIds: [], |
|
|
|
|
selectIds: [], //选中ID |
|
|
|
|
}, |
|
|
|
|
formRules1: { |
|
|
|
|
processCode: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }], |
|
|
|
|
@ -573,11 +598,13 @@ export default { |
|
|
|
|
}, |
|
|
|
|
treeNodes: {}, //选中组织树节点信息 |
|
|
|
|
partInfoData: {}, //零件信息 |
|
|
|
|
tempId: 0, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getDetails(); |
|
|
|
|
this.getModelList(); |
|
|
|
|
this.getDetails(); |
|
|
|
|
|
|
|
|
|
this.getProcessSetList(); |
|
|
|
|
this.getCraftAbilityList(); |
|
|
|
|
this.getPqList(); |
|
|
|
|
@ -600,9 +627,10 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 工艺模板列表 |
|
|
|
|
getModelList() { |
|
|
|
|
getModelList().then(res => { |
|
|
|
|
async getModelList () { |
|
|
|
|
await getModelList().then(res => { |
|
|
|
|
this.modelOption = res.data.data; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 工序列表查询 |
|
|
|
|
@ -619,17 +647,47 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 导入模板 |
|
|
|
|
modelLevelChange() { |
|
|
|
|
getModelDetailList({ modelId: this.modelLevel }).then(res => {}); |
|
|
|
|
getModelDetailList({ modelId: this.modelLevel }).then(res => { |
|
|
|
|
// this.form1.tableData1=res.data.data; |
|
|
|
|
const templateData = res.data.data; |
|
|
|
|
const existing = [...this.form1.tableData1]; |
|
|
|
|
// 将模板中的工序数据映射为表格所需格式 |
|
|
|
|
const mappedData = templateData.map((item, index) => { |
|
|
|
|
// 如果模板中的字段和表格字段一致,可直接使用;否则需转换 |
|
|
|
|
return { |
|
|
|
|
id: null, // 新增时通常设为 null |
|
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), // 自动生成工序号 |
|
|
|
|
processCode: item.processCode || item.id, // 假设模板中有 processCode 或 id |
|
|
|
|
processName: item.processName, |
|
|
|
|
craftCode: item.craftCode, |
|
|
|
|
craftName: item.craftName, |
|
|
|
|
proDes: item.proDes || item.description, |
|
|
|
|
proHours: item.proHours || '', |
|
|
|
|
setoutHours: item.setoutHours || '', |
|
|
|
|
isMain: item.isMain || '0', |
|
|
|
|
// 其他字段按需补充... |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
// 赋值(方式1)或追加(方式2) |
|
|
|
|
this.form1.tableData1 = [...existing, ...mappedData]; // 追加模式 |
|
|
|
|
|
|
|
|
|
this.$message.success('模板导入成功'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取零件信息详情数据 |
|
|
|
|
getDetails() { |
|
|
|
|
getProcessAuthorized({ |
|
|
|
|
async getDetails() { |
|
|
|
|
await getProcessAuthorized({ |
|
|
|
|
partId: this.partId, |
|
|
|
|
taskId: this.updateRow.id, |
|
|
|
|
rank: this.rank, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = this.transformCraftTree(res.data.data); |
|
|
|
|
this.partInfoData = res.data.data.partInfo; |
|
|
|
|
if (this.partInfoData.partName == '石墨模') { |
|
|
|
|
let graphite = this.modelOption.find(item => item.name == '石墨模'); |
|
|
|
|
this.modelLevel = graphite.id; |
|
|
|
|
this.modelLevelChange(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 组织树转换 |
|
|
|
|
@ -744,41 +802,102 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 插入一行 |
|
|
|
|
addTable() { |
|
|
|
|
this.tempId++; |
|
|
|
|
if (this.activeName == '1') { |
|
|
|
|
this.form1.tableData1.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
processNo: this.getProcessNo(this.form1.tableData1), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '2') { |
|
|
|
|
this.form2.tableData2.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form2.tableData2), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '3') { |
|
|
|
|
this.form3.tableData3.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form3.tableData3), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '4') { |
|
|
|
|
this.form4.tableData4.push({ |
|
|
|
|
_tempId: this.tempId, // 临时唯一标识 |
|
|
|
|
id: null, |
|
|
|
|
trialNo: this.getProcessNo(this.form4.tableData4), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange1(val) { |
|
|
|
|
this.form1.selectIds = val.map(row => row.id || row._tempId); |
|
|
|
|
this.form1.deleteIds = val |
|
|
|
|
.filter(row => row.id != null && row.id !== '') // 排除新增行(id 为 null 或空) |
|
|
|
|
.map(row => row.id); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange2(val) { |
|
|
|
|
this.form2.selectIds = val.map(row => row.id || row._tempId); |
|
|
|
|
this.form2.deleteIds = val.filter(row => row.id != null).map(row => row.id); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange3(val) { |
|
|
|
|
this.form3.selectIds = val.map(row => row.id || row._tempId); |
|
|
|
|
this.form3.deleteIds = val.filter(row => row.id != null).map(row => row.id); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange4(val) { |
|
|
|
|
this.form4.selectIds = val.map(row => row.id || row._tempId); |
|
|
|
|
this.form4.deleteIds = val.filter(row => row.id != null).map(row => row.id); |
|
|
|
|
}, |
|
|
|
|
// 删除选择行 |
|
|
|
|
delTable() { |
|
|
|
|
if (this.activeName == '1') { |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '2') { |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '3') { |
|
|
|
|
} |
|
|
|
|
if (this.activeName == '4') { |
|
|
|
|
const active = this.activeName; |
|
|
|
|
let message = '请至少选择一条数据进行删除'; |
|
|
|
|
|
|
|
|
|
if (active === '1') { |
|
|
|
|
if (this.form1.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form1.tableData1 = this.form1.tableData1.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form1.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form1.selectIds = []; // 清空选中 |
|
|
|
|
} else if (active === '2') { |
|
|
|
|
if (this.form2.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form2.tableData2 = this.form2.tableData2.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form2.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form2.selectIds = []; |
|
|
|
|
} else if (active === '3') { |
|
|
|
|
if (this.form3.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form3.tableData3 = this.form3.tableData3.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form3.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form3.selectIds = []; |
|
|
|
|
} else if (active === '4') { |
|
|
|
|
if (this.form4.selectIds.length === 0) { |
|
|
|
|
this.$message.warning(message); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.form4.tableData4 = this.form4.tableData4.filter(row => { |
|
|
|
|
const key = row.id || row._tempId; |
|
|
|
|
return !this.form4.selectIds.includes(key); |
|
|
|
|
}); |
|
|
|
|
this.form4.selectIds = []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
}, |
|
|
|
|
checkingProNo(table) { |
|
|
|
|
// 验证工序号是否重复 |
|
|
|
|
@ -798,7 +917,7 @@ export default { |
|
|
|
|
saveInfo() { |
|
|
|
|
if (this.activeName == '1') { |
|
|
|
|
// 调用单个 Form 的校验方法 |
|
|
|
|
this.$refs.tableForm1.validate(async(isValid, invalidFields) => { |
|
|
|
|
this.$refs.tableForm1.validate(async (isValid, invalidFields) => { |
|
|
|
|
if (isValid) { |
|
|
|
|
if (Object.keys(this.treeNodes).length == 0) { |
|
|
|
|
return this.$message.warning('请先选择左侧组织树数据'); |
|
|
|
|
@ -815,7 +934,7 @@ export default { |
|
|
|
|
}); |
|
|
|
|
// 验证主工序 是否设置 |
|
|
|
|
let noMainPro = false; |
|
|
|
|
const arr = []; |
|
|
|
|
const arr = []; |
|
|
|
|
const pidList = []; |
|
|
|
|
const tableData = this.form1.tableData1; |
|
|
|
|
tableData.forEach(item => { |
|
|
|
|
@ -835,18 +954,18 @@ export default { |
|
|
|
|
return this.$message.warning('涂色标的工时定额必须大于0,请修改!'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const res = await getPartDetail(this.partId) |
|
|
|
|
console.log(res) |
|
|
|
|
let dsCraftMold = res.data.data.dsPartEntity |
|
|
|
|
const res = await getPartDetail(this.partId); |
|
|
|
|
console.log(res); |
|
|
|
|
let dsCraftMold = res.data.data.dsPartEntity; |
|
|
|
|
|
|
|
|
|
if (dsCraftMold.markingsTest=='1') { |
|
|
|
|
if (dsCraftMold.markingsTest == '1') { |
|
|
|
|
if (!arr.includes('涂色标')) { |
|
|
|
|
return this.$message.warning('该工艺包含的工序必须包含涂色标'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 验证热处理工序是否存在 |
|
|
|
|
if (dsCraftMold.hardness =='1') { |
|
|
|
|
if (dsCraftMold.hardness == '1') { |
|
|
|
|
if (!arr.includes('热处理检验')) { |
|
|
|
|
this.$message({ |
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
@ -858,7 +977,7 @@ export default { |
|
|
|
|
'</strong>', |
|
|
|
|
showClose: true, |
|
|
|
|
duration: 7000, |
|
|
|
|
type: 'warning' |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$message({ |
|
|
|
|
@ -871,16 +990,13 @@ export default { |
|
|
|
|
'</strong>', |
|
|
|
|
showClose: true, |
|
|
|
|
duration: 7000, |
|
|
|
|
type: 'success' |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 验证镀种存在 SB 判断工序是否存在喷砂 |
|
|
|
|
if ( |
|
|
|
|
dsCraftMold.plate != null && |
|
|
|
|
dsCraftMold.plate.indexOf('SB') != -1 |
|
|
|
|
) { |
|
|
|
|
if (dsCraftMold.plate != null && dsCraftMold.plate.indexOf('SB') != -1) { |
|
|
|
|
if (!arr.includes('喷砂')) { |
|
|
|
|
this.$message({ |
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
@ -892,25 +1008,22 @@ export default { |
|
|
|
|
'</strong>', |
|
|
|
|
showClose: true, |
|
|
|
|
duration: 7000, |
|
|
|
|
type: 'warning' |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 判断镀种中是否包含 不钝化 |
|
|
|
|
if ( |
|
|
|
|
dsCraftMold.plate != null && |
|
|
|
|
dsCraftMold.plate.indexOf('不钝化') != -1 |
|
|
|
|
) { |
|
|
|
|
if (dsCraftMold.plate != null && dsCraftMold.plate.indexOf('不钝化') != -1) { |
|
|
|
|
// 如果存在镀后检验工序 |
|
|
|
|
if (pidList.length > 0) { |
|
|
|
|
// 拿出所有镀后检验工序对应的实验项目 |
|
|
|
|
let isExist = 0; |
|
|
|
|
const res1 = await this.$ajax.post( |
|
|
|
|
'dsMatingInfo/loadMatingInfoByPidList', |
|
|
|
|
{ pidList: pidList, miType: 1 } |
|
|
|
|
); |
|
|
|
|
res1.data.forEach((item) => { |
|
|
|
|
const res1 = await this.$ajax.post('dsMatingInfo/loadMatingInfoByPidList', { |
|
|
|
|
pidList: pidList, |
|
|
|
|
miType: 1, |
|
|
|
|
}); |
|
|
|
|
res1.data.forEach(item => { |
|
|
|
|
if (item.trialItem.indexOf('可焊性') != -1) { |
|
|
|
|
// 如果其中存在可焊性实验项目 |
|
|
|
|
isExist = 1; |
|
|
|
|
@ -927,7 +1040,7 @@ export default { |
|
|
|
|
'</strong>', |
|
|
|
|
showClose: true, |
|
|
|
|
duration: 7000, |
|
|
|
|
type: 'warning' |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1002,7 +1115,7 @@ export default { |
|
|
|
|
dsPart: this.partInfoData, //零件信息 |
|
|
|
|
craft: this.treeNodes.rawData, //工艺信息 |
|
|
|
|
processList: this.form1.tableData1, //工序集合 |
|
|
|
|
deleteIds: [], //删除ids |
|
|
|
|
deleteIds: this.form1.deleteIds, //删除ids |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
authorizedAccomplish2(query_).then(res => { |
|
|
|
|
@ -1017,7 +1130,7 @@ export default { |
|
|
|
|
let query_ = { |
|
|
|
|
processEntity: this.treeNodes.rawData.processInfo, //工序 |
|
|
|
|
processProjectEntityList: this.form2.tableData2, //项目 |
|
|
|
|
deleteIds: [], //删除ids |
|
|
|
|
deleteIds: this.form2.deleteIds, //删除ids |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
saveProcessProjectSave(query_).then(res => { |
|
|
|
|
@ -1032,7 +1145,7 @@ export default { |
|
|
|
|
let query_ = { |
|
|
|
|
processEntity: this.treeNodes.rawData.processInfo, //工序 |
|
|
|
|
processMeasuringToolEntities: this.form3.tableData3, //尺寸量具 |
|
|
|
|
deleteIds: [], //删除ids |
|
|
|
|
deleteIds: this.form3.deleteIds, //删除ids |
|
|
|
|
}; |
|
|
|
|
saveProcessMeasuringTool(query_).then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
@ -1046,7 +1159,7 @@ export default { |
|
|
|
|
let query_ = { |
|
|
|
|
processEntity: this.treeNodes.rawData.processInfo, //工序 |
|
|
|
|
processMoldToolEntities: this.form4.tableData4, //尺寸量具 |
|
|
|
|
deleteIds: [], //删除ids |
|
|
|
|
deleteIds: this.form4.deleteIds, //删除ids |
|
|
|
|
}; |
|
|
|
|
saveProcessMoldTool(query_).then(res => { |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
|