creditDetail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div class="app-container">
  3. <el-form ref="form" :model="form" disabled :rules="rules" :inline="true" style="margin-top: 20px" label-width="auto" >
  4. <el-divider content-position="left">融信详情</el-divider>
  5. <el-row>
  6. <el-col :span="8">
  7. <el-form-item label="融信编号" prop="zfiNumber">
  8. <el-input v-model="form.zfiNumber" style="width: 200px"/>
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="8">
  12. <el-form-item label="创建时间" prop="createTime">
  13. <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
  14. </el-date-picker>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="8">
  18. <el-form-item label="创建人" prop="createName">
  19. <el-input v-model="form.createName" style="width: 200px"/>
  20. </el-form-item>
  21. </el-col>
  22. </el-row>
  23. <el-row>
  24. <el-col :span="8">
  25. <el-form-item label="开立方" prop="openName">
  26. <el-input v-model="form.openName" style="width: 200px"/>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="8">
  30. <el-form-item label="接收方" prop="receiveName">
  31. <el-input v-model="form.receiveName" style="width: 200px"/>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="授信额度" prop="zfpName" >
  36. <el-input v-model="form.zfpName" style="width: 200px"/>
  37. </el-form-item>
  38. </el-col>
  39. </el-row>
  40. <el-row>
  41. <el-col :span="8">
  42. <el-form-item label="签发有效期" prop="zfiEffectiveDate">
  43. <el-date-picker disabled size="small" style="width: 200px" v-model="form.zfiEffectiveDate" type="date" value-format="yyyy-MM-dd">
  44. </el-date-picker>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="8">
  48. <el-form-item label="承诺还款日" prop="zfiExpireDate" >
  49. <el-date-picker disabled size="small" style="width: 200px" v-model="form.zfiExpireDate" type="date" value-format="yyyy-MM-dd">
  50. </el-date-picker>
  51. </el-form-item>
  52. </el-col>
  53. <!-- <el-col :span="8">
  54. <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="isShow">
  55. <el-input v-model="form.zfiCollectionAccount" style="width: 200px"/>
  56. </el-form-item>
  57. </el-col> -->
  58. </el-row>
  59. <el-divider content-position="left" >{{tableTitle}}</el-divider>
  60. <el-form-item style="margin-left: 100px">
  61. <el-form-item label="合计金额:">
  62. <span>{{checkTotalAmt}}</span>
  63. </el-form-item>
  64. <el-form-item label="金额大写:">
  65. <span>{{checkTotalBigAmt}}</span>
  66. </el-form-item>
  67. <el-table :data="payList" style="width: 1100px">
  68. <el-table-column label="账款名称" align="center" prop="zbiName" show-overflow-tooltip />
  69. <el-table-column label="应收企业" align="center" prop="receiveName"/>
  70. <el-table-column label="应付企业" align="center" prop="payName" />
  71. <el-table-column label="预计还款期" align="center" prop="zbiPayDate" show-overflow-tooltip />
  72. <el-table-column label="金额" align="center" prop="zbiAmount" />
  73. </el-table>
  74. </el-form-item>
  75. <el-row>
  76. <el-col :span="8">
  77. <el-form-item label="签发金额" prop="zfiAmount">
  78. <el-input v-model="form.zfiAmount" style="width: 200px"/>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="8">
  82. <el-form-item label="金额大写" prop="issuedAmount">
  83. {{issuedAmount}}
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <!-- <el-row>
  88. <el-col :span="8">
  89. <el-form-item label="金额大写" prop="issuedAmount">
  90. {{issuedAmount}}
  91. </el-form-item>
  92. </el-col>
  93. </el-row> -->
  94. </el-form>
  95. <!-- 发票附件 -->
  96. <el-divider content-position="left">发票附件</el-divider>
  97. <el-table :data="invoiceFileList" style="width: 100%">
  98. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  99. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  100. <template slot-scope="scope">
  101. <el-button
  102. size="mini"
  103. type="text"
  104. icon="el-icon-view"
  105. @click="handleDownload(scope.row)"
  106. >下载</el-button>
  107. <el-button
  108. size="mini"
  109. type="text"
  110. icon="el-icon-view"
  111. @click="handlePreview(scope.row)"
  112. >预览</el-button>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. <!-- 合同附件 -->
  117. <el-divider content-position="left">合同附件</el-divider>
  118. <el-table :data="contractFileList" style="width: 100%">
  119. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  120. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  121. <template slot-scope="scope">
  122. <el-button
  123. size="mini"
  124. type="text"
  125. icon="el-icon-view"
  126. @click="handleDownload(scope.row)"
  127. >下载</el-button>
  128. <el-button
  129. size="mini"
  130. type="text"
  131. icon="el-icon-view"
  132. @click="handlePreview(scope.row)"
  133. >预览</el-button>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. <!-- 其他附件 -->
  138. <el-divider content-position="left">其他附件</el-divider>
  139. <el-table :data="otherFileList" style="width: 100%">
  140. <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
  141. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
  142. <template slot-scope="scope">
  143. <el-button
  144. size="mini"
  145. type="text"
  146. icon="el-icon-view"
  147. @click="handleDownload(scope.row)"
  148. >下载</el-button>
  149. <el-button
  150. size="mini"
  151. type="text"
  152. icon="el-icon-view"
  153. @click="handlePreview(scope.row)"
  154. >预览</el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. <el-divider content-position="left">盖章附件</el-divider>
  159. <el-row>
  160. <img style="width:50px;height:50px;"
  161. :key="dict.pfiFileId"
  162. src="../../../assets/images/pdf.png"
  163. v-for="dict in creditSealList"
  164. @click="handlePreview(dict)"
  165. :title="dict.pfiFileName"
  166. >
  167. </el-row>
  168. <div style="margin-top: 100px; margin-left:45%">
  169. <el-button type="info" @click="cancel">取消</el-button>
  170. <!-- <el-button type="success" @click="submitForm"
  171. >提交</el-button> -->
  172. </div>
  173. <!--预览-->
  174. <el-dialog :visible.sync="openFile" width="1000px" append-to-body>
  175. <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
  176. <iframe :src="wordUrl" width='800px' height='600px' frameborder='1' v-if="heid"/>
  177. </el-dialog>
  178. </div>
  179. </template>
  180. <script>
  181. import {getCreditDetail,getFile} from "@/api/service/credit/credit";
  182. import {accAdd} from "@/utils/calculation";
  183. import {getToken} from "@/utils/auth";
  184. import {getCreditSealFile} from "@/api/service/credit/creditHandle";
  185. export default {
  186. name: "addCredit",
  187. components: {},
  188. data() {
  189. return {
  190. // 总条数
  191. total: 0,
  192. // 表单参数
  193. form: {
  194. },
  195. // 表单校验
  196. rules: {
  197. },
  198. // 是否显示弹出层
  199. open: false,
  200. //应付账款
  201. payList:[],
  202. //签发金额大写
  203. issuedAmount:"零元整",
  204. //合计选中的应付账款的金额
  205. checkTotalAmt:"0.00",
  206. //合计选中的应付账款的大写金额
  207. checkTotalBigAmt:"零元整",
  208. //标题
  209. tableTitle:"",
  210. //控制收款账号是否显示
  211. isShow:false,
  212. //获取类型
  213. createType:'',
  214. //合同附件
  215. contractFileList:[],
  216. //发票附件
  217. invoiceFileList:[],
  218. //其他文件
  219. otherFileList:[],
  220. openFile:false,
  221. wordUrl: "",
  222. show:false,
  223. heid:false,
  224. //盖章文件
  225. creditSealList:[]
  226. };
  227. },
  228. created() {
  229. const zfiId = this.$route.params && this.$route.params.zfiId;
  230. getCreditDetail(zfiId).then((response) => {
  231. if(response.data){
  232. //融信信息
  233. this.form = response.data.financeInf;
  234. this.createType = response.data.financeInf.zfiCreateType;
  235. //核心开立
  236. if(response.data.financeInf.zfiCreateType == '1'){
  237. this.tableTitle = "应付账款";
  238. }else{
  239. this.tableTitle = "应收账款";
  240. //融资开立
  241. if(response.data.financeInf.zfiCreateType == '2'){
  242. //收款账号
  243. //非电子
  244. if(response.data.proComRel.zfpcrLoanType != '0'){
  245. this.isShow = true;
  246. }
  247. }
  248. }
  249. //接收方
  250. this.form.receiveName = response.data.receiveName;
  251. //授信额度
  252. this.form.zfpName = response.data.zfpName;
  253. //开立方
  254. this.form.openName = response.data.openName;
  255. //创建人
  256. this.form.createName = response.data.createName;
  257. //签发金额大写
  258. this.issuedAmount = this.smallToBig(this.form.zfiAmount);
  259. }
  260. if(response.data.payList){
  261. this.payList = response.data.payList.records;
  262. this.getReTotal(this.payList);
  263. //附件
  264. this.getFile(this.payList);
  265. }
  266. this.getCreditSealFile();
  267. })
  268. },
  269. methods: {
  270. // 取消按钮
  271. cancel() {
  272. this.$store.dispatch("tagsView/delView", this.$route);
  273. this.$router.go(-1);
  274. },
  275. /* 多选框跨页 */
  276. rowkeyCustomer(row) {
  277. return row.cciId;
  278. },
  279. //重新合计
  280. getReTotal(chooseTicket){
  281. //合计
  282. this.checkTotalAmt = "0.00";
  283. for(var i = 0; i < chooseTicket.length;i++){
  284. this.checkTotalAmt = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
  285. }
  286. this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
  287. this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
  288. },
  289. //获取附件信息
  290. getFile(datas){
  291. var queryParamsFile = {};
  292. queryParamsFile.ticketList = datas;
  293. getFile(queryParamsFile).then((response) => {
  294. if(response.data){
  295. //获取发票文件
  296. this.invoiceFileList = response.data.invoiceFileList;
  297. //获取合同文件
  298. this.contractFileList = response.data.contractFileList;
  299. //获取其他文件
  300. this.otherFileList = response.data.otherFileList;
  301. }
  302. });
  303. },
  304. //文件下载
  305. handleDownload(row){
  306. const pfiUrl = row.pfiUrl;
  307. if(pfiUrl != null && pfiUrl != ''){
  308. window.open(pfiUrl +"/"+ getToken());
  309. }else{
  310. this.$message({
  311. message: '该附件不存在!',
  312. type: 'warning'
  313. });
  314. return;
  315. }
  316. },
  317. //格式化金额
  318. amtFormat(cellValue) {
  319. if(cellValue == null || cellValue== undefined || cellValue == ''){
  320. cellValue = '0.00'
  321. }
  322. cellValue += '';
  323.       if (!cellValue.includes('.')) {
  324. cellValue += '.00';
  325. }
  326.       return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  327.         return $1 + ',';
  328.       }).replace(/\.$/, '');
  329. },
  330. /* // 将数字金额转换为大写金额 */
  331. smallToBig(money) {
  332. // 将数字金额转换为大写金额
  333. var cnNums = new Array(
  334. "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
  335. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  336. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  337. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  338. var cnInteger = "整"; //整数金额时后面跟的字符
  339. var cnIntLast = "元"; //整数完以后的单位
  340. //最大处理的数字
  341. var maxNum = 999999999999999.9999;
  342. var integerNum; //金额整数部分
  343. var decimalNum; //金额小数部分
  344. //输出的中文金额字符串
  345. var chineseStr = "";
  346. var parts; //分离金额后用的数组,预定义
  347. if (money == "" || money == null || money == undefined) {
  348. return "零元零角零分";
  349. }
  350. money = parseFloat(money);
  351. if (money >= maxNum) {
  352. //超出最大处理数字
  353. return "超出最大处理数字";
  354. }
  355. if (money == 0) {
  356. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  357. return chineseStr;
  358. }
  359. //四舍五入保留两位小数,转换为字符串
  360. money = Math.round(money * 100).toString();
  361. integerNum = money.substr(0, money.length - 2);
  362. decimalNum = money.substr(money.length - 2);
  363. //获取整型部分转换
  364. if (parseInt(integerNum, 10) > 0) {
  365. var zeroCount = 0;
  366. var IntLen = integerNum.length;
  367. for (var i = 0; i < IntLen; i++) {
  368. var n = integerNum.substr(i, 1);
  369. var p = IntLen - i - 1;
  370. var q = p / 4;
  371. var m = p % 4;
  372. if (n == "0") {
  373. zeroCount++;
  374. } else {
  375. if (zeroCount > 0) {
  376. chineseStr += cnNums[0];
  377. }
  378. //归零
  379. zeroCount = 0;
  380. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  381. }
  382. if (m == 0 && zeroCount < 4) {
  383. chineseStr += cnIntUnits[q];
  384. }
  385. }
  386. chineseStr += cnIntLast;
  387. }
  388. //小数部分
  389. if (decimalNum != "") {
  390. var decLen = decimalNum.length;
  391. for (var i = 0; i < decLen; i++) {
  392. var n = decimalNum.substr(i, 1);
  393. if (n != "0") {
  394. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  395. }
  396. }
  397. }
  398. if (chineseStr == "") {
  399. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  400. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  401. chineseStr += cnInteger;
  402. }
  403. return chineseStr;
  404. },
  405. //预览
  406. handlePreview(row) {
  407. const pfiUrl = row.pfiUrl;
  408. const pfiFileName = row.pfiFileName;
  409. if (row.pfiUrl) {
  410. console.log(pfiFileName.substr(-3));
  411. if (pfiFileName.substr(-3) == "pdf") {
  412. this.wordUrl = pfiUrl + "/" + getToken();
  413. this.show=false;
  414. this.heid=true;
  415. } else if (
  416. pfiFileName.substr(-3) == "jpg" ||
  417. pfiFileName.substr(-3) == "png" ||
  418. pfiFileName.substr(-3) == "JPG" ||
  419. pfiFileName.substr(-3) == "PNG" ||
  420. pfiFileName.substr(-4) == "jpeg" ||
  421. pfiFileName.substr(-3) == "JPEG"
  422. ) {
  423. this.wordUrl =
  424. pfiUrl +
  425. "/" +
  426. getToken();
  427. this.show=true;
  428. this.heid=false;
  429. console.log("====>",this.wordUrl);
  430. } else if (
  431. pfiFileName.substr(-3) == "doc" ||
  432. pfiFileName.substr(-3) == "DOC"||
  433. pfiFileName.substr(-4) == "docx" ||
  434. pfiFileName.substr(-3) == "DOCX"
  435. ) {
  436. this.wordUrl =
  437. "https://view.officeapps.live.com/op/view.aspx?src=" +
  438. pfiUrl +
  439. "/" +
  440. getToken() +
  441. "/" +
  442. pfiFileName;
  443. this.show=false;
  444. this.heid=true;
  445. console.log("====>",this.wordUrl);
  446. } else {
  447. this.$message({
  448. message: "暂不支持该类型文件预览",
  449. type: "warning",
  450. });
  451. return;
  452. }
  453. }
  454. this.openFile = true;
  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. };
  466. </script>
  467. <style lang="scss">
  468. .uoloadfj .el-upload--picture-card{
  469. width:110px;
  470. height:110px;
  471. line-height:110px;
  472. }
  473. .fjUoloadSty .el-upload--picture-card{
  474. display:none;
  475. }
  476. table th.star div::before {
  477. content: '*';
  478. color: red;
  479. }
  480. </style>