confirmationAudit.vue 44 KB

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