<template>
|
<div class="comm-page">
|
<div class="form-content">
|
<FormList :info="formInfo" :isShowDetail="isShowDetail" @handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue" @onSubmit="onSubmit" @setValueInfo="setValueInfo"></FormList>
|
</div>
|
|
<p class="export-excle">
|
<el-button size="small" type="primary" @click="showAddForm">新增应收账款</el-button>
|
</p>
|
|
<div class="list-content">
|
<TableList :pageInfo="pageInfo" @doAction="doAction" @handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange" :isAutoIndex="true" :list="records" :header="tableHeader"
|
:loading="loading"></TableList>
|
</div>
|
|
<el-dialog :title="title" :visible.sync="dialogTableVisible" custom-class="comm-dialog"
|
:modal-append-to-body="true" :close-on-click-modal="false" center width="1200px">
|
<el-form :model="form" :rules="rules" ref="form" label-width="120px" inline size="small" v-if="formOption.productid">
|
<div class="title">产品信息</div>
|
<el-form-item label="产品编号" prop="productid">
|
<el-input v-model="form.productid" :disabled="!formOption.productid.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="产品名称" prop="productname">
|
<el-select v-model="form.productname" filterable placeholder="请选择" :disabled="!formOption.productname.writeAble" @change="productnameChange">
|
<el-option
|
v-for="(item,index) in productTypeList"
|
:key="index"
|
:label="item.productName"
|
:value="item.productName">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<div class="title">债权人&核心企业信息</div>
|
<el-form-item label="债权人名称" prop="creditorname">
|
<el-input v-model="form.creditorname" :disabled="!formOption.creditorname.writeAble" @blur="qryDimensionDetailByCreditor"></el-input>
|
</el-form-item>
|
<el-form-item label="债权人证件类型" prop="creditorcerttype">
|
<el-select v-model="form.creditorcerttype" filterable placeholder="请选择" :disabled="!formOption.creditorcerttype.writeAble">
|
<el-option
|
v-for="(item,index) in certtypeList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="债权人类型" prop="creditortype">
|
<el-select v-model="form.creditortype" filterable placeholder="请选择" :disabled="!formOption.creditortype.writeAble">
|
<el-option
|
v-for="(item,index) in borrowerTypeList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="核心企业名称" prop="enterprisename">
|
<el-select v-model="form.enterprisename" filterable placeholder="请选择" :disabled="!formOption.enterprisename.writeAble" @change="enterprisenameChange">
|
<el-option
|
v-for="(item,index) in enterpriseList"
|
:key="index"
|
:label="item.enterprisename"
|
:value="item.enterprisename">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="核心企业统一社会信用代码" prop="reditcode">
|
<el-input v-model="form.reditcode" :disabled="!formOption.reditcode.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="债权人证件号码" prop="customerCertId">
|
<el-input v-model="form.creditorcertid" :disabled="!formOption.creditorcertid.writeAble"></el-input>
|
</el-form-item>
|
<div class="title">基础合同信息</div>
|
<el-form-item label="基础合同编号" prop="contractno">
|
<el-input v-model="form.contractno" :disabled="!formOption.contractno.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="基础合同名称" prop="contractname">
|
<el-input v-model="form.contractname" :disabled="!formOption.contractname.writeAble"></el-input>
|
</el-form-item>
|
<div class="title">应收账款基本信息</div>
|
<el-form-item label="名称" prop="billname">
|
<el-input v-model="form.billname" :disabled="!formOption.billname.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="凭证类型" prop="billtype">
|
<el-select v-model="form.billtype" filterable placeholder="请选择" :disabled="!formOption.billtype.writeAble">
|
<el-option
|
v-for="(item,index) in accountsCertTypeList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="凭证号码" prop="billno">
|
<el-input v-model="form.billno" :disabled="!formOption.billno.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="节点" prop="accountsnodetype">
|
<el-select v-model="form.accountsnodetype" filterable placeholder="请选择" :disabled="!formOption.accountsnodetype.writeAble">
|
<el-option
|
v-for="(item,index) in accountsNodeTypeList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="金额" prop="billsum">
|
<el-input v-model="form.billsum" :disabled="!formOption.billsum.writeAble"
|
@blur="form.billsum = formatMoney(form.billsum);qryDimensionDetailByCreditor()"></el-input>
|
</el-form-item>
|
<el-form-item label="截止付款日期" prop="pjpamentendday">
|
<el-date-picker
|
v-model="form.pjpamentendday"
|
type="date"
|
:disabled="!formOption.pjpamentendday.writeAble"
|
format="yyyy/MM/dd"
|
value-format="yyyy/MM/dd"
|
size="small"
|
placeholder="选择日期"
|
>
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="兑付状态" prop="cashstatus">
|
<!-- <el-input v-model="form.cashstatus" :disabled="!formOption.cashstatus.writeAble"></el-input> -->
|
|
<el-select v-model="form.cashstatus" filterable placeholder="请选择" :disabled="!formOption.cashstatus.writeAble">
|
<el-option
|
v-for="(item,index) in yesNoList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="授信比例" prop="creditratio">
|
<el-input :value="form.creditratio+'%'" :disabled="!formOption.creditratio.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="剩余额度" prop="remanentamt">
|
<el-input v-model="form.remanentamt" :disabled="!formOption.remanentamt.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="授信额度" prop="creditamt">
|
<el-input v-model="form.creditamt" :disabled="!formOption.creditamt.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="额度周期" prop="quotacycletype">
|
<!-- <el-input v-model="form.quotacycletype" :disabled="!formOption.quotacycletype.writeAble"></el-input> -->
|
<el-select v-model="form.quotacycletype" filterable placeholder="请选择" :disabled="!formOption.quotacycletype.writeAble">
|
<el-option
|
v-for="(item,index) in quotaStatusList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="已用额度" prop="useamt">
|
<el-input v-model="form.useamt" :disabled="!formOption.useamt.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="质押标志" prop="pledgestatus">
|
<el-select v-model="form.pledgestatus" filterable placeholder="请选择" :disabled="!formOption.pledgestatus.writeAble">
|
<el-option
|
v-for="(item,index) in yesNoList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
|
</el-form-item>
|
<el-form-item label="额度状态" prop="quotastatus">
|
<el-select v-model="form.quotastatus" filterable placeholder="请选择" :disabled="!formOption.quotastatus.writeAble">
|
<el-option
|
v-for="(item,index) in quotaStatusList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno">
|
</el-option>
|
</el-select>
|
|
</el-form-item>
|
<div class="title">应收账款与申请单的映射关系</div>
|
<p class="export-excle" style="width:100%; margin: 2px 20px 10px 0">
|
<el-button size="small" type="primary" @click="showAddAccountsReceivable" v-if="title !='查看' ">新增</el-button>
|
</p>
|
|
|
<el-table
|
stripe
|
:data="relativeInfoList"
|
highlight-current-row
|
|
:header-cell-style="{ background: '#f5f5f5', color: '#222222' }"
|
>
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">申请单号</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 15px" v-show="!isEdit">{{
|
row.disburseobjectno
|
}}</span>
|
<!-- <el-input
|
style="padding-left: 15px"
|
size="small"
|
v-show="isEdit"
|
v-model="row.disburseobjectno"
|
placeholder="请输入"
|
></el-input> -->
|
<el-select
|
v-show="isEdit"
|
v-model="row.disburseobjectno"
|
filterable
|
@change="disburseobjectnoChange(row)"
|
placeholder="请输入姓名进行选择">
|
<el-option
|
v-for="item in applyListFilter"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value">
|
<div slot>{{item.value + '/' + item.customername}}</div>
|
</el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<!-- <span class="red-star">*</span> -->
|
<span style="padding-left: 8px">客户姓名</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
|
<span style="padding-left: 15px" >{{
|
row.customername
|
}}</span>
|
<!-- <el-input
|
style="padding-left: 15px"
|
size="small"
|
v-show="isEdit"
|
v-model="row.customername"
|
placeholder="请输入"
|
></el-input> -->
|
</template>
|
</el-table-column>
|
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">放款时间</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 15px" >{{
|
row.loanTime ? row.loanTime : "--"
|
}}</span>
|
<!-- <div style="padding-left: 15px">
|
<el-date-picker
|
v-model="row.loanTime"
|
type="date"
|
v-show="!isEdit"
|
format="yyyy/MM/dd"
|
value-format="yyyy/MM/dd"
|
size="small"
|
placeholder="选择日期"
|
>
|
</el-date-picker>
|
</div> -->
|
</template>
|
</el-table-column>
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">匹配应收账款金额</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 15px" v-show="!isEdit">{{
|
row.disburseamt ? formatMoney(row.disburseamt) : "--"
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
size="small"
|
v-show="isEdit"
|
v-model="row.disburseamt"
|
placeholder="请输入"
|
@blur="row.disburseamt = formatMoney(row.disburseamt);calculation(row.disburseamt)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<!-- <el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">状态</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 15px" v-show="!isEdit">{{
|
row.statusdesc
|
}}</span>
|
</template>
|
</el-table-column> -->
|
<el-table-column label="操作" min-width="110" v-if="title !='查看' ">
|
<template slot-scope="scope">
|
<!-- <el-button
|
type="text"
|
@click.native="handleEdit(scope.row)"
|
v-if="!scope.row.isEdit"
|
>修改</el-button
|
>
|
<el-button
|
type="text"
|
@click.native="handleSave(scope.row, scope.$index)"
|
v-else
|
>保存</el-button
|
>
|
<el-button
|
type="text"
|
@click.native="handleCancel(scope.row, scope.$index)"
|
v-if="scope.row.isCancel"
|
>取消</el-button
|
> -->
|
<el-button
|
type="text"
|
@click.native="handleDelete(scope.row, scope.$index)"
|
v-if="optType == '0040' || optType == '0060'"
|
>删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
<template v-if="title !='新增'">
|
<div class="title">
|
中登网登记信息
|
<el-button size="small" type="primary" @click="zhdwDownload">登记证明查看</el-button>
|
<el-button size="small" type="primary" @click="showZhdw" v-if="(!zhdwForm.pledgeStatus || zhdwForm.pledgeStatus != 1) && title !='查看' ">中登网登记</el-button>
|
</div>
|
|
<el-form-item label="质押状态" >
|
<el-input :value="!zhdwForm.pledgeStatus ? '否' : zhdwForm.pledgeStatus == 1 ? '成功' : '失败'" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="质押上传时间" >
|
<el-input v-model="zhdwForm.uploadDate" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="质押描述" style="width: 66.6%;">
|
<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 5}" v-model="zhdwForm.pledgeDesc" disabled></el-input>
|
</el-form-item>
|
</template>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button plain @click="dialogTableVisible = false">取消</el-button>
|
<el-button type="primary" @click="submit(form)">确定</el-button>
|
</span>
|
</el-dialog>
|
|
|
<ZhdwConfirmDialog ref="zhdwConfirmDialog" ></ZhdwConfirmDialog>
|
</div>
|
</template>
|
|
<script>
|
import TableList from "@comprehensive/components/TableList";
|
import FormList from "@comprehensive/components/FormList";
|
import { accountsReceivableHeader } from '@comprehensive/utils/tableHeaders'
|
import { accountsReceivableSearch } from '@comprehensive/utils/formItems'
|
import ZhdwConfirmDialog from "@comprehensive/components/ZhdwConfirmDialog";
|
import {
|
qryCreditorBillInfoList,
|
qryCreditorBillInfo,
|
zhdwQueryResult,
|
qryBusinessApplyListByCreditor,
|
saveCreditorBillInfoByManage
|
} from "@comprehensive/serve/public";
|
|
import {
|
qryProdList,
|
getDictionaryList,
|
qryDimensionDetailByCreditor,
|
} from '@/api/product'
|
import { qryCoreEnterpriseList } from '@/api/area/enterprise'
|
import common from "@/utils/common";
|
export default {
|
data() {
|
return {
|
records: [],
|
productTypeList:[],
|
borrowerTypeList: [],
|
certtypeList: [],
|
accountsCertTypeList: [],
|
accountsNodeTypeList: [],
|
yesNoList: [],
|
quotaCycleTypeList: [],
|
quotaStatusList: [],
|
enterpriseList: [],
|
applyList: [],
|
valueInfo: {
|
customercertid: '', // 客户证件号码
|
customerid: '', // 客户编号
|
customername: '',// 客户名称
|
enterprisename: '', // 核心企业
|
pledgestatus: '', // 质押状态,是否质押:0-未质押、1-已质押
|
productid: '', //产品名称
|
reditcode: '' //核心企业社会信用代码
|
},
|
tableColumn1: [
|
{ prop: "disburseobjectno", label: "申请单号"},
|
{ prop: "customername", label: "客户姓名"},
|
{ prop: "loanTime", label: "放款时间"},
|
{ prop: "disburseamt", label: "匹配应收账款金额" },
|
// { prop: "status", label: "状态" },
|
],
|
applyList: [],
|
isShowDetail: false,
|
loading: false,
|
dialogTableVisible: false,
|
title: '新增',
|
optType: '0040',
|
pageInfo: {
|
turnFlag: 0,
|
currentPage: 1,
|
pageSize: 10,
|
},
|
formInfo: [...accountsReceivableSearch],
|
tableHeader: [...accountsReceivableHeader],
|
powerControl: {
|
detailFlagControl: true,
|
},
|
form: {},
|
formOption: {},
|
rules: {},
|
zhdwForm: {},
|
relativeInfoList: [],
|
isEdit: false,
|
}
|
},
|
components: {
|
FormList,
|
TableList,
|
ZhdwConfirmDialog
|
},
|
activated() {
|
this.init()
|
},
|
mounted() {
|
},
|
computed: {
|
applyListFilter() {
|
let data= this.applyList.filter(item=>{
|
return !this.relativeInfoList.find( prop => {
|
return prop.disburseobjectno == item.applyserialno
|
})
|
})
|
console.log(data)
|
return data
|
}
|
},
|
methods: {
|
async init() {
|
const { formInfo } = this;
|
// if (formInfo.some(({ name }) => name === "phaseNo")) {
|
// this.enterpriseQryCondition('phaseno','phaseNo');
|
// }
|
// 产品类型
|
this.qryProdList()
|
// 获取核心企业
|
this.qryCoreEnterpriseList()
|
// 人类型
|
this.borrowerTypeList = await this.qryDictionaryList('BorrowerType');
|
// 证件类型
|
this.certtypeList = await this.qryDictionaryList('CertType');
|
// 凭证类型
|
this.accountsCertTypeList = await this.qryDictionaryList('AccountsCertType');
|
// 应收账款
|
this.accountsNodeTypeList = await this.qryDictionaryList('AccountsNodeType');
|
// 兑付状态
|
this.yesNoList = await this.qryDictionaryList('CashStatus');
|
// 额度周期
|
this.quotaCycleTypeList = await this.qryDictionaryList('QuotaCycleType');
|
// 额度状态
|
this.quotaStatusList = await this.qryDictionaryList('QuotaStatus');
|
// this.qryDimensionDetailByCreditor
|
// 获取申请单列表
|
this.qryBusinessApplyListByCreditor()
|
this.qryCreditorBillInfoList()
|
},
|
|
qryDictionaryList(code){
|
return new Promise(resolve=>{
|
getDictionaryList({
|
codeNo: code
|
}).then(res=>{
|
resolve(res.result)
|
})
|
})
|
},
|
// 查询产品类型
|
qryProdList(){
|
qryProdList({}).then(res=>{
|
this.productTypeList = res.result
|
|
this.setOrGetFormInfo("productid", { options: res.result });
|
})
|
},
|
// 查询核心企业
|
qryCoreEnterpriseList() {
|
qryCoreEnterpriseList({}).then(res=>{
|
this.enterpriseList = res.result
|
})
|
},
|
async qryBusinessApplyListByCreditor(query) {
|
const { result } = await qryBusinessApplyListByCreditor({ customername: query})
|
result.forEach(val => {
|
val.label = `${val.applyserialno}/${val.customername}`
|
val.value = val.applyserialno
|
});
|
this.applyList = result
|
},
|
selHandler(obj){
|
this.form.disburseobjectno = obj.applyserialno
|
this.form.customername = obj.customername
|
this.form.loanTime = obj.loanTime
|
},
|
productnameChange() {
|
this.$set(this.form, 'productid' , this.productTypeList.find(res=>res.productName == this.form.productname).productCode)
|
this.qryDimensionDetailByCreditor()
|
},
|
enterprisenameChange() {
|
let data = this.enterpriseList.find(res=>res.enterprisename == this.form.enterprisename)
|
this.form.reditcode = data.reditcode
|
this.form.enterpriseno = data.serialno
|
this.qryDimensionDetailByCreditor()
|
},
|
disburseobjectnoChange(row) {
|
row.customername = this.applyList.find(res=>res.applyserialno == row.disburseobjectno).customername
|
},
|
async qryDimensionDetailByCreditor() {
|
// productid -- 产品编号
|
// creditorname -- 债权人姓名
|
// enterpriseno -- 企业核心编码
|
// billsum -- 发票金额/单据金额.number类型
|
let { productid, creditorname, enterpriseno, billsum} = this.form
|
if(productid && creditorname && enterpriseno && billsum) {
|
let num = this.moneyFomatNumber(billsum, 2)
|
const {result} = await qryDimensionDetailByCreditor({
|
productid,
|
creditorname,
|
enterpriseno,
|
billsum: num
|
})
|
|
this.form.creditratio = result.creditratio
|
// this.form.creditratiodesc = result.creditratio + '%'
|
this.form.creditamt = result.creditamt
|
this.calculation()
|
this.form.quotacycletype = result.quotacycletype
|
}
|
},
|
calculation() {
|
const sum = this.relativeInfoList.reduce((prev,cur,index)=>{
|
return prev + Number(this.moneyFomatNumber(cur.disburseamt || 0, 2))
|
},0);
|
console.log(sum)
|
this.form.remanentamt = (this.form.creditamt*1000 - sum*1000) / 1000
|
this.form.useamt = sum
|
},
|
initFormData() {
|
let val = this.formOption
|
for (const key in val) {
|
if(key == 'relativeInfoList') return
|
// // 格式化金额
|
if (
|
key == "billsum"
|
) {
|
val[key].value = this.formatMoney(val[key].value);
|
}
|
if (
|
key == "productname" ||
|
key == "creditorcerttype" ||
|
key == "creditortype" ||
|
key == "billtype" ||
|
key == "accountsnodetype" ||
|
key == "cashstatus" ||
|
key == "quotacycletype" ||
|
key == "pledgestatus" ||
|
key == "quotastatus"
|
) {
|
val[key].vaildType = 'change'
|
}
|
if (val[key].required) {
|
this.rules[key] = [];
|
this.rules[key].push({
|
required: true,
|
message: `请输入${val[key].filedDescription}`,
|
trigger: val[key].vaildType || "blur"
|
});
|
}
|
}
|
console.log(this.rules)
|
},
|
// 金额格式化
|
formatMoney(value) {
|
if (value) {
|
value =
|
parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
|
if (value == "NaN") return;
|
let l = value.split(".")[0].split("").reverse();
|
let r = value.split(".")[1];
|
let t = "";
|
for (let i = 0; i < l.length; i++) {
|
t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? "," : "");
|
}
|
return t.split("").reverse().join("") + "." + r;
|
}
|
},
|
//金额变成数字
|
moneyFomatNumber(number, n = 2) {
|
if(typeof number == 'number') return number
|
if (number != null && number != "" && number != undefined) {
|
number = number.replace(/,/g, ""); //去除千分位的','
|
if (isNaN(number)) {
|
//判断是否是数字
|
number = "0";
|
} else {
|
number = Math.round(number * Math.pow(10, n)) / Math.pow(10, n); //n幂
|
number = number.toString();
|
}
|
} else {
|
number = "0";
|
}
|
//a.indexOf(x,y);返回x值在a字符串值中从y位置开始检索首次出现的位置
|
var numLength = number.indexOf(".");
|
//判断传递的值是整数增加小数点再补"0"
|
if (numLength < 0) {
|
numLength = number.length;
|
number += ".";
|
}
|
//不足n位小数的,循环补"0"
|
while (number.length <= numLength + n) {
|
number += "0";
|
}
|
return number;
|
},
|
showAddAccountsReceivable() {
|
this.relativeInfoList.push({
|
"disburseobjectno": '',
|
"customername": '',
|
"loanTime": '',
|
"disburseamt": '',
|
})
|
},
|
async qryCreditorBillInfoList() {
|
this.loading = true;
|
let { valueInfo, pageInfo, powerControl } = this;
|
const { detailFlagControl } = powerControl
|
const res = await qryCreditorBillInfoList({
|
...valueInfo,
|
...pageInfo
|
});
|
const { records = [], total } = res.result;
|
this.loading = false;
|
this.records = records.reduce((pre, curr) => {
|
let arr = [];
|
arr.push({ label: "查看" });
|
arr.push({ label: "编辑" });
|
pre.push({
|
...curr,
|
buttons: [...arr],
|
});
|
|
return pre;
|
}, []);
|
|
this.pageInfo = {
|
...pageInfo,
|
total
|
};
|
},
|
// 表单事件触发
|
async doAction(name, item, { label }) {
|
if (name === "lastAction") {
|
const { objectType } = item;
|
const detailInfo = { ...item, objecttype: objectType };
|
if (label == '查看') {
|
// this.toDetail(detailInfo)
|
this.showForm(detailInfo)
|
}
|
if (label == '编辑') {
|
this.showEditForm(detailInfo)
|
}
|
}
|
},
|
async showAddForm(item) {
|
this.optType = '0040'
|
this.title = '新增'
|
this.isEdit = true
|
this.querBillInfo('')
|
},
|
async showEditForm(item) {
|
this.optType = '0060'
|
this.title = '编辑'
|
this.isEdit = true
|
this.querBillInfo(item.serialno)
|
},
|
// 跳转到详情页
|
async showForm(item) {
|
this.optType = '0100'
|
this.title = '查看'
|
this.isEdit = false
|
this.querBillInfo(item.serialno)
|
},
|
async querBillInfo(serialno) {
|
this.$refs.form && this.$refs.form.resetFields();
|
const { result } = await qryCreditorBillInfo({ serialno: serialno, optType: this.optType});
|
let from = {}
|
Object.keys(result).map((res)=>from[res] = result[res] && result[res].value || '')
|
this.form = from
|
this.formOption = result
|
this.initFormData()
|
this.relativeInfoList = result.relativeInfoList || []
|
console.log(from)
|
if(this.title != '新增') this.queryResult()
|
this.dialogTableVisible = true
|
},
|
queryResult() {
|
zhdwQueryResult({
|
applySerialNo: this.form.billno
|
}).then(res => {
|
this.zhdwForm = res.result
|
});
|
},
|
zhdwDownload() {
|
const url = `${process.env.VUE_APP_API_ORIGIN}/rlc-cts/server/zhdw/downloadPDF/${this.form.billno}`;
|
window.open(url)
|
},
|
showZhdw() {
|
this.$refs.zhdwConfirmDialog.initInfo({serialNo:this.relativeInfoList[0].disburseobjectno})
|
},
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
// 更新表单数据或查找某项数据
|
setOrGetFormInfo(nameKey, newInfo) {
|
let { formInfo } = this
|
let index = formInfo.findIndex(({ name }) => name === nameKey)
|
let result = {}
|
if (!isNaN(index)) {
|
this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo })
|
result = this.formInfo[index]
|
}
|
if (typeof newInfo === 'undefined') {
|
return result
|
}
|
},
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item;
|
this.setOrGetFormInfo(name, { value });
|
},
|
// 查询
|
onSubmit() {
|
this.pageInfo.currentPage = 1;
|
this.qryCreditorBillInfoList();
|
},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.qryCreditorBillInfoList();
|
},
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.qryCreditorBillInfoList();
|
},
|
//删除选中应收账款明细
|
handleDelete(row, index) {
|
|
common.comfirm(
|
"提示",
|
`请确认是否需要删除:${row.disburseobjectno}?`,
|
async () => {
|
// this.$set(row, "isEdit", true);
|
this.relativeInfoList.splice(index,1)
|
}
|
);
|
},
|
|
//保存选中应收账款明细
|
// async handleSave(row, index) {
|
// if (!row.disburseobjectno) {
|
// this.$message.warning("申请单号不能为空");
|
// return;
|
// }
|
// if (!row.customername) {
|
// this.$message.warning("客户姓名不能为空");
|
// return;
|
// }
|
// if (!row.loanTime) {
|
// this.$message.warning("放款时间不能为空");
|
// return;
|
// }
|
// if (!row.disburseamt) {
|
// this.$message.warning("匹配应收账款金额不能为空");
|
// return;
|
// }
|
// if (!row.status) {
|
// this.$message.warning("状态不能为空");
|
// return;
|
// }
|
// // if (!row.pjpamentendday) {
|
// // this.$message.warning("应收账款到期日不能为空");
|
// // return;
|
// // }
|
|
// for (let i = 0; i < this.relativeInfoList.length; i++) {
|
// if (
|
// index != i &&
|
// row.disburseobjectno == this.relativeInfoList[i].disburseobjectno
|
// ) {
|
// this.$message.warning("申请单已存在,请重新填写");
|
// return;
|
// }
|
// }
|
// },
|
checkRelativeInfoList() {
|
let error = false
|
for(let i = 0; i < this.relativeInfoList.length; i ++) {
|
let data = this.relativeInfoList[i]
|
if(!data.disburseobjectno) {
|
error = true
|
this.$message.warning(`请选择第 ${i+1} 行申请单号`)
|
break;
|
}
|
if(!data.disburseamt) {
|
error = true
|
this.$message.warning(`请输入第 ${i+1} 行匹配应收账款金额`)
|
break;
|
}
|
}
|
return error
|
|
},
|
async submit() {
|
if(this.checkRelativeInfoList()) return
|
let info = await this.$refs.form.validate()
|
if (info !== false) {
|
let list = [...this.relativeInfoList]
|
list.forEach(res=>{
|
res.disburseamt = this.moneyFomatNumber(res.disburseamt, 2)
|
})
|
this.form.relativeInfoList = list
|
// this.form.relativeInfoList = [...this.relativeInfoList]
|
this.form.billsum = this.moneyFomatNumber(this.form.billsum, 2)
|
const res = await saveCreditorBillInfoByManage(this.form)
|
if(res.code == '00'){
|
this.$message.success('保存成功')
|
this.qryCreditorBillInfoList()
|
this.dialogTableVisible = false
|
}
|
// this.saveOrUpdateCss(
|
// !serialNo ? { csId: userid, ...formValues } : formValues
|
// )
|
}
|
}
|
},
|
}
|
</script>
|
|
<style lang="postcss" scoped>
|
.comm-page {
|
& .list-content {
|
font-size: 14px;
|
}
|
|
& .export-excle {
|
margin: 2px 20px 30px 0;
|
|
& .el-button-primary {
|
font-size: 14px;
|
}
|
}
|
|
& .empty-section {
|
height: 50px;
|
}
|
|
&>>>.comm-dialog {
|
&.el-dialog {
|
min-width: 1200px;
|
max-height: 100%;
|
overflow: hidden;
|
margin: 0 !important;
|
position: absolute;
|
left: 50%;
|
top: 50%;
|
-webkit-transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
}
|
|
& .el-dialog__body{
|
|
max-height: 60vh;
|
overflow: auto;
|
}
|
& .el-form--inline .el-form-item__content {
|
vertical-align: middle;
|
}
|
& .el-form {
|
display: flex;
|
justify-content: flex-start;
|
flex-wrap: wrap;
|
& .el-table {
|
margin-bottom: 20px
|
}
|
& .title {
|
width: 100%;
|
color: #222;
|
font-weight: 500;
|
font-size: 14px;
|
position: relative;
|
padding-left: 10px;
|
margin-bottom: 20px;
|
border-left: 2px solid #0081f0;
|
}
|
|
& .el-form-item {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
width: 33.33%;
|
margin: 0 0 24px 0;
|
padding-right: 60px;
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
|
& .el-form-item__label {
|
line-height: 16px;
|
}
|
|
& .el-form-item__content {
|
flex: 1;
|
|
& .el-select {
|
width: 100%;
|
}
|
|
& .el-autocomplete {
|
width: 100%;
|
|
& .el-autocomplete-suggestion {
|
position: absolute !important;
|
left: 0 !important;
|
min-width: 100%;
|
width: auto !important;
|
}
|
}
|
}
|
}
|
}
|
|
& .el-dialog__footer {
|
& .el-button {
|
width: 120px;
|
font-size: 14px;
|
line-height: 20px;
|
padding: 5px 0;
|
|
&+.el-button {
|
margin-left: 40px;
|
}
|
}
|
}
|
}
|
}
|
</style>
|