|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<el-dialog title="新增" append-to-body :modelValue="openShow" width="80%" @close="closeDialog"> |
|
|
|
|
<el-dialog :title="title" append-to-body :modelValue="openShow" width="80%" @close="closeDialog"> |
|
|
|
|
<div style="margin-bottom: 12px" v-if="moldAddMore"> |
|
|
|
|
<el-button type="primary" @click="addTable">插入一行</el-button> |
|
|
|
|
<el-button type="danger" @click="delTable">删除选中行</el-button> |
|
|
|
|
@ -172,7 +172,7 @@ |
|
|
|
|
<script> |
|
|
|
|
import { getWorkCenterList } from '@/api/processManagement/addQuantity.js'; |
|
|
|
|
// import { submitBatchData } from '@/api/processManagement/periodical.js'; // 实际提交接口 |
|
|
|
|
import { getEquipmentList, add } from '@/api/processManagement/specialProcess'; |
|
|
|
|
import { getEquipmentList, add,update } from '@/api/processManagement/specialProcess'; |
|
|
|
|
import { getRoleUserList } from '@/api/processManagement/taskDispatch'; |
|
|
|
|
export default { |
|
|
|
|
props: { |
|
|
|
|
@ -180,13 +180,14 @@ export default { |
|
|
|
|
moldAddMore: { type: Boolean, default: false }, |
|
|
|
|
tabPosition: { type: String, default: '' }, |
|
|
|
|
itemData: { type: Array, default: () => [] }, |
|
|
|
|
title: { type: String, default: '' }, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: false, |
|
|
|
|
openShow: false, |
|
|
|
|
wcData: [], |
|
|
|
|
userData:[], |
|
|
|
|
userData: [], |
|
|
|
|
equipmentData: [], |
|
|
|
|
formError: '', // 全局错误提示 |
|
|
|
|
|
|
|
|
|
@ -236,12 +237,12 @@ export default { |
|
|
|
|
console.log('this.itemData', this.itemData); |
|
|
|
|
this.form.tableData = |
|
|
|
|
this.itemData.length > 0 ? JSON.parse(JSON.stringify(this.itemData)) : []; |
|
|
|
|
if(this.form.tableData.length > 0){ |
|
|
|
|
if (this.form.tableData.length > 0) { |
|
|
|
|
this.form.tableData.forEach(item => { |
|
|
|
|
item.lastDueTime = item.lastDueTime+' 00:00:00' |
|
|
|
|
}) |
|
|
|
|
item.lastDueTime = item.lastDueTime + ' 00:00:00'; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.workCenterChange() |
|
|
|
|
this.workCenterChange(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
@ -324,11 +325,19 @@ export default { |
|
|
|
|
// 调用接口提交(实际项目替换) |
|
|
|
|
try { |
|
|
|
|
console.log('提交数据:', submitData); |
|
|
|
|
if (this.title == '新增') { |
|
|
|
|
add(submitData).then(res => { |
|
|
|
|
this.$message.success('操作成功'); |
|
|
|
|
this.loading = false; |
|
|
|
|
this.closeDialog(); |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
update(submitData[0]).then(res => { |
|
|
|
|
this.$message.success('操作成功'); |
|
|
|
|
this.loading = false; |
|
|
|
|
this.closeDialog(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} catch (err) { |
|
|
|
|
this.loading = false; |
|
|
|
|
this.$message.error(err.message); |
|
|
|
|
|