Browse Source

添加商品补货,店提无热销字段

dq 6 years ago
parent
commit
9804d92eea

+ 2 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -139,7 +139,7 @@
                     </Form-item>
                     <Form-item label="货品业务类型" prop="goodsBizType" >
                         <i-select v-model="goods.goodsBizType" filterable placeholder="货品业务类型"
-                                  label-in-value style="width: 268px;">
+                                  label-in-value style="width: 268px;" @on-change="changeGoodsBizType">
                             <i-option v-for="macro in macros" :value="macro.value" :key="macro.id">{{macro.name}}
                             </i-option>
                         </i-select>
@@ -362,7 +362,7 @@
                             </Radio>
                         </Radio-group>
                     </Form-item>
-                    <Form-item label="热销" prop="isHot">
+                    <Form-item v-if="showInput" label="热销" prop="isHot">
                         <Radio-group v-model="goods.isHot">
                             <Radio label="0">
                                 <span>否</span>

+ 13 - 1
kmall-admin/src/main/webapp/js/shop/goods.js

@@ -142,7 +142,8 @@ var vm = new Vue({
         attributeCategories: [],//属性类别
         specifications: [],
         brands: [],
-        freights: []
+        freights: [],
+        showInput: true
     },
     methods: {
         delSpeRow: function (index) {
@@ -201,6 +202,7 @@ var vm = new Vue({
             vm.getFreights();
             vm.getAttributeCategories();
             vm.getAttributes();
+            vm.showInput = true;
         },
         update: function (event) {
             var id = getSelectedRow();
@@ -217,6 +219,10 @@ var vm = new Vue({
             vm.getAttributeCategories();
             vm.getGoodsGallery(id);
             vm.getAttributes();
+            vm.showInput = true;
+            if (vm.goods.goodsBizType == '10' || vm.goods.goodsBizType == '02') {
+                vm.showInput = false;
+            }
         },
         getAttributes: function () {
             $.get("../attribute/queryAll", function (r) {
@@ -436,6 +442,12 @@ var vm = new Vue({
                 }
             });
         },
+        changeGoodsBizType: function(opt) {
+            var goodsBizType = opt.value;
+            if (vm.goods.goodsBizType == '10' || vm.goods.goodsBizType == '02') {
+                vm.showInput = false;
+            }
+        },
         handleView(name) {
             this.imgName = name;
             this.visible = true;