|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="salesReturn-productList-wrap">
|
|
|
<!-- 搜索条件 -->
|
|
|
- <div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)" style="flex-grow: 1;">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24" v-if="grabFlag == 1">
|
|
|
<a-form-item label="审核时间">
|
|
@@ -36,6 +36,9 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
+ <div>
|
|
|
+ <hideCellMenus placeholder="显示" @change="showCellChange" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -132,9 +135,10 @@ import { salesReturnProductList } from '@/api/salesReturn'
|
|
|
import { stockList } from '@/api/stock'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import hideCellMenus from '@/views/common/hideCellMenus'
|
|
|
export default {
|
|
|
name: 'SalesReturnQueryPart',
|
|
|
- components: { STable, VSelect, rangeDate },
|
|
|
+ components: { STable, VSelect, rangeDate, hideCellMenus },
|
|
|
mixins: [commonMixin],
|
|
|
props: {
|
|
|
warehouseCascadeData: { // 仓库信息
|
|
@@ -160,12 +164,12 @@ export default {
|
|
|
endDate: '', // 结束时间
|
|
|
salesBillNo: '', // 销售单号
|
|
|
productName: '', // 产品名称
|
|
|
- productCode: '' // 产品编码
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ oosFlag: undefined // 是否急件
|
|
|
},
|
|
|
buyerSn: '', // 客户sn
|
|
|
priceType: '', // 价格类型
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
- columns: [], // 列
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -215,40 +219,90 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- listData: []
|
|
|
+ listData: [],
|
|
|
+ currentDealerInfo: null,
|
|
|
+ showCell: []// 已选要显示的列
|
|
|
}
|
|
|
},
|
|
|
- mounted () {
|
|
|
- // 抓单
|
|
|
- if (this.grabFlag == 1) {
|
|
|
- this.columns = [
|
|
|
- { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
|
|
|
- { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
- { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '销售单号', dataIndex: 'salesBillNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '销售审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '售价', dataIndex: 'price', align: 'right', width: '5%', scopedSlots: { customRender: 'price' } },
|
|
|
- { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '销售数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '已退数量', dataIndex: 'hasReturnQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
|
|
|
- { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
|
|
|
- { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }]
|
|
|
- } else {
|
|
|
- // 不抓单
|
|
|
- this.columns = [
|
|
|
- { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '售价', dataIndex: 'salePrice', width: '10%', align: 'right', scopedSlots: { customRender: 'price' } },
|
|
|
- { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
|
|
|
- { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
|
|
|
- { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }]
|
|
|
+ computed: {
|
|
|
+ colsArr () {
|
|
|
+ const _this = this
|
|
|
+ // 省级且有市级价权限
|
|
|
+ if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '批发价',
|
|
|
+ key: 'wholesalePrice',
|
|
|
+ disabled: false,
|
|
|
+ checked: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '终端价',
|
|
|
+ key: 'terminalPrice',
|
|
|
+ disabled: false,
|
|
|
+ checked: false
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '终端价',
|
|
|
+ key: 'terminalPrice',
|
|
|
+ disabled: false,
|
|
|
+ checked: false
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns () {
|
|
|
+ const _this = this
|
|
|
+ let arr = []
|
|
|
+ // 抓单
|
|
|
+ if (this.grabFlag == 1) {
|
|
|
+ arr = [
|
|
|
+ { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
+ { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '急件', dataIndex: 'oosFlagDictValue', width: '5%', align: 'center', customRender: function (text) { return text == '是' ? text : '' } },
|
|
|
+ { title: '原售价', dataIndex: 'price', align: 'right', width: '7%', scopedSlots: { customRender: 'price' } },
|
|
|
+ { title: '折后售价', dataIndex: 'discountedPrice', align: 'right', width: '7%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ // { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ // { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '已退数量', dataIndex: 'hasReturnQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
|
|
|
+ { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
|
|
|
+ { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }]
|
|
|
+ } else {
|
|
|
+ // 不抓单
|
|
|
+ arr = [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '原售价', dataIndex: 'salePrice', width: '10%', align: 'right', scopedSlots: { customRender: 'price' } },
|
|
|
+ // { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ // { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
|
|
|
+ { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
|
|
|
+ { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }]
|
|
|
+ }
|
|
|
+
|
|
|
+ // 省级且有市级价权限
|
|
|
+ if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
|
|
|
+ arr.splice(this.grabFlag == 1 ? 7 : 5, 0, { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ arr.splice(this.grabFlag == 1 ? 8 : 6, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ } else {
|
|
|
+ arr.splice(this.grabFlag == 1 ? 7 : 5, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ }
|
|
|
+ return arr.filter(item => !_this.showCell.includes(item.dataIndex))
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -257,6 +311,12 @@ export default {
|
|
|
this.queryParam.beginDate = date[0]
|
|
|
this.queryParam.endDate = date[1]
|
|
|
},
|
|
|
+ showCellChange (val) {
|
|
|
+ this.$emit('showCellChange', val)
|
|
|
+ },
|
|
|
+ setCell (data) {
|
|
|
+ this.currentDealerInfo = data
|
|
|
+ },
|
|
|
// 双击列表选择配件
|
|
|
handleClickRow (record) {
|
|
|
const _this = this
|
|
@@ -299,6 +359,7 @@ export default {
|
|
|
this.queryParam.salesBillNo = ''
|
|
|
this.queryParam.productName = ''
|
|
|
this.queryParam.productCode = ''
|
|
|
+ this.queryParam.oosFlag = undefined
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 初始化,客户sn、价格类型
|