addInformation.vue 50 KB

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