|
|
@@ -140,7 +140,7 @@
|
|
|
<selectComponent v-if="row.$cellEdit" v-model="row.corpId"
|
|
|
:configuration="configuration" @receiveList="receiveList"/>
|
|
|
<span v-else>
|
|
|
- <span v-for="item in corpNameOption" v-if="item.id == row.corpId">{{ item.cname }}</span>
|
|
|
+ <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
|
|
|
</span>
|
|
|
</template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
@@ -170,6 +170,7 @@
|
|
|
@row-save="rowSaveBankOfDeposit"
|
|
|
@row-update="rowUpdateBankOfDeposit"
|
|
|
@row-del="rowDelBankOfDeposit"
|
|
|
+ :upload-after="uploadAfter"
|
|
|
></avue-crud>
|
|
|
</basic-container>
|
|
|
</el-form>
|
|
|
@@ -470,6 +471,11 @@ import _ from "lodash";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
disabled: false,
|
|
|
@@ -979,7 +985,8 @@ export default {
|
|
|
},
|
|
|
paymentOption: [],
|
|
|
statusOption: [],
|
|
|
- corpNameOption: [],
|
|
|
+ // 费用信息排序的最大值
|
|
|
+ maxFeeNum: 0,
|
|
|
}
|
|
|
},
|
|
|
//初始化查询
|
|
|
@@ -991,28 +998,28 @@ export default {
|
|
|
this.statusOption = res.data.data
|
|
|
})
|
|
|
this.$set(this.form, 'orderStatus', '录入')
|
|
|
- if (this.$route.query.id) {
|
|
|
- let id = this.$route.query.id.replace(/\"/g, "")
|
|
|
- this.queryData(id)
|
|
|
+ if (this.detailData.id) {
|
|
|
+ // let id = this.$route.query.id.replace(/\"/g, "")
|
|
|
+ this.queryData(this.detailData.id)
|
|
|
}
|
|
|
- if (this.$route.query.copyId) {
|
|
|
- let id = this.$route.query.copyId.replace(/\"/g, "")
|
|
|
- this.queryData(id, true)
|
|
|
+ if (this.detailData.copyId) {
|
|
|
+ // let id = this.$route.query.copyId.replace(/\"/g, "")
|
|
|
+ this.queryData(this.detailData.copyId, true)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- '$route'(to, from) {
|
|
|
- console.log(to, from);
|
|
|
- if (this.$route.query.id) {
|
|
|
- let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
|
|
|
- detail(id).then(res => {
|
|
|
- console.log(res.data.data)
|
|
|
- this.form = res.data.data;
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.form = {}
|
|
|
- }
|
|
|
- }
|
|
|
+ // '$route'(to, from) {
|
|
|
+ // console.log(to, from);
|
|
|
+ // if (this.$route.query.id) {
|
|
|
+ // let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
|
|
|
+ // detail(id).then(res => {
|
|
|
+ // console.log(res.data.data)
|
|
|
+ // this.form = res.data.data;
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.form = {}
|
|
|
+ // }
|
|
|
+ // },
|
|
|
},
|
|
|
methods: {
|
|
|
queryData(id, isCopy = false){
|
|
|
@@ -1035,12 +1042,25 @@ export default {
|
|
|
feesData.push(a)
|
|
|
})
|
|
|
this.configuration.dicData = this.configuration.dicData.concat(feesData)
|
|
|
- this.corpNameOption = this.configuration.dicData
|
|
|
+ // 去重
|
|
|
+ this.removeRepeat()
|
|
|
delete this.form.orderItemsList
|
|
|
delete this.form.orderFeesList
|
|
|
delete this.form.orderFilesList
|
|
|
delete this.form.corpName
|
|
|
delete this.form.belongToCorpList
|
|
|
+ // 获取最大值
|
|
|
+ let num = []
|
|
|
+ this.advantageProjectData.forEach(item => {
|
|
|
+ num.push(item.sort)
|
|
|
+ })
|
|
|
+ if (num.length == 0) {
|
|
|
+ this.maxFeeNum = 0;
|
|
|
+ } else {
|
|
|
+ this.maxFeeNum = num.reduce((a, b) => {
|
|
|
+ return b > a? b: a;
|
|
|
+ })
|
|
|
+ }
|
|
|
if (isCopy) {
|
|
|
delete this.form.id
|
|
|
this.contactsData.forEach(item => {
|
|
|
@@ -1117,7 +1137,7 @@ export default {
|
|
|
generateShipment(data).then(res => {
|
|
|
console.log(res.data.data)
|
|
|
this.$router.push({
|
|
|
- path: "deliveryNotice_detailsPageEdit",
|
|
|
+ path: "/businessManagement/deliveryNotice/index",
|
|
|
query: {form: JSON.stringify(res.data.data)},
|
|
|
});
|
|
|
})
|
|
|
@@ -1133,10 +1153,18 @@ export default {
|
|
|
console.log(row)
|
|
|
this.choiceIndex = row.$index
|
|
|
},
|
|
|
+ // 去重
|
|
|
+ removeRepeat() {
|
|
|
+ let obj = []
|
|
|
+ this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
|
|
|
+ obj[next.id] ? '': obj[next.id] = true && current.push(next)
|
|
|
+ return current
|
|
|
+ }, [])
|
|
|
+ },
|
|
|
//
|
|
|
receiveList(data){
|
|
|
- console.log(data)
|
|
|
- this.corpNameOption = this.corpNameOption.concat(data)
|
|
|
+ this.configuration.dicData = this.configuration.dicData.concat(data)
|
|
|
+ this.removeRepeat()
|
|
|
},
|
|
|
//点击商品明细选择触发
|
|
|
commodityChoice(row) {
|
|
|
@@ -1180,6 +1208,8 @@ export default {
|
|
|
console.log(this.tableDataCost[item])
|
|
|
this.tableDataCost[item].itemId = this.tableDataCost[item].id
|
|
|
this.tableDataCost[item].feeName = this.tableDataCost[item].cname
|
|
|
+ this.tableDataCost[item].sort = this.maxFeeNum + 1
|
|
|
+ this.maxFeeNum++
|
|
|
delete this.tableDataCost[item].id
|
|
|
this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
|
|
|
this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
|
|
|
@@ -1423,6 +1453,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ uploadAfter(res, done) {
|
|
|
+ if (res.originalName) {
|
|
|
+ this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
|
|
|
+ ? this.bankOfDepositForm.fileName
|
|
|
+ : res.originalName;
|
|
|
+ }
|
|
|
+ done();
|
|
|
+ },
|
|
|
//修改提交触发
|
|
|
editCustomer(isBack = false) {
|
|
|
console.log(this.form)
|
|
|
@@ -1442,11 +1480,7 @@ export default {
|
|
|
this.disabled = false
|
|
|
if (isBack) {
|
|
|
//成功关闭此页面回到列表页
|
|
|
- this.$router.$avueRouter.closeTag();
|
|
|
- this.$router.push({
|
|
|
- path: '/businessManagement/salesOrder/index',
|
|
|
- query: {}
|
|
|
- });
|
|
|
+ this.$emit("goBack");
|
|
|
} else {
|
|
|
this.queryData(res.data.data.id)
|
|
|
}
|
|
|
@@ -1494,11 +1528,12 @@ export default {
|
|
|
}).then(() => {
|
|
|
this.editCustomer(true)
|
|
|
}).catch(() => {
|
|
|
- this.$router.$avueRouter.closeTag();
|
|
|
- this.$router.push({
|
|
|
- path: '/businessManagement/salesOrder/index',
|
|
|
- query: {}
|
|
|
- });
|
|
|
+ // this.$router.$avueRouter.closeTag();
|
|
|
+ // this.$router.push({
|
|
|
+ // path: '/businessManagement/salesOrder/index',
|
|
|
+ // query: {}
|
|
|
+ // });
|
|
|
+ this.$emit("goBack");
|
|
|
})
|
|
|
}
|
|
|
}
|