|
@@ -111,8 +111,25 @@
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="chooseColumns"
|
|
:columns="chooseColumns"
|
|
:data="chooseLoadData"
|
|
:data="chooseLoadData"
|
|
- :scroll="{ x: 1090, y: 300 }"
|
|
|
|
|
|
+ :scroll="{ x: 1160, y: 300 }"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <!-- 售价 -->
|
|
|
|
+ <template slot="price" slot-scope="text, record, index">{{ record.provincePrice }}
|
|
|
|
+ <a-select
|
|
|
|
+ size="small"
|
|
|
|
+ id="allocateBillEdit-price"
|
|
|
|
+ option-label-prop="label"
|
|
|
|
+ v-model="record.price"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ @change="e => priceChange(e, record)"
|
|
|
|
+ @focus="e => priceFocus(record, index)"
|
|
|
|
+ style="width: 100%;">
|
|
|
|
+ <a-select-option v-if="record.cost" :value="record.cost" :label="record.cost">成本 {{ record.cost }}</a-select-option>
|
|
|
|
+ <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].provincePrice" :value="loadDataSource[index].provincePrice" :label="loadDataSource[index].provincePrice">A价 {{ loadDataSource[index].provincePrice }}</a-select-option>
|
|
|
|
+ <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].cityPrice" :value="loadDataSource[index].cityPrice" :label="loadDataSource[index].cityPrice">B价 {{ loadDataSource[index].cityPrice }}</a-select-option>
|
|
|
|
+ <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].specialPrice" :value="loadDataSource[index].specialPrice" :label="loadDataSource[index].specialPrice">C价 {{ loadDataSource[index].specialPrice }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </template>
|
|
<!-- 调出数量 -->
|
|
<!-- 调出数量 -->
|
|
<template slot="qty" slot-scope="text, record">
|
|
<template slot="qty" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
@@ -125,15 +142,6 @@
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
@blur="e => qtyBlur(e.target.value, record)"
|
|
@blur="e => qtyBlur(e.target.value, record)"
|
|
style="width: 100%;" />
|
|
style="width: 100%;" />
|
|
- <!-- <a-select
|
|
|
|
- id="allocateBillEdit-qty"
|
|
|
|
- option-label-prop="label"
|
|
|
|
- v-model="record.qty"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- style="width: 100%;">
|
|
|
|
- <a-select-option v-if="record.price" :value="record.price" :label="record.price">成本价{{ record.price }}</a-select-option>
|
|
|
|
- <a-select-option v-if="record.totalCost" :value="record.totalCost" :label="record.totalCost">A价{{ record.totalCost }}</a-select-option>
|
|
|
|
- </a-select> -->
|
|
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -165,6 +173,7 @@
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import { queryStockProductPage } from '@/api/stock'
|
|
import { queryStockProductPage } from '@/api/stock'
|
|
|
|
+import { productPriceInfo } from '@/api/product'
|
|
import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert } from '@/api/allocateBill'
|
|
import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert } from '@/api/allocateBill'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, ImportGuideModal },
|
|
components: { STable, VSelect, ImportGuideModal },
|
|
@@ -197,10 +206,12 @@ export default {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
|
|
+ this.loadDataSource = data.list || []
|
|
this.disabled = false
|
|
this.disabled = false
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ loadDataSource: [],
|
|
localDataSource: [],
|
|
localDataSource: [],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
chooseLoadData: parameter => {
|
|
chooseLoadData: parameter => {
|
|
@@ -214,8 +225,9 @@ export default {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].qtyBackups = data.list[i].qty
|
|
data.list[i].qtyBackups = data.list[i].qty
|
|
|
|
+ data.list[i].priceBackups = data.list[i].price
|
|
}
|
|
}
|
|
- this.localDataSource = data.list
|
|
|
|
|
|
+ this.localDataSource = data.list || []
|
|
this.chooseDisabled = false
|
|
this.chooseDisabled = false
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
@@ -247,7 +259,7 @@ export default {
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '原厂编码', dataIndex: 'productEntity.origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'productEntity.origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '售价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '售价', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
|
|
{ title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
|
|
{ title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -303,10 +315,14 @@ export default {
|
|
}
|
|
}
|
|
if (isEdit) { // 编辑
|
|
if (isEdit) { // 编辑
|
|
// 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
// 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
- if (!row.qty || row.qty == row.qtyBackups) {
|
|
|
|
|
|
+ if (!row.qty) {
|
|
row.qty = row.qtyBackups
|
|
row.qty = row.qtyBackups
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if (!row.price) {
|
|
|
|
+ row.price = row.priceBackups
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.spinning = true
|
|
this.spinning = true
|
|
allocateBillDetailSave(params).then(res => {
|
|
allocateBillDetailSave(params).then(res => {
|
|
@@ -316,7 +332,6 @@ export default {
|
|
this.$refs.chooseTable.refresh()
|
|
this.$refs.chooseTable.refresh()
|
|
this.spinning = false
|
|
this.spinning = false
|
|
} else {
|
|
} else {
|
|
- row.qty = row.qtyBackups
|
|
|
|
this.spinning = false
|
|
this.spinning = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -395,6 +410,25 @@ export default {
|
|
this.handleAdd(record, 'edit')
|
|
this.handleAdd(record, 'edit')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 已选产品 售价 change
|
|
|
|
+ priceChange (val, record) {
|
|
|
|
+ // 光标移出,值发生改变再调用编辑接口
|
|
|
|
+ if (val != record.priceBackups) {
|
|
|
|
+ this.handleAdd(record, 'edit')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 获取价格
|
|
|
|
+ priceFocus (row, index) {
|
|
|
|
+ if (row.productSn) {
|
|
|
|
+ productPriceInfo({ sn: row.productSn }).then(res => {
|
|
|
|
+ if (res.status == 200 && res.data) {
|
|
|
|
+ this.loadDataSource[index].provincePrice = res.data.provincePrice || undefined
|
|
|
|
+ this.loadDataSource[index].cityPrice = res.data.cityPrice || undefined
|
|
|
|
+ this.loadDataSource[index].specialPrice = res.data.specialPrice || undefined
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 打印预览/快捷打印
|
|
// 打印预览/快捷打印
|
|
handlePrint (type) {
|
|
handlePrint (type) {
|
|
const _this = this
|
|
const _this = this
|