1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321 |
- <template>
- <el-tabs type="border-card">
- <!-- 资产信息-->
- <el-tab-pane label="资产信息">
- <!-- <div class="app-container"> -->
- <el-form ref="form" :model="form" :rules="rules" :inline="true" style="margin-top: 20px" label-width="auto" >
- <el-divider content-position="left">补充资料</el-divider>
- <el-row>
- <el-col :span="8">
- <el-form-item label="融信编号" prop="zfiNumber">
- <el-input v-model="form.zfiNumber" style="width: 200px" disabled/>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="创建时间" prop="createTime">
- <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="创建人" prop="createName">
- <el-input v-model="form.createName" style="width: 200px" disabled/>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="开立方" prop="openName">
- <el-input v-model="form.openName" style="width: 200px" disabled/>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="接收方" prop="zfiSupplierId">
- <!-- <el-select
- style="width: 200px"
- v-model="form.zfiSupplierId"
- filterable
- clearable
- remote
- disabled
- >
- <el-option
- v-for="item in supplierList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select> -->
- <el-input v-model="form.receiveName" style="width: 200px" disabled/>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="签发有效期" prop="zfiEffectiveDate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.zfiEffectiveDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择签发有效期"
- disabled>
- </el-date-picker>
- <el-tooltip class="item" effect="light" content="签发有效期:即指定签发截止日期,对方企业在签发截止日内未处理该笔融信,本次融信操作将自动失效" placement="top">
- <i class="el-icon-question" style="font-size: 23px;"/>
- </el-tooltip>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="承诺还款日" prop="zfiExpireDate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.zfiExpireDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择承诺还款日"
- disabled>
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="授信额度" prop="zfiCoreQuotaId">
- <!-- <el-select
- style="width: 200px"
- v-model="form.zfiCoreQuotaId"
- filterable
- clearable
- remote
- disabled
- >
- <el-option
- v-for="item in creditLineList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select> -->
- <el-input v-model="form.zfpName" style="width: 200px" disabled/>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="8">
- <span>可用额度:</span>
- <span>{{availableAmt}}</span>
- <br>
- <span>有效期:</span>
- <span>{{validityDate}}</span>
- </el-col> -->
- </el-row>
- <el-divider content-position="left" >应收账款</el-divider>
- <el-form-item style="margin-left: 100px">
- <el-button type="success" @click="openTicket">选择</el-button>
- <el-button type="primary" @click="addPay">新增应付账款</el-button>
- <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
- <el-form-item label="合计金额:">
- <span>{{checkTotalAmt}}</span>
- </el-form-item>
- <el-form-item label="金额大写:">
- <span>{{checkTotalBigAmt}}</span>
- </el-form-item>
-
- <el-table :data="ticketList" style="width: 1100px">
- <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
- <el-table-column label="应收企业" align="center" prop="receiveName"/>
- <el-table-column label="应收企业" align="center" prop="payName" />
- <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
- <el-table-column label="金额" align="center" prop="zbiAmount" />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.$index, ticketList)"
- >删除</el-button>
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.$index, ticketList)">修改</el-button>
- </template>
-
- </el-table-column>
- </el-table>
- </el-form-item>
- <el-row>
- <el-col :span="8">
- <el-form-item label="签发金额" prop="zfiAmount">
- <el-input v-model="form.zfiAmount" style="width: 200px" disabled @input="getBigSmall"/>
- </el-form-item>
- </el-col>
-
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="金额大写" prop="issuedAmount">
- {{issuedAmount}}
- </el-form-item>
- </el-col>
- </el-row>
- <p>请知悉,资产信息仅能接受指定的销售方与购买方的往来账款(含账款基本信息、贸易合同与贸易发票等);如须使用系统尚未维护的往来账款,请点击新增应付账款
- </p>
- </el-form>
- <!-- 发票附件 -->
- <el-divider content-position="left">发票附件</el-divider>
- <el-table :data="invoiceFileList" style="width: 100%">
- <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleDownload(scope.row)"
- >下载</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handlePreview(scope.row)"
- >预览</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 合同附件 -->
- <el-divider content-position="left">合同附件</el-divider>
- <el-table :data="contractFileList" style="width: 100%">
- <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleDownload(scope.row)"
- >下载</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handlePreview(scope.row)"
- >预览</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 其他附件 -->
- <el-divider content-position="left">其他附件</el-divider>
- <el-table :data="otherFileList" style="width: 100%">
- <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleDownload(scope.row)"
- >下载</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handlePreview(scope.row)"
- >预览</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="footer" style="float: right;
- margin-bottom:2px;">
- <el-button type="info" @click="refuse">拒绝</el-button>
- <el-button type="primary" @click="submitForm" v-if="isHas">内部审批</el-button>
- <el-button type="primary" @click="submit" v-if="submitButton">提交</el-button>
- <el-button type="primary" @click="sign" v-if="signButton">签收</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- <!-- 应收账款信息 -->
- <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
- <el-form :model="queryParamsPay" ref="formQuery" :inline="true" label-width="68px" style="margin-bottom: -21px">
- <el-form-item label="账款名称" prop="zbiName">
- <el-input
- v-model="queryParamsPay.zbiName"
- placeholder="请输入账款名称"
- clearable
- size="small"
- maxlength="11"
- @keyup.enter.native="handleQuerys"/>
- </el-form-item>
- <el-form-item>
- <el-button
- type="cyan"
- icon="el-icon-search"
- size="mini"
- @click="handleQuerys"
- >搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
- >重置</el-button>
- </el-form-item>
- </el-form>
- <el-table :data="payList"
- ref="tablePay"
- class="single-select-table"
- @selection-change="handleSelectionChange"
- :row-key="rowkey">
- <el-table-column
- type="selection"
- :reserve-selection="true"
- width="50"
- align="center"/>
- <el-table-column label="序号" type="index" width="50" align="center">
- <template slot-scope="scope">
- <span>{{ (queryParamsPay.pageNum - 1) * queryParamsPay.pageSize + scope.$index + 1}}</span>
- </template>
- </el-table-column>
- <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
- <el-table-column label="应收企业" align="center" prop="receiveName"/>
- <el-table-column label="应收企业" align="center" prop="payName" />
- <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
- <el-table-column label="金额" align="center" prop="zbiAmount" />
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParamsPay.pageNum"
- :limit.sync="queryParamsPay.pageSize"
- @pagination="getAccountsCollection" />
- <span slot="footer" class="dialog-footer">
- <el-button size="mini" @click="cancelTicket">取消</el-button>
- <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
- </span>
- </el-dialog>
-
- <!-- 新增往来账款 -->
- <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
- <add-bill :companyId="form.zfiCoreId" companyType="01" :payDate="payDate" @addClick="emitAddClick" v-if="openAddBill"></add-bill>
- </el-dialog>
- <!-- 修改往来账款 -->
- <el-dialog title="修改往来账款" :visible.sync="openEditBill" width="1120px" append-to-body>
- <edit-bill :zbiId="this.zbiId" @editClick="emitEditClick" v-if="openEditBill"></edit-bill>
- </el-dialog>
- <!--预览-->
- <el-dialog :visible.sync="openFile" width="1000px" append-to-body>
- <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
- <iframe :src="wordUrl" width='800px' height='600px' frameborder='1' v-if="heid"/>
- </el-dialog>
- <el-dialog
- :visible.sync="pdfShowDialog"
- width="70%"
- height = "60%"
- append-to-body>
- <pdf-show :pdfFileList="pdfFileList" :zfiId="this.form.zfiId" :parent="parent">
- </pdf-show>
- </el-dialog>
- <!--去融资-->
- <el-dialog :visible.sync="goShow" width="300px" append-to-body :before-close = "cancelGo" center>
- <!-- <p>恭喜您成功签收一笔融信</p> -->
- <el-form ref="financeSignForm" :model="financeSignForm" label-width="auto" :inline="true">
- <el-row>
- <el-form-item label="融信编号:">{{financeSignForm.zfiNumber}}</el-form-item>
- <el-form-item label="融信金额:">{{handleInput(financeSignForm.zfiAmount)}}</el-form-item>
- <el-form-item label="大写:">{{smallToBig(financeSignForm.zfiAmount)}}</el-form-item>
- </el-row>
- <el-row>
- <el-form-item label="融信利率:">{{financeSignForm.zfiRate}}</el-form-item>
- <el-form-item label="最长融信期限:">{{financeSignForm.intervalTime + "天"}}</el-form-item>
- <el-form-item label="融信有效期:">{{financeSignForm.validity}}</el-form-item>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="goFinance">去融资</el-button>
- <el-button @click="cancelGo">取 消</el-button>
- </div>
- </el-dialog>
- </el-tab-pane>
- <el-tab-pane label="签署合同">
- <el-table :data="creditSealList" style="width: 100%">
- <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
- <template slot-scope="scope">
- <img style="width:30px;height:30px;"
- src="../../../assets/images/pdf.png"
- />
- <span>{{scope.row.pfiFileName}}
- </span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleDownload(scope.row)"
- >下载</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handlePreview(scope.row)"
- >预览</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <!-- </div> -->
- </template>
- <script>
- import {getCreditDetail,getAccountsCollection,getFile,getFinanceSign} from "@/api/service/credit/credit";
- import {addInfor,getCreditSealFile,creditRefuse,getContractFile} from "@/api/service/credit/creditHandle";
- import {accAdd} from "@/utils/calculation";
- import {getToken} from "@/utils/auth";
- import AddBill from "@/views/service/bill/addBill";
- import EditBill from "@/views/service/bill/editBill";
- import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
- import { amtformat } from "@/utils/amtCommon";
- import pdfShow from "./pdfShow";
- import Cookies from 'js-cookie';
- export default {
- name: "addCredit",
- components: {AddBill,pdfShow,EditBill},
- data() {
- return {
- //往来账款id
- zbiId: '',
- // 总条数
- total: 0,
- // 表单参数read
- form: {
- },
- // 表单校验
- rules: {
-
- },
- financeSignForm:{},
- // 是否显示弹出层
- open: false,
- openAddBill: false,
- openEditBill: false,
- //选择的应收账款
- payList:[],
- //现有的应收账款
- ticketList:[],
- //签发金额大写
- issuedAmount:"零元整",
- //合计选中的应收账款的金额
- checkTotalAmt:"0.00",
- //合计选中的应收账款的大写金额
- checkTotalBigAmt:"零元整",
- //接收方
- supplierList:[],
- supplierForm:{},
- queryParamsPay: {
- pageNum: 1,
- pageSize: 10,
- zbiName:null
- },
- //授信额度
- creditLineList:[],
- //可用额度
- availableAmt:"0.00",
- //有效期
- validityDate:"",
- //有效期类型
- zfpcrDateType:"" ,
- //产品是否可拆分
- zfpSplit:"",
- //融资放款方式
- zfpcrLoanType:"",
- //产品编号
- zfpId:"",
- //标题
- payTitle:"",
- //利率
- zfiRate:"",
- //授信额度
- creditParams: {
- zfpcrId:null,
- type:'1'
- },
- //合同附件
- contractFileList:[],
- //发票附件
- invoiceFileList:[],
- //其他文件
- otherFileList:[] ,
- //盖章文件
- creditSealList:[],
- //开立方编号
- zfiCoreId:"",
- //接收方
- zfiSupplierId:"",
- openFile:false,
- wordUrl: "",
- show:false,
- heid:false,
- chooseTicket:[],
- payDate:null,
- //内部审批控制
- isHas:true,
- //提交按钮
- submitButton:true,
- //签收按钮
- signButton:true,
- pdfFileList : [],
- pdfShowDialog : false,
- parent : this,
- //平台审批状态
- zfiPlatformStatus:"",
- //显示去融资框
- goShow:false
- };
- },
- /* watch:{
- 'form.zfiCoreQuotaId':'change'
- }, */
- activated() {
- const zfiId = this.$route.params && this.$route.params.zfiId;
- getCreditDetail(zfiId).then((response) => {
- if(response.data){
- //接收方编号
- /* this.supplierForm.zfiSupplierId = response.data.financeInf.zfiSupplierId;
- getReceiverList(this.supplierForm).then((response) => {
- this.supplierList = response.data.records.map(item => {
- return { value: item.scyId, label: item.scyName};
- });
- });
- this.listCreditLine(response.data); */
- this.form = response.data.financeInf;
- //开立方
- this.form.openName = response.data.openName;
- //接收方
- this.form.receiveName = response.data.receiveName;
- //产品
- this.form.zfpName = response.data.zfpName;
- //创建人
- this.form.createName = response.data.createName;
- //签发金额大写
- this.issuedAmount = this.smallToBig(this.form.zfiAmount);
- //开立方编号
- this.zfiCoreId = response.data.financeInf.zfiCoreId;
- //接收方
- this.zfiSupplierId = response.data.financeInf.zfiSupplierId;
- //平台
- this.zfiPlatformStatus = response.data.zfiPlatformStatus;
- }
- if(response.data.payList){
- this.ticketList = response.data.payList.records;
- this.getReTotal(this.ticketList);
- //附件
- this.getFile(this.ticketList);
- }
- //盖章合同
- this.getCreditSealFile();
- //判断有无开启审批
- this.isOpenApproval();
- })
- },
- methods: {
- // 取消按钮
- cancel() {
- this.$store.dispatch("tagsView/delView", this.$route);
- this.$router.go(-1);
- },
- /* 多选框跨页 */
- rowkeyCustomer(row) {
- return row.cciId;
- },
- //获取附件信息
- getFile(datas){
- var queryParamsFile = {};
- queryParamsFile.ticketList = datas;
- getFile(queryParamsFile).then((response) => {
- if(response.data){
- //获取发票文件
- this.invoiceFileList = response.data.invoiceFileList;
- //获取合同文件
- this.contractFileList = response.data.contractFileList;
- //获取其他文件
- this.otherFileList = response.data.otherFileList;
- }
- });
- },
- //获取盖章文件
- getCreditSealFile(){
- getCreditSealFile(this.form).then((response) => {
- if(response.data.list){
- this.creditSealList = response.data.list;
- }
- });
- },
- resetQuerys() {
- this.resetForm("formQuery");
- this.handleQuerys();
- },
- //回到父页
- cancelGo(){
- this.goShow = false;
- this.$store.dispatch(
- "tagsView/delView",
- this.$route
- );
- this.$router.go(-1);
- },
- handleQuerys() {
- this.queryParamsPay.pageNum = 1;
- this.getAccountsCollection();
- },
- //打开应收账款选择列表
- openTicket() {
- this.queryParamsPay.zbiName = "";
- this.queryParamsPay.pageNum = 1;
- this.getAccountsCollection();
- this.open = true;
- this.payTitle = "应收账款";
- },
- //核心授信额度
- /* listCreditLine(data){
- this.creditParams.zfpcrId = data.financeInf.zfiCoreQuotaId;
- listCreditLine(this.creditParams).then((response) => {
- this.creditLineList = response.data.map(item => {
- return { value: item.zfpcrId, label: item.zfpName,zfpcrDateType:item.zfpcrDateType,zfpcrEndDate:item.zfpcrEndDate,zfpcrLoanType:item.zfpcrLoanType,zfpSplit:item.zfpSplit,zfpId:item.zfpId,zfpcrRate:item.zfpcrRate};
- });
- this.form = data.financeInf;
- //开立方
- this.form.openName = data.openName;
- //创建人
- this.form.createName = data.createName;
- //签发金额大写
- this.issuedAmount = this.smallToBig(this.form.zfiAmount);
- //开立方编号
- this.zfiCoreId = data.financeInf.zfiCoreId;
- //接收方
- this.zfiSupplierId = data.financeInf.zfiSupplierId;
- });
- }, */
- //应收账款查询列表
- getAccountsCollection() {
- //开立方
- this.queryParamsPay.payId = this.zfiCoreId;
- //接收方
- this.queryParamsPay.zfiSupplierId = this.zfiSupplierId;
- return getAccountsCollection(this.queryParamsPay).then((response) => {
- this.payList = response.data.records;
- this.selectChecked();
- this.total = response.data.total;
- return Promise.resolve(response)
- });
- },
- selectChecked() {
- //清空选择
- this.$refs.tablePay && this.$refs.tablePay.clearSelection();
- this.ticketList.forEach((item) => {
- this.payList.forEach(row => {
- if (row.zbiId == item.zbiId) {
- this.$nextTick(() => {
- this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(row, true);
- })
- }
- });
- });
- //合计
- this.getReTotal(this.ticketList);
- //附件
- this.getFile(this.ticketList);
- },
- //文件下载
- handleDownload(row){
- debugger
- const pfiUrl = row.pfiUrl;
- if(pfiUrl != null && pfiUrl != ''){
- window.open(pfiUrl +"/"+ getToken());
- }else{
- this.$message({
- message: '该附件不存在!',
- type: 'warning'
- });
- return;
- }
- },
- /* 删除按钮 */
- handleDelete(index, rows) {
- rows.splice(index, 1);
- if(this.$refs.tablePay){
- this.$refs.tablePay.clearSelection();
- }
- this.selectChecked();
- },
- /* 修改按钮 */
- handleUpdate(index, rows) {
- this.zbiId = rows[index].zbiId;
- this.openEditBill = true
- },
- /* 多选框跨页 */
- rowkey(row) {
- return row.zbiId;
- },
- // 多选框选中数据
- handleSelectionChange(val) {
- this.chooseTicket = val
- },
- // 确认选择
- closeTicket() {
- if(this.chooseTicket.length > 0){
- var flag = true;
- //获取选中第一个的预计还款日期
- var zbiPayDate = this.chooseTicket[0].zbiPayDate;
- for(var i = 0 ;i < this.chooseTicket.length;i++){
- if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
- flag = false;
- this.$message({
- message: '请选择预计还款日期相同的应收账款',
- type: 'warning'
- });
- break;
- }
- }
- if(flag){
- //合计
- this.getReTotal(this.chooseTicket);
- this.ticketList = this.chooseTicket;
- //更新附件信息
- this.getFile(this.ticketList);
- this.open = false;
- }
-
- }else{
- this.$message({
- message: '请选择应收账款',
- type: 'warning'
- });
- }
- },
- //重新合计
- getReTotal(chooseTicket){
- //合计
- this.checkTotalAmt = "0.00";
- for(var i = 0; i < chooseTicket.length;i++){
- this.checkTotalAmt = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
- }
- this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
- this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
- },
- //取消选择按钮
- cancelTicket(){
- /* this.ticketList = [];
- if(this.$refs.tablePay){
- this.$refs.tablePay.clearSelection();
- } */
- this.open = false;
- },
- /** 清空选择信息 */
- deleteTicekt() {
- this.ticketList = [];
- this.checkTotalAmt = "0.00";
- this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
- if(this.$refs.tablePay){
- this.$refs.tablePay.clearSelection();
- }
- //更新附件
- this.getFile(this.ticketList);
- },
- /* 删除按钮 */
- handleDelete(index, rows) {
- rows.splice(index, 1);
- if(this.$refs.tablePay){
- this.$refs.tablePay.clearSelection();
- }
- this.selectChecked();
- },
- onSelectAll() {
- if(this.$refs.tablePay){
- this.$refs.tablePay.clearSelection();
- }
- },
- //格式化金额
- amtFormat(cellValue) {
- if(cellValue == null || cellValue== undefined || cellValue == ''){
- cellValue = '0.00'
- }
- cellValue += '';
- if (!cellValue.includes('.')) {
- cellValue += '.00';
- }
- return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
- return $1 + ',';
- }).replace(/\.$/, '');
- },
- //获取签发金额大写
- getBigSmall(){
- this.issuedAmount = this.smallToBig(this.form.zfiAmount);
- },
- /* // 将数字金额转换为大写金额 */
- smallToBig(money) {
- // 将数字金额转换为大写金额
- var cnNums = new Array(
- "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
- var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
- var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
- var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
- var cnInteger = "整"; //整数金额时后面跟的字符
- var cnIntLast = "元"; //整数完以后的单位
- //最大处理的数字
- var maxNum = 999999999999999.9999;
- var integerNum; //金额整数部分
- var decimalNum; //金额小数部分
- //输出的中文金额字符串
- var chineseStr = "";
- var parts; //分离金额后用的数组,预定义
- if (money == "" || money == null || money == undefined) {
- return "零元零角零分";
- }
- money = parseFloat(money);
- if (money >= maxNum) {
- //超出最大处理数字
- return "超出最大处理数字";
- }
- if (money == 0) {
- chineseStr = cnNums[0] + cnIntLast + cnInteger;
- return chineseStr;
- }
- //四舍五入保留两位小数,转换为字符串
- money = Math.round(money * 100).toString();
- integerNum = money.substr(0, money.length - 2);
- decimalNum = money.substr(money.length - 2);
- //获取整型部分转换
- if (parseInt(integerNum, 10) > 0) {
- var zeroCount = 0;
- var IntLen = integerNum.length;
- for (var i = 0; i < IntLen; i++) {
- var n = integerNum.substr(i, 1);
- var p = IntLen - i - 1;
- var q = p / 4;
- var m = p % 4;
- if (n == "0") {
- zeroCount++;
- } else {
- if (zeroCount > 0) {
- chineseStr += cnNums[0];
- }
- //归零
- zeroCount = 0;
- chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
- }
- if (m == 0 && zeroCount < 4) {
- chineseStr += cnIntUnits[q];
- }
- }
- chineseStr += cnIntLast;
- }
- //小数部分
- if (decimalNum != "") {
- var decLen = decimalNum.length;
- for (var i = 0; i < decLen; i++) {
- var n = decimalNum.substr(i, 1);
- if (n != "0") {
- chineseStr += cnNums[Number(n)] + cnDecUnits[i];
- }
- }
- }
- if (chineseStr == "") {
- chineseStr += cnNums[0] + cnIntLast + cnInteger;
- } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
- chineseStr += cnInteger;
- }
- return chineseStr;
- },
- //选择授信触发
- /* change(val) {
- if (!val) {
- //可用额度
- this.availableAmt = "0.00";
- //有效期
- this.validityDate ="";
- //产品是否可拆分
- this.zfpSplit= "",
- //融资放款方式
- this.zfpcrLoanType = "";
- //产品
- this.zfpId = "";
- //利率
- this.zfiRate = "";
- return;
- }
- let obj = {};
- obj = this.creditLineList.find(item => {
- return item.value === val;
- });
- //获取有效期的类型
- this.zfpcrDateType = obj.zfpcrDateType;
- //产品是否可拆分
- this.zfpSplit= obj.zfpSplit;
- //放款方式
- this.zfpcrLoanType = obj.zfpcrLoanType;
- //产品
- this.zfpId = obj.zfpId;
- //利率
- this.zfiRate = obj.zfpcrRate;
- //长期
- if("0"== this.zfpcrDateType){
- this.validityDate = "长期";
- }else{
- this.validityDate = obj.zfpcrEndDate;
- }
- var lineQueryParam = {};
- lineQueryParam.zfpcrId = val;
- //获取可用额度
- getAvailableBalance(lineQueryParam).then((response) => {
- this.availableAmt = response.data.remaining;
- });
- }, */
- //内部审批
- submitForm(){
- this.$refs["form"].validate(valid => {
- if(this.ticketList.length < 1){
- this.$message({
- message: '请选择应收账款',
- type: 'warning'
- });
- return;
- }
- if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
- this.$message({
- message: '签发金额不可大于合计金额',
- type: 'warning'
- });
- return;
- }
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: 'Loading',
- background: 'rgba(0, 0, 0,0)'
- });
- //如果签发金额小于合计金额
- if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
- var _this = this;
- this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- //应收账款
- _this.form.ticketList = _this.ticketList;
- addInfor(_this.form).then(response => {
- loading.close();
- _this.msgSuccess("融信资料已提交内部审批");
- _this.$store.dispatch("tagsView/delView", _this.$route);
- _this.$router.go(-1);
- }).catch((response)=>{
- loading.close();
- });
- }).catch((e) => {
- loading.close();
- });
- }else{
- //应收账款
- this.form.ticketList = this.ticketList;
- addInfor(this.form).then(response => {
- loading.close();
- this.msgSuccess("融信资料已提交内部审批");
- this.$store.dispatch("tagsView/delView", this.$route);
- this.$router.go(-1);
- }).catch((response)=>{
- loading.close();
- });
- }
- }
- });
- },
- //金额去掉千分位
- moneyDelete(num){
- if(num &&num != undefined && num != null){
- let _num = num;
- _num = _num.toString();
- _num = _num.replace(/,/gi,'');
- return _num;
- }else{
- return num;
- }
- },
- //预览
- handlePreview(row) {
- const pfiUrl = row.pfiUrl;
- const pfiFileName = row.pfiFileName;
- if (row.pfiUrl) {
- console.log(pfiFileName.substr(-3));
- if (pfiFileName.substr(-3) == "pdf") {
- this.wordUrl = pfiUrl + "/" + getToken();
- this.show=false;
- this.heid=true;
- } else if (
- pfiFileName.substr(-3) == "jpg" ||
- pfiFileName.substr(-3) == "png" ||
- pfiFileName.substr(-3) == "JPG" ||
- pfiFileName.substr(-3) == "PNG" ||
- pfiFileName.substr(-4) == "jpeg" ||
- pfiFileName.substr(-3) == "JPEG"
- ) {
- this.wordUrl =
- pfiUrl +
- "/" +
- getToken();
- this.show=true;
- this.heid=false;
- console.log("====>",this.wordUrl);
- } else if (
- pfiFileName.substr(-3) == "doc" ||
- pfiFileName.substr(-3) == "DOC"||
- pfiFileName.substr(-4) == "docx" ||
- pfiFileName.substr(-3) == "DOCX"
- ) {
- this.wordUrl =
- "https://view.officeapps.live.com/op/view.aspx?src=" +
- pfiUrl +
- "/" +
- getToken() +
- "/" +
- pfiFileName;
- this.show=false;
- this.heid=true;
- console.log("====>",this.wordUrl);
- } else {
- this.$message({
- message: "暂不支持该类型文件预览",
- type: "warning",
- });
- return;
- }
- }
- this.openFile = true;
- },
- //新增应付
- addPay(){
- //获取选中第一个的预计还款日期
- if(this.chooseTicket[0]){
- var zbiPayDate = this.chooseTicket[0].zbiPayDate;
- this.payDate = zbiPayDate;
- }
- if(this.form.zfiCoreId){
- this.openAddBill = true
- }else{
- this.$message({
- message: "开立方不能为空",
- type: "warning",
- });
- }
- },
- //新增账款回调
- emitAddClick(val){
- var self = this
- this.getAccountsCollection().then((response) => {
- //新增付款返回id直接选中
- if (val) {
- self.payList.forEach(element => {
- if(element.zbiId == val){
- // 将当前点击项选中
- self.chooseTicket.push(element)
- self.closeTicket()
- }
- });
- }
- })
- self.openAddBill = false
- },
- //修改账款回调
- emitEditClick(val) {
- var self = this
- this.getAccountsCollection().then((response) => {
- //修改付款返回id直接选中
- if (val) {
- // self.payList.forEach(element => {
- // if (element.zbiId == val) {
- // // 将当前点击项选中
- // // self.chooseTicket.push(element)
- // //self.closeTicket()
- // }
- // });
- console.log(self.chooseTicket)
- self.ticketList = self.chooseTicket
- self.closeTicket()
- }
- })
- self.openEditBill = false
- },
- //判断有无补充资料内部审批
- isOpenApproval(){
- console.log("1111");
- // 平台审批通过
- if (this.form.zfiPlatformStatus == '01') {
- this.signButton = true;
- this.isHas = false;
- this.submitButton = false;
- //如果显示签收,调起预览文件
- this.getContractFile(true);
- // 平台审批拒绝
- } else if (this.form.zfiPlatformStatus == '02') {
- // 融信状态为平台退回
- if (this.form.zfiStatus == '06') {
- // 判断是否有内部审批
- var confirmParam = {};
- confirmParam.menuId = "1000000003";
- isOpenApproval(confirmParam).then((response) => {
- var result = response.data.isOpen;
- // 有内部审批
- if (result) {
- this.signButton = false;
- this.isHas = true;
- this.submitButton = false;
- // 没有内部审批
- } else {
- // 判断是否有平台审批
- var platParam = {};
- platParam.menuId = "1000000004";
- isOpenApproval(platParam).then((response) => {
- var platResult = response.data.isOpen;
- //开启平台审批,显示提交按钮
- if(platResult){
- this.submitButton = true;
- this.isHas = false;
- this.signButton = false;
- //如果显示签收,调起预览文件
- this.getContractFile(true);
- }else{
- //未开启平台审批,显示签收按钮
- this.signButton = true;
- this.submitButton = false;
- this.isHas = false;
- //如果显示签收,调起预览文件
- this.getContractFile(true);
- }
- });
- }
- })
- // 融信状态为 待签收
- } else if(this.form.zfiStatus == '01') {
- //不存在此情况
- }
- // 平台未审批
- } else if (this.form.zfiPlatformStatus == null || this.form.zfiPlatformStatus == "04") {
- // 融资审批状态
- if (this.form.zfiSupplierStatus == '01') {
- //不存在此情况
- // 融资审批状态为拒绝 或者 为 null
- } else if (this.form.zfiSupplierStatus == '02' || this.form.zfiSupplierStatus == null) {
- // 判断是否有内部审批
- var confirmParam = {};
- confirmParam.menuId = "1000000003";
- isOpenApproval(confirmParam).then((response) => {
- var result = response.data.isOpen;
- // 有内部审批
- if (result) {
- this.signButton = false;
- this.isHas = true;
- this.submitButton = false;
- // 没有内部审批
- } else {
- // 判断是否有平台审批
- var platParam = {};
- platParam.menuId = "1000000004";
- isOpenApproval(platParam).then((response) => {
- var platResult = response.data.isOpen;
- //开启平台审批,显示提交按钮
- if(platResult){
- this.submitButton = true;
- this.isHas = false;
- this.signButton = false;
- }else{
- //未开启平台审批,显示签收按钮
- this.signButton = true;
- this.submitButton = false;
- this.isHas = false;
- }
- });
- }
- })
- }
- }
- },
- //拒签
- refuse(){
- creditRefuse(this.form).then(response => {
- const loading = this.$loading({
- lock: true,
- text: 'Loading',
- background: 'rgba(0, 0, 0,0)'
- });
- loading.close();
- this.msgSuccess("该笔融信将作废");
- this.$store.dispatch("tagsView/delView",this.$route);
- this.$router.go(-1);
- }).catch((response)=>{
- loading.close();
- });
- },
- //提交
- submit(){
- this.$refs["form"].validate(valid => {
- if(this.ticketList.length < 1){
- this.$message({
- message: '请选择应收账款',
- type: 'warning'
- });
- return;
- }
- if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
- this.$message({
- message: '签发金额不可大于合计金额',
- type: 'warning'
- });
- return;
- }
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: 'Loading',
- background: 'rgba(0, 0, 0,0)'
- });
- //如果签发金额小于合计金额
- if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
- var _this = this;
- this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- //应收账款
- _this.form.ticketList = _this.ticketList;
- addInfor(_this.form).then(response => {
- loading.close();
- _this.msgSuccess("平台正在审核资料,平台审核时间为工作日:9:00—18:00;单日16:00之前提交资料,预计2小时内完成,请平台审批通过后,再次签署");
- _this.$store.dispatch("tagsView/delView", _this.$route);
- _this.$router.go(-1);
- }).catch((response)=>{
- loading.close();
- });
- }).catch((e) => {
- loading.close();
- });
- }else{
- //应收账款
- this.form.ticketList = this.ticketList;
- addInfor(this.form).then(response => {
- loading.close();
- this.msgSuccess("平台正在审核资料,平台审核时间为工作日:9:00—18:00;单日16:00之前提交资料,预计2小时内完成,请平台审批通过后,再次签署");
- this.$store.dispatch("tagsView/delView", this.$route);
- this.$router.go(-1);
- }).catch((response)=>{
- loading.close();
- });
- }
- }
- });
- },
- //签收
- sign(){
- //预览文件
- this.getContractFile();
- },
- //获取合同文件
- getContractFile(nosign){
- const loading = this.$loading({
- lock: true,
- text: 'Loading',
- background: 'rgba(0, 0, 0,0)'
- });
- getContractFile(this.form).then((response) => {
- loading.close();
- if(response.data.list){
- this.pdfFileList = response.data.list;
- }
- //文件存在
- if(this.pdfFileList.length > 0 ){
- this.pdfShowDialog = true;
- }else{
- /* this.$message({
- message: '文件不存在!',
- type: 'warning'
- }); */
- //文件不存在并且不是一进去页面调用的直接盖章
- if (!nosign) {
- this.contractSigning();
- }
- }
- }).catch((response)=>{
- loading.close();
- });
- },
- closePdfShow(){
- this.pdfShowDialog = false;
- },
- //盖章
- contractSigning(){
- const loading = this.$loading({
- lock: true,
- text: 'Loading',
- background: 'rgba(0, 0, 0,0)'
- });
- contractSigning(this.form).then((response) => {
- loading.close();
- const zfiId = this.$route.params && this.$route.params.zfiId;
- getFinanceSign(zfiId).then((response) => {
- //融信编号
- this.financeSignForm.zfiNumber = response.data.zfiNumber;
- //融信金额
- this.financeSignForm.zfiAmount = response.data.zfiAmount;
- //利率
- this.financeSignForm.zfiRate = response.data.zfiRate;
- //最长融信期限
- this.financeSignForm.intervalTime = response.data.intervalTime;
- //融信有效期
- this.financeSignForm.validity = response.data.validity;
- this.goShow = true;
- });
- }).catch((response) => {
- loading.close();
- });
- },
- //去融资
- goFinance(){
- //关闭当前页
- this.$store.dispatch(
- "tagsView/delView",
- this.$route
- );
- //关闭弹框
- this.goShow = false;
- Cookies.set("/credit/goFinance/"+this.form.zfiId + "/", this.$route.fullPath)
- this.$router.push({ path: "/credit/goFinance/"+this.form.zfiId + "/" });
- },
- //返回到列表页
- goParent(){
- var self = this
- this.pdfShowDialog = false;
- self.$store.dispatch(
- "tagsView/delView",
- self.$route
- );
- //self.$router.push("/Bill/credit")
- self.$router.push("/Bill/finance/credit")
- },
- /* 金额展示 */
- handleInput(str) {
- return amtformat(str, 2, ".", ",");
- },
-
- }
- };
- </script>
- <style lang="scss">
- .uoloadfj .el-upload--picture-card{
- width:110px;
- height:110px;
- line-height:110px;
- }
- .fjUoloadSty .el-upload--picture-card{
- display:none;
- }
- table th.star div::before {
- content: '*';
- color: red;
- }
- </style>
|