confirmationAudit.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  1. <template>
  2. <el-tabs type="border-card">
  3. <!-- 资产信息-->
  4. <el-tab-pane label="资产信息">
  5. <!-- <div class="app-container"> -->
  6. <el-form ref="form" :model="form" :rules="rules" :inline="true" style="margin-top: 10px" label-width="auto" >
  7. <el-row>
  8. <el-col :span="8">
  9. <el-form-item label="融信编号" prop="zfiNumber">
  10. <el-input v-model="form.zfiNumber" style="width: 200px" disabled/>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="8">
  14. <el-form-item label="创建时间" prop="createTime">
  15. <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
  16. </el-date-picker>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="8">
  20. <el-form-item label="创建人" prop="createName">
  21. <el-input v-model="form.createName" style="width: 200px" disabled/>
  22. </el-form-item>
  23. </el-col>
  24. </el-row>
  25. <el-row>
  26. <el-divider content-position="left" >资产信息</el-divider>
  27. <el-form-item style="margin-left: 100px">
  28. <!-- <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
  29. <el-button size="mini" @click="deleteTicekt">清空全部</el-button> -->
  30. <el-form-item label="合计金额:">
  31. <span>{{checkTotalAmt}}</span>
  32. </el-form-item>
  33. <el-form-item label="金额大写:">
  34. <span>{{checkTotalBigAmt}}</span>
  35. </el-form-item>
  36. <el-table :data="ticketList" style="width: 1100px">
  37. <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
  38. <el-table-column label="应收企业" align="center" prop="receiveName"/>
  39. <el-table-column label="应付企业" align="center" prop="payName" />
  40. <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
  41. <el-table-column label="金额" align="center" prop="zbiAmount" />
  42. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
  43. <template slot-scope="scope">
  44. <el-button
  45. size="mini"
  46. type="text"
  47. icon="el-icon-delete"
  48. @click="handleDelete(scope.$index, ticketList)"
  49. >删除</el-button>
  50. </template>
  51. </el-table-column> -->
  52. </el-table>
  53. </el-form-item>
  54. <el-col :span="8">
  55. <el-form-item label="开立方" prop="openName">
  56. <el-input v-model="form.openName" style="width: 200px" disabled />
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="8">
  60. <el-form-item label="接收方" prop="receiveName">
  61. <el-input v-model="form.receiveName" style="width: 200px" disabled />
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="8">
  65. <el-form-item label="签发有效期" prop="zfiEffectiveDate">
  66. <el-date-picker clearable size="small" style="width: 200px" :disabled="isUpdate"
  67. v-model="form.zfiEffectiveDate"
  68. type="date"
  69. value-format="yyyy-MM-dd"
  70. placeholder="选择签发有效期"
  71. :picker-options="pickerOptions">
  72. </el-date-picker>
  73. </el-form-item>
  74. </el-col>
  75. </el-row>
  76. <el-row>
  77. <el-col :span="8">
  78. <el-form-item label="承诺还款日" prop="zfiExpireDate">
  79. <el-date-picker clearable size="small" style="width: 200px"
  80. v-model="form.zfiExpireDate"
  81. type="date"
  82. value-format="yyyy-MM-dd"
  83. placeholder="选择承诺还款日"
  84. :picker-options="pickerOptions">
  85. </el-date-picker>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="8" v-if="this.zfiCreateType == 0">
  89. <el-form-item label="授信额度" prop="zfiCoreQuotaId">
  90. <el-select style="width:300px" v-model="form.zfiCoreQuotaId" filterable clearable remote>
  91. <el-option v-for="item in creditLineList" :key="item.value" :label="item.label+'/'+item.remaining" :value="item.value">
  92. </el-option>
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="8" v-if="this.zfiCreateType != 0">
  97. <el-form-item label="授信额度" prop="zfpName" >
  98. <el-input v-model="form.zfpName" style="width: 300px" disabled/>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="8" v-if="this.zfiCreateType == 0">
  102. <span style="display:none">可用额度:</span>
  103. <span style="display:none">{{availableAmt}}</span>
  104. <span>有效期:</span>
  105. <span>{{validityDate}}</span>
  106. <br>
  107. <span>最小融资金额:</span>
  108. <span>{{zfpMinimumAmount}}</span>
  109. </el-col>
  110. </el-row>
  111. <el-row>
  112. <el-col :span="8">
  113. <el-form-item label="签发金额" prop="zfiAmount">
  114. <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall"  @input.native="changeRate($event,form.zfiAmount)"/>
  115. </el-form-item>
  116. </el-col>
  117. <!-- <el-col :span="8">
  118. <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="zfpcrLoanType != '0'">
  119. <el-input v-model="form.zfiCollectionAccount" style="width: 200px" />
  120. </el-form-item>
  121. </el-col> -->
  122. </el-row>
  123. <el-row>
  124. <el-col :span="8">
  125. <el-form-item label="金额大写" prop="issuedAmount">
  126. {{issuedAmount}}
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. </el-form>
  131. <!-- 发票附件 -->
  132. <el-divider content-position="left">发票附件</el-divider>
  133. <el-table :data="invoiceFileList" style="width: 100%">
  134. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  135. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  136. <template slot-scope="scope">
  137. <el-button
  138. size="mini"
  139. type="text"
  140. icon="el-icon-view"
  141. @click="handleDownload(scope.row)"
  142. >下载</el-button>
  143. <el-button
  144. size="mini"
  145. type="text"
  146. icon="el-icon-view"
  147. @click="handlePreview(scope.row)"
  148. >预览</el-button>
  149. </template>
  150. </el-table-column>
  151. </el-table>
  152. <!-- 合同附件 -->
  153. <el-divider content-position="left">合同附件</el-divider>
  154. <el-table :data="contractFileList" style="width: 100%">
  155. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  156. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  157. <template slot-scope="scope">
  158. <el-button
  159. size="mini"
  160. type="text"
  161. icon="el-icon-view"
  162. @click="handleDownload(scope.row)"
  163. >下载</el-button>
  164. <el-button
  165. size="mini"
  166. type="text"
  167. icon="el-icon-view"
  168. @click="handlePreview(scope.row)"
  169. >预览</el-button>
  170. </template>
  171. </el-table-column>
  172. </el-table>
  173. <!-- 其他附件 -->
  174. <el-divider content-position="left">其他附件</el-divider>
  175. <el-table :data="otherFileList" style="width: 100%">
  176. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  177. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  178. <template slot-scope="scope">
  179. <el-button
  180. size="mini"
  181. type="text"
  182. icon="el-icon-view"
  183. @click="handleDownload(scope.row)"
  184. >下载</el-button>
  185. <el-button
  186. size="mini"
  187. type="text"
  188. icon="el-icon-view"
  189. @click="handlePreview(scope.row)"
  190. >预览</el-button>
  191. </template>
  192. </el-table-column>
  193. </el-table>
  194. <div class="footer" style="float: right;
  195. margin-bottom:1px;">
  196. <el-button type="info" @click="submitForm('01')">拒绝</el-button>
  197. <el-button type="primary" @click="submitForm('00')" v-if="isHas">内部审批</el-button>
  198. <el-button type="primary" @click="confirmApproval()" v-if="!isHas">确权</el-button>
  199. <el-button @click="cancel">取 消</el-button>
  200. </div>
  201. <!-- 应付账款信息 -->
  202. <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
  203. <el-form :model="queryParamsPay" ref="formQuery" :inline="true" label-width="68px" style="margin-bottom: -21px">
  204. <el-form-item label="账款名称" prop="zbiName">
  205. <el-input
  206. v-model="queryParamsPay.zbiName"
  207. placeholder="请输入账款名称"
  208. clearable
  209. size="small"
  210. maxlength="11"
  211. @keyup.enter.native="handleQuerys"/>
  212. </el-form-item>
  213. <el-form-item label="应付企业" prop="payName">
  214. <el-input
  215. v-model="queryParamsPay.payName"
  216. placeholder="请输入应付企业"
  217. clearable
  218. size="small"
  219. maxlength="11"
  220. @keyup.enter.native="handleQuerys"/>
  221. </el-form-item>
  222. <el-form-item>
  223. <el-button
  224. type="cyan"
  225. icon="el-icon-search"
  226. size="mini"
  227. @click="handleQuerys"
  228. >搜索</el-button>
  229. <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
  230. >重置</el-button>
  231. </el-form-item>
  232. </el-form>
  233. <el-table :data="payList"
  234. ref="tablePay"
  235. class="single-select-table"
  236. @selection-change="handleSelectionChange"
  237. :row-key="rowkey">
  238. <el-table-column
  239. type="selection"
  240. :reserve-selection="true"
  241. width="50"
  242. align="center"/>
  243. <el-table-column label="序号" type="index" width="50" align="center">
  244. <template slot-scope="scope">
  245. <span>{{ (queryParamsPay.pageNum - 1) * queryParamsPay.pageSize + scope.$index + 1}}</span>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
  249. <el-table-column label="应收企业" align="center" prop="receiveName"/>
  250. <el-table-column label="应付企业" align="center" prop="payName" />
  251. <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
  252. <el-table-column label="金额" align="center" prop="zbiAmount" />
  253. </el-table>
  254. <pagination
  255. v-show="total > 0"
  256. :total="total"
  257. :page.sync="queryParamsPay.pageNum"
  258. :limit.sync="queryParamsPay.pageSize"
  259. @pagination="getAccountsCollection" />
  260. <span slot="footer" class="dialog-footer">
  261. <el-button size="mini" @click="cancelTicket">取消</el-button>
  262. <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
  263. </span>
  264. </el-dialog>
  265. <!--预览-->
  266. <el-dialog :visible.sync="openFile" width="1000px" append-to-body>
  267. <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
  268. <iframe :src="wordUrl" width='800px' height='600px' frameborder='1' v-if="heid"/>
  269. </el-dialog>
  270. <el-dialog
  271. :visible.sync="pdfShowDialog"
  272. width="70%"
  273. height = "60%"
  274. append-to-body>
  275. <pdf-show :pdfFileList="pdfFileList" :zfiId="this.form.zfiId" :parent="parent">
  276. </pdf-show>
  277. </el-dialog>
  278. </el-tab-pane>
  279. <!-- 签署合同-->
  280. <el-tab-pane label="签署合同">
  281. <el-table :data="creditSealList" style="width: 100%">
  282. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
  283. <template slot-scope="scope">
  284. <img style="width:30px;height:30px;"
  285. src="../../../assets/images/pdf.png"
  286. />
  287. <span>{{scope.row.pfiFileName}}
  288. </span>
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  292. <template slot-scope="scope">
  293. <el-button
  294. size="mini"
  295. type="text"
  296. icon="el-icon-view"
  297. @click="handleDownload(scope.row)"
  298. >下载</el-button>
  299. <el-button
  300. size="mini"
  301. type="text"
  302. icon="el-icon-view"
  303. @click="handlePreview(scope.row)"
  304. >预览</el-button>
  305. </template>
  306. </el-table-column>
  307. </el-table>
  308. </el-tab-pane>
  309. <!-- </div> -->
  310. </el-tabs>
  311. </template>
  312. <script>
  313. import {listCreditLine,getCreditDetail,getAccountsCollection,getAvailableBalance,getFile} from "@/api/service/credit/credit";
  314. import {approveCredit,getCreditSealFile,getContractFile} from "@/api/service/credit/creditHandle";
  315. import {accAdd} from "@/utils/calculation";
  316. import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
  317. import {getToken} from "@/utils/auth";
  318. import pdfShow from "./pdfShow";
  319. export default {
  320. name: "addCredit",
  321. components: {pdfShow},
  322. data() {
  323. return {
  324. // 总条数
  325. total: 0,
  326. // 查询参数
  327. queryParams: {
  328. pageNum: 1,
  329. pageSize: 10,
  330. },
  331. creditParams: {
  332. zfsqId:null,
  333. type: "1",
  334. },
  335. supplierCreditParams: {
  336. zfsqId:null
  337. },
  338. queryParamsPay: {
  339. pageNum: 1,
  340. pageSize: 10,
  341. payName:null,
  342. zbiName:null
  343. },
  344. // 表单参数
  345. form: {
  346. },
  347. // 表单校验
  348. rules: {
  349. /* //签发有效期
  350. zfiEffectiveDate: [
  351. {
  352. required: true,
  353. message: "请选择签发有效期",
  354. trigger: ["blur", "change"],
  355. },
  356. ],
  357. //承诺还款日
  358. zfiExpireDate: [
  359. {
  360. required: true,
  361. message: "请选择承诺还款日",
  362. trigger: ["blur", "change"],
  363. },
  364. ],
  365. //授信额度
  366. zfiCoreQuotaId: [
  367. {
  368. required: true,
  369. message: "请选择授信额度",
  370. trigger: ["blur", "change"],
  371. },
  372. ],
  373. //签发金额
  374. zfiAmount: [
  375. {
  376. required: true,
  377. message: "请输入签发金额",
  378. trigger: ["blur", "change"],
  379. },
  380. ] */
  381. },
  382. // 是否显示弹出层
  383. open: false,
  384. //授信
  385. creditLineList:[],
  386. //接收方
  387. supplierList:[],
  388. //应付账款
  389. payList:[],
  390. //应付账款表格数据
  391. ticketList: [],
  392. //应付标题
  393. payTitle:"",
  394. //可用额度
  395. availableAmt:"0.00",
  396. //有效期
  397. validityDate:"",
  398. //有效期类型
  399. zfpcrDateType:"" ,
  400. //合计选中的应付账款的金额
  401. checkTotalAmt:"0.00",
  402. //合计选中的应付账款的大写金额
  403. checkTotalBigAmt:"零元整",
  404. //签发金额大写
  405. issuedAmount:"零元整",
  406. //产品是否可拆分
  407. zfpSplit:"",
  408. //融资放款方式
  409. zfpcrLoanType:"",
  410. //产品编号
  411. zfpId:"",
  412. //利率
  413. zfpcrRate:'',
  414. //最小融资金额
  415. zfpMinimumAmount:"",
  416. //合同附件
  417. contractFileList:[],
  418. //发票附件
  419. invoiceFileList:[],
  420. //其他文件
  421. otherFileList:[],
  422. //盖章文件
  423. creditSealList:[],
  424. //融信类型
  425. zfiCreateType:"",
  426. //是否可编辑
  427. isUpdate:false,
  428. pickerOptions:{
  429. disabledDate(v){
  430. return v.getTime() < new Date().getTime()-86400000;
  431. }
  432. },
  433. openFile:false,
  434. wordUrl: "",
  435. show:false,
  436. heid:false,
  437. //控制通过,确权按钮展示或隐藏
  438. isHas:true,
  439. //融信编号
  440. zfiId:"",
  441. //核心审批状态
  442. zfiCoreStatus:"",
  443. pdfFileList : [],
  444. pdfShowDialog : false,
  445. parent : this,
  446. };
  447. },
  448. watch:{
  449. 'form.zfiCoreQuotaId':'change'
  450. },
  451. activated() {
  452. const zfiId = this.$route.params && this.$route.params.zfiId;
  453. this.zfiId = zfiId;
  454. getCreditDetail(zfiId).then((response) => {
  455. if(response.data){
  456. this.form = response.data.financeInf;
  457. //融信类型
  458. this.zfiCreateType = response.data.financeInf.zfiCreateType;
  459. //核心审批状态
  460. this.zfiCoreStatus = response.data.financeInf.zfiCoreStatus;
  461. //供应商开立
  462. if(this.zfiCreateType == '2'){
  463. this.isUpdate = true;
  464. }else{
  465. this.isUpdate = false;
  466. }
  467. //接收方
  468. this.form.receiveName = response.data.receiveName;
  469. //产品
  470. this.form.zfpName = response.data.zfpName;
  471. //开立方
  472. this.form.openName = response.data.openName;
  473. //创建人
  474. this.form.createName = response.data.createName;
  475. //签发金额大写
  476. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  477. }
  478. if(response.data.payList){
  479. this.ticketList = response.data.payList.records;
  480. this.getReTotal(this.ticketList);
  481. //附件
  482. this.getFile(this.ticketList);
  483. }
  484. //查询有无确权的内部审批
  485. this.isOpenApproval();
  486. //盖章合同
  487. this.getCreditSealFile();
  488. })
  489. //授信额度
  490. this.listCreditLine();
  491. },
  492. methods: {
  493. // 取消按钮
  494. cancel() {
  495. this.$store.dispatch("tagsView/delView", this.$route);
  496. this.$router.go(-1);
  497. },
  498. /* 多选框跨页 */
  499. rowkeyCustomer(row) {
  500. return row.cciId;
  501. },
  502. //供应商授信额度
  503. listCreditLine(){
  504. listCreditLine(this.creditParams).then((response) => {
  505. this.creditLineList = response.data.map((item) => {
  506. return {
  507. value: item.zfpcrId,
  508. label: item.zfpName,
  509. zfpcrDateType: item.zfpcrDateType,
  510. zfpcrEndDate: item.zfpcrEndDate,
  511. zfpcrLoanType: item.zfpcrLoanType,
  512. zfpSplit: item.zfpSplit,
  513. zfpId: item.zfpId,
  514. zfpcrRate:item.zfpcrRate,
  515. zfpAuthType:item.zfpAuthType,
  516. remaining:item.remaining,
  517. zfpMinimumAmount:item.zfpMinimumAmount
  518. };
  519. });
  520. });
  521. },
  522. //应收账款查询列表
  523. getAccountsCollection() {
  524. getAccountsCollection(this.queryParamsPay).then((response) => {
  525. this.payList = response.data.records;
  526. this.selectChecked();
  527. this.total = response.data.total;
  528. });
  529. },
  530. //文件下载
  531. handleDownload(row){
  532. const pfiUrl = row.pfiUrl;
  533. if(pfiUrl != null && pfiUrl != ''){
  534. window.open(pfiUrl +"/"+ getToken());
  535. }else{
  536. this.$message({
  537. message: '该附件不存在!',
  538. type: 'warning'
  539. });
  540. return;
  541. }
  542. },
  543. resetQuerys() {
  544. this.resetForm("formQuery");
  545. this.handleQuerys();
  546. },
  547. handleQuerys() {
  548. this.queryParamsPay.pageNum = 1;
  549. this.getAccountsCollection();
  550. },
  551. //打开应付账款选择列表
  552. openTicket() {
  553. //清空搜索条件
  554. this.queryParamsPay.zbiName = "";
  555. this.queryParamsPay.payName = "";
  556. this.queryParamsPay.pageNum = 1;
  557. this.getAccountsCollection();
  558. this.open = true;
  559. this.payTitle = "应收账款";
  560. },
  561. //获取签发金额大写
  562. getBigSmall(){
  563. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  564. },
  565. selectChecked() {
  566. this.ticketList.forEach((item) => {
  567. this.payList.forEach(row => {
  568. if (row.zbiId == item.zbiId) {
  569. this.$nextTick(() => {
  570. this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(row, true);
  571. })
  572. }
  573. });
  574. });
  575. //合计
  576. this.getReTotal(this.ticketList);
  577. //附件
  578. this.getFile(this.ticketList);
  579. },
  580. //获取附件信息
  581. getFile(datas){
  582. var queryParamsFile = {};
  583. queryParamsFile.ticketList = datas;
  584. getFile(queryParamsFile).then((response) => {
  585. if(response.data){
  586. //获取发票文件
  587. this.invoiceFileList = response.data.invoiceFileList;
  588. //获取合同文件
  589. this.contractFileList = response.data.contractFileList;
  590. //获取其他文件
  591. this.otherFileList = response.data.otherFileList;
  592. }
  593. });
  594. },
  595. //获取盖章文件
  596. getCreditSealFile(){
  597. getCreditSealFile(this.form).then((response) => {
  598. if(response.data.list){
  599. this.creditSealList = response.data.list;
  600. }
  601. });
  602. },
  603. /* 多选框跨页 */
  604. rowkey(row) {
  605. return row.zbiId;
  606. },
  607. // 多选框选中数据
  608. handleSelectionChange(val) {
  609. this.chooseTicket = val
  610. },
  611. // 确认选择
  612. closeTicket() {
  613. if(this.chooseTicket.length > 0){
  614. var flag = true;
  615. //获取选中第一个的应付企业
  616. var payName = this.chooseTicket[0].payName;
  617. //获取选中第一个的预计还款日期
  618. var zbiPayDate = this.chooseTicket[0].zbiPayDate;
  619. for(var i = 0 ;i < this.chooseTicket.length;i++){
  620. if(payName != this.chooseTicket[i].payName){
  621. flag = false;
  622. this.$message({
  623. message: '请选择应付企业相同的应付账款',
  624. type: 'warning'
  625. });
  626. break;
  627. }else if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
  628. flag = false;
  629. this.$message({
  630. message: '请选择预计还款日期相同的应付账款',
  631. type: 'warning'
  632. });
  633. break;
  634. }
  635. }
  636. if(flag){
  637. //合计
  638. this.getReTotal(this.chooseTicket);
  639. this.ticketList = this.chooseTicket;
  640. //附件
  641. this.getFile(this.ticketList);
  642. //开立方赋值
  643. this.$set(this.form, "openName",this.chooseTicket[0].payName);
  644. this.open = false;
  645. }
  646. }else{
  647. this.$message({
  648. message: '请选择应收账款',
  649. type: 'warning'
  650. });
  651. }
  652. },
  653. //重新合计
  654. getReTotal(chooseTicket){
  655. //合计
  656. this.checkTotalAmt = "0.00";
  657. for(var i = 0; i < chooseTicket.length;i++){
  658. this.checkTotalAmt = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
  659. }
  660. //签发金额
  661. // this.$set(this.form, "zfiAmount",this.checkTotalAmt);
  662. //签发金额大写
  663. //this.issuedAmount = this.smallToBig(this.checkTotalAmt);
  664. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  665. this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
  666. },
  667. //取消选择按钮
  668. cancelTicket(){
  669. /* this.ticketList = [];
  670. if(this.$refs.tablePay){
  671. this.$refs.tablePay.clearSelection();
  672. } */
  673. this.open = false;
  674. },
  675. /** 清空选择信息 */
  676. deleteTicekt() {
  677. this.ticketList = [];
  678. this.checkTotalAmt = "0.00";
  679. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  680. //开立方清空
  681. this.$set(this.form, "openName","");
  682. if(this.$refs.tablePay){
  683. this.$refs.tablePay.clearSelection();
  684. }
  685. this.getFile(this.ticketList);
  686. },
  687. /* 删除按钮 */
  688. handleDelete(index, rows) {
  689. rows.splice(index, 1);
  690. if(this.$refs.tablePay){
  691. this.$refs.tablePay.clearSelection();
  692. }
  693. this.selectChecked();
  694. },
  695. onSelectAll() {
  696. if(this.$refs.tablePay){
  697. this.$refs.tablePay.clearSelection();
  698. }
  699. },
  700. //选择授信触发
  701. change(val) {
  702. if (!val) {
  703. //可用额度
  704. this.availableAmt = "0.00";
  705. //有效期
  706. this.validityDate ="";
  707. //产品是否可拆分
  708. this.zfpSplit= "",
  709. //融资放款方式
  710. this.zfpcrLoanType = "";
  711. //产品
  712. this.zfpId = "";
  713. //利率
  714. this.zfpcrRate = "";
  715. //有效期类型
  716. this.zfpcrDateType = "";
  717. //最小融资金额
  718. this.zfpMinimumAmount = "";
  719. return;
  720. }
  721. let obj = {};
  722. obj = this.creditLineList.find(item => {
  723. return item.value === val;
  724. });
  725. //获取有效期的类型
  726. this.zfpcrDateType = obj.zfpcrDateType;
  727. //产品是否可拆分
  728. this.zfpSplit= obj.zfpSplit;
  729. //放款方式
  730. this.zfpcrLoanType = obj.zfpcrLoanType;
  731. //产品
  732. this.zfpId = obj.zfpId;
  733. //利率
  734. this.zfpcrRate = obj.zfpcrRate;
  735. //最小融资金额
  736. this.zfpMinimumAmount = obj.zfpMinimumAmount;
  737. //长期
  738. if("0"== this.zfpcrDateType){
  739. this.validityDate = "长期";
  740. }else{
  741. this.validityDate = obj.zfpcrEndDate;
  742. }
  743. var lineQueryParam = {};
  744. lineQueryParam.zfpcrId = val;
  745. //获取可用额度
  746. getAvailableBalance(lineQueryParam).then((response) => {
  747. this.availableAmt = response.data.remaining;
  748. });
  749. },
  750. //格式化金额
  751. amtFormat(cellValue) {
  752. if(cellValue == null || cellValue== undefined || cellValue == ''){
  753. cellValue = '0.00'
  754. }
  755. cellValue += '';
  756.       if (!cellValue.includes('.')) {
  757. cellValue += '.00';
  758. }
  759. console.log(cellValue);
  760.       return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  761.         return $1 + ',';
  762.       }).replace(/\.$/, '');
  763. },
  764. /* // 将数字金额转换为大写金额 */
  765. smallToBig(money) {
  766. // 将数字金额转换为大写金额
  767. var cnNums = new Array(
  768. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  769. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  770. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  771. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  772. var cnInteger = "整"; //整数金额时后面跟的字符
  773. var cnIntLast = "元"; //整数完以后的单位
  774. //最大处理的数字
  775. var maxNum = 999999999999999.9999;
  776. var integerNum; //金额整数部分
  777. var decimalNum; //金额小数部分
  778. //输出的中文金额字符串
  779. var chineseStr = "";
  780. var parts; //分离金额后用的数组,预定义
  781. if (money == "" || money == null || money == undefined) {
  782. return "零元零角零分";
  783. }
  784. money = parseFloat(money);
  785. if (money >= maxNum) {
  786. //超出最大处理数字
  787. return "超出最大处理数字";
  788. }
  789. if (money == 0) {
  790. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  791. return chineseStr;
  792. }
  793. //四舍五入保留两位小数,转换为字符串
  794. money = Math.round(money * 100).toString();
  795. integerNum = money.substr(0, money.length - 2);
  796. decimalNum = money.substr(money.length - 2);
  797. //获取整型部分转换
  798. if (parseInt(integerNum, 10) > 0) {
  799. var zeroCount = 0;
  800. var IntLen = integerNum.length;
  801. for (var i = 0; i < IntLen; i++) {
  802. var n = integerNum.substr(i, 1);
  803. var p = IntLen - i - 1;
  804. var q = p / 4;
  805. var m = p % 4;
  806. if (n == "0") {
  807. zeroCount++;
  808. } else {
  809. if (zeroCount > 0) {
  810. chineseStr += cnNums[0];
  811. }
  812. //归零
  813. zeroCount = 0;
  814. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  815. }
  816. if (m == 0 && zeroCount < 4) {
  817. chineseStr += cnIntUnits[q];
  818. }
  819. }
  820. chineseStr += cnIntLast;
  821. }
  822. //小数部分
  823. if (decimalNum != "") {
  824. var decLen = decimalNum.length;
  825. for (var i = 0; i < decLen; i++) {
  826. var n = decimalNum.substr(i, 1);
  827. if (n != "0") {
  828. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  829. }
  830. }
  831. }
  832. if (chineseStr == "") {
  833. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  834. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  835. chineseStr += cnInteger;
  836. }
  837. return chineseStr;
  838. },
  839. //提交
  840. submitForm(param){
  841. this.$refs["form"].validate(valid => {
  842. //通过
  843. if("00" == param){
  844. if(!this.form.zfiCoreQuotaId){
  845. this.$message({
  846. message: '请选择授信额度',
  847. type: 'warning'
  848. });
  849. return;
  850. }
  851. if(!this.form.zfiEffectiveDate){
  852. this.$message({
  853. message: '请选择签发有效期',
  854. type: 'warning'
  855. });
  856. return;
  857. }
  858. if(!this.form.zfiExpireDate){
  859. this.$message({
  860. message: '请选择承诺还款日',
  861. type: 'warning'
  862. });
  863. return;
  864. }
  865. //融信申请
  866. if(this.zfiCreateType == '0'){
  867. if(parseFloat(this.form.zfiAmount) < parseFloat(this.zfpMinimumAmount)){
  868. this.$message({
  869. message: '签发金额不可小于产品的最小融资金额',
  870. type: 'warning'
  871. });
  872. return;
  873. }
  874. if(parseFloat(this.form.zfiAmount) > parseFloat(this.availableAmt)){
  875. this.$message({
  876. message: '签发金额不可大于可用金额',
  877. type: 'warning'
  878. });
  879. return;
  880. }
  881. }
  882. }
  883. if (valid) {
  884. const loading = this.$loading({
  885. lock: true,
  886. text: 'Loading',
  887. background: 'rgba(0, 0, 0,0)'
  888. });
  889. this.form.flag = param;
  890. //产品
  891. this.form.zfpId = this.zfpId;
  892. //利率
  893. this.form.zfiRate = this.zfpcrRate;
  894. //最小融资金额
  895. this.form.zfpMinimumAmount = this.zfpMinimumAmount;
  896. //可用金额
  897. this.form.availableAmt = this.availableAmt;
  898. approveCredit(this.form).then(response => {
  899. loading.close();
  900. //通过
  901. if("00" == param){
  902. this.msgSuccess("融信资料已提交内部审批");
  903. this.$store.dispatch("tagsView/delView", this.$route);
  904. this.$router.go(-1);
  905. }else if("01" == param){//拒绝
  906. this.msgSuccess("该笔融信将作废");
  907. this.$store.dispatch("tagsView/delView", this.$route);
  908. this.$router.go(-1);
  909. }
  910. }).catch((response)=>{
  911. loading.close();
  912. });
  913. }
  914. });
  915. },
  916. //金额去掉千分位
  917. moneyDelete(num){
  918. if(num &&num != undefined && num != null){
  919. let _num = num;
  920. _num = _num.toString();
  921. _num = _num.replace(/,/gi,'');
  922. return _num;
  923. }else{
  924. return num;
  925. }
  926. },
  927. //预览
  928. handlePreview(row) {
  929. const pfiUrl = row.pfiUrl;
  930. const pfiFileName = row.pfiFileName;
  931. if (row.pfiUrl) {
  932. console.log(pfiFileName.substr(-3));
  933. if (pfiFileName.substr(-3) == "pdf") {
  934. this.wordUrl = pfiUrl + "/" + getToken();
  935. this.show=false;
  936. this.heid=true;
  937. } else if (
  938. pfiFileName.substr(-3) == "jpg" ||
  939. pfiFileName.substr(-3) == "png" ||
  940. pfiFileName.substr(-3) == "JPG" ||
  941. pfiFileName.substr(-3) == "PNG" ||
  942. pfiFileName.substr(-4) == "jpeg" ||
  943. pfiFileName.substr(-3) == "JPEG"
  944. ) {
  945. this.wordUrl =
  946. pfiUrl +
  947. "/" +
  948. getToken();
  949. this.show=true;
  950. this.heid=false;
  951. console.log("====>",this.wordUrl);
  952. } else if (
  953. pfiFileName.substr(-3) == "doc" ||
  954. pfiFileName.substr(-3) == "DOC"||
  955. pfiFileName.substr(-4) == "docx" ||
  956. pfiFileName.substr(-3) == "DOCX"
  957. ) {
  958. this.wordUrl =
  959. "https://view.officeapps.live.com/op/view.aspx?src=" +
  960. pfiUrl +
  961. "/" +
  962. getToken() +
  963. "/" +
  964. pfiFileName;
  965. this.show=false;
  966. this.heid=true;
  967. console.log("====>",this.wordUrl);
  968. } else {
  969. this.$message({
  970. message: "暂不支持该类型文件预览",
  971. type: "warning",
  972. });
  973. return;
  974. }
  975. }
  976. this.openFile = true;
  977. },
  978. changeRate(e,input){
  979.       e.target.value=(e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  980.       this.input=e.target.value
  981.       this.form.zfiAmount=this.input
  982.     },
  983. //查询有无确权内部审批
  984. isOpenApproval(){
  985. var confirmParam = {};
  986. confirmParam.menuId = "1000000007";
  987. isOpenApproval(confirmParam).then((response) => {
  988. var result = response.data.isOpen;
  989. //有确权内部审批
  990. if(true == result){
  991. //获取核心审批状态(拒绝或者状态为空时显示内部审批按钮)
  992. if(this.zfiCoreStatus == "02" || this.zfiCoreStatus == "" || this.zfiCoreStatus == "null" || this.zfiCoreStatus == null ){
  993. this.isHas = true;
  994. }else{
  995. this.isHas = false;
  996. //调文件
  997. this.getContractFile(true);
  998. }
  999. }else{//无确权内部审批,显示确权按钮
  1000. this.isHas = false;
  1001. //调文件
  1002. this.getContractFile(true);
  1003. }
  1004. });
  1005. },
  1006. //确权
  1007. confirmApproval(){
  1008. //核心确权通过,直接盖章
  1009. if(this.form.zfiCoreStatus == '01'){
  1010. //预览文件
  1011. this.getContractFile();
  1012. }else{
  1013. this.$refs["form"].validate(valid => {
  1014. if(!this.form.zfiCoreQuotaId){
  1015. this.$message({
  1016. message: '请选择授信额度',
  1017. type: 'warning'
  1018. });
  1019. return;
  1020. }
  1021. if(!this.form.zfiEffectiveDate){
  1022. this.$message({
  1023. message: '请选择签发有效期',
  1024. type: 'warning'
  1025. });
  1026. return;
  1027. }
  1028. if(!this.form.zfiExpireDate){
  1029. this.$message({
  1030. message: '请选择承诺还款日',
  1031. type: 'warning'
  1032. });
  1033. return;
  1034. }
  1035. //融信申请
  1036. if(this.zfiCreateType == '0'){
  1037. if(parseFloat(this.form.zfiAmount) < parseFloat(this.zfpMinimumAmount)){
  1038. this.$message({
  1039. message: '签发金额不可小于产品的最小融资金额',
  1040. type: 'warning'
  1041. });
  1042. return;
  1043. }
  1044. if(parseFloat(this.form.zfiAmount) > parseFloat(this.availableAmt)){
  1045. this.$message({
  1046. message: '签发金额不可大于可用金额',
  1047. type: 'warning'
  1048. });
  1049. return;
  1050. }
  1051. }
  1052. if (valid) {
  1053. const loading = this.$loading({
  1054. lock: true,
  1055. text: 'Loading',
  1056. background: 'rgba(0, 0, 0,0)'
  1057. });
  1058. this.form.flag = '00';
  1059. //产品
  1060. this.form.zfpId = this.zfpId;
  1061. //利率
  1062. this.form.zfiRate = this.zfpcrRate;
  1063. //最小融资金额
  1064. this.form.zfpMinimumAmount = this.zfpMinimumAmount;
  1065. //可用金额
  1066. this.form.availableAmt = this.availableAmt;
  1067. approveCredit(this.form).then(response => {
  1068. loading.close();
  1069. //预览文件
  1070. this.getContractFile();
  1071. }).catch((response)=>{
  1072. loading.close();
  1073. });
  1074. }
  1075. });
  1076. }
  1077. },
  1078. //获取合同文件
  1079. getContractFile(notSign){
  1080. const loading = this.$loading({
  1081. lock: true,
  1082. text: 'Loading',
  1083. background: 'rgba(0, 0, 0,0)'
  1084. });
  1085. getContractFile(this.form).then((response) => {
  1086. loading.close();
  1087. if(response.data.list){
  1088. this.pdfFileList = response.data.list;
  1089. }
  1090. //文件存在
  1091. if(this.pdfFileList.length > 0 ){
  1092. this.pdfShowDialog = true;
  1093. }else{
  1094. /* this.$message({
  1095. message: '文件不存在!',
  1096. type: 'warning'
  1097. }); */
  1098. //文件不存在并且不是一进去页面调用的直接盖章
  1099. if (!notSign) {
  1100. this.contractSigning();
  1101. }
  1102. }
  1103. }).catch((response)=>{
  1104. loading.close();
  1105. });
  1106. },
  1107. closePdfShow(){
  1108. this.pdfShowDialog = false;
  1109. },
  1110. //盖章
  1111. contractSigning(){
  1112. const loading = this.$loading({
  1113. lock: true,
  1114. text: 'Loading',
  1115. background: 'rgba(0, 0, 0,0)'
  1116. });
  1117. contractSigning(this.form).then((response) => {
  1118. loading.close();
  1119. //融资申请
  1120. if(this.zfiCreateType == '0'){
  1121. this.msgSuccess("确权成功,融信已提交"+this.form.receiveName+"签收");
  1122. this.$store.dispatch(
  1123. "tagsView/delView",
  1124. this.$route
  1125. );
  1126. this.$router.go(-1);
  1127. }else if(this.zfiCreateType == '2'){//供应商开立,盖章后改为已生效
  1128. this.msgSuccess("确权成功,融信已生效");
  1129. this.$store.dispatch(
  1130. "tagsView/delView",
  1131. this.$route
  1132. );
  1133. this.$router.go(-1);
  1134. }
  1135. }).catch((response) => {
  1136. loading.close();
  1137. });
  1138. },
  1139. //返回到列表页
  1140. goParent(){
  1141. var self = this
  1142. this.pdfShowDialog = false;
  1143. self.$store.dispatch(
  1144. "tagsView/delView",
  1145. self.$route
  1146. );
  1147. //self.$router.push("/Bill/credit")
  1148. self.$router.push("/Bill/finance/credit")
  1149. }
  1150. }
  1151. };
  1152. </script>
  1153. <style lang="scss">
  1154. .uoloadfj .el-upload--picture-card{
  1155. width:110px;
  1156. height:110px;
  1157. line-height:110px;
  1158. }
  1159. .fjUoloadSty .el-upload--picture-card{
  1160. display:none;
  1161. }
  1162. table th.star div::before {
  1163. content: '*';
  1164. color: red;
  1165. }
  1166. </style>