过程项问题修改

dev-scheduling
zhangdi 2 months ago
parent 6f8fe43e20
commit 28425174fb
  1. 9
      src/views/processManagement/components/addinPlantMaintenanceDialog.vue

@ -164,7 +164,7 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"> </el-button> <el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm" :loading="loading"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -184,6 +184,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
openShow: false, openShow: false,
wcData: [], wcData: [],
equipmentData: [], equipmentData: [],
@ -232,7 +233,8 @@ export default {
if (this.moldAddMore && this.form.tableData.length === 0) { if (this.moldAddMore && this.form.tableData.length === 0) {
this.addTable(); this.addTable();
} else { } else {
this.form.tableData = this.itemData.length > 0 ? JSON.parse(JSON.stringify(this.itemData)) : []; this.form.tableData =
this.itemData.length > 0 ? JSON.parse(JSON.stringify(this.itemData)) : [];
} }
}, },
methods: { methods: {
@ -304,6 +306,7 @@ export default {
}); });
return; return;
} }
this.loading = true;
// //
const submitData = this.form.tableData.map(row => { const submitData = this.form.tableData.map(row => {
@ -316,9 +319,11 @@ export default {
console.log('提交数据:', submitData); console.log('提交数据:', submitData);
add(submitData).then(res => { add(submitData).then(res => {
this.$message.success('操作成功'); this.$message.success('操作成功');
this.loading = false;
this.closeDialog(); this.closeDialog();
}); });
} catch (err) { } catch (err) {
this.loading = false;
this.$message.error(err.message); this.$message.error(err.message);
console.error('提交失败:', err); console.error('提交失败:', err);
} }

Loading…
Cancel
Save