signFor.vue 43 KB

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