Compare commits
45 Commits
salary
...
a544840679
| Author | SHA1 | Date | |
|---|---|---|---|
| a544840679 | |||
|
|
c2e4bfe609 | ||
| 247c6ed4a0 | |||
|
|
e6906818e8 | ||
|
|
004915e956 | ||
|
|
2cf95c4e5d | ||
|
|
db22a8ae8a | ||
| 769c901954 | |||
|
|
1be86c7699 | ||
|
|
a5e1a97d93 | ||
|
|
a3dc76e6a8 | ||
|
|
e60eb51f45 | ||
|
|
183794746b | ||
| 18bfc7d353 | |||
|
|
29f9dc5661 | ||
| fb6b341242 | |||
|
|
78d9f0649e | ||
| fea69da8ed | |||
|
|
22bc22c00a | ||
| 125f6f28ad | |||
|
|
925887f4c9 | ||
|
|
605151c5c8 | ||
|
|
feccb2a1fa | ||
| 39cddaa8e0 | |||
|
|
6922d1cb4c | ||
|
|
440dfe8747 | ||
|
|
48689642d8 | ||
| ffd15e2433 | |||
|
|
1e40357e51 | ||
|
|
60231e4005 | ||
|
|
252f23f96d | ||
|
|
904d76208d | ||
|
|
8d9c426773 | ||
|
|
2be616917e | ||
|
|
b2a7fa8dc4 | ||
|
|
98fc520e27 | ||
|
|
97b941055e | ||
|
|
ec14af1351 | ||
|
|
160f7c959e | ||
| 2bebd0480e | |||
|
|
cbfe115e88 | ||
|
|
a35a88d970 | ||
|
|
ed4522b043 | ||
|
|
e1285ed9c3 | ||
| 3036140859 |
@@ -4,7 +4,7 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
|
||||
# 上传路径
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
import { isDark } from '@/utils/is'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import routerSearch from '@/components/RouterSearch/index.vue'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('app')
|
||||
const appStore = useAppStore()
|
||||
const currentSize = computed(() => appStore.getCurrentSize)
|
||||
const greyMode = computed(() => appStore.getGreyMode)
|
||||
const { wsCache } = useCache()
|
||||
|
||||
// 根据浏览器当前主题设置系统主题色
|
||||
const setDefaultTheme = () => {
|
||||
let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
|
||||
let isDarkTheme = cache.local.get(CACHE_KEY.IS_DARK)
|
||||
if (isDarkTheme === null) {
|
||||
isDarkTheme = isDark()
|
||||
}
|
||||
|
||||
30
src/api/clue/extraFee.js
Normal file
30
src/api/clue/extraFee.js
Normal file
@@ -0,0 +1,30 @@
|
||||
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' })
|
||||
}
|
||||
@@ -58,3 +58,7 @@ export const getPublicClue = async (data) => {
|
||||
export const getFollowUserList = async (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 })
|
||||
}
|
||||
|
||||
@@ -37,3 +37,11 @@ export const cancelApplyPayment = async (data) => {
|
||||
export const getPaymentDetail = async (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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,3 +29,21 @@ export const signAddPay = async (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 })
|
||||
}
|
||||
|
||||
33
src/api/school/setting/area.js
Normal file
33
src/api/school/setting/area.js
Normal file
@@ -0,0 +1,33 @@
|
||||
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 })
|
||||
}
|
||||
@@ -17,7 +17,10 @@ export interface MenuVO {
|
||||
alwaysShow?: boolean
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 获取服务列表
|
||||
export const getServiceAppList = () => {
|
||||
return request.get({ url: '/admin-api/system/service/list' })
|
||||
}
|
||||
// 查询菜单(精简)列表
|
||||
export const getSimpleMenusList = () => {
|
||||
return request.get({ url: '/admin-api/system/menu/list-all-simple' })
|
||||
|
||||
@@ -74,3 +74,13 @@ export const updateUserStatus = (id: number, status: number) => {
|
||||
export const getSimpleUserList = (): Promise<UserVO[]> => {
|
||||
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,6 +67,7 @@ const emit = defineEmits(['close'])
|
||||
destroy-on-close
|
||||
draggable
|
||||
lock-scroll
|
||||
append-to-body
|
||||
v-bind="getBindValue"
|
||||
@close="emit('close')"
|
||||
>
|
||||
@@ -75,13 +76,16 @@ const emit = defineEmits(['close'])
|
||||
<slot name="title">
|
||||
{{ title }}
|
||||
</slot>
|
||||
<Icon
|
||||
v-if="fullscreen"
|
||||
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
|
||||
class="mr-22px cursor-pointer is-hover mt-2px z-10"
|
||||
color="var(--el-color-info)"
|
||||
@click="toggleFull"
|
||||
/>
|
||||
<div class="flex items-center">
|
||||
<slot name="btn"></slot>
|
||||
<Icon
|
||||
v-if="fullscreen"
|
||||
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
|
||||
class="mr-22px cursor-pointer is-hover z-10"
|
||||
color="var(--el-color-info)"
|
||||
@click="toggleFull"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="flex">
|
||||
<el-table :data="tableObject.tableList" border style="flex: 1">
|
||||
<el-table
|
||||
:data="tableObject.tableList"
|
||||
:row-key="rowkey"
|
||||
:expand-row-keys="expandRowKeys"
|
||||
border
|
||||
style="flex: 1"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<slot></slot>
|
||||
</el-table>
|
||||
<el-button
|
||||
@@ -53,10 +60,12 @@ import { useRoute } from 'vue-router'
|
||||
|
||||
const props = defineProps({
|
||||
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'])
|
||||
const emit = defineEmits(['update:tableObject', 'getList', 'getCheckedColumns', 'selection-change'])
|
||||
const route = useRoute()
|
||||
|
||||
const pageNo = ref(props.tableObject?.pageNo || 1)
|
||||
@@ -110,6 +119,10 @@ function onDragEnd() {
|
||||
emitColumns()
|
||||
}
|
||||
|
||||
function handleSelectionChange(val) {
|
||||
emit('selection-change', val)
|
||||
}
|
||||
|
||||
// 勾选确认
|
||||
function confirm() {
|
||||
ClueCacheApi.setClueCache({
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
import errorCode from './errorCode'
|
||||
|
||||
import { resetRouter } from '@/router'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { result_code, base_url, request_timeout } = config
|
||||
@@ -213,11 +212,10 @@ service.interceptors.response.use(
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 无访问权限,退出登录
|
||||
const { wsCache } = useCache()
|
||||
const tenantId = wsCache.get('TENANT_ID')
|
||||
const appId = wsCache.get('App_ID')
|
||||
const tenantId = cache.local.get('TENANT_ID')
|
||||
const appId = cache.local.get('App_ID')
|
||||
resetRouter() // 重置静态路由表
|
||||
wsCache.clear()
|
||||
cache.local.clear()
|
||||
removeToken()
|
||||
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
|
||||
})
|
||||
@@ -259,11 +257,10 @@ const handleAuthorized = () => {
|
||||
confirmButtonText: t('login.relogin'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const { wsCache } = useCache()
|
||||
const tenantId = wsCache.get('TENANT_ID')
|
||||
const appId = wsCache.get('App_ID')
|
||||
const tenantId = cache.local.get('TENANT_ID')
|
||||
const appId = cache.local.get('App_ID')
|
||||
resetRouter() // 重置静态路由表
|
||||
wsCache.clear()
|
||||
cache.local.clear()
|
||||
removeToken()
|
||||
isRelogin.show = false
|
||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { App } from 'vue'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
export function hasPermi(app: App<Element>) {
|
||||
app.directive('hasPermi', (el, binding) => {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const all_permission = '*:*:*'
|
||||
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||
const permissions = cache.local.get(CACHE_KEY.USER)?.permissions || []
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const permissionFlag = value
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { App } from 'vue'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
export function hasRole(app: App<Element>) {
|
||||
app.directive('hasRole', (el, binding) => {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const super_admin = 'admin'
|
||||
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||
const roles = cache.local.get(CACHE_KEY.USER).roles
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const roleFlag = value
|
||||
|
||||
@@ -229,6 +229,7 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
|
||||
value: defaultValue,
|
||||
...schemaItem.form,
|
||||
field: schemaItem.field,
|
||||
isRequired: schemaItem.isRequired,
|
||||
label: schemaItem.form?.label || schemaItem.label
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
// import { ElMessage } from 'element-plus'
|
||||
// import { useClipboard, useCssVar } from '@vueuse/core'
|
||||
import { useCssVar } from '@vueuse/core'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
import { setCssVar, trim } from '@/utils'
|
||||
import { colorIsDark, hexToRGB, lighten } from '@/utils/color'
|
||||
@@ -195,10 +196,9 @@ watch(
|
||||
|
||||
// 清空缓存
|
||||
const clear = () => {
|
||||
const { wsCache } = useCache()
|
||||
wsCache.delete(CACHE_KEY.LAYOUT)
|
||||
wsCache.delete(CACHE_KEY.THEME)
|
||||
wsCache.delete(CACHE_KEY.IS_DARK)
|
||||
cache.local.delete(CACHE_KEY.LAYOUT)
|
||||
cache.local.delete(CACHE_KEY.THEME)
|
||||
cache.local.delete(CACHE_KEY.IS_DARK)
|
||||
window.location.reload()
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<script lang="ts" name="UserInfo" setup>
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
import { Setting } from '@/layout/components/Setting'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
const { push, replace } = useRouter()
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -24,7 +23,7 @@ const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('user-info')
|
||||
|
||||
const user = wsCache.get(CACHE_KEY.USER)
|
||||
const user = cache.local.get(CACHE_KEY.USER)
|
||||
|
||||
const avatar = user.user.avatar ? user.user.avatar : avatarImg
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import router from './router'
|
||||
import { isRelogin } from '@/config/axios/service'
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||
import { useTitle } from '@/hooks/web/useTitle'
|
||||
import { useNProgress } from '@/hooks/web/useNProgress'
|
||||
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||
@@ -8,6 +8,7 @@ import { useDictStoreWithOut } from '@/store/modules/dict'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
@@ -19,44 +20,53 @@ const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/regis
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
start()
|
||||
loadStart()
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
await userStore.setUserInfoAction()
|
||||
isRelogin.show = false
|
||||
// 后端过滤菜单
|
||||
await permissionStore.generateRoutes()
|
||||
permissionStore.getAddRouters.forEach((route) => {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
next(nextData)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
if (getAppId() && to.query?.appId && getAppId() != to.query?.appId) {
|
||||
removeToken()
|
||||
cache?.local?.delete('appInfo')
|
||||
cache?.local?.delete('roleRouters')
|
||||
cache?.local?.delete('user')
|
||||
cache?.local?.delete('App_ID')
|
||||
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
await userStore.setUserInfoAction()
|
||||
isRelogin.show = false
|
||||
// 后端过滤菜单
|
||||
await permissionStore.generateRoutes()
|
||||
permissionStore.getAddRouters.forEach((route) => {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
next(nextData)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/crm/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) : {}
|
||||
return storage[key]
|
||||
},
|
||||
remove(key) {
|
||||
delete(key) {
|
||||
if (!sessionStorage) {
|
||||
return null
|
||||
}
|
||||
@@ -62,7 +62,7 @@ const localCache = {
|
||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||
return storage[key]
|
||||
},
|
||||
remove(key) {
|
||||
delete(key) {
|
||||
if (!localStorage) {
|
||||
return null
|
||||
}
|
||||
@@ -73,6 +73,10 @@ const localCache = {
|
||||
let storage = storageStr ? JSON.parse(storageStr) : {}
|
||||
delete storage[key]
|
||||
localStorage.setItem(name, JSON.stringify(storage))
|
||||
},
|
||||
clear() {
|
||||
let storage = {}
|
||||
localStorage.setItem(name, JSON.stringify(storage))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,27 @@ 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',
|
||||
component: () => import('@/views/Login/Login.vue'),
|
||||
|
||||
@@ -2,13 +2,12 @@ import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
import { setCssVar, humpToUnderline } from '@/utils'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
import { LayoutType } from '@/types/layout'
|
||||
import { ThemeTypes } from '@/types/theme'
|
||||
import { getAppInfo } from '@/api/login'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
interface AppState {
|
||||
breadcrumb: boolean
|
||||
@@ -46,7 +45,7 @@ export const useAppStore = defineStore('app', {
|
||||
sizeMap: ['default', 'large', 'small'],
|
||||
mobile: false, // 是否是移动端
|
||||
title: import.meta.env.VITE_APP_TITLE, // 标题
|
||||
appInfo: wsCache.get('appInfo'),
|
||||
appInfo: cache.local.get('appInfo'),
|
||||
pageLoading: false, // 路由跳转loading
|
||||
|
||||
breadcrumb: true, // 面包屑
|
||||
@@ -64,12 +63,12 @@ export const useAppStore = defineStore('app', {
|
||||
fixedHeader: true, // 固定toolheader
|
||||
footer: false, // 显示页脚
|
||||
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
|
||||
fixedMenu: wsCache.get('fixedMenu') || false, // 是否固定菜单
|
||||
fixedMenu: cache.local.get('fixedMenu') || false, // 是否固定菜单
|
||||
|
||||
layout: wsCache.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
|
||||
isDark: wsCache.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
|
||||
currentSize: wsCache.get('default') || 'default', // 组件尺寸
|
||||
theme: wsCache.get(CACHE_KEY.THEME) || {
|
||||
layout: cache.local.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
|
||||
isDark: cache.local.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
|
||||
currentSize: cache.local.get('default') || 'default', // 组件尺寸
|
||||
theme: cache.local.get(CACHE_KEY.THEME) || {
|
||||
// 主题色
|
||||
elColorPrimary: '#409eff',
|
||||
// 左侧菜单边框颜色
|
||||
@@ -225,7 +224,7 @@ export const useAppStore = defineStore('app', {
|
||||
this.greyMode = greyMode
|
||||
},
|
||||
setFixedMenu(fixedMenu: boolean) {
|
||||
wsCache.set('fixedMenu', fixedMenu)
|
||||
cache.local.set('fixedMenu', fixedMenu)
|
||||
this.fixedMenu = fixedMenu
|
||||
},
|
||||
setPageLoading(pageLoading: boolean) {
|
||||
@@ -237,7 +236,7 @@ export const useAppStore = defineStore('app', {
|
||||
return
|
||||
}
|
||||
this.layout = layout
|
||||
wsCache.set(CACHE_KEY.LAYOUT, this.layout)
|
||||
cache.local.set(CACHE_KEY.LAYOUT, this.layout)
|
||||
},
|
||||
setTitle(title: string) {
|
||||
this.title = title
|
||||
@@ -251,18 +250,18 @@ export const useAppStore = defineStore('app', {
|
||||
document.documentElement.classList.add('light')
|
||||
document.documentElement.classList.remove('dark')
|
||||
}
|
||||
wsCache.set(CACHE_KEY.IS_DARK, this.isDark)
|
||||
cache.local.set(CACHE_KEY.IS_DARK, this.isDark)
|
||||
},
|
||||
setCurrentSize(currentSize: ElementPlusSize) {
|
||||
this.currentSize = currentSize
|
||||
wsCache.set('currentSize', this.currentSize)
|
||||
cache.local.set('currentSize', this.currentSize)
|
||||
},
|
||||
setMobile(mobile: boolean) {
|
||||
this.mobile = mobile
|
||||
},
|
||||
setTheme(theme: ThemeTypes) {
|
||||
this.theme = Object.assign(this.theme, theme)
|
||||
wsCache.set(CACHE_KEY.THEME, this.theme)
|
||||
cache.local.set(CACHE_KEY.THEME, this.theme)
|
||||
},
|
||||
setCssVarTheme() {
|
||||
for (const key in this.theme) {
|
||||
@@ -274,7 +273,7 @@ export const useAppStore = defineStore('app', {
|
||||
},
|
||||
async setAppInfo(appId: number) {
|
||||
const appInfo = await getAppInfo(appId)
|
||||
wsCache.set('appInfo', appInfo)
|
||||
cache.local.set('appInfo', appInfo)
|
||||
this.appInfo = appInfo
|
||||
return appInfo
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import { defineStore } from 'pinia'
|
||||
import { store } from '../index'
|
||||
// @ts-ignore
|
||||
import { DictDataVO } from '@/api/system/dict/types'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache('sessionStorage')
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
import { listSimpleDictData } from '@/api/system/dict/dict.data'
|
||||
|
||||
export interface DictValueType {
|
||||
@@ -28,7 +28,7 @@ export const useDictStore = defineStore('dict', {
|
||||
}),
|
||||
getters: {
|
||||
getDictMap(): Recordable {
|
||||
const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE)
|
||||
const dictMap = cache.session.get(CACHE_KEY.DICT_CACHE)
|
||||
if (dictMap) {
|
||||
this.dictMap = dictMap
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export const useDictStore = defineStore('dict', {
|
||||
},
|
||||
actions: {
|
||||
async setDictMap() {
|
||||
const dictMap = wsCache.get(CACHE_KEY.DICT_CACHE)
|
||||
const dictMap = cache.session.get(CACHE_KEY.DICT_CACHE)
|
||||
if (dictMap) {
|
||||
this.dictMap = dictMap
|
||||
this.isSetDict = true
|
||||
@@ -64,7 +64,7 @@ export const useDictStore = defineStore('dict', {
|
||||
})
|
||||
this.dictMap = dictDataMap
|
||||
this.isSetDict = true
|
||||
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||
cache.session.set(CACHE_KEY.DICT_CACHE, dictDataMap) // 60 秒 过期
|
||||
}
|
||||
},
|
||||
getDictByType(type: string) {
|
||||
@@ -74,7 +74,7 @@ export const useDictStore = defineStore('dict', {
|
||||
return this.dictMap[type]
|
||||
},
|
||||
async resetDict() {
|
||||
wsCache.delete(CACHE_KEY.DICT_CACHE)
|
||||
cache.session.delete(CACHE_KEY.DICT_CACHE)
|
||||
const res = await listSimpleDictData()
|
||||
// 设置数据
|
||||
const dictDataMap = new Map<string, any>()
|
||||
@@ -94,7 +94,7 @@ export const useDictStore = defineStore('dict', {
|
||||
})
|
||||
this.dictMap = dictDataMap
|
||||
this.isSetDict = true
|
||||
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||
cache.session.set(CACHE_KEY.DICT_CACHE, dictDataMap) // 60 秒 过期
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,9 +3,8 @@ import { store } from '../index'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import remainingRouter from '@/router/modules/remaining'
|
||||
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
export interface PermissionState {
|
||||
routers: AppRouteRecordRaw[]
|
||||
@@ -34,8 +33,8 @@ export const usePermissionStore = defineStore('permission', {
|
||||
async generateRoutes(): Promise<unknown> {
|
||||
return new Promise<void>(async (resolve) => {
|
||||
let res: AppCustomRouteRecordRaw[] = []
|
||||
if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||
res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||
if (cache.local.get(CACHE_KEY.ROLE_ROUTERS)) {
|
||||
res = cache.local.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
|
||||
}
|
||||
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
|
||||
// 动态路由,404一定要放到最后面
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { store } from '../index'
|
||||
import { defineStore } from 'pinia'
|
||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { getInfo, loginOut } from '@/api/login'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
interface UserVO {
|
||||
id: number
|
||||
@@ -49,7 +48,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
this.resetState()
|
||||
return null
|
||||
}
|
||||
let userInfo = wsCache.get(CACHE_KEY.USER)
|
||||
let userInfo = cache.local.get(CACHE_KEY.USER)
|
||||
if (!userInfo) {
|
||||
userInfo = await getInfo({})
|
||||
}
|
||||
@@ -57,13 +56,13 @@ export const useUserStore = defineStore('admin-user', {
|
||||
this.roles = userInfo.roles
|
||||
this.user = userInfo.user
|
||||
this.isSetUser = true
|
||||
wsCache.set(CACHE_KEY.USER, userInfo)
|
||||
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
|
||||
cache.local.set(CACHE_KEY.USER, userInfo)
|
||||
cache.local.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
|
||||
},
|
||||
async loginOut() {
|
||||
await loginOut()
|
||||
removeToken()
|
||||
wsCache.clear()
|
||||
cache.local.clear()
|
||||
this.resetState()
|
||||
},
|
||||
resetState() {
|
||||
@@ -77,7 +76,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
wsCache.delete(CACHE_KEY.USER)
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
this.resetState()
|
||||
window.location.href = ''
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { TokenType } from '@/api/login/types'
|
||||
import { decrypt, encrypt } from '@/utils/jsencrypt'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const AccessTokenKey = 'ACCESS_TOKEN'
|
||||
const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
@@ -10,24 +8,26 @@ const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
// 获取token
|
||||
export const getAccessToken = () => {
|
||||
// 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
|
||||
return wsCache.get(AccessTokenKey) ? wsCache.get(AccessTokenKey) : wsCache.get('ACCESS_TOKEN')
|
||||
return cache.local.get(AccessTokenKey)
|
||||
? cache.local.get(AccessTokenKey)
|
||||
: cache.local.get('ACCESS_TOKEN')
|
||||
}
|
||||
|
||||
// 刷新token
|
||||
export const getRefreshToken = () => {
|
||||
return wsCache.get(RefreshTokenKey)
|
||||
return cache.local.get(RefreshTokenKey)
|
||||
}
|
||||
|
||||
// 设置token
|
||||
export const setToken = (token: TokenType) => {
|
||||
wsCache.set(RefreshTokenKey, token.refreshToken, { exp: token.expiresTime })
|
||||
wsCache.set(AccessTokenKey, token.accessToken)
|
||||
cache.local.set(RefreshTokenKey, token.refreshToken)
|
||||
cache.local.set(AccessTokenKey, token.accessToken)
|
||||
}
|
||||
|
||||
// 删除token
|
||||
export const removeToken = () => {
|
||||
wsCache.delete(AccessTokenKey)
|
||||
wsCache.delete(RefreshTokenKey)
|
||||
cache.local.delete(AccessTokenKey)
|
||||
cache.local.delete(RefreshTokenKey)
|
||||
}
|
||||
|
||||
/** 格式化token(jwt格式) */
|
||||
@@ -47,7 +47,7 @@ export type LoginFormType = {
|
||||
}
|
||||
|
||||
export const getLoginForm = () => {
|
||||
const loginForm: LoginFormType = wsCache.get(LoginFormKey)
|
||||
const loginForm: LoginFormType = cache.local.get(LoginFormKey)
|
||||
if (loginForm) {
|
||||
loginForm.password = decrypt(loginForm.password) as string
|
||||
}
|
||||
@@ -56,11 +56,11 @@ export const getLoginForm = () => {
|
||||
|
||||
export const setLoginForm = (loginForm: LoginFormType) => {
|
||||
loginForm.password = encrypt(loginForm.password) as string
|
||||
wsCache.set(LoginFormKey, loginForm, { exp: 30 * 24 * 60 * 60 })
|
||||
cache.local.set(LoginFormKey, loginForm)
|
||||
}
|
||||
|
||||
export const removeLoginForm = () => {
|
||||
wsCache.delete(LoginFormKey)
|
||||
cache.local.delete(LoginFormKey)
|
||||
}
|
||||
|
||||
// ========== 租户相关 ==========
|
||||
@@ -69,52 +69,52 @@ const TenantIdKey = 'TENANT_ID'
|
||||
const TenantNameKey = 'TENANT_NAME'
|
||||
|
||||
export const getTenantName = () => {
|
||||
return wsCache.get(TenantNameKey)
|
||||
return cache.local.get(TenantNameKey)
|
||||
}
|
||||
|
||||
export const setTenantName = (username: string) => {
|
||||
wsCache.set(TenantNameKey, username, { exp: 30 * 24 * 60 * 60 })
|
||||
cache.local.set(TenantNameKey, username)
|
||||
}
|
||||
|
||||
export const removeTenantName = () => {
|
||||
wsCache.delete(TenantNameKey)
|
||||
cache.local.delete(TenantNameKey)
|
||||
}
|
||||
|
||||
export const getTenantId = () => {
|
||||
return wsCache.get(TenantIdKey)
|
||||
return cache.local.get(TenantIdKey)
|
||||
}
|
||||
|
||||
export const setTenantId = (username: string) => {
|
||||
wsCache.set(TenantIdKey, username)
|
||||
cache.local.set(TenantIdKey, username)
|
||||
}
|
||||
|
||||
export const removeTenantId = () => {
|
||||
wsCache.delete(TenantIdKey)
|
||||
cache.local.delete(TenantIdKey)
|
||||
}
|
||||
|
||||
const AppIdKey = 'App_ID'
|
||||
const AppNameKey = 'App_NAME'
|
||||
|
||||
export const getAPPName = () => {
|
||||
return wsCache.get(AppNameKey)
|
||||
return cache.local.get(AppNameKey)
|
||||
}
|
||||
|
||||
export const setAppName = (name: string) => {
|
||||
wsCache.set(AppNameKey, name, { exp: 30 * 24 * 60 * 60 })
|
||||
cache.local.set(AppNameKey, name)
|
||||
}
|
||||
|
||||
export const removeAppName = () => {
|
||||
wsCache.delete(AppNameKey)
|
||||
cache.local.delete(AppNameKey)
|
||||
}
|
||||
|
||||
export const getAppId = () => {
|
||||
return wsCache.get(AppIdKey)
|
||||
return cache.local.get(AppIdKey)
|
||||
}
|
||||
|
||||
export const setAppId = (id: number) => {
|
||||
wsCache.set(AppIdKey, id)
|
||||
cache.local.set(AppIdKey, id)
|
||||
}
|
||||
|
||||
export const removeAppId = () => {
|
||||
wsCache.delete(AppIdKey)
|
||||
cache.local.delete(AppIdKey)
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
|
||||
export const removeNullField = (obj: Object) => {
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
if (obj[key] === '') {
|
||||
if (obj[key] === '' || obj[key] === null || obj[key] == undefined) {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
@@ -9,10 +10,9 @@ const { t } = useI18n() // 国际化
|
||||
*/
|
||||
export function checkPermi(value: string[]) {
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const { wsCache } = useCache()
|
||||
const permissionDatas = value
|
||||
const all_permission = '*:*:*'
|
||||
const permissions = wsCache.get(CACHE_KEY.USER).permissions
|
||||
const permissions = cache.local.get(CACHE_KEY.USER).permissions
|
||||
const hasPermission = permissions.some((permission) => {
|
||||
return all_permission === permission || permissionDatas.includes(permission)
|
||||
})
|
||||
@@ -30,10 +30,9 @@ export function checkPermi(value: string[]) {
|
||||
*/
|
||||
export function checkRole(value: string[]) {
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const { wsCache } = useCache()
|
||||
const permissionRoles = value
|
||||
const super_admin = 'admin'
|
||||
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||
const roles = cache.local.get(CACHE_KEY.USER).roles
|
||||
const hasRole = roles.some((role) => {
|
||||
return super_admin === role || permissionRoles.includes(role)
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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>
|
||||
<Tooltip
|
||||
v-if="getConfig('usePhoneConfig').remark"
|
||||
@@ -20,7 +20,7 @@
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item v-if="getConfig('showFollowConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
<el-tab-pane label="线索管理" :name="0" v-if="checkPermi(['basic:setting:clue'])">
|
||||
<BSClue v-if="tabIndex == 0" />
|
||||
</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" />
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="GeneralSetting">
|
||||
import BSClue from './Comp/BSClue.vue'
|
||||
import BSSalerComission from './Comp/BSSalerComission.vue'
|
||||
// import BSSalerComission from './Comp/BSSalerComission.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const tabIndex = ref(0)
|
||||
|
||||
@@ -7,6 +7,16 @@
|
||||
:rules="formRules"
|
||||
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-tree-select
|
||||
v-model="formData.parentId"
|
||||
@@ -106,14 +116,18 @@
|
||||
<script lang="ts" name="SystemMenuForm" setup>
|
||||
// import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as MenuApi from '@/api/system/menu'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import { CommonStatusEnum, SystemMenuTypeEnum } from '@/utils/constants'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const props = defineProps({
|
||||
appList: Object as any
|
||||
})
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
@@ -132,7 +146,8 @@ const formData = ref({
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
visible: true,
|
||||
keepAlive: true,
|
||||
alwaysShow: true
|
||||
alwaysShow: true,
|
||||
serviceId: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
|
||||
@@ -203,7 +218,7 @@ const submitForm = async () => {
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
// 清空,从而触发刷新
|
||||
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
cache.local.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +248,8 @@ const resetForm = () => {
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
visible: true,
|
||||
keepAlive: true,
|
||||
alwaysShow: true
|
||||
alwaysShow: true,
|
||||
serviceId: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
@@ -62,6 +62,11 @@
|
||||
<el-table-column :show-overflow-tooltip="true" label="组件路径" prop="component" />
|
||||
<el-table-column :show-overflow-tooltip="true" label="组件名称" prop="componentName" />
|
||||
<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="操作">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="openForm('update', scope.row.id)">
|
||||
@@ -77,14 +82,14 @@
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<MenuForm ref="formRef" @success="getList" />
|
||||
<MenuForm ref="formRef" :appList="appList" @success="getList" />
|
||||
</template>
|
||||
<script lang="ts" name="SystemMenu" setup>
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import * as MenuApi from '@/api/system/menu'
|
||||
import MenuForm from './MenuForm.vue'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache()
|
||||
import { CACHE_KEY } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -140,7 +145,7 @@ const refreshMenu = async () => {
|
||||
try {
|
||||
await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存')
|
||||
// 清空,从而触发刷新
|
||||
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
cache.local.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||
// 刷新浏览器
|
||||
location.reload()
|
||||
} catch {}
|
||||
@@ -160,8 +165,20 @@ const handleDelete = async (id: number) => {
|
||||
} 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(() => {
|
||||
getOptions()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
<el-col :span="20" :xs="24">
|
||||
<!-- 搜索 -->
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||
<el-form-item label="登录账号" prop="username">
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-input
|
||||
v-model="queryParams.username"
|
||||
placeholder="请输入登录账号"
|
||||
v-model="queryParams.nickname"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
@@ -118,6 +118,7 @@ const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
mobile: undefined,
|
||||
deptId: undefined
|
||||
})
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable>
|
||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable style="width: 120px">
|
||||
<el-option label="待审核" :value="1" />
|
||||
<el-option label="已撤销" :value="2" />
|
||||
<el-option label="已通过" :value="3" />
|
||||
@@ -16,7 +16,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.signUser"
|
||||
placeholder="登记人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -34,10 +40,17 @@
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.applyUser" placeholder="申请人" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.applyUser"
|
||||
placeholder="申请人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -55,12 +68,31 @@
|
||||
range-separator="-"
|
||||
start-placeholder="申请日期"
|
||||
end-placeholder="申请日期"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchAudit">批量审核</el-button>
|
||||
<el-date-picker
|
||||
v-model="searchForm.checkTime"
|
||||
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-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>
|
||||
|
||||
@@ -76,6 +108,8 @@
|
||||
<el-table-column prop="phone" 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="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="solution" label="解决方案" min-width="150px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
|
||||
@@ -92,10 +126,23 @@
|
||||
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 label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['clue:order:after-sale-detail']"
|
||||
@click="handleDetail(row.id)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -142,6 +189,7 @@ import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
||||
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const afterSaleAuditDialog = ref()
|
||||
@@ -159,6 +207,7 @@ const searchForm = ref({
|
||||
dealUser: undefined,
|
||||
createDate: [],
|
||||
createUser: undefined,
|
||||
checkTime: [],
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
@@ -182,6 +231,7 @@ function handleReset() {
|
||||
dealUser: undefined,
|
||||
createDate: [],
|
||||
createUser: undefined,
|
||||
checkTime: [],
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
@@ -191,7 +241,7 @@ const loading = ref(false)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await AfterSaleApi.getAfterSalePage(searchForm.value)
|
||||
const data = await AfterSaleApi.getAfterSalePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
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() // 消息弹窗
|
||||
@@ -155,7 +156,7 @@ const loading = ref(false)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await DeliveryApi.getDeliveryPage(searchForm.value)
|
||||
const data = await DeliveryApi.getDeliveryPage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="reason" label="售后原因" />
|
||||
<el-table-column prop="refundAmount" label="退款金额" />
|
||||
<el-table-column prop="percentageDeductAmount" label="提成扣款" />
|
||||
<el-table-column prop="isReturns" label="是否退货" />
|
||||
<el-table-column prop="applyTime" label="申请日期" width="180px" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
@@ -13,35 +14,61 @@
|
||||
<el-button v-show="showAdd" class="mb-10px" type="primary" @click="handleAdd">
|
||||
新增售后
|
||||
</el-button>
|
||||
<el-form v-if="!showAdd" :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="售后原因" prop="reason">
|
||||
<el-input v-model="form.reason" placeholder="请输入售后原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退款金额" prop="refundAmount">
|
||||
<el-input-number
|
||||
v-model="form.refundAmount"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
placeholder="请输入金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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-form-item label="解决方案" prop="solution">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 3 }"
|
||||
v-model="form.solution"
|
||||
placeholder="请输入退款原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
<el-form v-if="!showAdd" :model="form" ref="formRef" :rules="rules" label-width="auto">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="售后原因" prop="reason">
|
||||
<el-input v-model="form.reason" placeholder="请输入售后原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="退款金额" prop="refundAmount">
|
||||
<el-input-number
|
||||
v-model="form.refundAmount"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
placeholder="请输入金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="提成扣款金额" prop="percentageDeductAmount">
|
||||
<el-input-number
|
||||
v-model="form.percentageDeductAmount"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
placeholder="请输入金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</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-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button @click="showAdd = true">取消</el-button>
|
||||
@@ -72,7 +99,8 @@ function open(signId) {
|
||||
const showAdd = ref(true)
|
||||
const form = ref({})
|
||||
const rules = {
|
||||
refundAmount: { required: true, message: '回款金额不可为空', trigger: 'blur' },
|
||||
percentageDeductAmount: { required: true, message: '提成扣款金额不可为空', trigger: 'blur' },
|
||||
refundAmount: { required: true, message: '退款金额不可为空', trigger: 'blur' },
|
||||
reason: { required: true, message: '售后原因不可为空', trigger: 'blur' },
|
||||
solution: { required: true, message: '解决方案不可为空', trigger: 'blur' }
|
||||
}
|
||||
@@ -91,6 +119,7 @@ function handleAdd() {
|
||||
solution: undefined,
|
||||
refundAmount: undefined,
|
||||
isReturns: false,
|
||||
percentageDeductAmount: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,39 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<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-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
</el-form-item>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:rules="ruels"
|
||||
:model="formData"
|
||||
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>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -20,6 +43,7 @@
|
||||
</template>
|
||||
<script name="DialogAfterSaleAudit" setup>
|
||||
import { auditAfterSale } from '@/api/clue/afterSale'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -63,6 +87,16 @@ const schema = [
|
||||
label: '退款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'percentageDeductAmount',
|
||||
label: '提成扣款',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isCompanyReceipts',
|
||||
label: '是否公司收款',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isReturns',
|
||||
label: '是否退货',
|
||||
@@ -94,6 +128,10 @@ const formData = ref({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const ruels = {
|
||||
checkTime: { required: true, message: '审核日期不可为空', trigger: 'blur,change' }
|
||||
}
|
||||
|
||||
const orderInfo = ref({})
|
||||
/** 打开弹窗 */
|
||||
const open = async (row) => {
|
||||
@@ -130,6 +168,7 @@ const resetForm = (signId) => {
|
||||
formData.value = {
|
||||
saleId: signId,
|
||||
state: 3,
|
||||
checkTime: formatDate(new Date()),
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
||||
@@ -54,6 +54,16 @@ const applySchema = [
|
||||
label: '退款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'percentageDeductAmount',
|
||||
label: '提成扣款',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isCompanyReceipts',
|
||||
label: '是否公司收款',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isReturns',
|
||||
label: '是否退货',
|
||||
|
||||
@@ -1,15 +1,38 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<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-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
</el-form-item>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:rules="ruels"
|
||||
:model="formData"
|
||||
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>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -20,6 +43,7 @@
|
||||
<script name="DialogAfterSaleAudit" setup>
|
||||
import { batchAuditAfterSale } from '@/api/clue/afterSale'
|
||||
import { batchAuditPayment } from '@/api/clue/payment'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -32,6 +56,10 @@ const formData = ref({
|
||||
remark: ''
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const ruels = {
|
||||
checkTime: { required: true, message: '审核日期不可为空', trigger: 'blur,change' }
|
||||
}
|
||||
|
||||
const formType = ref('aftersale')
|
||||
const titleMap = {
|
||||
aftersale: '批量售后审核',
|
||||
@@ -79,6 +107,7 @@ const resetForm = (ids) => {
|
||||
formData.value = {
|
||||
payIds: ids,
|
||||
saleIds: ids,
|
||||
checkTime: formatDate(new Date()),
|
||||
state: 3,
|
||||
remark: ''
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ async function onSubmit() {
|
||||
warehouseId: form.value.warehouseId
|
||||
}
|
||||
} else {
|
||||
params.detailList = inventoryList.value
|
||||
params.detailList = deliveryArr.value
|
||||
}
|
||||
|
||||
await createDelivery(params)
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in extraPayOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.id"
|
||||
:label="item.extraPayName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@@ -73,9 +73,9 @@
|
||||
|
||||
<script setup name="DialogExtraPay">
|
||||
import { signAddPay, getSignExtraPayList } from '@/api/clue/sign'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import * as ExtraFeeApi from '@/api/clue/extraFee'
|
||||
|
||||
const extraPayOptions = getDictOptions('extra_pay_type')
|
||||
const extraPayOptions = ref([])
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
@@ -83,6 +83,7 @@ function open(id) {
|
||||
show.value = true
|
||||
resetForm(id)
|
||||
getFormList()
|
||||
getOptions()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
@@ -135,6 +136,12 @@ async function onSubmit() {
|
||||
function handleRemove(type, index) {
|
||||
form.value[type].splice(index, 1)
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
ExtraFeeApi.getExtraFeeSimpleList().then((data) => {
|
||||
extraPayOptions.value = data
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,16 +1,44 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<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-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
</el-form-item>
|
||||
<el-table :data="followList" size="small" border class="mt-10px mb-10px">
|
||||
<el-table-column prop="userName" label="跟进人" />
|
||||
<el-table-column prop="followTime" label="最新跟进时间" :formatter="dateFormatter" />
|
||||
<el-table-column prop="signSate" label="成交状态" />
|
||||
</el-table>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="ruels"
|
||||
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>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -19,8 +47,10 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogFeebackAudit" setup>
|
||||
import { auditPayment } from '@/api/clue/payment'
|
||||
|
||||
import { getFollowUserList } from '@/api/clue'
|
||||
import { auditPayment, getPaymentDetail } from '@/api/clue/payment'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import {} from '@/utils/formatTime'
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
@@ -82,6 +112,11 @@ const formData = ref({
|
||||
state: 3,
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const ruels = {
|
||||
checkTime: { required: true, message: '审核日期不可为空', trigger: 'blur,change' }
|
||||
}
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const orderInfo = ref({})
|
||||
@@ -90,8 +125,10 @@ const open = async (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '回款审核'
|
||||
resetForm(row.id)
|
||||
// 修改时,设置数据
|
||||
orderInfo.value = { ...row }
|
||||
// 设置数据
|
||||
orderInfo.value = await getPaymentDetail({ id: row.id })
|
||||
// 获取跟进信息
|
||||
getFollowInfo(row.clueId)
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
@@ -120,8 +157,17 @@ const resetForm = (signId) => {
|
||||
formData.value = {
|
||||
payId: signId,
|
||||
state: 3,
|
||||
checkTime: formatDate(new Date()),
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
const followList = ref([])
|
||||
|
||||
function getFollowInfo(id) {
|
||||
getFollowUserList({ id }).then((data) => {
|
||||
followList.value = data
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
:columns="2"
|
||||
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
|
||||
title="审核详情"
|
||||
:data="orderInfo"
|
||||
@@ -18,110 +23,40 @@
|
||||
</template>
|
||||
<script name="DialogFeebackDetail" setup>
|
||||
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 dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const applySchema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
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 applySchema = computed(() => {
|
||||
return appStore.getAppInfo?.instanceType == 1 ? schoolApplySchema : mallApplySchema
|
||||
})
|
||||
|
||||
const orderInfo = ref({})
|
||||
/** 打开弹窗 */
|
||||
const open = async (id) => {
|
||||
const open = async (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '回款申请详情'
|
||||
try {
|
||||
orderInfo.value = await getPaymentDetail({ id })
|
||||
orderInfo.value = await getPaymentDetail({ id: row.id })
|
||||
getFollowInfo(row.clueId)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const followList = ref([])
|
||||
|
||||
function getFollowInfo(id) {
|
||||
getFollowUserList({ id }).then((data) => {
|
||||
followList.value = data
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<Dialog title="成交详情" v-model="show" width="800px">
|
||||
<el-tabs v-model="tabName">
|
||||
<el-tab-pane label="线索信息" name="clueInfo">
|
||||
<el-tab-pane label="线索信息" name="clueInfo" v-if="checkPermi(['clue:pool:detail'])">
|
||||
<Descriptions :data="clueInfo" :schema="clueSchema" :columns="2" labelWidth="130px" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="成交信息" name="orderInfo">
|
||||
@@ -61,7 +61,11 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回款记录" name="returnRecord">
|
||||
<el-tab-pane
|
||||
label="回款记录"
|
||||
name="returnRecord"
|
||||
v-if="checkPermi(['clue:order:return-list'])"
|
||||
>
|
||||
<el-table :data="returnRecordList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="money" label="回款金额" />
|
||||
@@ -70,7 +74,11 @@
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="售后记录" name="afterSale">
|
||||
<el-tab-pane
|
||||
label="售后记录"
|
||||
name="afterSale"
|
||||
v-if="checkPermi(['clue:order:after-sale-list'])"
|
||||
>
|
||||
<el-table :data="aftersaleList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="reason" label="售后原因" />
|
||||
|
||||
@@ -52,6 +52,13 @@
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </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>
|
||||
</Search>
|
||||
</div>
|
||||
@@ -61,49 +68,89 @@
|
||||
class="mt-10px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
rowkey="signId"
|
||||
:expandRowKeys="expendRows"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" />
|
||||
<el-table-column type="expand">
|
||||
<template #default="{ row }">
|
||||
<div class="p-10px flex justify-center">
|
||||
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" width="100px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" />
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px" />
|
||||
<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
|
||||
target="tbody"
|
||||
v-model="row.signProducts"
|
||||
:animation="150"
|
||||
@end="onDragEnd"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table
|
||||
:data="row.signProducts"
|
||||
row-key="id"
|
||||
stripe
|
||||
style="width: 80%; margin: 0 auto"
|
||||
>
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" width="100px" />
|
||||
<el-table-column label="生产状态" width="160px">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isProduced"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="已生产"
|
||||
inactive-text="待生产"
|
||||
:disabled="!checkPermi(['clue:order:update-produce'])"
|
||||
size="small"
|
||||
@change="handleChangeProdoce(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="scope.row.sendState == '待发货' ? 'danger' : 'success'"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.sendState }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.sendRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
:disabled="scope.row.sendState == '已发货'"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
@click="handleDelivery(scope.row)"
|
||||
>
|
||||
发货
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</VueDraggable>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -115,17 +162,14 @@
|
||||
min-width="120px"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="item.field == 'remark' && row.remark"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
<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>
|
||||
@@ -200,7 +244,7 @@
|
||||
<script setup name="ClueOrderList">
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
@@ -211,13 +255,13 @@ import DialogDelivery from './DialogDelivery.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { ElMessageBox, ElOption, ElSelect } from 'element-plus'
|
||||
import { VueDraggable } from 'vue-draggable-plus'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
@@ -286,8 +330,10 @@ async function getCurdSchemas() {
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
data.forEach((elem) => {
|
||||
if (elem.field == 'createUser') {
|
||||
if (['createUser'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
} else if (['convertPeople', 'receiver'].includes(elem.field)) {
|
||||
elem.search.options = allUserOptions.value
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
@@ -343,16 +389,110 @@ function handleAddFee(row) {
|
||||
extraFeeDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
async function getOptions() {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserList()
|
||||
getCurdSchemas()
|
||||
}
|
||||
const deliveryDialog = ref()
|
||||
function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.signId)
|
||||
}
|
||||
|
||||
const selectedValue = ref(undefined)
|
||||
const installOptions = [
|
||||
{ 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>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -2,22 +2,44 @@
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
<el-input
|
||||
v-model="searchForm.signId"
|
||||
placeholder="成交单号"
|
||||
clearable
|
||||
style="width: 120px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
<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 />
|
||||
<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>
|
||||
<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>
|
||||
<el-select
|
||||
v-model="searchForm.signUser"
|
||||
placeholder="登记人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -35,6 +57,19 @@
|
||||
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>
|
||||
@@ -44,6 +79,7 @@
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.signSpecs = undefined"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prodOptions"
|
||||
@@ -60,6 +96,7 @@
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.signProduct)"
|
||||
@@ -70,7 +107,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.supplier" placeholder="选择供应商" filterable clearable>
|
||||
<el-select
|
||||
v-model="searchForm.supplier"
|
||||
placeholder="选择供应商"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.value"
|
||||
@@ -87,9 +130,11 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchSettle">批量结算</el-button>
|
||||
<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>
|
||||
|
||||
@@ -112,6 +157,12 @@
|
||||
<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="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<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" />
|
||||
@@ -136,6 +187,7 @@
|
||||
/>
|
||||
<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">
|
||||
@@ -196,6 +248,7 @@ const searchForm = ref({
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
createDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
@@ -212,6 +265,7 @@ function handleReset() {
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
createDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
|
||||
@@ -89,17 +89,14 @@
|
||||
min-width="120px"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="500px"
|
||||
trigger="click"
|
||||
v-if="item.form?.component == 'Editor' && row[item.field]"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
<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>
|
||||
@@ -174,7 +171,7 @@
|
||||
<script setup name="ClueOrderList">
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
|
||||
@@ -187,11 +184,8 @@ import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
@@ -260,8 +254,10 @@ async function getCurdSchemas() {
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
data.forEach((elem) => {
|
||||
if (elem.field == 'createUser') {
|
||||
if (['createUser'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
} else if (['convertPeople', 'receiver'].includes(elem.field)) {
|
||||
elem.search.options = allUserOptions.value
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
@@ -333,12 +329,15 @@ async function getClassTypeOptions() {
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
async function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserList()
|
||||
getCurdSchemas()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,15 +8,53 @@
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable>
|
||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable style="width: 120px">
|
||||
<el-option label="待审核" :value="1" />
|
||||
<el-option label="已撤销" :value="2" />
|
||||
<el-option label="已通过" :value="3" />
|
||||
<el-option label="已驳回" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-select
|
||||
v-model="searchForm.receiver"
|
||||
placeholder="接待人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in allUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.signUser"
|
||||
placeholder="登记人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -34,10 +72,17 @@
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.applyUser" placeholder="申请人" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.applyUser"
|
||||
placeholder="申请人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -55,12 +100,27 @@
|
||||
range-separator="-"
|
||||
start-placeholder="申请日期"
|
||||
end-placeholder="申请日期"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchAudit">批量审核</el-button>
|
||||
<el-date-picker
|
||||
v-model="searchForm.checkTime"
|
||||
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-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>
|
||||
|
||||
@@ -68,14 +128,77 @@
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
||||
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
||||
<el-table-column prop="money" label="回款金额" min-width="90" />
|
||||
<el-table-column type="selection" width="60" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="180px" />
|
||||
<el-table-column prop="name" label="线索名称" width="150px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />companyProfit
|
||||
<el-table-column prop="money" label="回款金额" min-width="120px">
|
||||
<template #default="{ row }">
|
||||
<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" />
|
||||
<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 prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
@@ -90,10 +213,23 @@
|
||||
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="90" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<el-table-column label="操作" width="220px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['clue:order:return-detail']"
|
||||
@click="handleDetail(row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -106,6 +242,16 @@
|
||||
>
|
||||
撤销
|
||||
</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
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
@@ -134,17 +280,20 @@
|
||||
|
||||
<script setup name="Reback">
|
||||
import * as FeebackApi from '@/api/clue/payment'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
||||
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
const appStore = useAppStore()
|
||||
|
||||
const feebackDialog = ref()
|
||||
|
||||
@@ -158,11 +307,13 @@ const searchForm = ref({
|
||||
signUser: undefined,
|
||||
applyTime: [],
|
||||
applyUser: undefined,
|
||||
checkTime: [],
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
@@ -175,24 +326,29 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
signId: undefined,
|
||||
receiver: undefined,
|
||||
convertPeople: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
state: undefined,
|
||||
signUser: undefined,
|
||||
applyTime: [],
|
||||
applyUser: undefined,
|
||||
checkTime: [],
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
|
||||
const totalInfo = ref({})
|
||||
const loading = ref(false)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await FeebackApi.getPaymentPage(searchForm.value)
|
||||
const data = await FeebackApi.getPaymentPage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
totalInfo.value = data.totalData
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -213,8 +369,8 @@ function batchAudit() {
|
||||
}
|
||||
|
||||
const feebackDetailDialog = ref()
|
||||
function handleDetail(id) {
|
||||
feebackDetailDialog.value.open(id)
|
||||
function handleDetail(row) {
|
||||
feebackDetailDialog.value.open(row)
|
||||
}
|
||||
async function handleCancel(id) {
|
||||
try {
|
||||
@@ -237,6 +393,53 @@ function getOptions() {
|
||||
getUserOption().then((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
|
||||
})
|
||||
.then(() => {
|
||||
message.success('修改成功')
|
||||
})
|
||||
.finally(() => {
|
||||
row.edit = false
|
||||
})
|
||||
} else {
|
||||
row.edit = true
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -2,22 +2,44 @@
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
<el-input
|
||||
v-model="searchForm.signId"
|
||||
placeholder="成交单号"
|
||||
clearable
|
||||
style="width: 120px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
<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 />
|
||||
<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>
|
||||
<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>
|
||||
<el-select
|
||||
v-model="searchForm.signUser"
|
||||
placeholder="登记人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
@@ -35,6 +57,19 @@
|
||||
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>
|
||||
@@ -44,6 +79,7 @@
|
||||
filterable
|
||||
clearable
|
||||
@change="changeSchool"
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in schoolOptions"
|
||||
@@ -61,6 +97,7 @@
|
||||
clearable
|
||||
:disabled="!searchForm.signSchool"
|
||||
@change="changePlace"
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in placeOptions"
|
||||
@@ -77,6 +114,7 @@
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
@@ -93,9 +131,11 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchSettle">批量结算</el-button>
|
||||
<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>
|
||||
|
||||
@@ -118,6 +158,12 @@
|
||||
<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="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<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" />
|
||||
@@ -142,6 +188,7 @@
|
||||
/>
|
||||
<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">
|
||||
@@ -203,6 +250,7 @@ const searchForm = ref({
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
createDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
@@ -219,6 +267,7 @@ function handleReset() {
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
createDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
@@ -239,16 +288,14 @@ const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const totalNum = ref(0)
|
||||
const totalAmount = 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
|
||||
totalNum.value = data.totalNum
|
||||
totalAmount.value = data.totalAmount
|
||||
totalInfo.value = data.totalData
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -261,9 +308,9 @@ function getSummaries(param) {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
} else if (column.property == 'settlementNum') {
|
||||
sums[index] = totalNum.value
|
||||
sums[index] = totalInfo.value.totalNum
|
||||
} else if (column.property == 'settlementMoney') {
|
||||
sums[index] = totalAmount.value
|
||||
sums[index] = totalInfo.value.totalAmount
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
|
||||
150
src/views/Clue/Order/Comp/feedbackSchema.js
Normal file
150
src/views/Clue/Order/Comp/feedbackSchema.js
Normal file
@@ -0,0 +1,150 @@
|
||||
export const schoolApplySchema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
label: '回款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signPrice',
|
||||
label: '成交价',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'companyProfit',
|
||||
label: '公司利润',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'personProfit',
|
||||
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
|
||||
}
|
||||
]
|
||||
|
||||
export const mallApplySchema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
label: '回款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signPrice',
|
||||
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
|
||||
}
|
||||
]
|
||||
|
||||
export 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
|
||||
}
|
||||
]
|
||||
|
||||
export const cancelSchema = [
|
||||
{
|
||||
field: 'stateName',
|
||||
label: '审核状态',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'revokeTime',
|
||||
label: '撤销时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
}
|
||||
]
|
||||
@@ -1,21 +1,29 @@
|
||||
<template>
|
||||
<el-tabs v-model="tabName">
|
||||
<el-tab-pane label="成交列表" name="list">
|
||||
<el-tab-pane label="成交列表" name="list" v-if="checkPermi(['clue:order:order-list'])">
|
||||
<template v-if="tabName == 'list'">
|
||||
<OrderList v-if="appStore.getAppInfo?.instanceType == 1" />
|
||||
<MallOrderList v-else-if="appStore.getAppInfo?.instanceType == 2" />
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回款申请" name="commission">
|
||||
<el-tab-pane label="回款申请" name="commission" v-if="checkPermi(['clue:order:return-list'])">
|
||||
<Reback v-if="tabName == 'commission'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="售后申请" name="aftersale">
|
||||
<el-tab-pane
|
||||
label="售后申请"
|
||||
name="aftersale"
|
||||
v-if="checkPermi(['clue:order:after-sale-list'])"
|
||||
>
|
||||
<AfterSales v-if="tabName == 'aftersale'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货列表" name="delivery" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-tab-pane
|
||||
label="发货列表"
|
||||
name="delivery"
|
||||
v-if="appStore.getAppInfo?.instanceType == 2 && checkPermi(['clue:order:delivery-list'])"
|
||||
>
|
||||
<Delivery v-if="tabName == 'delivery'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="对外结算" name="settle" v-if="checkPermi(['clue:order:settle'])">
|
||||
<el-tab-pane label="对外结算" name="settle" v-if="checkPermi(['clue:order:settle-list'])">
|
||||
<Settle v-if="tabName == 'settle'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
<script setup name="ClueMap">
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getConfigByConfigKey } from '@/api/system/set'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
@@ -69,9 +70,17 @@ const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
})
|
||||
const defaultCity = ref('合肥')
|
||||
|
||||
let AutoComplete = ref(null)
|
||||
function initMap() {
|
||||
async function initMap() {
|
||||
const data = await getConfigByConfigKey({ configKey: 'defaultLocation' })
|
||||
const cityInfo = JSON.parse(data.configValue)
|
||||
defaultLatLng.value = {
|
||||
lat: cityInfo.lat,
|
||||
lng: cityInfo.lng
|
||||
}
|
||||
defaultCity.value = cityInfo.locationName
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
version: '2.0',
|
||||
@@ -79,7 +88,7 @@ function initMap() {
|
||||
}).then((AMap) => {
|
||||
aMap.value = AMap
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '合肥'
|
||||
city: defaultCity.value
|
||||
})
|
||||
clueMap.value = new AMap.Map('mapClue', {
|
||||
zoom: 14,
|
||||
|
||||
98
src/views/Clue/Pool/Comp/DialogBatchChangeFollow.vue
Normal file
98
src/views/Clue/Pool/Comp/DialogBatchChangeFollow.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<Dialog title="批量修改跟进人" v-model="show" width="400px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto">
|
||||
<el-form-item label="修改线索数">
|
||||
{{ form.clueIdList.length }}
|
||||
</el-form-item>
|
||||
<el-form-item label="原跟进人" prop="originFollowUserId">
|
||||
<el-select v-model="form.originFollowUserId" placeholder="原跟进人" filterable>
|
||||
<el-option
|
||||
v-for="item in props.userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="新跟进人" prop="newFollowUserId">
|
||||
<el-select v-model="form.newFollowUserId" placeholder="新跟进人" filterable>
|
||||
<el-option
|
||||
v-for="item in props.userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogBatchChangeFollow">
|
||||
import { batchUpdateFollowUser } from '@/api/clue'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const props = defineProps({
|
||||
userOptions: {
|
||||
type: Array
|
||||
}
|
||||
})
|
||||
|
||||
const show = ref(false)
|
||||
const form = ref({
|
||||
clueIdList: [],
|
||||
originFollowUserId: undefined,
|
||||
newFollowUserId: undefined
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
originFollowUserId: { required: true, message: '原跟进人不可为空', trigger: 'change' },
|
||||
newFollowUserId: { required: true, message: '新跟进人不可为空', trigger: 'change' }
|
||||
})
|
||||
|
||||
function open(clueIdList) {
|
||||
resetForm(clueIdList)
|
||||
show.value = true
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
function resetForm(clueIdList) {
|
||||
form.value = {
|
||||
clueIdList,
|
||||
originFollowUserId: undefined,
|
||||
newFollowUserId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const formLoading = ref(false)
|
||||
const emit = defineEmits(['success'])
|
||||
const formRef = ref()
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await batchUpdateFollowUser(form.value)
|
||||
message.success('修改成功!')
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap">
|
||||
<template #btn>
|
||||
<el-button class="mr-20px" type="primary" size="small" @click="handleSave">保存</el-button>
|
||||
</template>
|
||||
<el-tabs v-model="tabName" @tab-change="changeTab">
|
||||
<el-tab-pane label="线索信息" name="info">
|
||||
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
||||
@@ -30,7 +33,7 @@
|
||||
v-model="row.nextFollowTime"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
:disabled="!row.editable"
|
||||
:disabled="row.userId != useUserStore().getUser.id"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
@@ -44,7 +47,7 @@
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 2 }"
|
||||
placeholder="输入跟进内容"
|
||||
:disabled="!row.editable"
|
||||
:disabled="row.userId != useUserStore().getUser.id"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -118,10 +121,10 @@
|
||||
</el-collapse>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="position: absolute; top: 75px; right: 20px">
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
</Dialog>
|
||||
</template>
|
||||
@@ -130,6 +133,7 @@
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getConfigByConfigKey } from '@/api/system/set'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -154,6 +158,9 @@ const props = defineProps({
|
||||
},
|
||||
userOptions: {
|
||||
type: Array
|
||||
},
|
||||
allUserOptions: {
|
||||
type: Array
|
||||
}
|
||||
})
|
||||
|
||||
@@ -162,6 +169,14 @@ const formSchema = computed(() => {
|
||||
newSchema.forEach((it) => {
|
||||
if (it.field == 'consultTime') {
|
||||
it.componentProps['disabled-date'] = dateAfterToday
|
||||
// it.componentProps['disabled'] = formType.value != 'create'
|
||||
it.componentProps['disabled'] = true
|
||||
}
|
||||
// else if (it.field == 'convertPeople' && formType.value == 'update') {
|
||||
// it.componentProps['disabled'] = true
|
||||
// }
|
||||
if (it.field == 'convertPeople') {
|
||||
it.options = props.allUserOptions.map((it) => ({ ...it, name: it.nickname }))
|
||||
}
|
||||
})
|
||||
return [
|
||||
@@ -188,6 +203,20 @@ const formSchema = computed(() => {
|
||||
]
|
||||
})
|
||||
|
||||
const rules = computed(() => {
|
||||
let ruleObj = {}
|
||||
props.schema.map((it) => {
|
||||
if (it.isRequired) {
|
||||
Reflect.set(ruleObj, it.field, {
|
||||
required: true,
|
||||
message: `${it.label}不可为空`,
|
||||
trigger: 'blur, change'
|
||||
})
|
||||
}
|
||||
})
|
||||
return ruleObj
|
||||
})
|
||||
|
||||
const dateAfterToday = (t) => {
|
||||
return t.getTime() > Date.now()
|
||||
}
|
||||
@@ -198,14 +227,6 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const rules = {
|
||||
name: { required: true, message: '线索名称不可为空', trigger: 'blur' },
|
||||
phone: { required: true, message: '联系方式不可为空', trigger: 'blur' },
|
||||
source: { required: true, message: '线索来源不可为空', trigger: 'change' },
|
||||
intentionState: { required: true, message: '意向状态不可为空', trigger: 'change' },
|
||||
consultTime: { required: true, message: '咨询日期不可为空', trigger: 'change' }
|
||||
}
|
||||
|
||||
const tabName = ref('info')
|
||||
|
||||
const followList = ref([])
|
||||
@@ -216,6 +237,7 @@ const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
})
|
||||
const defaultCity = ref('合肥')
|
||||
const info = ref({})
|
||||
|
||||
const diyFieldArr = ref([])
|
||||
@@ -255,9 +277,14 @@ const open = async (type, id) => {
|
||||
}
|
||||
]
|
||||
address.value = ''
|
||||
defaultLatLng.value = {
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
const data = await getConfigByConfigKey({ configKey: 'defaultLocation' })
|
||||
const cityInfo = JSON.parse(data.configValue)
|
||||
defaultLatLng.value = {
|
||||
lat: cityInfo.lat,
|
||||
lng: cityInfo.lng
|
||||
}
|
||||
defaultCity.value = cityInfo.locationName
|
||||
}
|
||||
nextTick(() => {
|
||||
formRef.value.setValues(info.value, true)
|
||||
@@ -337,8 +364,8 @@ async function handleSave() {
|
||||
const data = await ClueApi.createClue(params)
|
||||
message.success(data)
|
||||
} else {
|
||||
const data = await ClueApi.updateClue(params)
|
||||
message.success(data)
|
||||
await ClueApi.updateClue(params)
|
||||
message.success('修改成功')
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
@@ -386,7 +413,7 @@ function initMap(data) {
|
||||
})
|
||||
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '合肥'
|
||||
city: defaultCity.value
|
||||
})
|
||||
geoCoder.value = new AMap.Geocoder()
|
||||
dialogMap.value.on('click', (e) => {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1000px">
|
||||
<template #btn>
|
||||
<el-button class="mr-20px" type="primary" size="small" @click="handleSave">保存</el-button>
|
||||
</template>
|
||||
<div class="flex">
|
||||
<el-form style="flex: 1" :model="form" ref="formRef" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<Dialog title="成交登记" v-model="show" width="900px">
|
||||
<template #btn>
|
||||
<el-button class="mr-20px" type="primary" size="small" @click="handleSave">保存</el-button>
|
||||
</template>
|
||||
<Descriptions
|
||||
:title="`线索信息-${info.name}`"
|
||||
:data="info"
|
||||
@@ -8,7 +11,7 @@
|
||||
labelWidth="130px"
|
||||
:defaultShow="false"
|
||||
/>
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="100px" class="mt-20px">
|
||||
<el-row :gutter="20">
|
||||
<!-- 驾校招生模式 -->
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
@@ -78,9 +81,20 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交价" prop="signPrice">
|
||||
<el-input-number
|
||||
v-model="form.signPrice"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
:controls="false"
|
||||
@change="signPriceChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.state">
|
||||
<el-radio-group v-model="form.isPayoff">
|
||||
<el-radio :label="true"> 全款 </el-radio>
|
||||
<el-radio :label="false"> 非全款 </el-radio>
|
||||
</el-radio-group>
|
||||
@@ -88,7 +102,12 @@
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="支付金额" prop="payAmount">
|
||||
<el-input-number v-model="form.payAmount" :min="1" :step="1" style="width: 100%" />
|
||||
<el-input-number
|
||||
v-model="form.payAmount"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
:controls="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
@@ -99,8 +118,33 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="接待人" prop="receiver">
|
||||
<el-select v-model="form.receiver" placeholder="选择接待人" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in allUserOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="安装状态" prop="installStatus">
|
||||
<el-select v-model="form.installStatus">
|
||||
<el-option label="待安装" :value="1" />
|
||||
<el-option label="已安装" :value="2" />
|
||||
<el-option label="无需安装" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col
|
||||
:span="8"
|
||||
:span="fieldItem.component == 'Editor' ? 24 : 8"
|
||||
:offset="0"
|
||||
v-for="fieldItem in diyFieldList"
|
||||
:key="fieldItem.clueParamId"
|
||||
@@ -297,6 +341,9 @@ import { getDiyFieldList } from '@/api/clue/orderField'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import { getConfigByConfigKey } from '@/api/system/set'
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
|
||||
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
@@ -305,10 +352,6 @@ import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const show = ref(false)
|
||||
const form = ref({})
|
||||
const rules = ref({
|
||||
dealDate: { required: true, message: '成交日期不可为空', trigger: 'change' },
|
||||
payAmount: { required: true, message: '支付金额不可为空', trigger: 'change,blur' }
|
||||
})
|
||||
|
||||
const schoolRules = {
|
||||
signSchool: { required: true, message: '成交驾校不可为空', trigger: 'change' },
|
||||
@@ -325,6 +368,9 @@ const message = useMessage() // 消息弹窗
|
||||
const props = defineProps({
|
||||
schema: {
|
||||
type: Array
|
||||
},
|
||||
allUserOptions: {
|
||||
type: Array
|
||||
}
|
||||
})
|
||||
|
||||
@@ -365,11 +411,29 @@ const showSchema = computed(() => {
|
||||
return [...list, ...arr]
|
||||
})
|
||||
|
||||
// const rules = computed(() => {
|
||||
// let ruleObj = {}
|
||||
// props.schema.map((it) => {
|
||||
// if (it.isRequired) {
|
||||
// Reflect.set(ruleObj, it.field, {
|
||||
// required: true,
|
||||
// message: `${it.label}不可为空`,
|
||||
// trigger: 'blur, change'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// ruleObj = { ...ruleObj, ...schoolRules }
|
||||
// }
|
||||
// return ruleObj
|
||||
// })
|
||||
|
||||
const extraPayOptions = getDictOptions('other_pay_type')
|
||||
|
||||
async function open(id) {
|
||||
try {
|
||||
resetForm(id)
|
||||
getDiyFields()
|
||||
const data = await ClueApi.getClue(id)
|
||||
info.value = { ...data, ...data.diyParams }
|
||||
show.value = true
|
||||
@@ -379,16 +443,40 @@ async function open(id) {
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
function resetForm(id) {
|
||||
const rules = ref([])
|
||||
function getDiyFields() {
|
||||
getSimpleFieldList().then((data) => {
|
||||
let ruleObj = {}
|
||||
data.map((it) => {
|
||||
if (it.isRequired) {
|
||||
Reflect.set(ruleObj, it.field, {
|
||||
required: true,
|
||||
message: `${it.label}不可为空`,
|
||||
trigger: 'blur, change'
|
||||
})
|
||||
}
|
||||
})
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
ruleObj = { ...ruleObj, ...schoolRules }
|
||||
}
|
||||
rules.value = ruleObj
|
||||
})
|
||||
}
|
||||
|
||||
async function resetForm(id) {
|
||||
const data = await getConfigByConfigKey({ configKey: 'companyCollectionConfig' })
|
||||
form.value = {
|
||||
clueId: id,
|
||||
dealDate: formatDate(new Date()),
|
||||
state: true,
|
||||
isPayoff: true,
|
||||
signPrice: 0,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||
isCompanyReceipts: data.configValue == 'true',
|
||||
receiver: undefined,
|
||||
extraPay: [],
|
||||
signProducts: []
|
||||
signProducts: [],
|
||||
installStatus: 3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,6 +565,7 @@ function getOptions() {
|
||||
// getSimpleWarehouseList().then((data) => {
|
||||
// warehouseOptions.value = data
|
||||
// })
|
||||
// 获取员工列表
|
||||
}
|
||||
|
||||
// 自定义参数
|
||||
@@ -496,8 +585,15 @@ function changePlace() {
|
||||
}
|
||||
|
||||
function changeClass() {
|
||||
form.value.payAmount =
|
||||
form.value.signPrice =
|
||||
classOptions.value.find((it) => it.typeId == form.value.signClass).guidingPrice || 0
|
||||
signPriceChange()
|
||||
}
|
||||
|
||||
function signPriceChange() {
|
||||
if (form.value.isPayoff) {
|
||||
form.value.payAmount = form.value.signPrice
|
||||
}
|
||||
}
|
||||
|
||||
function handleRemove(type, index) {
|
||||
@@ -505,9 +601,6 @@ function handleRemove(type, index) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
rules.value = { ...rules.value, ...schoolRules }
|
||||
}
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -16,13 +16,19 @@
|
||||
<div class="flex" style="align-items: center">
|
||||
<b class="mr-5px text-24px">{{ info.name }}</b>
|
||||
<div class="mr-5px text-16px">{{ info.phone }}</div>
|
||||
<el-tag type="success">{{ info.intentionState }}</el-tag>
|
||||
<el-tag type="success">{{ info.intentionStateName }}</el-tag>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" v-hasPermi="['clue:pool:update']" plain @click="handleUpdate">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button type="danger" v-hasPermi="['clue:pool:delete']" plain @click="handleRemove">
|
||||
<el-button
|
||||
type="danger"
|
||||
v-if="info.state != '成交'"
|
||||
v-hasPermi="['clue:pool:delete']"
|
||||
plain
|
||||
@click="handleRemove"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="2">
|
||||
<template #label>
|
||||
<Tooltip message="下次跟进时间在今日之前的未成交线索" />
|
||||
<Tooltip message="下次跟进时间在今日及之前的未成交线索" />
|
||||
<el-badge v-if="clueCount.followNum" :value="clueCount.followNum" :max="9999">
|
||||
<span class="ml-3px">待跟进</span>
|
||||
</el-badge>
|
||||
@@ -53,6 +53,12 @@
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
||||
<el-button
|
||||
@click="handleBatchChangeFollow"
|
||||
v-hasPermi="['clue:pool:batch-update-follow']"
|
||||
>
|
||||
批量修改跟进人
|
||||
</el-button>
|
||||
</template>
|
||||
</Search>
|
||||
<!-- 列表 -->
|
||||
@@ -63,7 +69,9 @@
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" />
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
@@ -159,6 +167,7 @@
|
||||
v-if="!loading"
|
||||
ref="formRef"
|
||||
:userOptions="userOptions"
|
||||
:allUserOptions="allUserOptions"
|
||||
:schema="allSchemas.formSchema"
|
||||
@success="getTableList"
|
||||
/>
|
||||
@@ -169,8 +178,19 @@
|
||||
@get-list="getTableList"
|
||||
@update="handleEdit"
|
||||
/>
|
||||
<DialogSuccess ref="successRef" :schema="allSchemas.detailSchema" @success="getTableList" />
|
||||
<DialogSuccess
|
||||
ref="successRef"
|
||||
:schema="allSchemas.detailSchema"
|
||||
:allUserOptions="allUserOptions"
|
||||
:userOptions="userOptions"
|
||||
@success="getTableList"
|
||||
/>
|
||||
<DialogFollow ref="followRef" @success="getTableList" />
|
||||
<DialogBatchChangeFollow
|
||||
ref="batchChangeFollowDialog"
|
||||
:userOptions="allStatusUserOptions"
|
||||
@success="getTableList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -182,7 +202,12 @@ import DrawerClue from './Comp/DrawerClue.vue'
|
||||
import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||
import DialogFollow from './Comp/DialogFollow.vue'
|
||||
import ClueMap from './Comp/ClueMap.vue'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import DialogBatchChangeFollow from './Comp/DialogBatchChangeFollow.vue'
|
||||
import {
|
||||
getSimpleUserList as getUserOption,
|
||||
getAllUserList,
|
||||
getAllUserListWithHire
|
||||
} from '@/api/system/user'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -209,8 +234,10 @@ async function getCurdSchemas() {
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
data.forEach((elem) => {
|
||||
if (elem.field == 'followUser') {
|
||||
if (['followUser', 'convertPeople'].includes(elem.field)) {
|
||||
elem.search.options = userOptions.value
|
||||
} else if (['firstFollowUser'].includes(elem.field)) {
|
||||
elem.search.options = allStatusUserOptions.value
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
@@ -288,6 +315,20 @@ function getSearchCount() {
|
||||
})
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.clueId)
|
||||
}
|
||||
|
||||
const batchChangeFollowDialog = ref()
|
||||
function handleBatchChangeFollow() {
|
||||
if (batchIds.value.length) {
|
||||
batchChangeFollowDialog.value.open(batchIds.value)
|
||||
} else {
|
||||
message.info('请选择表格中的数据!')
|
||||
}
|
||||
}
|
||||
|
||||
// 新增
|
||||
function handleInsert() {
|
||||
formRef.value.open('create', null)
|
||||
@@ -351,12 +392,14 @@ function handleGain(id) {
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
const allUserOptions = ref([])
|
||||
const allStatusUserOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
onMounted(async () => {
|
||||
userOptions.value = await getUserOption()
|
||||
allUserOptions.value = await getAllUserList()
|
||||
allStatusUserOptions.value = await getAllUserListWithHire()
|
||||
getCurdSchemas()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="支出项" prop="label">
|
||||
<el-input v-model="formData.label" placeholder="请输入支出项" />
|
||||
<el-form-item label="支出项" prop="extraPayName">
|
||||
<el-input v-model="formData.extraPayName" placeholder="请输入支出项" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否扣除提成" prop="isPercentage">
|
||||
<el-radio-group v-model="formData.isPercentage">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||
@@ -29,7 +35,8 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogExtraFee" setup>
|
||||
import * as dictApi from '@/api/system/dict/dict.data'
|
||||
import * as ExtraFeeApi from '@/api/clue/extraFee'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -38,12 +45,13 @@ const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
label: '',
|
||||
extraPayName: '',
|
||||
isPercentage: false,
|
||||
sort: 1,
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
label: [{ required: true, message: '支出项不能为空', trigger: 'blur' }]
|
||||
extraPayName: [{ required: true, message: '支出项不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
@@ -57,7 +65,7 @@ const open = async (type, id) => {
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await dictApi.getDictData(id)
|
||||
formData.value = await ExtraFeeApi.getExtraFee(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -75,14 +83,11 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (!formData.value.value) {
|
||||
formData.value.value = formData.value.label
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await dictApi.createDictData(formData.value)
|
||||
await ExtraFeeApi.createExtraFee(formData.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await dictApi.updateDictData(formData.value)
|
||||
await ExtraFeeApi.updateExtraFee(formData.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
@@ -96,10 +101,10 @@ const submitForm = async () => {
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
label: '',
|
||||
extraPayName: '',
|
||||
isPercentage: false,
|
||||
sort: 1,
|
||||
status: 0,
|
||||
dictType: 'extra_pay_type',
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.name"
|
||||
v-model="searchForm.extraPayName"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
@@ -16,7 +16,12 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column prop="label" label="支出项" />
|
||||
<el-table-column prop="extraPayName" label="支出项" />
|
||||
<el-table-column prop="isPercentage" label="是否扣除提成">
|
||||
<template #default="{ row }">
|
||||
{{ row.isPercentage ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" width="100px" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column
|
||||
@@ -27,22 +32,10 @@
|
||||
/>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!scope.row.editable"
|
||||
text
|
||||
@click="openForm('update', scope.row.id)"
|
||||
>
|
||||
<el-button type="primary" text @click="openForm('update', scope.row.id)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!scope.row.editable"
|
||||
text
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button type="danger" text @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -60,16 +53,16 @@
|
||||
<script setup name="ExtraFeeType">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import DialogExtraFee from './DialogExtraFee.vue'
|
||||
import * as dictApi from '@/api/system/dict/dict.data'
|
||||
import * as ExtraFeeApi from '@/api/clue/extraFee'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
label: '',
|
||||
extraPayName: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
dictType: 'extra_pay_type'
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
@@ -83,10 +76,9 @@ function handleQuery() {
|
||||
}
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
label: '',
|
||||
extraPayName: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
dictType: 'extra_pay_type'
|
||||
pageNo: 1
|
||||
}
|
||||
getList()
|
||||
}
|
||||
@@ -94,7 +86,7 @@ function resetQuery() {
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await dictApi.getDictDataPage(searchForm.value)
|
||||
const data = await ExtraFeeApi.getExtraFeePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -111,7 +103,7 @@ async function handleDelete(id) {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await dictApi.deleteDictData(id)
|
||||
await ExtraFeeApi.deleteExtraFee(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
|
||||
@@ -5,11 +5,16 @@
|
||||
<el-table :data="tableList" :row-class-name="setRowClass" @row-click="handleRowClick">
|
||||
<el-table-column prop="label" label="名称" />
|
||||
<el-table-column prop="field" label="属性编码" />
|
||||
<el-table-column prop="component" label="类型" width="200px">
|
||||
<el-table-column prop="component" label="类型">
|
||||
<template #default="{ row }">
|
||||
{{ typeOptions.find((it) => it.value == row.component).label }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否必填" width="80">
|
||||
<template #default="{ row }">
|
||||
{{ row.isRequired ? '必填' : '非必填' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="启用状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
@@ -43,6 +48,12 @@
|
||||
</template>
|
||||
<el-input v-model="form.field" placeholder="请输入属性编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否必填" prop="isRequired">
|
||||
<el-radio-group v-model="form.isRequired">
|
||||
<el-radio :label="true"> 必填 </el-radio>
|
||||
<el-radio :label="false"> 非必填 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性类型" prop="component">
|
||||
<el-select
|
||||
v-model="form.component"
|
||||
@@ -118,6 +129,7 @@ const form = ref({
|
||||
component: undefined,
|
||||
options: [],
|
||||
status: 0,
|
||||
isRequired: false,
|
||||
isCustom: true,
|
||||
isForm: true,
|
||||
isSearch: true,
|
||||
@@ -157,6 +169,7 @@ function handleInsert() {
|
||||
component: undefined,
|
||||
options: [],
|
||||
status: 0,
|
||||
isRequired: false,
|
||||
isCustom: true,
|
||||
isForm: true,
|
||||
isSearch: true,
|
||||
|
||||
@@ -5,11 +5,16 @@
|
||||
<el-table :data="tableList" :row-class-name="setRowClass" @row-click="handleRowClick">
|
||||
<el-table-column prop="label" label="名称" />
|
||||
<el-table-column prop="field" label="属性编码" />
|
||||
<el-table-column prop="component" label="类型" width="200px">
|
||||
<el-table-column prop="component" label="类型">
|
||||
<template #default="{ row }">
|
||||
{{ typeOptions.find((it) => it.value == row.component).label }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否必填" width="80">
|
||||
<template #default="{ row }">
|
||||
{{ row.isRequired ? '必填' : '非必填' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="启用状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
@@ -43,6 +48,12 @@
|
||||
</template>
|
||||
<el-input v-model="form.field" placeholder="请输入属性编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否必填" prop="isRequired">
|
||||
<el-radio-group v-model="form.isRequired">
|
||||
<el-radio :label="true"> 必填 </el-radio>
|
||||
<el-radio :label="false"> 非必填 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性类型" prop="component">
|
||||
<el-select
|
||||
v-model="form.component"
|
||||
@@ -118,6 +129,7 @@ const form = ref({
|
||||
component: undefined,
|
||||
options: [],
|
||||
status: 0,
|
||||
isRequired: false,
|
||||
isCustom: true,
|
||||
isForm: true,
|
||||
isSearch: true,
|
||||
@@ -157,6 +169,7 @@ function handleInsert() {
|
||||
component: undefined,
|
||||
options: [],
|
||||
status: 0,
|
||||
isRequired: false,
|
||||
isCustom: true,
|
||||
isForm: true,
|
||||
isSearch: true,
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
<script setup name="ClueSkill">
|
||||
import * as SkillApi from '@/api/clue/skill'
|
||||
import DialogSkill from './Comp/DialogSkill.vue'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const skillDialog = ref()
|
||||
|
||||
@@ -95,7 +96,7 @@ function handleQuery() {
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await SkillApi.getSkillPage(searchForm.value)
|
||||
const data = await SkillApi.getSkillPage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -108,7 +109,7 @@ function handleAdd() {
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
skillDialog.value.open('update', row.id)
|
||||
skillDialog.value.open('update', row.skillId)
|
||||
}
|
||||
|
||||
async function handleDelete(row) {
|
||||
|
||||
@@ -96,7 +96,7 @@ const chars = computed(() => {
|
||||
return text.slice(0, currentCharIndex.value)
|
||||
})
|
||||
|
||||
function init() {
|
||||
async function init() {
|
||||
const res = currentRoute.value?.query?.tenantId
|
||||
authUtil.setTenantId(res)
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitEmployeeForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<span>员工利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitEmployeeForm.profitRule.mark"
|
||||
size="small"
|
||||
@@ -257,7 +257,7 @@
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<span>,员工利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
@@ -474,12 +474,15 @@ const opts = ref({
|
||||
})
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type, id) => {
|
||||
const open = async (type, id, sp) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
|
||||
formType.value = type
|
||||
currentTab.value = 'base'
|
||||
resetForm()
|
||||
if (type == 'create' && sp && sp.length) {
|
||||
formData.value.schPlace = sp
|
||||
}
|
||||
if (!opts.value.length) {
|
||||
const arr = await ClassApi.getCommissionParams()
|
||||
arr.map((item) => {
|
||||
|
||||
@@ -47,20 +47,23 @@
|
||||
plain
|
||||
@click="handleOpenDialog('create', null)"
|
||||
v-hasPermi="['school:class:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="handleBatchDelete([])"
|
||||
v-hasPermi="['school:class:batch-delete']"
|
||||
>批量删除</el-button
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
@click="handleBatchStatus"
|
||||
v-hasPermi="['school:class:batch-status']"
|
||||
>批量启/停用</el-button
|
||||
>
|
||||
批量启/停用
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -235,7 +238,7 @@ async function getList() {
|
||||
|
||||
const ClassDialog = ref()
|
||||
function handleOpenDialog(type, id = null) {
|
||||
ClassDialog.value.open(type, id)
|
||||
ClassDialog.value.open(type, id, searchForm.value.schPlace)
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
|
||||
@@ -118,9 +118,9 @@
|
||||
<el-select v-model="placeForm.area" placeholder="请选择" clearable class="w-full">
|
||||
<el-option
|
||||
v-for="dict in areaOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -234,6 +234,7 @@
|
||||
|
||||
<script setup name="Place">
|
||||
import * as PlaceApi from '@/api/school/place'
|
||||
import { getAreaSimpleList } from '@/api/school/setting/area'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
@@ -593,8 +594,15 @@ function resetMarkers() {
|
||||
createMarkersInMap()
|
||||
}
|
||||
|
||||
function getDictOptions() {
|
||||
getAreaSimpleList().then((data) => {
|
||||
areaOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initMap()
|
||||
getDictOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
147
src/views/SchoolManagement/Set/Comp/DialogArea.vue
Normal file
147
src/views/SchoolManagement/Set/Comp/DialogArea.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="提成比例" prop="percentageRate">
|
||||
<el-input v-model="formData.percentageRate" placeholder="请输入比例">
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="director">
|
||||
<el-select
|
||||
v-model="formData.director"
|
||||
placeholder="选择负责人"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in employeeOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="开始负责时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="formData.remark"
|
||||
placeholder="请输入备注"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogArea" setup>
|
||||
import * as AreaApi from '@/api/school/setting/area'
|
||||
import { getSimpleUserList } from '@/api/system/user'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
name: undefined,
|
||||
percentageRate: undefined,
|
||||
director: undefined,
|
||||
startTime: undefined,
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const employeeOptions = ref([])
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type, id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type == 'update' ? '修改区域' : '新增区域'
|
||||
formType.value = type
|
||||
resetForm()
|
||||
getOptions()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await AreaApi.getArea(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (formType.value === 'create') {
|
||||
await AreaApi.createArea(formData.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await AreaApi.updateArea(formData.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
name: undefined,
|
||||
percentageRate: undefined,
|
||||
director: undefined,
|
||||
startTime: undefined,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
getSimpleUserList().then((data) => {
|
||||
employeeOptions.value = data
|
||||
})
|
||||
}
|
||||
</script>
|
||||
105
src/views/SchoolManagement/Set/Comp/SettingArea.vue
Normal file
105
src/views/SchoolManagement/Set/Comp/SettingArea.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="queryForm" :model="searchForm" label-width="0" inline @submit.prevent>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.name"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" @click="openForm('create', null)">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="percentageRate" label="提成比例(%)" />
|
||||
<el-table-column prop="directorName" label="负责人" />
|
||||
<el-table-column prop="startTime" label="开始负责时间" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text @click="openForm('update', row.id)"> 修改 </el-button>
|
||||
<el-button type="danger" text @click="handleDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
<DialogArea ref="areaDialog" @success="handleQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SettingArea">
|
||||
import * as AreaApi from '@/api/school/setting/area'
|
||||
import DialogArea from './DialogArea.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
name: '',
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
const tableList = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
function handleQuery() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
name: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
getList()
|
||||
}
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await AreaApi.getAreaPage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const areaDialog = ref()
|
||||
function openForm(type, id = null) {
|
||||
areaDialog.value.open(type, id)
|
||||
}
|
||||
|
||||
async function handleDelete(id) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await AreaApi.deleteArea(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -4,15 +4,16 @@
|
||||
<el-tab-pane label="驾照类型" :name="0" v-if="checkPermi(['school:setting:cartype'])">
|
||||
<SettingCartype v-if="tabIndex == 0" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="销售提成" :name="10" v-if="checkPermi(['basic:setting:comission'])">
|
||||
<BSSalerComission v-if="tabIndex == 10" />
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="区域" :name="10" v-if="checkPermi(['school:setting:area'])">
|
||||
<SettingArea v-if="tabIndex == 10" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SchoolSetting">
|
||||
import SettingCartype from './Comp/SettingCartype.vue'
|
||||
import SettingArea from './Comp/SettingArea.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const tabIndex = ref(0)
|
||||
|
||||
Reference in New Issue
Block a user