|
@@ -118,7 +118,7 @@
|
|
|
<avue-crud
|
|
|
:option="customerContact"
|
|
|
v-model="contactsForm"
|
|
|
- :data="contactsData"
|
|
|
+ :data="goodsShowData"
|
|
|
ref="crudContact"
|
|
|
@row-save="rowSave"
|
|
|
@row-click="handleRowClick"
|
|
@@ -149,13 +149,12 @@
|
|
|
>删 除</el-button>
|
|
|
</template>
|
|
|
<template slot="menuLeft" slot-scope="{size}">
|
|
|
-<!-- <el-button type="primary"-->
|
|
|
-<!-- icon="el-icon-plus"-->
|
|
|
-<!-- size="small"-->
|
|
|
-<!-- @click="commoditySelection"-->
|
|
|
-<!-- :disabled="detailData.seeDisabled"-->
|
|
|
-<!-- >录入明细-->
|
|
|
-<!-- </el-button>-->
|
|
|
+ <el-tabs v-model="goodsActives" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
<el-button type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
@@ -753,6 +752,12 @@ export default {
|
|
|
rowHeight: '',
|
|
|
// 查询时loading页面
|
|
|
pageLoading: false,
|
|
|
+ goodsActives: 'goods',
|
|
|
+ goodsDisabled: false,
|
|
|
+ // 赠品信息数据
|
|
|
+ giftData: [],
|
|
|
+ // 商品信息展示数据
|
|
|
+ goodsShowData: [],
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -815,7 +820,29 @@ export default {
|
|
|
delete this.form.createTime
|
|
|
delete this.form.id
|
|
|
delete this.form.sysNo
|
|
|
- this.contactsData = this.form.orderItemsList
|
|
|
+ this.contactsData = this.form.orderItemsList.filter(item => {
|
|
|
+ return item.goodType == 0
|
|
|
+ })
|
|
|
+ this.giftData = this.form.orderItemsList.filter(item => {
|
|
|
+ return item.goodType == 1
|
|
|
+ })
|
|
|
+ this.giftData.forEach(item => {
|
|
|
+ this.$set(item, 'deliveryAmount', item.amount)
|
|
|
+ this.$set(item, 'specificationAndModel', item.itemType)
|
|
|
+ this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
|
|
|
+ this.$set(item, "srcId", item.id)
|
|
|
+ delete item.id
|
|
|
+ delete item.pid
|
|
|
+ delete item.createTime
|
|
|
+ delete item.createUser
|
|
|
+ delete item.status
|
|
|
+ delete item.updateTime
|
|
|
+ delete item.updateUser
|
|
|
+ })
|
|
|
+ this.goodsShowData = this.giftData;
|
|
|
+ this.goodsActives = 'goods';
|
|
|
+ this.handleClick({name: this.goodsActives})
|
|
|
+ // this.contactsData = this.form.orderItemsList
|
|
|
delete this.form.orderItemsList
|
|
|
this.configuration.dicData = this.form.corpName
|
|
|
delete this.form.corpName
|
|
@@ -859,6 +886,11 @@ export default {
|
|
|
this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
|
|
|
delete item.id
|
|
|
delete item.pid
|
|
|
+ delete item.createTime
|
|
|
+ delete item.createUser
|
|
|
+ delete item.status
|
|
|
+ delete item.updateTime
|
|
|
+ delete item.updateUser
|
|
|
})
|
|
|
} else if (this.detailData.copyId) {
|
|
|
let id = this.detailData.copyId
|
|
@@ -870,9 +902,20 @@ export default {
|
|
|
methods: {
|
|
|
queryData(id, isCopy = false) {
|
|
|
detail(id).then(res => {
|
|
|
- console.log(res.data.data)
|
|
|
this.form = res.data.data;
|
|
|
- this.contactsData = this.form.deliveryItemsList
|
|
|
+ // this.contactsData = this.form.deliveryItemsList
|
|
|
+ this.contactsData = this.form.deliveryItemsList.filter(item => {
|
|
|
+ return item.goodType == 0
|
|
|
+ })
|
|
|
+ this.giftData = this.form.deliveryItemsList.filter(item => {
|
|
|
+ return item.goodType == 1
|
|
|
+ })
|
|
|
+ this.giftData.forEach(item => {
|
|
|
+ this.$set(item, 'deliveryAmount', item.amount)
|
|
|
+ })
|
|
|
+ this.goodsShowData = this.giftData;
|
|
|
+ this.goodsActives = 'goods';
|
|
|
+ this.handleClick({name: this.goodsActives})
|
|
|
this.advantageProjectData = this.form.deliveryFeesList
|
|
|
this.bankOfDepositData = this.form.deliveryFilesList
|
|
|
this.configuration.dicData = this.form.corpName
|
|
@@ -1322,15 +1365,15 @@ export default {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
//商品信息
|
|
|
- this.form.deliveryItemsList = this.contactsData
|
|
|
+ this.contactsData.forEach(item => {
|
|
|
+ this.$set(item, 'contractAmount', item.deliveryAmount)
|
|
|
+ })
|
|
|
+ this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
this.form.deliveryFeesList = this.advantageProjectData
|
|
|
this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
if (typeof this.form.corpsTypeId == 'object') {
|
|
|
this.form.corpsTypeId = this.form.corpsTypeId.join(",")
|
|
|
}
|
|
|
- this.contactsData.forEach(item => {
|
|
|
- this.$set(item, 'contractAmount', item.deliveryAmount)
|
|
|
- })
|
|
|
this.saveLoading = true
|
|
|
this.form.billType = 'FH'
|
|
|
typeSave(this.form).then(res => {
|
|
@@ -1344,7 +1387,7 @@ export default {
|
|
|
}
|
|
|
if (type == '发货') {
|
|
|
this.$nextTick(() => {
|
|
|
- this.form.deliveryItemsList = this.contactsData
|
|
|
+ this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
this.form.deliveryFeesList = this.advantageProjectData
|
|
|
this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
if (typeof this.form.corpsTypeId == 'object') {
|
|
@@ -1414,7 +1457,7 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
//商品信息
|
|
|
- this.form.deliveryItemsList = this.contactsData
|
|
|
+ this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
|
|
|
this.form.deliveryFeesList = this.advantageProjectData
|
|
|
this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
if (typeof this.form.corpsTypeId == 'object') {
|
|
@@ -1461,7 +1504,11 @@ export default {
|
|
|
list.forEach(item => {
|
|
|
item.cname = item.cname
|
|
|
this.$set(item, 'specificationAndModel', item.itemType)
|
|
|
- this.$set(item, 'deliveryAmount', item.amount)
|
|
|
+ if (this.goodsActives == 'goods') {
|
|
|
+ this.$set(item, 'deliveryAmount', item.amount)
|
|
|
+ } else {
|
|
|
+ this.$set(item, 'deliveryAmount', 0)
|
|
|
+ }
|
|
|
this.$set(item, 'actualQuantity', item.orderQuantity)
|
|
|
this.$set(item, 'inventoryNumber', item.storageQuantity)
|
|
|
delete item.id
|
|
@@ -1526,6 +1573,47 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 商品信息标签页切换
|
|
|
+ handleClick(data) {
|
|
|
+ this.goodsDisabled = true
|
|
|
+ if (data.name == 'goods') {
|
|
|
+ this.giftData = this.goodsShowData
|
|
|
+ // 显示
|
|
|
+ this.customerContact.column.forEach(item => {
|
|
|
+ if (item.prop == 'deliveryAmount') item.label = '出库金额'
|
|
|
+ if (item.prop == 'actualQuantity') item.label = '出库数量'
|
|
|
+ if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
|
|
|
+ || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight'
|
|
|
+ || item.prop == 'inventoryNumber' || item.prop == 'inventoryAmount'
|
|
|
+ ) {
|
|
|
+ item.hide = false;
|
|
|
+ item.showColumn = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.goodsShowData = this.contactsData;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.goodsDisabled = false
|
|
|
+ },500)
|
|
|
+ } else {
|
|
|
+ // 隐藏字段
|
|
|
+ this.contactsData = this.goodsShowData
|
|
|
+ this.customerContact.column.forEach(item => {
|
|
|
+ if (item.prop == 'deliveryAmount') item.label = '积分'
|
|
|
+ if (item.prop == 'actualQuantity') item.label = '数量'
|
|
|
+ if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
|
|
|
+ || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight' || item.prop == 'inventoryNumber'
|
|
|
+ || item.prop == 'inventoryAmount'
|
|
|
+ ) {
|
|
|
+ item.hide = true;
|
|
|
+ item.showColumn = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.goodsShowData = this.giftData;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.goodsDisabled = false
|
|
|
+ },500)
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|