浏览代码

商品全景图增加条件

zcb 4 年之前
父节点
当前提交
bb4b7c9d91

+ 19 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -81,6 +81,25 @@ public class GoodsController {
     }
 
     /**
+     * 查看信息
+     */
+    @RequestMapping("/infoByQuery")
+    public R infoByQuery(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeKey", "merchSn", "thirdPartyMerchCode");
+        ParamUtils.setName(params, "name");
+        //查询列表数据
+        Query query = new Query(params);
+
+        query.put("isDelete", 0);
+        List<GoodsEntity> goodsList = goodsService.queryList(query);
+        if(goodsList != null && goodsList.size() != 0) {
+            return R.ok().put("goods", goodsList.get(0));
+        }
+        return R.ok().put("goods", new GoodsEntity());
+    }
+
+
+    /**
      * 保存
      */
     @RequestMapping("/save")

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

@@ -163,6 +163,9 @@
         <if test="sku != null and sku.trim() != ''">
             AND gs.sku = #{sku}
         </if>
+        <if test="prodBarcode != null and prodBarcode.trim() != ''">
+            AND gs.prod_barcode = #{prodBarcode}
+        </if>
         <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
             AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>

+ 4 - 3
kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml

@@ -207,6 +207,9 @@
         <if test="categoryTwo != null and categoryTwo != ''">
             AND a.category_id = #{categoryTwo}
         </if>
+        <if test="prodBarcode != null and prodBarcode != ''">
+            AND b.prod_barcode = #{prodBarcode}
+        </if>
         <if test="storeId != null and storeId != '' ">
             AND a.store_id = #{storeId}
         </if>
@@ -231,9 +234,7 @@
         <if test="productId != null">
             AND a.product_id = #{productId}
         </if>
-        <if test="storeId != null and storeId != ''">
-            AND s.id = #{storeId}
-        </if>
+
         <if test="goodsBizType != null and goodsBizType != ''">
             AND b.goods_biz_type = #{goodsBizType}
         </if>

+ 21 - 56
kmall-admin/src/main/webapp/WEB-INF/page/sale/goodsPanorama.html

@@ -61,61 +61,9 @@
 </head>
 <body>
 <div id="rrapp" v-cloak>
-    <div v-show="showList">
+    <div v-show="!showList">
         <Row :gutter="16">
-            <div class="search-group">
-                <i-col span="3">
-                    <i-select v-model="q.merchSn" placeholder="商户编号" filterable label-in-value>
-                        <i-option v-for="merch in queryMerch" :value="merch.merchSn"
-                                  :key="merch.merchSn">{{merch.merchName}}
-                        </i-option>
-                    </i-select>
-                </i-col>
-                <i-col span="3">
-                    <i-select v-model="q.thirdPartyMerchCode" placeholder="第三方商户" label-in-value>
-                        <i-option v-for="thirdMerchant in thirdMerchantBizViewList" :value="thirdMerchant.thirdPartyMerchCode" :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
-                    </i-select>
-                </i-col>
-                <i-col span="3">
-                    <i-input v-model="q.goodsSn" @on-enter="query" placeholder="商品编码"/>
-                </i-col>
-                <i-col span="3">
-                    <i-input v-model="q.prodBarcode" @on-enter="query" placeholder="产品条码"/>
-                </i-col>
-                <i-col span="3">
-                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
-                </i-col>
-                <i-col span="3">
-                    <i-input v-model="q.englishName" @on-enter="query" placeholder="英文名称"/>
-                </i-col>
-                <!--<i-col span="3">-->
-                <!--<i-input v-model="q.plu" @on-enter="query" placeholder="PLU"/>-->
-                <!--</i-col>-->
-                <i-col span="3">
-                    <i-select v-model="q.goodsBizType" placeholder="货品业务类型"
-                              label-in-value>
-                        <i-option v-for="macro in macros" :value="macro.value" :key="macro.id">{{macro.name}}
-                        </i-option>
-                    </i-select>
-                </i-col><!--
-                <i-col span="3">
-                    <i-select v-model="q.category" placeholder="商品分类" filterable @on-change="changeQueryCategories"
-                              label-in-value>
-                        <i-option v-for="category in queryCategories" :value="category.id"
-                                  :key="categoqry.id">{{category.name}}
-                        </i-option>
-                    </i-select>
-                </i-col>
-                <i-col span="3">
-                    <i-select v-model="q.categoryTwo" placeholder="商品二级分类" filterable label-in-value>
-                        <i-option v-for="category in queryCategoriesTwo" :value="category.id"
-                                  :key="category.id">{{category.name}}
-                        </i-option>
-                    </i-select>
-                </i-col>-->
-                <i-button @click="query">查询</i-button>
-                <i-button @click="reloadSearch">重置</i-button>
-            </div>
+
             <div class="buttons-group" style="width: 100%;margin-top: 8px; padding-left: 10px;">
                 #if($shiro.hasPermission("goods:update"))
                 <i-button type="warning" @click="update">&nbsp;全景图</i-button>
