From 30d61360fa60a1e73e35af30a7933d1a83e4dfaa Mon Sep 17 00:00:00 2001 From: kaeery <3491123437@qq.com> Date: Thu, 27 Feb 2025 19:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8B=9B=E7=94=9F=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E3=80=91=20=E6=96=B0=E5=A2=9E#=201=E3=80=81=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E7=94=B5=E9=94=80=E7=9A=84=E6=B7=BB=E5=8A=A0=E8=B7=9F?= =?UTF-8?q?=E8=BF=9B=E3=80=81=E8=B7=9F=E8=BF=9B=E8=AE=B0=E5=BD=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9B2=E3=80=81=E5=AF=B9=E6=8E=A5=E6=8B=9B?= =?UTF-8?q?=E7=94=9F=E7=9A=84=E6=B7=BB=E5=8A=A0=E8=BF=9B=E5=B1=95=EF=BC=9B?= =?UTF-8?q?3=E3=80=81=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=B6=E5=BA=95=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A0=8F=E6=98=BE=E7=A4=BA=E9=A6=96=E9=A1=B5=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=9B4=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=9A=E7=82=B9=E5=87=BB=E5=BA=95=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A0=8F=E4=B8=AD=E7=9A=84=E6=80=BB=E7=BB=93=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=86=8D=E7=82=B9=E5=87=BB=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E9=A1=B5=E9=9D=A2=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 6 +- src/App.vue | 23 +--- src/api/clue.ts | 34 +++++ src/api/dict.ts | 15 ++- src/bundle/pages/login/login.vue | 6 +- src/bundle/pages/progress_add/index.vue | 81 ++++++++---- src/components/design-container.vue | 1 - src/components/design-form.vue | 10 +- src/components/design-input-field.vue | 1 + src/components/design-multiselect-field.vue | 1 - src/components/design-search.vue | 3 +- src/components/roles-popup.vue | 4 +- src/components/tabbar/tabbar.vue | 1 + src/components/widgets/card/card.vue | 7 +- .../widgets/date-more/date-more.vue | 2 +- .../widgets/recruitsale/clue-card.vue | 97 +++++++++++--- src/components/widgets/telesale/clue-card.vue | 50 +++++-- .../widgets/telesale/follow-form.vue | 61 ++++++--- .../widgets/telesale/follow-record.vue | 39 +++--- src/enums/appEnums.ts | 4 +- src/enums/index.ts | 19 +++ src/hooks/useCommon.ts | 21 +++ src/hooks/useRoleData.ts | 92 +++---------- src/pages.json | 70 ++++++---- src/pages/index/index.vue | 124 +----------------- src/pages/recruitsale/home/index.vue | 65 +++++---- src/pages/recruitsale/my/index.vue | 7 + src/pages/recruitsale/summary/index.vue | 16 ++- src/pages/telesale/home/index.vue | 15 ++- src/pages/telesale/my/index.vue | 7 + src/pages/telesale/summary/index.vue | 1 + src/static/iconfont/iconfont.css | 14 +- src/stores/app.ts | 10 +- src/stores/user.ts | 10 +- src/styles/public.scss | 5 + src/utils/validate.ts | 15 +++ tailwind.config.js | 3 +- 37 files changed, 515 insertions(+), 425 deletions(-) create mode 100644 src/api/clue.ts create mode 100644 src/enums/index.ts create mode 100644 src/hooks/useCommon.ts create mode 100644 src/pages/recruitsale/my/index.vue create mode 100644 src/pages/telesale/my/index.vue create mode 100644 src/utils/validate.ts diff --git a/.env.development b/.env.development index bee9f00..da6b919 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ # @FilePath: \chargingpile-uniapp\.env.development ### # 请求域名 -# VITE_APP_BASE_URL= 'http://120.77.216.5:8084' -VITE_APP_BASE_URL="http://192.168.111.98:8084" -# VITE_APP_BASE_URL="https://wechat.szcxj2024.com" +# VITE_APP_BASE_URL= 'http://192.168.111.5:8086' +VITE_APP_BASE_URL="http://192.168.111.98:8086" +# VITE_APP_BASE_URL="https://124.220.209.120:8086" # VITE_APP_SOCKET_URL = 'wss://front.yuegoodlife.com' \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 2965e0f..f08af9b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@ import { getAllDict } from '@/hooks/useDictOptions' const appStore = useAppStore() const userStore = useUserStore() -// getAllDict() +getAllDict() onLaunch(async () => { appStore.getSystemInfoFn() @@ -24,28 +24,9 @@ onLaunch(async () => { onShow(async () => { const token = userStore.token if (token) { - await appStore.getConfig() + // await appStore.getConfig() appStore.updateLocation() } else appStore.closeTimer() }) - -// function genDates() { -// const weekdays = ['日', '一', '二', '三', '四', '五', '六'] -// const currentDate = new Date() -// const currentDayOfWeek = currentDate.getDay() -// let preDateOfWeek = currentDate.getDate() - 1 -// const daysInRange = [] -// for (let i = currentDayOfWeek; i <= weekdays.length - 1; i++) { -// preDateOfWeek = preDateOfWeek + 1 -// daysInRange.push(preDateOfWeek) -// } -// let currentDateOfWeek = currentDate.getDate() -// for (let i = 0; i <= weekdays.length - daysInRange.length; i++) { -// currentDateOfWeek = currentDateOfWeek - 1 -// daysInRange.unshift(currentDateOfWeek) -// } -// console.log(daysInRange) -// } -// genDates() diff --git a/src/api/clue.ts b/src/api/clue.ts new file mode 100644 index 0000000..a9b388f --- /dev/null +++ b/src/api/clue.ts @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +// 新增线索 +export function apiAddCluse(params: any) { + return request.post({ url: '/clue/add', data: params }) +} +// 线索列表 +export function apiCluseList(params: any) { + return request.get({ url: '/clue/list', data: params }) +} +// 领取线索 +export function apiGetCluse(params: any) { + return request.post({ url: '/clue/grabTheOrder', data: params }) +} +// 线索详情 +export function apiCluseDetail(params: any) { + return request.get({ url: '/clue/detail', data: params }) +} +// 添加进展 +export function apiAddCluseProgress(params: any) { + return request.post({ url: '/clue/addProgress', data: params }) +} +// 转化完成 +export function apiCompleteCluse(params: any) { + return request.post({ url: '/clue/conversionCompleted', data: params }) +} +// 修改备注 +export function apiEditRemark(params: any) { + return request.post({ url: '/clue/modifyRemarks', data: params }) +} +// 修改跟进 +export function apiEditClue(params: any) { + return request.post({ url: '/clue/edit', data: params }) +} diff --git a/src/api/dict.ts b/src/api/dict.ts index 9d8bad7..10af5a5 100644 --- a/src/api/dict.ts +++ b/src/api/dict.ts @@ -2,10 +2,13 @@ import request from '@/utils/request' // 所有字典以及字典下的所有数据 export function dictAllDataList() { - return request.get({ - url: '/setting/dict/type/allDataList', - data: { - pageSize: 60 - } - }) + return request.get( + { + url: '/setting/dict/type/allDataList', + data: { + pageSize: 60 + } + }, + { isAuth: true } + ) } diff --git a/src/bundle/pages/login/login.vue b/src/bundle/pages/login/login.vue index 344627d..86e0a4f 100644 --- a/src/bundle/pages/login/login.vue +++ b/src/bundle/pages/login/login.vue @@ -193,7 +193,7 @@ async function handleLogin(e) { scene: LoginTypeEnum.MNP, iv: e.detail.iv, encryptedData: e.detail.encryptedData, - channel: ChannelEnum.STAFF_PLATFORM + channel: ChannelEnum.USER_PLATFORM }) // 保存登录数据 loginData.value = data @@ -228,14 +228,14 @@ async function loginHandle(data: any) { // 获取用户信息 await userStore.getUser() // 获取系统配置 - await appStore.getConfig() + // await appStore.getConfig() // 显示登录成功提示 uni.$u.toast('登录成功') // 隐藏登录加载框 uni.hideLoading() - appStore.setFirstLogin(true) + // appStore.setFirstLogin(true) const { userInfo } = userStore if (userInfo.roles?.length > 1) { uni.redirectTo({ diff --git a/src/bundle/pages/progress_add/index.vue b/src/bundle/pages/progress_add/index.vue index 932b5fb..12d9650 100644 --- a/src/bundle/pages/progress_add/index.vue +++ b/src/bundle/pages/progress_add/index.vue @@ -2,9 +2,9 @@ - + - + - + - + - + - - 提交 + + 提交{{ form.state }} diff --git a/src/components/design-container.vue b/src/components/design-container.vue index 97feffa..11bfa72 100644 --- a/src/components/design-container.vue +++ b/src/components/design-container.vue @@ -17,7 +17,6 @@ flex-direction: column; .wrapper { flex: 1; - background-color: #fafafe; @apply flex flex-col; } } diff --git a/src/components/design-form.vue b/src/components/design-form.vue index a326659..d29d593 100644 --- a/src/components/design-form.vue +++ b/src/components/design-form.vue @@ -120,6 +120,13 @@ export default defineComponent({ }) }) } + const resetFields = () => { + instance.proxy.children.map(child => { + const prop = child.prop + const value = uni.$u.getProperty(originalModel.value, prop) + uni.$u.setProperty(props.model, prop, value) + }) + } watch( () => props.rules, newVal => { @@ -139,7 +146,8 @@ export default defineComponent({ ) return { children: [], - validate + validate, + resetFields } } }) diff --git a/src/components/design-input-field.vue b/src/components/design-input-field.vue index b2b088e..bf1784e 100644 --- a/src/components/design-input-field.vue +++ b/src/components/design-input-field.vue @@ -21,6 +21,7 @@ :inputAlign="inputAlign" :readonly="readonly" :maxlength="maxlength" + placeholderStyle="color: '#7c7e82'" > diff --git a/src/components/design-multiselect-field.vue b/src/components/design-multiselect-field.vue index a8c2e02..fe85c94 100644 --- a/src/components/design-multiselect-field.vue +++ b/src/components/design-multiselect-field.vue @@ -58,7 +58,6 @@ const innerValue = ref(props.modelValue) const handleSelectedItem = (val: number) => { emit('update:modelValue', val) innerValue.value = val - console.log(val) } diff --git a/src/components/design-search.vue b/src/components/design-search.vue index 9cd9f2d..46b55fd 100644 --- a/src/components/design-search.vue +++ b/src/components/design-search.vue @@ -58,7 +58,7 @@ const props = defineProps({ default: false } }) -const emit = defineEmits(['update:modelValue']) +const emit = defineEmits(['update:modelValue', 'onInput']) const innerValue = ref('') @@ -96,6 +96,7 @@ const isShowClear = computed(() => { const onInput = e => { innerValue.value = e.detail.value emit('update:modelValue', innerValue.value) + emit('onInput') } const onClear = () => { innerValue.value = '' diff --git a/src/components/roles-popup.vue b/src/components/roles-popup.vue index ffc7a7d..cc2b2fa 100644 --- a/src/components/roles-popup.vue +++ b/src/components/roles-popup.vue @@ -47,8 +47,8 @@ const { roles } = useRoleData() const emit = defineEmits(['update:modelValue', 'close']) const activeRole = ref(props.modelValue) const visible = ref(false) -let currentRoutes = getCurrentPages() // 获取当前打开过的页面路由数组 -let currentRoute = currentRoutes[currentRoutes.length - 1].route //获取当前页面路由 +const currentRoutes = getCurrentPages() // 获取当前打开过的页面路由数组 +const currentRoute = currentRoutes[currentRoutes.length - 1].route //获取当前页面路由 const handleActiveRole = (val: number) => { activeRole.value = val } diff --git a/src/components/tabbar/tabbar.vue b/src/components/tabbar/tabbar.vue index ef44ece..50b56ef 100644 --- a/src/components/tabbar/tabbar.vue +++ b/src/components/tabbar/tabbar.vue @@ -39,6 +39,7 @@ const props = withDefaults(defineProps(), { const tabBarStore = useTabBarStore() const { tabBarList, activeTabBar } = storeToRefs(tabBarStore) + const handleTabbar = (index: number) => { tabBarStore.setActiveTabBar(index) navigateTo(unref(tabBarList)[index], 'reLaunch') diff --git a/src/components/widgets/card/card.vue b/src/components/widgets/card/card.vue index 8bbb9b1..2a510dc 100644 --- a/src/components/widgets/card/card.vue +++ b/src/components/widgets/card/card.vue @@ -8,12 +8,7 @@ - - - + diff --git a/src/components/widgets/date-more/date-more.vue b/src/components/widgets/date-more/date-more.vue index 1dcaf46..a03c64a 100644 --- a/src/components/widgets/date-more/date-more.vue +++ b/src/components/widgets/date-more/date-more.vue @@ -14,7 +14,7 @@ import { computed } from 'vue' const props = defineProps({ curDate: { - type: String, + type: Number, default: new Date().getTime() }, type: { diff --git a/src/components/widgets/recruitsale/clue-card.vue b/src/components/widgets/recruitsale/clue-card.vue index 31b7044..96724a0 100644 --- a/src/components/widgets/recruitsale/clue-card.vue +++ b/src/components/widgets/recruitsale/clue-card.vue @@ -3,9 +3,9 @@ @@ -71,18 +108,36 @@ diff --git a/src/enums/appEnums.ts b/src/enums/appEnums.ts index 70b3e94..fa8ab1e 100644 --- a/src/enums/appEnums.ts +++ b/src/enums/appEnums.ts @@ -6,8 +6,8 @@ export enum ThemeEnum { DARK = 'dark' } export enum ChannelEnum { - USER_PLATFORM = 0, - STAFF_PLATFORM = 1 + USER_PLATFORM = 0, // 用户端 + STAFF_PLATFORM = 1 //师傅端 } // 客户端 export enum ClientEnum { diff --git a/src/enums/index.ts b/src/enums/index.ts new file mode 100644 index 0000000..9efcfa2 --- /dev/null +++ b/src/enums/index.ts @@ -0,0 +1,19 @@ +export enum teleSaleEnum { + ADD_FOLLOW = 0, + FOLLOW_RECORD = 1 +} + +export enum converStatusEnum { + INTENTION = 0, //有意向 + UN_RECEIVED = 1, //待领取 + CONVERTED_PROCESS = 2, //转化中 + ADD_RELATION = 3, //已添加 + EXCEPTION = 4, //异常待处理 + CONVERTED = 5, //已成交 + FAILED = 6 //已战败 +} +export enum stateEnum { + ADD_RELATION = 0, //账号已添加 + NO_EXIST = 1, //账号不存在 + UN_PASS = 2 //账号未通过 +} diff --git a/src/hooks/useCommon.ts b/src/hooks/useCommon.ts new file mode 100644 index 0000000..0b84540 --- /dev/null +++ b/src/hooks/useCommon.ts @@ -0,0 +1,21 @@ +import { apiCluseDetail } from '@/api/clue' +import { ref } from 'vue' + +// 获取线索详情 +export function useClueDetail() { + const clueDetailInfo = ref() + const fetchClueDetail = async (id: number | string) => { + uni.showLoading({ + title: '加载中' + }) + try { + const result = await apiCluseDetail({ id }) + clueDetailInfo.value = result + } catch (error) {} + uni.hideLoading() + } + return { + clueDetailInfo, + fetchClueDetail + } +} diff --git a/src/hooks/useRoleData.ts b/src/hooks/useRoleData.ts index 15322d0..83a5a77 100644 --- a/src/hooks/useRoleData.ts +++ b/src/hooks/useRoleData.ts @@ -23,110 +23,50 @@ export interface RoleItem { export function useRoleData() { const roles: RoleItem[] = [ { - name: '业务员', - ids: [8, 9], + name: '电销老师', + ids: [5], tabBarList: [ { - text: '客户库', + text: '首页', + path: '/pages/telesale/home/index', inactiveIcon: clientInActive, - activeIcon: clientActive, - path: '/pages/salesman/client/index' + activeIcon: clientActive }, { - text: '合同管理', - path: '/pages/salesman/contract/index', + text: '总结模板', + path: '/pages/telesale/summary/index', inactiveIcon: contractInActive, activeIcon: contractActive }, { text: '个人中心', - path: '/pages/salesman/profile/index', + path: '/pages/telesale/my/index', inactiveIcon: profileInActive, activeIcon: profileActive } ] }, { - name: '检修员', + name: '招生老师', ids: [6], tabBarList: [ { - text: '工单池', + text: '首页', inactiveIcon: order, activeIcon: orderActive, - path: '/pages/overhaul/pool/index' + path: '/pages/recruitsale/home/index' }, { - text: '我的任务', + text: '总结模板', + path: '/pages/recruitsale/summary/index', inactiveIcon: task, - activeIcon: taskActive, - path: '/pages/overhaul/task/index' + activeIcon: taskActive }, { text: '个人中心', + path: '/pages/recruitsale/my/index', inactiveIcon: profileInActive, - activeIcon: profileActive, - path: '/pages/overhaul/my/index' - } - ] - }, - { - name: '客户', - ids: [1, 2, 11], - tabBarList: [ - { - text: '工单记录', - inactiveIcon: order, - activeIcon: orderActive, - path: '/pages/client/workOrder/index' - }, - { - text: '个人中心', - inactiveIcon: profileInActive, - activeIcon: profileActive, - path: '/pages/client/my/index' - } - ] - }, - { - name: '维修员', - ids: [7], - tabBarList: [ - // { - // text: '工单池', - // inactiveIcon: order, - // activeIcon: orderActive, - // path: '/pages/repair/pool/index' - // }, - { - text: '工单列表', - inactiveIcon: task, - activeIcon: taskActive, - path: '/pages/repair/task/index' - }, - { - text: '个人中心', - inactiveIcon: profileInActive, - activeIcon: profileActive, - path: '/pages/repair/my/index' - } - ] - }, - { - name: '维修主管', - ids: [10], - tabBarList: [ - { - text: '工单列表', - inactiveIcon: task, - activeIcon: taskActive, - path: '/pages/charge/order/index' - }, - { - text: '个人中心', - inactiveIcon: profileInActive, - activeIcon: profileActive, - path: '/pages/charge/my/index' + activeIcon: profileActive } ] } diff --git a/src/pages.json b/src/pages.json index 39cd5fb..3b61e73 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,29 +1,56 @@ { "pages": [ { - "path": "pages/recruitsale/home/index", + "path": "pages/index/index", "style": { - "navigationBarTitleText": "" - } - }, - { - "path": "pages/recruitsale/summary/index", - "style": { - "navigationBarTitleText": "" - } - }, - { - "path": "pages/telesale/summary/index", - "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "首页", + "navigationStyle": "custom" } }, { "path": "pages/telesale/home/index", "style": { "navigationBarTitleText": "" + }, + "auth": true + }, + { + "path": "pages/recruitsale/home/index", + "style": { + "navigationBarTitleText": "" + }, + "auth": true + }, + { + "path": "pages/telesale/summary/index", + "style": { + "navigationBarTitleText": "" + }, + "auth": true + }, + { + "path": "pages/recruitsale/summary/index", + "style": { + "navigationBarTitleText": "" + }, + "auth": true + }, + { + "path": "pages/recruitsale/my/index", + "style": { + "navigationBarTitleText": "个人中心", + "navigationStyle": "custom" + }, + "auth": true + }, + { + "path": "pages/telesale/my/index", + "style": { + "navigationBarTitleText": "个人中心", + "navigationStyle": "custom" } }, + { "path": "pages/salesman/contract/index", "style": { @@ -44,21 +71,6 @@ }, "auth": true }, - { - "path": "pages/client/my/index", - "style": { - "navigationBarTitleText": "个人中心", - "navigationStyle": "custom" - }, - "auth": true - }, - { - "path": "pages/salesman/profile/index", - "style": { - "navigationBarTitleText": "个人中心", - "navigationStyle": "custom" - } - }, { "path": "pages/overhaul/pool/index", "style": { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 95f0357..cd77dd4 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,86 +1,19 @@ - - - + diff --git a/src/pages/recruitsale/home/index.vue b/src/pages/recruitsale/home/index.vue index 9590e9c..82584b8 100644 --- a/src/pages/recruitsale/home/index.vue +++ b/src/pages/recruitsale/home/index.vue @@ -1,7 +1,7 @@