yjwang пре 2 недеља
родитељ
комит
46621b5cbe
1 измењених фајлова са 45 додато и 5 уклоњено
  1. 45 5
      src/views/hisStore/components/productAfterSalesOrder.vue

+ 45 - 5
src/views/hisStore/components/productAfterSalesOrder.vue

@@ -24,7 +24,8 @@
             <el-button size="mini"  @click="showOrder">查看订单</el-button>
             <el-button size="mini"  @click="showOrder">查看订单</el-button>
          </div>
          </div>
         </div>
         </div>
-        <div style="margin: 20px 0px">
+
+        <div style="margin: 20px 0px" >
           <span class="font-small">基本信息</span>
           <span class="font-small">基本信息</span>
         </div>
         </div>
         <el-descriptions   :column="4" border  >
         <el-descriptions   :column="4" border  >
@@ -310,6 +311,9 @@ export default {
       logs:[],
       logs:[],
       form:{
       form:{
         refundAmount:0,
         refundAmount:0,
+        reasonId1: null,
+        reasonId2: null,
+        auditRemark: ''
       },
       },
       rules:{
       rules:{
         status: [
         status: [
@@ -318,8 +322,9 @@ export default {
         refundAmount: [
         refundAmount: [
           { required: true, message: "退款金额不能为空", trigger: "blur" }
           { required: true, message: "退款金额不能为空", trigger: "blur" }
         ],
         ],
-      }
-
+      },
+      reasonList: [],
+      reason2List: []
     };
     };
   },
   },
   computed: {
   computed: {
@@ -402,9 +407,44 @@ export default {
 
 
     },
     },
     handleRefund(){
     handleRefund(){
-        this.audit.open=true;
         this.form.salesId=this.afterSales.id;
         this.form.salesId=this.afterSales.id;
         this.form.refundAmount=this.order.payMoney;
         this.form.refundAmount=this.order.payMoney;
+        this.form.reasonId1 = null;
+        this.form.reasonId2 = null;
+        this.form.auditRemark = '';
+        this.reason2List = [];
+        this.audit.open=true;
+        this.getReasonList();
+    },
+    getReasonList() {
+      listRefundReason({ typeLevel: 1 }).then(response => {
+        this.reasonList = response.rows.map(item => {
+          return {
+            ...item,
+            children: []
+          };
+        });
+        this.reasonList.forEach(item => {
+          if (item.childrenCount > 0) {
+            this.getReason2List(item.id, item);
+          }
+        });
+      });
+    },
+    getReason2List(parentId, parent) {
+      listRefundReason({ parentId: parentId, typeLevel: 2 }).then(response => {
+        parent.children = response.rows;
+      });
+    },
+    handleReason1Change(val) {
+        this.form.reasonId2 = null;
+        this.reason2List = [];
+        if (val) {
+          const selected = this.reasonList.find(item => item.id === val);
+          if (selected && selected.children) {
+            this.reason2List = selected.children;
+          }
+        }
     },
     },
     submitAuditForm() {
     submitAuditForm() {
       this.$refs["form"].validate(valid => {
       this.$refs["form"].validate(valid => {
@@ -442,7 +482,7 @@ export default {
             this.user=response.user;
             this.user=response.user;
             this.order=response.order;
             this.order=response.order;
         });
         });
-     }
+     },
   }
   }
 };
 };
 </script>
 </script>