signFor.vue 39 KB

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