数据接口定义修改

修复了导出excel失败的问题
master
toesbieya 6 years ago
parent b8d29c4b6c
commit 325689f80e
  1. 43
      vue/src/api/account/index.js
  2. 1
      vue/src/api/doc/baseUrl.js
  3. 9
      vue/src/api/doc/history.js
  4. 45
      vue/src/api/doc/purchase/inbound.js
  5. 45
      vue/src/api/doc/purchase/order.js
  6. 45
      vue/src/api/doc/sell/order.js
  7. 45
      vue/src/api/doc/sell/outbound.js
  8. 1
      vue/src/api/message/baseUrl.js
  9. 29
      vue/src/api/message/manage.js
  10. 17
      vue/src/api/message/user.js
  11. 12
      vue/src/api/record/index.js
  12. 49
      vue/src/api/request.js
  13. 20
      vue/src/api/statistic/index.js
  14. 16
      vue/src/api/stock/current.js
  15. 1
      vue/src/api/system/baseUrl.js
  16. 25
      vue/src/api/system/category.js
  17. 25
      vue/src/api/system/customer.js
  18. 21
      vue/src/api/system/department.js
  19. 21
      vue/src/api/system/resource.js
  20. 25
      vue/src/api/system/role.js
  21. 25
      vue/src/api/system/supplier.js
  22. 29
      vue/src/api/system/user.js
  23. 3
      vue/src/component/biz/CategoryTree/index.vue
  24. 16
      vue/src/component/biz/UserSelector/SimpleMultipleUserSelector.vue
  25. 5
      vue/src/component/biz/doc/DocHistory.vue
  26. 4
      vue/src/layout/component/Navbar/component/Bell.vue
  27. 45
      vue/src/mixin/docDetailMixin.js
  28. 25
      vue/src/mixin/docTableMixin.js
  29. 3
      vue/src/store/module/message.js
  30. 5
      vue/src/store/module/resource.js
  31. 4
      vue/src/store/module/user.js
  32. 19
      vue/src/util/auth.js
  33. 5
      vue/src/view/app/login/RegisterForm.vue
  34. 2
      vue/src/view/example/developingTest/component/ApiSpeedTest.vue
  35. 4
      vue/src/view/example/developingTest/component/ExportExcelTest.vue
  36. 3
      vue/src/view/index/component/DailyFinishOrderStat.vue
  37. 3
      vue/src/view/index/component/DailyProfitStat.vue
  38. 3
      vue/src/view/index/component/PanelGroup/index.vue
  39. 3
      vue/src/view/index/component/TotalProfitGoods.vue
  40. 18
      vue/src/view/message/manage/EditDialog.vue
  41. 13
      vue/src/view/message/manage/indexPage.vue
  42. 11
      vue/src/view/message/user/MessageStream.vue
  43. 6
      vue/src/view/purchase/inbound/component/OrderSelector.vue
  44. 5
      vue/src/view/purchase/inbound/detailPage.vue
  45. 8
      vue/src/view/purchase/inbound/indexPage.vue
  46. 4
      vue/src/view/purchase/order/component/CategorySelector.vue
  47. 13
      vue/src/view/purchase/order/component/SupplierSelector.vue
  48. 3
      vue/src/view/purchase/order/detailPage.vue
  49. 8
      vue/src/view/purchase/order/indexPage.vue
  50. 5
      vue/src/view/sell/order/component/CustomerSelector.vue
  51. 2
      vue/src/view/sell/order/component/StockSelector.vue
  52. 3
      vue/src/view/sell/order/detailPage.vue
  53. 8
      vue/src/view/sell/order/indexPage.vue
  54. 2
      vue/src/view/sell/outbound/component/StockSelector.vue
  55. 7
      vue/src/view/sell/outbound/detailPage.vue
  56. 8
      vue/src/view/sell/outbound/indexPage.vue
  57. 2
      vue/src/view/stock/current/DetailDialog.vue
  58. 6
      vue/src/view/stock/current/indexPage.vue
  59. 2
      vue/src/view/system/category/component/Form.vue
  60. 14
      vue/src/view/system/category/component/List.vue
  61. 4
      vue/src/view/system/customer/EditDialog.vue
  62. 33
      vue/src/view/system/customer/indexPage.vue
  63. 4
      vue/src/view/system/department/component/EditDialog.vue
  64. 13
      vue/src/view/system/department/indexPage.vue
  65. 18
      vue/src/view/system/menu/indexPage.vue
  66. 7
      vue/src/view/system/role/EditDialog.vue
  67. 21
      vue/src/view/system/role/indexPage.vue
  68. 4
      vue/src/view/system/supplier/EditDialog.vue
  69. 32
      vue/src/view/system/supplier/indexPage.vue
  70. 5
      vue/src/view/system/user/component/DepartmentSelector.vue
  71. 7
      vue/src/view/system/user/component/EditDialog.vue
  72. 10
      vue/src/view/system/user/component/RoleSelector.vue
  73. 35
      vue/src/view/system/user/indexPage.vue
  74. 2
      vue/src/view/userCenter/component/Account.vue
  75. 6
      vue/src/view/userCenter/component/Avatar.vue
  76. 3
      vue/src/view/userCenter/component/LoginHistory.vue
  77. 3
      vue/src/view/userCenter/component/UserAction.vue

@ -1,34 +1,23 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import {isEmpty} from "@/util"
export const baseUrl = '/account' export const login = new PostApi(`/account/login`)
export function login(data) { export const logout = new GetApi(`/account/logout`)
return request.post(`${baseUrl}/login`, data).then(({data}) => data.data)
}
export function logout() { export const register = new PostApi(`/account/register`)
return request.get(`${baseUrl}/logout`)
}
export function register(data) { export const updateUserPwd = new PostApi(`/account/updatePwd`)
return request.post(`${baseUrl}/register`, data)
}
export function updateUserPwd(data) { export const updateAvatar = new GetApi(
return request.post(`${baseUrl}/updatePwd`, data).then(({data}) => data) `/account/updateAvatar`,
} key => ({params: {key: encodeURIComponent(key)}}),
p => p.then(({data}) => data)
)
export function updateAvatar(key) { export const validate = new GetApi(`/account/validate`, pwd => ({params: {pwd}}))
return request.get(`${baseUrl}/updateAvatar?key=${encodeURIComponent(key)}`).then(({data}) => ({...data, key}))
}
export function validate(pwd) { export const checkName = new GetApi(
return request.get(`${baseUrl}/validate?pwd=${pwd}`).then(({data}) => data) `/account/checkName`,
} (name, id) => ({params: {name, id}}),
p => p.then(({data}) => data)
export function checkName(name, id) { )
let param = `?name=${name}`
if (!isEmpty(id)) param += `&id=${id}`
return request.get(`${baseUrl}/checkName${param}`).then(({data}) => data)
}

@ -1 +0,0 @@
export default '/doc'

