|
@@ -13,9 +13,10 @@
|
|
|
<el-button class="el-button--small-yh" type="primary" size="small"
|
|
|
:disabled="form.financeStatus == '已收款' || isSaveBtn" @click="editCustomer">保存数据
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="warning" :disabled="isFinanceBtn" size="small" @click="collection">{{
|
|
|
- form.financeStatus ==
|
|
|
- '已收款' ? '撤销收款' : '收款' }}
|
|
|
+ <el-button class="el-button--small-yh" type="warning" :disabled="isFinanceBtn" size="small"
|
|
|
+ @click="collection">{{
|
|
|
+ form.financeStatus ==
|
|
|
+ '已收款' ? '撤销收款' : '收款' }}
|
|
|
</el-button>
|
|
|
<!-- <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id">启用
|
|
|
</el-button> -->
|
|
@@ -24,24 +25,12 @@
|
|
|
<div style="margin-top: 50px">
|
|
|
<trade-card title="基础信息">
|
|
|
<avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
- <!--<template slot-scope="scope" slot="corpId">-->
|
|
|
- <!-- <el-select v-model="form.corpId" placeholder="请选择">-->
|
|
|
- <!-- <el-option-->
|
|
|
- <!-- v-for="item in corpIdData"-->
|
|
|
- <!-- :key="item.id"-->
|
|
|
- <!-- :label="item.cname"-->
|
|
|
- <!-- :value="item.id">-->
|
|
|
- <!-- </el-option>-->
|
|
|
- <!-- </el-select>-->
|
|
|
- <!--</template>-->
|
|
|
- <!--<template slot-scope="scope" slot="settlementDate">-->
|
|
|
- <!-- <el-date-picker-->
|
|
|
- <!-- v-model="value1"-->
|
|
|
- <!-- type="date"-->
|
|
|
- <!-- format="yyyy-MM-dd",-->
|
|
|
- <!-- placeholder="选择日期">-->
|
|
|
- <!-- </el-date-picker>-->
|
|
|
- <!--</template>-->
|
|
|
+ <tempalte slot="corpName" slot-scope="{ row }">
|
|
|
+ <dic-select v-model="form.corpName" placeholder="客户" key="id" label="cname" res="records"
|
|
|
+ url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true" :remote="true"
|
|
|
+ dataName="cname" @selectChange="dicChange('corpName', $event)"
|
|
|
+ :disabled="optionForm.disabled"></dic-select>
|
|
|
+ </tempalte>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="明细信息">
|
|
@@ -59,12 +48,14 @@
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="thisAmount">
|
|
|
<el-input-number size="small" v-model="row.thisAmount" :precision="2" :controls="false"
|
|
|
- v-if="row.$cellEdit && row.businesType == 'XS'" @change="thisAmountChange(row)" :max="row.accountsAmount-row.settlmentAmount"></el-input-number>
|
|
|
+ v-if="row.$cellEdit && row.businesType == 'XS'" @change="thisAmountChange(row)"
|
|
|
+ :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
|
|
|
<span v-else>{{ row.thisAmount }}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="thisRefundAmount">
|
|
|
<el-input-number size="small" width="100" v-model="row.thisRefundAmount" :precision="2" :controls="false"
|
|
|
- v-if="row.$cellEdit && row.businesType == 'TKXS'" @change="thisReAmountChange(row)" :max="row.accountsAmount-row.settlmentAmount"></el-input-number>
|
|
|
+ v-if="row.$cellEdit && row.businesType == 'TKXS'" @change="thisReAmountChange(row)"
|
|
|
+ :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
|
|
|
<span v-else>{{ row.thisRefundAmount }}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
@@ -84,9 +75,9 @@
|
|
|
deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="filesList" display
|
|
|
:enumerationValue="35.1"></c-upload>
|
|
|
</div>
|
|
|
- <el-dialog title="导入订单" v-if="billDetailDialog" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog"
|
|
|
- width="80%" :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" top="10vh"
|
|
|
- v-dialog-drag>
|
|
|
+ <el-dialog title="导入订单" v-if="billDetailDialog" append-to-body class="el-dialogDeep"
|
|
|
+ :visible.sync="billDetailDialog" width="80%" :close-on-click-modal="false" :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false" top="10vh" v-dialog-drag>
|
|
|
<bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail"
|
|
|
@importProMent="importProMent">
|
|
|
</bill-detail>
|
|
@@ -99,12 +90,13 @@ import billDetail from "@/components/bill/selectOrderDetailList";
|
|
|
import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
|
|
|
import { getList } from "@/api/collectionSettlement/index.js";
|
|
|
import { skgetKh } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
-
|
|
|
+import dicSelect from "@/components/dicSelect/main";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
components: {
|
|
|
- billDetail
|
|
|
+ billDetail,
|
|
|
+ dicSelect
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -132,17 +124,18 @@ export default {
|
|
|
span: 8,
|
|
|
column: [{
|
|
|
label: '客户',
|
|
|
- prop: "corpId",
|
|
|
- type: 'select',
|
|
|
- remote: true,
|
|
|
- props: {
|
|
|
- label: 'cname',
|
|
|
- value: 'id'
|
|
|
- },
|
|
|
- click: () => {
|
|
|
- this.$refs.form.dicInit()
|
|
|
- },
|
|
|
- dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH',
|
|
|
+ prop: "corpName",
|
|
|
+ // type: 'select',
|
|
|
+ // remote: true,
|
|
|
+ // props: {
|
|
|
+ // label: 'cname',
|
|
|
+ // value: 'id',
|
|
|
+ // res: 'data.records'
|
|
|
+ // },
|
|
|
+ // click: () => {
|
|
|
+ // this.$refs.form.dicInit()
|
|
|
+ // },
|
|
|
+ // dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&cname={{key}}&corpType=KH',
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
@@ -379,22 +372,32 @@ export default {
|
|
|
// this.corpIdData
|
|
|
},
|
|
|
methods: {
|
|
|
- thisAmountChange(row){
|
|
|
- let sum1=0
|
|
|
- let sum2=0
|
|
|
- this.form.settlementItemsList.forEach(e=>{
|
|
|
+ dicChange(name, row) {
|
|
|
+ if (name == 'corpName') {
|
|
|
+ if (row) {
|
|
|
+ this.form.corpId = row.id
|
|
|
+ } else {
|
|
|
+ this.form.corpId = null
|
|
|
+ this.form.corpName = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ thisAmountChange(row) {
|
|
|
+ let sum1 = 0
|
|
|
+ let sum2 = 0
|
|
|
+ this.form.settlementItemsList.forEach(e => {
|
|
|
sum1 += e.thisAmount ? Number(e.thisAmount) : 0;
|
|
|
sum2 += e.thisRefundAmount ? Number(e.thisRefundAmount) : 0;
|
|
|
- this.$set(this.form,'amount',sum1-sum2)
|
|
|
+ this.$set(this.form, 'amount', sum1 - sum2)
|
|
|
})
|
|
|
},
|
|
|
- thisReAmountChange(row){
|
|
|
- let sum1=0
|
|
|
- let sum2=0
|
|
|
- this.form.settlementItemsList.forEach(e=>{
|
|
|
+ thisReAmountChange(row) {
|
|
|
+ let sum1 = 0
|
|
|
+ let sum2 = 0
|
|
|
+ this.form.settlementItemsList.forEach(e => {
|
|
|
sum1 += e.thisAmount ? Number(e.thisAmount) : 0;
|
|
|
sum2 += e.thisRefundAmount ? Number(e.thisRefundAmount) : 0;
|
|
|
- this.$set(this.form,'amount',sum1-sum2)
|
|
|
+ this.$set(this.form, 'amount', sum1 - sum2)
|
|
|
})
|
|
|
},
|
|
|
rowDelBox(row, index) {
|
|
@@ -473,15 +476,15 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
- let sum1=0
|
|
|
- let sum2=0
|
|
|
+ let sum1 = 0
|
|
|
+ let sum2 = 0
|
|
|
list.forEach((item, index) => {
|
|
|
item.contractNumber = item.ordNo;
|
|
|
- item.accountsAmount = item.bsType == "XS"||item.bsType == "GX"?item.totalMoney:item.returnsAmount
|
|
|
+ item.accountsAmount = item.bsType == "XS" || item.bsType == "GX" ? item.totalMoney : item.returnsAmount
|
|
|
item.settlmentAmount = item.paymentAmountTl
|
|
|
- item.businesType=item.bsType
|
|
|
- this.$set(item,'thisAmount',item.bsType=="XS"||item.bsType == "GX"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0)
|
|
|
- this.$set(item,'thisRefundAmount',item.bsType=="TKXS"?(Number(item.returnsAmount) - Number(item.paymentAmountTl)):0)
|
|
|
+ item.businesType = item.bsType
|
|
|
+ this.$set(item, 'thisAmount', item.bsType == "XS" || item.bsType == "GX" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0)
|
|
|
+ this.$set(item, 'thisRefundAmount', item.bsType == "TKXS" ? (Number(item.returnsAmount) - Number(item.paymentAmountTl)) : 0)
|
|
|
// item.thisAmount =item.bsType=="XS"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0
|
|
|
// item.thisRefundAmount =item.bsType=="TKXS"? (Number(item.totalMoney) - Number(item.paymentAmountTl)):0
|
|
|
item.srcParentId = item.id
|
|
@@ -492,9 +495,9 @@ export default {
|
|
|
delete item.ordNo;
|
|
|
this.$refs.formContacts.rowCellAdd(item);
|
|
|
//计算主表金额
|
|
|
- sum1+=item.bsType=="XS"||item.bsType == "GX"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0
|
|
|
- sum2+=item.bsType=="TKXS"? (Number(item.totalMoney) - Number(item.paymentAmountTl)):0
|
|
|
- this.form.amount=sum1-sum2
|
|
|
+ sum1 += item.bsType == "XS" || item.bsType == "GX" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0
|
|
|
+ sum2 += item.bsType == "TKXS" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0
|
|
|
+ this.form.amount = sum1 - sum2
|
|
|
})
|
|
|
//明细列表所有合同号 去重 加, 为主表合同号
|
|
|
// this.$set(this.form,'srcOrderno',Array.from(new Set(this.dataList.map(item =>{ return item.srcOrderno}))).join(','))
|
|
@@ -510,7 +513,7 @@ export default {
|
|
|
...this.form,
|
|
|
dc: 'd',
|
|
|
billType: 'SK',
|
|
|
- corpName: this.form.$corpId,
|
|
|
+ // corpName: this.form.$corpId,
|
|
|
accountName: this.form.$accountId,
|
|
|
filesList: this.filesList
|
|
|
}
|
|
@@ -561,7 +564,7 @@ export default {
|
|
|
...this.form,
|
|
|
dc: 'd',
|
|
|
billType: 'SK',
|
|
|
- corpName: this.form.$corpId
|
|
|
+ // corpName: this.form.$corpId
|
|
|
}
|
|
|
saveSubmit(data).then(res => {
|
|
|
loading.close()
|