Przeglądaj źródła

修改提交名字

yuhongqi 6 dni temu
rodzic
commit
149971375e

+ 9 - 2
src/views/live/components/productOrder.vue

@@ -795,14 +795,19 @@ export default {
     submitEditDyForm() {
       this.$refs["editDyForm"].validate(valid => {
         if (valid) {
-          // 如果没有id就表明是添加物流信息
-          updateDeliveryId(this.editDyForm).then(response => {
+          const payload = { ...this.editDyForm };
+          if (!payload.deliverName) {
+            const selectedOption = this.deliveryOptions.find(option => option.value === payload.deliverSn);
+            payload.deliverName = selectedOption ? selectedOption.label : null;
+          }
+          updateDeliveryId(payload).then(response => {
             if (response.code === 200) {
               this.msgSuccess("操作成功");
               this.editDy.open = false;
               this.getOrder(this.order.orderId);
             }
           }).finally(() => {
+            this.editDyForm.id = null;
             this.editDyForm.deliverSn = null;
             this.editDyForm.deliverId = null;
             this.editDyForm.deliverName = null;
@@ -934,7 +939,9 @@ export default {
         this.editDyForm.id = scope.row.id;
         this.editDyForm.deliverId = scope.row.deliverId;
         this.editDyForm.deliverSn = scope.row.deliverSn;
+        this.editDyForm.deliverName = scope.row.deliverName;
       } else {
+        this.editDyForm.id = null;
         this.editDyForm.deliverSn = null;
         this.editDyForm.deliverId = null;
         this.editDyForm.deliverName = null;

+ 11 - 0
src/views/live/liveOrder/liveOrderDetails.vue

@@ -466,6 +466,13 @@ export default {
         userId:null,
         followDoctorId:null,
       },
+      deliveryOptions: [
+        {key: "SF", label: "顺丰", value: "SF"},
+        {key: "EMS", label: "邮政", value: "EMS"},
+        {key: "ZTO", label: "中通", value: "ZTO"},
+        {key: "JD", label: "京东", value: "JD"},
+        {key: "DBL", label: "德邦", value: "DBL"}
+      ],
       editDyForm:{
         id: null,
         orderId: null,
@@ -1063,6 +1070,10 @@ export default {
           if (this.editDyForm.id != null) {
             params.id = this.editDyForm.id;
           }
+          if (!params.deliverName) {
+            const selectedOption = this.deliveryOptions.find(option => option.value === params.deliverSn);
+            params.deliverName = selectedOption ? selectedOption.label : null;
+          }
           editDeliveryId(params).then(response => {
             if (response.code === 200) {
               this.msgSuccess("操作成功");