Browse Source

修改订单维护快递信息

YY 2 năm trước cách đây
mục cha
commit
cd76637ad4

+ 30 - 29
src/views/platmanag/order/parts/detail/parts/card-2.vue

@@ -3,7 +3,8 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="9" class="one">
-          <el-col :span="24">
+          <!-- 快递列表 -->
+          <el-col :span="24" v-if="form.transport_type == '0'">
             <el-col v-for="(item, index) in transport" :key="index" class="transport">
               <el-col v-for="(good, index) in item.goods" :key="index">
                 <el-col :span="24" class="bode">
@@ -25,17 +26,17 @@
               </el-col>
               <el-col :span="24" style="text-align: center">
                 <el-button type="danger" @click="toDel(item)"> 删除 </el-button>
+                <!-- <el-button type="success" @click="toExpre(item)"> 修改快递信息 </el-button> -->
                 <el-button type="primary" @click="toLog(item)"> 查看物流 </el-button>
               </el-col>
             </el-col>
           </el-col>
+          <!-- 添加修改快递信息 -->
           <el-col v-if="form.status == '1' || form.status == '2-'">
             <el-radio-group v-model="status" @change="onstatus">
               <el-radio :label="0" border>全部发货</el-radio>
               <el-radio :label="1" border>部分发货</el-radio>
             </el-radio-group>
-            <!-- <el-button type="primary" @click="onstatus('0')"> 全部发货 </el-button>
-            <el-button type="primary" @click="onstatus('1')"> 部分发货 </el-button> -->
           </el-col>
           <el-col :span="24" v-if="status == '1' && form.transport_type == '0'">
             <el-col>发货商品</el-col>
@@ -85,12 +86,10 @@
             </el-form>
           </el-col>
         </el-col>
+        <!-- 物流信息 -->
         <el-col :span="9" class="one" v-if="form.transport_type == '0' && logList.length != 0">
           <el-col :span="24">{{ activit.is_check || '暂无快递信息' }}</el-col>
           <el-col :span="24">{{ shop.shop_transport_name || '暂无快递信息' }}: {{ activit.no || '暂无快递信息' }}</el-col>
-          <!-- <el-col :span="24">
-            <p>订单编号: {{ form.id }}</p>
-          </el-col> -->
           <el-col :span="24">
             <p>收货地址:{{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }}</p>
           </el-col>
