confirmationAudit.vue 48 KB

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