diff --git a/.eslintrc.cjs b/.eslintrc.cjs index faab54e..74d0320 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,6 +23,13 @@ module.exports = { '@typescript-eslint/no-empty-function': 'off', // 允许非空断言 '@typescript-eslint/no-non-null-assertion': 'off', - 'vue/no-template-shadow': 'off' + 'vue/no-template-shadow': 'off', + "@typescript-eslint/no-this-alias": [ + "error", + { + "allowDestructuring": false, // Disallow `const { props, state } = this`; true by default + "allowedNames": ["that"] // Allow `const self = this`; `[]` by default + } + ] } } diff --git a/package.json b/package.json index 6249161..806c069 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "cropperjs": "^1.5.13", "crypto-js": "^4.1.1", "dayjs": "^1.11.7", + "echarts": "^5.4.3", "js-cookie": "^3.0.5", "json-bigint": "^1.0.0", "mitt": "^3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa0d483..2f78930 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,6 +50,9 @@ dependencies: dayjs: specifier: ^1.11.7 version: 1.11.7 + echarts: + specifier: ^5.4.3 + version: 5.4.3 js-cookie: specifier: ^3.0.5 version: 3.0.5 @@ -2702,6 +2705,13 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true + /echarts@5.4.3: + resolution: {integrity: sha512-mYKxLxhzy6zyTi/FaEbJMOZU1ULGEQHaeIeuMR5L+JnJTpz+YR03mnnpBhbR4+UYJAgiXgpyTVLffPAjOTLkZA==} + dependencies: + tslib: 2.3.0 + zrender: 5.4.4 + dev: false + /ejs@3.1.9: resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==} engines: {node: '>=0.10.0'} @@ -5313,6 +5323,10 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true + /tslib@2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + dev: false + /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} dev: true @@ -5850,3 +5864,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + + /zrender@5.4.4: + resolution: {integrity: sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==} + dependencies: + tslib: 2.3.0 + dev: false diff --git a/src/api/directResources/index.ts b/src/api/directResources/index.ts index 853c8a1..fcbefab 100644 --- a/src/api/directResources/index.ts +++ b/src/api/directResources/index.ts @@ -1,7 +1,6 @@ import httpClient from '@/utils/axios' import type { ApiResult } from '@/api/types' import type { directPageParam, distributeData } from './types' - export function pageQueryPage(pageParams: directPageParam) { return httpClient.get('/directClue/page', { params: pageParams @@ -12,6 +11,6 @@ export function upDistribute(data: distributeData[]) { return httpClient.post('/directClue/distribute', data) } -export function getfFindDirectSalesman() { - return httpClient.get('/system/user/findDirectSalesman', {}) +export function getfFindDirectSalesman(id: number) { + return httpClient.get('/system/user/findSalesman/' + id) } diff --git a/src/api/geopoliticalCustomers/index.ts b/src/api/geopoliticalCustomers/index.ts index 92fd847..f588f8b 100644 --- a/src/api/geopoliticalCustomers/index.ts +++ b/src/api/geopoliticalCustomers/index.ts @@ -1,16 +1,14 @@ import httpClient from '@/utils/axios' import type { ApiResult } from '@/api/types' -import type { - DistributeTaskManagementPageParam, - distributeTaskId -} from '@/api/controlcenterstation/distributionTaskManagement/types' +import type { distributeTaskId } from '@/api/controlcenterstation/distributionTaskManagement/types' import type { GeopoliticalCustomersDTO, CustomerDTO, customId, auditDTO, GeopoliticalCustomersPageParam, - storePageParam + storePageParam, + toExamine } from '@/api/geopoliticalCustomers/types' // import type { @@ -126,18 +124,8 @@ export function getStoreData(pageParams: storePageParam) { * 任务审核 * */ -export function updateCustomerAudit( - customId: number, - status: number, - salesmanType: number, - reviewUserId?: undefined | number -) { - return httpClient.post('/custom/audit', { - customId, - status, - salesmanType, - reviewUserId - }) +export function updateCustomerAudit(data: toExamine) { + return httpClient.post('/custom/audit', data) } /** * ID查询质检详情 diff --git a/src/api/geopoliticalCustomers/types.ts b/src/api/geopoliticalCustomers/types.ts index ed5f96e..eab6dbc 100644 --- a/src/api/geopoliticalCustomers/types.ts +++ b/src/api/geopoliticalCustomers/types.ts @@ -182,6 +182,12 @@ export interface CustomerDTO { //备注 remark?: string | undefined address?: Array + // 简略地址 + abbreviateAddress?: any[] + // 性别 + sex: number + // 客户资料 + customInformation: string //省 economize?: string //市 @@ -200,6 +206,8 @@ export interface CustomerDTO { customStoreEntities: Array description?: number | undefined status?: number | undefined + salesmanUserId?: number[] + type?: number } export interface auditDTO { customId?: number | undefined @@ -301,3 +309,11 @@ export type storeQO = { // 结束时间 endTime?: string } +// 分发 重审 参数 +export type toExamine = { + customId: number + status: number + salesmanType: number + reviewUserId?: undefined | number + salesmanUserId?: number[] +} diff --git a/src/api/system/statistics/index.ts b/src/api/system/statistics/index.ts new file mode 100644 index 0000000..f00fe48 --- /dev/null +++ b/src/api/system/statistics/index.ts @@ -0,0 +1,28 @@ +import httpClient from '@/utils/axios' +import type { ApiResult } from '@/api/types' +import type { searchData } from './types' +// 首页顶部统计 +export function getHomePageBase() { + return httpClient.get('/api/homePage/base') +} + +// 线索录入明细查询 +export function getHomePageEnter(data: searchData) { + return httpClient.post>('/api/homePage/enter', data) +} +// 各终端分发明细查询 +export function getHomePageAssigned(data: searchData) { + return httpClient.post>('/api/homePage/assigned', data) +} +// 首页图表-公告导出方法 +export function getHomePageExport(data: searchData) { + return httpClient.post>('/api/homePage/export', data, { responseType: 'blob' }) +} +// 首页图表-分发数量统计-分发员 +export function getDistributors(data: searchData) { + return httpClient.post>('/api/homePage/distributors', data) +} +// 首页图表-线索数量统计-分发员 +export function getSalesman(data: searchData) { + return httpClient.post>('/api/homePage/salesman', data) +} diff --git a/src/api/system/statistics/types.ts b/src/api/system/statistics/types.ts new file mode 100644 index 0000000..e19c3a9 --- /dev/null +++ b/src/api/system/statistics/types.ts @@ -0,0 +1,14 @@ +export type searchData = { + createStartTime?: string + createEndTime?: string + assignedIdList?: number[] + enterIdList?: number[] + channelType: number + type?: number +} + +export type chartData = { + title?: string + xAxisArr: string[] + seriesArr: any[] +} diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index df2bc2e..fae2441 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -66,7 +66,6 @@ export function updateUserAvatar(userId: Key | undefined, fileObj: FileObject) { const formData = new FormData() formData.append('file', fileObj.data, fileObj.name) formData.append('userId', userId + '') - console.log("🚀 ~ file: index.ts:69 ~ updateUserAvatar ~ formData:", formData) return httpClient.postForm>('/system/user/avatar', formData) } @@ -102,3 +101,7 @@ export function updateUserPassword(userId: number, data: SysUserPassDTO) { export function chargeClue(chargeDto: SysUserChargeDTO) { return httpClient.post>('/system/user/recharge', chargeDto) } +// 当前管理员角色-查询指定角色子用户: +export function getFindRoleSonUser(roleId: number) { + return httpClient.get>(`/system/user/findRoleSonUser/${roleId}`) +} diff --git a/src/stores/user-store.ts b/src/stores/user-store.ts index 4cee0bf..bea0d52 100644 --- a/src/stores/user-store.ts +++ b/src/stores/user-store.ts @@ -6,14 +6,14 @@ import { getLoginUserMenus } from '@/api/system/menu' import type { SysMenuRouterVO } from '@/api/system/menu/types' export interface UserInfo extends LoginUserInfo { - roleCodes: string[] permissions: string[] gender: number | undefined + roleCodes: string[] } const accessTokenKey = getStorageKey('access-token') const userInfoKey = getStorageKey('user-info') - +const roleCodesKey = getStorageKey('role-codes') export const useUserStore = defineStore('userStore', { // 其他配置... state: () => ({ @@ -24,7 +24,11 @@ export const useUserStore = defineStore('userStore', { writeDefaults: false, serializer: StorageSerializers.object }), - userMenus: undefined as SysMenuRouterVO[] | undefined + userMenus: undefined as SysMenuRouterVO[] | undefined, + // 角色 + roleCodes: useLocalStorage(roleCodesKey, undefined, { + writeDefaults: false + }) }), actions: { async fetchUserMenus() { @@ -65,6 +69,7 @@ export const useUserStore = defineStore('userStore', { this.accessToken = undefined this.userInfo = undefined this.userMenus = undefined + this.roleCodes = undefined } } }) diff --git a/src/utils/dom-utils.ts b/src/utils/dom-utils.ts index 7afc453..fc4a373 100644 --- a/src/utils/dom-utils.ts +++ b/src/utils/dom-utils.ts @@ -7,3 +7,37 @@ export function hasClass(dom: HTMLElement, className: string) { ) >= 0 ) } + +export function debounce(func: any, wait: any, immediate: any) { + let timeout: any, args: null, context: any, timestamp: number, result: any + + const later = function() { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last) + } else { + timeout = null + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args) + if (!timeout) context = args = null + } + } + } + return function(...args: any) { + context = this + timestamp = +new Date() + const callNow = immediate && !timeout + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait) + if (callNow) { + result = func.apply(context, args) + context = args = null + } + + return result + } +} diff --git a/src/views/basic/echarts/linChart.vue b/src/views/basic/echarts/linChart.vue new file mode 100644 index 0000000..cc83ff2 --- /dev/null +++ b/src/views/basic/echarts/linChart.vue @@ -0,0 +1,106 @@ + + + + diff --git a/src/views/basic/iframe/index.vue b/src/views/basic/iframe/index.vue index 91930ab..325274d 100644 --- a/src/views/basic/iframe/index.vue +++ b/src/views/basic/iframe/index.vue @@ -1,33 +1,302 @@ diff --git a/src/views/formReview/formReview.vue b/src/views/formReview/formReview.vue index 8032839..424e2b6 100644 --- a/src/views/formReview/formReview.vue +++ b/src/views/formReview/formReview.vue @@ -27,7 +27,7 @@ 编辑 - 回单 + - @@ -116,6 +116,18 @@ const columns: ProColumns[] = [ title: '客户名称', dataIndex: 'customName' }, + { + title: '分发类型', + dataIndex: 'customType', + width: 80, + customRender: ({ record }: any) => { + if (record.customType == 0) { + return h('div', '地理分发') + } else if (record.customType == 1) { + return h('div', '基础分发') + } + } + }, { title: '联系方式', dataIndex: 'customNid' diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal-第一版.vue similarity index 100% rename from src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue rename to src/views/geopoliticalCustomers/geopoliticalCustomersModal-第一版.vue diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal-第二版.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal-第二版.vue new file mode 100644 index 0000000..4dfac70 --- /dev/null +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersModal-第二版.vue @@ -0,0 +1,1961 @@ + + + + diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue index 4dfac70..8fe6370 100644 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue @@ -5,27 +5,26 @@ :visible="visible" :mask-closable="false" :centered="true" - :body-style="{ padding: '0px 40px 8px' }" + :body-style="{ + padding: '0px 40px 8px', + minHeight: '65vh', + maxHeight: '85vh', + overflowY: 'scroll' + }" :get-container="() => $refs.refModal" :confirm-loading="submitLoading" :width="850" @cancel="handleClose" > - - - - - - - - - - + + + --> - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + @@ -298,7 +329,7 @@ -
+

您提交的表单信息为:

称呼:{{ formModel.customName }}

联系方式:{{ formModel.customNid }}

-
+

备注:{{ formModel.remark }}

+

{{ `报名的门店${index + 1}为` }}:{{ item.storeName }}  {{ item.reservationDate?.toString().split(' ')[0] }} @@ -466,6 +502,7 @@ import type { SelectValue } from 'ant-design-vue/es/select' import type { SelectProps } from 'ant-design-vue' import type { Dayjs } from 'dayjs' import 'dayjs/locale/zh-cn' +import { getfFindDirectSalesman } from '@/api/directResources/index' import { addCustomer, updateCustomer, @@ -488,40 +525,38 @@ const userInfoCurrent = ref('') // required: true, // trigger: 'change' // } - +//省市区下拉框列表数据 +const provincesAndCitiesAndAutonomousOptions: any = ref([]) +//省市下拉框列表数据 +const provincesAndCities: any = ref([]) onMounted(() => { //省市区三级下拉框列表数据 - provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions + provincesAndCitiesAndAutonomousOptions.value = JSON.parse( + JSON.stringify(window.globalProvincesAndCitiesAndAutonomousRegions) + ) //省市区二级下拉框列表数据 - // if (provincesAndCitiesAndAutonomousRegions) { - // const addressArray = JSON.parse(JSON.stringify(provincesAndCitiesAndAutonomousRegions)) - // const arr: any[] = [] - // addressArray.forEach((item: any) => { - // item.children.forEach((it: any) => { - // if (it.children) { - // delete it.children - // } - // }) - // arr.push(item) - // }) - // provincesAndCitiesAndAutonomousOptions.value = arr - // } + const arr: any[] = [] + const addressArray = window.globalProvincesAndCitiesAndAutonomousRegions + addressArray.forEach((item: any) => { + item.children.forEach((it: any) => { + it.children && delete it.children + }) + arr.push(item) + }) + provincesAndCities.value = arr //获取当前账号角色 userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString() }) - +// 业务员 +let userList: any = [] //当前激活 tab 面板的 key -const activeKey = ref('') +const activeKey = ref() //tabs change事件 -const tabsChange = (val: string) => { +const tabsChange = (val: number) => { handleMapInit() // formRef.value?.resetFields() formRef.value?.clearValidate() - if (val === '1') { - formModel.customType = 0 - } else { - formModel.customType = 1 - } + formModel.customType = val } //省市区动态生成只读/禁用样式 @@ -558,9 +593,6 @@ const formRef = ref() // const city = ref('') // const cityAnddistinguish = ref('') - -//省市区下拉框列表数据 -const provincesAndCitiesAndAutonomousOptions: any = ref([]) //省市区change const addressChange = async (value: any) => { // if (infoWindows.value) { @@ -609,9 +641,75 @@ const radiusChange = (value: SelectValue) => { formModel.radius = value } +const emits = defineEmits<{ + (e: 'submit-success', resetPageIndex?: boolean): void +}>() + +const { title, visible, openModal, closeModal } = useModal() + +const { formAction } = useFormAction() +// 表单模型 +const formModel = reactive({ + customType: undefined, + customId: undefined, + customName: '', + customNid: '', + remark: '', + address: [], + abbreviateAddress: [], // 简略地址 + sex: 0, + customInformation: '', + economize: '', + market: '', + distinguish: '', + detailAddress: '', + otherAddressesInfo: '', + radius: '', + enrollStatus: 1, + customStoreEntities: [], + salesmanUserId: [] +}) +const formRule = ref({ + customName: [{ required: true, message: '请输入称呼', trigger: ['blur', 'change'] }], + customNid: [ + { + required: true, + message: '请输入正确的手机号码', + pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, + trigger: ['blur', 'change'] + } + ], + address: [{ required: true, message: '请选择地址信息', trigger: ['blur', 'change'] }], + detailAddress: [{ required: true, message: '请输入小区名称', trigger: 'change' }], + radius: [{ required: true, message: '请选择区域半径', trigger: 'change' }] +}) + +// 表单的提交请求 +const formRequestMapping: FormRequestMapping = { + [FormAction.CREATE]: addCustomer, + [FormAction.UPDATE]: auditCustomer +} + +// 获取 useAdminForm 的返回值 +const adminForm = useAdminForm(formAction, formRequestMapping, formModel, formRule) + +// 使用 toRefs 创建响应式解构副本 +const { submitLoading, validateAndSubmit, resetFields, validateInfos } = toRefs(adminForm) + +//表单提交处理 +const handleSubmit = () => { + handleClose() + emits('submit-success') +} //根据地址搜索出来的门店数据 const listData: any = ref([]) - +const initUserList = () => { + doRequest(getfFindDirectSalesman(23), { + onSuccess: (res: any) => { + userList = res.data + } + }) +} //预约时间下拉框列表数据(根据后端返回的营业时间生成) const generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => { const startHour = Number(tradeStartTime.split(':')[0]) @@ -849,10 +947,8 @@ const getCenterMarkerAddress = () => { result.includes(formModel.detailAddress) || pois[0].address.includes(formModel.detailAddress) ) { - console.log('1111') accordingStorenameGetCenter(pois) } else { - console.log('2222') accordingAddressGetCenter() } } else { @@ -860,10 +956,8 @@ const getCenterMarkerAddress = () => { formModel.detailAddress.includes(result) || formModel.detailAddress.includes(pois[0].address) ) { - console.log('3333') accordingStorenameGetCenter(pois) } else { - console.log('4444') accordingAddressGetCenter() } } @@ -876,10 +970,8 @@ const getCenterMarkerAddress = () => { pois[0].name.includes(formModel.detailAddress) || pois[0].address.includes(formModel.detailAddress) ) { - console.log('1111') accordingStorenameGetCenter(pois) } else { - console.log('2222') accordingAddressGetCenter() } } else { @@ -887,10 +979,8 @@ const getCenterMarkerAddress = () => { formModel.detailAddress.includes(pois[0].name) || formModel.detailAddress.includes(pois[0].address) ) { - console.log('3333') accordingStorenameGetCenter(pois) } else { - console.log('4444') accordingAddressGetCenter() } } @@ -1047,7 +1137,6 @@ const idThen = (detailAddress: string) => { if (status === 'complete' && result.info === 'OK') { // 处理搜索结果 const pois = result.poiList.pois - console.log(pois, 'pois') // 对获取到的兴趣点列表进行处理 if (pois[0].name.includes('小区')) { const result = pois[0].name.replace('小区', '') @@ -1059,10 +1148,8 @@ const idThen = (detailAddress: string) => { result.includes(formModel.detailAddress) || pois[0].address.includes(formModel.detailAddress) ) { - console.log('1111') accordingStorenameMatch(pois) } else { - console.log('2222') accordingAddressMatch() } } else { @@ -1070,10 +1157,8 @@ const idThen = (detailAddress: string) => { formModel.detailAddress.includes(result) || formModel.detailAddress.includes(pois[0].address) ) { - console.log('3333') accordingStorenameMatch(pois) } else { - console.log('4444') accordingAddressMatch() } } @@ -1086,10 +1171,8 @@ const idThen = (detailAddress: string) => { pois[0].name.includes(formModel.detailAddress) || pois[0].address.includes(formModel.detailAddress) ) { - console.log('1111') accordingStorenameMatch(pois) } else { - console.log('2222') accordingAddressMatch() } } else { @@ -1097,10 +1180,8 @@ const idThen = (detailAddress: string) => { formModel.detailAddress.includes(pois[0].name) || formModel.detailAddress.includes(pois[0].address) ) { - console.log('3333') accordingStorenameMatch(pois) } else { - console.log('4444') accordingAddressMatch() } } @@ -1121,7 +1202,7 @@ const idThen = (detailAddress: string) => { } //匹配 const match = async (detailAddress: string) => { - if (activeKey.value === '1') { + if (activeKey.value === 0) { if (title.value === '新建预约' && formModel.customStoreEntities.length !== 0) { matchregisterVisible.value = true } else { @@ -1213,6 +1294,9 @@ const storeResetForm = () => { formModel.customName = '' formModel.customNid = '' formModel.remark = '' + formModel.customInformation = '' + formModel.salesmanUserId = [] + formModel.abbreviateAddress = [] if (title.value === '详情' || title.value === '回单' || title.value === '新建预约') { formModel.address = [] formModel.detailAddress = '' @@ -1233,7 +1317,8 @@ const showModal = () => { formRef.value ?.validate() .then(() => { - if (activeKey.value === '1') { + console.log('activeKey==', activeKey.value) + if (activeKey.value === 0) { if (formModel.customStoreEntities.length === 0) { message.info('请先添加预约门店') } else { @@ -1295,6 +1380,9 @@ const submitOperate = () => { } if (title.value === '新建预约' || title.value === '编辑预约' || title.value === '编辑') { + if (title.value === '编辑') { + filteredObj.type = 2 + } const requestFn = title.value === '新建预约' ? addCustomer : updateCustomer doRequest(requestFn(filteredObj), { onSuccess: handleSuccess @@ -1347,11 +1435,25 @@ const temporaryStorage = async () => { } //回单 -const distribute = () => { +// const distribute = () => { +// formRef.value +// ?.validate() +// .then(() => { +// if (formModel.customStoreEntities.length === 0) { +// message.info('请先添加预约门店') +// } else { +// registerVisible.value = true +// } +// }) +// .catch(err => { +// console.log('校验失败err', err) +// }) +// } +const submitValidation = () => { formRef.value ?.validate() .then(() => { - if (formModel.customStoreEntities.length === 0) { + if (formModel.customStoreEntities.length === 0 && activeKey.value == 0) { message.info('请先添加预约门店') } else { registerVisible.value = true @@ -1362,64 +1464,6 @@ const distribute = () => { }) } -const emits = defineEmits<{ - (e: 'submit-success', resetPageIndex?: boolean): void -}>() - -const { title, visible, openModal, closeModal } = useModal() - -const { formAction } = useFormAction() -// 表单模型 -const formModel = reactive({ - customType: undefined, - customId: undefined, - customName: '', - customNid: '', - remark: '', - address: [], - economize: '', - market: '', - distinguish: '', - detailAddress: '', - otherAddressesInfo: '', - radius: '', - enrollStatus: 1, - customStoreEntities: [] -}) - -const formRule = ref({ - customName: [{ required: true, message: '请输入称呼', trigger: ['blur', 'change'] }], - customNid: [ - { - required: true, - message: '请输入正确的手机号码', - pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, - trigger: ['blur', 'change'] - } - ], - address: [{ required: true, message: '请选择地址信息', trigger: ['blur', 'change'] }], - detailAddress: [{ required: true, message: '请输入小区名称', trigger: 'change' }], - radius: [{ required: true, message: '请选择区域半径', trigger: 'change' }] -}) - -// 表单的提交请求 -const formRequestMapping: FormRequestMapping = { - [FormAction.CREATE]: addCustomer, - [FormAction.UPDATE]: auditCustomer -} - -// 获取 useAdminForm 的返回值 -const adminForm = useAdminForm(formAction, formRequestMapping, formModel, formRule) - -// 使用 toRefs 创建响应式解构副本 -const { submitLoading, validateAndSubmit, resetFields, validateInfos } = toRefs(adminForm) - -//表单提交处理 -const handleSubmit = () => { - handleClose() - emits('submit-success') -} - //弹窗关闭方法 const handleClose = () => { // activeKey.value = '1' @@ -1491,15 +1535,22 @@ defineExpose({ otherAddressesInfo, radius, customStoreVOList, - customType + customType, + customInformation, + salesmanUserId } = data formModel.customId = customId formModel.customName = customName formModel.customNid = customNid formModel.remark = remark + formModel.customInformation = customInformation || remark if (economize) { - formModel.address = [economize, market, distinguish] + if (customType == 0) { + formModel.address = [economize, market, distinguish] + } else if (customType == 1) { + formModel.abbreviateAddress = [economize, market] + } } else { formModel.address = [] } @@ -1511,6 +1562,7 @@ defineExpose({ formModel.customType = customType formModel.otherAddressesInfo = otherAddressesInfo + formModel.salesmanUserId = salesmanUserId formModel.radius = radius formModel.customStoreEntities.push(...customStoreVOList) //获取预约时间段下拉框回显数据 @@ -1518,29 +1570,19 @@ defineExpose({ i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime) }) const getActiveKey = () => { - if (formModel.customType === 0) { - activeKey.value = '1' - } else { - activeKey.value = '2' - } + activeKey.value = formModel.customType } if (opendata.type === 'audit') { getActiveKey() title.value = '编辑' - // if (formModel.address.length !== 0) { - // isAddressDisabled.value = true - // } - // if (formModel.radius) { - // isRadiusDisabled.value = true - // } - // if (formModel.detailAddress) { - // isDetailAddressDisabled.value = true - // } - handleMapInit().then(() => { - if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { - match(formModel.detailAddress) - } - }) + activeKey.value = formModel.customType || 0 + if (activeKey.value == 0) { + handleMapInit().then(() => { + if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { + match(formModel.detailAddress) + } + }) + } } else if (opendata.type === 'edit') { getActiveKey() title.value = '编辑预约' @@ -1553,42 +1595,37 @@ defineExpose({ if (formModel.detailAddress) { isDetailAddressDisabled.value = true } - handleMapInit().then(() => { - if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { - match(formModel.detailAddress) - } - }) - } else if (opendata.type === 'view') { - if (formModel.customType === 0) { - activeKey.value = '1' - } else { - activeKey.value = '2' + activeKey.value = formModel.customType || 0 + if (activeKey.value == 0) { + handleMapInit().then(() => { + if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { + match(formModel.detailAddress) + } + }) } + } else if (opendata.type === 'view') { + activeKey.value = formModel.customType title.value = '详情' isAddressReadOnly.value = true isRadiusReadOnly.value = true isDetailAddressReadOnly.value = true isReservationTimeisReadOnly.value = true - } else if (opendata.type === 'distribute') { - getActiveKey() - title.value = '回单' - isAddressReadOnly.value = true - isRadiusReadOnly.value = true - isDetailAddressReadOnly.value = true - isReservationTimeisReadOnly.value = true - formModel.description = 1 + } + if (activeKey.value == 1) { + initUserList() } openModal() } - if (opendata.newFormAction === FormAction.CREATE) { - activeKey.value = '1' - handleMapInit() - title.value = '新建预约' - formModel.customStoreEntities.length = 0 - formModel.customType = 0 - openModal() - } else if (opendata.newFormAction === FormAction.UPDATE) { + // if (opendata.newFormAction === FormAction.CREATE) { + // activeKey.value = '1' + // handleMapInit() + // title.value = '新建预约' + // formModel.customStoreEntities.length = 0 + // formModel.customType = 0 + // openModal() + // } else + if (opendata.newFormAction === FormAction.UPDATE) { doRequest(getDetail({ id: opendata.record?.customId }), { onSuccess: handleSuccess }) diff --git a/src/views/login/components/LoginContent.vue b/src/views/login/components/LoginContent.vue index 4045a48..edaf63e 100644 --- a/src/views/login/components/LoginContent.vue +++ b/src/views/login/components/LoginContent.vue @@ -80,6 +80,7 @@ import { projectTitle, projectDesc, enableLoginCaptcha } from '@/config' import { SliderCaptcha as LoginCaptcha } from '@/components/Captcha' import { useI18n } from 'vue-i18n' import { getCodeData } from '@/api/auth' +import { queryUserScope } from '@/api/system/user/index' // import useAdminWebSocket from '@/hooks/websocket' const { t } = useI18n() @@ -136,7 +137,10 @@ function store(res: LoginResult) { roleCodes, permissions } - + // 获取角色 + queryUserScope(info.userId).then(result => { + userStore.roleCodes = result.data.roleCodes + }) // TODO 自动登录处理 // const ttl = res.expires_in * 1000 // const refreshToken = res.refresh_token @@ -172,7 +176,6 @@ function handleSubmit(captchaId?: string) { store(res) const nextPath = (router.currentRoute.value.query.redirect as string) || '/' router.push(nextPath) - // 获取 WebSocket 连接对象 // const webSocket = // useAdminWebSocket() diff --git a/src/views/qualityInspectionDistribution/inspectionIndex.vue b/src/views/qualityInspectionDistribution/inspectionIndex.vue index ebf056a..ae0fcb1 100644 --- a/src/views/qualityInspectionDistribution/inspectionIndex.vue +++ b/src/views/qualityInspectionDistribution/inspectionIndex.vue @@ -20,7 +20,7 @@ @@ -110,14 +110,14 @@ const columns: ProColumns[] = [ dataIndex: 'customName' }, { - title: '客户类型', + title: '分发类型', dataIndex: 'customType', width: 80, customRender: ({ record }: any) => { if (record.customType == 0) { - return h('div', 'A型') + return h('div', '地理分发') } else if (record.customType == 1) { - return h('div', 'B型') + return h('div', '基础分发') } } }, diff --git a/src/views/qualityInspectionDistribution/inspectionModal.vue b/src/views/qualityInspectionDistribution/inspectionModal.vue index 3283815..70aba99 100644 --- a/src/views/qualityInspectionDistribution/inspectionModal.vue +++ b/src/views/qualityInspectionDistribution/inspectionModal.vue @@ -5,56 +5,30 @@ :visible="visible" :mask-closable="false" :centered="true" - :body-style="{ padding: '0px 40px 8px' }" + :body-style="{ + padding: '0px 40px 8px', + minHeight: '65vh', + maxHeight: '85vh', + overflowY: 'scroll' + }" :get-container="() => $refs.refModal" :confirm-loading="submitLoading" :width="850" @cancel="handleClose" > - - - - - - - - - - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +

- +
@@ -298,7 +313,7 @@
-
+
@@ -386,7 +385,7 @@ :allow-clear="title === '新建预约' || title === '编辑预约' || title === '编辑'" :options="item.option" :class="reservationTimeClass" - :style="{ width: title === '详情' || title === '回单' ? '103%' : '100%' }" + :style="{ width: title === '详情' ? '103%' : '100%' }" > @@ -398,42 +397,24 @@

您提交的表单信息为:

称呼:{{ formModel.customName }}

联系方式:{{ formModel.customNid }}

-
+

备注:{{ formModel.remark }}

+

{{ `报名的门店${index + 1}为` }}:{{ item.storeName }}  {{ item.reservationDate?.toString().split(' ')[0] }} @@ -475,53 +456,98 @@ import { getStoreData } from '@/api/geopoliticalCustomers' import type { CustomerDTO, GeopoliticalCustomersRecord } from '@/api/geopoliticalCustomers/types' +import { getfFindDirectSalesman } from '@/api/directResources/index' import axios from 'axios' //获取当前账号角色 import { useUserStore } from '@/stores/user-store' const { userInfo } = useUserStore() const userInfoCurrent = ref('') -//省市区二级 -// import { provincesAndCitiesAndAutonomousRegions } from '@/utils/geopolitical-customers' +interface customStoreEntitiesItem { + //门店id + customStoreId?: number + //预约id + storeId: number + //门店名称 + storeName?: string + //预约日期 + reservationDate?: Dayjs | string + //预约时间 + reservationTime: string +} -//dom中可以写成:rules = 'rulesData' -// const rulesData = { -// required: true, -// trigger: 'change' -// } +const emits = defineEmits<{ + (e: 'submit-success', resetPageIndex?: boolean): void +}>() +const { title, visible, openModal, closeModal } = useModal() -onMounted(() => { - //省市区三级下拉框列表数据 - provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions - //省市区二级下拉框列表数据 - // if (provincesAndCitiesAndAutonomousRegions) { - // const addressArray = JSON.parse(JSON.stringify(provincesAndCitiesAndAutonomousRegions)) - // const arr: any[] = [] - // addressArray.forEach((item: any) => { - // item.children.forEach((it: any) => { - // if (it.children) { - // delete it.children - // } - // }) - // arr.push(item) - // }) - // provincesAndCitiesAndAutonomousOptions.value = arr - // } - //获取当前账号角色 - userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString() +const { formAction } = useFormAction() +// 表单模型 +const formModel = reactive({ + customType: undefined, + customId: undefined, + customName: '', + customNid: '', + remark: '', + address: [], // 详细地址 + abbreviateAddress: [], // 简略地址 + sex: 0, + customInformation: '', + economize: '', + market: '', + distinguish: '', + detailAddress: '', + otherAddressesInfo: '', + radius: '', + enrollStatus: 1, + customStoreEntities: [], + salesmanUserId: [] }) +const formRule = ref({ + customName: [{ required: true, message: '请输入称呼', trigger: ['blur', 'change'] }], + customNid: [ + { + required: true, + message: '请输入正确的手机号码', + pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, + trigger: ['blur', 'change'] + } + ], + address: [{ required: true, message: '请选择地址信息', trigger: ['blur', 'change'] }], + detailAddress: [{ required: true, message: '请输入小区名称', trigger: 'change' }], + radius: [{ required: true, message: '请选择区域半径', trigger: 'change' }] +}) + +// 表单的提交请求 +const formRequestMapping: FormRequestMapping = { + [FormAction.CREATE]: addCustomer, + [FormAction.UPDATE]: auditCustomer +} + +// 获取 useAdminForm 的返回值 +const adminForm = useAdminForm(formAction, formRequestMapping, formModel, formRule) + +// 使用 toRefs 创建响应式解构副本 +const { submitLoading, validateAndSubmit, resetFields, validateInfos } = toRefs(adminForm) + +//是否发送请求了,发送了就要执行表格刷新 +const isSubmit = ref(false) //当前激活 tab 面板的 key -const activeKey = ref('') +const activeKey = ref(1) //tabs change事件 -const tabsChange = (val: string) => { - handleMapInit() +const tabsChange = (val: number) => { // formRef.value?.resetFields() formRef.value?.clearValidate() - if (val === '1') { - formModel.customType = 0 - } else { - formModel.customType = 1 + formModel.customType = val + // formModel.address = [] + // formModel.detailAddress = '' + if (val === 0) { + handleMapInit().then(() => { + if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { + match(formModel.detailAddress) + } + }) } } @@ -562,6 +588,8 @@ const formRef = ref() //省市区下拉框列表数据 const provincesAndCitiesAndAutonomousOptions: any = ref([]) +//省市下拉框列表数据 +const provincesAndCities: any = ref([]) //省市区change const addressChange = async (value: any) => { // if (infoWindows.value) { @@ -609,10 +637,36 @@ const radiusOptions = ref([ const radiusChange = (value: SelectValue) => { formModel.radius = value } - +// 业务员 +let userList: any = [] //根据地址搜索出来的门店数据 const listData: any = ref([]) +onMounted(() => { + //省市区三级下拉框列表数据 + provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions + //省市二级下拉框列表数据 + const arr: any[] = [] + const addressArray = JSON.parse( + JSON.stringify(window.globalProvincesAndCitiesAndAutonomousRegions) + ) + addressArray.forEach((item: any) => { + item.children.forEach((it: any) => { + it.children && delete it.children + }) + arr.push(item) + }) + provincesAndCities.value = arr + //获取当前账号角色 + userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString() +}) +const initUserList = () => { + doRequest(getfFindDirectSalesman(23), { + onSuccess: (res: any) => { + userList = res.data + } + }) +} //预约时间下拉框列表数据(根据后端返回的营业时间生成) const generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => { const startHour = Number(tradeStartTime.split(':')[0]) @@ -893,7 +947,6 @@ const getCenterMarkerAddress = () => { } }) } - //经纬度 const lng = ref() const lat = ref() @@ -1105,7 +1158,7 @@ const idThen = (detailAddress: string) => { } //匹配 const match = async (detailAddress: string) => { - if (activeKey.value === '1') { + if (activeKey.value === 0) { if (title.value === '新建预约' && formModel.customStoreEntities.length !== 0) { matchregisterVisible.value = true } else { @@ -1121,9 +1174,7 @@ const match = async (detailAddress: string) => { }) } } else { - if (title.value === '新建预约' && formModel.customStoreEntities.length !== 0) { - matchregisterVisible.value = true - } else if (title.value === '编辑') { + if (title.value === '编辑') { const fields = ['address', 'detailAddress', 'radius'] // 指定要校验的字段名 formRef.value ?.validateFields(fields) @@ -1197,7 +1248,10 @@ const storeResetForm = () => { formModel.customName = '' formModel.customNid = '' formModel.remark = '' - if (title.value === '详情' || title.value === '回单' || title.value === '新建预约') { + formModel.customInformation = '' + formModel.salesmanUserId = [] + formModel.abbreviateAddress = [] + if (formModel.customType == 0) { formModel.address = [] formModel.detailAddress = '' formModel.radius = '5000' @@ -1217,7 +1271,7 @@ const showModal = () => { formRef.value ?.validate() .then(() => { - if (activeKey.value === '1') { + if (activeKey.value === 0) { if (formModel.customStoreEntities.length === 0) { message.info('请先添加预约门店') } else { @@ -1233,20 +1287,7 @@ const showModal = () => { console.log('校验失败err', err) }) } -interface customStoreEntitiesItem { - //门店id - customStoreId?: number - //预约id - storeId: number - //门店名称 - storeName?: string - //预约日期 - reservationDate?: Dayjs | string - //预约时间 - reservationTime: string -} -//是否发送请求了,发送了就要执行表格刷新 -const isSubmit = ref(false) + //报名、暂存提交请求操作 const submitOperate = () => { //移除address属性 @@ -1274,7 +1315,12 @@ const submitOperate = () => { if (res.code === 200) { message.success('保存成功') isSubmit.value = true - updateCustomerAudit(formModel.customId as number, 1, userInfo!.salesmanType).then(res => { + updateCustomerAudit({ + customId: formModel.customId as number, + status: formModel.customType as number, + salesmanType: userInfo!.salesmanType, + salesmanUserId: formModel.salesmanUserId + }).then(res => { if (res.code == 200) { handleSubmit() registerVisible.value = false @@ -1294,11 +1340,6 @@ const submitOperate = () => { onSuccess: handleSuccess }) } - // else if (title.value === '回单') { - // doRequest(auditCustomer({ customId: formModel.customId, status: 1 }), { - // onSuccess: handleSuccess - // }) - // } } //报名信息确认弹窗确定点击事件 @@ -1342,74 +1383,6 @@ const temporaryStorage = async () => { }) } -//回单 -const distribute = () => { - formRef.value - ?.validate() - .then(() => { - if (formModel.customStoreEntities.length === 0) { - message.info('请先添加预约门店') - } else { - registerVisible.value = true - } - }) - .catch(err => { - console.log('校验失败err', err) - }) -} - -const emits = defineEmits<{ - (e: 'submit-success', resetPageIndex?: boolean): void -}>() - -const { title, visible, openModal, closeModal } = useModal() - -const { formAction } = useFormAction() -// 表单模型 -const formModel = reactive({ - customType: undefined, - customId: undefined, - customName: '', - customNid: '', - remark: '', - address: [], - economize: '', - market: '', - distinguish: '', - detailAddress: '', - otherAddressesInfo: '', - radius: '', - enrollStatus: 1, - customStoreEntities: [] -}) - -const formRule = ref({ - customName: [{ required: true, message: '请输入称呼', trigger: ['blur', 'change'] }], - customNid: [ - { - required: true, - message: '请输入正确的手机号码', - pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, - trigger: ['blur', 'change'] - } - ], - address: [{ required: true, message: '请选择地址信息', trigger: ['blur', 'change'] }], - detailAddress: [{ required: true, message: '请输入小区名称', trigger: 'change' }], - radius: [{ required: true, message: '请选择区域半径', trigger: 'change' }] -}) - -// 表单的提交请求 -const formRequestMapping: FormRequestMapping = { - [FormAction.CREATE]: addCustomer, - [FormAction.UPDATE]: auditCustomer -} - -// 获取 useAdminForm 的返回值 -const adminForm = useAdminForm(formAction, formRequestMapping, formModel, formRule) - -// 使用 toRefs 创建响应式解构副本 -const { submitLoading, validateAndSubmit, resetFields, validateInfos } = toRefs(adminForm) - //表单提交处理 const handleSubmit = () => { handleClose() @@ -1462,17 +1435,7 @@ const handleMapInit = async () => { defineExpose({ open(opendata: openObj) { isSubmit.value = false - // console.log('formModel.customType resssssssss', formModel.customType) - //不写resetFields.value()预约门店信息会反复追加进去,但是加了resetFields.value()会导致formModel.customType为0 - // resetFields.value() - // formModel.customType = undefined formModel.customStoreEntities = [] - // console.log('formModel.customType ddddddddddd', formModel.customType) - // if (userInfoCurrent.value === 'ROLE_REVIEWER') { - // formModel.customType = 1 - // } else if (userInfoCurrent.value === 'ROLE_PRELIMINARY_EXAMINER') { - // formModel.customType = 0 - // } const handleSuccess = (res: any) => { const data = res.data || {} const { @@ -1487,15 +1450,22 @@ defineExpose({ otherAddressesInfo, radius, customStoreVOList, - customType + customType, + salesmanUserId, + customInformation } = data formModel.customId = customId formModel.customName = customName formModel.customNid = customNid formModel.remark = remark + formModel.customInformation = customInformation || remark if (economize) { - formModel.address = [economize, market, distinguish] + if (customType == 0) { + formModel.address = [economize, market, distinguish] + } else if (customType == 1) { + formModel.abbreviateAddress = [economize, market] + } } else { formModel.address = [] } @@ -1505,7 +1475,7 @@ defineExpose({ formModel.distinguish = distinguish formModel.detailAddress = detailAddress formModel.customType = customType - + formModel.salesmanUserId = salesmanUserId formModel.otherAddressesInfo = otherAddressesInfo formModel.radius = radius formModel.customStoreEntities.push(...customStoreVOList) @@ -1513,67 +1483,36 @@ defineExpose({ formModel.customStoreEntities.forEach((i: any) => { i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime) }) - const getActiveKey = () => { - if (formModel.customType === 0) { - activeKey.value = '1' - } else { - activeKey.value = '2' - } - } if (opendata.type === 'audit') { - getActiveKey() - title.value = '编辑' - // if (formModel.address.length !== 0) { - // isAddressDisabled.value = true - // } - // if (formModel.radius) { - // isRadiusDisabled.value = true - // } - // if (formModel.detailAddress) { - // isDetailAddressDisabled.value = true - // } - handleMapInit().then(() => { - if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { - match(formModel.detailAddress) - } - }) - } else if (opendata.type === 'edit') { - getActiveKey() - title.value = '编辑预约' - if (formModel.address.length !== 0) { - isAddressDisabled.value = true - } - if (formModel.radius) { - isRadiusDisabled.value = true - } - if (formModel.detailAddress) { - isDetailAddressDisabled.value = true - } - handleMapInit().then(() => { - if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { - match(formModel.detailAddress) - } - }) - } else if (opendata.type === 'view') { - if (formModel.customType === 0) { - activeKey.value = '1' - } else { - activeKey.value = '2' + activeKey.value = formModel.customType || 0 + if (activeKey.value === 0) { + handleMapInit().then(() => { + if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { + match(formModel.detailAddress) + } + }) } - title.value = '详情' - isAddressReadOnly.value = true - isRadiusReadOnly.value = true - isDetailAddressReadOnly.value = true - isReservationTimeisReadOnly.value = true - } else if (opendata.type === 'distribute') { - getActiveKey() - title.value = '回单' - isAddressReadOnly.value = true - isRadiusReadOnly.value = true - isDetailAddressReadOnly.value = true - isReservationTimeisReadOnly.value = true - formModel.description = 1 + title.value = '编辑' } + // else if (opendata.type === 'edit') { + // console.log('2222222222') + // getActiveKey() + // title.value = '编辑预约' + // if (formModel.address.length !== 0) { + // isAddressDisabled.value = true + // } + // if (formModel.radius) { + // isRadiusDisabled.value = true + // } + // if (formModel.detailAddress) { + // isDetailAddressDisabled.value = true + // } + // handleMapInit().then(() => { + // if (formModel.address?.length !== 0 && formModel.detailAddress && formModel.radius) { + // match(formModel.detailAddress) + // } + // }) + // } openModal() } @@ -1581,6 +1520,7 @@ defineExpose({ doRequest(getDetail({ id: opendata.record?.customId }), { onSuccess: handleSuccess }) + initUserList() } formAction.value = opendata.newFormAction } @@ -1786,7 +1726,22 @@ const storeItemClick = (item: any, index: number) => { // ::v-deep .ant-form-item-explain-success { // display: none !important; // } - +.a-label { + align-items: center; + max-width: 100%; + height: 32px; + line-height: 32px; + text-align: right; + color: #000000d9; + font-size: 14px; + width: 160px; + &::after { + content: ':'; + position: relative; + top: -0.5px; + margin: 0 8px 0 2px; + } +} //请输入区域半径 .radius { ::v-deep .ant-form-item-control-input-content { diff --git a/src/views/qualityInspectionDistribution/inspectionSelectModal.vue b/src/views/qualityInspectionDistribution/inspectionSelectModal.vue index 8893191..1071a6d 100644 --- a/src/views/qualityInspectionDistribution/inspectionSelectModal.vue +++ b/src/views/qualityInspectionDistribution/inspectionSelectModal.vue @@ -12,8 +12,8 @@ @cancel="handleClose" > - - + + + + + + + + + + - + - - {{ item.label }} - + @@ -98,21 +130,21 @@

取消 重审 - 分发 + > -->
@@ -131,6 +163,7 @@ import { useUserStore } from '@/stores/user-store' import { doRequest } from '@/utils/axios/request' import { getCustomDetails } from '@/api/geopoliticalCustomers' import type { SelectProps } from 'ant-design-vue' +import { getfFindDirectSalesman } from '@/api/directResources/index' //预约时间 import 'dayjs/locale/zh-cn' import { $ref } from 'vue/macros' @@ -160,6 +193,7 @@ interface SysUserPageVO { customType: number customStoreVOList: ReservationShop[] reviewUserId: number | undefined + customInformation: string } const formModel = reactive({ @@ -171,7 +205,8 @@ const formModel = reactive({ remark: '', customStoreVOList: [], enrollStatus: undefined, - reviewUserId: undefined + reviewUserId: undefined, + customInformation: '' }) // 表单校验规则 @@ -205,12 +240,12 @@ const toExamine = (type: number) => { formRef.value .validate() .then(() => { - updateCustomerAudit( - formModel.customId as number, - type, - userInfo!.salesmanType, - formModel.reviewUserId - ).then(res => { + updateCustomerAudit({ + customId: formModel.customId as number, + status: type, + salesmanType: userInfo!.salesmanType, + reviewUserId: formModel.reviewUserId + }).then(res => { message.info({ content: h('span', { style: 'white-space: pre-wrap;' }, res.message) }) @@ -230,17 +265,22 @@ const selectedReviewerOptions = ref([]) defineExpose({ open(newFormAction: FormAction, id: number) { selectedReviewerOptions.value = [] - doRequest(selectedReviewerList(), { + // doRequest(selectedReviewerList(), { + // onSuccess: (res: any) => { + // const a = res.data.map((item: any) => { + // return { label: item.name, value: item.value } + // }) + // a.forEach((item: any) => { + // selectedReviewerOptions.value?.push({ + // label: item.label, + // value: item.value + // }) + // }) + // } + // }) + doRequest(getfFindDirectSalesman(21), { onSuccess: (res: any) => { - const a = res.data.map((item: any) => { - return { label: item.name, value: item.value } - }) - a.forEach((item: any) => { - selectedReviewerOptions.value?.push({ - label: item.label, - value: item.value - }) - }) + selectedReviewerOptions.value = res.data } }) openModal() @@ -252,6 +292,7 @@ defineExpose({ onSuccess: (res: any) => { record = res.data record.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}` + record.customInformation = record.customInformation || record.remark overrideProperties(formModel, record) record.customStoreVOList.forEach((item: any) => { const targetObj = formModel.customStoreVOList.find( diff --git a/vite.config.ts b/vite.config.ts index 53047d0..55be9d4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -20,7 +20,7 @@ import { projectTitle } from './src/config' import { antdvStyleDeps } from './src/utils/resolvers' //xy -// export const serverAddress = 'http://172.18.0.225:8000' +export const serverAddress = 'http://172.18.0.225:8000' //jt // export const serverAddress = 'http://172.18.1.8:8000' //ts @@ -29,7 +29,7 @@ import { antdvStyleDeps } from './src/utils/resolvers' // export const serverAddress = 'http://39.100.77.21:8000' //线上域名,现在用这个 -export const serverAddress = 'https://byffp.top' +// export const serverAddress = 'https://byffp.top' export default defineConfig({ server: {