signFor.vue 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396
  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(form.zfiId)">选择</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 destroy-on-close>
  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" @PDFData="PDFData">
  315. </pdf-show>
  316. </el-dialog>
  317. <el-dialog
  318. :visible.sync="pdfShowDialogs"
  319. width="70%" height = "60%" append-to-body :show-close="false" >
  320. <pdf-shows :pdfFileLists="pdfFileLists" :zfiId="this.form.zfiId" :parents="parents">
  321. </pdf-shows>
  322. </el-dialog>
  323. <!--去融资-->
  324. <el-dialog :visible.sync="goShow" width="300px" append-to-body :before-close = "cancelGo" center>
  325. <!-- <p>恭喜您成功签收一笔融信</p> -->
  326. <p>签收融信成功,融信信息:</p>
  327. <el-form ref="financeSignForm" :model="financeSignForm" label-width="auto" :inline="true">
  328. <el-row>
  329. <el-form-item label="融信编号:">{{financeSignForm.zfiNumber}}</el-form-item>
  330. <el-form-item label="融信金额:">{{handleInput(financeSignForm.zfiAmount) + "元"}}</el-form-item>
  331. <el-form-item label="大写:">{{smallToBig(financeSignForm.zfiAmount)}}</el-form-item>
  332. </el-row>
  333. <el-row>
  334. <el-form-item label="融信利率:">{{financeSignForm.zfiRate + "%"}}</el-form-item>
  335. <el-form-item label="最长融信期限:">{{financeSignForm.intervalTime + "天"}}</el-form-item>
  336. <el-form-item label="融信有效期:">{{financeSignForm.validity}}</el-form-item>
  337. </el-row>
  338. </el-form>
  339. <div slot="footer" class="dialog-footer">
  340. <el-button type="primary" @click="goFinance">去融资</el-button>
  341. <el-button @click="cancelGo">取 消</el-button>
  342. </div>
  343. </el-dialog>
  344. </el-tab-pane>
  345. <el-tab-pane label="签署合同">
  346. <el-table :data="creditSealList" style="width: 100%">
  347. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
  348. <template slot-scope="scope">
  349. <img style="width:30px;height:30px;"
  350. src="../../../assets/images/pdf.png"
  351. />
  352. <span>{{scope.row.pfiFileName}}
  353. </span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  357. <template slot-scope="scope">
  358. <el-button
  359. size="mini"
  360. type="text"
  361. icon="el-icon-view"
  362. @click="handleDownload(scope.row)"
  363. >下载</el-button>
  364. <el-button
  365. size="mini"
  366. type="text"
  367. icon="el-icon-view"
  368. @click="handlePreview(scope.row)"
  369. >预览</el-button>
  370. </template>
  371. </el-table-column>
  372. </el-table>
  373. </el-tab-pane>
  374. </el-tabs>
  375. <!-- </div> -->
  376. </template>
  377. <script>
  378. import {getCreditDetail,getAvailableBalance,getAccountsCollection,getFile,getFinanceSign} from "@/api/service/credit/credit";
  379. import {signFor,getCreditSealFile,getContractFile} from "@/api/service/credit/creditHandle";
  380. import {accAdd} from "@/utils/calculation";
  381. import {getToken} from "@/utils/auth";
  382. import { getBill} from "@/api/service/bill/bill";
  383. import AddBill from "@/views/service/bill/addBill";
  384. import EditBill from "@/views/service/bill/editBill";
  385. import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
  386. import pdfShow from "./pdfShow";
  387. import pdfShows from "./showStampedPdf";
  388. import DetailBill from "@/views/service/credit/billDetail";
  389. import {contractSigning} from "@/api/service/credit/message";
  390. import { listFinanceInf } from "@/api/common/financeInf";
  391. import { amtformat } from "@/utils/amtCommon";
  392. import Cookies from 'js-cookie';
  393. export default {
  394. name: "addCredit",
  395. components: {AddBill,DetailBill,pdfShow,EditBill,pdfShows},
  396. data() {
  397. return {
  398. //往来账款id
  399. zbiId: '',
  400. // 总条数
  401. total: 0,
  402. // 表单参数read
  403. form: {
  404. },
  405. forms:{},
  406. // 表单校验
  407. rules: {
  408. },
  409. financeSignForm:{},
  410. // 是否显示弹出层
  411. open: false,
  412. openAddBill: false,
  413. openDetailBill: false,
  414. openEditBill: false,
  415. //选择的应收账款
  416. payList:[],
  417. //现有的应收账款
  418. ticketList:[],
  419. //签发金额大写
  420. issuedAmount:"零元整",
  421. //合计选中的应收账款的金额
  422. checkTotalAmt:"0.00",
  423. //合计选中的应收账款的大写金额
  424. checkTotalBigAmt:"零元整",
  425. //接收方
  426. supplierList:[],
  427. supplierForm:{},
  428. queryParamsPay: {
  429. pageNum: 1,
  430. pageSize: 10,
  431. zbiName:null
  432. },
  433. //授信额度
  434. creditLineList:[],
  435. //可用额度
  436. availableAmt:"0.00",
  437. //有效期
  438. validityDate:"",
  439. //有效期类型
  440. zfpcrDateType:"" ,
  441. //产品是否可拆分
  442. zfpSplit:"",
  443. //融资放款方式
  444. zfpcrLoanType:"",
  445. //产品编号
  446. zfpId:"",
  447. //标题
  448. payTitle:"",
  449. //利率
  450. zfiRate:"",
  451. //授信额度
  452. creditParams: {
  453. zfpcrId:null,
  454. type:'1'
  455. },
  456. //合同附件
  457. contractFileList:[],
  458. //发票附件
  459. invoiceFileList:[],
  460. //其他文件
  461. otherFileList:[] ,
  462. //盖章文件
  463. creditSealList:[],
  464. //开立方编号
  465. zfiCoreId:"",
  466. //接收方
  467. zfiSupplierId:"" ,
  468. //融信类型
  469. zfiCreateType:"",
  470. //控制按钮是否可点击
  471. isClick:true,
  472. openFile:false,
  473. wordUrl: "",
  474. show:false,
  475. heid:false,
  476. chooseTicket:[],
  477. payDate:null,
  478. //开立方
  479. openName:"",
  480. //开立社会码
  481. openCode:"",
  482. //开立银行
  483. openBank:"",
  484. //开立账户
  485. openAccount:"",
  486. //接收方
  487. receiveName:"",
  488. //接收方社会统一码
  489. receiverCode:"",
  490. //接收方银行
  491. receiverBank:"",
  492. //接收方账户
  493. receiverAccount:"",
  494. //起止日期
  495. stopDate:"",
  496. //控制签收,内部审批按钮展示
  497. isHas:true,
  498. //融资企业审批状态
  499. zfiSupplierStatus:"",
  500. //融信编号
  501. zfiId:"",
  502. pdfFileList : [],
  503. pdfShowDialog : false,
  504. parent : this,
  505. pdfShowDialogs : false,
  506. pdfFileLists : [],
  507. parents : this,
  508. //显示去融资框
  509. goShow:false,
  510. //状态
  511. stateOptions:[],
  512. };
  513. },
  514. watch:{
  515. 'form.zfiCoreQuotaId':'change'
  516. },
  517. created() {
  518. this.getDicts("zc_finance_state").then(response => {
  519. this.stateOptions = response.data;
  520. });
  521. const zfiId = this.$route.params && this.$route.params.zfiId;
  522. this.zfiId = zfiId;
  523. getCreditDetail(zfiId).then((response) => {
  524. if(response.data){
  525. //签发金额
  526. this.form= response.data.financeInf;
  527. this.forms.zfiStatus = response.data.financeInf.zfiStatus;
  528. //签发金额大写
  529. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  530. //开立方编号
  531. this.zfiCoreId = response.data.financeInf.zfiCoreId;
  532. //接收方
  533. this.zfiSupplierId = response.data.financeInf.zfiSupplierId;
  534. //类型
  535. this.zfiCreateType = response.data.financeInf.zfiCreateType;
  536. //融资方审批状态
  537. this.zfiSupplierStatus = response.data.financeInf.zfiSupplierStatus;
  538. //核心
  539. if( this.zfiCreateType == "1"){
  540. this.isClick = false;
  541. }else{
  542. this.isClick = true;
  543. }
  544. //给表格赋值
  545. this.openName = response.data.openName;
  546. this.openCode = response.data.openCode;
  547. this.openBank = response.data.openBank;
  548. this.openAccount = response.data.openAccount;
  549. this.receiveName = response.data.receiveName;
  550. this.receiverCode = response.data.receiverCode;
  551. this.receiverBank = response.data.receiverBank;
  552. this.receiverAccount = response.data.receiverAccount;
  553. this.stopDate = response.data.stopDate;
  554. this.zfiRate = response.data.financeInf.zfiRate;
  555. }
  556. if(response.data.payList){
  557. this.ticketList = response.data.payList.records;
  558. this.getReTotal(this.ticketList);
  559. //附件
  560. this.getFile(this.ticketList);
  561. }
  562. //查询有无签收内部审批
  563. this.isOpenApproval();
  564. //盖章合同
  565. this.getCreditSealFile();
  566. });
  567. this.getFinanceInf(zfiId);
  568. },
  569. methods: {
  570. PDFData(val){
  571. console.log(val,"子传父")
  572. this.pdfFileLists = val;
  573. this.pdfShowDialogs = true;
  574. },
  575. /** 查询融信编号 */
  576. getFinanceInf(zfrFinanceId) {
  577. this.loading = true;
  578. listFinanceInf(zfrFinanceId).then(response => {
  579. debugger;
  580. if (response.data) {
  581. this.financeInfList = response.data;
  582. for (let item of this.financeInfList) {
  583. if (item.zfiId == zfrFinanceId) {
  584. this.amount(item);
  585. }
  586. }
  587. this.loading = false;
  588. }
  589. });
  590. },
  591. /* 融信编号赋值融资金额 */
  592. amount(item) {
  593. debugger;
  594. this.$set(this.forms, "zfiAmount", item.zfiAmount);
  595. this.$set(this.forms, "zfrAmount", item.zfiAmount);
  596. this.$set(this.forms, "zfrRepaymentDate", item.zfiExpireDate);
  597. this.$set(this.forms, "zfrRate", item.zfpcrRate);
  598. this.$set(this.forms, "zfpcrLoanType", item.zfpcrLoanType);
  599. this.$set(this.forms, "zfiProductId", item.zfiProductId);
  600. this.$set(this.forms, "zfpcrChargeRate", item.zfpcrChargeRate);
  601. this.$set(this.forms, "termIng", item.termIng);
  602. this.$set(this.forms, "zfiEffectiveDate", item.zfiEffectiveDate);
  603. },
  604. // 取消按钮
  605. cancel() {
  606. this.$store.dispatch("tagsView/delView", this.$route);
  607. this.$router.go(-1);
  608. },
  609. /* 多选框跨页 */
  610. rowkeyCustomer(row) {
  611. return row.cciId;
  612. },
  613. //获取附件信息
  614. getFile(datas){
  615. var queryParamsFile = {};
  616. queryParamsFile.ticketList = datas;
  617. getFile(queryParamsFile).then((response) => {
  618. if(response.data){
  619. //获取发票文件
  620. this.invoiceFileList = response.data.invoiceFileList;
  621. //获取合同文件
  622. this.contractFileList = response.data.contractFileList;
  623. //获取其他文件
  624. this.otherFileList = response.data.otherFileList;
  625. }
  626. });
  627. },
  628. //获取盖章文件
  629. getCreditSealFile(){
  630. getCreditSealFile(this.form).then((response) => {
  631. if(response.data.list){
  632. this.creditSealList = response.data.list;
  633. }
  634. });
  635. },
  636. //文件下载
  637. handleDownload(row){
  638. const pfiUrl = row.pfiUrl;
  639. if(pfiUrl != null && pfiUrl != ''){
  640. window.open(pfiUrl +"/"+ getToken());
  641. }else{
  642. this.$message({
  643. message: '该附件不存在!',
  644. type: 'warning'
  645. });
  646. return;
  647. }
  648. },
  649. resetQuerys() {
  650. this.resetForm("formQuery");
  651. this.handleQuerys();
  652. },
  653. handleQuerys() {
  654. this.queryParamsPay.pageNum = 1;
  655. this.getAccountsCollection();
  656. },
  657. //打开应收账款选择列表
  658. openTicket(id) {
  659. //清空搜索条件
  660. this.queryParamsPay.zbiName = "";
  661. this.queryParamsPay.pageNum = 1;
  662. if(id){
  663. this.queryParamsPay.zfiId = id;
  664. }
  665. this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
  666. this.getAccountsCollection();
  667. this.open = true;
  668. this.payTitle = "应收账款";
  669. },
  670. //应收账款查询列表
  671. getAccountsCollection() {
  672. //开立方为应收企业的
  673. this.queryParamsPay.payId = this.zfiCoreId;
  674. //接收方
  675. this.queryParamsPay.zfiSupplierId = this.zfiSupplierId;
  676. return getAccountsCollection(this.queryParamsPay).then((response) => {
  677. this.payList = response.data.records;
  678. this.selectChecked();
  679. this.total = response.data.total;
  680. return Promise.resolve(response)
  681. });
  682. },
  683. selectChecked() {
  684. //清空选择
  685. //             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
  686. var changeSelectionTemp = eval("(" + JSON.stringify(this.chooseTicket) + ")")
  687. this.$nextTick(() => {
  688. this.$refs.tablePay.clearSelection();
  689. changeSelectionTemp.forEach((item) => {
  690. var f = true;
  691. for (var i=0; i < this.payList.length; i++) {
  692. var row = this.payList[i];
  693. if (row.zbiId == item.zbiId) {
  694. this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(row, true);
  695. f = false;
  696. break;
  697. }
  698. };
  699. if (f) {
  700. this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(item, true);
  701. }
  702. });
  703. })
  704. //合计
  705. // this.getReTotal(this.ticketList);
  706. //附件
  707. // this.getFile(this.ticketList);
  708. },
  709. /* 删除按钮 */
  710. handleDelete(index, rows) {
  711. rows.splice(index, 1);
  712. if(this.$refs.tablePay){
  713. this.$refs.tablePay.clearSelection();
  714. }
  715. this.selectChecked();
  716. },
  717. //详情按钮
  718. handleDetail(index, rows){
  719. this.zbiId = rows[index].zbiId
  720. this.openDetailBill = true
  721. },
  722. /* 修改按钮 */
  723. handleUpdate(index, rows) {
  724. this.zbiId = rows[index].zbiId;
  725. this.openEditBill = true
  726. },
  727. /* 多选框跨页 */
  728. rowkey(row) {
  729. return row.zbiId;
  730. },
  731. // 多选框选中数据
  732. handleSelectionChange(val) {
  733. this.chooseTicket = val
  734. },
  735. //回到父页
  736. cancelGo(){
  737. this.goShow = false;
  738. this.$store.dispatch(
  739. "tagsView/delView",
  740. this.$route
  741. );
  742. this.$router.go(-1);
  743. },
  744. // 确认选择
  745. closeTicket() {
  746. if(this.chooseTicket.length > 0){
  747. var flag = true;
  748. //获取选中第一个的预计还款日期
  749. var zbiPayDate = this.chooseTicket[0].zbiPayDate;
  750. for(var i = 0 ;i < this.chooseTicket.length;i++){
  751. if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
  752. flag = false;
  753. this.$message({
  754. message: '请选择预计还款日期相同的应收账款',
  755. type: 'warning'
  756. });
  757. break;
  758. }
  759. }
  760. if(flag){
  761. //合计
  762. this.getReTotal(this.chooseTicket);
  763. this.ticketList = this.chooseTicket;
  764. //更新附件信息
  765. this.getFile(this.ticketList);
  766. this.open = false;
  767. }
  768. }else{
  769. this.$message({
  770. message: '请选择应收账款',
  771. type: 'warning'
  772. });
  773. }
  774. },
  775. //重新合计
  776. getReTotal(chooseTicket){
  777. //合计
  778. this.checkTotalAmt = "0.00";
  779. for(var i = 0; i < chooseTicket.length;i++){
  780. this.checkTotalAmt = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
  781. }
  782. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  783. this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
  784. },
  785. //取消选择按钮
  786. cancelTicket(){
  787. /* this.ticketList = [];
  788. if(this.$refs.tablePay){
  789. this.$refs.tablePay.clearSelection();
  790. } */
  791. this.open = false;
  792. },
  793. /** 清空选择信息 */
  794. deleteTicekt() {
  795. this.ticketList = [];
  796. this.checkTotalAmt = "0.00";
  797. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  798. if(this.$refs.tablePay){
  799. this.$refs.tablePay.clearSelection();
  800. }
  801. //更新附件
  802. this.getFile(this.ticketList);
  803. },
  804. /* 删除按钮 */
  805. handleDelete(index, rows) {
  806. rows.splice(index, 1);
  807. if(this.$refs.tablePay){
  808. this.$refs.tablePay.clearSelection();
  809. }
  810. this.selectChecked();
  811. },
  812. onSelectAll() {
  813. if(this.$refs.tablePay){
  814. this.$refs.tablePay.clearSelection();
  815. }
  816. },
  817. //格式化金额
  818. amtFormat(cellValue) {
  819. if(cellValue == null || cellValue== undefined || cellValue == ''){
  820. cellValue = '0.00'
  821. }
  822. cellValue += '';
  823.       if (!cellValue.includes('.')) {
  824. cellValue += '.00';
  825. }
  826.       return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  827.         return $1 + ',';
  828.       }).replace(/\.$/, '');
  829. },
  830. //获取签发金额大写
  831. getBigSmall(){
  832. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  833. },
  834. /* // 将数字金额转换为大写金额 */
  835. smallToBig(money) {
  836. // 将数字金额转换为大写金额
  837. var cnNums = new Array(
  838. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  839. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  840. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  841. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  842. var cnInteger = "整"; //整数金额时后面跟的字符
  843. var cnIntLast = "元"; //整数完以后的单位
  844. //最大处理的数字
  845. var maxNum = 999999999999999.9999;
  846. var integerNum; //金额整数部分
  847. var decimalNum; //金额小数部分
  848. //输出的中文金额字符串
  849. var chineseStr = "";
  850. var parts; //分离金额后用的数组,预定义
  851. if (money == "" || money == null || money == undefined) {
  852. return "零元零角零分";
  853. }
  854. money = parseFloat(money);
  855. if (money >= maxNum) {
  856. //超出最大处理数字
  857. return "超出最大处理数字";
  858. }
  859. if (money == 0) {
  860. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  861. return chineseStr;
  862. }
  863. //四舍五入保留两位小数,转换为字符串
  864. money = Math.round(money * 100).toString();
  865. integerNum = money.substr(0, money.length - 2);
  866. decimalNum = money.substr(money.length - 2);
  867. //获取整型部分转换
  868. if (parseInt(integerNum, 10) > 0) {
  869. var zeroCount = 0;
  870. var IntLen = integerNum.length;
  871. for (var i = 0; i < IntLen; i++) {
  872. var n = integerNum.substr(i, 1);
  873. var p = IntLen - i - 1;
  874. var q = p / 4;
  875. var m = p % 4;
  876. if (n == "0") {
  877. zeroCount++;
  878. } else {
  879. if (zeroCount > 0) {
  880. chineseStr += cnNums[0];
  881. }
  882. //归零
  883. zeroCount = 0;
  884. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  885. }
  886. if (m == 0 && zeroCount < 4) {
  887. chineseStr += cnIntUnits[q];
  888. }
  889. }
  890. chineseStr += cnIntLast;
  891. }
  892. //小数部分
  893. if (decimalNum != "") {
  894. var decLen = decimalNum.length;
  895. for (var i = 0; i < decLen; i++) {
  896. var n = decimalNum.substr(i, 1);
  897. if (n != "0") {
  898. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  899. }
  900. }
  901. }
  902. if (chineseStr == "") {
  903. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  904. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  905. chineseStr += cnInteger;
  906. }
  907. return chineseStr;
  908. },
  909. //选择授信触发
  910. change(val) {
  911. if (!val) {
  912. //可用额度
  913. this.availableAmt = "0.00";
  914. //有效期
  915. this.validityDate ="";
  916. //产品是否可拆分
  917. this.zfpSplit= "",
  918. //融资放款方式
  919. this.zfpcrLoanType = "";
  920. //产品
  921. this.zfpId = "";
  922. //利率
  923. this.zfiRate = "";
  924. return;
  925. }
  926. let obj = {};
  927. obj = this.creditLineList.find(item => {
  928. return item.value === val;
  929. });
  930. //获取有效期的类型
  931. this.zfpcrDateType = obj.zfpcrDateType;
  932. //产品是否可拆分
  933. this.zfpSplit= obj.zfpSplit;
  934. //放款方式
  935. this.zfpcrLoanType = obj.zfpcrLoanType;
  936. //产品
  937. this.zfpId = obj.zfpId;
  938. //利率
  939. this.zfiRate = obj.zfpcrRate;
  940. //长期
  941. if("0"== this.zfpcrDateType){
  942. this.validityDate = "长期";
  943. }else{
  944. this.validityDate = obj.zfpcrEndDate;
  945. }
  946. var lineQueryParam = {};
  947. lineQueryParam.zfpcrId = val;
  948. //获取可用额度
  949. getAvailableBalance(lineQueryParam).then((response) => {
  950. this.availableAmt = response.data.remaining;
  951. });
  952. },
  953. //内部审批
  954. submitForm(param){
  955. this.$refs["form"].validate(valid => {
  956. //通过
  957. if(param == "00"){
  958. if(this.ticketList.length < 1){
  959. this.$message({
  960. message: '请选择应收账款',
  961. type: 'warning'
  962. });
  963. return;
  964. }
  965. if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
  966. this.$message({
  967. message: '签发金额不可大于合计金额',
  968. type: 'warning'
  969. });
  970. return;
  971. }
  972. }
  973. if (valid) {
  974. const loading = this.$loading({
  975. lock: true,
  976. text: 'Loading',
  977. background: 'rgba(0, 0, 0,0)'
  978. });
  979. //如果签发金额小于合计金额(通过需判断)
  980. if(((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))) && "00" == param){
  981. var _this = this;
  982. this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
  983. confirmButtonText: "确定",
  984. cancelButtonText: "取消",
  985. type: "warning"
  986. }).then(function() {
  987. //应收账款
  988. _this.form.ticketList = _this.ticketList;
  989. _this.form.flag = param;
  990. signFor(_this.form).then(response => {
  991. loading.close();
  992. //通过
  993. /* if("00" == param){ */
  994. _this.msgSuccess("融信资料已提交内部审核");
  995. _this.$store.dispatch("tagsView/delView", _this.$route);
  996. _this.$router.go(-1);
  997. /* }else if ("01" == param){//拒绝
  998. _this.msgSuccess("该笔融信将作废");
  999. _this.$store.dispatch("tagsView/delView", _this.$route);
  1000. _this.$router.go(-1);
  1001. } */
  1002. }).catch((response)=>{
  1003. loading.close();
  1004. });
  1005. }).catch((e) => {
  1006. loading.close();
  1007. });
  1008. }else{
  1009. //应收账款
  1010. this.form.ticketList = this.ticketList;
  1011. this.form.flag = param;
  1012. signFor(this.form).then(response => {
  1013. loading.close();
  1014. //通过
  1015. if("00" == param){
  1016. this.msgSuccess("融信资料已提交内部审核");
  1017. this.$store.dispatch("tagsView/delView", this.$route);
  1018. this.$router.go(-1);
  1019. }else if ("01" == param){//拒绝
  1020. this.msgSuccess("该笔融信将作废");
  1021. this.$store.dispatch("tagsView/delView", this.$route);
  1022. this.$router.go(-1);
  1023. }
  1024. }).catch((response)=>{
  1025. loading.close();
  1026. });
  1027. }
  1028. }
  1029. });
  1030. },
  1031. //金额去掉千分位
  1032. moneyDelete(num){
  1033. if(num &&num != undefined && num != null){
  1034. let _num = num;
  1035. _num = _num.toString();
  1036. _num = _num.replace(/,/gi,'');
  1037. return _num;
  1038. }else{
  1039. return num;
  1040. }
  1041. },
  1042. //预览
  1043. handlePreview(row) {
  1044. const pfiUrl = row.pfiUrl;
  1045. const pfiFileName = row.pfiFileName;
  1046. if (row.pfiUrl) {
  1047. console.log(pfiFileName.substr(-3));
  1048. if (pfiFileName.substr(-3) == "pdf") {
  1049. this.wordUrl = pfiUrl + "/" + getToken();
  1050. this.show=false;
  1051. this.heid=true;
  1052. } else if (
  1053. pfiFileName.substr(-3) == "jpg" ||
  1054. pfiFileName.substr(-3) == "png" ||
  1055. pfiFileName.substr(-3) == "JPG" ||
  1056. pfiFileName.substr(-3) == "PNG" ||
  1057. pfiFileName.substr(-4) == "jpeg" ||
  1058. pfiFileName.substr(-3) == "JPEG"
  1059. ) {
  1060. this.wordUrl =
  1061. pfiUrl +
  1062. "/" +
  1063. getToken();
  1064. this.show=true;
  1065. this.heid=false;
  1066. console.log("====>",this.wordUrl);
  1067. } else if (
  1068. pfiFileName.substr(-3) == "doc" ||
  1069. pfiFileName.substr(-3) == "DOC"||
  1070. pfiFileName.substr(-4) == "docx" ||
  1071. pfiFileName.substr(-3) == "DOCX"
  1072. ) {
  1073. this.wordUrl =
  1074. "https://view.officeapps.live.com/op/view.aspx?src=" +
  1075. pfiUrl +
  1076. "/" +
  1077. getToken() +
  1078. "/" +
  1079. pfiFileName;
  1080. this.show=false;
  1081. this.heid=true;
  1082. console.log("====>",this.wordUrl);
  1083. } else {
  1084. this.$message({
  1085. message: "暂不支持该类型文件预览",
  1086. type: "warning",
  1087. });
  1088. return;
  1089. }
  1090. }
  1091. this.openFile = true;
  1092. },
  1093. //新增应付
  1094. addPay(){
  1095. //获取选中第一个的预计还款日期
  1096. if(this.chooseTicket[0]){
  1097. var zbiPayDate = this.chooseTicket[0].zbiPayDate;
  1098. this.payDate = zbiPayDate;
  1099. }
  1100. if(this.form.zfiCoreId){
  1101. this.openAddBill = true
  1102. }else{
  1103. this.$message({
  1104. message: "开立方不能为空",
  1105. type: "warning",
  1106. });
  1107. }
  1108. },
  1109. //新增账款回调
  1110. emitAddClick(val){
  1111. var self = this
  1112. this.getAccountsCollection().then((response) => {
  1113. //新增付款返回id直接选中
  1114. if (val) {
  1115. self.payList.forEach(element => {
  1116. if(element.zbiId == val){
  1117. // 将当前点击项选中
  1118. self.chooseTicket.push(element)
  1119. self.closeTicket()
  1120. }
  1121. });
  1122. }
  1123. })
  1124. self.openAddBill = false
  1125. },
  1126. //修改账款回调
  1127. emitEditClick(val) {
  1128. var self = this
  1129. getBill(val).then((response) => {
  1130. for (var i = 0; i < this.ticketList.length; i ++) {
  1131. if (response.data.zbiId == this.ticketList[i].zbiId) {
  1132. this.$set(this.ticketList, i, response.data)
  1133. break;
  1134. }
  1135. }
  1136. for (var i = 0; i < this.ticketList.length; i ++) {
  1137. if (response.data.zbiId == this.ticketList[i].zbiId) {
  1138. this.$set(this.chooseTicket, i, response.data)
  1139. break;
  1140. }
  1141. }
  1142. self.closeTicket();
  1143. })
  1144. self.openEditBill = false
  1145. },
  1146. //查询有无签收内部审批
  1147. isOpenApproval(){
  1148. var confirmParam = {};
  1149. confirmParam.menuId = "1000000005";
  1150. isOpenApproval(confirmParam).then((response) => {
  1151. var result = response.data.isOpen;
  1152. //有签收内部审批
  1153. if(true == result){
  1154. //获取融资方审批状态(拒绝或者状态为空时显示通过按钮)
  1155. if(this.zfiSupplierStatus == "02" || this.zfiSupplierStatus == "" || this.zfiSupplierStatus == "null" || this.zfiSupplierStatus == null ){
  1156. this.isHas = true;
  1157. }else{
  1158. this.isHas = false;
  1159. //获取文件
  1160. //融资方通过
  1161. if(this.zfiSupplierStatus == '01'){
  1162. //预览文件
  1163. this.getContractFile(true);
  1164. }
  1165. }
  1166. }else{//无签收内部审批,显示签收按钮
  1167. this.isHas = false;
  1168. //融资方通过
  1169. if(this.zfiSupplierStatus == '01'){
  1170. //预览文件
  1171. this.getContractFile(true);
  1172. }
  1173. }
  1174. });
  1175. },
  1176. //签收
  1177. sign(){
  1178. //融资方通过
  1179. if(this.zfiSupplierStatus == '01'){
  1180. //预览文件
  1181. this.getContractFile(false);
  1182. }else{
  1183. this.$refs["form"].validate(valid => {
  1184. //通过
  1185. if(this.ticketList.length < 1){
  1186. this.$message({
  1187. message: '请选择应收账款',
  1188. type: 'warning'
  1189. });
  1190. return;
  1191. }
  1192. if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
  1193. this.$message({
  1194. message: '签发金额不可大于合计金额',
  1195. type: 'warning'
  1196. });
  1197. return;
  1198. }
  1199. if (valid) {
  1200. const loading = this.$loading({
  1201. lock: true,
  1202. text: 'Loading',
  1203. background: 'rgba(0, 0, 0,0)'
  1204. });
  1205. //如果签发金额小于合计金额
  1206. if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
  1207. var _this = this;
  1208. this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
  1209. confirmButtonText: "确定",
  1210. cancelButtonText: "取消",
  1211. type: "warning"
  1212. }).then(function() {
  1213. //应收账款
  1214. _this.form.ticketList = _this.ticketList;
  1215. _this.form.flag = "00";
  1216. signFor(_this.form).then(response => {
  1217. loading.close();
  1218. //预览文件
  1219. _this.getContractFile(false);
  1220. }).catch((response)=>{
  1221. loading.close();
  1222. });
  1223. }).catch((e) => {
  1224. loading.close();
  1225. });
  1226. }else{
  1227. //应收账款
  1228. this.form.ticketList = this.ticketList;
  1229. this.form.flag = "00";
  1230. signFor(this.form).then(response => {
  1231. loading.close();
  1232. //预览文件
  1233. this.getContractFile(false);
  1234. }).catch((response)=>{
  1235. loading.close();
  1236. });
  1237. }
  1238. }
  1239. });
  1240. }
  1241. },
  1242. //获取合同文件
  1243. getContractFile(nosign){
  1244. const loading = this.$loading({
  1245. lock: true,
  1246. text: 'Loading',
  1247. background: 'rgba(0, 0, 0,0)'
  1248. });
  1249. getContractFile(this.form).then((response) => {
  1250. loading.close();
  1251. if(response.data.list){
  1252. this.pdfFileList = response.data.list;
  1253. }
  1254. //文件存在
  1255. if(this.pdfFileList.length > 0 ){
  1256. this.pdfShowDialog = true;
  1257. }else{
  1258. /* this.$message({
  1259. message: '文件不存在!',
  1260. type: 'warning'
  1261. }); */
  1262. //文件不存在,并且不是一进页面调的文件预览才盖章
  1263. if(!nosign){
  1264. this.contractSigning();
  1265. }
  1266. }
  1267. }).catch((response)=>{
  1268. loading.close();
  1269. });
  1270. },
  1271. closePdfShow(){
  1272. this.pdfShowDialog = false;
  1273. },
  1274. closePdfShows(){
  1275. this.pdfShowDialogs = false;
  1276. },
  1277. //盖章
  1278. contractSigning(){
  1279. const loading = this.$loading({
  1280. lock: true,
  1281. text: 'Loading',
  1282. background: 'rgba(0, 0, 0,0)'
  1283. });
  1284. contractSigning(this.form).then((response) => {
  1285. loading.close();
  1286. const zfiId = this.$route.params && this.$route.params.zfiId;
  1287. getFinanceSign(zfiId).then((response) => {
  1288. //融信编号
  1289. this.financeSignForm.zfiNumber = response.data.zfiNumber;
  1290. //融信金额
  1291. if(response.data.zfiAmount){
  1292. this.financeSignForm.zfiAmount = response.data.zfiAmount;
  1293. }else{
  1294. this.financeSignForm.zfiAmount = "0.00";
  1295. }
  1296. //利率
  1297. if(response.data.zfiRate){
  1298. this.financeSignForm.zfiRate = response.data.zfiRate;
  1299. }else{
  1300. this.financeSignForm.zfiRate = "0";
  1301. }
  1302. //最长融信期限
  1303. this.financeSignForm.intervalTime = response.data.intervalTime;
  1304. //融信有效期
  1305. if(response.data.validity){
  1306. this.financeSignForm.validity = response.data.validity;
  1307. }
  1308. this.goShow = true;
  1309. });
  1310. }).catch((response) => {
  1311. loading.close();
  1312. });
  1313. },
  1314. //去融资
  1315. goFinance(){
  1316. //关闭当前页
  1317. this.$store.dispatch(
  1318. "tagsView/delView",
  1319. this.$route
  1320. );
  1321. //关闭弹框
  1322. this.goShow = false;
  1323. Cookies.set("/credit/goFinance/"+this.zfiId + "/", this.$route.fullPath)
  1324. this.$router.push({ path: "/credit/goFinance/"+this.zfiId + "/" });
  1325. },
  1326. //返回到列表页
  1327. goParent(){
  1328. var self = this
  1329. this.pdfShowDialog = false;
  1330. self.$store.dispatch(
  1331. "tagsView/delView",
  1332. self.$route
  1333. );
  1334. //self.$router.push("/Bill/credit")
  1335. self.$router.push("/Bill/credit")
  1336. },
  1337. /* 金额展示 */
  1338. handleInput(str) {
  1339. return amtformat(str, 2, ".", ",");
  1340. },
  1341. }
  1342. };
  1343. </script>
  1344. <style lang="scss">
  1345. .uoloadfj .el-upload--picture-card{
  1346. width:110px;
  1347. height:110px;
  1348. line-height:110px;
  1349. }
  1350. .fjUoloadSty .el-upload--picture-card{
  1351. display:none;
  1352. }
  1353. table th.star div::before {
  1354. content: '*';
  1355. color: red;
  1356. }
  1357. </style>
  1358. <style type="text/css">
  1359. table.gridtable {
  1360. font-size:11px;
  1361. color:#333333;
  1362. border-width: 1px;
  1363. border-collapse: collapse;
  1364. }
  1365. table.gridtable th {
  1366. border-width: 1px;
  1367. padding: 8px;
  1368. border-style: solid;
  1369. background-color: #dedede;
  1370. }
  1371. table.gridtable td {
  1372. border-width: 1px;
  1373. padding: 8px;
  1374. border-style: solid;
  1375. }
  1376. </style>