signFor.vue 43 KB

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