Ver Fonte

添加采购单号

chenrui há 6 meses atrás
pai
commit
40849c4748

+ 37 - 30
src/views/salesManagement/salesQuery/list.vue

@@ -141,17 +141,7 @@
           </a-popover>
         </div>
         <div>
-          <a-dropdown v-model="showCell">
-            <a-button type="link" class="button-default" id="salesQuery-discount-showCell"> <a-icon type="setting" />  显示</a-button>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-checkbox v-model="showDiscount" id="salesQuery-discount">折后总售价</a-checkbox>
-              </a-menu-item>
-              <a-menu-item>
-                <a-checkbox v-model="showKhgx" id="salesQuery-khgx">客户关系</a-checkbox>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <hideCellMenus placeholder="显示" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
         </div>
       </div>
       <a-alert type="info" style="margin-bottom:10px">
@@ -285,11 +275,12 @@ import auditModal from '@/views/common/auditModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import stateIcon from '@/views/common/stateIcon'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
 export default {
   name: 'SalesList',
-  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon },
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon, hideCellMenus },
   mixins: [commonMixin],
   data () {
     return {
@@ -300,9 +291,7 @@ export default {
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
       isByCustQuery: false, // 是否按客户查询
-      showKhgx: false, // 是否显示客户关系
-      showDiscount: false, // 是否显示折后总售价
-      showCell: false, // 是否显示自定义列
+      showDiscount: false, // 显示折后总售价
       time: [ // 创建时间
         getDate.getMonthDays(3).starttime,
         getDate.getMonthDays(3).endtime
@@ -366,7 +355,28 @@ export default {
       auditInfo: null, // 当前审核的数据
       spinningAudit: false, // 审核loading
       distributionFlag: '0', //  是否铺货出库
-      isAbandonOrder: true// 包含废弃单
+      isAbandonOrder: true, // 包含废弃单
+      colsArr: [// 需要显示的列
+        {
+          title: '折后总售价',
+          key: 'discountedAmount',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '客户关系',
+          key: 'buyerRelationTypeDictValue',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '采购单号',
+          key: 'purchaseBillNo',
+          disabled: false,
+          checked: false
+        }
+      ],
+      showCell: []// 已选要显示的列
     }
   },
   computed: {
@@ -375,14 +385,15 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
         { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
-        // { title: '客户关系', dataIndex: 'buyerRelationTypeDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '8%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '13%', customRender: function (text) { return text || '--' } },
+        { title: '客户关系', dataIndex: 'buyerRelationTypeDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        // { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -394,16 +405,12 @@ export default {
         // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-      if (this.showKhgx) {
-        arr.splice(4, 0, { title: '客户关系', dataIndex: 'buyerRelationTypeDictValue', align: 'center', width: '5%', customRender: function (text) { return text || '--' } })
-      }
-      // 显示折扣
-      if (this.showDiscount) {
-        const dx = this.showKhgx ? 1 : 0
-        arr.splice(7 + dx, 0, { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(8 + dx, 0, { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      _this.showDiscount = !_this.showCell.includes('discountedAmount')
+      if (!_this.showCell.includes('discountedAmount')) {
+        const pos = (_this.showCell.includes('purchaseBillNo') && _this.showCell.includes('buyerRelationTypeDictValue')) ? 7 : (!_this.showCell.includes('purchaseBillNo') && !_this.showCell.includes('buyerRelationTypeDictValue')) ? 9 : 8
+        arr.splice(pos, 0, { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      return arr
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {

+ 35 - 29
src/views/salesManagement/salesQueryNew/list.vue

@@ -156,20 +156,9 @@
           <div class="action-buttons">
             <a-button id="salesManagementList-add0" type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)"><a-icon type="plus" /> 新增(零售)</a-button>
             <a-button id="salesManagementList-add1" type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)"><a-icon type="plus" /> 新增(铺货)</a-button>
-            <a-dropdown v-model="showCell">
-              <a-button type="link" class="button-default" id="salesQuery-discount-showCell"> <a-icon type="setting" />  显示</a-button>
-              <a-menu slot="overlay">
-                <a-menu-item>
-                  <a-checkbox v-model="showDiscount" id="salesManagementList-discount">折后总售价</a-checkbox>
-                </a-menu-item>
-                <a-menu-item>
-                  <a-checkbox v-model="showKhgx" id="salesQuery-khgx">客户关系</a-checkbox>
-                </a-menu-item>
-              </a-menu>
-            </a-dropdown>
+            <hideCellMenus placeholder="显示" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
           </div>
         </div>
-
         <!-- 列表 -->
         <s-table
           class="sTable fixPagination"
@@ -289,12 +278,13 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import stateIcon from '@/views/common/stateIcon'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
 import moment from 'moment'
 export default {
   name: 'SalesList',
-  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon },
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon, hideCellMenus },
   mixins: [commonMixin],
   data () {
     return {
@@ -305,9 +295,7 @@ export default {
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
       isByCustQuery: false, // 是否按客户查询
-      showKhgx: false, // 显示客户关系
       showDiscount: false, // 显示折后总售价
-      showCell: false, // 显示下拉选项
       time: [ // 创建时间
         getDate.getMonthDays(3).starttime,
         getDate.getMonthDays(3).endtime
@@ -371,7 +359,28 @@ export default {
       auditInfo: null, // 审核信息
       spinningAudit: false, // 审核操作loading
       distributionFlag: '0', // 是否铺货
-      isAbandonOrder: true// 包含废弃单
+      isAbandonOrder: true, // 包含废弃单
+      colsArr: [// 需要显示的列
+        {
+          title: '折后总售价',
+          key: 'discountedAmount',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '客户关系',
+          key: 'buyerRelationTypeDictValue',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '采购单号',
+          key: 'purchaseBillNo',
+          disabled: false,
+          checked: false
+        }
+      ],
+      showCell: []// 已选要显示的列
     }
   },
   computed: {
@@ -380,14 +389,15 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
         { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: this.showDiscount ? '6%' : '9%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: this.showDiscount ? '12%' : '15%', customRender: function (text) { return text || '--' } },
-        // { title: '客户关系', dataIndex: 'buyerRelationTypeDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '8%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '客户关系', dataIndex: 'buyerRelationTypeDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        // { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -399,16 +409,12 @@ export default {
         // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-      if (this.showKhgx) {
-        arr.splice(4, 0, { title: '客户关系', dataIndex: 'buyerRelationTypeDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } })
-      }
-      // 显示折扣
-      if (this.showDiscount) {
-        const dx = this.showKhgx ? 1 : 0
-        arr.splice(7 + dx, 0, { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(8 + dx, 0, { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      _this.showDiscount = !_this.showCell.includes('discountedAmount')
+      if (!_this.showCell.includes('discountedAmount')) {
+        const pos = (_this.showCell.includes('purchaseBillNo') && _this.showCell.includes('buyerRelationTypeDictValue')) ? 7 : (!_this.showCell.includes('purchaseBillNo') && !_this.showCell.includes('buyerRelationTypeDictValue')) ? 9 : 8
+        arr.splice(pos, 0, { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      return arr
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {