zhengjinyi 1 سال پیش
والد
کامیت
bf4c16b6d7
1فایلهای تغییر یافته به همراه13 افزوده شده و 4 حذف شده
  1. 13 4
      src/main/resources/static/js/supplier-center/shop/mixins/freightMixins.js

+ 13 - 4
src/main/resources/static/js/supplier-center/shop/mixins/freightMixins.js

@@ -13,6 +13,14 @@ const freightDefault = () =>{
         allAmount:'' // 包邮商品金额
     }
 }
+const freightTempDefault = () =>{
+    return {
+        id:'', //模板Id
+        name:'', // 模板名称
+        shopId:'', // 供应商ID
+        freightRuleList:[] // 运费规则
+    }
+}
 const freightMixins = function () {
     return {
         data() {
@@ -48,8 +56,7 @@ const freightMixins = function () {
 
         },
         mounted () {
-            this.freightTemp.shopId = globalUserData.shopId
-            this.freightRuleList.push(freightDefault())
+
         },
         methods: {
             disabled(value){
@@ -70,9 +77,12 @@ const freightMixins = function () {
             // 新增运费模板
             handleAddFreight(){
                 this.templateType = 'add'
-                this.freightTemp.name = ''
                 this.freightRuleList = []
                 this.freightRuleList.push(freightDefault())
+                this.freightTemp = freightTempDefault()
+                this.freightTemp.shopId = globalUserData.shopId
+                console.log('freightRuleList',this.freightRuleList)
+                console.log('freightTemp',this.freightTemp)
                 this.getFreightArea()
                 this.handleInitAreas()
                 this.dialogFormVisible = true
@@ -94,7 +104,6 @@ const freightMixins = function () {
             },
             // 修改运费规则
             changeFreightRole(freight,index){
-                console.log('freight',freight)
                 this.freightRulesForm = freight
                 this.rulesChecked = freight.freeType === 1
                 this.rulesFormVisible = true