creditLine.vue 32 KB

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