|
@@ -2,6 +2,7 @@
|
|
|
<ele-modal
|
|
<ele-modal
|
|
|
:title="title"
|
|
:title="title"
|
|
|
:visible.sync="visible"
|
|
:visible.sync="visible"
|
|
|
|
|
+ v-if="visible"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
@close="handleClose"
|
|
@close="handleClose"
|
|
|
resizable
|
|
resizable
|
|
@@ -568,8 +569,61 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 提交
|
|
// 提交
|
|
|
|
|
+ // submit(type) {
|
|
|
|
|
+ // console.log('this.form', this.form);
|
|
|
|
|
+ // this.$refs.formRef.validate(async (valid, invalidFields) => {
|
|
|
|
|
+ // if (valid) {
|
|
|
|
|
+ // // 必须要有物品清单
|
|
|
|
|
+ // if (this.form.orders.length == 0) {
|
|
|
|
|
+ // this.$message.warning('请添加物品清单');
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // this.butLoading = true;
|
|
|
|
|
+ // try {
|
|
|
|
|
+ // if (type == 'save') {
|
|
|
|
|
+ // // 存在id 则更新
|
|
|
|
|
+ // if (this.form.id) {
|
|
|
|
|
+ // await checklistrecordUpdate(this.form);
|
|
|
|
|
+ // this.$message.success('操作成功,已保存到放行单列表');
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.form.createUserName = this.$store.state.user.info.name;
|
|
|
|
|
+ // const data = await checklistrecordSave(this.form);
|
|
|
|
|
+ // this.$message.success('操作成功,已保存到放行单列表');
|
|
|
|
|
+ // this.form.id = data;
|
|
|
|
|
+ // this.getCheckDetails(this.form.id);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // // submit 保存并提交审核
|
|
|
|
|
+ // // 存在id 则更新
|
|
|
|
|
+ // if (this.form.id) {
|
|
|
|
|
+ // await checklistrecordUpdate(this.form);
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.form.createUserName = this.$store.state.user.info.name;
|
|
|
|
|
+ // const data = await checklistrecordSave(this.form);
|
|
|
|
|
+ // this.form.id = data;
|
|
|
|
|
+ // await this.getCheckDetails(this.form.id);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.openApproval();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.butLoading = false;
|
|
|
|
|
+ // this.$emit('reload');
|
|
|
|
|
+ // } catch (error) {
|
|
|
|
|
+ // this.butLoading = false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // // 转换为数组
|
|
|
|
|
+ // const firstErrorField = Object.values(invalidFields);
|
|
|
|
|
+ // if (firstErrorField.length > 0) {
|
|
|
|
|
+ // this.$message.warning(firstErrorField[0][0].message);
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
submit(type) {
|
|
submit(type) {
|
|
|
- console.log('this.form', this.form);
|
|
|
|
|
this.$refs.formRef.validate(async (valid, invalidFields) => {
|
|
this.$refs.formRef.validate(async (valid, invalidFields) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
// 必须要有物品清单
|
|
// 必须要有物品清单
|
|
@@ -579,6 +633,16 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.butLoading = true;
|
|
this.butLoading = true;
|
|
|
|
|
+
|
|
|
|
|
+ const text = type == 'save' ? '保存中...' : '提交中...';
|
|
|
|
|
+
|
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text,
|
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
if (type == 'save') {
|
|
if (type == 'save') {
|
|
|
// 存在id 则更新
|
|
// 存在id 则更新
|
|
@@ -593,8 +657,6 @@
|
|
|
this.getCheckDetails(this.form.id);
|
|
this.getCheckDetails(this.form.id);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- // submit 保存并提交审核
|
|
|
|
|
- // 存在id 则更新
|
|
|
|
|
if (this.form.id) {
|
|
if (this.form.id) {
|
|
|
await checklistrecordUpdate(this.form);
|
|
await checklistrecordUpdate(this.form);
|
|
|
} else {
|
|
} else {
|
|
@@ -605,10 +667,13 @@
|
|
|
}
|
|
}
|
|
|
this.openApproval();
|
|
this.openApproval();
|
|
|
}
|
|
}
|
|
|
- this.butLoading = false;
|
|
|
|
|
|
|
+ // this.visible = false;
|
|
|
this.$emit('reload');
|
|
this.$emit('reload');
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ } finally {
|
|
|
this.butLoading = false;
|
|
this.butLoading = false;
|
|
|
|
|
+ loading.close();
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// 转换为数组
|
|
// 转换为数组
|
|
@@ -616,11 +681,11 @@
|
|
|
if (firstErrorField.length > 0) {
|
|
if (firstErrorField.length > 0) {
|
|
|
this.$message.warning(firstErrorField[0][0].message);
|
|
this.$message.warning(firstErrorField[0][0].message);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
// 选择生产工单
|
|
// 选择生产工单
|
|
|
openAddModel() {
|
|
openAddModel() {
|
|
|
this.$refs.selectWorkOrderRef?.open();
|
|
this.$refs.selectWorkOrderRef?.open();
|