From feccb2a1fa7e8dc7d5dfc76c66524b5e7753e7ee Mon Sep 17 00:00:00 2001 From: qsh <> Date: Thu, 1 Aug 2024 16:03:54 +0800 Subject: [PATCH 1/3] tj --- src/views/Clue/Order/Comp/Reback.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/Clue/Order/Comp/Reback.vue b/src/views/Clue/Order/Comp/Reback.vue index 54d2a86..0c5dc14 100644 --- a/src/views/Clue/Order/Comp/Reback.vue +++ b/src/views/Clue/Order/Comp/Reback.vue @@ -370,7 +370,12 @@ async function handleUpdate(row) { // 删除的二次确认 await message.confirm('是否确认修改回款金额?') // 保存 - FeebackApi.updateApplyPayment({ id: row.id, money: row.money }) + FeebackApi.updateApplyPayment({ + id: row.id, + money: row.money, + companyProfit: row.companyProfit, + personProfit: row.personProfit + }) .then(() => { message.success('修改成功') }) From 605151c5c873ee208fe1e42f5c5ff545ffc45f8e Mon Sep 17 00:00:00 2001 From: qsh <> Date: Thu, 1 Aug 2024 18:41:37 +0800 Subject: [PATCH 2/3] sh --- src/App.vue | 6 +- src/config/axios/service.ts | 15 ++-- src/directives/permission/hasPermi.ts | 6 +- src/directives/permission/hasRole.ts | 6 +- src/layout/components/Setting/src/Setting.vue | 10 +-- .../components/UserInfo/src/UserInfo.vue | 7 +- src/permission.js | 80 +++++++++++-------- src/plugins/cache/index.js | 8 +- src/store/modules/app.ts | 29 ++++--- src/store/modules/dict.ts | 14 ++-- src/store/modules/permission.ts | 9 +-- src/store/modules/user.ts | 15 ++-- src/utils/auth.ts | 48 +++++------ src/utils/permission.ts | 9 +-- src/views/Basic/Menu/MenuForm.vue | 6 +- src/views/Basic/Menu/index.vue | 6 +- src/views/Login/Login.vue | 2 +- 17 files changed, 141 insertions(+), 135 deletions(-) diff --git a/src/App.vue b/src/App.vue index f75478c..97cdad3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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() } diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index a65905b..a4a7ec7 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -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的校验 diff --git a/src/directives/permission/hasPermi.ts b/src/directives/permission/hasPermi.ts index 1207464..82fe8d9 100644 --- a/src/directives/permission/hasPermi.ts +++ b/src/directives/permission/hasPermi.ts @@ -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) { 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 diff --git a/src/directives/permission/hasRole.ts b/src/directives/permission/hasRole.ts index 31a352a..99e80b7 100644 --- a/src/directives/permission/hasRole.ts +++ b/src/directives/permission/hasRole.ts @@ -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) { 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 diff --git a/src/layout/components/Setting/src/Setting.vue b/src/layout/components/Setting/src/Setting.vue index 908ed99..97f92b0 100644 --- a/src/layout/components/Setting/src/Setting.vue +++ b/src/layout/components/Setting/src/Setting.vue @@ -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() } diff --git a/src/layout/components/UserInfo/src/UserInfo.vue b/src/layout/components/UserInfo/src/UserInfo.vue index d305009..27a7f7e 100644 --- a/src/layout/components/UserInfo/src/UserInfo.vue +++ b/src/layout/components/UserInfo/src/UserInfo.vue @@ -1,19 +1,18 @@ diff --git a/src/views/Clue/Pool/Comp/ClueMap.vue b/src/views/Clue/Pool/Comp/ClueMap.vue index e3afcc6..202f727 100644 --- a/src/views/Clue/Pool/Comp/ClueMap.vue +++ b/src/views/Clue/Pool/Comp/ClueMap.vue @@ -39,6 +39,7 @@ + + diff --git a/src/views/Clue/Pool/Comp/DialogClue.vue b/src/views/Clue/Pool/Comp/DialogClue.vue index 7132df4..95e2f81 100644 --- a/src/views/Clue/Pool/Comp/DialogClue.vue +++ b/src/views/Clue/Pool/Comp/DialogClue.vue @@ -133,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' @@ -226,6 +227,7 @@ const defaultLatLng = ref({ lat: 31.86119, lng: 117.283042 }) +const defaultCity = ref('合肥') const info = ref({}) const diyFieldArr = ref([]) @@ -265,9 +267,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) @@ -396,7 +403,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) => { diff --git a/src/views/Clue/Pool/Comp/DialogSuccess.vue b/src/views/Clue/Pool/Comp/DialogSuccess.vue index 80487bf..ec6c301 100644 --- a/src/views/Clue/Pool/Comp/DialogSuccess.vue +++ b/src/views/Clue/Pool/Comp/DialogSuccess.vue @@ -328,6 +328,7 @@ 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 { getSimpleWarehouseList } from '@/api/mall/warehouse' import { formatDate } from '@/utils/formatTime' @@ -415,7 +416,8 @@ async function open(id) { } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 -function resetForm(id) { +async function resetForm(id) { + const data = await getConfigByConfigKey({ configKey: 'companyCollectionConfig' }) form.value = { clueId: id, dealDate: formatDate(new Date()), @@ -423,7 +425,7 @@ function resetForm(id) { signPrice: 0, payAmount: 0, remark: undefined, - isCompanyReceipts: appStore.getAppInfo?.instanceType == 2, + isCompanyReceipts: data.configValue == 'true', receiver: undefined, extraPay: [], signProducts: [] diff --git a/src/views/Clue/Pool/index.vue b/src/views/Clue/Pool/index.vue index daa0c20..c15172c 100644 --- a/src/views/Clue/Pool/index.vue +++ b/src/views/Clue/Pool/index.vue @@ -53,6 +53,12 @@ @@ -63,7 +69,9 @@ :tableColumns="allSchemas.tableColumns" @get-list="getTableList" @get-checked-columns="getCheckedColumns" + @selection-change="handleSelectionChange" > + + @@ -189,6 +202,7 @@ 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 DialogBatchChangeFollow from './Comp/DialogBatchChangeFollow.vue' import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user' import { removeNullField } from '@/utils' @@ -216,7 +230,7 @@ async function getCurdSchemas() { try { const data = await getSimpleFieldList() data.forEach((elem) => { - if (elem.field == 'followUser' || elem.field == 'convertPeople') { + if (['followUser', 'convertPeople', 'firstFollowUser'].includes(elem.field)) { elem.search.options = userOptions.value } }) @@ -295,6 +309,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) diff --git a/src/views/Clue/Set/Comp/DialogExtraFee.vue b/src/views/Clue/Set/Comp/DialogExtraFee.vue index 5f12aa6..ceccec9 100644 --- a/src/views/Clue/Set/Comp/DialogExtraFee.vue +++ b/src/views/Clue/Set/Comp/DialogExtraFee.vue @@ -5,10 +5,16 @@ v-loading="formLoading" :model="formData" :rules="formRules" - label-width="80px" + label-width="auto" > - - + + + + + + + + @@ -29,7 +35,8 @@