Parcourir la source

商品全景图

zcb il y a 4 ans
Parent
commit
aca5839bd3

+ 9 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/alarm/Mall2OrderingEarlyWarningRemindsEntity.java

@@ -27,6 +27,7 @@ public class Mall2OrderingEarlyWarningRemindsEntity implements Serializable {
      * 商品名称
      */
     private String goodsName;
+    private String sku;
     /**
      * 平均销量
      */
@@ -237,4 +238,12 @@ public class Mall2OrderingEarlyWarningRemindsEntity implements Serializable {
     public Date getTstm() {
         return tstm;
     }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
 }

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/alarm/Mall2OrderingEarlyWarningRemindsServiceImpl.java

@@ -148,6 +148,7 @@ public class Mall2OrderingEarlyWarningRemindsServiceImpl implements Mall2Orderin
                     if(orderingEarlyWarningRemindsEntity == null){
                         orderingEarlyWarningRemindsEntity = new Mall2OrderingEarlyWarningRemindsEntity();
                         orderingEarlyWarningRemindsEntity.setAverageSales(new BigDecimal(totalSellVolumn));
+                        orderingEarlyWarningRemindsEntity.setSku(goodsEntity.getGoodsSn());
                         orderingEarlyWarningRemindsEntity.setTotalNum(totalNum);
                         orderingEarlyWarningRemindsEntity.setGoodsId(goodsEntity.getId().intValue());
                         orderingEarlyWarningRemindsEntity.setGoodsName(goodsEntity.getName());

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/task/OrderRemindsTask.java

@@ -25,7 +25,7 @@ public class OrderRemindsTask {
 
 
 
-    @Scheduled(cron = "0/30 * * * * ?")
+//    @Scheduled(cron = "0/30 * * * * ?")
     public void orderReminds() {
         logger.info("订货提醒查询-----------------" );
         try {

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/task/ShippingRemindsTask.java

@@ -24,7 +24,7 @@ public class ShippingRemindsTask {
 
 
 
-    @Scheduled(cron = "0/30 * * * * ?")
+//    @Scheduled(cron = "0/30 * * * * ?")
     public void shippingReminds() {
         logger.info("出货提醒查询-----------------" );
         try {

+ 10 - 0
kmall-admin/src/main/resources/mybatis/mapper/alarm/Mall2OrderingEarlyWarningRemindsDao.xml

@@ -7,6 +7,7 @@
         <result property="moewrId" column="moewr_id"/>
         <result property="goodsId" column="goods_id"/>
         <result property="goodsName" column="goods_name"/>
+		<result property="sku" column="sku"/>
         <result property="averageSales" column="average_sales"/>
         <result property="totalNum" column="total_num"/>
         <result property="alarmType" column="alarm_type"/>
@@ -24,6 +25,7 @@
 			`moewr_id`,
 			`goods_id`,
 			`goods_name`,
+			`sku`,
 			`average_sales`,
 			`total_num`,
 			`alarm_type`,
@@ -43,6 +45,7 @@
     		`moewr_id`,
     		`goods_id`,
     		`goods_name`,
+    		`sku`,
     		`average_sales`,
     		`total_num`,
     		`alarm_type`,
@@ -86,6 +89,7 @@
 			`moewr_id`,
 			`goods_id`,
 			`goods_name`,
+			`sku`,
 			`average_sales`,
 			`total_num`,
 			`alarm_type`,
@@ -100,6 +104,7 @@
 			#{moewrId},
 			#{goodsId},
 			#{goodsName},
+			#{sku},
 			#{averageSales},
 			#{totalNum},
 			#{alarmType},
@@ -117,6 +122,7 @@
 		<set>
 			<if test="goodsId != null">`goods_id` = #{goodsId}, </if>
 			<if test="goodsName != null">`goods_name` = #{goodsName}, </if>
+			<if test="sku != null">`sku` = #{sku}, </if>
 			<if test="averageSales != null">`average_sales` = #{averageSales}, </if>
 			<if test="totalNum != null">`total_num` = #{totalNum}, </if>
 			<if test="alarmType != null">`alarm_type` = #{alarmType}, </if>
@@ -147,6 +153,7 @@
 			`moewr_id`,
 			`goods_id`,
 			`goods_name`,
+			`sku`,
 			`average_sales`,
 			`total_num`,
 			`alarm_type`,
@@ -163,6 +170,7 @@
 			#{item.moewrId},
 			#{item.goodsId},
 			#{item.goodsName},
+			#{ite.sku},
 			#{item.averageSales},
 			#{item.totalNum},
 			#{item.alarmType},
@@ -184,6 +192,7 @@
 			<set>
 				<if test="item.goodsId != null">`goods_id` = #{item.goodsId}, </if>
 				<if test="item.goodsName != null">`goods_name` = #{item.goodsName}, </if>
+				<if test="item.sku != null">`sku` = #{item.sku}, </if>
 				<if test="item.averageSales != null">`average_sales` = #{item.averageSales}, </if>
 				<if test="item.totalNum != null">`total_num` = #{item.totalNum}, </if>
 				<if test="item.alarmType != null">`alarm_type` = #{item.alarmType}, </if>
@@ -205,6 +214,7 @@
 			`moewr_id`,
 			`goods_id`,
 			`goods_name`,
+			`sku`,
 			`average_sales`,
 			`total_num`,
 			`alarm_type`,

+ 278 - 0
kmall-admin/src/main/webapp/WEB-INF/page/sale/goodsPanorama.html

@@ -0,0 +1,278 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title></title>
+    #parse("sys/header.html")
+    <style>
+        .upload-list {
+            display: inline-block;
+            width: 60px;
+            height: 60px;
+            text-align: center;
+            line-height: 60px;
+            border: 1px solid transparent;
+            border-radius: 4px;
+            overflow: hidden;
+            background: #fff;
+            position: relative;
+            box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
+            margin-right: 4px;
+        }
+
+        .upload-list img {
+            width: 100%;
+            height: 100%;
+        }
+
+        .upload-list-cover {
+            display: none;
+            position: absolute;
+            top: 0;
+            bottom: 0;
+            left: 0;
+            right: 0;
+            background: rgba(0, 0, 0, .6);
+        }
+
+        .upload-list:hover .upload-list-cover {
+            display: block;
+        }
+
+        .upload-list-cover i {
+            color: #fff;
+            font-size: 20px;
+            cursor: pointer;
+            margin: 0 2px;
+        }
+
+        .hselect {
+            margin: 0;
+            padding: 0;
+        }
+
+        .ui-jqgrid .ui-jqgrid-bdiv {
+            border-top: 1px solid #E1E1E1;
+            overflow-x: auto;
+        }
+        .frozen-div, .frozen-bdiv {
+            background-color: #E4E6E9;/*与网页背景色一致*/
+        }
+    </style>
+</head>
+<body>
+<div id="rrapp" v-cloak>
+    <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>
+                #end
+
+
+                <!--<i-button type="info" @click="goodsExport"><i class="fa fa-plus"></i>&nbsp;商品导入</i-button>-->
+                <!--<i-button type="info" @click="sameGoodsExport"><i class="fa fa-plus"></i>&nbsp;普货商品导入</i-button>-->
+
+            </div>
+        </Row>
+        <table id="jqGrid"></table>
+        <div id="jqGridPager"><div class="ui-jqgrid-bdiv frozen-div"></div></div>
+
+    </div>
+
+    <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+
+        <i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="140">
+        <Row>
+            <i-col span="4">
+                <Form-item label="商品名称" prop="name">
+                    <i-input v-model="goods.name" placeholder="商品名称"/>
+                </Form-item>
+            </i-col>
+            <i-col span="4">
+                <Form-item label="商品简称" prop="name">
+                    <i-input v-model="goods.name" placeholder="商品简称"/>
+                </Form-item>
+            </i-col>
+            <i-col span="4">
+                <Form-item label="规格" prop="ciqProdModel">
+                    <i-input v-model="goods.ciqProdModel" placeholder="规格"/>
+                </Form-item>
+            </i-col>
+            <i-col span="4">
+                <Form-item label="基本单位" prop="goodsUnit">
+                    <i-input v-model="goods.goodsUnit" placeholder="基本单位"/>
+                </Form-item>
+            </i-col>
+        </Row>
+            <Row>
+                <i-col span="4">
+                    <Form-item label="品类" prop="goodsSn">
+<!--                        <i-input v-model="goods.goodsSn" placeholder="品类"/>-->
+                        <i-input  placeholder="品类"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="部门" prop="goodsSn">
+<!--                        <i-input v-model="goods.goodsSn" placeholder="部门"/>-->
+                        <i-input placeholder="部门"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="品牌厅" prop="brand">
+                        <i-input v-model="goods.brand" placeholder="品牌厅"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="进货单位" prop="goodsSn">
+<!--                        <i-input v-model="goods.goodsSn" placeholder="进货单位"/>-->
+                        <i-input  placeholder="进货单位"/>
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="4">
+                    <Form-item label="主供应商" prop="goodsSn">
+<!--                        <i-input v-model="goods.goodsSn" placeholder="主供应商"/>-->
+                        <i-input  placeholder="主供应商"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="商品U级" prop="goodsSn">
+<!--                        <i-input v-model="goods.goodsSn" placeholder="商品U级"/>-->
+                        <i-input  placeholder="商品U级"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="包装含量" prop="goodsSn">
+<!--                        <i-input v-model="goods.goodsSn" placeholder="包装含量"/>-->
+                        <i-input placeholder="包装含量"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="产地" prop="goodsSn">
+                        <i-select v-model="goods.oriCntCode" filterable placeholder="原产国"
+                                  label-in-value>
+                            <i-option v-for="cusNationCode in cusNationCodeList" :value="cusNationCode.code" :key="cusNationCode.sn">{{cusNationCode.name}}</i-option>
+                        </i-select>
+<!--                        <i-input v-model="goods.goodsSn" placeholder="产地"/>-->
+                    </Form-item>
+                </i-col>
+            </Row>
+            <Row>
+                <i-col span="4">
+                    <Form-item label="主条码" prop="prodBarcode">
+                        <i-input v-model="goods.prodBarcode" placeholder="主条码"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="PLU编码" prop="sku">
+                        <!--<i-input v-model="goods.sku" placeholder="PLU编码"/>-->
+                        <i-input  placeholder="PLU编码"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="编码" prop="sku">
+                        <i-input v-model="goods.sku" placeholder="编码"/>
+                    </Form-item>
+                </i-col>
+                <i-col span="4">
+                    <Form-item label="品牌" prop="brand">
+                        <i-input v-model="goods.brand" placeholder="品牌"/>
+                    </Form-item>
+                </i-col>
+            </Row>
+
+        <Tabs value="branch">
+            <Tab-Pane label="分店信息" name="branch">
+                <table id="branchJqGrid"></table>
+                <div id="branchJqGridPager"><div class="ui-jqgrid-bdiv frozen-div"></div></div>
+            </Tab-Pane>
+
+            <Tab-Pane label="折扣信息" name="discount">
+                <table id="discountJqGrid"></table>
+                <div id="discountJqGridPager"><div class="ui-jqgrid-bdiv frozen-div"></div></div>
+            </Tab-Pane>
+            <Tab-Pane label="条码信息" name="barcode">
+                <table id="barcodeJqGrid"></table>
+                <div id="barcodeJqGridPager"><div class="ui-jqgrid-bdiv frozen-div"></div></div>
+            </Tab-Pane>
+            <Tab-Pane label="进销存明细查询" name="detail">
+                <table id="detailJqGrid"></table>
+                <div id="detailJqGridPager"><div class="ui-jqgrid-bdiv frozen-div"></div></div>
+            </Tab-Pane>
+            <Tab-Pane label="销售查询" name="sales">
+                <table id="salesJqGrid"></table>
+                <div id="salesJqGridPager"><div class="ui-jqgrid-bdiv frozen-div"></div></div>
+            </Tab-Pane>
+        </Tabs>
+        </i-form>
+        <div style="padding-left: 20px">
+            <!--<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>-->
+            <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
+            <!--<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>-->
+        </div>
+    </Card>
+</div>
+
+<!-- 选择类型 -->
+<div id="categoryLayer" style="display: none;padding: 10px;">
+    <ul id="categoryTree" class="ztree"></ul>
+</div>
+
+<script src="${rc.contextPath}/js/sale/goodsPanorama.js?_${date.systemTime}"></script>
+</body>
+</html>

+ 934 - 0
kmall-admin/src/main/webapp/js/sale/goodsPanorama.js

@@ -0,0 +1,934 @@
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: '../goods/list',
+        datatype: "json",
+        colModel: [
+            // {label: 'ID', name: 'id', index: 'id', width: 60, key: true},
+            {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '第三方商户编号', name: 'thirdPartyMerchCode', index: 'thirdPartyMerchCode', width: 160, align: 'center'},
+            {label: '商品编码', name: 'goodsSn', index: 'goods_Sn', width: 180, align: 'center'},
+            {label: 'SKU', name: 'sku', index: 'sku', width: 180, align: 'center'},
+            {label: 'PLU', name: 'plu', index: 'plu', width: 180, align: 'center'},
+            {label: '英文名称', name: 'englishName', index: 'englishName', width: 180, align: 'center'},
+            {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 160, align: 'center'},
+            // {label: '商品类型', name: 'categoryName', index: 'category_id', width: 40, align: 'center'},
+            {label: '名称', name: 'name', index: 'name', width: 500, align: 'left'},
+            {
+                label: '货品业务类型', name: 'goodsBizType', index: 'goods_biz_type', width: 100, align: 'center',
+                formatter: function (value) {
+                    if (value == '00') {
+                        return '保税备货';
+                    } else if (value == '02') {
+                        return '保税展示补货';
+                    } else if (value == '10') {
+                        return '保税展示跨境';
+                    }
+                    return '普通货物';
+                }
+            },
+            {label: '库存是否共享', name: 'isStockShare', index: 'isStockShare', width: 100, align: 'center',
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '否';
+                    } else if (value == '1') {
+                        return '是';
+                    }
+                    return '-';
+                }},
+            {label: '商品库存', name: 'goodsNumber', index: 'goodsNumber', width: 100, align: 'right'},
+            // {label: '零售价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
+            // {label: '市场价', name: 'marketPrice', index: 'market_price', width: 80, align: 'center'},
+            {
+                label: '上架', name: 'isOnSale', index: 'is_on_sale', width: 50, align: 'center',
+                formatter: function (value) {
+                    return transIsNot(value);
+                }
+            },
+            {
+                label: '热销', name: 'isHot', index: 'is_hot', width: 50, align: 'center',formatter: function (value) {
+                return transIsNot(value);
+            }
+            },
+            /*{
+                label: '活动', name: 'goodsType', index: 'goodsType', width: 80,
+                formatter: function (value) {
+                    if (value == 2) {
+                        return '<span class="label label-warning">团购</span>';
+                    } else {
+                        return '<span class="label label-success">无活动</span>';
+                    }
+                }
+            },*/
+            {
+                label: '录入日期', name: 'addTime', index: 'add_time', width: 200, align: 'center',
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }
+            }
+        ],
+        viewrecords: true,
+        height: 475,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        shrinkToFit: false,
+        autoScroll: true,   //开启水平滚动条
+        width: 1600,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
+        }
+    });
+    $('#goodsDesc').editable({
+        inlineMode: false,
+        alwaysBlank: true,
+        height: '500px', //高度
+        minHeight: '200px',
+        language: "zh_cn",
+        spellcheck: false,
+        plainPaste: true,
+        enableScript: false,
+        imageButtons: ["floatImageLeft", "floatImageNone", "floatImageRight", "linkImage", "replaceImage", "removeImage"],
+        allowedImageTypes: ["jpeg", "jpg", "png", "gif"],
+        imageUploadURL: '../sys/oss/upload',
+        imageUploadParams: {id: "edit"},
+        imagesLoadURL: '../sys/oss/queryAll'
+    });
+
+
+    $("#branchJqGrid").jqGrid({
+        url: '../productstorerela/list',
+        datatype: "json",
+        colModel: [
+            {label: '所属门店', name: 'storeName', index: 'storeName', width: 180, align: 'center'},
+            {label: '商品类型', name: 'categoryName', index: 'categoryName', width: 120, align: 'center'},
+            {label: '批次编号', name: 'batchSn', index: 'batchSn', width: 140, align: 'center'},
+            {label: '批次到期日期', name: 'batchExpireDate', index: 'batchExpireDate', width: 160, align: 'center',formatter: function (value) {
+                    return transDate(value,'yyyy-MM-dd hh:mm:ss');
+                }},
+            {label: '门店库存', name: 'stockNum', index: 'stockNum', width: 80, align: 'center'},
+            {label: '园区库存', name: 'parkStock', index: 'parkStock', width: 80, align: 'center'},
+            {label: '零售价格', name: 'retailPrice', index: 'retailPrice', width: 80, align: 'right'},
+            {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80, align: 'right'},
+            {label: '底线价格', name: 'bottomLinePrice', index: 'bottomLinePrice', width: 80, align: 'right',formatter: function (value) {
+                    if (value){
+                        return value;
+                    }
+                    return '-';
+                }},
+            {
+                label: '销售量',
+                name: 'sellVolume',
+                index: 'a.sell_volume',
+                width: 80,
+                sortable: true, align: 'center',
+                onSortCol: function (index, colindex, sortorder) {
+                    //列排序事件
+                    jQuery("#jqGrid").jqGrid('setGridParam', {page: $('#XtoPage').val()});
+                }
+            }
+        ],
+        viewrecords: true,
+        height: 475,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        shrinkToFit: false,
+        autoScroll: true,   //开启水平滚动条
+        width: 1600,
+        pager: "#branchJqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
+        }
+    });
+
+
+    $("#barcodeJqGrid").jqGrid({
+        url: '../goods/list',
+        datatype: "json",
+        colModel: [
+            // {label: 'ID', name: 'id', index: 'id', width: 60, key: true},
+            {label: '商户名称', name: 'merchName', index: 'merchName', width: 100, align: 'center'},
+            {label: '商品编码', name: 'goodsSn', index: 'goods_Sn', width: 180, align: 'center'},
+            {label: 'SKU', name: 'sku', index: 'sku', width: 180, align: 'center'},
+            {label: 'PLU', name: 'plu', index: 'plu', width: 180, align: 'center'},
+            {label: '英文名称', name: 'englishName', index: 'englishName', width: 180, align: 'center'},
+            {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 160, align: 'center'}
+        ],
+        viewrecords: true,
+        height: 475,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        shrinkToFit: false,
+        autoScroll: true,   //开启水平滚动条
+        width: 1600,
+        multiselect: true,
+        pager: "#barcodeJqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
+        }
+    });
+
+
+    $("#salesJqGrid").jqGrid({
+        url: '../order/list',
+        datatype: "json",
+        colModel: [
+            {label: '所属门店', name: 'storeName', index: 'storeName',align: 'center', width: 180},
+            {label: '订单号', name: 'orderSn', index: 'order_sn', align: 'center',width: 180},
+            {label: '会员', name: 'userName', index: 'user_name',align: 'center', width: 80},
+            {label: '商户订单号', name: 'merchOrderSn', index: 'merchOrderSn', align: 'center',width: 150},
+            {
+                label: '订单状态', name: 'orderStatus', index: 'order_status', align: 'center',width: 120,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '订单创建成功等待付款';
+                    } else if (value == '100') {
+                        return '订单付款中';
+                    } else if (value == '101') {
+                        return '订单已取消';
+                    } else if (value == '102') {
+                        return '订单已删除';
+                    } else if (value == '201') {
+                        return '订单已付款';
+                    } else if (value == '300') {
+                        return '订单已发货';
+                    } else if (value == '301') {
+                        return '用户确认收货';
+                    } else if (value == '401') {
+                        return '没有发货,退款';
+                    } else if (value == '402') {
+                        return '已收货,退款退货';
+                    }
+                    return value;
+                }
+            },
+            {
+                label: '订付人核验', name: 'buyerPayCheck', index: 'buyer_pay_check', align: 'center',width: 80,
+                formatter: function (value) {//订购人支付人校验,0:未知,1:一致,2:不一致,3:校验异常
+                    if (value == '0') {
+                        return '未知';
+                    } else if (value == '1') {
+                        return '一致';
+                    } else if (value == '2') {
+                        return '不一致';
+                    }
+                    return "-";
+                }
+            },
+            {
+                label: '付款状态', name: 'payStatus', index: 'pay_status', align: 'center',width: 80,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '未付款';
+                    } else if (value == '1') {
+                        return '付款中';
+                    } else if (value == '2') {
+                        return '已付款';
+                    } else if (value == '3') {
+                        return '退款中';
+                    } else if (value == '4') {
+                        return '退款';
+                    }
+                    return value;
+                }
+            },
+            {label: '实际支付', name: 'actualPrice', index: 'actual_price', align: 'right',width: 80},
+            {label: '订单总价', name: 'orderPrice', index: 'order_price', align: 'right',width: 80},
+            {
+                label: '下单时间', name: 'addTime', index: 'add_time',align: 'center', width: 160,
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }
+            }
+        ],
+        viewrecords: true,
+        height: 550,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        shrinkToFit: false,
+        autoScroll: true,   //开启水平滚动条
+        width: 1500,
+        pager: "#salesJqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
+        }
+    });
+
+
+});
+
+var ztree;
+
+var setting = {
+    data: {
+        simpleData: {
+            enable: true,
+            idKey: "id",
+            pIdKey: "parentId",
+            rootPId: -1
+        },
+        key: {
+            url: "nourl"
+        }
+    }
+};
+var vm = new Vue({
+    el: '#rrapp',
+    data: {
+        showList: true,
+        fileList: true,
+        title: null,
+        uploadList: [],
+        imgName: '',
+        visible: false,
+        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: [],
+        suppliers: [],
+        thirdMerchantBizList: [],
+        thirdMerchantBizViewList: [],
+        isStockShare: false,
+        goodsBizType: '',
+        isOperator: '',
+        share: ''
+    },
+    methods: {
+        delSpeRow: function (index) {
+            //最后一行时禁止删除
+            if (vm.productEntityList.length == 1) {
+                return;
+            }
+            vm.productEntityList[index].isDelete = 1;
+        },
+        addSpeRow: function () {
+            let goodsId = '';
+            if (vm.goods) {
+                goodsId = vm.goods.id;
+            }
+            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: '',
+                goodsSn: '',
+                prodBarcode: '',
+                goodsBizType: '',
+                merchSn: '',
+                thirdPartyMerchCode:''
+            }
+        },
+        query: function () {
+            vm.reload(1);
+        },
+        add: function () {
+            vm.showList = false;
+            vm.isOperator='add';
+            vm.title = "新增";
+            vm.uploadList = [];
+            vm.goods = {primaryPicUrl: '', listPicUrl: '',videoUrl:'', categoryId: '', isOnSale: 1, isAppExclusive: 0, isLimited: 0,
+                isHot: 0, categoryName: '', retailPrice: '', marketPrice: '', goodsRate: '', sortOrder: '',goodsNumber: '' };
+            $('#goodsDesc').editable('setHTML', '');
+            vm.getCategory();
+            vm.macros = [];
+            vm.brands = [];
+            // vm.freights = [];
+            vm.cusUnitCodeList = [];
+            vm.cusNationCodeList = [];
+            // vm.attributeEntityList = [{'id': '', 'goodsId': '', 'attributeId': '', 'value': '', 'isDelete': 0}];
+            vm.getMacro();
+            vm.getCusUnitCodeList();
+            vm.getCusNationCode();
+            vm.getMerchList();
+            vm.showInput = true;
+        },
+        update: function (event) {
+            var id = getSelectedRow();
+            if (id == null) {
+                return;
+            }
+            vm.isOperator='update';
+            vm.showList = false;
+            vm.title = "修改";
+            vm.uploadList = [];
+            // vm.goods = {primaryPicUrl: '', listPicUrl: '',videoUrl:'', categoryId: '', isOnSale: 1, isAppExclusive: 0, isLimited: 0,
+            //     isHot: 0, categoryName: '', retailPrice: '', marketPrice: '', goodsRate: '', sortOrder: '',goodsNumber: '' };
+            vm.getInfo(id);/*
+            var opt = {};
+            opt.value = vm.goods.categoryId;
+            opt.flag = 1;
+            vm.getAttributes(opt);*/
+
+            vm.thirdMerchantBizList = [];
+            vm.getCusUnitCodeList();
+            vm.getCusNationCode();
+            vm.showInput = true;
+            if (vm.goods.goodsBizType == '10' || vm.goods.goodsBizType == '02') {
+                vm.showInput = false;
+            }
+
+            vm.price();
+            vm.discount();
+            vm.detail();
+
+        },
+        getInfo: function (id) {
+            $.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){
+
+            var postData = {"goodsSn":sku}
+
+            $("#branchJqGrid").jqGrid('setGridParam',{
+                datatype:'json',
+                postData:postData,
+            }).trigger("reloadGrid");
+        },
+        price:function(){
+
+        },
+        discount:function(){
+
+        },
+        barcode:function(sku){
+            var postData = {"goodsSn":sku}
+
+            $("#barcodeJqGrid").jqGrid('setGridParam',{
+                datatype:'json',
+                postData:postData,
+            }).trigger("reloadGrid");
+        },
+        detail:function(){
+
+        },
+        sales:function(sku){
+            var postData = {"sku":sku}
+
+            $("#salesJqGrid").jqGrid('setGridParam',{
+                datatype:'json',
+                postData:postData,
+            }).trigger("reloadGrid");
+        },
+        getMacro: function () {
+            // 获取货品业务类型
+            $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
+                vm.macros = r.list;
+            });
+        },/*
+        getBrand: function (merchSn) {
+            $.get("../brand/queryAll?merchSn=" + merchSn, function (r) {
+                vm.brands = r.list;
+            });
+        },*/
+        getSuppliers: function (thirdMerchantCode) {
+            $.get("../supplier/queryAll?thirdPartyMerchCode=" + thirdMerchantCode, function (r) {
+                vm.suppliers = r.list;
+            });
+        },
+        getCusUnitCodeList: function () {
+            $.get("../syscusunitcode/queryAll", function (r) {
+                vm.cusUnitCodeList = r.list;
+            });
+        },
+        getCusNationCode: function () {
+            $.get("../syscusnationcode/queryAll", function (r) {
+                vm.cusNationCodeList = r.list;
+            });
+        },/*
+        getFreights: function(merchSn) {
+            $.get("../freight/queryAll?merchSn=" + merchSn, function (r) {
+                vm.freights = r.list;
+            });
+        },*/
+        getGoodsGallery: function (id) {//获取商品顶部轮播图
+            $.get("../goodsgallery/queryAll?goodsId=" + id, function (r) {
+                vm.uploadList = r.list;
+            });
+        },
+        getMerchList: function() {
+            $.get("../merch/queryAll", function (r) {
+                vm.merchList = r.list;
+            });
+        },
+        getThirdMerchantBizList: function(merchSn) {
+            $.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+                vm.thirdMerchantBizList = r.list;
+            });
+        },
+        saveOrUpdate: function (event) {
+            var url = vm.goods.id == null ? "../goods/save" : "../goods/update";
+            vm.goods.goodsDesc = $('#goodsDesc').editable('getHTML');
+            vm.goods.goodsImgList = vm.uploadList;
+            // vm.goods.attributeEntityList = vm.attributeEntityList;
+            vm.goods.productEntityList = vm.productEntityList;
+            $.ajax({
+                type: "POST",
+                url: url,
+                dataType: "json",
+                contentType: "application/json",
+                data: JSON.stringify(vm.goods),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('操作成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+            });
+        },
+        enSale: function () {
+            var ids = getSelectedRows();
+            if (ids == null) {
+                return;
+            }
+            confirm('确定要上架选中的商品?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goods/enSaleBatch",
+                    contentType: "application/json",
+                    data: JSON.stringify(ids),
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert('操作成功', function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
+        openSpe: function () {
+            var id = getSelectedRow();
+            if (id == null) {
+                return;
+            }
+            openWindow({
+                type: 2,
+                title: '商品规格',
+                content: '../shop/goodsspecification.html?goodsId=' + id
+            })
+        },
+        openPro: function () {
+            var id = getSelectedRow();
+            if (id == null) {
+                return;
+            }
+            openWindow({
+                type: 2,
+                title: '产品设置',
+                content: '../shop/product.html?goodsId=' + id
+            });
+        },
+        unSale: function () {
+            var ids = getSelectedRows();
+            if (ids == null) {
+                return;
+            }
+            confirm('确定要下架选中的商品?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goods/unSaleBatch",
+                    contentType: "application/json",
+                    data: JSON.stringify(ids),
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert('操作成功', function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
+        del: function (event) {
+            var ids = getSelectedRows();
+            if (ids == null) {
+                return;
+            }
+
+            confirm('确定要删除选中的记录?', function () {
+                $.ajax({
+                    type: "POST",
+                    url: "../goods/delete",
+                    contentType: "application/json",
+                    data: JSON.stringify(ids),
+                    success: function (r) {
+                        if (r.code == 0) {
+                            alert('操作成功', function (index) {
+                                $("#jqGrid").trigger("reloadGrid");
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    }
+                });
+            });
+        },
+        reload: function (event) {
+            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');
+        },
+        getCategory: function () {
+            //加载分类树
+            $.get("../category/query", function (r) {
+                ztree = $.fn.zTree.init($("#categoryTree"), setting, r.list);
+                var node = ztree.getNodeByParam("id", vm.goods.categoryId);
+                if (node) {
+                    ztree.selectNode(node);
+                    vm.goods.categoryName = node.name;
+                } else {
+                    node = ztree.getNodeByParam("id", 0);
+                    ztree.selectNode(node);
+                    vm.goods.categoryName = node.name;
+                }
+            })
+        },
+        categoryTree: function () {
+            openWindow({
+                title: "选择类型",
+                area: ['300px', '450px'],
+                content: jQuery("#categoryLayer"),
+                btn: ['确定', '取消'],
+                btn1: function (index) {
+                    var node = ztree.getSelectedNodes();
+                    if (node[0].isParent) {
+                        alert("只能选择");
+                        return;
+                    }
+                    //选择上级菜单
+                    vm.goods.categoryId = node[0].id;
+                    vm.goods.categoryName = node[0].name;
+
+                    layer.close(index);
+                }
+            });
+        },
+        showStockShare:function(opt){
+            var thirdMerchantCode = opt.value;
+            /*$.get("../thirdmerchantbiz/infoByCode?thirdMerchantCode=" + thirdMerchantCode, function (r) {
+                if(r.thirdMerchantBiz){
+                    vm.share = r.thirdMerchantBiz.isStockShare;
+                    if(vm.goods.goodsBizType == '00' && r.thirdMerchantBiz.isStockShare == 1){
+                        // vm.isStockShare = true;
+                    }else{
+                        // vm.isStockShare = false;
+                        vm.goods.goodsNumber= '';
+                    }
+                }
+            });*/
+            vm.getSuppliers(thirdMerchantCode);
+        },
+        changeGoodsBizType: function(opt) {
+            var goodsBizType = opt.value;
+            if (vm.goods.goodsBizType == '10' || vm.goods.goodsBizType == '02') {
+                vm.showInput = false;
+            } else {
+                vm.showInput = true;
+            }
+            // console.log('goodsBizType:'+vm.goods.goodsBizType)
+            // console.log('share:'+vm.share)
+            // if(vm.goods.goodsBizType == '00' && vm.share == 1){
+            //     vm.isStockShare = true;
+            // }else{
+            //     vm.isStockShare = false;
+            //     // vm.goods.goodsNumber= '';
+            //     // console.log('错错错')
+            // }
+
+        },
+        handleView(name) {
+            this.imgName = name;
+            this.visible = true;
+        },
+        /*changeQueryCategories: function (opt) {
+            var value = opt.value;
+            $.get("../category/getCategorySelectByParent?parentId=" + value, function (r) {
+                vm.queryCategoriesTwo = r.list;
+            });
+        },
+
+        getAttributes: function (opt) {
+            var value = opt.value;
+            $.get("../attribute/query?attributeCategoryId=" + value, function (r) {
+                vm.attributes = r.list;
+            });
+
+            if (opt.flag != 1 && !(value === vm.categoryId)) {
+                if (vm.attributeEntityList.length > 0 && vm.attributeEntityList[0].attributeId != '') {
+                    for (var i = 0; i < vm.attributeEntityList.length; i++) {
+                        if (!(vm.attributeEntityList[0].attributeId === '')) {
+                            vm.attributeEntityList[i].isDelete = 1;
+                        }
+                    }
+
+                    var goodsId = '';
+                    if (vm.goods) {
+                        goodsId = vm.goods.id;
+                    }
+                    vm.attributeEntityList.unshift({'id': '', 'goodsId': goodsId, 'attributeId': '', 'value': '', 'isDelete': 0});
+                }
+            }
+        },
+        changeCategories: function (opt) {
+            var value = opt.value;
+            $.get("../category/getCategorySelectByParent?isShow=1&parentId=" + value, function (r) {
+                vm.categoriesTwo = r.list;
+            });
+        },*/
+        uploadExcelSuccess: function (data) {
+            // console.log(data);
+            if(data.code==0){
+                alert('导入成功', function (index) {
+                    $("#jqGrid").trigger("reloadGrid");
+                });
+            }else{
+                alert(data.msg);
+            }
+        },
+        uploadExcelError: function () {
+            alert('上传出现异常,请重试!');
+        },
+        uploadExcelFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
+            });
+        },
+        handleRemove(file) {
+            // 从 upload 实例删除数据
+            const fileList = vm.uploadList;
+            vm.uploadList.splice(fileList.indexOf(file), 1);
+        },
+        handleSuccess(res, file) {
+            // 因为上传过程为实例,这里模拟添加 url
+            file.imgUrl = res.url;
+            file.name = res.url;
+            vm.uploadList.add(file);
+        },
+        handleBeforeUpload() {
+            const check = vm.uploadList.length < 5;
+            if (!check) {
+                this.$Notice.warning({
+                    title: '最多只能上传 5 张图片。'
+                });
+            }
+            return check;
+        },
+        handleSubmit: function (name) {
+            // handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            // });
+        },
+        handleFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 jpg 或 png 格式的图片。'
+            });
+        },
+        handleMaxSize: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 100k。'
+            });
+        },
+        handleMaxSizeByInfo: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 300k。'
+            });
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        },
+        handleSuccessPicUrl: function (res, file) {
+            vm.goods.primaryPicUrl = file.response.url;
+        },
+        handleSuccessListPicUrl: function (res, file) {
+            vm.goods.listPicUrl = file.response.url;
+        },
+        eyeImagePicUrl: function () {
+            var url = vm.goods.primaryPicUrl;
+            eyeImage(url);
+        },
+        eyeImageListPicUrl: function () {
+            var url = vm.goods.listPicUrl;
+            eyeImage(url);
+        },
+        eyeImage: function (e) {
+            eyeImage($(e.target).attr('src'));
+        },
+        eyeImageListVideoUrl: function (e) {
+            var url = vm.goods.videoUrl;
+            eyeVideo(url);
+        },
+        handleVideoFormatError: function (file) {
+            this.$Notice.warning({
+                title: '文件格式不正确',
+                desc: '文件 ' + file.name + ' 格式不正确,请上传 mp4 格式的图片。'
+            });
+        },
+        handleVideoMaxSize: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 1M。'
+            });
+        },
+        handleSuccessListVideoUrl: function (res, file) {
+            vm.goods.videoUrl = file.response.url;
+        },
+        goodsExport: function () {
+            vm.fileList = false;
+        },
+        showMerchInfo:function(opt){
+            var merchSn = opt.value;
+            // vm.getCategories(merchSn);
+            // vm.getFreights(merchSn);
+            // vm.getBrand(merchSn);
+            vm.getThirdMerchantBizList(merchSn);
+        },
+        // getCategories: function (merchSn) {
+        //     $.get("../category/getCategorySelect?isShow=1&merchSn=" + merchSn, function (r) {
+        //         vm.categories = r.list;
+        //     });
+        // }
+    },
+    mounted() {
+        // this.uploadList = this.$refs.upload.fileList;
+        /*$.get("../category/getCategorySelect", function (r) {
+            vm.queryCategories = r.list;
+        });*/
+        $.get("../merch/queryAll", function (r) {
+            vm.queryMerch = r.list;
+        });
+
+        $.get("../sys/macro/queryMacrosByValue?value=goodsBizType", function (r) {
+            vm.macros = r.list;
+        });
+
+        $.get("../thirdmerchantbiz/queryAll", function (r) {
+            vm.thirdMerchantBizViewList = r.list;
+        });
+
+    }
+});