signFor.vue 55 KB

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