|
@@ -27,7 +27,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="4" :sm="24">
|
|
<a-col :md="4" :sm="24">
|
|
<a-form-item label="类型">
|
|
<a-form-item label="类型">
|
|
- <a-select default-value="0" @change="handlePtypeChange">
|
|
|
|
|
|
+ <a-select v-model.trim="queryParam.ptype" >
|
|
<a-select-option value="0">
|
|
<a-select-option value="0">
|
|
全部产品
|
|
全部产品
|
|
</a-select-option>
|
|
</a-select-option>
|
|
@@ -130,6 +130,7 @@ export default {
|
|
showSetting: false, // 设置弹框
|
|
showSetting: false, // 设置弹框
|
|
productType: [],
|
|
productType: [],
|
|
queryParam: {
|
|
queryParam: {
|
|
|
|
+ ptype: '0', // 类型
|
|
productCode: '', // 产品编码
|
|
productCode: '', // 产品编码
|
|
productName: '', // 产品名称
|
|
productName: '', // 产品名称
|
|
promotionFlag: undefined, // 是否促销品
|
|
promotionFlag: undefined, // 是否促销品
|
|
@@ -150,7 +151,7 @@ export default {
|
|
{ title: '成本价', dataIndex: 'showCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '成本价', dataIndex: 'showCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '销售价', dataIndex: 'price', width: 150, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '销售价', dataIndex: 'price', width: 150, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '可用库存', dataIndex: 'kc', width: 150, align: 'center' },
|
|
|
|
|
|
+ { title: '可用库存', dataIndex: 'stockQty', width: 150, align: 'center' },
|
|
{ title: '销售数量', dataIndex: 'qty', width: 150, align: 'center' },
|
|
{ title: '销售数量', dataIndex: 'qty', width: 150, align: 'center' },
|
|
{ title: '已取消', dataIndex: 'cancelQty', width: 150, align: 'center' },
|
|
{ title: '已取消', dataIndex: 'cancelQty', width: 150, align: 'center' },
|
|
{ title: '已下推', dataIndex: 'pushedQty', width: 150, align: 'center' },
|
|
{ title: '已下推', dataIndex: 'pushedQty', width: 150, align: 'center' },
|
|
@@ -164,11 +165,26 @@ export default {
|
|
this.queryParam.salesBillSn = this.salesBillSn
|
|
this.queryParam.salesBillSn = this.salesBillSn
|
|
return salesDetailAllList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return salesDetailAllList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
let data = res.data
|
|
let data = res.data
|
|
- data = data.filter(item => item != null)
|
|
|
|
|
|
+ // 根据类型过滤数据
|
|
|
|
+ data = data.filter(item => {
|
|
|
|
+ if (this.queryParam.ptype == '1') {
|
|
|
|
+ return item != null && item.surplusQty > 0
|
|
|
|
+ }
|
|
|
|
+ if (this.queryParam.ptype == '2') {
|
|
|
|
+ return item != null && item.surplusQty > 0 && item.surplusQty <= item.stockQty
|
|
|
|
+ }
|
|
|
|
+ if (this.queryParam.ptype == '3') {
|
|
|
|
+ return item != null && item.surplusQty > item.stockQty
|
|
|
|
+ }
|
|
|
|
+ if (this.queryParam.ptype == '0') {
|
|
|
|
+ return item != null
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // 增加编号
|
|
const no = 0
|
|
const no = 0
|
|
for (var i = 0; i < data.length; i++) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
data[i].no = no + i + 1
|
|
data[i].no = no + i + 1
|
|
- data[i].cancelNums = 1
|
|
|
|
|
|
+ data[i].cancelNums = data[i].surplusQty
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
return data
|
|
return data
|