lilei 6 ヶ月 前
コミット
1397773ee6
1 ファイル変更28 行追加45 行削除
  1. 28 45
      src/views/salesManagement/stockPrint/list.vue

+ 28 - 45
src/views/salesManagement/stockPrint/list.vue

@@ -112,17 +112,7 @@
             </a-tabs>
           </div>
           <div>
-            <span>显示:</span>
-            <a-tree-select
-              size="small"
-              v-model="showCols"
-              style="min-width: 200px"
-              dropdownMatchSelectWidth
-              :maxTagCount="3"
-              :tree-data="colsArr"
-              tree-checkable
-              placeholder="请选择要显示的列"
-            />
+            <hideCellMenus :defHiddenKes="colsArr" v-model="showCols"></hideCellMenus>
           </div>
         </div>
         <!-- 列表 -->
@@ -231,12 +221,13 @@ import customerService from '@/views/common/customerService'
 import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import explainInfoModal from '@/views/salesManagement/pushOrderManagement/explainInfoModal.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 import { dispatchlList, dispatchDetailPrint, dispatchPrintStatus } from '@/api/dispatch'
 import { printBase64Fun } from '@/libs/JGPrint.js'
 export default {
   name: 'StockPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area, commonModal, salesDetail, dispatchDetail, explainInfoModal, chooseWarehouse, customerService },
+  components: { STable, VSelect, hideCellMenus, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area, commonModal, salesDetail, dispatchDetail, explainInfoModal, chooseWarehouse, customerService },
   data () {
     return {
       spinning: false,
@@ -294,33 +285,39 @@ export default {
       colsArr: [
         {
           title: '销售单号',
-          value: 'salesBillNo',
-          key: 'salesBillNo'
+          key: 'salesBillNo',
+          disabled: false,
+          checked: false
         },
         {
           title: '仓库',
-          value: 'warehouseName',
-          key: 'warehouseName'
+          key: 'warehouseName',
+          disabled: false,
+          checked: false
         },
         {
           title: '业务状态',
-          value: 'billStatusDictValue',
-          key: 'billStatusDictValue'
+          key: 'billStatusDictValue',
+          disabled: false,
+          checked: false
         },
         {
           title: '单据状态',
-          value: 'voidFlagDictValue',
-          key: 'voidFlagDictValue'
+          key: 'voidFlagDictValue',
+          disabled: false,
+          checked: false
         },
         {
           title: '允许打印时间',
-          value: 'allowPrintTime',
-          key: 'allowPrintTime'
+          key: 'allowPrintTime',
+          disabled: false,
+          checked: false
         },
         {
           title: '打印次数',
-          value: 'stockUpPrintTimes',
-          key: 'stockUpPrintTimes'
+          key: 'stockUpPrintTimes',
+          disabled: false,
+          checked: false
         }
       ]
     }
@@ -338,9 +335,7 @@ export default {
         { title: '产品款数', dataIndex: 'totalCategory', width: '30px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品数量', dataIndex: 'totalQty', width: '30px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.showCols.includes('salesBillNo')) {
-        arr.splice(2, 0, { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '80px', align: 'center' })
-      }
+      arr.splice(2, 0, { title: '销售单号', dataIndex: 'salesBillNo', scopedSlots: { customRender: 'salesBillNo' }, width: '80px', align: 'center' })
 
       if (this.$hasPermissions('M_stockPrintList_salesPrice')) { //  售价权限
         const ind = this.isShowWarehouse ? 10 : 9
@@ -352,26 +347,14 @@ export default {
         arr.splice(ind + 5, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(ind + 6, 0, { title: '轮胎售价', dataIndex: 'receiveLtTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
-
-      if (this.showCols.includes('warehouseName')) {
-        arr.push({ title: '仓库', dataIndex: 'warehouseName', width: '50px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-      }
-      if (this.showCols.includes('billStatusDictValue')) {
-        arr.push({ title: '业务状态', dataIndex: 'billStatusDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
-      }
-      if (this.showCols.includes('voidFlagDictValue')) {
-        arr.push({ title: '单据状态', dataIndex: 'voidFlagDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
-      }
+      arr.push({ title: '仓库', dataIndex: 'warehouseName', width: '50px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+      arr.push({ title: '业务状态', dataIndex: 'billStatusDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '单据状态', dataIndex: 'voidFlagDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
       arr.push({ title: '备货打印状态', width: '40px', align: 'center', scopedSlots: { customRender: 'printStatus' } })
-      if (this.showCols.includes('allowPrintTime')) {
-        arr.push({ title: '允许打印时间', dataIndex: 'allowPrintTime', width: '50px', align: 'center', customRender: function (text) { return text || '--' } })
-      }
-      if (this.showCols.includes('stockUpPrintTimes')) {
-        arr.push({ title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '40px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-
+      arr.push({ title: '允许打印时间', dataIndex: 'allowPrintTime', width: '50px', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '40px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '60px', align: 'center' })
-      return arr
+      return arr.filter(item => !this.showCols.includes(item.dataIndex))
     }
   },
   methods: {