|
@@ -127,24 +127,6 @@ export default {
|
|
showCost: false,
|
|
showCost: false,
|
|
printOrgCode: false, // 打印原创编码
|
|
printOrgCode: false, // 打印原创编码
|
|
showOutInModal: false,
|
|
showOutInModal: false,
|
|
- // 表头
|
|
|
|
- columns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
|
|
|
|
- { title: '售价', dataIndex: 'price', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '折后售价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
|
|
- ],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
@@ -178,6 +160,45 @@ export default {
|
|
detailData: null // 详情数据
|
|
detailData: null // 详情数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ // 是否自建单据
|
|
|
|
+ isOwerEdit () {
|
|
|
|
+ return this.detailData && this.detailData.salesBillSource == 'SALES'
|
|
|
|
+ },
|
|
|
|
+ columns () {
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
|
|
|
|
+ { title: '售价', dataIndex: 'price', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '折后售价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ // { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ // { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
|
|
+ ]
|
|
|
|
+ // 实际总成本
|
|
|
|
+ if (this.showCost) {
|
|
|
|
+ arr.splice(4, 0, { slots: { title: 'costTitle' }, dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ } else {
|
|
|
|
+ arr.splice(4, 1)
|
|
|
|
+ }
|
|
|
|
+ // 下级创建,不显示仓库仓位
|
|
|
|
+ if (!this.isOwerEdit) {
|
|
|
|
+ arr.splice(this.showCost ? 12 : 11, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ } else {
|
|
|
|
+ arr.splice(this.showCost ? 12 : 11, 0, { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ arr.splice(this.showCost ? 13 : 12, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 打印预览/快捷打印
|
|
// 打印预览/快捷打印
|
|
handlePrint (type, printerType) {
|
|
handlePrint (type, printerType) {
|
|
@@ -230,13 +251,6 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- showCost (newValue, oldValue) {
|
|
|
|
- if (newValue) {
|
|
|
|
- this.columns.splice(4, 0, { slots: { title: 'costTitle' }, dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
- } else {
|
|
|
|
- this.columns.splice(4, 1)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
printOrgCode (newValue, oldValue) {
|
|
printOrgCode (newValue, oldValue) {
|
|
localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
|
|
localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
|
|
}
|
|
}
|