addInformation.vue 62 KB

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