|
@@ -9,7 +9,7 @@
|
|
|
</div>
|
|
|
<el-button
|
|
|
class="el-button--small-yh add-customer-btn"
|
|
|
- type="success" style="right: 140px;">
|
|
|
+ type="success" style="right: 140px;" @click="copyOrder">
|
|
|
复制新单
|
|
|
</el-button>
|
|
|
<el-button
|
|
@@ -30,6 +30,9 @@
|
|
|
size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"
|
|
|
:configuration="configuration"/>
|
|
|
+ <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%">
|
|
|
+ <el-option v-for="(item,index) in paymentOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
|
|
|
+ </el-select>
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -42,7 +45,8 @@
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
<el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
<selectComponent v-else-if="item.prop === 'belongToCorpId'" v-model="form[item.prop]" :configuration="configuration"/>
|
|
|
- <el-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
|
|
|
+ <el-input v-else-if="(item.prop === 'advancePayment') || (item.prop === 'settlmentAmount')" v-model="form[item.prop]" size="small" autocomplete="off" @change="computedCost"></el-input>
|
|
|
+ <el-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -64,6 +68,26 @@
|
|
|
<span style="float: left;padding-top: 2px">{{ row.code }}</span>
|
|
|
<el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
|
|
|
</template>
|
|
|
+ <template slot="orderQuantity" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.orderQuantity"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="quantityChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.orderQuantity }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="price" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.price"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="priceChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.price }}</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -146,7 +170,8 @@
|
|
|
width="80%"
|
|
|
:close-on-click-modal="false"
|
|
|
:destroy-on-close="true"
|
|
|
- :close-on-press-escape="false">
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ @close="closeGoods">
|
|
|
<el-row style="height: 0;">
|
|
|
<el-col :span="5">
|
|
|
<div>
|
|
@@ -186,7 +211,8 @@
|
|
|
width="80%"
|
|
|
:close-on-click-modal="false"
|
|
|
:destroy-on-close="true"
|
|
|
- :close-on-press-escape="false">
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ @close="closePolicy">
|
|
|
<el-row style="height: 0;">
|
|
|
<el-col :span="5">
|
|
|
<div>
|
|
@@ -234,7 +260,8 @@
|
|
|
top="8vh"
|
|
|
:close-on-click-modal="false"
|
|
|
:destroy-on-close="true"
|
|
|
- :close-on-press-escape="false">
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ @close="closeFees">
|
|
|
<el-row style="height: 0;">
|
|
|
<el-col :span="5">
|
|
|
<div>
|
|
@@ -410,6 +437,7 @@ import {
|
|
|
corpsfiles,
|
|
|
corpsitem,
|
|
|
getList,
|
|
|
+ getGoodsList,
|
|
|
detailList,
|
|
|
generateShipment
|
|
|
} from "@/api/basicData/configuration"
|
|
@@ -427,6 +455,7 @@ import {
|
|
|
policyList,
|
|
|
policyColumn
|
|
|
} from "@/api/basicData/basicFeesDesc";
|
|
|
+import _ from "lodash";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
@@ -453,6 +482,7 @@ export default {
|
|
|
dialogCost: false,
|
|
|
treeDeptId: '',
|
|
|
treeDeptIdCost: '',
|
|
|
+ treePolicyId: '',
|
|
|
pageCost: {
|
|
|
pageSize: 10,
|
|
|
currentPage: 1,
|
|
@@ -597,7 +627,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '单据状态',
|
|
|
- prop: 'status1',
|
|
|
+ prop: 'status',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -637,7 +667,8 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '应收未收款',
|
|
|
- prop: 'settlmentAmount',//无
|
|
|
+ prop: 'accountsReceivable',//无
|
|
|
+ disabled: true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -926,7 +957,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ paymentOption: [],
|
|
|
}
|
|
|
},
|
|
|
//初始化查询
|
|
@@ -935,6 +967,13 @@ export default {
|
|
|
let id = this.$route.query.id.replace(/\"/g, "")
|
|
|
this.queryData(id)
|
|
|
}
|
|
|
+ if (this.$route.query.copyId) {
|
|
|
+ let id = this.$route.query.copyId.replace(/\"/g, "")
|
|
|
+ this.queryData(id, true)
|
|
|
+ }
|
|
|
+ this.getWorkDicts("payment_term").then(res => {
|
|
|
+ this.paymentOption = res.data.data
|
|
|
+ })
|
|
|
},
|
|
|
watch: {
|
|
|
'$route'(to, from) {
|
|
@@ -951,7 +990,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- queryData(id){
|
|
|
+ queryData(id, isCopy = false){
|
|
|
detail(id).then(res => {
|
|
|
console.log(res.data.data)
|
|
|
this.form = res.data.data;
|
|
@@ -959,15 +998,35 @@ export default {
|
|
|
this.advantageProjectData = this.form.orderFeesList
|
|
|
this.bankOfDepositData = this.form.orderFilesList
|
|
|
this.configuration.dicData = this.form.corpName
|
|
|
- delete this.form.orderItemsList
|
|
|
+ this.configuration.dicData = this.configuration.dicData.concat(this.form.belongToCorpList)
|
|
|
+ // delete this.form.orderItemsList
|
|
|
delete this.form.orderFeesList
|
|
|
delete this.form.orderFilesList
|
|
|
delete this.form.corpName
|
|
|
+ delete this.form.belongToCorpList
|
|
|
+ if (isCopy) {
|
|
|
+ delete this.form.id
|
|
|
+ this.contactsData.forEach(item => {
|
|
|
+ delete item.id
|
|
|
+ delete item.pid
|
|
|
+ })
|
|
|
+ this.advantageProjectData.forEach(item => {
|
|
|
+ delete item.id
|
|
|
+ delete item.pid
|
|
|
+ })
|
|
|
+ this.bankOfDepositData.forEach(item => {
|
|
|
+ delete item.id
|
|
|
+ delete item.pid
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
+ // 复制新单
|
|
|
+ copyOrder() {
|
|
|
+ this.queryData(this.form.id, true)
|
|
|
+ },
|
|
|
//点击行可编辑
|
|
|
handleRowClick(row, event, column) {
|
|
|
- console.log(row.$index)
|
|
|
},
|
|
|
//商品编辑
|
|
|
rowCell(row, index) {
|
|
@@ -977,7 +1036,7 @@ export default {
|
|
|
//费用编辑
|
|
|
rowCellTwo(row, index) {
|
|
|
console.log(row)
|
|
|
- this.$refs.crudProject.rowCellTwo(row, index)
|
|
|
+ this.$refs.crudProject.rowCell(row, index)
|
|
|
},
|
|
|
//费用新增触发
|
|
|
costIncrease() {
|
|
@@ -1046,6 +1105,7 @@ export default {
|
|
|
},
|
|
|
//导入商品触发
|
|
|
importChoice() {
|
|
|
+ // this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
if (this.tableData.length === 1) {
|
|
|
this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
|
|
|
this.contactsData[this.choiceIndexT].code = this.tableData[0].code
|
|
@@ -1059,7 +1119,6 @@ export default {
|
|
|
},
|
|
|
//费用编辑导入触发
|
|
|
choiceCost() {
|
|
|
- console.log('1111')
|
|
|
if (this.tableDataCost.length === 1) {
|
|
|
this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
|
|
|
this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
|
|
@@ -1070,7 +1129,6 @@ export default {
|
|
|
},
|
|
|
//费用导入触发
|
|
|
importCost() {
|
|
|
- console.log('111111')
|
|
|
// this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
|
|
|
if (this.tableDataCost.length > 0) {
|
|
|
for (let item in this.tableDataCost) {
|
|
@@ -1102,14 +1160,25 @@ export default {
|
|
|
this.tableData = []
|
|
|
this.dialogVisible = false
|
|
|
},
|
|
|
+ closeGoods() {
|
|
|
+ this.tableData = [];
|
|
|
+ this.treeDeptId = "";
|
|
|
+ },
|
|
|
+ closeFees() {
|
|
|
+ this.treeDeptIdCost = "";
|
|
|
+ this.treeData = [];
|
|
|
+ },
|
|
|
+ closePolicy() {
|
|
|
+ this.treePolicyId = '';
|
|
|
+ this.dataPolicy = [];
|
|
|
+ this.contactsDataBuyFree = [];
|
|
|
+ },
|
|
|
//选中触发
|
|
|
selectionChange(list) {
|
|
|
- console.log(list);
|
|
|
this.tableData = list
|
|
|
},
|
|
|
//费用选中触发
|
|
|
selectionChangeCost(list) {
|
|
|
- console.log(list);
|
|
|
this.tableDataCost = list
|
|
|
},
|
|
|
//导入页左商品类型查询
|
|
@@ -1120,14 +1189,14 @@ export default {
|
|
|
},
|
|
|
//导入页销售政策查询
|
|
|
policyNodeClick(data) {
|
|
|
- console.log(data.id)
|
|
|
- detailList(data.id).then(res => {
|
|
|
- console.log(res.data.data)
|
|
|
- //特价促销
|
|
|
- this.dataPolicy = res.data.data.specialItemList
|
|
|
- //买赠促销
|
|
|
- this.contactsDataBuyFree = res.data.data.presentItemList
|
|
|
- })
|
|
|
+ this.treePolicyId = data.id
|
|
|
+ // detailList(data.id).then(res => {
|
|
|
+ // //特价促销
|
|
|
+ // this.dataPolicy = res.data.data.specialItemList
|
|
|
+ // //买赠促销
|
|
|
+ // this.contactsDataBuyFree = res.data.data.presentItemList
|
|
|
+ // })
|
|
|
+ this.policyOnLoad()
|
|
|
},
|
|
|
//导入页左费用类型查询
|
|
|
nodeClickCost(data) {
|
|
@@ -1151,7 +1220,6 @@ export default {
|
|
|
//导入商品政策
|
|
|
importPolicy() {
|
|
|
let list = this.policyData.concat(this.policyDataTwo)
|
|
|
- console.log(list)
|
|
|
for (let item in list) {
|
|
|
console.log(list[item])
|
|
|
this.$refs.crudContact.rowCellAdd(list[item]);
|
|
@@ -1210,10 +1278,19 @@ export default {
|
|
|
rowUpdateProject(row, index, done, loading) {
|
|
|
done(row);
|
|
|
},
|
|
|
+ policyOnLoad(params = {}) {
|
|
|
+ // this.policyLoading = true;
|
|
|
+ detailList(this.treePolicyId).then(res => {
|
|
|
+ //特价促销
|
|
|
+ this.dataPolicy = res.data.data.specialItemList
|
|
|
+ //买赠促销
|
|
|
+ this.contactsDataBuyFree = res.data.data.presentItemList
|
|
|
+ })
|
|
|
+ },
|
|
|
//商品列表查询
|
|
|
onLoad(page, params = {}) {
|
|
|
this.loading = true;
|
|
|
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
|
|
|
+ getGoodsList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
|
|
|
console.log(res)
|
|
|
const data = res.data.data;
|
|
|
this.page.total = data.total;
|
|
@@ -1321,6 +1398,38 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 计算应收未收款
|
|
|
+ computedCost() {
|
|
|
+ // 应收预付款
|
|
|
+ let advancePayment = 0;
|
|
|
+ // 已收款
|
|
|
+ let settlmentAmount = 0;
|
|
|
+ if (this.form.advancePayment) {
|
|
|
+ advancePayment = this.form.advancePayment
|
|
|
+ }
|
|
|
+ if (this.form.settlmentAmount) {
|
|
|
+ settlmentAmount = this.form.settlmentAmount
|
|
|
+ }
|
|
|
+ this.$set(this.form, "accountsReceivable", Number(advancePayment) - Number(settlmentAmount)).toFixed(2);
|
|
|
+ },
|
|
|
+ quantityChange(row) {
|
|
|
+ console.log(row)
|
|
|
+ if (!row.orderQuantity) {
|
|
|
+ row.orderQuantity = 0;
|
|
|
+ } else {
|
|
|
+ // row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
|
|
|
+ this.$set(row,"amount",_.multiply(row.price, row.orderQuantity).toFixed(2))
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ priceChange(row) {
|
|
|
+ if (!row.price) {
|
|
|
+ row.price = 0;
|
|
|
+ } else {
|
|
|
+ // row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
|
|
|
+ this.$set(row,"amount",_.multiply(row.price, row.orderQuantity).toFixed(2))
|
|
|
+ }
|
|
|
+ },
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
this.$router.$avueRouter.closeTag();
|