@@ -153,7 +152,7 @@ export default {
     return {
       activit: {},
       logList: [],
-      status: '0',
+      status: 0,
       // 物流
       reverse: false,
       loading: false,
@@ -220,11 +219,6 @@ export default {
       }
       this.toClose();
     },
-    // 删除
-    toDelete({ data }) {
-      let newList = this.goodsList.filter((i) => i.id != data.id);
-      this.$set(this, `goodsList`, newList);
-    },
     onstatus(status) {
       this.status = status;
     },
@@ -242,6 +236,26 @@ export default {
       let name = goods.name + ',' + goods.goods.name;
       return name;
     },
+    // 删除
+    toDelete({ data }) {
+      let newList = this.goodsList.filter((i) => i.id != data.id);
+      this.$set(this, `goodsList`, newList);
+    },
+    // 发货最大数量
+    toNum(val) {
+      if (val > this.buy_num) {
+        this.$message.error('超过发货最大数量');
+        this.$set(this.form, `num`, '');
+      }
+    },
+    // 修改快递信息
+    // toExpre(data) {
+    //   this.$set(this.form, `shop_transport_no`, data.shop_transport_no);
+    //   this.querySearch(data.shop_transport_type);
+    //   this.$set(this.form, `shop_transport_type`, data.shop_transport_type);
+    //   if (data.goods) this.$set(this, `status`, 1);
+    //   this.$set(this, `goodsList`, data.goods);
+    // },
     // 查看物流
     toLog(value) {
       this.$set(this, `shop`, value);
@@ -252,14 +266,7 @@ export default {
         this.$set(this, `activit`, info);
       }
     },
-
-    // 发货最大数量
-    toNum(val) {
-      if (val > this.buy_num) {
-        this.$message.error('超过发货最大数量');
-        this.$set(this.form, `num`, '');
-      }
-    },
+    // 删除快递信息
     toDel(data) {
       this.$confirm('是否确认删除', '提示', {
         confirmButtonText: '确定',
@@ -270,8 +277,6 @@ export default {
         let form = this.form;
         let newList = list.filter((i) => i.id != data.id);
         form.transport = newList;
-        // this.transport = newList;
-        // this.$set(this, `transport`, newList);
         let res;
         if (form.id) res = await this.update(form);
         if (this.$checkRes(res)) {
@@ -322,14 +327,11 @@ export default {
                 transport.push({ shop_transport_no, shop_transport_type });
                 form.transport = transport;
               }
-            }
+            } else if (form.transport_type == '1' && form.transport) delete form.transport;
             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)) {
@@ -384,7 +386,6 @@ export default {
     .transport {
       margin: 50px;
       padding: 5px;
-      // margin: 0 0 0 40px;
       border: 1px solid rgb(254, 195, 195);
     }
     .other {

+ 30 - 29
src/views/selfShop/order/parts/detail/parts/card-2.vue

@@ -3,7 +3,8 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="9" class="one">
-          <el-col :span="24">
+          <!-- 快递列表 -->
+          <el-col :span="24" v-if="form.transport_type == '0'">
             <el-col v-for="(item, index) in transport" :key="index" class="transport">
               <el-col v-for="(good, index) in item.goods" :key="index">
                 <el-col :span="24" class="bode">
@@ -25,17 +26,17 @@
               </el-col>
               <el-col :span="24" style="text-align: center">
                 <el-button type="danger" @click="toDel(item)"> 删除 </el-button>
+                <!-- <el-button type="success" @click="toExpre(item)"> 修改快递信息 </el-button> -->
                 <el-button type="primary" @click="toLog(item)"> 查看物流 </el-button>
               </el-col>
             </el-col>
           </el-col>
+          <!-- 添加修改快递信息 -->
           <el-col v-if="form.status == '1' || form.status == '2-'">
             <el-radio-group v-model="status" @change="onstatus">
               <el-radio :label="0" border>全部发货</el-radio>
               <el-radio :label="1" border>部分发货</el-radio>
             </el-radio-group>
-            <!-- <el-button type="primary" @click="onstatus('0')"> 全部发货 </el-button>
-            <el-button type="primary" @click="onstatus('1')"> 部分发货 </el-button> -->
           </el-col>
           <el-col :span="24" v-if="status == '1' && form.transport_type == '0'">
             <el-col>发货商品</el-col>
@@ -85,12 +86,10 @@
             </el-form>
           </el-col>
         </el-col>
+        <!-- 物流信息 -->
         <el-col :span="9" class="one" v-if="form.transport_type == '0' && logList.length != 0">
           <el-col :span="24">{{ activit.is_check || '暂无快递信息' }}</el-col>
           <el-col :span="24">{{ shop.shop_transport_name || '暂无快递信息' }}: {{ activit.no || '暂无快递信息' }}</el-col>
-          <!-- <el-col :span="24">
-            <p>订单编号: {{ form.id }}</p>
-          </el-col> -->
           <el-col :span="24">
             <p>收货地址:{{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }}</p>
           </el-col>
@@ -153,7 +152,7 @@ export default {
     return {
       activit: {},
       logList: [],
-      status: '0',
+      status: 0,
       // 物流
       reverse: false,
       loading: false,
@@ -220,11 +219,6 @@ export default {
       }
       this.toClose();
     },
-    // 删除
-    toDelete({ data }) {
-      let newList = this.goodsList.filter((i) => i.id != data.id);
-      this.$set(this, `goodsList`, newList);
-    },
     onstatus(status) {
       this.status = status;
     },
@@ -242,6 +236,26 @@ export default {
       let name = goods.name + ',' + goods.goods.name;
       return name;
     },
+    // 删除
+    toDelete({ data }) {
+      let newList = this.goodsList.filter((i) => i.id != data.id);
+      this.$set(this, `goodsList`, newList);
+    },
+    // 发货最大数量
+    toNum(val) {
+      if (val > this.buy_num) {
+        this.$message.error('超过发货最大数量');
+        this.$set(this.form, `num`, '');
+      }
+    },
+    // 修改快递信息
+    // toExpre(data) {
+    //   this.$set(this.form, `shop_transport_no`, data.shop_transport_no);
+    //   this.querySearch(data.shop_transport_type);
+    //   this.$set(this.form, `shop_transport_type`, data.shop_transport_type);
+    //   if (data.goods) this.$set(this, `status`, 1);
+    //   this.$set(this, `goodsList`, data.goods);
+    // },
     // 查看物流
     toLog(value) {
       this.$set(this, `shop`, value);
@@ -252,14 +266,7 @@ export default {
         this.$set(this, `activit`, info);
       }
     },
-
-    // 发货最大数量
-    toNum(val) {
-      if (val > this.buy_num) {
-        this.$message.error('超过发货最大数量');
-        this.$set(this.form, `num`, '');
-      }
-    },
+    // 删除快递信息
     toDel(data) {
       this.$confirm('是否确认删除', '提示', {
         confirmButtonText: '确定',
@@ -270,8 +277,6 @@ export default {
         let form = this.form;
         let newList = list.filter((i) => i.id != data.id);
         form.transport = newList;
-        // this.transport = newList;
-        // this.$set(this, `transport`, newList);
         let res;
         if (form.id) res = await this.update(form);
         if (this.$checkRes(res)) {
@@ -322,14 +327,11 @@ export default {
                 transport.push({ shop_transport_no, shop_transport_type });
                 form.transport = transport;
               }
-            }
+            } else if (form.transport_type == '1' && form.transport) delete form.transport;
             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)) {
@@ -384,7 +386,6 @@ export default {
     .transport {
       margin: 50px;
       padding: 5px;
-      // margin: 0 0 0 40px;
       border: 1px solid rgb(254, 195, 195);
     }
     .other {