Compare commits
74 Commits
b6a87197f0
...
dev-zcx
| Author | SHA1 | Date | |
|---|---|---|---|
| 85f5b87f84 | |||
|
|
0253dfa47f | ||
|
|
81a3847992 | ||
|
|
49b5d302a9 | ||
|
|
8a2d976552 | ||
|
|
f1d2449599 | ||
|
|
e97de4342c | ||
|
|
bfdbef4bd7 | ||
|
|
c519172f5e | ||
|
|
41d52f4ce7 | ||
|
|
79530d221f | ||
|
|
d6bfbcf96a | ||
|
|
b155d3ce9e | ||
|
|
5097cf38f6 | ||
|
|
ae11ac4dc7 | ||
|
|
b0573fdf17 | ||
|
|
b91fe3b05a | ||
|
|
75572f6104 | ||
|
|
a712e3f85f | ||
|
|
a5a64b7131 | ||
|
|
b196135ddb | ||
|
|
34de068ffa | ||
|
|
b1feb33c00 | ||
|
|
853a18df9b | ||
|
|
288770adce | ||
|
|
7bb3a74095 | ||
|
|
34a1fc56d3 | ||
|
|
926cefaee9 | ||
|
|
e5e141fb84 | ||
|
|
ca10366398 | ||
|
|
d39ea3270e | ||
|
|
4726770e3f | ||
|
|
514b602599 | ||
|
|
17208922ad | ||
|
|
82f7d4be5e | ||
|
|
30655c4219 | ||
|
|
3db8be1280 | ||
|
|
aa84bb69f3 | ||
|
|
15b589ab03 | ||
|
|
0b26cf8b28 | ||
|
|
a8e41fe889 | ||
|
|
d1c4632f72 | ||
|
|
70dcf5bc28 | ||
|
|
2af1282718 | ||
|
|
a97f5bf79e | ||
|
|
a2adf2ce20 | ||
|
|
e5418f4019 | ||
|
|
aa5382f199 | ||
|
|
e59ba74c12 | ||
|
|
6c035fa0d8 | ||
|
|
518cddc93c | ||
|
|
0a484253a5 | ||
|
|
af34798896 | ||
|
|
f8a6617a7a | ||
|
|
9180d14ede | ||
|
|
0c555e8473 | ||
|
|
3aa44fa60a | ||
|
|
9dada27bd0 | ||
|
|
8142e05543 | ||
|
|
d80be0d7f1 | ||
|
|
274fc2f435 | ||
|
|
ab2da33ebc | ||
|
|
72a049b7b8 | ||
|
|
f56305505f | ||
|
|
f45123126d | ||
|
|
df36d1da35 | ||
|
|
9ade90355b | ||
|
|
fc71e47903 | ||
|
|
c91a2b608f | ||
|
|
ab63082327 | ||
|
|
a9c5d16926 | ||
|
|
f3b5079fbe | ||
|
|
880eabb761 | ||
|
|
77134be7ff |
@@ -4,11 +4,13 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
# VITE_UPLOAD_URL='http://114.55.169.15:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
|
||||
2
.env.dev
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -4,10 +4,10 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
@@ -7,7 +7,7 @@ VITE_DEV=false
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/oa-api
|
||||
|
||||
5
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/locales"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ss-oa-manage",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "莳松oa管理系统",
|
||||
"author": "ss",
|
||||
"private": false,
|
||||
@@ -51,7 +51,7 @@
|
||||
"diagram-js": "^11.6.0",
|
||||
"echarts": "^5.4.2",
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "2.3.4",
|
||||
"element-plus": "2.9.4",
|
||||
"fast-xml-parser": "^4.2.2",
|
||||
"highlight.js": "^11.8.0",
|
||||
"intro.js": "^7.0.1",
|
||||
@@ -72,6 +72,7 @@
|
||||
"vue-i18n": "9.2.2",
|
||||
"vue-router": "^4.2.1",
|
||||
"vue-types": "^5.0.3",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"web-storage-cache": "^1.1.1",
|
||||
"xe-utils": "^3.5.7",
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
import { isDark } from '@/utils/is'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import routerSearch from '@/components/RouterSearch/index.vue'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('app')
|
||||
const appStore = useAppStore()
|
||||
const currentSize = computed(() => appStore.getCurrentSize)
|
||||
const greyMode = computed(() => appStore.getGreyMode)
|
||||
const { wsCache } = useCache()
|
||||
|
||||
// 根据浏览器当前主题设置系统主题色
|
||||
const setDefaultTheme = () => {
|
||||
let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
|
||||
let isDarkTheme = cache.local.get(CACHE_KEY.IS_DARK)
|
||||
if (isDarkTheme === null) {
|
||||
isDarkTheme = isDark()
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export default {
|
||||
callLogin(data) {
|
||||
return request.post({ url: '/call-api/openapi/V2.0.4/agentLogin', data })
|
||||
},
|
||||
callUserStatus(data) {
|
||||
return request.post({ url: '/call-api/openapi/V2.0.4/getAgentStatus', data })
|
||||
},
|
||||
callNumber(data) {
|
||||
return request.post({ url: '/call-api/openapi/V2.0.4/callNumber', data })
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getAfterSaleList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/list', params })
|
||||
}
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getAfterSalePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createAfterSale = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-after-sale/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
export const auditAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/check', data })
|
||||
}
|
||||
|
||||
export const batchAuditAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/batch/check', data })
|
||||
}
|
||||
|
||||
// 撤销
|
||||
export const cancelApplyAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/revoke', params: data })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getAfterSaleDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/get', params })
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询用户配置
|
||||
export const getClueCache = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/param-user-setting/get-by-user', params })
|
||||
}
|
||||
|
||||
// 保存用户配置
|
||||
export const setClueCache = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/param-user-setting/save', data })
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 1 } })
|
||||
}
|
||||
|
||||
// 更新
|
||||
export const updateField = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/param/update', data })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteField = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/param/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得
|
||||
export const getField = (id) => {
|
||||
return request.get({ url: `/admin-api/crm/param/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得精简信息列表
|
||||
export const getSimpleFieldList = () => {
|
||||
return request.get({ url: '/admin-api/crm/param/simple-list', params: { module: 1 } })
|
||||
}
|
||||
|
||||
// 获取自定义字段
|
||||
export const getDiyFieldList = () => {
|
||||
return request.get({ url: '/admin-api/crm/param/get-diy-param', params: { module: 1 } })
|
||||
}
|
||||
|
||||
// 状态修改
|
||||
export const updateFieldStatus = (signParamId, status) => {
|
||||
const data = {
|
||||
signParamId,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/param/status/update', data: data })
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 线索获取规则
|
||||
export const getClueGainRuleList = () => {
|
||||
return request.get({ url: '/admin-api/crm/sch-clue-gain-rule/list' })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteClueGainRule = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/sch-clue-gain-rule/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 线索获取规则保存
|
||||
export const saveClueGainRule = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/sch-clue-gain-rule/batchUpdate', data })
|
||||
}
|
||||
|
||||
// 线索规则
|
||||
export const getClueDistributeRuleByUser = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/sch-clue-distribution-rule/queryByUserId', params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteClueDistributeRule = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/sch-clue-gain-rule/delete?id=${id}` })
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getDeliveryList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-send/list', params })
|
||||
}
|
||||
|
||||
// 查询分页列表
|
||||
export const getDeliveryPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-send/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createDelivery = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getDeliveryDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-send/get', params })
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getFollowList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/clue-follow-record/list', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createFollow = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/clue-follow-record/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteFollow = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/clue-follow-record/delete?id=' + id })
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getSimpleClueList = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-clue/list-all-simple' })
|
||||
}
|
||||
|
||||
// 查询列表
|
||||
export const getCluePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-clue/page', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getClue = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-clue/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createClue = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-clue/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateClue = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-clue/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteClue = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-clue/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 释放
|
||||
export const releaseClue = async (data) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-clue/public/save', data })
|
||||
}
|
||||
|
||||
// 通用查询数量
|
||||
export const getClueCount = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-clue/get-clue-num' })
|
||||
}
|
||||
|
||||
// 获取操作记录
|
||||
export const getOpearateRecord = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/clue-operate-record/list', params })
|
||||
}
|
||||
|
||||
// 获取公海线索
|
||||
export const getPublicClue = async (data) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-clue/public/save', data })
|
||||
}
|
||||
|
||||
// 获得线索跟进用户信息
|
||||
export const getFollowUserList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-clue/get-follow-user', params })
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 2 } })
|
||||
}
|
||||
|
||||
// 更新
|
||||
export const updateField = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/param/update', data })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteField = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/param/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得
|
||||
export const getField = (id) => {
|
||||
return request.get({ url: `/admin-api/crm/param/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得精简信息列表
|
||||
export const getSimpleFieldList = () => {
|
||||
return request.get({ url: '/admin-api/crm/param/simple-list', params: { module: 2 } })
|
||||
}
|
||||
|
||||
// 获取自定义字段
|
||||
export const getDiyFieldList = () => {
|
||||
return request.get({ url: '/admin-api/crm/param/get-diy-param', params: { module: 2 } })
|
||||
}
|
||||
|
||||
// 状态修改
|
||||
export const updateFieldStatus = (signParamId, status) => {
|
||||
const data = {
|
||||
signParamId,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/param/status/update', data: data })
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getPaymentList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/list', params })
|
||||
}
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getPaymentPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createPayment = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-pay-record/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
export const auditPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/check', data })
|
||||
}
|
||||
|
||||
export const batchAuditPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/batch/check', data })
|
||||
}
|
||||
|
||||
// 撤销
|
||||
export const cancelApplyPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/revoke', params: data })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getPaymentDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/get', params })
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询列表
|
||||
export const getSettlePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/page', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getSettle = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/get?id=' + id })
|
||||
}
|
||||
|
||||
// 批量结算
|
||||
export const batchSaveSettle = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-settlement/batch/save', data })
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询列表
|
||||
export const getSignPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign/page', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getSign = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createSign = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
export const cancelDeal = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sign/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 新增支出
|
||||
export const signAddPay = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign/extra-pay/save', data: data })
|
||||
}
|
||||
|
||||
// 查询支出
|
||||
export const getSignExtraPayList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign/extra-pay/get', params })
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得列表
|
||||
export const getSkillPage = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/skill/page', params })
|
||||
}
|
||||
|
||||
// 创建
|
||||
export const createSkill = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新
|
||||
export const updateSkill = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/skill/update', data })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteSkill = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/skill/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得
|
||||
export const getSkill = (id) => {
|
||||
return request.get({ url: `/admin-api/crm/skill/get?id=${id}` })
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getSimpleSourceList = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/source/list' })
|
||||
}
|
||||
|
||||
// 查询列表
|
||||
export const getSourcePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/source/list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getSource = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/source/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createSource = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateSource = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/source/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteSource = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/source/delete?id=' + id })
|
||||
}
|
||||
41
src/api/finance/plan.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获取提成结算参数
|
||||
export const getCommissionParams = async () => {
|
||||
return await request.get({ url: '/admin-api/oa/percentage/get-percentage-param' })
|
||||
}
|
||||
|
||||
// 创建
|
||||
export const createPlan = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/percentage/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updatePlan = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/percentage/update', data })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updatePlanStatus = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/percentage/status/update', data })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getPlanPage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/percentage/page', params })
|
||||
}
|
||||
|
||||
// 列表
|
||||
export const getPlanSimpleList = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/percentage/simple-list', params })
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getPlanDetail = (id) => {
|
||||
return request.get({ url: '/admin-api/oa/percentage/get', params: { id } })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deletePlan = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/percentage/delete', params: { id } })
|
||||
}
|
||||
39
src/api/finance/salary.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createSalary = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/user-salary/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateSalary = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/user-salary/update', data })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updateSalaryStatus = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/user-salary/status/update', data })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getSalaryPage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/user-salary/page', params })
|
||||
}
|
||||
|
||||
// 列表
|
||||
export const getSalarySimpleList = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/user-salary/simple-list', params })
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getSalaryDetail = (id) => {
|
||||
return request.get({
|
||||
url: '/admin-api/oa/user-salary/getByEmployeeId',
|
||||
params: { employeeId: id }
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteSalary = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/user-salary/delete', params: { id } })
|
||||
}
|
||||
21
src/api/home/falseDiligence.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询列表
|
||||
export const getPage = async (data) => {
|
||||
return await request.post({ url: '/admin-api/oa/dingtalk/attendance/periodPage', data })
|
||||
}
|
||||
|
||||
// 同步假勤数据
|
||||
export const syncFalseDiligence = async (params) => {
|
||||
return await request.get({ url: '/admin-api/oa/dingtalk/attendance/sync', params })
|
||||
}
|
||||
|
||||
// 修改考勤数据
|
||||
export const updateFalseDiligence = async (data) => {
|
||||
return await request.put({ url: '/admin-api/oa/dingtalk/attendance/batchUpdate', data })
|
||||
}
|
||||
|
||||
// 封存考勤数据
|
||||
export const saveFalseDiligence = async (params) => {
|
||||
return await request.get({ url: '/admin-api/oa/dingtalk/attendance/confirm', params })
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
// 线索情况
|
||||
export const getUserClueCount = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/home/get-user-count', params })
|
||||
}
|
||||
|
||||
// 成交率
|
||||
export const getClueSignSignRate = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/home/get-sign-rate', params })
|
||||
}
|
||||
|
||||
// 成交率
|
||||
export const getClueSignSignRank = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/home/get-sign-top10', params })
|
||||
}
|
||||
|
||||
// 成交率
|
||||
export const getClueFollowRank = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/home/get-follow-top10', params })
|
||||
}
|
||||
56
src/api/home/salary.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询工资条
|
||||
export const getSalaryPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/oa/user-salary-grant/periodPage', params })
|
||||
}
|
||||
|
||||
// 生成工资条
|
||||
export const createSalarySlip = async (data) => {
|
||||
return await request.upload({
|
||||
url: '/admin-api/oa/user-salary-grant/import',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 导入工资条
|
||||
export const importSalarySlip = async (data) => {
|
||||
return await request.upload({ url: '/admin-api/oa/user-salary-grant/import/history', data })
|
||||
}
|
||||
|
||||
// 修改工资条
|
||||
export const updateSalarySlip = async (data) => {
|
||||
return await request.put({ url: '/admin-api/oa/user-salary-grant/batchUpdate', data })
|
||||
}
|
||||
|
||||
// 封存
|
||||
export const sealupSalarySlip = async (data) => {
|
||||
return await request.post({ url: '/admin-api/oa/user-salary-grant/confirm', data })
|
||||
}
|
||||
|
||||
// 获取考勤模板链接
|
||||
export const getLinkAttendance = async () => {
|
||||
return await request.download({
|
||||
url: '/admin-api/oa/user-attendance/get-import-template'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取奖金模板
|
||||
export const getLinkReward = async () => {
|
||||
return await request.download({
|
||||
url: '/admin-api/oa/user-salary-grant/get-import-template'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取历史工资条模板
|
||||
export const getLinkHistorySalary = async () => {
|
||||
return await request.download({
|
||||
url: '/admin-api/oa/user-salary-grant/get-import-template/history'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询提成明细
|
||||
export const getCommissionDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/oa/user-salary-grant/detail', params })
|
||||
}
|
||||
42
src/api/kpi/index.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createKpi = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/oa/examine-configuration/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateKpi = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/examine-configuration/update', data })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updateKpiStatus = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/examine-configuration/status/update', data })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getKpiPage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-configuration/page', params })
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getKpiDetail = (id) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-configuration/get', params: { id } })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteKpi = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/examine-configuration/delete', params: { id } })
|
||||
}
|
||||
|
||||
//
|
||||
export const getKpiEmployees = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/oa/employee/examinedEmployees'
|
||||
})
|
||||
}
|
||||
41
src/api/kpi/score.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 打分数据
|
||||
export const getKpiEmployees = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-score/getExamineUserExamineScore', params })
|
||||
}
|
||||
|
||||
// 保存考勤打分数据
|
||||
export const saveKpiScore = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/examine-score/update', data })
|
||||
}
|
||||
|
||||
// 删除考核项
|
||||
export const deleteKpiItem = (params) => {
|
||||
return request.delete({ url: '/admin-api/oa/examine-score/delete', params })
|
||||
}
|
||||
|
||||
// 考评分页数据
|
||||
export const getScorePage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-period/page', params })
|
||||
}
|
||||
|
||||
// 封存
|
||||
export const saveScoreRecord = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-period/confirm', params })
|
||||
}
|
||||
|
||||
// 查询周期是否已封存
|
||||
export const getKpiPeriodStatus = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-period/getExaminePeriodByPeriod', params })
|
||||
}
|
||||
|
||||
// 查询考核记录
|
||||
export const getScoreRecord = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/examine-result/periodPage', data })
|
||||
}
|
||||
|
||||
// 查详情
|
||||
export const getScoreDetail = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/examine-result/detail', params })
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 商品品牌
|
||||
*/
|
||||
export interface BrandVO {
|
||||
/**
|
||||
* 品牌编号
|
||||
*/
|
||||
id?: number
|
||||
/**
|
||||
* 品牌名称
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* 品牌图片
|
||||
*/
|
||||
picUrl: string
|
||||
/**
|
||||
* 品牌排序
|
||||
*/
|
||||
sort?: number
|
||||
/**
|
||||
* 品牌描述
|
||||
*/
|
||||
description?: string
|
||||
/**
|
||||
* 开启状态
|
||||
*/
|
||||
status: number
|
||||
}
|
||||
|
||||
// 创建商品品牌
|
||||
export const createBrand = (data: BrandVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新商品品牌
|
||||
export const updateBrand = (data: BrandVO) => {
|
||||
return request.put({ url: '/admin-api/crm/erp-product-brand/update', data })
|
||||
}
|
||||
|
||||
// 删除商品品牌
|
||||
export const deleteBrand = (id: number) => {
|
||||
return request.delete({ url: `/admin-api/crm/erp-product-brand/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得商品品牌
|
||||
export const getBrand = (id: number) => {
|
||||
return request.get({ url: `/admin-api/crm/erp-product-brand/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得商品品牌列表
|
||||
export const getBrandParam = (params: PageParam) => {
|
||||
return request.get({ url: '/admin-api/crm/erp-product-brand/page', params })
|
||||
}
|
||||
|
||||
// 获得商品品牌精简信息列表
|
||||
export const getSimpleBrandList = () => {
|
||||
return request.get({ url: '/admin-api/crm/erp-product-brand/simple-list' })
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 产品分类
|
||||
*/
|
||||
export interface CategoryVO {
|
||||
/**
|
||||
* 分类编号
|
||||
*/
|
||||
id?: number
|
||||
/**
|
||||
* 父分类编号
|
||||
*/
|
||||
parentId?: number
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
name: string
|
||||
/**
|
||||
* 移动端分类图
|
||||
*/
|
||||
picUrl: string
|
||||
/**
|
||||
* PC 端分类图
|
||||
*/
|
||||
bigPicUrl?: string
|
||||
/**
|
||||
* 分类排序
|
||||
*/
|
||||
sort: number
|
||||
/**
|
||||
* 开启状态
|
||||
*/
|
||||
status: number
|
||||
}
|
||||
|
||||
// 创建商品分类
|
||||
export const createCategory = (data: CategoryVO) => {
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-category/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新商品分类
|
||||
export const updateCategory = (data: CategoryVO) => {
|
||||
return request.put({ url: '/admin-api/crm/erp-product-category/update', data })
|
||||
}
|
||||
|
||||
// 删除商品分类
|
||||
export const deleteCategory = (id: number) => {
|
||||
return request.delete({ url: `/admin-api/crm/erp-product-category/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得商品分类
|
||||
export const getCategory = (id: number) => {
|
||||
return request.get({ url: `/admin-api/crm/erp-product-category/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得商品分类列表
|
||||
export const getCategoryList = (params: any) => {
|
||||
return request.get({ url: '/admin-api/crm/erp-product-category/list', params })
|
||||
}
|
||||
|
||||
// 获得商品分类列表
|
||||
export const getCategorySimpleList = (params: any) => {
|
||||
return request.get({ url: '/admin-api/crm/erp-product-category/simple-list', params })
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
// 查询列表
|
||||
export const getProductPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-product/page', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getProduct = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-product/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createProduct = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-product/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateProduct = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/erp-product/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteProduct = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/erp-product/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const getSimpleProductList = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-product/simple-list' })
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/crm/param/create',
|
||||
data: { ...data, module: 3 },
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
export const updateField = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/param/update', data })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteField = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/param/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得
|
||||
export const getField = (id) => {
|
||||
return request.get({ url: `/admin-api/crm/param/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得精简信息列表
|
||||
export const getSimpleFieldList = () => {
|
||||
return request.get({ url: '/admin-api/crm/param/simple-list', params: { module: 3 } })
|
||||
}
|
||||
|
||||
// 获取自定义字段
|
||||
export const getDiyFieldList = () => {
|
||||
return request.get({ url: '/admin-api/crm/param/get-diy-param', params: { module: 3 } })
|
||||
}
|
||||
|
||||
// 状态修改
|
||||
export const updateFieldStatus = (signParamId, status) => {
|
||||
const data = {
|
||||
signParamId,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/param/status/update', data: data })
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 商品属性
|
||||
*/
|
||||
export interface PropertyVO {
|
||||
id?: number
|
||||
/** 名称 */
|
||||
name: string
|
||||
/** 备注 */
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
export interface PropertyValueVO {
|
||||
id?: number
|
||||
/** 属性项的编号 */
|
||||
propertyId?: number
|
||||
/** 名称 */
|
||||
name: string
|
||||
/** 备注 */
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品属性值的明细
|
||||
*/
|
||||
export interface PropertyValueDetailVO {
|
||||
/** 属性项的编号 */
|
||||
propertyId: number // 属性的编号
|
||||
/** 属性的名称 */
|
||||
propertyName: string
|
||||
/** 属性值的编号 */
|
||||
valueId: number
|
||||
/** 属性值的名称 */
|
||||
valueName: string
|
||||
}
|
||||
|
||||
// ------------------------ 属性项 -------------------
|
||||
|
||||
// 创建属性项
|
||||
export const createProperty = (data: PropertyVO) => {
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-property/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新属性项
|
||||
export const updateProperty = (data: PropertyVO) => {
|
||||
return request.put({ url: '/product/property/update', data })
|
||||
}
|
||||
|
||||
// 删除属性项
|
||||
export const deleteProperty = (id: number) => {
|
||||
return request.delete({ url: `/product/property/delete?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得属性项
|
||||
export const getProperty = (id: number): Promise<PropertyVO> => {
|
||||
return request.get({ url: `/product/property/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 获得属性项分页
|
||||
export const getPropertyPage = (params: PageParam) => {
|
||||
return request.get({ url: '/product/property/page', params })
|
||||
}
|
||||
|
||||
// 获得属性项列表
|
||||
export const getPropertyList = (params: any) => {
|
||||
return request.get({ url: '/product/property/list', params })
|
||||
}
|
||||
|
||||
// 获得属性项列表
|
||||
export const getPropertyListAndValue = (data: any) => {
|
||||
return request.post({ url: '/product/property/get-value-list', data })
|
||||
}
|
||||
|
||||
// ------------------------ 属性值 -------------------
|
||||
|
||||
// 获得属性值分页
|
||||
export const getPropertyValuePage = (params: PageParam & any) => {
|
||||
return request.get({ url: '/product/property/value/page', params })
|
||||
}
|
||||
|
||||
// 获得属性值
|
||||
export const getPropertyValue = (id: number): Promise<PropertyValueVO> => {
|
||||
return request.get({ url: `/product/property/value/get?id=${id}` })
|
||||
}
|
||||
|
||||
// 创建属性值
|
||||
export const createPropertyValue = (data: PropertyValueVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-property-value/create', data })
|
||||
}
|
||||
|
||||
// 更新属性值
|
||||
export const updatePropertyValue = (data: PropertyValueVO) => {
|
||||
return request.put({ url: '/product/property/value/update', data })
|
||||
}
|
||||
|
||||
// 删除属性值
|
||||
export const deletePropertyValue = (id: number) => {
|
||||
return request.delete({ url: `/product/property/value/delete?id=${id}` })
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
// 查询列表
|
||||
export const getPurchasePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-purchase/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createPurchase = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-purchase/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updatePurchase = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/erp-purchase/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deletePurchase = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/erp-purchase/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 审核
|
||||
export const auditPurchase = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-purchase/audit', data })
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DeliveryExpressVO {
|
||||
id: number
|
||||
code: string
|
||||
name: string
|
||||
logo: string
|
||||
sort: number
|
||||
status: number
|
||||
}
|
||||
|
||||
// 查询快递公司列表
|
||||
export const getDeliveryExpressPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/trade/delivery/express/page', params })
|
||||
}
|
||||
|
||||
// 查询快递公司详情
|
||||
export const getDeliveryExpress = async (id: number) => {
|
||||
return await request.get({ url: '/trade/delivery/express/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增快递公司
|
||||
export const createDeliveryExpress = async (data: DeliveryExpressVO) => {
|
||||
return await request.post({ url: '/trade/delivery/express/create', data })
|
||||
}
|
||||
|
||||
// 修改快递公司
|
||||
export const updateDeliveryExpress = async (data: DeliveryExpressVO) => {
|
||||
return await request.put({ url: '/trade/delivery/express/update', data })
|
||||
}
|
||||
|
||||
// 删除快递公司
|
||||
export const deleteDeliveryExpress = async (id: number) => {
|
||||
return await request.delete({ url: '/trade/delivery/express/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出快递公司 Excel
|
||||
export const exportDeliveryExpressApi = async (params) => {
|
||||
return await request.download({ url: '/trade/delivery/express/export-excel', params })
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DeliveryExpressTemplateVO {
|
||||
id: number
|
||||
name: string
|
||||
chargeMode: number
|
||||
sort: number
|
||||
templateCharge: ExpressTemplateChargeVO[]
|
||||
templateFree: ExpressTemplateFreeVO[]
|
||||
}
|
||||
|
||||
export declare type ExpressTemplateChargeVO = {
|
||||
areaIds: number[]
|
||||
startCount: number
|
||||
startPrice: number
|
||||
extraCount: number
|
||||
extraPrice: number
|
||||
}
|
||||
|
||||
export declare type ExpressTemplateFreeVO = {
|
||||
areaIds: number[]
|
||||
freeCount: number
|
||||
freePrice: number
|
||||
}
|
||||
|
||||
// 查询快递运费模板列表
|
||||
export const getDeliveryExpressTemplatePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/trade/delivery/express-template/page', params })
|
||||
}
|
||||
|
||||
// 查询快递运费模板详情
|
||||
export const getDeliveryExpressTemplate = async (id: number) => {
|
||||
return await request.get({ url: '/trade/delivery/express-template/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增快递运费模板
|
||||
export const createDeliveryExpressTemplate = async (data: DeliveryExpressTemplateVO) => {
|
||||
return await request.post({ url: '/trade/delivery/express-template/create', data })
|
||||
}
|
||||
|
||||
// 修改快递运费模板
|
||||
export const updateDeliveryExpressTemplate = async (data: DeliveryExpressTemplateVO) => {
|
||||
return await request.put({ url: '/trade/delivery/express-template/update', data })
|
||||
}
|
||||
|
||||
// 删除快递运费模板
|
||||
export const deleteDeliveryExpressTemplate = async (id: number) => {
|
||||
return await request.delete({ url: '/trade/delivery/express-template/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出快递运费模板 Excel
|
||||
export const exportDeliveryExpressTemplateApi = async (params) => {
|
||||
return await request.download({ url: '/trade/delivery/express-template/export-excel', params })
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
// 查询列表
|
||||
export const getWarehousePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-warehouse/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createWarehouse = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-warehouse/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateWarehouse = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/erp-warehouse/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteWarehouse = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/erp-warehouse/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 获取仓库
|
||||
export const getWarehouse = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-warehouse/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获取仓库列表
|
||||
export const getSimpleWarehouseList = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-warehouse/simple-list' })
|
||||
}
|
||||
|
||||
// 获取库存
|
||||
export const getInventoryList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-inventory/page', params })
|
||||
}
|
||||
|
||||
// 获取库存变动记录
|
||||
export const getInventoryRecord = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
||||
}
|
||||
|
||||
// 获取剩余库存
|
||||
export const getRemainInventoryList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-inventory-detail/list', params })
|
||||
}
|
||||
38
src/api/okr/comment.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createComment = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/comments/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getCommentPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/comments/page',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取评论类型
|
||||
export const getCommentTypeOptions = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/dict-data/get-by-type',
|
||||
params: { dictType: 'comment_type' }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 点赞评论
|
||||
export const likeComment = (commentId) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/comments-likes/update',
|
||||
data: { commentId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
110
src/api/okr/okr.js
Normal file
@@ -0,0 +1,110 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createOkrNode = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/node/add',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateOkrNode = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/node/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getOkrNodeDetail = (nodeId) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/get',
|
||||
params: { nodeId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 我负责的 - 节点树
|
||||
export const getMyNodeTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/my/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 我负责的 - okr列表
|
||||
export const getMyOkrPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/my/object/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 全部目标 - 节点树
|
||||
export const getAllNodeTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/all/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 全部目标 - okr列表
|
||||
export const getAllOkrPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/all/object/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取节点操作历史
|
||||
export const getOkrNodeHistory = (nodeId) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/record/list',
|
||||
params: { nodeId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取系统默认的关键成果内容
|
||||
export const getDefaultOkrOptions = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/dict-data/get-by-type',
|
||||
params: { dictType: 'key_result_source' }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 更新OKR进度
|
||||
export const updateOkrProgress = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/node/progress/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取目标关系树一级节点
|
||||
export const getOkrRelationTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/first-node',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取目标关系树下级节点数据
|
||||
export const getOkrRelationTreeChildren = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/node-tree',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
83
src/api/okr/wait.js
Normal file
@@ -0,0 +1,83 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createWait = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/agent-work/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateWait = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/agent-work/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getWaitPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/page',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getWaitDetail = (id) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/get',
|
||||
params: { id }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteWait = (id) => {
|
||||
return request.delete({
|
||||
url: '/admin-api/okr/agent-work/delete',
|
||||
params: { id }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 催办
|
||||
export const urgeWait = (workId) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/urge',
|
||||
params: { workId }
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 跟进待办
|
||||
export const followWait = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/agent-work-follow/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询跟进记录
|
||||
export const getFollowWaitPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work-follow/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
export const getWaitCount = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/agent-work/getAgentWorkNum',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
36
src/api/pers/attendancePlan.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createPlan = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/attendance-setting/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updatePlan = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/attendance-setting/update', data })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updatePlanStatus = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/attendance-setting/status/update', data })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getPlanPage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/attendance-setting/page', params })
|
||||
}
|
||||
|
||||
// 列表
|
||||
export const getPlanSimpleList = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/attendance-setting/simple-list', params })
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getPlanDetail = (id) => {
|
||||
return request.get({ url: '/admin-api/oa/attendance-setting/get', params: { id } })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deletePlan = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/attendance-setting/delete', params: { id } })
|
||||
}
|
||||
41
src/api/pers/employee.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createEmployee = (data) => {
|
||||
return request.post({ url: '/admin-api/oa/employee/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getEmployeeSimpleList = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/employee/list-all-simple', params })
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateEmployee = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/employee/update', data })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updateEmployeeStatus = (data) => {
|
||||
return request.put({ url: '/admin-api/oa/employee/status/update', data })
|
||||
}
|
||||
|
||||
// 分页
|
||||
export const getEmployeePage = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/employee/page', params })
|
||||
}
|
||||
|
||||
// 详情
|
||||
export const getEmployeeDetail = (id) => {
|
||||
return request.get({ url: '/admin-api/oa/employee/get', params: { id } })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteEmployee = (id) => {
|
||||
return request.delete({ url: '/admin-api/oa/employee/delete', params: { id } })
|
||||
}
|
||||
|
||||
// 获取钉钉id
|
||||
export const getDingUserId = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/employee/getDingTalkUserIdByMobile', params })
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询列表-分页
|
||||
export const getClassTypePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
|
||||
}
|
||||
|
||||
export const getClassTypeList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getClassType = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createClassType = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-class-type/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateClassType = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-class-type/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteClassType = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
export const updateClassTypeStatus = async (data) => {
|
||||
return request.put({ url: '/admin-api/crm/sch-class-type/status/update', data })
|
||||
}
|
||||
|
||||
// 批量修改状态
|
||||
export const batchUpdateClassTypeStatus = async (data) => {
|
||||
return request.put({ url: '/admin-api/crm/sch-class-type/status/batch-update', data })
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
export const batchDeleteClassType = async (ids) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/batch-delete?ids=' + ids })
|
||||
}
|
||||
|
||||
// 获取提成结算参数
|
||||
export const getCommissionParams = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get-percentage-param' })
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询列表-分页
|
||||
export const getPlacePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-place/page', params })
|
||||
}
|
||||
|
||||
// 查询列表-不分页
|
||||
export const getPlaceList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-place/list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getPlace = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-place/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createPlace = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-place/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updatePlace = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-place/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deletePlace = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const updatePlaceStatus = async (placeId, status) => {
|
||||
const data = {
|
||||
placeId,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/sch-place/status/update', data: data })
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
// 查询列表
|
||||
export const getSchoolPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-school/page', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getSchool = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-school/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createSchool = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-school/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateSchool = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-school/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteSchool = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const updateSchoolStatus = async (schoolId, status) => {
|
||||
const data = {
|
||||
schoolId,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/sch-school/status/update', data: data })
|
||||
}
|
||||
5
src/api/system/app/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getSimpleAppList = async () => {
|
||||
return await request.get({ url: '/admin-api/system/serviceInstance/simple-list' })
|
||||
}
|
||||
@@ -47,3 +47,8 @@ export const deleteDictData = (id: number) => {
|
||||
export const exportDictData = (params) => {
|
||||
return request.get({ url: '/admin-api/oa/dict-data/export', params })
|
||||
}
|
||||
|
||||
// 获取通用字典数据
|
||||
export const getGeneralSysDictData = (dictType: string) => {
|
||||
return request.get({ url: '/admin-api/system/dict-data/get-by-type', params: { dictType } })
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询知识库列表
|
||||
export const getLibraryPage = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/knowledge-lib/page', params })
|
||||
}
|
||||
|
||||
// 查询知识库详情
|
||||
export const getLibrary = (id) => {
|
||||
return request.get({ url: '/admin-api/crm/knowledge-lib/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增知识库
|
||||
export const createLibrary = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/knowledge-lib/create', data })
|
||||
}
|
||||
|
||||
// 修改知识库
|
||||
export const updateLibrary = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/knowledge-lib/update', data })
|
||||
}
|
||||
|
||||
// 删除知识库
|
||||
export const deleteLibrary = (id) => {
|
||||
return request.delete({ url: '/admin-api/crm/knowledge-lib/delete?id=' + id })
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询资源列表
|
||||
export const getResourcePage = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/knowledge-lib-info/page', params })
|
||||
}
|
||||
|
||||
// 查询资源详情
|
||||
export const getResource = (id) => {
|
||||
return request.get({ url: '/admin-api/crm/knowledge-lib-info/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增资源
|
||||
export const createResource = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/knowledge-lib-info/create', data })
|
||||
}
|
||||
|
||||
// 修改资源
|
||||
export const updateResource = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/knowledge-lib-info/update', data })
|
||||
}
|
||||
|
||||
// 删除资源
|
||||
export const deleteResource = (id) => {
|
||||
return request.delete({ url: '/admin-api/crm/knowledge-lib-info/delete?id=' + id })
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import request from '@/config/axios'
|
||||
import qs from 'qs'
|
||||
|
||||
export interface NotifyMessageVO {
|
||||
id: number
|
||||
@@ -16,35 +15,39 @@ export interface NotifyMessageVO {
|
||||
}
|
||||
|
||||
// 查询站内信消息列表
|
||||
export const getNotifyMessagePage = async (params: PageParam) => {
|
||||
export const getNotifyMessagePage = async (params: any) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/page', params })
|
||||
}
|
||||
|
||||
// 获得我的站内信分页
|
||||
export const getMyNotifyMessagePage = async (params: PageParam) => {
|
||||
export const getMyNotifyMessagePage = async (params: any) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/my-page', params })
|
||||
}
|
||||
|
||||
// 批量标记已读
|
||||
export const updateNotifyMessageRead = async (ids) => {
|
||||
export const updateNotifyMessageRead = async (data: any) => {
|
||||
return await request.put({
|
||||
url:
|
||||
'/admin-api/system/notify-message/update-read?' +
|
||||
qs.stringify({ ids: ids }, { indices: false })
|
||||
url: '/admin-api/system/notify-message/update-read?',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 标记所有站内信为已读
|
||||
export const updateAllNotifyMessageRead = async () => {
|
||||
return await request.put({ url: '/admin-api/system/notify-message/update-all-read' })
|
||||
export const updateAllNotifyMessageRead = async (data: any) => {
|
||||
return await request.put({ url: '/admin-api/system/notify-message/update-all-read', data })
|
||||
}
|
||||
|
||||
// 获取当前用户的最新站内信列表
|
||||
export const getUnreadNotifyMessageList = async () => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/get-unread-list' })
|
||||
export const getUnreadNotifyMessageList = async (params: any) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/get-unread-list', params })
|
||||
}
|
||||
|
||||
// 获得当前用户的未读站内信数量
|
||||
export const getUnreadNotifyMessageCount = async () => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/get-unread-count' })
|
||||
export const getUnreadNotifyMessageCount = async (params: any) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/get-unread-count', params })
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
export const getNotifyMessageDetail = async (id: number) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/get', params: { id } })
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 341 B |
|
Before Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 350 B |
|
Before Width: | Height: | Size: 358 B |
|
Before Width: | Height: | Size: 355 B |
|
Before Width: | Height: | Size: 903 B |
|
Before Width: | Height: | Size: 958 B |
|
Before Width: | Height: | Size: 926 B |
|
Before Width: | Height: | Size: 926 B |
|
Before Width: | Height: | Size: 950 B |
|
Before Width: | Height: | Size: 970 B |
BIN
src/assets/imgs/login2.gif
Normal file
|
After Width: | Height: | Size: 309 KiB |
BIN
src/assets/imgs/shisong.jpg
Normal file
|
After Width: | Height: | Size: 192 KiB |
@@ -542,10 +542,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.second.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.second.type == '1'" label="范围">
|
||||
@@ -601,10 +601,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.minute.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.minute.type == '1'" label="范围">
|
||||
@@ -660,10 +660,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.hour.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.hour.type == '1'" label="范围">
|
||||
@@ -719,12 +719,12 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.day.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button label="4">本月最后一天</el-radio-button>
|
||||
<el-radio-button label="5">不指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
<el-radio-button value="4">本月最后一天</el-radio-button>
|
||||
<el-radio-button value="5">不指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.day.type == '1'" label="范围">
|
||||
@@ -780,10 +780,10 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.month.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.month.type == '1'" label="范围">
|
||||
@@ -840,12 +840,12 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.week.type">
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button label="4">本月最后一周</el-radio-button>
|
||||
<el-radio-button label="5">不指定</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
<el-radio-button value="4">本月最后一周</el-radio-button>
|
||||
<el-radio-button value="5">不指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.week.type == '1'" label="范围">
|
||||
@@ -919,11 +919,11 @@ const submit = () => {
|
||||
<el-form>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="cronValue.year.type">
|
||||
<el-radio-button label="-1">忽略</el-radio-button>
|
||||
<el-radio-button label="0">任意值</el-radio-button>
|
||||
<el-radio-button label="1">范围</el-radio-button>
|
||||
<el-radio-button label="2">间隔</el-radio-button>
|
||||
<el-radio-button label="3">指定</el-radio-button>
|
||||
<el-radio-button value="-1">忽略</el-radio-button>
|
||||
<el-radio-button value="0">任意值</el-radio-button>
|
||||
<el-radio-button value="1">范围</el-radio-button>
|
||||
<el-radio-button value="2">间隔</el-radio-button>
|
||||
<el-radio-button value="3">指定</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="cronValue.year.type == '1'" label="范围">
|
||||
|
||||
@@ -24,7 +24,27 @@ const props = defineProps({
|
||||
default: () => undefined
|
||||
},
|
||||
readonly: propTypes.bool.def(false),
|
||||
modelValue: propTypes.string.def('')
|
||||
modelValue: propTypes.string.def(''),
|
||||
toolbarConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
excludeKeys: [
|
||||
'insertVideo', // 网络视频
|
||||
'insertImage', // 网络图片
|
||||
'insertLink', // 链接
|
||||
'codeBlock', // 代码块
|
||||
'headerSelect', // 标题
|
||||
'blockquote', // 引用
|
||||
'fontFamily', // 字体
|
||||
'todo', // 代办
|
||||
'group-indent', // 缩进
|
||||
'emotion', // 表情
|
||||
'undo', // 撤销
|
||||
'redo', // 重做
|
||||
'fullScreen'
|
||||
]
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change', 'update:modelValue'])
|
||||
@@ -212,24 +232,6 @@ const editorStyle = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const toolbarConfig = ref({
|
||||
excludeKeys: [
|
||||
'insertVideo', // 网络视频
|
||||
'insertImage', // 网络图片
|
||||
'insertLink', // 链接
|
||||
'codeBlock', // 代码块
|
||||
'headerSelect', // 标题
|
||||
'blockquote', // 引用
|
||||
'fontFamily', // 字体
|
||||
'todo', // 代办
|
||||
'group-indent', // 缩进
|
||||
'emotion', // 表情
|
||||
'undo', // 撤销
|
||||
'redo', // 重做
|
||||
'fullScreen'
|
||||
]
|
||||
})
|
||||
|
||||
// 回调函数
|
||||
const handleChange = (editor: IDomEditor) => {
|
||||
emit('change', editor)
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
v-show="total > 0"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:small="small"
|
||||
:background="true"
|
||||
:page-sizes="[10, 20, 30, 50, 100]"
|
||||
:page-sizes="[10, 20, 50, 100, 200]"
|
||||
:pager-count="pagerCount"
|
||||
:total="total"
|
||||
class="float-right mt-15px mb-15px"
|
||||
@@ -43,10 +42,6 @@ const props = defineProps({
|
||||
layout: {
|
||||
type: String,
|
||||
default: 'total, sizes, prev, pager, next, jumper'
|
||||
},
|
||||
small: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -22,13 +22,16 @@
|
||||
class="upload-file-uploader"
|
||||
>
|
||||
<el-button type="primary"><Icon icon="ep:upload-filled" />选取文件</el-button>
|
||||
<template v-if="isShowTip" #tip>
|
||||
<div style="font-size: 12px">
|
||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||
</div>
|
||||
<div style="font-size: 12px">
|
||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件
|
||||
</div>
|
||||
<template #tip>
|
||||
<template v-if="isShowTip">
|
||||
<div style="font-size: 12px">
|
||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||
</div>
|
||||
<div style="font-size: 12px">
|
||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件
|
||||
</div>
|
||||
</template>
|
||||
<slot name="tip"></slot>
|
||||
</template>
|
||||
</el-upload>
|
||||
</div>
|
||||
@@ -47,7 +50,7 @@ const props = defineProps({
|
||||
// fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: propTypes.array.def([]),
|
||||
accept: propTypes.string.def('*'),
|
||||
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
||||
fileSize: propTypes.number.def(10), // 大小限制(MB)
|
||||
limit: propTypes.number.def(5), // 数量限制
|
||||
autoUpload: propTypes.bool.def(true), // 自动上传
|
||||
drag: propTypes.bool.def(false), // 拖拽上传
|
||||
|
||||
@@ -5,7 +5,7 @@ import { config } from './config'
|
||||
const { default_headers } = config
|
||||
|
||||
const request = (option: any) => {
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm, headers } = option
|
||||
return service({
|
||||
url: url,
|
||||
method,
|
||||
@@ -14,7 +14,8 @@ const request = (option: any) => {
|
||||
data,
|
||||
responseType: responseType,
|
||||
headers: {
|
||||
'Content-Type': headersType || default_headers
|
||||
'Content-Type': headersType || default_headers,
|
||||
...headers
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
import errorCode from './errorCode'
|
||||
|
||||
import { resetRouter } from '@/router'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { result_code, base_url, request_timeout } = config
|
||||
@@ -67,7 +66,8 @@ service.interceptors.request.use(
|
||||
|
||||
// 设置实例
|
||||
const appId = getAppId()
|
||||
if (appId) (config as Recordable).headers['instance-id'] = appId
|
||||
if (appId && !(config as Recordable).headers['instance-id'])
|
||||
(config as Recordable).headers['instance-id'] = appId
|
||||
|
||||
const params = config.params || {}
|
||||
const data = config.data || false
|
||||
@@ -79,7 +79,7 @@ service.interceptors.request.use(
|
||||
config.data = qs.stringify(data)
|
||||
}
|
||||
// get参数编码
|
||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||
if (config.method?.toUpperCase() === 'GET' && Object.keys(params).length > 0) {
|
||||
config.params = {}
|
||||
const paramsStr = qs.stringify(params, { allowDots: true })
|
||||
if (paramsStr) {
|
||||
@@ -137,8 +137,8 @@ service.interceptors.response.use(
|
||||
const code = data.code || result_code
|
||||
// 二进制数据则直接返回
|
||||
if (
|
||||
response.request.responseType === 'blob' ||
|
||||
response.request.responseType === 'arraybuffer'
|
||||
response?.request?.responseType === 'blob' ||
|
||||
response?.request?.responseType === 'arraybuffer'
|
||||
) {
|
||||
return response.data
|
||||
}
|
||||
@@ -213,11 +213,10 @@ service.interceptors.response.use(
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 无访问权限,退出登录
|
||||
const { wsCache } = useCache()
|
||||
const tenantId = wsCache.get('TENANT_ID')
|
||||
const appId = wsCache.get('App_ID')
|
||||
const tenantId = cache.local.get('TENANT_ID')
|
||||
const appId = cache.local.get('App_ID')
|
||||
resetRouter() // 重置静态路由表
|
||||
wsCache.clear()
|
||||
cache.local.clear()
|
||||
removeToken()
|
||||
window.location.href = `/oa/login?tenantId=${tenantId}&appId=${appId}`
|
||||
})
|
||||
@@ -259,11 +258,10 @@ const handleAuthorized = () => {
|
||||
confirmButtonText: t('login.relogin'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const { wsCache } = useCache()
|
||||
const tenantId = wsCache.get('TENANT_ID')
|
||||
const appId = wsCache.get('App_ID')
|
||||
const tenantId = cache.local.get('TENANT_ID')
|
||||
const appId = cache.local.get('App_ID')
|
||||
resetRouter() // 重置静态路由表
|
||||
wsCache.clear()
|
||||
cache.local.clear()
|
||||
removeToken()
|
||||
isRelogin.show = false
|
||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { App } from 'vue'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
export function hasPermi(app: App<Element>) {
|
||||
app.directive('hasPermi', (el, binding) => {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const all_permission = '*:*:*'
|
||||
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||
const permissions = cache.local.get(CACHE_KEY.USER)?.permissions || []
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const permissionFlag = value
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { App } from 'vue'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
export function hasRole(app: App<Element>) {
|
||||
app.directive('hasRole', (el, binding) => {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const super_admin = 'admin'
|
||||
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||
const roles = cache.local.get(CACHE_KEY.USER).roles
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const roleFlag = value
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script lang="ts" name="Message" setup>
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import * as NotifyMessageApi from '@/api/system/notify/message'
|
||||
// import * as NotifyMessageApi from '@/api/system/notify/message'
|
||||
// import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
// const userStore = useUserStore()
|
||||
const { push } = useRouter()
|
||||
const activeName = ref('notice')
|
||||
const unreadCount = ref(0) // 未读消息数量
|
||||
@@ -9,17 +11,21 @@ const list = ref<any[]>([]) // 消息列表
|
||||
|
||||
// 获得消息列表
|
||||
const getList = async () => {
|
||||
list.value = await NotifyMessageApi.getUnreadNotifyMessageList()
|
||||
// list.value = await NotifyMessageApi.getUnreadNotifyMessageList({
|
||||
// roleId: userStore.getUser?.currentRole
|
||||
// })
|
||||
// 强制设置 unreadCount 为 0,避免小红点因为轮询太慢,不消除
|
||||
unreadCount.value = 0
|
||||
}
|
||||
|
||||
// 获得未读消息数
|
||||
const getUnreadCount = async () => {
|
||||
NotifyMessageApi.getUnreadNotifyMessageCount().then((data) => {
|
||||
unreadCount.value = data
|
||||
})
|
||||
}
|
||||
// const getUnreadCount = async () => {
|
||||
// NotifyMessageApi.getUnreadNotifyMessageCount({ roleId: userStore.getUser?.currentRole }).then(
|
||||
// (data) => {
|
||||
// unreadCount.value = data
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
|
||||
// 跳转我的站内信
|
||||
const goMyList = () => {
|
||||
@@ -32,7 +38,7 @@ const goMyList = () => {
|
||||
const msgInterval = ref<any>(null)
|
||||
onMounted(() => {
|
||||
// 首次加载小红点
|
||||
getUnreadCount()
|
||||
// getUnreadCount()
|
||||
// 轮询刷新小红点
|
||||
// msgInterval.value = setInterval(() => {
|
||||
// getUnreadCount()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// import { ElMessage } from 'element-plus'
|
||||
// import { useClipboard, useCssVar } from '@vueuse/core'
|
||||
import { useCssVar } from '@vueuse/core'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
|
||||
import { setCssVar, trim } from '@/utils'
|
||||
@@ -13,6 +13,7 @@ import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
||||
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||
import { useWatermark } from '@/hooks/web/useWatermark'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { setWatermark } = useWatermark()
|
||||
|
||||
@@ -195,10 +196,9 @@ watch(
|
||||
|
||||
// 清空缓存
|
||||
const clear = () => {
|
||||
const { wsCache } = useCache()
|
||||
wsCache.delete(CACHE_KEY.LAYOUT)
|
||||
wsCache.delete(CACHE_KEY.THEME)
|
||||
wsCache.delete(CACHE_KEY.IS_DARK)
|
||||
cache.local.delete(CACHE_KEY.LAYOUT)
|
||||
cache.local.delete(CACHE_KEY.THEME)
|
||||
cache.local.delete(CACHE_KEY.IS_DARK)
|
||||
window.location.reload()
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" name="UserInfo" setup>
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
@@ -9,11 +9,10 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
|
||||
import { Setting } from '@/layout/components/Setting'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
const { push, replace } = useRouter()
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -24,7 +23,7 @@ const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('user-info')
|
||||
|
||||
const user = wsCache.get(CACHE_KEY.USER)
|
||||
const user = cache.local.get(CACHE_KEY.USER)
|
||||
|
||||
const avatar = user.user.avatar ? user.user.avatar : avatarImg
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import router from './router'
|
||||
import { isRelogin } from '@/config/axios/service'
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||
import { useTitle } from '@/hooks/web/useTitle'
|
||||
import { useNProgress } from '@/hooks/web/useNProgress'
|
||||
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||
@@ -8,6 +8,7 @@ import { useDictStoreWithOut } from '@/store/modules/dict'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
@@ -19,44 +20,53 @@ const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/regis
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
start()
|
||||
loadStart()
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
await userStore.setUserInfoAction()
|
||||
isRelogin.show = false
|
||||
// 后端过滤菜单
|
||||
await permissionStore.generateRoutes()
|
||||
permissionStore.getAddRouters.forEach((route) => {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
next(nextData)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
if (getAppId() && to.query?.appId && getAppId() != to.query?.appId) {
|
||||
removeToken()
|
||||
cache?.local?.delete('appInfo')
|
||||
cache?.local?.delete('roleRouters')
|
||||
cache?.local?.delete('user')
|
||||
cache?.local?.delete('App_ID')
|
||||
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
next(`/oa/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
await userStore.setUserInfoAction()
|
||||
isRelogin.show = false
|
||||
// 后端过滤菜单
|
||||
await permissionStore.generateRoutes()
|
||||
permissionStore.getAddRouters.forEach((route) => {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
next(nextData)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/oa/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
src/plugins/cache/index.js
vendored
@@ -26,7 +26,7 @@ const sessionCache = {
|
||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||
return storage[key]
|
||||
},
|
||||
remove(key) {
|
||||
delete(key) {
|
||||
if (!sessionStorage) {
|
||||
return null
|
||||
}
|
||||
@@ -62,7 +62,7 @@ const localCache = {
|
||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||
return storage[key]
|
||||
},
|
||||
remove(key) {
|
||||
delete(key) {
|
||||
if (!localStorage) {
|
||||
return null
|
||||
}
|
||||
@@ -73,6 +73,10 @@ const localCache = {
|
||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||
delete storage[key]
|
||||
localStorage.setItem(name, JSON.stringify(storage))
|
||||
},
|
||||
clear() {
|
||||
let storage = {}
|
||||
localStorage.setItem(name, JSON.stringify(storage))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,27 +106,41 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/Basic',
|
||||
// component: Layout,
|
||||
// name: 'Basic',
|
||||
// meta: {},
|
||||
// redirect: '/Basic/menu',
|
||||
// children: [
|
||||
// {
|
||||
// path: 'menu',
|
||||
// component: () => import('@/views/Basic/Menu/index.vue'),
|
||||
// name: 'Menu',
|
||||
// meta: {
|
||||
// canTo: true,
|
||||
// hidden: true,
|
||||
// noTagsView: false,
|
||||
// icon: 'ep:user',
|
||||
// title: '菜单管理'
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '/Basic',
|
||||
component: Layout,
|
||||
name: 'Basic',
|
||||
meta: {
|
||||
title: '菜单管理'
|
||||
},
|
||||
redirect: '/Basic/menu',
|
||||
children: [
|
||||
{
|
||||
path: 'menu',
|
||||
component: () => import('@/views/Basic/Menu/index.vue'),
|
||||
name: 'Menu',
|
||||
meta: {
|
||||
canTo: true,
|
||||
// hidden: true,
|
||||
noTagsView: false,
|
||||
icon: 'ep:user',
|
||||
title: '菜单管理'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'okr',
|
||||
component: () => import('@/views/OKR/Management/index.vue'),
|
||||
name: 'OkrManagement',
|
||||
meta: {
|
||||
canTo: true,
|
||||
// hidden: true,
|
||||
noTagsView: false,
|
||||
icon: 'ep:user',
|
||||
title: 'Okr管理'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/Login/Login.vue'),
|
||||
|
||||
@@ -2,14 +2,13 @@ import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
import { setCssVar, humpToUnderline } from '@/utils'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
import { LayoutType } from '@/types/layout'
|
||||
import { ThemeTypes } from '@/types/theme'
|
||||
import { getAppInfo } from '@/api/login'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
import cache from '@/plugins/cache'
|
||||
interface AppState {
|
||||
breadcrumb: boolean
|
||||
breadcrumbIcon: boolean
|
||||
@@ -46,7 +45,7 @@ export const useAppStore = defineStore('app', {
|
||||
sizeMap: ['default', 'large', 'small'],
|
||||
mobile: false, // 是否是移动端
|
||||
title: import.meta.env.VITE_APP_TITLE, // 标题
|
||||
appInfo: wsCache.get('appInfo'),
|
||||
appInfo: cache.local.get('appInfo'),
|
||||
pageLoading: false, // 路由跳转loading
|
||||
|
||||
breadcrumb: true, // 面包屑
|
||||
@@ -57,19 +56,19 @@ export const useAppStore = defineStore('app', {
|
||||
screenfull: true, // 全屏图标
|
||||
size: false, // 尺寸图标
|
||||
locale: false, // 多语言图标
|
||||
message: true, // 消息图标
|
||||
message: false, // 消息图标
|
||||
tagsView: true, // 标签页
|
||||
tagsViewIcon: false, // 是否显示标签图标
|
||||
logo: true, // logo
|
||||
fixedHeader: true, // 固定toolheader
|
||||
footer: false, // 显示页脚
|
||||
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
|
||||
fixedMenu: wsCache.get('fixedMenu') || false, // 是否固定菜单
|
||||
fixedMenu: cache.local.get('fixedMenu') || false, // 是否固定菜单
|
||||
|
||||
layout: wsCache.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
|
||||
isDark: wsCache.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
|
||||
currentSize: wsCache.get('default') || 'default', // 组件尺寸
|
||||
theme: wsCache.get(CACHE_KEY.THEME) || {
|
||||
layout: cache.local.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
|
||||
isDark: cache.local.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
|
||||
currentSize: cache.local.get('default') || 'default', // 组件尺寸
|
||||
theme: cache.local.get(CACHE_KEY.THEME) || {
|
||||
// 主题色
|
||||
elColorPrimary: '#409eff',
|
||||
// 左侧菜单边框颜色
|
||||
@@ -225,7 +224,7 @@ export const useAppStore = defineStore('app', {
|
||||
this.greyMode = greyMode
|
||||
},
|
||||
setFixedMenu(fixedMenu: boolean) {
|
||||
wsCache.set('fixedMenu', fixedMenu)
|
||||
cache.local.set('fixedMenu', fixedMenu)
|
||||
this.fixedMenu = fixedMenu
|
||||
},
|
||||
setPageLoading(pageLoading: boolean) {
|
||||
@@ -237,7 +236,7 @@ export const useAppStore = defineStore('app', {
|
||||
return
|
||||
}
|
||||
this.layout = layout
|
||||
wsCache.set(CACHE_KEY.LAYOUT, this.layout)
|
||||
cache.local.set(CACHE_KEY.LAYOUT, this.layout)
|
||||
},
|
||||
setTitle(title: string) {
|
||||
this.title = title
|
||||
@@ -251,18 +250,18 @@ export const useAppStore = defineStore('app', {
|
||||
document.documentElement.classList.add('light')
|
||||
document.documentElement.classList.remove('dark')
|
||||
}
|
||||
wsCache.set(CACHE_KEY.IS_DARK, this.isDark)
|
||||
cache.local.set(CACHE_KEY.IS_DARK, this.isDark)
|
||||
},
|
||||
setCurrentSize(currentSize: ElementPlusSize) {
|
||||
this.currentSize = currentSize
|
||||
wsCache.set('currentSize', this.currentSize)
|
||||
cache.local.set('currentSize', this.currentSize)
|
||||
},
|
||||
setMobile(mobile: boolean) {
|
||||
this.mobile = mobile
|
||||
},
|
||||
setTheme(theme: ThemeTypes) {
|
||||
this.theme = Object.assign(this.theme, theme)
|
||||
wsCache.set(CACHE_KEY.THEME, this.theme)
|
||||
cache.local.set(CACHE_KEY.THEME, this.theme)
|
||||
},
|
||||
setCssVarTheme() {
|
||||
for (const key in this.theme) {
|
||||
@@ -274,7 +273,7 @@ export const useAppStore = defineStore('app', {
|
||||
},
|
||||
async setAppInfo(appId: number) {
|
||||
const appInfo = await getAppInfo(appId)
|
||||
wsCache.set('appInfo', appInfo)
|
||||
cache.local.set('appInfo', appInfo)
|
||||
this.appInfo = appInfo
|
||||
return appInfo
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
// @ts-ignore
|
||||
import { DictDataVO } from '@/api/system/dict/types'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache('sessionStorage')
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { listSimpleDictData } from '@/api/system/dict/dict.data'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
export interface DictValueType {
|
||||
value: any
|
||||
@@ -28,7 +28,7 @@ export const useDictStore = defineStore('dict', {
|
||||
}),
|
||||
getters: {
|
||||
getDictMap(): Recordable {
|
||||
const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE)
|
||||
const dictMap = cache.session.get(CACHE_KEY.DICT_CACHE)
|
||||
if (dictMap) {
|
||||
this.dictMap = dictMap
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export const useDictStore = defineStore('dict', {
|
||||
},
|
||||
actions: {
|
||||
async setDictMap() {
|
||||
const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE)
|
||||
const dictMap = cache.session.get(CACHE_KEY.DICT_CACHE)
|
||||
if (dictMap) {
|
||||
this.dictMap = dictMap
|
||||
this.isSetDict = true
|
||||
@@ -64,7 +64,7 @@ export const useDictStore = defineStore('dict', {
|
||||
})
|
||||
this.dictMap = dictDataMap
|
||||
this.isSetDict = true
|
||||
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||
cache.session.set(CACHE_KEY.DICT_CACHE, dictDataMap) // 60 秒 过期
|
||||
}
|
||||
},
|
||||
getDictByType(type: string) {
|
||||
@@ -74,7 +74,7 @@ export const useDictStore = defineStore('dict', {
|
||||
return this.dictMap[type]
|
||||
},
|
||||
async resetDict() {
|
||||
wsCache.delete(CACHE_KEY.DICT_CACHE)
|
||||
cache.session.delete(CACHE_KEY.DICT_CACHE)
|
||||
const res = await listSimpleDictData()
|
||||
// 设置数据
|
||||
const dictDataMap = new Map<string, any>()
|
||||
@@ -94,7 +94,7 @@ export const useDictStore = defineStore('dict', {
|
||||
})
|
||||
this.dictMap = dictDataMap
|
||||
this.isSetDict = true
|
||||
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||
cache.session.set(CACHE_KEY.DICT_CACHE, dictDataMap) // 60 秒 过期
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,9 +3,9 @@ import { store } from '../index'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import remainingRouter from '@/router/modules/remaining'
|
||||
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
export interface PermissionState {
|
||||
routers: AppRouteRecordRaw[]
|
||||
@@ -34,8 +34,8 @@ export const usePermissionStore = defineStore('permission', {
|
||||
async generateRoutes(): Promise<unknown> {
|
||||
return new Promise<void>(async (resolve) => {
|
||||
let res: AppCustomRouteRecordRaw[] = []
|
||||
if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||
res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||
if (cache.local.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||
res = cache.local.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||
}
|
||||
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
|
||||
// 动态路由,404一定要放到最后面
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { store } from '../index'
|
||||
import { defineStore } from 'pinia'
|
||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { getInfo, loginOut } from '@/api/login'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
interface UserVO {
|
||||
id: number
|
||||
@@ -49,21 +49,21 @@ export const useUserStore = defineStore('admin-user', {
|
||||
this.resetState()
|
||||
return null
|
||||
}
|
||||
let userInfo = wsCache.get(CACHE_KEY.USER)
|
||||
if (!userInfo) {
|
||||
let userInfo = cache.local.get(CACHE_KEY.USER)
|
||||
if (!userInfo || !userInfo?.menus || userInfo.menus.length == 0) {
|
||||
userInfo = await getInfo({})
|
||||
}
|
||||
this.permissions = userInfo.permissions
|
||||
this.roles = userInfo.roles
|
||||
this.user = userInfo.user
|
||||
this.isSetUser = true
|
||||
wsCache.set(CACHE_KEY.USER, userInfo)
|
||||
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
|
||||
cache.local.set(CACHE_KEY.USER, userInfo)
|
||||
cache.local.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
|
||||
},
|
||||
async loginOut() {
|
||||
await loginOut()
|
||||
removeToken()
|
||||
wsCache.clear()
|
||||
cache.local.clear()
|
||||
this.resetState()
|
||||
},
|
||||
resetState() {
|
||||
@@ -77,7 +77,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
wsCache.delete(CACHE_KEY.USER)
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
this.resetState()
|
||||
window.location.href = ''
|
||||
}
|
||||
|
||||
@@ -69,3 +69,32 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.dialog-okr {
|
||||
width: 94vw;
|
||||
height: 94vh;
|
||||
max-width: 1800px;
|
||||
max-height: 1000px;
|
||||
margin: 0;
|
||||
}
|
||||
.dialog-okr .el-dialog__header {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.okr-info-dialog {
|
||||
.el-dialog__body {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 去除 Chrome、Safari、Edge、Opera 中的指示器 */
|
||||
.el-input__inner::-webkit-outer-spin-button,
|
||||
.el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 去除 Firefox 中的指示器 */
|
||||
.el-input__inner[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { TokenType } from '@/api/login/types'
|
||||
import { decrypt, encrypt } from '@/utils/jsencrypt'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const AccessTokenKey = 'ACCESS_TOKEN'
|
||||
const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
@@ -10,24 +9,26 @@ const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
// 获取token
|
||||
export const getAccessToken = () => {
|
||||
// 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
|
||||
return wsCache.get(AccessTokenKey) ? wsCache.get(AccessTokenKey) : wsCache.get('ACCESS_TOKEN')
|
||||
return cache.local.get(AccessTokenKey)
|
||||
? cache.local.get(AccessTokenKey)
|
||||
: cache.local.get('ACCESS_TOKEN')
|
||||
}
|
||||
|
||||
// 刷新token
|
||||
export const getRefreshToken = () => {
|
||||
return wsCache.get(RefreshTokenKey)
|
||||
return cache.local.get(RefreshTokenKey)
|
||||
}
|
||||
|
||||
// 设置token
|
||||
export const setToken = (token: TokenType) => {
|
||||
wsCache.set(RefreshTokenKey, token.refreshToken, { exp: token.expiresTime })
|
||||
wsCache.set(AccessTokenKey, token.accessToken)
|
||||
cache.local.set(RefreshTokenKey, token.refreshToken)
|
||||
cache.local.set(AccessTokenKey, token.accessToken)
|
||||
}
|
||||
|
||||
// 删除token
|
||||
export const removeToken = () => {
|
||||
wsCache.delete(AccessTokenKey)
|
||||
wsCache.delete(RefreshTokenKey)
|
||||
cache.local.delete(AccessTokenKey)
|
||||
cache.local.delete(RefreshTokenKey)
|
||||
}
|
||||
|
||||
/** 格式化token(jwt格式) */
|
||||
@@ -47,7 +48,7 @@ export type LoginFormType = {
|
||||
}
|
||||
|
||||
export const getLoginForm = () => {
|
||||
const loginForm: LoginFormType = wsCache.get(LoginFormKey)
|
||||
const loginForm: LoginFormType = cache.local.get(LoginFormKey)
|
||||
if (loginForm) {
|
||||
loginForm.password = decrypt(loginForm.password) as string
|
||||
}
|
||||
@@ -56,11 +57,11 @@ export const getLoginForm = () => {
|
||||
|
||||
export const setLoginForm = (loginForm: LoginFormType) => {
|
||||
loginForm.password = encrypt(loginForm.password) as string
|
||||
wsCache.set(LoginFormKey, loginForm, { exp: 30 * 24 * 60 * 60 })
|
||||
cache.local.set(LoginFormKey, loginForm)
|
||||
}
|
||||
|
||||
export const removeLoginForm = () => {
|
||||
wsCache.delete(LoginFormKey)
|
||||
cache.local.delete(LoginFormKey)
|
||||
}
|
||||
|
||||
// ========== 租户相关 ==========
|
||||
@@ -69,52 +70,52 @@ const TenantIdKey = 'TENANT_ID'
|
||||
const TenantNameKey = 'TENANT_NAME'
|
||||
|
||||
export const getTenantName = () => {
|
||||
return wsCache.get(TenantNameKey)
|
||||
return cache.local.get(TenantNameKey)
|
||||
}
|
||||
|
||||
export const setTenantName = (username: string) => {
|
||||
wsCache.set(TenantNameKey, username, { exp: 30 * 24 * 60 * 60 })
|
||||
cache.local.set(TenantNameKey, username)
|
||||
}
|
||||
|
||||
export const removeTenantName = () => {
|
||||
wsCache.delete(TenantNameKey)
|
||||
cache.local.delete(TenantNameKey)
|
||||
}
|
||||
|
||||
export const getTenantId = () => {
|
||||
return wsCache.get(TenantIdKey)
|
||||
return cache.local.get(TenantIdKey)
|
||||
}
|
||||
|
||||
export const setTenantId = (username: string) => {
|
||||
wsCache.set(TenantIdKey, username)
|
||||
cache.local.set(TenantIdKey, username)
|
||||
}
|
||||
|
||||
export const removeTenantId = () => {
|
||||
wsCache.delete(TenantIdKey)
|
||||
cache.local.delete(TenantIdKey)
|
||||
}
|
||||
|
||||
const AppIdKey = 'App_ID'
|
||||
const AppNameKey = 'App_NAME'
|
||||
|
||||
export const getAPPName = () => {
|
||||
return wsCache.get(AppNameKey)
|
||||
return cache.local.get(AppNameKey)
|
||||
}
|
||||
|
||||
export const setAppName = (name: string) => {
|
||||
wsCache.set(AppNameKey, name, { exp: 30 * 24 * 60 * 60 })
|
||||
cache.local.set(AppNameKey, name)
|
||||
}
|
||||
|
||||
export const removeAppName = () => {
|
||||
wsCache.delete(AppNameKey)
|
||||
cache.local.delete(AppNameKey)
|
||||
}
|
||||
|
||||
export const getAppId = () => {
|
||||
return wsCache.get(AppIdKey)
|
||||
return cache.local.get(AppIdKey)
|
||||
}
|
||||
|
||||
export const setAppId = (id: number) => {
|
||||
wsCache.set(AppIdKey, id)
|
||||
cache.local.set(AppIdKey, id)
|
||||
}
|
||||
|
||||
export const removeAppId = () => {
|
||||
wsCache.delete(AppIdKey)
|
||||
cache.local.delete(AppIdKey)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const download0 = (data: Blob, fileName: string, mineType: string) => {
|
||||
// 创建 blob
|
||||
const blob = new Blob([data], { type: mineType })
|
||||
|
||||
// 创建 href 超链接,点击进行下载
|
||||
window.URL = window.URL || window.webkitURL
|
||||
const href = URL.createObjectURL(blob)
|
||||
@@ -15,7 +16,11 @@ const download0 = (data: Blob, fileName: string, mineType: string) => {
|
||||
const download = {
|
||||
// 下载 Excel 方法
|
||||
excel: (data: Blob, fileName: string) => {
|
||||
download0(data, fileName, 'application/vnd.ms-excel')
|
||||
download0(
|
||||
data,
|
||||
fileName,
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
)
|
||||
},
|
||||
// 下载 Word 方法
|
||||
word: (data: Blob, fileName: string) => {
|
||||
|
||||
@@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
|
||||
export const removeNullField = (obj: Object) => {
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
if (obj[key] == '') {
|
||||
if (obj[key] === '' || obj[key] === null || obj[key] === undefined) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
@@ -9,10 +10,9 @@ const { t } = useI18n() // 国际化
|
||||
*/
|
||||
export function checkPermi(value: string[]) {
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const { wsCache } = useCache()
|
||||
const permissionDatas = value
|
||||
const all_permission = '*:*:*'
|
||||
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||
const permissions = cache.local.get(CACHE_KEY.USER).permissions
|
||||
const hasPermission = permissions.some((permission) => {
|
||||
return all_permission === permission || permissionDatas.includes(permission)
|
||||
})
|
||||
@@ -30,10 +30,9 @@ export function checkPermi(value: string[]) {
|
||||
*/
|
||||
export function checkRole(value: string[]) {
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const { wsCache } = useCache()
|
||||
const permissionRoles = value
|
||||
const super_admin = 'admin'
|
||||
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||
const roles = cache.local.get(CACHE_KEY.USER).roles
|
||||
const hasRole = roles.some((role) => {
|
||||
return super_admin === role || permissionRoles.includes(role)
|
||||
})
|
||||
|
||||
@@ -32,9 +32,10 @@
|
||||
<el-form-item label="负责人" prop="leaderUserId">
|
||||
<el-select v-model="formData.leaderUserId" clearable placeholder="请输入负责人">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:disabled="item.status == 1"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -43,8 +44,8 @@
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="0"> 启用 </el-radio>
|
||||
<el-radio :label="1"> 禁用 </el-radio>
|
||||
<el-radio :value="0"> 启用 </el-radio>
|
||||
<el-radio :value="1"> 禁用 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -55,6 +56,26 @@
|
||||
<el-input-number v-model="formData.sort" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="开通系统" prop="instanceIds">
|
||||
<el-select
|
||||
v-model="formData.instanceIds"
|
||||
placeholder="选择开通系统"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in instanceIdsOptions"
|
||||
:key="item.instanceId"
|
||||
:label="item.instanceName"
|
||||
:disabled="item.status == 1"
|
||||
:value="item.instanceId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
@@ -73,8 +94,9 @@
|
||||
<script lang="ts" name="SystemDeptForm" setup>
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { getSimpleAppList } from '@/api/system/app'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -90,7 +112,8 @@ const formData = ref({
|
||||
sort: 1,
|
||||
leaderUserId: undefined,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
instanceIds: undefined
|
||||
})
|
||||
const formRules = reactive<any>({
|
||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||
@@ -104,7 +127,8 @@ const formRules = reactive<any>({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const deptTree = ref() // 树形结构
|
||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
const employeeOptions = ref<any>([]) // 用户列表
|
||||
const instanceIdsOptions = ref<any>([]) // 实例ids
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
@@ -122,7 +146,13 @@ const open = async (type: string, id?: number) => {
|
||||
}
|
||||
}
|
||||
// 获得用户列表
|
||||
userList.value = await UserApi.getSimpleUserList()
|
||||
getEmployeeSimpleList().then((data) => {
|
||||
employeeOptions.value = data
|
||||
})
|
||||
//实例
|
||||
getSimpleAppList().then((data) => {
|
||||
instanceIdsOptions.value = data
|
||||
})
|
||||
// 获得部门树
|
||||
await getTree()
|
||||
}
|
||||
@@ -163,7 +193,8 @@ const resetForm = () => {
|
||||
sort: 1,
|
||||
leaderUserId: undefined,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
instanceIds: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
@@ -21,9 +21,16 @@
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list" row-key="id" default-expand-all border>
|
||||
<el-table-column prop="name" label="部门名称" />
|
||||
<el-table-column prop="leader" label="负责人" width="120" />
|
||||
<el-table-column prop="sort" label="排序" width="200" />
|
||||
<el-table-column prop="status" label="状态" width="100" />
|
||||
<el-table-column prop="leaderUserName" label="负责人" width="120" />
|
||||
<el-table-column prop="instanceNames" label="业务系统" width="200" />
|
||||
<el-table-column prop="sort" label="排序" width="80" />
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 0 ? 'success' : 'danger'">
|
||||
{{ scope.row.status == 0 ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" class-name="fixed-width" width="160">
|
||||
<template #default="scope">
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单类型" prop="type">
|
||||
<el-radio-group v-model="formData.type">
|
||||
<el-radio-button :label="1"> 目录 </el-radio-button>
|
||||
<el-radio-button :label="2"> 菜单 </el-radio-button>
|
||||
<el-radio-button :label="3"> 按钮 </el-radio-button>
|
||||
<el-radio-button :value="1"> 目录 </el-radio-button>
|
||||
<el-radio-button :value="2"> 菜单 </el-radio-button>
|
||||
<el-radio-button :value="3"> 按钮 </el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.type !== 3" label="菜单图标">
|
||||
@@ -69,8 +69,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="0"> 启用 </el-radio>
|
||||
<el-radio :label="1"> 禁用 </el-radio>
|
||||
<el-radio :value="0"> 启用 </el-radio>
|
||||
<el-radio :value="1"> 禁用 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.type !== 3" label="显示状态" prop="visible">
|
||||
@@ -116,11 +116,11 @@
|
||||
<script lang="ts" name="SystemMenuForm" setup>
|
||||
// import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as MenuApi from '@/api/system/menu'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { CommonStatusEnum, SystemMenuTypeEnum } from '@/utils/constants'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -218,7 +218,7 @@ const submitForm = async () => {
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
// 清空,从而触发刷新
|
||||
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
cache.local.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import * as MenuApi from '@/api/system/menu'
|
||||
import MenuForm from './MenuForm.vue'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache()
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -145,7 +145,7 @@ const refreshMenu = async () => {
|
||||
try {
|
||||
await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存')
|
||||
// 清空,从而触发刷新
|
||||
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
cache.local.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
// 刷新浏览器
|
||||
location.reload()
|
||||
} catch {}
|
||||
|
||||
@@ -9,6 +9,18 @@
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
/>
|
||||
<el-table-column label="状态" key="status">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
active-text="在职"
|
||||
inactive-text="离职"
|
||||
:inactive-value="1"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="pageSize"
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :label="1"> 男 </el-radio>
|
||||
<el-radio :label="2"> 女 </el-radio>
|
||||
<el-radio :value="1"> 男 </el-radio>
|
||||
<el-radio :value="2"> 女 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
<el-col :span="20" :xs="24">
|
||||
<!-- 搜索 -->
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||
<el-form-item label="登录账号" prop="username">
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-input
|
||||
v-model="queryParams.username"
|
||||
placeholder="请输入登录账号"
|
||||
v-model="queryParams.nickname"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
@@ -50,6 +50,8 @@
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="在职"
|
||||
inactive-text="离职"
|
||||
v-hasPermi="['basic:employee:update']"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
@@ -118,6 +120,7 @@ const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
mobile: undefined,
|
||||
deptId: undefined
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" style="width: 1000px">
|
||||
<el-form
|
||||
:model="comissionForm"
|
||||
:model="formData"
|
||||
ref="formRef"
|
||||
:rules="rules"
|
||||
class="mt-10px"
|
||||
@@ -10,48 +10,73 @@
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="方案名称" prop="name">
|
||||
<el-input v-model="comissionForm.name" placeholder="请输入方案名称" clearable />
|
||||
<el-form-item label="方案名称" prop="percentageName">
|
||||
<el-input v-model="formData.percentageName" placeholder="请输入方案名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="结算方式">
|
||||
<el-radio-group v-model="comissionForm.percentageType">
|
||||
<el-radio :label="1">
|
||||
<el-radio-group v-model="formData.percentageType">
|
||||
<el-radio :value="1">
|
||||
<Tooltip message="可配置多级,命中某档位后,按照档位分级结算" />阶梯结算
|
||||
</el-radio>
|
||||
<el-radio :label="2">
|
||||
<el-radio :value="2">
|
||||
<Tooltip message="可配置多级,命中某档位后所有金额全部按照该档位结算" />常规结算
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button type="primary" class="mb-10px" plain @click="handleAddRules"
|
||||
>添加提成档位</el-button
|
||||
>
|
||||
|
||||
<el-card class="mb-18px" shadow="never" :body-style="{ padding: '10px' }">
|
||||
<div v-if="formData.percentageType == 1">
|
||||
<p class="text-red-500">阶梯结算说明:</p>
|
||||
<p>若设置 0档、1000档、2000档</p>
|
||||
<p>金额为1500,则未满1000的部分按照0档结算提成,1000-1500的部分按照1000档结算</p>
|
||||
</div>
|
||||
<div v-else-if="formData.percentageType == 2">
|
||||
<p class="text-red-500">阶梯结算说明:</p>
|
||||
<p>若设置 0档、1000档、2000档</p>
|
||||
<p>金额为1500,则全部按照1000档结算</p>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-button type="primary" class="mb-10px" plain @click="handleAddRules">
|
||||
添加提成档位
|
||||
</el-button>
|
||||
<el-row :gutter="20" class="mb-10px">
|
||||
<el-col
|
||||
:span="24"
|
||||
:offset="0"
|
||||
class="flex"
|
||||
v-for="(item, index) in comissionForm.rules"
|
||||
v-for="(item, index) in formData.rules"
|
||||
:key="index"
|
||||
>
|
||||
<el-select v-model="item.ruleParam1" style="width: 100px">
|
||||
<el-select
|
||||
v-model="item.ruleParam1"
|
||||
style="width: 100px"
|
||||
:disabled="index > 0"
|
||||
@change="planChanged('ruleParam1', false)"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in opts.percentage_param1"
|
||||
:key="Number(it.value)"
|
||||
:key="it.value"
|
||||
:label="it.label"
|
||||
:value="Number(it.value)"
|
||||
:value="it.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select class="ml-5px" v-model="item.ruleParam2" style="width: 100px">
|
||||
<el-select
|
||||
class="ml-5px"
|
||||
v-model="item.ruleParam2"
|
||||
style="width: 100px"
|
||||
:disabled="index > 0"
|
||||
@change="planChanged('ruleParam2', false)"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in opts.percentage_param2"
|
||||
:key="Number(it.value)"
|
||||
:key="it.value"
|
||||
:label="it.label"
|
||||
:value="Number(it.value)"
|
||||
:value="it.value"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="ml-5px">满</span>
|
||||
@@ -67,9 +92,9 @@
|
||||
<el-select class="ml-5px" v-model="item.ruleParam4" style="width: 120px">
|
||||
<el-option
|
||||
v-for="it in opts.percentage_param4"
|
||||
:key="Number(it.value)"
|
||||
:key="it.value"
|
||||
:label="it.label"
|
||||
:value="Number(it.value)"
|
||||
:value="it.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div v-if="item.ruleParam4 == 2" class="inline-flex items-center">
|
||||
@@ -85,12 +110,18 @@
|
||||
</div>
|
||||
<div v-else class="inline-flex items-center">
|
||||
<span class="ml-5px">取</span>
|
||||
<el-select class="ml-5px" v-model="item.ruleParam5" style="width: 100px">
|
||||
<el-select
|
||||
class="ml-5px"
|
||||
v-model="item.ruleParam5"
|
||||
style="width: 100px"
|
||||
:disabled="formData.percentageType == 1"
|
||||
@change="planChanged('ruleParam5')"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in opts.percentage_param5"
|
||||
:key="Number(it.value)"
|
||||
:key="it.value"
|
||||
:label="it.label"
|
||||
:value="Number(it.value)"
|
||||
:value="it.value"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="ml-5px">结算</span>
|
||||
@@ -105,6 +136,102 @@
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</div>
|
||||
<Icon
|
||||
v-if="index > 0"
|
||||
icon="ep:remove-filled"
|
||||
class="text-red-500 ml-20px"
|
||||
@click="handleRemove(index)"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider direction="horizontal" />
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="转化提成比例" labelWidth="150px">
|
||||
<el-input v-model="formData.convertPercentageRate" placeholder="比例" clearable>
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="接待提成比例" labelWidth="150px">
|
||||
<el-input v-model="formData.receptionPercentageRate" placeholder="比例" clearable>
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="包含区域提成" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isAreaPercentage">
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否关联成交率" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isRelateSignRate">
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否扣除其他支出" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isDeductExtraPay">
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否扣除售后" labelWidth="150px">
|
||||
<el-radio-group v-model="formData.isDeductAfterSale">
|
||||
<el-radio :value="true"> 是 </el-radio>
|
||||
<el-radio :value="false"> 否 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="关联规则" label-width="150px" v-if="formData.isRelateSignRate">
|
||||
<div>
|
||||
<el-button @click="formData.rateRules.push({})"> 新增规则 </el-button>
|
||||
<div
|
||||
v-for="(item, index) in formData.rateRules"
|
||||
:key="index"
|
||||
class="mt-10px flex justify-center items-center"
|
||||
>
|
||||
<span>成交率达</span>
|
||||
<el-input
|
||||
class="ml-10px"
|
||||
v-model="item.signRate"
|
||||
placeholder="成交率"
|
||||
style="width: 100px"
|
||||
type="number"
|
||||
:min="0"
|
||||
>
|
||||
<template #suffix>%</template>
|
||||
</el-input>
|
||||
<span>,可结算</span>
|
||||
<el-input
|
||||
class="ml-10px"
|
||||
v-model="item.percentageRate"
|
||||
placeholder="提成率"
|
||||
style="width: 100px"
|
||||
type="number"
|
||||
:min="0"
|
||||
>
|
||||
<template #suffix>%</template>
|
||||
</el-input>
|
||||
<span>提成</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@@ -118,16 +245,18 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogSalarySetting">
|
||||
<script setup name="DialogCommissionPlan">
|
||||
import * as PlanApi from '@/api/finance/plan'
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('工资条设置')
|
||||
const dialogTitle = ref('提成方案')
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
|
||||
const comissionForm = ref({})
|
||||
const formData = ref({})
|
||||
const rules = {
|
||||
name: { required: true, message: '方案名称不可为空', trigger: 'blur' }
|
||||
percentageName: { required: true, message: '方案名称不可为空', trigger: 'blur' }
|
||||
}
|
||||
const opts = ref({
|
||||
percentage_param1: [],
|
||||
@@ -145,16 +274,16 @@ const open = async (type, row) => {
|
||||
resetForm()
|
||||
|
||||
if (!opts.value.length) {
|
||||
// const arr = await ClassApi.getCommissionParams()
|
||||
// arr.map((item) => {
|
||||
// opts.value[item.dictType].push(item)
|
||||
// })
|
||||
const arr = await PlanApi.getCommissionParams()
|
||||
arr.map((item) => {
|
||||
opts.value[item.dictType].push(item)
|
||||
})
|
||||
}
|
||||
|
||||
if (row?.id) {
|
||||
if (row?.percentageId) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
// comissionForm.value = await UserApi.getUser(id)
|
||||
formData.value = await PlanApi.getPlanDetail(row.percentageId)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -164,32 +293,38 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
comissionForm.value = {
|
||||
name: undefined,
|
||||
percentageType: 1,
|
||||
opts.value = {
|
||||
percentage_param1: [],
|
||||
percentage_param2: [],
|
||||
percentage_param4: [],
|
||||
percentage_param5: []
|
||||
}
|
||||
formData.value = {
|
||||
percentageName: undefined,
|
||||
percentageType: 2,
|
||||
rules: [
|
||||
{
|
||||
ruleParam1: 1,
|
||||
ruleParam2: 1,
|
||||
ruleParam1: '2',
|
||||
ruleParam2: '1',
|
||||
ruleParam3: 0,
|
||||
ruleParam4: 1,
|
||||
ruleParam5: 1,
|
||||
ruleParam4: '1',
|
||||
ruleParam5: '1',
|
||||
ruleParam6: 10
|
||||
}
|
||||
]
|
||||
],
|
||||
isRelateSignRate: false,
|
||||
rateRules: [],
|
||||
isDeductExtraPay: true,
|
||||
isDeductAfterSale: true,
|
||||
receptionPercentageRate: undefined,
|
||||
isAreaPercentage: false,
|
||||
convertPercentageRate: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
function handleAddRules() {
|
||||
comissionForm.value.rules.push({
|
||||
ruleParam1: 1,
|
||||
ruleParam2: 1,
|
||||
ruleParam3: 0,
|
||||
ruleParam4: 1,
|
||||
ruleParam5: 1,
|
||||
ruleParam6: 1
|
||||
})
|
||||
formData.value.rules.push({ ...formData.value.rules[0] })
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
@@ -202,11 +337,12 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = { ...formData.value }
|
||||
if (formType.value === 'create') {
|
||||
// await ClassApi.createClassType(data)
|
||||
await PlanApi.createPlan(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
// await ClassApi.updateClassType(data)
|
||||
await PlanApi.updatePlan(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
@@ -216,6 +352,28 @@ const submitForm = async () => {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleRemove(index) {
|
||||
formData.value.rules.splice(index, 1)
|
||||
}
|
||||
|
||||
function planChanged(paramName, editble = true) {
|
||||
const defaultRule = formData.value.rules[0]
|
||||
formData.value.rules.forEach((it, index) => {
|
||||
if (formData.value.percentageType == 2) {
|
||||
if (!editble) {
|
||||
it[paramName] = defaultRule[paramName]
|
||||
}
|
||||
} else {
|
||||
if (index > 0) {
|
||||
it[paramName] = defaultRule[paramName]
|
||||
}
|
||||
if (paramName == 'ruleParam2') {
|
||||
it['ruleParam5'] = defaultRule[paramName]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,23 +1,40 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form :model="searchForm" inline @submit.prevent>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="方案名称" />
|
||||
<el-input
|
||||
v-model="searchForm.percentageName"
|
||||
placeholder="方案名称"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.status" placeholder="启用状态" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.status"
|
||||
placeholder="启用状态"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option label="启用" :value="0" />
|
||||
<el-option label="停用" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">搜索</el-button>
|
||||
<el-button type="primary" plain @click="openForm('create')"> 新增 </el-button>
|
||||
<el-button @click="handleQuery" v-hasPermi="['finance:commission:search']">搜索</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['finance:commission:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="方案名称" prop="name" width="240" />
|
||||
<el-table-column label="方案名称" prop="percentageName" width="240" />
|
||||
<el-table-column label="结算方式" prop="percentageType" width="150" />
|
||||
<el-table-column label="结算规则">
|
||||
<template #default="{ row }">
|
||||
@@ -30,14 +47,29 @@
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
v-hasPermi="['finance:commission:update']"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="openForm('update', scope.row)"> 修改 </el-button>
|
||||
<el-button type="primary" link @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="openForm('update', scope.row)"
|
||||
v-hasPermi="['finance:commission:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDelete(scope.row.percentageId)"
|
||||
v-hasPermi="['finance:commission:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -54,13 +86,23 @@
|
||||
|
||||
<script name="CommissionPlan" setup>
|
||||
import DialogPlan from './Comp/DialogPlan.vue'
|
||||
import * as PlanApi from '@/api/finance/plan'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
percentageName: undefined,
|
||||
status: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
searchForm.value.pageNo = 1
|
||||
@@ -74,10 +116,9 @@ const total = ref(0)
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
tableList.value = [{ status: 0 }]
|
||||
// const data = await UserApi.getUserPage(queryParams)
|
||||
// tableList.value = data.list
|
||||
// total.value = data.total
|
||||
const data = await PlanApi.getPlanPage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -92,9 +133,9 @@ const handleStatusChange = async (row) => {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
const text = row.status === 0 ? '启用' : '停用'
|
||||
await message.confirm('确认要"' + text + '""' + row.name + '"方案吗?')
|
||||
await message.confirm('确认要"' + text + '""' + row.percentageName + '"方案吗?')
|
||||
// 发起修改状态
|
||||
// await UserApi.updateUserStatus(row.id, row.status)
|
||||
await PlanApi.updatePlanStatus({ percentageId: row.percentageId, status: row.status })
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {
|
||||
@@ -102,6 +143,19 @@ const handleStatusChange = async (row) => {
|
||||
row.status = row.status === 0 ? 1 : 0
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await PlanApi.deletePlan(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" style="width: 600px">
|
||||
<el-form :model="formData" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="生效日期" prop="validTime">
|
||||
<el-form-item label="生效日期" prop="startDate">
|
||||
<el-date-picker
|
||||
v-model="formData.validTime"
|
||||
v-model="formData.startDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
@@ -13,69 +13,87 @@
|
||||
<el-divider direction="horizontal" content-position="left">应发</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="底薪" prop="dixin">
|
||||
<el-input-number v-model="formData.dixin" :min="0" :controls="false" />
|
||||
<el-form-item label="基本工资" prop="baseSalary">
|
||||
<el-input-number v-model="formData.baseSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="奖金" prop="jiangjin">
|
||||
<el-input-number v-model="formData.jiangjin" :min="0" :controls="false" />
|
||||
<el-form-item label="绩效(%)">
|
||||
<el-input-number v-model="formData.meritsRate" :min="0" :max="100" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="提成方案" prop="tichengfangan">
|
||||
<el-select v-model="formData.tichengfangan" placeholder="请选择" filterable>
|
||||
<el-form-item label="提成方案" prop="planId">
|
||||
<el-select v-model="formData.planId" placeholder="请选择" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in tichengfanganOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in planOptions"
|
||||
:key="item.percentageId"
|
||||
:label="item.percentageName"
|
||||
:disabled="item.status == 1"
|
||||
:value="item.percentageId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应发" prop="qitayingfa">
|
||||
<el-input-number v-model="formData.qitayingfa" :min="0" :controls="false" />
|
||||
<el-form-item label="补贴" prop="allowanceSalary">
|
||||
<el-input-number v-model="formData.allowanceSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="满勤" prop="fullWorkSalary">
|
||||
<el-input-number v-model="formData.fullWorkSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="奖金" prop="rewardSalary">
|
||||
<el-input-number v-model="formData.rewardSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应发" prop="extraSalary">
|
||||
<el-input-number v-model="formData.extraSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider direction="horizontal" content-position="left">应扣</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="绩效" prop="jixiao">
|
||||
<!-- <el-col :span="12" :offset="0">
|
||||
<el-form-item label="绩效">
|
||||
<el-input placeholder="生成后录入" disabled />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="社保" prop="socialDeduct">
|
||||
<el-input-number v-model="formData.socialDeduct" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="考勤" prop="kaoqin">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
<el-form-item label="公积金" prop="accumulationFundDeduct">
|
||||
<el-input-number v-model="formData.accumulationFundDeduct" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="社保" prop="shebao">
|
||||
<el-input-number v-model="formData.shebao" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="公积金" prop="gongjijin">
|
||||
<el-input-number v-model="formData.gongjijin" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="税额" prop="shuie">
|
||||
<el-form-item label="税额">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应扣" prop="qitayingkou">
|
||||
<el-input-number v-model="formData.qitayingkou" :min="0" :controls="false" />
|
||||
<el-form-item label="考勤">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应扣" prop="extraDeduct">
|
||||
<el-input-number v-model="formData.extraDeduct" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -91,7 +109,10 @@
|
||||
</template>
|
||||
|
||||
<script setup name="DialogSalarySetting">
|
||||
// const message = useMessage() // 消息弹窗
|
||||
import * as SalaryApi from '@/api/finance/salary'
|
||||
import { getPlanSimpleList } from '@/api/finance/plan'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('工资条设置')
|
||||
@@ -100,42 +121,51 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||
const formData = ref({})
|
||||
|
||||
const rules = {
|
||||
dixin: { required: true, message: '底薪不可为空', trigger: 'blur' }
|
||||
startDate: { required: true, message: '生效日期不可为空', trigger: 'blur, change' },
|
||||
baseSalary: { required: true, message: '基本工资不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = `工资条设置-【${row.nickname}】`
|
||||
resetForm()
|
||||
dialogTitle.value = `工资条设置-【${row.name}】`
|
||||
getOptions()
|
||||
formLoading.value = true
|
||||
try {
|
||||
// formData.value = await UserApi.getUser(id)
|
||||
const data = await SalaryApi.getSalaryDetail(row.id)
|
||||
if (!data) {
|
||||
resetForm(row.id)
|
||||
} else {
|
||||
formData.value = { ...data }
|
||||
}
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const tichengfanganOptions = ref([])
|
||||
const planOptions = ref([])
|
||||
function getOptions() {
|
||||
tichengfanganOptions.value = []
|
||||
getPlanSimpleList().then((data) => {
|
||||
planOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
const resetForm = (id) => {
|
||||
formData.value = {
|
||||
dixin: 0,
|
||||
tichengfangan: undefined,
|
||||
jiangjin: 0,
|
||||
qitayingfa: 0,
|
||||
jixiao: 0,
|
||||
kaoqin: 0,
|
||||
shebao: 0,
|
||||
gongjijin: 0,
|
||||
shuie: 0,
|
||||
qitayingkou: 0
|
||||
employeeId: id,
|
||||
baseSalary: 0,
|
||||
planId: undefined,
|
||||
rewardSalary: 0,
|
||||
allowanceSalary: 0,
|
||||
fullWorkSalary: 0,
|
||||
extraSalary: 0,
|
||||
socialDeduct: 0,
|
||||
accumulationFundDeduct: 0,
|
||||
meritsSalary: 0,
|
||||
extraDeduct: 0,
|
||||
meritsRate: 0
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
@@ -150,13 +180,8 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
// const data = formData.value as unknown as UserApi.UserVO
|
||||
// if (formType.value === 'create') {
|
||||
// await UserApi.createUser(data)
|
||||
// message.success(t('common.createSuccess'))
|
||||
// } else {
|
||||
// await UserApi.updateUser(data)
|
||||
// }
|
||||
const data = { ...formData.value }
|
||||
await SalaryApi.updateSalary(data)
|
||||
message.success('配置成功')
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
|
||||
@@ -1,29 +1,45 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form :model="searchForm" inline @submit.prevent>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="请输入员工姓名" />
|
||||
<el-input
|
||||
v-model="searchForm.name"
|
||||
placeholder="请输入员工姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.status">
|
||||
<el-radio :label="0"> 在职 </el-radio>
|
||||
<el-radio :label="1"> 离职 </el-radio>
|
||||
<el-radio-group v-model="searchForm.status" @change="handleQuery">
|
||||
<el-radio :value="0"> 在职 </el-radio>
|
||||
<el-radio :value="1"> 离职 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="handleQuery" v-hasPermi="['finance:salary:search']">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="用户姓名" prop="nickname" />
|
||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||
<el-table-column label="在职状态" prop="status" />
|
||||
<el-table-column label="员工姓名" prop="name" />
|
||||
<el-table-column label="职位" prop="post" />
|
||||
<el-table-column label="手机号码" prop="mobile" />
|
||||
<el-table-column label="在职状态">
|
||||
<template #default="{ row }">
|
||||
{{ ['在职', '离职'][row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="openForm(scope.row)"> 工资条设置 </el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="openForm(scope.row)"
|
||||
v-hasPermi="['finance:salary:set']"
|
||||
>
|
||||
工资条设置
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -39,6 +55,10 @@
|
||||
|
||||
<script name="EmployeeList" setup>
|
||||
import DialogSalary from './Comp/DialogSalary.vue'
|
||||
// import * as SalaryApi from '@/api/finance/salary'
|
||||
import { getEmployeePage } from '@/api/pers/employee'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
status: 0,
|
||||
@@ -46,6 +66,10 @@ const searchForm = ref({
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
searchForm.value.pageNo = 1
|
||||
@@ -59,10 +83,9 @@ const total = ref(0)
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
tableList.value = [1, 2]
|
||||
// const data = await UserApi.getUserPage(queryParams)
|
||||
// tableList.value = data.list
|
||||
// total.value = data.total
|
||||
const data = await getEmployeePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||