Compare commits
125 Commits
dev-report
...
c4df756715
| Author | SHA1 | Date | |
|---|---|---|---|
| c4df756715 | |||
|
|
cb2deeb142 | ||
|
|
831c343448 | ||
|
|
c0be75b6fd | ||
|
|
9b323b68f9 | ||
|
|
6ebe33e48c | ||
|
|
c34623287c | ||
| 2e19a4c6f6 | |||
|
|
240224823e | ||
|
|
e3ccfd9721 | ||
|
|
461d36dc5d | ||
|
|
65af79e9a1 | ||
|
|
07850f1233 | ||
|
|
7e54b14103 | ||
|
|
2add57162e | ||
|
|
be9a9d77be | ||
|
|
8f4da16e81 | ||
|
|
b4a5c36fb0 | ||
|
|
cd3a39fa47 | ||
|
|
126853ad45 | ||
| d74161b8ce | |||
|
|
4735da7362 | ||
|
|
4b030babe2 | ||
|
|
3aaa26fdc2 | ||
|
|
78cd9f04bc | ||
|
|
dc3292982a | ||
| e8ec9bdc47 | |||
|
|
6726bd7756 | ||
|
|
a8bf678f2e | ||
|
|
3ec039050f | ||
|
|
6baa78a94f | ||
|
|
770d700ba1 | ||
|
|
039ab28c15 | ||
|
|
f75140e135 | ||
|
|
467e1eceb7 | ||
|
|
47bac0315f | ||
|
|
ce0da69b5f | ||
|
|
0d99fbac80 | ||
|
|
06681658fc | ||
| 6a07c0c711 | |||
|
|
3abe367954 | ||
| b3435a9a86 | |||
|
|
2eac9d0fc9 | ||
|
|
f7924d7cb1 | ||
|
|
6ac19b825e | ||
| 6d83198a9f | |||
|
|
e10fedb4dc | ||
|
|
f70cdfb074 | ||
| 29ee948cbb | |||
|
|
ac70a128c1 | ||
| f044dbbe7b | |||
|
|
21ff3718bd | ||
| 1c0f0651d8 | |||
|
|
1778ea9fb4 | ||
| b052af5507 | |||
|
|
e4ae5e275f | ||
| f7e81fad0e | |||
|
|
df3a4b9f46 | ||
|
|
fc22c16cb1 | ||
| c6b6602181 | |||
|
|
9b7543f65f | ||
| f2cea1585d | |||
|
|
1d1f1762f8 | ||
| 32bda88a41 | |||
|
|
ffc7691b47 | ||
|
|
c01fea9c5b | ||
|
|
beb12193b3 | ||
|
|
b09ba1547c | ||
|
|
72341a96a5 | ||
| 6d866b7e7c | |||
|
|
9cdfa01d33 | ||
|
|
af84640a4b | ||
|
|
15179707d9 | ||
|
|
fe4270178f | ||
| bbecf28819 | |||
|
|
cd22e26589 | ||
| 5740ca00d1 | |||
| 206315c642 | |||
|
|
b475af8dd3 | ||
|
|
3022106428 | ||
|
|
d4641eacb5 | ||
|
|
d3b4a360dd | ||
| b9a3424d98 | |||
|
|
91a509d49d | ||
|
|
7e771a89e4 | ||
|
|
24e540f151 | ||
| 16cb210988 | |||
|
|
0ef7703f7d | ||
| bc3c4f2ebc | |||
|
|
fa39fd8492 | ||
|
|
b8bc124162 | ||
|
|
e1036fd2c3 | ||
|
|
014bb14170 | ||
| 6ba54c8bcd | |||
|
|
eaaceb9595 | ||
| acccadd43a | |||
|
|
1ab365efae | ||
| 0f04d7e80c | |||
| 02af7babc4 | |||
| 505139cfe2 | |||
| 6246d46d53 | |||
| 98a5d374a4 | |||
| dd049320f6 | |||
| 696e96a0c0 | |||
| ee770b9e60 | |||
| 6908183a36 | |||
| af9bcb7024 | |||
| 5c6c3df4d0 | |||
| acdcc670de | |||
| 9472c5ea56 | |||
| 4f150b0912 | |||
| f76d6dce66 | |||
| dd4bdb0786 | |||
| 477a279867 | |||
| c87637cc78 | |||
| a544840679 | |||
| 247c6ed4a0 | |||
| 769c901954 | |||
| 18bfc7d353 | |||
| fb6b341242 | |||
| fea69da8ed | |||
| 125f6f28ad | |||
| 39cddaa8e0 | |||
| ffd15e2433 | |||
| 2bebd0480e |
18
.env.base
18
.env.base
@@ -4,11 +4,23 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
# VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
#VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
|
||||
# 高德地图key密钥
|
||||
# 1寻驾
|
||||
VITE_AMAP_KEY=ec6b7ebe38f7ff27126f7088d87a9091
|
||||
# 2莳松
|
||||
# VITE_AMAP_KEY=9233a9d4ffe95fb335e70834503460fa
|
||||
|
||||
# 小程序接口请求路劲
|
||||
VITE_APPLET_URL='https://cloud.ahduima.com'
|
||||
# 题库路径
|
||||
VITE_TIKU_URL = 'http://47.98.161.246'
|
||||
|
||||
# 上传路径
|
||||
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
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=/crm-api
|
||||
|
||||
@@ -4,10 +4,11 @@ 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_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=/crm-api
|
||||
|
||||
5
.env.pro
5
.env.pro
@@ -5,6 +5,11 @@ VITE_DEV=false
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='/crm-api'
|
||||
# 高德地图key密钥
|
||||
# 1寻驾
|
||||
VITE_AMAP_KEY=ec6b7ebe38f7ff27126f7088d87a9091
|
||||
# 2莳松
|
||||
# VITE_AMAP_KEY=9233a9d4ffe95fb335e70834503460fa
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='/crm-api/admin-api/system/file/upload'
|
||||
|
||||
@@ -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=/crm-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=/crm-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=/crm-api
|
||||
|
||||
15
.vscode/extensions.json
vendored
15
.vscode/extensions.json
vendored
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"voorjaar.windicss-intellisense",
|
||||
"vscode-icons-team.vscode-icons",
|
||||
"davidanson.vscode-markdownlint",
|
||||
"stylelint.vscode-stylelint",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"vue.volar",
|
||||
"lokalise.i18n-ally",
|
||||
"mikestead.dotenv",
|
||||
"eamodio.gitlens",
|
||||
"antfu.iconify"
|
||||
]
|
||||
}
|
||||
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@@ -1,16 +0,0 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "msedge",
|
||||
"request": "launch",
|
||||
"name": "Launch Edge against localhost",
|
||||
"url": "http://localhost",
|
||||
"webRoot": "${workspaceFolder}/src",
|
||||
"sourceMaps": true
|
||||
}
|
||||
]
|
||||
}
|
||||
54
.vscode/settings.json
vendored
54
.vscode/settings.json
vendored
@@ -1,54 +0,0 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"prettier.enable": true,
|
||||
"editor.formatOnType": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[scss]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"i18n-ally.localesPaths": ["src/locales"],
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"i18n-ally.sortKeys": true,
|
||||
"i18n-ally.namespace": true,
|
||||
"i18n-ally.enabledParsers": ["ts"],
|
||||
"i18n-ally.sourceLanguage": "en",
|
||||
"i18n-ally.displayLanguage": "zh-CN",
|
||||
"i18n-ally.enabledFrameworks": ["vue", "react"],
|
||||
"god.tsconfig": "./tsconfig.json",
|
||||
"vue-i18n.i18nPaths": "src/locales",
|
||||
"explorer.fileNesting.enabled": true,
|
||||
"explorer.fileNesting.expand": false,
|
||||
"explorer.fileNesting.patterns": {
|
||||
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
|
||||
"*.tsx": "$(capture).test.ts, $(capture).test.tsx",
|
||||
"*.env": "$(capture).env.*",
|
||||
"CHANGELOG.md": "CHANGELOG*",
|
||||
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc,vite.config.*,windi.*,tailwind.*,tsconfig.*,postcss*",
|
||||
".eslintrc.js": ".eslintignore,.eslintrc-*,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelint*,stylelint*,prettier.*,.editorconfig"
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,9 @@
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
<script type="text/javascript">
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
||||
// securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
||||
securityJsCode: '420463f2f8c849ab78b9d29548aff7d3' // 寻驾密钥
|
||||
// securityJsCode: 'ab6bcce5d153c4e5353b40e5b0ce6fee' // 莳松密钥
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"@vueuse/core": "^10.1.2",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.10",
|
||||
"@wangeditor/plugin-upload-attachment": "^1.1.0",
|
||||
"@zxcvbn-ts/core": "^3.0.1",
|
||||
"animate.css": "^4.1.1",
|
||||
"axios": "^1.4.0",
|
||||
@@ -51,7 +52,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",
|
||||
@@ -69,9 +70,11 @@
|
||||
"vue": "3.3.4",
|
||||
"vue-amap": "^0.5.10",
|
||||
"vue-dompurify-html": "^5.0.1",
|
||||
"vue-draggable-plus": "^0.6.0",
|
||||
"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",
|
||||
|
||||
@@ -5,7 +5,7 @@ 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 })
|
||||
}
|
||||
@@ -45,3 +45,8 @@ export const updateApplyPayment = async (data) => {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
export const exportPayment = async (params) => {
|
||||
return await request.download({ url: '/admin-api/crm/sign-pay-record/export-excel', params })
|
||||
}
|
||||
|
||||
@@ -51,3 +51,13 @@ export const updateProduceSort = (data) => {
|
||||
export const getSignProfit = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/sign/profit', params })
|
||||
}
|
||||
|
||||
// 新增产品
|
||||
export const addOrderProduct = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/sign-prodcut/create', data })
|
||||
}
|
||||
|
||||
// 新增产品
|
||||
export const removeOrderProduct = (id) => {
|
||||
return request.delete({ url: '/admin-api/crm/sign-prodcut/delete?id=' + id })
|
||||
}
|
||||
|
||||
8
src/api/home/reportSaler.js
Normal file
8
src/api/home/reportSaler.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import request from '@/config/axios'
|
||||
export const getInfo = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-clue/sale/report/detail', data })
|
||||
}
|
||||
|
||||
export const getList = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-clue/sale/report', data })
|
||||
}
|
||||
42
src/api/kpi/index.js
Normal file
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
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 })
|
||||
}
|
||||
38
src/api/okr/comment.js
Normal file
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 }
|
||||
})
|
||||
}
|
||||
61
src/api/okr/meeting.js
Normal file
61
src/api/okr/meeting.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const createMeeting = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/okr/meeting/add',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateMeeting = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/meeting/update',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
// 查询详情
|
||||
export const getMeetingDetail = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/meeting/get',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 取消会议
|
||||
export const cancelMeeting = (data) => {
|
||||
return request.put({
|
||||
url: '/admin-api/okr/meeting/cancel',
|
||||
data
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 分页查询
|
||||
export const getMeetingPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/meeting/page',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新微信群列表
|
||||
export const refreshWxGroupList = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/system/wx/reFreshWeChatGroupList'
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取微信群聊列表
|
||||
export const getWxGroupList = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/system/wx/getWeChatGroupList'
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
154
src/api/okr/okr.js
Normal file
154
src/api/okr/okr.js
Normal file
@@ -0,0 +1,154 @@
|
||||
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 = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/get',
|
||||
params
|
||||
// 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 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取我的组员
|
||||
export const getMyMemberList = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/my-members',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取我的组员节点树
|
||||
export const getMySonNodeTree = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/member/node/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取我的组员OKR列表
|
||||
export const getMySonOkrPage = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/member/objective/list',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取渠道
|
||||
export const getChannelOptions = () => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/source'
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取统计表中的合计信息
|
||||
export const getOkrStatisticsTotal = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/okr/node/data/count',
|
||||
params
|
||||
// headers: { 'instance-id': 1016 }
|
||||
})
|
||||
}
|
||||
83
src/api/okr/wait.js
Normal file
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
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
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 })
|
||||
}
|
||||
33
src/api/school/setting/supplier.js
Normal file
33
src/api/school/setting/supplier.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import request from '@/config/axios'
|
||||
// 查询列表
|
||||
export const getSupplierPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-supplier/page', params })
|
||||
}
|
||||
|
||||
export const getSupplierSimpleList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-supplier/simple-list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getSupplier = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/erp-supplier/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createSupplier = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-supplier/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
export const updateSupplier = async (params) => {
|
||||
return await request.put({ url: '/admin-api/crm/erp-supplier/update', data: params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
export const deleteSupplier = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/erp-supplier/delete?id=' + id })
|
||||
}
|
||||
@@ -12,9 +12,11 @@ export interface UserVO {
|
||||
avatar: string
|
||||
loginIp: string
|
||||
status: number
|
||||
hireStatus: number
|
||||
remark: string
|
||||
loginDate: Date
|
||||
createTime: Date
|
||||
retireDate: string
|
||||
}
|
||||
|
||||
// 查询用户管理列表
|
||||
@@ -62,10 +64,17 @@ export const resetUserPwd = (id: number, password: string) => {
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export const updateUserStatus = (id: number, status: number) => {
|
||||
export const updateUserStatus = (
|
||||
id: number,
|
||||
status: number,
|
||||
retireDate: string,
|
||||
hireStatus: number
|
||||
) => {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
status,
|
||||
retireDate,
|
||||
hireStatus
|
||||
}
|
||||
return request.put({ url: '/admin-api/system/user/update-status', data: data })
|
||||
}
|
||||
@@ -84,3 +93,8 @@ export const getAllUserList = (): Promise<UserVO[]> => {
|
||||
export const getAllUserListWithHire = (): Promise<UserVO[]> => {
|
||||
return request.get({ url: '/admin-api/system/user/no/permission/list-all' })
|
||||
}
|
||||
|
||||
// 获取钉钉id
|
||||
export const getDDIdByPhone = (params) => {
|
||||
return request.get({ url: '/admin-api/system/user/getDingTalkUserIdByMobile', params })
|
||||
}
|
||||
|
||||
23
src/api/system/wechat/index.js
Normal file
23
src/api/system/wechat/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 更新
|
||||
export const updateWechatConfig = (data) => {
|
||||
return request.post({ url: '/admin-api/system/wx-robot-message-setting/save', data })
|
||||
}
|
||||
|
||||
// 更新发送时间
|
||||
export const updateWechatSendTime = (data) => {
|
||||
return request.put({ url: '/admin-api/system/wx-robot-message-setting/update-send-time', data })
|
||||
}
|
||||
// 更新微信群
|
||||
export const updateWechatGroup = (data) => {
|
||||
return request.put({ url: '/admin-api/system/wx-robot-message-setting/update-wx-group', data })
|
||||
}
|
||||
|
||||
// 获得列表
|
||||
export const getWechatConfigList = (params) => {
|
||||
return request.get({
|
||||
url: '/admin-api/system/wx-robot-message-setting/list',
|
||||
params
|
||||
})
|
||||
}
|
||||
48
src/api/xjapplet/discount.js
Normal file
48
src/api/xjapplet/discount.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getVipDiscountList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/discount/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addVipDiscount = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/discount/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateVipDiscount = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/discount/update',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteVipDiscount = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/member/discount/delete?discountId=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getVipDiscountOptions = async () => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/discount/simple-list'
|
||||
})
|
||||
}
|
||||
|
||||
export const getUserDiscountList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/user/discount/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const giveUserDiscount = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/user/discount/send',
|
||||
data
|
||||
})
|
||||
}
|
||||
39
src/api/xjapplet/resell.js
Normal file
39
src/api/xjapplet/resell.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getResellList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addResell = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/distribution/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateResell = async (data) => {
|
||||
return await request.put({
|
||||
url: '/admin-api/applet/xunjia/distribution/update',
|
||||
data
|
||||
})
|
||||
}
|
||||
export const deleteResell = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/distribution/delete?distributionId=' + id
|
||||
})
|
||||
}
|
||||
export const getResellDetail = async (id) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getResellSimpleList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/simple-list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
56
src/api/xjapplet/vip.js
Normal file
56
src/api/xjapplet/vip.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const getUserMemberList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/user/member/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const giveUserMember = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/user/member/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const getVipTypeList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addVipType = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/add',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateVipType = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/member/update',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteVipType = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/member/delete?memberId=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getVipTypeOptions = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/member/simple-list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const getRechargeRecords = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/pay/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
67
src/api/xjapplet/vipdatabase.js
Normal file
67
src/api/xjapplet/vipdatabase.js
Normal file
@@ -0,0 +1,67 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const addJx = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/question/jx/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getJxQuestionList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/question/jx/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const delJxData = async (id) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/question/jx/delete?id=${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export const addMj = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/secret/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getMjList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/secret/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const delMj = async (secretId) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/delete?secretId=${secretId}`
|
||||
})
|
||||
}
|
||||
|
||||
export const clearMj = async (secretId) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/clear?secretId=${secretId}`
|
||||
})
|
||||
}
|
||||
|
||||
export const getMjQuestionList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/secret/question/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const addMjQuestion = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/secret/question/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const delMjQuestion = async (id) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/question/delete?id=${id}`
|
||||
})
|
||||
}
|
||||
48
src/api/xjapplet/xjdatabase.js
Normal file
48
src/api/xjapplet/xjdatabase.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
export const searchQuestion = async (param) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/question/list',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
export const updateQuestion = async (data) => {
|
||||
return await request.put({
|
||||
url: '/admin-api/applet/xunjia/question/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const addQuestion = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/question/add',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteQuestion = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/question/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const uploadFile = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/applet/xunjia/question/upload',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getQuestionSort = async (param) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/question/sort/list',
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
export const getMjList = async (params) => {
|
||||
return await request.get({
|
||||
url: 'http://localhost/tiku-api/tiku/xunjia/secret/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
BIN
src/assets/imgs/login2.gif
Normal file
BIN
src/assets/imgs/login2.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 309 KiB |
BIN
src/assets/imgs/shisong.jpg
Normal file
BIN
src/assets/imgs/shisong.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
@@ -21,10 +21,34 @@ const props = defineProps({
|
||||
height: propTypes.oneOfType([Number, String]).def('40vh'),
|
||||
editorConfig: {
|
||||
type: Object as PropType<Partial<IEditorConfig>>,
|
||||
default: () => undefined
|
||||
default: () => ({})
|
||||
},
|
||||
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'
|
||||
],
|
||||
insertKeys: {
|
||||
index: 20, // 自定义插入的位置
|
||||
keys: ['uploadAttachment'] // “上传附件”菜单
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change', 'update:modelValue'])
|
||||
@@ -84,6 +108,12 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
},
|
||||
autoFocus: false,
|
||||
scroll: true,
|
||||
// 在编辑器中,点击选中“附件”节点时,要弹出的菜单
|
||||
hoverbarKeys: {
|
||||
attachment: {
|
||||
menuKeys: ['downloadAttachment'] // “下载附件”菜单
|
||||
}
|
||||
},
|
||||
MENU_CONF: {
|
||||
['uploadImage']: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
@@ -198,6 +228,52 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
customInsert(res: any, insertFn: InsertFnType) {
|
||||
insertFn(res.data, 'video', res.data)
|
||||
}
|
||||
},
|
||||
uploadAttachment: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
timeout: 20 * 1000, // 2s
|
||||
|
||||
fieldName: 'file',
|
||||
// meta: { token: 'xxx', a: 100 }, // 请求时附加的数据
|
||||
// metaWithUrl: true, // meta 拼接到 url 上
|
||||
// headers: { Accept: 'text/x-json' },
|
||||
// 自定义增加 http header
|
||||
headers: {
|
||||
Accept: '*',
|
||||
Authorization: 'Bearer ' + getAccessToken(),
|
||||
'tenant-id': getTenantId(),
|
||||
'instance-id': getAppId()
|
||||
},
|
||||
|
||||
maxFileSize: 20 * 1024 * 1024, // 20M
|
||||
|
||||
onBeforeUpload(file: File) {
|
||||
console.log('onBeforeUpload', file)
|
||||
return file // 上传 file 文件
|
||||
// return false // 会阻止上传
|
||||
},
|
||||
onProgress(progress: number) {
|
||||
console.log('onProgress', progress)
|
||||
},
|
||||
onSuccess(file: File, res: any) {
|
||||
console.log('onSuccess', file, res)
|
||||
},
|
||||
onFailed(file: File, res: any) {
|
||||
alert(res.message)
|
||||
console.log('onFailed', file, res)
|
||||
},
|
||||
onError(file: File, err: Error, res: any) {
|
||||
alert(err.message)
|
||||
console.error('onError', file, err, res)
|
||||
},
|
||||
// 上传成功后,用户自定义插入文件
|
||||
customInsert(res: any, file: File, insertFn: Function) {
|
||||
console.log('customInsert', res)
|
||||
|
||||
// 插入附件到编辑器
|
||||
insertFn(file.name, res.data)
|
||||
// insertFn(res.data, `customInsert-${file.name}`, res.data)
|
||||
}
|
||||
}
|
||||
},
|
||||
uploadImgShowBase64: true
|
||||
@@ -212,24 +288,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)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
v-model:page-size="pageSize"
|
||||
:small="small"
|
||||
:background="true"
|
||||
:page-sizes="[10, 20, 30, 50, 100]"
|
||||
:page-sizes="[10, 50, 100, 500, 1000]"
|
||||
:pager-count="pagerCount"
|
||||
:total="total"
|
||||
class="float-right mt-15px mb-15px"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
@end="onDragEnd"
|
||||
>
|
||||
<template #item="{ element: item }">
|
||||
<el-checkbox :key="item.id" :label="item.id">
|
||||
<el-checkbox :key="item.id" :label="item.id" :value="item.id">
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</template>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
@import './process-designer.scss';
|
||||
@import './process-panel.scss';
|
||||
@import './process-panel.scss';
|
||||
@@ -132,6 +132,9 @@ service.interceptors.response.use(
|
||||
throw new Error()
|
||||
}
|
||||
const { t } = useI18n()
|
||||
// if (data.code === undefined) {
|
||||
// return response
|
||||
// }
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = data.code || result_code
|
||||
// 二进制数据则直接返回
|
||||
|
||||
@@ -266,7 +266,6 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
|
||||
// 过滤 descriptions 结构
|
||||
const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[] => {
|
||||
const descriptionsSchema: FormSchema[] = []
|
||||
|
||||
eachTree(crudSchema, (schemaItem: CrudSchema) => {
|
||||
// 判断是否显示
|
||||
if (schemaItem?.isDetail !== false && schemaItem.detail?.show !== false) {
|
||||
@@ -275,6 +274,10 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[
|
||||
field: schemaItem.field,
|
||||
label: schemaItem.detail?.label || schemaItem.label
|
||||
}
|
||||
if (schemaItem.form?.component == 'Editor') {
|
||||
descriptionsSchemaItem.span = 2
|
||||
descriptionsSchemaItem.isEditor = true
|
||||
}
|
||||
if (schemaItem.dictType) {
|
||||
descriptionsSchemaItem.dictType = schemaItem.dictType
|
||||
}
|
||||
|
||||
@@ -42,8 +42,13 @@ import '@/plugins/tongji' // 百度统计
|
||||
import Logger from '@/utils/Logger'
|
||||
import VueDOMPurifyHTML from 'vue-dompurify-html'
|
||||
|
||||
import { Boot } from '@wangeditor/editor'
|
||||
import attachmentModule from '@wangeditor/plugin-upload-attachment'
|
||||
|
||||
// 创建实例
|
||||
const setupAll = async () => {
|
||||
// 注册。要在创建编辑器之前注册,且只能注册一次,不可重复注册。
|
||||
Boot.registerModule(attachmentModule)
|
||||
const app = createApp(App)
|
||||
|
||||
await setupI18n(app)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import router from './router'
|
||||
import { isRelogin } from '@/config/axios/service'
|
||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { useTitle } from '@/hooks/web/useTitle'
|
||||
import { useNProgress } from '@/hooks/web/useNProgress'
|
||||
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||
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'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { getTenantId, getAppId, setTenantId, setAppId } from '@/utils/auth'
|
||||
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
@@ -29,58 +29,73 @@ const whiteList = [
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
start()
|
||||
loadStart()
|
||||
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 (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict && to.path != '/nm-detail') {
|
||||
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()
|
||||
}
|
||||
const userStore = useUserStoreWithOut()
|
||||
if (to.path == '/login') {
|
||||
userStore.resetState() // 重置用户信息状态
|
||||
}
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
if (to.query?.tenantId && to.query?.appId) {
|
||||
setApp(to.query.tenantId, to.query.appId)
|
||||
await waitTime(1500)
|
||||
}
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
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 {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
next()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
// next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
window.location.href = 'https://cloud.ahduima.com/ss/login'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
async function waitTime(seconds) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, seconds)
|
||||
})
|
||||
}
|
||||
|
||||
function setApp(tenantId, appId) {
|
||||
setTenantId(tenantId)
|
||||
|
||||
setAppId(appId)
|
||||
const appStore = useAppStoreWithOut()
|
||||
appStore.setAppInfo(appId)
|
||||
}
|
||||
|
||||
router.afterEach((to) => {
|
||||
useTitle(to?.meta?.title)
|
||||
done() // 结束Progress
|
||||
|
||||
@@ -51,7 +51,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: '/Home/index',
|
||||
name: '',
|
||||
@@ -59,6 +59,20 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
title: '首页',
|
||||
hidden: true
|
||||
}
|
||||
// ,children: [
|
||||
// {
|
||||
// path: '/index',
|
||||
// component: () => import('@/views/Basic/Menu/index.vue'),
|
||||
// name: 'Home',
|
||||
// meta: {
|
||||
// title: '首页',
|
||||
// icon: 'ep:home-filled',
|
||||
// noTagsView: true,
|
||||
// affix: true
|
||||
// // hidden: true
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
path: '/swagger',
|
||||
@@ -133,8 +147,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
// path: '/Basic',
|
||||
// component: Layout,
|
||||
// name: 'Basic',
|
||||
// meta: { title: '菜单管理' },
|
||||
// redirect: '/Basic/menu',
|
||||
// meta: { title: '菜单管理' },
|
||||
// children: [
|
||||
// {
|
||||
// path: 'menu',
|
||||
|
||||
87
src/router/modules/static.ts
Normal file
87
src/router/modules/static.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
const staticRouter: AppCustomRouteRecordRaw[] = [
|
||||
{
|
||||
icon: 'ep:calendar',
|
||||
path: '/Okr',
|
||||
component: '',
|
||||
name: 'OKR',
|
||||
componentName: '',
|
||||
redirect: '',
|
||||
parentId: 0,
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
children: [
|
||||
{
|
||||
icon: 'ep:finished',
|
||||
path: 'okr-management',
|
||||
name: 'OKR管理',
|
||||
componentName: 'OkrManagement',
|
||||
component: 'OKR/Management/index',
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
meta: {
|
||||
title: 'OKR管理'
|
||||
},
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:alarm-clock',
|
||||
path: 'okr-wait',
|
||||
name: '待办事项',
|
||||
componentName: 'OkrWait',
|
||||
component: 'OKR/Wait/index',
|
||||
meta: {
|
||||
title: '待办事项'
|
||||
},
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:data-line',
|
||||
path: 'okr-analysis',
|
||||
name: 'Okr统计',
|
||||
componentName: 'OkrAnalysis',
|
||||
component: 'OKR/Analysis/index',
|
||||
meta: {
|
||||
title: 'Okr统计'
|
||||
},
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:data-board',
|
||||
path: 'okr-meeting',
|
||||
name: '会议管理',
|
||||
componentName: 'OkrMeeting',
|
||||
component: 'OKR/Meeting/index',
|
||||
meta: {
|
||||
title: '会议管理'
|
||||
},
|
||||
visible: true,
|
||||
alwaysShow: true,
|
||||
redirect: ''
|
||||
},
|
||||
{
|
||||
icon: 'ep:data-board',
|
||||
path: 'okr-meeting-info/:id',
|
||||
name: '会议详情',
|
||||
componentName: 'MeetingInfo',
|
||||
component: 'OKR/Meeting/MeetingInfo',
|
||||
meta: {
|
||||
title: '会议详情'
|
||||
},
|
||||
visible: false,
|
||||
alwaysShow: true,
|
||||
redirect: '',
|
||||
keepAlive: true
|
||||
}
|
||||
],
|
||||
meta: {
|
||||
title: 'OKR',
|
||||
icon: 'ep:calendar'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default staticRouter
|
||||
@@ -45,7 +45,7 @@ export const useDictStore = defineStore('dict', {
|
||||
this.dictMap = dictMap
|
||||
this.isSetDict = true
|
||||
} else {
|
||||
const res = await listSimpleDictData()
|
||||
const res = (await listSimpleDictData()) || []
|
||||
// 设置数据
|
||||
const dictDataMap = new Map<string, any>()
|
||||
res.forEach((dictData: DictDataVO) => {
|
||||
@@ -75,7 +75,7 @@ export const useDictStore = defineStore('dict', {
|
||||
},
|
||||
async resetDict() {
|
||||
cache.session.delete(CACHE_KEY.DICT_CACHE)
|
||||
const res = await listSimpleDictData()
|
||||
const res = (await listSimpleDictData()) || []
|
||||
// 设置数据
|
||||
const dictDataMap = new Map<string, any>()
|
||||
res.forEach((dictData: DictDataVO) => {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import remainingRouter from '@/router/modules/remaining'
|
||||
import staticRouter from '@/router/modules/static'
|
||||
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
@@ -36,6 +37,25 @@ export const usePermissionStore = defineStore('permission', {
|
||||
if (cache.local.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||
res = cache.local.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||
}
|
||||
const staticRouters = cloneDeep(staticRouter)
|
||||
// 与动态路由比较,首先判断目录是否存在,如果存在就合并,并替换动态路由中的目录
|
||||
staticRouters.forEach((item) => {
|
||||
const index = res.findIndex((item2) => item2.path === item.path)
|
||||
if (index !== -1) {
|
||||
const arr = []
|
||||
if (!item.children || item.children.length === 0) {
|
||||
item.children = arr
|
||||
}
|
||||
if (res[index].children && res[index].children.length > 0) {
|
||||
item.children = item.children.concat(res[index].children)
|
||||
}
|
||||
// routerMap[index].children = item.children
|
||||
// 插入动态路由数组的第二位
|
||||
res[index] = { ...res, ...item }
|
||||
} else {
|
||||
res = [...staticRouters, ...res]
|
||||
}
|
||||
})
|
||||
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
|
||||
// 动态路由,404一定要放到最后面
|
||||
this.addRouters = routerMap.concat([
|
||||
|
||||
@@ -64,7 +64,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
async loginOut() {
|
||||
await loginOut()
|
||||
removeToken()
|
||||
cache.local.clear()
|
||||
// cache.local.clear()
|
||||
this.resetState()
|
||||
},
|
||||
resetState() {
|
||||
@@ -77,6 +77,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
nickname: '',
|
||||
currentRole: 0
|
||||
}
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
},
|
||||
refresh() {
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
|
||||
@@ -69,3 +69,51 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
.caret-wrapper {
|
||||
width: 16px;
|
||||
}
|
||||
.sort-caret {
|
||||
left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table--default .cell {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.flex-radio{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
line-height: 40px;
|
||||
height: 40px;
|
||||
.el-radio__label {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 去除 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;
|
||||
}
|
||||
.el-drawer__header {
|
||||
padding: 16px 16px 8px 16px !important;
|
||||
margin: 0 !important;
|
||||
line-height: 24px !important;
|
||||
font-size: 18px !important;
|
||||
color: #303133 !important;
|
||||
box-sizing: border-box !important;
|
||||
// border-bottom: 1px solid #e8e8e8 !important;
|
||||
}
|
||||
@@ -8,26 +8,34 @@ const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
// 获取token
|
||||
export const getAccessToken = () => {
|
||||
// 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
|
||||
return cache.local.get(AccessTokenKey)
|
||||
? cache.local.get(AccessTokenKey)
|
||||
: cache.local.get('ACCESS_TOKEN')
|
||||
return localStorage.getItem(AccessTokenKey)
|
||||
? localStorage.getItem(AccessTokenKey)
|
||||
: localStorage.getItem('ACCESS_TOKEN')
|
||||
// return cache.local.get(AccessTokenKey)
|
||||
// ? cache.local.get(AccessTokenKey)
|
||||
// : cache.local.get('ACCESS_TOKEN')
|
||||
}
|
||||
|
||||
// 刷新token
|
||||
export const getRefreshToken = () => {
|
||||
return cache.local.get(RefreshTokenKey)
|
||||
return localStorage.getItem(RefreshTokenKey)
|
||||
// return cache.local.get(RefreshTokenKey)
|
||||
}
|
||||
|
||||
// 设置token
|
||||
export const setToken = (token: TokenType) => {
|
||||
cache.local.set(RefreshTokenKey, token.refreshToken)
|
||||
cache.local.set(AccessTokenKey, token.accessToken)
|
||||
localStorage.setItem(AccessTokenKey, token.accessToken)
|
||||
localStorage.setItem(RefreshTokenKey, token.refreshToken)
|
||||
// cache.local.set(RefreshTokenKey, token.refreshToken)
|
||||
// cache.local.set(AccessTokenKey, token.accessToken)
|
||||
}
|
||||
|
||||
// 删除token
|
||||
export const removeToken = () => {
|
||||
cache.local.delete(AccessTokenKey)
|
||||
cache.local.delete(RefreshTokenKey)
|
||||
localStorage.removeItem(AccessTokenKey)
|
||||
localStorage.removeItem(RefreshTokenKey)
|
||||
// cache.local.delete(AccessTokenKey)
|
||||
// cache.local.delete(RefreshTokenKey)
|
||||
}
|
||||
|
||||
/** 格式化token(jwt格式) */
|
||||
|
||||
@@ -74,13 +74,13 @@ export const SystemUserSocialTypeEnum = {
|
||||
type: 20,
|
||||
source: 'dingtalk',
|
||||
img: 'https://s1.ax1x.com/2022/05/22/OzMDRs.png'
|
||||
},
|
||||
WECHAT_ENTERPRISE: {
|
||||
title: '企业微信',
|
||||
type: 30,
|
||||
source: 'wechat_enterprise',
|
||||
img: 'https://s1.ax1x.com/2022/05/22/OzMrzn.png'
|
||||
}
|
||||
// WECHAT_ENTERPRISE: {
|
||||
// title: '企业微信',
|
||||
// type: 30,
|
||||
// source: 'wechat_enterprise',
|
||||
// img: 'https://s1.ax1x.com/2022/05/22/OzMrzn.png'
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -220,3 +220,30 @@ export const removeNullField = (obj: Object) => {
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
import * as XLSX from 'xlsx'
|
||||
import * as FileSaver from 'file-saver'
|
||||
export const exportTableWithVue = (domId: any, fileName: String) => {
|
||||
// const XLSX = require('xlsx')
|
||||
// 使用 this.$nextTick 是在dom元素都渲染完成之后再执行
|
||||
// this.$nextTick(function () {
|
||||
// 设置导出的内容是否只做解析,不进行格式转换 false:要解析, true:不解析
|
||||
const xlsxParam = { raw: true }
|
||||
const wb = XLSX.utils.table_to_book(document.querySelector(domId), xlsxParam)
|
||||
|
||||
const wbout = XLSX.write(wb, {
|
||||
bookType: 'xlsx',
|
||||
bookSST: true,
|
||||
type: 'array'
|
||||
})
|
||||
try {
|
||||
// 下载保存文件
|
||||
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), `${fileName}.xlsx`)
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console.log(e, wbout)
|
||||
}
|
||||
}
|
||||
return wbout
|
||||
// });
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" width="800px">
|
||||
<Dialog v-if="dialogVisible" v-model="dialogVisible" :title="dialogTitle" width="800px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
@@ -30,7 +30,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="负责人" prop="leaderUserId">
|
||||
<el-select v-model="formData.leaderUserId" clearable placeholder="请输入负责人">
|
||||
<el-select
|
||||
v-model="formData.leaderUserId"
|
||||
clearable
|
||||
multiple
|
||||
placeholder="请输入负责人"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
@@ -59,7 +64,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
<Editor v-model="formData.remark" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- 列表 -->
|
||||
<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="leaderUserName" label="负责人" width="120" />
|
||||
<el-table-column prop="sort" label="排序" width="200" />
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<!-- <el-tab-pane label="销售提成" :name="10" v-if="checkPermi(['basic:setting:comission'])">
|
||||
<BSSalerComission v-if="tabIndex == 10" />
|
||||
</el-tab-pane> -->
|
||||
<!-- <el-tab-pane label="微信机器人" :name="20">
|
||||
<BSSalerComission v-if="tabIndex == 20" />
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<MenuForm ref="formRef" :appList="appList" @success="getList" />
|
||||
</template>
|
||||
<script lang="ts" name="SystemMenu" setup>
|
||||
<script lang="ts" name="Menu" setup>
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import * as MenuApi from '@/api/system/menu'
|
||||
import MenuForm from './MenuForm.vue'
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@@ -85,6 +85,11 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="微信号" prop="wxAlias">
|
||||
<el-input v-model="formData.wxAlias" placeholder="请输入微信号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入职日期" prop="hireDate">
|
||||
<el-date-picker
|
||||
@@ -97,6 +102,23 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="钉钉手机号">
|
||||
<el-input
|
||||
v-model="formData.ddPhone"
|
||||
placeholder="请输入钉钉手机号"
|
||||
clearable
|
||||
@blur="getDDId"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="钉钉Id" prop="dingUserId">
|
||||
<el-input v-model="formData.dingUserId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
@@ -127,7 +149,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
const formData = ref<any>({
|
||||
nickname: '',
|
||||
deptId: '',
|
||||
mobile: '',
|
||||
@@ -140,7 +162,8 @@ const formData = ref({
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
roleIds: [],
|
||||
hireDate: '',
|
||||
isNewUserConfirm: false
|
||||
isNewUserConfirm: false,
|
||||
wxAlias: ''
|
||||
})
|
||||
const formRules = ref<any>({
|
||||
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||
@@ -228,8 +251,21 @@ const resetForm = () => {
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
roleIds: [],
|
||||
hireDate: formatDate(new Date(), 'YYYY-MM-DD'),
|
||||
isNewUserConfirm: false
|
||||
isNewUserConfirm: false,
|
||||
wxAlias: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
async function getDDId() {
|
||||
try {
|
||||
if (!formData.value.ddPhone) {
|
||||
formData.value.dingUserId = undefined
|
||||
return
|
||||
}
|
||||
const data = await UserApi.getDDIdByPhone({ mobile: formData.value.ddPhone })
|
||||
formData.value.dingUserId = data
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="queryParams.status" @change="handleQuery">
|
||||
<el-radio :label="0"> 在职 </el-radio>
|
||||
<el-radio :label="1"> 离职 </el-radio>
|
||||
<el-radio :label="0"> 启用 </el-radio>
|
||||
<el-radio :label="1"> 禁用 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -45,31 +45,45 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="用户编号" key="id" prop="id" />
|
||||
<el-table-column label="用户编号" key="id" prop="id" width="100" />
|
||||
<el-table-column label="登录账号" prop="username" />
|
||||
<el-table-column label="用户姓名" prop="nickname" />
|
||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||
<el-table-column label="部门" key="deptName" prop="deptName" width="100" />
|
||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||
<el-table-column label="状态" key="status" width="180">
|
||||
<el-table-column label="微信号" prop="wxAlias" min-width="80" />
|
||||
<el-table-column label="钉钉号" prop="dingUserId" min-width="80" />
|
||||
<el-table-column label="在职状态" key="hireStatus" width="120">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
v-model="scope.row.hireStatus"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="在职"
|
||||
inactive-text="离职"
|
||||
size="small"
|
||||
v-hasPermi="['basic:employee:update']"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="操作" width="200">
|
||||
<el-table-column label="启用状态" key="status" width="120">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
size="small"
|
||||
:disabled="scope.row.hireStatus == 1"
|
||||
v-hasPermi="['basic:employee:update']"
|
||||
@change="handleUseChange(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入职日期" prop="hireDate" width="120" :formatter="dateFormatter" />
|
||||
<el-table-column label="离职日期" prop="" width="120" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -178,14 +192,49 @@ const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 修改用户状态 */
|
||||
/** 修改在职状态 */
|
||||
const handleStatusChange = async (row: UserApi.UserVO) => {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
||||
await message.confirm('确认要"' + text + '""' + row.username + '"用户吗?')
|
||||
const text = row.hireStatus === CommonStatusEnum.ENABLE ? '入职' : '离职'
|
||||
let result = { value: '' }
|
||||
if (text == '入职') {
|
||||
await message.confirm('确认要"' + text + '""' + row.nickname + '"吗?')
|
||||
} else {
|
||||
result = await message.prompt(
|
||||
'请输入年月日,如2024-01-01',
|
||||
'确认要"' + text + '""' + row.nickname + '"用户吗?'
|
||||
)
|
||||
const regex = /^\d{4}-\d{2}-\d{2}$/
|
||||
|
||||
if (!regex.test(result.value)) {
|
||||
message.error('请输入离职日期')
|
||||
throw new Error()
|
||||
}
|
||||
}
|
||||
// 发起修改状态
|
||||
await UserApi.updateUserStatus(row.id, row.status)
|
||||
await UserApi.updateUserStatus(row.id, row.status, result.value, row.hireStatus)
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.hireStatus =
|
||||
row.hireStatus === CommonStatusEnum.ENABLE
|
||||
? CommonStatusEnum.DISABLE
|
||||
: CommonStatusEnum.ENABLE
|
||||
}
|
||||
}
|
||||
|
||||
// 修改启用状态
|
||||
const handleUseChange = async (row: UserApi.UserVO) => {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '禁用'
|
||||
await message.confirm('确认要"' + text + '""' + row.nickname + '"吗?')
|
||||
// 发起修改状态
|
||||
await UserApi.updateUserStatus(row.id, row.status, row.retireDate, row.hireStatus)
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {
|
||||
|
||||
7
src/views/Basic/WxRobot/Record.vue
Normal file
7
src/views/Basic/WxRobot/Record.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<div> record </div>
|
||||
</template>
|
||||
|
||||
<script setup name="WXRecord"></script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
228
src/views/Basic/WxRobot/Setting.vue
Normal file
228
src/views/Basic/WxRobot/Setting.vue
Normal file
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column v-for="col in columns" :prop="col.prop" :key="col.prop" :label="col.label" />
|
||||
<el-table-column label="发送方式" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<el-checkbox-group v-model="row.sendType" size="small" @change="rowChange(row)">
|
||||
<el-checkbox label="微信"> 微信 </el-checkbox>
|
||||
<el-checkbox label="微信群"> 微信群 </el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="群二维码" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-upload
|
||||
ref="rewardFile"
|
||||
action="#"
|
||||
:limit="1"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
:disabled="loading"
|
||||
:show-file-list="false"
|
||||
:before-upload="fileBeforeUpload"
|
||||
:http-request="(data) => rewardUpload(data, row.id)"
|
||||
>
|
||||
<el-button type="primary" size="small">
|
||||
<Icon icon="ep:upload" class="mr-5px" size="small" /> 点击上传
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<!-- <UploadImg v-model="row.wxQrCode" /> -->
|
||||
|
||||
<!-- <img :src="row.wxCode" width="80px" height="80px" alt="" /> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="微信群名称" prop="wxGroup" min-width="150" />
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="{ row }">
|
||||
<!-- <div>
|
||||
<el-button
|
||||
v-if="row.sendType.includes('微信群')"
|
||||
type="primary"
|
||||
style="padding: 5px 0"
|
||||
text
|
||||
@click="row.edit = true"
|
||||
>
|
||||
修改群名称
|
||||
</el-button>
|
||||
</div> -->
|
||||
<div v-if="['每日', '每月'].includes(row.sendFrequency)">
|
||||
<el-button type="primary" style="padding: 5px 0" text @click="changeSendTime(row)">
|
||||
修改发送时间
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<Dialog
|
||||
:title="`修改【${sendTimeInfo.messageName}】发送时间`"
|
||||
v-model="showSendTime"
|
||||
width="500px"
|
||||
>
|
||||
<el-text type="danger">
|
||||
<span v-if="sendTimeInfo.sendFrequency == '每日'">
|
||||
请按照时间格式输入,多个时间以“、”分割,如09:00、15:00、18:00
|
||||
</span>
|
||||
<span v-else-if="sendTimeInfo.sendFrequency == '每月'">
|
||||
请按照"日期-时间"格式输入,多个日期以“、”分割,如26-18:00、28-14:00、30-15:00、30-18:00
|
||||
</span>
|
||||
</el-text>
|
||||
<el-input
|
||||
type="textarea"
|
||||
class="mt-20px mb-20px"
|
||||
:autosize="{ minRows: 3 }"
|
||||
v-model="sendTimeInfo.sendTime"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitSendTime">确 定</el-button>
|
||||
<el-button @click="showSendTime = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="WXSetting">
|
||||
import * as WechatApi from '@/api/system/wechat'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const columns = [
|
||||
{
|
||||
label: '消息名称',
|
||||
prop: 'messageName'
|
||||
},
|
||||
{
|
||||
label: '解释说明',
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
label: '发送频率',
|
||||
prop: 'sendFrequency'
|
||||
},
|
||||
{
|
||||
label: '发送时间',
|
||||
prop: 'sendTime'
|
||||
}
|
||||
]
|
||||
|
||||
onMounted(() => {
|
||||
getTableList()
|
||||
})
|
||||
|
||||
async function getTableList() {
|
||||
try {
|
||||
loading.value = true
|
||||
const list = await WechatApi.getWechatConfigList()
|
||||
tableList.value = list.map((it) => ({ ...it, sendType: it.sendType || [] }))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
let timer = ref(null)
|
||||
const lastId = ref('')
|
||||
function rowChange(row) {
|
||||
try {
|
||||
lastId.value == row.id && clearTimeout(timer.value)
|
||||
timer.value = setTimeout(async () => {
|
||||
lastId.value = row.id
|
||||
await WechatApi.updateWechatGroup({
|
||||
id: row.id,
|
||||
sendType: row.sendType,
|
||||
wxGroup: row.wxGroup
|
||||
})
|
||||
// message.success('修改成功')
|
||||
}, 1500)
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
const showSendTime = ref(false)
|
||||
const sendTimeInfo = ref({})
|
||||
function changeSendTime(row) {
|
||||
showSendTime.value = true
|
||||
sendTimeInfo.value = { ...row }
|
||||
}
|
||||
|
||||
const formLoading = ref(false)
|
||||
|
||||
async function submitSendTime() {
|
||||
// 校验时间是否有效
|
||||
const arr = sendTimeInfo.value.sendTime ? sendTimeInfo.value.sendTime.split('、') : []
|
||||
|
||||
if (sendTimeInfo.value.sendFrequency == '每日') {
|
||||
// 正则校验是否HH:MM
|
||||
if (arr.some((it) => !/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/.test(it))) {
|
||||
message.error('请检查输入格式是否正确!!!')
|
||||
return
|
||||
} else {
|
||||
try {
|
||||
formLoading.value = true
|
||||
await WechatApi.updateWechatSendTime({
|
||||
id: sendTimeInfo.value.id,
|
||||
sendTime: arr.join('、')
|
||||
})
|
||||
message.success('修改成功!')
|
||||
getTableList()
|
||||
showSendTime.value = false
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
} else if (sendTimeInfo.value.sendFrequency == '每月') {
|
||||
// 正则校验是否【1-31】-HH:MM
|
||||
const reg = /^([1-9]|[1-2]\d|3[01])-([01]?[0-9]|2[0-3]):[0-5][0-9]$/
|
||||
if (arr.length > 0 && arr.some((it) => !reg.test(it))) {
|
||||
message.error('请检查输入格式是否正确!!!')
|
||||
return
|
||||
} else {
|
||||
try {
|
||||
formLoading.value = true
|
||||
await WechatApi.updateWechatSendTime({
|
||||
id: sendTimeInfo.value.id,
|
||||
sendTime: arr.join('、')
|
||||
})
|
||||
message.success('修改成功!')
|
||||
getTableList()
|
||||
showSendTime.value = false
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const fileBeforeUpload = (file) => {
|
||||
let format = '.' + file.name.split('.')[1]
|
||||
if (!['.jpg', '.png', 'jpeg'].includes(format)) {
|
||||
message.error(`请上传指定格式".jpg,.jpeg,.png"文件`)
|
||||
return false
|
||||
}
|
||||
let isRightSize = file.size / 1024 / 1024 < 20
|
||||
if (!isRightSize) {
|
||||
message.error('文件大小超过 20MB')
|
||||
}
|
||||
return isRightSize
|
||||
}
|
||||
|
||||
const fd = ref(new FormData())
|
||||
|
||||
async function rewardUpload(data, id) {
|
||||
fd.value.append('file', data.file)
|
||||
fd.value.append('id', id)
|
||||
// 上传接口,成功后得到微信群名
|
||||
try {
|
||||
// 上传文件
|
||||
setTimeout(() => {
|
||||
getTableList()
|
||||
}, 2000)
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,62 +0,0 @@
|
||||
// import { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const statusOptions = [
|
||||
{ label: '发送成功', value: 1 },
|
||||
{ label: '发送失败', value: 2 },
|
||||
{ label: '排队中', value: 3 },
|
||||
{ label: '微信端卡住', value: 4 }
|
||||
]
|
||||
|
||||
// CrudSchema:https://doc.iocoder.cn/vue3/crud-schema/
|
||||
const crudSchemas = reactive([
|
||||
{
|
||||
label: '发送对象',
|
||||
field: 'sendUser',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '发送内容',
|
||||
field: 'content',
|
||||
isSearch: false,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '发送状态',
|
||||
field: 'status',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Select',
|
||||
api: () => statusOptions,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'label',
|
||||
valueField: 'value'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '发送时间',
|
||||
field: 'createTime',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
formatter: dateFormatter,
|
||||
detail: {
|
||||
dateFormat: 'YYYY-MM-DD'
|
||||
},
|
||||
search: {
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
type: 'daterange',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
startPlaceholder: '发送时间',
|
||||
endPlaceholder: '发送时间'
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
@@ -1,77 +1,19 @@
|
||||
<template>
|
||||
<el-tabs v-model="tabIndex" type="border-card">
|
||||
<el-tab-pane label="微信消息记录" :name="0">
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search
|
||||
:schema="allSchemas.searchSchema"
|
||||
labelWidth="0"
|
||||
@search="setSearchParams"
|
||||
@reset="setSearchParams"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in allSchemas.tableColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
:fixed="item.fixed"
|
||||
min-width="150px"
|
||||
showOverflowTooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="sendMsg(row)">再次发送</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
<!-- <el-tab-pane label="微信消息记录" :name="0">
|
||||
<Record />
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="消息配置" :name="1">
|
||||
<Setting />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { allSchemas } from './index.data.js'
|
||||
<script setup name="WXBoot">
|
||||
// import Record from './Record.vue'
|
||||
import Setting from './Setting.vue'
|
||||
|
||||
const tabIndex = ref(0)
|
||||
|
||||
const tableObject = ref({
|
||||
tableList: [],
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
currentPage: 1
|
||||
})
|
||||
|
||||
function setSearchParams() {
|
||||
tableObject.value.tableList = [
|
||||
{
|
||||
sendUser: '测试',
|
||||
content: '您今日有10条待跟进的线索',
|
||||
status: '发送成功',
|
||||
createTime: '2024-04-25 12:00:00'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function getTableList() {
|
||||
tableObject.value.tableList = [
|
||||
{
|
||||
sendUser: '测试',
|
||||
content: '您今日有10条待跟进的线索',
|
||||
status: '发送成功',
|
||||
createTime: '2024-04-25 12:00:00'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function sendMsg() {
|
||||
console.log('测试')
|
||||
}
|
||||
const tabIndex = ref(1)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -83,6 +83,18 @@
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.area" placeholder="选择区域" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in areaOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch" v-hasPermi="['clue:order:after-sale-search']">
|
||||
查询
|
||||
@@ -189,6 +201,7 @@
|
||||
<script setup name="AfterSales">
|
||||
import * as AfterSaleApi from '@/api/clue/afterSale'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getAreaSimpleList } from '@/api/school/setting/area'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
||||
@@ -292,7 +305,12 @@ function handleAudit(row) {
|
||||
afterSaleAuditDialog.value.open(row)
|
||||
}
|
||||
|
||||
const areaOptions = ref([])
|
||||
function getOptions() {
|
||||
// 区域
|
||||
getAreaSimpleList().then((data) => {
|
||||
areaOptions.value = data
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
|
||||
130
src/views/Clue/Order/Comp/DialogAddProduct.vue
Normal file
130
src/views/Clue/Order/Comp/DialogAddProduct.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<Dialog title="添加产品" v-model="show" width="800px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="成交产品" prop="productId">
|
||||
<el-select
|
||||
v-model="form.productId"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
@change="form.specsId = undefined"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prodOptions"
|
||||
:key="item.productId"
|
||||
:label="item.productName"
|
||||
:value="item.productId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="产品规格" prop="specsId">
|
||||
<el-select
|
||||
v-model="form.specsId"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
:disabled="!form.productId"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(form.productId)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="成交数量" prop="signNum">
|
||||
<el-input-number v-model="form.signNum" :min="1" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="生产状态" prop="isProduced">
|
||||
<el-radio-group v-model="form.isProduced">
|
||||
<el-radio :label="0">待生产</el-radio>
|
||||
<el-radio :label="1">已生产</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 3 }"
|
||||
v-model="form.remark"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogProduct">
|
||||
import { addOrderProduct } from '@/api/clue/sign'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const show = ref(false)
|
||||
const form = ref({})
|
||||
const rules = {
|
||||
productId: { required: true, message: '成交产品不可为空', trigger: 'change' },
|
||||
specsId: { required: true, message: '产品规格不可为空', trigger: 'change' },
|
||||
signNum: { required: true, message: '成交数量不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
const prodOptions = ref([])
|
||||
|
||||
function open(signId, arr) {
|
||||
prodOptions.value = arr
|
||||
form.value.signId = signId
|
||||
form.value.isProduced = 0
|
||||
show.value = true
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await addOrderProduct(form.value)
|
||||
message.success('新增成功!')
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -28,9 +28,9 @@
|
||||
<el-select v-model="form.supplier" placeholder="选择供应商" filterable>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.id"
|
||||
:label="item.supplierName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -141,15 +141,18 @@
|
||||
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
|
||||
import { createDelivery } from '@/api/clue/delivery'
|
||||
import { getConfigList } from '@/api/system/set'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { getSupplierSimpleList } from '@/api/school/setting/supplier'
|
||||
import { getExtraFeeSimpleList } from '@/api/clue/extraFee'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const warehouseOptions = ref([])
|
||||
const extraPayOptions = ref([])
|
||||
const supplierOptions = getDictOptions('erp_supplier')
|
||||
const supplierOptions = ref([])
|
||||
function getOptions() {
|
||||
getSupplierSimpleList().then((data) => {
|
||||
supplierOptions.value = data
|
||||
})
|
||||
getSimpleWarehouseList().then((data) => {
|
||||
warehouseOptions.value = data
|
||||
})
|
||||
|
||||
@@ -61,14 +61,15 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
label="回款记录"
|
||||
name="returnRecord"
|
||||
v-if="checkPermi(['clue:order:return-list'])"
|
||||
>
|
||||
<el-tab-pane label="回款记录" name="returnRecord">
|
||||
<el-table :data="returnRecordList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="money" label="回款金额" />
|
||||
<el-table-column
|
||||
v-if="checkPermi(['clue:order:return-list'])"
|
||||
prop="money"
|
||||
label="回款金额"
|
||||
/>
|
||||
<el-table-column prop="personProfit" label="员工利润" />
|
||||
<el-table-column prop="applyTime" label="申请日期" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
@@ -197,13 +198,14 @@ function getFields() {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
|
||||
if (it.field == 'receivedMoney') {
|
||||
checkPermi(['clue:order:return-list']) && arr.push(it)
|
||||
} else {
|
||||
arr.push(it)
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
if (arr.filter((item) => item.span != 2).length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
orderSchema.value = [
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" />
|
||||
<el-table-column type="expand">
|
||||
<el-table-column type="selection" width="60" fixed="left" />
|
||||
<el-table-column type="expand" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<div class="p-10px flex justify-center">
|
||||
<VueDraggable
|
||||
@@ -91,8 +91,8 @@
|
||||
stripe
|
||||
style="width: 80%; margin: 0 auto"
|
||||
>
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="productName" label="成交产品" width="120px" />
|
||||
<el-table-column prop="specsName" label="产品规格" width="120px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" width="100px" />
|
||||
<el-table-column label="生产状态" width="160px">
|
||||
@@ -147,6 +147,15 @@
|
||||
>
|
||||
发货
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:remove-product']"
|
||||
@click="handleRemoveProduct(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -228,6 +237,16 @@
|
||||
>
|
||||
取消登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:add-product']"
|
||||
@click="handleAddProduct(scope.row)"
|
||||
>
|
||||
添加产品
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
@@ -238,6 +257,7 @@
|
||||
<DialogAfterSale ref="afterSaleDialog" />
|
||||
<DialogExtraFee ref="extraFeeDialog" />
|
||||
<DialogDelivery ref="deliveryDialog" @success="getTableList" />
|
||||
<DialogAddProduct ref="addProductDialog" @success="getTableList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -252,6 +272,7 @@ import DialogFeeback from './DialogFeeback.vue'
|
||||
import DialogAfterSale from './DialogAfterSale.vue'
|
||||
import DialogExtraFee from './DialogExtraPay.vue'
|
||||
import DialogDelivery from './DialogDelivery.vue'
|
||||
import DialogAddProduct from './DialogAddProduct.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -404,6 +425,11 @@ function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
|
||||
const addProductDialog = ref()
|
||||
function handleAddProduct(row) {
|
||||
addProductDialog.value.open(row.signId, prodOptions.value)
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.signId)
|
||||
@@ -460,6 +486,18 @@ function handleBatchUpdateInstall() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleRemoveProduct(row) {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
await message.confirm(`确认要删除${row.productName}吗?`)
|
||||
// 发起修改状态
|
||||
await SignApi.removeOrderProduct(row.id)
|
||||
message.success('删除成功')
|
||||
// 刷新列表
|
||||
getTableList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
async function handleChangeProdoce(row) {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
@@ -472,7 +510,7 @@ async function handleChangeProdoce(row) {
|
||||
})
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
getTableList()
|
||||
// getTableList()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.isProduced = !row.isProduced
|
||||
|
||||
@@ -116,9 +116,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.id"
|
||||
:label="item.supplierName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -246,6 +246,16 @@
|
||||
<el-form-item label="结算金额">
|
||||
{{ settleAmount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="结算日期">
|
||||
<el-date-picker
|
||||
v-model="form.settlementDate"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
@@ -267,9 +277,9 @@ import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { getSupplierSimpleList } from '@/api/school/setting/supplier'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -394,6 +404,7 @@ function batchSettle() {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
settlementDate: formatDate(new Date(), 'YYYY-MM-DD'),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
@@ -419,9 +430,12 @@ async function handleSaveSettle() {
|
||||
|
||||
const userOptions = ref([])
|
||||
const prodOptions = ref([])
|
||||
const supplierOptions = getDictOptions('erp_supplier')
|
||||
const supplierOptions = ref([])
|
||||
|
||||
function getOptions() {
|
||||
getSupplierSimpleList().then((data) => {
|
||||
supplierOptions.value = data
|
||||
})
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
|
||||
@@ -18,22 +18,93 @@
|
||||
<el-option label="已驳回" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-select
|
||||
v-model="searchForm.receiver"
|
||||
placeholder="接待人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.receiver"
|
||||
placeholder="接待人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signSchool"
|
||||
placeholder="选择驾校"
|
||||
filterable
|
||||
clearable
|
||||
@change="changeSchool"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in schoolOptions"
|
||||
:key="item.schoolId"
|
||||
:label="item.schoolName"
|
||||
:value="item.schoolId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signPlace"
|
||||
placeholder="选择场地"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signSchool"
|
||||
@change="changePlace"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in placeOptions"
|
||||
:key="item.placeId"
|
||||
:label="item.name"
|
||||
:value="item.placeId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signClass"
|
||||
:disabled="!searchForm.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
:key="item.typeId"
|
||||
:label="item.typeName"
|
||||
:value="item.typeId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.licenseType" placeholder="驾照类型" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in getDictOptions(DICT_TYPE.LINCENSE_TYPE)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.area" placeholder="选择区域" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in areaOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item v-else-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-select
|
||||
v-model="searchForm.convertPeople"
|
||||
@@ -121,6 +192,7 @@
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch" v-hasPermi="['clue:order:return-search']">查询</el-button>
|
||||
<el-button @click="handleReset" v-hasPermi="['clue:order:return-reset']">重置</el-button>
|
||||
<el-button @click="handleExport" v-hasPermi="['clue:order:return-export']">导出</el-button>
|
||||
<el-button @click="batchAudit" v-hasPermi="['clue:order:return-batch-audit']">
|
||||
批量审核
|
||||
</el-button>
|
||||
@@ -198,6 +270,30 @@
|
||||
<div v-else>{{ row.isPayoff }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="signSchool"
|
||||
label="报名驾校"
|
||||
min-width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="signPlace"
|
||||
label="报名场地"
|
||||
min-width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="signClass"
|
||||
label="报名班型"
|
||||
min-width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="licenseType"
|
||||
label="驾照类型"
|
||||
min-width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="receiverName"
|
||||
@@ -317,6 +413,10 @@
|
||||
<script setup name="Reback">
|
||||
import * as FeebackApi from '@/api/clue/payment'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import { getAreaSimpleList } from '@/api/school/setting/area'
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
||||
@@ -324,8 +424,10 @@ import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import download from '@/utils/download'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import { ElLoading } from 'element-plus'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -352,6 +454,13 @@ const searchForm = ref({
|
||||
const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
|
||||
const schoolOptions = ref([])
|
||||
const allPlaceOptions = ref([])
|
||||
|
||||
const placeOptions = computed(() => {
|
||||
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
|
||||
})
|
||||
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
@@ -373,11 +482,31 @@ function handleReset() {
|
||||
applyUser: undefined,
|
||||
checkTime: [],
|
||||
mobile: undefined,
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
area: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
|
||||
function changeSchool() {
|
||||
searchForm.value.signPlace = undefined
|
||||
searchForm.value.signClass = undefined
|
||||
}
|
||||
|
||||
function changePlace() {
|
||||
searchForm.value.signClass = undefined
|
||||
getClassTypeOptions()
|
||||
}
|
||||
|
||||
const classOptions = ref([])
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
const totalInfo = ref({})
|
||||
const loading = ref(false)
|
||||
async function getList() {
|
||||
@@ -392,6 +521,26 @@ async function getList() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
try {
|
||||
ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在导出数据,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
const params = removeNullField(searchForm.value)
|
||||
delete params.pageNo
|
||||
delete params.pageSize
|
||||
const data = await FeebackApi.exportPayment(params)
|
||||
download.excel(data, `汇款记录表${new Date().getTime()}.xls`)
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
const loadingInstance = ElLoading.service()
|
||||
loadingInstance.close()
|
||||
}, 400)
|
||||
}
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.id)
|
||||
@@ -400,7 +549,7 @@ function handleSelectionChange(val) {
|
||||
const batchAuditDialog = ref()
|
||||
function batchAudit() {
|
||||
if (batchIds.value.length) {
|
||||
batchAuditDialog.value.open('aftersale', batchIds.value)
|
||||
batchAuditDialog.value.open('feeback', batchIds.value)
|
||||
} else {
|
||||
message.info('请选择表格中需要审核的数据')
|
||||
}
|
||||
@@ -427,7 +576,17 @@ function handleAudit(row) {
|
||||
feebackDialog.value.open(row)
|
||||
}
|
||||
|
||||
const areaOptions = ref([])
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
// 区域
|
||||
getAreaSimpleList().then((data) => {
|
||||
areaOptions.value = data
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
|
||||
@@ -248,6 +248,16 @@
|
||||
<el-form-item label="结算金额">
|
||||
{{ settleAmount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="结算日期">
|
||||
<el-date-picker
|
||||
v-model="form.settlementDate"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
@@ -270,7 +280,7 @@ import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -395,6 +405,7 @@ function batchSettle() {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
settlementDate: formatDate(new Date()),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
|
||||
@@ -82,7 +82,7 @@ async function initMap() {
|
||||
}
|
||||
defaultCity.value = cityInfo.locationName
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
key: import.meta.env.VITE_AMAP_KEY, //设置您的key
|
||||
version: '2.0',
|
||||
plugins: ['AMap.AutoComplete']
|
||||
}).then((AMap) => {
|
||||
|
||||
@@ -52,7 +52,7 @@ const form = ref({
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
originFollowUserId: { required: true, message: '原跟进人不可为空', trigger: 'change' }
|
||||
// originFollowUserId: { required: true, message: '原跟进人不可为空', trigger: 'change' }
|
||||
// newFollowUserId: { required: true, message: '新跟进人不可为空', trigger: 'change' }
|
||||
})
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
:disabled="!row.editable"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in props.userOptions"
|
||||
v-for="item in props.allUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
@@ -88,7 +88,7 @@
|
||||
<div class="w-100px">线索位置:</div>
|
||||
<el-input v-model="address" disabled placeholder="请输入线索位置" clearable />
|
||||
</div>
|
||||
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
||||
<el-checkbox v-model="showSchool" :label="true" :value="true" @change="handleShowSchool">
|
||||
展示场地
|
||||
</el-checkbox>
|
||||
</div>
|
||||
@@ -170,7 +170,7 @@ const formSchema = computed(() => {
|
||||
if (it.field == 'consultTime') {
|
||||
it.componentProps['disabled-date'] = dateAfterToday
|
||||
// it.componentProps['disabled'] = formType.value != 'create'
|
||||
it.componentProps['disabled'] = true
|
||||
it.componentProps['disabled'] = appStore.getAppInfo?.instanceType == 1
|
||||
}
|
||||
// else if (it.field == 'convertPeople' && formType.value == 'update') {
|
||||
// it.componentProps['disabled'] = true
|
||||
@@ -395,7 +395,7 @@ let geoCoder = ref(null)
|
||||
|
||||
function initMap(data) {
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
key: import.meta.env.VITE_AMAP_KEY, //设置您的key
|
||||
version: '2.0',
|
||||
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
||||
}).then((AMap) => {
|
||||
|
||||
@@ -165,7 +165,12 @@
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="fieldItem.component == 'Radio'">
|
||||
<el-radio v-for="item in fieldItem.options" :key="item.id" :label="item.id">
|
||||
<el-radio
|
||||
v-for="item in fieldItem.options"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</template>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<el-tab-pane label="详细信息" name="infoDetail">
|
||||
<Descriptions :data="info" :schema="showSchema" :columns="2" />
|
||||
<div v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
||||
<el-checkbox v-model="showSchool" :label="true" :value="true" @change="handleShowSchool">
|
||||
展示场地
|
||||
</el-checkbox>
|
||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||
@@ -289,7 +289,7 @@ const defaultLatLng = ref({
|
||||
|
||||
function initMap(data) {
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
key: import.meta.env.VITE_AMAP_KEY, //设置您的key
|
||||
version: '2.0'
|
||||
}).then((AMap) => {
|
||||
aMap.value = AMap
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
rowkey="clueId"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@selection-change="handleSelectionChange"
|
||||
@@ -92,6 +93,9 @@
|
||||
快速新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'intentionStateName'">
|
||||
<DictTag type="intention_state" :value="row.intentionState + ''" />
|
||||
</div>
|
||||
<div v-else-if="item.field == 'contact'">
|
||||
<span>{{ row[item.field] }}</span>
|
||||
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
||||
|
||||
@@ -7,30 +7,130 @@
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item v-if="formData.parentSource" label="上级来源">
|
||||
<el-input v-model="formData.parentSource" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="来源名称" prop="sourceName">
|
||||
<el-input v-model="formData.sourceName" placeholder="请输入来源名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||
</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-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="formData.remark"
|
||||
placeholder="请输入备注"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-row :gutter="20">
|
||||
<el-col v-if="formData.parentSource" :span="12" :offset="0">
|
||||
<el-form-item label="上级来源">
|
||||
<el-input v-model="formData.parentSource" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="来源名称" prop="sourceName">
|
||||
<el-input v-model="formData.sourceName" placeholder="请输入来源名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="开户费用" prop="accountFee">
|
||||
<el-input-number
|
||||
v-model="formData.accountFee"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="开户日期" prop="accountStartTime">
|
||||
<el-date-picker
|
||||
v-model="formData.accountStartTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="到期日期" prop="accountEndTime">
|
||||
<el-date-picker
|
||||
v-model="formData.accountEndTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="formData.remark"
|
||||
placeholder="请输入备注"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider direction="horizontal" content-position="left">线索成本</el-divider>
|
||||
|
||||
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button>
|
||||
<el-table :data="formData.sourceCostVOS" border>
|
||||
<el-table-column label="年份" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.year"
|
||||
type="year"
|
||||
placeholder="选择年份"
|
||||
size="small"
|
||||
format="YYYY"
|
||||
value-format="YYYY"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
|
||||
<el-table-column label="充值">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.monthData[col - 1].rechargeFee"
|
||||
size="small"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.monthData[col - 1].consumeFee"
|
||||
size="small"
|
||||
:controls="false"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线索数">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.monthData[col - 1].clueNum"
|
||||
size="small"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
:min="0"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
@@ -49,6 +149,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
sourceName: '',
|
||||
accountFee: undefined,
|
||||
sort: 1,
|
||||
remark: ''
|
||||
})
|
||||
@@ -111,8 +212,29 @@ const resetForm = () => {
|
||||
sourceName: '',
|
||||
status: 0,
|
||||
sort: 1,
|
||||
remark: ''
|
||||
remark: '',
|
||||
costModel: 0,
|
||||
sourceCostVOS: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
function handleAddPrice() {
|
||||
const obj = {
|
||||
year: undefined,
|
||||
monthData: []
|
||||
}
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
obj.monthData.push({
|
||||
month: i,
|
||||
consumeFee: 0,
|
||||
rechargeFee: 0,
|
||||
clueNum: 0
|
||||
})
|
||||
}
|
||||
if (!formData.value.sourceCostVOS) {
|
||||
formData.value.sourceCostVOS = []
|
||||
}
|
||||
formData.value.sourceCostVOS.push(obj)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column type="index" width="50" fixed="left" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" fixed="left" />
|
||||
<el-table-column
|
||||
v-for="(item, index) in new Date().getMonth() + 1"
|
||||
v-for="(item, index) in 12"
|
||||
:key="index"
|
||||
:label="item + '月'"
|
||||
sortable
|
||||
@@ -102,8 +102,6 @@ function totalSort(pre, cur) {
|
||||
}
|
||||
|
||||
function monthSort(pre, cur, idx) {
|
||||
console.log(idx)
|
||||
|
||||
return (
|
||||
Number(pre.monthClueSignRateReportList[idx].rate) -
|
||||
Number(cur.monthClueSignRateReportList[idx].rate)
|
||||
|
||||
62
src/views/Home/Comp/BarSalerClueReport.vue
Normal file
62
src/views/Home/Comp/BarSalerClueReport.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<Echart :options="optionsData" :width="400" :height="200" />
|
||||
</template>
|
||||
|
||||
<script setup name="BarSalerClueReport">
|
||||
import { set } from 'lodash-es'
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
getReportData()
|
||||
})
|
||||
})
|
||||
|
||||
const optionsData = ref({})
|
||||
|
||||
const getReportData = async () => {
|
||||
// const data = await HomeApi.getClueSignSignRate()
|
||||
set(optionsData, 'radiusAxis', {
|
||||
type: 'category',
|
||||
data: ['宝典', '一点通', '抖音', '小红书'],
|
||||
z: 10
|
||||
})
|
||||
set(optionsData, 'series', [
|
||||
{
|
||||
type: 'bar',
|
||||
data: [1, 2, 3, 4],
|
||||
coordinateSystem: 'polar',
|
||||
name: '高意向A',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [2, 4, 6, 8],
|
||||
coordinateSystem: 'polar',
|
||||
name: '中意向B',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [1, 2, 3, 4],
|
||||
coordinateSystem: 'polar',
|
||||
name: '低意向C',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getReportData
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -17,6 +17,7 @@
|
||||
:data="props.sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
filterable
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
:data="props.sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
filterable
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
style="width: 100%"
|
||||
|
||||
402
src/views/Home/Comp/DialogSalerReportDetail.vue
Normal file
402
src/views/Home/Comp/DialogSalerReportDetail.vue
Normal file
@@ -0,0 +1,402 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1000px">
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.consultTime"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
start-placeholder="选择日期"
|
||||
end-placeholder="选择日期"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tree-select
|
||||
v-model="searchForm.sourceId"
|
||||
:data="props.sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
@change="sourceChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-select
|
||||
v-model="searchForm.licenseTypeList"
|
||||
placeholder="选择驾照类型"
|
||||
clearable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="item in props.licenseTypeOptions"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-tabs v-model="showPane" class="pb-10px">
|
||||
<el-tab-pane label="详细数据" :name="1">
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column prop="sourceName" label="渠道名称" width="100" fixed="left" />
|
||||
<el-table-column prop="newClueNumber" label="新线索数" sortable min-width="100" />
|
||||
<el-table-column prop="signNumber" label="成交数" sortable min-width="100" />
|
||||
<el-table-column
|
||||
prop="signRate"
|
||||
label="成交率"
|
||||
sortable
|
||||
min-width="100"
|
||||
:formatter="(row) => row.signRate + '%'"
|
||||
/>
|
||||
<el-table-column prop="averageSignPeriod" label="成交周期" sortable min-width="100" />
|
||||
<el-table-column
|
||||
prop="grossProfitOfSingleSign"
|
||||
label="毛利/单"
|
||||
sortable
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column prop="payPriceOfSingleSign" label="支出/单" sortable min-width="100" />
|
||||
<el-table-column prop="costOfSingleClue" label="线索成本/条" sortable min-width="100" />
|
||||
<el-table-column
|
||||
prop="netProfitOfSingleSign"
|
||||
label="净利润/单"
|
||||
sortable
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column label="总线索成本" prop="clueCostTotal" sortable min-width="100" />
|
||||
<el-table-column label="总支出" prop="payPriceTotal" sortable min-width="100" />
|
||||
<el-table-column label="总利润" prop="profitTotal" sortable min-width="100" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="图表展示" :name="2" lazy>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-checkbox-group v-model="showChannel" @change="setReportData">
|
||||
<el-checkbox v-for="(item, index) in channelArr" :key="index" :label="item" />
|
||||
</el-checkbox-group>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<Echart :options="echart1Option" width="100%" :height="400" />
|
||||
</el-skeleton>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0" v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<Echart :options="echart2Option" width="100%" :height="400" />
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<Echart :options="echart3Option" width="100%" :height="400" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogSalerReportDetail">
|
||||
import { set } from 'lodash-es'
|
||||
import * as reportApi from '@/api/home/reportSaler'
|
||||
import { getIntDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
licenseTypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
sourceOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'sourceName',
|
||||
value: 'sourceId',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
|
||||
const showChannel = ref([])
|
||||
const intentionOptions = getIntDictOptions('intention_state')
|
||||
|
||||
const channelArr = computed(() => {
|
||||
if (searchForm.value.sourceId) {
|
||||
let arr =
|
||||
props.sourceOptions.find((it) => it.sourceId == searchForm.value.sourceId)?.children || []
|
||||
return arr.map((it) => it.sourceName)
|
||||
} else {
|
||||
return props.sourceOptions.map((it) => it.sourceName)
|
||||
}
|
||||
})
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const loading = ref(false)
|
||||
const searchForm = ref({})
|
||||
|
||||
const showPane = ref(1)
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
consultTime: [`${year}-${month}-01`, formatDate(new Date())],
|
||||
licenseTypeList: [],
|
||||
sourceId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (info, queryInfo) => {
|
||||
showPane.value = 1
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = info.nickname
|
||||
searchForm.value = { ...queryInfo }
|
||||
searchForm.value.userId = info.userId
|
||||
|
||||
sourceChange()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const tableList = ref([])
|
||||
|
||||
async function handleSearch() {
|
||||
loading.value = true
|
||||
try {
|
||||
const params = { ...searchForm.value }
|
||||
const data = await reportApi.getInfo(removeNullField(params))
|
||||
tableList.value = data.sourceDetailVOList
|
||||
setReportData(data)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function sourceChange() {
|
||||
handleSearch()
|
||||
showChannel.value = channelArr.value
|
||||
}
|
||||
|
||||
const echart1Option = ref({
|
||||
title: {
|
||||
text: '线索分布图'
|
||||
},
|
||||
radiusAxis: {},
|
||||
angleAxis: {},
|
||||
tooltip: {
|
||||
show: true,
|
||||
formatter: '{b0}-{a}: {c}'
|
||||
},
|
||||
polar: {},
|
||||
legend: {
|
||||
show: true,
|
||||
type: 'scroll',
|
||||
left: 100
|
||||
}
|
||||
})
|
||||
|
||||
const echart2Option = ref({
|
||||
title: {
|
||||
text: '成交分布图'
|
||||
},
|
||||
radiusAxis: {},
|
||||
angleAxis: {},
|
||||
tooltip: {
|
||||
show: true,
|
||||
formatter: '{b0}-{a}: {c}'
|
||||
},
|
||||
polar: {},
|
||||
legend: {
|
||||
show: true,
|
||||
type: 'scroll',
|
||||
left: 100
|
||||
}
|
||||
})
|
||||
|
||||
const echart3Option = ref({
|
||||
title: {
|
||||
text: '销售雷达图'
|
||||
},
|
||||
radar: {
|
||||
indicator: [
|
||||
{ name: '成交周期' },
|
||||
{ name: '毛利/单' },
|
||||
{ name: '支出/单' },
|
||||
{ name: '线索成本/条' },
|
||||
{ name: '净利润/单' },
|
||||
{ name: '成交率' }
|
||||
// { name: '线索总成本' },
|
||||
// { name: '总支出' },
|
||||
// { name: '总利润' }
|
||||
]
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
right: '10px',
|
||||
orient: 'vertical'
|
||||
}
|
||||
})
|
||||
|
||||
const setReportData = async (data) => {
|
||||
// const data = await HomeApi.getClueSignSignRate()
|
||||
|
||||
const channelClueArr = showChannel.value.sort((pre, cur) => {
|
||||
const preArr = tableList.value.find((it) => it.sourceName == pre).clueIntentionNumVOList || []
|
||||
const curArr = tableList.value.find((it) => it.sourceName == cur).clueIntentionNumVOList || []
|
||||
const preCount = preArr.reduce((preVal, curVal) => preVal + curVal.intentionNum, 0)
|
||||
const curCount = curArr.reduce((preVal, curVal) => preVal + curVal.intentionNum, 0)
|
||||
return preCount - curCount
|
||||
})
|
||||
|
||||
const arr1 = intentionOptions.map((intention) => {
|
||||
const list = []
|
||||
channelClueArr.map((item) => {
|
||||
const row = tableList.value.find((it) => item == it.sourceName)
|
||||
if (row) {
|
||||
list.push(
|
||||
row.clueIntentionNumVOList.find((it) => it.intentionState == intention.value).intentionNum
|
||||
)
|
||||
}
|
||||
})
|
||||
return {
|
||||
type: 'bar',
|
||||
data: list,
|
||||
coordinateSystem: 'polar',
|
||||
name: intention.label,
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const channelSignArr = showChannel.value.sort((pre, cur) => {
|
||||
const preArr = tableList.value.find((it) => it.sourceName == pre).signLicenseTypeNumVOList || []
|
||||
const curArr = tableList.value.find((it) => it.sourceName == cur).signLicenseTypeNumVOList || []
|
||||
const preCount = preArr.reduce((preVal, curVal) => preVal + curVal.licenseTypeNum, 0)
|
||||
const curCount = curArr.reduce((preVal, curVal) => preVal + curVal.licenseTypeNum, 0)
|
||||
return preCount - curCount
|
||||
})
|
||||
const arr2 = props.licenseTypeOptions.map((cartype) => {
|
||||
const list = []
|
||||
channelClueArr.map((item) => {
|
||||
const row = tableList.value.find((it) => item == it.sourceName)
|
||||
if (row) {
|
||||
list.push(
|
||||
row.signLicenseTypeNumVOList.find((it) => it.licenseType == cartype.label).licenseTypeNum
|
||||
)
|
||||
}
|
||||
})
|
||||
return {
|
||||
type: 'bar',
|
||||
data: list,
|
||||
coordinateSystem: 'polar',
|
||||
name: cartype.label,
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
set(echart1Option.value, 'radiusAxis', {
|
||||
type: 'category',
|
||||
data: channelClueArr,
|
||||
axisLabel: {
|
||||
margin: 5,
|
||||
fontSize: 10,
|
||||
interval: 0
|
||||
}
|
||||
})
|
||||
|
||||
set(echart1Option.value, 'series', arr1)
|
||||
|
||||
set(echart2Option.value, 'radiusAxis', {
|
||||
type: 'category',
|
||||
data: channelSignArr,
|
||||
axisLabel: {
|
||||
margin: 5,
|
||||
fontSize: 10,
|
||||
interval: 0
|
||||
}
|
||||
})
|
||||
set(echart2Option.value, 'series', arr2)
|
||||
const { personDetail, averageDetail } = data
|
||||
set(echart3Option.value, 'series', [
|
||||
{
|
||||
type: 'radar',
|
||||
data: [
|
||||
{
|
||||
value: [
|
||||
averageDetail.averageSignPeriod,
|
||||
averageDetail.grossProfitOfSingleSign,
|
||||
averageDetail.payPriceOfSingleSign,
|
||||
averageDetail.costOfSingleClue,
|
||||
averageDetail.netProfitOfSingleSign,
|
||||
averageDetail.signRate
|
||||
// averageDetail.clueCostTotal,
|
||||
// averageDetail.payPriceTotal,
|
||||
// averageDetail.profitTotal
|
||||
],
|
||||
name: '平均水平',
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
},
|
||||
areaStyle: {
|
||||
color: 'rgba(0, 191, 255, 0.6)'
|
||||
},
|
||||
label: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [
|
||||
personDetail.averageSignPeriod,
|
||||
personDetail.grossProfitOfSingleSign,
|
||||
personDetail.payPriceOfSingleSign,
|
||||
personDetail.costOfSingleClue,
|
||||
personDetail.netProfitOfSingleSign,
|
||||
personDetail.signRate
|
||||
// personDetail.clueCostTotal,
|
||||
// personDetail.payPriceTotal,
|
||||
// personDetail.profitTotal
|
||||
],
|
||||
name: dialogTitle.value,
|
||||
areaStyle: {
|
||||
color: 'rgba(255, 145, 124, 0.4)'
|
||||
},
|
||||
label: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -38,31 +38,42 @@
|
||||
</el-form>
|
||||
<el-table :data="tableList" border stripe show-summary :summary-method="getSummaries">
|
||||
<el-table-column label="周期" prop="period" width="110px" />
|
||||
<el-table-column prop="signNumber" label="成交数" />
|
||||
<el-table-column prop="signPrice" label="成交额" />
|
||||
<el-table-column
|
||||
prop="signPriceSequentialGrowth"
|
||||
label="成交额环比增长"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="signPriceSamePeriodCompareGrowth"
|
||||
label="成交额同比增长"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
<el-table-column prop="profit" label="利润" />
|
||||
<el-table-column prop="profitSequentialGrowth" label="利润环比增长" :formatter="parseRate" />
|
||||
<el-table-column
|
||||
prop="profitSamePeriodCompareGrowth"
|
||||
label="利润同比增长"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
<el-table-column prop="notReceivedMoney" label="未到账金额" />
|
||||
<el-table-column prop="receivedMoney" label="已到账金额" />
|
||||
<el-table-column label="成交" align="center">
|
||||
<el-table-column prop="signNumber" label="成交数" />
|
||||
<el-table-column prop="signPrice" label="成交额" />
|
||||
<el-table-column prop="signPriceSequentialGrowth" label="环比" :formatter="parseRate" />
|
||||
<el-table-column
|
||||
prop="signPriceSamePeriodCompareGrowth"
|
||||
label="同比"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
</el-table-column>
|
||||
<el-table-column label="利润" align="center">
|
||||
<el-table-column prop="profit">
|
||||
<template #header> <Tooltip message="公司利润" /> <span>利润</span> </template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="profitSequentialGrowth" label="环比" :formatter="parseRate" />
|
||||
<el-table-column prop="profitSamePeriodCompareGrowth" label="同比" :formatter="parseRate" />
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="notReceivedMoney">
|
||||
<template #header>
|
||||
<Tooltip message="回款列表中未审核的公司利润" /> <span>未到账</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="receivedMoney">
|
||||
<template #header>
|
||||
<Tooltip message="回款列表中已审核的公司利润" /> <span>已到账</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="waitSettleMoney" label="待结算金额" />
|
||||
<el-table-column prop="settledMoney" label="已结算金额" />
|
||||
<el-table-column prop="refundAmount" label="已退款金额" />
|
||||
<el-table-column prop="remainMoney" label="结余" />
|
||||
<el-table-column prop="remainMoney">
|
||||
<template #header>
|
||||
<Tooltip message="已到账金额-已结算金额-已退款金额" /> <span>结余</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
@@ -129,14 +140,16 @@ function getSummaries({ columns, data }) {
|
||||
if (column.property.includes('Growth')) {
|
||||
sums[index] = ''
|
||||
} else {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = values
|
||||
.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
.toFixed(2)
|
||||
}
|
||||
} else {
|
||||
sums[index] = ''
|
||||
|
||||
@@ -13,6 +13,32 @@
|
||||
</el-col>
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<div class="flex h-40px items-center justify-end <sm:mt-10px">
|
||||
<div
|
||||
class="px-8px text-right"
|
||||
@click="router.push({ path: '/Okr/okr-wait', query: { type: 1 } })"
|
||||
>
|
||||
<div class="text-14px text-red-600 mb-20px">今日待办</div>
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="waitCount.dayEndAgentWorkNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<div
|
||||
class="px-8px text-right"
|
||||
@click="router.push({ path: '/Okr/okr-wait', query: { type: 2 } })"
|
||||
>
|
||||
<div class="text-14px text-gray-400 mb-20px">我的待办</div>
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="waitCount.myAgentWorkNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<div class="px-8px text-right">
|
||||
<div class="text-14px text-gray-400 mb-20px">今日待跟进</div>
|
||||
<CountTo
|
||||
@@ -85,8 +111,8 @@
|
||||
<div class="flex justify-between items-center">
|
||||
<span>跟进榜Top10</span>
|
||||
<el-radio-group v-model="followDate" size="small" @change="getFollowList">
|
||||
<el-radio :label="1">本日</el-radio>
|
||||
<el-radio :label="2">本月</el-radio>
|
||||
<el-radio :label="1" :value="1">本日</el-radio>
|
||||
<el-radio :label="2" :value="2">本月</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
@@ -113,9 +139,16 @@
|
||||
</template>
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-table :data="signList" size="small">
|
||||
<el-table-column type="index" />
|
||||
<el-table-column prop="username" label="姓名" width="100" />
|
||||
<el-table-column prop="followNum" label="成交数量" width="70" />
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column prop="username" label="姓名" width="80" />
|
||||
<el-table-column prop="followNum" label="成交数量" width="90" sortable />
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType != 1"
|
||||
prop="signPrice"
|
||||
label="成交额"
|
||||
min-width="90"
|
||||
sortable
|
||||
/>
|
||||
<el-table-column prop="deptName" label="所属组织" width="150" />
|
||||
</el-table>
|
||||
</el-skeleton>
|
||||
@@ -142,11 +175,13 @@ import { useUserStore } from '@/store/modules/user'
|
||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
import { lineOptions } from './echarts-data'
|
||||
import * as HomeApi from '@/api/home/index'
|
||||
import { getWaitCount } from '@/api/okr/wait'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const appStore = useAppStore()
|
||||
const router = useRouter() // 路由对象
|
||||
const loading = ref(false)
|
||||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
|
||||
const username = userStore.getUser.nickname
|
||||
@@ -236,8 +271,27 @@ function getSignList() {
|
||||
})
|
||||
}
|
||||
|
||||
function getWaitTargetCount() {
|
||||
getWaitCount({}).then((res) => {
|
||||
waitCount.value = res
|
||||
})
|
||||
}
|
||||
|
||||
const waitCount = ref({
|
||||
dayEndAgentWorkNum: 0,
|
||||
myAgentWorkNum: 0,
|
||||
urgeAgentWorkNum: 0,
|
||||
notifyNum: 0
|
||||
})
|
||||
|
||||
const getAllApi = async () => {
|
||||
await Promise.all([getClueInfo(), getSignList(), getMonthlySaleRate(), getFollowList()])
|
||||
await Promise.all([
|
||||
getClueInfo(),
|
||||
getSignList(),
|
||||
getMonthlySaleRate(),
|
||||
getFollowList(),
|
||||
getWaitTargetCount()
|
||||
])
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
||||
248
src/views/Home/SalesReport.vue
Normal file
248
src/views/Home/SalesReport.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.consultTime"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
start-placeholder="选择日期"
|
||||
end-placeholder="选择日期"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.nickname" placeholder="销售姓名" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tree-select
|
||||
v-model="searchForm.sourceId"
|
||||
:data="sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-select
|
||||
v-model="searchForm.licenseTypeList"
|
||||
placeholder="选择驾照类型"
|
||||
clearable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="item in licenseTypeOptions"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
stripe
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
<el-table-column type="index" width="60" fixed="left" align="center" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row)">{{
|
||||
row.nickname
|
||||
}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="newClueNumber" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="咨询日期在所选周期内的线索总数" />
|
||||
<span>新线索数</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成交数" prop="signNumber" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="成交日期在所选周期内的成交数" />
|
||||
<span>成交数</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="成交率"
|
||||
prop="signRate"
|
||||
sortable
|
||||
min-width="100"
|
||||
:formatter="(row) => row.signRate + '%'"
|
||||
/>
|
||||
<el-table-column label="跟进数/日" prop="dayFollowNumber" sortable min-width="100" />
|
||||
<el-table-column label="成交数/日" prop="daySignNumber" sortable min-width="100" />
|
||||
<el-table-column label="平均成交周期" prop="averageSignPeriod" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="平均每条成交的线索,从咨询开始到成交所需要的天数" />
|
||||
<span>平均成交周期</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="grossProfitOfSingleSign" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip
|
||||
message="平均每笔成交订单的公司利润【按照登记,不按审核到账】=总公司利润/总成交数"
|
||||
/>
|
||||
<span>毛利/单</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="payPriceOfSingleSign" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip
|
||||
message="平均每笔成交订单的额外支出(返费等)【按照登记,不按审核到账】=总支出/总成交数"
|
||||
/>
|
||||
<span>支出/单</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="costOfSingleClue" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="平均每条线索的成本=总线索成本/新线索条数" />
|
||||
<span>线索成本/条</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="netProfitOfSingleSign" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="=(总公司利润-总支出-总线索成本)/总成交数" />
|
||||
<span>净利润/单</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总线索成本" prop="clueCostTotal" sortable min-width="100" />
|
||||
<el-table-column label="总支出" prop="payPriceTotal" sortable min-width="100" />
|
||||
<el-table-column label="总利润" prop="profitTotal" sortable min-width="100" />
|
||||
<el-table-column prop="efficiency" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="=总利润/(总成本+总支出)" />
|
||||
<span>能效</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="撞单数" prop="repeatClueNum" sortable min-width="100" />
|
||||
<el-table-column label="撞单成交数" prop="repeatClueSignNum" sortable min-width="100" />
|
||||
</el-table>
|
||||
|
||||
<DialogSalerReportDetail
|
||||
:licenseTypeOptions="licenseTypeOptions"
|
||||
:source-options="sourceOptions"
|
||||
ref="SalerDetailDialog"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<script setup name="SalesReport">
|
||||
import DialogSalerReportDetail from './Comp/DialogSalerReportDetail.vue'
|
||||
|
||||
import * as reportApi from '@/api/home/reportSaler'
|
||||
import { getSimpleSourceList as getResourceOptions } from '@/api/clue/source'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import { getIntDictOptions } from '@/utils/dict'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const appStore = useAppStore()
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleReset()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'sourceName',
|
||||
value: 'sourceId',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
|
||||
const sourceOptions = ref([])
|
||||
const licenseTypeOptions = ref([])
|
||||
|
||||
const searchForm = ref({})
|
||||
|
||||
function handleReset() {
|
||||
const year = new Date().getFullYear()
|
||||
const month = new Date().getMonth() + 1 + ''
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
consultTime: [`${year}-${month.padStart(2, '0')}-01`, formatDate(new Date())],
|
||||
licenseTypeList: [],
|
||||
sourceId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const avgData = ref({})
|
||||
async function handleSearch() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await reportApi.getList(removeNullField(searchForm.value))
|
||||
tableList.value = data.personDataVOList
|
||||
avgData.value = data.averageDataVO
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries({ columns, data }) {
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index == 0) {
|
||||
sums[index] = '统计'
|
||||
return
|
||||
}
|
||||
|
||||
const doubleSumsColumns = [
|
||||
'newClueNumber',
|
||||
'signNumber',
|
||||
'clueCostTotal',
|
||||
'payPriceTotal',
|
||||
'profitTotal'
|
||||
]
|
||||
if (column.property in avgData.value) {
|
||||
sums[index] = `均值: ${avgData.value[column.property]}`
|
||||
} else if (doubleSumsColumns.includes(column.property)) {
|
||||
const values = data.map((item) => Number(item[column.property]))
|
||||
let sum = values.reduce((prev, curr) => prev + curr, 0)
|
||||
let avg = sum / values.length
|
||||
if (['newClueNumber', 'signNumber'].includes(column.property)) {
|
||||
avg = Math.floor(avg)
|
||||
} else {
|
||||
sum = sum.toFixed(2)
|
||||
avg = avg.toFixed(2)
|
||||
}
|
||||
sums[index] = h('div', {}, [h('div', {}, `合计:${sum}`), h('div', {}, `均值:${avg}`)])
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
|
||||
const SalerDetailDialog = ref()
|
||||
function handleDetail(info) {
|
||||
SalerDetailDialog.value.open(info, searchForm.value)
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
getResourceOptions().then((data) => {
|
||||
sourceOptions.value = handleTree(data, 'sourceId')
|
||||
})
|
||||
licenseTypeOptions.value = getIntDictOptions('license_type')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
225
src/views/Kpi/Appraise/Components/DialogAppraise.vue
Normal file
225
src/views/Kpi/Appraise/Components/DialogAppraise.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<Dialog :title="title" v-model="show" width="800px">
|
||||
<el-form v-loading="formLoading" :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="考核指标" prop="examineTarget">
|
||||
<el-input v-model="form.examineTarget" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="生效日期" prop="effectiveDate">
|
||||
<el-date-picker
|
||||
v-model="form.effectiveDate"
|
||||
:disabled="form.id"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="模式" prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio
|
||||
v-for="(item, index) in prop.kpiModeOoptions"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="权重" prop="weight">
|
||||
<el-input-number v-model="form.weight" :min="0" :step="1" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="评分上限" prop="examineScore">
|
||||
<el-input-number v-model="form.examineScore" :min="0" :step="1" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="考核内容" prop="examineContent">
|
||||
<Editor
|
||||
v-model:modelValue="form.examineContent"
|
||||
height="150px"
|
||||
:toolbarConfig="{
|
||||
toolbarKeys: []
|
||||
}"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="考核规则" prop="examineRule">
|
||||
<Editor
|
||||
v-model:modelValue="form.examineRule"
|
||||
height="150px"
|
||||
:toolbarConfig="{ toolbarKeys: [] }"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="考核员工" prop="examinedUserIdList">
|
||||
<div>
|
||||
<el-checkbox
|
||||
v-model="checkAll"
|
||||
:indeterminate="isIndeterminate"
|
||||
@change="handleCheckAllChange"
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-checkbox-group v-model="form.examinedUserIdList" @change="handleCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:disabled="item.status == 1"
|
||||
:label="item.id"
|
||||
:value="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button type="primary" :disabled="formLoading" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogAppraise">
|
||||
import * as KpiApi from '@/api/kpi/index.js'
|
||||
|
||||
const prop = defineProps({
|
||||
kpiModeOoptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
const title = ref('')
|
||||
const formType = ref('create')
|
||||
|
||||
const form = ref({})
|
||||
const formLoading = ref(false)
|
||||
const rules = ref({
|
||||
examineTarget: { required: true, message: '标题不可为空', trigger: 'blur' },
|
||||
effectiveDate: { required: true, message: '生效日期不可为空', trigger: 'blur,change' },
|
||||
examineContent: { required: true, message: '标题不可为空', trigger: 'blur' },
|
||||
examineRule: { required: true, message: '标题不可为空', trigger: 'blur' }
|
||||
})
|
||||
|
||||
async function open(type, val) {
|
||||
show.value = true
|
||||
title.value = type == 'update' ? '修改考核项' : '新增考核项'
|
||||
formType.value = type
|
||||
resetForm()
|
||||
if (val) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
form.value = await KpiApi.getKpiDetail(val)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
getOptions()
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
KpiApi.getKpiEmployees().then((data) => {
|
||||
employeeOptions.value = data
|
||||
if (formType.value == 'update') {
|
||||
handleCheckedChange(form.value.examinedUserIdList)
|
||||
} else {
|
||||
handleCheckAllChange(true)
|
||||
checkAll.value = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
form.value = {
|
||||
examineTarget: '',
|
||||
type: '3',
|
||||
weight: 0,
|
||||
examineContent: ``,
|
||||
examineRule: ``,
|
||||
examineScore: 5,
|
||||
examinedUserIdList: []
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (formType.value === 'create') {
|
||||
await KpiApi.createKpi(form.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await KpiApi.updateKpi(form.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const checkAll = ref(false)
|
||||
const isIndeterminate = ref(false)
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function handleCheckAllChange(val) {
|
||||
form.value.examinedUserIdList = val ? employeeOptions.value.map((it) => it.id) : []
|
||||
isIndeterminate.value = false
|
||||
}
|
||||
|
||||
function handleCheckedChange(value) {
|
||||
const checkedCount = value.length
|
||||
checkAll.value = checkedCount === employeeOptions.value.length
|
||||
isIndeterminate.value = checkedCount > 0 && checkedCount < employeeOptions.value.length
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
156
src/views/Kpi/Appraise/index.vue
Normal file
156
src/views/Kpi/Appraise/index.vue
Normal file
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="searchForm" ref="queryFormRef" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.examineTarget" placeholder="请输入考核指标" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery" v-hasPermi="['kpi:appraise:search']"> 搜索</el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['kpi:appraise:reset']"> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['kpi:appraise:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list" border>
|
||||
<el-table-column prop="examineTarget" label="考核指标" width="180" />
|
||||
<el-table-column prop="typeName" label="分值模式" width="90" :formatter="getKpiModeLabel" />
|
||||
<el-table-column prop="weight" label="权重%" width="90" />
|
||||
<el-table-column label="考核内容">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineContent"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考核规则" prop="examineRule">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineRule"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分上限" prop="examineScore" width="90" />
|
||||
<el-table-column label="考核人数" width="90">
|
||||
<template #default="{ row }">
|
||||
{{ row.examinedUserIdList?.length || 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生效日期" prop="effectiveDate" width="120" />
|
||||
<el-table-column label="操作" class-name="fixed-width" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', row.id)"
|
||||
v-hasPermi="['kpi:appraise:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(row.id)"
|
||||
v-hasPermi="['kpi:appraise:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<DialogAppraise ref="formRef" :kpiModeOoptions="kpiModeOoptions" @success="handleQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="KpiContent">
|
||||
import { removeNullField } from '@/utils'
|
||||
import DialogAppraise from './Components/DialogAppraise.vue'
|
||||
import * as KpiApi from '@/api/kpi/index.js'
|
||||
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const searchForm = ref({
|
||||
examineTarget: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
const total = ref(0)
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
const kpiModeOoptions = ref([])
|
||||
function getOptions() {
|
||||
getGeneralSysDictData('examine_type').then((data) => {
|
||||
kpiModeOoptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function getKpiModeLabel(row) {
|
||||
return kpiModeOoptions.value.find((it) => it.value == row.type)?.label
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await KpiApi.getKpiPage(removeNullField(searchForm.value))
|
||||
list.value = data.list
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
searchForm.value = {
|
||||
examineTarget: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type, id) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await KpiApi.deleteKpi(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
214
src/views/Kpi/Score/index.vue
Normal file
214
src/views/Kpi/Score/index.vue
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="searchForm" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.period"
|
||||
type="month"
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM"
|
||||
:clearable="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getList" v-hasPermi="['kpi:score:search']"> 搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tabs v-model="employeeId" @tab-click="getList">
|
||||
<el-tab-pane
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.examinedUser"
|
||||
:name="item.examinedUser"
|
||||
>
|
||||
<template #label>
|
||||
<span>{{ item.examinedUserName }}</span>
|
||||
<el-badge :is-dot="item.notExaminedCount > 0" type="danger" />
|
||||
</template>
|
||||
<div class="mb-10px">
|
||||
<el-tag v-if="periodSaved == 1" type="danger">
|
||||
当前周期已封存,不可修改当月绩效考核
|
||||
</el-tag>
|
||||
<el-tag v-else type="warning">
|
||||
当前周期未封存,可选择修改当月绩效考核,两秒内不操作将自动保存考核结果
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
<el-table-column prop="examineTarget" label="考核指标" width="180" />
|
||||
<el-table-column prop="typeName" label="分值模式" width="90" />
|
||||
<el-table-column prop="weight" label="权重%" width="90" />
|
||||
<el-table-column label="考核内容">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineContent"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考核规则" prop="examineRule">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.examineRule"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分上限" prop="examineScore" width="90" />
|
||||
<el-table-column label="考核评分" width="120">
|
||||
<template #default="{ row }">
|
||||
<div v-if="periodSaved == 1">{{ row.score }}</div>
|
||||
<el-input-number
|
||||
v-else
|
||||
v-model="row.score"
|
||||
:min="0"
|
||||
:max="row.examineScore"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
@input="handleSave(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分备注" width="200">
|
||||
<template #default="{ row }">
|
||||
<div v-if="periodSaved == 1">{{ row.remark }}</div>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="row.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
@input="handleSave(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加权得分" prop="weightSocre" width="90" />
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button style="padding: 0" type="danger" text @click="handleDelete(row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="KpiScore">
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import * as KpiApi from '@/api/kpi/score.js'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const loading = ref(false) // 列表的加载中
|
||||
const list = ref([]) // 列表的数据
|
||||
const searchForm = ref({
|
||||
period: undefined
|
||||
})
|
||||
|
||||
const periodSaved = ref(0)
|
||||
|
||||
const employeeOptions = ref([])
|
||||
const employeeId = ref('')
|
||||
|
||||
onMounted(() => {
|
||||
// 默认取上个月
|
||||
const today = new Date()
|
||||
searchForm.value.period = formatDate(
|
||||
new Date(today.getFullYear(), today.getMonth() - 1),
|
||||
'YYYY-MM'
|
||||
)
|
||||
|
||||
KpiApi.getKpiPeriodStatus({ period: searchForm.value.period }).then((data) => {
|
||||
periodSaved.value = data.status
|
||||
})
|
||||
|
||||
getList()
|
||||
})
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
// 获取当前要考核的人员
|
||||
const arr = await KpiApi.getKpiEmployees(searchForm.value)
|
||||
employeeOptions.value = arr || []
|
||||
if (employeeOptions.value.length > 0) {
|
||||
if (!employeeId.value) {
|
||||
employeeId.value = employeeOptions.value[0].examinedUser
|
||||
}
|
||||
} else {
|
||||
message.error('当月无待考核员工!!!')
|
||||
return
|
||||
}
|
||||
list.value =
|
||||
employeeOptions.value.find((it) => it.examinedUser == employeeId.value)
|
||||
?.examineScoreRespVOList || []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
let timer = ref(null)
|
||||
const lastId = ref('')
|
||||
function handleSave(row) {
|
||||
try {
|
||||
lastId.value == row.id && clearTimeout(timer.value)
|
||||
timer.value = setTimeout(async () => {
|
||||
lastId.value = row.id
|
||||
// message.success('正在保存数据,请稍后')
|
||||
await KpiApi.saveKpiScore({
|
||||
id: row.id,
|
||||
score: row.score,
|
||||
remark: row.remark
|
||||
})
|
||||
message.success('修改成功!')
|
||||
getList()
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDelete(row) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm(
|
||||
`删除后,该员工于${searchForm.value.period}将不再考核此项,是否确认删除?`
|
||||
)
|
||||
// 发起删除
|
||||
await KpiApi.deleteKpiItem({ id: row.id })
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function getSummaries({ columns, data }) {
|
||||
let sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index == 0) {
|
||||
sums[index] = '考核总分'
|
||||
return
|
||||
}
|
||||
const values = data.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
if (column.property == 'weightSocre') {
|
||||
const employee = employeeOptions.value.find((it) => it.examinedUser == employeeId.value)
|
||||
sums[index] = employee.scoreTotal + '分'
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,54 +1,25 @@
|
||||
<template>
|
||||
<div
|
||||
:class="prefixCls"
|
||||
class="h-[100%] relative <xl:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"
|
||||
class="h-[100%] relative dark:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"
|
||||
>
|
||||
<div class="relative h-full flex mx-auto">
|
||||
<div
|
||||
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px <xl:hidden`"
|
||||
>
|
||||
<div :class="`${prefixCls}__left w-[30%] <lg:w-[100%] left-box relative p-30px <xl:p-20px`">
|
||||
<!-- 左上角的 logo + 系统标题 -->
|
||||
<div class="flex items-center relative text-white">
|
||||
<img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
|
||||
</div>
|
||||
<!-- 左边的背景图 + 欢迎语 -->
|
||||
<div class="flex justify-center">
|
||||
<TransitionGroup
|
||||
appear
|
||||
enter-active-class="animate__animated animate__bounceInLeft"
|
||||
tag="div"
|
||||
>
|
||||
<img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />
|
||||
<!-- <div key="2" class="text-3xl text-white">{{ t('login.welcome') }}</div> -->
|
||||
</TransitionGroup>
|
||||
</div>
|
||||
|
||||
<div class="landIn">
|
||||
<transition-group name="text-animation">
|
||||
<span v-for="(char, index) in chars" :key="index">{{ char }}</span>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 p-30px <sm:p-10px dark:bg-v-dark relative">
|
||||
<!-- 右上角的主题、语言选择 -->
|
||||
<div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
|
||||
<div class="flex items-center @2xl:hidden @xl:hidden">
|
||||
<img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-end items-center space-x-10px">
|
||||
<ThemeSwitch />
|
||||
<!-- <LocaleDropdown class="<xl:text-white dark:text-white" /> -->
|
||||
</div>
|
||||
<div class="flex items-center relative">
|
||||
<h2 class="mb-3 text-2xl font-bold">
|
||||
欢迎使用 {{ underlineToHump(appInfo.instanceName) }}
|
||||
</h2>
|
||||
<!-- <img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" /> -->
|
||||
<!-- <span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span> -->
|
||||
</div>
|
||||
<!-- 右边的登录界面 -->
|
||||
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
||||
<div
|
||||
class="h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px"
|
||||
class="flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px <xl:mt-20px"
|
||||
>
|
||||
<!-- 账号登录 -->
|
||||
<LoginForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
||||
<LoginForm class="p-40px <xl:p-10px h-auto m-auto" />
|
||||
<!-- 手机登录 -->
|
||||
<!-- <MobileForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||
<!-- 二维码登录 -->
|
||||
@@ -59,6 +30,39 @@
|
||||
<!-- <SSOLoginVue class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||
</div>
|
||||
</Transition>
|
||||
<!-- 左边的背景图 + 欢迎语 -->
|
||||
<div class="flex justify-center">
|
||||
<TransitionGroup
|
||||
appear
|
||||
enter-active-class="animate__animated animate__bounceInLeft"
|
||||
tag="div"
|
||||
>
|
||||
<!-- <img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" /> -->
|
||||
<img key="1" alt="" class="w-[50%] m-auto" src="@/assets/imgs/login2.gif" />
|
||||
</TransitionGroup>
|
||||
</div>
|
||||
|
||||
<div class="landIn">
|
||||
<transition-group name="text-animation">
|
||||
<span v-for="(char, index) in chars" :key="index">{{ char }}</span>
|
||||
</transition-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-box flex-1 p-30px <sm:p-10px dark:bg-v-dark <lg:hidden relative">
|
||||
<!-- 右上角的主题、语言选择 -->
|
||||
<div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
|
||||
<div class="flex items-center @2xl:hidden @xl:hidden">
|
||||
<!-- <img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" /> -->
|
||||
<!-- <span class="text-20px font-bold text-black">
|
||||
欢迎使用 {{ underlineToHump(appInfo.instanceName) }}
|
||||
</span> -->
|
||||
</div>
|
||||
<div class="flex justify-end items-center space-x-10px">
|
||||
<ThemeSwitch />
|
||||
<!-- <LocaleDropdown class="<xl:text-white dark:text-white" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<img src="@/assets/imgs/shisong.jpg" width="80%" alt="" srcset="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,7 +100,7 @@ const chars = computed(() => {
|
||||
return text.slice(0, currentCharIndex.value)
|
||||
})
|
||||
|
||||
async function init() {
|
||||
function init() {
|
||||
const res = currentRoute.value?.query?.tenantId
|
||||
authUtil.setTenantId(res)
|
||||
|
||||
@@ -137,7 +141,7 @@ $prefix-cls: #{$namespace}-login;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('@/assets/svgs/login-bg.svg');
|
||||
// background-image: url('@/assets/svgs/login-bg.svg');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
content: '';
|
||||
@@ -145,6 +149,20 @@ $prefix-cls: #{$namespace}-login;
|
||||
}
|
||||
}
|
||||
|
||||
// .left-box {
|
||||
// background: #f3f4fb;
|
||||
// background-image: url('@/assets/imgs/login-left-bg.png');
|
||||
// background-repeat: no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
// }
|
||||
|
||||
.login-box {
|
||||
background-image: url('@/assets/imgs/shisong.jpg');
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 80% 80%;
|
||||
}
|
||||
|
||||
.text-animation-enter-active,
|
||||
.text-animation-leave-active {
|
||||
transition: opacity 0.5s;
|
||||
@@ -160,12 +178,11 @@ $prefix-cls: #{$namespace}-login;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-size: 18px;
|
||||
line-height: 1.8;
|
||||
font-size: 1rem;
|
||||
line-height: 1.3;
|
||||
font-family: Lora, serif;
|
||||
white-space: pre;
|
||||
font-weight: 600;
|
||||
color: #6ee1f5;
|
||||
|
||||
span {
|
||||
animation: landIn 0.8s ease-out both;
|
||||
|
||||
@@ -11,10 +11,13 @@
|
||||
>
|
||||
<el-row style="margin-left: -10px; margin-right: -10px">
|
||||
<el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<slot name="title"></slot>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<el-form-item>
|
||||
<LoginFormTitle style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantId">
|
||||
<el-input
|
||||
@@ -107,7 +110,7 @@
|
||||
</template>
|
||||
<script name="LoginForm" setup>
|
||||
import { ElLoading } from 'element-plus'
|
||||
import LoginFormTitle from './LoginFormTitle.vue'
|
||||
// import LoginFormTitle from './LoginFormTitle.vue'
|
||||
|
||||
import { useIcon } from '@/hooks/web/useIcon'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
@@ -7,11 +7,17 @@
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="名称" prop="label">
|
||||
<el-input v-model="formData.label" placeholder="请输入供应商名称" />
|
||||
<el-form-item label="名称" prop="supplierName">
|
||||
<el-input v-model="formData.supplierName" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||
<el-form-item label="微信群" prop="wechatGroup">
|
||||
<el-input v-model="formData.wechatGroup" placeholder="请输入微信群" />
|
||||
</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-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
@@ -29,7 +35,7 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogSupplier" setup>
|
||||
import * as dictApi from '@/api/system/dict/dict.data'
|
||||
import * as SupplierApi from '@/api/school/setting/supplier'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -38,12 +44,12 @@ const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
label: '',
|
||||
sort: 1,
|
||||
supplierName: '',
|
||||
wechatGroup: 1,
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
label: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||
supplierName: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
@@ -57,7 +63,7 @@ const open = async (type, id) => {
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await dictApi.getDictData(id)
|
||||
formData.value = await SupplierApi.getSupplier(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -75,14 +81,11 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (!formData.value.value) {
|
||||
formData.value.value = formData.value.label
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await dictApi.createDictData(formData.value)
|
||||
await SupplierApi.createSupplier(formData.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await dictApi.updateDictData(formData.value)
|
||||
await SupplierApi.updateSupplier(formData.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
@@ -96,10 +99,9 @@ const submitForm = async () => {
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
label: '',
|
||||
sort: 1,
|
||||
supplierName: '',
|
||||
wechatGroup: '',
|
||||
status: 0,
|
||||
dictType: 'erp_supplier',
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.name"
|
||||
v-model="searchForm.supplierName"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
@@ -16,8 +16,13 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column prop="label" label="供应商名称" />
|
||||
<el-table-column prop="sort" label="排序" width="100px" />
|
||||
<el-table-column prop="supplierName" label="供应商名称" />
|
||||
<el-table-column prop="wechatGroup" label="微信群名称" />
|
||||
<el-table-column label="状态" min-width="150" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
@@ -46,16 +51,16 @@
|
||||
<script setup name="SupplierSet">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import DialogSupplier from './DialogSupplier.vue'
|
||||
import * as dictApi from '@/api/system/dict/dict.data'
|
||||
import * as SupplierApi from '@/api/school/setting/supplier'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
label: '',
|
||||
supplierName: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
dictType: 'erp_supplier'
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
@@ -69,10 +74,9 @@ function handleQuery() {
|
||||
}
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
label: '',
|
||||
supplierName: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
dictType: 'erp_supplier'
|
||||
pageNo: 1
|
||||
}
|
||||
getList()
|
||||
}
|
||||
@@ -80,7 +84,7 @@ function resetQuery() {
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await dictApi.getDictDataPage(searchForm.value)
|
||||
const data = await SupplierApi.getSupplierPage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -97,7 +101,7 @@ async function handleDelete(id) {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await dictApi.deleteDictData(id)
|
||||
await SupplierApi.deleteSupplier(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" class="mt-20px" :data="tableList" border>
|
||||
<el-table-column type="expand" width="30">
|
||||
<el-table-column type="expand" width="30" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<div class="pl-100px pr-100px">
|
||||
<el-table :data="row.productSpecList">
|
||||
@@ -71,16 +71,16 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="productId" label="产品编码" prop="productId" />
|
||||
<el-table-column show-overflow-tooltip label="产品名称" min-width="200" prop="productName" />
|
||||
<el-table-column label="分类" min-width="90" prop="productCategoryName" />
|
||||
<el-table-column label="品牌" min-width="90" prop="productBrandName" />
|
||||
<el-table-column show-overflow-tooltip label="产品名称" min-width="100" prop="productName" />
|
||||
<el-table-column label="分类" width="90" prop="productCategoryName" />
|
||||
<el-table-column label="品牌" width="90" prop="productBrandName" />
|
||||
<el-table-column label="商品图" min-width="80">
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.mainImage" @click="imagePreview(row.mainImage)" class="w-30px h-30px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="简介" min-width="70" prop="productIntro" />
|
||||
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="180" />
|
||||
<el-table-column label="简介" min-width="200" prop="productIntro" />
|
||||
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="120" />
|
||||
<el-table-column v-for="item in diyFieldList" :key="item.clueParamId" :label="item.label">
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.component == 'DatePicker'">
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
<el-select v-model="form.supplier" placeholder="选择供应商" filterable>
|
||||
<el-option
|
||||
v-for="item in opts.supplier"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.id"
|
||||
:label="item.supplierName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
<el-select v-model="queryParams.supplier" placeholder="供应商" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in opts.supplier"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.id"
|
||||
:label="item.supplierName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -135,7 +135,7 @@ import { allSchemas } from './index.data.js'
|
||||
import DialogAdd from './Comp/DialogAdd.vue'
|
||||
import DialogAudit from './Comp/DialogAudit.vue'
|
||||
import * as PurchaseApi from '@/api/mall/purchase'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { getSupplierSimpleList } from '@/api/school/setting/supplier'
|
||||
|
||||
const creatPurchase = ref()
|
||||
const auditPurchase = ref()
|
||||
@@ -164,7 +164,9 @@ function getOptions() {
|
||||
ProductApi.getSimpleProductList().then((data) => {
|
||||
opts.value.product = data
|
||||
})
|
||||
opts.value.supplier = getDictOptions('erp_supplier')
|
||||
getSupplierSimpleList().then((data) => {
|
||||
opts.value.supplier = data
|
||||
})
|
||||
}
|
||||
|
||||
function changeProd(val) {
|
||||
|
||||
600
src/views/OKR/Analysis/index.vue
Normal file
600
src/views/OKR/Analysis/index.vue
Normal file
@@ -0,0 +1,600 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row class="mb-10px flex justify-between items-start">
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
check-strictly
|
||||
style="width: 300px"
|
||||
@change="nodeChange"
|
||||
/>
|
||||
<div class="flex justify-end flex-1">
|
||||
<el-button type="info" @click="handleExport">导出</el-button>
|
||||
<el-popover
|
||||
ref="countRef"
|
||||
placement="left"
|
||||
:title="`${currentNode?.nodeName} 数据汇总`"
|
||||
trigger="click"
|
||||
width="500px"
|
||||
v-model:visible="showCountPop"
|
||||
>
|
||||
<template #reference><el-button>数据汇总</el-button></template>
|
||||
<el-table :data="countInfo" stripe>
|
||||
<el-table-column prop="keyResultShowName" label="项目名称" />
|
||||
<el-table-column prop="currentValue" label="当前值" width="90" />
|
||||
<el-table-column prop="targetValue" label="预期值" width="90" />
|
||||
<el-table-column label="完成度" width="150">
|
||||
<template #default="{ row }">
|
||||
<el-progress
|
||||
:percentage="parseInt((row.currentValue / row.targetValue) * 100) || 0"
|
||||
:color="customColors"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-popover>
|
||||
<el-button type="primary" @click="openDrawer(1, currentNode.nodeId, currentNode.nodeName)">
|
||||
节点笔谈
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
id="okrAnalysisTable"
|
||||
:data="originList"
|
||||
border
|
||||
:show-summary="!!tableKeywords"
|
||||
:span-method="objectSpanMethod"
|
||||
@cell-click="handleClickCell"
|
||||
>
|
||||
<el-table-column prop="objectInfo.objectiveName" label="目标">
|
||||
<template #default="{ row }">
|
||||
{{ row.objectInfo.objectiveName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="objectiveId" label="占比" width="100px">
|
||||
<template #default> 0 </template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="keyResultShowName">
|
||||
<template #header>
|
||||
<div class="flex items-center justify-center">
|
||||
<div class="flex-1 mr-10px">
|
||||
<el-input
|
||||
v-if="showTableSearch"
|
||||
v-model="tableKeywords"
|
||||
placeholder="请输入关键字"
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
@change="handleTableFilter"
|
||||
/>
|
||||
<div v-else>关键成果</div>
|
||||
</div>
|
||||
<el-button type="primary" size="small" @click="handleFilterTableClick">
|
||||
{{ showTableSearch ? '取消' : '筛选' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
{{ row.sourceName ? `【${row.sourceName}】` : '' }} {{ row.keyResultShowName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="targetValue" label="目标值" width="100px" />
|
||||
<el-table-column prop="currentValue" label="当前进度" width="100px" />
|
||||
<el-table-column label="开始日期" width="120px">
|
||||
<template #default>
|
||||
{{ currentNode.startTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="完成状态" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.currentValue >= row.targetValue" type="success">完成</el-tag>
|
||||
<el-tag v-else type="danger">未完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="muis" label="差值" width="100px">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
:style="{
|
||||
color: row.targetValue >= row.currentValue ? 'red' : '#333',
|
||||
'font-weight': row.targetValue >= row.currentValue ? 'bold' : '500'
|
||||
}"
|
||||
>
|
||||
{{ parseInt(row.targetValue - row.currentValue) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="complete" label="完成度" width="200px">
|
||||
<template #default="{ row }">
|
||||
<el-progress :percentage="parseInt(row.progress)" :color="customColors" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="结束日期" width="120px">
|
||||
<template #default>
|
||||
{{ currentNode.endTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="objectInfo.progress" label="目标完成度" width="100px" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ parseInt(row.objectInfo.progress) }}%
|
||||
<!-- <el-progress :percentage="parseInt(row.objectInfo.progress)" :color="customColors" /> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-drawer
|
||||
v-if="showDrawer"
|
||||
v-model="showDrawer"
|
||||
:title="drawerTitle"
|
||||
size="60vw"
|
||||
direction="rtl"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-tabs v-model="currentType" @tab-click="searchCommentList()">
|
||||
<el-tab-pane
|
||||
v-for="item in commentTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:name="item.id"
|
||||
>
|
||||
<div v-if="item.id == currentType">
|
||||
<div v-if="addNewComment">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<el-button size="small" @click="addNewComment = false"> 取消 </el-button>
|
||||
<el-button type="primary" size="small" @click="handleSaveComment">
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-10px" v-if="addNewComment">
|
||||
<Editor
|
||||
v-model:modelValue="form.commentValue"
|
||||
height="300px"
|
||||
:toolbarConfig="toolbarConfig"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<el-button v-else type="primary" size="small" @click="handleInsertComment">
|
||||
新增
|
||||
</el-button>
|
||||
<div
|
||||
v-for="(it, index) in commentList"
|
||||
:key="it.commentId"
|
||||
class="border-b-1"
|
||||
style="padding: 10px 5px"
|
||||
>
|
||||
<div
|
||||
class="flex items-center justify-between overflow-hidden text-16px"
|
||||
style="line-height: 30px"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<el-avatar
|
||||
shape="circle"
|
||||
style="
|
||||
background-color: var(--el-color-primary-light-3);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
"
|
||||
fit="fill"
|
||||
>
|
||||
<span class="text-12px">{{ it.creatorName.slice(-2) }}</span>
|
||||
</el-avatar>
|
||||
<div class="ml-10px text-16px">{{ it.creatorName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px" v-dompurify-html="it.content"></div>
|
||||
<div
|
||||
class="ml-10px mt-10px flex items-center justify-between text-12px"
|
||||
style="line-height: 20px; color: #aaa"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="good(it)">
|
||||
<Icon
|
||||
icon="fa:thumbs-o-up"
|
||||
:size="16"
|
||||
:color="it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'"
|
||||
/>
|
||||
</el-button>
|
||||
<span
|
||||
class="ml-5px"
|
||||
:style="{
|
||||
color: it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'
|
||||
}"
|
||||
>{{ it.likeCount }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="showChildComment(index)">
|
||||
<Icon icon="ep:chat-dot-square" :size="16" color="#333" />
|
||||
</el-button>
|
||||
<span class="ml-5px" style="color: #333">{{ it.commentCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px text-13px text-gray-400">
|
||||
{{ formatDate(it.createTime, 'YYYY-MM-DD HH:mm') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 评论 -->
|
||||
<div
|
||||
v-if="showCommentIndex == index"
|
||||
class="bg-gray-100 pl-10px pr-10px pt-5px pb-5px"
|
||||
style="margin: 10px 10px 0 10px; border-radius: 4px"
|
||||
label="笔谈"
|
||||
>
|
||||
<div
|
||||
v-for="subComment in it.children.sort((a, b) => a.createTime - b.createTime)"
|
||||
:key="subComment.commentId"
|
||||
class="text-14px"
|
||||
style="line-height: 24px"
|
||||
>
|
||||
<span class="font-bold">{{ subComment.creatorName }}:</span>
|
||||
<span>
|
||||
{{ subComment.content }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10px relative">
|
||||
<!-- <el-input
|
||||
v-model="form.commentValue"
|
||||
placeholder="请输入评论"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
/> -->
|
||||
<el-mention
|
||||
v-model="form.commentValue"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
:options="employeeOptions"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
whole
|
||||
placeholder="请输入内容"
|
||||
@select="handleMention"
|
||||
>
|
||||
<template #label="scope">
|
||||
<div class="flex items-center justify-between h-full">
|
||||
<span class="text-14px text-dark-700">{{ scope.item.name }}</span>
|
||||
<span class="text-12px text-gray-400">{{ scope.item.dept }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-mention>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="position: absolute; right: 2px; bottom: 2px"
|
||||
@click="handleSendCommnet(index)"
|
||||
>
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Analysis">
|
||||
import { listToTree, findNode } from '@/utils/tree'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { getAllNodeTree, getAllOkrPage, getOkrStatisticsTotal } from '@/api/okr/okr'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import {
|
||||
getCommentTypeOptions,
|
||||
createComment,
|
||||
getCommentPage,
|
||||
likeComment
|
||||
} from '@/api/okr/comment'
|
||||
import { exportTableWithVue } from '@/utils'
|
||||
|
||||
const message = useMessage()
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const currentNode = ref(undefined)
|
||||
const showDrawer = ref(false)
|
||||
const drawerTitle = ref('详情')
|
||||
|
||||
const customColors = [
|
||||
{ color: 'rgb(196, 86.4, 86.4)', percentage: 20 },
|
||||
{ color: 'rgb(196, 86.4, 86.4)', percentage: 40 },
|
||||
{ color: 'rgb(237.5, 189.9, 118.5)', percentage: 60 },
|
||||
{ color: 'rgb(159.5, 206.5, 255)', percentage: 80 },
|
||||
{ color: 'rgb(179, 224.5, 156.5)', percentage: 100 }
|
||||
]
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
const showTableSearch = ref(false)
|
||||
const tableKeywords = ref('')
|
||||
|
||||
handleSearchPeroid()
|
||||
getOptions()
|
||||
|
||||
// 当前是否是叶子节点
|
||||
// 如果不是叶子节点,则表格数据不可修改
|
||||
const isCurrentLeafNode = ref(false)
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getAllNodeTree().then((resp) => {
|
||||
if (resp.nodeId) {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
nodeChange(resp.nodeId)
|
||||
currentNode.value = (resp.tree || []).find((item) => item.nodeId === resp.nodeId)
|
||||
} else {
|
||||
message.warning('请先创建节点数据')
|
||||
}
|
||||
})
|
||||
}
|
||||
const showCountPop = ref(false)
|
||||
function nodeChange(nodeId) {
|
||||
if (nodeId) {
|
||||
searchForm.value.nodeId = nodeId
|
||||
getOkrList()
|
||||
getCountInfo()
|
||||
currentNode.value = findNode(peroidList.value, (node) => {
|
||||
return node.nodeId == nodeId
|
||||
})
|
||||
searchForm.value.creatorId = currentNode.value.creatorId
|
||||
if (!currentNode.value.children || currentNode.value.children.length == 0) {
|
||||
isCurrentLeafNode.value = true
|
||||
} else {
|
||||
isCurrentLeafNode.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const originList = ref([])
|
||||
const defaultTableList = ref([])
|
||||
const spanObj = ref([])
|
||||
function getOkrList() {
|
||||
getAllOkrPage(searchForm.value).then((resp) => {
|
||||
originList.value = []
|
||||
spanObj.value = []
|
||||
if (resp && resp.length) {
|
||||
resp.map((o) => {
|
||||
if (o.keyResults && o.keyResults.length) {
|
||||
const arr = o.keyResults.map((k, index) => {
|
||||
spanObj.value.push(index == 0 ? o.keyResults.length : 0)
|
||||
const obj = cloneDeep(o)
|
||||
delete obj.keyResults
|
||||
return {
|
||||
...k,
|
||||
objectInfo: obj
|
||||
}
|
||||
})
|
||||
originList.value = [...originList.value, ...arr]
|
||||
}
|
||||
})
|
||||
defaultTableList.value = [...originList.value]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const countInfo = ref([])
|
||||
function getCountInfo() {
|
||||
getOkrStatisticsTotal({ nodeId: searchForm.value.nodeId }).then(async (resp) => {
|
||||
countInfo.value = resp || []
|
||||
// await nextTick(() =)
|
||||
showCountPop.value = true
|
||||
})
|
||||
}
|
||||
|
||||
function objectSpanMethod({ column, rowIndex }) {
|
||||
if (['目标', '目标完成度'].includes(column.label)) {
|
||||
let _row = spanObj.value[rowIndex]
|
||||
let _col = _row > 0 ? 1 : 0
|
||||
return {
|
||||
rowspan: _row,
|
||||
colspan: _col
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleClickCell(row, column) {
|
||||
if (column.property === 'keyResultShowName') {
|
||||
openDrawer(2, row.keyResultId, `${row.sourceName} ${row.keyResultShowName}`)
|
||||
} else if (column.property === 'objectInfo.objectiveName') {
|
||||
openDrawer(3, row.objectInfo.objectiveId, row.objectInfo.objectiveName)
|
||||
}
|
||||
}
|
||||
|
||||
const commentTypeOptions = ref([])
|
||||
const currentType = ref(1) // 默认评论类型为1
|
||||
function getOptions() {
|
||||
getCommentTypeOptions().then((resp) => {
|
||||
commentTypeOptions.value = (resp || []).sort((pre, cur) => pre.sort - cur.sort)
|
||||
currentType.value = resp[0].id
|
||||
})
|
||||
getEmployeeSimpleList({ status: 0 }).then((resp) => {
|
||||
employeeOptions.value = resp.map((item) => ({
|
||||
...item,
|
||||
label: item.name,
|
||||
value: item.name
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
const commentList = ref([])
|
||||
const commentInfo = ref({
|
||||
businessType: undefined,
|
||||
businessId: undefined,
|
||||
commentType: undefined,
|
||||
pageSize: -1
|
||||
})
|
||||
function openDrawer(type, id, name) {
|
||||
showDrawer.value = true
|
||||
drawerTitle.value = `【${name}】笔谈`
|
||||
commentInfo.value = {
|
||||
businessType: type,
|
||||
businessId: id,
|
||||
commentType: currentType.value,
|
||||
pageSize: -1
|
||||
}
|
||||
searchCommentList()
|
||||
}
|
||||
|
||||
function searchCommentList() {
|
||||
commentInfo.value.commentType = currentType.value
|
||||
getCommentPage(commentInfo.value).then((resp) => {
|
||||
// commentList.value = resp.list
|
||||
commentList.value = listToTree(resp.list, {
|
||||
id: 'commentId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const showCommentIndex = ref(-1)
|
||||
function showChildComment(index) {
|
||||
showCommentIndex.value = showCommentIndex.value == index ? -1 : index
|
||||
}
|
||||
|
||||
function good(item) {
|
||||
likeComment(item.commentId).then(() => {
|
||||
message.success('点赞成功')
|
||||
searchCommentList()
|
||||
})
|
||||
}
|
||||
|
||||
const form = ref({
|
||||
commentValue: '',
|
||||
mentionedUserIdList: []
|
||||
})
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function handleMention(item) {
|
||||
form.value.mentionedUserIdList.push(item.id)
|
||||
}
|
||||
|
||||
function handleSendCommnet(idx) {
|
||||
try {
|
||||
// 过滤掉删除的用户,方式为遍历mentionedUserIdList,查找评论中是否有对应的用户名
|
||||
const userList = [...form.value.mentionedUserIdList]
|
||||
const arr = []
|
||||
userList.map((item) => {
|
||||
if (form.value.commentValue.indexOf(`@${item.name}`) != -1) {
|
||||
arr.push(item.id)
|
||||
// 然后移除对应的用户名,防止有多个
|
||||
form.value.commentValue = form.value.commentValue.replace(`@${item.name}`, '')
|
||||
}
|
||||
})
|
||||
const data = {
|
||||
businessType: commentInfo.value.businessType,
|
||||
businessId: commentInfo.value.businessId,
|
||||
commentType: currentType.value,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: arr,
|
||||
parentId: commentList.value[idx].commentId
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
|
||||
const addNewComment = ref(false)
|
||||
function handleInsertComment() {
|
||||
addNewComment.value = true
|
||||
form.value.commentValue = commentTypeOptions.value.find(
|
||||
(item) => item.id == currentType.value
|
||||
).remark
|
||||
}
|
||||
|
||||
const toolbarConfig = {
|
||||
toolbarKeys: [
|
||||
'bold', // 加粗
|
||||
'underline', // 下划线
|
||||
'italic', // 斜体
|
||||
'color', // 文字颜色
|
||||
'bgColor', // 背景色
|
||||
'fontSize', // 字号
|
||||
'bulletedList', // 无序列表
|
||||
'numberedList', // 有序列表
|
||||
'insertTable', // 插入表格
|
||||
'insertLink', // 插入链接
|
||||
'undo' // 撤销
|
||||
]
|
||||
}
|
||||
|
||||
function handleSaveComment() {
|
||||
addNewComment.value = false
|
||||
try {
|
||||
const data = {
|
||||
businessType: commentInfo.value.businessType,
|
||||
businessId: commentInfo.value.businessId,
|
||||
commentType: currentType.value,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: form.value.mentionedUserIdList
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
exportTableWithVue('#okrAnalysisTable', `OKR分析报表-${currentNode.value.nodeName}`)
|
||||
}
|
||||
|
||||
function handleTableFilter() {
|
||||
console.log('tableKeywords', tableKeywords.value)
|
||||
|
||||
if (tableKeywords.value) {
|
||||
originList.value = defaultTableList.value.filter(
|
||||
(item) =>
|
||||
item.keyResultShowName.includes(tableKeywords.value) ||
|
||||
item.sourceName.includes(tableKeywords.value)
|
||||
)
|
||||
} else {
|
||||
originList.value = [...defaultTableList.value]
|
||||
}
|
||||
}
|
||||
|
||||
function handleFilterTableClick() {
|
||||
showTableSearch.value = !showTableSearch.value
|
||||
if (!showTableSearch.value) {
|
||||
tableKeywords.value = ''
|
||||
originList.value = [...defaultTableList.value]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
150
src/views/OKR/Management/Components/AllTarget.vue
Normal file
150
src/views/OKR/Management/Components/AllTarget.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div class="flex flex-col w-full h-full p-4 bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="flex items-center justify-between">
|
||||
<el-row>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
check-strictly
|
||||
style="width: 400px"
|
||||
@change="nodeChange"
|
||||
/>
|
||||
<el-button class="ml-10px" type="primary" @click="handleAddNode">新建节点</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
v-if="currentUserId == searchForm.creatorId"
|
||||
@click="handleEditOkr(searchForm.nodeId)"
|
||||
>
|
||||
修改当前节点
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
v-if="searchForm.executor?.includes(currentUserId)"
|
||||
@click="handleUpdateProcess"
|
||||
>更新进度</el-button
|
||||
>
|
||||
</el-row>
|
||||
</div>
|
||||
<OkrTable ref="okrTableRef" :canEdit="isCurrentLeafNode" />
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" @success="handleSearchPeroid" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="AllTarget">
|
||||
import OkrTable from './OkrTable.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
|
||||
import { getAllNodeTree, getAllOkrPage } from '@/api/okr/okr'
|
||||
import { listToTree, findNode } from '@/utils/tree'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const message = useMessage()
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
handleSearchPeroid()
|
||||
|
||||
// 当前是否是叶子节点
|
||||
// 如果不是叶子节点,则表格数据不可修改
|
||||
const isCurrentLeafNode = ref(false)
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getAllNodeTree().then((resp) => {
|
||||
if (resp.nodeId) {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
nodeChange(resp.nodeId)
|
||||
} else {
|
||||
message.warning('请先创建节点数据')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function nodeChange(nodeId) {
|
||||
if (nodeId) {
|
||||
searchForm.value.nodeId = nodeId
|
||||
getOkrList()
|
||||
const currentNode = findNode(peroidList.value, (node) => {
|
||||
return node.nodeId == nodeId
|
||||
})
|
||||
searchForm.value.creatorId = currentNode.creatorId
|
||||
if (!currentNode.children || currentNode.children.length == 0) {
|
||||
isCurrentLeafNode.value = true
|
||||
} else {
|
||||
isCurrentLeafNode.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getAllOkrPage(searchForm.value).then((resp) => {
|
||||
const list = resp
|
||||
if (list && list.length > 0) {
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(list)
|
||||
})
|
||||
} else {
|
||||
// 如果没有数据,清空表格
|
||||
okrTableRef.value.prepareData([])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
function handleAddNode() {
|
||||
dialogOkrInfo.value.open('create', null)
|
||||
}
|
||||
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 2)
|
||||
}
|
||||
|
||||
function handleUpdateProcess() {
|
||||
okrTableRef.value.updateProcess(searchForm.value.nodeId).then(() => {
|
||||
message.success('更新成功')
|
||||
getOkrList()
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
function handleShowOkr(id) {
|
||||
dialogOkr.value.open({
|
||||
nodeId: id,
|
||||
canEdit: isCurrentLeafNode.value,
|
||||
queryType: 2
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
682
src/views/OKR/Management/Components/DialogOkr.vue
Normal file
682
src/views/OKR/Management/Components/DialogOkr.vue
Normal file
@@ -0,0 +1,682 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-if="show"
|
||||
v-model="show"
|
||||
width="94vw"
|
||||
class="dialog-okr"
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<template #header>
|
||||
<div class="dialog-okr-header">
|
||||
<div class="flex-1 flex items-center" style="line-height: 50px">
|
||||
<div class="dialog-okr-title">
|
||||
<Icon icon="ep:circle-check-filled" color="#30d1fc" :size="14" />
|
||||
<span>目标</span>
|
||||
</div>
|
||||
<el-divider direction="vertical" />
|
||||
<span class="text-14px ml-0.25">ork落地</span>
|
||||
<div class="ml-20px text-14px">
|
||||
<span>【节点】</span>
|
||||
<span
|
||||
v-for="(item, index) in nodeInfo.parentNodes"
|
||||
:key="item.nodeId"
|
||||
@click="handleChildItem(item)"
|
||||
>
|
||||
<span
|
||||
class="cursor-pointer"
|
||||
:style="{
|
||||
color: index < nodeInfo.parentNodes.length - 1 ? '#409eff' : '#333',
|
||||
borderBottom:
|
||||
index < nodeInfo.parentNodes.length - 1 ? '1px solid #409eff' : 'none'
|
||||
}"
|
||||
>
|
||||
{{ item.nodeName }}
|
||||
</span>
|
||||
<span v-if="index != nodeInfo.parentNodes.length - 1"> -> </span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<el-button
|
||||
v-if="nodeInfo.creatorId == currentUserId"
|
||||
link
|
||||
@click="emit('edit', nodeInfo.nodeId)"
|
||||
>
|
||||
<el-tooltip content="编辑" placement="top" effect="dark">
|
||||
<Icon icon="ep:edit" :size="16" />
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
|
||||
<el-button link @click="show = false">
|
||||
<el-tooltip content="关闭" placement="top" effect="dark">
|
||||
<Icon icon="ep:close" :size="16" />
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="dialog-okr-body">
|
||||
<div class="dialog-okr-content pr-10px">
|
||||
<div class="dialog-okr-content-detail">
|
||||
<div class="detail-basic-title">
|
||||
<div class="basic-title-item">
|
||||
<div class="basic-title-label">创建人</div>
|
||||
<div class="basic-title-value">{{ nodeInfo.creator }}</div>
|
||||
</div>
|
||||
<div class="basic-title-item">
|
||||
<div class="basic-title-label">执行人</div>
|
||||
<div class="basic-title-value">{{ nodeInfo.executorName || '无' }}</div>
|
||||
</div>
|
||||
<div class="basic-title-item">
|
||||
<div class="basic-title-label">目标数</div>
|
||||
<div class="basic-title-value">{{ okrList.length }}</div>
|
||||
</div>
|
||||
<div class="basic-title-item" style="min-width: 200px">
|
||||
<div class="basic-title-label">总体进度</div>
|
||||
<el-progress :percentage="parseInt(nodeInfo.progress) || 0" :stroke-width="8" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex detail-basic-info">
|
||||
<span>开始日期:{{ nodeInfo.startTime }}</span>
|
||||
<span>截止日期:{{ nodeInfo.endTime }}</span>
|
||||
<span>最新更新时间:{{ nodeInfo.updateTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex" style="position: relative; flex: 1; height: 100px">
|
||||
<el-tabs v-model="workIndex" style="flex: 1">
|
||||
<el-tab-pane label="目标/关键成果" name="okr">
|
||||
<div class="content-wrap">
|
||||
<OkrTable ref="okrTableRef" :canEdit="canEdit" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-button v-if="canEdit" class="sav-btn" type="primary" @click="handleSaveProcess">
|
||||
保存并更新
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog-okr-side pl-10px">
|
||||
<el-tabs v-model="sideIndex" style="flex: 1; height: 100%">
|
||||
<el-tab-pane label="子节点" name="subNode" key=" ">
|
||||
<div class="overflow-y-auto" style="height: calc(100% - 50px)">
|
||||
<div
|
||||
v-for="item in childNodeList"
|
||||
:key="item.nodeId"
|
||||
class="border-b-1 child-item"
|
||||
style="padding: 10px 5px; cursor: pointer"
|
||||
@click="handleChildItem(item)"
|
||||
>
|
||||
<div
|
||||
class="flex justify-between items-center overflow-hidden text-16px"
|
||||
style="line-height: 30px"
|
||||
>
|
||||
<div class="child-label">【节点】{{ item.nodeName }}</div>
|
||||
<el-progress
|
||||
type="line"
|
||||
:percentage="parseInt(item.progress) || 0"
|
||||
:stroke-width="6"
|
||||
style="width: 120px"
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-10px flex items-center text-13px" style="line-height: 30px">
|
||||
<span>目标数:</span>
|
||||
<span style="color: #aaa">{{ item.objectiveNum }}</span>
|
||||
<el-divider direction="vertical" style="margin: 0 20px" />
|
||||
<div
|
||||
class="flex-1 overflow-hidden h-30px"
|
||||
style="text-overflow: ellipsis; white-space: nowrap"
|
||||
>
|
||||
<span>执行人:</span>
|
||||
<span style="color: #aaa">{{ item.executorName || '无' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ml-10px flex items-center text-12px"
|
||||
style="line-height: 20px; color: #aaa"
|
||||
>
|
||||
<span>开始日期:{{ item.startTime }}</span>
|
||||
<el-divider direction="vertical" style="margin: 0 20px" />
|
||||
<span>截止日期:{{ item.endTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="笔谈" name="conclusion" key="conclusion">
|
||||
<div class="relative overflow-y-auto" style="height: calc(100% - 50px)">
|
||||
<div v-if="addNewComment">
|
||||
<div class="flex justify-between items-center">
|
||||
<el-select
|
||||
v-model="form.commentType"
|
||||
filterable
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
@change="getCommentTemplate"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in commentTypeOptions"
|
||||
:label="it.label"
|
||||
:value="it.id"
|
||||
:key="it.id"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<div>
|
||||
<el-button size="small" @click="addNewComment = false"> 取消 </el-button>
|
||||
<el-button type="primary" size="small" @click="handleSaveComment">
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-10px" v-if="addNewComment">
|
||||
<Editor
|
||||
v-model:modelValue="form.commentValue"
|
||||
height="300px"
|
||||
:toolbarConfig="toolbarConfig"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<el-button v-else type="primary" size="small" @click="handleInsertComment">
|
||||
新增笔谈
|
||||
</el-button>
|
||||
<div
|
||||
v-for="(it, index) in commentList"
|
||||
:key="it.commentId"
|
||||
class="border-b-1"
|
||||
style="padding: 10px 5px"
|
||||
>
|
||||
<div
|
||||
class="flex items-center justify-between overflow-hidden text-16px"
|
||||
style="line-height: 30px"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<el-avatar
|
||||
shape="circle"
|
||||
style="
|
||||
background-color: var(--el-color-primary-light-3);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
"
|
||||
fit="fill"
|
||||
>
|
||||
<span class="text-12px">{{ it.creatorName.slice(-2) }}</span>
|
||||
</el-avatar>
|
||||
<div class="ml-10px text-16px">{{ it.creatorName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px" v-dompurify-html="it.content"></div>
|
||||
<div
|
||||
class="ml-10px mt-10px flex items-center justify-between text-12px"
|
||||
style="line-height: 20px; color: #aaa"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="good(it)">
|
||||
<Icon
|
||||
icon="fa:thumbs-o-up"
|
||||
:size="16"
|
||||
:color="it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'"
|
||||
/>
|
||||
</el-button>
|
||||
<span
|
||||
class="ml-5px"
|
||||
:style="{
|
||||
color: it.currentUserIsLike ? 'var(--el-color-primary)' : '#333'
|
||||
}"
|
||||
>{{ it.likeCount }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center mr-50px">
|
||||
<el-button link @click="showComment(index)">
|
||||
<Icon icon="ep:chat-dot-square" :size="16" color="#333" />
|
||||
</el-button>
|
||||
<span class="ml-5px" style="color: #333">{{ it.commentCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-10px text-13px text-gray-400">
|
||||
{{ formatDate(it.createTime, 'YYYY-MM-DD HH:mm') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 评论 -->
|
||||
<div
|
||||
v-if="showCommentIndex == index"
|
||||
class="bg-gray-100 pl-10px pr-10px pt-5px pb-5px"
|
||||
style="margin: 10px 10px 0 10px; border-radius: 4px"
|
||||
label="笔谈"
|
||||
>
|
||||
<div
|
||||
v-for="subComment in it.children.sort((a, b) => a.createTime - b.createTime)"
|
||||
:key="subComment.commentId"
|
||||
class="text-14px"
|
||||
style="line-height: 24px"
|
||||
>
|
||||
<span class="font-bold">{{ subComment.creatorName }}:</span>
|
||||
<span>
|
||||
{{ subComment.content }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-10px relative">
|
||||
<!-- <el-input
|
||||
v-model="form.commentValue"
|
||||
placeholder="请输入评论"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 100%"
|
||||
/> -->
|
||||
<el-mention
|
||||
v-model="form.commentValue"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
:options="employeeOptions"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
whole
|
||||
placeholder="请输入内容"
|
||||
@select="handleMention"
|
||||
>
|
||||
<template #label="{ item }">
|
||||
<div class="flex items-center justify-between h-full">
|
||||
<span class="text-14px text-dark-700">{{ item.name }}</span>
|
||||
<span class="text-12px text-gray-400">{{ item.dept }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-mention>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="position: absolute; right: 2px; bottom: 2px"
|
||||
@click="handleSendCommnet(index)"
|
||||
>
|
||||
发布
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="进度历史" name="history" key="history">
|
||||
<div class="overflow-y-auto pl-15px" style="height: calc(100% - 50px)">
|
||||
<el-timeline class="ml-10px">
|
||||
<el-timeline-item
|
||||
v-for="item in nodeRecords"
|
||||
:key="item.recordId"
|
||||
placement="bottom"
|
||||
:timestamp="formatDate(item.createTime, 'YYYY-MM-DD HH:mm:ss')"
|
||||
color="#30d1fc"
|
||||
>
|
||||
<div>{{ item.creator }}</div>
|
||||
<div class="mt-10px text-14px" style="line-height: 24px; color: #666">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogOkr">
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import OkrTable from './OkrTable.vue'
|
||||
|
||||
import { getOkrNodeDetail, getOkrNodeHistory } from '@/api/okr/okr'
|
||||
import {
|
||||
getCommentTypeOptions,
|
||||
createComment,
|
||||
getCommentPage,
|
||||
likeComment
|
||||
} from '@/api/okr/comment'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const message = useMessage()
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
const emit = defineEmits(['edit', 'close'])
|
||||
|
||||
const show = ref(false)
|
||||
|
||||
watch(
|
||||
() => show.value,
|
||||
(newValue, oldValue) => {
|
||||
if (oldValue && !newValue) {
|
||||
emit('close', nodeInfo.value)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const canEdit = ref(false)
|
||||
|
||||
const toolbarConfig = {
|
||||
toolbarKeys: [
|
||||
'bold', // 加粗
|
||||
'underline', // 下划线
|
||||
'italic', // 斜体
|
||||
'color', // 文字颜色
|
||||
'bgColor', // 背景色
|
||||
'fontSize', // 字号
|
||||
'bulletedList', // 无序列表
|
||||
'numberedList', // 有序列表
|
||||
'insertTable', // 插入表格
|
||||
'insertLink', // 插入链接
|
||||
'undo' // 撤销
|
||||
]
|
||||
}
|
||||
|
||||
const workIndex = ref('okr')
|
||||
const okrList = ref([])
|
||||
const childNodeList = ref([])
|
||||
const sideIndex = ref('subNode')
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const nodeInfo = ref({})
|
||||
|
||||
const nodeRecords = ref([])
|
||||
const commentTypeOptions = ref([])
|
||||
|
||||
const queryType = ref(1)
|
||||
function open(curNode) {
|
||||
canEdit.value = curNode.canEdit
|
||||
nodeInfo.value.nodeId = curNode.nodeId
|
||||
queryType.value = curNode.queryType
|
||||
// 获取数据详情
|
||||
searchInfo(curNode)
|
||||
show.value = true
|
||||
}
|
||||
|
||||
const employeeOptions = ref([])
|
||||
|
||||
function searchInfo(curNode) {
|
||||
try {
|
||||
getOkrNodeDetail({ nodeId: curNode.nodeId, queryType: queryType.value }).then((resp) => {
|
||||
nodeInfo.value = {
|
||||
...resp,
|
||||
executor: resp.executor || []
|
||||
}
|
||||
canEdit.value = canEdit.value && nodeInfo.value.executor.includes(currentUserId + '')
|
||||
if (resp.objectives) {
|
||||
okrList.value = resp.objectives.map((item) => ({
|
||||
...item,
|
||||
keyResults: item.keyResults || []
|
||||
}))
|
||||
} else {
|
||||
okrList.value = []
|
||||
}
|
||||
childNodeList.value = [...resp.children]
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(okrList.value)
|
||||
})
|
||||
})
|
||||
getOkrNodeHistory(curNode.nodeId).then((resp) => {
|
||||
nodeRecords.value = resp
|
||||
})
|
||||
getEmployeeSimpleList({ status: 0 }).then((resp) => {
|
||||
employeeOptions.value = resp.map((item) => ({
|
||||
...item,
|
||||
label: item.name,
|
||||
value: item.name
|
||||
}))
|
||||
})
|
||||
getCommentTypeOptions().then((resp) => {
|
||||
commentTypeOptions.value = resp
|
||||
})
|
||||
searchCommentList()
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
}
|
||||
|
||||
defineExpose({ open, close })
|
||||
|
||||
function handleMention(item) {
|
||||
form.value.mentionedUserIdList.push(item.id)
|
||||
}
|
||||
|
||||
function handleSaveProcess() {
|
||||
okrTableRef.value.updateProcess(nodeInfo.value.nodeId).then(() => {
|
||||
message.success('更新成功')
|
||||
searchInfo({ nodeId: nodeInfo.value.nodeId })
|
||||
})
|
||||
}
|
||||
|
||||
function handleChildItem(item) {
|
||||
const arr = item.executor || []
|
||||
const isExecutor = arr.includes(currentUserId)
|
||||
canEdit.value = isExecutor && (!item.children || item.children.length == 0)
|
||||
searchInfo(item)
|
||||
}
|
||||
|
||||
const addNewComment = ref(false)
|
||||
const form = ref({
|
||||
commentValue: '',
|
||||
commentType: undefined,
|
||||
mentionedUserIdList: []
|
||||
})
|
||||
function handleInsertComment() {
|
||||
addNewComment.value = true
|
||||
const defaultComment = commentTypeOptions.value[0]
|
||||
if (defaultComment) {
|
||||
form.value = {
|
||||
commentType: defaultComment.id,
|
||||
mentionedUserIdList: []
|
||||
}
|
||||
}
|
||||
getCommentTemplate()
|
||||
}
|
||||
|
||||
function getCommentTemplate() {
|
||||
if (form.value.commentType) {
|
||||
form.value.commentValue = commentTypeOptions.value.find(
|
||||
(item) => item.id == form.value.commentType
|
||||
).remark
|
||||
} else {
|
||||
form.value.commentValue = `<h2 style=\"text-align: start;\">一、工作概况</h2><p> </p><h2 style=\"text-align: start;\">二、数据统计</h2><ol><li>呼出电话数:</li><li>有效沟通数:</li><li>销售成果</li></ol><h2 style=\"text-align: start;\">三、问题与改进方案</h2><p><br></p>`
|
||||
}
|
||||
}
|
||||
|
||||
function handleSaveComment() {
|
||||
addNewComment.value = false
|
||||
try {
|
||||
const data = {
|
||||
businessType: 1,
|
||||
businessId: nodeInfo.value.nodeId,
|
||||
commentType: form.value.commentType,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: form.value.mentionedUserIdList
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
const commentList = ref([])
|
||||
|
||||
function searchCommentList() {
|
||||
getCommentPage({
|
||||
businessType: 1,
|
||||
businessId: nodeInfo.value.nodeId,
|
||||
pageNum: 1,
|
||||
pageSize: -1
|
||||
}).then((resp) => {
|
||||
commentList.value = listToTree(resp.list, {
|
||||
id: 'commentId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function good(item) {
|
||||
likeComment(item.commentId).then(() => {
|
||||
message.success('点赞成功')
|
||||
searchCommentList()
|
||||
})
|
||||
}
|
||||
|
||||
const showCommentIndex = ref(-1)
|
||||
function showComment(index) {
|
||||
showCommentIndex.value = showCommentIndex.value == index ? -1 : index
|
||||
}
|
||||
|
||||
function handleSendCommnet(idx) {
|
||||
try {
|
||||
// 过滤掉删除的用户,方式为遍历mentionedUserIdList,查找评论中是否有对应的用户名
|
||||
const userList = [...form.value.mentionedUserIdList]
|
||||
const arr = []
|
||||
userList.map((item) => {
|
||||
if (form.value.commentValue.indexOf(`@${item.name}`) != -1) {
|
||||
arr.push(item.id)
|
||||
// 然后移除对应的用户名,防止有多个
|
||||
form.value.commentValue = form.value.commentValue.replace(`@${item.name}`, '')
|
||||
}
|
||||
})
|
||||
const data = {
|
||||
businessType: 1,
|
||||
businessId: nodeInfo.value.nodeId,
|
||||
contentType: 1,
|
||||
commentType: form.value.commentType,
|
||||
content: form.value.commentValue,
|
||||
mentionedUserIdList: arr,
|
||||
parentId: commentList.value[idx].commentId
|
||||
}
|
||||
createComment(data)
|
||||
.then(() => {
|
||||
message.success('创建成功')
|
||||
searchCommentList()
|
||||
})
|
||||
.finally(() => {
|
||||
form.value.commentValue = ''
|
||||
})
|
||||
} catch (error) {
|
||||
message.error('创建失败')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-okr {
|
||||
.dialog-okr-header {
|
||||
display: flex;
|
||||
height: 51px;
|
||||
min-height: 51px;
|
||||
vertical-align: middle;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
padding: 0 1.25rem;
|
||||
.dialog-okr-title {
|
||||
display: flex;
|
||||
margin-right: 5px;
|
||||
align-items: center;
|
||||
background: rgba(48, 209, 252, 0.1);
|
||||
border-radius: 3px;
|
||||
padding: 0 10px;
|
||||
line-height: 24px;
|
||||
span {
|
||||
color: #2a344b;
|
||||
font-size: 12px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.dialog-okr-body {
|
||||
display: flex;
|
||||
background: #f0f3fa;
|
||||
overflow: hidden;
|
||||
min-width: 1064px;
|
||||
height: calc(94vh - 85px);
|
||||
.dialog-okr-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 70%;
|
||||
flex: auto;
|
||||
min-width: 700px;
|
||||
background: #fff;
|
||||
margin: 0 1px 0 0;
|
||||
justify-content: space-between;
|
||||
overflow-y: hidden !important;
|
||||
.dialog-okr-content-detail {
|
||||
position: relative;
|
||||
margin-bottom: 30px;
|
||||
overflow-y: auto;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
.detail-basic-title {
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
margin-bottom: 16px;
|
||||
.basic-title-item {
|
||||
margin-right: 50px;
|
||||
.basic-title-label {
|
||||
color: #aaa;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.basic-title-value {
|
||||
color: #2a344b;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.detail-basic-info {
|
||||
font-size: 14px;
|
||||
color: #aaa;
|
||||
span {
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 15px);
|
||||
}
|
||||
}
|
||||
.dialog-okr-side {
|
||||
padding-left: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 30%;
|
||||
overflow: hidden;
|
||||
min-width: 364px;
|
||||
max-width: 500px;
|
||||
background: #fff;
|
||||
margin: 0;
|
||||
.child-item:hover {
|
||||
background: #f0f3fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sav-btn {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 0;
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
647
src/views/OKR/Management/Components/DialogOkrInfo.vue
Normal file
647
src/views/OKR/Management/Components/DialogOkrInfo.vue
Normal file
@@ -0,0 +1,647 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="show"
|
||||
width="88vw"
|
||||
class="dialog-okr"
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<template #header>
|
||||
<div class="dialog-okr-header">
|
||||
<div class="flex-1 flex items-center" style="line-height: 50px"> {{ title }} </div>
|
||||
<div class="flex items-center">
|
||||
<el-button type="primary" link :disabled="formLoading" @click="handleSave">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button link @click="show = false"> 关闭 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="dialog-okr-body" v-loading="formLoading">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="0">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="parentId">
|
||||
<el-tree-select
|
||||
v-model="form.parentId"
|
||||
:data="parentNodeList"
|
||||
check-strictly
|
||||
:props="{ value: 'nodeId', label: 'nodeName', children: 'children' }"
|
||||
:render-after-expand="false"
|
||||
placeholder="父节点"
|
||||
clearable
|
||||
:disabled="!!form.nodeId"
|
||||
@change="handleChangeParent"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="nodeName">
|
||||
<el-input v-model="form.nodeName" placeholder="请输入节点名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="开始日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="截止日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="executor">
|
||||
<el-select
|
||||
v-model="form.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id + ''"
|
||||
:disabled="item.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="0">
|
||||
<el-form-item prop="dataScope">
|
||||
<el-select v-model="form.dataScope" placeholder="选择权限" clearable filterable>
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="relative">
|
||||
<el-button
|
||||
v-if="okrKey == 'okr'"
|
||||
style="position: absolute; right: 10px; top: 10px; z-index: 9"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="addObjective"
|
||||
>
|
||||
添加目标
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="okrKey == 'childNode'"
|
||||
style="position: absolute; right: 10px; top: 10px; z-index: 9"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="addChildNode"
|
||||
>
|
||||
添加子节点
|
||||
</el-button>
|
||||
<el-tabs v-model="okrKey">
|
||||
<el-tab-pane label="目标/关键成果" name="okr">
|
||||
<div>
|
||||
<div
|
||||
class="flex items-center w-full"
|
||||
v-for="(item, i) in objectList"
|
||||
:key="item.objectiveId"
|
||||
style="padding-bottom: 5px"
|
||||
>
|
||||
<div class="flex-1 w-100px">
|
||||
<div class="flex items-center">
|
||||
<el-tooltip content="点击可折叠/展开目标" placement="top" effect="dark">
|
||||
<el-tag
|
||||
type="success"
|
||||
class="mr-10px"
|
||||
@click="item.hideChild = !item.hideChild"
|
||||
>
|
||||
O{{ i + 1 }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
|
||||
<el-input
|
||||
v-model="item.objectiveName"
|
||||
placeholder="目标名称"
|
||||
class="flex-1 w-150px"
|
||||
:disabled="!!item.objectiveId"
|
||||
/>
|
||||
<el-select
|
||||
v-model="item.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
collapse-tags
|
||||
filterable
|
||||
style="width: 240px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in userOptions"
|
||||
:key="it.id"
|
||||
:label="it.name"
|
||||
:value="it.id + ''"
|
||||
:disabled="it.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="item.dataScope"
|
||||
placeholder="选择权限"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px; margin-left: 10px"
|
||||
>
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
<div class="ml-10px">
|
||||
<el-button type="primary" text @click="AddKR(i)">新增关键成果</el-button>
|
||||
<el-button type="danger" text @click="removeObj(i)">删除目标</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!item.hideChild" style="background: #f0f3fa; padding-bottom: 10px">
|
||||
<div
|
||||
class="ml-50px"
|
||||
v-for="(kr, index) in item.keyResults"
|
||||
:key="kr.keyResultId"
|
||||
>
|
||||
<div class="flex flex-1 items-center pb-5px pt-5px">
|
||||
<el-tag class="mr-10px">KR{{ index + 1 }}</el-tag>
|
||||
<el-select
|
||||
v-model="kr.keyResultName"
|
||||
placeholder="选择或输入关键成果"
|
||||
filterable
|
||||
:props="{ value: 'keyResultId', label: 'keyResultName' }"
|
||||
allow-create
|
||||
:reserve-keyword="false"
|
||||
class="flex-1 w-150px"
|
||||
@change="krChange(i, index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in krOptions"
|
||||
:key="it.value"
|
||||
:label="it.label"
|
||||
:value="it.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="danger" text @click="removeKR(i, index)">
|
||||
删除关键成果
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="mt-5px flex items-center">
|
||||
<el-tree-select
|
||||
v-model="kr.source"
|
||||
:data="sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
<!-- <el-radio-group v-model="kr.resultType" class="ml-10px">
|
||||
<el-radio-button :value="1">目标值</el-radio-button>
|
||||
<el-radio-button :value="2">是/否</el-radio-button>
|
||||
</el-radio-group> -->
|
||||
|
||||
<el-input
|
||||
v-if="kr.resultType == 1"
|
||||
v-model="kr.targetValue"
|
||||
type="number"
|
||||
placeholder="目标值"
|
||||
class="ml-10px"
|
||||
style="width: 120px"
|
||||
/>
|
||||
|
||||
<el-select
|
||||
v-model="kr.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
filterable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
style="width: 240px; margin-left: 10px"
|
||||
>
|
||||
<el-option
|
||||
v-for="it in userOptions"
|
||||
:key="it.id"
|
||||
:label="it.name"
|
||||
:value="it.id + ''"
|
||||
:disabled="it.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="kr.dataScope"
|
||||
placeholder="选择权限"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px; margin-left: 10px"
|
||||
>
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
<el-radio-group v-model="kr.isCount" class="ml-10px">
|
||||
<el-radio :label="true" :value="true">参与统计</el-radio>
|
||||
<el-radio :label="false" :value="false">不参与统计</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="w-100px"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="子节点" name="childNode">
|
||||
<el-table :data="childNodeList">
|
||||
<el-table-column label="名称">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.nodeName" placeholder="子节点名称" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始日期" width="160px">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.startTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 130px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="截止日期" width="160px">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.endTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 130px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="权限" width="160px">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.dataScope" placeholder="请选择" style="width: 130px">
|
||||
<el-option label="公开" :value="1" />
|
||||
<el-option label="仅上级可见" :value="2" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="执行人" width="300px">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.executor"
|
||||
placeholder="选择执行人,可多选"
|
||||
multiple
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id + ''"
|
||||
:disabled="item.status == 1"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="删除" :width="100">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="danger" text @click="removeChildNode($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogOkrInfo">
|
||||
import {
|
||||
getAllNodeTree,
|
||||
getOkrNodeDetail,
|
||||
createOkrNode,
|
||||
updateOkrNode,
|
||||
getAllOkrPage,
|
||||
getDefaultOkrOptions,
|
||||
getChannelOptions
|
||||
} from '@/api/okr/okr'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
import { getEmployeeSimpleList } from '@/api/pers/employee'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
|
||||
watch(
|
||||
() => show.value,
|
||||
(newValue, oldValue) => {
|
||||
if (oldValue && !newValue) {
|
||||
emit('close')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const title = ref('')
|
||||
const formType = ref('create')
|
||||
|
||||
const form = ref({})
|
||||
const formLoading = ref(false)
|
||||
const rules = ref({
|
||||
nodeName: { required: true, message: '节点名称不可为空', trigger: 'blur' },
|
||||
startTime: { required: true, message: '开始日期不可为空', trigger: 'change' },
|
||||
endTime: { required: true, message: '截止日期不可为空', trigger: 'change' }
|
||||
})
|
||||
|
||||
const okrKey = ref('okr')
|
||||
|
||||
const parentNodeList = ref([])
|
||||
|
||||
const childNodeList = ref([])
|
||||
|
||||
const userOptions = ref([])
|
||||
const krOptions = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'sourceName',
|
||||
value: 'sourceId',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
const sourceOptions = ref([])
|
||||
const objectList = ref([])
|
||||
function open(type, val, queryType) {
|
||||
show.value = true
|
||||
title.value = type == 'update' ? '修改Okr' : '新增Okr'
|
||||
formType.value = type
|
||||
resetForm()
|
||||
getEmployeeSimpleList().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
getAllNodeTree().then((resp) => {
|
||||
parentNodeList.value = listToTree(resp.tree, {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
getDefaultOkrOptions().then((resp) => {
|
||||
krOptions.value = resp
|
||||
})
|
||||
getChannelOptions().then((resp) => {
|
||||
sourceOptions.value = listToTree(resp, {
|
||||
id: 'sourceId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
})
|
||||
if (val) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
getOkrNodeDetail({
|
||||
nodeId: val,
|
||||
queryType
|
||||
}).then((resp) => {
|
||||
form.value = resp
|
||||
if (resp.objectives) {
|
||||
objectList.value = resp.objectives.map((item) => ({
|
||||
...item,
|
||||
keyResults: item.keyResults || []
|
||||
}))
|
||||
} else {
|
||||
objectList.value = []
|
||||
}
|
||||
childNodeList.value = [...resp.children]
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
function resetForm() {
|
||||
form.value = {
|
||||
parentId: undefined,
|
||||
nodeName: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
executor: [],
|
||||
dataScope: 2
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const formRef = ref()
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success', 'close']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
function addObjective() {
|
||||
objectList.value.push({
|
||||
objectiveName: '',
|
||||
executor: form.value.executor || [],
|
||||
keyResults: [],
|
||||
dataScope: form.value.dataScope || 2
|
||||
})
|
||||
}
|
||||
|
||||
function AddKR(idx) {
|
||||
if (!objectList.value[idx].keyResults) {
|
||||
objectList.value[idx].keyResults = []
|
||||
}
|
||||
const obj = objectList.value[idx]
|
||||
objectList.value[idx].keyResults.push({
|
||||
keyResultName: undefined,
|
||||
resultType: 1,
|
||||
source: undefined,
|
||||
targetValue: undefined,
|
||||
process: undefined,
|
||||
currentValue: undefined,
|
||||
executor: obj.executor,
|
||||
dataScope: obj.dataScope,
|
||||
isCount: false
|
||||
})
|
||||
}
|
||||
|
||||
function removeObj(idx) {
|
||||
objectList.value.splice(idx, 1)
|
||||
}
|
||||
|
||||
function removeKR(oIdx, krIdx) {
|
||||
objectList.value[oIdx].keyResults.splice(krIdx, 1)
|
||||
}
|
||||
|
||||
function addChildNode() {
|
||||
childNodeList.value.push({ dataScope: 2 })
|
||||
}
|
||||
|
||||
function removeChildNode(idx) {
|
||||
childNodeList.value.splice(idx, 1)
|
||||
}
|
||||
|
||||
// 读取父节点的OKR,并展示出来
|
||||
function handleChangeParent() {
|
||||
// 通过父节点Id,查询父节点的okr,需要继承
|
||||
if (form.value.parentId) {
|
||||
getAllOkrPage({ nodeId: form.value.parentId }).then((resp) => {
|
||||
objectList.value = resp
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function getLastDayOfMonth(year, month) {
|
||||
// 创建一个日期对象,将月份设置为指定月份的下一个月,日期设置为 0
|
||||
const date = new Date(year, month + 1, 0)
|
||||
// 返回该日期对象的日期部分,即指定年月的最后一天
|
||||
return date.getDate()
|
||||
}
|
||||
|
||||
function krChange(idx, krIdx) {
|
||||
const kr = objectList.value[idx].keyResults[krIdx]
|
||||
if (kr.keyResultName) {
|
||||
const obj = krOptions.value.find((item) => item.value == kr.keyResultName)
|
||||
if (obj) {
|
||||
kr.isSys = true
|
||||
} else {
|
||||
kr.isSys = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
form.value.executor = form.value.executor || []
|
||||
if (form.value.executor.length > 1) {
|
||||
message
|
||||
.confirm('是否按照当前节点所选的多个执行人自动新增对应的员工节点?', {
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: '不新增员工节点',
|
||||
confirmButtonText: '新增员工节点'
|
||||
})
|
||||
.then(() => {
|
||||
saveOkrData(true)
|
||||
})
|
||||
.catch(() => {
|
||||
saveOkrData(false)
|
||||
})
|
||||
} else {
|
||||
saveOkrData(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function saveOkrData(isAutoAddChild = false) {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
form.value.isAutoAddChild = isAutoAddChild
|
||||
form.value.objectives = objectList.value
|
||||
form.value.children = childNodeList.value
|
||||
if (formType.value === 'create') {
|
||||
// 创建的是一级节点,且子节点为空时,自动新增12个月子节点,并且每月添加4周的周子节点
|
||||
if (!form.value.parentId) {
|
||||
if (form.value.children.length == 0) {
|
||||
const defaultTime = new Date(form.value.startTime)
|
||||
for (let month = 0; month < 12; month++) {
|
||||
form.value.children.push({
|
||||
nodeName: `${month + 1}月`,
|
||||
startTime: `${defaultTime.getFullYear()}-${String(month + 1).padStart(2, '0')}-01`,
|
||||
endTime: `${defaultTime.getFullYear()}-${String(month + 1).padStart(
|
||||
2,
|
||||
'0'
|
||||
)}-${getLastDayOfMonth(defaultTime.getFullYear(), month)}`,
|
||||
dataScope: form.value.dataScope,
|
||||
executor: form.value.executor
|
||||
// children: [
|
||||
// {
|
||||
// nodeName: `${month + 1}月第1周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// },
|
||||
// {
|
||||
// nodeName: `${month + 1}月第2周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// },
|
||||
// {
|
||||
// nodeName: `${month + 1}月第3周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// },
|
||||
// {
|
||||
// nodeName: `${month + 1}月第4周`,
|
||||
// dataScope: form.value.dataScope,
|
||||
// executor: form.value.executor,
|
||||
// children: []
|
||||
// }
|
||||
// ]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
await createOkrNode(form.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await updateOkrNode(form.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-okr {
|
||||
.dialog-okr-header {
|
||||
display: flex;
|
||||
height: 51px;
|
||||
min-height: 51px;
|
||||
vertical-align: middle;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
padding: 0 1.25rem;
|
||||
}
|
||||
.dialog-okr-body {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
min-width: 1064px;
|
||||
height: calc(94vh - 85px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
113
src/views/OKR/Management/Components/MyDuty.vue
Normal file
113
src/views/OKR/Management/Components/MyDuty.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="flex items-center justify-between">
|
||||
<el-row>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
style="width: 400px"
|
||||
@change="getOkrList"
|
||||
/>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
|
||||
<el-button type="success" @click="handleUpdateProcess">更新进度</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<OkrTable ref="okrTableRef" canEdit />
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MyDuty">
|
||||
import OkrTable from './OkrTable.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
import { listToTree } from '@/utils/tree'
|
||||
|
||||
import { getMyNodeTree, getMyOkrPage } from '@/api/okr/okr'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
// onMounted(() => {
|
||||
handleSearchPeroid()
|
||||
// })
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getMyNodeTree().then((resp) => {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
searchForm.value.nodeId = resp.nodeId
|
||||
getOkrList()
|
||||
})
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getMyOkrPage(searchForm.value).then((resp) => {
|
||||
const list = resp
|
||||
if (list && list.length > 0) {
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(list)
|
||||
})
|
||||
} else {
|
||||
// 如果没有数据,清空表格
|
||||
okrTableRef.value.prepareData([])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
// function handleAddNode() {
|
||||
// dialogOkrInfo.value.open('create', null)
|
||||
// }
|
||||
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 1)
|
||||
}
|
||||
|
||||
function handleUpdateProcess() {
|
||||
okrTableRef.value.updateProcess(searchForm.value.nodeId).then(() => {
|
||||
message.success('更新成功')
|
||||
getOkrList()
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
function handleShowOkr(id) {
|
||||
dialogOkr.value.open({
|
||||
nodeId: id,
|
||||
canEdit: true,
|
||||
queryType: 1
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
125
src/views/OKR/Management/Components/MySon.vue
Normal file
125
src/views/OKR/Management/Components/MySon.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="flex items-center justify-between">
|
||||
<el-row>
|
||||
<el-tree-select
|
||||
v-model="searchForm.nodeId"
|
||||
:data="peroidList"
|
||||
:props="defaultProps"
|
||||
:render-after-expand="false"
|
||||
:default-expand-all="false"
|
||||
style="width: 400px"
|
||||
@change="nodeChange"
|
||||
/>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="info" @click="handleShowOkr(searchForm.nodeId)"> 节点详情 </el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
v-if="currentUserId == searchForm.creatorId"
|
||||
@click="handleEditOkr(searchForm.nodeId)"
|
||||
>
|
||||
修改当前节点
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<OkrTable ref="okrTableRef" canEdit />
|
||||
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
|
||||
<DialogOkrInfo ref="dialogOkrInfo" @success="handleSearchPeroid" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MySon">
|
||||
import OkrTable from './OkrTable.vue'
|
||||
import DialogOkr from './DialogOkr.vue'
|
||||
import DialogOkrInfo from './DialogOkrInfo.vue'
|
||||
import { listToTree, findNode } from '@/utils/tree'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import { getMySonNodeTree, getMySonOkrPage } from '@/api/okr/okr'
|
||||
|
||||
const props = defineProps({
|
||||
userId: {
|
||||
type: Number,
|
||||
default: undefined
|
||||
}
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
value: 'nodeId',
|
||||
label: 'nodeName',
|
||||
children: 'children'
|
||||
}
|
||||
|
||||
const userStore = useUserStore()
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const okrTableRef = ref(null)
|
||||
const searchForm = ref({
|
||||
nodeId: undefined
|
||||
})
|
||||
|
||||
const peroidList = ref([])
|
||||
|
||||
handleSearchPeroid()
|
||||
|
||||
function handleSearchPeroid() {
|
||||
getMySonNodeTree({ userId: props.userId }).then((resp) => {
|
||||
peroidList.value = listToTree(resp?.tree || [], {
|
||||
id: 'nodeId',
|
||||
pid: 'parentId',
|
||||
children: 'children'
|
||||
})
|
||||
nodeChange(resp.nodeId)
|
||||
})
|
||||
}
|
||||
|
||||
function getOkrList() {
|
||||
getMySonOkrPage({
|
||||
...searchForm.value,
|
||||
userId: props.userId
|
||||
}).then((resp) => {
|
||||
if (resp && resp.length > 0) {
|
||||
nextTick(() => {
|
||||
okrTableRef.value.prepareData(resp)
|
||||
})
|
||||
} else {
|
||||
// 如果没有数据,清空表格
|
||||
okrTableRef.value.prepareData([])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function nodeChange(nodeId) {
|
||||
searchForm.value.nodeId = nodeId
|
||||
getOkrList()
|
||||
const currentNode = findNode(peroidList.value, (node) => {
|
||||
return node.nodeId == nodeId
|
||||
})
|
||||
searchForm.value.creatorId = currentNode.creatorId
|
||||
}
|
||||
|
||||
const dialogOkr = ref(null)
|
||||
function handleShowOkr(id) {
|
||||
dialogOkr.value.open({
|
||||
nodeId: id,
|
||||
canEdit: true,
|
||||
queryType: 2
|
||||
})
|
||||
}
|
||||
|
||||
const dialogOkrInfo = ref(null)
|
||||
function handleEditOkr(nodeId = undefined) {
|
||||
dialogOkr.value.close()
|
||||
dialogOkrInfo.value.open('update', nodeId || searchForm.value.nodeId, 2)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-overlay-dialog) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user