addInformation.vue 38 KB

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