confirmationAudit.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  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. append-to-body>
  274. <pdf-show :pdfFileList="pdfFileList" :zfiId="this.form.zfiId" :parent="parent">
  275. </pdf-show>
  276. </el-dialog>
  277. </el-tab-pane>
  278. <!-- 签署合同-->
  279. <el-tab-pane label="签署合同">
  280. <el-table :data="creditSealList" style="width: 100%">
  281. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
  282. <template slot-scope="scope">
  283. <img style="width:30px;height:30px;"
  284. src="../../../assets/images/pdf.png"
  285. />
  286. <span>{{scope.row.pfiFileName}}
  287. </span>
  288. </template>
  289. </el-table-column>
  290. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  291. <template slot-scope="scope">
  292. <el-button
  293. size="mini"
  294. type="text"
  295. icon="el-icon-view"
  296. @click="handleDownload(scope.row)"
  297. >下载</el-button>
  298. <el-button
  299. size="mini"
  300. type="text"
  301. icon="el-icon-view"
  302. @click="handlePreview(scope.row)"
  303. >预览</el-button>
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. </el-tab-pane>
  308. <!-- </div> -->
  309. </el-tabs>
  310. </template>
  311. <script>
  312. import {listCreditLine,getCreditDetail,getAccountsCollection,getAvailableBalance,getFile} from "@/api/service/credit/credit";
  313. import {approveCredit,getCreditSealFile,getContractFile} from "@/api/service/credit/creditHandle";
  314. import {accAdd} from "@/utils/calculation";
  315. import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
  316. import {listCompanyHandler} from "@/api/common/companyHandler";
  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. }else{//无确权内部审批,显示确权按钮
  998. this.isHas = false;
  999. }
  1000. });
  1001. },
  1002. //确权
  1003. confirmApproval(){
  1004. this.$refs["form"].validate(valid => {
  1005. if(!this.form.zfiCoreQuotaId){
  1006. this.$message({
  1007. message: '请选择授信额度',
  1008. type: 'warning'
  1009. });
  1010. return;
  1011. }
  1012. if(!this.form.zfiEffectiveDate){
  1013. this.$message({
  1014. message: '请选择签发有效期',
  1015. type: 'warning'
  1016. });
  1017. return;
  1018. }
  1019. if(!this.form.zfiExpireDate){
  1020. this.$message({
  1021. message: '请选择承诺还款日',
  1022. type: 'warning'
  1023. });
  1024. return;
  1025. }
  1026. //融信申请
  1027. if(this.zfiCreateType == '0'){
  1028. if(parseFloat(this.form.zfiAmount) < parseFloat(this.zfpMinimumAmount)){
  1029. this.$message({
  1030. message: '签发金额不可小于产品的最小融资金额',
  1031. type: 'warning'
  1032. });
  1033. return;
  1034. }
  1035. if(parseFloat(this.form.zfiAmount) > parseFloat(this.availableAmt)){
  1036. this.$message({
  1037. message: '签发金额不可大于可用金额',
  1038. type: 'warning'
  1039. });
  1040. return;
  1041. }
  1042. }
  1043. if (valid) {
  1044. const loading = this.$loading({
  1045. lock: true,
  1046. text: 'Loading',
  1047. background: 'rgba(0, 0, 0,0)'
  1048. });
  1049. this.form.flag = '00';
  1050. //产品
  1051. this.form.zfpId = this.zfpId;
  1052. //利率
  1053. this.form.zfiRate = this.zfpcrRate;
  1054. //最小融资金额
  1055. this.form.zfpMinimumAmount = this.zfpMinimumAmount;
  1056. //可用金额
  1057. this.form.availableAmt = this.availableAmt;
  1058. approveCredit(this.form).then(response => {
  1059. loading.close();
  1060. //预览文件
  1061. this.getContractFile();
  1062. }).catch((response)=>{
  1063. loading.close();
  1064. });
  1065. }
  1066. });
  1067. },
  1068. //获取合同文件
  1069. getContractFile(){
  1070. const loading = this.$loading({
  1071. lock: true,
  1072. text: 'Loading',
  1073. background: 'rgba(0, 0, 0,0)'
  1074. });
  1075. getContractFile(this.form).then((response) => {
  1076. loading.close();
  1077. if(response.data.list){
  1078. this.pdfFileList = response.data.list;
  1079. }
  1080. //文件存在
  1081. if(this.pdfFileList.length > 0 ){
  1082. this.pdfShowDialog = true;
  1083. }else{
  1084. /* this.$message({
  1085. message: '文件不存在!',
  1086. type: 'warning'
  1087. }); */
  1088. //文件不存在,直接盖章
  1089. this.contractSigning();
  1090. }
  1091. }).catch((response)=>{
  1092. loading.close();
  1093. });
  1094. },
  1095. closePdfShow(){
  1096. this.pdfShowDialog = false;
  1097. },
  1098. //盖章
  1099. contractSigning(){
  1100. const loading = this.$loading({
  1101. lock: true,
  1102. text: 'Loading',
  1103. background: 'rgba(0, 0, 0,0)'
  1104. });
  1105. contractSigning(this.form).then((response) => {
  1106. loading.close();
  1107. this.msgSuccess("确权成功,融信已提交"+this.form.receiveName+"签收");
  1108. this.$store.dispatch(
  1109. "tagsView/delView",
  1110. this.$route
  1111. );
  1112. this.$router.go(-1);
  1113. }).catch((response) => {
  1114. loading.close();
  1115. });
  1116. },
  1117. }
  1118. };
  1119. </script>
  1120. <style lang="scss">
  1121. .uoloadfj .el-upload--picture-card{
  1122. width:110px;
  1123. height:110px;
  1124. line-height:110px;
  1125. }
  1126. .fjUoloadSty .el-upload--picture-card{
  1127. display:none;
  1128. }
  1129. table th.star div::before {
  1130. content: '*';
  1131. color: red;
  1132. }
  1133. </style>