Compare commits
15 Commits
dev-cjl
...
32781fa067
| Author | SHA1 | Date | |
|---|---|---|---|
| 32781fa067 | |||
| e33abc8f66 | |||
| b40e28af6f | |||
| 5ab62d2a05 | |||
| 11fb0576ac | |||
| ab30f1307f | |||
| 92e5a032b5 | |||
| dd6ae89728 | |||
| b407d0a04d | |||
| 82e7731583 | |||
| 9d006fe6a5 | |||
| f4231a13e5 | |||
| 2c2ffcd104 | |||
| 028883975d | |||
| acc59c3a9e |
11
.env.base
11
.env.base
@@ -1,21 +1,20 @@
|
|||||||
# 本地开发环境
|
# 本地开发环境
|
||||||
VITE_NODE_ENV=development
|
NODE_ENV=development
|
||||||
|
|
||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
#VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
||||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
VITE_BASE_URL='http://localhost:48080'
|
||||||
|
|
||||||
# 上传路径
|
# 上传路径
|
||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
# VITE_UPLOAD_URL='http://114.55.169.15:48080/admin-api/system/file/upload'
|
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=/dev-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/crm/
|
VITE_BASE_PATH=/
|
||||||
|
|||||||
4
.env.dev
4
.env.dev
@@ -10,13 +10,13 @@ VITE_BASE_URL='http://localhost:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=/dev-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/crm/
|
VITE_BASE_PATH=/
|
||||||
|
|
||||||
# 是否删除debugger
|
# 是否删除debugger
|
||||||
VITE_DROP_DEBUGGER=false
|
VITE_DROP_DEBUGGER=false
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ VITE_BASE_URL='http://118.31.23.45:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=/dev-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/crm/
|
VITE_BASE_PATH=/
|
||||||
|
|
||||||
# 项目本地运行端口号, 与.vscode/launch.json配合
|
# 项目本地运行端口号, 与.vscode/launch.json配合
|
||||||
VITE_PORT=80
|
VITE_PORT=80
|
||||||
|
|||||||
8
.env.pro
8
.env.pro
@@ -4,13 +4,13 @@ VITE_NODE_ENV=production
|
|||||||
VITE_DEV=false
|
VITE_DEV=false
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='/crm-api'
|
VITE_BASE_URL='http://localhost:48080'
|
||||||
|
|
||||||
# 上传路径
|
# 上传路径
|
||||||
VITE_UPLOAD_URL='/crm-api/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_SOURCEMAP=false
|
VITE_SOURCEMAP=false
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/crm/
|
VITE_BASE_PATH=/
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-pro
|
VITE_OUT_DIR=dist-pro
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ 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://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_SOURCEMAP=false
|
VITE_SOURCEMAP=false
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH='/crm'
|
VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/'
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-stage
|
VITE_OUT_DIR=dist-stage
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ VITE_BASE_URL='http://localhost:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_SOURCEMAP=false
|
VITE_SOURCEMAP=false
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/crm/
|
VITE_BASE_PATH=/admin-ui-vue3/
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-dev
|
VITE_OUT_DIR=dist-dev
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ VITE_BASE_URL='http://localhost:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false
|
|||||||
VITE_SOURCEMAP=true
|
VITE_SOURCEMAP=true
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/crm/
|
VITE_BASE_PATH=/
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-test
|
VITE_OUT_DIR=dist-test
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
<script type="module" src="/src/main.js"></script>
|
<script type="module" src="/src/main.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window._AMapSecurityConfig = {
|
window._AMapSecurityConfig = {
|
||||||
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
securityJsCode: 'a2f0d14a4c5c1e387f9271b1045a781d' // 你的密钥
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -2,19 +2,19 @@
|
|||||||
import { isDark } from '@/utils/is'
|
import { isDark } from '@/utils/is'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import routerSearch from '@/components/RouterSearch/index.vue'
|
import routerSearch from '@/components/RouterSearch/index.vue'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
const { getPrefixCls } = useDesign()
|
const { getPrefixCls } = useDesign()
|
||||||
const prefixCls = getPrefixCls('app')
|
const prefixCls = getPrefixCls('app')
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const currentSize = computed(() => appStore.getCurrentSize)
|
const currentSize = computed(() => appStore.getCurrentSize)
|
||||||
const greyMode = computed(() => appStore.getGreyMode)
|
const greyMode = computed(() => appStore.getGreyMode)
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
// 根据浏览器当前主题设置系统主题色
|
// 根据浏览器当前主题设置系统主题色
|
||||||
const setDefaultTheme = () => {
|
const setDefaultTheme = () => {
|
||||||
let isDarkTheme = cache.local.get(CACHE_KEY.IS_DARK)
|
let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
|
||||||
if (isDarkTheme === null) {
|
if (isDarkTheme === null) {
|
||||||
isDarkTheme = isDark()
|
isDarkTheme = isDark()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ export const getAfterSalePage = async (params) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createAfterSale = async (data) => {
|
export const createAfterSale = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/sign-after-sale/create', data })
|
||||||
url: '/admin-api/crm/sign-after-sale/create',
|
|
||||||
data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
// 审核
|
||||||
|
|||||||
@@ -10,14 +10,9 @@ export const deleteClueGainRule = (id) => {
|
|||||||
return request.delete({ url: `/admin-api/crm/sch-clue-gain-rule/delete?id=${id}` })
|
return request.delete({ url: `/admin-api/crm/sch-clue-gain-rule/delete?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 线索获取规则保存
|
|
||||||
export const saveClueGainRule = (data) => {
|
|
||||||
return request.put({ url: '/admin-api/crm/sch-clue-gain-rule/batchUpdate', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 线索规则
|
// 线索规则
|
||||||
export const getClueDistributeRuleByUser = (params) => {
|
export const getClueDistributeRuleList = () => {
|
||||||
return request.get({ url: '/admin-api/crm/sch-clue-distribution-rule/queryByUserId', params })
|
return request.get({ url: '/admin-api/crm/sch-clue-gain-rule/list' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ export const getDeliveryList = async (params) => {
|
|||||||
return await request.get({ url: '/admin-api/crm/sign-send/list', params })
|
return await request.get({ url: '/admin-api/crm/sign-send/list', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询分页列表
|
// 查询(精简)列表
|
||||||
export const getDeliveryPage = async (params) => {
|
export const getDeliveryPage = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sign-send/page', params })
|
return await request.get({ url: '/admin-api/crm/sign-send/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createDelivery = async (data) => {
|
export const createDelivery = async (data) => {
|
||||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data, isSubmitForm: true })
|
return await request.post({ url: '/admin-api/crm/sign-send/create', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询详情
|
// 查询详情
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
|
|
||||||
// 获得列表
|
|
||||||
export const getExtraFeePage = (params) => {
|
|
||||||
return request.get({ url: '/admin-api/crm/extra-pay/page', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建
|
|
||||||
export const createExtraFee = (data) => {
|
|
||||||
return request.post({ url: '/admin-api/crm/extra-pay/create', data, isSubmitForm: true })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新
|
|
||||||
export const updateExtraFee = (data) => {
|
|
||||||
return request.put({ url: '/admin-api/crm/extra-pay/update', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
|
||||||
export const deleteExtraFee = (id) => {
|
|
||||||
return request.delete({ url: `/admin-api/crm/extra-pay/delete?id=${id}` })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得
|
|
||||||
export const getExtraFee = (id) => {
|
|
||||||
return request.get({ url: `/admin-api/crm/extra-pay/get?id=${id}` })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getExtraFeeSimpleList = async () => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/extra-pay/simple-list' })
|
|
||||||
}
|
|
||||||
@@ -7,11 +7,7 @@ export const getFollowList = async (params) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createFollow = async (data) => {
|
export const createFollow = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/clue-follow-record/create', data: data })
|
||||||
url: '/admin-api/crm/clue-follow-record/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ export const getClue = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createClue = async (data) => {
|
export const createClue = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/sch-clue/create', data: data })
|
||||||
url: '/admin-api/crm/sch-clue/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -58,7 +54,3 @@ export const getPublicClue = async (data) => {
|
|||||||
export const getFollowUserList = async (params) => {
|
export const getFollowUserList = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sch-clue/get-follow-user', params })
|
return await request.get({ url: '/admin-api/crm/sch-clue/get-follow-user', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const batchUpdateFollowUser = async (data) => {
|
|
||||||
return await request.put({ url: '/admin-api/crm/sch-clue/batchUpdateFollowUser', data })
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ export const getPaymentPage = async (params) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createPayment = async (data) => {
|
export const createPayment = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/sign-pay-record/create', data })
|
||||||
url: '/admin-api/crm/sign-pay-record/create',
|
|
||||||
data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
// 审核
|
||||||
@@ -37,11 +33,3 @@ export const cancelApplyPayment = async (data) => {
|
|||||||
export const getPaymentDetail = async (params) => {
|
export const getPaymentDetail = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/get', params })
|
return await request.get({ url: '/admin-api/crm/sign-pay-record/get', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 撤销
|
|
||||||
export const updateApplyPayment = async (data) => {
|
|
||||||
return await request.post({
|
|
||||||
url: '/admin-api/crm/sign-pay-record/updateRecordMoney',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
|
|
||||||
// 查询招生结算列表
|
|
||||||
export const getSchoolSettlePage = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/page', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询招生结算详情
|
|
||||||
export const getSchoolSettleDetail = async (id) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/get?id=' + id })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询进销存结算列表
|
|
||||||
export const getMallSettlePage = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/sign-settlement/erp/page', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询进销存结算详情
|
|
||||||
export const getMallSettleDetail = async (id) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/sign-settlement/erp/get?id=' + id })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量结算
|
|
||||||
export const batchSaveSettle = async (data) => {
|
|
||||||
return await request.post({ url: '/admin-api/crm/sign-settlement/batch/save', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改结算
|
|
||||||
export const updateSettle = async (data) => {
|
|
||||||
return await request.post({ url: '/admin-api/crm/sign-settlement/update/money', data })
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,7 @@ export const getSign = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createSign = async (data) => {
|
export const createSign = async (data) => {
|
||||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
|
return await request.post({ url: '/admin-api/crm/sign/create', data: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消登记
|
// 取消登记
|
||||||
@@ -24,30 +24,3 @@ export const cancelDeal = async (id) => {
|
|||||||
export const signAddPay = async (data) => {
|
export const signAddPay = async (data) => {
|
||||||
return await request.post({ url: '/admin-api/crm/sign/extra-pay/save', data: data })
|
return await request.post({ url: '/admin-api/crm/sign/extra-pay/save', data: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询支出
|
|
||||||
export const getSignExtraPayList = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/sign/extra-pay/get', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 安装状态修改
|
|
||||||
export const updateInstallStatus = (signIdList, installStatus) => {
|
|
||||||
const data = {
|
|
||||||
signIdList,
|
|
||||||
installStatus
|
|
||||||
}
|
|
||||||
return request.post({ url: '/admin-api/crm/sign/install-status/batchSave', data: data })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改生产状态
|
|
||||||
export const updateProduceStatus = (data) => {
|
|
||||||
return request.put({ url: '/admin-api/crm/sign-prodcut/update', data: data })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const updateProduceSort = (data) => {
|
|
||||||
return request.post({ url: '/admin-api/crm/sign-prodcut/adjust/sort', data: data })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getSignProfit = (params) => {
|
|
||||||
return request.get({ url: '/admin-api/crm/sign/profit', params })
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const getSkillPage = (params) => {
|
|||||||
|
|
||||||
// 创建
|
// 创建
|
||||||
export const createSkill = (data) => {
|
export const createSkill = (data) => {
|
||||||
return request.post({ url: '/admin-api/crm/skill/create', data, isSubmitForm: true })
|
return request.post({ url: '/admin-api/crm/skill/create', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const getSource = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createSource = async (data) => {
|
export const createSource = async (data) => {
|
||||||
return await request.post({ url: '/admin-api/crm/source/create', data: data, isSubmitForm: true })
|
return await request.post({ url: '/admin-api/crm/source/create', data: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
// 线索情况
|
|
||||||
export const getUserClueCount = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/home/get-user-count', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 成交率
|
|
||||||
export const getClueSignSignRate = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/home/get-sign-rate', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 成交率
|
|
||||||
export const getClueSignSignRank = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/home/get-sign-top10', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 成交率
|
|
||||||
export const getClueFollowRank = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/home/get-follow-top10', params })
|
|
||||||
}
|
|
||||||
@@ -71,10 +71,3 @@ export const getAppInfo = (instanceId: number) => {
|
|||||||
url: '/admin-api/system/serviceInstance/getInstanceInfo?instanceId=' + instanceId
|
url: '/admin-api/system/serviceInstance/getInstanceInfo?instanceId=' + instanceId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const bindWx = (data: any) => {
|
|
||||||
return request.post({
|
|
||||||
url: '/admin-api/system/user/bind/wx',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export interface BrandVO {
|
|||||||
|
|
||||||
// 创建商品品牌
|
// 创建商品品牌
|
||||||
export const createBrand = (data: BrandVO) => {
|
export const createBrand = (data: BrandVO) => {
|
||||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data, isSubmitForm: true })
|
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新商品品牌
|
// 更新商品品牌
|
||||||
|
|||||||
@@ -36,11 +36,7 @@ export interface CategoryVO {
|
|||||||
|
|
||||||
// 创建商品分类
|
// 创建商品分类
|
||||||
export const createCategory = (data: CategoryVO) => {
|
export const createCategory = (data: CategoryVO) => {
|
||||||
return request.post({
|
return request.post({ url: '/admin-api/crm/erp-product-category/create', data })
|
||||||
url: '/admin-api/crm/erp-product-category/create',
|
|
||||||
data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新商品分类
|
// 更新商品分类
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ export const getProduct = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createProduct = async (data) => {
|
export const createProduct = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/erp-product/create', data: data })
|
||||||
url: '/admin-api/crm/erp-product/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
|
|||||||
@@ -2,11 +2,7 @@ import request from '@/config/axios'
|
|||||||
|
|
||||||
// 创建
|
// 创建
|
||||||
export const createField = (data) => {
|
export const createField = (data) => {
|
||||||
return request.post({
|
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 3 } })
|
||||||
url: '/admin-api/crm/param/create',
|
|
||||||
data: { ...data, module: 3 },
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
|
|||||||
@@ -42,11 +42,7 @@ export interface PropertyValueDetailVO {
|
|||||||
|
|
||||||
// 创建属性项
|
// 创建属性项
|
||||||
export const createProperty = (data: PropertyVO) => {
|
export const createProperty = (data: PropertyVO) => {
|
||||||
return request.post({
|
return request.post({ url: '/admin-api/crm/erp-product-property/create', data })
|
||||||
url: '/admin-api/crm/erp-product-property/create',
|
|
||||||
data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新属性项
|
// 更新属性项
|
||||||
|
|||||||
@@ -6,11 +6,7 @@ export const getPurchasePage = async (params) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createPurchase = async (data) => {
|
export const createPurchase = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/erp-purchase/create', data: data })
|
||||||
url: '/admin-api/crm/erp-purchase/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
|
|||||||
@@ -6,11 +6,7 @@ export const getWarehousePage = async (params) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createWarehouse = async (data) => {
|
export const createWarehouse = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/erp-warehouse/create', data: data })
|
||||||
url: '/admin-api/crm/erp-warehouse/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -42,8 +38,3 @@ export const getInventoryList = async (params) => {
|
|||||||
export const getInventoryRecord = async (params) => {
|
export const getInventoryRecord = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取剩余库存
|
|
||||||
export const getRemainInventoryList = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/erp-inventory-detail/list', params })
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ export const getClassTypePage = async (params) => {
|
|||||||
return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
|
return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getClassTypeList = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/sch-class-type/list', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询详情
|
// 查询详情
|
||||||
export const getClassType = async (id) => {
|
export const getClassType = async (id) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
||||||
@@ -16,11 +12,7 @@ export const getClassType = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createClassType = async (data) => {
|
export const createClassType = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
|
||||||
url: '/admin-api/crm/sch-class-type/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -30,7 +22,7 @@ export const updateClassType = async (params) => {
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
export const deleteClassType = async (id) => {
|
export const deleteClassType = async (id) => {
|
||||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改状态
|
// 修改状态
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ export const getPlace = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createPlace = async (data) => {
|
export const createPlace = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/sch-place/create', data: data })
|
||||||
url: '/admin-api/crm/sch-place/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -34,10 +30,10 @@ export const deletePlace = async (id) => {
|
|||||||
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updatePlaceStatus = async (placeId, status) => {
|
export const updatePlaceStatus = async (id, status) => {
|
||||||
const data = {
|
const data = {
|
||||||
placeId,
|
id,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sch-place/status/update', data: data })
|
return request.put({ url: '/admin-api/crm/sch-place/update-status', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ export const getSchool = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createSchool = async (data) => {
|
export const createSchool = async (data) => {
|
||||||
return await request.post({
|
return await request.post({ url: '/admin-api/crm/sch-school/create', data: data })
|
||||||
url: '/admin-api/crm/sch-school/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -28,10 +24,10 @@ export const deleteSchool = async (id) => {
|
|||||||
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateSchoolStatus = async (schoolId, status) => {
|
export const updateSchoolStatus = async (id, status) => {
|
||||||
const data = {
|
const data = {
|
||||||
schoolId,
|
id,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sch-school/status/update', data: data })
|
return request.put({ url: '/admin-api/crm/sch-school/update-status', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
// 查询列表
|
|
||||||
export const getAreaPage = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/area/page', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getAreaSimpleList = async (params) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/area/simple-list', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询详情
|
|
||||||
export const getArea = async (id) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/area/get?id=' + id })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
export const createArea = async (data) => {
|
|
||||||
return await request.post({
|
|
||||||
url: '/admin-api/crm/area/create',
|
|
||||||
data: data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改
|
|
||||||
export const updateArea = async (params) => {
|
|
||||||
return await request.put({ url: '/admin-api/crm/area/update', data: params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
|
||||||
export const deleteArea = async (id) => {
|
|
||||||
return await request.delete({ url: '/admin-api/crm/area/delete?id=' + id })
|
|
||||||
}
|
|
||||||
@@ -41,13 +41,3 @@ export const updateDept = async (params: DeptVO) => {
|
|||||||
export const deleteDept = async (id: number) => {
|
export const deleteDept = async (id: number) => {
|
||||||
return await request.delete({ url: '/admin-api/system/dept/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/system/dept/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取部门业务指标
|
|
||||||
export const getDeptTarget = async (deptId: number) => {
|
|
||||||
return await request.get({ url: '/admin-api/crm/dept-target/get', params: { deptId } })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新部门业务指标
|
|
||||||
export const updateDeptTarget = async (data: any) => {
|
|
||||||
return await request.put({ url: '/admin-api/crm/dept-target/save', data, isSubmitForm: true })
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -44,11 +44,6 @@ export const deleteDictData = (id: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 导出字典类型数据
|
// 导出字典类型数据
|
||||||
export const exportDictData = (params: any) => {
|
export const exportDictData = (params) => {
|
||||||
return request.get({ url: '/admin-api/crm/dict-data/export', params })
|
return request.get({ url: '/admin-api/crm/dict-data/export', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取通用字典数据
|
|
||||||
export const getGeneralSysDictData = (dictType: string) => {
|
|
||||||
return request.get({ url: '/admin-api/system/dict-data/get-by-type', params: { dictType } })
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ export interface MenuVO {
|
|||||||
alwaysShow?: boolean
|
alwaysShow?: boolean
|
||||||
createTime: Date
|
createTime: Date
|
||||||
}
|
}
|
||||||
// 获取服务列表
|
|
||||||
export const getServiceAppList = () => {
|
|
||||||
return request.get({ url: '/admin-api/system/service/list' })
|
|
||||||
}
|
|
||||||
// 查询菜单(精简)列表
|
// 查询菜单(精简)列表
|
||||||
export const getSimpleMenusList = () => {
|
export const getSimpleMenusList = () => {
|
||||||
return request.get({ url: '/admin-api/system/menu/list-all-simple' })
|
return request.get({ url: '/admin-api/system/menu/list-all-simple' })
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
import qs from 'qs'
|
||||||
|
|
||||||
export interface NotifyMessageVO {
|
export interface NotifyMessageVO {
|
||||||
id: number
|
id: number
|
||||||
@@ -15,39 +16,35 @@ export interface NotifyMessageVO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询站内信消息列表
|
// 查询站内信消息列表
|
||||||
export const getNotifyMessagePage = async (params: any) => {
|
export const getNotifyMessagePage = async (params: PageParam) => {
|
||||||
return await request.get({ url: '/admin-api/system/notify-message/page', params })
|
return await request.get({ url: '/admin-api/system/notify-message/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得我的站内信分页
|
// 获得我的站内信分页
|
||||||
export const getMyNotifyMessagePage = async (params: any) => {
|
export const getMyNotifyMessagePage = async (params: PageParam) => {
|
||||||
return await request.get({ url: '/admin-api/system/notify-message/my-page', params })
|
return await request.get({ url: '/admin-api/system/notify-message/my-page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量标记已读
|
// 批量标记已读
|
||||||
export const updateNotifyMessageRead = async (data: any) => {
|
export const updateNotifyMessageRead = async (ids) => {
|
||||||
return await request.put({
|
return await request.put({
|
||||||
url: '/admin-api/system/notify-message/update-read?',
|
url:
|
||||||
data
|
'/admin-api/system/notify-message/update-read?' +
|
||||||
|
qs.stringify({ ids: ids }, { indices: false })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 标记所有站内信为已读
|
// 标记所有站内信为已读
|
||||||
export const updateAllNotifyMessageRead = async (data: any) => {
|
export const updateAllNotifyMessageRead = async () => {
|
||||||
return await request.put({ url: '/admin-api/system/notify-message/update-all-read', data })
|
return await request.put({ url: '/admin-api/system/notify-message/update-all-read' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前用户的最新站内信列表
|
// 获取当前用户的最新站内信列表
|
||||||
export const getUnreadNotifyMessageList = async (params: any) => {
|
export const getUnreadNotifyMessageList = async () => {
|
||||||
return await request.get({ url: '/admin-api/system/notify-message/get-unread-list', params })
|
return await request.get({ url: '/admin-api/system/notify-message/get-unread-list' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得当前用户的未读站内信数量
|
// 获得当前用户的未读站内信数量
|
||||||
export const getUnreadNotifyMessageCount = async (params: any) => {
|
export const getUnreadNotifyMessageCount = async () => {
|
||||||
return await request.get({ url: '/admin-api/system/notify-message/get-unread-count', params })
|
return await request.get({ url: '/admin-api/system/notify-message/get-unread-count' })
|
||||||
}
|
|
||||||
|
|
||||||
// 获取详情
|
|
||||||
export const getNotifyMessageDetail = async (id: number) => {
|
|
||||||
return await request.get({ url: '/admin-api/system/notify-message/get', params: { id } })
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
|
|
||||||
// 获取角色快报配置
|
|
||||||
export const getRoleDaliyReport = async (roleId) => {
|
|
||||||
return await request.get({
|
|
||||||
url: '/admin-api/system/role-message-setting/get',
|
|
||||||
params: { roleId }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存角色每日快报配置
|
|
||||||
export const updateRoleDaliyReport = async (data) => {
|
|
||||||
return await request.post({
|
|
||||||
url: '/admin-api/system/role-message-setting/save',
|
|
||||||
data,
|
|
||||||
isSubmitForm: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取每日快报发送内容
|
|
||||||
export const getDaliyReportContent = async () => {
|
|
||||||
return await request.get({
|
|
||||||
url: '/admin-api/system/message-item/list-all-simple'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -74,13 +74,3 @@ export const updateUserStatus = (id: number, status: number) => {
|
|||||||
export const getSimpleUserList = (): Promise<UserVO[]> => {
|
export const getSimpleUserList = (): Promise<UserVO[]> => {
|
||||||
return request.get({ url: '/admin-api/system/user/list-all-simple' })
|
return request.get({ url: '/admin-api/system/user/list-all-simple' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有用户列表-无权限限制
|
|
||||||
export const getAllUserList = (): Promise<UserVO[]> => {
|
|
||||||
return request.get({ url: '/admin-api/system/user/no/permission/list-all-simple' })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取所有包括离职的用户
|
|
||||||
export const getAllUserListWithHire = (): Promise<UserVO[]> => {
|
|
||||||
return request.get({ url: '/admin-api/system/user/no/permission/list-all' })
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ const emit = defineEmits(['close'])
|
|||||||
destroy-on-close
|
destroy-on-close
|
||||||
draggable
|
draggable
|
||||||
lock-scroll
|
lock-scroll
|
||||||
append-to-body
|
|
||||||
v-bind="getBindValue"
|
v-bind="getBindValue"
|
||||||
@close="emit('close')"
|
@close="emit('close')"
|
||||||
>
|
>
|
||||||
@@ -76,16 +75,13 @@ const emit = defineEmits(['close'])
|
|||||||
<slot name="title">
|
<slot name="title">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</slot>
|
</slot>
|
||||||
<div class="flex items-center">
|
<Icon
|
||||||
<slot name="btn"></slot>
|
v-if="fullscreen"
|
||||||
<Icon
|
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
|
||||||
v-if="fullscreen"
|
class="mr-22px cursor-pointer is-hover mt-2px z-10"
|
||||||
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
|
color="var(--el-color-info)"
|
||||||
class="mr-22px cursor-pointer is-hover z-10"
|
@click="toggleFull"
|
||||||
color="var(--el-color-info)"
|
/>
|
||||||
@click="toggleFull"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ watch(
|
|||||||
(options) => {
|
(options) => {
|
||||||
if (echartRef) {
|
if (echartRef) {
|
||||||
echartRef?.setOption(options)
|
echartRef?.setOption(options)
|
||||||
resizeHandler()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,10 +78,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 对表单赋值
|
// 对表单赋值
|
||||||
const setValues = (data: Recordable = {}, isReset: Boolean = false) => {
|
const setValues = (data: Recordable = {}) => {
|
||||||
if (isReset) {
|
|
||||||
formModel.value = initModel(unref(getProps).schema, unref(formModel))
|
|
||||||
}
|
|
||||||
formModel.value = Object.assign(unref(formModel), data)
|
formModel.value = Object.assign(unref(formModel), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +233,6 @@ export default defineComponent({
|
|||||||
vModel={formModel.value[item.field]}
|
vModel={formModel.value[item.field]}
|
||||||
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
||||||
{...setComponentProps(item)}
|
{...setComponentProps(item)}
|
||||||
filterable
|
|
||||||
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||||
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||||
style={baseSty + item.componentProps?.style}
|
style={baseSty + item.componentProps?.style}
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-table
|
<el-table :data="tableObject.tableList" border style="flex: 1">
|
||||||
:data="tableObject.tableList"
|
|
||||||
:row-key="rowkey"
|
|
||||||
:expand-row-keys="expandRowKeys"
|
|
||||||
border
|
|
||||||
style="flex: 1"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -60,12 +53,10 @@ import { useRoute } from 'vue-router'
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tableObject: { type: Object, default: () => ({ tableList: [] }) },
|
tableObject: { type: Object, default: () => ({ tableList: [] }) },
|
||||||
tableColumns: { type: Array, default: () => [] },
|
tableColumns: { type: Array, default: () => [] }
|
||||||
rowkey: { type: String, default: 'id' },
|
|
||||||
expandRowKeys: { type: Array, default: () => [] }
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:tableObject', 'getList', 'getCheckedColumns', 'selection-change'])
|
const emit = defineEmits(['update:tableObject', 'getList', 'getCheckedColumns'])
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const pageNo = ref(props.tableObject?.pageNo || 1)
|
const pageNo = ref(props.tableObject?.pageNo || 1)
|
||||||
@@ -119,10 +110,6 @@ function onDragEnd() {
|
|||||||
emitColumns()
|
emitColumns()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelectionChange(val) {
|
|
||||||
emit('selection-change', val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 勾选确认
|
// 勾选确认
|
||||||
function confirm() {
|
function confirm() {
|
||||||
ClueCacheApi.setClueCache({
|
ClueCacheApi.setClueCache({
|
||||||
|
|||||||
@@ -59,11 +59,6 @@ const usedSchema = ref([])
|
|||||||
|
|
||||||
const newSchema = computed(() => {
|
const newSchema = computed(() => {
|
||||||
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
||||||
schema.forEach((item: FormSchema) => {
|
|
||||||
if (item.component == 'TreeSelect') {
|
|
||||||
item.componentProps['check-strictly'] = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (props.expand && props.expandField && !unref(visible)) {
|
if (props.expand && props.expandField && !unref(visible)) {
|
||||||
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ const props = defineProps({
|
|||||||
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
||||||
title: propTypes.string.def('文件上传'),
|
title: propTypes.string.def('文件上传'),
|
||||||
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
|
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
|
||||||
// fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
fileType: propTypes.array.def([]),
|
|
||||||
accept: propTypes.string.def('*'),
|
accept: propTypes.string.def('*'),
|
||||||
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
||||||
limit: propTypes.number.def(5), // 数量限制
|
limit: propTypes.number.def(5), // 数量限制
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const config: {
|
|||||||
/**
|
/**
|
||||||
* api请求基础路径
|
* api请求基础路径
|
||||||
*/
|
*/
|
||||||
base_url: import.meta.env.VITE_API_BASEPATH,
|
base_url: 'http://localhost' + import.meta.env.VITE_API_BASEPATH,
|
||||||
/**
|
/**
|
||||||
* 接口成功返回状态码
|
* 接口成功返回状态码
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,11 +5,10 @@ import { config } from './config'
|
|||||||
const { default_headers } = config
|
const { default_headers } = config
|
||||||
|
|
||||||
const request = (option: any) => {
|
const request = (option: any) => {
|
||||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
const { url, method, params, data, headersType, responseType } = option
|
||||||
return service({
|
return service({
|
||||||
url: url,
|
url: url,
|
||||||
method,
|
method,
|
||||||
isSubmitForm,
|
|
||||||
params,
|
params,
|
||||||
data,
|
data,
|
||||||
responseType: responseType,
|
responseType: responseType,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
import errorCode from './errorCode'
|
import errorCode from './errorCode'
|
||||||
|
|
||||||
import { resetRouter } from '@/router'
|
import { resetRouter } from '@/router'
|
||||||
import cache from '@/plugins/cache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
|
|
||||||
const { result_code, base_url, request_timeout } = config
|
const { result_code, base_url, request_timeout } = config
|
||||||
|
|
||||||
@@ -62,11 +62,15 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
// 设置租户
|
// 设置租户
|
||||||
const tenantId = getTenantId()
|
const tenantId = getTenantId()
|
||||||
if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
|
if (tenantId) {
|
||||||
|
;(config as Recordable).headers['tenant-id'] = tenantId
|
||||||
|
}
|
||||||
|
|
||||||
// 设置实例
|
// 设置实例
|
||||||
const appId = getAppId()
|
const appId = getAppId()
|
||||||
if (appId) (config as Recordable).headers['instance-id'] = appId
|
if (appId) {
|
||||||
|
;(config as Recordable).headers['instance-id'] = appId
|
||||||
|
}
|
||||||
|
|
||||||
const params = config.params || {}
|
const params = config.params || {}
|
||||||
const data = config.data || false
|
const data = config.data || false
|
||||||
@@ -79,39 +83,27 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
// get参数编码
|
// get参数编码
|
||||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||||
config.params = {}
|
let url = config.url + '?'
|
||||||
const paramsStr = qs.stringify(params, { allowDots: true })
|
for (const propName of Object.keys(params)) {
|
||||||
if (paramsStr) {
|
const value = params[propName]
|
||||||
config.url = config.url + '?' + paramsStr
|
if (value !== void 0 && value !== null && typeof value !== 'undefined') {
|
||||||
}
|
if (typeof value === 'object') {
|
||||||
}
|
for (const val of Object.keys(value)) {
|
||||||
// 是否提交表单型的接口,如果是,不要频繁调接口
|
const params = propName + '[' + val + ']'
|
||||||
if (config?.isSubmitForm) {
|
const subPart = encodeURIComponent(params) + '='
|
||||||
const requestObj = {
|
url += subPart + encodeURIComponent(value[val]) + '&'
|
||||||
url: config.url,
|
}
|
||||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
} else {
|
||||||
time: new Date().getTime()
|
url += `${propName}=${encodeURIComponent(value)}&`
|
||||||
}
|
}
|
||||||
const sessionObj = cache.session.get('sessionObj')
|
|
||||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
|
||||||
cache.session.set('sessionObj', requestObj)
|
|
||||||
} else {
|
|
||||||
const s_url = sessionObj.url // 请求地址
|
|
||||||
const s_data = sessionObj.data // 请求数据
|
|
||||||
const s_time = sessionObj.time // 请求时间
|
|
||||||
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
|
|
||||||
if (
|
|
||||||
s_data === requestObj.data &&
|
|
||||||
requestObj.time - s_time < interval &&
|
|
||||||
s_url === requestObj.url
|
|
||||||
) {
|
|
||||||
const message = '数据正在处理,请勿重复提交'
|
|
||||||
console.warn(`[${s_url}]: ` + message)
|
|
||||||
return Promise.reject(new Error(message))
|
|
||||||
} else {
|
|
||||||
cache.session.set('sessionObj', requestObj)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 给 get 请求加上时间戳参数,避免从缓存中拿数据
|
||||||
|
// const now = new Date().getTime()
|
||||||
|
// params = params.substring(0, url.length - 1) + `?_t=${now}`
|
||||||
|
url = url.slice(0, -1)
|
||||||
|
config.params = {}
|
||||||
|
config.url = url
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
@@ -205,23 +197,8 @@ service.interceptors.response.use(
|
|||||||
if (msg === '无效的刷新令牌') {
|
if (msg === '无效的刷新令牌') {
|
||||||
// hard coding:忽略这个提示,直接登出
|
// hard coding:忽略这个提示,直接登出
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
} else if (code == 18888) {
|
|
||||||
return { data }
|
|
||||||
} else {
|
} else {
|
||||||
ElNotification.error({ title: msg })
|
ElNotification.error({ title: msg })
|
||||||
if (code == 403) {
|
|
||||||
ElMessageBox.confirm(`${msg},是否重新登陆`, '提示', {
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
// 无访问权限,退出登录
|
|
||||||
const tenantId = cache.local.get('TENANT_ID')
|
|
||||||
const appId = cache.local.get('App_ID')
|
|
||||||
resetRouter() // 重置静态路由表
|
|
||||||
cache.local.clear()
|
|
||||||
removeToken()
|
|
||||||
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Promise.reject('error')
|
return Promise.reject('error')
|
||||||
} else {
|
} else {
|
||||||
@@ -259,15 +236,16 @@ const handleAuthorized = () => {
|
|||||||
confirmButtonText: t('login.relogin'),
|
confirmButtonText: t('login.relogin'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const tenantId = cache.local.get('TENANT_ID')
|
const { wsCache } = useCache()
|
||||||
const appId = cache.local.get('App_ID')
|
const tenantId = wsCache.get('TENANT_ID')
|
||||||
|
const appId = wsCache.get('App_ID')
|
||||||
resetRouter() // 重置静态路由表
|
resetRouter() // 重置静态路由表
|
||||||
cache.local.clear()
|
wsCache.clear()
|
||||||
removeToken()
|
removeToken()
|
||||||
isRelogin.show = false
|
isRelogin.show = false
|
||||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||||
// window.location.href = window.location.href
|
// window.location.href = window.location.href
|
||||||
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
|
window.location.href = `/login?tenantId=${tenantId}&appId=${appId}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject(t('sys.api.timeoutMessage'))
|
return Promise.reject(t('sys.api.timeoutMessage'))
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import type { App } from 'vue'
|
import type { App } from 'vue'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
export function hasPermi(app: App<Element>) {
|
export function hasPermi(app: App<Element>) {
|
||||||
app.directive('hasPermi', (el, binding) => {
|
app.directive('hasPermi', (el, binding) => {
|
||||||
|
const { wsCache } = useCache()
|
||||||
const { value } = binding
|
const { value } = binding
|
||||||
const all_permission = '*:*:*'
|
const all_permission = '*:*:*'
|
||||||
const permissions = cache.local.get(CACHE_KEY.USER)?.permissions || []
|
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||||
|
|
||||||
if (value && value instanceof Array && value.length > 0) {
|
if (value && value instanceof Array && value.length > 0) {
|
||||||
const permissionFlag = value
|
const permissionFlag = value
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import type { App } from 'vue'
|
import type { App } from 'vue'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
export function hasRole(app: App<Element>) {
|
export function hasRole(app: App<Element>) {
|
||||||
app.directive('hasRole', (el, binding) => {
|
app.directive('hasRole', (el, binding) => {
|
||||||
|
const { wsCache } = useCache()
|
||||||
const { value } = binding
|
const { value } = binding
|
||||||
const super_admin = 'admin'
|
const super_admin = 'admin'
|
||||||
const roles = cache.local.get(CACHE_KEY.USER).roles
|
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||||
|
|
||||||
if (value && value instanceof Array && value.length > 0) {
|
if (value && value instanceof Array && value.length > 0) {
|
||||||
const roleFlag = value
|
const roleFlag = value
|
||||||
|
|||||||
@@ -229,7 +229,6 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
|
|||||||
value: defaultValue,
|
value: defaultValue,
|
||||||
...schemaItem.form,
|
...schemaItem.form,
|
||||||
field: schemaItem.field,
|
field: schemaItem.field,
|
||||||
isRequired: schemaItem.isRequired,
|
|
||||||
label: schemaItem.form?.label || schemaItem.label
|
label: schemaItem.form?.label || schemaItem.label
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ export function useWatermark(appendEl: HTMLElement | null = document.body) {
|
|||||||
clear()
|
clear()
|
||||||
|
|
||||||
const can = document.createElement('canvas')
|
const can = document.createElement('canvas')
|
||||||
can.width = 500
|
can.width = 300
|
||||||
can.height = 240
|
can.height = 240
|
||||||
|
|
||||||
const cans = can.getContext('2d')
|
const cans = can.getContext('2d')
|
||||||
if (cans) {
|
if (cans) {
|
||||||
cans.rotate((-20 * Math.PI) / 120)
|
cans.rotate((-20 * Math.PI) / 120)
|
||||||
cans.font = '15px Vedana'
|
cans.font = '15px Vedana'
|
||||||
cans.fillStyle = 'rgba(0, 0, 0, 0.05)'
|
cans.fillStyle = 'rgba(0, 0, 0, 0.15)'
|
||||||
cans.textAlign = 'left'
|
cans.textAlign = 'left'
|
||||||
cans.textBaseline = 'middle'
|
cans.textBaseline = 'middle'
|
||||||
cans.fillText(str, can.width / 20, can.height)
|
cans.fillText(str, can.width / 20, can.height)
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<script lang="ts" name="Message" setup>
|
<script lang="ts" name="Message" setup>
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
import * as NotifyMessageApi from '@/api/system/notify/message'
|
import * as NotifyMessageApi from '@/api/system/notify/message'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
|
||||||
|
|
||||||
const userStore = useUserStore()
|
|
||||||
|
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
const activeName = ref('notice')
|
const activeName = ref('notice')
|
||||||
@@ -12,27 +9,22 @@ const list = ref<any[]>([]) // 消息列表
|
|||||||
|
|
||||||
// 获得消息列表
|
// 获得消息列表
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
const data = await NotifyMessageApi.getUnreadNotifyMessageList({
|
list.value = await NotifyMessageApi.getUnreadNotifyMessageList()
|
||||||
roleId: userStore.getUser?.currentRole
|
|
||||||
})
|
|
||||||
list.value = data.list
|
|
||||||
// 强制设置 unreadCount 为 0,避免小红点因为轮询太慢,不消除
|
// 强制设置 unreadCount 为 0,避免小红点因为轮询太慢,不消除
|
||||||
unreadCount.value = 0
|
unreadCount.value = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得未读消息数
|
// 获得未读消息数
|
||||||
const getUnreadCount = async () => {
|
const getUnreadCount = async () => {
|
||||||
NotifyMessageApi.getUnreadNotifyMessageCount({ roleId: userStore.getUser?.currentRole }).then(
|
NotifyMessageApi.getUnreadNotifyMessageCount().then((data) => {
|
||||||
(data) => {
|
unreadCount.value = data
|
||||||
unreadCount.value = data
|
})
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转我的站内信
|
// 跳转我的站内信
|
||||||
const goMyList = () => {
|
const goMyList = () => {
|
||||||
push({
|
push({
|
||||||
name: 'NotifyMessage'
|
name: 'MyNotifyMessage'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,9 +56,10 @@ onUnmounted(() => {
|
|||||||
<div class="message-list">
|
<div class="message-list">
|
||||||
<template v-for="item in list" :key="item.id">
|
<template v-for="item in list" :key="item.id">
|
||||||
<div class="message-item">
|
<div class="message-item">
|
||||||
|
<img alt="" class="message-icon" src="@/assets/imgs/avatar.gif" />
|
||||||
<div class="message-content">
|
<div class="message-content">
|
||||||
<span class="message-title">
|
<span class="message-title">
|
||||||
{{ item.title }}
|
{{ item.templateNickname }}:{{ item.templateContent }}
|
||||||
</span>
|
</span>
|
||||||
<span class="message-date">
|
<span class="message-date">
|
||||||
{{ formatDate(item.createTime) }}
|
{{ formatDate(item.createTime) }}
|
||||||
@@ -101,7 +94,7 @@ onUnmounted(() => {
|
|||||||
.message-item {
|
.message-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 5px 0;
|
padding: 20px 0;
|
||||||
border-bottom: 1px solid var(--el-border-color-light);
|
border-bottom: 1px solid var(--el-border-color-light);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
@@ -120,7 +113,6 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
.message-title {
|
.message-title {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-date {
|
.message-date {
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
// import { ElMessage } from 'element-plus'
|
// import { ElMessage } from 'element-plus'
|
||||||
// import { useClipboard, useCssVar } from '@vueuse/core'
|
// import { useClipboard, useCssVar } from '@vueuse/core'
|
||||||
import { useCssVar } from '@vueuse/core'
|
import { useCssVar } from '@vueuse/core'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
import { setCssVar, trim } from '@/utils'
|
import { setCssVar, trim } from '@/utils'
|
||||||
import { colorIsDark, hexToRGB, lighten } from '@/utils/color'
|
import { colorIsDark, hexToRGB, lighten } from '@/utils/color'
|
||||||
@@ -13,13 +12,6 @@ import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
|||||||
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
||||||
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||||
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||||
import { useWatermark } from '@/hooks/web/useWatermark'
|
|
||||||
|
|
||||||
const { setWatermark } = useWatermark()
|
|
||||||
|
|
||||||
nextTick(() => {
|
|
||||||
setWatermark('安徽莳松科技有限公司')
|
|
||||||
})
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
@@ -196,16 +188,16 @@ watch(
|
|||||||
|
|
||||||
// 清空缓存
|
// 清空缓存
|
||||||
const clear = () => {
|
const clear = () => {
|
||||||
cache.local.delete(CACHE_KEY.LAYOUT)
|
const { wsCache } = useCache()
|
||||||
cache.local.delete(CACHE_KEY.THEME)
|
wsCache.delete(CACHE_KEY.LAYOUT)
|
||||||
cache.local.delete(CACHE_KEY.IS_DARK)
|
wsCache.delete(CACHE_KEY.THEME)
|
||||||
|
wsCache.delete(CACHE_KEY.IS_DARK)
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="false"
|
|
||||||
:class="prefixCls"
|
:class="prefixCls"
|
||||||
class="fixed top-[45%] right-0 w-40px h-40px text-center leading-40px bg-[var(--el-color-primary)] cursor-pointer"
|
class="fixed top-[45%] right-0 w-40px h-40px text-center leading-40px bg-[var(--el-color-primary)] cursor-pointer"
|
||||||
@click="drawer = true"
|
@click="drawer = true"
|
||||||
@@ -213,9 +205,7 @@ const clear = () => {
|
|||||||
<Icon color="#fff" icon="ep:setting" />
|
<Icon color="#fff" icon="ep:setting" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div @click="drawer = true">主题配置</div>
|
<ElDrawer v-model="drawer" :z-index="4000" direction="rtl" size="350px">
|
||||||
|
|
||||||
<ElDrawer v-model="drawer" :z-index="4000" append-to-body direction="rtl" size="350px">
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
|
<span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ const fixedMenuChange = (show: boolean) => {
|
|||||||
const setWater = () => {
|
const setWater = () => {
|
||||||
setWatermark(water.value)
|
setWatermark(water.value)
|
||||||
}
|
}
|
||||||
|
setWater()
|
||||||
|
|
||||||
const layout = computed(() => appStore.getLayout)
|
const layout = computed(() => appStore.getLayout)
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
<script lang="ts" name="UserInfo" setup>
|
<script lang="ts" name="UserInfo" setup>
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
import { getTenantId, getAppId } from '@/utils/auth'
|
import { getTenantId, getAppId } from '@/utils/auth'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
import { Setting } from '@/layout/components/Setting'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
const { push, replace } = useRouter()
|
const { push, replace } = useRouter()
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -23,7 +22,7 @@ const { getPrefixCls } = useDesign()
|
|||||||
|
|
||||||
const prefixCls = getPrefixCls('user-info')
|
const prefixCls = getPrefixCls('user-info')
|
||||||
|
|
||||||
const user = cache.local.get(CACHE_KEY.USER)
|
const user = wsCache.get(CACHE_KEY.USER)
|
||||||
|
|
||||||
const avatar = user.user.avatar ? user.user.avatar : avatarImg
|
const avatar = user.user.avatar ? user.user.avatar : avatarImg
|
||||||
|
|
||||||
@@ -59,10 +58,6 @@ const toProfile = async () => {
|
|||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<ElDropdownMenu>
|
<ElDropdownMenu>
|
||||||
<ElDropdownItem>
|
|
||||||
<Icon icon="ep:tools" />
|
|
||||||
<Setting />
|
|
||||||
</ElDropdownItem>
|
|
||||||
<ElDropdownItem>
|
<ElDropdownItem>
|
||||||
<Icon icon="ep:tools" />
|
<Icon icon="ep:tools" />
|
||||||
<div @click="toProfile">{{ t('common.profile') }}</div>
|
<div @click="toProfile">{{ t('common.profile') }}</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import router from './router'
|
import router from './router'
|
||||||
import { isRelogin } from '@/config/axios/service'
|
import { isRelogin } from '@/config/axios/service'
|
||||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
import { getAccessToken } from '@/utils/auth'
|
||||||
import { useTitle } from '@/hooks/web/useTitle'
|
import { useTitle } from '@/hooks/web/useTitle'
|
||||||
import { useNProgress } from '@/hooks/web/useNProgress'
|
import { useNProgress } from '@/hooks/web/useNProgress'
|
||||||
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||||
@@ -8,74 +8,55 @@ import { useDictStoreWithOut } from '@/store/modules/dict'
|
|||||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||||
import { getTenantId, getAppId } from '@/utils/auth'
|
import { getTenantId, getAppId } from '@/utils/auth'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
const { start, done } = useNProgress()
|
const { start, done } = useNProgress()
|
||||||
|
|
||||||
const { loadStart, loadDone } = usePageLoading()
|
const { loadStart, loadDone } = usePageLoading()
|
||||||
// 路由不重定向白名单
|
// 路由不重定向白名单
|
||||||
const whiteList = [
|
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/swagger']
|
||||||
'/login',
|
|
||||||
'/mp-login',
|
|
||||||
'/nm-detail',
|
|
||||||
'/social-login',
|
|
||||||
'/auth-redirect',
|
|
||||||
'/bind',
|
|
||||||
'/register',
|
|
||||||
'/swagger'
|
|
||||||
]
|
|
||||||
|
|
||||||
// 路由加载前
|
// 路由加载前
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
start()
|
start()
|
||||||
loadStart()
|
loadStart()
|
||||||
if (getAppId() && to.query?.appId && getAppId() != to.query?.appId) {
|
if (getAccessToken()) {
|
||||||
removeToken()
|
if (to.path === '/login') {
|
||||||
cache?.local?.delete('appInfo')
|
next({ path: '/' })
|
||||||
cache?.local?.delete('roleRouters')
|
|
||||||
cache?.local?.delete('user')
|
|
||||||
cache?.local?.delete('App_ID')
|
|
||||||
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
|
|
||||||
} else {
|
|
||||||
if (getAccessToken()) {
|
|
||||||
if (to.path === '/login') {
|
|
||||||
next({ path: '/' })
|
|
||||||
} else {
|
|
||||||
// 获取所有字典
|
|
||||||
const dictStore = useDictStoreWithOut()
|
|
||||||
const userStore = useUserStoreWithOut()
|
|
||||||
const permissionStore = usePermissionStoreWithOut()
|
|
||||||
if (!dictStore.getIsSetDict) {
|
|
||||||
await dictStore.setDictMap()
|
|
||||||
}
|
|
||||||
if (!userStore.getIsSetUser) {
|
|
||||||
isRelogin.show = true
|
|
||||||
await userStore.setUserInfoAction()
|
|
||||||
isRelogin.show = false
|
|
||||||
// 后端过滤菜单
|
|
||||||
await permissionStore.generateRoutes()
|
|
||||||
permissionStore.getAddRouters.forEach((route) => {
|
|
||||||
router.addRoute(route) // 动态添加可访问路由表
|
|
||||||
})
|
|
||||||
const redirectPath = from.query.redirect || to.path
|
|
||||||
const redirect = decodeURIComponent(redirectPath)
|
|
||||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
|
||||||
next(nextData)
|
|
||||||
} else {
|
|
||||||
next()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
// 获取所有字典
|
||||||
next()
|
const dictStore = useDictStoreWithOut()
|
||||||
|
const userStore = useUserStoreWithOut()
|
||||||
|
const permissionStore = usePermissionStoreWithOut()
|
||||||
|
if (!dictStore.getIsSetDict) {
|
||||||
|
await dictStore.setDictMap()
|
||||||
|
}
|
||||||
|
if (!userStore.getIsSetUser) {
|
||||||
|
isRelogin.show = true
|
||||||
|
await userStore.setUserInfoAction()
|
||||||
|
isRelogin.show = false
|
||||||
|
// 后端过滤菜单
|
||||||
|
await permissionStore.generateRoutes()
|
||||||
|
permissionStore.getAddRouters.forEach((route) => {
|
||||||
|
router.addRoute(route) // 动态添加可访问路由表
|
||||||
|
})
|
||||||
|
const redirectPath = from.query.redirect || to.path
|
||||||
|
const redirect = decodeURIComponent(redirectPath)
|
||||||
|
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||||
|
next(nextData)
|
||||||
} else {
|
} else {
|
||||||
const tenantId = getTenantId()
|
next()
|
||||||
const appId = getAppId()
|
}
|
||||||
if (tenantId && appId) {
|
}
|
||||||
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
} else {
|
||||||
} else {
|
if (whiteList.indexOf(to.path) !== -1) {
|
||||||
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
next()
|
||||||
}
|
} else {
|
||||||
|
const tenantId = getTenantId()
|
||||||
|
const appId = getAppId()
|
||||||
|
if (tenantId && appId) {
|
||||||
|
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||||
|
} else {
|
||||||
|
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
src/plugins/cache/index.js
vendored
8
src/plugins/cache/index.js
vendored
@@ -26,7 +26,7 @@ const sessionCache = {
|
|||||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||||
return storage[key]
|
return storage[key]
|
||||||
},
|
},
|
||||||
delete(key) {
|
remove(key) {
|
||||||
if (!sessionStorage) {
|
if (!sessionStorage) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ const localCache = {
|
|||||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||||
return storage[key]
|
return storage[key]
|
||||||
},
|
},
|
||||||
delete(key) {
|
remove(key) {
|
||||||
if (!localStorage) {
|
if (!localStorage) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -73,10 +73,6 @@ const localCache = {
|
|||||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||||
delete storage[key]
|
delete storage[key]
|
||||||
localStorage.setItem(name, JSON.stringify(storage))
|
localStorage.setItem(name, JSON.stringify(storage))
|
||||||
},
|
|
||||||
clear() {
|
|
||||||
let storage = {}
|
|
||||||
localStorage.setItem(name, JSON.stringify(storage))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import remainingRouter from './modules/remaining'
|
|||||||
|
|
||||||
// 创建路由实例
|
// 创建路由实例
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.VITE_BASE_PATH), // createWebHashHistory URL带#,createWebHistory URL不带#
|
history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
|
||||||
strict: true,
|
strict: true,
|
||||||
routes: remainingRouter as RouteRecordRaw[],
|
routes: remainingRouter as RouteRecordRaw[],
|
||||||
scrollBehavior: () => ({ left: 0, top: 0 })
|
scrollBehavior: () => ({ left: 0, top: 0 })
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'notify-message',
|
path: 'notify-message',
|
||||||
component: () => import('@/views/Profile/NotifyMessage.vue'),
|
component: () => import('@/views/system/notify/my/index.vue'),
|
||||||
name: 'NotifyMessage',
|
name: 'MyNotifyMessage',
|
||||||
meta: {
|
meta: {
|
||||||
canTo: true,
|
canTo: true,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
@@ -130,27 +130,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
// },
|
// },
|
||||||
// {
|
|
||||||
// path: '/Basic',
|
|
||||||
// component: Layout,
|
|
||||||
// name: 'Basic',
|
|
||||||
// meta: {},
|
|
||||||
// redirect: '/Basic/menu',
|
|
||||||
// children: [
|
|
||||||
// {
|
|
||||||
// path: 'menu',
|
|
||||||
// component: () => import('@/views/Basic/Menu/index.vue'),
|
|
||||||
// name: 'Menu',
|
|
||||||
// meta: {
|
|
||||||
// canTo: true,
|
|
||||||
// hidden: true,
|
|
||||||
// noTagsView: false,
|
|
||||||
// icon: 'ep:user',
|
|
||||||
// title: '菜单管理'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: () => import('@/views/Login/Login.vue'),
|
component: () => import('@/views/Login/Login.vue'),
|
||||||
@@ -161,16 +141,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
noTagsView: true
|
noTagsView: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/mp-login',
|
|
||||||
component: () => import('@/views/Login/MPLogin.vue'),
|
|
||||||
name: 'MPLogin',
|
|
||||||
meta: {
|
|
||||||
hidden: true,
|
|
||||||
title: '用户绑定',
|
|
||||||
noTagsView: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/sso',
|
path: '/sso',
|
||||||
component: () => import('@/views/Login/Login.vue'),
|
component: () => import('@/views/Login/Login.vue'),
|
||||||
@@ -181,16 +151,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
noTagsView: true
|
noTagsView: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/nm-detail',
|
|
||||||
component: () => import('@/views/Profile/NotifyMessageDetail.vue'),
|
|
||||||
name: 'NMDetail',
|
|
||||||
meta: {
|
|
||||||
hidden: true,
|
|
||||||
title: '通知详情',
|
|
||||||
noTagsView: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/403',
|
path: '/403',
|
||||||
component: () => import('@/views/Error/403.vue'),
|
component: () => import('@/views/Error/403.vue'),
|
||||||
|
|||||||
@@ -2,12 +2,13 @@ import { defineStore } from 'pinia'
|
|||||||
import { store } from '../index'
|
import { store } from '../index'
|
||||||
import { setCssVar, humpToUnderline } from '@/utils'
|
import { setCssVar, humpToUnderline } from '@/utils'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import { ElementPlusSize } from '@/types/elementPlus'
|
import { ElementPlusSize } from '@/types/elementPlus'
|
||||||
import { LayoutType } from '@/types/layout'
|
import { LayoutType } from '@/types/layout'
|
||||||
import { ThemeTypes } from '@/types/theme'
|
import { ThemeTypes } from '@/types/theme'
|
||||||
import { getAppInfo } from '@/api/login'
|
import { getAppInfo } from '@/api/login'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
interface AppState {
|
interface AppState {
|
||||||
breadcrumb: boolean
|
breadcrumb: boolean
|
||||||
@@ -45,7 +46,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
sizeMap: ['default', 'large', 'small'],
|
sizeMap: ['default', 'large', 'small'],
|
||||||
mobile: false, // 是否是移动端
|
mobile: false, // 是否是移动端
|
||||||
title: import.meta.env.VITE_APP_TITLE, // 标题
|
title: import.meta.env.VITE_APP_TITLE, // 标题
|
||||||
appInfo: cache.local.get('appInfo'),
|
appInfo: wsCache.get('appInfo'),
|
||||||
pageLoading: false, // 路由跳转loading
|
pageLoading: false, // 路由跳转loading
|
||||||
|
|
||||||
breadcrumb: true, // 面包屑
|
breadcrumb: true, // 面包屑
|
||||||
@@ -63,12 +64,12 @@ export const useAppStore = defineStore('app', {
|
|||||||
fixedHeader: true, // 固定toolheader
|
fixedHeader: true, // 固定toolheader
|
||||||
footer: false, // 显示页脚
|
footer: false, // 显示页脚
|
||||||
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
|
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
|
||||||
fixedMenu: cache.local.get('fixedMenu') || false, // 是否固定菜单
|
fixedMenu: wsCache.get('fixedMenu') || false, // 是否固定菜单
|
||||||
|
|
||||||
layout: cache.local.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
|
layout: wsCache.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
|
||||||
isDark: cache.local.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
|
isDark: wsCache.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
|
||||||
currentSize: cache.local.get('default') || 'default', // 组件尺寸
|
currentSize: wsCache.get('default') || 'default', // 组件尺寸
|
||||||
theme: cache.local.get(CACHE_KEY.THEME) || {
|
theme: wsCache.get(CACHE_KEY.THEME) || {
|
||||||
// 主题色
|
// 主题色
|
||||||
elColorPrimary: '#409eff',
|
elColorPrimary: '#409eff',
|
||||||
// 左侧菜单边框颜色
|
// 左侧菜单边框颜色
|
||||||
@@ -224,7 +225,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
this.greyMode = greyMode
|
this.greyMode = greyMode
|
||||||
},
|
},
|
||||||
setFixedMenu(fixedMenu: boolean) {
|
setFixedMenu(fixedMenu: boolean) {
|
||||||
cache.local.set('fixedMenu', fixedMenu)
|
wsCache.set('fixedMenu', fixedMenu)
|
||||||
this.fixedMenu = fixedMenu
|
this.fixedMenu = fixedMenu
|
||||||
},
|
},
|
||||||
setPageLoading(pageLoading: boolean) {
|
setPageLoading(pageLoading: boolean) {
|
||||||
@@ -236,7 +237,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.layout = layout
|
this.layout = layout
|
||||||
cache.local.set(CACHE_KEY.LAYOUT, this.layout)
|
wsCache.set(CACHE_KEY.LAYOUT, this.layout)
|
||||||
},
|
},
|
||||||
setTitle(title: string) {
|
setTitle(title: string) {
|
||||||
this.title = title
|
this.title = title
|
||||||
@@ -250,18 +251,18 @@ export const useAppStore = defineStore('app', {
|
|||||||
document.documentElement.classList.add('light')
|
document.documentElement.classList.add('light')
|
||||||
document.documentElement.classList.remove('dark')
|
document.documentElement.classList.remove('dark')
|
||||||
}
|
}
|
||||||
cache.local.set(CACHE_KEY.IS_DARK, this.isDark)
|
wsCache.set(CACHE_KEY.IS_DARK, this.isDark)
|
||||||
},
|
},
|
||||||
setCurrentSize(currentSize: ElementPlusSize) {
|
setCurrentSize(currentSize: ElementPlusSize) {
|
||||||
this.currentSize = currentSize
|
this.currentSize = currentSize
|
||||||
cache.local.set('currentSize', this.currentSize)
|
wsCache.set('currentSize', this.currentSize)
|
||||||
},
|
},
|
||||||
setMobile(mobile: boolean) {
|
setMobile(mobile: boolean) {
|
||||||
this.mobile = mobile
|
this.mobile = mobile
|
||||||
},
|
},
|
||||||
setTheme(theme: ThemeTypes) {
|
setTheme(theme: ThemeTypes) {
|
||||||
this.theme = Object.assign(this.theme, theme)
|
this.theme = Object.assign(this.theme, theme)
|
||||||
cache.local.set(CACHE_KEY.THEME, this.theme)
|
wsCache.set(CACHE_KEY.THEME, this.theme)
|
||||||
},
|
},
|
||||||
setCssVarTheme() {
|
setCssVarTheme() {
|
||||||
for (const key in this.theme) {
|
for (const key in this.theme) {
|
||||||
@@ -273,7 +274,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
},
|
},
|
||||||
async setAppInfo(appId: number) {
|
async setAppInfo(appId: number) {
|
||||||
const appInfo = await getAppInfo(appId)
|
const appInfo = await getAppInfo(appId)
|
||||||
cache.local.set('appInfo', appInfo)
|
wsCache.set('appInfo', appInfo)
|
||||||
this.appInfo = appInfo
|
this.appInfo = appInfo
|
||||||
return appInfo
|
return appInfo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { defineStore } from 'pinia'
|
|||||||
import { store } from '../index'
|
import { store } from '../index'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { DictDataVO } from '@/api/system/dict/types'
|
import { DictDataVO } from '@/api/system/dict/types'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import cache from '@/plugins/cache'
|
const { wsCache } = useCache('sessionStorage')
|
||||||
import { listSimpleDictData } from '@/api/system/dict/dict.data'
|
import { listSimpleDictData } from '@/api/system/dict/dict.data'
|
||||||
|
|
||||||
export interface DictValueType {
|
export interface DictValueType {
|
||||||
@@ -28,7 +28,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getDictMap(): Recordable {
|
getDictMap(): Recordable {
|
||||||
const dictMap = cache.session.get(CACHE_KEY.DICT_CACHE)
|
const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE)
|
||||||
if (dictMap) {
|
if (dictMap) {
|
||||||
this.dictMap = dictMap
|
this.dictMap = dictMap
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async setDictMap() {
|
async setDictMap() {
|
||||||
const dictMap = cache.session.get(CACHE_KEY.DICT_CACHE)
|
const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE)
|
||||||
if (dictMap) {
|
if (dictMap) {
|
||||||
this.dictMap = dictMap
|
this.dictMap = dictMap
|
||||||
this.isSetDict = true
|
this.isSetDict = true
|
||||||
@@ -64,7 +64,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
})
|
})
|
||||||
this.dictMap = dictDataMap
|
this.dictMap = dictDataMap
|
||||||
this.isSetDict = true
|
this.isSetDict = true
|
||||||
cache.session.set(CACHE_KEY.DICT_CACHE, dictDataMap) // 60 秒 过期
|
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDictByType(type: string) {
|
getDictByType(type: string) {
|
||||||
@@ -74,7 +74,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
return this.dictMap[type]
|
return this.dictMap[type]
|
||||||
},
|
},
|
||||||
async resetDict() {
|
async resetDict() {
|
||||||
cache.session.delete(CACHE_KEY.DICT_CACHE)
|
wsCache.delete(CACHE_KEY.DICT_CACHE)
|
||||||
const res = await listSimpleDictData()
|
const res = await listSimpleDictData()
|
||||||
// 设置数据
|
// 设置数据
|
||||||
const dictDataMap = new Map<string, any>()
|
const dictDataMap = new Map<string, any>()
|
||||||
@@ -94,7 +94,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
})
|
})
|
||||||
this.dictMap = dictDataMap
|
this.dictMap = dictDataMap
|
||||||
this.isSetDict = true
|
this.isSetDict = true
|
||||||
cache.session.set(CACHE_KEY.DICT_CACHE, dictDataMap) // 60 秒 过期
|
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ import { store } from '../index'
|
|||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import remainingRouter from '@/router/modules/remaining'
|
import remainingRouter from '@/router/modules/remaining'
|
||||||
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
|
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
export interface PermissionState {
|
export interface PermissionState {
|
||||||
routers: AppRouteRecordRaw[]
|
routers: AppRouteRecordRaw[]
|
||||||
@@ -33,8 +34,8 @@ export const usePermissionStore = defineStore('permission', {
|
|||||||
async generateRoutes(): Promise<unknown> {
|
async generateRoutes(): Promise<unknown> {
|
||||||
return new Promise<void>(async (resolve) => {
|
return new Promise<void>(async (resolve) => {
|
||||||
let res: AppCustomRouteRecordRaw[] = []
|
let res: AppCustomRouteRecordRaw[] = []
|
||||||
if (cache.local.get(CACHE_KEY.ROLE_ROUTERS)) {
|
if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||||
res = cache.local.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||||
}
|
}
|
||||||
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
|
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
|
||||||
// 动态路由,404一定要放到最后面
|
// 动态路由,404一定要放到最后面
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { store } from '../index'
|
import { store } from '../index'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import { getInfo, loginOut } from '@/api/login'
|
import { getInfo, loginOut } from '@/api/login'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
interface UserVO {
|
interface UserVO {
|
||||||
id: number
|
id: number
|
||||||
avatar: string
|
avatar: string
|
||||||
nickname: string
|
nickname: string
|
||||||
currentRole: number
|
|
||||||
}
|
}
|
||||||
interface UserInfoVO {
|
interface UserInfoVO {
|
||||||
permissions: string[]
|
permissions: string[]
|
||||||
@@ -26,8 +26,7 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
user: {
|
user: {
|
||||||
id: 0,
|
id: 0,
|
||||||
avatar: '',
|
avatar: '',
|
||||||
nickname: '',
|
nickname: ''
|
||||||
currentRole: 0
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
@@ -50,21 +49,21 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
this.resetState()
|
this.resetState()
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
let userInfo = cache.local.get(CACHE_KEY.USER)
|
let userInfo = wsCache.get(CACHE_KEY.USER)
|
||||||
if (!userInfo || !userInfo?.menus || userInfo.menus.length == 0) {
|
if (!userInfo) {
|
||||||
userInfo = await getInfo({})
|
userInfo = await getInfo({})
|
||||||
}
|
}
|
||||||
this.permissions = userInfo.permissions
|
this.permissions = userInfo.permissions
|
||||||
this.roles = userInfo.roles
|
this.roles = userInfo.roles
|
||||||
this.user = userInfo.user
|
this.user = userInfo.user
|
||||||
this.isSetUser = true
|
this.isSetUser = true
|
||||||
cache.local.set(CACHE_KEY.USER, userInfo)
|
wsCache.set(CACHE_KEY.USER, userInfo)
|
||||||
cache.local.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
|
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
|
||||||
},
|
},
|
||||||
async loginOut() {
|
async loginOut() {
|
||||||
await loginOut()
|
await loginOut()
|
||||||
removeToken()
|
removeToken()
|
||||||
cache.local.clear()
|
wsCache.clear()
|
||||||
this.resetState()
|
this.resetState()
|
||||||
},
|
},
|
||||||
resetState() {
|
resetState() {
|
||||||
@@ -74,12 +73,11 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
this.user = {
|
this.user = {
|
||||||
id: 0,
|
id: 0,
|
||||||
avatar: '',
|
avatar: '',
|
||||||
nickname: '',
|
nickname: ''
|
||||||
currentRole: 0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
cache.local.delete(CACHE_KEY.USER)
|
wsCache.delete(CACHE_KEY.USER)
|
||||||
this.resetState()
|
this.resetState()
|
||||||
window.location.href = ''
|
window.location.href = ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { TokenType } from '@/api/login/types'
|
import { TokenType } from '@/api/login/types'
|
||||||
import { decrypt, encrypt } from '@/utils/jsencrypt'
|
import { decrypt, encrypt } from '@/utils/jsencrypt'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
const AccessTokenKey = 'ACCESS_TOKEN'
|
const AccessTokenKey = 'ACCESS_TOKEN'
|
||||||
const RefreshTokenKey = 'REFRESH_TOKEN'
|
const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||||
@@ -8,26 +10,24 @@ const RefreshTokenKey = 'REFRESH_TOKEN'
|
|||||||
// 获取token
|
// 获取token
|
||||||
export const getAccessToken = () => {
|
export const getAccessToken = () => {
|
||||||
// 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
|
// 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
|
||||||
return cache.local.get(AccessTokenKey)
|
return wsCache.get(AccessTokenKey) ? wsCache.get(AccessTokenKey) : wsCache.get('ACCESS_TOKEN')
|
||||||
? cache.local.get(AccessTokenKey)
|
|
||||||
: cache.local.get('ACCESS_TOKEN')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新token
|
// 刷新token
|
||||||
export const getRefreshToken = () => {
|
export const getRefreshToken = () => {
|
||||||
return cache.local.get(RefreshTokenKey)
|
return wsCache.get(RefreshTokenKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置token
|
// 设置token
|
||||||
export const setToken = (token: TokenType) => {
|
export const setToken = (token: TokenType) => {
|
||||||
cache.local.set(RefreshTokenKey, token.refreshToken)
|
wsCache.set(RefreshTokenKey, token.refreshToken, { exp: token.expiresTime })
|
||||||
cache.local.set(AccessTokenKey, token.accessToken)
|
wsCache.set(AccessTokenKey, token.accessToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除token
|
// 删除token
|
||||||
export const removeToken = () => {
|
export const removeToken = () => {
|
||||||
cache.local.delete(AccessTokenKey)
|
wsCache.delete(AccessTokenKey)
|
||||||
cache.local.delete(RefreshTokenKey)
|
wsCache.delete(RefreshTokenKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 格式化token(jwt格式) */
|
/** 格式化token(jwt格式) */
|
||||||
@@ -47,7 +47,7 @@ export type LoginFormType = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getLoginForm = () => {
|
export const getLoginForm = () => {
|
||||||
const loginForm: LoginFormType = cache.local.get(LoginFormKey)
|
const loginForm: LoginFormType = wsCache.get(LoginFormKey)
|
||||||
if (loginForm) {
|
if (loginForm) {
|
||||||
loginForm.password = decrypt(loginForm.password) as string
|
loginForm.password = decrypt(loginForm.password) as string
|
||||||
}
|
}
|
||||||
@@ -56,11 +56,11 @@ export const getLoginForm = () => {
|
|||||||
|
|
||||||
export const setLoginForm = (loginForm: LoginFormType) => {
|
export const setLoginForm = (loginForm: LoginFormType) => {
|
||||||
loginForm.password = encrypt(loginForm.password) as string
|
loginForm.password = encrypt(loginForm.password) as string
|
||||||
cache.local.set(LoginFormKey, loginForm)
|
wsCache.set(LoginFormKey, loginForm, { exp: 30 * 24 * 60 * 60 })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeLoginForm = () => {
|
export const removeLoginForm = () => {
|
||||||
cache.local.delete(LoginFormKey)
|
wsCache.delete(LoginFormKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 租户相关 ==========
|
// ========== 租户相关 ==========
|
||||||
@@ -69,52 +69,52 @@ const TenantIdKey = 'TENANT_ID'
|
|||||||
const TenantNameKey = 'TENANT_NAME'
|
const TenantNameKey = 'TENANT_NAME'
|
||||||
|
|
||||||
export const getTenantName = () => {
|
export const getTenantName = () => {
|
||||||
return cache.local.get(TenantNameKey)
|
return wsCache.get(TenantNameKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setTenantName = (username: string) => {
|
export const setTenantName = (username: string) => {
|
||||||
cache.local.set(TenantNameKey, username)
|
wsCache.set(TenantNameKey, username, { exp: 30 * 24 * 60 * 60 })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeTenantName = () => {
|
export const removeTenantName = () => {
|
||||||
cache.local.delete(TenantNameKey)
|
wsCache.delete(TenantNameKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getTenantId = () => {
|
export const getTenantId = () => {
|
||||||
return cache.local.get(TenantIdKey)
|
return wsCache.get(TenantIdKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setTenantId = (username: string) => {
|
export const setTenantId = (username: string) => {
|
||||||
cache.local.set(TenantIdKey, username)
|
wsCache.set(TenantIdKey, username)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeTenantId = () => {
|
export const removeTenantId = () => {
|
||||||
cache.local.delete(TenantIdKey)
|
wsCache.delete(TenantIdKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppIdKey = 'App_ID'
|
const AppIdKey = 'App_ID'
|
||||||
const AppNameKey = 'App_NAME'
|
const AppNameKey = 'App_NAME'
|
||||||
|
|
||||||
export const getAPPName = () => {
|
export const getAPPName = () => {
|
||||||
return cache.local.get(AppNameKey)
|
return wsCache.get(AppNameKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setAppName = (name: string) => {
|
export const setAppName = (name: string) => {
|
||||||
cache.local.set(AppNameKey, name)
|
wsCache.set(AppNameKey, name, { exp: 30 * 24 * 60 * 60 })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeAppName = () => {
|
export const removeAppName = () => {
|
||||||
cache.local.delete(AppNameKey)
|
wsCache.delete(AppNameKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getAppId = () => {
|
export const getAppId = () => {
|
||||||
return cache.local.get(AppIdKey)
|
return wsCache.get(AppIdKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setAppId = (id: number) => {
|
export const setAppId = (id: number) => {
|
||||||
cache.local.set(AppIdKey, id)
|
wsCache.set(AppIdKey, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const removeAppId = () => {
|
export const removeAppId = () => {
|
||||||
cache.local.delete(AppIdKey)
|
wsCache.delete(AppIdKey)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
|
|||||||
export const removeNullField = (obj: Object) => {
|
export const removeNullField = (obj: Object) => {
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||||
if (obj[key] === '' || obj[key] === null || obj[key] == undefined) {
|
if (obj[key] == '') {
|
||||||
delete obj[key]
|
delete obj[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
@@ -10,9 +9,10 @@ const { t } = useI18n() // 国际化
|
|||||||
*/
|
*/
|
||||||
export function checkPermi(value: string[]) {
|
export function checkPermi(value: string[]) {
|
||||||
if (value && value instanceof Array && value.length > 0) {
|
if (value && value instanceof Array && value.length > 0) {
|
||||||
|
const { wsCache } = useCache()
|
||||||
const permissionDatas = value
|
const permissionDatas = value
|
||||||
const all_permission = '*:*:*'
|
const all_permission = '*:*:*'
|
||||||
const permissions = cache.local.get(CACHE_KEY.USER).permissions
|
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||||
const hasPermission = permissions.some((permission) => {
|
const hasPermission = permissions.some((permission) => {
|
||||||
return all_permission === permission || permissionDatas.includes(permission)
|
return all_permission === permission || permissionDatas.includes(permission)
|
||||||
})
|
})
|
||||||
@@ -30,9 +30,10 @@ export function checkPermi(value: string[]) {
|
|||||||
*/
|
*/
|
||||||
export function checkRole(value: string[]) {
|
export function checkRole(value: string[]) {
|
||||||
if (value && value instanceof Array && value.length > 0) {
|
if (value && value instanceof Array && value.length > 0) {
|
||||||
|
const { wsCache } = useCache()
|
||||||
const permissionRoles = value
|
const permissionRoles = value
|
||||||
const super_admin = 'admin'
|
const super_admin = 'admin'
|
||||||
const roles = cache.local.get(CACHE_KEY.USER).roles
|
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||||
const hasRole = roles.some((role) => {
|
const hasRole = roles.some((role) => {
|
||||||
return super_admin === role || permissionRoles.includes(role)
|
return super_admin === role || permissionRoles.includes(role)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script name="SystemDeptForm" setup>
|
<script lang="ts" name="SystemDeptForm" setup>
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
@@ -81,7 +81,6 @@ const message = useMessage() // 消息弹窗
|
|||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@@ -93,7 +92,7 @@ const formData = ref({
|
|||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
remark: undefined
|
remark: undefined
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive<any>({
|
||||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||||
name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
||||||
sort: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
|
sort: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
|
||||||
@@ -105,10 +104,10 @@ const formRules = reactive({
|
|||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const deptTree = ref() // 树形结构
|
const deptTree = ref() // 树形结构
|
||||||
const userList = ref([]) // 用户列表
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type, id) => {
|
const open = async (type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
formType.value = type
|
formType.value = type
|
||||||
@@ -139,7 +138,7 @@ const submitForm = async () => {
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = formData.value
|
const data = formData.value as unknown as DeptApi.DeptVO
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await DeptApi.createDept(data)
|
await DeptApi.createDept(data)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
@@ -173,7 +172,7 @@ const resetForm = () => {
|
|||||||
const getTree = async () => {
|
const getTree = async () => {
|
||||||
deptTree.value = []
|
deptTree.value = []
|
||||||
const data = await DeptApi.getSimpleDeptList()
|
const data = await DeptApi.getSimpleDeptList()
|
||||||
let dept = { id: 0, name: '顶级部门', children: [] }
|
let dept: Tree = { id: 0, name: '顶级部门', children: [] }
|
||||||
dept.children = handleTree(data)
|
dept.children = handleTree(data)
|
||||||
deptTree.value.push(dept)
|
deptTree.value.push(dept)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,133 +0,0 @@
|
|||||||
<template>
|
|
||||||
<Dialog v-model="dialogVisible" :title="dialogTitle" width="800px">
|
|
||||||
<el-form ref="formRef" :model="formData" label-width="130px">
|
|
||||||
<el-form-item label="每日跟进指标数">
|
|
||||||
<el-input-number v-model="formData.targetNum" :controls="false" style="width: 150px" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="跟进指标生效日期">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.startDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-divider direction="horizontal" content-position="left">成交额指标</el-divider>
|
|
||||||
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button>
|
|
||||||
<el-table :data="formData.deptSignPriceTargetVOList" border>
|
|
||||||
<el-table-column label="年份" width="120">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="row.year"
|
|
||||||
type="year"
|
|
||||||
placeholder="选择年份"
|
|
||||||
size="small"
|
|
||||||
format="YYYY"
|
|
||||||
value-format="YYYY"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-input-number
|
|
||||||
v-model="row.monthTargetVOList[col - 1].targetPrice"
|
|
||||||
size="small"
|
|
||||||
:controls="false"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<template #footer>
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
||||||
</template>
|
|
||||||
</Dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="DialogTarget">
|
|
||||||
import * as DeptApi from '@/api/system/dept'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
|
||||||
|
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
||||||
const formData = ref({
|
|
||||||
remark: undefined
|
|
||||||
})
|
|
||||||
|
|
||||||
/** 打开弹窗 */
|
|
||||||
const open = async (deptId) => {
|
|
||||||
dialogVisible.value = true
|
|
||||||
dialogTitle.value = '业绩指标'
|
|
||||||
resetForm()
|
|
||||||
// 修改时,设置数据
|
|
||||||
if (deptId) {
|
|
||||||
formLoading.value = true
|
|
||||||
try {
|
|
||||||
formData.value = await DeptApi.getDeptTarget(deptId)
|
|
||||||
formData.value.deptId = deptId
|
|
||||||
if (formData.value?.deptSignPriceTargetVOList) {
|
|
||||||
formData.value.deptSignPriceTargetVOList.forEach((it) => {
|
|
||||||
it.year = it.year + ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
||||||
|
|
||||||
/** 提交表单 */
|
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
||||||
const formRef = ref() // 表单 Ref
|
|
||||||
const submitForm = async () => {
|
|
||||||
// 提交请求
|
|
||||||
formLoading.value = true
|
|
||||||
try {
|
|
||||||
await DeptApi.updateDeptTarget(formData.value)
|
|
||||||
message.success('修改成功')
|
|
||||||
dialogVisible.value = false
|
|
||||||
// 发送操作成功的事件
|
|
||||||
emit('success')
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置表单 */
|
|
||||||
const resetForm = () => {
|
|
||||||
formData.value = {
|
|
||||||
targetNum: undefined,
|
|
||||||
startDate: undefined,
|
|
||||||
deptSignPriceTargetVOList: []
|
|
||||||
}
|
|
||||||
formRef.value?.resetFields()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleAddPrice() {
|
|
||||||
const obj = {
|
|
||||||
year: undefined,
|
|
||||||
monthTargetVOList: []
|
|
||||||
}
|
|
||||||
for (let i = 1; i <= 12; i++) {
|
|
||||||
obj.monthTargetVOList.push({
|
|
||||||
month: i,
|
|
||||||
targetPrice: undefined
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!formData.value.deptSignPriceTargetVOList) {
|
|
||||||
formData.value.deptSignPriceTargetVOList = []
|
|
||||||
}
|
|
||||||
formData.value.deptSignPriceTargetVOList.push(obj)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
@@ -23,13 +23,9 @@
|
|||||||
<el-table-column prop="name" label="部门名称" />
|
<el-table-column prop="name" label="部门名称" />
|
||||||
<el-table-column prop="leader" label="负责人" width="120" />
|
<el-table-column prop="leader" label="负责人" width="120" />
|
||||||
<el-table-column prop="sort" label="排序" width="200" />
|
<el-table-column prop="sort" label="排序" width="200" />
|
||||||
<el-table-column prop="status" label="状态" width="100">
|
<el-table-column prop="status" label="状态" width="100" />
|
||||||
<template #default="{ row }">
|
|
||||||
{{ ['启用', '禁用'][row.status] }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||||
<el-table-column label="操作" class-name="fixed-width" width="240">
|
<el-table-column label="操作" class-name="fixed-width" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
@@ -39,14 +35,6 @@
|
|||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
@click="openTarget(scope.row.id)"
|
|
||||||
v-hasPermi="['basic:dept:update']"
|
|
||||||
>
|
|
||||||
业绩指标
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@@ -61,13 +49,11 @@
|
|||||||
|
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<DeptForm ref="formRef" @success="getList" />
|
<DeptForm ref="formRef" @success="getList" />
|
||||||
<DialogTarget ref="targetDialogRef" @success="getList" />
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="SystemDept">
|
<script setup lang="ts" name="SystemDept">
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import DeptForm from './DeptForm.vue'
|
import DeptForm from './DeptForm.vue'
|
||||||
import DialogTarget from './DialogTarget.vue'
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
@@ -107,11 +93,6 @@ const openForm = (type: string, id?: number) => {
|
|||||||
formRef.value.open(type, id)
|
formRef.value.open(type, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetDialogRef = ref()
|
|
||||||
const openTarget = (id: number) => {
|
|
||||||
targetDialogRef.value.open(id)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form :model="form" ref="formRef" label-width="auto">
|
<el-form :model="form" ref="formRef" label-width="auto">
|
||||||
<!-- <el-form-item v-if="getConfig('usePhoneConfig')">
|
<el-form-item v-if="getConfig('usePhoneConfig')">
|
||||||
<template #label>
|
<template #label>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
v-if="getConfig('usePhoneConfig').remark"
|
v-if="getConfig('usePhoneConfig').remark"
|
||||||
@@ -8,10 +8,7 @@
|
|||||||
/>
|
/>
|
||||||
<span>使用外呼</span>
|
<span>使用外呼</span>
|
||||||
</template>
|
</template>
|
||||||
<el-radio-group
|
<el-radio-group v-model="form.usePhoneConfig">
|
||||||
v-model="form.usePhoneConfig"
|
|
||||||
:disabled="!getConfig('usePhoneConfig').modifiable"
|
|
||||||
>
|
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -20,7 +17,7 @@
|
|||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
<el-form-item v-if="getConfig('showFollowConfig')">
|
<el-form-item v-if="getConfig('showFollowConfig')">
|
||||||
<template #label>
|
<template #label>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
<el-tab-pane label="线索管理" :name="0" v-if="checkPermi(['basic:setting:clue'])">
|
<el-tab-pane label="线索管理" :name="0" v-if="checkPermi(['basic:setting:clue'])">
|
||||||
<BSClue v-if="tabIndex == 0" />
|
<BSClue v-if="tabIndex == 0" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="销售提成" :name="10" v-if="checkPermi(['basic:setting:comission'])">
|
<el-tab-pane label="销售提成" :name="10" v-if="checkPermi(['basic:setting:comission'])">
|
||||||
<BSSalerComission v-if="tabIndex == 10" />
|
<BSSalerComission v-if="tabIndex == 10" />
|
||||||
</el-tab-pane> -->
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="GeneralSetting">
|
<script setup name="GeneralSetting">
|
||||||
import BSClue from './Comp/BSClue.vue'
|
import BSClue from './Comp/BSClue.vue'
|
||||||
// import BSSalerComission from './Comp/BSSalerComission.vue'
|
import BSSalerComission from './Comp/BSSalerComission.vue'
|
||||||
import { checkPermi } from '@/utils/permission'
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
const tabIndex = ref(0)
|
const tabIndex = ref(0)
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="files" label="附件">
|
<el-table-column prop="files" label="附件">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" underline target="_blank" @click="handleDownload(row.files)">
|
<el-link type="primary" underline :href="row.fileUrl" target="_blank">
|
||||||
{{ row.files }}
|
{{ row.files }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
@@ -195,16 +195,6 @@ function handleClickLib(index) {
|
|||||||
getResourceList()
|
getResourceList()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDownload(href) {
|
|
||||||
if (href) {
|
|
||||||
let a = document.createElement('a')
|
|
||||||
a.download = href //指定下载的文件名
|
|
||||||
a.href = href // URL对象
|
|
||||||
a.click() // 模拟点击
|
|
||||||
URL.revokeObjectURL(a.href) // 释放URL 对象
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function openResource(type, id) {
|
function openResource(type, id) {
|
||||||
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,16 +7,6 @@
|
|||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
<el-form-item label="服务类型" prop="serviceId">
|
|
||||||
<el-select v-model="formData.serviceId" placeholder="选择服务类型" filterable>
|
|
||||||
<el-option
|
|
||||||
v-for="item in props.appList"
|
|
||||||
:key="item.serviceId"
|
|
||||||
:label="item.serviceName"
|
|
||||||
:value="item.serviceId"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="上级菜单">
|
<el-form-item label="上级菜单">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="formData.parentId"
|
v-model="formData.parentId"
|
||||||
@@ -116,18 +106,14 @@
|
|||||||
<script lang="ts" name="SystemMenuForm" setup>
|
<script lang="ts" name="SystemMenuForm" setup>
|
||||||
// import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
// import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import * as MenuApi from '@/api/system/menu'
|
import * as MenuApi from '@/api/system/menu'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import { CommonStatusEnum, SystemMenuTypeEnum } from '@/utils/constants'
|
import { CommonStatusEnum, SystemMenuTypeEnum } from '@/utils/constants'
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
appList: Object as any
|
|
||||||
})
|
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
@@ -146,8 +132,7 @@ const formData = ref({
|
|||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
visible: true,
|
visible: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
alwaysShow: true,
|
alwaysShow: true
|
||||||
serviceId: undefined
|
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
name: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
|
||||||
@@ -218,7 +203,7 @@ const submitForm = async () => {
|
|||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
// 清空,从而触发刷新
|
// 清空,从而触发刷新
|
||||||
cache.local.delete(CACHE_KEY.ROLE_ROUTERS)
|
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,8 +233,7 @@ const resetForm = () => {
|
|||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
visible: true,
|
visible: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
alwaysShow: true,
|
alwaysShow: true
|
||||||
serviceId: undefined
|
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,11 +62,6 @@
|
|||||||
<el-table-column :show-overflow-tooltip="true" label="组件路径" prop="component" />
|
<el-table-column :show-overflow-tooltip="true" label="组件路径" prop="component" />
|
||||||
<el-table-column :show-overflow-tooltip="true" label="组件名称" prop="componentName" />
|
<el-table-column :show-overflow-tooltip="true" label="组件名称" prop="componentName" />
|
||||||
<el-table-column label="状态" prop="status" width="80" />
|
<el-table-column label="状态" prop="status" width="80" />
|
||||||
<el-table-column label="服务类型" prop="" width="100">
|
|
||||||
<template #default="{ row }">
|
|
||||||
{{ getServiceName(row.serviceId) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="操作">
|
<el-table-column align="center" label="操作">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="openForm('update', scope.row.id)">
|
<el-button link type="primary" @click="openForm('update', scope.row.id)">
|
||||||
@@ -82,14 +77,14 @@
|
|||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<MenuForm ref="formRef" :appList="appList" @success="getList" />
|
<MenuForm ref="formRef" @success="getList" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" name="SystemMenu" setup>
|
<script lang="ts" name="SystemMenu" setup>
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
import * as MenuApi from '@/api/system/menu'
|
import * as MenuApi from '@/api/system/menu'
|
||||||
import MenuForm from './MenuForm.vue'
|
import MenuForm from './MenuForm.vue'
|
||||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
import cache from '@/plugins/cache'
|
const { wsCache } = useCache()
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -145,7 +140,7 @@ const refreshMenu = async () => {
|
|||||||
try {
|
try {
|
||||||
await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存')
|
await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存')
|
||||||
// 清空,从而触发刷新
|
// 清空,从而触发刷新
|
||||||
cache.local.delete(CACHE_KEY.ROLE_ROUTERS)
|
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||||
// 刷新浏览器
|
// 刷新浏览器
|
||||||
location.reload()
|
location.reload()
|
||||||
} catch {}
|
} catch {}
|
||||||
@@ -165,20 +160,8 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
const appList = ref([] as any)
|
|
||||||
const getOptions = () => {
|
|
||||||
MenuApi.getServiceAppList().then((data) => {
|
|
||||||
appList.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function getServiceName(serviceId: any) {
|
|
||||||
return appList.value.find((it: any) => it.serviceId == serviceId)?.serviceName
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getOptions()
|
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="pl-20px pr-20px">
|
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto" v-loading="formLoading">
|
|
||||||
<el-form-item label="开启通知">
|
|
||||||
<el-radio-group v-model="form.status">
|
|
||||||
<el-radio :label="0"> 开启 </el-radio>
|
|
||||||
<el-radio :label="1"> 关闭 </el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="发送途径">
|
|
||||||
<el-checkbox-group v-model="form.sendType">
|
|
||||||
<el-checkbox v-for="(item, index) in sendTypeOptions" :key="index" :label="item.value">
|
|
||||||
{{ item.label }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发送时间">
|
|
||||||
<el-time-picker
|
|
||||||
v-model="form.sendTime"
|
|
||||||
placeholder="任意时间点"
|
|
||||||
format="HH:mm"
|
|
||||||
value-format="HH:mm"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发送内容">
|
|
||||||
<el-tree
|
|
||||||
ref="treeRef"
|
|
||||||
:data="contentOptions"
|
|
||||||
:props="defaultProps"
|
|
||||||
empty-text="加载中,请稍候"
|
|
||||||
node-key="id"
|
|
||||||
show-checkbox
|
|
||||||
default-expand-all
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm"> 保 存 </el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="ReportDaily">
|
|
||||||
import * as DaliyReportApi from '@/api/system/role/daliyReport'
|
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
|
||||||
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
const props = defineProps({
|
|
||||||
roleId: {
|
|
||||||
type: Number
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const formLoading = ref(false)
|
|
||||||
const form = ref({
|
|
||||||
sendItem: []
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.roleId,
|
|
||||||
() => {
|
|
||||||
getReportInfo()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
init()
|
|
||||||
})
|
|
||||||
|
|
||||||
const formRef = ref()
|
|
||||||
|
|
||||||
const rules = {}
|
|
||||||
|
|
||||||
const contentOptions = ref([])
|
|
||||||
|
|
||||||
async function init() {
|
|
||||||
getOptions()
|
|
||||||
getReportInfo()
|
|
||||||
}
|
|
||||||
|
|
||||||
const sendTypeOptions = ref([])
|
|
||||||
const treeRef = ref()
|
|
||||||
function getOptions() {
|
|
||||||
getGeneralSysDictData('message_send_type').then((data) => {
|
|
||||||
sendTypeOptions.value = data
|
|
||||||
})
|
|
||||||
DaliyReportApi.getDaliyReportContent().then((data) => {
|
|
||||||
contentOptions.value = handleTree(data)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getReportInfo() {
|
|
||||||
try {
|
|
||||||
formLoading.value = true
|
|
||||||
const data = await DaliyReportApi.getRoleDaliyReport(props.roleId)
|
|
||||||
form.value = { ...data }
|
|
||||||
|
|
||||||
if (!form.value.sendType) {
|
|
||||||
form.value.sendType = []
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!form.value.sendTime) {
|
|
||||||
form.value.sendTime = '22:00'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!form.value.sendItem) {
|
|
||||||
form.value.sendItem = []
|
|
||||||
}
|
|
||||||
treeRef.value.setCheckedKeys([], false)
|
|
||||||
// 设置选中
|
|
||||||
form.value.sendItem.forEach((menuId) => {
|
|
||||||
treeRef.value.setChecked(menuId, true, false)
|
|
||||||
})
|
|
||||||
formLoading.value = false
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交表单 */
|
|
||||||
const submitForm = async () => {
|
|
||||||
// 提交请求
|
|
||||||
formLoading.value = true
|
|
||||||
try {
|
|
||||||
const data = {
|
|
||||||
id: form.value.id,
|
|
||||||
roleId: props.roleId,
|
|
||||||
sendType: form.value.sendType,
|
|
||||||
sendTime: form.value.sendTime,
|
|
||||||
status: form.value.status,
|
|
||||||
sendItem: [
|
|
||||||
...treeRef.value.getCheckedKeys(false), // 获得当前选中节点
|
|
||||||
...treeRef.value.getHalfCheckedKeys() // 获得半选中的父节点
|
|
||||||
]
|
|
||||||
}
|
|
||||||
await DaliyReportApi.updateRoleDaliyReport(data)
|
|
||||||
message.success('保存成功')
|
|
||||||
getReportInfo()
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
@@ -107,14 +107,7 @@ const dataScopeOptions = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
async function getRoleInfo(id) {
|
async function getRoleInfo(id) {
|
||||||
try {
|
formData.value = await RoleApi.getRole(id)
|
||||||
formData.value = await RoleApi.getRole(id)
|
|
||||||
nextTick(() => {
|
|
||||||
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
|
|||||||
@@ -75,13 +75,6 @@
|
|||||||
@success="getList"
|
@success="getList"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="每日快报" :name="4">
|
|
||||||
<ReportDaily
|
|
||||||
v-if="roleOperateIndex == 4"
|
|
||||||
ref="reportDailyRef"
|
|
||||||
:roleId="list[libraryIndex].id"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
@@ -93,7 +86,6 @@ import RoleForm from './RoleForm.vue'
|
|||||||
import RoleEmployee from './Comp/RoleEmployee.vue'
|
import RoleEmployee from './Comp/RoleEmployee.vue'
|
||||||
import RoleAssignMenuForm from './RoleAssignMenuForm.vue'
|
import RoleAssignMenuForm from './RoleAssignMenuForm.vue'
|
||||||
import RoleDataPermissionForm from './RoleDataPermissionForm.vue'
|
import RoleDataPermissionForm from './RoleDataPermissionForm.vue'
|
||||||
import ReportDaily from './Comp/ReportDaily.vue'
|
|
||||||
import * as RoleApi from '@/api/system/role'
|
import * as RoleApi from '@/api/system/role'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称">
|
||||||
|
<template #prefix>
|
||||||
|
<Icon icon="ep:search" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
@@ -19,6 +26,7 @@ import { ElTree } from 'element-plus'
|
|||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
|
||||||
|
const deptName = ref('')
|
||||||
const deptList = ref<Tree[]>([]) // 树形结构
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户姓名" prop="nickname">
|
<el-form-item label="用户昵称" prop="nickname">
|
||||||
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" />
|
<el-input v-model="formData.nickname" placeholder="请输入用户昵称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -69,8 +69,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="username">
|
<el-form-item v-if="formData.id === undefined" label="用户名称" prop="username">
|
||||||
<el-input v-model="formData.username" placeholder="请输入登录账号" />
|
<el-input v-model="formData.username" placeholder="请输入用户名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -139,12 +139,11 @@ const formData = ref({
|
|||||||
remark: '',
|
remark: '',
|
||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
roleIds: [],
|
roleIds: [],
|
||||||
hireDate: '',
|
hireDate: ''
|
||||||
isNewUserConfirm: false
|
|
||||||
})
|
})
|
||||||
const formRules = ref<any>({
|
const formRules = ref<any>({
|
||||||
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
username: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
|
||||||
nickname: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }],
|
nickname: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
||||||
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
||||||
email: [
|
email: [
|
||||||
{
|
{
|
||||||
@@ -153,7 +152,13 @@ const formRules = ref<any>({
|
|||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
mobile: [
|
||||||
|
{
|
||||||
|
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||||
|
message: '请输入正确的手机号码',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const deptList = ref<Tree[]>([]) // 树形结构
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
@@ -193,14 +198,8 @@ const submitForm = async () => {
|
|||||||
try {
|
try {
|
||||||
const data = formData.value as unknown as UserApi.UserVO
|
const data = formData.value as unknown as UserApi.UserVO
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
const resp = await UserApi.createUser(data)
|
await UserApi.createUser(data)
|
||||||
if (resp.code == 18888) {
|
message.success(t('common.createSuccess'))
|
||||||
await message.confirm(resp.msg)
|
|
||||||
formData.value.isNewUserConfirm = true
|
|
||||||
submitForm()
|
|
||||||
} else {
|
|
||||||
message.success(t('common.createSuccess'))
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
await UserApi.updateUser(data)
|
await UserApi.updateUser(data)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
@@ -227,8 +226,7 @@ const resetForm = () => {
|
|||||||
remark: '',
|
remark: '',
|
||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
roleIds: [],
|
roleIds: [],
|
||||||
hireDate: formatDate(new Date(), 'YYYY-MM-DD'),
|
hireDate: formatDate(new Date(), 'YYYY-MM-DD')
|
||||||
isNewUserConfirm: false
|
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
<el-col :span="20" :xs="24">
|
<el-col :span="20" :xs="24">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||||
<el-form-item label="姓名" prop="nickname">
|
<el-form-item label="用户名称" prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.nickname"
|
v-model="queryParams.username"
|
||||||
placeholder="请输入姓名"
|
placeholder="请输入用户名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="用户编号" key="id" prop="id" />
|
<el-table-column label="用户编号" key="id" prop="id" />
|
||||||
<el-table-column label="登录账号" prop="username" />
|
<el-table-column label="用户名称" prop="username" />
|
||||||
<el-table-column label="用户姓名" prop="nickname" />
|
<el-table-column label="用户昵称" prop="nickname" />
|
||||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||||
<el-table-column label="状态" key="status">
|
<el-table-column label="状态" key="status">
|
||||||
@@ -118,7 +118,6 @@ const queryParams = reactive({
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
username: undefined,
|
username: undefined,
|
||||||
nickname: undefined,
|
|
||||||
mobile: undefined,
|
mobile: undefined,
|
||||||
deptId: undefined
|
deptId: undefined
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef) return
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// 提交请求
|
// 提交请求
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef) return
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// 提交请求
|
// 提交请求
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable style="width: 120px">
|
<el-select v-model="searchForm.state" placeholder="审核状态" clearable>
|
||||||
<el-option label="待审核" :value="1" />
|
<el-option label="待审核" :value="1" />
|
||||||
<el-option label="已撤销" :value="2" />
|
<el-option label="已撤销" :value="2" />
|
||||||
<el-option label="已通过" :value="3" />
|
<el-option label="已通过" :value="3" />
|
||||||
@@ -16,13 +16,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||||
v-model="searchForm.signUser"
|
|
||||||
placeholder="登记人"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in userOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -38,19 +32,12 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="成交日期"
|
start-placeholder="登记日期"
|
||||||
end-placeholder="成交日期"
|
end-placeholder="登记日期"
|
||||||
style="width: 240px"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select v-model="searchForm.applyUser" placeholder="申请人" clearable filterable>
|
||||||
v-model="searchForm.applyUser"
|
|
||||||
placeholder="申请人"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in userOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -68,31 +55,12 @@
|
|||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="申请日期"
|
start-placeholder="申请日期"
|
||||||
end-placeholder="申请日期"
|
end-placeholder="申请日期"
|
||||||
style="width: 240px"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-date-picker
|
<el-button @click="handleSearch">查询</el-button>
|
||||||
v-model="searchForm.checkTime"
|
<el-button @click="handleReset">重置</el-button>
|
||||||
type="daterange"
|
<el-button @click="batchAudit">批量审核</el-button>
|
||||||
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-button @click="handleSearch" v-hasPermi="['clue:order:after-sale-search']">
|
|
||||||
查询
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="handleReset" v-hasPermi="['clue:order:after-sale-reset']">
|
|
||||||
重置
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="batchAudit" v-hasPermi="['clue:order:after-sale-batch-audit']">
|
|
||||||
批量审核
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -108,41 +76,16 @@
|
|||||||
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
||||||
<el-table-column prop="reason" label="售后原因" min-width="150px" />
|
<el-table-column prop="reason" label="售后原因" min-width="150px" />
|
||||||
<el-table-column prop="refundAmount" label="退款金额" min-width="90px" />
|
<el-table-column prop="refundAmount" label="退款金额" min-width="90px" />
|
||||||
<el-table-column prop="percentageDeductAmount" label="提成扣款" min-width="90px" />
|
|
||||||
<el-table-column prop="isCompanyReceipts" label="是否公司收款" min-width="120px" />
|
|
||||||
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
|
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
|
||||||
<el-table-column prop="solution" label="解决方案" min-width="150px" />
|
<el-table-column prop="solution" label="解决方案" min-width="150px" />
|
||||||
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
|
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
|
||||||
<el-table-column
|
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||||
prop="dealDate"
|
|
||||||
label="成交日期"
|
|
||||||
min-width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
|
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
|
||||||
<el-table-column
|
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||||
prop="applyTime"
|
|
||||||
label="申请时间"
|
|
||||||
min-width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="checkUser" label="审核人" min-width="90" />
|
|
||||||
<el-table-column
|
|
||||||
prop="checkTime"
|
|
||||||
label="审核时间"
|
|
||||||
min-width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
||||||
<el-table-column label="操作" width="150px" fixed="right">
|
<el-table-column label="操作" width="150px" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||||
type="primary"
|
|
||||||
style="padding: 0"
|
|
||||||
text
|
|
||||||
v-hasPermi="['clue:order:after-sale-detail']"
|
|
||||||
@click="handleDetail(row.id)"
|
|
||||||
>
|
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -189,9 +132,6 @@ import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
|||||||
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
||||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const afterSaleAuditDialog = ref()
|
const afterSaleAuditDialog = ref()
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -207,7 +147,6 @@ const searchForm = ref({
|
|||||||
dealUser: undefined,
|
dealUser: undefined,
|
||||||
createDate: [],
|
createDate: [],
|
||||||
createUser: undefined,
|
createUser: undefined,
|
||||||
checkTime: [],
|
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
@@ -231,7 +170,6 @@ function handleReset() {
|
|||||||
dealUser: undefined,
|
dealUser: undefined,
|
||||||
createDate: [],
|
createDate: [],
|
||||||
createUser: undefined,
|
createUser: undefined,
|
||||||
checkTime: [],
|
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
@@ -241,7 +179,7 @@ const loading = ref(false)
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await AfterSaleApi.getAfterSalePage(removeNullField(searchForm.value))
|
const data = await AfterSaleApi.getAfterSalePage(searchForm.value)
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -24,16 +24,15 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="成交日期"
|
start-placeholder="登记日期"
|
||||||
end-placeholder="成交日期"
|
end-placeholder="登记日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.productId"
|
v-model="searchForm.signProduct"
|
||||||
placeholder="选择成交产品"
|
placeholder="选择成交产品"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
|
||||||
@change="searchForm.specsId = undefined"
|
@change="searchForm.specsId = undefined"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -49,11 +48,10 @@
|
|||||||
v-model="searchForm.specsId"
|
v-model="searchForm.specsId"
|
||||||
placeholder="选择规格"
|
placeholder="选择规格"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
:disabled="!searchForm.signProduct"
|
||||||
:disabled="!searchForm.productId"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in specsOptions(searchForm.productId)"
|
v-for="item in specsOptions(searchForm.signProduct)"
|
||||||
:key="item.specsId"
|
:key="item.specsId"
|
||||||
:label="item.specsName"
|
:label="item.specsName"
|
||||||
:value="item.specsId"
|
:value="item.specsId"
|
||||||
@@ -67,36 +65,21 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="tableList" border>
|
<el-table v-loading="loading" :data="tableList" border>
|
||||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
||||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
||||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
||||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||||
<el-table-column prop="productName" label="成交产品" min-width="150px" />
|
<el-table-column prop="" label="成交产品" min-width="150px" />
|
||||||
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
|
<el-table-column prop="" label="产品规格" min-width="150px" />
|
||||||
<el-table-column prop="signNum" label="销售数量" width="90px" />
|
<el-table-column prop="" label="发货时间" min-width="150px" />
|
||||||
<el-table-column
|
<el-table-column prop="" label="发货仓库" min-width="100px" />
|
||||||
prop="createTime"
|
<el-table-column prop="" label="备注" min-width="100px" />
|
||||||
label="发货时间"
|
<el-table-column label="操作" width="150px" fixed="right">
|
||||||
width="120px"
|
<template #default="{ row }">
|
||||||
:formatter="dateFormatter"
|
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||||
/>
|
详情
|
||||||
<el-table-column prop="batchNo" label="发货批次" min-width="120px" />
|
</el-button>
|
||||||
<el-table-column prop="warehouseName" label="发货仓库" min-width="120px" />
|
|
||||||
<el-table-column prop="sendNum" label="发货数量" width="90px" />
|
|
||||||
<el-table-column label="发货备注">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-popover
|
|
||||||
placement="top"
|
|
||||||
width="500px"
|
|
||||||
trigger="click"
|
|
||||||
v-if="scope.row.warehouseName && scope.row.remark"
|
|
||||||
>
|
|
||||||
<template #reference>
|
|
||||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
|
||||||
</template>
|
|
||||||
<div v-dompurify-html="scope.row.remark"></div>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -112,10 +95,6 @@
|
|||||||
<script setup name="Delivery">
|
<script setup name="Delivery">
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
import { getSimpleProductList } from '@/api/mall/product'
|
import { getSimpleProductList } from '@/api/mall/product'
|
||||||
import * as DeliveryApi from '@/api/clue/delivery'
|
|
||||||
import { removeNullField } from '@/utils'
|
|
||||||
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
// const message = useMessage() // 消息弹窗
|
// const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
@@ -123,8 +102,6 @@ const searchForm = ref({
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
dealDate: [],
|
dealDate: [],
|
||||||
signUser: undefined,
|
signUser: undefined,
|
||||||
productId: undefined,
|
|
||||||
specsId: undefined,
|
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
@@ -145,8 +122,6 @@ function handleReset() {
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
dealDate: [],
|
dealDate: [],
|
||||||
signUser: undefined,
|
signUser: undefined,
|
||||||
productId: undefined,
|
|
||||||
specsId: undefined,
|
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
@@ -156,14 +131,19 @@ const loading = ref(false)
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await DeliveryApi.getDeliveryPage(removeNullField(searchForm.value))
|
tableList.value = []
|
||||||
tableList.value = data.list
|
// const data = await FeebackApi.getPaymentPage(searchForm.value)
|
||||||
total.value = data.total
|
// tableList.value = data.list
|
||||||
|
// total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDetail(id) {
|
||||||
|
console.log(id)
|
||||||
|
}
|
||||||
|
|
||||||
const prodOptions = ref([])
|
const prodOptions = ref([])
|
||||||
|
|
||||||
const specsOptions = computed({
|
const specsOptions = computed({
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="reason" label="售后原因" />
|
<el-table-column prop="reason" label="售后原因" />
|
||||||
<el-table-column prop="refundAmount" label="退款金额" />
|
<el-table-column prop="refundAmount" label="退款金额" />
|
||||||
<el-table-column prop="percentageDeductAmount" label="提成扣款" />
|
|
||||||
<el-table-column prop="isReturns" label="是否退货" />
|
<el-table-column prop="isReturns" label="是否退货" />
|
||||||
<el-table-column prop="applyTime" label="申请日期" width="180px" />
|
<el-table-column prop="applyTime" label="申请日期" width="180px" />
|
||||||
<el-table-column prop="stateName" label="审核状态" />
|
<el-table-column prop="stateName" label="审核状态" />
|
||||||
@@ -14,61 +13,35 @@
|
|||||||
<el-button v-show="showAdd" class="mb-10px" type="primary" @click="handleAdd">
|
<el-button v-show="showAdd" class="mb-10px" type="primary" @click="handleAdd">
|
||||||
新增售后
|
新增售后
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-form v-if="!showAdd" :model="form" ref="formRef" :rules="rules" label-width="auto">
|
<el-form v-if="!showAdd" :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||||
<el-row :gutter="20">
|
<el-form-item label="售后原因" prop="reason">
|
||||||
<el-col :span="24" :offset="0">
|
<el-input v-model="form.reason" placeholder="请输入售后原因" />
|
||||||
<el-form-item label="售后原因" prop="reason">
|
</el-form-item>
|
||||||
<el-input v-model="form.reason" placeholder="请输入售后原因" />
|
<el-form-item label="退款金额" prop="refundAmount">
|
||||||
</el-form-item>
|
<el-input-number
|
||||||
</el-col>
|
v-model="form.refundAmount"
|
||||||
</el-row>
|
:min="0"
|
||||||
<el-row :gutter="20">
|
:controls="false"
|
||||||
<el-col :span="12" :offset="0">
|
placeholder="请输入金额"
|
||||||
<el-form-item label="退款金额" prop="refundAmount">
|
/>
|
||||||
<el-input-number
|
</el-form-item>
|
||||||
v-model="form.refundAmount"
|
<el-form-item label="是否退货" prop="isReturns">
|
||||||
:min="0"
|
<el-radio-group v-model="form.isReturns">
|
||||||
:controls="false"
|
<el-radio :label="true"> 退货 </el-radio>
|
||||||
placeholder="请输入金额"
|
<el-radio :label="false"> 不退货 </el-radio>
|
||||||
/>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label="解决方案" prop="solution">
|
||||||
<el-col :span="12" :offset="0">
|
<el-input
|
||||||
<el-form-item label="提成扣款金额" prop="percentageDeductAmount">
|
type="textarea"
|
||||||
<el-input-number
|
:autoSize="{ minRows: 3 }"
|
||||||
v-model="form.percentageDeductAmount"
|
v-model="form.solution"
|
||||||
:min="0"
|
placeholder="请输入退款原因"
|
||||||
:controls="false"
|
/>
|
||||||
placeholder="请输入金额"
|
</el-form-item>
|
||||||
/>
|
<el-form-item label="备注">
|
||||||
</el-form-item>
|
<Editor v-model:modelValue="form.remark" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<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-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<el-form-item label="解决方案" prop="solution">
|
|
||||||
<el-input
|
|
||||||
type="textarea"
|
|
||||||
:autoSize="{ minRows: 3 }"
|
|
||||||
v-model="form.solution"
|
|
||||||
placeholder="请输入退款原因"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<el-form-item label="备注">
|
|
||||||
<Editor v-model:modelValue="form.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||||
<el-button @click="showAdd = true">取消</el-button>
|
<el-button @click="showAdd = true">取消</el-button>
|
||||||
@@ -99,8 +72,7 @@ function open(signId) {
|
|||||||
const showAdd = ref(true)
|
const showAdd = ref(true)
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
const rules = {
|
const rules = {
|
||||||
percentageDeductAmount: { required: true, message: '提成扣款金额不可为空', trigger: 'blur' },
|
refundAmount: { required: true, message: '回款金额不可为空', trigger: 'blur' },
|
||||||
refundAmount: { required: true, message: '退款金额不可为空', trigger: 'blur' },
|
|
||||||
reason: { required: true, message: '售后原因不可为空', trigger: 'blur' },
|
reason: { required: true, message: '售后原因不可为空', trigger: 'blur' },
|
||||||
solution: { required: true, message: '解决方案不可为空', trigger: 'blur' }
|
solution: { required: true, message: '解决方案不可为空', trigger: 'blur' }
|
||||||
}
|
}
|
||||||
@@ -119,7 +91,6 @@ function handleAdd() {
|
|||||||
solution: undefined,
|
solution: undefined,
|
||||||
refundAmount: undefined,
|
refundAmount: undefined,
|
||||||
isReturns: false,
|
isReturns: false,
|
||||||
percentageDeductAmount: undefined,
|
|
||||||
remark: undefined
|
remark: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||||
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
||||||
<el-form
|
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||||
ref="formRef"
|
<el-form-item label="状态" prop="state">
|
||||||
v-loading="formLoading"
|
<el-radio-group v-model="formData.state">
|
||||||
:rules="ruels"
|
<el-radio :label="3"> 通过 </el-radio>
|
||||||
:model="formData"
|
<el-radio :label="4"> 驳回 </el-radio>
|
||||||
label-width="80px"
|
</el-radio-group>
|
||||||
>
|
</el-form-item>
|
||||||
<el-row :gutter="20">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-col :span="12" :offset="0">
|
<Editor v-model:modelValue="formData.remark" />
|
||||||
<el-form-item label="状态" prop="state">
|
</el-form-item>
|
||||||
<el-radio-group v-model="formData.state">
|
|
||||||
<el-radio :label="3"> 通过 </el-radio>
|
|
||||||
<el-radio :label="4"> 驳回 </el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="审核日期" prop="checkTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.checkTime"
|
|
||||||
type="date"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<Editor v-model:modelValue="formData.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -43,7 +20,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<script name="DialogAfterSaleAudit" setup>
|
<script name="DialogAfterSaleAudit" setup>
|
||||||
import { auditAfterSale } from '@/api/clue/afterSale'
|
import { auditAfterSale } from '@/api/clue/afterSale'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -68,8 +44,7 @@ const schema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '成交日期',
|
label: '登记时间',
|
||||||
dateFormat: 'YYYY-MM-DD',
|
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -87,16 +62,6 @@ const schema = [
|
|||||||
label: '退款金额',
|
label: '退款金额',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'percentageDeductAmount',
|
|
||||||
label: '提成扣款',
|
|
||||||
span: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'isCompanyReceipts',
|
|
||||||
label: '是否公司收款',
|
|
||||||
span: 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'isReturns',
|
field: 'isReturns',
|
||||||
label: '是否退货',
|
label: '是否退货',
|
||||||
@@ -110,7 +75,6 @@ const schema = [
|
|||||||
{
|
{
|
||||||
field: 'applyTime',
|
field: 'applyTime',
|
||||||
label: '申请时间',
|
label: '申请时间',
|
||||||
dateFormat: 'YYYY-MM-DD',
|
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -128,10 +92,6 @@ const formData = ref({
|
|||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
const ruels = {
|
|
||||||
checkTime: { required: true, message: '审核日期不可为空', trigger: 'blur,change' }
|
|
||||||
}
|
|
||||||
|
|
||||||
const orderInfo = ref({})
|
const orderInfo = ref({})
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (row) => {
|
const open = async (row) => {
|
||||||
@@ -168,7 +128,6 @@ const resetForm = (signId) => {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
saleId: signId,
|
saleId: signId,
|
||||||
state: 3,
|
state: 3,
|
||||||
checkTime: formatDate(new Date()),
|
|
||||||
remark: ''
|
remark: ''
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ const applySchema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '成交日期',
|
label: '登记时间',
|
||||||
dateFormat: 'YYYY-MM-DD',
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,16 +54,6 @@ const applySchema = [
|
|||||||
label: '退款金额',
|
label: '退款金额',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'percentageDeductAmount',
|
|
||||||
label: '提成扣款',
|
|
||||||
span: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'isCompanyReceipts',
|
|
||||||
label: '是否公司收款',
|
|
||||||
span: 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'isReturns',
|
field: 'isReturns',
|
||||||
label: '是否退货',
|
label: '是否退货',
|
||||||
@@ -82,7 +72,7 @@ const applySchema = [
|
|||||||
{
|
{
|
||||||
field: 'applyTime',
|
field: 'applyTime',
|
||||||
label: '申请时间',
|
label: '申请时间',
|
||||||
dateFormat: 'YYYY-MM-DD',
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,38 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
||||||
<el-form
|
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||||
ref="formRef"
|
<el-form-item label="状态" prop="state">
|
||||||
v-loading="formLoading"
|
<el-radio-group v-model="formData.state">
|
||||||
:rules="ruels"
|
<el-radio :label="3"> 通过 </el-radio>
|
||||||
:model="formData"
|
<el-radio :label="4"> 驳回 </el-radio>
|
||||||
label-width="80px"
|
</el-radio-group>
|
||||||
>
|
</el-form-item>
|
||||||
<el-row :gutter="20">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-col :span="12" :offset="0">
|
<Editor v-model:modelValue="formData.remark" />
|
||||||
<el-form-item label="状态" prop="state">
|
</el-form-item>
|
||||||
<el-radio-group v-model="formData.state">
|
|
||||||
<el-radio :label="3"> 通过 </el-radio>
|
|
||||||
<el-radio :label="4"> 驳回 </el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="审核日期" prop="checkTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.checkTime"
|
|
||||||
type="date"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<Editor v-model:modelValue="formData.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -43,7 +20,6 @@
|
|||||||
<script name="DialogAfterSaleAudit" setup>
|
<script name="DialogAfterSaleAudit" setup>
|
||||||
import { batchAuditAfterSale } from '@/api/clue/afterSale'
|
import { batchAuditAfterSale } from '@/api/clue/afterSale'
|
||||||
import { batchAuditPayment } from '@/api/clue/payment'
|
import { batchAuditPayment } from '@/api/clue/payment'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -56,10 +32,6 @@ const formData = ref({
|
|||||||
remark: ''
|
remark: ''
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const ruels = {
|
|
||||||
checkTime: { required: true, message: '审核日期不可为空', trigger: 'blur,change' }
|
|
||||||
}
|
|
||||||
|
|
||||||
const formType = ref('aftersale')
|
const formType = ref('aftersale')
|
||||||
const titleMap = {
|
const titleMap = {
|
||||||
aftersale: '批量售后审核',
|
aftersale: '批量售后审核',
|
||||||
@@ -107,7 +79,6 @@ const resetForm = (ids) => {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
payIds: ids,
|
payIds: ids,
|
||||||
saleIds: ids,
|
saleIds: ids,
|
||||||
checkTime: formatDate(new Date()),
|
|
||||||
state: 3,
|
state: 3,
|
||||||
remark: ''
|
remark: ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,130 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="发货" v-model="show" width="700px">
|
<el-dialog title="发货" v-model="show" width="600px">
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="85px">
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||||
<el-row :gutter="20">
|
<el-form-item label="发货仓库" prop="warehouseId">
|
||||||
<el-col :span="8" :offset="0">
|
<el-select v-model="form.warehouseId" placeholder="选择仓库" filterable>
|
||||||
<el-form-item label="待发数量">
|
<el-option
|
||||||
<span class="font-bold">:{{ form.sendTotalNum }}</span>
|
v-for="item in warehouseOptions"
|
||||||
</el-form-item>
|
:key="item.warehouseId"
|
||||||
</el-col>
|
:label="item.warehouseName"
|
||||||
<el-col :span="16" :offset="0">
|
:value="item.warehouseId"
|
||||||
<el-form-item label="发货方式">
|
/>
|
||||||
<el-radio-group v-model="form.sendType" :disabled="autoAuditPurchase == 'false'">
|
</el-select>
|
||||||
<el-radio :label="1">
|
</el-form-item>
|
||||||
<Tooltip
|
<el-form-item label="备注">
|
||||||
message="必须在进销存的“通用配置-常规配置”中,将 ’采购申请自动通过‘ 设置为“是”"
|
|
||||||
/>
|
|
||||||
立即采购发货
|
|
||||||
</el-radio>
|
|
||||||
<el-radio :label="2"> 使用库存发货 </el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<template v-if="form.sendType == 1">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="供应商" prop="supplier">
|
|
||||||
<el-select v-model="form.supplier" placeholder="选择供应商" filterable>
|
|
||||||
<el-option
|
|
||||||
v-for="item in supplierOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="采购数量" prop="num">
|
|
||||||
<el-input-number
|
|
||||||
:min="form.sendTotalNum"
|
|
||||||
v-model="form.num"
|
|
||||||
:controls="false"
|
|
||||||
placeholder="请输入"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="采购单价" prop="unitPrice">
|
|
||||||
<el-input-number
|
|
||||||
:min="0"
|
|
||||||
:controls="false"
|
|
||||||
v-model="form.unitPrice"
|
|
||||||
placeholder="请输入"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="存放仓库" prop="warehouseId">
|
|
||||||
<el-select
|
|
||||||
v-model="form.warehouseId"
|
|
||||||
placeholder="请选择"
|
|
||||||
filterable
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in warehouseOptions"
|
|
||||||
:key="item.warehouseId"
|
|
||||||
:label="item.warehouseName"
|
|
||||||
:value="item.warehouseId"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="其他支出">
|
|
||||||
<el-select v-model="extraPay.extraPayType" placeholder="其他支出类型" filterable>
|
|
||||||
<el-option
|
|
||||||
v-for="item in extraPayOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.extraPayName"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="支出金额">
|
|
||||||
<el-input-number v-model="extraPay.extraPayMoney" :controls="false" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<el-form-item label="支出备注">
|
|
||||||
<el-input v-model="extraPay.remark" placeholder="备注信息" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<el-table :data="inventoryList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" />
|
|
||||||
<el-table-column prop="batchNo" label="入库批次号" width="150px" />
|
|
||||||
<el-table-column prop="warehouseName" label="存放仓库" width="120px" />
|
|
||||||
<el-table-column prop="price" label="采购价" width="90px" />
|
|
||||||
<el-table-column prop="num" label="剩余库存" width="90px" />
|
|
||||||
<el-table-column label="发货数量">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-input-number
|
|
||||||
v-model="row.sendNum"
|
|
||||||
size="small"
|
|
||||||
:min="1"
|
|
||||||
:max="row.num"
|
|
||||||
:controls="false"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</template>
|
|
||||||
<el-form-item label="发货备注">
|
|
||||||
<Editor v-model:modelValue="form.remark" />
|
<Editor v-model:modelValue="form.remark" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -138,122 +25,48 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogDelivery">
|
<script setup name="DialogDelivery">
|
||||||
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
|
import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||||
import { createDelivery } from '@/api/clue/delivery'
|
import { createDelivery } from '@/api/clue/delivery'
|
||||||
import { getConfigList } from '@/api/system/set'
|
|
||||||
import { getDictOptions } from '@/utils/dict'
|
|
||||||
import { getExtraFeeSimpleList } from '@/api/clue/extraFee'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
|
|
||||||
const warehouseOptions = ref([])
|
const warehouseOptions = ref([])
|
||||||
const extraPayOptions = ref([])
|
|
||||||
const supplierOptions = getDictOptions('erp_supplier')
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
getSimpleWarehouseList().then((data) => {
|
getSimpleWarehouseList().then((data) => {
|
||||||
warehouseOptions.value = data
|
warehouseOptions.value = data
|
||||||
})
|
})
|
||||||
getExtraFeeSimpleList().then((data) => {
|
|
||||||
extraPayOptions.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRemainInventory(signProductId) {
|
|
||||||
getRemainInventoryList({ signProductId }).then((data) => {
|
|
||||||
inventoryList.value = data
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
function open(row) {
|
function open(id) {
|
||||||
show.value = true
|
show.value = true
|
||||||
resetForm(row)
|
resetForm(id)
|
||||||
getRemainInventory(row.id)
|
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
})
|
})
|
||||||
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
const extraPay = ref({})
|
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
supplier: { required: true, message: '供应商不可为空', trigger: 'change' },
|
|
||||||
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' },
|
|
||||||
num: { required: true, message: '采购数量不可为空', trigger: 'change,blur' },
|
|
||||||
unitPrice: { required: true, message: '采购单价不可为空', trigger: 'change,blur' },
|
|
||||||
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
||||||
})
|
})
|
||||||
function resetForm(row) {
|
function resetForm(id) {
|
||||||
form.value = {
|
form.value = {
|
||||||
sendType: 2,
|
signId: id,
|
||||||
sendTotalNum: row.signNum,
|
|
||||||
signProductId: row.id,
|
|
||||||
productId: row.productId,
|
|
||||||
specsId: row.specsId,
|
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
supplier: undefined,
|
|
||||||
num: row.signNum,
|
|
||||||
unitPrice: undefined,
|
|
||||||
remark: undefined
|
|
||||||
}
|
|
||||||
extraPay.value = {
|
|
||||||
extraPayType: undefined,
|
|
||||||
extraPayMoney: undefined,
|
|
||||||
remark: undefined
|
remark: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
const formRef = ref()
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
if (form.value.sendType == 1) {
|
if (!valid) return
|
||||||
const valid = await formRef.value.validate()
|
|
||||||
if (!valid) return
|
|
||||||
} else {
|
|
||||||
if (!deliveryArr.value.length) {
|
|
||||||
message.info('请选择库存发货!')
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
const deliveryCount = deliveryArr.value.reduce((pre, cur) => pre + cur.sendNum, 0)
|
|
||||||
if (deliveryCount < form.value.sendTotalNum) {
|
|
||||||
message.info('所选发货库存少于待发货数量,请重新选择后再发货!')
|
|
||||||
return
|
|
||||||
} else if (deliveryCount > form.value.sendTotalNum) {
|
|
||||||
message.info('所选发货库存多于待发货数量,请重新选择后再发货!')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
let params = {
|
await createDelivery(form.value)
|
||||||
signProductId: form.value.signProductId,
|
|
||||||
sendType: form.value.sendType,
|
|
||||||
remark: form.value.remark
|
|
||||||
}
|
|
||||||
if (params.sendType == 1) {
|
|
||||||
params.purchaseOrder = {
|
|
||||||
productId: form.value.productId,
|
|
||||||
specsId: form.value.specsId,
|
|
||||||
supplier: form.value.supplier,
|
|
||||||
num: form.value.num,
|
|
||||||
unitPrice: form.value.unitPrice,
|
|
||||||
warehouseId: form.value.warehouseId
|
|
||||||
}
|
|
||||||
if (extraPay.value.extraPayMoney) {
|
|
||||||
params.purchaseOrder.extraPay = [extraPay.value]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
params.detailList = deliveryArr.value
|
|
||||||
}
|
|
||||||
|
|
||||||
await createDelivery(params)
|
|
||||||
message.success('发货成功!')
|
message.success('发货成功!')
|
||||||
show.value = false
|
show.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
@@ -262,22 +75,8 @@ async function onSubmit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const inventoryList = ref([])
|
|
||||||
|
|
||||||
const deliveryArr = ref([])
|
|
||||||
function handleSelectionChange(val) {
|
|
||||||
deliveryArr.value = val
|
|
||||||
}
|
|
||||||
|
|
||||||
const autoAuditPurchase = ref('false')
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getOptions()
|
getOptions()
|
||||||
getConfigList({ module: 3 }).then((data) => {
|
|
||||||
// 获取所有配置项
|
|
||||||
autoAuditPurchase.value = data.find(
|
|
||||||
(it) => it.configKey == 'purchaseAuditAutoCompleteConfig'
|
|
||||||
).configValue
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
form.extraPay.push({
|
form.extraPay.push({
|
||||||
extraPayType: undefined,
|
extraPayType: undefined,
|
||||||
extraPayMoney: 0,
|
extraPayMoney: 0,
|
||||||
dictType: 'extra_pay_type',
|
dictType: 'extra_pay_type'
|
||||||
editabled: true
|
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
@@ -19,35 +18,24 @@
|
|||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-select
|
<el-select v-model="row.extraPayType" size="small" placeholder="其他费用类型" filterable>
|
||||||
v-if="row.editabled"
|
|
||||||
v-model="row.extraPayType"
|
|
||||||
size="small"
|
|
||||||
placeholder="其他费用类型"
|
|
||||||
filterable
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in extraPayOptions"
|
v-for="item in extraPayOptions"
|
||||||
:key="item.id"
|
:key="item.value"
|
||||||
:label="item.extraPayName"
|
:label="item.label"
|
||||||
:value="item.id"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="extraPayMoney" label="费用金额" width="180px">
|
<el-table-column prop="extraPayMoney" label="费用金额" width="180px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number
|
<el-input-number v-model="row.extraPayMoney" size="small" :controls="false" />
|
||||||
v-if="row.editabled"
|
|
||||||
v-model="row.extraPayMoney"
|
|
||||||
size="small"
|
|
||||||
:controls="false"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" label="备注">
|
<el-table-column prop="remark" label="备注">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-if="row.editabled" v-model="row.remark" size="small" placeholder="备注信息" />
|
<el-input v-model="row.remark" size="small" placeholder="备注信息" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="60px">
|
<el-table-column label="操作" width="60px">
|
||||||
@@ -55,7 +43,7 @@
|
|||||||
<Icon
|
<Icon
|
||||||
icon="ep:remove-filled"
|
icon="ep:remove-filled"
|
||||||
class="text-red-500"
|
class="text-red-500"
|
||||||
v-if="row.editabled"
|
:disabled="row.id"
|
||||||
@click="handleRemove('extraPay', $index)"
|
@click="handleRemove('extraPay', $index)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -72,18 +60,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogExtraPay">
|
<script setup name="DialogExtraPay">
|
||||||
import { signAddPay, getSignExtraPayList } from '@/api/clue/sign'
|
import { signAddPay } from '@/api/clue/sign'
|
||||||
import * as ExtraFeeApi from '@/api/clue/extraFee'
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const extraPayOptions = ref([])
|
const extraPayOptions = getDictOptions('extra_pay_type')
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
function open(id) {
|
function open(id) {
|
||||||
show.value = true
|
show.value = true
|
||||||
resetForm(id)
|
resetForm(id)
|
||||||
getFormList()
|
|
||||||
getOptions()
|
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
@@ -97,15 +83,6 @@ function resetForm(id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFormList() {
|
|
||||||
getSignExtraPayList({ id: form.value.signId }).then((data) => {
|
|
||||||
form.value.extraPay = data.map((it) => ({
|
|
||||||
...it,
|
|
||||||
editabled: false
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
@@ -122,12 +99,11 @@ async function onSubmit() {
|
|||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
signId: form.value.signId,
|
signId: form.value.id,
|
||||||
extraPay: form.value.extraPay.filter((it) => it.editabled)
|
extraPay: form.value.extraPay.filter((it) => !it.id)
|
||||||
}
|
}
|
||||||
await signAddPay(params)
|
await signAddPay(params)
|
||||||
message.success('添加额外支出成功!')
|
message.success('添加额外支出成功!')
|
||||||
getFormList()
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -136,12 +112,6 @@ async function onSubmit() {
|
|||||||
function handleRemove(type, index) {
|
function handleRemove(type, index) {
|
||||||
form.value[type].splice(index, 1)
|
form.value[type].splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOptions() {
|
|
||||||
ExtraFeeApi.getExtraFeeSimpleList().then((data) => {
|
|
||||||
extraPayOptions.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -1,44 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||||
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
||||||
<el-table :data="followList" size="small" border class="mt-10px mb-10px">
|
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||||
<el-table-column prop="userName" label="跟进人" />
|
<el-form-item label="状态" prop="state">
|
||||||
<el-table-column prop="followTime" label="最新跟进时间" :formatter="dateFormatter" />
|
<el-radio-group v-model="formData.state">
|
||||||
<el-table-column prop="signSate" label="成交状态" />
|
<el-radio :label="3"> 通过 </el-radio>
|
||||||
</el-table>
|
<el-radio :label="4"> 驳回 </el-radio>
|
||||||
<el-form
|
</el-radio-group>
|
||||||
ref="formRef"
|
</el-form-item>
|
||||||
v-loading="formLoading"
|
<el-form-item label="备注" prop="remark">
|
||||||
:model="formData"
|
<Editor v-model:modelValue="formData.remark" />
|
||||||
:rules="ruels"
|
</el-form-item>
|
||||||
label-width="80px"
|
|
||||||
>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<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-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="审核日期" prop="checkTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="formData.checkTime"
|
|
||||||
type="date"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24" :offset="0">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<Editor v-model:modelValue="formData.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -47,10 +19,8 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script name="DialogFeebackAudit" setup>
|
<script name="DialogFeebackAudit" setup>
|
||||||
import { getFollowUserList } from '@/api/clue'
|
import { auditPayment } from '@/api/clue/payment'
|
||||||
import { auditPayment, getPaymentDetail } from '@/api/clue/payment'
|
|
||||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
|
||||||
import {} from '@/utils/formatTime'
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
@@ -74,8 +44,7 @@ const schema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '成交日期',
|
label: '登记时间',
|
||||||
dateFormat: 'YYYY-MM-DD',
|
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -96,7 +65,6 @@ const schema = [
|
|||||||
{
|
{
|
||||||
field: 'applyTime',
|
field: 'applyTime',
|
||||||
label: '申请时间',
|
label: '申请时间',
|
||||||
dateFormat: 'YYYY-MM-DD',
|
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,11 +80,6 @@ const formData = ref({
|
|||||||
state: 3,
|
state: 3,
|
||||||
remark: ''
|
remark: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const ruels = {
|
|
||||||
checkTime: { required: true, message: '审核日期不可为空', trigger: 'blur,change' }
|
|
||||||
}
|
|
||||||
|
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
const orderInfo = ref({})
|
const orderInfo = ref({})
|
||||||
@@ -125,10 +88,8 @@ const open = async (row) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = '回款审核'
|
dialogTitle.value = '回款审核'
|
||||||
resetForm(row.id)
|
resetForm(row.id)
|
||||||
// 设置数据
|
// 修改时,设置数据
|
||||||
orderInfo.value = await getPaymentDetail({ id: row.id })
|
orderInfo.value = { ...row }
|
||||||
// 获取跟进信息
|
|
||||||
getFollowInfo(row.clueId)
|
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
@@ -157,17 +118,8 @@ const resetForm = (signId) => {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
payId: signId,
|
payId: signId,
|
||||||
state: 3,
|
state: 3,
|
||||||
checkTime: formatDate(new Date()),
|
|
||||||
remark: ''
|
remark: ''
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
const followList = ref([])
|
|
||||||
|
|
||||||
function getFollowInfo(id) {
|
|
||||||
getFollowUserList({ id }).then((data) => {
|
|
||||||
followList.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,11 +7,6 @@
|
|||||||
:columns="2"
|
:columns="2"
|
||||||
labelWidth="130px"
|
labelWidth="130px"
|
||||||
/>
|
/>
|
||||||
<el-table :data="followList" size="small" border class="mt-10px">
|
|
||||||
<el-table-column prop="userName" label="跟进人" />
|
|
||||||
<el-table-column prop="followTime" label="最新跟进时间" :formatter="dateFormatter" />
|
|
||||||
<el-table-column prop="signSate" label="成交状态" />
|
|
||||||
</el-table>
|
|
||||||
<Descriptions
|
<Descriptions
|
||||||
title="审核详情"
|
title="审核详情"
|
||||||
:data="orderInfo"
|
:data="orderInfo"
|
||||||
@@ -23,40 +18,110 @@
|
|||||||
</template>
|
</template>
|
||||||
<script name="DialogFeebackDetail" setup>
|
<script name="DialogFeebackDetail" setup>
|
||||||
import { getPaymentDetail } from '@/api/clue/payment'
|
import { getPaymentDetail } from '@/api/clue/payment'
|
||||||
import { getFollowUserList } from '@/api/clue'
|
|
||||||
|
|
||||||
import { useAppStore } from '@/store/modules/app'
|
|
||||||
import { schoolApplySchema, mallApplySchema, auditSchema, cancelSchema } from './feedbackSchema.js'
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const appStore = useAppStore()
|
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
|
||||||
const applySchema = computed(() => {
|
const applySchema = [
|
||||||
return appStore.getAppInfo?.instanceType == 1 ? schoolApplySchema : mallApplySchema
|
{
|
||||||
})
|
field: 'name',
|
||||||
|
label: '线索名称',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'phone',
|
||||||
|
label: '联系方式',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'signUserName',
|
||||||
|
label: '登记人',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'dealDate',
|
||||||
|
label: '登记时间',
|
||||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'money',
|
||||||
|
label: '回款金额',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'isPayoff',
|
||||||
|
label: '是否结清',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'applyUserName',
|
||||||
|
label: '申请人',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'applyTime',
|
||||||
|
label: '申请时间',
|
||||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
span: 2,
|
||||||
|
isEditor: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const auditSchema = [
|
||||||
|
{
|
||||||
|
field: 'stateName',
|
||||||
|
label: '审核状态',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'checkUser',
|
||||||
|
label: '审核人',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'checkTime',
|
||||||
|
label: '审核时间',
|
||||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'checkRemark',
|
||||||
|
label: '备注',
|
||||||
|
span: 3,
|
||||||
|
isEditor: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const cancelSchema = [
|
||||||
|
{
|
||||||
|
field: 'stateName',
|
||||||
|
label: '审核状态',
|
||||||
|
span: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'revokeTime',
|
||||||
|
label: '撤销时间',
|
||||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
span: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const orderInfo = ref({})
|
const orderInfo = ref({})
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (row) => {
|
const open = async (id) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = '回款申请详情'
|
dialogTitle.value = '回款申请详情'
|
||||||
try {
|
try {
|
||||||
orderInfo.value = await getPaymentDetail({ id: row.id })
|
orderInfo.value = await getPaymentDetail({ id })
|
||||||
getFollowInfo(row.clueId)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
const followList = ref([])
|
|
||||||
|
|
||||||
function getFollowInfo(id) {
|
|
||||||
getFollowUserList({ id }).then((data) => {
|
|
||||||
followList.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,71 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog title="成交详情" v-model="show" width="800px">
|
<Dialog title="成交详情" v-model="show" width="800px">
|
||||||
<el-tabs v-model="tabName">
|
<el-tabs v-model="tabName">
|
||||||
<el-tab-pane label="线索信息" name="clueInfo" v-if="checkPermi(['clue:pool:detail'])">
|
<el-tab-pane label="线索信息" name="clueInfo">
|
||||||
<Descriptions :data="clueInfo" :schema="clueSchema" :columns="2" labelWidth="130px" />
|
<Descriptions :data="clueInfo" :schema="clueSchema" :columns="2" labelWidth="130px" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="成交信息" name="orderInfo">
|
<el-tab-pane label="成交信息" name="orderInfo">
|
||||||
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
||||||
<template v-if="orderInfo.signProducts && orderInfo.signProducts.length">
|
<el-divider direction="horizontal" content-position="left">其他费用</el-divider>
|
||||||
<el-divider direction="horizontal" content-position="left">
|
|
||||||
成交产品<span v-if="prodTotalPrice">,应收:{{ prodTotalPrice }}</span>
|
|
||||||
</el-divider>
|
|
||||||
<el-table :data="orderInfo.signProducts" border stripe>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column prop="productName" label="成交产品" />
|
|
||||||
<el-table-column prop="specsName" label="产品规格" />
|
|
||||||
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
|
||||||
<el-table-column label="发货状态" prop="sendState" width="100px" />
|
|
||||||
<el-table-column label="发货备注">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-popover
|
|
||||||
placement="top"
|
|
||||||
width="500px"
|
|
||||||
trigger="click"
|
|
||||||
v-if="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>
|
|
||||||
</template>
|
|
||||||
<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.extraPay" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="extraPayType" label="费用项" />
|
<el-table-column prop="extraPayType" label="费用项" />
|
||||||
<el-table-column prop="extraPayMoney" label="金额" />
|
<el-table-column prop="extraPayMoney" label="金额" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-divider
|
|
||||||
v-if="prodTotalPrice + extraTotalPrice"
|
|
||||||
direction="horizontal"
|
|
||||||
content-position="left"
|
|
||||||
>
|
|
||||||
合计应收:{{ prodTotalPrice + extraTotalPrice }}
|
|
||||||
</el-divider>
|
|
||||||
<div v-if="checkPermi(['clue:order:add-fee'])">
|
|
||||||
<el-divider direction="horizontal" content-position="left">
|
|
||||||
额外支出<span v-if="extraPayTotalFee">,合计:{{ extraPayTotalFee }}</span>
|
|
||||||
</el-divider>
|
|
||||||
<el-table :data="extraPayList" border stripe>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column prop="extraPayType" label="支出项" />
|
|
||||||
<el-table-column prop="extraPayMoney" label="金额" />
|
|
||||||
<el-table-column prop="remark" label="备注" />
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane label="回款记录" name="returnRecord">
|
||||||
label="回款记录"
|
|
||||||
name="returnRecord"
|
|
||||||
v-if="checkPermi(['clue:order:return-list'])"
|
|
||||||
>
|
|
||||||
<el-table :data="returnRecordList" border stripe>
|
<el-table :data="returnRecordList" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="money" label="回款金额" />
|
<el-table-column prop="money" label="回款金额" />
|
||||||
@@ -74,11 +23,7 @@
|
|||||||
<el-table-column prop="stateName" label="审核状态" />
|
<el-table-column prop="stateName" label="审核状态" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane label="售后记录" name="afterSale">
|
||||||
label="售后记录"
|
|
||||||
name="afterSale"
|
|
||||||
v-if="checkPermi(['clue:order:after-sale-list'])"
|
|
||||||
>
|
|
||||||
<el-table :data="aftersaleList" border stripe>
|
<el-table :data="aftersaleList" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="reason" label="售后原因" />
|
<el-table-column prop="reason" label="售后原因" />
|
||||||
@@ -101,38 +46,14 @@ import { getSimpleFieldList as getOrderFieldList } from '@/api/clue/orderField'
|
|||||||
import { getPaymentPage } from '@/api/clue/payment'
|
import { getPaymentPage } from '@/api/clue/payment'
|
||||||
import { getAfterSalePage } from '@/api/clue/afterSale'
|
import { getAfterSalePage } from '@/api/clue/afterSale'
|
||||||
|
|
||||||
import { checkPermi } from '@/utils/permission'
|
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
const tabName = ref('clueInfo')
|
const tabName = ref('clueInfo')
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
const clueInfo = ref({})
|
const clueInfo = ref({})
|
||||||
const orderInfo = ref({
|
const orderInfo = ref({})
|
||||||
signProducts: [],
|
|
||||||
extraPay: []
|
|
||||||
})
|
|
||||||
const returnRecordList = ref([])
|
const returnRecordList = ref([])
|
||||||
const aftersaleList = ref([])
|
const aftersaleList = ref([])
|
||||||
const extraPayList = ref([])
|
|
||||||
|
|
||||||
const prodTotalPrice = computed(() => {
|
|
||||||
return (
|
|
||||||
orderInfo.value.signProducts?.reduce(
|
|
||||||
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
|
||||||
0
|
|
||||||
) || 0
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 其他费用
|
|
||||||
const extraTotalPrice = computed(() => {
|
|
||||||
return orderInfo.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 额外支出
|
|
||||||
const extraPayTotalFee = computed(() => {
|
|
||||||
return extraPayList.value.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
|
||||||
})
|
|
||||||
|
|
||||||
function open(clueId, orderId) {
|
function open(clueId, orderId) {
|
||||||
try {
|
try {
|
||||||
@@ -146,9 +67,6 @@ function open(clueId, orderId) {
|
|||||||
orderInfo.value = { ...data, ...data.diyParams }
|
orderInfo.value = { ...data, ...data.diyParams }
|
||||||
orderInfo.value.dealDate = formatDate(orderInfo.value.dealDate, 'YYYY-MM-DD HH:mm')
|
orderInfo.value.dealDate = formatDate(orderInfo.value.dealDate, 'YYYY-MM-DD HH:mm')
|
||||||
})
|
})
|
||||||
OrderApi.getSignExtraPayList({ id: orderId }).then((data) => {
|
|
||||||
extraPayList.value = data
|
|
||||||
})
|
|
||||||
getPaymentPage({ signId: orderId, pageNo: 1, pageSize: 100 }).then((data) => {
|
getPaymentPage({ signId: orderId, pageNo: 1, pageSize: 100 }).then((data) => {
|
||||||
returnRecordList.value = data.list
|
returnRecordList.value = data.list
|
||||||
})
|
})
|
||||||
@@ -165,15 +83,6 @@ const orderSchema = ref([])
|
|||||||
function getFields() {
|
function getFields() {
|
||||||
getClueFieldList().then((data) => {
|
getClueFieldList().then((data) => {
|
||||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||||
|
|
||||||
arr.forEach((it) => {
|
|
||||||
if (it.label.includes('日期')) {
|
|
||||||
it.dateFormat = 'YYYY-MM-DD'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (arr.length % 2 != 0) {
|
|
||||||
arr.push({})
|
|
||||||
}
|
|
||||||
clueSchema.value = [
|
clueSchema.value = [
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
@@ -191,21 +100,7 @@ function getFields() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
getOrderFieldList().then((data) => {
|
getOrderFieldList().then((data) => {
|
||||||
const list = useCrudSchemas(data).allSchemas.detailSchema
|
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||||
const arr = []
|
|
||||||
list.forEach((it) => {
|
|
||||||
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) {
|
|
||||||
arr.push({})
|
|
||||||
}
|
|
||||||
orderSchema.value = [
|
orderSchema.value = [
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
v-model="searchForm.signProduct"
|
v-model="searchForm.signProduct"
|
||||||
placeholder="选择成交产品"
|
placeholder="选择成交产品"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
|
||||||
@change="searchForm.specsId = undefined"
|
@change="searchForm.specsId = undefined"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -30,7 +29,6 @@
|
|||||||
v-model="searchForm.specsId"
|
v-model="searchForm.specsId"
|
||||||
placeholder="选择规格"
|
placeholder="选择规格"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
|
||||||
:disabled="!searchForm.signProduct"
|
:disabled="!searchForm.signProduct"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -52,13 +50,6 @@
|
|||||||
<template #actionMore>
|
<template #actionMore>
|
||||||
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
|
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
|
||||||
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
|
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
@click="handleBatchUpdateInstall"
|
|
||||||
v-hasPermi="['clue:order:batch-update-install']"
|
|
||||||
>
|
|
||||||
批量修改安装状态
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</Search>
|
</Search>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,113 +59,41 @@
|
|||||||
class="mt-10px"
|
class="mt-10px"
|
||||||
v-model:tableObject="tableObject"
|
v-model:tableObject="tableObject"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
rowkey="signId"
|
|
||||||
:expandRowKeys="expendRows"
|
|
||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
@get-checked-columns="getCheckedColumns"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="60" />
|
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="p-10px flex justify-center">
|
<div class="p-10px flex justify-center">
|
||||||
<VueDraggable
|
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||||
target="tbody"
|
<el-table-column prop="productName" label="成交产品" />
|
||||||
v-model="row.signProducts"
|
<el-table-column prop="specsName" label="产品规格" />
|
||||||
:animation="150"
|
<el-table-column prop="signNum" label="成交数量" />
|
||||||
@end="onDragEnd"
|
<el-table-column prop="" label="发货仓库" />
|
||||||
style="width: 100%"
|
<el-table-column label="操作" width="100px">
|
||||||
>
|
<template #default="scope">
|
||||||
<el-table
|
<el-button
|
||||||
:data="row.signProducts"
|
type="primary"
|
||||||
row-key="id"
|
class="mr-10px"
|
||||||
stripe
|
link
|
||||||
style="width: 80%; margin: 0 auto"
|
style="padding: 0; margin-left: 0"
|
||||||
>
|
v-hasPermi="['clue:order:send']"
|
||||||
<el-table-column prop="productName" label="成交产品" />
|
@click="handleDelivery(scope.row)"
|
||||||
<el-table-column prop="specsName" label="产品规格" />
|
>
|
||||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
发货
|
||||||
<el-table-column prop="remark" label="成交备注" width="100px" />
|
</el-button>
|
||||||
<el-table-column label="生产状态" width="160px">
|
</template>
|
||||||
<template #default="scope">
|
</el-table-column>
|
||||||
<el-switch
|
</el-table>
|
||||||
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>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</VueDraggable>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in showColumns"
|
v-for="item in allSchemas.tableColumns"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
:prop="item.field"
|
:prop="item.field"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
min-width="120px"
|
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" text>点击查看</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="240px" fixed="right">
|
<el-table-column label="操作" width="240px" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -202,7 +121,7 @@
|
|||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-if="scope.row.isPayoff == '未结清'"
|
v-if="scope.row.isPayoff == false"
|
||||||
v-hasPermi="['clue:order:return']"
|
v-hasPermi="['clue:order:return']"
|
||||||
@click="feeBack(scope.row)"
|
@click="feeBack(scope.row)"
|
||||||
>
|
>
|
||||||
@@ -244,7 +163,7 @@
|
|||||||
<script setup name="ClueOrderList">
|
<script setup name="ClueOrderList">
|
||||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||||
import * as SignApi from '@/api/clue/sign'
|
import * as SignApi from '@/api/clue/sign'
|
||||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
import { getSimpleProductList } from '@/api/mall/product'
|
import { getSimpleProductList } from '@/api/mall/product'
|
||||||
|
|
||||||
import DialogOrder from './DialogOrder.vue'
|
import DialogOrder from './DialogOrder.vue'
|
||||||
@@ -254,16 +173,6 @@ import DialogExtraFee from './DialogExtraPay.vue'
|
|||||||
import DialogDelivery from './DialogDelivery.vue'
|
import DialogDelivery from './DialogDelivery.vue'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
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([])
|
|
||||||
onMounted(() => {
|
|
||||||
getOptions()
|
|
||||||
})
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -293,7 +202,7 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
pageNo: 1
|
currentPage: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
@@ -301,7 +210,7 @@ function resetQuery() {
|
|||||||
signProduct: undefined
|
signProduct: undefined
|
||||||
}
|
}
|
||||||
searchRef.value.reset()
|
searchRef.value.reset()
|
||||||
tableObject.value.pageNo = 1
|
tableObject.value.currentPage = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
}
|
}
|
||||||
// 查询
|
// 查询
|
||||||
@@ -313,7 +222,7 @@ async function getTableList() {
|
|||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
...searchForm.value,
|
...searchForm.value,
|
||||||
pageNo: tableObject.value.pageNo,
|
pageNo: tableObject.value.currentPage,
|
||||||
pageSize: tableObject.value.pageSize
|
pageSize: tableObject.value.pageSize
|
||||||
}
|
}
|
||||||
const data = await SignApi.getSignPage(removeNullField(params))
|
const data = await SignApi.getSignPage(removeNullField(params))
|
||||||
@@ -330,10 +239,8 @@ async function getCurdSchemas() {
|
|||||||
try {
|
try {
|
||||||
const data = await getSimpleFieldList()
|
const data = await getSimpleFieldList()
|
||||||
data.forEach((elem) => {
|
data.forEach((elem) => {
|
||||||
if (['createUser'].includes(elem.field)) {
|
if (elem.field == 'createUser') {
|
||||||
elem.search.options = userOptions.value
|
elem.search.options = userOptions.value
|
||||||
} else if (['convertPeople', 'receiver'].includes(elem.field)) {
|
|
||||||
elem.search.options = allUserOptions.value
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||||
@@ -345,13 +252,6 @@ async function getCurdSchemas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const showColumns = ref([])
|
|
||||||
|
|
||||||
// 初始化表格
|
|
||||||
function getCheckedColumns(list) {
|
|
||||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
|
||||||
}
|
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
function handleDetail(row) {
|
function handleDetail(row) {
|
||||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||||
@@ -389,110 +289,25 @@ function handleAddFee(row) {
|
|||||||
extraFeeDialog.value.open(row.signId)
|
extraFeeDialog.value.open(row.signId)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getOptions() {
|
function getOptions() {
|
||||||
// 产品
|
// 产品
|
||||||
getSimpleProductList().then((data) => {
|
getSimpleProductList().then((data) => {
|
||||||
prodOptions.value = data
|
prodOptions.value = data
|
||||||
})
|
})
|
||||||
|
|
||||||
userOptions.value = await getUserOption()
|
|
||||||
allUserOptions.value = await getAllUserList()
|
|
||||||
getCurdSchemas()
|
|
||||||
}
|
}
|
||||||
const deliveryDialog = ref()
|
const deliveryDialog = ref()
|
||||||
function handleDelivery(row) {
|
function handleDelivery(row) {
|
||||||
deliveryDialog.value.open(row)
|
deliveryDialog.value.open(row.signId)
|
||||||
}
|
}
|
||||||
|
|
||||||
const batchIds = ref([])
|
const userOptions = ref([])
|
||||||
function handleSelectionChange(val) {
|
onMounted(() => {
|
||||||
batchIds.value = val.map((it) => it.signId)
|
getUserOption().then((data) => {
|
||||||
}
|
userOptions.value = data
|
||||||
|
getCurdSchemas()
|
||||||
const selectedValue = ref(undefined)
|
})
|
||||||
const installOptions = [
|
getOptions()
|
||||||
{ label: '待安装', value: 1 },
|
})
|
||||||
{ label: '已安装', value: 2 },
|
|
||||||
{ label: '无需安装', value: 3 }
|
|
||||||
]
|
|
||||||
|
|
||||||
const select = () =>
|
|
||||||
h(
|
|
||||||
ElSelect,
|
|
||||||
{
|
|
||||||
modelValue: selectedValue.value,
|
|
||||||
placeholder: '新状态',
|
|
||||||
'onUpdate:modelValue': (val) => {
|
|
||||||
selectedValue.value = val
|
|
||||||
}
|
|
||||||
},
|
|
||||||
() =>
|
|
||||||
installOptions.map((item) => {
|
|
||||||
return h(ElOption, { label: item.label, value: item.value })
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
function handleBatchUpdateInstall() {
|
|
||||||
if (batchIds.value.length) {
|
|
||||||
ElMessageBox({
|
|
||||||
title: '是否确认修改安装状态?',
|
|
||||||
message: select,
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消'
|
|
||||||
}).then(async (action) => {
|
|
||||||
// 处理用户点击确定或取消按钮后的逻辑
|
|
||||||
if (action == 'confirm') {
|
|
||||||
try {
|
|
||||||
// 发起修改状态
|
|
||||||
await SignApi.updateInstallStatus(batchIds.value, selectedValue.value)
|
|
||||||
message.success('修改成功')
|
|
||||||
// 刷新列表
|
|
||||||
await getTableList()
|
|
||||||
} catch (err) {
|
|
||||||
// 取消后,进行恢复按钮
|
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
message.info('请选择表格行')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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 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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -1,446 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-form :model="searchForm" label-width="0" inline>
|
|
||||||
<el-form-item>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.signId"
|
|
||||||
placeholder="成交单号"
|
|
||||||
clearable
|
|
||||||
style="width: 120px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<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: 120px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.settlementType"
|
|
||||||
placeholder="结算类型"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option label="货款" value="货款" />
|
|
||||||
<el-option label="其他支出" value="其他支出" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.signUser"
|
|
||||||
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.dealDate"
|
|
||||||
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-date-picker
|
|
||||||
v-model="searchForm.createDate"
|
|
||||||
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.signProduct"
|
|
||||||
placeholder="选择成交产品"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
@change="searchForm.signSpecs = undefined"
|
|
||||||
style="width: 150px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in prodOptions"
|
|
||||||
:key="item.productId"
|
|
||||||
:label="item.productName"
|
|
||||||
:value="item.productId"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.signSpecs"
|
|
||||||
placeholder="选择规格"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
:disabled="!searchForm.signProduct"
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<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-item>
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.supplier"
|
|
||||||
placeholder="选择供应商"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in supplierOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</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-group>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
|
||||||
<el-button @click="handleSearch" v-hasPermi="['clue:order:settle-search']">查询</el-button>
|
|
||||||
<el-button @click="handleReset" v-hasPermi="['clue:order:settle-reset']">重置</el-button>
|
|
||||||
<el-button @click="batchSettle" v-hasPermi="['clue:order:settle-batch-audit']">
|
|
||||||
批量结算
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
v-loading="loading"
|
|
||||||
:data="tableList"
|
|
||||||
border
|
|
||||||
show-summary
|
|
||||||
:summary-method="getSummaries"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
type="selection"
|
|
||||||
width="60"
|
|
||||||
fixed="left"
|
|
||||||
:selectable="(row) => row.settlementState == '待结算'"
|
|
||||||
/>
|
|
||||||
<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" />
|
|
||||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
|
||||||
<el-table-column prop="createTime" label="支出日期" width="140px">
|
|
||||||
<template #default="{ row, col }">
|
|
||||||
<el-date-picker
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.createTime"
|
|
||||||
type="date"
|
|
||||||
size="small"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
style="width: 110px"
|
|
||||||
:clearable="false"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ dateFormatter(row, col, row.createTime) }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="signProduct" label="成交产品" min-width="150px" />
|
|
||||||
<el-table-column prop="signSpecs" label="成交规格" min-width="150px" />
|
|
||||||
<el-table-column prop="supplier" label="供应商" min-width="150px" />
|
|
||||||
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-input-number
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.settlementPrice"
|
|
||||||
size="small"
|
|
||||||
:min="0"
|
|
||||||
:controls="false"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ row.settlementPrice }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
|
|
||||||
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
|
|
||||||
<el-table-column label="费用备注" width="90px">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
|
|
||||||
<template #reference>
|
|
||||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
|
||||||
</template>
|
|
||||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="settlementDate"
|
|
||||||
label="结算时间"
|
|
||||||
width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
|
|
||||||
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
|
|
||||||
<el-table-column prop="isCommissioned" label="提成状态" width="90px" fixed="right" />
|
|
||||||
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
|
|
||||||
<el-table-column label="结算备注" width="90px">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
|
||||||
<template #reference>
|
|
||||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
|
||||||
</template>
|
|
||||||
<div v-dompurify-html="scope.row.remark"></div>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="100px" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button
|
|
||||||
v-if="row.settlementState == '待结算'"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
v-hasPermi="['clue:order:settle-update']"
|
|
||||||
@click="handleUpdate(row)"
|
|
||||||
>
|
|
||||||
{{ row.edit ? '保存' : '修改' }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<Pagination
|
|
||||||
v-model:limit="searchForm.pageSize"
|
|
||||||
v-model:page="searchForm.pageNo"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<el-dialog title="批量结算" v-model="showDailog" width="600px">
|
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="结算金额">
|
|
||||||
{{ settleAmount }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结算备注" prop="remark">
|
|
||||||
<Editor v-model:modelValue="form.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span>
|
|
||||||
<el-button @click="showDailog = false">取 消</el-button>
|
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
|
||||||
确 定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="MallSettle">
|
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
|
||||||
import { getSimpleProductList } from '@/api/mall/product'
|
|
||||||
import * as SettleApi from '@/api/clue/settle'
|
|
||||||
|
|
||||||
import { getDictOptions } from '@/utils/dict'
|
|
||||||
import { removeNullField } from '@/utils/index'
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getOptions()
|
|
||||||
handleSearch()
|
|
||||||
})
|
|
||||||
|
|
||||||
const searchForm = ref({
|
|
||||||
name: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
signUser: undefined,
|
|
||||||
dealDate: [],
|
|
||||||
createDate: [],
|
|
||||||
signProduct: undefined,
|
|
||||||
signSpecs: undefined,
|
|
||||||
signId: undefined,
|
|
||||||
settlementState: 0,
|
|
||||||
settlementType: undefined,
|
|
||||||
supplier: undefined,
|
|
||||||
pageSize: 20,
|
|
||||||
pageNo: 1
|
|
||||||
})
|
|
||||||
|
|
||||||
function handleReset() {
|
|
||||||
searchForm.value = {
|
|
||||||
name: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
signUser: undefined,
|
|
||||||
dealDate: [],
|
|
||||||
createDate: [],
|
|
||||||
signProduct: undefined,
|
|
||||||
signSpecs: undefined,
|
|
||||||
signId: undefined,
|
|
||||||
settlementState: 0,
|
|
||||||
settlementType: undefined,
|
|
||||||
supplier: undefined,
|
|
||||||
pageSize: 20,
|
|
||||||
pageNo: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSearch() {
|
|
||||||
searchForm.value.pageNo = 1
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
const loading = ref(false)
|
|
||||||
const tableList = ref([])
|
|
||||||
const total = ref(0)
|
|
||||||
const totalNum = ref(0)
|
|
||||||
const totalAmount = ref(0)
|
|
||||||
async function getList() {
|
|
||||||
loading.value = true
|
|
||||||
try {
|
|
||||||
const data = await SettleApi.getMallSettlePage(removeNullField(searchForm.value))
|
|
||||||
tableList.value = data.list
|
|
||||||
total.value = data.total
|
|
||||||
totalNum.value = data.totalNum
|
|
||||||
totalAmount.value = data.totalAmount
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSummaries(param) {
|
|
||||||
const { columns } = param
|
|
||||||
const sums = []
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = '合计'
|
|
||||||
} else if (column.property == 'settlementNum') {
|
|
||||||
sums[index] = totalNum.value
|
|
||||||
} else if (column.property == 'settlementMoney') {
|
|
||||||
sums[index] = totalAmount.value
|
|
||||||
} else {
|
|
||||||
sums[index] = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return sums
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleUpdate(row) {
|
|
||||||
if (row.edit) {
|
|
||||||
// 删除的二次确认
|
|
||||||
await message.confirm('是否确认修改结算数据?')
|
|
||||||
// 保存
|
|
||||||
SettleApi.updateSettle({
|
|
||||||
settlementId: row.settlementId,
|
|
||||||
settlementPrice: row.settlementPrice,
|
|
||||||
createTime: row.createTime
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
message.success('修改成功')
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
row.edit = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
row.edit = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectList = ref([])
|
|
||||||
function handleSelectionChange(val) {
|
|
||||||
selectList.value = [...val]
|
|
||||||
}
|
|
||||||
|
|
||||||
const showDailog = ref(false)
|
|
||||||
const form = ref({})
|
|
||||||
const formRef = ref()
|
|
||||||
const formLoading = ref(false)
|
|
||||||
const rules = {
|
|
||||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
|
||||||
}
|
|
||||||
|
|
||||||
const settleAmount = ref(0)
|
|
||||||
function batchSettle() {
|
|
||||||
if (selectList.value.length) {
|
|
||||||
showDailog.value = true
|
|
||||||
form.value = {
|
|
||||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
|
||||||
reamrk: undefined
|
|
||||||
}
|
|
||||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
|
||||||
} else {
|
|
||||||
message.info('请选择表格数据!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleSaveSettle() {
|
|
||||||
if (!formRef.value) return
|
|
||||||
const valid = await formRef.value.validate()
|
|
||||||
if (!valid) return
|
|
||||||
try {
|
|
||||||
formLoading.value = true
|
|
||||||
await SettleApi.batchSaveSettle(form.value)
|
|
||||||
message.success('结算成功')
|
|
||||||
showDailog.value = false
|
|
||||||
getList()
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const userOptions = ref([])
|
|
||||||
const prodOptions = ref([])
|
|
||||||
const supplierOptions = getDictOptions('erp_supplier')
|
|
||||||
|
|
||||||
function getOptions() {
|
|
||||||
// 产品
|
|
||||||
getSimpleProductList().then((data) => {
|
|
||||||
prodOptions.value = data
|
|
||||||
})
|
|
||||||
getUserOption().then((data) => {
|
|
||||||
userOptions.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const specsOptions = computed({
|
|
||||||
get() {
|
|
||||||
return (prodId) => {
|
|
||||||
if (prodId) {
|
|
||||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
|
||||||
}
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
@@ -79,30 +79,14 @@
|
|||||||
v-model:tableObject="tableObject"
|
v-model:tableObject="tableObject"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
@get-checked-columns="getCheckedColumns"
|
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in showColumns"
|
v-for="item in allSchemas.tableColumns"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
:prop="item.field"
|
:prop="item.field"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
min-width="120px"
|
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" text>点击查看</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>
|
|
||||||
<span v-else>{{ row[item.field] }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="240px" fixed="right">
|
<el-table-column label="操作" width="240px" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -130,22 +114,12 @@
|
|||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-if="scope.row.isPayoff == '未结清'"
|
v-if="scope.row.isPayoff == false"
|
||||||
v-hasPermi="['clue:order:return']"
|
v-hasPermi="['clue:order:return']"
|
||||||
@click="feeBack(scope.row)"
|
@click="feeBack(scope.row)"
|
||||||
>
|
>
|
||||||
回款
|
回款
|
||||||
</el-button>
|
</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
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
@@ -164,30 +138,21 @@
|
|||||||
<DialogOrder ref="orderDetailDialog" />
|
<DialogOrder ref="orderDetailDialog" />
|
||||||
<DialogFeeback ref="feedbackDialog" />
|
<DialogFeeback ref="feedbackDialog" />
|
||||||
<DialogAfterSale ref="afterSaleDialog" />
|
<DialogAfterSale ref="afterSaleDialog" />
|
||||||
<DialogExtraFee ref="extraFeeDialog" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="ClueOrderList">
|
<script setup name="ClueOrderList">
|
||||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||||
import * as SignApi from '@/api/clue/sign'
|
import * as SignApi from '@/api/clue/sign'
|
||||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
import { getPlaceList } from '@/api/school/place'
|
import { getPlaceList } from '@/api/school/place'
|
||||||
import { getClassTypeList } from '@/api/school/class'
|
import { getClassTypePage } from '@/api/school/class'
|
||||||
|
|
||||||
import DialogOrder from './DialogOrder.vue'
|
import DialogOrder from './DialogOrder.vue'
|
||||||
import DialogFeeback from './DialogFeeback.vue'
|
import DialogFeeback from './DialogFeeback.vue'
|
||||||
import DialogAfterSale from './DialogAfterSale.vue'
|
import DialogAfterSale from './DialogAfterSale.vue'
|
||||||
import DialogExtraFee from './DialogExtraPay.vue'
|
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const userOptions = ref([])
|
|
||||||
const allUserOptions = ref([])
|
|
||||||
onMounted(() => {
|
|
||||||
getOptions()
|
|
||||||
})
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -210,7 +175,7 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
pageNo: 1
|
currentPage: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const placeOptions = computed(() => {
|
const placeOptions = computed(() => {
|
||||||
@@ -225,7 +190,7 @@ function resetQuery() {
|
|||||||
signProduct: undefined
|
signProduct: undefined
|
||||||
}
|
}
|
||||||
searchRef.value.reset()
|
searchRef.value.reset()
|
||||||
tableObject.value.pageNo = 1
|
tableObject.value.currentPage = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
}
|
}
|
||||||
// 查询
|
// 查询
|
||||||
@@ -237,7 +202,7 @@ async function getTableList() {
|
|||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
...searchForm.value,
|
...searchForm.value,
|
||||||
pageNo: tableObject.value.pageNo,
|
pageNo: tableObject.value.currentPage,
|
||||||
pageSize: tableObject.value.pageSize
|
pageSize: tableObject.value.pageSize
|
||||||
}
|
}
|
||||||
const data = await SignApi.getSignPage(removeNullField(params))
|
const data = await SignApi.getSignPage(removeNullField(params))
|
||||||
@@ -254,10 +219,8 @@ async function getCurdSchemas() {
|
|||||||
try {
|
try {
|
||||||
const data = await getSimpleFieldList()
|
const data = await getSimpleFieldList()
|
||||||
data.forEach((elem) => {
|
data.forEach((elem) => {
|
||||||
if (['createUser'].includes(elem.field)) {
|
if (elem.field == 'createUser') {
|
||||||
elem.search.options = userOptions.value
|
elem.search.options = userOptions.value
|
||||||
} else if (['convertPeople', 'receiver'].includes(elem.field)) {
|
|
||||||
elem.search.options = allUserOptions.value
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||||
@@ -269,13 +232,6 @@ async function getCurdSchemas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const showColumns = ref([])
|
|
||||||
|
|
||||||
// 初始化表格
|
|
||||||
function getCheckedColumns(list) {
|
|
||||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
|
||||||
}
|
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
function handleDetail(row) {
|
function handleDetail(row) {
|
||||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||||
@@ -293,11 +249,6 @@ function feeBack(row) {
|
|||||||
feedbackDialog.value.open(row.signId)
|
feedbackDialog.value.open(row.signId)
|
||||||
}
|
}
|
||||||
|
|
||||||
const extraFeeDialog = ref()
|
|
||||||
function handleAddFee(row) {
|
|
||||||
extraFeeDialog.value.open(row.signId)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消登记
|
// 取消登记
|
||||||
async function cancelDeal(row) {
|
async function cancelDeal(row) {
|
||||||
try {
|
try {
|
||||||
@@ -325,20 +276,26 @@ function changePlace() {
|
|||||||
|
|
||||||
const classOptions = ref([])
|
const classOptions = ref([])
|
||||||
async function getClassTypeOptions() {
|
async function getClassTypeOptions() {
|
||||||
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
const data = await getClassTypePage({ placeId: searchForm.value.signPlace })
|
||||||
classOptions.value = data
|
classOptions.value = data.list
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getOptions() {
|
function getOptions() {
|
||||||
// 驾校
|
// 驾校
|
||||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
getPlaceList().then((data) => {
|
||||||
schoolOptions.value = data.schoolList
|
schoolOptions.value = data.schoolList
|
||||||
allPlaceOptions.value = data.placeList
|
allPlaceOptions.value = data.placeList
|
||||||
})
|
})
|
||||||
userOptions.value = await getUserOption()
|
|
||||||
allUserOptions.value = await getAllUserList()
|
|
||||||
getCurdSchemas()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const userOptions = ref([])
|
||||||
|
onMounted(() => {
|
||||||
|
getUserOption().then((data) => {
|
||||||
|
userOptions.value = data
|
||||||
|
getCurdSchemas()
|
||||||
|
})
|
||||||
|
getOptions()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -8,56 +8,15 @@
|
|||||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="searchForm.mobile" placeholder="联系方式" clearable />
|
<el-select v-model="searchForm.state" placeholder="审核状态" clearable>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable style="width: 120px">
|
|
||||||
<el-option label="待审核" :value="1" />
|
<el-option label="待审核" :value="1" />
|
||||||
<el-option label="已撤销" :value="2" />
|
<el-option label="已撤销" :value="2" />
|
||||||
<el-option label="已通过" :value="3" />
|
<el-option label="已通过" :value="3" />
|
||||||
<el-option label="已驳回" :value="4" />
|
<el-option label="已驳回" :value="4" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.receiver"
|
|
||||||
placeholder="接待人"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in allUserOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.nickname"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-else-if="appStore.getAppInfo?.instanceType == 2">
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.convertPeople"
|
|
||||||
placeholder="转化人"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in allUserOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.nickname"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||||
v-model="searchForm.signUser"
|
|
||||||
placeholder="登记人"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in userOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -73,19 +32,12 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="成交日期"
|
start-placeholder="登记日期"
|
||||||
end-placeholder="成交日期"
|
end-placeholder="登记日期"
|
||||||
style="width: 240px"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select v-model="searchForm.applyUser" placeholder="申请人" clearable filterable>
|
||||||
v-model="searchForm.applyUser"
|
|
||||||
placeholder="申请人"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in userOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -103,27 +55,12 @@
|
|||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="申请日期"
|
start-placeholder="申请日期"
|
||||||
end-placeholder="申请日期"
|
end-placeholder="申请日期"
|
||||||
style="width: 240px"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-date-picker
|
<el-button @click="handleSearch">查询</el-button>
|
||||||
v-model="searchForm.checkTime"
|
<el-button @click="handleReset">重置</el-button>
|
||||||
type="daterange"
|
<el-button @click="batchAudit">批量审核</el-button>
|
||||||
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-button @click="handleSearch" v-hasPermi="['clue:order:return-search']">查询</el-button>
|
|
||||||
<el-button @click="handleReset" v-hasPermi="['clue:order:return-reset']">重置</el-button>
|
|
||||||
<el-button @click="batchAudit" v-hasPermi="['clue:order:return-batch-audit']">
|
|
||||||
批量审核
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -131,137 +68,22 @@
|
|||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="tableList"
|
:data="tableList"
|
||||||
border
|
border
|
||||||
show-summary
|
|
||||||
:summary-method="getSummaries"
|
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="60" :selectable="(row) => row.state == 1" />
|
<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 prop="name" label="线索名称" width="120px" />
|
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
||||||
<el-table-column prop="phone" label="联系方式" width="120px" />companyProfit
|
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
||||||
<el-table-column prop="money" label="回款金额" min-width="120px">
|
<el-table-column prop="money" label="回款金额" min-width="90" />
|
||||||
<template #default="{ row }">
|
<el-table-column prop="isPayoff" label="是否结清" min-width="90" />
|
||||||
<el-input-number
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.money"
|
|
||||||
size="small"
|
|
||||||
:min="0"
|
|
||||||
:controls="false"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ row.money }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
|
||||||
prop="companyProfit"
|
|
||||||
label="公司利润"
|
|
||||||
min-width="120px"
|
|
||||||
>
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-input-number
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.companyProfit"
|
|
||||||
size="small"
|
|
||||||
:min="0"
|
|
||||||
:controls="false"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ row.companyProfit }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
|
||||||
prop="personProfit"
|
|
||||||
label="员工利润"
|
|
||||||
min-width="120px"
|
|
||||||
>
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-input-number
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.personProfit"
|
|
||||||
size="small"
|
|
||||||
:min="0"
|
|
||||||
:controls="false"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ row.personProfit }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="signPrice" label="成交价" min-width="90" />
|
|
||||||
<el-table-column prop="isPayoff" label="是否结清" min-width="90">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-select v-if="row.edit" size="small" v-model="row.isPayoffValue">
|
|
||||||
<el-option label="结清" :value="true" />
|
|
||||||
<el-option label="未结清" :value="false" />
|
|
||||||
</el-select>
|
|
||||||
<div v-else>{{ row.isPayoff }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
|
||||||
prop="receiverName"
|
|
||||||
label="接待人"
|
|
||||||
min-width="90"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
v-else-if="appStore.getAppInfo?.instanceType == 2"
|
|
||||||
prop="convertPeopleName"
|
|
||||||
label="转化人"
|
|
||||||
min-width="90"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
|
||||||
prop="area"
|
|
||||||
label="区域"
|
|
||||||
min-width="90"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||||
<el-table-column
|
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||||
prop="dealDate"
|
|
||||||
label="成交日期"
|
|
||||||
min-width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
|
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
|
||||||
<el-table-column
|
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||||
prop="applyTime"
|
|
||||||
label="申请时间"
|
|
||||||
min-width="140px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
>
|
|
||||||
<template #default="{ row, col }">
|
|
||||||
<el-date-picker
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.applyTime"
|
|
||||||
type="date"
|
|
||||||
size="small"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
style="width: 110px"
|
|
||||||
:clearable="false"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ dateFormatter(row, col, row.applyTime) }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="checkUser" label="审核人" min-width="90" />
|
|
||||||
<el-table-column
|
|
||||||
prop="checkTime"
|
|
||||||
label="审核时间"
|
|
||||||
min-width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
||||||
<el-table-column label="操作" width="220px" fixed="right">
|
<el-table-column label="操作" width="150px" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||||
type="primary"
|
|
||||||
style="padding: 0"
|
|
||||||
text
|
|
||||||
v-hasPermi="['clue:order:return-detail']"
|
|
||||||
@click="handleDetail(row)"
|
|
||||||
>
|
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -274,16 +96,6 @@
|
|||||||
>
|
>
|
||||||
撤销
|
撤销
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
style="padding: 0"
|
|
||||||
text
|
|
||||||
v-if="row.state == 1"
|
|
||||||
v-hasPermi="['clue:order:update-return-money']"
|
|
||||||
@click="handleUpdate(row)"
|
|
||||||
>
|
|
||||||
<span>{{ row.edit ? '保存' : '修改金额' }}</span>
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
style="padding: 0"
|
style="padding: 0"
|
||||||
@@ -312,20 +124,15 @@
|
|||||||
|
|
||||||
<script setup name="Reback">
|
<script setup name="Reback">
|
||||||
import * as FeebackApi from '@/api/clue/payment'
|
import * as FeebackApi from '@/api/clue/payment'
|
||||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
|
||||||
import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
||||||
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
|
||||||
import { useAppStore } from '@/store/modules/app'
|
|
||||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const appStore = useAppStore()
|
|
||||||
|
|
||||||
const feebackDialog = ref()
|
const feebackDialog = ref()
|
||||||
|
|
||||||
@@ -339,14 +146,11 @@ const searchForm = ref({
|
|||||||
signUser: undefined,
|
signUser: undefined,
|
||||||
applyTime: [],
|
applyTime: [],
|
||||||
applyUser: undefined,
|
applyUser: undefined,
|
||||||
checkTime: [],
|
|
||||||
phone: undefined,
|
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
|
|
||||||
const userOptions = ref([])
|
const userOptions = ref([])
|
||||||
const allUserOptions = ref([])
|
|
||||||
|
|
||||||
const tableList = ref([])
|
const tableList = ref([])
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
@@ -359,30 +163,24 @@ function handleSearch() {
|
|||||||
function handleReset() {
|
function handleReset() {
|
||||||
searchForm.value = {
|
searchForm.value = {
|
||||||
signId: undefined,
|
signId: undefined,
|
||||||
receiver: undefined,
|
|
||||||
convertPeople: undefined,
|
|
||||||
name: undefined,
|
name: undefined,
|
||||||
dealDate: [],
|
dealDate: [],
|
||||||
state: undefined,
|
state: undefined,
|
||||||
signUser: undefined,
|
signUser: undefined,
|
||||||
applyTime: [],
|
applyTime: [],
|
||||||
applyUser: undefined,
|
applyUser: undefined,
|
||||||
checkTime: [],
|
|
||||||
mobile: undefined,
|
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const totalInfo = ref({})
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await FeebackApi.getPaymentPage(removeNullField(searchForm.value))
|
const data = await FeebackApi.getPaymentPage(searchForm.value)
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
totalInfo.value = data.totalData
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
@@ -403,8 +201,8 @@ function batchAudit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const feebackDetailDialog = ref()
|
const feebackDetailDialog = ref()
|
||||||
function handleDetail(row) {
|
function handleDetail(id) {
|
||||||
feebackDetailDialog.value.open(row)
|
feebackDetailDialog.value.open(id)
|
||||||
}
|
}
|
||||||
async function handleCancel(id) {
|
async function handleCancel(id) {
|
||||||
try {
|
try {
|
||||||
@@ -427,57 +225,6 @@ function getOptions() {
|
|||||||
getUserOption().then((data) => {
|
getUserOption().then((data) => {
|
||||||
userOptions.value = data
|
userOptions.value = data
|
||||||
})
|
})
|
||||||
getAllUserList().then((data) => {
|
|
||||||
allUserOptions.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSummaries(param) {
|
|
||||||
const { columns } = param
|
|
||||||
const sums = []
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = '合计'
|
|
||||||
} else if (column.property == 'money') {
|
|
||||||
sums[index] = totalInfo.value.totalMoney
|
|
||||||
} else if (column.property == 'personProfit') {
|
|
||||||
sums[index] = totalInfo.value.totalPersonProfit
|
|
||||||
} else if (column.property == 'companyProfit') {
|
|
||||||
sums[index] = totalInfo.value.totalCompanyProfit
|
|
||||||
} else if (column.property == 'signPrice') {
|
|
||||||
sums[index] = totalInfo.value.totalSignPrice
|
|
||||||
} else {
|
|
||||||
sums[index] = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return sums
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleUpdate(row) {
|
|
||||||
if (row.edit) {
|
|
||||||
// 删除的二次确认
|
|
||||||
await message.confirm('是否确认修改回款金额?')
|
|
||||||
// 保存
|
|
||||||
FeebackApi.updateApplyPayment({
|
|
||||||
id: row.id,
|
|
||||||
money: row.money,
|
|
||||||
companyProfit: row.companyProfit,
|
|
||||||
personProfit: row.personProfit,
|
|
||||||
isPayoff: row.isPayoffValue,
|
|
||||||
applyTime: formatDate(row.applyTime)
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
message.success('修改成功')
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
row.edit = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
row.edit = true
|
|
||||||
row.isPayoffValue = row.isPayoff == '结清'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -1,457 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-form :model="searchForm" label-width="0" inline>
|
|
||||||
<el-form-item>
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.signId"
|
|
||||||
placeholder="成交单号"
|
|
||||||
clearable
|
|
||||||
style="width: 120px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<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: 120px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.settlementType"
|
|
||||||
placeholder="结算类型"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option label="报名费" value="报名费" />
|
|
||||||
<el-option label="其他支出" value="其他支出" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.signUser"
|
|
||||||
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.dealDate"
|
|
||||||
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-date-picker
|
|
||||||
v-model="searchForm.createDate"
|
|
||||||
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.signSchool"
|
|
||||||
placeholder="选择驾校"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
@change="changeSchool"
|
|
||||||
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.signPlace"
|
|
||||||
placeholder="选择场地"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
:disabled="!searchForm.signSchool"
|
|
||||||
@change="changePlace"
|
|
||||||
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-select
|
|
||||||
v-model="searchForm.signClass"
|
|
||||||
:disabled="!searchForm.signPlace"
|
|
||||||
placeholder="选择班型"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
style="width: 120px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in classOptions"
|
|
||||||
:key="item.typeId"
|
|
||||||
:label="item.typeName"
|
|
||||||
:value="item.typeId"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-radio-group v-model="searchForm.settlementState">
|
|
||||||
<el-radio :label="1"> 已结算 </el-radio>
|
|
||||||
<el-radio :label="0"> 待结算 </el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button @click="handleSearch" v-hasPermi="['clue:order:settle-search']">查询</el-button>
|
|
||||||
<el-button @click="handleReset" v-hasPermi="['clue:order:settle-reset']">重置</el-button>
|
|
||||||
<el-button @click="batchSettle" v-hasPermi="['clue:order:settle-batch-audit']">
|
|
||||||
批量结算
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
v-loading="loading"
|
|
||||||
:data="tableList"
|
|
||||||
border
|
|
||||||
show-summary
|
|
||||||
:summary-method="getSummaries"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
type="selection"
|
|
||||||
width="60"
|
|
||||||
fixed="left"
|
|
||||||
:selectable="(row) => row.settlementState == '待结算'"
|
|
||||||
/>
|
|
||||||
<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" />
|
|
||||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
|
||||||
<el-table-column prop="createTime" label="支出日期" width="140px">
|
|
||||||
<template #default="{ row, col }">
|
|
||||||
<el-date-picker
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.createTime"
|
|
||||||
type="date"
|
|
||||||
size="small"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
style="width: 110px"
|
|
||||||
:clearable="false"
|
|
||||||
placeholder="选择日期"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ dateFormatter(row, col, row.createTime) }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="signSchool" label="成交驾校" min-width="150px" />
|
|
||||||
<el-table-column prop="signPlace" label="成交场地" min-width="150px" />
|
|
||||||
<el-table-column prop="signClass" label="成交班型" min-width="150px" />
|
|
||||||
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-input-number
|
|
||||||
v-if="row.edit"
|
|
||||||
v-model="row.settlementPrice"
|
|
||||||
size="small"
|
|
||||||
:min="0"
|
|
||||||
:controls="false"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
<div v-else>{{ row.settlementPrice }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
|
|
||||||
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
|
|
||||||
<el-table-column label="费用备注" width="90px">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
|
|
||||||
<template #reference>
|
|
||||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
|
||||||
</template>
|
|
||||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="settlementDate"
|
|
||||||
label="结算时间"
|
|
||||||
width="120px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
|
|
||||||
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
|
|
||||||
<el-table-column prop="isCommissioned" label="提成状态" width="90px" fixed="right" />
|
|
||||||
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
|
|
||||||
<el-table-column label="结算备注" width="90px">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
|
||||||
<template #reference>
|
|
||||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
|
||||||
</template>
|
|
||||||
<div v-dompurify-html="scope.row.remark"></div>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="100px" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button
|
|
||||||
v-if="row.settlementState == '待结算'"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
v-hasPermi="['clue:order:settle-update']"
|
|
||||||
@click="handleUpdate(row)"
|
|
||||||
>
|
|
||||||
{{ row.edit ? '保存' : '修改' }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<Pagination
|
|
||||||
v-model:limit="searchForm.pageSize"
|
|
||||||
v-model:page="searchForm.pageNo"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<el-dialog title="批量结算" v-model="showDailog" width="600px">
|
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="结算金额">
|
|
||||||
{{ settleAmount }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结算备注" prop="remark">
|
|
||||||
<Editor v-model:modelValue="form.remark" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span>
|
|
||||||
<el-button @click="showDailog = false">取 消</el-button>
|
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
|
||||||
确 定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="SchoolSettle">
|
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
|
||||||
import { getPlaceList } from '@/api/school/place'
|
|
||||||
import { getClassTypeList } from '@/api/school/class'
|
|
||||||
import * as SettleApi from '@/api/clue/settle'
|
|
||||||
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
import { removeNullField } from '@/utils/index'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getOptions()
|
|
||||||
handleSearch()
|
|
||||||
})
|
|
||||||
|
|
||||||
const searchForm = ref({
|
|
||||||
name: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
signUser: undefined,
|
|
||||||
dealDate: [],
|
|
||||||
createDate: [],
|
|
||||||
signSchool: undefined,
|
|
||||||
signPlace: undefined,
|
|
||||||
signClass: undefined,
|
|
||||||
signId: undefined,
|
|
||||||
settlementType: undefined,
|
|
||||||
settlementState: 0,
|
|
||||||
pageSize: 20,
|
|
||||||
pageNo: 1
|
|
||||||
})
|
|
||||||
|
|
||||||
function handleReset() {
|
|
||||||
searchForm.value = {
|
|
||||||
name: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
signUser: undefined,
|
|
||||||
dealDate: [],
|
|
||||||
createDate: [],
|
|
||||||
signSchool: undefined,
|
|
||||||
signPlace: undefined,
|
|
||||||
signClass: undefined,
|
|
||||||
signId: undefined,
|
|
||||||
settlementType: undefined,
|
|
||||||
settlementState: 0,
|
|
||||||
pageSize: 20,
|
|
||||||
pageNo: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSearch() {
|
|
||||||
searchForm.value.pageNo = 1
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
const loading = ref(false)
|
|
||||||
const tableList = ref([])
|
|
||||||
const total = ref(0)
|
|
||||||
|
|
||||||
const totalInfo = ref({})
|
|
||||||
async function getList() {
|
|
||||||
loading.value = true
|
|
||||||
try {
|
|
||||||
const data = await SettleApi.getSchoolSettlePage(removeNullField(searchForm.value))
|
|
||||||
tableList.value = data.list
|
|
||||||
total.value = data.total
|
|
||||||
totalInfo.value = data.totalData
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleUpdate(row) {
|
|
||||||
if (row.edit) {
|
|
||||||
// 删除的二次确认
|
|
||||||
await message.confirm('是否确认修改结算数据?')
|
|
||||||
// 保存
|
|
||||||
SettleApi.updateSettle({
|
|
||||||
settlementId: row.settlementId,
|
|
||||||
settlementPrice: row.settlementPrice,
|
|
||||||
createTime: row.createTime
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
message.success('修改成功')
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
row.edit = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
row.edit = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSummaries(param) {
|
|
||||||
const { columns } = param
|
|
||||||
const sums = []
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = '合计'
|
|
||||||
} else if (column.property == 'settlementNum') {
|
|
||||||
sums[index] = totalInfo.value.totalNum
|
|
||||||
} else if (column.property == 'settlementMoney') {
|
|
||||||
sums[index] = totalInfo.value.totalAmount
|
|
||||||
} else {
|
|
||||||
sums[index] = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return sums
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectList = ref([])
|
|
||||||
function handleSelectionChange(val) {
|
|
||||||
selectList.value = [...val]
|
|
||||||
}
|
|
||||||
|
|
||||||
const showDailog = ref(false)
|
|
||||||
const form = ref({})
|
|
||||||
const formRef = ref()
|
|
||||||
const formLoading = ref(false)
|
|
||||||
const rules = {
|
|
||||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
|
||||||
}
|
|
||||||
|
|
||||||
const settleAmount = ref(0)
|
|
||||||
function batchSettle() {
|
|
||||||
if (selectList.value.length) {
|
|
||||||
showDailog.value = true
|
|
||||||
form.value = {
|
|
||||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
|
||||||
reamrk: undefined
|
|
||||||
}
|
|
||||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
|
||||||
} else {
|
|
||||||
message.info('请选择表格数据!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleSaveSettle() {
|
|
||||||
if (!formRef.value) return
|
|
||||||
const valid = await formRef.value.validate()
|
|
||||||
if (!valid) return
|
|
||||||
try {
|
|
||||||
formLoading.value = true
|
|
||||||
await SettleApi.batchSaveSettle(form.value)
|
|
||||||
message.success('结算成功')
|
|
||||||
showDailog.value = false
|
|
||||||
getList()
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const schoolOptions = ref([])
|
|
||||||
const allPlaceOptions = ref([])
|
|
||||||
const userOptions = ref([])
|
|
||||||
|
|
||||||
function getOptions() {
|
|
||||||
// 驾校
|
|
||||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
|
||||||
schoolOptions.value = data.schoolList
|
|
||||||
allPlaceOptions.value = data.placeList
|
|
||||||
})
|
|
||||||
getUserOption().then((data) => {
|
|
||||||
userOptions.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const placeOptions = computed(() => {
|
|
||||||
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
|
|
||||||
})
|
|
||||||
|
|
||||||
function changeSchool() {
|
|
||||||
searchForm.value.signPlace = undefined
|
|
||||||
searchForm.value.signClass = undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
function changePlace() {
|
|
||||||
searchForm.value.signClass = undefined
|
|
||||||
getClassTypeOptions()
|
|
||||||
}
|
|
||||||
|
|
||||||
const classOptions = ref([])
|
|
||||||
async function getClassTypeOptions() {
|
|
||||||
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
|
||||||
classOptions.value = data
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user