signFor.vue 44 KB

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