|
@@ -18,17 +18,20 @@
|
|
|
:column-width-resize-option="columnWidthResizeOption"
|
|
|
/>
|
|
|
<div v-show="showEmpty" class="empty-data">暂无数据</div>
|
|
|
+ <!-- 活动规则详情 -->
|
|
|
+ <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+ import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
|
|
|
import { salesPromoQueryList } from '@/api/salesNew'
|
|
|
import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
|
|
|
export default {
|
|
|
name: 'DetailProductList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { },
|
|
|
+ components: { detailModal },
|
|
|
props: {
|
|
|
newLoading: Boolean,
|
|
|
detailData: {
|
|
@@ -71,6 +74,8 @@
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
+ openDetailModal: false,
|
|
|
+ detailSn: null,
|
|
|
activeList: [], // 活动列表
|
|
|
dataSource: [],
|
|
|
tableHeight: this.maxHeight,
|
|
@@ -138,7 +143,7 @@
|
|
|
{record.promo?(
|
|
|
<div>
|
|
|
<strong style="margin-right:10px;font-size:14px;">{record.promo.promotion.title} ({record.promo.promotionRule.description})</strong>
|
|
|
- <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record)}>
|
|
|
+ <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record.promo)}>
|
|
|
<a-icon title="查看活动详情" type="eye"/> 活动详情
|
|
|
</span>
|
|
|
</div>
|
|
@@ -147,12 +152,28 @@
|
|
|
款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
|
|
|
数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
|
|
|
{_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
|
|
|
+ {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>优惠金额:<strong>{record.total.lossAmount||'--'}</strong>;</span>):('')}
|
|
|
+ {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>采购额结余:<strong>{_this.toThousands(Number(record.total.totalPromoGiftsAmount) - Number(record.total.totalUsePromoGiftsAmount))}</strong>;</span>):('')}
|
|
|
+ {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total ? (<span>采购额超出:<strong>{_this.toThousands(Number(record.total.totalUsePromoGiftsAmount) - Number(record.total.totalPromoGiftsAmount))}</strong>;</span>):('')}
|
|
|
+ {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
|
|
|
</div>
|
|
|
</div>
|
|
|
):(<span>{data}</span>)}
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
+ // 显示折扣价
|
|
|
+ const discountPriceFormat = function(record,data,h) {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {_this.toThousands(data)}
|
|
|
+ {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
|
|
|
+ <span style="color:#f5222d;" title="原价">({ _this.toThousands(record.origPrice)})</span>
|
|
|
+ ):''}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
let arr= [
|
|
|
{ title: '序号', field: 'no',key: "a", width: 50, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
|
|
|
{ title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
|
|
@@ -181,12 +202,12 @@
|
|
|
arr.push({ title: '市级价', field: 'cityPrice', width: 80,key: "j", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
|
|
|
if (this.$hasPermissions(this.authCode + '_salesPrice')) { // 售价权限
|
|
|
this.colspanNums = this.colspanNums + 1
|
|
|
- arr.push({ title: '销售价', field: 'price', width: 80,key: "k", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
|
|
|
+ arr.push({ title: '销售价', field: 'price', width: 120,key: "k", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row,row[column.field],h)} })
|
|
|
}
|
|
|
} else {
|
|
|
if (this.$hasPermissions(this.authCode + '_salesPrice')) { // 售价权限
|
|
|
this.colspanNums = this.colspanNums + 1
|
|
|
- arr.push({ title: '销售价', field: 'price', width: 80,key: "l", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
|
|
|
+ arr.push({ title: '销售价', field: 'price', width: 120,key: "l", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row,row[column.field],h)} })
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -212,6 +233,11 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 关闭详情弹窗
|
|
|
+ closeDetailModal () {
|
|
|
+ this.detailSn = null
|
|
|
+ this.openDetailModal = false
|
|
|
+ },
|
|
|
// 合并活动分类单元格
|
|
|
bodyCellSpan({ row, column, rowIndex }) {
|
|
|
if (row.id.indexOf('promo-')>=0) {
|
|
@@ -229,8 +255,9 @@
|
|
|
}
|
|
|
},
|
|
|
// 查看活动详情
|
|
|
- showDesc(e,item){
|
|
|
-
|
|
|
+ showDesc(row){
|
|
|
+ this.detailSn = row.promoRuleSn
|
|
|
+ this.openDetailModal = true
|
|
|
},
|
|
|
// 获取销售单参与的活动列表
|
|
|
pageInit(){
|