@@ -132,8 +80,25 @@
 
     </div>
 
-    <Card v-show="!showList">
-        <p slot="title">{{title}}</p>
+    <Card v-show="showList">
+        <div class="search-group">
+            <i-col span="3">
+                <i-input v-model="q.goodsSn" @on-enter="query" placeholder="商品编码"/>
+            </i-col>
+            <i-col span="3">
+                <i-input v-model="q.prodBarcode" @on-enter="query" placeholder="商品条码"/>
+            </i-col>
+            <i-col span="3">
+                <i-select v-model="q.storeId" placeholder="门店" filterable label-in-value>
+                    <i-option v-for="store in stores" :value="store.id"
+                              :key="store.id">{{store.storeName}}
+                    </i-option>
+                </i-select>
+            </i-col>
+            <i-button @click="query">查询</i-button>
+            <i-button @click="reloadSearch">重置</i-button>
+        </div>
+<!--        <p slot="title">{{title}}</p>-->
 
         <i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="140">
         <Row>

+ 46 - 57
kmall-admin/src/main/webapp/js/sale/goodsPanorama.js

@@ -337,28 +337,18 @@ var vm = new Vue({
         uploadList: [],
         imgName: '',
         visible: false,
+        stores: [],
         goods: {primaryPicUrl: '', listPicUrl: '',videoUrl:'', categoryId: '', isOnSale: 1, isAppExclusive: 0, isLimited: 0, isHot: 0, categoryName: '', retailPrice: '', marketPrice: '', goodsRate: '', sortOrder: '',goodsNumber: '' },
         ruleValidate: {
-            /*name: [
-                {required: true, message: '名称不能为空', trigger: 'blur'}
-            ]*/
         },
         q: {name: '', goodsSn: '', prodBarcode: '',goodsBizType:'', merchSn: '',thirdPartyMerchCode:''},
         attributes: [],
         attributeEntityList: [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}],
         productEntityList: [{'id': '', 'goodsId': '', 'goodsSpecificationIds': '', 'goodsSpecificationNameValue': '', 'goodsSn': '', 'goodsNumber': '', 'isDelete': 0, 'goodsDefault': 0}],
-        /*queryCategories: [],//一级分类
-        queryCategoriesTwo: [],*/
         queryMerch: [],
-        /*categories: [],//一级分类
-        categoriesTwo: [],*/
         macros: [],//商品单位
-        // attributeCategories: [],//属性类别
         specifications: [],
-        // brands: [],
-        // freights: [],
         showInput: true,
-        // categoryId: '',
         cusUnitCodeList: [],
         cusNationCodeList: [],
         merchList: [],
@@ -385,20 +375,6 @@ var vm = new Vue({
             }
             vm.productEntityList.push({'id': '', 'goodsId': '', 'goodsSpecificationIds': '', 'goodsSpecificationNameValue': '', 'goodsSn': '', 'goodsNumber': '', 'isDelete': 0, 'goodsDefault': 0});
         },
-        /*delAttrRow: function (index) {
-            //最后一行时禁止删除
-            if (vm.attributeEntityList.length == 1) {
-                return;
-            }
-            vm.attributeEntityList[index].isDelete = 1;
-        },
-        addAttrRow: function () {
-            let goodsId = '';
-            if (vm.goods) {
-                goodsId = vm.goods.id;
-            }
-            vm.attributeEntityList.push({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
-        },*/
         reloadSearch: function () {
             vm.q = {
                 name: '',
@@ -463,19 +439,27 @@ var vm = new Vue({
             vm.detail();
 
         },
-        getInfo: function (id) {
-            $.get("../goods/info/" + id, function (r) {
-                vm.goods = r.goods;
-                vm.goodsBizType = r.goods.goodsBizType;
+        getInfo: function () {
+            var postData = {"goodsSn":vm.q.goodsSn,'prodBarcode':vm.q.prodBarcode,'storeId':vm.q.storeId};
+            vm.getCusUnitCodeList();
+            vm.getCusNationCode();
+            $.post("../goods/infoByQuery",postData,function(r){
 
-                vm.branch(r.goods.goodsSn);
-                vm.barcode(r.goods.goodsSn);
-                vm.sales(r.goods.goodsSn);
+                vm.goods = r.goods;
+                // vm.goodsBizType = r.goods.goodsBizType;
             });
+            // $.get("../goods/info/" + id, function (r) {
+            //     vm.goods = r.goods;
+            //     vm.goodsBizType = r.goods.goodsBizType;
+            //
+            //     // vm.branch(r.goods.goodsSn);
+            //     // vm.barcode(r.goods.goodsSn);
+            //     // vm.sales(r.goods.goodsSn);
+            // });
         },
-        branch:function(sku){
+        branch:function(){
 
-            var postData = {"goodsSn":sku}
+            var postData = {"goodsSn":vm.q.goodsSn,'prodBarcode':vm.q.prodBarcode,'storeId':vm.q.storeId};
 
             $("#branchJqGrid").jqGrid('setGridParam',{
                 datatype:'json',
@@ -488,8 +472,8 @@ var vm = new Vue({
         discount:function(){
 
         },
-        barcode:function(sku){
-            var postData = {"goodsSn":sku}
+        barcode:function(){
+            var postData = {"goodsSn":vm.q.goodsSn,'prodBarcode':vm.q.prodBarcode,'storeId':vm.q.storeId};
 
             $("#barcodeJqGrid").jqGrid('setGridParam',{
                 datatype:'json',
@@ -499,8 +483,8 @@ var vm = new Vue({
         detail:function(){
 
         },
-        sales:function(sku){
-            var postData = {"sku":sku}
+        sales:function(){
+            var postData = {"goodsSn":vm.q.goodsSn,'prodBarcode':vm.q.prodBarcode,'storeId':vm.q.storeId};
 
             $("#salesJqGrid").jqGrid('setGridParam',{
                 datatype:'json',
@@ -669,25 +653,28 @@ var vm = new Vue({
             });
         },
         reload: function (event) {
+            vm.sales();
+            vm.branch();
+            vm.barcode();
+            vm.getInfo();
             vm.showList = true;
-            let page = event;
-            if (event != 1) {
-                page = $("#jqGrid").jqGrid('getGridParam', 'page');
-            }
-            $("#jqGrid").jqGrid('setGridParam', {
-                postData: {
-                    'name': vm.q.name,
-                    'englishName': vm.q.englishName,
-                    // 'plu': vm.q.plu,
-                    'goodsSn': vm.q.goodsSn,
-                    'prodBarcode': vm.q.prodBarcode,
-                    'goodsBizType': vm.q.goodsBizType,
-                    'merchSn': vm.q.merchSn,
-                    'thirdPartyMerchCode': vm.q.thirdPartyMerchCode
-                },
-                page: page
-            }).trigger("reloadGrid");
-            vm.handleReset('formValidate');
+            // let page = event;
+            // if (event != 1) {
+            //     page = $("#jqGrid").jqGrid('getGridParam', 'page');
+            // }
+            // $("#jqGrid").jqGrid('setGridParam', {
+            //     postData: {
+            //         'name': vm.q.name,
+            //         'englishName': vm.q.englishName,
+            //         'goodsSn': vm.q.goodsSn,
+            //         'prodBarcode': vm.q.prodBarcode,
+            //         'goodsBizType': vm.q.goodsBizType,
+            //         'merchSn': vm.q.merchSn,
+            //         'thirdPartyMerchCode': vm.q.thirdPartyMerchCode
+            //     },
+            //     page: page
+            // }).trigger("reloadGrid");
+            // vm.handleReset('formValidate');
         },
         getCategory: function () {
             //加载分类树
@@ -921,7 +908,9 @@ var vm = new Vue({
         $.get("../merch/queryAll", function (r) {
             vm.queryMerch = r.list;
         });
-
+        $.get("../store/queryAll", function (r) {
+            vm.stores = r.list;
+        });
         $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
             vm.macros = r.list;
         });