@ -1,8 +1,3 @@
import request from "@/api/request" import {PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/history` export const search = new PostApi(`/doc/history/search`)
export function searchHistory(data) {
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}

@ -1,44 +1,23 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from '../baseUrl'
export const baseUrl = `${BASE}/purchase/inbound` export const baseUrl = `/doc/purchase/inbound`
export function getById(id) { export const getById = new GetApi(`${baseUrl}/getById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getById?id=${id}`).then(({data}) => data.data)
}
export function getSubById(id) { export const getSubById = new GetApi(`${baseUrl}/getSubById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getSubById?id=${id}`).then(({data}) => data.data)
}
export function search(data) { export const search = new PostApi(`${baseUrl}/search`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function add(data) { export const add = new PostApi(`${baseUrl}/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const update = new PostApi(`${baseUrl}/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function commit(data) { export const commit = new PostApi(`${baseUrl}/commit`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/commit`, data).then(({data}) => data)
}
export function withdraw(data) { export const withdraw = new PostApi(`${baseUrl}/withdraw`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/withdraw`, data).then(({data}) => data)
}
export function pass(data) { export const pass = new PostApi(`${baseUrl}/pass`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/pass`, data).then(({data}) => data)
}
export function reject(data) { export const reject = new PostApi(`${baseUrl}/reject`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/reject`, data).then(({data}) => data)
}
export function del(id) { export const del = new GetApi(`${baseUrl}/del`, id => ({params: {id}}), p => p.then(({data}) => data))
return request.get(`${baseUrl}/del?id=${id}`).then(({data}) => data)
}

@ -1,44 +1,23 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from '../baseUrl'
export const baseUrl = `${BASE}/purchase/order` export const baseUrl = `/doc/purchase/order`
export function getById(id) { export const getById = new GetApi(`${baseUrl}/getById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getById?id=${id}`).then(({data}) => data.data)
}
export function getSubById(id) { export const getSubById = new GetApi(`${baseUrl}/getSubById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getSubById?id=${id}`).then(({data}) => data.data)
}
export function search(data) { export const search = new PostApi(`${baseUrl}/search`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function add(data) { export const add = new PostApi(`${baseUrl}/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const update = new PostApi(`${baseUrl}/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function commit(data) { export const commit = new PostApi(`${baseUrl}/commit`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/commit`, data).then(({data}) => data)
}
export function withdraw(data) { export const withdraw = new PostApi(`${baseUrl}/withdraw`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/withdraw`, data).then(({data}) => data)
}
export function pass(data) { export const pass = new PostApi(`${baseUrl}/pass`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/pass?`, data).then(({data}) => data)
}
export function reject(data) { export const reject = new PostApi(`${baseUrl}/reject`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/reject`, data).then(({data}) => data)
}
export function del(id) { export const del = new GetApi(`${baseUrl}/del`, id => ({params: {id}}), p => p.then(({data}) => data))
return request.get(`${baseUrl}/del?id=${id}`).then(({data}) => data)
}

@ -1,44 +1,23 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from '../baseUrl'
export const baseUrl = `${BASE}/sell/order` export const baseUrl = `/doc/sell/order`
export function getById(id) { export const getById = new GetApi(`${baseUrl}/getById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getById?id=${id}`).then(({data}) => data.data)
}
export function getSubById(id) { export const getSubById = new GetApi(`${baseUrl}/getSubById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getSubById?id=${id}`).then(({data}) => data.data)
}
export function search(data) { export const search = new PostApi(`${baseUrl}/search`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function add(data) { export const add = new PostApi(`${baseUrl}/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const update = new PostApi(`${baseUrl}/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function commit(data) { export const commit = new PostApi(`${baseUrl}/commit`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/commit`, data).then(({data}) => data)
}
export function withdraw(data) { export const withdraw = new PostApi(`${baseUrl}/withdraw`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/withdraw`, data).then(({data}) => data)
}
export function pass(data) { export const pass = new PostApi(`${baseUrl}/pass`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/pass?`, data).then(({data}) => data)
}
export function reject(data) { export const reject = new PostApi(`${baseUrl}/reject`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/reject`, data).then(({data}) => data)
}
export function del(id) { export const del = new GetApi(`${baseUrl}/del`, id => ({params: {id}}), p => p.then(({data}) => data))
return request.get(`${baseUrl}/del?id=${id}`).then(({data}) => data)
}

@ -1,44 +1,23 @@
import request from "@/api/request" import request, {GetApi, PostApi} from "@/api/request"
import BASE from '../baseUrl'
export const baseUrl = `${BASE}/sell/outbound` export const baseUrl = `/doc/sell/outbound`
export function getById(id) { export const getById = new GetApi(`${baseUrl}/getById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getById?id=${id}`).then(({data}) => data.data)
}
export function getSubById(id) { export const getSubById = new GetApi(`${baseUrl}/getSubById`, id => ({params: {id}}))
return request.get(`${baseUrl}/getSubById?id=${id}`).then(({data}) => data.data)
}
export function search(data) { export const search = new PostApi(`${baseUrl}/search`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function add(data) { export const add = new PostApi(`${baseUrl}/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const update = new PostApi(`${baseUrl}/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function commit(data) { export const commit = new PostApi(`${baseUrl}/commit`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/commit`, data).then(({data}) => data)
}
export function withdraw(data) { export const withdraw = new PostApi(`${baseUrl}/withdraw`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/withdraw`, data).then(({data}) => data)
}
export function pass(data) { export const pass = new PostApi(`${baseUrl}/pass`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/pass?`, data).then(({data}) => data)
}
export function reject(data) { export const reject = new PostApi(`${baseUrl}/reject`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/reject`, data).then(({data}) => data)
}
export function del(id) { export const del = new GetApi(`${baseUrl}/del`, id => ({params: {id}}), p => p.then(({data}) => data))
return request.get(`${baseUrl}/del?id=${id}`).then(({data}) => data)
}

@ -1 +0,0 @@
export default '/message'

@ -1,28 +1,13 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/manage` export const search = new PostApi(`/message/manage/search`)
export function search(data) { export const add = new PostApi(`/message/manage/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function add(data) { export const update = new PostApi(`/message/manage/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const publish = new PostApi(`/message/manage/publish`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function publish(data) { export const withdraw = new PostApi(`/message/manage/withdraw`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/publish`, data).then(({data}) => data)
}
export function withdraw(data) { export const del = new GetApi(`/message/manage/del`, (id, title) => ({params: {id, title}}))
return request.post(`${baseUrl}/withdraw`, data).then(({data}) => data)
}
export function del(id, title) {
return request.get(`${baseUrl}/del?id=${id}&title=${title}`).then(({data}) => data)
}

@ -1,16 +1,9 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/user` export const baseUrl = `/message/user`
export function search(data) { export const search = new PostApi(`/message/user/search`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function read(id) { export const read = new GetApi(`/message/user/read`, id => ({params: {id}}))
return request.get(`${baseUrl}/read?id=${id}`).then(({data}) => data)
}
export function readAll() { export const readAll = new GetApi(`/message/user/readAll`)
return request.get(`${baseUrl}/readAll`).then(({data}) => data)
}

@ -1,11 +1,5 @@
import request from "@/api/request" import {PostApi} from "@/api/request"
export const baseUrl = '/record' export const searchLoginHistory = new PostApi(`/record/searchLoginHistory`)
export function searchLoginHistory(data) { export const searchUserAction = new PostApi(`/record/searchUserAction`)
return request.post(`${baseUrl}/searchLoginHistory`, data).then(({data}) => data.data)
}
export function searchUserAction(data) {
return request.post(`${baseUrl}/searchUserAction`, data).then(({data}) => data.data)
}

@ -4,13 +4,13 @@ import {MessageBox, Notification} from 'element-ui'
import Message from '@ele/component/Message' import Message from '@ele/component/Message'
import store from '@/store' import store from '@/store'
const service = axios.create({ const instance = axios.create({
baseURL: apiPrefix, baseURL: apiPrefix,
// withCredentials: true, // send cookies when cross-domain requests // withCredentials: true, // send cookies when cross-domain requests
timeout: 60000 // request timeout timeout: 60000 // request timeout
}) })
service.interceptors.request.use( instance.interceptors.request.use(
config => { config => {
//登录状态下socket断连时,除登出外中断一切请求 //登录状态下socket断连时,除登出外中断一切请求
if (store.state.user.id && !store.state.socket.online && config.url !== '/account/logout') { if (store.state.user.id && !store.state.socket.online && config.url !== '/account/logout') {
@ -27,7 +27,7 @@ service.interceptors.request.use(
error => Promise.reject(error) error => Promise.reject(error)
) )
service.interceptors.response.use( instance.interceptors.response.use(
response => { response => {
const res = response.data const res = response.data
@ -73,4 +73,45 @@ service.interceptors.response.use(
} }
) )
export default service class Api {
/**
* 数据接口定义
* @param url 请求url不带参数
* @param arg 对传入参数的处理方法返回值将作为axios[get,post]的第二个参数
* @param chain 形参为请求返回的promise
* @param isGet 是否为get请求
*/
constructor(url, arg, chain, isGet) {
this.url = url
this.arg = arg
this.chain = chain
this.isGet = isGet
if (this.chain === undefined) {
this.chain = p => p.then(({data}) => data.data)
}
}
request(...args) {
const params = this.arg ? this.arg(...args) : undefined
const method = this.isGet ? 'get' : 'post'
const promise = instance[method](this.url, params)
return this.chain ? this.chain(promise) : promise
}
}
export class PostApi extends Api {
constructor(url, arg, chain) {
if (!arg) {
arg = data => data
}
super(url, arg, chain, false)
}
}
export class GetApi extends Api {
constructor(url, arg, chain) {
super(url, arg, chain, true)
}
}
export default instance

@ -1,19 +1,9 @@
import request from "@/api/request" import {GetApi} from "@/api/request"
export const baseUrl = `/statistic` export const getFourBlock = new GetApi(`/statistic/getFourBlock`)
export function getFourBlock() { export const getDailyProfitStat = new GetApi(`/statistic/getDailyProfitStat`)
return request.get(`${baseUrl}/getFourBlock`).then(({data}) => data.data)
}
export function getDailyProfitStat() { export const getDailyFinishOrder = new GetApi(`/statistic/getDailyFinishOrder`)
return request.get(`${baseUrl}/getDailyProfitStat`).then(({data}) => data.data)
}
export function getDailyFinishOrder() { export const getTotalProfitGoods = new GetApi(`/statistic/getTotalProfitGoods`)
return request.get(`${baseUrl}/getDailyFinishOrder`).then(({data}) => data.data)
}
export function getTotalProfitGoods() {
return request.get(`${baseUrl}/getTotalProfitGoods`).then(({data}) => data.data)
}

@ -1,15 +1,7 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
export const baseUrl = '/stock/current' export const search = new PostApi(`/stock/current/search`)
export function search(data) { export const getDetail = new GetApi(`/stock/current/getDetail`, cids => ({params: {cids}}))
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function getDetail(cids) { export const getDetailById = new GetApi(`/stock/current/getDetailById`, ids => ({params: {ids}}))
return request.get(`${baseUrl}/getDetail?cids=${cids}`).then(({data}) => data.data)
}
export function getDetailById(ids) {
return request.get(`${baseUrl}/getDetailById?ids=${ids}`).then(({data}) => data.data)
}

@ -1 +0,0 @@
export default '/system'

@ -1,24 +1,11 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/category` export const search = new PostApi(`/system/category/search`)
export function search(data) { export const getAll = new GetApi(`/system/category/getAll`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function getAll() { export const add = new PostApi(`/system/category/add`)
return request.get(`${baseUrl}/getAll`).then(({data}) => data.data)
}
export function add(data) { export const update = new PostApi(`/system/category/update`)
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const del = new PostApi(`/system/category/del`)
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function del(data) {
return request.post(`${baseUrl}/del`, data).then(({data}) => data)
}

@ -1,24 +1,11 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/customer` export const getLimitRegion = new GetApi(`/system/customer/getLimitRegion`)
export function getLimitRegion() { export const search = new PostApi(`/system/customer/search`)
return request.get(`${baseUrl}/getLimitRegion`).then(({data}) => data.data)
}
export function getCustomers(data) { export const add = new PostApi(`/system/customer/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function addCustomer(data) { export const update = new PostApi(`/system/customer/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function updateCustomer(data) { export const del = new PostApi(`/system/customer/del`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function delCustomer(data) {
return request.post(`${baseUrl}/del`, data).then(({data}) => data)
}

@ -1,20 +1,9 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/department` export const get = new GetApi(`/system/department/get`, (all = true) => ({params: {all}}))
export function getDepartments(all = true) { export const add = new PostApi(`/system/department/add`, null, p => p.then(({data}) => data))
return request.get(`${baseUrl}/get?all=${all}`).then(({data}) => data.data)
}
export function addDepartment(data) { export const update = new PostApi(`/system/department/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function updateDepartment(data) { export const del = new PostApi(`/system/department/del`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function delDepartment(data) {
return request.post(`${baseUrl}/del`, data).then(({data}) => data)
}

@ -1,20 +1,9 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/resource` export const getAll = new GetApi(`/system/resource/getAll`)
export function getAll() { export const add = new PostApi(`/system/resource/add`, null, p => p.then(({data}) => data))
return request.get(`${baseUrl}/getAll`).then(({data}) => data.data)
}
export function add(data) { export const update = new PostApi(`/system/resource/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const del = new GetApi(`/system/resource/del`, id => ({params: {id}}), p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function del(id) {
return request.get(`${baseUrl}/del?id=${id}`).then(({data}) => data)
}

@ -1,24 +1,13 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/role` export const baseUrl = `/system/role`
export function search(data) { export const search = new PostApi(`/system/role/search`)
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function get() { export const get = new GetApi(`/system/role/get`)
return request.get(`${baseUrl}/get`).then(({data}) => data.data)
}
export function add(data) { export const add = new PostApi(`/system/role/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function update(data) { export const update = new PostApi(`/system/role/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function del(data) { export const del = new PostApi(`/system/role/del`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/del`, data).then(({data}) => data)
}

@ -1,24 +1,11 @@
import request from "@/api/request" import {GetApi, PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/supplier` export const getLimitRegion = new GetApi(`/system/supplier/getLimitRegion`)
export function getLimitRegion() { export const search = new PostApi(`/system/supplier/search`)
return request.get(`${baseUrl}/getLimitRegion`).then(({data}) => data.data)
}
export function getSuppliers(data) { export const add = new PostApi(`/system/supplier/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function addSupplier(data) { export const update = new PostApi(`/system/supplier/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function updateSupplier(data) { export const del = new PostApi(`/system/supplier/del`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function delSupplier(data) {
return request.post(`${baseUrl}/del`, data).then(({data}) => data)
}

@ -1,28 +1,13 @@
import request from "@/api/request" import {PostApi} from "@/api/request"
import BASE from './baseUrl'
export const baseUrl = `${BASE}/user` export const search = new PostApi(`/system/user/search`)
export function getUsers(data) { export const kick = new PostApi(`/system/user/kick`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/search`, data).then(({data}) => data.data)
}
export function kick(data) { export const add = new PostApi(`/system/user/add`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/kick`, data).then(({data}) => data)
}
export function addUser(data) { export const update = new PostApi(`/system/user/update`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/add`, data).then(({data}) => data)
}
export function updateUser(data) { export const del = new PostApi(`/system/user/del`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/update`, data).then(({data}) => data)
}
export function delUser(data) { export const resetPwd = new PostApi(`/system/user/resetPwd`, null, p => p.then(({data}) => data))
return request.post(`${baseUrl}/del`, data).then(({data}) => data)
}
export function resetUserPwd(data) {
return request.post(`${baseUrl}/resetPwd`, data).then(({data}) => data)
}

@ -33,7 +33,8 @@ export default {
mounted() { mounted() {
if (this.data.length > 0) return if (this.data.length > 0) return
getAll() getAll
.request()
.then(data => this.$store.commit('dataCache/categories', data)) .then(data => this.$store.commit('dataCache/categories', data))
.finally(() => this.loading = false) .finally(() => this.loading = false)
} }

@ -10,21 +10,14 @@
</template> </template>
<script> <script>
import {getUsers} from '@/api/system/user' import {search} from '@/api/system/user'
export default { export default {
name: "SimpleMultipleUserSelector", name: "SimpleMultipleUserSelector",
props: { props: {value: Array, disabled: Boolean},
value: Array,
disabled: Boolean
},
data() { data:()=>({data:[]}),
return {
data: []
}
},
methods: { methods: {
emit(v) { emit(v) {
@ -33,7 +26,8 @@ export default {
}, },
mounted() { mounted() {
getUsers({page: 1, pageSize: 9999}) search
.request({page: 1, pageSize: 9999})
.then(({list}) => this.data = list) .then(({list}) => this.data = list)
} }
} }

@ -15,7 +15,7 @@
<script> <script>
import AbstractPagination from '@/component/AbstractPagination' import AbstractPagination from '@/component/AbstractPagination'
import AbstractTable from "@/component/AbstractTable" import AbstractTable from "@/component/AbstractTable"
import {searchHistory} from "@/api/doc/history" import {search} from "@/api/doc/history"
import {isEmpty, timeFormat} from "@/util" import {isEmpty, timeFormat} from "@/util"
export default { export default {
@ -49,7 +49,8 @@ export default {
methods: { methods: {
search() { search() {
if (isEmpty(this.id)) return if (isEmpty(this.id)) return
searchHistory({pid: this.id, ...this.searchForm}) search
.request({pid: this.id, ...this.searchForm})
.then(({total, list}) => { .then(({total, list}) => {
this.transformData(list) this.transformData(list)
this.data = list this.data = list

@ -5,8 +5,6 @@
</template> </template>
<script> <script>
import {baseUrl} from '@/api/message/user'
export default { export default {
name: "Bell", name: "Bell",
@ -18,7 +16,7 @@ export default {
methods: { methods: {
jump() { jump() {
let target = baseUrl let target = '/message/user'
if (this.$route.path === target) target = `/redirect${target}` if (this.$route.path === target) target = `/redirect${target}`
this.$router.replace(target) this.$router.replace(target)
} }

@ -82,28 +82,28 @@ export default {
//权限判断以及根据状态控制是否可编辑 //权限判断以及根据状态控制是否可编辑
canSave() { canSave() {
//add模式有添加权限、edit模式有编辑权限且status=0 //add模式有添加权限、edit模式有编辑权限且status=0
return this.type === 'add' && auth(`${this.baseUrl}/add`) return this.type === 'add' && auth(this.api.add.url)
|| this.form.status === 0 && this.type === 'edit' && auth(`${this.baseUrl}/update`) || this.form.status === 0 && this.type === 'edit' && auth(this.api.update.url)
}, },
canCommit() { canCommit() {
//有提交权限、add模式或edit模式且status=0 //有提交权限、add模式或edit模式且status=0
return auth(`${this.baseUrl}/commit`) return auth(this.api.commit.url)
&& (this.type === 'add' || this.type === 'edit' && this.form.status === 0) && (this.type === 'add' || this.type === 'edit' && this.form.status === 0)
}, },
canWithdraw() { canWithdraw() {
//有撤回权限、当前用户是创建人、edit模式且status=1 //有撤回权限、当前用户是创建人、edit模式且status=1
return auth(`${this.baseUrl}/withdraw`) return auth(this.api.withdraw.url)
&& this.type === 'edit' && this.type === 'edit'
&& this.user.id === this.form.cid && this.user.id === this.form.cid
&& this.form.status === 1 && this.form.status === 1
}, },
canPass() { canPass() {
//有通过权限、edit模式且status=1 //有通过权限、edit模式且status=1
return auth(`${this.baseUrl}/pass`) && this.type === 'edit' && this.form.status === 1 return auth(this.api.pass.url) && this.type === 'edit' && this.form.status === 1
}, },
canReject() { canReject() {
//有驳回权限、edit模式且status=1 //有驳回权限、edit模式且status=1
return auth(`${this.baseUrl}/reject`) && this.type === 'edit' && this.form.status === 1 return auth(this.api.reject.url) && this.type === 'edit' && this.form.status === 1
} }
}, },
@ -120,8 +120,9 @@ export default {
if (!isEmpty(valid)) return elAlert(valid) if (!isEmpty(valid)) return elAlert(valid)
} }
this.loading = true this.loading = true
const promise = this.type === 'add' ? this.api.add(this.form) : this.api.update(this.form) const method = this.type === 'add' ? this.api.add : this.api.update
promise method
.request(this.form)
.then(({data, msg}) => { .then(({data, msg}) => {
this.needSearch() this.needSearch()
elSuccess(msg) elSuccess(msg)
@ -142,7 +143,7 @@ export default {
} }
elConfirm('确认提交审核?') elConfirm('确认提交审核?')
.then(() => this.loading = true) .then(() => this.loading = true)
.then(() => this.api.commit(this.form)) .then(() => this.api.commit.request(this.form))
.then(({data, msg}) => { .then(({data, msg}) => {
elSuccess(msg) elSuccess(msg)
this.needSearch() this.needSearch()
@ -158,7 +159,7 @@ export default {
elConfirm('确认撤回?') elConfirm('确认撤回?')
.then(() => { .then(() => {
this.loading = true this.loading = true
return this.api.withdraw({id: this.form.id, pid: this.form.pid}) return this.api.withdraw.request({id: this.form.id, pid: this.form.pid})
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)
@ -174,7 +175,7 @@ export default {
elConfirm('确认通过审核?') elConfirm('确认通过审核?')
.then(() => { .then(() => {
this.loading = true this.loading = true
return this.api.pass({id: this.form.id, pid: this.form.pid}) return this.api.pass.request({id: this.form.id, pid: this.form.pid})
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)
@ -190,7 +191,7 @@ export default {
elPrompt('请输入驳回理由') elPrompt('请输入驳回理由')
.then(info => { .then(info => {
this.loading = true this.loading = true
return this.api.reject({id: this.form.id, pid: this.form.pid, info}) return this.api.reject.request({id: this.form.id, pid: this.form.pid, info})
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)
@ -206,7 +207,8 @@ export default {
if (isEmpty(id)) { if (isEmpty(id)) {
return elAlert(`获取${this.docName}数据失败,请传入id`, this.close) return elAlert(`获取${this.docName}数据失败,请传入id`, this.close)
} }
this.api.getById(id) this.api.getById
.request(id)
.then(data => { .then(data => {
if (!data || id !== data.id) return Promise.reject() if (!data || id !== data.id) return Promise.reject()
this.modifyDataBeforeMerge && this.modifyDataBeforeMerge(data) this.modifyDataBeforeMerge && this.modifyDataBeforeMerge(data)
@ -221,9 +223,9 @@ export default {
}, },
//保存、提交成功后需要判断后续动作 //保存、提交成功后需要判断后续动作
afterSaveOrCommit(data) { afterSaveOrCommit(id) {
if (this.type === 'add') { if (this.type === 'add') {
const editUrl = `${this.baseUrl}/detail/edit/${data}` const editUrl = this.$route.path.replace('/add', `/edit/${id}`)
return closeCurrentPage(editUrl) return closeCurrentPage(editUrl)
} }
else return this.init(this.form.id) else return this.init(this.form.id)
@ -240,11 +242,18 @@ export default {
deleteUpload(deleteArr).catch(e => ({})) deleteUpload(deleteArr).catch(e => ({}))
} }
return closeCurrentPage(this.baseUrl) return closeCurrentPage(this.getTablePageUrl())
}, },
//获取列表页的地址
getTablePageUrl() {
const url = this.$route.path
const i = url.indexOf('/detail')
const tablePageUrl = url.substring(0, i)
return [...tablePageUrl].join('')
},
//列表页是否需要刷新数据
needSearch() { needSearch() {
this.$store.commit('needSearch/emit', this.baseUrl) this.$store.commit('needSearch/emit', this.getTablePageUrl())
}, },
//附件操作 //附件操作

@ -4,7 +4,6 @@ import {isEmpty} from "@/util"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
import {auth} from "@/util/auth" import {auth} from "@/util/auth"
import {exportExcel} from "@/util/excel" import {exportExcel} from "@/util/excel"
export const commonMethods = { export const commonMethods = {
getStatus(status) { getStatus(status) {
switch (status) { switch (status) {
@ -52,19 +51,19 @@ export default {
computed: { computed: {
canAdd() { canAdd() {
return auth(`${this.baseUrl}/add`) return auth(this.api.add.url)
}, },
canUpdate() { canUpdate() {
return auth(`${this.baseUrl}/update`) return auth(this.api.update.url)
|| auth(`${this.baseUrl}/withdraw`) || auth(this.api.withdraw.url)
|| auth(`${this.baseUrl}/pass`) || auth(this.api.pass.url)
|| auth(`${this.baseUrl}/reject`) || auth(this.api.reject.url)
}, },
canDel() { canDel() {
return auth(`${this.baseUrl}/del`) return auth(this.api.del.url)
}, },
canExport() { canExport() {
return auth(`${this.baseUrl}/export`) return auth(this.exportUrl)
}, },
}, },
@ -76,7 +75,8 @@ export default {
//折叠所有行 //折叠所有行
this.tableData.forEach(row => this.$refs.table.toggleRowExpansion(row, false)) this.tableData.forEach(row => this.$refs.table.toggleRowExpansion(row, false))
this.row = null this.row = null
this.api.search(this.mergeSearchForm()) this.api.search
.request(this.mergeSearchForm())
.then(({list, total}) => { .then(({list, total}) => {
list.forEach(i => { list.forEach(i => {
i._loading = false //加载状态 i._loading = false //加载状态
@ -90,7 +90,8 @@ export default {
getSubList(row) { getSubList(row) {
if (row._loaded || row._loading) return if (row._loaded || row._loading) return
row._loading = true row._loading = true
this.api.getSubById(row.id) this.api.getSubById
.request(row.id)
.then(data => { .then(data => {
row.data = data row.data = data
row._loaded = true row._loaded = true
@ -121,7 +122,7 @@ export default {
elConfirm(`确定删除单据【${this.row.id}】?`) elConfirm(`确定删除单据【${this.row.id}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return this.api.del(this.row.id) return this.api.del.request(this.row.id)
}) })
.then(() => { .then(() => {
elSuccess('删除成功') elSuccess('删除成功')
@ -130,7 +131,7 @@ export default {
.finally(() => this.config.operating = false) .finally(() => this.config.operating = false)
}, },
downloadExcel() { downloadExcel() {
exportExcel(`${this.baseUrl}/export`, this.mergeSearchForm(), this.excel) exportExcel(this.exportUrl, this.mergeSearchForm(), this.excel)
} }
} }
} }

@ -9,7 +9,8 @@ const mutations = createMutations(state)
const actions = { const actions = {
refresh({commit}) { refresh({commit}) {
search({page: 1, pageSize: 1, unread: true}) search
.request({page: 1, pageSize: 1, unread: true})
.then(({data}) => commit('unreadCount', data)) .then(({data}) => commit('unreadCount', data))
} }
} }

@ -2,7 +2,7 @@ import path from 'path'
import {useBackendRoute} from '@/config' import {useBackendRoute} from '@/config'
import {addDynamicRoutes} from '@/router' import {addDynamicRoutes} from '@/router'
import {getDynamicRoutes} from '@/router/define' import {getDynamicRoutes} from '@/router/define'
import {stringifyRoutes, parseRoutes, metaExtend} from "@/router/util" import {parseRoutes, metaExtend} from "@/router/util"
import {needAuth} from "@/util/auth" import {needAuth} from "@/util/auth"
import {createTree} from "@/util/tree" import {createTree} from "@/util/tree"
import {getAll} from "@/api/system/resource" import {getAll} from "@/api/system/resource"
@ -49,7 +49,8 @@ const mutations = {
const actions = { const actions = {
init({commit}, {resources, admin, addRoutes = false}) { init({commit}, {resources, admin, addRoutes = false}) {
return getAll() return getAll
.request()
.then(data => { .then(data => {
const routes = transformOriginRouteData(data) const routes = transformOriginRouteData(data)
metaExtend(routes) metaExtend(routes)

@ -26,7 +26,7 @@ const mutations = createMutations(state, true)
const actions = { const actions = {
login({commit, dispatch}, userInfo) { login({commit, dispatch}, userInfo) {
const {username, password} = userInfo const {username, password} = userInfo
return login({username: username.trim(), password}) return login.request({username: username.trim(), password})
.then(user => { .then(user => {
if (user.admin === true) user.roleName = '超级管理员' if (user.admin === true) user.roleName = '超级管理员'
user.avatar = autoCompleteUrl(user.avatar) user.avatar = autoCompleteUrl(user.avatar)
@ -40,7 +40,7 @@ const actions = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (state.prepareLogout) return Promise.reject() if (state.prepareLogout) return Promise.reject()
commit('prepareLogout', true) commit('prepareLogout', true)
logout(state.token) logout.request(state.token)
.then(() => { .then(() => {
commit('resource/init', false, {root: true}) commit('resource/init', false, {root: true})
return Promise.all([ return Promise.all([

@ -1,5 +1,6 @@
import store from '@/store' import store from '@/store'
import {isEmpty} from "@/util/index" import {uppercaseFirst} from "@/filter"
import {isEmpty} from "@/util"
//判断路由是否需要鉴权,需要则返回true //判断路由是否需要鉴权,需要则返回true
export function needAuth(route) { export function needAuth(route) {
@ -18,3 +19,19 @@ export function auth(path) {
const resources = store.state.user.resources const resources = store.state.user.resources
return resources && path in resources return resources && path in resources
} }
/**
* what i can
* 批量生成canXxx的计算属性
* @param apiMap <key:接口名称value:接口对象>
*/
export function wic(apiMap) {
const attrs = {}
Object.entries(apiMap).forEach(([key, value]) => {
const attrKey = `can${uppercaseFirst(key)}`
attrs[attrKey] = () => auth(value.url)
})
return attrs
}

@ -56,7 +56,8 @@ export default {
data() { data() {
const validateName = debounce((r, v, c) => { const validateName = debounce((r, v, c) => {
checkName(this.form.username) checkName
.request(this.form.username)
.then(({msg}) => msg ? c(msg) : c()) .then(({msg}) => msg ? c(msg) : c())
.catch(e => c(e)) .catch(e => c(e))
}, 300) }, 300)
@ -94,7 +95,7 @@ export default {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (!valid) return if (!valid) return
this.loading = true this.loading = true
register({username: this.form.username, password: md5(this.form.pwd)}) register.request({username: this.form.username, password: md5(this.form.pwd)})
.then(() => { .then(() => {
elSuccess('注册成功') elSuccess('注册成功')
this.$router.push('/login') this.$router.push('/login')

@ -10,7 +10,7 @@
</template> </template>
<script> <script>
import request from "@/api/request" import request, {GetApi, PostApi} from "@/api/request"
export default { export default {
name: "ApiSpeedTest", name: "ApiSpeedTest",

@ -19,7 +19,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
column: [ columns: [
{header: ['合并表头演示', '序号'], prop: 'no', merge: true}, {header: ['合并表头演示', '序号'], prop: 'no', merge: true},
{header: ['合并表头演示', '名称'], prop: 'name', merge: true}, {header: ['合并表头演示', '名称'], prop: 'name', merge: true},
{header: '日期', prop: 'date'}, {header: '日期', prop: 'date'},
@ -41,7 +41,7 @@ export default {
this.loading = true this.loading = true
const arr = new Array(this.rows).fill(this.row) const arr = new Array(this.rows).fill(this.row)
const workbook = json2workbook(arr, this.column, this.merge ? { const workbook = json2workbook(arr, this.columns, this.merge ? {
primaryKey: 'name', primaryKey: 'name',
orderKey: 'no' orderKey: 'no'
} : null) } : null)

@ -16,7 +16,8 @@ export default {
init() { init() {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
getDailyFinishOrder() getDailyFinishOrder
.request()
.then(data => { .then(data => {
const time = [] const time = []
const purchase = [] const purchase = []

@ -16,7 +16,8 @@ export default {
init() { init() {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
getDailyProfitStat() getDailyProfitStat
.request()
.then(data => { .then(data => {
const time = [] const time = []
const purchase = [] const purchase = []

@ -61,7 +61,8 @@ export default {
init() { init() {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
getFourBlock() getFourBlock
.request()
.then(data => { .then(data => {
this.list.forEach(i => { this.list.forEach(i => {
if (i.id in data) i.value = data[i.id] if (i.id in data) i.value = data[i.id]

@ -47,7 +47,8 @@ export default {
init() { init() {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
getTotalProfitGoods() getTotalProfitGoods
.request()
.then(data => { .then(data => {
const purchase = [] const purchase = []
const sell = [] const sell = []

@ -58,7 +58,7 @@ import AbstractFormItem from "@/component/AbstractForm/item"
import FormDialog from '@/component/FormDialog' import FormDialog from '@/component/FormDialog'
import RichTextEditor from "@/component/editor/RichTextEditor" import RichTextEditor from "@/component/editor/RichTextEditor"
import UserSelector from '@/component/biz/UserSelector/SimpleMultipleUserSelector' import UserSelector from '@/component/biz/UserSelector/SimpleMultipleUserSelector'
import {baseUrl, add, update, publish, withdraw} from "@/api/message/manage" import {add, update, publish, withdraw} from "@/api/message/manage"
import {isEmpty, mergeObj, resetObj} from '@/util' import {isEmpty, mergeObj, resetObj} from '@/util'
import {auth} from "@/util/auth" import {auth} from "@/util/auth"
import {elAlert, elConfirm, elSuccess} from "@/util/message" import {elAlert, elConfirm, elSuccess} from "@/util/message"
@ -119,18 +119,16 @@ export default {
canSave() { canSave() {
//addeditstatus=0 //addeditstatus=0
return this.type === 'add' && auth(`${baseUrl}/add`) return this.type === 'add' && auth(add.url)
|| this.form.status === 0 && this.type === 'edit' && auth(`${baseUrl}/update`) || this.form.status === 0 && this.type === 'edit' && auth(update.url)
}, },
canPublish() { canPublish() {
//addeditstatus=0 //addeditstatus=0
return auth(`${baseUrl}/publish`) && (this.type === 'add' || this.type === 'edit' && this.form.status === 0) return auth(publish.url) && (this.type === 'add' || this.type === 'edit' && this.form.status === 0)
}, },
canWithdraw() { canWithdraw() {
//editstatus=1 //editstatus=1
return auth(`${baseUrl}/withdraw`) return auth(withdraw.url)
&& this.type === 'edit' && this.type === 'edit'
&& this.form.status === 1 && this.form.status === 1
}, },
@ -164,7 +162,7 @@ export default {
if (!v) return if (!v) return
this.loading = true this.loading = true
const data = this.transformForm() const data = this.transformForm()
const promise = this.type === 'add' ? add(data) : update(data) const promise = this.type === 'add' ? add.request(data) : update.request(data)
promise promise
.then(({data, msg}) => { .then(({data, msg}) => {
this.needSearch = true this.needSearch = true
@ -190,7 +188,7 @@ export default {
} }
elConfirm('确认发布?') elConfirm('确认发布?')
.then(() => this.loading = true) .then(() => this.loading = true)
.then(() => publish(this.transformForm())) .then(() => publish.request(this.transformForm()))
.then(({data, msg}) => { .then(({data, msg}) => {
elSuccess(msg) elSuccess(msg)
this.needSearch = true this.needSearch = true
@ -214,7 +212,7 @@ export default {
elConfirm('确认撤回?') elConfirm('确认撤回?')
.then(() => { .then(() => {
this.loading = true this.loading = true
return withdraw({id: this.form.id, title: this.form.title}) return withdraw.request({id: this.form.id, title: this.form.title})
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)

@ -58,7 +58,7 @@ import tableMixin from '@/mixin/tablePageMixin'
import EditDialog from './EditDialog' import EditDialog from './EditDialog'
import SearchForm from "@/component/SearchForm" import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, search, del} from "@/api/message/manage" import {search, add, update, del} from "@/api/message/manage"
import {isEmpty} from '@/util' import {isEmpty} from '@/util'
import {auth} from "@/util/auth" import {auth} from "@/util/auth"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
@ -85,13 +85,13 @@ export default {
computed: { computed: {
canAdd() { canAdd() {
return auth(`${baseUrl}/add`) return auth(add.url)
}, },
canUpdate() { canUpdate() {
return auth(`${baseUrl}/update`) return auth(update.url)
}, },
canDel() { canDel() {
return auth(`${baseUrl}/del`) return auth(del.url)
} }
}, },
@ -112,7 +112,8 @@ export default {
this.config.loading = true this.config.loading = true
this.row = null this.row = null
this.type = 'see' this.type = 'see'
search(this.searchForm) search
.request(this.searchForm)
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list
@ -144,7 +145,7 @@ export default {
elConfirm(`确定删除消息【${this.row.title}】?`) elConfirm(`确定删除消息【${this.row.title}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return del(this.row.id, this.row.title) return del.request(this.row.id, this.row.title)
}) })
.then(() => { .then(() => {
elSuccess('删除成功') elSuccess('删除成功')

@ -53,9 +53,7 @@ export default {
components: {AutoHidden, Empty}, components: {AutoHidden, Empty},
props: { props: {mode: String,},
mode: String,
},
data() { data() {
return { return {
@ -87,7 +85,8 @@ export default {
const currentMode = this.mode const currentMode = this.mode
this.tableData = [] this.tableData = []
this.config.loading = true this.config.loading = true
search({...this.searchForm, unread}) search
.request({...this.searchForm, unread})
.then(({list, total}) => { .then(({list, total}) => {
if (this.mode !== currentMode) return if (this.mode !== currentMode) return
unread && this.$store.commit('message/unreadCount', total) unread && this.$store.commit('message/unreadCount', total)
@ -129,11 +128,11 @@ export default {
if (msg.read) return if (msg.read) return
msg.read = true msg.read = true
this.$store.commit('message/unreadCount', this.unreadCount - 1) this.$store.commit('message/unreadCount', this.unreadCount - 1)
read(msg.id) read.request(msg.id)
}, },
readAll() { readAll() {
readAll().then(() => this.search()) readAll.request().then(() => this.search())
}, },
transformType(type) { transformType(type) {

@ -95,7 +95,8 @@ export default {
if (!this.value || this.config.loading) return if (!this.value || this.config.loading) return
this.config.loading = true this.config.loading = true
this.row = null this.row = null
search(this.searchForm) search
.request(this.searchForm)
.then(({list, total}) => { .then(({list, total}) => {
list.forEach(i => { list.forEach(i => {
i._loading = false // i._loading = false //
@ -111,7 +112,8 @@ export default {
getSubList(row) { getSubList(row) {
if (row._loaded || row._loading) return if (row._loaded || row._loading) return
row._loading = true row._loading = true
getSubById(row.id) getSubById
.request(row.id)
.then(data => { .then(data => {
row.data = data row.data = data
row._loaded = true row._loaded = true

@ -85,7 +85,7 @@
<script> <script>
import docDetailMixin from "@/mixin/docDetailMixin" import docDetailMixin from "@/mixin/docDetailMixin"
import OrderSelector from './component/OrderSelector' import OrderSelector from './component/OrderSelector'
import {baseUrl, add, commit, getById, pass, reject, update, withdraw} from "@/api/doc/purchase/inbound" import {getById, add, update, commit, withdraw, pass, reject} from "@/api/doc/purchase/inbound"
import {getSubById as getParentSubById} from "@/api/doc/purchase/order" import {getSubById as getParentSubById} from "@/api/doc/purchase/order"
import {isEmpty} from "@/util" import {isEmpty} from "@/util"
import {elAlert} from "@/util/message" import {elAlert} from "@/util/message"
@ -100,7 +100,6 @@ export default {
data() { data() {
return { return {
baseUrl,
docName: '采购入库单', docName: '采购入库单',
api: { api: {
getById, add, update, commit, withdraw, pass, reject getById, add, update, commit, withdraw, pass, reject
@ -144,7 +143,7 @@ export default {
methods: { methods: {
afterInit() { afterInit() {
if (this.type !== 'edit') return Promise.resolve() if (this.type !== 'edit') return Promise.resolve()
return getParentSubById(this.form.pid).then(data => this.parentSubList = data) return getParentSubById.request(this.form.pid).then(data => this.parentSubList = data)
}, },
selectParent(id, sub) { selectParent(id, sub) {
this.parentSubList = sub this.parentSubList = sub

@ -89,7 +89,7 @@
import docTableMixin from '@/mixin/docTableMixin' import docTableMixin from '@/mixin/docTableMixin'
import SearchForm from '@/component/SearchForm' import SearchForm from '@/component/SearchForm'
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, del, getSubById, search} from "@/api/doc/purchase/inbound" import {baseUrl, add, update, del, withdraw, pass, reject, getSubById, search} from "@/api/doc/purchase/inbound"
export default { export default {
name: "purchaseInbound", name: "purchaseInbound",
@ -100,13 +100,13 @@ export default {
data() { data() {
return { return {
baseUrl, exportUrl: `${baseUrl}/export`,
api: {search, del, getSubById}, api: {add, update, del, withdraw, pass, reject, getSubById, search},
searchForm: { searchForm: {
pidFuzzy: null pidFuzzy: null
}, },
excel: { excel: {
column: [ columns: [
{header: '序号', prop: 'id'}, {header: '序号', prop: 'id'},
{header: '采购订单单号', prop: 'pid', width: 30}, {header: '采购订单单号', prop: 'pid', width: 30},
{header: '创建人', prop: 'cname'}, {header: '创建人', prop: 'cname'},

@ -52,7 +52,9 @@ export default {
methods: { methods: {
init() { init() {
if (this.tree.length === 0) { if (this.tree.length === 0) {
getAll().then(data => this.$store.commit('dataCache/categories', data)) getAll
.request()
.then(data => this.$store.commit('dataCache/categories', data))
} }
}, },

@ -14,7 +14,6 @@
<el-button size="small" type="primary" @click="confirm"> </el-button> <el-button size="small" type="primary" @click="confirm"> </el-button>
<el-button plain size="small" @click="closeDialog"> </el-button> <el-button plain size="small" @click="closeDialog"> </el-button>
<el-button <el-button
v-if="canGoToSysSupplierPage"
plain plain
size="small" size="small"
type="dashed" type="dashed"
@ -63,8 +62,7 @@
import dialogMixin from "@/mixin/dialogMixin" import dialogMixin from "@/mixin/dialogMixin"
import tableMixin from '@/mixin/tablePageMixin' import tableMixin from '@/mixin/tablePageMixin'
import LinerProgress from '@/component/LinerProgress' import LinerProgress from '@/component/LinerProgress'
import {getSuppliers} from "@/api/system/supplier" import {search} from "@/api/system/supplier"
import {auth} from "@/util/auth"
import {elError} from "@/util/message" import {elError} from "@/util/message"
export default { export default {
@ -84,18 +82,13 @@ export default {
} }
}, },
computed: {
canGoToSysSupplierPage() {
return auth('/system/supplier')
}
},
methods: { methods: {
search() { search() {
if (!this.value || this.config.loading) return if (!this.value || this.config.loading) return
this.config.loading = true this.config.loading = true
this.row = null this.row = null
getSuppliers(this.searchForm) search
.request(this.searchForm)
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list

@ -132,7 +132,7 @@
import docDetailMixin from "@/mixin/docDetailMixin" import docDetailMixin from "@/mixin/docDetailMixin"
import CategorySelector from './component/CategorySelector' import CategorySelector from './component/CategorySelector'
import SupplierSelector from './component/SupplierSelector' import SupplierSelector from './component/SupplierSelector'
import {baseUrl, add, commit, getById, pass, reject, update, withdraw} from "@/api/doc/purchase/order" import {getById, add, update, commit, withdraw, pass, reject} from "@/api/doc/purchase/order"
import {isEmpty} from "@/util" import {isEmpty} from "@/util"
import {mul, plus} from "@/util/math" import {mul, plus} from "@/util/math"
import {isInteger} from "@/util/validate" import {isInteger} from "@/util/validate"
@ -146,7 +146,6 @@ export default {
data() { data() {
return { return {
baseUrl,
docName: '采购订单', docName: '采购订单',
api: { api: {
getById, add, update, commit, withdraw, pass, reject getById, add, update, commit, withdraw, pass, reject

@ -117,7 +117,7 @@
import docTableMixin from '@/mixin/docTableMixin' import docTableMixin from '@/mixin/docTableMixin'
import SearchForm from '@/component/SearchForm' import SearchForm from '@/component/SearchForm'
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, del, getSubById, search} from "@/api/doc/purchase/order" import {baseUrl, add, update, del, withdraw, pass, reject, getSubById, search} from "@/api/doc/purchase/order"
export default { export default {
name: "purchaseOrder", name: "purchaseOrder",
@ -128,7 +128,7 @@ export default {
data() { data() {
return { return {
baseUrl, exportUrl: `${baseUrl}/export`,
searchForm: { searchForm: {
sname: null sname: null
}, },
@ -136,9 +136,9 @@ export default {
finish: [], finish: [],
ftime: [] ftime: []
}, },
api: {search, del, getSubById}, api: {add, update, del, withdraw, pass, reject, getSubById, search},
excel: { excel: {
column: [ columns: [
{header: '序号', prop: 'id'}, {header: '序号', prop: 'id'},
{header: '供应商', prop: 'sname', width: 30}, {header: '供应商', prop: 'sname', width: 30},
{header: '创建人', prop: 'cname'}, {header: '创建人', prop: 'cname'},

@ -47,7 +47,7 @@
import dialogMixin from "@/mixin/dialogMixin" import dialogMixin from "@/mixin/dialogMixin"
import tableMixin from '@/mixin/tablePageMixin' import tableMixin from '@/mixin/tablePageMixin'
import LinerProgress from '@/component/LinerProgress' import LinerProgress from '@/component/LinerProgress'
import {getCustomers} from "@/api/system/customer" import {search} from "@/api/system/customer"
import {elError} from "@/util/message" import {elError} from "@/util/message"
export default { export default {
@ -72,7 +72,8 @@ export default {
if (!this.value || this.config.loading) return if (!this.value || this.config.loading) return
this.config.loading = true this.config.loading = true
this.row = null this.row = null
getCustomers(this.searchForm) search
.request(this.searchForm)
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list

@ -64,7 +64,7 @@ export default {
if (!this.value || this.config.loading) return if (!this.value || this.config.loading) return
this.config.loading = true this.config.loading = true
this.$refs.table && this.$refs.table.clearSelection() this.$refs.table && this.$refs.table.clearSelection()
search(this.searchForm) search.request(this.searchForm)
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list

@ -117,7 +117,7 @@
import docDetailMixin from "@/mixin/docDetailMixin" import docDetailMixin from "@/mixin/docDetailMixin"
import CustomerSelector from './component/CustomerSelector' import CustomerSelector from './component/CustomerSelector'
import StockSelector from './component/StockSelector' import StockSelector from './component/StockSelector'
import {baseUrl, add, commit, getById, pass, reject, update, withdraw} from "@/api/doc/sell/order" import {getById, add, update, commit, withdraw, pass, reject} from "@/api/doc/sell/order"
import {isEmpty} from "@/util" import {isEmpty} from "@/util"
import {mul, plus} from "@/util/math" import {mul, plus} from "@/util/math"
import {isInteger} from "@/util/validate" import {isInteger} from "@/util/validate"
@ -131,7 +131,6 @@ export default {
data() { data() {
return { return {
baseUrl,
docName: '销售订单', docName: '销售订单',
api: { api: {
getById, add, update, commit, withdraw, pass, reject getById, add, update, commit, withdraw, pass, reject

@ -124,7 +124,7 @@
import docTableMixin from '@/mixin/docTableMixin' import docTableMixin from '@/mixin/docTableMixin'
import SearchForm from '@/component/SearchForm' import SearchForm from '@/component/SearchForm'
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, del, getSubById, search} from "@/api/doc/sell/order" import {baseUrl, add, update, del, withdraw, pass, reject, getSubById, search} from "@/api/doc/sell/order"
export default { export default {
name: "sellOrder", name: "sellOrder",
@ -135,7 +135,7 @@ export default {
data() { data() {
return { return {
baseUrl, exportUrl: `${baseUrl}/export`,
searchForm: { searchForm: {
customerName: null customerName: null
}, },
@ -143,9 +143,9 @@ export default {
finish: [], finish: [],
ftime: [] ftime: []
}, },
api: {search, del, getSubById}, api: {add, update, del, withdraw, pass, reject, getSubById, search},
excel: { excel: {
column: [ columns: [
{header: '序号', prop: 'id'}, {header: '序号', prop: 'id'},
{header: '客户', prop: 'customerName', width: 30}, {header: '客户', prop: 'customerName', width: 30},
{header: '创建人', prop: 'cname'}, {header: '创建人', prop: 'cname'},

@ -69,7 +69,7 @@ export default {
if (!this.value || this.loading) return if (!this.value || this.loading) return
this.loading = true this.loading = true
this.$refs.table && this.$refs.table.clearSelection() this.$refs.table && this.$refs.table.clearSelection()
getDetail(this.cid) getDetail.request(this.cid)
.then(data => this.tableData = data) .then(data => this.tableData = data)
.finally(() => this.loading = false) .finally(() => this.loading = false)
}, },

@ -105,7 +105,7 @@ import OrderSelector from "./component/OrderSelector"
import StockSelector from "./component/StockSelector" import StockSelector from "./component/StockSelector"
import {getDetailById as getStockDetail} from "@/api/stock/current" import {getDetailById as getStockDetail} from "@/api/stock/current"
import {getSubById as getParentSubById} from "@/api/doc/sell/order" import {getSubById as getParentSubById} from "@/api/doc/sell/order"
import {baseUrl, add, commit, getById, pass, reject, update, withdraw} from "@/api/doc/sell/outbound" import {getById, add, update, commit, withdraw, pass, reject} from "@/api/doc/sell/outbound"
import {isEmpty} from "@/util" import {isEmpty} from "@/util"
import {plus, sub} from "@/util/math" import {plus, sub} from "@/util/math"
import {elAlert} from "@/util/message" import {elAlert} from "@/util/message"
@ -120,7 +120,6 @@ export default {
data() { data() {
return { return {
baseUrl,
docName: '销售出库单', docName: '销售出库单',
api: { api: {
getById, add, update, commit, withdraw, pass, reject getById, add, update, commit, withdraw, pass, reject
@ -168,8 +167,8 @@ export default {
if (this.type === 'add') return Promise.resolve() if (this.type === 'add') return Promise.resolve()
const ids = this.form.data.map(i => i.sid).join(',') const ids = this.form.data.map(i => i.sid).join(',')
return Promise.all([ return Promise.all([
getParentSubById(this.form.pid), getParentSubById.request(this.form.pid),
getStockDetail(ids) getStockDetail.request(ids)
]) ])
.then(([r1, r2]) => this.buildDisplayTableData(r1, r2)) .then(([r1, r2]) => this.buildDisplayTableData(r1, r2))
}, },

@ -96,7 +96,7 @@
import docTableMixin from '@/mixin/docTableMixin' import docTableMixin from '@/mixin/docTableMixin'
import SearchForm from '@/component/SearchForm' import SearchForm from '@/component/SearchForm'
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, del, getSubById, search} from "@/api/doc/sell/outbound" import {baseUrl, add, update, del, withdraw, pass, reject, getSubById, search} from "@/api/doc/sell/outbound"
export default { export default {
name: "sellOutbound", name: "sellOutbound",
@ -107,13 +107,13 @@ export default {
data() { data() {
return { return {
baseUrl, exportUrl: `${baseUrl}/export`,
api: {search, del, getSubById}, api: {add, update, del, withdraw, pass, reject, getSubById, search},
searchForm: { searchForm: {
pidFuzzy: null pidFuzzy: null
}, },
excel: { excel: {
column: [ columns: [
{header: '序号', prop: 'id'}, {header: '序号', prop: 'id'},
{header: '销售订单单号', prop: 'pid', width: 30}, {header: '销售订单单号', prop: 'pid', width: 30},
{header: '创建人', prop: 'cname'}, {header: '创建人', prop: 'cname'},

@ -83,7 +83,7 @@ export default {
this.tableData = [] this.tableData = []
if (!this.value || isEmpty(this.cid) || this.loading) return if (!this.value || isEmpty(this.cid) || this.loading) return
this.loading = true this.loading = true
getDetail(this.cid) getDetail.request(this.cid)
.then(data => { .then(data => {
this.prepareData(data) this.prepareData(data)
this.tableData = data this.tableData = data

@ -66,7 +66,7 @@ import DetailDialog from "./DetailDialog"
import ExtraArea from '@/component/ExtraArea' import ExtraArea from '@/component/ExtraArea'
import SearchForm from "@/component/SearchForm" import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, search} from "@/api/stock/current" import {search} from "@/api/stock/current"
import {isEmpty, debounce} from "@/util" import {isEmpty, debounce} from "@/util"
import {exportExcel} from "@/util/excel" import {exportExcel} from "@/util/excel"
import {plus} from "@/util/math" import {plus} from "@/util/math"
@ -150,7 +150,7 @@ export default {
search() { search() {
if (this.config.loading) return if (this.config.loading) return
this.config.loading = true this.config.loading = true
search(this.mergeSearchForm()) search.request(this.mergeSearchForm())
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list
@ -159,7 +159,7 @@ export default {
}, },
downloadExcel() { downloadExcel() {
exportExcel(`${baseUrl}/export`, this.mergeSearchForm(), this.excel) exportExcel(`/stock/current/export`, this.mergeSearchForm(), this.excel)
}, },
nodeClick(obj) { nodeClick(obj) {

@ -115,7 +115,7 @@ export default {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (!v) return if (!v) return
elConfirm(this.confirmMessage) elConfirm(this.confirmMessage)
.then(() => this.type === 'add' ? add(this.form) : update(this.form)) .then(() => this.type === 'add' ? add.request(this.form) : update.request(this.form))
.then(() => { .then(() => {
this.$emit('commit-success', this.type === 'add' ? '添加成功' : '修改成功') this.$emit('commit-success', this.type === 'add' ? '添加成功' : '修改成功')
this.cancel() this.cancel()

@ -13,12 +13,13 @@
</template> </template>
<script> <script>
import {isEmpty, waitUntilSuccess} from '@/util'
import {elConfirm, elError, elSuccess} from "@/util/message"
import {del, getAll} from "@/api/system/category"
import ContextMenu from "@/component/ContextMenu" import ContextMenu from "@/component/ContextMenu"
import ContextMenuItem from "@/component/ContextMenu/item" import ContextMenuItem from "@/component/ContextMenu/item"
import CategoryTree from '@/component/biz/CategoryTree' import CategoryTree from '@/component/biz/CategoryTree'
import {add, del, getAll} from "@/api/system/category"
import {isEmpty, waitUntilSuccess} from '@/util'
import {auth} from "@/util/auth"
import {elConfirm, elError, elSuccess} from "@/util/message"
export default { export default {
components: {ContextMenuItem, ContextMenu, CategoryTree}, components: {ContextMenuItem, ContextMenu, CategoryTree},
@ -40,7 +41,7 @@ export default {
computed: { computed: {
canAdd() { canAdd() {
return !this.currentCategory return auth(add.url) && !this.currentCategory
|| !this.currentCategory.leaf && this.currentCategory.level < this.maxLevel || !this.currentCategory.leaf && this.currentCategory.level < this.maxLevel
} }
}, },
@ -50,7 +51,8 @@ export default {
this.loading = true this.loading = true
this.currentCategory = null this.currentCategory = null
this.contextmenu.show = false this.contextmenu.show = false
getAll() getAll
.request()
.then(data => this.$store.commit('dataCache/categories', data)) .then(data => this.$store.commit('dataCache/categories', data))
.finally(() => this.loading = false) .finally(() => this.loading = false)
}, },
@ -77,7 +79,7 @@ export default {
elConfirm(`确认删除【${this.currentCategory.name}】分类?`) elConfirm(`确认删除【${this.currentCategory.name}】分类?`)
.then(() => { .then(() => {
this.loading = true this.loading = true
return del({id: this.currentCategory.id, name: this.currentCategory.name}) return del.request({id: this.currentCategory.id, name: this.currentCategory.name})
}) })
.then(() => this.commitSuccess('删除成功')) .then(() => this.commitSuccess('删除成功'))
}, },

@ -51,7 +51,7 @@ import dialogMixin from "@/mixin/dialogMixin"
import AbstractForm from "@/component/AbstractForm" import AbstractForm from "@/component/AbstractForm"
import FormDialog from '@/component/FormDialog' import FormDialog from '@/component/FormDialog'
import RegionSelector from '@/component/RegionSelector' import RegionSelector from '@/component/RegionSelector'
import {addCustomer, updateCustomer} from "@/api/system/customer" import {add, update} from "@/api/system/customer"
import {isEmpty, mergeObj, resetObj} from '@/util' import {isEmpty, mergeObj, resetObj} from '@/util'
import {elConfirm} from "@/util/message" import {elConfirm} from "@/util/message"
@ -156,7 +156,7 @@ export default {
elConfirm(this.confirmMessage) elConfirm(this.confirmMessage)
.then(() => { .then(() => {
this.loading = true this.loading = true
return this.type === 'add' ? addCustomer(this.form) : updateCustomer(this.form) return this.type === 'add' ? add.request(this.form) : update.request(this.form)
}) })
.then(({msg}) => this.$emit('success', msg)) .then(({msg}) => this.$emit('success', msg))
.finally(() => this.loading = false) .finally(() => this.loading = false)

@ -41,10 +41,10 @@
</search-form> </search-form>
<el-row class="button-group"> <el-row class="button-group">
<el-button size="small" type="success" @click="search"> </el-button> <el-button icon="el-icon-search" size="small" type="success" @click="search"> </el-button>
<el-button v-if="canAdd" size="small" type="primary" @click="add"> </el-button> <el-button v-if="canAdd" icon="el-icon-plus" size="small" type="primary" @click="add"> </el-button>
<el-button v-if="canUpdate" size="small" type="primary" @click="edit"> </el-button> <el-button v-if="canUpdate" icon="el-icon-edit" size="small" type="primary" @click="edit"> </el-button>
<el-button v-if="canDel" size="small" type="danger" @click="del"> </el-button> <el-button v-if="canDel" icon="el-icon-delete" size="small" type="danger" @click="del"> </el-button>
</el-row> </el-row>
<el-row v-loading="config.loading" class="table-container"> <el-row v-loading="config.loading" class="table-container">
@ -79,9 +79,9 @@ import EditDialog from './EditDialog'
import RegionSelector from "@/component/RegionSelector" import RegionSelector from "@/component/RegionSelector"
import SearchForm from "@/component/SearchForm" import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, delCustomer, getCustomers, getLimitRegion} from "@/api/system/customer" import {add, update, del, search, getLimitRegion} from "@/api/system/customer"
import {isEmpty} from '@/util' import {isEmpty} from '@/util'
import {auth} from "@/util/auth" import {wic} from "@/util/auth"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
export default { export default {
@ -109,21 +109,11 @@ export default {
} }
}, },
computed: { computed: wic({add, update, del}),
canAdd() {
return auth(`${baseUrl}/add`)
},
canUpdate() {
return auth(`${baseUrl}/update`)
},
canDel() {
return auth(`${baseUrl}/del`)
}
},
methods: { methods: {
getLimitRegion() { getLimitRegion() {
return getLimitRegion() return getLimitRegion.request()
}, },
clearSidSearch() { clearSidSearch() {
@ -149,7 +139,8 @@ export default {
this.config.loading = true this.config.loading = true
this.row = null this.row = null
this.type = 'see' this.type = 'see'
getCustomers(this.mergeSearchForm()) search
.request(this.mergeSearchForm())
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list
@ -170,11 +161,12 @@ export default {
del() { del() {
if (isEmpty(this.row)) return elError('请选择要删除的客户') if (isEmpty(this.row)) return elError('请选择要删除的客户')
if (this.row.enable) return elError('已启用的客户不能删除')
if (this.config.operating) return if (this.config.operating) return
elConfirm(`确定删除客户【${this.row.name}】?`) elConfirm(`确定删除客户【${this.row.name}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return delCustomer({id: this.row.id, name: this.row.name}) return del.request({id: this.row.id, name: this.row.name})
}) })
.then(() => this.success('删除成功')) .then(() => this.success('删除成功'))
.finally(() => this.config.operating = false) .finally(() => this.config.operating = false)
@ -184,7 +176,6 @@ export default {
elSuccess(msg) elSuccess(msg)
this.editDialog = false this.editDialog = false
this.search() this.search()
this.$refs.tree.init()
} }
} }
} }

@ -26,7 +26,7 @@
import dialogMixin from "@/mixin/dialogMixin" import dialogMixin from "@/mixin/dialogMixin"
import AbstractForm from "@/component/AbstractForm" import AbstractForm from "@/component/AbstractForm"
import FormDialog from '@/component/FormDialog' import FormDialog from '@/component/FormDialog'
import {addDepartment, updateDepartment} from "@/api/system/department" import {add, update} from "@/api/system/department"
import {isEmpty} from '@/util' import {isEmpty} from '@/util'
import {elConfirm, elSuccess} from "@/util/message" import {elConfirm, elSuccess} from "@/util/message"
@ -120,7 +120,7 @@ export default {
elConfirm(this.confirmMessage) elConfirm(this.confirmMessage)
.then(() => { .then(() => {
this.loading = true this.loading = true
return this.type === 'add' ? addDepartment(this.form) : updateDepartment(this.form) return this.type === 'add' ? add.request(this.form) : update.request(this.form)
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)

@ -57,7 +57,7 @@ import ContextMenuItem from "@/component/ContextMenu/item"
import EditDialog from "./component/EditDialog" import EditDialog from "./component/EditDialog"
import OrgTreeView from "./component/OrgTreeView" import OrgTreeView from "./component/OrgTreeView"
import ZoomControl from './component/ZoomControl' import ZoomControl from './component/ZoomControl'
import {baseUrl, delDepartment, getDepartments} from "@/api/system/department" import {add, update, del, get} from "@/api/system/department"
import {auth} from "@/util/auth" import {auth} from "@/util/auth"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
import {createTreeByWorker} from "@/util/tree" import {createTreeByWorker} from "@/util/tree"
@ -89,13 +89,13 @@ export default {
return this.zoom / 100 return this.zoom / 100
}, },
canAdd() { canAdd() {
return auth(`${baseUrl}/add`) return auth(add.url)
}, },
canUpdate() { canUpdate() {
return auth(`${baseUrl}/update`) return auth(update.url)
}, },
canDel() { canDel() {
return auth(`${baseUrl}/del`) return auth(del.url)
}, },
}, },
@ -147,7 +147,7 @@ export default {
elConfirm(`确定删除部门【${this.currentNode.name}】?`) elConfirm(`确定删除部门【${this.currentNode.name}】?`)
.then(() => { .then(() => {
this.loading = true this.loading = true
return delDepartment(this.currentNode) return del.request(this.currentNode)
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)
@ -159,7 +159,8 @@ export default {
search() { search() {
this.currentNode = null this.currentNode = null
this.loading = true this.loading = true
getDepartments() get
.request()
.then(data => createTreeByWorker(data)) .then(data => createTreeByWorker(data))
.then(data => { .then(data => {
this.completeDepartment(data) this.completeDepartment(data)

@ -148,11 +148,11 @@
import treePageMixin from '@/mixin/treePageMixin' import treePageMixin from '@/mixin/treePageMixin'
import AbstractForm from "@/component/AbstractForm" import AbstractForm from "@/component/AbstractForm"
import JsonEditor from "@/component/editor/JsonEditor" import JsonEditor from "@/component/editor/JsonEditor"
import {baseUrl, add, update, del} from '@/api/system/resource' import {add, update, del} from '@/api/system/resource'
import {isEmpty, mergeObj, resetObj} from "@/util" import {isEmpty, mergeObj, resetObj} from "@/util"
import {elSuccess, elError, elConfirm} from "@/util/message" import {elSuccess, elError, elConfirm} from "@/util/message"
import {elTreeControl} from "@/util/tree" import {elTreeControl} from "@/util/tree"
import {auth} from "@/util/auth" import {wic} from "@/util/auth"
import {nodeType, getNodeInfo, getNodeTitle} from "./common" import {nodeType, getNodeInfo, getNodeTitle} from "./common"
export default { export default {
@ -207,15 +207,7 @@ export default {
}, },
computed: { computed: {
canAdd() { ...wic({add, update, del}),
return auth(`${baseUrl}/add`)
},
canUpdate() {
return auth(`${baseUrl}/update`)
},
canDel() {
return auth(`${baseUrl}/del`)
},
menus() { menus() {
return this.$store.state.resource.resourceTree return this.$store.state.resource.resourceTree
@ -311,7 +303,7 @@ export default {
elConfirm(`确定删除【${getNodeTitle(this.curNode)}】?`) elConfirm(`确定删除【${getNodeTitle(this.curNode)}】?`)
.then(() => { .then(() => {
this.loading = true this.loading = true
return del(this.curNode.data.id) return del.request(this.curNode.data.id)
}) })
.then(() => { .then(() => {
elSuccess('删除成功') elSuccess('删除成功')
@ -343,7 +335,7 @@ export default {
if (!v) return if (!v) return
this.loading = true this.loading = true
const data = this.transformForm() const data = this.transformForm()
const promise = this.type === 'add' ? add(data) : update(data) const promise = this.type === 'add' ? add.request(data) : update.request(data)
promise promise
.then(({data, msg}) => { .then(({data, msg}) => {
elSuccess(msg) elSuccess(msg)

@ -65,7 +65,7 @@
import dialogMixin from "@/mixin/dialogMixin" import dialogMixin from "@/mixin/dialogMixin"
import AbstractForm from "@/component/AbstractForm" import AbstractForm from "@/component/AbstractForm"
import FormDialog from '@/component/FormDialog' import FormDialog from '@/component/FormDialog'
import {getDepartments} from "@/api/system/department" import {get as getDepartments} from "@/api/system/department"
import {add, update} from "@/api/system/role" import {add, update} from "@/api/system/role"
import {isEmpty, mergeObj} from '@/util' import {isEmpty, mergeObj} from '@/util'
import {createTreeByWorker, elTreeControl} from '@/util/tree' import {createTreeByWorker, elTreeControl} from '@/util/tree'
@ -169,7 +169,7 @@ export default {
departmentId: this.getCheckedDept(), departmentId: this.getCheckedDept(),
resourceId: this.getCheckedRes() resourceId: this.getCheckedRes()
} }
const promise = this.type === 'add' ? add(data) : update(data) const promise = this.type === 'add' ? add.request(data) : update.request(data)
promise promise
.then(({msg}) => this.$emit('success', msg)) .then(({msg}) => this.$emit('success', msg))
.finally(() => this.loading = false) .finally(() => this.loading = false)
@ -186,7 +186,8 @@ export default {
}, },
mounted() { mounted() {
getDepartments(false) getDepartments
.request(false)
.then(data => createTreeByWorker(data)) .then(data => createTreeByWorker(data))
.then(data => { .then(data => {
this.departments = data this.departments = data

@ -59,9 +59,9 @@ import tableMixin from '@/mixin/tablePageMixin'
import EditDialog from './EditDialog' import EditDialog from './EditDialog'
import SearchForm from "@/component/SearchForm" import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, del, search} from "@/api/system/role" import {add, update, del, search} from "@/api/system/role"
import {isEmpty} from '@/util' import {isEmpty} from '@/util'
import {auth} from "@/util/auth" import {wic} from "@/util/auth"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
export default { export default {
@ -85,17 +85,7 @@ export default {
} }
}, },
computed: { computed: wic({add, update, del}),
canAdd() {
return auth(`${baseUrl}/add`)
},
canUpdate() {
return auth(`${baseUrl}/update`)
},
canDel() {
return auth(`${baseUrl}/del`)
}
},
methods: { methods: {
mergeSearchForm() { mergeSearchForm() {
@ -116,7 +106,8 @@ export default {
this.config.loading = true this.config.loading = true
this.row = null this.row = null
this.type = 'see' this.type = 'see'
search(this.mergeSearchForm()) search
.request(this.mergeSearchForm())
.then(({list, total}) => { .then(({list, total}) => {
list.forEach(i => { list.forEach(i => {
i.departmentId = this.str2intArray(i.departmentId) i.departmentId = this.str2intArray(i.departmentId)
@ -148,7 +139,7 @@ export default {
elConfirm(`确定删除角色【${name}】?`) elConfirm(`确定删除角色【${name}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return del({id, name}) return del.request({id, name})
}) })
.then(() => { .then(() => {
elSuccess('删除成功') elSuccess('删除成功')

@ -51,7 +51,7 @@ import dialogMixin from "@/mixin/dialogMixin"
import AbstractForm from "@/component/AbstractForm" import AbstractForm from "@/component/AbstractForm"
import FormDialog from '@/component/FormDialog' import FormDialog from '@/component/FormDialog'
import RegionSelector from '@/component/RegionSelector' import RegionSelector from '@/component/RegionSelector'
import {addSupplier, updateSupplier} from "@/api/system/supplier" import {add, update} from "@/api/system/supplier"
import {isEmpty, mergeObj, resetObj} from '@/util' import {isEmpty, mergeObj, resetObj} from '@/util'
import {elConfirm} from "@/util/message" import {elConfirm} from "@/util/message"
@ -156,7 +156,7 @@ export default {
elConfirm(this.confirmMessage) elConfirm(this.confirmMessage)
.then(() => { .then(() => {
this.loading = true this.loading = true
return this.type === 'add' ? addSupplier(this.form) : updateSupplier(this.form) return this.type === 'add' ? add.request(this.form) : update.request(this.form)
}) })
.then(({msg}) => this.$emit('success', msg)) .then(({msg}) => this.$emit('success', msg))
.finally(() => this.loading = false) .finally(() => this.loading = false)

@ -41,10 +41,10 @@
</search-form> </search-form>
<el-row class="button-group"> <el-row class="button-group">
<el-button size="small" type="success" @click="search"> </el-button> <el-button icon="el-icon-search" size="small" type="success" @click="search"> </el-button>
<el-button v-if="canAdd" size="small" type="primary" @click="add"> </el-button> <el-button v-if="canAdd" icon="el-icon-plus" size="small" type="primary" @click="add"> </el-button>
<el-button v-if="canUpdate" size="small" type="primary" @click="edit"> </el-button> <el-button v-if="canUpdate" icon="el-icon-edit" size="small" type="primary" @click="edit"> </el-button>
<el-button v-if="canDel" size="small" type="danger" @click="del"> </el-button> <el-button v-if="canDel" icon="el-icon-delete" size="small" type="danger" @click="del"> </el-button>
</el-row> </el-row>
<el-row v-loading="config.loading" class="table-container"> <el-row v-loading="config.loading" class="table-container">
@ -79,9 +79,9 @@ import EditDialog from './EditDialog'
import RegionSelector from "@/component/RegionSelector" import RegionSelector from "@/component/RegionSelector"
import SearchForm from "@/component/SearchForm" import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, delSupplier, getLimitRegion, getSuppliers} from "@/api/system/supplier" import {add, update, del, getLimitRegion, search} from "@/api/system/supplier"
import {isEmpty} from '@/util' import {isEmpty} from '@/util'
import {auth} from "@/util/auth" import {wic} from "@/util/auth"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
export default { export default {
@ -109,21 +109,11 @@ export default {
} }
}, },
computed: { computed: wic({add, update, del}),
canAdd() {
return auth(`${baseUrl}/add`)
},
canUpdate() {
return auth(`${baseUrl}/update`)
},
canDel() {
return auth(`${baseUrl}/del`)
}
},
methods: { methods: {
getLimitRegion() { getLimitRegion() {
return getLimitRegion() return getLimitRegion.request()
}, },
clearSidSearch() { clearSidSearch() {
@ -149,7 +139,8 @@ export default {
this.config.loading = true this.config.loading = true
this.row = null this.row = null
this.type = 'see' this.type = 'see'
getSuppliers(this.mergeSearchForm()) search
.request(this.mergeSearchForm())
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list
@ -174,7 +165,7 @@ export default {
elConfirm(`确定删除供应商【${this.row.name}】?`) elConfirm(`确定删除供应商【${this.row.name}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return delSupplier({id: this.row.id, name: this.row.name}) return del.request({id: this.row.id, name: this.row.name})
}) })
.then(() => this.success('删除成功')) .then(() => this.success('删除成功'))
.finally(() => this.config.operating = false) .finally(() => this.config.operating = false)
@ -184,7 +175,6 @@ export default {
elSuccess(msg) elSuccess(msg)
this.editDialog = false this.editDialog = false
this.search() this.search()
this.$refs.tree.init()
} }
} }
} }

@ -4,7 +4,7 @@
<script> <script>
import TreeSelect from '@/component/TreeSelect' import TreeSelect from '@/component/TreeSelect'
import {getDepartments} from "@/api/system/department" import {get} from "@/api/system/department"
import {createTreeByWorker} from "@/util/tree" import {createTreeByWorker} from "@/util/tree"
export default { export default {
@ -28,7 +28,8 @@ export default {
}, },
mounted() { mounted() {
getDepartments(false) get
.request(false)
.then(data => createTreeByWorker(data)) .then(data => createTreeByWorker(data))
.then(data => { .then(data => {
this.data = data this.data = data

@ -42,7 +42,7 @@ import DepartmentSelector from "./DepartmentSelector"
import FormDialog from '@/component/FormDialog' import FormDialog from '@/component/FormDialog'
import RoleSelector from './RoleSelector' import RoleSelector from './RoleSelector'
import {checkName} from "@/api/account" import {checkName} from "@/api/account"
import {addUser, updateUser} from "@/api/system/user" import {add, update} from "@/api/system/user"
import {isEmpty, debounce} from '@/util' import {isEmpty, debounce} from '@/util'
import {elConfirm} from "@/util/message" import {elConfirm} from "@/util/message"
@ -61,7 +61,8 @@ export default {
data() { data() {
const validateName = debounce((r, v, c) => { const validateName = debounce((r, v, c) => {
checkName(this.form.name, this.form.id) checkName
.request(this.form.name, this.form.id)
.then(({msg}) => msg ? c(msg) : c()) .then(({msg}) => msg ? c(msg) : c())
.catch(e => c(e)) .catch(e => c(e))
}, 300) }, 300)
@ -150,7 +151,7 @@ export default {
elConfirm(this.confirmMessage) elConfirm(this.confirmMessage)
.then(() => { .then(() => {
this.loading = true this.loading = true
return this.type === 'add' ? addUser(this.form) : updateUser(this.form) return this.type === 'add' ? add.request(this.form) : update.request(this.form)
}) })
.then(({msg}) => this.$emit('success', msg)) .then(({msg}) => this.$emit('success', msg))
.finally(() => this.loading = false) .finally(() => this.loading = false)

@ -1,5 +1,5 @@
<template> <template>
<el-select :value="value" clearable @clear="emit(null)" @input="emit"> <el-select :value="value" clearable @clear="() => emit(null)" @input="emit">
<el-option <el-option
v-for="item in roles" v-for="item in roles"
:key="item.id" :key="item.id"
@ -17,15 +17,11 @@ export default {
props: {value: Number}, props: {value: Number},
data() { data: () => ({roles: []}),
return {
roles: []
}
},
methods: { methods: {
init() { init() {
get().then(data => this.roles = data) get.request().then(data => this.roles = data)
}, },
emit(v) { emit(v) {

@ -84,9 +84,9 @@ import EditDialog from './component/EditDialog'
import RoleSelector from './component/RoleSelector' import RoleSelector from './component/RoleSelector'
import SearchForm from "@/component/SearchForm" import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/item" import SearchFormItem from "@/component/SearchForm/item"
import {baseUrl, delUser, getUsers, kick, resetUserPwd} from "@/api/system/user" import {search, add, update, del, kick, resetPwd} from "@/api/system/user"
import {isEmpty} from '@/util' import {isEmpty} from '@/util'
import {auth} from "@/util/auth" import {wic} from "@/util/auth"
import {autoCompleteUrl} from "@/util/file" import {autoCompleteUrl} from "@/util/file"
import {elConfirm, elError, elSuccess} from "@/util/message" import {elConfirm, elError, elSuccess} from "@/util/message"
@ -109,27 +109,7 @@ export default {
} }
}, },
computed: { computed: wic({add, update, del, kick, resetPwd}),
canAdd() {
return auth(`${baseUrl}/add`)
},
canUpdate() {
return auth(`${baseUrl}/update`)
},
canDel() {
return auth(`${baseUrl}/del`)
},
canKick() {
return auth(`${baseUrl}/kick`)
},
canResetPwd() {
return auth(`${baseUrl}/resetPwd`)
},
},
methods: { methods: {
mergeSearchForm() { mergeSearchForm() {
@ -145,7 +125,8 @@ export default {
this.config.loading = true this.config.loading = true
this.row = null this.row = null
this.type = 'see' this.type = 'see'
getUsers(this.mergeSearchForm()) search
.request(this.mergeSearchForm())
.then(({list, total}) => { .then(({list, total}) => {
list.forEach(u => u.avatar = autoCompleteUrl(u.avatar)) list.forEach(u => u.avatar = autoCompleteUrl(u.avatar))
this.searchForm.total = total this.searchForm.total = total
@ -171,7 +152,7 @@ export default {
elConfirm(`确定重置用户【${this.row.name}】的密码?`) elConfirm(`确定重置用户【${this.row.name}】的密码?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return resetUserPwd({id: this.row.id, name: this.row.name}) return resetPwd.request({id: this.row.id, name: this.row.name})
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)
@ -186,7 +167,7 @@ export default {
elConfirm(`确定删除用户【${this.row.name}】?`) elConfirm(`确定删除用户【${this.row.name}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return delUser({id: this.row.id, name: this.row.name}) return del.request({id: this.row.id, name: this.row.name})
}) })
.then(({msg}) => { .then(({msg}) => {
elSuccess(msg) elSuccess(msg)
@ -202,7 +183,7 @@ export default {
elConfirm(`确定踢出用户【${this.row.name}】?`) elConfirm(`确定踢出用户【${this.row.name}】?`)
.then(() => { .then(() => {
this.config.operating = true this.config.operating = true
return kick([{id: this.row.id, name: this.row.name}]) return kick.request([{id: this.row.id, name: this.row.name}])
}) })
.then(() => { .then(() => {
elSuccess('踢出成功') elSuccess('踢出成功')

@ -71,7 +71,7 @@ export default {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (!v) return if (!v) return
this.loading = true this.loading = true
updateUserPwd({ updateUserPwd.request({
oldPwd: md5(this.form.oldPwd), oldPwd: md5(this.form.oldPwd),
newPwd: md5(this.form.newPwd), newPwd: md5(this.form.newPwd),
}) })

@ -85,9 +85,9 @@ export default {
this.loading = true this.loading = true
this.$refs.cropper.getCropBlob(data => { this.$refs.cropper.getCropBlob(data => {
upload(new Blob([data]), this.name) upload(new Blob([data]), this.name)
.then(({key}) => updateAvatar(key)) .then(({key}) => updateAvatar.request(key))
.then(({key, msg}) => { .then(({data, msg}) => {
this.$store.commit('user/avatar', autoCompleteUrl(key)) this.$store.commit('user/avatar', autoCompleteUrl(data))
this.$store.dispatch('user/refresh') this.$store.dispatch('user/refresh')
elSuccess(msg) elSuccess(msg)
}) })

@ -49,7 +49,8 @@ export default {
search() { search() {
if (this.config.loading) return if (this.config.loading) return
this.config.loading = true this.config.loading = true
searchLoginHistory({...this.searchForm, uid: this.uid}) searchLoginHistory
.request({...this.searchForm, uid: this.uid})
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list

@ -50,7 +50,8 @@ export default {
search() { search() {
if (this.config.loading) return if (this.config.loading) return
this.config.loading = true this.config.loading = true
searchUserAction({...this.searchForm, uid: this.$store.state.user.id}) searchUserAction
.request({...this.searchForm, uid: this.$store.state.user.id})
.then(({list, total}) => { .then(({list, total}) => {
this.searchForm.total = total this.searchForm.total = total
this.tableData = list this.tableData = list

Loading…
Cancel
Save