financeProduct.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <div class="app-container zap-main">
  3. <el-row class="zap-table-search">
  4. <el-row style="padding-top: 16px;">
  5. <right-toolbar style="margin-top: 4px;" :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
  6. <span class="zap-table-search__title">所选条件:</span>
  7. <div style="float: right;margin-right:1%">
  8. <el-button type="cyan" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  9. <el-button icon="el-icon-refresh" @click="resetQuery" style="float: ;">重置</el-button>
  10. <column-setting :checkList="checkList" :tableList="tableList"  :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
  11. </div>
  12. </el-row>
  13. <hr style="margin-top: 16px;">
  14. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  15. <el-form-item label="产品名称" prop="zfpName">
  16. <el-input v-model="queryParams.zfpName" placeholder="请输入产品名称" clearable size="large" maxlength="30" @keyup.enter.native="handleQuery" />
  17. </el-form-item>
  18. <el-form-item label="资方" prop="scyName">
  19. <el-input v-model="queryParams.scyName" placeholder="请输入资方名称" clearable size="large" maxlength="30" @keyup.enter.native="handleQuery" />
  20. </el-form-item>
  21. <el-form-item label="最短账期">
  22. <el-input type="number" v-model="queryParams.begin" placeholder="请输入最短账期" clearable size="large" maxlength="20" min="0" />
  23. </el-form-item>
  24. <el-form-item>
  25. ~
  26. </el-form-item>
  27. <el-form-item>
  28. <el-input type="number" v-model="queryParams.end" placeholder="请输入最短账期" clearable size="large" @keyup.enter.native="handleQuery" maxlength="20" min="1" />
  29. </el-form-item>
  30. </el-form>
  31. </el-row>
  32. <el-row class="zap-margin-top">
  33. <div style="padding: 20px;background-color: #ffffff;">
  34. <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-hasPermi="['service:financeProduct:add']">新增</el-button>
  35. </div>
  36. </el-row>
  37. <el-row>
  38. <div class="zap-table">
  39. <el-table v-loading="loading" :data="financeProductList" @selection-change="handleSelectionChange" stripe="">
  40. <el-table-column label="序号" type="index" width="50" align="center">
  41. <template slot-scope="scope">
  42. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="产品编号" align="center" prop="zfpNumber" :show-overflow-tooltip="true"  v-if="uncheckList.zfpNumber" />
  46. <el-table-column label="产品名称" align="center" prop="zfpName" :show-overflow-tooltip="true"  v-if="uncheckList.zfpName" />
  47. <el-table-column label="产品类型" align="center" prop="zfpType" :formatter="typeFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpType" />
  48. <el-table-column label="资金方" align="center" prop="scyName" :show-overflow-tooltip="true"  v-if="uncheckList.scyName" />
  49. <el-table-column label="是否可拆转融" align="center" prop="zfpSplit" :formatter="splitFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpSplit" />
  50. <el-table-column label="是否有追索权" align="center" prop="zfpRecourse" :formatter="recourseFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpRecourse" />
  51. <el-table-column label="电子凭证类型" align="center" prop="zfpVoucherType" :formatter="voucherTypeFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpVoucherType" />
  52. <el-table-column label="服务费是否可退" align="center" prop="zfpCharge" :formatter="chargeFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpCharge" />
  53. <el-table-column label="产品状态" align="center" prop="zfpStatus" :formatter="statusFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpStatus" />
  54. <el-table-column label="最小融资金额(元)" align="center" prop="zfpMinimumAmount" :formatter="moneyFormat" :show-overflow-tooltip="true"  v-if="uncheckList.zfpMinimumAmount" />
  55. <el-table-column label="最短账期" align="center" prop="zfpShortestPeriod" :show-overflow-tooltip="true"  v-if="uncheckList.zfpShortestPeriod" />
  56. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
  57. <template slot-scope="scope">
  58. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['service:financeProduct:edit']">修改</el-button>
  59. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleChange(scope.row)" v-if="scope.row.zfpStatus == '01'" v-hasPermi="['service:financeProduct:change']">停用</el-button>
  60. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleChange(scope.row)" v-if="scope.row.zfpStatus == '00'" v-hasPermi="['service:financeProduct:change']">启用</el-button>
  61. <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDel(scope.row)" v-if="scope.row.zfpStatus == '00'" v-hasPermi="['service:financeProduct:delete']">删除</el-button>
  62. <el-button size="mini" type="text" icon="el-icon-view" @click="handleInfo(scope.row)" v-hasPermi="['service:financeProduct:query']">详情</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. </div>
  67. </el-row>
  68. <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  69. </div>
  70. </template>
  71. <script>
  72. import {
  73. listFinanceProduct,
  74. changeState,
  75. delFinanceProduct
  76. } from "@/api/service/financeProduct/financeProduct";
  77. import ColumnSetting from "../../../components/Table/columnSetting.vue";
  78. import {
  79. columnQuery,
  80. columnfilter
  81. } from "@/api/common/columnSetting";
  82. import Cookies from 'js-cookie'
  83. export default {
  84. name: "financeProduct",
  85. components: {
  86. ColumnSetting
  87. },
  88. data() {
  89. return {
  90. // 遮罩层
  91. loading: true,
  92. // 选中数组
  93. ids: [],
  94. // 非单个禁用
  95. single: true,
  96. // 非多个禁用
  97. multiple: true,
  98. // 显示搜索条件
  99. showSearch: true,
  100. financeProductList: [],
  101. // 总条数
  102. total: 0,
  103. // 弹出层标题
  104. title: "",
  105. // 是否显示弹出层
  106. open: false,
  107. // 查询参数
  108. queryParams: {
  109. pageNum: 1,
  110. pageSize: 10,
  111. zfpName: null,
  112. scyName: null,
  113. begin: null,
  114. end: null,
  115. },
  116. // 表单参数
  117. form: {},
  118. // 表单校验
  119. rules: {
  120. // pptName:[
  121. // { required: true, message: "项目类型不能为空", trigger: "blur" },
  122. // ]
  123. },
  124. tableList: [{
  125. label: "zfpNumber",
  126. value: "产品编号"
  127. },
  128. {
  129. label: "zfpName",
  130. value: "产品名称"
  131. },
  132. {
  133. label: "zfpType",
  134. value: "产品类型"
  135. },
  136. {
  137. label: "scyName",
  138. value: "资金方"
  139. },
  140. {
  141. label: "zfpSplit",
  142. value: "是否可拆转融"
  143. },
  144. {
  145. label: "zfpRecourse",
  146. value: "是否有追索权"
  147. },
  148. {
  149. label: "zfpVoucherType",
  150. value: "电子凭证类型"
  151. },
  152. {
  153. label: "zfpCharge",
  154. value: "服务费是否可退"
  155. },
  156. {
  157. label: "zfpStatus",
  158. value: "产品状态"
  159. },
  160. {
  161. label: "zfpMinimumAmount",
  162. value: "最小融资金额"
  163. },
  164. {
  165. label: "zfpShortestPeriod",
  166. value: "最短账期"
  167. },
  168. ],
  169. checkList: [], //筛选列选中的数据列表--显示隐藏列用
  170. uncheckList: {}, //控制筛选列显示隐藏--显示隐藏列用
  171. selfDom: this,
  172. tableId: "/service/financeProduct/list",
  173. };
  174. },
  175. created() {
  176. this.getList();
  177. this.getDicts("zc_zfp_split").then((response) => {
  178. this.splitOptions = response.data;
  179. });
  180. this.getDicts("zc_zfp_recourse").then((response) => {
  181. this.recourseOptions = response.data;
  182. });
  183. this.getDicts("zc_zfp_status").then((response) => {
  184. this.statusOptions = response.data;
  185. });
  186. this.getDicts("zc_zfp_charge").then((response) => {
  187. this.chargeOptions = response.data;
  188. });
  189. this.getDicts("zc_zfp_voucher_type").then((response) => {
  190. this.voucherTypeOptions = response.data;
  191. });
  192. this.getDicts("zc_zfp_type").then((response) => {
  193. this.typeOptions = response.data;
  194. });
  195. },
  196. activated() {
  197. this.getList();
  198. },
  199. mounted() {
  200. this.columnQuery();
  201. },
  202. methods: {
  203. /** 查询融资产品列表 */
  204. getList() {
  205. this.loading = true;
  206. listFinanceProduct(this.queryParams).then(response => {
  207. this.financeProductList = response.data.records;
  208. this.total = response.data.total;
  209. this.loading = false;
  210. });
  211. },
  212. // 取消按钮
  213. cancel() {
  214. this.open = false;
  215. this.reset();
  216. },
  217. // 表单重置
  218. reset() {
  219. this.form = {
  220. };
  221. this.resetForm("form");
  222. },
  223. /** 搜索按钮操作 */
  224. handleQuery() {
  225. this.queryParams.pageNum = 1;
  226. this.getList();
  227. },
  228. /** 重置按钮操作 */
  229. resetQuery() {
  230. this.queryParams.begin = "";
  231. this.queryParams.end = "";
  232. this.resetForm("queryForm");
  233. this.handleQuery();
  234. },
  235. // 多选框选中数据
  236. handleSelectionChange(selection) {
  237. /* this.ids = selection.map(item => item.ptcId)
  238. this.single = selection.length!==1
  239. this.multiple = !selection.length */
  240. },
  241. /** 新增按钮操作 */
  242. handleAdd() {
  243. this.reset();
  244. this.resetForm("queryForm");
  245. Cookies.set("/financeProduct/addFinanceProduct/", this.$route.fullPath);
  246. this.$router.push({
  247. path: "/financeProduct/addFinanceProduct/"
  248. });
  249. },
  250. /** 修改按钮操作 */
  251. handleUpdate(row) {
  252. const zfpId = row.zfpId
  253. this.resetForm("queryForm");
  254. Cookies.set("/financeProduct/editFinanceProduct/" + zfpId + "/", this.$route.fullPath);
  255. this.$router.push({
  256. path: "/financeProduct/editFinanceProduct/" + zfpId + "/"
  257. });
  258. },
  259. /** 修改按钮操作 */
  260. handleInfo(row) {
  261. const zfpId = row.zfpId
  262. this.resetForm("queryForm");
  263. Cookies.set("/financeProduct/detailFinanceProduct/" + zfpId + "/", this.$route.fullPath);
  264. this.$router.push({
  265. path: "/financeProduct/detailFinanceProduct/" + zfpId + "/"
  266. });
  267. },
  268. /** 启用按钮操作 */
  269. handleChange(row) {
  270. let text = row.zfpStatus === "00" ? "开启产品" : "停用产品";
  271. this.$confirm(
  272. "确认要" + text + '"' + row.zfpName + '"吗?',
  273. "警告", {
  274. confirmButtonText: "确定",
  275. cancelButtonText: "取消",
  276. type: "warning",
  277. }
  278. )
  279. .then(function () {
  280. return changeState(row.zfpId);
  281. })
  282. .then(() => {
  283. this.getList();
  284. this.msgSuccess(text + '"' + row.zfpName + '"成功');
  285. })
  286. .catch(function () {
  287. });
  288. },
  289. //拆转融字典反显
  290. splitFormat(row, column) {
  291. return this.selectDictLabel(this.splitOptions, row.zfpSplit);
  292. },
  293. //是否有追索权字典反显
  294. recourseFormat(row, column) {
  295. return this.selectDictLabel(this.recourseOptions, row.zfpRecourse);
  296. },
  297. //产品状态字典反显
  298. statusFormat(row, column) {
  299. return this.selectDictLabel(this.statusOptions, row.zfpStatus);
  300. },
  301. //服务费是否可退字典反显
  302. chargeFormat(row, column) {
  303. return this.selectDictLabel(this.chargeOptions, row.zfpCharge);
  304. },
  305. //电子凭证类型字典反显
  306. voucherTypeFormat(row, column) {
  307. return this.selectDictLabel(this.voucherTypeOptions, row.zfpVoucherType);
  308. },
  309. //类型字典反显
  310. typeFormat(row, column) {
  311. return this.selectDictLabel(this.typeOptions, row.zfpType);
  312. },
  313. //获取当前客户是否之前设置过列展示隐藏
  314. columnQuery() {
  315. //获取页面路径
  316. var psfPagePath = window.location.pathname;
  317. //用请求后台的url作为唯一标识
  318. var psfTableName = this.tableId;
  319. var columnForm = {};
  320. columnForm.psfPagePath = psfPagePath;
  321. columnForm.psfTableName = psfTableName;
  322. columnQuery(columnForm).then(response => {
  323. if (response.data && response.data.psfShowData) {
  324. this.checkList = response.data.psfShowData;
  325. }
  326. this.filter();
  327. });
  328. },
  329. //控制隐藏显示的函数
  330. filter(checkList) {
  331. if (!!checkList) {
  332. this.checkList = checkList;
  333. }
  334. columnfilter(this.selfDom);
  335. },
  336. /** 提交按钮 */
  337. submitForm() {
  338. this.$refs["form"].validate(valid => {
  339. if (valid) {
  340. if (this.form.pptId != null) {
  341. const loading = this.$loading({
  342. lock: true,
  343. text: "Loading",
  344. spinner: "el-icon-loading",
  345. background: "rgba(0, 0, 0, 0.7)",
  346. })
  347. updateProjectType(this.form).then(response => {
  348. loading.close();
  349. this.msgSuccess("修改成功");
  350. this.open = false;
  351. this.getList();
  352. }).catch((response) => {
  353. loading.close();
  354. });
  355. } else {
  356. const loading = this.$loading({
  357. lock: true,
  358. text: "Loading",
  359. spinner: "el-icon-loading",
  360. background: "rgba(0, 0, 0, 0.7)",
  361. })
  362. addProjectType(this.form).then(response => {
  363. loading.close();
  364. this.msgSuccess("新增成功");
  365. this.open = false;
  366. this.getList();
  367. }).catch((response) => {
  368. loading.close();
  369. });
  370. }
  371. }
  372. });
  373. },
  374. /** 删除按钮操作 */
  375. handleDel(row) {
  376. const zfpId = row.zfpId || this.ids;
  377. const zfpName = row.zfpName;
  378. this.$confirm('是否确认删除产品名称为"' + zfpName + '"的数据项?', "警告", {
  379. confirmButtonText: "确定",
  380. cancelButtonText: "取消",
  381. type: "warning"
  382. }).then(function () {
  383. return delFinanceProduct(zfpId);
  384. }).then(() => {
  385. this.getList();
  386. this.msgSuccess("删除成功");
  387. })
  388. .catch(() => {
  389. this.$message({
  390. type: "warning",
  391. message: "已取消删除",
  392. });
  393. });
  394. },
  395. //列表格式化金额
  396. moneyFormat(row, column, cellValue) {
  397. if (cellValue == null || cellValue == undefined || cellValue == '') {
  398. cellValue = '0.00'
  399. }
  400. cellValue += '';
  401. if (!cellValue.includes('.')) {
  402. cellValue += '.00';
  403. }
  404. return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  405. return $1 + ',';
  406. }).replace(/\.$/, '');
  407. },
  408. /** 导出按钮操作 */
  409. handleExport() {
  410. /* this.download('base/taxCode/export', {
  411. ...this.queryParams
  412. }, `base_taxCode.xlsx`) */
  413. }
  414. }
  415. };
  416. </script>
  417. </style>
  418. <style lang="scss" scoped>
  419. ::v-deep .el-tabs__item {
  420. width: 105px;
  421. height: 55px;
  422. padding: 0;
  423. line-height: 55px;
  424. text-align: center;
  425. font-size: 16px;
  426. }
  427. .zap-credit__content {
  428. position: relative;
  429. padding: 0 13px 25px;
  430. background-color: #ffffff;
  431. }
  432. .zap-credit__tabs {
  433. position: relative;
  434. }
  435. .zap-credit__buttons {
  436. position: absolute;
  437. top: 0;
  438. right: 13px;
  439. display: flex;
  440. align-items: center;
  441. height: 55px;
  442. z-index: 99;
  443. }
  444. .zap-table-search__title {
  445. display: inline-block;
  446. line-height: 40px;
  447. height: 40px;
  448. color: #333333;
  449. font-size: 14px;
  450. }
  451. .zap-table {
  452. padding: 0 13px;
  453. background-color: #ffffff;
  454. }
  455. </style>