|
@@ -60,7 +60,8 @@
|
|
|
<div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
|
|
|
采购金额合计:<strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? toThousands(detail.discountedAmount,2) : '--' }}</strong>,
|
|
|
审核订单金额:<strong>{{ detail && (detail.totalPushedAmount || detail.totalPushedAmount==0) ? toThousands(detail.totalPushedAmount,2) : '--' }}</strong>,
|
|
|
- 已取消金额:<strong>{{ detail && (detail.totalCancelAmount || detail.totalCancelAmount==0) ? toThousands(detail.totalCancelAmount,2) : '--' }}</strong>
|
|
|
+ 已取消金额:<strong>{{ detail && (detail.totalCancelAmount || detail.totalCancelAmount==0) ? toThousands(detail.totalCancelAmount,2) : '--' }}</strong>,
|
|
|
+ <span v-if="isShowSalesFlag" style="color: #ed1c24;">优惠金额:<strong>{{ detail && (detail.discountAmount || detail.discountAmount==0) ? detail.discountAmount.toFixed(2) : '--' }}</strong></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-alert>
|
|
@@ -74,6 +75,12 @@
|
|
|
:data="loadData"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
+ <!-- 产品编码 -->
|
|
|
+ <template slot="code" slot-scope="text, record">
|
|
|
+ <span>{{ record.dealerProductEntity.code }}</span>
|
|
|
+ <a-badge v-if="record.promotionFlag && record.promotionFlag=='GIFT'" count="促" :number-style="{ backgroundColor: '#52c41a', zoom:'80%',marginLeft:'5px' }"></a-badge>
|
|
|
+ <a-badge v-if="record.promotionFlag && record.promotionFlag=='DISCOUNT'" count="特" :number-style="{ backgroundColor: '#faad14', zoom:'80%',marginLeft:'5px' }"></a-badge>
|
|
|
+ </template>
|
|
|
<!-- 采购数量 -->
|
|
|
<template slot="origqty" slot-scope="text, record">
|
|
|
<div>{{ text }}</div>
|
|
@@ -83,6 +90,16 @@
|
|
|
<template slot="outOfStockNum" slot-scope="text, record">
|
|
|
<span>{{ record.outOfStockNum }}</span>
|
|
|
</template>
|
|
|
+ <!-- 采购单价 -->
|
|
|
+ <template slot="unitPrice" slot-scope="text, record">
|
|
|
+ <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.price||record.price==0? toThousands(record.price): '--' }}{{ record.origPrice ? '(' + toThousands(record.origPrice) + ')' : '' }}</span>
|
|
|
+ <span v-else>{{ toThousands(record.price) }}</span>
|
|
|
+ </template>
|
|
|
+ <!-- 采购金额 -->
|
|
|
+ <template slot="amount" slot-scope="text, record">
|
|
|
+ <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedAmount||record.discountedAmount==0?toThousands(record.discountedAmount) : '--' }}{{ record.totalOrigAmount ? '(' + toThousands(record.totalOrigAmount) + ')' : '' }}</span>
|
|
|
+ <span v-else>{{ toThousands(record.discountedAmount) }}</span>
|
|
|
+ </template>
|
|
|
</s-table>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
@@ -161,6 +178,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
+ isShowSalesFlag: false,
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -172,6 +190,7 @@ export default {
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
}
|
|
|
+ this.isShowSalesFlag = data.list.some(con => { return con.promotionFlag != 0 })
|
|
|
this.localDataSource = data.list
|
|
|
this.disabled = false
|
|
|
}
|
|
@@ -185,10 +204,10 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
columns () {
|
|
|
- let _this=this
|
|
|
+ const _this = this
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', scopedSlots: { customRender: 'code' } },
|
|
|
{ title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -197,12 +216,12 @@ export default {
|
|
|
{ title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', scopedSlots: { customRender: 'origqty' } },
|
|
|
// { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '审核订单数量', dataIndex: 'pushedQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
]
|
|
|
if (this.$hasPermissions('M_ShowAllCost')) {
|
|
|
- arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
|
|
|
- arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
|
|
|
- arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
|
|
|
+ arr.splice(5, 0, { title: '采购单价', dataIndex: 'price', width: '7%', align: 'right', scopedSlots: { customRender: 'unitPrice' } })
|
|
|
+ arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', scopedSlots: { customRender: 'amount' } })
|
|
|
+ arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
@@ -220,7 +239,13 @@ export default {
|
|
|
getDetail () {
|
|
|
purchaseDetailBySn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.detail = res.data
|
|
|
+ const dataInfo = res.data
|
|
|
+ if (dataInfo.totalOrigAmount && dataInfo.totalAmount) {
|
|
|
+ dataInfo.discountAmount = dataInfo.totalOrigAmount - dataInfo.totalAmount
|
|
|
+ } else {
|
|
|
+ dataInfo.discountAmount = null
|
|
|
+ }
|
|
|
+ this.detail = dataInfo
|
|
|
} else {
|
|
|
this.detail = null
|
|
|
}
|