addInformation.vue 48 KB

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