1
0
Quellcode durchsuchen

广告页面修改

zhang vor 6 Jahren
Ursprung
Commit
c4067a25b0

+ 10 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/ad.html

@@ -33,6 +33,16 @@
     <Card v-show="!showList">
         <p slot="title">{{title}}</p>
         <i-form ref="formValidate" :model="ad" :rules="ruleValidate" :label-width="80">
+            <Form-item label="商户" prop="merchSn">
+                <i-select v-model="ad.merchSn" filterable placeholder="商户" @on-change="getStoresByMerch" label-in-value>
+                    <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
+                </i-select>
+            </Form-item>
+            <Form-item label="门店" prop="storeId">
+                <i-select v-model="ad.storeId" filterable placeholder="门店" label-in-value>
+                    <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
+                </i-select>
+            </Form-item>
             <Form-item label="广告位置" prop="adPositionId">
                 <i-select v-model="ad.adPositionId" filterable>
                     <i-option v-for="adPosition in adPositions" :value="adPosition.id" :key="adPosition.id">

+ 19 - 1
kmall-admin/src/main/webapp/js/shop/ad.js

@@ -70,7 +70,9 @@ var vm = new Vue({
         q: {
             name: ''
         },
-        adPositions: []
+        adPositions: [],
+        storeList: [],
+        merchList: []
     },
     methods: {
         query: function () {
@@ -82,6 +84,9 @@ var vm = new Vue({
             vm.ad = {enabled: 1, imageUrl: '', mediaType: 0};
             vm.adPosition = [];
             this.getAdPositions();
+            vm.storeList = [];
+            vm.merchList = [];
+            vm.getMerchList();
         },
         update: function (event) {
             var id = getSelectedRow();
@@ -92,6 +97,8 @@ var vm = new Vue({
             vm.title = "修改";
 
             vm.getInfo(id);
+            vm.getMerchList();
+            vm.getStoresByMerch();
             this.getAdPositions();
         },
         saveOrUpdate: function (event) {
@@ -141,6 +148,17 @@ var vm = new Vue({
                 vm.ad = r.ad;
             });
         },
+        getStoresByMerch: function (opt) {
+            var value = opt.value;
+            $.get("../store/getStoresByMerch?merchSn=" + value, function (r) {
+                vm.storeList = r.list;
+            });
+        },
+        getMerchList: function() {
+            $.get("../merch/queryAll", function (r) {
+                vm.merchList = r.list;
+            });
+        },
         reload: function (event) {
             vm.showList = true;
             var page = $("#jqGrid").jqGrid('getGridParam', 'page');