|
@@ -55,6 +55,11 @@
|
|
|
<v-select code="FLAG" allowClear placeholder="请选择是否满足起订量"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col flex="1">
|
|
|
+ <a-form-item label="累计产品">
|
|
|
+ <v-select code="FLAG" allowClear placeholder="请选择是否累计产品"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
<a-col flex="2" style="margin-bottom: 10px;">
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" :id="'salesEdit-refresh-'+id">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" :id="'salesEdit-reset-'+id">重置</a-button>
|
|
@@ -96,7 +101,6 @@
|
|
|
<span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项</span>
|
|
|
</a-col>
|
|
|
<a-col :md="12" :sm="24" style="text-align:right;">
|
|
|
- <label><a-checkbox v-model="queryParam.showLj"></a-checkbox> 显示累计产品</label>
|
|
|
<a-button
|
|
|
:id="'salesEdit-searchBox-'+id"
|
|
|
type="link"
|
|
@@ -117,7 +121,7 @@
|
|
|
:row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.promotionFlag == 'GIFT'&&!!record.salesPromoDetailParentSn } }) }"
|
|
|
@rowSelection="rowSelectionFun"
|
|
|
:defaultLoadData="false"
|
|
|
- :pageSize="10"
|
|
|
+ :showPagination="false"
|
|
|
bordered>
|
|
|
<!-- 产品编码 -->
|
|
|
<template slot="productCode" slot-scope="text, record">
|
|
@@ -154,7 +158,7 @@
|
|
|
</template>
|
|
|
<!-- 规则数量 -->
|
|
|
<template slot="rulesNums" slot-scope="text, record">
|
|
|
- <a-button type="link" :id="'salesEdit-gzqty-'+id+'-'+record.id" size="small" class="button-info">1</a-button>
|
|
|
+ <a-button type="link" :id="'salesEdit-gzqty-'+id+'-'+record.id" size="small" class="button-info">{{ record.promoRuleNum }}</a-button>
|
|
|
</template>
|
|
|
<!-- 销售数量 -->
|
|
|
<template slot="salesNums" slot-scope="text, record">
|
|
@@ -235,7 +239,7 @@ import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
import {
|
|
|
- salesDetailList,
|
|
|
+ salesDetailExtPromoList,
|
|
|
salesDetailUpdateQty,
|
|
|
salesDetailInsert,
|
|
|
salesDetailInsertBatchBorrow,
|
|
@@ -263,10 +267,6 @@ export default {
|
|
|
default: false
|
|
|
},
|
|
|
newLoading: Boolean,
|
|
|
- promo: {
|
|
|
- type: Object,
|
|
|
- default: function () { return null }
|
|
|
- },
|
|
|
// 详情数据
|
|
|
detailData: {
|
|
|
type: Object,
|
|
@@ -277,10 +277,10 @@ export default {
|
|
|
type: String,
|
|
|
default: '0'
|
|
|
},
|
|
|
- // 仓库sn
|
|
|
- warehouseSn: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
+ // 活动sn
|
|
|
+ salesPromoSnSet: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
},
|
|
|
// 销售单sn
|
|
|
salesBillSn: {
|
|
@@ -296,30 +296,21 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.queryParam.salesBillSn = this.salesBillSn || ''
|
|
|
- return salesDetailList(Object.assign(parameter, this.queryParam, {
|
|
|
+ this.queryParam.salesPromoSnSet = this.salesPromoSnSet || []
|
|
|
+ return salesDetailExtPromoList(Object.assign(parameter, this.queryParam, {
|
|
|
showStock: true,
|
|
|
- promoRuleSn: this.promo ? this.promo.promoRuleSn : '',
|
|
|
- promoSn: this.promo ? this.promo.promoSn : '',
|
|
|
- salesPromoSn: this.promo ? this.promo.salesPromoSn : ''
|
|
|
+ promoFlag: this.detailData.promoFlag
|
|
|
})).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = no + i + 1
|
|
|
- data.list[i].qtyBackups = data.list[i].qty
|
|
|
- data.list[i].productUnit = data.list[i].productEntity && data.list[i].productEntity.unit
|
|
|
- // 按数量设置
|
|
|
- if (data.list[i].unitType && data.list[i].unitType == 'SL') {
|
|
|
- data.list[i].unitQtyV = data.list[i].unitQty ? (data.list[i].unitQty + data.list[i].productUnit) : '--'
|
|
|
- data.list[i].unitQtyR = data.list[i].unitQty
|
|
|
- } else {
|
|
|
- data.list[i].unitQtyV = data.list[i].packQty && data.list[i].unitQty ? ((data.list[i].unitQty + '*' + data.list[i].packQty) + data.list[i].productUnit) : '--'
|
|
|
- data.list[i].unitQtyR = data.list[i].packQty * data.list[i].unitQty
|
|
|
- }
|
|
|
+ const no = 0
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ data[i].no = no + i + 1
|
|
|
+ data[i].qtyBackups = data[i].qty
|
|
|
+ data[i].productUnit = data[i].productEntity && data[i].productEntity.unit
|
|
|
}
|
|
|
- this.dataSource = data.list
|
|
|
+ this.dataSource = data
|
|
|
}
|
|
|
this.disabled = false
|
|
|
return data
|
|
@@ -336,7 +327,8 @@ export default {
|
|
|
productBrandSn: undefined, // 产品品牌
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
- productTypeSn3: '' // 产品三级分类
|
|
|
+ productTypeSn3: '', // 产品三级分类
|
|
|
+ borrowFlag: undefined // 是否累计产品
|
|
|
},
|
|
|
productType: [], // 已选产品分类
|
|
|
rowSelectionInfo: null, // 已选产品数据
|
|
@@ -360,7 +352,7 @@ export default {
|
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '12%', align: 'center' },
|
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '25%', align: 'left' },
|
|
|
{ title: '规则数量', scopedSlots: { customRender: 'rulesNums' }, width: '4%', align: 'center' },
|
|
|
- { title: '起订量', dataIndex: 'unitQtyV', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '起订量', dataIndex: 'promoUnit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '6%', align: 'center' },
|
|
|
{ title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '5%', align: 'center' },
|
|
|
{ title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '8%', align: 'center' },
|
|
@@ -383,7 +375,7 @@ export default {
|
|
|
salesBillSn (newValue, oldValue) {
|
|
|
this.resetSearchForm()
|
|
|
},
|
|
|
- promo (newValue, oldValue) {
|
|
|
+ salesPromoSnSet (newValue, oldValue) {
|
|
|
this.resetSearchForm()
|
|
|
},
|
|
|
spinning (a, b) {
|
|
@@ -431,6 +423,7 @@ export default {
|
|
|
this.queryParam.productTypeSn1 = ''
|
|
|
this.queryParam.productTypeSn2 = ''
|
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
+ this.queryParam.borrowFlag = undefined
|
|
|
this.productType = []
|
|
|
this.rowSelectionInfo = null
|
|
|
this.$refs.table.clearSelected()
|