goFinance.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <div class="app-container zap-main">
  3. <!-- 添加或修改融资记录对话框 -->
  4. <div class="zap-title">融资信息</div>
  5. <el-form
  6. class="zap-form"
  7. ref="form"
  8. :model="form"
  9. :rules="rules"
  10. :inline="true"
  11. label-width="auto"
  12. >
  13. <el-row class="zap-form" style="padding-bottom: 0;">
  14. <el-col :span="12">
  15. <el-form-item label="选择融信:" prop="zfrFinanceId" size="large">
  16. <el-select v-model="form.zfrFinanceId" clearable @clear="clearBoth" :disabled="true">
  17. <el-option v-for="(item,index) in financeInfList" :key="index" :label="item.zfiNumber" :value="item.zfiId" @click.native="amount(item)" disabled></el-option>
  18. </el-select>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="12">
  22. <el-form-item label="融资收款账户:" prop="zfrCollectionAccount" size="large" label-width="101px">
  23. <el-input v-model="form.zfrCollectionAccount" clearable placeholder="请输入融资账户" maxlength="25" :readonly="onlyRead" />
  24. </el-form-item>
  25. </el-col>
  26. </el-row>
  27. <el-row class="zap-form" style="padding-bottom: 0;">
  28. <el-col :span="12">
  29. <el-form-item label="融信金额:" prop="zfiAmount" size="large">
  30. <el-input v-model="form.zfiAmount" clearable placeholder="请输入融信金额" maxlength="25" readonly >
  31. <template slot="append">元</template>
  32. </el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="12">
  36. <el-form-item label="申请融资方:" prop="companyName" size="large">
  37. <el-input v-model="form.companyName" clearable placeholder="请输入申请融资方" maxlength="25" readonly />
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. <el-row class="zap-form" style="padding-bottom: 0;">
  42. <el-col :span="12">
  43. <el-form-item label="融资金额:" prop="zfrAmount" size="large">
  44. <el-input v-model="form.zfrAmount" clearable placeholder="请输入融资金额" maxlength="25" readonly >
  45. <template slot="append">元</template>
  46. </el-input>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="12">
  50. <el-form-item label="融资利率:" prop="zfrRate" size="large">
  51. <el-input v-model="form.zfrRate" clearable placeholder="请输入融资利率" maxlength="25" readonly >
  52. <template slot="append">%</template>
  53. </el-input>
  54. </el-form-item>
  55. </el-col>
  56. </el-row>
  57. <el-row class="zap-form" style="padding-bottom: 0;">
  58. <el-col :span="12">
  59. <el-form-item label="承诺还款日期:" prop="zfrRepaymentDate" size="large" label-width="101px">
  60. <el-input v-model="form.zfrRepaymentDate" clearable placeholder="请输入承诺还款日期" maxlength="25" readonly />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="12">
  64. <el-form-item label="服务费率:" prop="zfpcrChargeRate" size="large">
  65. <el-input v-model="form.zfpcrChargeRate" clearable placeholder="请输入服务费率" maxlength="25" readonly >
  66. <template slot="append">%</template>
  67. </el-input>
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. <el-row class="zap-form" style="padding-bottom: 0;">
  72. <el-col :span="12">
  73. <el-form-item label="预计融资成本:" prop="cost" size="large" label-width="101px">
  74. <el-input v-model="form.cost" clearable placeholder="请输入预计融资成本" maxlength="25" readonly >
  75. <template slot="append">元</template>
  76. </el-input>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="12">
  80. <el-form-item label="预计融资期限:" prop="term" size="large" label-width="101px">
  81. <el-input v-model="form.term" clearable placeholder="请输入预计融资期限" maxlength="25" readonly >
  82. <template slot="append">天</template>
  83. </el-input>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row class="zap-form" style="padding-bottom: 0;">
  88. <el-col :span="12">
  89. <el-form-item label="预计净融资额:" prop="amount" size="large" label-width="101px">
  90. <el-input v-model="form.amount" clearable placeholder="请输入预计净融资额" maxlength="25" readonly >
  91. <template slot="append">元</template>
  92. </el-input>
  93. </el-form-item>
  94. </el-col>
  95. </el-row>
  96. <div class="contain">
  97. <p>说明:
  98. </p>
  99. <p>
  100. 1. 因银行结算原因,资金到账可能会在申请日期后2-5工作日;
  101. </p>
  102. <p>
  103. 2. 申请融资时,预计融资成本、预计融资期限、预计净融资额,由申请日期单日开始计算;准确数值以银行实际放款日期为准;
  104. </p>
  105. <p>
  106. 3. 因填写融资收款账户错误,或其他原因导致银行无法正常放款,款项将汇入备用收款账户,可在电子账户管理查看;
  107. </p>
  108. <p>
  109. 4. 服务费缴纳与退还要求,可详细阅读《融信产品使用协议》
  110. </p>
  111. </div>
  112. </el-form>
  113. <div class="zap-title">融信信息</div>
  114. <el-row class="zap-form">
  115. <el-col>
  116. <span style="font-size: 14px;color: #333333;">融信凭证</span>
  117. </el-col>
  118. <table class="gridtable" style="width:80%;text-align:center" align="center">
  119. <tr>
  120. <td rowspan="4">开立方</td>
  121. <td>全称</td>
  122. <td>{{openName}}</td>
  123. <td rowspan="4">接收方</td>
  124. <td>全称</td>
  125. <td>{{receiveName}}</td>
  126. </tr>
  127. <tr>
  128. <td>社会统一码</td>
  129. <td>{{openCode}}</td>
  130. <td>社会统一码</td>
  131. <td>{{receiverCode}}</td>
  132. </tr>
  133. <tr>
  134. <td>开户银行</td>
  135. <td>{{openBank}}</td>
  136. <td>开户银行</td>
  137. <td>{{receiverBank}}</td>
  138. </tr>
  139. <tr>
  140. <td>账号</td>
  141. <td>{{openAccount}}</td>
  142. <td>账号</td>
  143. <td>{{receiverAccount}}</td>
  144. </tr>
  145. <tr>
  146. <td colspan="2">粮信金额</td>
  147. <td colspan="4">人民币(大写):{{issuedAmount}}<br>人民币(小写)¥{{amtFormat(form.zfiAmount)}}</td>
  148. </tr>
  149. <tr>
  150. <td colspan="2">起止日期</td>
  151. <td colspan="4">{{stopDate}}</td>
  152. </tr>
  153. </table>
  154. </el-row>
  155. <div class="zap-title zap-margin-top">资产信息</div>
  156. <el-row class="zap-form zap-padding-bottom">
  157. <el-row class="zap-accounts-receivable">
  158. <el-col>
  159. <el-row type="flex" align="middle" style="height: 36px;">
  160. <span class="label">金额大写:</span>
  161. <span class="value" style="margin-right: 40px;">{{ smallToBig(allAmount()) }}</span>
  162. <span class="label">消费金额:</span>
  163. <span class="value">{{ amtFormat(allAmount()) }} 元</span>
  164. </el-row>
  165. </el-col>
  166. </el-row>
  167. <el-table :data="billInfList" stripe>
  168. <el-table-column label="序号" type="index" width="50" align="center">
  169. <template slot-scope="scope">
  170. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column label="编号" align="center" prop="zbiNumber" />
  174. <el-table-column label="账款名称" align="center" prop="zbiName" />
  175. <el-table-column label="应收企业" align="center" prop="payee" />
  176. <el-table-column label="应付企业" align="center" prop="payer" />
  177. <el-table-column label="还款时间" align="center" prop="zbiPayDate" />
  178. <el-table-column label="金额" align="center" prop="zbiAmount" />
  179. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
  180. <template slot-scope="scope">
  181. <el-button
  182. size="mini"
  183. type="text"
  184. icon="el-icon-view"
  185. @click="handleDetail(scope.$index, billInfList)"
  186. >详情</el-button>
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. </el-row>
  191. <!-- 签署合同 -->
  192. <el-row class="zap-margin-top zap-form">
  193. <div class="zap-title">签署合同</div>
  194. <el-table :data="creditSealList" style="width: 100%">
  195. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
  196. <template slot-scope="scope">
  197. <img style="width:30px;height:30px;"
  198. src="../../../assets/images/pdf.png"
  199. />
  200. <span>{{scope.row.pfiFileName}}
  201. </span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  205. <template slot-scope="scope">
  206. <el-button
  207. size="mini"
  208. type="text"
  209. icon="el-icon-view"
  210. @click="handleDownload(scope.row)"
  211. >下载</el-button>
  212. <el-button
  213. size="mini"
  214. type="text"
  215. icon="el-icon-view"
  216. @click="handlePreview(scope.row)"
  217. >预览</el-button>
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. </el-row>
  222. <!-- 发票附件 -->
  223. <!-- <div class="zap-title zap-margin-top">发票附件</div>
  224. <el-row class="zap-form">
  225. <el-table :data="invoiceFileList" style="width: 100%" stripe>
  226. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  227. <el-table-column
  228. label="操作"
  229. align="center"
  230. class-name="small-padding fixed-width"
  231. width="300"
  232. fixed="right"
  233. >
  234. <template slot-scope="scope">
  235. <el-button
  236. size="mini"
  237. type="text"
  238. icon="el-icon-view"
  239. @click="handleDownload(scope.row)"
  240. >下载</el-button>
  241. <el-button
  242. size="mini"
  243. type="text"
  244. icon="el-icon-view"
  245. @click="handlePreview(scope.row)"
  246. >预览</el-button>
  247. </template>
  248. </el-table-column>
  249. </el-table>
  250. </el-row> -->
  251. <!-- 合同附件 -->
  252. <!-- <div class="zap-title zap-margin-top">合同附件</div>
  253. <el-row class="zap-form">
  254. <el-table :data="contractFileList" style="width: 100%" stripe>
  255. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  256. <el-table-column
  257. label="操作"
  258. align="center"
  259. class-name="small-padding fixed-width"
  260. width="300"
  261. fixed="right"
  262. >
  263. <template slot-scope="scope">
  264. <el-button
  265. size="mini"
  266. type="text"
  267. icon="el-icon-view"
  268. @click="handleDownload(scope.row)"
  269. >下载</el-button>
  270. <el-button
  271. size="mini"
  272. type="text"
  273. icon="el-icon-view"
  274. @click="handlePreview(scope.row)"
  275. >预览</el-button>
  276. </template>
  277. </el-table-column>
  278. </el-table>
  279. </el-row> -->
  280. <!-- 其他附件 -->
  281. <!-- <div class="zap-title zap-margin-top">其他附件</div>
  282. <el-row class="zap-form">
  283. <el-table :data="otherFileList" style="width: 100%" stripe>
  284. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  285. <el-table-column
  286. label="操作"
  287. align="center"
  288. class-name="small-padding fixed-width"
  289. width="300"
  290. fixed="right"
  291. >
  292. <template slot-scope="scope">
  293. <el-button
  294. size="mini"
  295. type="text"
  296. icon="el-icon-view"
  297. @click="handleDownload(scope.row)"
  298. >下载</el-button>
  299. <el-button
  300. size="mini"
  301. type="text"
  302. icon="el-icon-view"
  303. @click="handlePreview(scope.row)"
  304. >预览</el-button>
  305. </template>
  306. </el-table-column>
  307. </el-table>
  308. </el-row> -->
  309. <el-row style="height: 109px;" type="flex" align="middle" justify="center">
  310. <el-button type="primary" plain @click="cancel">取 消</el-button>
  311. <el-button type="primary" @click="submitForm">确 定</el-button>
  312. </el-row>
  313. <!-- 附件详情 -->
  314. <el-dialog title="详情" :visible.sync="openDetailBill" width="1120px" append-to-body>
  315. <detail-bill :zbiId="this.zbiId" v-if="openDetailBill"></detail-bill>
  316. </el-dialog>
  317. <!--预览-->
  318. <el-dialog :visible.sync="openFile" width="900px" append-to-body>
  319. <img :src="wordUrl" v-if="show" width="800px" height="500px" />
  320. <iframe :src="wordUrl" width="800px" height="500px" frameborder="1" v-if="heid" />
  321. </el-dialog>
  322. </div>
  323. </template>
  324. <script>
  325. import {
  326. addRecord,
  327. listBillInf,
  328. listAccInf
  329. } from "@/api/service/financeRecord/record";
  330. import { listFinanceInf } from "@/api/common/financeInf";
  331. import { getFile } from "@/api/service/credit/credit";
  332. import { getToken } from "@/utils/auth";
  333. import { getUserProfile } from "@/api/system/user";
  334. import {getCreditDetail} from "@/api/service/credit/credit";
  335. import DetailBill from "@/views/service/credit/billDetail";
  336. import {getCreditSealFile} from "@/api/service/credit/creditHandle";
  337. export default {
  338. name: "financeRecord",
  339. components: {DetailBill},
  340. data() {
  341. return {
  342. //往来账款id
  343. zbiId: '',
  344. //融资账户是够编辑
  345. onlyRead: false,
  346. labelPosition: "top",
  347. // 遮罩层
  348. loading: true,
  349. // 选中数组
  350. ids: [],
  351. // 非单个禁用
  352. single: true,
  353. // 非多个禁用
  354. multiple: true,
  355. // 显示搜索条件
  356. showSearch: true,
  357. // 总条数
  358. total: 0,
  359. // 全部融资记录表格数据
  360. recordList: [],
  361. //融信编号数据
  362. financeInfList: [],
  363. //应收账款
  364. billInfList: [],
  365. //合同附件
  366. contractFileList: [],
  367. //发票附件
  368. invoiceFileList: [],
  369. //其他文件
  370. otherFileList: [],
  371. //盖章文件
  372. creditSealList:[],
  373. //开立方
  374. openName:"",
  375. //开立社会码
  376. openCode:"",
  377. //开立银行
  378. openBank:"",
  379. //开立账户
  380. openAccount:"",
  381. //接收方
  382. receiveName:"",
  383. //接收方社会统一码
  384. receiverCode:"",
  385. //接收方银行
  386. receiverBank:"",
  387. //接收方账户
  388. receiverAccount:"",
  389. //起止日期
  390. stopDate:"",
  391. //签发金额大写
  392. issuedAmount: "零元整",
  393. // 弹出层标题
  394. title: "",
  395. // 是否显示弹出层
  396. open: false,
  397. openDetailBill: false,
  398. // 查询参数
  399. queryParams: {
  400. pageNum: 1,
  401. pageSize: 10,
  402. zfrFinanceId: null,
  403. zfrNumber: null,
  404. zfrAmount: null,
  405. zfrRate: null,
  406. zfrHandler: null,
  407. zfrRepaymentDate: null,
  408. zfrApplyDate: null,
  409. zfrLoanDate: null,
  410. zfrApplyAmount: null,
  411. zfrApplyType: null,
  412. zfrStatus: null,
  413. zfrApproveStt: null,
  414. zfpcrLoanType: null,
  415. zfiProductId: null
  416. },
  417. queryParamsDown:{
  418. pfiFileUrl: null
  419. },
  420. // 表单参数
  421. form: {},
  422. forms:{},
  423. openFile: false,
  424. wordUrl: "",
  425. show: false,
  426. heid: false,
  427. // 表单校验
  428. rules: {
  429. zfrFinanceId: [
  430. { required: true, message: "融信编号不能为空", trigger: "blur" }
  431. ],
  432. zfrAmount: [
  433. { required: true, message: "融资金额不能为空", trigger: "blur" }
  434. ]
  435. }
  436. };
  437. },
  438. created() {
  439. const zfiId = this.$route.params && this.$route.params.zfiId;
  440. this.$set(this.form, "zfrFinanceId", zfiId);
  441. this.getFinanceInf(zfiId);
  442. this.getUserProfile();
  443. },
  444. methods: {
  445. //格式化金额
  446. amtFormat(cellValue) {
  447. if (cellValue == null || cellValue == undefined || cellValue == '') {
  448. cellValue = '0.00'
  449. }
  450. cellValue += '';
  451. if (!cellValue.includes('.')) {
  452. cellValue += '.00';
  453. }
  454. console.log(cellValue);
  455. return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  456. return $1 + ',';
  457. }).replace(/\.$/, '');
  458. },
  459. /** 查询融信编号 */
  460. getFinanceInf(zfrFinanceId) {
  461. this.loading = true;
  462. listFinanceInf(zfrFinanceId).then(response => {
  463. debugger;
  464. if (response.data) {
  465. this.financeInfList = response.data;
  466. for (let item of this.financeInfList) {
  467. if (item.zfiId == zfrFinanceId) {
  468. this.amount(item);
  469. }
  470. }
  471. this.loading = false;
  472. }
  473. });
  474. },
  475. getUserProfile(){
  476. getUserProfile().then(response => {
  477. debugger
  478. if(response.company){
  479. this.$set(this.form, "companyName", response.company.scyName);
  480. }
  481. });
  482. },
  483. //获取盖章文件
  484. getCreditSealFile(){
  485. getCreditSealFile(this.forms).then((response) => {
  486. debugger
  487. if(response.data.list){
  488. this.creditSealList = response.data.list;
  489. }
  490. });
  491. },
  492. // 取消按钮
  493. cancel() {
  494. this.$store.dispatch("tagsView/delView", this.$route);
  495. this.$router.go(-1);
  496. },
  497. //文件下载
  498. handleDownload(row) {
  499. debugger
  500. const pfiFileUrl = row.pfiFileUrl;
  501. if (pfiFileUrl != null && pfiFileUrl != "") {
  502. const pfiFileName = row.pfiFileName;
  503. this.queryParamsDown.pfiFileUrl = pfiFileUrl;
  504. this.download(
  505. "sc-service/creditLine/jpgAuthorization",
  506. {
  507. ...this.queryParamsDown
  508. },
  509. pfiFileName
  510. );
  511. // window.open(pfiUrl + "/" + getToken());
  512. } else {
  513. this.$message({
  514. message: "该附件不存在!",
  515. type: "warning"
  516. });
  517. return;
  518. }
  519. },
  520. // 表单重置
  521. reset() {
  522. this.form = {
  523. zfrId: null,
  524. zfrFinanceId: null,
  525. zfrNumber: null,
  526. zfrAmount: null,
  527. zfrRate: null,
  528. zfrHandler: null,
  529. zfrRepaymentDate: null,
  530. zfrApplyDate: null,
  531. zfrLoanDate: null,
  532. zfrApplyAmount: null,
  533. zfrApplyType: null,
  534. zfrStatus: "00",
  535. zfrApproveStt: null,
  536. zfrProfitSpare1: null,
  537. zfrProfitSpare2: null,
  538. zfrProfitSpare3: null,
  539. zfrProfitSpare4: null,
  540. zfrProfitSpare5: null,
  541. zfrProfitSpare6: null,
  542. zfrProfitSpare7: null,
  543. zfrProfitSpare8: null,
  544. zfrProfitSpare9: null,
  545. createBy: null,
  546. createTime: null,
  547. updateBy: null,
  548. updateTime: null
  549. };
  550. this.resetForm("form");
  551. },
  552. /** 全部搜索按钮操作 */
  553. handleQuery() {
  554. this.queryParams.pageNum = 1;
  555. this.getList();
  556. },
  557. /** 全部重置按钮操作 */
  558. resetQuery() {
  559. this.resetForm("queryForm");
  560. this.handleQuery();
  561. },
  562. //全部 多选框选中数据
  563. handleSelectionChange(selection) {
  564. this.ids = selection.map(item => item.zfrId);
  565. this.single = selection.length !== 1;
  566. this.multiple = !selection.length;
  567. },
  568. /* 融信编号赋值融资金额 */
  569. amount(item) {
  570. debugger;
  571. this.$set(this.form, "zfiAmount", item.zfiAmount);
  572. this.$set(this.form, "zfrAmount", item.zfiAmount);
  573. this.$set(this.form, "zfrRepaymentDate", item.zfiExpireDate);
  574. this.$set(this.form, "zfrRate", item.zfpcrRate);
  575. this.$set(this.form, "zfpcrLoanType", item.zfpcrLoanType);
  576. this.$set(this.form, "zfiProductId", item.zfiProductId);
  577. this.$set(this.form, "zfpcrChargeRate", item.zfpcrChargeRate);
  578. this.$set(this.form, "cost", item.cost);
  579. this.$set(this.form, "term", item.term);
  580. this.$set(this.form, "amount", item.amount);
  581. if (item.zfiId) {
  582. this.loading = true;
  583. listBillInf(item.zfiId)
  584. .then(response => {
  585. this.billInfList = response.data;
  586. this.loading = false;
  587. })
  588. .then(() => {
  589. var queryParamsFile = {};
  590. queryParamsFile.ticketList = this.billInfList;
  591. getFile(queryParamsFile).then(response => {
  592. if (response.data) {
  593. //获取发票文件
  594. this.invoiceFileList = response.data.invoiceFileList;
  595. //获取合同文件
  596. this.contractFileList = response.data.contractFileList;
  597. //获取其他文件
  598. this.otherFileList = response.data.otherFileList;
  599. }
  600. });
  601. if (item.zfpcrLoanType == "0") {
  602. listAccInf(item.zfiProductId).then(response => {
  603. this.$set(this.form, "zfrCollectionAccount", response.msg);
  604. this.onlyRead = true;
  605. });
  606. }
  607. });
  608. getCreditDetail(item.zfiId).then((response) => {
  609. if(response.data){
  610. this.forms= response.data.financeInf;
  611. //签发金额大写
  612. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  613. //给表格赋值
  614. this.openName = response.data.openName;
  615. this.openCode = response.data.openCode;
  616. this.openBank = response.data.openBank;
  617. this.openAccount = response.data.openAccount;
  618. this.receiveName = response.data.receiveName;
  619. this.receiverCode = response.data.receiverCode;
  620. this.receiverBank = response.data.receiverBank;
  621. this.receiverAccount = response.data.receiverAccount;
  622. this.stopDate = response.data.stopDate;
  623. this.zfiRate = response.data.financeInf.zfiRate;
  624. }
  625. //盖章合同
  626. this.getCreditSealFile();
  627. })
  628. }
  629. },
  630. //详情按钮
  631. handleDetail(index, rows){
  632. this.zbiId = rows[index].zbiId
  633. this.openDetailBill = true
  634. },
  635. /** 提交按钮 */
  636. submitForm() {
  637. this.$refs["form"].validate(valid => {
  638. if (valid) {
  639. const loading = this.$loading({
  640. lock: true,
  641. text: "Loading",
  642. spinner: "el-icon-loading",
  643. background: "rgba(0, 0, 0, 0.7)"
  644. });
  645. console.log(this.form, "AAHAHAHAH");
  646. addRecord(this.form)
  647. .then(response => {
  648. this.msgSuccess("融资申请成功");
  649. loading.close();
  650. this.$store.dispatch("tagsView/delView", this.$route);
  651. this.$router.go(-1);
  652. })
  653. .catch(response => {
  654. loading.close();
  655. });
  656. }
  657. });
  658. },
  659. /* 清空 */
  660. clearBoth() {
  661. this.form.zfrAmount = "";
  662. this.form, (zfrRepaymentDate = "");
  663. this.form.zfrRate = "";
  664. this.form.zfpcrLoanType = "";
  665. this.billInfList = [];
  666. this.contractFileList = [];
  667. this.invoiceFileList = [];
  668. this.otherFileList = [];
  669. },
  670. //应收账款合计
  671. allAmount() {
  672. var strarr = [0.0];
  673. for (let i in this.billInfList) {
  674. strarr.push(this.billInfList[i]["zbiAmount"]);
  675. }
  676. return Math.floor(eval(strarr.join("+")) * 100) / 100; //结果
  677. },
  678. /* // 将数字金额转换为大写金额 */
  679. smallToBig(money) {
  680. // 将数字金额转换为大写金额
  681. var cnNums = new Array(
  682. "零",
  683. "壹",
  684. "贰",
  685. "叁",
  686. "肆",
  687. "伍",
  688. "陆",
  689. "柒",
  690. "捌",
  691. "玖"
  692. ); //汉字的数字
  693. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  694. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  695. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  696. var cnInteger = "整"; //整数金额时后面跟的字符
  697. var cnIntLast = "元"; //整数完以后的单位
  698. //最大处理的数字
  699. var maxNum = 999999999999999.9999;
  700. var integerNum; //金额整数部分
  701. var decimalNum; //金额小数部分
  702. //输出的中文金额字符串
  703. var chineseStr = "";
  704. var parts; //分离金额后用的数组,预定义
  705. if (money == "" || money == null || money == undefined) {
  706. return "零元零角零分";
  707. }
  708. money = parseFloat(money);
  709. if (money >= maxNum) {
  710. //超出最大处理数字
  711. return "超出最大处理数字";
  712. }
  713. if (money == 0) {
  714. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  715. return chineseStr;
  716. }
  717. //四舍五入保留两位小数,转换为字符串
  718. money = Math.round(money * 100).toString();
  719. integerNum = money.substr(0, money.length - 2);
  720. decimalNum = money.substr(money.length - 2);
  721. //获取整型部分转换
  722. if (parseInt(integerNum, 10) > 0) {
  723. var zeroCount = 0;
  724. var IntLen = integerNum.length;
  725. for (var i = 0; i < IntLen; i++) {
  726. var n = integerNum.substr(i, 1);
  727. var p = IntLen - i - 1;
  728. var q = p / 4;
  729. var m = p % 4;
  730. if (n == "0") {
  731. zeroCount++;
  732. } else {
  733. if (zeroCount > 0) {
  734. chineseStr += cnNums[0];
  735. }
  736. //归零
  737. zeroCount = 0;
  738. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  739. }
  740. if (m == 0 && zeroCount < 4) {
  741. chineseStr += cnIntUnits[q];
  742. }
  743. }
  744. chineseStr += cnIntLast;
  745. }
  746. //小数部分
  747. if (decimalNum != "") {
  748. var decLen = decimalNum.length;
  749. for (var i = 0; i < decLen; i++) {
  750. var n = decimalNum.substr(i, 1);
  751. if (n != "0") {
  752. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  753. }
  754. }
  755. }
  756. if (chineseStr == "") {
  757. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  758. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  759. chineseStr += cnInteger;
  760. }
  761. return chineseStr;
  762. },
  763. /** 导出按钮操作 */
  764. handleExport() {
  765. this.download(
  766. "sc-service/record/export",
  767. {
  768. ...this.queryParams
  769. },
  770. `sc-service_record.xlsx`
  771. );
  772. },
  773. //预览
  774. handlePreview(row) {
  775. const pfiUrl = row.pfiUrl;
  776. const pfiFileName = row.pfiFileName;
  777. if (row.pfiUrl) {
  778. console.log(pfiFileName.substr(-3));
  779. if (pfiFileName.substr(-3) == "pdf") {
  780. this.wordUrl = pfiUrl + "/" + getToken();
  781. this.show = false;
  782. this.heid = true;
  783. } else if (
  784. pfiFileName.substr(-3) == "jpg" ||
  785. pfiFileName.substr(-3) == "png" ||
  786. pfiFileName.substr(-3) == "JPG" ||
  787. pfiFileName.substr(-3) == "PNG" ||
  788. pfiFileName.substr(-4) == "jpeg" ||
  789. pfiFileName.substr(-3) == "JPEG"
  790. ) {
  791. this.wordUrl = pfiUrl + "/" + getToken();
  792. this.show = true;
  793. this.heid = false;
  794. console.log("====>", this.wordUrl);
  795. } else if (
  796. pfiFileName.substr(-3) == "doc" ||
  797. pfiFileName.substr(-3) == "DOC" ||
  798. pfiFileName.substr(-4) == "docx" ||
  799. pfiFileName.substr(-3) == "DOCX"
  800. ) {
  801. this.wordUrl =
  802. "https://view.officeapps.live.com/op/view.aspx?src=" +
  803. pfiUrl +
  804. "/" +
  805. getToken() +
  806. "/" +
  807. pfiFileName;
  808. this.show = false;
  809. this.heid = true;
  810. console.log("====>", this.wordUrl);
  811. } else {
  812. this.$message({
  813. message: "暂不支持该类型文件预览",
  814. type: "warning"
  815. });
  816. return;
  817. }
  818. }
  819. this.openFile = true;
  820. }
  821. }
  822. };
  823. </script>
  824. <style type="text/css">
  825. table.gridtable {
  826. font-size:11px;
  827. color:#333333;
  828. border-width: 1px;
  829. border-collapse: collapse;
  830. }
  831. table.gridtable th {
  832. border-width: 1px;
  833. padding: 8px;
  834. border-style: solid;
  835. background-color: #dedede;
  836. }
  837. table.gridtable td {
  838. border-width: 1px;
  839. padding: 8px;
  840. border-style: solid;
  841. }
  842. </style>