|
@@ -7,7 +7,7 @@
|
|
|
custom-class="ele-dialog-form"
|
|
custom-class="ele-dialog-form"
|
|
|
:title="title"
|
|
:title="title"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
- :before-close="close"
|
|
|
|
|
|
|
+ :before-close="beforeClose"
|
|
|
:maxable="true"
|
|
:maxable="true"
|
|
|
>
|
|
>
|
|
|
<header-title title="基本信息"></header-title>
|
|
<header-title title="基本信息"></header-title>
|
|
@@ -16,6 +16,7 @@
|
|
|
:model="addForm"
|
|
:model="addForm"
|
|
|
:rules="addFormRules"
|
|
:rules="addFormRules"
|
|
|
label-width="120px"
|
|
label-width="120px"
|
|
|
|
|
+ v-loading="loading"
|
|
|
>
|
|
>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
@@ -312,11 +313,12 @@
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<template v-slot:footer>
|
|
<template v-slot:footer>
|
|
|
- <el-button @click="visible = false">取消</el-button>
|
|
|
|
|
|
|
+ <el-button :loading="butLoading" @click="beforeClose">取消</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="submit"
|
|
@click="submit"
|
|
|
:disabled="productionInfo.executeStatus != 0"
|
|
:disabled="productionInfo.executeStatus != 0"
|
|
|
|
|
+ :loading="butLoading"
|
|
|
>
|
|
>
|
|
|
派单</el-button
|
|
派单</el-button
|
|
|
>
|
|
>
|
|
@@ -369,7 +371,8 @@
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- addForm: formData,
|
|
|
|
|
|
|
+ formData,
|
|
|
|
|
+ addForm: JSON.parse(JSON.stringify(formData)),
|
|
|
uerList: [], // 审核人列表
|
|
uerList: [], // 审核人列表
|
|
|
executorList: [], // 业务人员列表
|
|
executorList: [], // 业务人员列表
|
|
|
|
|
|
|
@@ -410,8 +413,6 @@
|
|
|
{ label: '生效', value: 1 }
|
|
{ label: '生效', value: 1 }
|
|
|
],
|
|
],
|
|
|
|
|
|
|
|
- // 提交状态
|
|
|
|
|
- loading: false,
|
|
|
|
|
// 规则信息
|
|
// 规则信息
|
|
|
ruleInfo: null,
|
|
ruleInfo: null,
|
|
|
// 设备信息
|
|
// 设备信息
|
|
@@ -421,7 +422,11 @@
|
|
|
// 工艺路线
|
|
// 工艺路线
|
|
|
workOrderInfo: null,
|
|
workOrderInfo: null,
|
|
|
// 工序信息
|
|
// 工序信息
|
|
|
- produceTaskInfo: null
|
|
|
|
|
|
|
+ produceTaskInfo: null,
|
|
|
|
|
+ // 加载状态
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ // 提交状态
|
|
|
|
|
+ butLoading: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -445,7 +450,12 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- close() {
|
|
|
|
|
|
|
+ // 关闭重置数据
|
|
|
|
|
+ beforeClose() {
|
|
|
|
|
+ this.$refs.addFormRef.resetFields();
|
|
|
|
|
+ this.addForm = JSON.parse(JSON.stringify(this.formData));
|
|
|
|
|
+ this.ruleInfo = null;
|
|
|
|
|
+ this.deviceList = [];
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
},
|
|
},
|
|
|
// 初始化
|
|
// 初始化
|
|
@@ -467,26 +477,32 @@
|
|
|
},
|
|
},
|
|
|
// 已执行获取基本信息
|
|
// 已执行获取基本信息
|
|
|
async getInfo() {
|
|
async getInfo() {
|
|
|
- const { data } = await getById(this.productionInfo.eamPlanIds[0]);
|
|
|
|
|
- console.log('data 基本信息', data);
|
|
|
|
|
- // 数据回显
|
|
|
|
|
- this.$util.assignObject(this.addForm, data);
|
|
|
|
|
- // 类型转换
|
|
|
|
|
- this.addForm.urgent = this.addForm.urgent + '';
|
|
|
|
|
- this.addForm.executorId = data.executorId.split(',');
|
|
|
|
|
- // 获取部门用户列表
|
|
|
|
|
- this.getUserList({ groupId: data.groupId });
|
|
|
|
|
- this.ruleInfo = data.ruleInfo;
|
|
|
|
|
- this.ruleInfo.ruleItems = data.planDeviceList[0]?.workItems || [];
|
|
|
|
|
- this.deviceList = data.planDeviceList.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- name: item.substance.name,
|
|
|
|
|
- position: item.substance.position,
|
|
|
|
|
- id: item.substance.id,
|
|
|
|
|
- fixCode: item.substance.fixCode,
|
|
|
|
|
- codeNumber: item.substance.codeNumber
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ const { data } = await getById(this.productionInfo.eamPlanIds[0]);
|
|
|
|
|
+ console.log('data 基本信息', data);
|
|
|
|
|
+ // 数据回显
|
|
|
|
|
+ this.$util.assignObject(this.addForm, data);
|
|
|
|
|
+ // 类型转换
|
|
|
|
|
+ this.addForm.urgent = this.addForm.urgent + '';
|
|
|
|
|
+ this.addForm.executorId = data.executorId.split(',');
|
|
|
|
|
+ // 获取部门用户列表
|
|
|
|
|
+ this.getUserList({ groupId: data.groupId });
|
|
|
|
|
+ this.ruleInfo = data.ruleInfo;
|
|
|
|
|
+ this.ruleInfo.ruleItems = data.planDeviceList[0]?.workItems || [];
|
|
|
|
|
+ this.deviceList = data.planDeviceList.map((item) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ name: item.substance.name,
|
|
|
|
|
+ position: item.substance.position,
|
|
|
|
|
+ id: item.substance.id,
|
|
|
|
|
+ fixCode: item.substance.fixCode,
|
|
|
|
|
+ codeNumber: item.substance.codeNumber
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 获取规则信息 和 规则事项列表
|
|
// 获取规则信息 和 规则事项列表
|
|
|
async getRuleInfoAndList(row) {
|
|
async getRuleInfoAndList(row) {
|
|
@@ -609,6 +625,7 @@
|
|
|
console.log('this.addForm', this.addForm);
|
|
console.log('this.addForm', this.addForm);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+ this.butLoading = true;
|
|
|
let deviceInfo = this.deviceList[0] || {};
|
|
let deviceInfo = this.deviceList[0] || {};
|
|
|
|
|
|
|
|
// 请求参数
|
|
// 请求参数
|
|
@@ -649,18 +666,14 @@
|
|
|
|
|
|
|
|
await saveRuleRecord(body);
|
|
await saveRuleRecord(body);
|
|
|
this.$message.success('派单成功!');
|
|
this.$message.success('派单成功!');
|
|
|
- this.resetFormDate();
|
|
|
|
|
- this.visible = false;
|
|
|
|
|
|
|
+ this.butLoading = false;
|
|
|
|
|
+ this.beforeClose();
|
|
|
this.$emit('reload');
|
|
this.$emit('reload');
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.$message.error('派单失败!');
|
|
this.$message.error('派单失败!');
|
|
|
|
|
+ this.butLoading = false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- },
|
|
|
|
|
- // 重置表单
|
|
|
|
|
- resetFormDate() {
|
|
|
|
|
- this.$refs.addFormRef.resetFields();
|
|
|
|
|
- this.addForm = formData;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|