chris 2 tahun lalu
induk
melakukan
3e0b67fad8

+ 34 - 17
src/views/modules/check/ibc-add-or-update.vue

@@ -222,25 +222,42 @@
               return
             }
             this.dataForm.qualityInspectionItemsList = this.checkItems
-            this.$http({
-              url: !this.id ? this.$http.adornUrl(`/biz-service/incomingInspection/save`) : this.$http.adornUrl(`/biz-service/incomingInspection/update`),
-              method: 'post',
-              data: this.$http.adornData(this.dataForm)
-            }).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success',
-                  duration: 1500,
-                  onClose: () => {
-                    this.onChose()
-                    this.$emit('refreshDataList')
-                  }
-                })
-              } else {
-                this.$message.error(data.msg)
+            if (this.dataForm.qualifiedCnt && this.dataForm.qualifiedCnt > 0) {
+              this.submitDataFrom()
+            } else {
+              this.$confirm('该入库的合格数量为0,请确认操作!', '提示', {
+                iconClass: 'el-icon-question', // 自定义图标样式
+                confirmButtonText: '确认', // 确认按钮文字更换
+                cancelButtonText: '取消', // 取消按钮文字更换
+                showClose: true, // 是否显示右上角关闭按钮
+                type: 'warning' // 提示类型  success/info/warning/error
+              }).then(
+                () => {
+                  this.submitDataFrom()
+                }
+              )
+            }
+          }
+        })
+      },
+      submitDataFrom () {
+        this.$http({
+          url: !this.id ? this.$http.adornUrl(`/biz-service/incomingInspection/save`) : this.$http.adornUrl(`/biz-service/incomingInspection/update`),
+          method: 'post',
+          data: this.$http.adornData(this.dataForm)
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              message: '操作成功',
+              type: 'success',
+              duration: 1500,
+              onClose: () => {
+                this.onChose()
+                this.$emit('refreshDataList')
               }
             })
+          } else {
+            this.$message.error(data.msg)
           }
         })
       },

+ 1 - 1
src/views/modules/check/ibc-check-chose.vue

@@ -29,7 +29,7 @@
           </el-form-item>
         </el-row>
       </el-form>
-      <span slot="footer" class="dialog-footer">
+      <span slot="footer">
         <el-button @click="visible = false">取消</el-button>
         <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
       </span>