|
@@ -60,7 +60,8 @@
|
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
|
- <a-button type="danger" :disabled="newLoading" class="button-error" @click="handlePlCancel">批量取消</a-button>
|
|
|
+ <a-button type="danger" v-if="hasPrompActive" :disabled="newLoading" class="button-error" @click="handleAllCancel">整单取消</a-button>
|
|
|
+ <a-button type="danger" v-else :disabled="newLoading" class="button-error" @click="handlePlCancel">批量取消</a-button>
|
|
|
<span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
|
|
|
</div>
|
|
|
<div style="padding-left: 20px;">
|
|
@@ -176,10 +177,13 @@ export default {
|
|
|
showTableHead: true,
|
|
|
disableSelectedRowKeys: [],
|
|
|
selectedRowKeys: [],
|
|
|
- colspanNums: 16
|
|
|
+ colspanNums: 16,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ hasPrompActive(){
|
|
|
+ return this.activeList.length > 0
|
|
|
+ },
|
|
|
checkboxOption () {
|
|
|
return {
|
|
|
disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
@@ -196,8 +200,15 @@ export default {
|
|
|
},
|
|
|
columns () {
|
|
|
const _this = this
|
|
|
- const priceFormat = function(data){
|
|
|
- return _this.toThousands(data) || '--'
|
|
|
+ const priceFormat = function(record,data,h){
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {_this.toThousands(data)}
|
|
|
+ {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
|
|
|
+ <span title="原价">({ _this.toThousands(record.origPrice)})</span>
|
|
|
+ ):''}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
}
|
|
|
const numsFormat = function(data){
|
|
|
return data || data == 0 ? data : '--'
|
|
@@ -209,10 +220,6 @@ export default {
|
|
|
ftext = '促'
|
|
|
fcolor = '#52c41a'
|
|
|
}
|
|
|
- // if(record.promotionFlag == 'REGULAR'){
|
|
|
- // ftext = '正'
|
|
|
- // fcolor = '#108ee9'
|
|
|
- // }
|
|
|
if(record.promotionFlag == 'DISCOUNT'){
|
|
|
ftext = '特'
|
|
|
fcolor = '#faad14'
|
|
@@ -301,11 +308,11 @@ export default {
|
|
|
this.colspanNums = 6
|
|
|
if (this.$hasPermissions('B_salesDispatch_salesPrice')) { // 售价权限
|
|
|
this.colspanNums = this.colspanNums + 1
|
|
|
- arr.push({ title: '销售价', field: 'price', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
|
|
|
+ arr.push({ title: '销售价', field: 'price', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row,row[column.field],h)} })
|
|
|
}
|
|
|
if (this.$hasPermissions('B_salesDispatch_costPrice')) {
|
|
|
this.colspanNums = this.colspanNums + 1
|
|
|
- arr.push({ title: '成本价', field: 'showCost', width: 80,key: "g", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
|
|
|
+ arr.push({ title: '成本价', field: 'showCost', width: 80,key: "g", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return _this.toThousands(row[column.field])||'--'} })
|
|
|
}
|
|
|
this.colspanNums = this.colspanNums + 8
|
|
|
arr = arr.concat([
|
|
@@ -389,11 +396,11 @@ export default {
|
|
|
const proList = await salesDetailAllList(params).then(res => res.data)
|
|
|
const norTotal = await salesDetaiCount(params).then(res => res.data)
|
|
|
//没有活动时不显示统计
|
|
|
- let listData = active.length ? [{
|
|
|
+ let listData = active.length ? (proList.length ? [{
|
|
|
id: 'promo-normal',
|
|
|
total: norTotal
|
|
|
- },...proList] : proList
|
|
|
-
|
|
|
+ },...proList] : []) : proList
|
|
|
+
|
|
|
// 循环获取活动产品
|
|
|
for(let i=0;i<active.length;i++){
|
|
|
const promo = active[i]
|
|
@@ -419,9 +426,10 @@ export default {
|
|
|
},...aclist]
|
|
|
listData = aclist&&aclist.length ? listData.concat(retList) : listData
|
|
|
}
|
|
|
+
|
|
|
// 如果活动没有任何产品
|
|
|
if(active.length){
|
|
|
- const hasAcp = listData.filter(item => item.id.indexOf("promo-")>=0)
|
|
|
+ const hasAcp = listData.filter(item => item.id=='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
|
|
|
if(hasAcp && hasAcp.length==1){
|
|
|
listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
|
|
|
}
|
|
@@ -516,6 +524,19 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 整单取消
|
|
|
+ handleAllCancel () {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定整单取消订单?',
|
|
|
+ centered: true,
|
|
|
+ closable: true,
|
|
|
+ onOk () {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 批量取消
|
|
|
handlePlCancel () {
|
|
|
const _this = this
|