Compare commits
82 Commits
f7e81fad0e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fe10f075a | |||
| 980a8767f9 | |||
|
|
e3f139aeaf | ||
| 38bb85b090 | |||
|
|
b33e1e23b2 | ||
|
|
0266fdf2d4 | ||
|
|
cdb497977b | ||
|
|
666060f235 | ||
| 02f55ffcef | |||
|
|
93a1390eb9 | ||
|
|
3bbb2e5ecd | ||
|
|
14d0c3d20b | ||
|
|
c79ee47609 | ||
|
|
83abbc57b7 | ||
|
|
fec4bd5ee0 | ||
|
|
a8b5c18167 | ||
|
|
3a9a4a6d1c | ||
|
|
b78a26e0b9 | ||
|
|
7c0581f15f | ||
|
|
fa2ee0cd6a | ||
|
|
742e85ae65 | ||
|
|
1439a78d23 | ||
|
|
50f218b8f5 | ||
|
|
c41f0896e9 | ||
| 06d1f9e7c8 | |||
|
|
640c90b178 | ||
|
|
32ebe58d07 | ||
|
|
edc095cd48 | ||
|
|
98b64c9533 | ||
| 518d64bca4 | |||
|
|
21737cde3c | ||
|
|
e44b80966a | ||
|
|
36ce6fc87b | ||
|
|
4b0fa9fd7f | ||
|
|
ca95f6dcf3 | ||
|
|
b2a376cdf0 | ||
|
|
7df45d6703 | ||
|
|
cb2deeb142 | ||
|
|
831c343448 | ||
|
|
c0be75b6fd | ||
|
|
9b323b68f9 | ||
|
|
6ebe33e48c | ||
|
|
c34623287c | ||
|
|
240224823e | ||
|
|
e3ccfd9721 | ||
|
|
461d36dc5d | ||
|
|
65af79e9a1 | ||
|
|
07850f1233 | ||
|
|
7e54b14103 | ||
|
|
2add57162e | ||
|
|
be9a9d77be | ||
|
|
8f4da16e81 | ||
|
|
b4a5c36fb0 | ||
|
|
cd3a39fa47 | ||
|
|
126853ad45 | ||
|
|
4735da7362 | ||
|
|
4b030babe2 | ||
|
|
3aaa26fdc2 | ||
|
|
78cd9f04bc | ||
|
|
dc3292982a | ||
|
|
6726bd7756 | ||
|
|
a8bf678f2e | ||
|
|
3ec039050f | ||
|
|
6baa78a94f | ||
|
|
770d700ba1 | ||
|
|
039ab28c15 | ||
|
|
f75140e135 | ||
|
|
467e1eceb7 | ||
|
|
47bac0315f | ||
|
|
ce0da69b5f | ||
|
|
0d99fbac80 | ||
|
|
06681658fc | ||
|
|
3abe367954 | ||
|
|
2eac9d0fc9 | ||
|
|
f7924d7cb1 | ||
|
|
6ac19b825e | ||
|
|
e10fedb4dc | ||
|
|
f70cdfb074 | ||
|
|
ac70a128c1 | ||
|
|
21ff3718bd | ||
|
|
1778ea9fb4 | ||
|
|
e4ae5e275f |
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://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
VITE_BASE_URL='http://localhost: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,10 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/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
|
||||
}
|
||||
]
|
||||
}
|
||||
55
.vscode/settings.json
vendored
55
.vscode/settings.json
vendored
@@ -1,54 +1,5 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/locales"
|
||||
]
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
13
package.json
13
package.json
@@ -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,8 +52,9 @@
|
||||
"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",
|
||||
"file-saver": "^2.0.5",
|
||||
"highlight.js": "^11.8.0",
|
||||
"intro.js": "^7.0.1",
|
||||
"jsencrypt": "^3.3.2",
|
||||
@@ -65,16 +67,19 @@
|
||||
"qs": "^6.11.2",
|
||||
"steady-xml": "^0.1.0",
|
||||
"url": "^0.11.0",
|
||||
"video.js": "^8.3.0",
|
||||
"video.js": "^7.0.0",
|
||||
"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",
|
||||
"xlsx": "^0.18.5",
|
||||
"xml-js": "^1.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -110,7 +115,7 @@
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^5.0.1",
|
||||
"rollup": "^3.22.0",
|
||||
"sass": "^1.62.1",
|
||||
"sass": "1.75.0",
|
||||
"stylelint": "^15.6.2",
|
||||
"stylelint-config-html": "^1.1.0",
|
||||
"stylelint-config-recommended": "^12.0.0",
|
||||
@@ -121,7 +126,7 @@
|
||||
"unplugin-auto-import": "^0.16.0",
|
||||
"unplugin-element-plus": "^0.7.1",
|
||||
"unplugin-vue-components": "^0.24.1",
|
||||
"vite": "4.3.8",
|
||||
"vite": "^5.4.21",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-ejs": "^1.6.4",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
|
||||
@@ -37,3 +37,12 @@ export const cancelApplyAfterSale = async (data) => {
|
||||
export const getAfterSaleDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/get', params })
|
||||
}
|
||||
|
||||
// 导入
|
||||
export const importAfterSales = async (data) => {
|
||||
return await request.upload({ url: '/admin-api/crm/sign-after-sale/importAfterSales', data })
|
||||
}
|
||||
|
||||
export const getAfterSalesTemplate = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/get-import-template' })
|
||||
}
|
||||
|
||||
50
src/api/clue/clueRemark.js
Normal file
50
src/api/clue/clueRemark.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得微信群列表
|
||||
export const getWxGroupPage = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/wxgroup/page', params })
|
||||
}
|
||||
|
||||
// 创建微信群
|
||||
export const createWxGroup = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/wxgroup/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新微信群
|
||||
export const updateWxGroup = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/wxgroup/update', data })
|
||||
}
|
||||
|
||||
// 删除微信群
|
||||
export const deleteWxGroup = (id) => {
|
||||
return request.delete({ url: `/admin-api/crm/wxgroup?groupId=${id}` })
|
||||
}
|
||||
|
||||
export const getWxGroupSimpleList = async () => {
|
||||
return await request.get({ url: '/admin-api/crm/wxgroup/simple-list' })
|
||||
}
|
||||
|
||||
// 报备
|
||||
export const reportClue = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/clue-remark/remark/save', data })
|
||||
}
|
||||
|
||||
// 接待提交报名信息
|
||||
export const registerClue = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/clue-remark/sign/save', data })
|
||||
}
|
||||
|
||||
// 分页查询报备信息
|
||||
export const getClueRemarkPage = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/clue-remark/page', data })
|
||||
}
|
||||
|
||||
// 区域查询报备信息
|
||||
export const getClueRemarkByRemarkId = (params) => {
|
||||
return request.get({ url: `/admin-api/crm/clue-remark/sign/get`, params })
|
||||
}
|
||||
|
||||
// 销售查询报备信息
|
||||
export const getClueRemarkByClueId = (params) => {
|
||||
return request.get({ url: `/admin-api/crm/clue-remark/remark/get`, params })
|
||||
}
|
||||
@@ -62,3 +62,12 @@ export const getFollowUserList = async (params) => {
|
||||
export const batchUpdateFollowUser = async (data) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-clue/batchUpdateFollowUser', data })
|
||||
}
|
||||
|
||||
// 自动分配线索新增
|
||||
export const clueInput = async (data) => {
|
||||
return await request.post({
|
||||
url: '/out-api/out/clue/importClue/',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -61,3 +61,13 @@ export const addOrderProduct = (data) => {
|
||||
export const removeOrderProduct = (id) => {
|
||||
return request.delete({ url: '/admin-api/crm/sign-prodcut/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 查询订单商品
|
||||
export const getOrderProductList = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/sign-prodcut/list', params })
|
||||
}
|
||||
|
||||
//
|
||||
export const createSignOnRemark = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/sign/xj-create', 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 })
|
||||
}
|
||||
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 |
@@ -8,7 +8,7 @@ export default defineComponent({
|
||||
name: 'DictTag',
|
||||
props: {
|
||||
type: {
|
||||
type: String as PropType<string>,
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
value: {
|
||||
@@ -42,7 +42,7 @@ export default defineComponent({
|
||||
return (
|
||||
<ElTag
|
||||
style={dictData.value?.cssClass ? 'color: #fff' : ''}
|
||||
type={dictData.value?.colorType}
|
||||
type={dictData.value?.colorType || 'primary'}
|
||||
color={
|
||||
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
|
||||
? dictData.value?.cssClass
|
||||
@@ -50,7 +50,7 @@ export default defineComponent({
|
||||
}
|
||||
disableTransitions={true}
|
||||
>
|
||||
{dictData.value?.label}
|
||||
{dictData.value?.label || '未知'}
|
||||
</ElTag>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -13,7 +13,7 @@ export const useRenderRadio = () => {
|
||||
return item?.options?.map((option) => {
|
||||
const { ...other } = option
|
||||
return (
|
||||
<Com {...other} label={option[valueAlias || 'value']}>
|
||||
<Com {...other} label={option[valueAlias || 'value']} value={option[valueAlias || 'value']}>
|
||||
{option[labelAlias || 'label']}
|
||||
</Com>
|
||||
)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
:data="tableObject.tableList"
|
||||
:row-key="rowkey"
|
||||
:expand-row-keys="expandRowKeys"
|
||||
:show-summary="showSummary"
|
||||
:summary-method="summaryMethod"
|
||||
border
|
||||
style="flex: 1"
|
||||
@selection-change="handleSelectionChange"
|
||||
@@ -35,7 +37,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>
|
||||
@@ -62,7 +64,9 @@ const props = defineProps({
|
||||
tableObject: { type: Object, default: () => ({ tableList: [] }) },
|
||||
tableColumns: { type: Array, default: () => [] },
|
||||
rowkey: { type: String, default: 'id' },
|
||||
expandRowKeys: { type: Array, default: () => [] }
|
||||
expandRowKeys: { type: Array, default: () => [] },
|
||||
showSummary: { type: Boolean, default: false },
|
||||
summaryMethod: { type: Function, default: null }
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:tableObject', 'getList', 'getCheckedColumns', 'selection-change'])
|
||||
|
||||
@@ -183,7 +183,7 @@ initSearch()
|
||||
virtual-triggering
|
||||
>
|
||||
<el-checkbox-group v-model="checkedSchema" @change="changeSearch">
|
||||
<el-checkbox v-for="item in schema" :key="item.id" :label="item.id">
|
||||
<el-checkbox v-for="item in schema" :key="item.id" :label="item.id" :value="item.id">
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
|
||||
@@ -49,6 +49,9 @@ const service: AxiosInstance = axios.create({
|
||||
// request拦截器
|
||||
service.interceptors.request.use(
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
if (config.url?.startsWith('/out-api')) {
|
||||
config.baseURL = ''
|
||||
}
|
||||
// 是否需要设置 token
|
||||
let isToken = (config!.headers || {}).isToken === false
|
||||
whiteList.some((v) => {
|
||||
@@ -132,6 +135,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,15 @@
|
||||
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'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
@@ -23,29 +24,36 @@ const whiteList = [
|
||||
'/bind',
|
||||
'/register',
|
||||
'/swagger'
|
||||
// '/crm/'
|
||||
]
|
||||
|
||||
// 路由加载前
|
||||
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 {
|
||||
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 (to.name == 'ReceiveInput') {
|
||||
if (!checkPermi(['clue:remark:receive-input'])) {
|
||||
next({ path: '/403', replace: true, query: { noGoBack: true } })
|
||||
return
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict && to.path != '/nm-detail') {
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
@@ -72,15 +80,31 @@ router.beforeEach(async (to, from, next) => {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
// 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,21 @@ 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 +148,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
// path: '/Basic',
|
||||
// component: Layout,
|
||||
// name: 'Basic',
|
||||
// meta: { title: '菜单管理' },
|
||||
// redirect: '/Basic/menu',
|
||||
// meta: { title: '菜单管理' },
|
||||
// children: [
|
||||
// {
|
||||
// path: 'menu',
|
||||
@@ -150,6 +165,38 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '/clue-add',
|
||||
name: 'ClueAdd',
|
||||
component: () => import('@/views/Clue/Pool/ClueAdd.vue'),
|
||||
meta: {
|
||||
title: '线索录入',
|
||||
hidden: true,
|
||||
noTagsView: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/receive-input/:id',
|
||||
name: 'ReceiveInput',
|
||||
component: () => import('@/views/Clue/ReceiveInput/index.vue'),
|
||||
meta: {
|
||||
title: '接待信息录入',
|
||||
hidden: true,
|
||||
noTagsView: true,
|
||||
permission: 'clue:receiveInput:index'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/clue-enroll/:id',
|
||||
name: 'ClueEnroll',
|
||||
component: () => import('@/views/Clue/Pool/ClueEnroll.vue'),
|
||||
meta: {
|
||||
title: '学员报名登记',
|
||||
hidden: true,
|
||||
noTagsView: true,
|
||||
permission: 'clue:pool:enroll'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/Login/Login.vue'),
|
||||
|
||||
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)
|
||||
|
||||
@@ -82,3 +82,38 @@
|
||||
.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格式) */
|
||||
|
||||
@@ -220,3 +220,83 @@ 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
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* 数组数据导出为 Excel
|
||||
* @param {Array} data 要导出的数组数据(对象数组,如 [{name: '张三', age: 18}, ...])
|
||||
* @param {String} fileName 导出的文件名(不含 .xlsx 后缀)
|
||||
* @param {Array} header 自定义表头映射(可选,格式:[{key: 'name', title: '姓名'}, ...])
|
||||
* 若不传入,默认使用数据对象的 key 作为表头
|
||||
*/
|
||||
export const exportArrayToExcel = function (data: any[], fileName: String, header: any) {
|
||||
// 处理表头映射
|
||||
const worksheetData = []
|
||||
let headerKeys = [] // 数据对象的 key 集合
|
||||
let headerTitles = [] // 表头显示文本
|
||||
|
||||
if (header && header.length > 0) {
|
||||
// 使用自定义表头
|
||||
headerKeys = header.map((item) => item.key)
|
||||
headerTitles = header.map((item) => item.title)
|
||||
worksheetData.push(headerTitles) // 加入表头行
|
||||
} else {
|
||||
// 自动生成表头(使用数据中第一个对象的 key)
|
||||
if (data.length === 0) {
|
||||
console.warn('导出数据为空')
|
||||
return
|
||||
}
|
||||
headerKeys = Object.keys(data[0])
|
||||
headerTitles = headerKeys // 表头默认用 key
|
||||
worksheetData.push(headerTitles) // 加入表头行
|
||||
}
|
||||
|
||||
// 处理数据行(按表头 key 顺序提取数据)
|
||||
data.forEach((item) => {
|
||||
const row = headerKeys.map((key) => {
|
||||
// 处理特殊类型(如日期对象转为字符串)
|
||||
if (item[key] instanceof Date) {
|
||||
return item[key].toLocaleString()
|
||||
}
|
||||
// 其他类型直接转为字符串(避免 undefined 显示)
|
||||
return item[key] !== undefined ? String(item[key]) : ''
|
||||
})
|
||||
worksheetData.push(row)
|
||||
})
|
||||
|
||||
// 创建工作簿和工作表
|
||||
const ws = XLSX.utils.aoa_to_sheet(worksheetData) // 数组转工作表
|
||||
const wb = XLSX.utils.book_new() // 创建工作簿
|
||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') // 工作表命名为 Sheet1
|
||||
|
||||
// 生成二进制文件并下载
|
||||
const excelBuffer = XLSX.write(wb, { bookType: 'xlsx', type: 'array' })
|
||||
const blob = new Blob([excelBuffer], { type: 'application/octet-stream' })
|
||||
saveAs(blob, `${fileName}.xlsx`) // 保存文件
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="username">
|
||||
<el-form-item label="登录账号" prop="username">
|
||||
<el-input v-model="formData.username" placeholder="请输入登录账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -5,29 +5,46 @@
|
||||
<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="1"> 微信 </el-checkbox>
|
||||
<el-checkbox :label="2"> 微信群 </el-checkbox>
|
||||
<el-checkbox label="微信"> 微信 </el-checkbox>
|
||||
<el-checkbox label="微信群"> 微信群 </el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="微信群名称" min-width="150">
|
||||
<el-table-column label="群二维码" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="!row.edit">{{ row.wxGroup }}</span>
|
||||
<el-input v-else v-model="row.wxGroup" size="small" clearable @blur="rowChange(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="群二维码" width="90">
|
||||
<template #default="{ row }">
|
||||
<img :src="row.wxCode" width="80px" height="80px" alt="" />
|
||||
<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 type="primary" style="padding: 5px 0" text @click="row.edit = true">
|
||||
<!-- <div>
|
||||
<el-button
|
||||
v-if="row.sendType.includes('微信群')"
|
||||
type="primary"
|
||||
style="padding: 5px 0"
|
||||
text
|
||||
@click="row.edit = true"
|
||||
>
|
||||
修改群名称
|
||||
</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div v-if="['每日', '每月'].includes(row.sendFrequency)">
|
||||
<el-button type="primary" style="padding: 5px 0" text @click="changeSendTime(row)">
|
||||
修改发送时间
|
||||
@@ -37,7 +54,11 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<Dialog :title="`修改【${sendTimeInfo.name}】发送时间`" v-model="showSendTime" width="500px">
|
||||
<Dialog
|
||||
:title="`修改【${sendTimeInfo.messageName}】发送时间`"
|
||||
v-model="showSendTime"
|
||||
width="500px"
|
||||
>
|
||||
<el-text type="danger">
|
||||
<span v-if="sendTimeInfo.sendFrequency == '每日'">
|
||||
请按照时间格式输入,多个时间以“、”分割,如09:00、15:00、18:00
|
||||
@@ -63,68 +84,20 @@
|
||||
</template>
|
||||
|
||||
<script setup name="WXSetting">
|
||||
import * as WechatApi from '@/api/system/wechat'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([
|
||||
{
|
||||
name: '分配通知',
|
||||
sendType: [],
|
||||
sendFrequency: '每次',
|
||||
sendTime: '触发时立刻发送',
|
||||
remark: '线索分配给除本人之外的用户时,通知对方注意接收'
|
||||
},
|
||||
{
|
||||
name: '发货通知',
|
||||
sendType: [],
|
||||
sendFrequency: '每次',
|
||||
sendTime: '触发时立刻发送',
|
||||
remark: '攀尼下单后,点击发货,发送发货模板到微信/群'
|
||||
},
|
||||
{
|
||||
name: '审核失败通知',
|
||||
sendType: [],
|
||||
sendFrequency: '每次',
|
||||
sendTime: '触发时立刻发送',
|
||||
remark: 'crm中的回款、售后等审核失败,通知申请人'
|
||||
},
|
||||
{
|
||||
name: '喜报',
|
||||
sendType: [],
|
||||
sendFrequency: '每次',
|
||||
sendTime: '触发时立刻发送',
|
||||
remark: '销售成交登记时,发送喜报到微信/群',
|
||||
wxGroup: '寻驾'
|
||||
},
|
||||
{
|
||||
name: '周业绩排名',
|
||||
sendType: [],
|
||||
sendFrequency: '每日',
|
||||
sendTime: '10:00、15:00、18:00',
|
||||
remark: '发送业绩排名到微信/群',
|
||||
wxGroup: '爱顽熊'
|
||||
},
|
||||
{
|
||||
name: '月业绩排名',
|
||||
sendType: [],
|
||||
sendFrequency: '每月',
|
||||
sendTime: '26-18:00、28-14:00、30-15:00、30-18:00',
|
||||
remark: '发送业绩排名到微信/群'
|
||||
}
|
||||
// {
|
||||
// name: '周报',
|
||||
// sendType: [],
|
||||
// sendFrequency: '触发时立刻发送'
|
||||
// }
|
||||
])
|
||||
const tableList = ref([])
|
||||
const columns = [
|
||||
{
|
||||
label: '消息名称',
|
||||
prop: 'name'
|
||||
prop: 'messageName'
|
||||
},
|
||||
{
|
||||
label: '解释说明',
|
||||
prop: 'remark'
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
label: '发送频率',
|
||||
@@ -136,11 +109,35 @@ const columns = [
|
||||
}
|
||||
]
|
||||
|
||||
async function rowChange(row) {
|
||||
onMounted(() => {
|
||||
getTableList()
|
||||
})
|
||||
|
||||
async function getTableList() {
|
||||
try {
|
||||
console.log(row)
|
||||
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 {
|
||||
row.edit = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,31 +145,84 @@ const showSendTime = ref(false)
|
||||
const sendTimeInfo = ref({})
|
||||
function changeSendTime(row) {
|
||||
showSendTime.value = true
|
||||
sendTimeInfo.value = row
|
||||
sendTimeInfo.value = { ...row }
|
||||
}
|
||||
|
||||
function submitSendTime() {
|
||||
const formLoading = ref(false)
|
||||
|
||||
async function submitSendTime() {
|
||||
// 校验时间是否有效
|
||||
const arr = sendTimeInfo.value.sendTime.split('、')
|
||||
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 {
|
||||
message.success('校验成功!')
|
||||
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.some((it) => !reg.test(it))) {
|
||||
if (arr.length > 0 && arr.some((it) => !reg.test(it))) {
|
||||
message.error('请检查输入格式是否正确!!!')
|
||||
return
|
||||
} else {
|
||||
message.success('校验成功!')
|
||||
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,7 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signOrderId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="子订单号" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item v-else>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -105,6 +113,20 @@
|
||||
<el-button @click="batchAudit" v-hasPermi="['clue:order:after-sale-batch-audit']">
|
||||
批量审核
|
||||
</el-button>
|
||||
<el-upload
|
||||
ref="salaryFile"
|
||||
action="#"
|
||||
:limit="1"
|
||||
accept=".xls,.xlsx"
|
||||
:show-file-list="false"
|
||||
style="margin-left: 10px; height: 32px"
|
||||
:before-upload="fileBeforeUpload"
|
||||
:http-request="afterSalesUpload"
|
||||
:disabled="uploading"
|
||||
v-hasPermi="['clue:order:after-sale-import']"
|
||||
>
|
||||
<el-button type="primary"> 导入 </el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -115,7 +137,25 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
||||
<!-- <el-table-column prop="signId" label="成交单号" min-width="150px" /> -->
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="signId"
|
||||
label="成交单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
prop="signOrderId"
|
||||
label="成交单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
prop="signId"
|
||||
label="子订单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column prop="name" label="线索名称" min-width="150px" />
|
||||
<el-table-column prop="phone" label="联系方式" min-width="120px" />
|
||||
<el-table-column
|
||||
@@ -211,6 +251,7 @@ import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
import { removeNullField } from '@/utils'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { exportArrayToExcel } from '@/utils/index'
|
||||
|
||||
const afterSaleAuditDialog = ref()
|
||||
|
||||
@@ -229,6 +270,7 @@ const searchForm = ref({
|
||||
createDate: [],
|
||||
createUser: undefined,
|
||||
checkTime: [],
|
||||
signOrderId: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
@@ -253,6 +295,7 @@ function handleReset() {
|
||||
createDate: [],
|
||||
createUser: undefined,
|
||||
checkTime: [],
|
||||
signOrderId: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
@@ -305,6 +348,62 @@ function handleAudit(row) {
|
||||
afterSaleAuditDialog.value.open(row)
|
||||
}
|
||||
|
||||
const fileBeforeUpload = (file) => {
|
||||
let format = '.' + file.name.split('.')[1]
|
||||
if (!['.xls', '.xlsx'].includes(format)) {
|
||||
message.error(`请上传指定格式".xls,.xlsx"文件`)
|
||||
return false
|
||||
}
|
||||
let isRightSize = file.size / 1024 / 1024 < 20
|
||||
if (!isRightSize) {
|
||||
message.error('文件大小超过 20MB')
|
||||
}
|
||||
return isRightSize
|
||||
}
|
||||
|
||||
const uploading = ref(false)
|
||||
async function afterSalesUpload(data) {
|
||||
uploading.value = true
|
||||
const fd = new FormData()
|
||||
fd.append('file', data.file)
|
||||
try {
|
||||
const resp = await AfterSaleApi.importAfterSales(fd)
|
||||
debugger
|
||||
if (resp && resp.data && resp.data.length) {
|
||||
const succList = resp.data.filter((item) => item.success)
|
||||
const failList = resp.data.filter((item) => !item.success)
|
||||
let msg = `导入完成!成功 ${succList.length} 条,失败 ${failList.length} 条。`
|
||||
if (failList.length) {
|
||||
// 如果有失败,提示下载失败文件
|
||||
msg += '\n请点击消息下载失败明细进行查看。'
|
||||
}
|
||||
ElNotification({
|
||||
title: '导入结果',
|
||||
message: msg,
|
||||
type: 'info',
|
||||
duration: 0,
|
||||
onClick: () => {
|
||||
if (failList.length) {
|
||||
// 将failList生成文件,使用前端下载
|
||||
exportArrayToExcel(failList, `售后导入失败明细${new Date().getTime()}`, [
|
||||
{ title: '手机号', key: 'phone' },
|
||||
{ title: '售后原因', key: 'reason' },
|
||||
{ title: '退款金额', key: 'refundAmount' },
|
||||
{ title: '提成扣款', key: 'percentageDeductAmount' },
|
||||
{ title: '解决方案', key: 'solution' },
|
||||
{ title: '备注', key: 'remark' },
|
||||
{ title: '失败原因', key: 'message' }
|
||||
])
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} finally {
|
||||
uploading.value = false
|
||||
getList()
|
||||
}
|
||||
}
|
||||
|
||||
const areaOptions = ref([])
|
||||
function getOptions() {
|
||||
// 区域
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
<el-input v-model="searchForm.signOrderId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="子订单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
@@ -67,7 +70,8 @@
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" border>
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column prop="signOrderId" label="成交单号" min-width="120px" />
|
||||
<el-table-column prop="signId" label="子订单号" min-width="120px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
@@ -120,6 +124,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const searchForm = ref({
|
||||
signId: undefined,
|
||||
signOrderId: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
signUser: undefined,
|
||||
@@ -142,6 +147,7 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
signId: undefined,
|
||||
signOrderId: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
signUser: undefined,
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<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 :label="0" :value="0">待生产</el-radio>
|
||||
<el-radio :label="1" :value="1">已生产</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-form-item label="是否退货" prop="isReturns">
|
||||
<el-radio-group v-model="form.isReturns">
|
||||
<el-radio :label="true"> 退货 </el-radio>
|
||||
<el-radio :label="false"> 不退货 </el-radio>
|
||||
<el-radio :label="true" :value="true"> 退货 </el-radio>
|
||||
<el-radio :label="false" :value="false"> 不退货 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="formData.state">
|
||||
<el-radio :label="3"> 通过 </el-radio>
|
||||
<el-radio :label="4"> 驳回 </el-radio>
|
||||
<el-radio :label="3" :value="3"> 通过 </el-radio>
|
||||
<el-radio :label="4" :value="4"> 驳回 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="formData.state">
|
||||
<el-radio :label="3"> 通过 </el-radio>
|
||||
<el-radio :label="4"> 驳回 </el-radio>
|
||||
<el-radio :label="3" :value="3"> 通过 </el-radio>
|
||||
<el-radio :label="4" :value="4"> 驳回 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
<el-col :span="16" :offset="0">
|
||||
<el-form-item label="发货方式">
|
||||
<el-radio-group v-model="form.sendType" :disabled="autoAuditPurchase == 'false'">
|
||||
<el-radio :label="1">
|
||||
<el-radio :label="1" :value="1">
|
||||
<Tooltip
|
||||
message="必须在进销存的“通用配置-常规配置”中,将 ’采购申请自动通过‘ 设置为“是”"
|
||||
/>
|
||||
立即采购发货
|
||||
</el-radio>
|
||||
<el-radio :label="2"> 使用库存发货 </el-radio>
|
||||
<el-radio :label="2" :value="2"> 使用库存发货 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -74,6 +74,9 @@
|
||||
<script setup name="DialogExtraPay">
|
||||
import { signAddPay, getSignExtraPayList } from '@/api/clue/sign'
|
||||
import * as ExtraFeeApi from '@/api/clue/extraFee'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const extraPayOptions = ref([])
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -92,13 +95,13 @@ defineExpose({
|
||||
const form = ref({})
|
||||
function resetForm(id) {
|
||||
form.value = {
|
||||
signId: id,
|
||||
id: id,
|
||||
extraPay: []
|
||||
}
|
||||
}
|
||||
|
||||
function getFormList() {
|
||||
getSignExtraPayList({ id: form.value.signId }).then((data) => {
|
||||
getSignExtraPayList({ id: form.value.id }).then((data) => {
|
||||
form.value.extraPay = data.map((it) => ({
|
||||
...it,
|
||||
editabled: false
|
||||
@@ -121,10 +124,14 @@ async function onSubmit() {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const params = {
|
||||
signId: form.value.signId,
|
||||
let params = {
|
||||
extraPay: form.value.extraPay.filter((it) => it.editabled)
|
||||
}
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
params.signId = form.value.id
|
||||
} else {
|
||||
params.signOrderId = form.value.id
|
||||
}
|
||||
await signAddPay(params)
|
||||
message.success('添加额外支出成功!')
|
||||
getFormList()
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="是否结清" prop="isPayoff">
|
||||
<el-radio-group v-model="form.isPayoff">
|
||||
<el-radio :label="true"> 结清 </el-radio>
|
||||
<el-radio :label="false"> 未结清 </el-radio>
|
||||
<el-radio :label="true" :value="true"> 结清 </el-radio>
|
||||
<el-radio :label="false" :value="false"> 未结清 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="formData.state">
|
||||
<el-radio :label="3"> 通过 </el-radio>
|
||||
<el-radio :label="4"> 驳回 </el-radio>
|
||||
<el-radio :label="3" :value="3"> 通过 </el-radio>
|
||||
<el-radio :label="4" :value="4"> 驳回 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<el-divider direction="horizontal" content-position="left">
|
||||
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||
</el-divider>
|
||||
<el-table :data="orderInfo.extraPay" border stripe>
|
||||
<el-table :data="orderInfo.otherPay" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="extraPayType" label="费用项" />
|
||||
<el-table-column prop="extraPayMoney" label="金额" />
|
||||
@@ -110,7 +110,8 @@ const show = ref(false)
|
||||
const clueInfo = ref({})
|
||||
const orderInfo = ref({
|
||||
signProducts: [],
|
||||
extraPay: []
|
||||
extraPay: [],
|
||||
otherPay: []
|
||||
})
|
||||
const returnRecordList = ref([])
|
||||
const aftersaleList = ref([])
|
||||
@@ -127,7 +128,7 @@ const prodTotalPrice = computed(() => {
|
||||
|
||||
// 其他费用
|
||||
const extraTotalPrice = computed(() => {
|
||||
return orderInfo.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||
return orderInfo.value.otherPay?.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||
})
|
||||
|
||||
// 额外支出
|
||||
@@ -198,13 +199,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 = [
|
||||
|
||||
133
src/views/Clue/Order/Comp/DialogOrderProduct.vue
Normal file
133
src/views/Clue/Order/Comp/DialogOrderProduct.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<Dialog title="成交商品" v-model="show" width="80%">
|
||||
<el-table :data="orderProductList" border stripe>
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
||||
<el-table-column prop="remark" label="产品备注" />
|
||||
<el-table-column label="生产状态" width="160px">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isProduced"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="已生产"
|
||||
inactive-text="待生产"
|
||||
v-if="checkPermi(['clue:order:update-produce'])"
|
||||
size="small"
|
||||
@change="handleChangeProdoce(scope.row)"
|
||||
/>
|
||||
<div v-else>{{ scope.row.isProducedDesc }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.sendState == '待发货' ? 'danger' : 'success'" size="small">
|
||||
{{ scope.row.sendState }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货备注">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.sendRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
:disabled="scope.row.sendState == '已发货'"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
@click="handleDelivery(scope.row)"
|
||||
>
|
||||
发货
|
||||
</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>
|
||||
<DialogDelivery ref="deliveryDialog" @success="getList" />
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import DialogDelivery from './DialogDelivery.vue'
|
||||
|
||||
const show = ref(false)
|
||||
const orderProductList = ref([])
|
||||
const orderId = ref(null)
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
function open(signId) {
|
||||
try {
|
||||
show.value = true
|
||||
orderId.value = signId
|
||||
getList()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
function getList() {
|
||||
try {
|
||||
SignApi.getOrderProductList({ signId: orderId.value }).then((data) => {
|
||||
orderProductList.value = data || []
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleChangeProdoce(row) {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
await message.confirm('确认要修改生产状态吗?')
|
||||
// 发起修改状态
|
||||
await SignApi.updateProduceStatus({
|
||||
signId: row.signId,
|
||||
id: row.id,
|
||||
isProduced: row.isProduced
|
||||
})
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
// getTableList()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.isProduced = !row.isProduced
|
||||
}
|
||||
}
|
||||
|
||||
const deliveryDialog = ref()
|
||||
function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -2,46 +2,6 @@
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<div>
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
ref="moreSearchRef"
|
||||
inline
|
||||
label-width="0"
|
||||
style="display: inline"
|
||||
>
|
||||
<el-form-item style="margin-bottom: 10px">
|
||||
<el-select
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.specsId = undefined"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prodOptions"
|
||||
:key="item.productId"
|
||||
:label="item.productName"
|
||||
:value="item.productId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-bottom: 10px">
|
||||
<el-select
|
||||
v-model="searchForm.specsId"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.signProduct)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<Search
|
||||
v-if="!loading"
|
||||
ref="searchRef"
|
||||
@@ -67,9 +27,11 @@
|
||||
v-if="!loading"
|
||||
class="mt-10px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
rowkey="signId"
|
||||
:tableColumns="allSchemas.tableColumns.filter((it) => it.paramLevel == 1)"
|
||||
rowkey="signOrderId"
|
||||
:expandRowKeys="expendRows"
|
||||
:showSummary="true"
|
||||
:summaryMethod="summaryMethod"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@selection-change="handleSelectionChange"
|
||||
@@ -78,123 +40,41 @@
|
||||
<el-table-column type="expand" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<div class="p-10px flex justify-center">
|
||||
<VueDraggable
|
||||
target="tbody"
|
||||
v-model="row.signProducts"
|
||||
:animation="150"
|
||||
@end="onDragEnd"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table
|
||||
:data="row.signProducts"
|
||||
row-key="id"
|
||||
stripe
|
||||
style="width: 80%; margin: 0 auto"
|
||||
>
|
||||
<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">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isProduced"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="已生产"
|
||||
inactive-text="待生产"
|
||||
:disabled="!checkPermi(['clue:order:update-produce'])"
|
||||
size="small"
|
||||
@change="handleChangeProdoce(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="scope.row.sendState == '待发货' ? 'danger' : 'success'"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.sendState }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.sendRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
:disabled="scope.row.sendState == '已发货'"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
@click="handleDelivery(scope.row)"
|
||||
>
|
||||
发货
|
||||
</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>
|
||||
</VueDraggable>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table :data="row.childrenOrder" row-key="signId" stripe>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
v-for="item in allSchemas.tableColumns.filter((it) => it.paramLevel == 2)"
|
||||
:key="item.id"
|
||||
width="100px"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
v-if="item.field == 'remark' || item.form?.component == 'Editor'"
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
>
|
||||
<div v-dompurify-html="scope.row.remark"></div>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
<el-button type="primary" link>查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row[item.field]"></div>
|
||||
</el-popover>
|
||||
<div v-else>
|
||||
<span v-if="item.isCustom">{{ scope.row.diyParams[item.field] }}</span>
|
||||
<span v-else>{{ scope.row[item.field] }}</span>
|
||||
</div>
|
||||
<span v-else-if="item.form?.component == 'DatePicker'">
|
||||
{{ formatDate(row[item.field]) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240px" fixed="right">
|
||||
<el-table-column label="操作" width="260px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:detail']"
|
||||
@click="handleDetail(scope.row)"
|
||||
@click="openProduct(scope.row)"
|
||||
>
|
||||
详情
|
||||
成交商品
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -211,22 +91,11 @@
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-if="scope.row.isPayoff == '未结清'"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="feeBack(scope.row)"
|
||||
>
|
||||
回款
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:add-fee']"
|
||||
@click="handleAddFee(scope.row)"
|
||||
>
|
||||
添加支出
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
@@ -249,36 +118,71 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" link>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row[item.field]"></div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<span v-else-if="item.form?.component == 'DatePicker'">
|
||||
{{ formatDate(row[item.field]) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:add-fee']"
|
||||
@click="handleAddFee(scope.row)"
|
||||
>
|
||||
添加支出
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
|
||||
<!-- 详情 -->
|
||||
<DialogOrder ref="orderDetailDialog" />
|
||||
<DialogFeeback ref="feedbackDialog" />
|
||||
<DialogAfterSale ref="afterSaleDialog" />
|
||||
<DialogExtraFee ref="extraFeeDialog" />
|
||||
<DialogDelivery ref="deliveryDialog" @success="getTableList" />
|
||||
<DialogAddProduct ref="addProductDialog" @success="getTableList" />
|
||||
<DialogOrderProduct ref="orderProductDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueOrderList">
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import { getSimpleUserList as getUserOption, getAllUserListWithHire } from '@/api/system/user'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
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 DialogOrderProduct from './DialogOrderProduct.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { ElMessageBox, ElOption, ElSelect } from 'element-plus'
|
||||
import { VueDraggable } from 'vue-draggable-plus'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
@@ -290,20 +194,7 @@ const message = useMessage() // 消息弹窗
|
||||
|
||||
const allSchemas = ref({})
|
||||
|
||||
const orderDetailDialog = ref()
|
||||
const searchRef = ref()
|
||||
const prodOptions = ref([])
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
signProduct: undefined
|
||||
@@ -314,7 +205,12 @@ const tableObject = ref({
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
pageNo: 1,
|
||||
totalData: {
|
||||
totalReceivedMoney: 0,
|
||||
totalSignPrice: 0,
|
||||
totalPayAmount: 0
|
||||
}
|
||||
})
|
||||
|
||||
function resetQuery() {
|
||||
@@ -335,29 +231,44 @@ async function getTableList() {
|
||||
...queryParams,
|
||||
...searchForm.value,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageSize: tableObject.value.pageSize
|
||||
pageSize: tableObject.value.pageSize,
|
||||
diyParams: {}
|
||||
}
|
||||
searchFieldList.value.map((it) => {
|
||||
if (params[it.field]) {
|
||||
params.diyParams[it.field] = params[it.field]
|
||||
}
|
||||
})
|
||||
const data = await SignApi.getSignPage(removeNullField(params))
|
||||
tableObject.value.tableList = data.list.map((it) => ({ ...it, ...it.diyParams }))
|
||||
tableObject.value.tableList = data.list.map((it) => ({ ...it, ...it.orderDiyParams }))
|
||||
tableObject.value.total = data.total
|
||||
tableObject.value.totalData = data.totalData
|
||||
} finally {
|
||||
tableObject.value.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(true)
|
||||
const searchFieldList = ref([])
|
||||
async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
searchFieldList.value = data.filter((it) => it.isCustom && it.isSearch)
|
||||
// const mainOrderFields = data.filter((it) => it.paramLevel == 1)
|
||||
data.forEach((elem) => {
|
||||
if (['createUser'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
} else if (['convertPeople', 'receiver'].includes(elem.field)) {
|
||||
if (elem.isSearch) {
|
||||
// if (['createUser'].includes(elem.field)) {
|
||||
// elem.search.options = userOptions.value
|
||||
// } else
|
||||
if (['convertPeople', 'receiver', 'createUser'].includes(elem.field)) {
|
||||
elem.search.options = allUserOptions.value
|
||||
}
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
nextTick(() => {
|
||||
@@ -370,12 +281,8 @@ const showColumns = ref([])
|
||||
|
||||
// 初始化表格
|
||||
function getCheckedColumns(list) {
|
||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||
}
|
||||
|
||||
// 详情
|
||||
function handleDetail(row) {
|
||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||
showColumns.value =
|
||||
list && list.length ? list : allSchemas.value.tableColumns.filter((it) => it.paramLevel == 1)
|
||||
}
|
||||
|
||||
const feedbackDialog = ref()
|
||||
@@ -407,32 +314,23 @@ async function cancelDeal(row) {
|
||||
|
||||
const extraFeeDialog = ref()
|
||||
function handleAddFee(row) {
|
||||
extraFeeDialog.value.open(row.signId)
|
||||
extraFeeDialog.value.open(row.signOrderId)
|
||||
}
|
||||
|
||||
async function getOptions() {
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserListWithHire()
|
||||
getCurdSchemas()
|
||||
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserList()
|
||||
getCurdSchemas()
|
||||
}
|
||||
const deliveryDialog = ref()
|
||||
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)
|
||||
batchIds.value = val.map((it) => it.signOrderId)
|
||||
}
|
||||
|
||||
const selectedValue = ref(undefined)
|
||||
@@ -486,50 +384,37 @@ function handleBatchUpdateInstall() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleRemoveProduct(row) {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
await message.confirm(`确认要删除${row.productName}吗?`)
|
||||
// 发起修改状态
|
||||
await SignApi.removeOrderProduct(row.id)
|
||||
message.success('删除成功')
|
||||
// 刷新列表
|
||||
getTableList()
|
||||
} catch {}
|
||||
const orderProductDialog = ref()
|
||||
function openProduct(row) {
|
||||
orderProductDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
async function handleChangeProdoce(row) {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
await message.confirm('确认要修改生产状态吗?')
|
||||
// 发起修改状态
|
||||
await SignApi.updateProduceStatus({
|
||||
signId: row.signId,
|
||||
id: row.id,
|
||||
isProduced: row.isProduced
|
||||
})
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
getTableList()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.isProduced = !row.isProduced
|
||||
function summaryMethod({ columns }) {
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
if (column.property == 'payTotalAmount') {
|
||||
sums[index] = tableObject.value.totalData?.totalPayAmount || 0
|
||||
} else if (column.property == 'signTotalPrice') {
|
||||
sums[index] = tableObject.value.totalData?.totalSignPrice || 0
|
||||
} else if (column.property == 'receivedMoney') {
|
||||
sums[index] = tableObject.value.totalData?.totalReceivedMoney || 0
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
|
||||
const expendRows = ref([])
|
||||
async function onDragEnd(ev) {
|
||||
try {
|
||||
expendRows.value = [ev.data.signId]
|
||||
const list = tableObject.value.tableList.find((it) => it.signId == ev.data.signId).signProducts
|
||||
await SignApi.updateProduceSort(list.map((it) => it.id))
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
getTableList()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
getTableList()
|
||||
}
|
||||
|
||||
const addProductDialog = ref()
|
||||
const prodOptions = ref([])
|
||||
function handleAddProduct(row) {
|
||||
addProductDialog.value.open(row.signId, prodOptions.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.signId"
|
||||
placeholder="成交单号"
|
||||
clearable
|
||||
style="width: 120px"
|
||||
/>
|
||||
<el-input v-model="searchForm.signOrderId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="子订单号" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item v-else>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable style="width: 120px" />
|
||||
@@ -124,8 +127,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </el-radio>
|
||||
<el-radio :label="1" :value="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0" :value="0"> 待结算 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
@@ -152,7 +155,24 @@
|
||||
fixed="left"
|
||||
:selectable="(row) => row.settlementState == '待结算'"
|
||||
/>
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="signId"
|
||||
label="成交单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
prop="signOrderId"
|
||||
label="成交单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
prop="signId"
|
||||
label="子订单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
@@ -246,6 +266,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>
|
||||
@@ -269,9 +299,11 @@ import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { getSupplierSimpleList } from '@/api/school/setting/supplier'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const appStore = useAppStore()
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
@@ -287,6 +319,7 @@ const searchForm = ref({
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
signOrderId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
@@ -304,6 +337,7 @@ function handleReset() {
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
signOrderId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
@@ -394,6 +428,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)
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
<script setup name="ClueOrderList">
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { getAllUserListWithHire } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
|
||||
@@ -194,7 +194,7 @@ import DialogExtraFee from './DialogExtraPay.vue'
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
// const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
@@ -249,7 +249,8 @@ async function getTableList() {
|
||||
...queryParams,
|
||||
...searchForm.value,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageSize: tableObject.value.pageSize
|
||||
pageSize: tableObject.value.pageSize,
|
||||
diyParams: {}
|
||||
}
|
||||
searchFieldList.value.map((it) => {
|
||||
if (params[it.field]) {
|
||||
@@ -270,11 +271,12 @@ async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
searchFieldList.value = data.filter((it) => it.isCustom)
|
||||
searchFieldList.value = data.filter((it) => it.isCustom && it.isSearch)
|
||||
data.forEach((elem) => {
|
||||
if (['createUser'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
} else if (['convertPeople', 'receiver'].includes(elem.field)) {
|
||||
// if (['createUser'].includes(elem.field)) {
|
||||
// elem.search.options = userOptions.value
|
||||
// } else
|
||||
if (['convertPeople', 'receiver', 'createUser'].includes(elem.field)) {
|
||||
elem.search.options = allUserOptions.value
|
||||
}
|
||||
})
|
||||
@@ -349,12 +351,14 @@ async function getClassTypeOptions() {
|
||||
|
||||
async function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true, hasAll: true }).then(
|
||||
(data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserList()
|
||||
}
|
||||
)
|
||||
// userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserListWithHire()
|
||||
getCurdSchemas()
|
||||
}
|
||||
</script>
|
||||
|
||||
237
src/views/Clue/Order/Comp/OrderRemark.vue
Normal file
237
src/views/Clue/Order/Comp/OrderRemark.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="学员姓名" clearable style="width: 120px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.phone"
|
||||
placeholder="联系方式"
|
||||
clearable
|
||||
style="width: 100px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.intentionState"
|
||||
placeholder="学员意向"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in intentionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.followUser"
|
||||
placeholder="跟进人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.remarkDate"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="报备日期"
|
||||
end-placeholder="报备日期"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.schoolId"
|
||||
placeholder="邀约驾校"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<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.placeId"
|
||||
placeholder="邀约场地"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<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-date-picker
|
||||
v-model="searchForm.signDate"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="报名日期"
|
||||
end-placeholder="报名日期"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.isSign"
|
||||
placeholder="报名状态"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100px"
|
||||
>
|
||||
<el-option label="未报名" :value="0" />
|
||||
<el-option label="已报名" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.isEnroll"
|
||||
placeholder="登记状态"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100px"
|
||||
>
|
||||
<el-option label="未登记" :value="0" />
|
||||
<el-option label="已登记" :value="1" />
|
||||
</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>
|
||||
<el-table-column prop="name" label="学员姓名" width="90px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="110px" />
|
||||
<el-table-column prop="followUserName" label="跟进人" width="90" />
|
||||
<el-table-column prop="intentionStateName" label="学员意向" width="90" />
|
||||
<el-table-column prop="remarkDate" label="报备日期" width="100px" />
|
||||
<el-table-column prop="remarkUserName" label="报备人" width="90px" />
|
||||
<el-table-column prop="remarkContent" label="报备内容" min-width="400px" />
|
||||
<el-table-column prop="schoolName" label="邀约驾校" width="100" />
|
||||
<el-table-column prop="placeName" label="邀约场地" width="100" />
|
||||
<el-table-column prop="signDate" label="报名日期" width="100px" />
|
||||
<el-table-column prop="enterUserName" label="接待人" width="90px" />
|
||||
<el-table-column prop="signInfo" label="报名信息" min-width="150px" />
|
||||
<el-table-column prop="isSign" label="报名状态" width="85px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-tag type="success" v-if="row.isSign">已报名</el-tag>
|
||||
<el-tag type="info" v-else>未报名</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isEnroll" label="登记状态" width="85px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-tag type="success" v-if="row.isEnroll">已登记</el-tag>
|
||||
<el-tag type="info" v-else>未登记</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getClueRemarkPage } from '@/api/clue/clueRemark'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getIntDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const userOptions = ref([])
|
||||
const schoolOptions = ref([])
|
||||
const placeOptions = ref([])
|
||||
const intentionOptions = getIntDictOptions('intention_state')
|
||||
function getOptions() {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
|
||||
getPlaceList({
|
||||
placeStatus: 0,
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
}).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
placeOptions.value = data.placeList
|
||||
})
|
||||
}
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
let params = { ...removeNullField(searchForm.value) }
|
||||
const data = await getClueRemarkPage(params)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,7 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signOrderId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="子订单号" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item v-else>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -208,7 +216,24 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="signId"
|
||||
label="成交单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
prop="signOrderId"
|
||||
label="成交单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
prop="signId"
|
||||
label="子订单号"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column prop="name" label="线索名称" width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />companyProfit
|
||||
<el-table-column prop="money" label="回款金额" min-width="120px">
|
||||
@@ -439,6 +464,7 @@ const currentUserId = userStore.getUser.id
|
||||
|
||||
const searchForm = ref({
|
||||
signId: undefined,
|
||||
signOrderId: undefined,
|
||||
name: undefined,
|
||||
state: undefined,
|
||||
dealDate: [],
|
||||
@@ -472,6 +498,7 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
signId: undefined,
|
||||
signOrderId: undefined,
|
||||
receiver: undefined,
|
||||
convertPeople: undefined,
|
||||
name: undefined,
|
||||
|
||||
@@ -126,8 +126,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </el-radio>
|
||||
<el-radio :label="1" :value="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0" :value="0"> 待结算 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
<el-tab-pane label="对外结算" name="settle" v-if="checkPermi(['clue:order:settle-list'])">
|
||||
<Settle v-if="tabName == 'settle'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="邀约报备" name="remark" v-if="checkPermi(['clue:order:remark'])">
|
||||
<OrderRemark v-if="tabName == 'remark'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
@@ -37,6 +40,8 @@ import Reback from './Comp/Reback.vue'
|
||||
import AfterSales from './Comp/AfterSales.vue'
|
||||
import Delivery from './Comp/Delivery.vue'
|
||||
import Settle from './Comp/Settle.vue'
|
||||
import OrderRemark from './Comp/OrderRemark.vue'
|
||||
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
144
src/views/Clue/Pool/ClueAdd.vue
Normal file
144
src/views/Clue/Pool/ClueAdd.vue
Normal file
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<div class="p-10px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="学员姓名" prop="stuName">
|
||||
<el-input v-model="form.stuName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="stuMobile">
|
||||
<el-input v-model="form.stuMobile" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="线索来源" prop="source">
|
||||
<el-cascader
|
||||
:options="sourceOptions"
|
||||
v-model="form.source"
|
||||
clearable
|
||||
filterable
|
||||
:props="defaultProps"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="咨询日期" prop="stuConsultTime">
|
||||
<el-date-picker
|
||||
v-model="form.stuConsultTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="咨询车型" prop="stuConsultCartype">
|
||||
<el-select v-model="form.stuConsultCartype" placeholder="请选择" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in cartypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学员诉求" prop="requirement">
|
||||
<el-input
|
||||
v-model="form.requirement"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3 }"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3 }"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-button type="primary" @click="onSubmit" size="large" style="width: 100%"
|
||||
>提 交</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getStrDictOptions } from '@/utils/dict'
|
||||
import { getSimpleSourceList } from '@/api/clue/source'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
// import * as authUtil from '@/utils/auth'
|
||||
|
||||
import { clueInput } from '@/api/clue'
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
stuName: '',
|
||||
stuMobile: '',
|
||||
source: '',
|
||||
stuConsultTime: formatDate(new Date()),
|
||||
stuConsultCartype: 'C1',
|
||||
requirement: '',
|
||||
remark: '',
|
||||
instanceId: '1014'
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
expandTrigger: 'hover',
|
||||
checkStrictly: false,
|
||||
label: 'sourceName',
|
||||
value: 'sourceId'
|
||||
}
|
||||
|
||||
const rules = {
|
||||
stuName: [{ required: true, message: '请输入学员姓名', trigger: 'blur' }],
|
||||
stuMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
||||
source: [{ required: true, message: '请选择线索来源', trigger: 'change' }],
|
||||
stuConsultTime: [{ required: true, message: '请选择咨询日期', trigger: 'change' }],
|
||||
stuConsultCartype: [{ required: true, message: '请选择咨询车型', trigger: 'change' }]
|
||||
}
|
||||
|
||||
const sourceOptions = ref([])
|
||||
const cartypeOptions = getStrDictOptions('license_type')
|
||||
|
||||
function getOptions() {
|
||||
getSimpleSourceList().then((data) => {
|
||||
sourceOptions.value = handleTree(data, 'sourceId')
|
||||
})
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
function onSubmit() {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
// 提交表单
|
||||
const params = {
|
||||
...form.value,
|
||||
source: form.value.source ? form.value.source[form.value.source.length - 1] : null
|
||||
}
|
||||
clueInput(params).then(() => {
|
||||
message.success('线索录入成功')
|
||||
form.value = {
|
||||
stuName: '',
|
||||
stuMobile: '',
|
||||
source: '',
|
||||
stuConsultTime: formatDate(new Date()),
|
||||
stuConsultCartype: '',
|
||||
requirement: '',
|
||||
remark: ''
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('表单验证失败')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
593
src/views/Clue/Pool/ClueEnroll.vue
Normal file
593
src/views/Clue/Pool/ClueEnroll.vue
Normal file
@@ -0,0 +1,593 @@
|
||||
<template>
|
||||
<div style="height: 100vh; overflow-y: auto">
|
||||
<div>
|
||||
<div>
|
||||
<Descriptions
|
||||
:title="`线索信息-${info.name}`"
|
||||
:data="info"
|
||||
:schema="showSchema"
|
||||
:columns="2"
|
||||
labelWidth="130px"
|
||||
:defaultShow="false"
|
||||
/>
|
||||
<el-form
|
||||
:model="form"
|
||||
ref="formRef"
|
||||
:rules="rules"
|
||||
label-width="85px"
|
||||
class="mt-20px pl-10px pr-10px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="学员姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入学员姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系方式" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="成交驾校" prop="signSchool">
|
||||
<el-select
|
||||
v-model="form.signSchool"
|
||||
placeholder="选择驾校"
|
||||
filterable
|
||||
@change="changeSchool"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in schoolOptions"
|
||||
:key="item.schoolId"
|
||||
:label="item.schoolName"
|
||||
:value="item.schoolId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="成交场地" prop="signPlace">
|
||||
<el-select
|
||||
v-model="form.signPlace"
|
||||
placeholder="选择场地"
|
||||
filterable
|
||||
:disabled="!form.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-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="成交班型" prop="signClass">
|
||||
<el-select
|
||||
v-model="form.signClass"
|
||||
:disabled="!form.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
@change="changeClass"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
:key="item.typeId"
|
||||
:label="item.typeName"
|
||||
:value="item.typeId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
v-model="form.dealDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="成交价" prop="signPrice">
|
||||
<el-input-number
|
||||
v-model="form.signPrice"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
:controls="false"
|
||||
@change="signPriceChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.isPayoff">
|
||||
<el-radio :label="true" :value="true"> 全款 </el-radio>
|
||||
<el-radio :label="false" :value="false"> 非全款 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="支付金额" prop="payAmount">
|
||||
<el-input-number
|
||||
v-model="form.payAmount"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
:controls="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="公司收款" prop="isCompanyReceipts">
|
||||
<el-radio-group v-model="form.isCompanyReceipts">
|
||||
<el-radio :label="true" :value="true">是</el-radio>
|
||||
<el-radio :label="false" :value="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24" v-if="form.signClass">
|
||||
<el-form-item label="利润">
|
||||
<div style="color: blue; font-weight: bold; font-size: 16px">{{ profitNum }}</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xl="6" :lg="6" :md="8" :sm="24" :xs="24">
|
||||
<el-form-item label="接待人" prop="receiver">
|
||||
<el-select v-model="form.receiver" placeholder="选择接待人" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in allUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:xl="6"
|
||||
:lg="6"
|
||||
:md="8"
|
||||
:sm="24"
|
||||
:xs="24"
|
||||
v-for="fieldItem in diyFieldList"
|
||||
:key="fieldItem.clueParamId"
|
||||
>
|
||||
<el-form-item :label="fieldItem.label" :prop="fieldItem.field">
|
||||
<component :is="componentMap[fieldItem.component]" v-model="form[fieldItem.field]">
|
||||
<template v-if="fieldItem.component == 'Select'">
|
||||
<el-option
|
||||
v-for="item in fieldItem.options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="fieldItem.component == 'Radio'">
|
||||
<el-radio
|
||||
v-for="item in fieldItem.options"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</template>
|
||||
<template v-else-if="fieldItem.component == 'Checkbox'">
|
||||
<el-checkbox
|
||||
v-for="item in fieldItem.options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</template>
|
||||
</component>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0" class="mb-18px">
|
||||
<el-divider direction="horizontal" content-position="left"> 其他费用 </el-divider>
|
||||
<el-button
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="form.otherPay.push({ extraPayType: undefined, extraPayMoney: 0 })"
|
||||
>
|
||||
添加其他费用
|
||||
</el-button>
|
||||
<el-table :data="form.otherPay" border size="small">
|
||||
<el-table-column type="index" width="30" />
|
||||
<el-table-column prop="extraPayType" label="费用类型">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.extraPayType"
|
||||
size="small"
|
||||
placeholder="费用类型"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in otherPayOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="extraPayMoney" label="费用金额">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.extraPayMoney" size="small" :controls="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" size="small" placeholder="备注信息" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50px">
|
||||
<template #default="{ $index }">
|
||||
<Icon
|
||||
icon="ep:remove-filled"
|
||||
class="text-red-500"
|
||||
@click="handleRemove('otherPay', $index)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0" class="mb-18px">
|
||||
<el-divider direction="horizontal" content-position="left"> 额外支出 </el-divider>
|
||||
<el-button
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="
|
||||
form.extraPay.push({
|
||||
extraPayType: undefined,
|
||||
extraPayMoney: 0,
|
||||
dictType: 'extra_pay_type',
|
||||
editabled: true
|
||||
})
|
||||
"
|
||||
>
|
||||
添加额外支出
|
||||
</el-button>
|
||||
<el-table :data="form.extraPay" border size="small">
|
||||
<el-table-column type="index" width="30" />
|
||||
<el-table-column prop="extraPayType" label="支出类型">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-if="row.editabled"
|
||||
v-model="row.extraPayType"
|
||||
size="small"
|
||||
placeholder="支出类型"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in extraPayOptions"
|
||||
:key="item.id"
|
||||
:label="item.extraPayName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="extraPayMoney" label="支出金额">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="row.editabled"
|
||||
v-model="row.extraPayMoney"
|
||||
size="small"
|
||||
:controls="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template #default="{ row }">
|
||||
<el-input
|
||||
v-if="row.editabled"
|
||||
v-model="row.remark"
|
||||
size="small"
|
||||
placeholder="备注信息"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50px">
|
||||
<template #default="{ row, $index }">
|
||||
<Icon
|
||||
icon="ep:remove-filled"
|
||||
class="text-red-500"
|
||||
v-if="row.editabled"
|
||||
@click="handleRemove('extraPay', $index)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" label-width="50px">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="p-10px">
|
||||
<el-button
|
||||
v-if="!remarkInfo.isEnroll && info.clueId"
|
||||
type="primary"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
@click="handleSave"
|
||||
>
|
||||
提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { createSignOnRemark, getSignProfit } from '@/api/clue/sign'
|
||||
import { getClueRemarkByRemarkId } from '@/api/clue/clueRemark'
|
||||
import { getDiyFieldList } from '@/api/clue/orderField'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import { getConfigByConfigKey } from '@/api/system/set'
|
||||
import { getSimpleFieldList as getClueField } from '@/api/clue/clueField'
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import { getExtraFeeSimpleList } from '@/api/clue/extraFee'
|
||||
import { getAllUserList } from '@/api/system/user'
|
||||
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { componentMap } from '@/components/Form/src/componentMap'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const form = ref({})
|
||||
|
||||
const schoolRules = {
|
||||
name: { required: true, message: '学员姓名不可为空', trigger: 'blur' },
|
||||
phone: { required: true, message: '联系方式不可为空', trigger: 'blur' },
|
||||
signSchool: { required: true, message: '成交驾校不可为空', trigger: 'change' },
|
||||
signPlace: { required: true, message: '成交场地不可为空', trigger: 'change' },
|
||||
signClass: { required: true, message: '成交班型不可为空', trigger: 'change' }
|
||||
}
|
||||
|
||||
const info = ref({})
|
||||
const formLoading = ref(false)
|
||||
|
||||
const route = useRoute()
|
||||
const message = useMessage() // 消息弹窗
|
||||
const userStore = useUserStore()
|
||||
|
||||
const showSchema = ref([])
|
||||
|
||||
const otherPayOptions = getDictOptions('other_pay_type')
|
||||
const extraPayOptions = ref([])
|
||||
|
||||
const remarkInfo = ref({})
|
||||
|
||||
onMounted(() => {
|
||||
if (route.params.id && route.params.id != 0) {
|
||||
// 这里可以调用API获取会议详情数据
|
||||
getClueRemarkByRemarkId({ remarkId: route.params.id }).then((response) => {
|
||||
remarkInfo.value = response
|
||||
if (
|
||||
userStore.getUser?.id != remarkInfo.value.remarkUser &&
|
||||
userStore.getUser?.id != remarkInfo.value.followUser
|
||||
) {
|
||||
message.error('无权限操作该登记页面!')
|
||||
return
|
||||
} else {
|
||||
resetForm()
|
||||
getOptions()
|
||||
getDiyFields()
|
||||
ClueApi.getClue(remarkInfo.value.clueId).then((data) => {
|
||||
info.value = { ...data, ...data.diyParams, signInfo: remarkInfo.value.signInfo }
|
||||
let str = ''
|
||||
// if (!remarkInfo.value.remarkContent.includes(data.name)) {
|
||||
// // 提示姓名不一致
|
||||
// str += '学员姓名不一致'
|
||||
// }
|
||||
// if (!remarkInfo.value.remarkContent.includes(data.phone)) {
|
||||
// // 提示姓名不一致
|
||||
// str += '手机号不一致'
|
||||
// }
|
||||
if (str.length) {
|
||||
message.warning(`请注意:${str}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 关闭网页
|
||||
window.close()
|
||||
}
|
||||
})
|
||||
|
||||
async function resetForm() {
|
||||
const data = await getConfigByConfigKey({ configKey: 'companyCollectionConfig' })
|
||||
form.value = {
|
||||
name: remarkInfo.value.name,
|
||||
phone: remarkInfo.value.phone,
|
||||
clueId: remarkInfo.value.clueId,
|
||||
dealDate: formatDate(new Date()),
|
||||
isPayoff: true,
|
||||
signPrice: 0,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: data?.configValue == 'true',
|
||||
receiver: undefined,
|
||||
extraPay: [],
|
||||
otherPay: [],
|
||||
signProducts: [],
|
||||
installStatus: 3
|
||||
}
|
||||
}
|
||||
|
||||
const rules = ref([])
|
||||
function getDiyFields() {
|
||||
getSimpleFieldList().then((data) => {
|
||||
let ruleObj = {}
|
||||
data.map((it) => {
|
||||
if (it.isRequired) {
|
||||
Reflect.set(ruleObj, it.field, {
|
||||
required: true,
|
||||
message: `${it.label}不可为空`,
|
||||
trigger: 'blur, change'
|
||||
})
|
||||
}
|
||||
})
|
||||
rules.value = { ...ruleObj, ...schoolRules }
|
||||
})
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
if (form.value.otherPay.some((it) => !it.extraPayType || it.extraPayMoney == null)) {
|
||||
message.info('请将费用类型及费用金额填写完整!')
|
||||
return
|
||||
}
|
||||
if (form.value.extraPay.some((it) => !it.extraPayType || it.extraPayMoney == null)) {
|
||||
message.info('请将支出类型及支出金额填写完整!')
|
||||
return
|
||||
}
|
||||
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const params = { ...form.value }
|
||||
params.diyParams = {}
|
||||
diyFieldList.value.map((it) => {
|
||||
params.diyParams[it.field] = undefined
|
||||
})
|
||||
for (const key in params.diyParams) {
|
||||
if (Object.hasOwnProperty.call(params, key)) {
|
||||
params.diyParams[key] = params[key]
|
||||
}
|
||||
}
|
||||
await createSignOnRemark(params)
|
||||
message.success('登记成功!')
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const schoolOptions = ref([])
|
||||
const allPlaceOptions = ref([])
|
||||
|
||||
const diyFieldList = ref([])
|
||||
|
||||
const placeOptions = computed(() => {
|
||||
return allPlaceOptions.value.filter((it) => it.schoolId == form.value.signSchool)
|
||||
})
|
||||
|
||||
const classOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypeList({ placeId: form.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
getClueField().then((data) => {
|
||||
const list = useCrudSchemas(data)?.allSchemas?.detailSchema?.map((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
return it
|
||||
})
|
||||
if (list.length % 2 != 0) {
|
||||
list.push({})
|
||||
}
|
||||
const arr = [
|
||||
{
|
||||
field: 'requirement',
|
||||
label: '诉求',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
isEditor: true,
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
field: 'signInfo',
|
||||
label: '报名信息',
|
||||
isEditor: true,
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
showSchema.value = [...list, ...arr]
|
||||
})
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
// 自定义参数
|
||||
getDiyFieldList().then((data) => {
|
||||
diyFieldList.value = data
|
||||
})
|
||||
getExtraFeeSimpleList().then((data) => {
|
||||
extraPayOptions.value = data
|
||||
})
|
||||
getAllUserList().then((data) => {
|
||||
allUserOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function changeSchool() {
|
||||
form.value.signPlace = undefined
|
||||
form.value.signClass = undefined
|
||||
}
|
||||
|
||||
function changePlace() {
|
||||
form.value.signClass = undefined
|
||||
getClassTypeOptions()
|
||||
}
|
||||
|
||||
function changeClass() {
|
||||
form.value.signPrice =
|
||||
classOptions.value.find((it) => it.typeId == form.value.signClass).guidingPrice || 0
|
||||
signPriceChange()
|
||||
}
|
||||
|
||||
function signPriceChange() {
|
||||
if (form.value.isPayoff) {
|
||||
form.value.payAmount = form.value.signPrice
|
||||
}
|
||||
calcSignProfit()
|
||||
}
|
||||
|
||||
const profitNum = ref(0)
|
||||
function calcSignProfit() {
|
||||
if (form.value.signClass) {
|
||||
// 计算员工利润
|
||||
getSignProfit({ signClass: form.value.signClass, signPrice: form.value.signPrice }).then(
|
||||
(data) => {
|
||||
profitNum.value = data
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function handleRemove(type, index) {
|
||||
form.value[type].splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -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
|
||||
@@ -335,11 +335,14 @@ async function handleSave() {
|
||||
if (!followList.value || followList.value.length == 0) {
|
||||
message.info('请添加跟进人')
|
||||
return
|
||||
}
|
||||
if (followList.value && followList.value.length && followList.value.some((it) => !it.userId)) {
|
||||
} else if (followList.value.some((it) => !it.userId)) {
|
||||
message.info('请将跟进人填写完整!')
|
||||
return
|
||||
} else if (followList.value.some((it) => it.userId == useUserStore().getUser.id && !it.content)) {
|
||||
message.info('请填写您的首次跟进内容或将线索跟进人改成他人!')
|
||||
return
|
||||
}
|
||||
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !address.value) {
|
||||
message.info('请选择学员位置!')
|
||||
return
|
||||
@@ -395,7 +398,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) => {
|
||||
|
||||
@@ -17,17 +17,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="下次跟进时间" prop="nextFollowTime">
|
||||
<el-date-picker
|
||||
v-model="form.nextFollowTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
placeholder="下次跟进时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="意向状态" prop="intentionState">
|
||||
<el-select v-model="form.intentionState" filterable>
|
||||
@@ -40,6 +29,21 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="12"
|
||||
:offset="0"
|
||||
v-if="form.intentionState != 74 && form.intentionState != '1956731237364404224'"
|
||||
>
|
||||
<el-form-item label="下次跟进时间" prop="nextFollowTime">
|
||||
<el-date-picker
|
||||
v-model="form.nextFollowTime"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
placeholder="下次跟进时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
|
||||
149
src/views/Clue/Pool/Comp/DialogRemark.vue
Normal file
149
src/views/Clue/Pool/Comp/DialogRemark.vue
Normal file
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<Dialog title="邀约报备" v-model="show" width="600px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="0">
|
||||
<el-form-item prop="remarkContent">
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="请输入报备信息"
|
||||
v-model="form.remarkContent"
|
||||
:autosize="{ minRows: 10 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="groupId">
|
||||
<el-select v-model="form.groupId" placeholder="选择群聊发送报备信息并@区域" filterable>
|
||||
<el-option
|
||||
v-for="item in groupOptions"
|
||||
:key="item.groupId"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="schoolPlace">
|
||||
<el-cascader
|
||||
v-model="form.schoolPlace"
|
||||
:options="placeOptions"
|
||||
placeholder="选择邀约驾校和场地"
|
||||
filterable
|
||||
show-all-levels
|
||||
style="width: 100%"
|
||||
:props="{ expandTrigger: 'hover', multiple: false, checkStrictly: true }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</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>
|
||||
import { getWxGroupSimpleList, getClueRemarkByClueId, reportClue } from '@/api/clue/clueRemark'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
remarkContent: '',
|
||||
groupId: '',
|
||||
schoolPlace: []
|
||||
})
|
||||
const rules = {
|
||||
remarkContent: [{ required: true, message: '请输入报备信息', trigger: 'blur' }],
|
||||
groupId: [{ required: true, message: '请选择群聊', trigger: 'change' }]
|
||||
}
|
||||
const formLoading = ref(false)
|
||||
|
||||
const show = ref(false)
|
||||
async function open(row) {
|
||||
show.value = true
|
||||
// 查询群聊
|
||||
getOptions()
|
||||
|
||||
// 查询报备信息
|
||||
const data = await getClueRemarkByClueId({ clueId: row.clueId })
|
||||
if (data && data.remarkId) {
|
||||
form.value = { ...data }
|
||||
if (data.schoolId && data.placeId) {
|
||||
form.value.schoolPlace = [data.schoolId, data.placeId]
|
||||
} else if (data.schoolId) {
|
||||
form.value.schoolPlace = [data.schoolId]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
form.value.clueId = row.clueId
|
||||
let remarkInfo = `学员姓名:${row.name}\n联系方式:${row.phone}\n意向驾校:\n意向班型:`
|
||||
if (row.diyParams?.licenseType) {
|
||||
remarkInfo += `${row.diyParams.licenseType}\n`
|
||||
} else {
|
||||
remarkInfo += `\n`
|
||||
}
|
||||
// const name = userStore.getUser.nickname.substring(0, 1)
|
||||
const name = userStore.getUser.nickname
|
||||
remarkInfo += `意向成交价:\n邀约时间:\n邀约人:${name}教练\n备注:`
|
||||
form.value.remarkContent = remarkInfo
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
const groupOptions = ref([])
|
||||
const placeOptions = ref([])
|
||||
function getOptions() {
|
||||
getWxGroupSimpleList().then((response) => {
|
||||
groupOptions.value = response
|
||||
})
|
||||
|
||||
getPlaceList({
|
||||
placeStatus: 0,
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
}).then((data) => {
|
||||
placeOptions.value = data.schoolList.map((item) => ({
|
||||
value: item.schoolId,
|
||||
label: item.schoolName,
|
||||
children: data.placeList
|
||||
.filter((place) => item.schoolId == place.schoolId)
|
||||
.map((place) => ({
|
||||
value: place.placeId,
|
||||
label: place.name
|
||||
}))
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
function handleSave() {
|
||||
formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const params = { ...form.value }
|
||||
if (params.schoolPlace && params.schoolPlace.length) {
|
||||
params.schoolId = params.schoolPlace[0]
|
||||
if (params.schoolPlace.length == 2) {
|
||||
params.placeId = params.schoolPlace[1]
|
||||
}
|
||||
}
|
||||
await reportClue(params)
|
||||
message.success('提交报备信息成功')
|
||||
show.value = false
|
||||
} catch (error) {
|
||||
console.error('提交报备信息失败', error)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
} else {
|
||||
console.log('表单验证失败')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,8 +1,29 @@
|
||||
<template>
|
||||
<Dialog title="成交登记" v-model="show" width="900px">
|
||||
<Dialog title="成交登记" v-model="show" width="1000px">
|
||||
<template #btn>
|
||||
<el-button class="mr-20px" type="primary" size="small" @click="handleSave">保存</el-button>
|
||||
</template>
|
||||
<div v-if="showMergeOrder">
|
||||
<div style="color: red">
|
||||
查询到该客户已有成交订单,请选择订单进行合并,不选择则生成独立订单
|
||||
</div>
|
||||
<el-radio-group v-model="mergeOrderId" style="width: 100%">
|
||||
<el-radio
|
||||
v-for="item in mergeOrderList"
|
||||
:key="item.signOrderId"
|
||||
:label="item.signOrderId"
|
||||
:value="item.signOrderId"
|
||||
style="width: 100%; margin: 15px 0"
|
||||
>
|
||||
<div class="flex justify-between">
|
||||
<div class="mr-20px">订单编号:{{ item.signOrderId }}</div>
|
||||
<div class="mr-20px">登记时间:{{ item.dealDate }}</div>
|
||||
<div>线索来源:{{ item.source }}</div>
|
||||
</div>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div v-else>
|
||||
<Descriptions
|
||||
:title="`线索信息-${info.name}`"
|
||||
:data="info"
|
||||
@@ -12,7 +33,7 @@
|
||||
:defaultShow="false"
|
||||
/>
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="100px" class="mt-20px">
|
||||
<el-row :gutter="20">
|
||||
<el-row>
|
||||
<!-- 驾校招生模式 -->
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-col :span="8" :offset="0">
|
||||
@@ -95,8 +116,8 @@
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.isPayoff">
|
||||
<el-radio :label="true"> 全款 </el-radio>
|
||||
<el-radio :label="false"> 非全款 </el-radio>
|
||||
<el-radio :label="true" :value="true"> 全款 </el-radio>
|
||||
<el-radio :label="false" :value="false"> 非全款 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -113,8 +134,8 @@
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="公司收款" prop="isCompanyReceipts">
|
||||
<el-radio-group v-model="form.isCompanyReceipts">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
<el-radio :label="true" :value="true">是</el-radio>
|
||||
<el-radio :label="false" :value="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -165,7 +186,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>
|
||||
@@ -330,7 +356,14 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
</div>
|
||||
<template #footer v-if="showMergeOrder">
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleNext">下 一 步</el-button>
|
||||
</span>
|
||||
</template>
|
||||
<template #footer v-else>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
@@ -341,7 +374,7 @@
|
||||
|
||||
<script setup name="DialogSuccess">
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { createSign, getSignProfit } from '@/api/clue/sign'
|
||||
import { createSign, getSignProfit, getSignPage } from '@/api/clue/sign'
|
||||
import { getDiyFieldList } from '@/api/clue/orderField'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
@@ -380,6 +413,9 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const prodTotalPrice = computed(() => {
|
||||
if (appStore.getAppInfo?.instanceType != 2) {
|
||||
return 0
|
||||
}
|
||||
return form.value.signProducts.reduce(
|
||||
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||
0
|
||||
@@ -387,7 +423,7 @@ const prodTotalPrice = computed(() => {
|
||||
})
|
||||
|
||||
const extraTotalPrice = computed(() => {
|
||||
return form.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||
return form.value.extraPay?.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||
})
|
||||
|
||||
const showSchema = computed(() => {
|
||||
@@ -416,23 +452,6 @@ const showSchema = computed(() => {
|
||||
return [...list, ...arr]
|
||||
})
|
||||
|
||||
// const rules = computed(() => {
|
||||
// let ruleObj = {}
|
||||
// props.schema.map((it) => {
|
||||
// if (it.isRequired) {
|
||||
// Reflect.set(ruleObj, it.field, {
|
||||
// required: true,
|
||||
// message: `${it.label}不可为空`,
|
||||
// trigger: 'blur, change'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// ruleObj = { ...ruleObj, ...schoolRules }
|
||||
// }
|
||||
// return ruleObj
|
||||
// })
|
||||
|
||||
const extraPayOptions = getDictOptions('other_pay_type')
|
||||
|
||||
async function open(id) {
|
||||
@@ -441,6 +460,10 @@ async function open(id) {
|
||||
getDiyFields()
|
||||
const data = await ClueApi.getClue(id)
|
||||
info.value = { ...data, ...data.diyParams }
|
||||
// 进销存模式,查询是否需要合并订单
|
||||
if (appStore.getAppInfo?.instanceType == 2) {
|
||||
setMergeOrder(data.phone)
|
||||
}
|
||||
show.value = true
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
@@ -468,6 +491,35 @@ function getDiyFields() {
|
||||
})
|
||||
}
|
||||
|
||||
const showMergeOrder = ref(false)
|
||||
const mergeOrderList = ref([])
|
||||
const mergeOrderId = ref(undefined)
|
||||
function setMergeOrder(phone) {
|
||||
getSignPage({ phone, pageNo: 1, pageSize: 10 }).then((data) => {
|
||||
if (data.total > 0) {
|
||||
// 选择订单作为主订单
|
||||
showMergeOrder.value = true
|
||||
mergeOrderList.value = data.list
|
||||
mergeOrderId.value = undefined
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleNext() {
|
||||
if (mergeOrderId.value) {
|
||||
form.value.signOrderId = mergeOrderId.value
|
||||
const order = mergeOrderList.value.find((it) => it.signOrderId == mergeOrderId.value)
|
||||
if (order.orderDiyParams) {
|
||||
for (const key in order.orderDiyParams) {
|
||||
if (Object.prototype.hasOwnProperty.call(order.orderDiyParams, key)) {
|
||||
form.value[key] = order.orderDiyParams[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
showMergeOrder.value = false
|
||||
}
|
||||
|
||||
async function resetForm(id) {
|
||||
const data = await getConfigByConfigKey({ configKey: 'companyCollectionConfig' })
|
||||
form.value = {
|
||||
@@ -477,7 +529,7 @@ async function resetForm(id) {
|
||||
signPrice: 0,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: data.configValue == 'true',
|
||||
isCompanyReceipts: data?.configValue == 'true',
|
||||
receiver: undefined,
|
||||
extraPay: [],
|
||||
signProducts: [],
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
<div class="flex" style="align-items: center">
|
||||
<b class="mr-5px text-24px">{{ info.name }}</b>
|
||||
<div class="mr-5px text-16px">{{ info.phone }}</div>
|
||||
<el-tag type="success">{{ info.intentionStateName }}</el-tag>
|
||||
<!-- <el-tag type="success">{{ info.intentionStateName }}</el-tag> -->
|
||||
<DictTag type="intention_state" :value="info.intentionState + ''" />
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" v-hasPermi="['clue:pool:update']" plain @click="handleUpdate">
|
||||
@@ -64,8 +65,11 @@
|
||||
>
|
||||
<el-card shadow="always" :body-style="{ padding: '10px' }">
|
||||
<div>
|
||||
<div>
|
||||
<b class="text-18px" style="line-height: 36px">{{ item.operateUserName }}</b>
|
||||
<div class="flex items-center">
|
||||
<b class="text-18px mr-10px" style="line-height: 36px">
|
||||
{{ item.operateUserName }}
|
||||
</b>
|
||||
<DictTag type="intention_state" :value="item.intentionState + ''" />
|
||||
</div>
|
||||
<div>{{ item.content }}</div>
|
||||
<div class="flex mt-10px" style="align-items: center">
|
||||
@@ -86,7 +90,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>
|
||||
@@ -228,7 +232,8 @@ function getFollowList() {
|
||||
content: item.content,
|
||||
operateDate: formatDate(item.operateTime),
|
||||
followTime: formatDate(item.operateTime, 'YYYY-MM-DD HH:mm'),
|
||||
nextFollowTime: formatDate(item.nextFollowTime)
|
||||
nextFollowTime: formatDate(item.nextFollowTime),
|
||||
intentionState: item.intentionState
|
||||
}))
|
||||
})
|
||||
}
|
||||
@@ -289,7 +294,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
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-tab-pane label="全部" name="0" />
|
||||
<el-tab-pane name="1">
|
||||
<template #label>
|
||||
<Tooltip message="除了无效线索和已成交的线索" />
|
||||
<Tooltip message="过滤掉无效线索、已流失和已成交的线索" />
|
||||
<el-badge v-if="clueCount.unSignNum" :value="clueCount.unSignNum" :max="9999">
|
||||
<span class="ml-3px">未成交</span>
|
||||
</el-badge>
|
||||
@@ -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"
|
||||
@@ -83,7 +84,7 @@
|
||||
<div v-if="item.field == 'followRecord'">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
style="padding: 0"
|
||||
@click="handleFollow(row)"
|
||||
v-if="queryType != 4"
|
||||
@@ -135,7 +136,16 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.state == '成交'"
|
||||
@click="handleRemark(scope.row)"
|
||||
:disabled="appStore.getAppInfo?.instanceType == 1 && scope.row.state == '成交'"
|
||||
v-hasPermi="['clue:pool:remark']"
|
||||
>
|
||||
报备
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="appStore.getAppInfo?.instanceType == 1 && scope.row.state == '成交'"
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
@@ -194,6 +204,7 @@
|
||||
:userOptions="allStatusUserOptions"
|
||||
@success="getTableList"
|
||||
/>
|
||||
<DialogRemark ref="remarkRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -206,6 +217,7 @@ import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||
import DialogFollow from './Comp/DialogFollow.vue'
|
||||
import ClueMap from './Comp/ClueMap.vue'
|
||||
import DialogBatchChangeFollow from './Comp/DialogBatchChangeFollow.vue'
|
||||
import DialogRemark from './Comp/DialogRemark.vue'
|
||||
import {
|
||||
getSimpleUserList as getUserOption,
|
||||
getAllUserList,
|
||||
@@ -237,11 +249,12 @@ async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
searchFieldList.value = data.filter((it) => it.isCustom)
|
||||
searchFieldList.value = data.filter((it) => it.isCustom && it.isSearch)
|
||||
data.forEach((elem) => {
|
||||
if (['followUser', 'convertPeople'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
} else if (['firstFollowUser'].includes(elem.field)) {
|
||||
// if (['followUser', 'convertPeople'].includes(elem.field)) {
|
||||
// elem.search.options = userOptions.value
|
||||
// } else
|
||||
if (['firstFollowUser', 'followUser', 'convertPeople'].includes(elem.field)) {
|
||||
elem.search.options = allStatusUserOptions.value
|
||||
}
|
||||
})
|
||||
@@ -361,6 +374,11 @@ async function makeCall(phone) {
|
||||
console.log('打电话:' + phone)
|
||||
}
|
||||
|
||||
const remarkRef = ref()
|
||||
function handleRemark(row) {
|
||||
remarkRef.value.open(row)
|
||||
}
|
||||
|
||||
// 登记
|
||||
function handleSuccess(row) {
|
||||
successRef.value.open(row.clueId)
|
||||
|
||||
111
src/views/Clue/ReceiveInput/index.vue
Normal file
111
src/views/Clue/ReceiveInput/index.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card shadow="always" :body-style="{ padding: '10px' }">
|
||||
<template #header>
|
||||
<div>
|
||||
<span>报备❤</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-input
|
||||
class="remark"
|
||||
type="textarea"
|
||||
v-model="form.remarkContent"
|
||||
:autosize="{ minRows: 5 }"
|
||||
readonly
|
||||
/>
|
||||
</el-card>
|
||||
<el-card shadow="always" :body-style="{ padding: '10px' }" class="mt-10px">
|
||||
<template #header>
|
||||
<div>
|
||||
<span>接待录入</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="0">
|
||||
<el-form-item prop="signInfo">
|
||||
<el-input
|
||||
class="remark"
|
||||
type="textarea"
|
||||
placeholder="请输入报名信息"
|
||||
v-model="form.signInfo"
|
||||
:autosize="{ minRows: 5 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="group">
|
||||
<el-select v-model="form.groupId" placeholder="选择群聊并发送报名信息" filterable>
|
||||
<el-option
|
||||
v-for="item in groupOptions"
|
||||
:key="item.groupId"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button class="w-full" type="primary" size="large" @click="handleSubmit">
|
||||
提交
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getWxGroupSimpleList } from '@/api/clue/clueRemark'
|
||||
import { getClueRemarkByRemarkId, registerClue } from '@/api/clue/clueRemark'
|
||||
|
||||
const route = useRoute()
|
||||
const message = useMessage()
|
||||
|
||||
const groupOptions = ref([])
|
||||
|
||||
const form = ref({
|
||||
signInfo: '',
|
||||
groupId: ''
|
||||
})
|
||||
const rules = {
|
||||
signInfo: [{ required: true, message: '请输入接待信息', trigger: 'blur' }],
|
||||
groupId: [{ required: true, message: '请选择群聊', trigger: 'change' }]
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
|
||||
function handleSubmit() {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
registerClue(form.value).then(() => {
|
||||
message.success('提交接待信息成功')
|
||||
})
|
||||
} else {
|
||||
console.log('表单验证失败')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (route.params.id && route.params.id != 0) {
|
||||
// 这里可以调用API获取会议详情数据
|
||||
getClueRemarkByRemarkId({ remarkId: route.params.id }).then((response) => {
|
||||
form.value = response
|
||||
})
|
||||
} else {
|
||||
// 关闭网页
|
||||
window.close()
|
||||
}
|
||||
|
||||
getWxGroupSimpleList().then((response) => {
|
||||
groupOptions.value = response
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep(.remark .el-textarea__inner) {
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
}
|
||||
::v-deep(.el-card__header) {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
230
src/views/Clue/Set/Comp/RemarkGroup.vue
Normal file
230
src/views/Clue/Set/Comp/RemarkGroup.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.groupName"
|
||||
placeholder="请输入群名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" @click="openForm('create', null)">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column prop="groupName" label="群名称" />
|
||||
<el-table-column label="区域负责人" prop="areaUserName" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="openForm('update', row)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button type="danger" text @click="handleDelete(row.groupId)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="微信群" prop="groupId">
|
||||
<el-select
|
||||
filterable
|
||||
v-model="formData.groupId"
|
||||
placeholder="请选择群聊"
|
||||
:disabled="dialogType === 'update'"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in groupOptions"
|
||||
:key="item.wxGroupId"
|
||||
:label="item.wxGroupName"
|
||||
:value="item.wxGroupId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域负责人" prop="areaUser">
|
||||
<el-select v-model="formData.areaUser" placeholder="请选择" filterable multiple>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</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-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as wxgroupApi from '@/api/clue/clueRemark'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getWxGroupList, refreshWxGroupList } from '@/api/okr/meeting'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
groupName: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
const tableList = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
function handleQuery() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
groupName: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
getList()
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await wxgroupApi.getWxGroupPage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const dialogType = ref('create') // 弹窗的类型 create新增 update修改
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
groupId: '',
|
||||
areaUser: [],
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
groupId: [{ required: true, message: '微信群不能为空', trigger: 'change' }],
|
||||
areaUser: [{ required: true, message: '区域负责人不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref(null) // 表单的ref
|
||||
const groupOptions = ref([]) // 微信群选项
|
||||
const userOptions = ref([]) // 用户选项
|
||||
|
||||
async function openForm(type, row) {
|
||||
dialogType.value = type
|
||||
dialogTitle.value = type === 'create' ? '新增报备群' : '修改报备群'
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (row) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = { ...row }
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.value = {
|
||||
groupId: '',
|
||||
areaUser: [],
|
||||
remark: ''
|
||||
}
|
||||
if (formRef.value) {
|
||||
formRef.value.clearValidate()
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDelete(id) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await wxgroupApi.deleteWxGroup(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
if (!formRef.value) return
|
||||
formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
formLoading.value = true
|
||||
formData.value.groupName = groupOptions.value.find(
|
||||
(item) => item.wxGroupId == formData.value.groupId
|
||||
)?.wxGroupName
|
||||
try {
|
||||
if (dialogType.value === 'create') {
|
||||
await wxgroupApi.createWxGroup(formData.value)
|
||||
message.success(t('common.addSuccess'))
|
||||
} else {
|
||||
await wxgroupApi.updateWxGroup(formData.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
refreshWxGroupList().then(() => {
|
||||
getWxGroupList().then((resp) => {
|
||||
groupOptions.value = resp || []
|
||||
})
|
||||
})
|
||||
// 获取用户选项
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -33,6 +33,10 @@
|
||||
<el-tab-pane label="其他费用项" :name="37" v-if="checkPermi(['clue:setting:other-pay'])">
|
||||
<OtherPayType v-if="tabIndex == 37" />
|
||||
</el-tab-pane>
|
||||
<!-- 报备群设置 -->
|
||||
<el-tab-pane label="报备群设置" :name="38" v-if="checkPermi(['clue:setting:remarkGroup'])">
|
||||
<RemarkGroup v-if="tabIndex == 38" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="常规设置" :name="40" v-if="checkPermi(['clue:setting:general-setting'])">
|
||||
<GeneralSet v-if="tabIndex == 40" :appType="appStore.getAppInfo?.instanceType" />
|
||||
</el-tab-pane>
|
||||
@@ -54,6 +58,7 @@ import IntentionStatus from './Comp/IntentionStatus.vue'
|
||||
import ExtraFeeType from './Comp/ExtraFeeType.vue'
|
||||
import OtherPayType from './Comp/OtherPayType.vue'
|
||||
import GeneralSet from './Comp/GeneralSet.vue'
|
||||
import RemarkGroup from './Comp/RemarkGroup.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-table-column type="index" width="50" fixed="left" />
|
||||
<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
|
||||
|
||||
@@ -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%"
|
||||
|
||||
@@ -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>
|
||||
@@ -116,7 +142,13 @@
|
||||
<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 prop="signPrice" label="成交额" min-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>
|
||||
@@ -143,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
|
||||
@@ -237,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
|
||||
}
|
||||
|
||||
|
||||
@@ -174,10 +174,10 @@ const searchForm = ref({})
|
||||
|
||||
function handleReset() {
|
||||
const year = new Date().getFullYear()
|
||||
const month = new Date().getMonth() + 1
|
||||
const month = new Date().getMonth() + 1 + ''
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
consultTime: [`${year}-${month}-01`, formatDate(new Date())],
|
||||
consultTime: [`${year}-${month.padStart(2, '0')}-01`, formatDate(new Date())],
|
||||
licenseTypeList: [],
|
||||
sourceId: undefined
|
||||
}
|
||||
|
||||
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'
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user