1
0
Selaa lähdekoodia

商品规格增加查询条件

zhh 3 vuotta sitten
vanhempi
commit
8234bb1fc1

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/ProductDao.xml

@@ -61,6 +61,9 @@
         <if test="goodsName != null and goodsName.trim() != ''">
             AND mall_goods.name LIKE concat('%',#{goodsName},'%')
         </if>
+        <if test="goodsSn != null and goodsSn.trim() != ''">
+            AND mall_goods.goods_sn LIKE concat('%',#{goodsSn},'%')
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}

+ 3 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/product.html

@@ -12,6 +12,9 @@
                 <i-col span="4">
                     <i-input v-model="q.goodsName" @on-enter="query" placeholder="商品名称"/>
                 </i-col>
+                <i-col span="4">
+                    <i-input v-model="q.goodsSn" @on-enter="query" placeholder="商品序列号"/>
+                </i-col>
                 <i-button @click="query">查询</i-button>
             </div>
             <div class="buttons-group">

+ 7 - 6
kmall-admin/src/main/webapp/js/shop/product.js

@@ -14,10 +14,10 @@ $(function () {
                 label: '商品规格',
                 name: 'goodsSpecificationNameValue',
                 index: 'goods_specification_ids',
-                width: 160,
-                formatter: function (value, options, row) {
-                    return value.replace(row.goodsName + " ", '');
-                }
+                width: 160
+                // formatter: function (value, options, row) {
+                //     return value.replace(row.goodsName + " ", '');
+                // }
             },
             {label: '商品序列号', name: 'goodsSn', index: 'goods_sn', width: 180},
             // {label: '商品库存', name: 'goodsNumber', index: 'goods_number', width: 80},
@@ -65,7 +65,8 @@ let vm = new Vue({
             ]
         },
         q: {
-            goodsName: ''
+            goodsName: '',
+            goodsSn: ''
         },
         goodss: [],
         attribute: [],
@@ -157,7 +158,7 @@ let vm = new Vue({
             vm.showList = true;
             let page = $("#jqGrid").jqGrid('getGridParam', 'page');
             $("#jqGrid").jqGrid('setGridParam', {
-                postData: {'goodsName': vm.q.goodsName},
+                postData: {'goodsName': vm.q.goodsName, 'goodsSn': vm.q.goodsSn},
                 page: page
             }).trigger("reloadGrid");
             vm.handleReset('formValidate');