Quellcode durchsuchen

Merge branch 'deploy_0804' of jianguan-web/jg-ocs-html into master

陈瑞 vor 3 Jahren
Ursprung
Commit
510aa4caac
100 geänderte Dateien mit 3224 neuen und 1643 gelöschten Zeilen
  1. 1 0
      .env
  2. 2 1
      .env.development
  3. 11 0
      .env.practice
  4. 2 1
      .env.preview
  5. 19 0
      package-lock.json
  6. 2 0
      package.json
  7. 1 0
      public/index.html
  8. 130 0
      public/menus.js
  9. 23 5
      src/App.vue
  10. 25 1
      src/api/allocateBill.js
  11. 44 0
      src/api/dealerRecevieAddr.js
  12. 18 0
      src/api/product.js
  13. 28 0
      src/api/reportData.js
  14. 39 0
      src/api/sales.js
  15. 4 1
      src/api/salesDetail.js
  16. 35 11
      src/api/salesReturn.js
  17. 1 1
      src/components/Menu/SideMenu.vue
  18. 8 1
      src/components/Menu/menu.js
  19. 1 1
      src/components/MultiTab/MultiTab.vue
  20. 6 1
      src/components/Select/index.js
  21. 6 6
      src/components/Table/index.js
  22. 162 0
      src/components/custom.less
  23. 4 3
      src/components/global.less
  24. 52 2
      src/config/router.config.js
  25. 4 3
      src/layouts/BasicLayout.vue
  26. 8 2
      src/layouts/PageView.vue
  27. 6 0
      src/main.js
  28. 1 1
      src/views/Home.vue
  29. 168 0
      src/views/allocationManagement/transferOut/chooseImportModal.vue
  30. 20 20
      src/views/allocationManagement/transferOut/detail.vue
  31. 161 124
      src/views/allocationManagement/transferOut/edit.vue
  32. 219 0
      src/views/allocationManagement/transferOut/importGuideModal.vue
  33. 53 28
      src/views/allocationManagement/transferOut/list.vue
  34. 16 7
      src/views/basicData/transferTypeManagement/list.vue
  35. 15 5
      src/views/basicData/warehouse/list.vue
  36. 16 6
      src/views/basicData/warehouse/storingLocation/list.vue
  37. 1 5
      src/views/bnSetting/menu/adminMenus.vue
  38. 0 1
      src/views/bnSetting/menu/storeMenus.vue
  39. 3 3
      src/views/common/chooseCustomerModal.vue
  40. 49 34
      src/views/common/chooseProductsModal.vue
  41. 32 26
      src/views/common/chooseSupplierModal.vue
  42. 22 8
      src/views/common/chooseTypeModal.vue
  43. 29 1
      src/views/common/custList.vue
  44. 79 0
      src/views/common/dealerSubareaScopeList.vue
  45. 11 5
      src/views/common/productCodeList.vue
  46. 14 14
      src/views/common/productType.js
  47. 5 0
      src/views/common/rangeDate.vue
  48. 5 0
      src/views/common/rangeDateTime.vue
  49. 51 0
      src/views/common/tablePagination.vue
  50. 5 1
      src/views/dealerManagement/dealerAccountManagement/editModal.vue
  51. 24 14
      src/views/dealerManagement/dealerAccountManagement/list.vue
  52. 36 20
      src/views/dealerManagement/dealerRelationshipBinding/list.vue
  53. 21 7
      src/views/dealerManagement/marketingDivisionSet/list.vue
  54. 6 5
      src/views/dealerManagement/merchantInfoManagement/detailModal.vue
  55. 18 17
      src/views/dealerManagement/merchantInfoManagement/edit.vue
  56. 44 31
      src/views/dealerManagement/merchantInfoManagement/list.vue
  57. 47 81
      src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue
  58. 74 61
      src/views/dealerManagement/rebateSettings/list.vue
  59. 45 35
      src/views/financialManagement/financialCollection/list.vue
  60. 1 1
      src/views/financialManagement/inventoryReview/detail.vue
  61. 1 1
      src/views/financialManagement/inventoryReview/list.vue
  62. 48 34
      src/views/financialManagement/returnConfirmation/list.vue
  63. 38 34
      src/views/financialManagement/warehousingConfirmation/list.vue
  64. 1 1
      src/views/inventoryManagement/intelligentReplenishment/detailModal.vue
  65. 19 1
      src/views/inventoryManagement/intelligentReplenishment/edit.vue
  66. 18 3
      src/views/inventoryManagement/intelligentReplenishment/list.vue
  67. 5 1
      src/views/inventoryManagement/intelligentReplenishment/productRange.vue
  68. 2 2
      src/views/inventoryManagement/inventoryChecking/detail.vue
  69. 2 2
      src/views/inventoryManagement/inventoryChecking/financialAuditDetail.vue
  70. 1 1
      src/views/inventoryManagement/inventoryChecking/makeInventory.vue
  71. 2 2
      src/views/inventoryManagement/inventoryChecking/makeInventoryDetail.vue
  72. 4 4
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  73. 23 21
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  74. 46 37
      src/views/inventoryManagement/inventoryQuery/list.vue
  75. 129 97
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  76. 78 90
      src/views/inventoryManagement/inventoryWarning/list.vue
  77. 19 13
      src/views/power/OperateJournal/OperateJournal.vue
  78. 0 1
      src/views/power/menu/menu.vue
  79. 24 46
      src/views/power/role/roleList.vue
  80. 19 26
      src/views/power/user/userList.vue
  81. 50 42
      src/views/productManagement/priceChangeRecord/list.vue
  82. 19 9
      src/views/productManagement/productBrand/list.vue
  83. 2 1
      src/views/productManagement/productCategory/list.vue
  84. 18 11
      src/views/productManagement/productInfo/edit.vue
  85. 49 31
      src/views/productManagement/productInfo/list.vue
  86. 28 26
      src/views/productManagement/productLaunchAudit/list.vue
  87. 42 25
      src/views/productManagement/productLevel/list.vue
  88. 42 27
      src/views/productManagement/productOfflineAudit/list.vue
  89. 139 123
      src/views/productManagement/productPricing/list.vue
  90. 38 21
      src/views/productManagement/productUniversal/list.vue
  91. 5 5
      src/views/productManagement/purchaseBaseLimit/list.vue
  92. 114 104
      src/views/promotionRulesManagement/orderStatistics/list.vue
  93. 115 96
      src/views/promotionRulesManagement/productStatistics/list.vue
  94. 0 0
      src/views/promotionRulesManagement/promotionRules/chooseImportModal.vue
  95. 21 19
      src/views/promotionRulesManagement/promotionRules/choosePriceProductsModal.vue
  96. 85 58
      src/views/promotionRulesManagement/promotionRules/detail.vue
  97. 1 1
      src/views/promotionRulesManagement/promotionRules/importGuideModal.vue
  98. 26 21
      src/views/promotionRulesManagement/promotionRules/list.vue
  99. 17 4
      src/views/promotionRulesManagement/promotionRules/rule.vue
  100. 1 1
      src/views/purchasingManagement/bulkWarehousingOrder/detailModal.vue

+ 1 - 0
.env

@@ -3,6 +3,7 @@ VUE_APP_PREVIEW=false
 VUE_APP_API_BASE_URL=http://ocs-admin.360arrow.com/ocs-admin
 VUE_APP_WX_BASE_URL=//ocs-admin.360arrow.com/ocs-admin/websocket/
 VUE_APP_VERSION=V1.0.1
+VUE_APP_ENVTIPS=
 VUE_APP_PRO_NAME=箭冠运营中心系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24

+ 2 - 1
.env.development

@@ -3,7 +3,8 @@ VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
 VUE_APP_WX_BASE_URL=//192.168.16.103:8602/ocs-admin/websocket/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=箭冠运营中心系统-dev
+VUE_APP_ENVTIPS=开发环境
+VUE_APP_PRO_NAME=箭冠运营中心系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
 VUE_APP_COM_NAME=陕西山海高科信息技术有限公司

+ 11 - 0
.env.practice

@@ -0,0 +1,11 @@
+NODE_ENV=production
+VUE_APP_PREVIEW=true
+VUE_APP_API_BASE_URL=http://t.ocs.360arrow.com/ocs-admin
+VUE_APP_WX_BASE_URL=//t.ocs.360arrow.com/ocs-admin/websocket/
+VUE_APP_VERSION=V1.0.1
+VUE_APP_ENVTIPS=练习环境
+VUE_APP_PRO_NAME=箭冠运营中心系统
+VUE_APP_LOGO=@/assets/logo.png
+VUE_APP_THEME_COLOR=#ed1c24
+VUE_APP_COM_NAME=陕西山海高科信息技术有限公司
+VUE_APP_ICP=陕ICP备20006268号

+ 2 - 1
.env.preview

@@ -3,7 +3,8 @@ VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=http://ocs-admin.360arrow.com.cn/ocs-admin
 VUE_APP_WX_BASE_URL=//ocs-admin.360arrow.com.cn/ocs-admin/websocket/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=箭冠运营中心系统-pre
+VUE_APP_ENVTIPS=预发布环境
+VUE_APP_PRO_NAME=箭冠运营中心系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
 VUE_APP_COM_NAME=陕西山海高科信息技术有限公司

+ 19 - 0
package-lock.json

@@ -15832,6 +15832,11 @@
       "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=",
       "dev": true
     },
+    "throttle-debounce": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-2.3.0.tgz",
+      "integrity": "sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ=="
+    },
     "through": {
       "version": "2.3.8",
       "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@@ -16358,6 +16363,15 @@
       "resolved": "https://registry.npmjs.org/v-runtime-template/-/v-runtime-template-1.10.0.tgz",
       "integrity": "sha512-WLlq9jUepSfUrMEenw3mn7FDXX6hhbl11JjC1OKhwLzifHzVrY5a696TUHDPyj9jke3GGnR7b+2T3od/RL5cww=="
     },
+    "v-viewer": {
+      "version": "1.6.4",
+      "resolved": "https://registry.npmjs.org/v-viewer/-/v-viewer-1.6.4.tgz",
+      "integrity": "sha512-LVkiUHpmsbsZXebeNXnu8krRCi5i2n07FeLFxoIVGhw8lVvTBO0ffpbDC6mLEuacCjrIh09HjIqpciwUtWE8lQ==",
+      "requires": {
+        "throttle-debounce": "^2.0.1",
+        "viewerjs": "^1.5.0"
+      }
+    },
     "validate-npm-package-license": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
@@ -16401,6 +16415,11 @@
         "extsprintf": "^1.2.0"
       }
     },
+    "viewerjs": {
+      "version": "1.10.1",
+      "resolved": "https://registry.npmjs.org/viewerjs/-/viewerjs-1.10.1.tgz",
+      "integrity": "sha512-Oyzd3JP9dDSd+bBulfnQ+UTfHoobFwkmcT/uKSnQXjmPz7rZU0HJIiKudxPaMsiv17dr4Sm1cHnASJcDlFw1PA=="
+    },
     "viser": {
       "version": "2.4.6",
       "resolved": "https://registry.npmjs.org/viser/-/viser-2.4.6.tgz",

+ 2 - 0
package.json

@@ -7,6 +7,7 @@
     "dev": "vue-cli-service serve",
     "build": "vue-cli-service build",
     "uat": "vue-cli-service build --mode preview",
+    "pra": "vue-cli-service build --mode practice",
     "lint": "vue-cli-service lint",
     "lint:nofix": "vue-cli-service lint --no-fix",
     "test:unit": "vue-cli-service test:unit",
@@ -25,6 +26,7 @@
     "moment": "^2.24.0",
     "nprogress": "^0.2.0",
     "v-runtime-template": "^1.10.0",
+    "v-viewer": "^1.6.4",
     "viser-vue": "^2.4.6",
     "vue": "^2.6.10",
     "vue-clipboard2": "^0.2.1",

+ 1 - 0
public/index.html

@@ -11,6 +11,7 @@
     <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
     <link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
     <% } %>
