chenrui il y a 9 mois
Parent
commit
69e025b970

+ 5 - 2
src/views/easyPassManagement/shoppingManagement/list.vue

@@ -35,7 +35,7 @@
             unCheckedChildren="禁用"
             v-model="record.enableFlag"
             @change="e=>changeFlagHandle(e,record)"/>
-          <span v-else :style="{color:(record.enableFlag?'#00aa00':'#999')}"> {{ record.enableFlag? '已启用': '已禁用' }} </span>
+          <span v-else :style="{color:(record.status==1?'#00aa00':'#999')}"> {{ record.status==1? '已启用': '已禁用' }} </span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -122,6 +122,10 @@ export default {
           if (res.status == 200) {
             const pos = this.loadDataList.findIndex(item => item.categorySn === record.categorySn)
             _this.loadDataList[pos].children = pos != -1 ? (res.data.shopCategoryList && res.data.shopCategoryList.length > 0) ? res.data.shopCategoryList : [] : []
+            // 处理显示状态
+            if (_this.loadDataList[pos].children && _this.loadDataList[pos].children.length > 0) {
+              _this.loadDataList[pos].children.map(con => con.enableFlag = con.status == 1)
+            }
           }
           _this.spinning = false
         })
@@ -147,7 +151,6 @@ export default {
       this.pageType = typeVal
       this.openCategoryModal = true
       this.parentData = row
-      console.log('22222222222222:', row, typeVal)
       if (typeVal === 'edit') {
         this.$refs.categoryModal.getDetailData({ categorySn: row.categorySn })
       }

+ 13 - 6
src/views/easyPassManagement/shoppingProducts/editProductModal.vue

@@ -19,10 +19,10 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="产品编码">
-          {{form.productCode}}
+          {{ form.productCode }}
         </a-form-model-item>
         <a-form-model-item label="售价类型" prop="priceType">
-          <a-select v-model="form.priceType" id="edit-product-priceType" placeholder="请选择售价类型" allowClear>
+          <a-select v-model="form.priceType" id="edit-product-priceType" placeholder="请选择售价类型" allowClear @change="handlePriceType">
             <a-select-option value="TERMINAL_PRICE">
               终端价
             </a-select-option>
@@ -62,7 +62,7 @@
             :precision="0"
             :step="1"
             v-model="form.hotSort"
-            placeholder="请输入正整数,数字越大优先级越低" />
+            placeholder="请输入正整数,数字越大优先级越低"/>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
@@ -115,11 +115,18 @@ export default {
     }
   },
   methods: {
+    // 售价类型  change
+    handlePriceType (val) {
+      if (val === 'TERMINAL_PRICE') {
+        this.form.price = this.form && (this.form.oldPrice || this.form.oldPrice == 0) ? this.form.oldPrice : ''
+      }
+    },
     // 获取编辑详情
     getDetail () {
       this.spinning = true
       shopProductDetail({ shopProductSn: this.itemSn }).then(res => {
         if (res.status == 200 && res.data) {
+          res.data.oldPrice = res.data.price
           this.form = res.data
           this.spinning = false
         } else {
@@ -127,9 +134,9 @@ export default {
         }
       })
     },
-    //热销产品切换时清空数据
-    handleHotProduct(e){
-      if(e==0){
+    // 热销产品切换时清空数据
+    handleHotProduct (e) {
+      if (e == 0) {
         this.form.hotSort = ''
       }
     },

+ 1 - 0
src/views/easyPassManagement/shoppingProducts/list.vue

@@ -30,6 +30,7 @@
                 <a-cascader
                   id="shoppingProductsList-category"
                   expandTrigger="hover"
+                  :changeOnSelect="true"
                   :fieldNames="fieldNames"
                   :options="categoryOptions"
                   placeholder="请选择商城类目"