|
@@ -53,6 +53,16 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
+ <template slot="caseOverPayment">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ clearable
|
|
|
+ v-model="form.caseOverPayment"
|
|
|
+ @change="caseOverPaymentChange"
|
|
|
+ v-input-limit="2"
|
|
|
+ :disabled="dataList.length == 0"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
<template slot="remark">
|
|
|
<el-input type="textarea"
|
|
|
v-model="form.remark"
|
|
@@ -157,6 +167,7 @@
|
|
|
import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
|
|
|
import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
import {getUserInfo} from "@/api/system/user";
|
|
|
+ import {getCorpDetail} from "@/api/maintenance/overpayment";
|
|
|
|
|
|
export default {
|
|
|
name: "receiptDetailsPage",
|
|
@@ -203,7 +214,7 @@
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
@@ -291,6 +302,7 @@
|
|
|
label: '溢付款余额',
|
|
|
prop: 'overPayment',
|
|
|
display: false,
|
|
|
+ disabled: true,
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
@@ -365,6 +377,8 @@
|
|
|
billDetailDialog:false,
|
|
|
financeDisabled:true,
|
|
|
billType:"收费",
|
|
|
+ // 明细本次金额总计
|
|
|
+ allAmount: 0,
|
|
|
//新旧数据对比
|
|
|
oldForm:{},
|
|
|
oldDataList:[],
|
|
@@ -379,9 +393,13 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ // 人民币金额默认为0
|
|
|
+ this.$set(this.form,"amount", 0)
|
|
|
getUserInfo().then(res=>{
|
|
|
this.category = res.data.data.billType
|
|
|
if (this.category == 2) {
|
|
|
+ this.$set(this.form,"overPayment", 0)
|
|
|
+ this.$set(this.form,"caseOverPayment", 0)
|
|
|
this.option.column.forEach(item => {
|
|
|
if (item.prop == 'caseOverPayment' || item.prop == 'overPayment') {
|
|
|
item.display = true
|
|
@@ -419,6 +437,12 @@
|
|
|
getlistBankBy(corpValue.id).then(res =>{
|
|
|
this.$set(this.form,"bankList",res.data)
|
|
|
})
|
|
|
+ // 溢付款余额获取
|
|
|
+ if (this.category == 2) {
|
|
|
+ getCorpDetail({corpId:corpValue.id}).then(res => {
|
|
|
+ this.form.overPayment = res.data.data? res.data.data.balanceOverpaymen: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//选择卡号
|
|
|
accountNoChange(value){
|
|
@@ -481,6 +505,7 @@
|
|
|
console.log('1')
|
|
|
},
|
|
|
confirmSettlement(status){
|
|
|
+ if (!this.form.corpId) return this.$message.error('往来单位不能为空')
|
|
|
this.$refs["form"].validate((valid,done) => {
|
|
|
done();
|
|
|
if(valid && this.verificationData()){
|
|
@@ -497,6 +522,27 @@
|
|
|
this.buttonLoading = true
|
|
|
this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
|
|
|
|
|
|
+ console.log(this.financeDisabled)
|
|
|
+ if (this.category == 2 && this.financeDisabled) {
|
|
|
+ this.allAmount = 0;
|
|
|
+ this.form.amount = this.form.amount? this.form.amount: 0
|
|
|
+ this.dataList.forEach(e => {
|
|
|
+ this.allAmount = Number(this.allAmount) + Number(e.thisAmount)
|
|
|
+ })
|
|
|
+ console.log(Number(this.allAmount) > 0)
|
|
|
+ console.log((Number(this.form.amount) < Number(this.allAmount)))
|
|
|
+ if (this.allAmount == 0 && this.form.amount == 0) {
|
|
|
+ return this.$message.error('人民币金额不能为空')
|
|
|
+ } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) > Number(this.allAmount))) {
|
|
|
+ this.form.caseOverPayment = 0;
|
|
|
+ } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) < Number(this.allAmount))) {
|
|
|
+ this.form.caseOverPayment = Number(this.allAmount) - Number(this.form.amount)
|
|
|
+ console.log(this.form.caseOverPayment)
|
|
|
+ if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
|
|
|
+ return this.$message.error('溢付款余额不足,无法收费')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
const params = {
|
|
|
...this.form,
|
|
|
billType:"收费",
|
|
@@ -552,9 +598,17 @@
|
|
|
})
|
|
|
}})
|
|
|
},
|
|
|
- afterEcho(data){
|
|
|
+ async afterEcho(data){
|
|
|
this.form = data;
|
|
|
- this.oldForm = Object.assign({},data);
|
|
|
+ // 溢付款余额获取
|
|
|
+ if (this.category == 2) {
|
|
|
+ await getCorpDetail({corpId: this.form.corpId}).then(res => {
|
|
|
+ if (Number(this.form.overPayment) != Number(res.data.data.balanceOverpaymen)) {
|
|
|
+ this.form.overPayment = res.data.data? res.data.data.balanceOverpaymen: '0.00'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.oldForm = Object.assign({},this.form);
|
|
|
|
|
|
this.financeDisabled = this.form.financeStatus === "待结算"?true:false;
|
|
|
|
|
@@ -562,7 +616,7 @@
|
|
|
this.option.column.forEach(item =>{
|
|
|
if( item.prop === "remark"){
|
|
|
this.$set(item,"disabled",false)
|
|
|
- }else if( item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo" ){
|
|
|
+ }else if( item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo" || item.prop === "overPayment"){
|
|
|
this.$set(item,"disabled",true)
|
|
|
}else{
|
|
|
this.$set(item,"disabled",false)
|
|
@@ -617,7 +671,14 @@
|
|
|
}else{
|
|
|
this.$emit("goBack");
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 溢付款更改时
|
|
|
+ caseOverPaymentChange() {
|
|
|
+ if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
|
|
|
+ this.form.caseOverPayment = 0;
|
|
|
+ return this.$message.error('本次使用的溢付款不能超过总溢付款')
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|