|
@@ -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: {
|