Procházet zdrojové kódy

修改部分页面表格多选为单选

hhq před 4 roky
rodič
revize
2f44c6cc5b

+ 18 - 18
kmall-admin/src/main/webapp/js/sale/realtimeSalesDetection.js

@@ -27,7 +27,7 @@ $(function () {
             {label: '门店名称', name: 'storeName', index: 'storeName', width: 120},
             {label: '商户编码', name: 'merchSn', index: 'storeId', width: 220},
             {label: '商户名称', name: 'merchName', index: 'storeName', width: 120},
-            {label: '售总额', name: 'totalSales', index: 'totalSales', align: 'right', width: 80},
+            {label: '售总额', name: 'totalSales', index: 'totalSales', align: 'right', width: 80},
             {label: '实际销售额', name: 'actualSales', index: 'actualSales', align: 'right', width: 80},
             {label: '占比 %', name: 'proportion', index: 'proportion', align: 'right', width: 60},
             {label: '优惠损失', name: 'preferentialLoss', index: 'preferentialLoss', align: 'right', width: 80},
@@ -152,7 +152,7 @@ let vm = new Vue({
         projectList: [
             {
                 id: '0',
-                name: '售总额'
+                name: '售总额'
             },
             {
                 id: '1',
@@ -354,7 +354,7 @@ let vm = new Vue({
                             vm.seriesList2[0] = '';
 
                             if (vm.dataList.length > 0) {
-                                vm.dataList[0] = '[]/售总额:元()';
+                                vm.dataList[0] = '[]/售总额:元()';
                                 console.log(vm.dataList);
 
                             }
@@ -461,9 +461,9 @@ let vm = new Vue({
                     if (vm.projectSelect == '0') {
                         vm.seriesList2.splice(1, 1, vm.totalSales2);
                         if (vm.xAxisList.type == 'dept') {
-                            vm.dataList.splice(1, 1, '[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                            vm.dataList.splice(1, 1, '[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                         } else {
-                            vm.dataList.splice(1, 1, '[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                            vm.dataList.splice(1, 1, '[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                         }
                         // pie 设置
                         vm.seriesList.splice(1, 1, {value: vm.totalSales2, name: vm.dataList[1]});
@@ -487,9 +487,9 @@ let vm = new Vue({
                     if (vm.projectSelect == '0') {
                         vm.seriesList2.push(vm.totalSales2);
                         if (vm.xAxisList.type == 'dept') {
-                            vm.dataList.push('[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                            vm.dataList.push('[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                         } else {
-                            vm.dataList.push('[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                            vm.dataList.push('[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                         }
                         // pie 设置
                         vm.seriesList.push({value: vm.totalSales2, name: vm.dataList[1]});
@@ -610,9 +610,9 @@ let vm = new Vue({
                         if (vm.projectSelect == '0') {
                             vm.seriesList2.splice(1, 1, vm.totalSales2);
                             if (vm.xAxisList.type== 'dept') {
-                                vm.dataList.splice(1, 1, '[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                                vm.dataList.splice(1, 1, '[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                             } else {
-                                vm.dataList.splice(1, 1, '[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                                vm.dataList.splice(1, 1, '[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                             }
                             // pie 设置
                             vm.seriesList.splice(1, 1, {value: vm.totalSales2, name: vm.dataList[1]});
@@ -632,9 +632,9 @@ let vm = new Vue({
                         if (vm.projectSelect == '0') {
                             vm.seriesList2.push(vm.totalSales2);
                             if (vm.xAxisList.type== 'dept') {
-                                vm.dataList.push('[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                                vm.dataList.push('[' + vm.merchSn + ']' + vm.merchName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                             } else {
-                                vm.dataList.push('[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
+                                vm.dataList.push('[' + vm.storeId + ']' + vm.storeName2 + '/售总额:' + vm.totalSales2 + '元(' + vm.salesDate2 + ')');
                             }
                             // pie 设置
                             vm.seriesList.push({value: vm.totalSales2, name: vm.dataList[1]});
@@ -704,9 +704,9 @@ let vm = new Vue({
             var temp = '';
             if (vm.xAxisList.projectSelect == '0') {
                 if (vm.xAxisList.type == 'dept') {
-                    temp = '[' + vm.xAxisList.merchSn + ']' + vm.xAxisList.merchName + '/售总额:' + vm.xAxisList.totalSales + '元(' + vm.xAxisList.salesDate + ')';
+                    temp = '[' + vm.xAxisList.merchSn + ']' + vm.xAxisList.merchName + '/售总额:' + vm.xAxisList.totalSales + '元(' + vm.xAxisList.salesDate + ')';
                 } else {
-                    temp = '[' + vm.xAxisList.storeId + ']' + vm.xAxisList.storeName + '/售总额:' + vm.xAxisList.totalSales + '元(' + vm.xAxisList.salesDate + ')';
+                    temp = '[' + vm.xAxisList.storeId + ']' + vm.xAxisList.storeName + '/售总额:' + vm.xAxisList.totalSales + '元(' + vm.xAxisList.salesDate + ')';
                 }
                 vm.seriesList2.push(vm.xAxisList.totalSales);
                 vm.seriesList.push({value: vm.xAxisList.totalSales, name: temp});
@@ -724,9 +724,9 @@ let vm = new Vue({
 
             // if (vm.projectSelect == '0') {
             //     if (vm.xAxisList.type== 'dept') {
-            //         temp = '[' + vm.merchSn + ']' + vm.merchName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
+            //         temp = '[' + vm.merchSn + ']' + vm.merchName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
             //     } else {
-            //         temp = '[' + vm.storeId + ']' + vm.storeName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
+            //         temp = '[' + vm.storeId + ']' + vm.storeName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
             //     }
             //     vm.seriesList2.push(vm.totalSales);
             //     vm.seriesList.push({value: vm.totalSales, name: temp});
@@ -776,7 +776,7 @@ let vm = new Vue({
                     }
                 },
                 legend: {
-                    data: ['/售总额']
+                    data: ['/售总额']
                 },
                 xAxis: {
                     data: vm.dataList,
@@ -804,9 +804,9 @@ let vm = new Vue({
         },
         tooltipFormatter: function () {
             if (vm.type == 'dept') {
-                return '[' + vm.merchSn + ']' + vm.merchName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
+                return '[' + vm.merchSn + ']' + vm.merchName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
             }
-            return '[' + vm.storeId + ']' + vm.storeName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
+            return '[' + vm.storeId + ']' + vm.storeName + '/售总额:' + vm.totalSales + '元(' + vm.salesDate + ')';
         },
         showTable: function (postParam) {
 

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

@@ -78,7 +78,7 @@ $(function () {
         shrinkToFit: false,
         autoScroll: true,   //开启水平滚动条
         width: 1600,
-        multiselect: true,
+        multiselect: true, //是否可以多选
         pager: "#jqGridPager",
         jsonReader: {
             root: "page.list",
@@ -91,6 +91,15 @@ $(function () {
             rows: "limit",
             order: "order"
         },
+        multiboxonly:true, //只能单选
+        beforeSelectRow:function beforeSelectRow() //只能单选
+        {
+            var s;
+            s = $("#table_name").jqGrid('getGridParam', 'selrow'); //获取最后选择行的id
+            $("#table_name").jqGrid('setSelection', s);
+            $("#table_name").jqGrid('resetSelection');
+            return(true);
+        },
         gridComplete: function () {
             $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
         }

+ 9 - 0
kmall-admin/src/main/webapp/js/shop/goodsbatch.js

@@ -26,6 +26,15 @@ $(function () {
         autoScroll: true,   //开启水平滚动条
         width: 1500,
         multiselect: true,
+        multiboxonly:true, //只能单选
+        beforeSelectRow:function beforeSelectRow() //只能单选
+        {
+            var s;
+            s = $("#table_name").jqGrid('getGridParam', 'selrow'); //获取最后选择行的id
+            $("#table_name").jqGrid('setSelection', s);
+            $("#table_name").jqGrid('resetSelection');
+            return(true);
+        },
         pager: "#jqGridPager",
         jsonReader: {
             root: "page.list",

+ 3 - 3
kmall-admin/src/main/webapp/js/shop/mngchange.js

@@ -4,7 +4,7 @@ $(function () {
         datatype: "json",
         colModel: [
 			{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
-            {label: '变动类型', name: 'changeType', index: 'change_type', width: 80, align: 'center',
+            {label: '变动类型', name: 'changeType', index: 'change_type', width: 120, align: 'center',
                 formatter: function (value) {
                     if (value == '0') {
                         return '还原';
@@ -27,7 +27,7 @@ $(function () {
 			{label: '所属商户', name: 'merchName', index: 'merchName', width: 80, align: 'center'},
 			{label: '第三方商户代码', name: 'thirdPartyMerchCode', index: 'third_party_merch_code', width: 140, align: 'center'},
             {label: '第三方商户名称', name: 'thirdPartyMerchName', index: 'thirdPartyMerchName', width: 140, align: 'center'},
-            {label: '所属商品', name: 'goodsName', index: 'goodsName', width: 180},
+            {label: '所属商品', name: 'goodsName', index: 'goodsName', width: 220},
             // {label: '是否有效', name: 'isValid', index: 'is_valid', width: 50, align: 'center',
             //     formatter: function (value) {
             //         if (value == '0') {
@@ -56,7 +56,7 @@ $(function () {
         shrinkToFit: false,
         autoScroll: true,   //开启水平滚动条
         width: 1500,
-        multiselect: true,
+        // multiselect: true,
         pager: "#jqGridPager",
         jsonReader: {
             root: "page.list",

+ 9 - 0
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -113,6 +113,15 @@ $(function () {
             rows: "limit",
             order: "order"
         },
+        multiboxonly:true, //只能单选
+        beforeSelectRow:function beforeSelectRow() //只能单选
+        {
+            var s;
+            s = $("#table_name").jqGrid('getGridParam', 'selrow'); //获取最后选择行的id
+            $("#table_name").jqGrid('setSelection', s);
+            $("#table_name").jqGrid('resetSelection');
+            return(true);
+        },
         gridComplete: function () {
             $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "scroll"});
         }

+ 2 - 2
kmall-admin/src/main/webapp/js/shop/storemngchange.js

@@ -4,7 +4,7 @@ $(function () {
         datatype: "json",
         colModel: [
 			{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
-            {label: '变动类型', name: 'changeType', index: 'change_type', width: 160,
+            {label: '变动类型', name: 'changeType', index: 'change_type', width: 160, align: 'center',
                 formatter: function (value) {
                     if (value == '0') {
                         return '还原';
@@ -55,7 +55,7 @@ $(function () {
         shrinkToFit: false,
         autoScroll: true,   //开启水平滚动条
         width: 1500,
-        multiselect: true,
+        // multiselect: true,
         pager: "#jqGridPager",
         jsonReader: {
             root: "page.list",