695593266@qq.com 4 ay önce
ebeveyn
işleme
23379c396a

+ 70 - 5
src/views/checklistManagement/components/checkDetails.vue

@@ -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();

+ 3 - 3
src/views/produce/components/qualityInspection/components/selfInspectionReporting.vue

@@ -560,9 +560,11 @@
           const URL =
           const URL =
             this.type == 1 ? selfInspectionReport : specialInspectionReport;
             this.type == 1 ? selfInspectionReport : specialInspectionReport;
 
 
+          const text = actionType === 1 ? '提交中...' : '保存中...';
+
           const loading = this.$loading({
           const loading = this.$loading({
             lock: true,
             lock: true,
-            text: 'Loading',
+            text,
             spinner: 'el-icon-loading',
             spinner: 'el-icon-loading',
             background: 'rgba(0, 0, 0, 0.7)'
             background: 'rgba(0, 0, 0, 0.7)'
           });
           });
@@ -742,8 +744,6 @@
         };
         };
 
 
         const symbol = symbolMap[row.symbol] || row.symbol;
         const symbol = symbolMap[row.symbol] || row.symbol;
-
-        // ⭐⭐⭐ 区间判断
         if (row.textType == 3) {
         if (row.textType == 3) {
           let min = Number(row.minValue);
           let min = Number(row.minValue);
           let max = Number(row.maxValue);
           let max = Number(row.maxValue);