|
@@ -145,6 +145,27 @@
|
|
|
:defaultLoadData="false"
|
|
|
:scroll="{ y: 300 }"
|
|
|
bordered>
|
|
|
+ <!-- 售价 -->
|
|
|
+ <template slot="productPriceInfo" slot-scope="text, record">
|
|
|
+ <span v-if="!record.priceLevel">{{ (record.priceValue || record.priceValue==0) ? toThousands(record.priceValue):'--' }}</span>
|
|
|
+ <span v-else>{{ record.priceLevel=='PROVINCE'?record.provincePrice:record.priceLevel=='CITY'?record.cityPrice:record.specialPrice }}</span>
|
|
|
+ </template>
|
|
|
+ <!-- 价格级别 -->
|
|
|
+ <template slot="priceLevel" slot-scope="text, record, index">
|
|
|
+ <span v-if="!$hasPermissions('M_transferOut_edit_salesPrice')">--</span>
|
|
|
+ <div v-else>
|
|
|
+ <span v-if="record.priceValue ||record.priceValue==0">{{ record.priceLevelDictValue }}</span>
|
|
|
+ <v-select
|
|
|
+ v-else
|
|
|
+ style="width:90%;"
|
|
|
+ size="small"
|
|
|
+ code="PRICE_LEVEL"
|
|
|
+ v-model="record.priceLevel"
|
|
|
+ allowClear
|
|
|
+ placeholder="请选择价格级别"
|
|
|
+ @change="e => handlePriceLevel(e,index)"></v-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<!-- 调出数量 -->
|
|
|
<template slot="qty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
@@ -390,6 +411,8 @@ export default {
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
data.list[i].qty = 1
|
|
|
+ data.list[i].priceLevel = undefined
|
|
|
+ data.list[i].priceValue = data.list[i].productPrice
|
|
|
}
|
|
|
this.loadDataSource = data.list || []
|
|
|
this.disabled = false
|
|
@@ -441,7 +464,7 @@ export default {
|
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', width: '24%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
// { title: '成本价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
// { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '10%', align: 'center', scopedSlots: { customRender: 'priceLevel' } },
|
|
|
{ title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '调出数量', scopedSlots: { customRender: 'qty' }, width: '6%', align: 'center' },
|
|
|
{ title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -452,7 +475,7 @@ export default {
|
|
|
}
|
|
|
if (this.$hasPermissions('M_transferOut_edit_salesPrice')) { // 售价权限
|
|
|
const ind = this.$hasPermissions('M_transferOut_edit_costPrice') ? 5 : 4
|
|
|
- arr.splice(ind, 0, { title: '售价', dataIndex: 'productPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ arr.splice(ind, 0, { title: '售价', dataIndex: 'productPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'productPriceInfo' } })
|
|
|
}
|
|
|
return arr
|
|
|
},
|
|
@@ -578,6 +601,7 @@ export default {
|
|
|
},
|
|
|
// 添加/编辑
|
|
|
handleAdd (row, isEdit, isRefresh) {
|
|
|
+ debugger
|
|
|
const params = {
|
|
|
id: isEdit ? row.id : undefined,
|
|
|
allocateSn: this.$route.params.sn,
|
|
@@ -656,6 +680,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 价格等级
|
|
|
+ handlePriceLevel (val, pos) {
|
|
|
+ this.loadDataSource[pos].productPrice = val == 'PROVINCE' ? this.loadDataSource[pos].provincePrice : val == 'CITY' ? this.loadDataSource[pos].cityPrice : this.loadDataSource[pos].specialPrice
|
|
|
+ },
|
|
|
// 提交
|
|
|
handleOpen () {
|
|
|
if (this.localDataSource.length) {
|