Explorar o código

修改确认收货需要重新填写单号的问题

YY %!s(int64=2) %!d(string=hai) anos
pai
achega
f59871b754

+ 24 - 7
src/views/platmanag/order/parts/detail/parts/card-2.vue

@@ -78,7 +78,7 @@
                   <el-button type="primary" @click="onSubmit('form', '2-')" v-if="(form.status == '1' || form.status == '2-') && status == '1'">
                     添加保存
                   </el-button>
-                  <el-button type="primary" @click="onSubmit('form', '3')" v-if="form.status == '2'"> 确认收货 </el-button>
+                  <el-button type="primary" @click="onConfirm('3')" v-if="form.status == '2'"> 确认收货 </el-button>
                   <el-button type="primary" @click="onSubmit('form', '2')" v-if="form.status == '2'"> 保存 </el-button>
                 </el-col>
               </el-form-item>
@@ -268,7 +268,8 @@ export default {
         let form = this.form;
         let newList = list.filter((i) => i.id != data.id);
         form.transport = newList;
-        this.$set(this, `transport`, newList);
+        // this.transport = newList;
+        // this.$set(this, `transport`, newList);
         let res;
         if (form.id) res = await this.update(form);
         if (this.$checkRes(res)) {
@@ -277,6 +278,22 @@ export default {
         }
       });
     },
+    async onConfirm(val) {
+      this.$confirm('是否确认收货', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        var form = this.form;
+        var res;
+        form.status = val;
+        if (form.id) res = await this.update(form);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `维护信息成功` });
+          this.search();
+        }
+      });
+    },
     // 提交
     async onSubmit(formName, val) {
       this.$refs[formName].validate(async (valid) => {
@@ -306,11 +323,11 @@ export default {
             }
             var res;
             if (val != undefined || val != '') {
-              // if (this.goodsList.length == 0) {
-              //   form.status = '2';
-              // } else {
-              form.status = val;
-              // }
+              if (this.goodsList.length == 0) {
+                form.status = '2';
+              } else {
+                form.status = val;
+              }
             }
             if (form.id) res = await this.update(form);
             if (this.$checkRes(res)) {

+ 24 - 7
src/views/selfShop/order/parts/detail/parts/card-2.vue

@@ -78,7 +78,7 @@
                   <el-button type="primary" @click="onSubmit('form', '2-')" v-if="(form.status == '1' || form.status == '2-') && status == '1'">
                     添加保存
                   </el-button>
-                  <el-button type="primary" @click="onSubmit('form', '3')" v-if="form.status == '2'"> 确认收货 </el-button>
+                  <el-button type="primary" @click="onConfirm('3')" v-if="form.status == '2'"> 确认收货 </el-button>
                   <el-button type="primary" @click="onSubmit('form', '2')" v-if="form.status == '2'"> 保存 </el-button>
                 </el-col>
               </el-form-item>
@@ -268,7 +268,8 @@ export default {
         let form = this.form;
         let newList = list.filter((i) => i.id != data.id);
         form.transport = newList;
-        this.$set(this, `transport`, newList);
+        // this.transport = newList;
+        // this.$set(this, `transport`, newList);
         let res;
         if (form.id) res = await this.update(form);
         if (this.$checkRes(res)) {
@@ -277,6 +278,22 @@ export default {
         }
       });
     },
+    async onConfirm(val) {
+      this.$confirm('是否确认收货', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        var form = this.form;
+        var res;
+        form.status = val;
+        if (form.id) res = await this.update(form);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `维护信息成功` });
+          this.search();
+        }
+      });
+    },
     // 提交
     async onSubmit(formName, val) {
       this.$refs[formName].validate(async (valid) => {
@@ -306,11 +323,11 @@ export default {
             }
             var res;
             if (val != undefined || val != '') {
-              // if (this.goodsList.length == 0) {
-              //   form.status = '2';
-              // } else {
-              form.status = val;
-              // }
+              if (this.goodsList.length == 0) {
+                form.status = '2';
+              } else {
+                form.status = val;
+              }
             }
             if (form.id) res = await this.update(form);
             if (this.$checkRes(res)) {