creditLine.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. <template>
  2. <div class="app-container">
  3. <el-card class="fiche">
  4. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
  5. <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
  6. <div style="float: right;margin-right:1%">
  7. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  8. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
  9. <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px" v-if="this.companyType != '02'"></column-setting>
  10. </div>
  11. <hr style="margin-top: 16px;">
  12. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" >
  13. <el-form-item prop="rzScyName" label="资金方名称" label-width="82px" v-if="this.companyType != '02'">
  14. <el-input
  15. v-model="queryParams.rzScyName"
  16. placeholder="请输入资金方名称"
  17. clearable
  18. size="small"
  19. maxlength="25"
  20. style="width: 190px"
  21. />
  22. </el-form-item>
  23. <el-form-item prop="zfpName" label="融资产品">
  24. <el-input
  25. v-model="queryParams.zfpName"
  26. placeholder="请输入融资产品"
  27. clearable
  28. size="small"
  29. maxlength="25"
  30. style="width: 190px"
  31. />
  32. </el-form-item>
  33. <el-form-item prop="AmountA" label="授信额度范围" label-width="96px">
  34. <el-input
  35. v-model="queryParams.AmountA"
  36. placeholder="请输授信额度"
  37. clearable
  38. size="small"
  39. maxlength="20"
  40. style="width: 190px"
  41. />
  42. </el-form-item>
  43. <!-- <el-form-item>
  44. -
  45. </el-form-item> -->
  46. <el-form-item prop="AmountB">
  47. <el-input
  48. v-model="queryParams.AmountB"
  49. placeholder="请输授信额度"
  50. clearable
  51. size="small"
  52. maxlength="20"
  53. style="width: 190px"
  54. />
  55. </el-form-item>
  56. <el-form-item label="授信状态" prop="zfpcrStatus">
  57. <el-select v-model="queryParams.zfpcrStatus" placeholder="请选择状态" clearable size="small">
  58. <el-option
  59. v-for="dict in statusOptions"
  60. :key="dict.dictValue"
  61. :label="dict.dictLabel"
  62. :value="dict.dictValue"
  63. />
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item label="授信类型" prop="zfpType" v-if="this.companyType != '02'">
  67. <el-select v-model="queryParams.zfpType" placeholder="请选择类型" clearable size="small" >
  68. <el-option
  69. v-for="dict in typeOptions"
  70. :key="dict.dictValue"
  71. :label="dict.dictLabel"
  72. :value="dict.dictValue"
  73. />
  74. </el-select>
  75. </el-form-item>
  76. <el-form-item label="生效日期" prop="startTime">
  77. <el-date-picker size="small"
  78. v-model="queryParams.startTime"
  79. style="width: 240px"
  80. unlink-panels
  81. value-format="yyyy-MM-dd"
  82. type="daterange"
  83. range-separator="-"
  84. start-placeholder="开始日期"
  85. end-placeholder="结束日期">
  86. </el-date-picker>
  87. </el-form-item>
  88. <el-form-item label="到期日期" prop="endTime">
  89. <el-date-picker size="small"
  90. v-model="queryParams.endTime"
  91. style="width: 240px"
  92. unlink-panels
  93. value-format="yyyy-MM-dd"
  94. type="daterange"
  95. range-separator="-"
  96. start-placeholder="开始日期"
  97. end-placeholder="结束日期">
  98. </el-date-picker>
  99. </el-form-item>
  100. </el-form>
  101. </el-card>
  102. <el-row :gutter="10" class="mb8" style="width:96%">
  103. <el-col :span="1.5">
  104. <el-button
  105. type="primary"
  106. icon="el-icon-plus"
  107. size="mini"
  108. @click="handleAdd"
  109. v-hasPermi="['credit:line:add']"
  110. >新增</el-button>
  111. </el-col>
  112. </el-row>
  113. <el-table v-loading="loading" :data="creditLineList" @selection-change="handleSelectionChange" :row-key="rowKey" stripe  :cell-style="changeCellStyle" border v-if="this.companyType == '02'">
  114. <!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
  115. <el-table-column label="序号" type="index" width="50" align="center">
  116. <template slot-scope="scope">
  117. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="核心企业" align="center" prop="scyName" show-overflow-tooltip/>
  121. <el-table-column label="融资产品" align="center" prop="zfpName" show-overflow-tooltip/>
  122. <el-table-column label="授信额度" :formatter="moneyFormat" align="center" prop="zfsqAmount" show-overflow-tooltip width="120"/>
  123. <el-table-column label="利率(%)" align="center" prop="zfpcrRate" width="120" />
  124. <el-table-column label="已使用额度" :formatter="moneyFormat" align="center" prop="zfiAmount" width="120"/>
  125. <el-table-column label="可用额度" :formatter="moneyFormat" align="center" prop="usableAmount" width="120"/>
  126. <el-table-column label="生效日期" align="center" prop="zfpcrStartDate" show-overflow-tooltip/>
  127. <el-table-column label="到期日期" align="center" prop="zfpcrEndDate" show-overflow-tooltip/>
  128. <el-table-column label="授信状态" :formatter="statuFormat" align="center" prop="zfsqStatus" show-overflow-tooltip/>
  129. </el-table>
  130. <el-table v-loading="loading" :data="creditLineList" @selection-change="handleSelectionChange" :row-key="rowKey" stripe  :cell-style="changeCellStyle" border v-if="this.companyType != '02'">
  131. <!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
  132. <el-table-column label="序号" type="index" width="50" align="center">
  133. <template slot-scope="scope">
  134. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="资金方" align="center" prop="rzScyName" show-overflow-tooltip v-if="uncheckList.rzScyName" />
  138. <el-table-column label="授信类型" :formatter="typeFormat" align="center" prop="zfpType" show-overflow-tooltip v-if="uncheckList.zfpType" />
  139. <el-table-column label="融资产品" align="center" prop="zfpName" v-if="uncheckList.zfpName" show-overflow-tooltip/>
  140. <el-table-column label="企业名称" align="center" prop="scyName" v-if="uncheckList.scyName" show-overflow-tooltip/>
  141. <el-table-column label="企业代码" align="center" prop="scySocialCode" v-if="uncheckList.scySocialCode" show-overflow-tooltip/>
  142. <el-table-column label="授信额度" :formatter="moneyFormat" align="center" prop="zfpcrAmount" show-overflow-tooltip v-if="uncheckList.zfpcrAmount" width="120"/>
  143. <el-table-column label="利率(%)" align="center" prop="zfpcrRate" v-if="uncheckList.zfpcrRate" width="120" />
  144. <!-- <el-table-column label="已分割额度" :formatter="moneyFormat" align="center" prop="zfpcrDivisionAmount" v-if="uncheckList.zfpcrDivisionAmount" width="120"/> -->
  145. <el-table-column label="已使用额度" :formatter="moneyFormat" align="center" prop="zfiAmount" v-if="uncheckList.zfiAmount" width="120"/>
  146. <el-table-column label="已分配额度" :formatter="moneyFormat" align="center" prop="supplierAmount" v-if="uncheckList.supplierAmount" width="120"/>
  147. <el-table-column label="可用额度" :formatter="moneyFormat" align="center" prop="usableAmount" v-if="uncheckList.usableAmount && (this.companyType == '00' || this.companyType == '03')" width="120"/>
  148. <el-table-column label="生效日期" align="center" prop="zfpcrStartDate" v-if="uncheckList.zfpcrStartDate" show-overflow-tooltip/>
  149. <el-table-column label="到期日期" align="center" prop="zfpcrEndDate" v-if="uncheckList.zfpcrEndDate" show-overflow-tooltip/>
  150. <el-table-column label="授信状态" :formatter="statusFormat" align="center" prop="zfpcrStatus" v-if="uncheckList.zfpcrStatus" show-overflow-tooltip/>
  151. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
  152. <template slot-scope="scope">
  153. <el-button
  154. size="mini"
  155. type="text"
  156. icon="el-icon-edit"
  157. @click="handleEdit(scope.row)"
  158. v-if="scope.row.zfpcrStatus == '01'"
  159. v-hasPermi="['credit:line:edit']"
  160. >修改</el-button>
  161. <el-button
  162. size="mini"
  163. type="text"
  164. icon="el-icon-view"
  165. @click="handleRows(scope.row)"
  166. v-hasPermi="['credit:line:query']"
  167. >详情</el-button>
  168. <el-button
  169. type="text"
  170. size="mini"
  171. icon="el-icon-s-check"
  172. @click="handleUpdate(scope.row)"
  173. v-hasPermi="['credit:line:update']"
  174. v-if="scope.row.zfpcrStatus == '00'"
  175. >冻结</el-button>
  176. <el-button
  177. size="mini"
  178. type="text"
  179. icon="el-icon-delete"
  180. @click="handleUpdate(scope.row)"
  181. v-if="scope.row.zfpcrStatus == '01'"
  182. v-hasPermi="['credit:line:update']"
  183. >解冻</el-button>
  184. <el-button
  185. size="mini"
  186. type="text"
  187. icon="el-icon-edit"
  188. @click="handleSupplier(scope.row)"
  189. v-hasPermi="['supplierCredit:line:list']"
  190. v-if="scope.row.zfpType == '0'"
  191. >融资方列表</el-button>
  192. </template>
  193. </el-table-column>
  194. </el-table>
  195. <pagination
  196. v-show="total>0"
  197. :total="total"
  198. :page.sync="queryParams.pageNum"
  199. :limit.sync="queryParams.pageSize"
  200. @pagination="getList"
  201. />
  202. </div>
  203. </template>
  204. <script>
  205. import { listCreditLine, getCreditLine, delCreditLine, addCreditLine, updateCreditLine,changeStatus} from "@/api/service/creditLine/creditLine";
  206. import Cookies from 'js-cookie'
  207. import { columnQuery, columnfilter } from "@/api/common/columnSetting";
  208. import ColumnSetting from "../../../components/Table/columnSetting.vue";
  209. import {getPreMonthDay,getCurrentDateStr} from "@/api/common/getDateUtils";
  210. export default {
  211. name: "CreditLine",
  212. components: {
  213. ColumnSetting
  214. },
  215. data() {
  216. return {
  217. //企业类型
  218. companyType: '',
  219. // 遮罩层
  220. loading: true,
  221. //弹窗是否禁用
  222. isShow: false,
  223. // 选中数组
  224. ids: [],
  225. // 非单个禁用
  226. single: true,
  227. // 非多个禁用
  228. multiple: true,
  229. // 显示搜索条件
  230. showSearch: true,
  231. // 总条数
  232. total: 0,
  233. // 授信信息表格数据
  234. creditLineList: [],
  235. //合同列表
  236. contractList: [],
  237. //授信状态数据字典
  238. statusOptions: [],
  239. //供应商授信状态数据字典
  240. statuOptions: [],
  241. //授信类型(融资产品类型)
  242. typeOptions: [],
  243. // 弹出层标题
  244. title: "",
  245. // 是否显示弹出层
  246. open: false,
  247. // 查询参数
  248. queryParams: {
  249. pageNum: 1,
  250. pageSize: 10,
  251. zfpcrProductId: null,
  252. zfpcrCompanyId: null,
  253. zfpcrType: null,
  254. zfpcrAmount: null,
  255. zfpcrRate: null,
  256. zfpcrDivisionAmount: null,
  257. zfpcrDateType: null,
  258. zfpcrStartDate: null,
  259. zfpcrEndDate: null,
  260. zfpcrAddress: null,
  261. zfpcrCharge: null,
  262. zfpcrChargeRate: null,
  263. zfpcrAccount: null,
  264. zfpcrLoanType: null,
  265. zfpcrBookkeepingType: null,
  266. zfpcrStatus: null,
  267. zfpcrProfitSpare1: null,
  268. zfpcrProfitSpare2: null,
  269. zfpcrProfitSpare3: null,
  270. zfpcrProfitSpare4: null,
  271. zfpcrProfitSpare5: null,
  272. zfpcrProfitSpare6: null,
  273. zfpcrProfitSpare7: null,
  274. zfpcrProfitSpare8: null,
  275. zfpcrProfitSpare9: null,
  276. rzScyName: null,
  277. AmountA: null,
  278. AmountB: null,
  279. startTime: [],
  280. endTime: [],
  281. zfpType: null,
  282. zfpName: null
  283. },
  284. options: [],
  285. // 表单参数
  286. form: {},
  287. //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
  288. tableList: [
  289. {
  290. label: "rzScyName",
  291. value: "资金方"
  292. },
  293. {
  294. label: "zfpType",
  295. value: "授信类型"
  296. },
  297. {
  298. label: "zfpName",
  299. value: "融资产品"
  300. },
  301. {
  302. label: 'scyName',
  303. value: '企业名称'
  304. },
  305. {
  306. label: 'scySocialCode',
  307. value: '企业代码'
  308. },
  309. {
  310. label: "zfpcrAmount",
  311. value: "授信额度"
  312. },
  313. {
  314. label: "zfpcrRate",
  315. value: "利率"
  316. },
  317. // {
  318. // label: "zfpcrDivisionAmount",
  319. // value: "已分割额度"
  320. // },
  321. {
  322. label: "zfiAmount",
  323. value: "已使用额度"
  324. },
  325. {
  326. label: "supplierAmount",
  327. value: "已分配额度"
  328. },
  329. {
  330. label: "usableAmount",
  331. value: "可用额度"
  332. },
  333. {
  334. label: "zfpcrStartDate",
  335. value: "生效日期"
  336. },
  337. {
  338. label: "zfpcrEndDate",
  339. value: "到期日期"
  340. },
  341. {
  342. label: "zfpcrStatus",
  343. value: "授信状态"
  344. }
  345. ],
  346. checkList: [], //筛选列选中的数据列表--显示隐藏列用
  347. uncheckList: {}, //控制筛选列显示隐藏--显示隐藏列用
  348. selfDom: this,
  349. tableId: "/sc-service/creditLine/list",
  350. // 表单校验
  351. rules: {
  352. zfpcrProductId: [
  353. { required: true, message: "融资产品不能为空", trigger: "blur" }
  354. ],
  355. zfpcrCompanyId: [
  356. { required: true, message: "关联企业不能为空", trigger: "blur" }
  357. ],
  358. zfpcrAmount: [
  359. { required: true, message: "授信额度不能为空", trigger: "blur" }
  360. ],
  361. zfpcrRate: [
  362. { required: true, message: "利率不能为空", trigger: "blur" }
  363. ],
  364. zfpcrCharge: [
  365. { required: true, message: "是否收取手续费不能为空", trigger: "blur" }
  366. ],
  367. zfpcrChargeRate: [
  368. { required: true, message: "平台服务费收取费率不能为空", trigger: "blur" }
  369. ],
  370. zfpcrLoanType: [
  371. { required: true, message: "融资放款方式不能为空", trigger: "change" }
  372. ],
  373. zfpcrBookkeepingType: [
  374. { required: true, message: "记账簿托管方式不能为空", trigger: "change" }
  375. ],
  376. }
  377. };
  378. },
  379. created() {
  380. // this.$set(this.queryParams, 'startTime',[this.parseTime(getPreMonthDay(getCurrentDateStr(),3), '{y}-{m}-{d}'), this.parseTime(getCurrentDateStr(), '{y}-{m}-{d}')]);
  381. // this.$set(this.queryParams, 'endTime',[this.parseTime(getPreMonthDay(getCurrentDateStr(),3), '{y}-{m}-{d}'), this.parseTime(getCurrentDateStr(), '{y}-{m}-{d}')]);
  382. this.getList();
  383. // this.getContractList();
  384. this.getDicts("zc_zfpcr_status").then(response => {
  385. this.statusOptions = response.data;
  386. });
  387. this.getDicts("zc_zfp_type").then(response => {
  388. this.typeOptions = response.data;
  389. });
  390. },
  391. activated() {
  392. this.getList();
  393. // this.getContractList();
  394. this.getDicts("zc_zfpcr_status").then(response => {
  395. this.statusOptions = response.data;
  396. });
  397. this.getDicts("zc_zfsq_status").then(response => {
  398. this.statuOptions = response.data;
  399. });
  400. this.getDicts("zc_zfp_type").then(response => {
  401. this.typeOptions = response.data;
  402. });
  403. },
  404. mounted() {
  405. this.columnQuery();
  406. },
  407. methods: {
  408. /** 查询授信信息列表 */
  409. getList() {
  410. this.loading = true;
  411. listCreditLine(this.queryParams).then(response => {
  412. debugger
  413. this.creditLineList = response.data.records;
  414. if(response.data.records[0]){
  415. this.companyType = response.data.records[0].companyType
  416. }
  417. this.total = response.data.total;
  418. this.loading = false
  419. });
  420. },
  421. rowKey(row) {
  422. return row.zfpcrId;
  423. },
  424. //获取当前客户是否之前设置过列展示隐藏
  425. columnQuery() {
  426. //获取页面路径
  427. var psfPagePath = window.location.pathname;
  428. //用请求后台的url作为唯一标识
  429. var psfTableName = this.tableId;
  430. var columnForm = {};
  431. columnForm.psfPagePath = psfPagePath;
  432. columnForm.psfTableName = psfTableName;
  433. columnQuery(columnForm).then(response => {
  434. if (response.data && response.data.psfShowData) {
  435. this.checkList = response.data.psfShowData;
  436. }
  437. this.filter();
  438. });
  439. },
  440. //控制隐藏显示的函数
  441. filter(checkList) {
  442. if (!!checkList) {
  443. this.checkList = checkList;
  444. }
  445. columnfilter(this.selfDom);
  446. },
  447. // 取消按钮
  448. cancel() {
  449. this.open = false;
  450. this.custId = "";
  451. this.ctmId = "";
  452. this.customerList = [];
  453. this.reset();
  454. },
  455. // 表单重置
  456. reset() {
  457. this.form = {
  458. zfpcrId: null,
  459. zfpcrProductId: null,
  460. zfpcrCompanyId: null,
  461. zfpcrType: null,
  462. zfpcrAmount: null,
  463. zfpcrRate: null,
  464. zfpcrDivisionAmount: null,
  465. zfpcrDateType: null,
  466. zfpcrStartDate: null,
  467. zfpcrEndDate: null,
  468. zfpcrAddress: null,
  469. zfpcrCharge: null,
  470. zfpcrChargeRate: null,
  471. zfpcrAccount: null,
  472. zfpcrLoanType: null,
  473. zfpcrBookkeepingType: null,
  474. zfpcrStatus: "0",
  475. zfpcrProfitSpare1: null,
  476. zfpcrProfitSpare2: null,
  477. zfpcrProfitSpare3: null,
  478. zfpcrProfitSpare4: null,
  479. zfpcrProfitSpare5: null,
  480. zfpcrProfitSpare6: null,
  481. zfpcrProfitSpare7: null,
  482. zfpcrProfitSpare8: null,
  483. zfpcrProfitSpare9: null,
  484. createBy: null,
  485. createTime: null,
  486. updateBy: null,
  487. updateTime: null
  488. };
  489. this.resetForm("form");
  490. },
  491. /** 搜索按钮操作 */
  492. handleQuery() {
  493. this.queryParams.pageNum = 1;
  494. this.getList();
  495. },
  496. /** 重置按钮操作 */
  497. resetQuery() {
  498. this.resetForm("queryForm");
  499. this.handleQuery();
  500. },
  501. // 多选框选中数据
  502. handleSelectionChange(selection) {
  503. this.ids = selection.map(item => item.pafId);
  504. this.single = selection.length !== 1;
  505. this.multiple = !selection.length;
  506. },
  507. /** 字典翻译 */
  508. statusFormat(row, column) {
  509. return this.selectDictLabel(this.statusOptions, row.zfpcrStatus);
  510. },
  511. statuFormat(row, column) {
  512. return this.selectDictLabel(this.statuOptions, row.zfsqStatus);
  513. },
  514. typeFormat(row, column) {
  515. return this.selectDictLabel(this.typeOptions, row.zfpType);
  516. },
  517. /** 新增按钮操作 */
  518. handleAdd() {
  519. this.resetQuery();
  520. Cookies.set("/creditLine/addCreditLine/", this.$route.fullPath)
  521. this.$router.push("/creditLine/addCreditLine/");
  522. },
  523. /** 修改按钮操作 */
  524. handleEdit(row) {
  525. const zfpcrId = row.zfpcrId || this.ids;
  526. const zfiAmount = row.zfiAmount;
  527. const usableAmount = row.usableAmount;
  528. this.resetQuery();
  529. Cookies.set("/creditLine/editCreditLine/" + zfpcrId + '/' + zfiAmount + '/' + usableAmount + '/', this.$route.fullPath)
  530. this.$router.push("/creditLine/editCreditLine/" + zfpcrId + '/' + zfiAmount + '/' + usableAmount + '/');
  531. },
  532. // /** 详情按钮操作 */
  533. handleRows(row) {
  534. const zfpcrId = row.zfpcrId || this.ids;
  535. const zfiAmount = row.zfiAmount;
  536. const usableAmount = row.usableAmount;
  537. const companyType = this.companyType;
  538. this.resetQuery();
  539. Cookies.set("/creditLine/detailCreditLine/" + zfpcrId + '/' + zfiAmount + '/' + usableAmount + '/' + companyType + '/', this.$route.fullPath)
  540. this.$router.push("/creditLine/detailCreditLine/" + zfpcrId + '/' + zfiAmount + '/' + usableAmount + '/' + companyType + '/',);
  541. },
  542. /** 冻结/解冻按钮操作 */
  543. handleUpdate(row) {
  544. let text = row.zfpcrStatus === "01" ? "解冻" : "冻结";
  545. this.$confirm(
  546. "确认要" + text + '此数据项吗?',
  547. "警告",
  548. {
  549. confirmButtonText: "确定",
  550. cancelButtonText: "取消",
  551. type: "warning",
  552. }
  553. )
  554. .then(function() {
  555. return changeStatus(row.zfpcrId, row.zfiAmount,row.zfpcrStatus);
  556. })
  557. .then(() => {
  558. this.resetQuery();
  559. this.msgSuccess(text + "成功");
  560. })
  561. },
  562. /* 融资方列表 */
  563. handleSupplier(row){
  564. const zfpcrId = row.zfpcrId || this.ids;
  565. const zfpcrCompanyId = row.zfpcrCompanyId;
  566. this.resetQuery();
  567. Cookies.set("/creditLine/supplierCreditLine/" + zfpcrId + '/' + zfpcrCompanyId, this.$route.fullPath)
  568. this.$router.push("/creditLine/supplierCreditLine/" + zfpcrId + '/' + zfpcrCompanyId);
  569. },
  570. /** 提交按钮 */
  571. submitForm(state) {
  572. this.$refs["form"].validate(valid => {
  573. if (state) {
  574. this.form.pafState = state;
  575. }
  576. console.log(this.form,"提交form")
  577. debugger
  578. if (valid) {
  579. if (this.form.pafId != null) {
  580. const loading = this.$loading({
  581. lock: true,
  582. text: "Loading",
  583. spinner: "el-icon-loading",
  584. background: "rgba(0, 0, 0, 0.7)"
  585. });
  586. updateFlow(this.form).then(response => {
  587. this.msgSuccess("修改成功");
  588. this.open = false;
  589. this.reset();
  590. this.resetQuery();
  591. });
  592. loading.close();
  593. } else {
  594. const loading = this.$loading({
  595. lock: true,
  596. text: "Loading",
  597. spinner: "el-icon-loading",
  598. background: "rgba(0, 0, 0, 0.7)"
  599. });
  600. addFlow(this.form).then(response => {
  601. this.msgSuccess("新增成功");
  602. this.open = false;
  603. this.reset();
  604. this.resetQuery();
  605. });
  606. loading.close();
  607. }
  608. }
  609. });
  610. },
  611. /* 金额格式化 */
  612. moneyFormat(row, column, cellValue) {
  613. if(cellValue == null || cellValue== undefined || cellValue == ''){
  614. cellValue = '0.00'
  615. }
  616. cellValue += '';
  617. if (!cellValue.includes('.')) {
  618. cellValue += '.00';
  619. }
  620.     return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  621.         return $1 + ',';
  622.       }).replace(/\.$/, '');
  623. },
  624. /* 修改表格样式 */
  625. changeCellStyle(row, column, rowIndex, columnIndex) {
  626. if (row.column.label === "授信额度" || row.column.label === "已分割额度" || row.column.label === "已使用额度"
  627. || row.column.label === "可用额度") {
  628. return "font-weight: 700;"; // 修改的样式
  629. } else {
  630. return "";
  631. }
  632. },
  633. /* // 将数字金额转换为大写金额 */
  634. smallToBig(money) {
  635. // 将数字金额转换为大写金额
  636. var cnNums = new Array(
  637. "零",
  638. "壹",
  639. "贰",
  640. "叁",
  641. "肆",
  642. "伍",
  643. "陆",
  644. "柒",
  645. "捌",
  646. "玖"
  647. ); //汉字的数字
  648. var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
  649. var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
  650. var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
  651. var cnInteger = "整"; //整数金额时后面跟的字符
  652. var cnIntLast = "元"; //整数完以后的单位
  653. //最大处理的数字
  654. var maxNum = 999999999999999.9999;
  655. var integerNum; //金额整数部分
  656. var decimalNum; //金额小数部分
  657. //输出的中文金额字符串
  658. var chineseStr = "";
  659. var parts; //分离金额后用的数组,预定义
  660. if (money == "" || money == null || money == undefined) {
  661. return "零元零角零分";
  662. }
  663. money = parseFloat(money);
  664. if (money >= maxNum) {
  665. //超出最大处理数字
  666. return "超出最大处理数字";
  667. }
  668. if (money == 0) {
  669. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  670. return chineseStr;
  671. }
  672. //四舍五入保留两位小数,转换为字符串
  673. money = Math.round(money * 100).toString();
  674. integerNum = money.substr(0, money.length - 2);
  675. decimalNum = money.substr(money.length - 2);
  676. //获取整型部分转换
  677. if (parseInt(integerNum, 10) > 0) {
  678. var zeroCount = 0;
  679. var IntLen = integerNum.length;
  680. for (var i = 0; i < IntLen; i++) {
  681. var n = integerNum.substr(i, 1);
  682. var p = IntLen - i - 1;
  683. var q = p / 4;
  684. var m = p % 4;
  685. if (n == "0") {
  686. zeroCount++;
  687. } else {
  688. if (zeroCount > 0) {
  689. chineseStr += cnNums[0];
  690. }
  691. //归零
  692. zeroCount = 0;
  693. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  694. }
  695. if (m == 0 && zeroCount < 4) {
  696. chineseStr += cnIntUnits[q];
  697. }
  698. }
  699. chineseStr += cnIntLast;
  700. }
  701. //小数部分
  702. if (decimalNum != "") {
  703. var decLen = decimalNum.length;
  704. for (var i = 0; i < decLen; i++) {
  705. var n = decimalNum.substr(i, 1);
  706. if (n != "0") {
  707. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  708. }
  709. }
  710. }
  711. if (chineseStr == "") {
  712. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  713. } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
  714. chineseStr += cnInteger;
  715. }
  716. return chineseStr;
  717. }
  718. }
  719. };
  720. </script>