|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
|
- <div class="jg-page-wrap collectionPayment-wrap">
|
|
|
+ <div class="jg-page-wrap collectionPaymentNew-wrap">
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
- <a-page-header :ghost="false" :backIcon="false" class="collectionPayment-back" >
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="collectionPaymentNew-back" >
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
<span style="margin-right:30px;color: #000;font-size: 14px;font-weight: 600;">客户:{{ $route.params.name!='undefined'?$route.params.name: '--' }}</span>
|
|
|
- <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
|
|
|
+ <a-button id="collectionPayEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
|
|
|
</template>
|
|
|
<template slot="extra" v-if="$hasPermissions('B_cPayment_printAndExport')">
|
|
|
<div style="margin-top: 5px;">
|
|
@@ -17,14 +17,14 @@
|
|
|
</div>
|
|
|
</PrintPanel>
|
|
|
<a-divider type="vertical" />
|
|
|
- <a-button id="salesNewOrderEdit-del-btn" class="button-default" type="link" @click="handleOk([])"><a-icon type="close" />清空单据</a-button>
|
|
|
+ <a-button id="scollectionPayEdit-del-btn" class="button-default" type="link" @click="handleOk([])"><a-icon type="close" />清空单据</a-button>
|
|
|
<a-divider type="vertical" />
|
|
|
- <a-button id="salesNewOrderEdit-add-btn" type="link" @click="openModal=true"><a-icon type="plus" />选择单据</a-button>
|
|
|
+ <a-button id="scollectionPayEdit-add-btn" type="link" @click="openModal=true"><a-icon type="plus" />选择单据</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 已选单据 -->
|
|
|
- <a-card size="small" :bordered="false" class="collectionPayment-cont">
|
|
|
+ <a-card size="small" :bordered="false" class="collectionPaymentNew-cont">
|
|
|
<div class="table-operator">
|
|
|
<div class="alert-message">
|
|
|
共 <strong>{{ chooseLoadData.length }}</strong>条明细 ,
|
|
@@ -53,7 +53,7 @@
|
|
|
<!-- 本次结算金额 -->
|
|
|
<template slot="settleAmount" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="collectionPayment-settleAmount"
|
|
|
+ :id="'collectionPaymentNew-settleAmount-'+record.id"
|
|
|
v-model="record.settleAmount"
|
|
|
:precision="2"
|
|
|
:min="record.unsettleAmount<0 ? record.unsettleAmount : 0"
|
|
@@ -65,15 +65,15 @@
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="collectionPayment-del-btn">移除</a-button>
|
|
|
+ <a-button size="small" type="link" class="button-error" @click="handleDel(record)" :id="'collectionPaymentNew-del-'+record.id">移除</a-button>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</a-card>
|
|
|
- <a-card size="small" :bordered="false" class="collectionPayment-cont">
|
|
|
+ <a-card size="small" :bordered="false" class="collectionPaymentNew-cont">
|
|
|
<a-collapse :activeKey="['1']">
|
|
|
<a-collapse-panel key="1" header="收付款信息">
|
|
|
<a-form-model
|
|
|
- id="collectionPayment-form"
|
|
|
+ id="collectionPaymentNew-form"
|
|
|
ref="ruleForm"
|
|
|
:model="form"
|
|
|
:rules="rules"
|
|
@@ -86,7 +86,7 @@
|
|
|
本次结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
|
|
|
</template>
|
|
|
<a-input-number
|
|
|
- id="collectionPayment-amountSettled"
|
|
|
+ id="collectionPaymentNew-amountSettled"
|
|
|
v-model="form.amountSettled"
|
|
|
@change="amountSettledTotalChange"
|
|
|
:precision="2"
|
|
@@ -98,7 +98,7 @@
|
|
|
<a-col span="12">
|
|
|
<a-form-model-item label="折让金额" prop="discountAmount">
|
|
|
<a-input-number
|
|
|
- id="collectionPayment-discountAmount"
|
|
|
+ id="collectionPaymentNew-discountAmount"
|
|
|
v-model="form.discountAmount"
|
|
|
:precision="2"
|
|
|
:min="0"
|
|
@@ -114,7 +114,7 @@
|
|
|
本次实际结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
|
|
|
</template>
|
|
|
<a-input-number
|
|
|
- id="collectionPayment-actualSettlementAmount"
|
|
|
+ id="collectionPaymentNew-actualSettlementAmount"
|
|
|
v-model="actualSettlementAmount"
|
|
|
disabled
|
|
|
:precision="2"
|
|
@@ -126,7 +126,7 @@
|
|
|
<a-form-model-item label="结算方式" prop="settleStyleSn">
|
|
|
<v-select
|
|
|
code="SETTLE_STYLE"
|
|
|
- id="collectionPayment-settleStyleSn"
|
|
|
+ id="collectionPaymentNew-settleStyleSn"
|
|
|
v-model="form.settleStyleSn"
|
|
|
@change="settleStyleChange"
|
|
|
allowClear
|
|
@@ -137,7 +137,7 @@
|
|
|
<a-col span="12">
|
|
|
<a-form-model-item v-if="enableFundAccount" label="结算账户" prop="settleAccountSn">
|
|
|
<settleAccount
|
|
|
- id="collectionPayment-settleAccountSn"
|
|
|
+ id="collectionPaymentNew-settleAccountSn"
|
|
|
v-model="form.settleAccountSn"
|
|
|
:settleStyleSn="form.settleStyleSn"
|
|
|
@change="settleAccountChange"
|
|
@@ -147,7 +147,7 @@
|
|
|
</a-col>
|
|
|
<a-col span="24">
|
|
|
<a-form-model-item label="备注" prop="remark" :label-col="{ span: 3 }" :wrapper-col="{ span: 20 }">
|
|
|
- <a-textarea id="collectionPayment-remark" :maxLength="100" v-model="form.remark" placeholder="请输入备注(最多100个字符)" allowClear />
|
|
|
+ <a-textarea id="collectionPaymentNew-remark" :maxLength="100" v-model="form.remark" placeholder="请输入备注(最多100个字符)" allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -159,13 +159,14 @@
|
|
|
<div class="affix-cont">
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
- id="collectionPayment-submit"
|
|
|
+ id="collectionPaymentNew-submit"
|
|
|
size="large"
|
|
|
:disabled="spinning"
|
|
|
class="button-primary"
|
|
|
@click="handleSubmit"
|
|
|
style="padding: 0 60px;">提交</a-button>
|
|
|
</div>
|
|
|
+ <!-- 单据选择 -->
|
|
|
<choose-bill-modal
|
|
|
ref="chooseBillModal"
|
|
|
:openModal="openModal"
|
|
@@ -202,8 +203,8 @@ export default {
|
|
|
spinning: false,
|
|
|
loading: false, // 表格加载中
|
|
|
chooseQueryParam: {
|
|
|
- productCode: '',
|
|
|
- productName: ''
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productName: '' // 产品名称
|
|
|
},
|
|
|
// 表头
|
|
|
chooseColumns: [
|
|
@@ -225,13 +226,13 @@ export default {
|
|
|
wrapperCol: { span: 16 }
|
|
|
},
|
|
|
form: {
|
|
|
- amountSettled: 0,
|
|
|
+ amountSettled: 0, // 本次结算金额
|
|
|
discountAmount: 0, // 折让金额
|
|
|
- settleStyleSn: undefined,
|
|
|
- settleClientName: '',
|
|
|
- settleAccountSn: undefined,
|
|
|
- settleAccountName: undefined,
|
|
|
- remark: ''
|
|
|
+ settleStyleSn: undefined, // 结算方式sn
|
|
|
+ settleClientName: '', // 客户名称
|
|
|
+ settleAccountSn: undefined, // 结算账户sn
|
|
|
+ settleAccountName: undefined, // 结算账户名称
|
|
|
+ remark: '' // 备注
|
|
|
},
|
|
|
rules: {
|
|
|
amountSettled: [{ required: true, message: '请输入本次结算金额,系统将自动分配到已选单据上', trigger: 'change' }],
|
|
@@ -241,9 +242,9 @@ export default {
|
|
|
},
|
|
|
openModal: false, // 弹框
|
|
|
isPositive: true, // 是否是正值
|
|
|
- isChangeAs: false,
|
|
|
- maxAmountSettled: 0,
|
|
|
- enableFundAccount: false,
|
|
|
+ isChangeAs: false, // 防止重复计算
|
|
|
+ maxAmountSettled: 0, // 结算金额最大值
|
|
|
+ enableFundAccount: false, // 结算账户是否开启
|
|
|
printTotalKs: false, // 打印原创编码
|
|
|
printTotalNums: false, // 打印全部名称
|
|
|
remarksFlag: false // 打印备注
|
|
@@ -310,6 +311,7 @@ export default {
|
|
|
this.form.settleAccountSn = undefined
|
|
|
}
|
|
|
},
|
|
|
+ // 选择结算账户
|
|
|
settleAccountChange (v, name) {
|
|
|
this.form.settleAccountName = name
|
|
|
},
|
|
@@ -329,7 +331,6 @@ export default {
|
|
|
},
|
|
|
// 修改本次结算金额,自动分配
|
|
|
amountSettledTotalChange (v) {
|
|
|
- console.log(this.isChangeAs, v, this.totalBalance, this.isPositive)
|
|
|
if (v <= Math.abs(this.totalBalance)) {
|
|
|
this.isChangeAs = true
|
|
|
const sa = v
|
|
@@ -349,7 +350,6 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- console.log(ti, temp, sa)
|
|
|
list[ti].settleAmount = (list[ti].settleAmount - (temp - sa) * (this.isPositive ? 1 : -1)).toFixed(2)
|
|
|
// ti 之后的都改成0
|
|
|
for (let i = ti + 1; i < list.length; i++) {
|
|
@@ -369,6 +369,7 @@ export default {
|
|
|
this.chooseLoadData.splice(ind, 1)
|
|
|
this.amountSettledChange()
|
|
|
},
|
|
|
+ // 获取格式化后的提交参数
|
|
|
getParams () {
|
|
|
const _this = this
|
|
|
const form = _this.form
|
|
@@ -414,6 +415,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 选择单据成功
|
|
|
handleOk (selectedRows) {
|
|
|
if (selectedRows.length) {
|
|
|
this.chooseLoadData = this.chooseLoadData.concat(selectedRows).sort((a, b) => {
|
|
@@ -424,12 +426,12 @@ export default {
|
|
|
} else {
|
|
|
this.chooseLoadData = selectedRows
|
|
|
}
|
|
|
-
|
|
|
+ // 计算结算金额
|
|
|
this.amountSettledChange()
|
|
|
},
|
|
|
// 返回列表
|
|
|
handleBack () {
|
|
|
- this.$router.push({ path: `/financialManagement/companyReceivablePayableNew/list` })
|
|
|
+ this.$router.push({ name: `companyReceivablePayableNewList` })
|
|
|
},
|
|
|
// 关闭
|
|
|
handleClose () {
|
|
@@ -449,6 +451,7 @@ export default {
|
|
|
this.amountSettledChange()
|
|
|
})
|
|
|
},
|
|
|
+ // 初始化页面
|
|
|
pageInit () {
|
|
|
const vm = this
|
|
|
vm.$nextTick(() => {
|
|
@@ -487,7 +490,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
- .collectionPayment-wrap{
|
|
|
+ .collectionPaymentNew-wrap{
|
|
|
position: relative;
|
|
|
height: 100%;
|
|
|
padding-bottom: 51px;
|
|
@@ -496,7 +499,7 @@ export default {
|
|
|
overflow-y: auto;
|
|
|
height: 100%;
|
|
|
}
|
|
|
- .collectionPayment-cont{
|
|
|
+ .collectionPaymentNew-cont{
|
|
|
margin-top: 6px;
|
|
|
.green{
|
|
|
color: #19be6b;
|