|
|
|
@ -79,13 +79,13 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column align="center" label="设备型号" width="150"> |
|
|
|
<!-- <el-table-column align="center" label="设备型号" width="150"> |
|
|
|
<template #default="scope"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-form-item :prop="`tableData[${scope.$index}].equipNameType`"> |
|
|
|
<el-form-item :prop="`tableData[${scope.$index}].equipNameType`"> |
|
|
|
{{ scope.row.equipNameType }} |
|
|
|
{{ scope.row.equipNameType }} |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column align="center" label="设备分类" width="150"> |
|
|
|
<el-table-column align="center" label="设备分类" width="150"> |
|
|
|
<template #header> |
|
|
|
<template #header> |
|
|
|
<span><i style="color: red">*</i>设备分类</span> |
|
|
|
<span><i style="color: red">*</i>设备分类</span> |
|
|
|
@ -112,6 +112,33 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column align="center" label="工序" width="150"> |
|
|
|
|
|
|
|
<template #header> |
|
|
|
|
|
|
|
<span><i style="color: red">*</i>工序</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
|
|
|
|
:prop="`tableData[${scope.$index}].processId`" |
|
|
|
|
|
|
|
:rules="formRules.processId" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-select |
|
|
|
|
|
|
|
v-model="scope.row.processId" |
|
|
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
filterable |
|
|
|
|
|
|
|
@change="value => onChangeData(value, scope.$index, 'processId')" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="item in processData" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:value="item.id" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" label="工艺能力" width="150"> |
|
|
|
<el-table-column align="center" label="工艺能力" width="150"> |
|
|
|
<template #header> |
|
|
|
<template #header> |
|
|
|
<span><i style="color: red">*</i>工艺能力</span> |
|
|
|
<span><i style="color: red">*</i>工艺能力</span> |
|
|
|
@ -303,6 +330,7 @@ import { |
|
|
|
getCraftAbility, |
|
|
|
getCraftAbility, |
|
|
|
addEquipAbility, |
|
|
|
addEquipAbility, |
|
|
|
updateEquipAbility, |
|
|
|
updateEquipAbility, |
|
|
|
|
|
|
|
getProcessSet, |
|
|
|
} from '@/api/productionSchedulingPlan/basic.js'; |
|
|
|
} from '@/api/productionSchedulingPlan/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
@ -366,6 +394,7 @@ export default { |
|
|
|
prepareTime: [{ required: true, message: '请输入准备工时', trigger: ['change', 'submit'] }], |
|
|
|
prepareTime: [{ required: true, message: '请输入准备工时', trigger: ['change', 'submit'] }], |
|
|
|
interval: [{ required: true, message: '请输入轮次间隔', trigger: ['change', 'submit'] }], |
|
|
|
interval: [{ required: true, message: '请输入轮次间隔', trigger: ['change', 'submit'] }], |
|
|
|
partType: [{ required: true, message: '请选择加工类型', trigger: ['change', 'submit'] }], |
|
|
|
partType: [{ required: true, message: '请选择加工类型', trigger: ['change', 'submit'] }], |
|
|
|
|
|
|
|
processId: [{ required: true, message: '请选择工序', trigger: ['change', 'submit'] }], |
|
|
|
}, |
|
|
|
}, |
|
|
|
equipTypeData: [ |
|
|
|
equipTypeData: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -378,6 +407,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
equipData: [], |
|
|
|
equipData: [], |
|
|
|
|
|
|
|
craftData: [], |
|
|
|
|
|
|
|
processData: [], //工序列表 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
@ -385,10 +416,12 @@ export default { |
|
|
|
this.getWorkCenterList(); |
|
|
|
this.getWorkCenterList(); |
|
|
|
this.getEquipment(); |
|
|
|
this.getEquipment(); |
|
|
|
this.getCraftAbility(); |
|
|
|
this.getCraftAbility(); |
|
|
|
|
|
|
|
this.getProcessSet() |
|
|
|
// 初始添加一行(可选) |
|
|
|
// 初始添加一行(可选) |
|
|
|
if (this.title == '新增') { |
|
|
|
if (this.title == '新增') { |
|
|
|
this.addTable(); |
|
|
|
this.addTable(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
console.log('rowData', this.rowData); |
|
|
|
this.form.tableData = this.rowData; |
|
|
|
this.form.tableData = this.rowData; |
|
|
|
} |
|
|
|
} |
|
|
|
this.calcTableHeight(); |
|
|
|
this.calcTableHeight(); |
|
|
|
@ -457,18 +490,22 @@ export default { |
|
|
|
this.craftData = res.data.data; |
|
|
|
this.craftData = res.data.data; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取工序列表 |
|
|
|
|
|
|
|
getProcessSet() { |
|
|
|
|
|
|
|
getProcessSet().then(res => { |
|
|
|
|
|
|
|
this.processData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取设备列表 |
|
|
|
// 获取设备列表 |
|
|
|
getEquipment() { |
|
|
|
getEquipment() { |
|
|
|
getEquipment().then(res => { |
|
|
|
getEquipment().then(res => { |
|
|
|
this.equipData = res.data.data; |
|
|
|
this.equipData = res.data.data; |
|
|
|
console.log(res.data.data, 'data'); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取表格高度 |
|
|
|
// 获取表格高度 |
|
|
|
calcTableHeight() { |
|
|
|
calcTableHeight() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
const container = document.querySelector('.el-dialog__body'); |
|
|
|
const container = document.querySelector('.el-dialog__body'); |
|
|
|
console.log(container.offsetHeight); |
|
|
|
|
|
|
|
this.tableHeight = container.offsetHeight - 36 - 90 - 30; |
|
|
|
this.tableHeight = container.offsetHeight - 36 - 90 - 30; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -480,7 +517,6 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 作业中心 |
|
|
|
// 作业中心 |
|
|
|
onChangeData(value, index, type) { |
|
|
|
onChangeData(value, index, type) { |
|
|
|
console.log(value, index, type); |
|
|
|
|
|
|
|
if (type == 'workCenterId') { |
|
|
|
if (type == 'workCenterId') { |
|
|
|
// this.form.workCenterName = val.wcCode; |
|
|
|
// this.form.workCenterName = val.wcCode; |
|
|
|
const selectedItem = this.wcData.find(item => item.id === value); |
|
|
|
const selectedItem = this.wcData.find(item => item.id === value); |
|
|
|
@ -507,6 +543,14 @@ export default { |
|
|
|
this.form.tableData[index].craftName = ''; |
|
|
|
this.form.tableData[index].craftName = ''; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (type == 'processId') { |
|
|
|
|
|
|
|
const selectedItem = this.processData.find(item => item.id === value); |
|
|
|
|
|
|
|
if (selectedItem) { |
|
|
|
|
|
|
|
this.form.tableData[index].processName = selectedItem.name; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.form.tableData[index].processName = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onPartTypeChange(index) { |
|
|
|
onPartTypeChange(index) { |
|
|
|
const row = this.form.tableData[index]; |
|
|
|
const row = this.form.tableData[index]; |
|
|
|
@ -637,7 +681,6 @@ export default { |
|
|
|
this.$message.success('提交成功'); |
|
|
|
this.$message.success('提交成功'); |
|
|
|
this.closeDialog(); |
|
|
|
this.closeDialog(); |
|
|
|
this.$emit('submitSuccess', submitData); |
|
|
|
this.$emit('submitSuccess', submitData); |
|
|
|
done(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
error => { |
|
|
|
error => { |
|
|
|
this.subLoading = false; |
|
|
|
this.subLoading = false; |
|
|
|
@ -651,7 +694,6 @@ export default { |
|
|
|
this.closeDialog(); |
|
|
|
this.closeDialog(); |
|
|
|
this.$emit('submitSuccess', submitData); |
|
|
|
this.$emit('submitSuccess', submitData); |
|
|
|
this.subLoading = false; |
|
|
|
this.subLoading = false; |
|
|
|
done(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
error => { |
|
|
|
error => { |
|
|
|
window.console.log(error); |
|
|
|
window.console.log(error); |
|
|
|
|