|
@@ -110,7 +110,10 @@ export default {
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
components: { STable, VSelect, chooseWarehouse },
|
|
components: { STable, VSelect, chooseWarehouse },
|
|
props: {
|
|
props: {
|
|
- newLoading: Boolean,
|
|
|
|
|
|
+ newLoading: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ },
|
|
maxHeight:{
|
|
maxHeight:{
|
|
type: [String,Number],
|
|
type: [String,Number],
|
|
default: '300'
|
|
default: '300'
|
|
@@ -164,38 +167,27 @@ export default {
|
|
return data || data == 0 ? data : '--'
|
|
return data || data == 0 ? data : '--'
|
|
}
|
|
}
|
|
const codeFormat = function(record,data,h){
|
|
const codeFormat = function(record,data,h){
|
|
- if(record.promotionFlag=='GIFT'){
|
|
|
|
- return (
|
|
|
|
- <div>
|
|
|
|
- <span style="padding-right: 15px;">{data}</span>
|
|
|
|
- <a-badge count="促" number-style={{ backgroundColor: '#52c41a', zoom:'80%' }}></a-badge>
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
|
|
+ let ftext = ''
|
|
|
|
+ let fcolor = ''
|
|
|
|
+ if(record.promotionFlag == 'GIFT'){
|
|
|
|
+ ftext = '促'
|
|
|
|
+ fcolor = '#52c41a'
|
|
}
|
|
}
|
|
- if(record.promotionFlag=='REGULAR'){
|
|
|
|
- return (
|
|
|
|
- <div>
|
|
|
|
- <span style="padding-right: 15px;">{data}</span>
|
|
|
|
- <a-badge count="正" number-style={{ backgroundColor: '#108ee9', zoom:'80%' }}></a-badge>
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
|
|
+ if(record.promotionFlag == 'REGULAR'){
|
|
|
|
+ ftext = '正'
|
|
|
|
+ fcolor = '#108ee9'
|
|
}
|
|
}
|
|
- if(record.promotionFlag=='DISCOUNT'){
|
|
|
|
- return (
|
|
|
|
- <div>
|
|
|
|
- <span style="padding-right: 15px;">{data}</span>
|
|
|
|
- <a-badge count="特" number-style={{ backgroundColor: '#faad14', zoom:'80%' }}></a-badge>
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
|
|
+ if(record.promotionFlag == 'DISCOUNT'){
|
|
|
|
+ ftext = '特'
|
|
|
|
+ fcolor = '#faad14'
|
|
}
|
|
}
|
|
- if(Number(record.stockQty||0) < Number(record.unpushedQty||0)){
|
|
|
|
- return (
|
|
|
|
|
|
+ return (
|
|
<div>
|
|
<div>
|
|
<span style="padding-right: 15px;">{data}</span>
|
|
<span style="padding-right: 15px;">{data}</span>
|
|
- <a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>
|
|
|
|
|
|
+ {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
|
|
|
|
+ {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
- }
|
|
|
|
}
|
|
}
|
|
// 输入框
|
|
// 输入框
|
|
const inputFormat = function(record,data,h) {
|
|
const inputFormat = function(record,data,h) {
|
|
@@ -205,8 +197,8 @@ export default {
|
|
<a-input-number
|
|
<a-input-number
|
|
size="small"
|
|
size="small"
|
|
vModel={record.cancelNums}
|
|
vModel={record.cancelNums}
|
|
- precision="0"
|
|
|
|
- min="0"
|
|
|
|
|
|
+ precision={0}
|
|
|
|
+ min={0}
|
|
max={record.surplusQty}
|
|
max={record.surplusQty}
|
|
style="width: 100%;"
|
|
style="width: 100%;"
|
|
placeholder="请输入" />
|
|
placeholder="请输入" />
|
|
@@ -224,7 +216,6 @@ export default {
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-info"
|
|
class="button-info"
|
|
- loading={newLoading}
|
|
|
|
onClick="handleAdd(record)"
|
|
onClick="handleAdd(record)"
|
|
>添加</a-button>
|
|
>添加</a-button>
|
|
</div>
|
|
</div>
|
|
@@ -290,12 +281,32 @@ export default {
|
|
params.promoRuleSn = promo.promoRuleSn
|
|
params.promoRuleSn = promo.promoRuleSn
|
|
params.promoSn = promo.promoSn
|
|
params.promoSn = promo.promoSn
|
|
params.salesPromoSn = promo.salesPromoSn
|
|
params.salesPromoSn = promo.salesPromoSn
|
|
- list1[i] = await salesDetailAllList(params).then(res => res.data)
|
|
|
|
|
|
+ // 获取活动产品列表
|
|
|
|
+ const aclist = await salesDetailAllList(params).then(res => res.data)
|
|
|
|
+ // 获取活动产品统计
|
|
|
|
+ //const acTotal = await salesDetailCount(params).then(res => res.data)
|
|
|
|
+ list1[i] = [{
|
|
|
|
+ promo: promo,
|
|
|
|
+ // total: acTotal
|
|
|
|
+ },...aclist]
|
|
}
|
|
}
|
|
|
|
|
|
console.log(list0)
|
|
console.log(list0)
|
|
console.log(list1)
|
|
console.log(list1)
|
|
this.dataSource = list0
|
|
this.dataSource = list0
|
|
|
|
+
|
|
|
|
+ // 格式化数据
|
|
|
|
+ this.dataSource.map(item => {
|
|
|
|
+ data[i].no = no + i + 1
|
|
|
|
+ const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
|
|
|
|
+ const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
|
|
|
|
+ const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
|
|
|
|
+ const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
|
|
|
|
+ item.productCode = productCode || '--'
|
|
|
|
+ item.productName = productName || '--'
|
|
|
|
+ item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
|
|
|
|
+ item.productOrigUnit = productOrigUnit || '--'
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
@@ -318,13 +329,11 @@ export default {
|
|
this.getActiveList()
|
|
this.getActiveList()
|
|
},
|
|
},
|
|
clearTable () {
|
|
clearTable () {
|
|
- this.rowSelectionInfo = null
|
|
|
|
- this.$refs.table.clearSelected()
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
// 刷新当前页面
|
|
// 刷新当前页面
|
|
resetCurForm () {
|
|
resetCurForm () {
|
|
- this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
|
- this.$refs.table.refresh()
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
// 添加
|
|
// 添加
|
|
handleAdd (row) {
|
|
handleAdd (row) {
|