+  <script src="./menus.js"></script>
 	<script>
 		//  非谷歌浏览器或非IE11时,则提示下载谷歌浏览器进行访问
 		function BrowserType () {

+ 130 - 0
public/menus.js

@@ -0,0 +1,130 @@
+const {
+  remote,
+  clipboard
+} = require('electron');
+const { Menu, MenuItem } = remote
+
+// var rightTemplate = [{
+//     label: "复制",
+//     accelerator: 'ctrl+c',
+//     click: function() {
+//       console.log('复制',window.getSelection().toString())
+//       clipboard.writeText(window.getSelection().toString(), 'selection');
+//     }
+//   },
+//   {
+//     label: "粘贴",
+//     accelerator: 'ctrl+v',
+//     click: function() {
+//       console.log('粘贴')
+//       clipboard.readText('selection');
+//     }
+//   }
+// ]
+// console.log(remote)
+// var m = remote.Menu.buildFromTemplate(rightTemplate);
+
+// window.addEventListener('contextmenu', function(e) {
+//   e.preventDefault();
+//   var hasSelection = window.getSelection().toString()
+//   if(hasSelection.length){
+//     m.popup({
+//       window: remote.getCurrentWindow()
+//     });
+//   }
+// })
+
+// const inputs = document.querySelectorAll("input,textarea")
+// console.log(inputs)
+// for (const inp of inputs) {
+//   inp.addEventListener("focus", function(e){
+//     console.log(e)
+//     var hasSelection = window.getSelection().toString()
+//     if(hasSelection.length){
+//       m.popup({
+//         window: remote.getCurrentWindow()
+//       });
+//     }
+//   });
+// }
+
+// 写入剪贴板方法
+function copyString () {
+  const str = getSelections() // 获取选中内容
+  clipboard.writeText(str) // 写入剪贴板
+}
+// 获取剪贴版内容写入当前焦点元素中
+function printString () {
+  if (document.activeElement) {
+    const str = clipboard.readText() // 获取剪贴板内容
+    document.activeElement.value = str // 写入焦点元素
+    var eventchange = new Event('change');
+    var eventinput = new Event('input');
+    document.activeElement.dispatchEvent(eventchange);
+    document.activeElement.dispatchEvent(eventinput);
+    clipboard.clear() // 清空剪贴板
+  }
+}
+
+function getContextMenu(){
+  // 监听contextmenu,实现自定义右键菜单
+    window.addEventListener('contextmenu', function (e) {
+      e.preventDefault()
+      let menu = new Menu()
+  
+      // ↓ 情况一:任何情况下,都显示 复制 和 粘贴 按钮
+      //添加菜单功能, label: 菜单名称, accelerator:快捷键,click:点击方法
+      // menu.append(new MenuItem({ label: '复制', accelerator: 'CommandOrControl+C', click: copyString }))
+      // //添加菜单分割线
+      // menu.append(new MenuItem({ type: 'separator' }))
+      // //添加菜单功能
+      // menu.append(new MenuItem({ label: '粘贴', accelerator: 'CommandOrControl+V', click: printString }))
+      // ↑ 情况一
+  
+      // ↓ 情况二:可复制时,显示复制,可粘贴时显示粘贴
+      let flag = false // menu中是否有菜单项,true有,false没有
+      const tagName = document.activeElement.tagName // 焦点元素的tagName
+      const str = clipboard.readText() // 剪贴板中的内容
+      let selectStr = getSelections()// 选中的内容
+      const text = e.target.innerText || '' // 目标标签的innerText
+      const value = e.target.value || '' // 目标标签的value
+  
+      if (selectStr) { // 如果有选中内容
+        flag = true
+        selectStr = selectStr.replace(/\r\n\t\f\v/g,"")
+        selectStr = selectStr.replace(/\n/g,"")
+        selectStr = selectStr.replace(/\t/g,"")
+        selectStr = selectStr.replace(/\f/g,"")
+        selectStr = selectStr.replace(/\v/g,"")
+        // 在 选中的元素或者输入框 上面点右键,这样在选中后点别处就不会出现右键复制菜单
+        if (text.indexOf(selectStr) !== -1 || value.indexOf(selectStr) !== -1) menu.append(new MenuItem({ label: '复制', click: copyString }))
+      }
+      if (str && (tagName === 'INPUT' || tagName === 'TEXTAREA')) { // 若为输入框 且 剪贴板中有内容,则显示粘贴菜单
+        flag = true
+        menu.append(new MenuItem({ label: '粘贴', click: printString }))
+      }
+  
+      // ↑ 情况二
+      // menu中有菜单项 且(有选中内容 或 剪贴板中有内容)
+      console.log(flag,getSelections(),str)
+      if (flag && (getSelections() || str)) {
+        // 将此menu菜单作为 当前窗口 remote.getCurrentWindow() 中的上下文菜单弹出。
+        menu.popup(remote.getCurrentWindow())
+      }
+    }, false)
+}
+
+// 获取选中内容
+function getSelections () {
+  var text = ''
+  if (window.getSelection) { // 除IE9以下 之外的浏览器
+    text = window.getSelection().toString()
+  } else if (document.selection && document.selection.type !== 'Control') { //IE9以下,可不考虑
+    text = document.selection.createRange().text
+  }
+  if (text) {
+    return text
+  }
+}
+
+getContextMenu()

+ 23 - 5
src/App.vue

@@ -1,23 +1,28 @@
 <template>
-  <a-locale-provider :locale="locale">
+  <a-config-provider :locale="locale">
     <div id="app">
+      <div v-if="envtips!=''" class="envtipsBox">{{ envtips }}</div>
       <router-view/>
     </div>
-  </a-locale-provider>
+  </a-config-provider>
 </template>
 
 <script>
-import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
+import zhCN from 'ant-design-vue/es/locale/zh_CN'
 import { AppDeviceEnquire } from '@/utils/mixin'
-
+import moment from 'moment'
+import 'moment/locale/zh-cn'
+moment.locale('zh-cn')
 export default {
   mixins: [AppDeviceEnquire],
   data () {
     return {
-      locale: zhCN
+      locale: zhCN,
+      envtips: ''
     }
   },
   created () {
+    this.envtips = process.env.VUE_APP_ENVTIPS
     // 在页面加载时读取sessionStorage
     if (sessionStorage.getItem('store')) {
       const data = JSON.parse(sessionStorage.getItem('store'))
@@ -35,4 +40,17 @@ export default {
   #app {
     height: 100%;
   }
+  .envtipsBox{
+    position: fixed;
+    z-index: 100000;
+    background: red;
+    width: 230px;
+    text-align: center;
+    color: #fff;
+    font-size: 30px;
+    top: 0;
+    left: 0;
+    width: 50%;
+    margin-left: 25%;
+  }
 </style>

+ 25 - 1
src/api/allocateBill.js

@@ -106,8 +106,32 @@ export const allocateBillDetailSave = params => {
 // 调拨管理 详情  打印
 export const allocateBillDetailPrint = params => {
   return axios.request({
-    url: `allocateBill/print/${params.sn}/${params.isPreview}`,
+    url: `/allocateBill/print/${params.sn}/${params.isPreview}`,
     method: 'get',
     responseType: 'blob'
   })
 }
+// 调拨管理 下载模板
+export const allocateBillDownload = params => {
+  return axios.request({
+    url: `/allocateBill/detail/downloadExcel`,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 调拨管理  解析导入的文件
+export const allocateBillParseProducts = params => {
+  return axios({
+    url: '/allocateBill/detail/parseProducts',
+    data: params,
+    method: 'post'
+  })
+}
+// 调拨管理  批量插入
+export const allocateBillBatchInsert = params => {
+  return axios({
+    url: '/allocateBill/detail/batchInsert',
+    data: params,
+    method: 'post'
+  })
+}

+ 44 - 0
src/api/dealerRecevieAddr.js

@@ -0,0 +1,44 @@
+import { axios } from '@/utils/request'
+
+//  收货地址 列表  有分页
+export const dealerRecevieAddrList = (params) => {
+  const url = `/dealerRecevieAddr/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  收货地址 列表
+export const dealerRecevieAddrQuery = (params) => {
+  return axios({
+    url: '/dealerRecevieAddr/queryList',
+    data: params,
+    method: 'post'
+  })
+}
+//  收货地址 保存
+export const dealerRecevieAddrSave = (params) => {
+  return axios({
+    url: '/dealerRecevieAddr/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  收货地址 设置默认
+export const dealerRecevieAddrSet = (params) => {
+  return axios({
+    url: `/dealerRecevieAddr/setDefault/${params.id}`,
+    method: 'get'
+  })
+}
+//  收货地址 删除
+export const dealerRecevieAddrDel = (params) => {
+  return axios({
+    url: `/dealerRecevieAddr/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}

+ 18 - 0
src/api/product.js

@@ -220,3 +220,21 @@ export const productLevelSave = (params) => {
     method: 'post'
   })
 }
+//  价格查询 列表  分页
+export const productPriceList = (params) => {
+  const url = `/product/price/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  产品 获取价格
+export const productPriceInfo = (params) => {
+  return axios({
+    url: `/product/getProductPriceInfo/${params.sn}`,
+    method: 'get'
+  })
+}

+ 28 - 0
src/api/reportData.js

@@ -123,3 +123,31 @@ export const headRebateDetailReportCount = (params) => {
     method: 'post'
   })
 }
+//  差价明细报表
+export const reportRebateReportList = (params) => {
+  const url = `/report/reportRebate/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  差价明细报表  合计
+export const reportRebateCount = (params) => {
+  return axios({
+    url: '/report/reportRebate/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  差价明细报表 导出
+export const reportRebateExport = (params) => {
+  return axios({
+    url: '/report/reportRebate/export',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 39 - 0
src/api/sales.js

@@ -129,3 +129,42 @@ export const salesPromoCount = (params) => {
     method: 'post'
   })
 }
+// 销售  详情  该销售单的产品二级分类
+export const salesDetailProductType = (params) => {
+  return axios({
+    url: `/sales/detail/queryProductType/${params.sn}`,
+    method: 'get'
+  })
+}
+// 销售 详情  打印
+export const salesDetailPrint = params => {
+  const url = `/sales/print/${params.priceType}`
+  delete params.priceType
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 销售 详情  导出
+export const salesDetailExcel = params => {
+  const url = `/sales/excel/${params.priceType}`
+  delete params.priceType
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 销售 详情  分类导出
+export const salesDetailTypeExcel = params => {
+  const url = `/sales/detail/typeExcel`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 4 - 1
src/api/salesDetail.js

@@ -89,8 +89,11 @@ export const salesDetailDelAll = (params) => {
 
 // 获取产品适用活动的促销产品列表
 export const getPromoGoodsList = (params) => {
+  const url = `/sales/detail/getPromoGoodsList/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: `/sales/detail/getPromoGoodsList`,
+    url: url,
     data: params,
     method: 'post'
   })

+ 35 - 11
src/api/salesReturn.js

@@ -52,21 +52,21 @@ export const salesReturnPay = (params) => {
   })
 }
 
-//  销售退货 打印
+//  销售退货 打印预览
 export const salesReturnPrint = (params) => {
-  return axios({
-    url: '/salesReturn/print',
-    data: params,
-    method: 'post'
+  return axios.request({
+    url: `/salesReturn/print/${params.sn}`,
+    method: 'get',
+    responseType: 'blob'
   })
 }
 
-//  销售退货 打印预览
-export const salesReturnPrintPreview = (params) => {
-  return axios({
-    url: '/salesReturn/printPreview',
-    data: params,
-    method: 'post'
+//  销售退货 导出
+export const salesReturnExport = (params) => {
+  return axios.request({
+    url: `/salesReturn/export/${params.sn}`,
+    method: 'get',
+    responseType: 'blob'
   })
 }
 
@@ -141,3 +141,27 @@ export const salesReturnFinancial = (params) => {
     method: 'post'
   })
 }
+// 退货确认 下载模板
+export const salesReturnDownload = params => {
+  return axios.request({
+    url: `/salesReturn/detail/downloadExcel/${params.grabFlag}`,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 退货确认  解析导入的文件
+export const salesReturnParseProducts = params => {
+  return axios({
+    url: '/salesReturn/detail/parseProducts',
+    data: params,
+    method: 'post'
+  })
+}
+// 退货确认  批量插入
+export const salesReturnBatchInsert = params => {
+  return axios({
+    url: '/salesReturn/detail/batchInsert',
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
src/components/Menu/SideMenu.vue

@@ -1,7 +1,7 @@
 <template>
   <a-layout-sider
     :class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]"
-    width="256px"
+    width="230px"
     :collapsible="collapsible"
     v-model="collapsed"
     :trigger="null">

+ 8 - 1
src/components/Menu/menu.js

@@ -116,11 +116,18 @@ export default {
       return (
         <Item {...{ key: menu.path }}>
           <tag {...{ props, attrs }}>
-            {this.renderIcon(menu.meta.icon)}
             <span>{menu.meta.title}</span>
           </tag>
         </Item>
       )
+      // return (
+      //   <Item {...{ key: menu.path }}>
+      //     <tag {...{ props, attrs }}>
+      //       {this.renderIcon(menu.meta.icon)}
+      //       <span>{menu.meta.title}</span>
+      //     </tag>
+      //   </Item>
+      // )
     },
     renderSubMenu (menu) {
       const itemArr = []

+ 1 - 1
src/components/MultiTab/MultiTab.vue

@@ -165,7 +165,7 @@ export default {
 
     return (
       <div class="ant-pro-mu  lti-tab">
-        <div class="ant-pro-multi-tab-wrapper">
+        <div class="ant-pro-multi-tab-wrapper multi-tab-con">
           <a-tabs
             hideAdd
             type={'editable-card'}

+ 6 - 1
src/components/Select/index.js

@@ -25,6 +25,10 @@ export default {
     showType: {
       type: String,
       default: 'select'
+    },
+    isEnable: { // 是否只获取已启用的数据
+      type: Boolean,
+      default: false
     }
   }),
   created () {
@@ -33,7 +37,8 @@ export default {
     getLookUpData({
       pageNo: 1,
       pageSize: 1000,
-      lookupCode: _this.code
+      lookupCode: _this.code,
+      isEnable: _this.isEnable ? 1 : undefined
     }).then(res => {
       if (res.status == 200) {
         _this.dataList = res.data.list

+ 6 - 6
src/components/Table/index.js

@@ -5,13 +5,11 @@ export default {
   data () {
     return {
       needTotalList: [],
-
       selectedRows: [],
       selectedRowKeys: [],
-
       localLoading: false,
       localDataSource: [],
-      localPagination: Object.assign({'show-total':total => `共 ${total} 条`}, this.pagination)
+      localPagination: Object.assign({}, this.pagination)
     }
   },
   props: Object.assign({}, T.props, {
@@ -33,7 +31,7 @@ export default {
     },
     pageSize: {
       type: Number,
-      default: 10
+      default: 20
     },
     showSizeChanger: {
       type: Boolean,
@@ -125,6 +123,7 @@ export default {
     this.localPagination = ['auto', true].includes(this.showPagination) && Object.assign({}, this.localPagination, {
       current: localPageNum,
       pageSize: this.pageSize,
+      showTotal: total => `共 ${total} 条记录`,
       showSizeChanger: this.showSizeChanger
     }) || false
     // console.log('this.localPagination', this.localPagination)
@@ -140,13 +139,14 @@ export default {
      * @param Boolean bool
      */
     refresh (bool = false) {
+      console.log(this.showSizeChanger, '-----showSizeChanger', this.pageSize)
       bool && (this.localPagination = Object.assign({}, {
-        current: 1, pageSize: this.pageSize
+        current: 1, pageSize: this.pageSize, showSizeChanger: this.showSizeChanger
       }))
       this.loadData()
     },
     // 重置表格为空
-    clearTable(){
+    clearTable () {
       this.localDataSource = []
       this.localPagination = Object.assign({}, {
         current: 1, pageSize: this.pageSize, total: 0

+ 162 - 0
src/components/custom.less

@@ -0,0 +1,162 @@
+// 自定义样式文件   覆盖框架样式
+
+body{
+  font-size: 13px!important;
+  span,td,label,.ant-btn-sm{
+    font-size: 13px!important;
+  }
+}
+// 查询条件样式
+.table-page-search-wrapper {
+  .ant-form.ant-form-inline{
+    .ant-form-item {
+      margin-bottom: 10px;
+      .ant-input,.ant-select-selection{
+        border-radius: 2px;
+        padding: 0px 11px;
+      }
+      .ant-form-item-label{
+        line-height: 32px!important;
+        padding-right: 8px!important;
+      }
+      .ant-form-item-control{
+        line-height: 31px!important;
+      }
+      .ant-form-item-control-wrapper{
+        .ant-select-selection__rendered{
+          margin: 0!important;
+        }
+      }
+    }
+  }
+  .form-model-con{  // a-form-model  有必选条件(因校验提示信息原因,因此边距需高于无必选条件边距)
+    .ant-form-item {
+      margin-bottom: 16px!important;
+      .ant-form-explain{
+        font-size: 12px;
+      }
+    }
+  }
+  .table-page-search-submitButtons {
+    margin-bottom: 10px;
+  }
+}
+// 菜单样式
+.sider {
+  .logo {
+    h1 {
+      font-size: 15px!important;
+    }
+  }
+  .ant-menu{
+    .ant-menu-item{
+      // padding-left: 10px!important;  //  只有一级菜单时的左侧缩进(例:首页)
+    }
+    .ant-menu-submenu{
+      .ant-menu-submenu-title{
+        // padding-left: 10px!important;  //  多级菜单的一级菜单左侧缩进
+      }
+      .ant-menu-item{  //  二级菜单左侧缩进
+        padding-left: 30px!important;
+      }
+    }
+  }
+}
+// 内容盒子样式
+.content {
+  .table-operator {
+    padding: 8px 0;
+  }
+  .table-operator-nobor{
+    padding: 0 0 10px 0;
+    button {
+      margin-right: 5px;
+    }
+  }
+  .affix-cont{
+    z-index: 99;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    text-align: center;
+    background-color: #fff;
+    padding: 7px 0 4px;
+    box-shadow: 0 0 20px #dcdee2;
+  }
+}
+// 页签样式
+.multi-tab-con{
+  .ant-tabs-nav-container{
+    height: 25px!important;
+    .ant-tabs-tab{
+      padding: 0 8px!important;
+      height: 24px!important;
+      line-height: 24px!important;
+    }
+  }
+}
+// a-alert样式
+.ant-alert,.ant-alert-info{
+  .ant-alert-icon{
+    top: 6.5px!important;
+    left: 5px!important;
+  }
+  padding: 3px 10px!important;
+  border-radius: 2px!important;
+}
+.ant-page-header{
+  padding: 5px 10px!important;
+}
+// 折叠面板 样式
+.ant-collapse{
+  .ant-collapse-header{
+    padding-top: 8px!important;
+    padding-bottom: 8px!important;
+  }
+  .ant-collapse-content-box{
+    padding: 10px 12px 5px!important;
+    .ant-descriptions-item{
+      padding-bottom: 10px!important;
+    }
+  }
+}
+// 表格 样式
+.sTable{
+  .ant-table{
+    .ant-table-content{
+      .ant-table-header tr th, .ant-table-thead tr th{
+        background: #fafafa!important;
+        font-weight: bold;
+      }
+    }
+  }
+  .ant-table-row{
+    .ant-table-row-cell-break-word, td{
+      padding: 6px 4px!important;
+    }
+  }
+  .ant-pagination.ant-table-pagination{
+    margin: 10px 0;
+  }
+  .ant-table-small > .ant-table-content > .ant-table-body{
+    margin: 0;
+  }
+}
+.sTable.fixPagination{
+  >.ant-table-wrapper{
+    height: 100%;
+    >.ant-spin-nested-loading{
+      height: 100%;
+      >.ant-spin-container{
+        height: 100%;
+        position: relative;
+        .ant-pagination.ant-table-pagination{
+          position: absolute;
+          right: 0;
+          bottom: 0;
+        }
+      }
+    }
+  }
+}

+ 4 - 3
src/components/global.less

@@ -133,7 +133,7 @@ body {
       transition: width 0.2s;
 
       &.ant-header-side-opened {
-        width: calc(100% - 256px);
+        width: calc(100% - 230px);
       }
 
       &.ant-header-side-closed {
@@ -151,7 +151,7 @@ body {
       right:0;
       margin: auto;
       &.ant-header-side-opened {
-        width: calc(100% - 256px);
+        width: calc(100% - 230px);
       }
       
       &.ant-header-side-closed {
@@ -480,7 +480,8 @@ body {
   padding: 4px 0;
 
   .ant-dropdown-menu-item {
-    width: 160px;
+    // width: 160px;
+    width: 100%;
   }
 
   .ant-dropdown-menu-item > .anticon:first-child,

+ 52 - 2
src/config/router.config.js

@@ -357,6 +357,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/salesManagement/priceInquiry',
+            redirect: '/salesManagement/priceInquiry/list',
+            name: 'priceInquiry',
+            component: RouteView,
+            meta: {
+              title: '价格查询',
+              icon: 'file-protect',
+              permission: 'M_priceInquiryList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'priceInquiryList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/salesManagement/priceInquiry/list.vue'),
+                meta: {
+                  title: '价格查询列表',
+                  icon: 'file-protect',
+                  hidden: true,
+                  permission: 'M_priceInquiryList'
+                }
+              }
+            ]
           }
         ]
       },
@@ -1132,13 +1157,38 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/hPriceDifferenceDetailReport',
+            redirect: '/reportData/hPriceDifferenceDetailReport/list',
+            name: 'hPriceDifferenceDetailReport',
+            component: RouteView,
+            meta: {
+              title: '总部差价明细报表',
+              icon: 'profile',
+              permission: 'M_hPriceDifferenceDetailReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'hPriceDifferenceDetailReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/hPriceDifferenceDetailReport/list.vue'),
+                meta: {
+                  title: '总部差价明细列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_hPriceDifferenceDetailReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/priceDifferenceDetailReport',
             redirect: '/reportData/priceDifferenceDetailReport/list',
             name: 'priceDifferenceDetailReport',
             component: RouteView,
             meta: {
-              title: '总部差价明细报表',
+              title: '差价明细报表',
               icon: 'profile',
               permission: 'M_priceDifferenceDetailReportList'
             },
@@ -1149,7 +1199,7 @@ export const asyncRouterMap = [
                 name: 'priceDifferenceDetailReportList',
                 component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/priceDifferenceDetailReport/list.vue'),
                 meta: {
-                  title: '总部差价明细列表',
+                  title: '差价明细列表',
                   icon: 'profile',
                   hidden: true,
                   permission: 'M_priceDifferenceDetailReportList'

+ 4 - 3
src/layouts/BasicLayout.vue

@@ -39,7 +39,7 @@
         @toggle="toggle"
       />
       <!-- layout content -->
-      <a-layout-content :style="{ height: '100%', margin: '24px 24px 0', paddingTop: multiTab&&fixedHeader ? '85px' : (!multiTab&&fixedHeader?'45px':'0') }">
+      <a-layout-content :style="{ height: '100%', margin: '24px 20px 0', paddingTop: multiTab&&fixedHeader ? '66px' : (!multiTab&&fixedHeader?'45px':'0') }">
         <transition name="page-transition">
           <route-view/>
         </transition>
@@ -99,7 +99,7 @@ export default {
         return '0'
       }
       if (this.sidebarOpened) {
-        return '256px'
+        return '230px'
       }
       return '80px'
     }
@@ -142,7 +142,7 @@ export default {
     paddingCalc () {
       let left = ''
       if (this.sidebarOpened) {
-        left = this.isDesktop() ? '256px' : '80px'
+        left = this.isDesktop() ? '230px' : '80px'
       } else {
         left = (this.isMobile() && '0') || ((this.fixSidebar && '80px') || '0')
       }
@@ -159,6 +159,7 @@ export default {
 
 <style lang="less">
 @import url('../components/global.less');
+@import url('../components/custom.less');  //  自定义样式文件
 
 /*
  * The following styles are auto-applied to elements with

+ 8 - 2
src/layouts/PageView.vue

@@ -38,7 +38,7 @@
         </div>
       </div>
     </page-header>
-    <div class="content">
+    <div class="content" :style="{ height: contHeight+'px' }">
       <div class="page-header-index-wide">
         <slot>
           <!-- keep-alive  -->
@@ -92,7 +92,10 @@ export default {
   computed: {
     ...mapState({
       multiTab: state => state.app.multiTab
-    })
+    }),
+    contHeight () {
+      return window.innerHeight - 80
+    }
   },
   mounted () {
     this.tabs = this.directTabs
@@ -126,6 +129,9 @@ export default {
 <style lang="less" scoped>
   .content {
     margin: 12px 12px 0;
+    .page-header-index-wide{
+      height: 100%;
+    }
     .link {
       margin-top: 16px;
       &:not(:empty) {

+ 6 - 0
src/main.js

@@ -6,6 +6,8 @@ import App from './App.vue'
 import router from './router'
 import store from './store/'
 import { VueAxios } from './utils/request'
+import Viewer from 'v-viewer'
+import 'viewerjs/dist/viewer.css'
 
 // mock
 // import './mock'
@@ -16,6 +18,10 @@ import './permission' // permission control
 import './utils/filter'
 
 import VueCookies from 'vue-cookies' // global filter
+Vue.use(Viewer)
+Viewer.setDefaults({
+  Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
+}) // global filter
 
 Vue.config.productionTip = false
 

+ 1 - 1
src/views/Home.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="home">
-    <a-alert :message="message" type="info" showIcon />
+    <a-alert :message="message" type="info" />
     <!-- 重置密码 -->
     <a-modal
       class="resetPwdModal"

+ 168 - 0
src/views/allocationManagement/transferOut/chooseImportModal.vue

@@ -0,0 +1,168 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 60px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { allocateBillParseProducts } from '@/api/allocateBill'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [ //  正品
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      nowUnColumns: [ //  促销品
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qtyText', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'errorDesc', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      allocateBillParseProducts(this.paramsData).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.okList && res.data.okList.length > 0) {
+            res.data.okList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.okList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 20 - 20
src/views/allocationManagement/transferOut/detail.vue

@@ -34,10 +34,10 @@
       </a-card>
       <a-card size="small" :bordered="false" class="allocateBillDetail-cont">
         <!-- 总计 -->
-        <a-alert type="info" showIcon style="margin-bottom:15px">
+        <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
             总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
-            总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,
+            <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
             总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
           </div>
         </a-alert>
@@ -61,7 +61,6 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { getOperationalPrecision } from '@/libs/tools.js'
 import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount, allocateBillDetailPrint } from '@/api/allocateBill'
 export default {
   components: { STable, VSelect },
@@ -74,19 +73,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价小计(¥)', dataIndex: 'priceSubtotal', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.outBizSn || this.$route.params.sn })).then(res => {
@@ -94,9 +80,6 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
-            data.list[i].priceSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
           }
           this.localDataSource = data.list
           return data
@@ -109,7 +92,24 @@ export default {
   },
   computed: {
     isEdit () {
-      return (this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')
+      return this.basicInfoData && ((this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData.state == 'WAIT_AUDIT') || (this.basicInfoData.state == 'AUDIT_REJECT')) && $hasPermissions('M_transferOut_edit')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价小计(¥)', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '成本小计(¥)', dataIndex: 'totalCost', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 161 - 124
src/views/allocationManagement/transferOut/edit.vue

@@ -9,8 +9,8 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
-          <a-button key="2" id="allocateBillEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
-          <a-button key="1" type="primary" id="allocateBillEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
+          <a-button key="2" id="allocateBillEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
+          <a-button key="1" type="primary" id="allocateBillEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
         </template>
       </a-page-header>
       <!-- 选择产品 -->
@@ -36,7 +36,7 @@
                       <a-input id="allocateBillEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
                     <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
                   </a-col>
@@ -52,7 +52,7 @@
               :columns="columns"
               :customRow="handleClickRow"
               :data="loadData"
-              :scroll="{ x: 1240, y: 300 }"
+              :scroll="{ x: 990, y: 300 }"
               bordered>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -67,10 +67,10 @@
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="已选产品">
             <!-- 总计 -->
-            <a-alert type="info" showIcon style="margin-bottom:15px">
+            <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
                 总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
-                总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,
+                <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
                 总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
               </div>
             </a-alert>
@@ -78,7 +78,7 @@
             <a-row :gutter="15">
               <a-col :span="17">
                 <div class="table-page-search-wrapper">
-                  <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
+                  <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                     <a-row :gutter="15">
                       <a-col :md="9" :sm="24">
                         <a-form-item label="产品编码" prop="productCode">
@@ -90,8 +90,8 @@
                           <a-input id="allocateBillEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                         </a-form-item>
                       </a-col>
-                      <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                        <a-button type="primary" @click="getChooseProductList(1)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
+                      <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
                         <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
                       </a-col>
                     </a-row>
@@ -99,25 +99,45 @@
                 </div>
               </a-col>
               <a-col :span="7" style="text-align: right;">
-                <!-- <a-button size="small" id="allocateBillEdit-import-btn">导入明细</a-button> -->
-                <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+                <a-button size="small" id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
+                <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
               </a-col>
             </a-row>
             <!-- 列表 -->
-            <a-table
+            <s-table
               class="sTable"
               ref="chooseTable"
               size="small"
               :rowKey="(record) => record.id"
               :columns="chooseColumns"
-              :dataSource="chooseLoadData"
-              :scroll="{ x: 1335, y: 300 }"
-              :loading="loading"
-              :pagination="choosePaginationProps"
+              :data="chooseLoadData"
+              :scroll="{ x: 1160, y: 300 }"
               bordered>
+              <!-- 售价 -->
+              <template slot="price" slot-scope="text, record, index">
+                <!-- 调往对象为经销商时不可编辑售价,为员工或其他时可编辑售价 -->
+                <div v-if="$route.params.dealerLevel == 'OTHER'">
+                  <a-select
+                    size="small"
+                    id="allocateBillEdit-price"
+                    option-label-prop="label"
+                    v-model="record.price"
+                    placeholder="请选择"
+                    @change="e => priceChange(e, record)"
+                    @focus="e => priceFocus(record, index)"
+                    style="width: 100%;">
+                    <a-select-option v-if="record.cost" :value="record.cost" :label="record.cost">成本 {{ record.cost }}</a-select-option>
+                    <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].provincePrice" :value="loadDataSource[index].provincePrice" :label="loadDataSource[index].provincePrice">A价 {{ loadDataSource[index].provincePrice }}</a-select-option>
+                    <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].cityPrice" :value="loadDataSource[index].cityPrice" :label="loadDataSource[index].cityPrice">B价 {{ loadDataSource[index].cityPrice }}</a-select-option>
+                    <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].specialPrice" :value="loadDataSource[index].specialPrice" :label="loadDataSource[index].specialPrice">C价 {{ loadDataSource[index].specialPrice }}</a-select-option>
+                  </a-select>
+                </div>
+                <span v-else>{{ record.price }}</span>
+              </template>
               <!-- 调出数量 -->
               <template slot="qty" slot-scope="text, record">
                 <a-input-number
+                  size="small"
                   id="allocateBillEdit-qty"
                   v-model="record.qty"
                   :precision="0"
@@ -131,22 +151,23 @@
               <template slot="action" slot-scope="text, record">
                 <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
               </template>
-            </a-table>
+            </s-table>
           </a-collapse-panel>
         </a-collapse>
       </a-card>
-      <a-affix :offset-bottom="0">
-        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-          <a-button
-            type="primary"
-            id="allocateBillEdit-submit"
-            size="large"
-            class="button-primary"
-            @click="handleSubmit"
-            style="padding: 0 60px;">提交</a-button>
-        </div>
-      </a-affix>
     </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        id="allocateBillEdit-submit"
+        size="large"
+        :disabled="spinning"
+        class="button-primary"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </div>
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
     <!-- 打印 -->
     <div id="print"></div>
   </div>
@@ -154,10 +175,12 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import ImportGuideModal from './importGuideModal.vue'
 import { queryStockProductPage } from '@/api/stock'
-import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint } from '@/api/allocateBill'
+import { productPriceInfo } from '@/api/product'
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert } from '@/api/allocateBill'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, ImportGuideModal },
   data () {
     return {
       spinning: false,
@@ -178,55 +201,78 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'lastStockCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return queryStockProductPage(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: this.$route.params.dealerLevel })).then(res => {
+        return queryStockProductPage(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: this.$route.params.dealerLevel == 'OTHER' ? undefined : this.$route.params.dealerLevel })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
+          this.loadDataSource = data.list || []
           this.disabled = false
           return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 140, align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
-      chooseLoadData: [],
-      choosePageNo: 1, //  分页页码
-      choosePageSize: 10, //  分页 每页多少条
-      choosePaginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
-        total: 0, //  分页总条数
-        current: 1,
-        onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
-        onChange: (current) => this.changeChoosePage(current)
+      loadDataSource: [],
+      localDataSource: [],
+      // 加载数据方法 必须为 Promise 对象
+      chooseLoadData: parameter => {
+        this.chooseDisabled = true
+        const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.$route.params.sn })
+        return allocateBillDetailList(params).then(res => {
+          //  合计
+          this.getDetailCount(params)
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            data.list[i].qtyBackups = data.list[i].qty
+            data.list[i].priceBackups = data.list[i].price
+          }
+          this.localDataSource = data.list || []
+          this.chooseDisabled = false
+          return data
+        })
       },
-      productTotal: null //  合计
+      productTotal: null, //  合计
+      openGuideModal: false //  导入产品引导
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'lastStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {
@@ -247,18 +293,22 @@ export default {
         }
       }
     },
+    // 导入产品
+    hanldeOk (obj) {
+      allocateBillBatchInsert(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.chooseTable.refresh(true)
+        }
+      })
+    },
     // 已选产品  重置
     chooseResetSearchForm () {
       this.chooseQueryParam.productCode = ''
       this.chooseQueryParam.productName = ''
-      this.choosePageNo = 1
-      this.choosePageSize = 10
-      this.choosePaginationProps.total = 0
-      this.choosePaginationProps.current = 1
-      this.getChooseProductList(1)
+      this.$refs.chooseTable.refresh(true)
     },
     //  添加/编辑
-    handleAdd (row, isEdit) {
+    handleAdd (row, isEdit, isRefresh) {
       const params = {
         id: isEdit ? row.id : undefined,
         allocateSn: this.$route.params.sn,
@@ -269,20 +319,25 @@ export default {
       }
       if (isEdit) { // 编辑
         // 清空数量时,值应保持未清空前的值,因数量不可为空
-        if (!row.qty || row.qty == row.qtyBackups) {
+        if (!row.qty) {
           row.qty = row.qtyBackups
           return
         }
+        if (!row.price) {
+          row.price = row.priceBackups
+          return
+        }
       }
       this.spinning = true
       allocateBillDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          this.$refs.table.refresh()
-          this.getChooseProductList()
+          if (isRefresh != 'noRefresh') {
+            this.$refs.table.refresh()
+          }
+          this.$refs.chooseTable.refresh()
           this.spinning = false
         } else {
-          row.qty = row.qtyBackups
           this.spinning = false
         }
       })
@@ -302,7 +357,7 @@ export default {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.$refs.table.refresh()
-                _this.getChooseProductList()
+                _this.$refs.chooseTable.refresh()
                 _this.spinning = false
               } else {
                 _this.spinning = false
@@ -314,7 +369,7 @@ export default {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.$refs.table.refresh()
-                _this.getChooseProductList()
+                _this.$refs.chooseTable.refresh()
                 _this.spinning = false
               } else {
                 _this.spinning = false
@@ -354,49 +409,6 @@ export default {
     handleBack () {
       this.$router.push({ path: '/allocationManagement/transferOut/list', query: { closeLastOldTab: true } })
     },
-    //  已选产品 分页  一页多少条change
-    changeChoosePageSize (current, pageSize) {
-      this.choosePageNo = current
-      this.choosePageSize = pageSize
-      this.getChooseProductList()
-    },
-    //  已选产品 分页 页码change
-    changeChoosePage (current) {
-      this.choosePageNo = current
-      this.getChooseProductList()
-    },
-    // 已选产品列表数据
-    getChooseProductList (pageNo) {
-      this.choosePageNo = this.choosePageNo || pageNo
-      this.chooseDisabled = true
-      this.loading = true
-      const params = {
-        pageNo: this.choosePageNo,
-        pageSize: this.choosePageSize,
-        allocateSn: this.$route.params.sn
-      }
-      allocateBillDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
-        this.loading = false
-        if (res.status == 200) {
-          //  合计
-          this.getDetailCount(Object.assign(params, this.chooseQueryParam))
-          const data = res.data
-          this.choosePaginationProps.total = Number(res.data.count) || 0
-          this.choosePaginationProps.current = data.pageNo
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].qtyBackups = data.list[i].qty
-          }
-          this.chooseLoadData = data.list
-          this.chooseDisabled = false
-        } else {
-          this.choosePaginationProps.total = 0
-          this.choosePaginationProps.current = 1
-          this.chooseLoadData = []
-        }
-      })
-    },
     // 已选产品 调出数量  blur
     qtyBlur (val, record) {
       //  光标移出,值发生改变再调用编辑接口
@@ -404,6 +416,25 @@ export default {
         this.handleAdd(record, 'edit')
       }
     },
+    // 已选产品 售价  change
+    priceChange (val, record) {
+      //  光标移出,值发生改变再调用编辑接口
+      if (val != record.priceBackups) {
+        this.handleAdd(record, 'edit', 'noRefresh')
+      }
+    },
+    // 获取价格
+    priceFocus (row, index) {
+      if (row.productSn) {
+        productPriceInfo({ sn: row.productSn }).then(res => {
+          if (res.status == 200 && res.data) {
+            this.loadDataSource[index].provincePrice = res.data.provincePrice || undefined
+            this.loadDataSource[index].cityPrice = res.data.cityPrice || undefined
+            this.loadDataSource[index].specialPrice = res.data.specialPrice || undefined
+          }
+        })
+      }
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this
@@ -440,15 +471,21 @@ export default {
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getChooseProductList(1)
-    })
+    next(vm => {})
   }
 }
 </script>
 
 <style lang="less">
   .allocateBillEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
     .allocateBillEdit-back{
       margin-bottom: 10px;
     }

+ 219 - 0
src/views/allocationManagement/transferOut/importGuideModal.vue

@@ -0,0 +1,219 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”的列,且名称必须相同</li>
+            <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
+            <li>3) 如果导入的产品已经存在,则不会导入该行</li>
+          </ul>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+import { allocateBillDownload } from '@/api/allocateBill'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          allocateSn: this.params.allocateSn || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      allocateBillDownload({}).then(res => {
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const fname = '调拨单产品导入模板'
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 53 - 28
src/views/allocationManagement/transferOut/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="allocateBillList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -52,7 +52,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="allocateBillList-export">导出</a-button> -->
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -66,13 +66,14 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1940, y: tableHeight }"
+        :scroll="{ x: 1540, y: tableHeight }"
         bordered>
         <!-- 单号 -->
         <template slot="allocateNo" slot-scope="text, record">
@@ -108,7 +109,7 @@
     <!-- 新增 -->
     <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
     <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinning" @close="visibleAudit=false" @ok="auditOrder('WAIT_OUT_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
+    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_OUT_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
   </a-card>
 </template>
 
@@ -126,7 +127,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
@@ -141,25 +143,10 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center' },
-        { title: '调往对象', dataIndex: 'targetName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印状态', dataIndex: 'printStateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印次数', dataIndex: 'printCount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 180, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -167,18 +154,38 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
       visibleAudit: false,
       auditInfo: null,
+      spinningAudit: false,
       allocateTypeList: [], //  调拨类型
       openModal: false //  新增编辑  弹框
     }
   },
   computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center' },
+        { title: '调往对象', dataIndex: 'targetName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印状态', dataIndex: 'printStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'printCount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(6, 0, { title: '总成本', dataIndex: 'totalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {
@@ -200,7 +207,7 @@ export default {
     },
     //  基本信息  保存
     handleOk (data) {
-      this.$router.push({ path: `/allocationManagement/transferOut/add/${data.allocateSn}/${data.targetName}/${data.dealerLevel}` })
+      this.$router.push({ path: `/allocationManagement/transferOut/add/${data.allocateSn}/${data.targetName}/${data.targetType}` })
     },
     //  删除
     handleDel (row) {
@@ -231,16 +238,16 @@ export default {
     // 审核
     auditOrder (state) {
       const _this = this
-      _this.spinning = true
+      _this.spinningAudit = true
       allocateBillAudit({ sn: this.auditInfo.allocateSn, state: state }).then(res => {
         if (res.status == 200) {
           _this.visibleAudit = false
           _this.$message.success(res.message)
           _this.$refs.table.refresh()
-          _this.spinning = false
+          _this.spinningAudit = false
         } else {
           _this.visibleAudit = false
-          _this.spinning = false
+          _this.spinningAudit = false
         }
       })
     },
@@ -286,6 +293,24 @@ export default {
           this.allocateTypeList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 16 - 7
src/views/basicData/transferTypeManagement/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="transferTypeManagementList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 操作按钮 -->
-      <div class="table-operator-nobor">
+      <div ref="tableSearch" class="table-operator-nobor">
         <a-button
           id="transferTypeManagementList-add"
           type="primary"
@@ -12,8 +12,9 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -54,6 +55,7 @@ export default {
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
@@ -63,12 +65,14 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         return allocateTypeList(Object.assign(parameter, {})).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
+          this.spinning = false
           return data
         })
       },
@@ -77,11 +81,6 @@ export default {
       nowData: null //  当前记录数据
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - 310
-    }
-  },
   methods: {
     //  新增/编辑
     handleEdit (row) {
@@ -115,7 +114,17 @@ export default {
       this.itemSn = ''
       this.openModal = false
       this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 15 - 5
src/views/basicData/warehouse/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="warehouseList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -23,8 +23,9 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -85,9 +86,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
+        this.spinning = true
         return warehouseList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -95,6 +94,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -150,7 +150,17 @@ export default {
     //  查看仓位
     goStoringLocation (row) {
       this.$router.push({ path: `/basicData/storingLocation/${row.warehouseSn}`, query: { name: row.name } })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 16 - 6
src/views/basicData/warehouse/storingLocation/list.vue

@@ -10,7 +10,7 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="storingLocationList-cont">
         <!-- 搜索条件 -->
-        <div class="table-page-search-wrapper">
+        <div ref="tableSearch" class="table-page-search-wrapper">
           <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
@@ -26,13 +26,14 @@
           </a-form>
         </div>
         <!-- 操作按钮 -->
-        <div class="table-operator" style="border: 0;padding: 0 0 15px;">
+        <div class="table-operator" style="border: 0;padding: 0 0 10px;">
           <a-button id="storingLocationList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
         </div>
         <!-- 列表 -->
         <s-table
-          class="sTable"
+          class="sTable fixPagination"
           ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
           size="small"
           :rowKey="(record) => record.id"
           :columns="columns"
@@ -88,9 +89,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
+        this.spinning = true
         return warehouseLocList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -98,6 +97,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -160,7 +160,17 @@ export default {
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/basicData/warehouse/list', query: { closeLastOldTab: true } })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 285
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 1 - 5
src/views/bnSetting/menu/adminMenus.vue

@@ -1,10 +1,9 @@
 <template>
-  <a-card :bordered="false">
+  <a-card :bordered="false" :bodyStyle="{overflowY: 'auto'}">
     <a-row :gutter="24">
       <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
       <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
       <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
-
     </a-row>
     <a-row :gutter="24">
       <!-- 左侧菜单树列表 -->
@@ -13,7 +12,6 @@
           <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
           <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKeys.length" class="imgSize" @click="cancelSel">取消选择</span></span>
         </a-row>
-
         <a-row :gutter="24" >
           <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" />
           <a-tree
@@ -23,7 +21,6 @@
             :autoExpandParent="autoExpandParent"
             @select="onSelect"
             :selectedKeys="selectedKeys"
-            showIcon
           >
             <template slot="title" slot-scope="{title}">
               <span v-if="title.indexOf(searchValue) > -1">
@@ -50,7 +47,6 @@
               <a-icon type="pushpin" style="margin-right: 10px;" /><span >操作按钮</span>
             </div>
           </a-form-item>
-
           <!-- 名称 -->
           <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input

+ 0 - 1
src/views/bnSetting/menu/storeMenus.vue

@@ -23,7 +23,6 @@
             :autoExpandParent="autoExpandParent"
             @select="onSelect"
             :selectedKeys="selectedKeys"
-            showIcon
           >
             <template slot="title" slot-scope="{title}">
               <span v-if="title.indexOf(searchValue) > -1">

+ 3 - 3
src/views/common/chooseCustomerModal.vue

@@ -45,9 +45,9 @@
                 </a-form-item>
               </a-row>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>

+ 49 - 34
src/views/common/chooseProductsModal.vue

@@ -13,8 +13,9 @@
         <!-- 搜索条件 -->
         <div class="table-page-search-wrapper">
           <a-form-model
-            layout="inline"
             ref="ruleForm"
+            class="form-model-con"
+            layout="inline"
             :model="queryParam"
             :rules="rules"
             @keyup.enter.native="getProductList(1)"
@@ -54,9 +55,9 @@
                     allowClear />
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-button style="margin-bottom: 18px;" type="primary" @click="handleSearch" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
-                <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
+              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form-model></a-form>
@@ -79,11 +80,19 @@
           }"
           :data-source="loadData"
           :columns="columns"
-          :pagination="paginationProps"
+          :pagination="false"
           :loading="loading"
           :scroll="{ y: 450 }"
           bordered>
         </a-table>
+        <!-- 分页 -->
+        <tablePagination
+          ref="tablePagination"
+          :total="paginationProps.total"
+          :current="paginationProps.current"
+          :pageSize="paginationProps.pageSize"
+          @changePageSize="changePageSize"
+          @changePage="changePage" />
       </div>
       <!-- 按钮 -->
       <div class="btn-con">
@@ -107,13 +116,14 @@
 
 <script>
 import { STable } from '@/components'
+import tablePagination from '@/views/common/tablePagination.vue'
 import { productBrandQuery } from '@/api/productBrand'
-import { productTypeQuery } from '@/api/productType'
+import { productTypeQuery, productTypeQueryAll } from '@/api/productType'
 import { dealerScopeValidProduct } from '@/api/dealerScope'
 import { productPricedList, productPricingList } from '@/api/product'
 export default {
   name: 'ChooseProductsModal',
-  components: { STable },
+  components: { STable, tablePagination },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -161,14 +171,10 @@ export default {
         { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
-      pageNo: 1, //  分页页码
-      pageSize: 10, //  分页 每页多少条
       paginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
         total: 0, //  分页总条数
         current: 1,
-        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
-        onChange: (current) => this.changePage(current)
+        pageSize: 20
       },
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
@@ -234,10 +240,9 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productType = []
-      this.pageNo = 1
-      this.pageSize = 10
       this.paginationProps.total = 0
       this.paginationProps.current = 1
+      this.paginationProps.pageSize = 20
     },
     //  重置
     resetSearchForm () {
@@ -269,16 +274,11 @@ export default {
       this.selectedRowKeys = selectedRowKeys
     },
     onSelectChange (record, selected, selectedRows, nativeEvent) {
-      const _this = this
       if (this.type != 'supplier') { //  供应商增加产品
         if (selected) { //  选择
           this.selectedRows.push(record)
         } else { //  取消
-          this.selectedRows.map((item, index) => {
-            if (item.productSn == record.productSn) {
-              _this.selectedRows.splice(index, 1)
-            }
-          })
+          this.selectedRows = selectedRows
         }
       }
     },
@@ -289,23 +289,27 @@ export default {
         if (selected) { //  选择
           this.selectedRows = [...this.selectedRows, ...changeRows]
         } else { //  取消
+          const arrId = []
           this.selectedRows.map((item, index) => {
             this.selectedRows.map((subItem, ind) => {
               if (item.productSn == subItem.productSn) {
-                _this.selectedRows.splice(index, 1)
+                arrId.push(index)
               }
             })
           })
+          arrId.map((item, index) => {
+            _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+          })
         }
       }
     },
     // 产品列表
     getProductList (pageNo) {
-      this.pageNo = pageNo || this.pageNo
+      this.paginationProps.current = pageNo || this.paginationProps.current
       this.disabled = true
       const params = {
-        pageNo: this.pageNo,
-        pageSize: this.pageSize
+        pageNo: this.paginationProps.current,
+        pageSize: this.paginationProps.pageSize
       }
       this.loading = true
       let url = productPricedList //  获取定过价的产品
@@ -330,19 +334,20 @@ export default {
         } else {
           this.paginationProps.total = 0
           this.paginationProps.current = 1
+          this.paginationProps.pageSize = 20
           this.loadData = []
         }
       })
     },
     //  已选产品 分页  一页多少条change
     changePageSize (current, pageSize) {
-      this.pageNo = current
-      this.pageSize = pageSize
+      this.paginationProps.current = current
+      this.paginationProps.pageSize = pageSize
       this.getProductList()
     },
     //  已选产品 分页 页码change
     changePage (current) {
-      this.pageNo = current
+      this.paginationProps.current = current
       this.getProductList()
     },
     //  产品分类  change
@@ -368,13 +373,23 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      productTypeQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
+      if (this.type != 'supplier' && this.type != 'dealership') { //  促销
+        productTypeQueryAll({}).then(res => {
+          if (res.status == 200) {
+            this.productTypeList = res.data
+          } else {
+            this.productTypeList = []
+          }
+        })
+      } else {
+        productTypeQuery({}).then(res => {
+          if (res.status == 200) {
+            this.productTypeList = res.data
+          } else {
+            this.productTypeList = []
+          }
+        })
+      }
     }
   },
   watch: {

+ 32 - 26
src/views/common/chooseSupplierModal.vue

@@ -13,8 +13,9 @@
         <!-- 搜索条件 -->
         <div class="table-page-search-wrapper">
           <a-form-model
-            layout="inline"
             ref="ruleForm"
+            class="form-model-con"
+            layout="inline"
             :model="queryParam"
             :rules="rules"
             @keyup.enter.native="getSupplierList(1)"
@@ -31,9 +32,9 @@
                   <v-select code="ENABLE_FLAG" id="chooseSupplier-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-button style="margin-bottom: 18px;" type="primary" @click="handleSearch" :disabled="disabled" id="chooseSupplier-refresh">查询</a-button>
-                <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseSupplier-reset">重置</a-button>
+              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chooseSupplier-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseSupplier-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form-model></a-form>
@@ -53,11 +54,19 @@
           }"
           :data-source="loadData"
           :columns="columns"
-          :pagination="paginationProps"
+          :pagination="false"
           :loading="loading"
           :scroll="{ y: 450 }"
           bordered>
         </a-table>
+        <!-- 分页 -->
+        <tablePagination
+          ref="tablePagination"
+          :total="paginationProps.total"
+          :current="paginationProps.current"
+          :pageSize="paginationProps.pageSize"
+          @changePageSize="changePageSize"
+          @changePage="changePage" />
       </div>
       <!-- 按钮 -->
       <div class="btn-con">
@@ -81,10 +90,11 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import tablePagination from '@/views/common/tablePagination.vue'
 import { supplierList } from '@/api/supplier'
 export default {
   name: 'ChooseSupplierModal',
-  components: { STable, VSelect },
+  components: { STable, VSelect, tablePagination },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -121,14 +131,10 @@ export default {
         { title: '状态', dataIndex: 'enableFlagDictValue', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
-      pageNo: 1, //  分页页码
-      pageSize: 10, //  分页 每页多少条
       paginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
         total: 0, //  分页总条数
         current: 1,
-        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
-        onChange: (current) => this.changePage(current)
+        pageSize: 20
       },
       selectedRowKeys: [],
       selectedRows: []
@@ -150,10 +156,10 @@ export default {
     resetData () {
       this.queryParam.supplierName = ''
       this.queryParam.enabledFlag = undefined
-      this.pageNo = 1
-      this.pageSize = 10
+      this.paginationProps.total = 0
       this.paginationProps.total = 0
       this.paginationProps.current = 1
+      this.paginationProps.pageSize = 20
     },
     //  重置
     resetSearchForm () {
@@ -174,15 +180,10 @@ export default {
       this.selectedRowKeys = selectedRowKeys
     },
     onSelectChange (record, selected, selectedRows, nativeEvent) {
-      const _this = this
       if (selected) { //  选择
         this.selectedRows.push(record)
       } else { //  取消
-        this.selectedRows.map((item, index) => {
-          if (item.supplierSn == record.supplierSn) {
-            _this.selectedRows.splice(index, 1)
-          }
-        })
+        this.selectedRows = selectedRows
       }
     },
     // 本页全选/取消全选
@@ -191,22 +192,26 @@ export default {
       if (selected) { //  选择
         this.selectedRows = [...this.selectedRows, ...changeRows]
       } else { //  取消
+        const arrId = []
         this.selectedRows.map((item, index) => {
           this.selectedRows.map((subItem, ind) => {
             if (item.supplierSn == subItem.supplierSn) {
-              _this.selectedRows.splice(index, 1)
+              arrId.push(index)
             }
           })
         })
+        arrId.map((item, index) => {
+          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        })
       }
     },
     // 供应商列表
     getSupplierList (pageNo) {
-      this.pageNo = pageNo || this.pageNo
+      this.paginationProps.current = pageNo || this.paginationProps.current
       this.disabled = true
       const params = {
-        pageNo: this.pageNo,
-        pageSize: this.pageSize
+        pageNo: this.paginationProps.current,
+        pageSize: this.paginationProps.pageSize
       }
       this.loading = true
       supplierList(Object.assign(params, this.queryParam)).then(res => {
@@ -224,19 +229,20 @@ export default {
         } else {
           this.paginationProps.total = 0
           this.paginationProps.current = 1
+          this.paginationProps.pageSize = 20
           this.loadData = []
         }
       })
     },
     //  已选产品 分页  一页多少条change
     changePageSize (current, pageSize) {
-      this.pageNo = current
-      this.pageSize = pageSize
+      this.paginationProps.current = current
+      this.paginationProps.pageSize = pageSize
       this.getSupplierList()
     },
     //  已选产品 分页 页码change
     changePage (current) {
-      this.pageNo = current
+      this.paginationProps.current = current
       this.getSupplierList()
     }
   },

+ 22 - 8
src/views/common/chooseTypeModal.vue

@@ -43,7 +43,7 @@
 </template>
 
 <script>
-import { productTypeQuery } from '@/api/productType'
+import { productTypeQuery, productTypeQueryAll } from '@/api/productType'
 export default {
   name: 'ChooseTypeModal',
   props: {
@@ -56,6 +56,10 @@ export default {
       default: () => {
         return []
       }
+    },
+    type: { //  类型,促销规则promo
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -76,13 +80,23 @@ export default {
   methods: {
     //  产品分类  列表
     getProductType () {
-      productTypeQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
+      if (this.type == 'promo') {
+        productTypeQueryAll({}).then(res => {
+          if (res.status == 200) {
+            this.productTypeList = res.data
+          } else {
+            this.productTypeList = []
+          }
+        })
+      } else {
+        productTypeQuery({}).then(res => {
+          if (res.status == 200) {
+            this.productTypeList = res.data
+          } else {
+            this.productTypeList = []
+          }
+        })
+      }
     },
     // 保存
     handleSave () {

+ 29 - 1
src/views/common/custList.vue

@@ -2,6 +2,7 @@
   <a-select
     show-search
     label-in-value
+    :size="size"
     :value="dealerName"
     placeholder="请输入名称搜索"
     style="width: 100%"
@@ -22,6 +23,14 @@ import debounce from 'lodash/debounce'
 import { dealerQueryList, dealerFindUpdateInfoBySn } from '@/api/dealer'
 export default {
   props: {
+    size: {
+      type: String,
+      default: 'default'
+    },
+    itemSn: {
+      type: String || Number,
+      default: undefined
+    }
   },
   data () {
     this.lastFetchId = 0
@@ -40,7 +49,13 @@ export default {
       const fetchId = this.lastFetchId
       this.data = []
       this.fetching = true
-      dealerQueryList({ 'nameLike': dealerName, pageNo: 1, pageSize: 20 }).then(res => {
+      const params = { pageNo: 1, pageSize: 20 }
+      if (this.itemSn) {
+        params.dealerSn = this.itemSn
+      } else {
+        params.nameLike = dealerName
+      }
+      dealerQueryList(params).then(res => {
         if (fetchId !== this.lastFetchId) {
           return
         }
@@ -64,6 +79,19 @@ export default {
       dealerFindUpdateInfoBySn({ sn: sn }).then(res => {
         this.$emit('dealerDetail', res.data || null)
       })
+    },
+    setData (value) {
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+    }
+  },
+  mounted () {
+    if (this.itemSn) {
+      this.fetchUser(this.itemSn)
+      this.setData({ key: this.itemSn })
     }
   }
 }

+ 79 - 0
src/views/common/dealerSubareaScopeList.vue

@@ -0,0 +1,79 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :size="size"
+    :value="dealerName"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.dealerSn" :value="item.dealerSn">
+      {{ item.dealerName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { dealerSubareaScopeList, dealerDetailBySn } from '@/api/dealer'
+export default {
+  props: {
+    size: {
+      type: String,
+      default: 'default'
+    }
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      dealerName: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      console.log('fetching user', dealerName)
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      dealerSubareaScopeList({ nameLike: dealerName, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      if (value && value.key) {
+        const obj = this.data.find(item => item.dealerSn == value.key)
+        value.name = obj.dealerName
+      }
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined })
+    },
+    resetForm () {
+      this.dealerName = []
+    },
+    // 查询详细
+    getDetail (sn) {
+      dealerDetailBySn({ sn: sn }).then(res => {
+        this.$emit('dealerDetail', res.data || null)
+      })
+    }
+  }
+}
+</script>

+ 11 - 5
src/views/common/productCodeList.vue

@@ -34,7 +34,8 @@ export default {
     return {
       data: [],
       dealerName: undefined,
-      fetching: false
+      fetching: false,
+      lastData: []
     }
   },
   methods: {
@@ -43,6 +44,9 @@ export default {
       if (dealerName == '') return
       this.lastFetchId += 1
       const fetchId = this.lastFetchId
+      if (this.dealerName) {
+        this.lastData = JSON.parse(JSON.stringify(this.dealerName))
+      }
       this.data = []
       this.fetching = true
       productCodeQueryList({ 'productCode': dealerName, pageNo: 1, pageSize: 20 }).then(res => {
@@ -62,10 +66,12 @@ export default {
         }
       } else if (this.mode == 'multiple') { //  多选
         if (value.length > 0) {
-          value.map(subItem => {
-            const ind = _this.data.findIndex(item => item.productSn == subItem.key)
-            subItem.row = ind != -1 ? _this.data[ind] : undefined
-          })
+          const ind = _this.data.findIndex(item => item.productSn == value[value.length - 1].key)
+          value[value.length - 1].row = ind != -1 ? _this.data[ind] : undefined
+        }
+        if (this.lastData && this.lastData.length > 0) {
+          this.lastData = this.lastData.concat(value[value.length - 1])
+          value = this.lastData
         }
       }
       Object.assign(this, {

+ 14 - 14
src/views/common/productType.js

@@ -5,7 +5,7 @@ const ProductType = {
         @change="handleChange"
         change-on-select
         :value="defaultVal"
-		expand-trigger="hover"
+        expand-trigger="hover"
         :options="productTypeList"
         :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
         :id="id"
@@ -15,34 +15,34 @@ const ProductType = {
   props: {
     value: {
       type: Array,
-      defatut: function(){
+      defatut: function () {
         return []
       }
     },
     id: {
       type: String,
       default: ''
-    },
+    }
   },
-  data() {
+  data () {
     return {
       defaultVal: this.value,
       productTypeList: []
-    };
+    }
   },
   watch: {
-    value(newValue, oldValue) {
+    value (newValue, oldValue) {
       this.defaultVal = newValue
     }
   },
-  mounted() {
+  mounted () {
     this.getProductType()
   },
   methods: {
-    handleChange(value) {
-      this.defaultVal = value;
-      this.$emit('change', this.defaultVal);
-      this.$emit('input', this.defaultVal);
+    handleChange (value) {
+      this.defaultVal = value
+      this.$emit('change', this.defaultVal)
+      this.$emit('input', this.defaultVal)
     },
     //  产品分类列表
     getProductType () {
@@ -54,7 +54,7 @@ const ProductType = {
         }
       })
     }
-  },
-};
+  }
+}
 
-export default ProductType
+export default ProductType

+ 5 - 0
src/views/common/rangeDate.vue

@@ -1,6 +1,7 @@
 <template>
   <a-range-picker
     style="width:100%"
+    :size="size"
     :value="date"
     :disabledDate="disabledDate"
     :format="dateFormat"
@@ -17,6 +18,10 @@ export default {
       default: () => {
         return []
       }
+    },
+    size: {
+      type: String,
+      default: 'default'
     }
   },
   data () {

+ 5 - 0
src/views/common/rangeDateTime.vue

@@ -2,6 +2,7 @@
   <a-range-picker
     style="width:100%"
     :value="date"
+    :size="size"
     show-time
     :disabledDate="disabledDate"
     :format="dateFormat"
@@ -18,6 +19,10 @@ export default {
       default: () => {
         return []
       }
+    },
+    size: {
+      type: String,
+      default: 'default'
     }
   },
   data () {

+ 51 - 0
src/views/common/tablePagination.vue

@@ -0,0 +1,51 @@
+<template>
+  <div class="pagination-con" v-if="total!=0">
+    <a-pagination
+      size="small"
+      :total="total"
+      :current="current"
+      :pageSize="pageSize"
+      show-size-changer
+      :show-total="total => `共 ${total} 条记录`"
+      @showSizeChange="changePageSize"
+      @change="changePage" />
+  </div>
+</template>
+<script>
+export default {
+  name: 'TablePagination',
+  props: {
+    total: {
+      type: [String, Number],
+      default: 0
+    },
+    current: {
+      type: [String, Number],
+      default: 1
+    },
+    pageSize: {
+      type: [String, Number],
+      default: 20
+    }
+  },
+  data () {
+    return {}
+  },
+  methods: {
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.$emit('changePageSize', current, pageSize)
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.$emit('changePage', current)
+    }
+  }
+}
+</script>
+<style lang="less">
+  .pagination-con{
+    text-align: right;
+    margin: 10px 0;
+  }
+</style>

+ 5 - 1
src/views/dealerManagement/dealerAccountManagement/editModal.vue

@@ -115,7 +115,11 @@ export default {
         name: [{ required: true, message: '请输入管理员姓名', trigger: 'blur' }],
         phone: [{ required: true, message: '请输入管理员手机', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }],
         loginName: [{ required: true, message: '请输入管理员账号', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员账号由字母和数字组成' }],
-        password: [{ required: true, message: '请输入管理员密码', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员密码由字母和数字组成' }],
+        password: [
+          { required: true, message: '请输入管理员密码', trigger: 'blur' },
+          { pattern: /^[0-9a-zA-Z]+$/, message: '管理员密码由字母和数字组成' },
+          { min: 6, message: '管理员密码为6~50位' }
+        ],
         'org.childUserMaxNum': [{ required: true, message: '请输入最大可开通用户数', trigger: 'blur' }]
       },
       detailData: null //  详情数据

+ 24 - 14
src/views/dealerManagement/dealerAccountManagement/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="dealerAccountList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -22,7 +22,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -33,13 +33,14 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1310, y: tableHeight }"
+        :scroll="{ x: 1030, y: tableHeight }"
         bordered>
         <!-- 账号状态 -->
         <template slot="loginFlag" slot-scope="text, record">
@@ -106,21 +107,19 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center' },
         { title: '经销商名称', dataIndex: 'org.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '管理员姓名', dataIndex: 'name', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '管理员账号', dataIndex: 'loginName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '授权用户数', dataIndex: 'org.childUserMaxNum', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '状态', scopedSlots: { customRender: 'loginFlag' }, width: 150, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '管理员姓名', dataIndex: 'name', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '管理员账号', dataIndex: 'loginName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '授权用户数', dataIndex: 'org.childUserMaxNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '状态', scopedSlots: { customRender: 'loginFlag' }, width: 100, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
+        this.spinning = true
         return dealerUserList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -129,6 +128,7 @@ export default {
             data.list[i].loginFlag = Number(data.list[i].loginFlag)
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -207,7 +207,17 @@ export default {
           this.spinning = false
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 36 - 20
src/views/dealerManagement/dealerRelationshipBinding/list.vue

@@ -10,9 +10,9 @@
                 <a-input id="relationshipBindingList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="getList()" :disabled="disabled" id="relationshipBindingList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm()" :disabled="disabled" id="relationshipBindingList-reset">重置</a-button>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="getList(1)" :disabled="disabled" id="relationshipBindingList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="relationshipBindingList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -28,7 +28,7 @@
         size="small"
         :rowKey="(record) => record.dealerSn"
         :columns="columns"
-        :pagination="paginationProps"
+        :pagination="false"
         :data-source="list"
         @expand="expand"
         :expandedRowKeys="expandedRowKeys"
@@ -67,6 +67,14 @@
           <span v-else>--</span>
         </template>
       </a-table>
+      <!-- 分页 -->
+      <tablePagination
+        ref="tablePagination"
+        :total="paginationProps.total"
+        :current="paginationProps.current"
+        :pageSize="paginationProps.pageSize"
+        @changePageSize="changePageSize"
+        @changePage="changePage" />
     </a-spin>
     <!-- 关联下级 -->
     <associate-modal :openModal="openModal" :nowData="nowData" :tabInd="tabInd" @ok="addItemOk" @close="openModal=false" />
@@ -75,10 +83,11 @@
 I
 <script>
 import { STable, VSelect } from '@/components'
+import tablePagination from '@/views/common/tablePagination.vue'
 import associateModal from './associateModal.vue'
 import { dealerRelationList, querySubList, unbindRelation } from '@/api/dealerRelation'
 export default {
-  components: { STable, VSelect, associateModal },
+  components: { STable, VSelect, associateModal, tablePagination },
   data () {
     return {
       tableHeight: 0,
@@ -98,14 +107,10 @@ export default {
       ],
       expandedRowKeys: [],
       list: [],
-      pageNo: 1, //  分页页码
-      pageSize: 10, //  分页 每页多少条
       paginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
         total: 0, //  分页总条数
         current: 1,
-        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
-        onChange: (current) => this.changePage(current)
+        pageSize: 20
       },
       innerColumns: [
         { title: '经销商名称', dataIndex: 'dealerName', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -119,7 +124,7 @@ export default {
     }
   },
   mounted () {
-    this.tableHeight = window.innerHeight - 370
+    this.tableHeight = window.innerHeight - 290
     this.getList()
   },
   methods: {
@@ -151,11 +156,11 @@ export default {
     // 获取列表数据
     getList (pageNo) {
       this.disabled = true
-      this.pageNo = pageNo || this.pageNo
+      this.paginationProps.current = pageNo || this.paginationProps.current
       this.disabled = true
       const params = {
-        pageNo: this.pageNo,
-        pageSize: this.pageSize
+        pageNo: this.paginationProps.current,
+        pageSize: this.paginationProps.pageSize
       }
       this.loading = true
       dealerRelationList(Object.assign(params, this.queryParam, { dealerLevelList: this.tabInd == 1 ? ['PROVINCE'] : ['PROVINCE', 'CITY'] })).then(res => {
@@ -173,6 +178,7 @@ export default {
         } else {
           this.paginationProps.total = 0
           this.paginationProps.current = 1
+          this.paginationProps.pageSize = 20
           this.list = []
         }
       })
@@ -182,22 +188,21 @@ export default {
       if (!flag) {
         this.queryParam.dealerName = ''
         this.expandedRowKeys = []
-        this.pageNo = 1
-        this.pageSize = 10
         this.paginationProps.total = 0
         this.paginationProps.current = 1
+        this.paginationProps.pageSize = 20
       }
       this.getList()
     },
     //  分页  一页多少条change
     changePageSize (current, pageSize) {
-      this.pageNo = current
-      this.pageSize = pageSize
+      this.paginationProps.current = current
+      this.paginationProps.pageSize = pageSize
       this.getList()
     },
     //  分页 页码change
     changePage (current) {
-      this.pageNo = current
+      this.paginationProps.current = current
       this.getList()
     },
     tabChange (key) {
@@ -205,9 +210,9 @@ export default {
       //  不能共用resetSearchForm方法,因切换tab时,每页多少条数据更改后,不能同步tab两边页码
       this.queryParam.dealerName = ''
       this.expandedRowKeys = []
-      this.pageNo = 1
       this.paginationProps.total = 0
       this.paginationProps.current = 1
+      this.paginationProps.pageSize = 20
       this.getList()
     },
     // 关联下级
@@ -239,3 +244,14 @@ export default {
   }
 }
 </script>
+<style lang="less">
+  .relationshipBindingList-wrap{
+    position: relative;
+    height: 100%;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
+  }
+</style>

+ 21 - 7
src/views/dealerManagement/marketingDivisionSet/list.vue

@@ -2,13 +2,14 @@
   <a-card size="small" :bordered="false" class="marketingDivisionSetList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 操作按钮 -->
-      <div class="table-operator" style="border: 0;">
+      <div ref="tableSearch" class="table-operator" style="border: 0;">
         <a-button id="marketingDivisionSetList-add" type="primary" v-if="$hasPermissions('B_marketingDivisionSet_add')" class="button-error" @click="handleEdit()">新增</a-button>
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -62,6 +63,7 @@ export default {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '分区名', dataIndex: 'subareaName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
@@ -71,6 +73,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return subareaQueryIncludeAreaAll(parameter).then(res => {
           const data = res.data
           const no = 0
@@ -78,6 +81,7 @@ export default {
             data[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -86,11 +90,6 @@ export default {
       itemId: null //  当前产品id
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - 260
-    }
-  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -128,11 +127,26 @@ export default {
       this.itemId = null
       this.nowData = null
       this.openModal = false
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
     }
   },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
     })
   }
 }
 </script>
+<style lang="less">
+  .marketingDivisionSetList-wrap{
+    height: 100%;
+  }
+</style>

+ 6 - 5
src/views/dealerManagement/merchantInfoManagement/detailModal.vue

@@ -95,7 +95,7 @@
       </div>
     </a-spin>
     <!-- 审核 -->
-    <auditModal :openModal="visibleAudit" :spinning="spinning" @close="visibleAudit=false" @ok="auditOrder('PASS')" @fail="auditOrder('REJECT')" />
+    <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('PASS')" @fail="auditOrder('REJECT')" />
   </a-modal>
 </template>
 
@@ -122,13 +122,14 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: null,
       title: '',
-      visibleAudit: false
+      visibleAudit: false,
+      spinningAudit: false
     }
   },
   methods: {
     // 审核
     auditOrder (auditState) {
-      this.spinning = true
+      this.spinningAudit = true
       dealerAudit({
         dealerAuditSn: this.form.dealerAuditSn,
         auditState: auditState
@@ -137,10 +138,10 @@ export default {
           this.visibleAudit = false
           this.$message.success(res.message)
           this.$emit('ok')
-          this.spinning = false
+          this.spinningAudit = false
         } else {
           this.visibleAudit = false
-          this.spinning = false
+          this.spinningAudit = false
         }
       })
     },

+ 18 - 17
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -369,18 +369,17 @@
           </a-collapse>
         </a-card>
       </a-form-model>
-      <a-affix :offset-bottom="0">
-        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-          <a-button
-            type="primary"
-            class="button-primary"
-            id="merchantInfoManagementEdit-submit-btn"
-            size="large"
-            @click="handleSubmit"
-            style="padding: 0 60px;">提交</a-button>
-        </div>
-      </a-affix>
     </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        class="button-primary"
+        :disabled="spinning"
+        id="merchantInfoManagementEdit-submit-btn"
+        size="large"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </div>
   </div>
 </template>
 
@@ -569,7 +568,6 @@ export default {
       this.addrDistrictList = []
       this.form.citySn = undefined
       this.form.districtSn = undefined
-      this.form.address = ''
       if (val) {
         this.getArea('city', val, 0)
         this.form.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
@@ -581,7 +579,6 @@ export default {
     getAreaList (val) {
       this.addrDistrictList = []
       this.form.districtSn = undefined
-      this.form.address = ''
       if (val) {
         this.getArea('district', val, 0)
         this.form.cityName = this.addrCityList.find(item => item.areaSn == val).name
@@ -591,7 +588,6 @@ export default {
     },
     // 区县变更
     areaCharged (val) {
-      this.form.address = ''
       if (val) {
         this.form.districtName = this.addrDistrictList.find(item => item.areaSn == val).name
       } else {
@@ -604,7 +600,6 @@ export default {
       this.addrDistrictList1 = []
       this.form.receiveCitySn = undefined
       this.form.receiveDistrictSn = undefined
-      this.form.receiveAddress = ''
       if (val) {
         this.getArea('city', val, 1)
         this.form.receiveProvinceName = this.addrProvinceList1.find(item => item.areaSn == val).name
@@ -616,7 +611,6 @@ export default {
     getAreaList1 (val) {
       this.addrDistrictList1 = []
       this.form.receiveDistrictSn = undefined
-      this.form.receiveAddress = ''
       if (val) {
         this.getArea('district', val, 1)
         this.form.receiveCityName = this.addrCityList1.find(item => item.areaSn == val).name
@@ -626,7 +620,6 @@ export default {
     },
     // 区县变更
     areaCharged1 (val) {
-      this.form.receiveAddress = ''
       if (val) {
         this.form.receiveDistrictName = this.addrDistrictList1.find(item => item.areaSn == val).name
       } else {
@@ -690,6 +683,14 @@ export default {
 
 <style lang="less">
   .merchantInfoManagementEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
     .merchantInfoManagementEdit-cont{
       margin-bottom: 10px;
     }

+ 44 - 31
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="merchantInfoManagementList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -15,13 +15,13 @@
                 <a-input id="merchantInfoManagementList-nameLike" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入商户名称/别名"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="5" :sm="24">
               <a-form-item label="商户类型">
                 <v-select code="DEALER_TYPE" id="merchantInfoManagementList-dealerType" v-model="queryParam.dealerType" allowClear placeholder="请选择商户类型"></v-select>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="7" :sm="24">
                 <a-form-item label="审核状态">
                   <v-select code="AUDIT_STATE" id="merchantInfoManagementList-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
                 </a-form-item>
@@ -32,9 +32,9 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="merchantInfoManagementList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="merchantInfoManagementList-reset">重置</a-button>
+            <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="merchantInfoManagementList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="merchantInfoManagementList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -44,7 +44,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="merchantInfoManagementList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -56,19 +56,16 @@
       <div class="table-operator">
         <a-button id="merchantInfoManagementList-add" type="primary" v-if="$hasPermissions('B_merchantInfo_add')" class="button-error" @click="handleAdd">新增</a-button>
       </div>
-      <!-- 总计 -->
-      <!-- <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-      </a-alert> -->
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 2240, y: tableHeight }"
+        :scroll="{ x: 1870, y: tableHeight }"
         bordered>
         <!-- 经销商 -->
         <template slot="dealerName" slot-scope="text, record">
@@ -115,7 +112,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         nameLike: '', //  商户名称、别名
         dealerType: undefined, //  商户类型
@@ -128,25 +126,26 @@ export default {
       dateFormat: 'YYYY-MM-DD',
       total: 0,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域', scopedSlots: { customRender: 'area' }, width: 200, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', scopedSlots: { customRender: 'area' }, width: 180, align: 'center' },
         { title: '商户名称', scopedSlots: { customRender: 'dealerName' }, align: 'center', ellipsis: true },
-        { title: '商户别名', dataIndex: 'dealerAlias', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系人', dataIndex: 'contact', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '联系电话', dataIndex: 'dealerTelephone', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定手机号码', dataIndex: 'managerMobile', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核状态', dataIndex: 'auditStateDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '合作状态', dataIndex: 'cooperateFlagDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '生效时间', dataIndex: 'cooperateEffectiveTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户别名', dataIndex: 'dealerAlias', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人', dataIndex: 'contact', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '联系电话', dataIndex: 'dealerTelephone', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定手机号码', dataIndex: 'managerMobile', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核状态', dataIndex: 'auditStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '合作状态', dataIndex: 'cooperateFlagDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '生效时间', dataIndex: 'cooperateEffectiveTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center', fixed: 'right' }
       ],
       loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return dealerQueryList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -155,6 +154,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -165,11 +165,6 @@ export default {
       isAudit: false
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 430 : 375)
-    }
-  },
   methods: {
     //  重置列表
     resetSearchForm () {
@@ -264,6 +259,24 @@ export default {
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 47 - 81
src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue

@@ -9,13 +9,14 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="permissionSetting-main">
         <!-- 搜索条件 -->
-        <div class="table-page-search-wrapper">
+        <div ref="tableSearch" class="table-page-search-wrapper">
           <a-form-model
             id="permissionSetting-form"
             ref="ruleForm"
+            class="form-model-con"
+            layout="inline"
             :model="queryParam"
             :rules="rules"
-            layout="inline"
             @keyup.enter.native="handleSearch">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
@@ -33,9 +34,9 @@
                   <a-input id="permissionSetting-goodsCode" v-model.trim="queryParam.goodsCode" allowClear placeholder="请输入产品编码"/>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-button style="margin-bottom: 18px;" type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
-                <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
+              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="handleSearch" :disabled="disabled" id="permissionSetting-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="permissionSetting-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form-model>
@@ -47,22 +48,21 @@
           <a-button id="permissionSetting-product" type="primary" class="button-success" @click="choosePModal('PRODUCT')">选择产品</a-button>
         </div>
         <!-- 列表 -->
-        <a-table
-          class="sTable"
+        <s-table
+          class="sTable fixPagination"
           ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
           size="small"
           :rowKey="(record) => record.id"
           :columns="columns"
-          :data-source="loadData"
-          :pagination="paginationProps"
-          :loading="loading"
-          :scroll="{ x: 1200, y: tableHeight }"
+          :data="loadData"
+          :scroll="{ x: 930, y: tableHeight }"
           bordered>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
           </template>
-        </a-table>
+        </s-table>
       </a-card>
     </a-spin>
     <!-- 选择产品品牌 -->
@@ -91,7 +91,6 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
         goodsType: undefined,
@@ -104,23 +103,30 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, //  表格加载中
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '添加时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '添加时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '类型', dataIndex: 'type', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '类型名称', dataIndex: 'goodsName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'product.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'product.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'product.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
-      loadData: [],
-      pageNo: 1, //  分页页码
-      pageSize: 10, //  分页 每页多少条
-      paginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
-        total: 0, //  分页总条数
-        current: 1,
-        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
-        onChange: (current) => this.changePage(current)
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return dealerScopeList(Object.assign(parameter, this.queryParam, { dealerSn: this.$route.params.sn })).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            const goodsType = data.list[i].goodsType
+            data.list[i].type = goodsType == 'PRODUCT' ? '产品' : goodsType == 'BRAND' ? '品牌' : goodsType == 'CATEGORY' ? '分类' : '--'
+          }
+          this.disabled = false
+          this.spinning = false
+          return data
+        })
       },
       openBrandModal: false, //  选择产品品牌
       openTypeModal: false, //  选择产品分类
@@ -136,56 +142,12 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.getProductList(1)
+          _this.$refs.table.refresh(true)
         } else {
           return false
         }
       })
     },
-    // 经销权 列表
-    getProductList (pageNo) {
-      this.pageNo = pageNo || this.pageNo
-      this.disabled = true
-      if (this.tableHeight == 0) {
-        this.tableHeight = window.innerHeight - 380
-      }
-      const params = {
-        pageNo: this.pageNo,
-        pageSize: this.pageSize
-      }
-      this.loading = true
-      dealerScopeList(Object.assign(params, this.queryParam, { dealerSn: this.$route.params.sn })).then(res => {
-        this.loading = false
-        if (res.status == 200) {
-          const data = res.data
-          this.paginationProps.total = Number(res.data.count) || 0
-          this.paginationProps.current = data.pageNo
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            const goodsType = data.list[i].goodsType
-            data.list[i].type = goodsType == 'PRODUCT' ? '产品' : goodsType == 'BRAND' ? '品牌' : goodsType == 'CATEGORY' ? '分类' : '--'
-          }
-          this.loadData = data.list
-          this.disabled = false
-        } else {
-          this.paginationProps.total = 0
-          this.paginationProps.current = 1
-          this.loadData = []
-        }
-      })
-    },
-    //  分页  一页多少条change
-    changePageSize (current, pageSize) {
-      this.pageNo = current
-      this.pageSize = pageSize
-      this.getProductList()
-    },
-    //  分页 页码change
-    changePage (current) {
-      this.pageNo = current
-      this.getProductList()
-    },
     // 选择产品
     choosePModal (type) {
       const productList = []
@@ -273,7 +235,7 @@ export default {
       dealerScopeSave(params).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.getProductList(1)
+          _this.$refs.table.refresh(true)
           _this.spinning = false
         } else {
           _this.spinning = false
@@ -292,7 +254,7 @@ export default {
           dealerScopeDel({ sn: row.dealerScopeSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.getProductList()
+              _this.$refs.table.refresh()
               _this.spinning = false
             } else {
               _this.spinning = false
@@ -306,11 +268,7 @@ export default {
       this.queryParam.goodsType = undefined
       this.queryParam.goodsName = ''
       this.queryParam.goodsCode = ''
-      this.pageNo = 1
-      this.pageSize = 10
-      this.paginationProps.total = 0
-      this.paginationProps.current = 1
-      this.getProductList(1)
+      this.$refs.table.refresh(true)
     },
     // 返回
     handleBack () {
@@ -320,12 +278,20 @@ export default {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 295
     }
   },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getProductList(1)
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
     })
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
   }
 }
 </script>

+ 74 - 61
src/views/dealerManagement/rebateSettings/list.vue

@@ -1,63 +1,66 @@
 <template>
   <a-card size="small" :bordered="false" class="rebateSettingsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="经销商名称">
-              <a-input id="rebateSettingsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="rebateSettingsList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="rebateSettingsList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="$hasPermissions('B_rebateSettings_edit')"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="rebateSettingsList-edit-btn">编辑</a-button>
-        <span v-else>--</span>
-      </template>
-      <!-- 经销商名称 -->
-      <template slot="jxs" slot-scope="text, record">
-        <span v-if="record.subDealer">{{ record.subDealer.dealerName }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 经销商级别 -->
-      <template slot="dealerLevel" slot-scope="text, record">
-        <span v-if="record.subDealer">{{ record.subDealer.provinceName }} > {{ record.subDealer.dealerLevelDictValue }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 差价归属 -->
-      <template slot="cjgs" slot-scope="text, record">
-        <span v-if="record.supDealer">{{ record.supDealer.dealerName }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 归属经销商级别 -->
-      <template slot="gsjxsjb" slot-scope="text, record">
-        <span v-if="record.supDealer">{{ record.supDealer.provinceName }} > {{ record.supDealer.dealerLevelDictValue }}</span>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="经销商名称">
+                <a-input id="rebateSettingsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="rebateSettingsList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateSettingsList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_rebateSettings_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="rebateSettingsList-edit-btn">编辑</a-button>
+          <span v-else>--</span>
+        </template>
+        <!-- 经销商名称 -->
+        <template slot="jxs" slot-scope="text, record">
+          <span v-if="record.subDealer">{{ record.subDealer.dealerName }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 经销商级别 -->
+        <template slot="dealerLevel" slot-scope="text, record">
+          <span v-if="record.subDealer">{{ record.subDealer.provinceName }} > {{ record.subDealer.dealerLevelDictValue }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 差价归属 -->
+        <template slot="cjgs" slot-scope="text, record">
+          <span v-if="record.supDealer">{{ record.supDealer.dealerName }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 归属经销商级别 -->
+        <template slot="gsjxsjb" slot-scope="text, record">
+          <span v-if="record.supDealer">{{ record.supDealer.provinceName }} > {{ record.supDealer.dealerLevelDictValue }}</span>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 关联下级 -->
     <associate-modal :openModal="openModal" :nowData="nowData" @ok="$refs.table.refresh(true)" @close="closeModal" />
   </a-card>
@@ -71,6 +74,7 @@ export default {
   components: { STable, VSelect, associateModal },
   data () {
     return {
+      spinning: false,
       tableHeight: 0,
       formItemLayout: {
         labelCol: { span: 6 },
@@ -90,9 +94,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 320
-        }
+        this.spinning = true
         return queryRebatePage(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -100,6 +102,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -123,7 +126,17 @@ export default {
     closeModal () {
       this.nowData = null
       this.openModal = false
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 45 - 35
src/views/financialManagement/financialCollection/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -98,10 +98,10 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -109,19 +109,16 @@
           </a-row>
         </a-form>
       </div>
-      <!-- 总计 -->
-      <!-- <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-      </a-alert> -->
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1820, y: tableHeight }"
+        :scroll="{ x: 1440, y: tableHeight }"
         bordered>
         <!-- 单号 -->
         <template slot="salesBillNo" slot-scope="text, record">
@@ -156,6 +153,7 @@ export default {
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       queryParam: { //  查询条件
         beginAuditDate: getDate.getThreeMonthDays().starttime,
         endAuditDate: getDate.getCurrMonthDays().endtime,
@@ -178,23 +176,24 @@ export default {
       ], //  审核时间
       advanced: false,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 220, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '审核时间', dataIndex: 'auditDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 180, align: 'center' },
         { title: '经销商名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '订单金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收款时间', dataIndex: 'settleDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '订单金额', dataIndex: 'totalAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收款时间', dataIndex: 'settleDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remarks', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return salesReceiptList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -203,6 +202,7 @@ export default {
           }
           this.total = data.count || 0
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -212,11 +212,6 @@ export default {
       addrDistrictList: [] //  区下拉
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 440 : 330)
-    }
-  },
   methods: {
     //  审核时间  change
     dateAuditChange (date) {
@@ -321,6 +316,24 @@ export default {
           }
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -333,15 +346,12 @@ export default {
 
 <style lang="less">
   .financialCollectionList-wrap{
-    .sTable{
-      margin-top: 10px;
+    .active{
+      color: #ed1c24;
+      cursor: pointer;
+    }
+    .common{
+      color: rgba(0, 0, 0, 0.65);
     }
-	.active{
-		color: #ed1c24;
-		cursor: pointer;
-	}
-	.common{
-		color: rgba(0, 0, 0, 0.65);
-	}
   }
 </style>

+ 1 - 1
src/views/financialManagement/inventoryReview/detail.vue

@@ -14,7 +14,7 @@
     <!-- 内容 -->
     <a-page-header title="盘点单号:CG2021010100001" ></a-page-header>
     <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
+    <a-alert type="info" style="margin-bottom:10px">
       <div slot="message"><strong class="red">红色代表盘盈</strong>,<strong class="green">绿色代表盈亏</strong></div>
     </a-alert>
     <!-- 盈亏统计 -->

+ 1 - 1
src/views/financialManagement/inventoryReview/list.vue

@@ -35,7 +35,7 @@
       </a-form>
     </div>
     <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
+    <a-alert type="info" style="margin-bottom:10px">
       <div slot="message">共 <strong>6</strong> 条记录,其中待审核 <strong>14</strong> 条 </div>
     </a-alert>
     <!-- 列表 -->

+ 48 - 34
src/views/financialManagement/returnConfirmation/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="returnConfirmationList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -12,7 +12,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <custList ref="custList" id="returnConfirmationList-buyerSn" @change="custChange"></custList>
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="returnConfirmationList-buyerSn" @change="custChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -44,10 +44,10 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="returnConfirmationList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="returnConfirmationList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnConfirmationList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -57,13 +57,14 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1460, y: tableHeight }"
+        :scroll="{ x: 1210, y: tableHeight }"
         bordered>
         <!-- 销退单号 -->
         <template slot="salesReturnBillNo" slot-scope="text, record">
@@ -90,14 +91,15 @@
 <script>
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
-import custList from '@/views/common/custList.vue'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import confirmationDetailModal from './detailModal.vue'
 import { salesReturnFinancialList, salesReturnFinancial } from '@/api/salesReturn'
 export default {
-  components: { STable, VSelect, confirmationDetailModal, custList, rangeDate },
+  components: { STable, VSelect, confirmationDetailModal, dealerSubareaScopeList, rangeDate },
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
@@ -107,23 +109,24 @@ export default {
         billStatus: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      advanced: false,
+      advanced: true,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: 220, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: 180, align: 'center' },
         { title: '退货客户', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '确认时间', dataIndex: 'confirmTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'billStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货金额', dataIndex: 'totalAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '确认时间', dataIndex: 'confirmTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'billStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return salesReturnFinancialList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -131,6 +134,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -138,11 +142,6 @@ export default {
       itemSn: ''
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 375 : 320)
-    }
-  },
   methods: {
     //  创建时间  change
     dateChange (date) {
@@ -161,7 +160,7 @@ export default {
       this.queryParam.buyerSn = undefined
       this.queryParam.grabFlag = undefined
       this.queryParam.billStatus = undefined
-      this.$refs.custList.resetForm()
+      this.$refs.dealerSubareaScopeList.resetForm()
       this.$refs.table.refresh(true)
     },
     // 详情
@@ -207,6 +206,24 @@ export default {
           _this.spinning = false
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   }
 }
@@ -214,15 +231,12 @@ export default {
 
 <style lang="less">
   .returnConfirmationList-wrap{
-    .sTable{
-      margin-top: 10px;
+    .active{
+      color: #ed1c24;
+      cursor: pointer;
+    }
+    .common{
+      color: rgba(0, 0, 0, 0.65);
     }
-	.active{
-		color: #ed1c24;
-		cursor: pointer;
-	}
-	.common{
-		color: rgba(0, 0, 0, 0.65);
-	}
   }
 </style>

+ 38 - 34
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="warehousingConfirmationList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -21,29 +21,30 @@
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
       <!-- 列表 -->
-      <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 15px">
-        <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
-        <span style="margin-left: 8px">
+      <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 10px">
+        <a-button type="primary" class="button-error" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
+        <span style="margin-left: 5px">
           <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
         </span>
       </div>
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :row-selection="rowSelection"
         :rowKey="(record) => record.stockPutSn"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1530, y: tableHeight }"
+        :scroll="{ x: 1280, y: tableHeight }"
         bordered>
         <!-- 入库单号 -->
         <template slot="stockPutNo" slot-scope="text, record">
@@ -104,14 +105,14 @@ export default {
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: 220, align: 'center' },
+        { title: '入库时间', dataIndex: 'putTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: 180, align: 'center' },
         { title: '商户名称', dataIndex: 'providerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据状态', dataIndex: 'auditStateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'productTotalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'productTotalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据状态', dataIndex: 'auditStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remark', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
@@ -120,12 +121,11 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 370
-        }
+        this.spinning = true
         return stockPutList(Object.assign(parameter, this.queryParam, { confirm: true })).then(res => {
           const data = res.data
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -144,16 +144,16 @@ export default {
     rowSelection () {
       if (this.$hasPermissions('B_warehousingConfirmationpl')) {
         return {
-			  selectedRowKeys: this.selectedRowKeys,
-			  onChange: (selectedRowKeys, selectedRows) => {
-			    console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-			    this.onSelectChange(selectedRowKeys)
-			  },
-			  getCheckboxProps: record => ({
-			    props: {
-			      disabled: record.auditState != 'WAIT'
-			    }
-			  })
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: (selectedRowKeys, selectedRows) => {
+            console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+            this.onSelectChange(selectedRowKeys)
+          },
+          getCheckboxProps: record => ({
+            props: {
+              disabled: record.auditState != 'WAIT'
+            }
+          })
         }
       } else {
         return null
@@ -215,7 +215,6 @@ export default {
         if (res.status == 200) {
           if (this.isBatch) {
             _this.selectedRowKeys = []
-            _this.selectedRows = []
           }
           _this.$message.success(res.message)
           _this.$refs.table.refresh()
@@ -240,17 +239,22 @@ export default {
     onSelectChange (selectedRowKeys) {
       console.log('selectedRowKeys changed: ', selectedRowKeys)
       this.selectedRowKeys = selectedRowKeys
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>
 
 <style lang="less">
-  .warehousingConfirmationList-wrap{
-    .sTable{
-      margin-top: 20px;
-    }
-  }
 	.active{
 		color: #ed1c24;
 		cursor: pointer;

+ 1 - 1
src/views/inventoryManagement/intelligentReplenishment/detailModal.vue

@@ -10,7 +10,7 @@
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <div>
-        <a-alert type="info" showIcon style="margin-bottom:15px">
+        <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">此预测单的各项参数信息如下</div>
         </a-alert>
         <div class="module-cont" v-if="detailData">

+ 19 - 1
src/views/inventoryManagement/intelligentReplenishment/edit.vue

@@ -33,7 +33,7 @@
                   <a-radio :value="0">自选产品</a-radio>
                 </a-radio-group>
               </a-form-model-item>
-              <productRange v-if="form.stockPredictRange==0" ref="productRange" :itemSn="$route.params.sn" @ok="handleProductOk" />
+              <productRange v-if="form.stockPredictRange==0" ref="productRange" :tableHeight="tableHeight" :itemSn="$route.params.sn" @ok="handleProductOk" />
             </div>
           </div>
           <!-- 参数设置 -->
@@ -91,6 +91,7 @@ export default {
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       formItemLayout: {
         labelCol: { span: 2 },
         wrapperCol: { span: 16 }
@@ -220,8 +221,17 @@ export default {
           this.form.safetyFactor = ''
         }
       })
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - 550
     }
   },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getDetail()
@@ -234,10 +244,18 @@ export default {
 
 <style lang="less">
   .intelligentReplenishmentEdit-wrap{
+    height: 100%;
+    >.ant-spin-nested-loading{
+      height: 100%;
+      .ant-spin-container{
+        height: 93%;
+      }
+    }
     .intelligentReplenishmentEdit-back{
       margin-bottom: 10px;
     }
     .intelligentReplenishmentEdit-cont{
+      height: 100%;
       .steps-cont{
         width: 50%;
         margin: 30px auto 10px;

+ 18 - 3
src/views/inventoryManagement/intelligentReplenishment/list.vue

@@ -2,21 +2,23 @@
   <a-card size="small" :bordered="false" class="intelligentReplenishmentList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 操作按钮 -->
-      <div class="table-operator">
+      <div ref="tableSearch" class="table-operator">
         <a-button v-if="$hasPermissions('B_intelligentReplenishment_add')" id="intelligentReplenishmentList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
         <a-button v-if="$hasPermissions('B_intelligentReplenishment_set')" id="intelligentReplenishmentList-set" type="primary" class="button-warning" @click="handleSet">基础信息设置</a-button>
       </div>
-      <a-alert type="info" showIcon style="margin-bottom:15px">
+      <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">为保证系统性能,仅保留最近10次的预测结果</div>
       </a-alert>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
+        :scroll="{ y: tableHeight }"
         :showPagination="false"
         bordered>
         <!-- 操作 -->
@@ -68,6 +70,7 @@ export default {
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
@@ -77,11 +80,13 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         return predictList({}).then(res => {
           const data = res.data
           for (var i = 0; i < data.length; i++) {
             data[i].no = i + 1
           }
+          this.spinning = false
           return data
         })
       },
@@ -172,7 +177,17 @@ export default {
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 5 - 1
src/views/inventoryManagement/intelligentReplenishment/productRange.vue

@@ -22,7 +22,7 @@
         :columns="columns"
         :data="loadData"
         :showPagination="false"
-        :scroll="{ y: 400 }"
+        :scroll="{ y: tableHeight }"
         bordered>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -50,6 +50,10 @@ export default {
     itemSn: {
       type: [String, Number],
       default: ''
+    },
+    tableHeight: {
+      type: [String, Number],
+      default: 400
     }
   },
   data () {

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/detail.vue

@@ -24,7 +24,7 @@
     </a-card>
     <a-card size="small" :bordered="false" class="inventoryCheckingDetail-cont">
       <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
+      <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
           库存总数量:
           <strong>6</strong>
@@ -43,7 +43,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckingDetail-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckingDetail-reset">重置</a-button>
             </a-col>

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/financialAuditDetail.vue

@@ -29,7 +29,7 @@
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="详情">
           <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
+          <a-alert type="info" style="margin-bottom:10px">
             <div slot="message">盘盈总数量: <strong>6</strong> ,库存总成本(¥): <strong>6</strong> ,盘亏总数量: <strong>6</strong> ,盘亏总成本(¥): <strong>6</strong>,盈亏总数量: <strong>6</strong> ,盈亏总成本(¥): <strong>6</strong> </div>
           </a-alert>
           <!-- 筛选条件 -->
@@ -43,7 +43,7 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                   <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialAuditDetail-refresh">查询</a-button>
                   <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="financialAuditDetail-reset">重置</a-button>
                 </a-col>

+ 1 - 1
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -35,7 +35,7 @@
                 <a-cascader :options="typeData" id="makeInventory-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="makeInventory-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="makeInventory-reset">重置</a-button>
             </a-col>

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/makeInventoryDetail.vue

@@ -27,7 +27,7 @@
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="详情">
           <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
+          <a-alert type="info" style="margin-bottom:10px">
             <div slot="message">库存总数量: <strong>6</strong> ,盈亏总数量: <strong>6</strong></div>
           </a-alert>
           <!-- 筛选条件 -->
@@ -41,7 +41,7 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                   <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="makeInventoryDetail-refresh">查询</a-button>
                   <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="makeInventoryDetail-reset">重置</a-button>
                 </a-col>

+ 4 - 4
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -86,9 +86,9 @@
                     </a-col>
                   </template>
                   <a-col :md="6" :sm="24">
-                    <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="selfDisk-refresh">查询</a-button>
-                    <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="selfDisk-reset">重置</a-button>
-                    <a @click="advanced=!advanced" style="margin-left: 8px">
+                    <a-button style="margin-bottom: 10px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="selfDisk-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="selfDisk-reset">重置</a-button>
+                    <a @click="advanced=!advanced" style="margin-left: 5px">
                       {{ advanced ? '收起' : '展开' }}
                       <a-icon :type="advanced ? 'up' : 'down'"/>
                     </a>
@@ -126,7 +126,7 @@
           <!-- 已选产品 -->
           <div>
             <!-- 总计 -->
-            <a-alert type="info" showIcon style="margin-bottom:15px">
+            <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">产品款数 <strong>6</strong> ,采购数量合计 <strong>6</strong> ,采购金额合计¥<strong>6.33</strong></div>
             </a-alert>
             <!-- 列表 -->

+ 23 - 21
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -9,8 +9,11 @@
     @cancle="isShow=false"
     :width="960">
     <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        可用库存总数量(个):<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}</strong>;
+        <span v-if="$hasPermissions('B_isShowCost')">可用库存总成本(¥):<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? currentStock.currentStockCost : '--' }}</strong>。</span>
+      </div>
     </a-alert>
     <!-- 库存详情 -->
     <s-table
@@ -21,13 +24,8 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1580 }"
+      :scroll="{ x: 1210, y: 500 }"
       bordered>
-      <!-- 库存数量 -->
-      <template slot="currentQty" slot-scope="text, record">
-        {{ (record.currentQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-      </template>
     </s-table>
     <div class="btn-cont">
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -54,19 +52,6 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: 180, align: 'center' },
-        { title: '成本单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -98,6 +83,23 @@ export default {
       const currentStockCost = Number(this.currentStock.currentStockCost) || 0
       const freezeStockCost = Number(this.currentStock.freezeStockCost) || 0
       return ((currentStockCost * 1000 + freezeStockCost * 1000) / 1000).toFixed(2)
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库时间', dataIndex: 'putTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(9, 0, { title: '成本单价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 46 - 37
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -78,27 +78,23 @@
         </a-form>
       </div>
       <!-- 合计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">
+          可用库存总数量(个):<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}</strong>;
+          <span v-if="$hasPermissions('B_isShowCost')">可用库存总成本(¥):<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? currentStock.currentStockCost : '--' }}</strong>。</span>
+        </div>
       </a-alert>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1450, y: tableHeight }"
+        :scroll="{ x: 1170, y: tableHeight }"
         bordered>
-        <!-- 现有库存数量 -->
-        <template slot="currentStockQty" slot-scope="text, record">
-          {{ (record.currentStockQty + record.freezeQty) || 0 }}
-          <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-        </template>
-        <template slot="currentStockCost" slot-scope="text, record">
-          {{ ((Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000).toFixed(2) || 0 }}
-        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -136,7 +132,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -156,20 +153,10 @@ export default {
         { name: '库存数量为0', id: '1' },
         { name: '库存数量不为0', id: '0' }
       ],
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
-        { title: '库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 165, align: 'center', sorter: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         // 排序
         if (parameter.sortField == 'currentStockQty') {
           parameter.sortField = 'qty'
@@ -186,6 +173,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           // 总计
           this.getTotal(Object.assign(parameter, this.queryParam))
           // 产品分类
@@ -205,18 +193,21 @@ export default {
     }
   },
   computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
-    },
-    stockQty () { //  库存总数量 合计
-      const currentStockQty = this.currentStock && this.currentStock.currentStockQty ? Number(this.currentStock.currentStockQty) : 0
-      const freezeQty = this.currentStock && this.currentStock.freezeQty ? Number(this.currentStock.freezeQty) : 0
-      return currentStockQty + freezeQty
-    },
-    stockCost () { //  库存总成本 合计
-      const currentStockCost = this.currentStock && this.currentStock.currentStockCost ? Number(this.currentStock.currentStockCost) : 0
-      const freezeCost = this.currentStock && this.currentStock.freezeCost ? Number(this.currentStock.freezeCost) : 0
-      return ((currentStockCost * 1000 + freezeCost * 1000) / 1000).toFixed(2)
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '可用库存数量', dataIndex: 'currentStockQty', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(7, 0, { title: '可用库存成本', dataIndex: 'currentStockCost', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {
@@ -335,6 +326,24 @@ export default {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   }
 }

+ 129 - 97
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -1,94 +1,97 @@
 <template>
   <div class="inventoryQueryWarehouseDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="inventoryQueryWarehouseDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="inventoryQueryWarehouseDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="inventoryQueryWarehouseDetail-cont">
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-          <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="变动类型">
-                <v-select
-                  v-model="queryParam.flowType"
-                  ref="flowType"
-                  id="inventoryQueryWarehouseDetail-flowType"
-                  code="STOCK_FLOW_TYPE"
-                  placeholder="请选择变动类型"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="单据类型">
-                <v-select
-                  v-model="queryParam.bizType"
-                  ref="bizType"
-                  id="inventoryQueryWarehouseDetail-bizType"
-                  code="STOCK_FLOW_BIZ_TYPE"
-                  placeholder="请选择单据类型"
-                  allowClear></v-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="仓库">
-                <a-select id="inventoryQueryWarehouseDetail-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="inventoryQueryWarehouseDetail-back">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="inventoryQueryWarehouseDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="inventoryQueryWarehouseDetail-cont">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
               <a-col :md="6" :sm="24">
-                <a-form-item label="单据审核时间">
-                  <rangeDate ref="rangeDate" @change="dateChange" />
+                <a-form-item label="变动类型">
+                  <v-select
+                    v-model="queryParam.flowType"
+                    ref="flowType"
+                    id="inventoryQueryWarehouseDetail-flowType"
+                    code="STOCK_FLOW_TYPE"
+                    placeholder="请选择变动类型"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="单位名称">
-                  <a-input id="inventoryQueryWarehouseDetail-unitName" v-model.trim="queryParam.unitName" allowClear placeholder="请输入单位名称"/>
+                <a-form-item label="单据类型">
+                  <v-select
+                    v-model="queryParam.bizType"
+                    ref="bizType"
+                    id="inventoryQueryWarehouseDetail-bizType"
+                    code="STOCK_FLOW_BIZ_TYPE"
+                    placeholder="请选择单据类型"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
-            </template>
-            <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryWarehouseDetail-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryWarehouseDetail-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
-            </a-col>
-          </a-row>
-        </a-form>
-      </div>
-      <!-- 合计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div class="ftext" slot="message">
-          当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong>;
-          当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong>。
+              <a-col :md="6" :sm="24">
+                <a-form-item label="仓库">
+                  <a-select id="inventoryQueryWarehouseDetail-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                    <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <template v-if="advanced">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="单据审核时间">
+                    <rangeDate ref="rangeDate" @change="dateChange" />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="单位名称">
+                    <a-input id="inventoryQueryWarehouseDetail-unitName" v-model.trim="queryParam.unitName" allowClear placeholder="请输入单位名称"/>
+                  </a-form-item>
+                </a-col>
+              </template>
+              <a-col :md="6" :sm="24">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryWarehouseDetail-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryWarehouseDetail-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </a-col>
+            </a-row>
+          </a-form>
         </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1980 }"
-        bordered>
-        <!-- 数量 -->
-        <template slot="qty" slot-scope="text, record">
-          <p :class="record.flowType=='PUT' ? 'green':'red'" style="margin: 0;">
-            <span v-if="record.qty!=0">{{ record.flowType=='PUT' ? '+':'-' }}</span>
-            {{ record.qty }}
-          </p>
-        </template>
-      </s-table>
-    </a-card>
+        <!-- 合计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div class="ftext" slot="message">
+            当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong>;
+            <span v-if="$hasPermissions('B_isShowCost')">当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong>。</span>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x: 1590, y: tableHeight }"
+          bordered>
+          <!-- 数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <p :class="record.flowType=='PUT' ? 'green':'red'" style="margin: 0;">
+              <span v-if="record.qty!=0">{{ record.flowType=='PUT' ? '+':'-' }}</span>
+              {{ record.qty }}
+            </p>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
   </div>
 </template>
 
@@ -101,7 +104,9 @@ export default {
   components: { STable, VSelect, rangeDate },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
@@ -111,24 +116,10 @@ export default {
         warehouseSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次号', dataIndex: 'stockBatchNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'unitName', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
-        { title: '总成本', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         const params = Object.assign(parameter, this.queryParam, { productSn: this.$route.params.sn })
         return stockFlowList(params).then(res => {
           const data = res.data
@@ -142,6 +133,7 @@ export default {
             }
           }
           this.disabled = false
+          this.spinning = false
           this.getTotal(params)
           return data
         })
@@ -150,6 +142,28 @@ export default {
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'unitName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', scopedSlots: { customRender: 'qty' }, width: 80, align: 'center' },
+        { title: '总售价', dataIndex: 'totalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(11, 0, { title: '总成本', dataIndex: 'totalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  创建时间  change
     dateChange (date) {
@@ -192,6 +206,24 @@ export default {
           this.warehouseList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230 - 52
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 78 - 90
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -2,8 +2,8 @@
   <a-card size="small" :bordered="false" class="inventoryWarningList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="pageInit(1)">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品编码">
@@ -63,8 +63,8 @@
               </a-col>
             </template>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="pageInit(1)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
               <!-- <a-button
                 style="margin-left: 8px"
                 type="danger"
@@ -72,7 +72,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="inventoryWarningList-export">导出</a-button> -->
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -82,23 +82,22 @@
       </div>
       <!-- 操作按钮 -->
       <div v-if="$hasPermissions('B_inventoryWarning_refresh')" class="table-operator">
-        <a-button type="primary" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
+        <a-button class="button-error" type="primary" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
         <span style="margin-left: 8px">
           <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
         </span>
       </div>
       <!-- 列表 -->
-      <a-table
-        class="sTable"
+      <s-table
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :row-selection="$hasPermissions('B_inventoryWarning_refresh')?{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }:null"
         :rowKey="(record) => record.id"
         :columns="columns"
-        :dataSource="loadData"
-        :scroll="{ x: 2220, y: tableHeight }"
-        :pagination="paginationProps"
-        :loading="tableLoading"
+        :data="loadData"
+        :scroll="{ x: 1800, y: tableHeight }"
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
@@ -119,6 +118,7 @@
         <template slot="inTransit" slot-scope="text, record" >
           <div>
             <a-input-number
+              size="small"
               id="inventoryWarningList-inTransit"
               v-model="record.inTransit"
               :precision="0"
@@ -131,6 +131,7 @@
         <template slot="upperLimit" slot-scope="text, record" >
           <div>
             <a-input-number
+              size="small"
               id="inventoryWarningList-upperLimit"
               v-model="record.upperLimit"
               :precision="0"
@@ -143,6 +144,7 @@
         <template slot="lowerLimit" slot-scope="text, record" >
           <div>
             <a-input-number
+              size="small"
               id="inventoryWarningList-lowerLimit"
               v-model="record.lowerLimit"
               :precision="0"
@@ -162,7 +164,7 @@
             id="inventoryWarningList-add-btn">保存</a-button>
           <span v-else>--</span>
         </template>
-      </a-table>
+      </s-table>
     </a-spin>
   </a-card>
 </template>
@@ -178,7 +180,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         productCode: '',
         productName: '',
@@ -191,35 +194,47 @@ export default {
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      tableLoading: false, //  表格加载中
       productBrandList: [], //  产品品牌下拉数据
       productTypeList: [], //  产品类别下拉数据
       productType: [],
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '实时库存数(个)', scopedSlots: { customRender: 'stockQty' }, width: 180, align: 'center' },
-        { title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 130, align: 'center' },
-        { title: '总库存数(个)', dataIndex: 'totalQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
-        { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
-        { title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '预警提示', scopedSlots: { customRender: 'stockState' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 180, align: 'center' },
+        { title: '实时库存数(个)', scopedSlots: { customRender: 'stockQty' }, width: 110, align: 'center' },
+        { title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 100, align: 'center' },
+        { title: '总库存数(个)', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 110, align: 'center' },
+        { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 110, align: 'center' },
+        { title: '差异数量', dataIndex: 'differenceNum', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '预警提示', scopedSlots: { customRender: 'stockState' }, width: 80, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
-      loadData: [],
-      pageNo: 1, //  分页页码
-      pageSize: 10, //  分页 每页多少条
-      paginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
-        total: 0, //  分页总条数
-        current: 1,
-        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
-        onChange: (current) => this.changePage(current)
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return stockWarnList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            if (this.selectedRowKeys) { //  处理切换页码后 上页已选已输数据保留
+              const ind = this.selectedRowKeys.indexOf(data.list[i].id)
+              if (ind >= 0) {
+                data.list[i].inTransit = this.selectedRows[ind].inTransit
+                data.list[i].upperLimit = this.selectedRows[ind].upperLimit
+                data.list[i].lowerLimit = this.selectedRows[ind].lowerLimit
+              }
+            }
+          }
+          this.disabled = false
+          this.spinning = false
+          return data
+        })
       },
       selectedRowKeys: [],
       selectedRows: [],
@@ -227,50 +242,11 @@ export default {
     }
   },
   computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
-    },
     hasSelected () {
       return this.selectedRowKeys.length > 0
     }
   },
   methods: {
-    //  分页  一页多少条change
-    changePageSize (current, pageSize) {
-      this.pageNo = current
-      this.pageSize = pageSize
-      this.pageInit()
-    },
-    //  分页 页码change
-    changePage (current) {
-      this.pageNo = current
-      this.pageInit()
-    },
-    //  列表数据
-    pageInit (pageNo) {
-      this.disabled = true
-      this.pageNo = pageNo || this.pageNo
-      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
-      this.tableLoading = true
-      stockWarnList(params).then(res => {
-        this.tableLoading = false
-        if (res.status == 200) {
-          const data = res.data
-          this.paginationProps.total = Number(res.data.count) || 0
-          this.paginationProps.current = this.pageNo
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          this.loadData = data.list
-          this.disabled = false
-        } else {
-          this.paginationProps.total = 0
-          this.paginationProps.current = 1
-          this.loadData = []
-        }
-      })
-    },
     //  保存
     handleSave (row, isBatch) {
       const params = []
@@ -320,7 +296,7 @@ export default {
       stockWarnSaveBatch(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          this.pageInit()
+          this.$refs.table.refresh()
           this.selectedRowKeys = []
           this.selectedRows = []
           this.spinning = false
@@ -333,15 +309,10 @@ export default {
       this.selectedRowKeys = selectedRowKeys
     },
     onSelectChange (record, selected, selectedRows, nativeEvent) {
-      const _this = this
       if (selected) { //  选择
         this.selectedRows.push(record)
       } else { //  取消
-        this.selectedRows.map((item, index) => {
-          if (item.id == record.id) {
-            _this.selectedRows.splice(index, 1)
-          }
-        })
+        this.selectedRows = selectedRows
       }
     },
     // 本页全选/取消全选
@@ -350,13 +321,17 @@ export default {
       if (selected) { //  选择
         this.selectedRows = [...this.selectedRows, ...changeRows]
       } else { //  取消
+        const arrId = []
         this.selectedRows.map((item, index) => {
           this.selectedRows.map((subItem, ind) => {
             if (item.id == subItem.id) {
-              _this.selectedRows.splice(index, 1)
+              arrId.push(index)
             }
           })
         })
+        arrId.map((item, index) => {
+          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        })
       }
     },
     //  重置
@@ -370,11 +345,7 @@ export default {
       this.queryParam.productTypeSn3 = undefined
       this.queryParam.stockState = undefined
       this.productType = []
-      this.pageNo = 1
-      this.pageSize = 10
-      this.paginationProps.total = 0
-      this.paginationProps.current = 1
-      this.pageInit(1)
+      this.$refs.table.refresh(true)
     },
     //  批量更新
     handleupdate () {
@@ -444,11 +415,28 @@ export default {
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.pageInit(1)
       vm.getProductType()
       vm.getProductBrand()
     })

+ 19 - 13
src/views/power/OperateJournal/OperateJournal.vue

@@ -1,8 +1,8 @@
 <template>
-  <a-card :bordered="false">
+  <a-card size="small" :bordered="false">
     <div class="operateJournal">
       <!-- 搜索框 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -29,8 +29,9 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         rowKey="id"
         :columns="columns"
@@ -45,7 +46,6 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate'
 import { STable } from '@/components'
 import { journalList } from '@/api/OperateJournal.js'
@@ -57,9 +57,10 @@ export default {
     return {
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
       time: [
-        moment(getDate.getThreeday().starttime, this.dateFormat),
-        moment(getDate.getThreeday().endtime, this.dateFormat)
+        getDate.getThreeday().starttime,
+        getDate.getThreeday().endtime
       ],
       queryParam: {
         beginDate: getDate.getThreeday().starttime, // 查询的开始时间
@@ -69,8 +70,8 @@ export default {
       },
       dateFormat: 'YYYY-MM-DD',
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '操作时间', dataIndex: 'actDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '操作时间', dataIndex: 'actDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: 'IP', dataIndex: 'ip', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作人', dataIndex: 'actorName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作信息', dataIndex: 'actDesc', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
@@ -92,11 +93,6 @@ export default {
       }
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - 340
-    }
-  },
   methods: {
     //  时间  change
     dateChange (date) {
@@ -111,7 +107,17 @@ export default {
       this.queryParam.actDesc = ''
       this.queryParam.actorName = ''
       this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 0 - 1
src/views/power/menu/menu.vue

@@ -23,7 +23,6 @@
             :autoExpandParent="autoExpandParent"
             @select="onSelect"
             :selectedKeys="selectedKeys"
-            showIcon
           >
             <template slot="title" slot-scope="{title}">
               <span v-if="title.indexOf(searchValue) > -1">

+ 24 - 46
src/views/power/role/roleList.vue

@@ -1,7 +1,7 @@
 <template>
   <a-card size="small" :bordered="false">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline">
           <a-row :gutter="48">
             <a-col :md="6" :sm="24">
@@ -31,11 +31,14 @@
         <a-button type="primary" v-if="$hasPermissions('B_power_role_add')" class="button-error" @click="openModal" id="roleList-openModal">新增</a-button>
       </div>
       <s-table
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         rowKey="id"
         :columns="columns"
         :data="loadData"
+        :scroll="{ y: tableHeight }"
         style="word-break: break-all;"
         bordered>
         <!-- 启用禁用 -->
@@ -96,6 +99,7 @@ export default {
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       // 查询参数
       queryParam: {
         name: '',
@@ -106,52 +110,17 @@ export default {
       itemData: {}, // 编辑行数据
       menuData: {},
       // 表头
-      columns: [{
-        title: '序号',
-        dataIndex: 'no',
-        width: 60,
-        align: 'center'
-      },
-      {
-        title: '创建时间',
-        dataIndex: 'createDate',
-        width: 150,
-        align: 'center'
-      },
-      {
-        title: '角色名称',
-        dataIndex: 'name',
-        width: 150,
-        align: 'center'
-      },
-      {
-        title: '角色描述',
-        dataIndex: 'remarks',
-        width: 200,
-        align: 'center',
-        scopedSlots: {
-          customRender: 'remarks'
-        }
-      },
-      {
-        title: '状态',
-        width: 150,
-        align: 'center',
-        scopedSlots: {
-          customRender: 'status'
-        }
-      },
-      {
-        title: '操作',
-        width: 150,
-        align: 'center',
-        scopedSlots: {
-          customRender: 'action'
-        }
-      }
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center' },
+        { title: '角色名称', dataIndex: 'name', align: 'center' },
+        { title: '角色描述', dataIndex: 'remarks', width: 200, align: 'center', scopedSlots: { customRender: 'remarks' } },
+        { title: '状态', width: 100, align: 'center', scopedSlots: { customRender: 'status' } },
+        { title: '操作', width: 150, align: 'center', scopedSlots: { customRender: 'action' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         return getPowerRoleList(Object.assign(parameter, this.queryParam)).then(res => {
           const no = (res.data.pageNo - 1) * res.data.pageSize
           for (let i = 0; i < res.data.list.length; i++) {
@@ -159,6 +128,7 @@ export default {
             _item.no = no + i + 1
             _item.isEnable = _item.isEnable + '' === '1'
           }
+          this.spinning = false
           return res.data
         })
       },
@@ -246,7 +216,17 @@ export default {
           this.spinning = false
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>
@@ -260,11 +240,9 @@ export default {
 		color: #fff;
 		margin-right: 5px;
 	}
-
 	.red-text {
 		background-color: red;
 	}
-
 	.menu-text {
 		background-color: #f90;
 	}

+ 19 - 26
src/views/power/user/userList.vue

@@ -1,7 +1,7 @@
 <template>
   <a-card size="small" :bordered="false">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -27,46 +27,26 @@
         </a-form>
       </div>
       <div class="table-operator">
-        <!-- <a-button v-if="$hasPermissions('B_powerMD_user_add')" type="primary" class="button-error" @click="openModal">新增</a-button> -->
         <a-button type="primary" v-if="$hasPermissions('B_power_user_add')" class="button-error" @click="openModal">新增</a-button>
       </div>
       <s-table
+        class="sTable fixPagination"
         ref="table"
         size="small"
+        :style="{ height: tableHeight+84.5+'px' }"
         rowKey="id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1350 }"
+        :scroll="{ x: 1350, y: tableHeight }"
         style="word-break: break-all;"
         bordered
       >
         <span slot="status" slot-scope="text, record">
-          <!-- <a-switch v-if="$hasPermissions('B_powerMD_user_enable')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
-          <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span> -->
           <!-- 超级管理员不可删除不可编辑不可启禁用 -->
           <a-switch v-if="record.superAdmin!=1 && $hasPermissions('B_power_user_enable')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
           <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span>
         </span>
         <span slot="action" slot-scope="text, record">
-          <!-- <a-icon
-            type="edit"
-            title="编辑"
-            :style="{fontSize: '20px',color:' #1890FF',padding:' 0 10px'}"
-            v-if="$hasPermissions('B_powerMD_user_edit')"
-            @click="handleEdit(record)"
-          />
-          <a-icon
-            type="unlock"
-            title="重置密码"
-            v-if="record.loginFlag==1 && $hasPermissions('B_powerMD_user_restPwd')"
-            :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
-            @click="resetPassword(record)" />
-          <a-icon
-            type="delete"
-            title="删除"
-            :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-            v-if="record.loginFlag==0 && $hasPermissions('B_powerMD_user_del')"
-            @click="delect(record)"/> -->
           <a-icon
             type="edit"
             title="编辑"
@@ -114,6 +94,7 @@ export default {
   data () {
     return {
       spinning: false,
+      tableHeight: 0,
       // 查询参数
       queryParam: {
         name: '',
@@ -125,8 +106,8 @@ export default {
       itemData: null, // 编辑行数据
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '用户名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '手机号码', dataIndex: 'phone', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '用户账号', dataIndex: 'loginName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
@@ -137,6 +118,7 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
           const no = (res.data.pageNo - 1) * res.data.pageSize
           for (let i = 0; i < res.data.list.length; i++) {
@@ -144,6 +126,7 @@ export default {
             _item.no = no + i + 1
             _item.loginFlag = _item.loginFlag + '' === '1'
           }
+          this.spinning = false
           return res.data
         })
       },
@@ -236,7 +219,17 @@ export default {
           this.spinning = false
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 50 - 42
src/views/productManagement/priceChangeRecord/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productChangeRecordList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -15,13 +15,13 @@
                 <a-input id="productChangeRecordList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="5" :sm="24">
               <a-form-item label="产品编码">
                 <a-input id="productChangeRecordList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="7" :sm="24">
                 <a-form-item label="品牌">
                   <a-select
                     placeholder="请选择"
@@ -50,18 +50,18 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productChangeRecordList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productChangeRecordList-reset">重置</a-button>
+            <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productChangeRecordList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productChangeRecordList-reset">重置</a-button>
               <a-button
-                style="margin: 0 0 18px 8px"
+                style="margin-left: 5px"
                 type="primary"
                 v-if="$hasPermissions('B_priceChangeRecord_export')"
                 class="button-warning"
                 @click="handleExport"
                 :loading="exportLoading"
                 id="productChangeRecordList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -69,19 +69,16 @@
           </a-row>
         </a-form>
       </div>
-      <!-- 总计 -->
-      <!-- <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-      </a-alert> -->
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+122.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 2340, y: tableHeight }"
+        :scroll="{ x: 1810, y: tableHeight }"
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
@@ -131,7 +128,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
@@ -150,68 +148,64 @@ export default {
       ], //  变更时间
       exportLoading: false, // 导出loading
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '变更时间', dataIndex: 'updateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
+        { title: '变更时间', dataIndex: 'updateDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         {
           title: '省级价',
           dataIndex: 'sdtermindfaldsdPrice',
-          width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeProvincePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterProvincePrice' }, width: 100, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeProvincePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterProvincePrice' }, width: 80, align: 'center' }
           ]
         },
         {
           title: '市级价',
           dataIndex: 'sdterminaldsdPrice',
-          width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeCityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterCityPrice' }, width: 100, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeCityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterCityPrice' }, width: 80, align: 'center' }
           ]
         },
         {
           title: '特约价',
           dataIndex: 'gterminaldsdPrice',
-          width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeSpecialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterSpecialPrice' }, width: 100, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeSpecialPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterSpecialPrice' }, width: 80, align: 'center' }
           ]
         },
         {
           title: '终端价',
           dataIndex: 'hterminaldsdPrice',
-          width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeTerminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterTerminalPrice' }, width: 100, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeTerminalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterTerminalPrice' }, width: 80, align: 'center' }
           ]
         },
         {
           title: '车主价',
           dataIndex: 'sterminaldsdPrice',
-          width: 200,
           align: 'center',
           children: [
-            { title: '变更前', dataIndex: 'beforeCarOwnersPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-            { title: '变更后', scopedSlots: { customRender: 'afterCarOwnersPrice' }, width: 100, align: 'center' }
+            { title: '变更前', dataIndex: 'beforeCarOwnersPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+            { title: '变更后', scopedSlots: { customRender: 'afterCarOwnersPrice' }, width: 80, align: 'center' }
           ]
         },
-        { title: '变更原因', dataIndex: 'changeReason', width: 160, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '变更原因', dataIndex: 'changeReason', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return productPriceChangeList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -220,6 +214,7 @@ export default {
           }
           this.total = data.count || 0
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -228,11 +223,6 @@ export default {
       productTypeList: [] //  分类下拉数据
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
-    }
-  },
   methods: {
     //  创建时间  change
     dateChange (date) {
@@ -339,6 +329,24 @@ export default {
           this.productTypeList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 233
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 19 - 9
src/views/productManagement/productBrand/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productBrandList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -24,7 +24,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productBrandList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="productBrandList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productBrandList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -35,8 +35,9 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -45,7 +46,7 @@
         bordered>
         <!-- 产品图片 -->
         <template slot="imageUrl" slot-scope="text, record">
-          <img :src="record.imageUrl" width="30" height="30" class="imageUrl" @click="lookPic(record.imageUrl)" />
+          <img :src="record.imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''" width="30" height="30" class="imageUrl" @click="lookPic(record.imageUrl)" />
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -112,8 +113,8 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌图片', scopedSlots: { customRender: 'imageUrl' }, width: 140, align: 'center' },
         { title: '品牌名称', dataIndex: 'brandName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '品牌分类', dataIndex: 'brandTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
@@ -123,9 +124,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
+        this.spinning = true
         return productBrandList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -133,6 +132,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -199,7 +199,17 @@ export default {
           })
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 2 - 1
src/views/productManagement/productCategory/list.vue

@@ -75,7 +75,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 250
+          this.tableHeight = window.innerHeight - 200
         }
         return productTypeQuery({}).then(res => {
           //  递归去除空children
@@ -163,6 +163,7 @@ export default {
 
 <style lang="less">
   .productCategoryList-wrap{
+    height: 100%;
     // 表格
     .s-table{
       .btn-edit-s{

+ 18 - 11
src/views/productManagement/productInfo/edit.vue

@@ -196,18 +196,17 @@
           </a-row>
         </a-card>
       </a-form-model>
-      <a-affix :offset-bottom="0" class="affix">
-        <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-          <a-button
-            type="primary"
-            class="button-primary"
-            id="productInfoEdit-submit-btn"
-            size="large"
-            @click="handleSubmit"
-            style="padding: 0 60px;">提交</a-button>
-        </div>
-      </a-affix>
     </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        class="button-primary"
+        :disabled="spinning"
+        id="productInfoEdit-submit-btn"
+        size="large"
+        @click="handleSubmit"
+        style="padding: 0 60px;">提交</a-button>
+    </div>
   </div>
 </template>
 
@@ -432,6 +431,14 @@ export default {
 
 <style lang="less">
   .productInfoEdit-wrap{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
     .productInfoEdit-cont{
       margin-bottom: 10px;
     }

+ 49 - 31
src/views/productManagement/productInfo/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productInfoList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -15,7 +15,7 @@
                 <a-input id="productInfoList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="5" :sm="24">
               <a-form-item label="品牌">
                 <a-select
                   placeholder="请选择"
@@ -30,7 +30,7 @@
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="7" :sm="24">
                 <a-form-item label="产品分类">
                   <a-cascader
                     @change="changeProductType"
@@ -55,9 +55,9 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+            <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
               <a-button
                 v-if="$hasPermissions('B_productInfo_export')"
                 style="margin-left: 5px"
@@ -67,7 +67,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="productInfoList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -107,14 +107,15 @@
         </span>
       </div>
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :row-selection=" showSelect ?{ selectedRowKeys: selectedRowKeys, onChange: onChange, onSelect: onSelectChange, onSelectAll: onSelectAllChange }:null"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 2150, y: tableHeight }"
+        :scroll="{ x: 1650, y: tableHeight }"
         bordered>
         <!-- 自定义表头 -->
         <template slot="arrowFalgTitle">
@@ -202,7 +203,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
@@ -217,18 +219,18 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: 100, align: 'center' },
-        { title: '最近修改时间', dataIndex: 'updateDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: 80, align: 'center' },
+        { title: '最近修改时间', dataIndex: 'updateDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 180, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
       selectedRows: [],
@@ -238,6 +240,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -245,6 +248,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -257,9 +261,6 @@ export default {
     }
   },
   computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
-    },
     hasSelected () {
       return this.selectedRowKeys.length > 0
     },
@@ -273,15 +274,10 @@ export default {
       this.selectedRowKeys = selectedRowKeys
     },
     onSelectChange (record, selected, selectedRows, nativeEvent) {
-      const _this = this
       if (selected) { //  选择
         this.selectedRows.push(record)
       } else { //  取消
-        this.selectedRows.map((item, index) => {
-          if (item.id == record.id) {
-            _this.selectedRows.splice(index, 1)
-          }
-        })
+        this.selectedRows = selectedRows
       }
     },
     // 本页全选/取消全选
@@ -290,13 +286,17 @@ export default {
       if (selected) { //  选择
         this.selectedRows = [...this.selectedRows, ...changeRows]
       } else { //  取消
+        const arrId = []
         this.selectedRows.map((item, index) => {
           this.selectedRows.map((subItem, ind) => {
             if (item.id == subItem.id) {
-              _this.selectedRows.splice(index, 1)
+              arrId.push(index)
             }
           })
         })
+        arrId.map((item, index) => {
+          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        })
       }
     },
     // 审核
@@ -574,6 +574,24 @@ export default {
           this.productTypeList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 28 - 26
src/views/productManagement/productLaunchAudit/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productLaunchAuditList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -26,29 +26,30 @@
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productLaunchAuditList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productLaunchAuditList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productLaunchAuditList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
       <!-- 列表 -->
-      <div style="margin-bottom: 15px">
+      <div style="margin-bottom: 10px">
         <a-button type="primary" v-if="$hasPermissions('B_productLaunchAudit_batchAudit')" id="productLaunchAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
-        <span style="margin-left: 8px" v-if="$hasPermissions('B_productLaunchAudit_batchAudit')">
+        <span style="margin-left: 5px" v-if="$hasPermissions('B_productLaunchAudit_batchAudit')">
           <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
         </span>
       </div>
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :row-selection="rowSelection"
         :rowKey="(record) => record.productSn"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1510, y: tableHeight }"
+        :scroll="{ x: 1200, y: tableHeight }"
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
@@ -88,26 +89,25 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '提交时间', dataIndex: 'onlineSubmitTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '提交人', dataIndex: 'onlineSubmitPerson', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'onlineAuditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核人', dataIndex: 'onlineAuditPerson', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { title: '提交时间', dataIndex: 'onlineSubmitTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提交人', dataIndex: 'onlineSubmitPerson', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'onlineAuditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核人', dataIndex: 'onlineAuditPerson', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
       loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 370
-        }
+        this.spinning = true
         return productOnlineList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           this.disabled = false
+          this.spinning = false
           return data
         })
       }
@@ -196,15 +196,17 @@ export default {
     onSelectChange (selectedRowKeys) {
       console.log('selectedRowKeys changed: ', selectedRowKeys)
       this.selectedRowKeys = selectedRowKeys
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>
-
-<style lang="less">
-  .productLaunchAuditList-wrap{
-    .sTable{
-      margin-top: 20px;
-    }
-  }
-</style>

+ 42 - 25
src/views/productManagement/productLevel/list.vue

@@ -1,7 +1,7 @@
 <template>
   <a-card size="small" :bordered="false" class="productLevelList-wrap">
     <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
+    <div ref="tableSearch" class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
@@ -49,10 +49,10 @@
               </a-form-item>
             </a-col>
           </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productLevelList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productLevelList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productLevelList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productLevelList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -61,19 +61,20 @@
       </a-form>
     </div>
     <!-- 操作按钮 -->
-    <!-- <div class="table-operator">
-      <a-button style="margin: 0 0 18px 0" id="productLevelList-import" type="primary" @click="handleImport">导入</a-button>
-      <a-button style="margin: 0 0 18px 8px" id="productLevelList-export" type="danger" @click="handleExport" :loading="exportLoading">导出</a-button>
+    <!-- <div class="table-operator" style="margin-bottom: 10px;">
+      <a-button id="productLevelList-import" type="primary" @click="handleImport">导入</a-button>
+      <a-button style="margin-left: 5px" id="productLevelList-export" type="danger" @click="handleExport" :loading="exportLoading">导出</a-button>
     </div> -->
     <!-- 列表 -->
     <s-table
-      class="sTable"
+      class="sTable fixPagination"
       ref="table"
+      :style="{ height: tableHeight+84.5+'px' }"
       size="small"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1590, y: tableHeight }"
+      :scroll="{ x: 1210, y: tableHeight }"
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
@@ -108,7 +109,8 @@ export default {
   components: { STable, VSelect, productLevelEditModal },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
@@ -122,20 +124,21 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
         { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '包装数', dataIndex: 'packQtyV', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品级别', dataIndex: 'level', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { title: '包装数', dataIndex: 'packQtyV', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品级别', dataIndex: 'level', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return productLevelList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -147,6 +150,7 @@ export default {
             data.list[i].packQtyV = packQty + unit + '/' + packQtyUnit
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -157,11 +161,6 @@ export default {
       nowData: null
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 380 : 320)
-    }
-  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -240,6 +239,24 @@ export default {
           this.productTypeList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 42 - 27
src/views/productManagement/productOfflineAudit/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productOfflineAuditList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -67,10 +67,10 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productOfflineAuditList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productOfflineAuditList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productOfflineAuditList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -79,21 +79,22 @@
         </a-form>
       </div>
       <!-- 列表 -->
-      <div style="margin-bottom: 15px">
+      <div style="margin-bottom: 10px">
         <a-button type="primary" v-if="$hasPermissions('B_productOfflineAudit_batchAudit')" id="productOfflineAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
-        <span style="margin-left: 8px" v-if="$hasPermissions('B_productOfflineAudit_batchAudit')">
+        <span style="margin-left: 5px" v-if="$hasPermissions('B_productOfflineAudit_batchAudit')">
           <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
         </span>
       </div>
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :row-selection="rowSelection"
         :rowKey="(record) => record.productSn"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 2070, y: tableHeight }"
+        :scroll="{ x: 1600, y: tableHeight }"
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
@@ -126,7 +127,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         name: '', //  产品名称
         code: '', // 产品编码
@@ -141,26 +143,28 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '提交时间', dataIndex: 'offlineSubmitTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '提交人', dataIndex: 'offlineSubmitPerson', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '下线选项', dataIndex: 'offlineReasonType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用编码', dataIndex: 'commonCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下线原因', dataIndex: 'offlineRemark', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'offlineAuditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核人', dataIndex: 'offlineAuditPerson', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { title: '提交时间', dataIndex: 'offlineSubmitTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提交人', dataIndex: 'offlineSubmitPerson', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '下线选项', dataIndex: 'offlineReasonType', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用编码', dataIndex: 'commonCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下线原因', dataIndex: 'offlineRemark', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'offlineAuditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核人', dataIndex: 'offlineAuditPerson', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
       loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return productOfflineList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -169,9 +173,6 @@ export default {
     }
   },
   computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
-    },
     hasSelected () {
       return this.selectedRowKeys.length > 0
     },
@@ -248,7 +249,6 @@ export default {
             _this.loading = false
             if (res.status == 200) {
               _this.selectedRowKeys = []
-              _this.selectedRows = []
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
               _this.spinning = false
@@ -288,6 +288,24 @@ export default {
           this.productTypeList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -301,9 +319,6 @@ export default {
 
 <style lang="less">
   .productOfflineAuditList-wrap{
-    .sTable{
-      margin-top: 20px;
-    }
     .red{
       color: #ed1c24;
     }

+ 139 - 123
src/views/productManagement/productPricing/list.vue

@@ -1,113 +1,112 @@
 <template>
   <a-card size="small" :bordered="false" class="productPricingList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码/原厂编码">
-              <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="品牌">
-              <a-select
-                placeholder="请选择"
-                id="productPricingList-productBrandSn"
-                allowClear
-                v-model="queryParam.productBrandSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productPricingList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+              <a-form-item label="产品名称">
+                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="定价状态">
-                <v-select code="PRICING_STATUS" id="productPricingList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+              <a-form-item label="产品编码/原厂编码">
+                <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 总计 -->
-    <!-- <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
-    </a-alert> -->
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 2430, y: tableHeight }"
-      bordered>
-      <!-- 产品分类 -->
-      <template slot="productType" slot-scope="text, record">
-        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-        <span v-else>--</span>
-      </template>
-      <!-- 成本价 -->
-      <template slot="sterminaldsdPrice" slot-scope="text, record">
-        <div v-if="record.supplierProductList">
-          <p v-for="(item, index) in record.supplierProductList" :key="index" style="margin: 0;">
-            <span>{{ (item.cost || item.cost==0) ? item.cost.toFixed(2):'--' }}</span>元 -
-            <span>{{ (item.supplierName||'') }}</span>;
-          </p>
-        </div>
-        <span v-else>--</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.pricingState=='WAIT_PRICING_AUDIT' && $hasPermissions('B_productPricing_audit')"
-          class="button-warning"
-          @click="handleAudit(record)"
-          id="productPricingList-audit-btn">审核</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="$hasPermissions('B_productPricing_edit')"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="productPricingList-edit-btn">编辑</a-button>
-        <span v-if="!(record.pricingState=='WAIT_PRICING_AUDIT' && $hasPermissions('B_productPricing_audit')) && !$hasPermissions('B_productPricing_edit')">--</span>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌">
+                <a-select
+                  placeholder="请选择"
+                  id="productPricingList-productBrandSn"
+                  allowClear
+                  v-model="queryParam.productBrandSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="productPricingList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="定价状态">
+                  <v-select code="PRICING_STATUS" id="productPricingList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1870, y: tableHeight }"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 成本价 -->
+        <template slot="sterminaldsdPrice" slot-scope="text, record">
+          <div v-if="record.supplierProductList">
+            <p v-for="(item, index) in record.supplierProductList" :key="index" style="margin: 0;">
+              <span>{{ (item.cost || item.cost==0) ? item.cost.toFixed(2):'--' }}</span>元 -
+              <span>{{ (item.supplierName||'') }}</span>;
+            </p>
+          </div>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.pricingState=='WAIT_PRICING_AUDIT' && $hasPermissions('B_productPricing_audit')"
+            class="button-warning"
+            @click="handleAudit(record)"
+            id="productPricingList-audit-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productPricing_edit')"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="productPricingList-edit-btn">编辑</a-button>
+          <span v-if="!(record.pricingState=='WAIT_PRICING_AUDIT' && $hasPermissions('B_productPricing_audit')) && !$hasPermissions('B_productPricing_edit')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 编辑价格 -->
     <product-pricing-edit-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" @ok="$refs.table.refresh()" />
     <!-- 审核价格 -->
@@ -126,7 +125,9 @@ export default {
   components: { STable, VSelect, productPricingEditModal, productPricingAuditModal },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
@@ -139,26 +140,27 @@ export default {
       productType: [],
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: 200, align: 'center' },
-        { title: '省级价', dataIndex: 'provincePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { title: '产品状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', scopedSlots: { customRender: 'sterminaldsdPrice' }, width: 180, align: 'center' },
+        { title: '省级价', dataIndex: 'provincePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '市级价', dataIndex: 'cityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '特约价', dataIndex: 'specialPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return productPricingList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -167,6 +169,7 @@ export default {
           }
           this.total = data.count || 0
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -178,11 +181,6 @@ export default {
       productTypeList: [] //  分类下拉数据
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 375 : 320)
-    }
-  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -246,6 +244,24 @@ export default {
           this.productTypeList = []
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 38 - 21
src/views/productManagement/productUniversal/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="productUniversalList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -32,10 +32,10 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productUniversalList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productUniversalList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productUniversalList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productUniversalList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -49,13 +49,14 @@
       </div>
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1580, y: tableHeight }"
+        :scroll="{ x: 1230, y: tableHeight }"
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
@@ -97,7 +98,8 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         productCode: '',
         productName: '',
@@ -109,19 +111,20 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品状态', dataIndex: 'product.stateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用产品编码', dataIndex: 'productCommonCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用产品名称', dataIndex: 'productCommont.name', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
-        { title: '通用产品状态', dataIndex: 'productCommont.stateDictValue', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+        { title: '产品状态', dataIndex: 'product.stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用产品编码', dataIndex: 'productCommonCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用产品名称', dataIndex: 'productCommont.name', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '通用产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
+        { title: '通用产品状态', dataIndex: 'productCommont.stateDictValue', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return productUniversalCodeList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -129,6 +132,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -136,11 +140,6 @@ export default {
       itemId: '' //  当前id
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 425 : 370)
-    }
-  },
   methods: {
     //  重置
     resetSearchForm () {
@@ -206,6 +205,24 @@ export default {
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 5 - 5
src/views/productManagement/purchaseBaseLimit/list.vue

@@ -47,10 +47,10 @@
               </a-form-item>
             </a-col>
           </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseBaseLimitList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseBaseLimitList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseBaseLimitList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseBaseLimitList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -108,7 +108,7 @@ export default {
   components: { STable, VSelect, purchaseBaseLimitEditModal },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
+      advanced: true, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
         productName: '', //  产品名称
         productCode: '', //  产品编码/原厂编码

+ 114 - 104
src/views/promotionRulesManagement/orderStatistics/list.vue

@@ -1,96 +1,98 @@
 <template>
   <a-card size="small" :bordered="false" class="orderStatisticsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <custList ref="custList" id="orderStatisticsList-buyerSn" @change="custChange"></custList>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="销售单号">
-              <a-input id="orderStatisticsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="促销名称">
-                <promoList ref="promoList" id="orderStatisticsList-promoActiveSn" @change="promoChange"></promoList>
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  id="orderStatisticsList-billStatus"
-                  code="SALES_BILL_STATUS"
-                  placeholder="请选择业务状态"
-                  allowClear
-                ></v-select>
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <custList ref="custList" id="orderStatisticsList-buyerSn" @change="custChange"></custList>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons" style="margin-top: 3px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="orderStatisticsList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="orderStatisticsList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
-                {{ advanced ? '收起' : '展开' }}
-                <a-icon :type="advanced ? 'up' : 'down'"/>
-              </a>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">
-        促销品原价总额:<strong>{{ productTotal && (productTotal.totalOrigAmount || productTotal.totalOrigAmount==0) ? productTotal.totalOrigAmount : '--' }}</strong>,
-        促销品促销价总额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--' }}</strong>,
-        节省总额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,
-        总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
-        总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
-        总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销售单号">
+                <a-input id="orderStatisticsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="促销名称">
+                  <promoList ref="promoList" id="orderStatisticsList-promoActiveSn" @change="promoChange"></promoList>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="orderStatisticsList-billStatus"
+                    code="SALES_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="orderStatisticsList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="orderStatisticsList-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 5px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1690, y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="$hasPermissions('B_orderStatistics_detail')"
-          @click="handleDetail(record)"
-          class="button-success"
-          id="orderStatisticsList-edit-btn">详情</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+      <!-- alert -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div slot="message">
+          促销品原价总额:<strong>{{ productTotal && (productTotal.totalOrigAmount || productTotal.totalOrigAmount==0) ? productTotal.totalOrigAmount : '--' }}</strong>,
+          促销品促销价总额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--' }}</strong>,
+          节省总额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,
+          总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
+          总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
+          总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1510, y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_orderStatistics_detail')"
+            @click="handleDetail(record)"
+            class="button-success"
+            id="orderStatisticsList-edit-btn">详情</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
     <orderStatisticsDetailModal :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -102,7 +104,9 @@ export default {
   components: { STable, VSelect, orderStatisticsDetailModal, custList, promoList, rangeDate },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
+      spinning: false,
+      tableHeight: 0,
+      advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
       queryParam: {
@@ -119,23 +123,24 @@ export default {
       ],
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销名称', dataIndex: 'promoName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'buyerName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '促销品款数', dataIndex: 'totalPromoCategory', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销品数量', dataIndex: 'totalPromoQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'buyerName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销品款数', dataIndex: 'totalPromoCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销品数量', dataIndex: 'totalPromoQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '原价总额', dataIndex: 'promoTotal', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '促销品总额', dataIndex: 'totalPromoAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '促销品总额', dataIndex: 'totalPromoAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return salesPromoList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -148,6 +153,7 @@ export default {
             data.list[i].promoTotal = Number(totalPromoAmount) + Number(totalEconomizeAmount)
           }
           this.disabled = false
+          this.spinning = false
           this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
@@ -158,11 +164,6 @@ export default {
       productTotal: null
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 430 : 375)
-    }
-  },
   methods: {
     //  创建时间  change
     dateChange (date) {
@@ -211,19 +212,28 @@ export default {
       this.openModal = false
       this.itemSn = ''
       this.nowData = null
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230
     }
   },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
     })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
   }
 }
 </script>
-<style lang="less">
-  .orderStatisticsList-wrap{
-    .sTable{
-      margin-top: 15px;
-    }
-  }
-</style>

+ 115 - 96
src/views/promotionRulesManagement/productStatistics/list.vue

@@ -1,101 +1,103 @@
 <template>
   <a-card size="small" :bordered="false" class="productStatisticsList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="统计时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="productStatisticsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productStatisticsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  expand-trigger="hover"
-                  change-on-select
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productStatisticsList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear
-                  v-model="productType" />
+              <a-form-item label="统计时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <a-select
-                  placeholder="请选择产品品牌"
-                  id="productStatisticsList-productBrandSn"
-                  allowClear
-                  v-model="queryParam.productBrandSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                </a-select>
+              <a-form-item label="产品名称">
+                <a-input id="productStatisticsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24">
-            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productStatisticsList-refresh">查询</a-button>
-            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productStatisticsList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">
-        节省总金额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,
-        总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="productStatisticsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="productStatisticsList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="productStatisticsList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productStatisticsList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productStatisticsList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record, index) => index"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1140, y: tableHeight }"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          v-if="$hasPermissions('B_productStatistics_detail')"
-          class="button-success"
-          @click="handleDetail(record)"
-          id="productStatisticsList-detail-btn">详情</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+      <!-- alert -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div slot="message">
+          节省总金额:<strong>{{ productTotal && (productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--' }}</strong>,
+          总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record, index) => index"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="$hasPermissions('B_productStatistics_detail')"
+            class="button-success"
+            @click="handleDetail(record)"
+            id="productStatisticsList-detail-btn">详情</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
     <!-- 详情 -->
     <productStatisticsDetailModal :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -107,7 +109,9 @@ export default {
   components: { STable, VSelect, productStatisticsDetailModal, rangeDate },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
       productType: [],
       queryParam: { //  查询条件
         beginDate: getDate.getCurrMonthDays().starttime,
@@ -125,18 +129,19 @@ export default {
       ],
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '节省金额', dataIndex: 'totalEconomizeAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? '¥' + text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '节省金额', dataIndex: 'totalEconomizeAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? '¥' + text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return salesDetailPromoList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -144,6 +149,7 @@ export default {
             data.list[i].no = no + i + 1
           }
           this.disabled = false
+          this.spinning = false
           this.getTotal(Object.assign(parameter, this.queryParam))
           return data
         })
@@ -156,11 +162,6 @@ export default {
       productTotal: null
     }
   },
-  computed: {
-    tableHeight () {
-      return window.innerHeight - (this.advanced ? 430 : 375)
-    }
-  },
   methods: {
     //  时间  change
     dateChange (date) {
@@ -233,6 +234,24 @@ export default {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230
+    }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
     }
   },
   beforeRouteEnter (to, from, next) {

+ 0 - 0
src/views/common/chooseImportModal.vue → src/views/promotionRulesManagement/promotionRules/chooseImportModal.vue


+ 21 - 19
src/views/promotionRulesManagement/promotionRules/choosePriceProductsModal.vue

@@ -57,7 +57,7 @@
         :rowKey="(record, index) => index"
         :columns="nowColumns"
         :dataSource="loadData"
-        :scroll="{ x: goodsType == 'normal' ? 1380 : null, y: 500 }"
+        :scroll="{ x: goodsType == 'normal' ? 1090 : null, y: 500 }"
         :pagination="false"
         bordered>
         <!-- 序号 -->
@@ -66,10 +66,11 @@
         </template>
         <!-- 起订量限制 -->
         <template slot="orderGoodsUnit" slot-scope="text, record">
-          <a-select id="choosePosPriceProducts-orderGoodsUnit" v-model="record.orderGoodsUnit" placeholder="请选择" allowClear style="width: 40%;" >
+          <a-select id="choosePosPriceProducts-orderGoodsUnit" size="small" v-model="record.orderGoodsUnit" placeholder="请选择" allowClear style="width: 40%;" >
             <a-select-option v-for="item in orderGoodsUnitData" :key="item.code" :value="item.code">{{ item.dispName }}</a-select-option>
           </a-select>
           <a-input-number
+            size="small"
             v-if="record.orderGoodsUnit=='PROD_UNIT'"
             id="choosePosPriceProducts-orderGoodsQty"
             v-model="record.orderGoodsQty"
@@ -82,6 +83,7 @@
         <!-- 特惠单价 / 换购单价 -->
         <template slot="goodsPrice" slot-scope="text, record">
           <a-input-number
+            size="small"
             id="choosePosPriceProducts-goodsPrice"
             v-model="record.goodsPrice"
             :precision="2"
@@ -115,7 +117,7 @@
     <!-- 选择产品品牌 -->
     <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
     <!-- 选择产品分类 -->
-    <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
+    <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" type="promo" @close="openTypeModal=false" @ok="handleTypeOk" />
     <!-- 选择产品 -->
     <chooseProductsModal :openModal="openProductsModal" :chooseData="chooseProducts" @close="openProductsModal=false" @ok="handleProductsOk" />
     <!-- 导入产品 -->
@@ -127,7 +129,7 @@
 import ChooseProductsModal from '@/views/common/chooseProductsModal.vue'
 import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
-import ImportGuideModal from '@/views/common/importGuideModal.vue'
+import ImportGuideModal from './importGuideModal.vue'
 import { VSelect } from '@/components'
 import { getLookUpData } from '@/api/data'
 export default {
@@ -160,28 +162,28 @@ export default {
       orderGoodsQty: '', //  限制数量
       // 表头
       columns: [ //  正品
-        { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center' },
-        { title: '类型', dataIndex: 'goodsTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类型名称', dataIndex: 'goodsName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '序号', scopedSlots: { customRender: 'no' }, width: 70, align: 'center' },
+        { title: '类型', dataIndex: 'goodsTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类型名称', dataIndex: 'goodsName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'goodsCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '起订量限制', scopedSlots: { customRender: 'orderGoodsUnit' }, width: 400, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'goodsCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '起订量限制', scopedSlots: { customRender: 'orderGoodsUnit' }, width: 300, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       promoColumns: [ //  促销品
-        { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center' },
-        { title: '类型', dataIndex: 'goodsTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类型名称', dataIndex: 'goodsName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '序号', scopedSlots: { customRender: 'no' }, width: 70, align: 'center' },
+        { title: '类型', dataIndex: 'goodsTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类型名称', dataIndex: 'goodsName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'goodsCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'goodsCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       promoSpecialColumns: [ //  特价产品/加价促销品
-        { title: '序号', scopedSlots: { customRender: 'no' }, width: 80, align: 'center' },
+        { title: '序号', scopedSlots: { customRender: 'no' }, width: 70, align: 'center' },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'goodsCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: this.ruleType == 'PROMO_PROD' ? '特惠单价(¥)' : '换购单价(¥)', scopedSlots: { customRender: 'goodsPrice' }, width: 200, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+        { title: '产品编码', dataIndex: 'goodsCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: this.ruleType == 'PROMO_PROD' ? '特惠单价(¥)' : '换购单价(¥)', scopedSlots: { customRender: 'goodsPrice' }, width: 180, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       loadData: [],
       openBrandModal: false, //  选择产品品牌

+ 85 - 58
src/views/promotionRulesManagement/promotionRules/detail.vue

@@ -1,63 +1,66 @@
 <template>
   <div class="promotionRulesDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="promotionRulesDetail-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="promotionRulesDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="promotionRulesDetail-cont">
-      <a-descriptions bordered :column="2" v-if="detailsData">
-        <a-descriptions-item label="活动名称:">{{ detailsData.name || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="活动时间:">
-          <span v-if="detailsData.activeDateEnable=='0'">不限</span>
-          <span v-else>{{ detailsData.activeDateStart }} ~ {{ detailsData.activeDateEnd }}</span>
-        </a-descriptions-item>
-        <a-descriptions-item label="参与客户:">
-          <span v-if="detailsData.buyerLimitEnable=='0'">全部客户</span>
-          <p v-else style="margin: 0;">部分客户,共{{ detailsData.promoBuyerList.length }}个  <a-button id="promotionRules-rule-normalGoodsList" type="primary" size="small" class="button-success" @click="handleLook(detailsData.promoBuyerList)">查看</a-button></p>
-        </a-descriptions-item>
-        <a-descriptions-item label="活动经费上限:">
-          <span v-if="detailsData.activeAmountEnable=='0'">不限</span>
-          <span v-else>{{ detailsData.activeAmount }} 万元</span>
-        </a-descriptions-item>
-        <a-descriptions-item label="订单起订金额:">
-          <span v-if="detailsData.orderAmountEnable=='0'">不限</span>
-          <span v-else>{{ detailsData.orderAmount }} 万元</span>
-        </a-descriptions-item>
-        <a-descriptions-item label="备注:">{{ detailsData.remark || '--' }}</a-descriptions-item>
-      </a-descriptions>
-      <a-divider />
-      <!-- 列表 -->
-      <p style="font-weight: bold;">促销规则:</p>
-      <a-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data-source="promoRuleList"
-        :loading="loading"
-        :pagination="false"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            v-if="record.promoRuleType!='PROMO_PROD'"
-            size="small"
-            type="link"
-            class="button-info"
-            @click="handleLookP(record.normalGoodsList, record.promoRuleType, 'normal')"
-            id="promotionRulesDetail-edit-btn">查看正价品</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-warning"
-            @click="handleLookP(record.promoGoodsList, record.promoRuleType, 'promo')"
-            id="promotionRulesDetail-del-btn">查看{{ record.promoRuleType=='PROMO_PROD' ? '特价品' : record.promoRuleType=='ADD_PRICE_PURCH' ? '换购品' : '促销品' }}</a-button>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="promotionRulesDetail-back" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="promotionRulesDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
-      </a-table>
-    </a-card>
+      </a-page-header>
+      <a-card size="small" :bordered="false" class="promotionRulesDetail-cont">
+        <a-descriptions bordered :column="2" size="small" v-if="detailsData">
+          <a-descriptions-item label="活动名称:">{{ detailsData.name || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="活动时间:">
+            <span v-if="detailsData.activeDateEnable=='0'">不限</span>
+            <span v-else>{{ detailsData.activeDateStart }} ~ {{ detailsData.activeDateEnd }}</span>
+          </a-descriptions-item>
+          <a-descriptions-item label="参与客户:">
+            <span v-if="detailsData.buyerLimitEnable=='0'">全部客户</span>
+            <p v-else style="margin: 0;">部分客户,共{{ detailsData.promoBuyerList.length }}个  <a-button id="promotionRules-rule-normalGoodsList" type="primary" size="small" class="button-success" @click="handleLook(detailsData.promoBuyerList)">查看</a-button></p>
+          </a-descriptions-item>
+          <a-descriptions-item label="活动经费上限:">
+            <span v-if="detailsData.activeAmountEnable=='0'">不限</span>
+            <span v-else>{{ detailsData.activeAmount }} 万元</span>
+          </a-descriptions-item>
+          <a-descriptions-item label="订单起订金额:">
+            <span v-if="detailsData.orderAmountEnable=='0'">不限</span>
+            <span v-else>{{ detailsData.orderAmount }} 万元</span>
+          </a-descriptions-item>
+          <a-descriptions-item label="备注:">{{ detailsData.remark || '--' }}</a-descriptions-item>
+        </a-descriptions>
+        <a-divider />
+        <!-- 列表 -->
+        <p style="font-weight: bold;">促销规则:</p>
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data-source="promoRuleList"
+          :scroll="{ y: tableHeight }"
+          :loading="loading"
+          :pagination="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              v-if="record.promoRuleType!='PROMO_PROD'"
+              size="small"
+              type="link"
+              class="button-info"
+              @click="handleLookP(record.normalGoodsList, record.promoRuleType, 'normal')"
+              id="promotionRulesDetail-edit-btn">查看正价品</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleLookP(record.promoGoodsList, record.promoRuleType, 'promo')"
+              id="promotionRulesDetail-del-btn">查看{{ record.promoRuleType=='PROMO_PROD' ? '特价品' : record.promoRuleType=='ADD_PRICE_PURCH' ? '换购品' : '促销品' }}</a-button>
+          </template>
+        </a-table>
+      </a-card>
+    </a-spin>
     <!-- 查看客户/正价品/促销品 -->
     <a-modal
       centered
@@ -97,13 +100,15 @@ import { promoActiveDetailD } from '@/api/promoActive'
 export default {
   data () {
     return {
+      spinning: false,
+      tableHeight: 0,
       detailsData: null,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promoRuleTypeDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销规则', dataIndex: 'promoRule', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center' }
       ],
       loadData: [],
       openModal: false,
@@ -143,9 +148,11 @@ export default {
     //  详情
     getDetail () {
       const _this = this
+      this.spinning = true
       this.loading = true
       promoActiveDetailD({ sn: this.$route.params.sn }).then(res => {
         this.loading = false
+        this.spinning = false
         if (res.status == 200) {
           _this.detailsData = res.data
           if (_this.detailsData.promoRuleList) {
@@ -214,8 +221,17 @@ export default {
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/promotionRulesManagement/promotionRules/list', query: { closeLastOldTab: true } })
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - 400
     }
   },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
+  },
   watch: {
     detailsData: {
       handler (newValue, oldValue) {
@@ -236,6 +252,17 @@ export default {
 
 <style lang="less">
   .promotionRulesDetail-wrap{
+    position: relative;
+    height: 100%;
+    >.ant-spin-nested-loading{
+      height: 100%;
+      .ant-spin-container{
+        height: 100%;
+        .promotionRulesDetail-cont{
+          min-height: 90%;
+        }
+      }
+    }
     .promotionRulesDetail-back{
       margin-bottom: 10px;
     }

+ 1 - 1
src/views/common/importGuideModal.vue → src/views/promotionRulesManagement/promotionRules/importGuideModal.vue

@@ -65,7 +65,7 @@
 </template>
 
 <script>
-import ChooseImportModal from '@/views/common/chooseImportModal.vue'
+import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
 export default {
   name: 'ImportGuideModal',

+ 26 - 21
src/views/promotionRulesManagement/promotionRules/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="promotionRulesList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper">
+      <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
@@ -20,9 +20,9 @@
                 <v-select code="ENABLE_FLAG" id="promotionRulesList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
-              <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -31,19 +31,16 @@
       <div class="table-operator">
         <a-button id="promotionRulesList-add" type="primary" v-if="$hasPermissions('B_promotionRules_add')" class="button-error" @click="openModal=true">新增</a-button>
       </div>
-      <!-- 总计 -->
-      <!-- <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">合计: <strong>{{ total }}</strong>条</div>
-      </a-alert> -->
       <!-- 列表 -->
       <s-table
-        class="sTable"
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1440, y: tableHeight }"
+        :scroll="{ x: 1210, y: tableHeight }"
         bordered>
         <!-- 促销时间 -->
         <template slot="activeDate" slot-scope="text, record">
@@ -97,7 +94,6 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
@@ -116,21 +112,19 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '促销时间', scopedSlots: { customRender: 'activeDate' }, width: 200, align: 'center' },
-        { title: '参与客户', dataIndex: 'promoBuyerName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '备注', dataIndex: 'remark', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 140, align: 'center', fixed: 'right' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '促销时间', scopedSlots: { customRender: 'activeDate' }, width: 170, align: 'center' },
+        { title: '参与客户', dataIndex: 'promoBuyerName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '备注', dataIndex: 'remark', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 100, align: 'center', fixed: 'right' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
+        this.spinning = true
         return promoActiveList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -146,6 +140,7 @@ export default {
           }
           this.total = data.count || 0
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -208,7 +203,17 @@ export default {
           this.spinning = false
         }
       })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 17 - 4
src/views/promotionRulesManagement/promotionRules/rule.vue

@@ -7,7 +7,7 @@
           <a id="promotionRulesList-rule-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
       </a-page-header>
-      <a-card size="small" :bordered="false" class="promotionRulesList-rule-wrap">
+      <a-card size="small" :bordered="false" class="promotionRulesList-rule-cont">
         <!-- 操作按钮 -->
         <div class="table-operator">
           <a-button id="promotionRulesList-rule-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
@@ -20,6 +20,7 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
+          :scroll="{ y: tableHeight }"
           :showPagination="false"
           bordered>
           <!-- 操作 -->
@@ -55,16 +56,18 @@ export default {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promoRuleTypeDictValue', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销规则', dataIndex: 'promoRule', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.spinning = true
         return promoRuleQueryList({ promoActiveSn: this.$route.params.sn }).then(res => {
           const data = res.data
           for (var i = 0; i < data.length; i++) {
@@ -82,6 +85,7 @@ export default {
             }
           }
           this.disabled = false
+          this.spinning = false
           return data
         })
       },
@@ -132,7 +136,16 @@ export default {
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/promotionRulesManagement/promotionRules/list', query: { closeLastOldTab: true } })
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - 250
     }
+  },
+  mounted () {
+    const _this = this
+    this.$nextTick(() => { // 页面渲染完成后的回调
+      _this.setTableH()
+    })
   }
 }
 </script>

+ 1 - 1
src/views/purchasingManagement/bulkWarehousingOrder/detailModal.vue

@@ -29,7 +29,7 @@
     </a-card>
     <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
       <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
+      <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
           入库数量 <strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
           入库金额 <strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.