|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<!-- 已选配件列表 -->
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <!-- 总计 -->
|
|
|
+ <div style="padding:0 0 5px 0;" v-if="countData">
|
|
|
+ 总款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : 0 }}</strong>;
|
|
|
+ 总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : 0 }}</strong>;
|
|
|
+ <span v-if="$hasPermissions('B_salesDetail_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '0.00' }}</strong>;</span>
|
|
|
+ </div>
|
|
|
<div :style="{marginTop:type=='normal'?'0px':'10px'}">
|
|
|
<ve-table
|
|
|
border-y
|
|
@@ -110,7 +116,8 @@ export default {
|
|
|
hasOutStockOfActive: false, // 产品是否存在缺货
|
|
|
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 空图片
|
|
|
showStockCol: false, // 显示第三方库存
|
|
|
- hasJGtire: false // 是否轮胎产品
|
|
|
+ hasJGtire: false, // 是否轮胎产品
|
|
|
+ countData: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -124,7 +131,7 @@ export default {
|
|
|
const numsFormat = function (data) {
|
|
|
return data || data == 0 ? data : '--'
|
|
|
}
|
|
|
- // 销售单号
|
|
|
+ // 编号
|
|
|
const codeFormat = function (record, data, h) {
|
|
|
return (
|
|
|
<div>
|
|
@@ -138,37 +145,6 @@ export default {
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
- // 编号,并且格式化活动分类行
|
|
|
- const noFormat = function (record, data, h) {
|
|
|
- const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag == 1 && record.promo.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD'
|
|
|
- return (
|
|
|
- <div>
|
|
|
- {record.id.indexOf('promo-') >= 0 ? (
|
|
|
- <div class="active-title">
|
|
|
- {record.promo ? (
|
|
|
- <div>
|
|
|
- <strong style="font-size:14px;">{record.promo.promotion.description}</strong>
|
|
|
- <span>({record.promo.promotionRule.description})</span>
|
|
|
- <span id="salesDetail-activeDesc" style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={() => _this.showDesc(record.promo)}>
|
|
|
- <a-icon title="查看活动详情" type="eye"/> 活动详情
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- ) : (<div></div>)}
|
|
|
- <div>
|
|
|
- 款数:<strong>{record.total && record.total.totalCategory || '--'}</strong>;
|
|
|
- 数量:<strong>{record.total && record.total.totalQty || '--'}</strong>;
|
|
|
- {_this.$hasPermissions('B_salesDetail_salesPrice') ? (<span>总金额:<strong>{record.total && record.total.totalAmount || '--'}</strong>;</span>) : ('')}
|
|
|
- {_this.$hasPermissions('B_salesDetail_salesPrice') && record.promo && record.total && record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>) : ('')}
|
|
|
- {_this.$hasPermissions('B_salesDetail_salesPrice') && record.promo && record.total && record.total.cgejyAmount > 0 && !isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>) : ('')}
|
|
|
- {_this.$hasPermissions('B_salesDetail_salesPrice') && record.promo && record.total && record.total.cgejyAmount < 0 && !isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>) : ('')}
|
|
|
- {_this.$hasPermissions('B_salesDetail_salesPrice') && record.promo && record.total && record.total.totalPromoGiftsAmount && isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total.totalPromoGiftsAmount)}</strong>;</span>) : ('')}
|
|
|
- {record.total && record.total.expenseAccountFlag != 'WAIT' ? (<span style="color:red;">{record.total.expenseAccountFlagDictValue}</span>) : ''}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ) : (<span>{data}</span>)}
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
// 显示折扣价
|
|
|
const discountPriceFormat = function (record, data, h) {
|
|
|
return (
|
|
@@ -182,7 +158,7 @@ export default {
|
|
|
}
|
|
|
// 列定义
|
|
|
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: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
{ title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
|
|
|
{ title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
{ title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
@@ -275,7 +251,7 @@ export default {
|
|
|
|
|
|
// 查询正常产品明细列表
|
|
|
const normalList = this.type == 'normal' ? await salesDetailAllList(params).then(res => res.data) : []
|
|
|
- // const norTotal = this.type == 'normal' ? await salesDetaiCount(params).then(res => res.data) : null
|
|
|
+ this.countData = this.type == 'normal' ? await salesDetaiCount(params).then(res => res.data) : null
|
|
|
// 查询活动产品明细列表
|
|
|
const activeList = this.type == 'active' ? await salesDetailExtPromoList({ salesPromoSnSet: [], ...params }).then(res => res.data) : []
|
|
|
// 赋值
|