wq 5 年之前
父節點
當前提交
0d8daaa81d
共有 2 個文件被更改,包括 45 次插入0 次删除
  1. 2 0
      src/store/index.js
  2. 43 0
      src/store/loanpro.js

+ 2 - 0
src/store/index.js

@@ -20,6 +20,7 @@ import tPolicyInterpretation from './tPolicyInterpretation';
 import dictionary from './dictionary';
 import login from './login';
 import financeclaim from './financeclaim';
+import loanpro from './loanpro';
 import * as muta from './user/mutations';
 import * as states from './user/state';
 import banner from './banner';
@@ -49,6 +50,7 @@ export default new Vuex.Store({
     dictionary,
     financeclaim,
     banner,
+    loanpro,
   },
   state: { ...states },
   mutations: { ...muta },

+ 43 - 0
src/store/loanpro.js

@@ -0,0 +1,43 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  loanproInfo: `/api/financial/loanpro`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.loanproInfo}`, payload);
+    return res;
+  },
+  async loanproList({ commit }, payload) {// 贷款产品列表
+    const res = await this.$axios.$post(`${api.loanproInfo}/loanproList`, payload);
+    return res;
+  },
+  async one({ commit }, payload) {// 详情
+    const res = await this.$axios.$post(`${api.loanproInfo}/one`,payload);
+    return res;
+  },
+  async dupdate({ commit }, { id, ...data }) {//逻辑删除
+    const res = await this.$axios.$post(`${api.loanproInfo}/update/${id}`, data);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.loanproInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.loanproInfo}/update/${id}`, data);
+    return res;
+  },
+
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};