From 9e99f1336ce7bf6eaaccb9322f637403aef5c6f7 Mon Sep 17 00:00:00 2001 From: wangzeyan <258785420@qq.com> Date: Sun, 18 May 2025 14:18:50 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/components/TencentMapPicker.vue | 44 ++++++++++++++++++----- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/admin/src/components/TencentMapPicker.vue b/admin/src/components/TencentMapPicker.vue index 89894672..3a9654f8 100644 --- a/admin/src/components/TencentMapPicker.vue +++ b/admin/src/components/TencentMapPicker.vue @@ -344,15 +344,34 @@ const initMap = () => { } const TMap = (window as any).TMap - const center = new TMap.LatLng(20.029077, 110.366367) + let center + + // 优先使用传入的坐标 + if (props.modelValue.lat && props.modelValue.lng) { + center = new TMap.LatLng(props.modelValue.lat, props.modelValue.lng) + } else { + // 默认使用北京坐标 + center = new TMap.LatLng(39.90403, 116.407526) + } + // 创建地图实例 map = new TMap.Map('container', { center, zoom: 12, }) + // 创建标记 marker = createMarker(map) + // 初始化时设置标记位置 + if (props.modelValue.lat && props.modelValue.lng) { + marker.updateGeometries({ + id: 'center', + position: new TMap.LatLng(props.modelValue.lat, props.modelValue.lng), + }) + } + + // 地图点击事件 map.on('click', (evt: any) => { map.setCenter(evt.latLng) marker.updateGeometries({ @@ -455,16 +474,23 @@ const handleError = (error: any) => { watch( () => props.modelValue, (newVal) => { - if (newVal.lat && newVal.lng && map) { - const latLng = new (window as any).TMap.LatLng(newVal.lat, newVal.lng) - map.setCenter(latLng) - marker?.updateGeometries({ - id: 'center', - position: latLng, - }) + if (newVal?.lat && newVal?.lng && map) { + try { + const latLng = new (window as any).TMap.LatLng(newVal.lat, newVal.lng) + map.setCenter(latLng) + marker?.updateGeometries({ + id: 'center', + position: latLng, + }) + } catch (error) { + console.warn('地图更新失败:', error) + } } }, - { immediate: true } + { + deep: true, + immediate: true, + } ) onBeforeUnmount(() => { From 50a099dc4ff1175da1cc1b5a36f01319dc7bc9ca Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Sun, 18 May 2025 16:43:53 +0800 Subject: [PATCH 02/10] =?UTF-8?q?feat(personnel):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Personnel 控制器中添加 edit 方法,用于处理员工信息修改请求 - 在 route.php 中添加对应的路由 - 在 PersonnelService 中实现 edit 方法,用于更新员工信息 --- .../controller/apiController/Personnel.php | 24 +++++++++++++ niucloud/app/api/route/route.php | 2 ++ .../api/apiService/PersonnelService.php | 34 +++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/niucloud/app/api/controller/apiController/Personnel.php b/niucloud/app/api/controller/apiController/Personnel.php index 55f10784..fc0ed492 100644 --- a/niucloud/app/api/controller/apiController/Personnel.php +++ b/niucloud/app/api/controller/apiController/Personnel.php @@ -42,6 +42,30 @@ class Personnel extends BaseApiService return success($res); } + //员工修改 + public function edit(Request $request){ + $params = $request->all(); + $data = [ + 'head_img'=>$params['head_img'],//头像|绝对地址 + 'name'=>$params['name'],//姓名 + 'address'=>$params['address'],//住址 + 'gender'=>$params['gender'],//性别 + 'birthday'=>$params['birthday'],//生日 + 'email'=>$params['email'],//邮箱 + 'phone'=>$params['phone'],//手机号 + 'wx'=>$params['wx'],//微信号 + ]; + //获取员工信息 + $where = [ + 'id'=>$this->member_id, + ]; + $res = (new PersonnelService())->edit($where,$data); + if(!$res['code']){ + return fail('操作失败'); + } + return success([]); + } + /** * 登录 * @return Response diff --git a/niucloud/app/api/route/route.php b/niucloud/app/api/route/route.php index 7affb5ff..b6013152 100644 --- a/niucloud/app/api/route/route.php +++ b/niucloud/app/api/route/route.php @@ -199,6 +199,8 @@ Route::group(function() { Route::post('uploadImage', 'upload.Upload/image'); //员工端详情 Route::get('personnel/info', 'apiController.Personnel/info'); + //员工端-修改 + Route::post('personnel/edit', 'apiController.Personnel/edit'); diff --git a/niucloud/app/service/api/apiService/PersonnelService.php b/niucloud/app/service/api/apiService/PersonnelService.php index 1baf1e1d..c8c7ab54 100644 --- a/niucloud/app/service/api/apiService/PersonnelService.php +++ b/niucloud/app/service/api/apiService/PersonnelService.php @@ -68,6 +68,40 @@ class PersonnelService extends BaseApiService } + //员工信息-修改 + public function edit(array $where,array $data){ + $data['update_time'] = date('Y-m-d H:i:s'); + + if(!$where){ + return [ + 'code'=>0, + 'msg'=>'查询条件不能为空' + ]; + } + + $model = $this->model; + if(!empty($where['id'])){ + $model = $model->where('id',$where['id']); + } + $res = $model->update($data);//员工信息 + + if($res){ + $res = [ + 'code'=>1, + 'msg'=>'操作成功' + ]; + }else{ + $res = [ + 'code'=>0, + 'msg'=>'操作失败' + ]; + } + return $res; + + } + + + /** * 获取会员的模型对象(todo 慎用!!! 现主要用于登录) From 275211cb834fe24fef08e6c4c8130f5d1094e4d0 Mon Sep 17 00:00:00 2001 From: "1213317725@qq.com" <1213317725@qq.com> Date: Sun, 18 May 2025 17:38:53 +0800 Subject: [PATCH 03/10] 1 --- admin/components.d.ts | 4 - admin/src/app/api/customer_resources.ts | 30 +- admin/src/app/api/six_speed.ts | 27 +- admin/src/app/api/sys.ts | 12 + ...customer_resources.customer_resources.json | 74 +- .../app/lang/zh-cn/six_speed.six_speed.json | 62 +- .../components/customer-resources-edit.vue | 1111 +++++++++-------- .../customer_resources/customer_resources.vue | 542 ++++---- .../six_speed/components/six-speed-edit.vue | 681 +++++----- admin/src/app/views/six_speed/six_speed.vue | 586 ++++----- .../customer_resources/CustomerResources.php | 46 +- .../controller/six_speed/SixSpeed.php | 34 +- .../app/adminapi/route/customer_resources.php | 4 + niucloud/app/adminapi/route/six_speed.php | 5 + niucloud/app/common.php | 28 + .../customer_resources/CustomerResources.php | 6 + niucloud/app/model/six_speed/SixSpeed.php | 184 +-- .../CustomerResourcesService.php | 151 ++- .../admin/six_speed/SixSpeedService.php | 16 +- niucloud/app/validate/six_speed/SixSpeed.php | 8 +- 20 files changed, 1703 insertions(+), 1908 deletions(-) diff --git a/admin/components.d.ts b/admin/components.d.ts index e5b7f07b..266a85b9 100644 --- a/admin/components.d.ts +++ b/admin/components.d.ts @@ -10,7 +10,6 @@ declare module '@vue/runtime-core' { Attachment: typeof import('./src/components/upload-attachment/attachment.vue')['default'] DiyLink: typeof import('./src/components/diy-link/index.vue')['default'] Editor: typeof import('./src/components/editor/index.vue')['default'] - ElAlert: typeof import('element-plus/es')['ElAlert'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] @@ -45,7 +44,6 @@ declare module '@vue/runtime-core' { ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] - ElResult: typeof import('element-plus/es')['ElResult'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] @@ -58,8 +56,6 @@ declare module '@vue/runtime-core' { ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] - ElTimeline: typeof import('element-plus/es')['ElTimeline'] - ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] diff --git a/admin/src/app/api/customer_resources.ts b/admin/src/app/api/customer_resources.ts index da9d8f53..54b50473 100644 --- a/admin/src/app/api/customer_resources.ts +++ b/admin/src/app/api/customer_resources.ts @@ -1,5 +1,9 @@ import request from '@/utils/request' + + + + // USER_CODE_BEGIN -- customer_resources /** * 获取客户资源列表 @@ -7,7 +11,7 @@ import request from '@/utils/request' * @returns */ export function getCustomerResourcesList(params: Record) { - return request.get(`customer_resources/customer_resources`, { params }) + return request.get(`customer_resources/customer_resources`, {params}) } /** @@ -16,7 +20,7 @@ export function getCustomerResourcesList(params: Record) { * @returns */ export function getCustomerResourcesInfo(id: number) { - return request.get(`customer_resources/customer_resources/${id}`) + return request.get(`customer_resources/customer_resources/${id}`); } /** @@ -25,10 +29,7 @@ export function getCustomerResourcesInfo(id: number) { * @returns */ export function addCustomerResources(params: Record) { - return request.post('customer_resources/customer_resources', params, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.post('customer_resources/customer_resources', params, { showErrorMessage: true, showSuccessMessage: true }) } /** @@ -38,11 +39,7 @@ export function addCustomerResources(params: Record) { * @returns */ export function editCustomerResources(params: Record) { - return request.put( - `customer_resources/customer_resources/${params.id}`, - params, - { showErrorMessage: true, showSuccessMessage: true } - ) + return request.put(`customer_resources/customer_resources/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) } /** @@ -51,14 +48,13 @@ export function editCustomerResources(params: Record) { * @returns */ export function deleteCustomerResources(id: number) { - return request.delete(`customer_resources/customer_resources/${id}`, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.delete(`customer_resources/customer_resources/${id}`, { showErrorMessage: true, showSuccessMessage: true }) } -export function getWithCampusList(params: Record) { - return request.get('customer_resources/campus_all', { params }) +export function getWithPersonnelList(params: Record){ + return request.get('customer_resources/personnel_all', {params}) +}export function getWithCampusList(params: Record){ + return request.get('customer_resources/campus_all', {params}) } // USER_CODE_END -- customer_resources diff --git a/admin/src/app/api/six_speed.ts b/admin/src/app/api/six_speed.ts index 46a63f72..05791561 100644 --- a/admin/src/app/api/six_speed.ts +++ b/admin/src/app/api/six_speed.ts @@ -1,5 +1,7 @@ import request from '@/utils/request' + + // USER_CODE_BEGIN -- six_speed /** * 获取六一速列表 @@ -7,7 +9,7 @@ import request from '@/utils/request' * @returns */ export function getSixSpeedList(params: Record) { - return request.get(`six_speed/six_speed`, { params }) + return request.get(`six_speed/six_speed`, {params}) } /** @@ -16,7 +18,7 @@ export function getSixSpeedList(params: Record) { * @returns */ export function getSixSpeedInfo(id: number) { - return request.get(`six_speed/six_speed/${id}`) + return request.get(`six_speed/six_speed/${id}`); } /** @@ -25,10 +27,7 @@ export function getSixSpeedInfo(id: number) { * @returns */ export function addSixSpeed(params: Record) { - return request.post('six_speed/six_speed', params, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.post('six_speed/six_speed', params, { showErrorMessage: true, showSuccessMessage: true }) } /** @@ -38,10 +37,7 @@ export function addSixSpeed(params: Record) { * @returns */ export function editSixSpeed(params: Record) { - return request.put(`six_speed/six_speed/${params.id}`, params, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.put(`six_speed/six_speed/${params.id}`, params, { showErrorMessage: true, showSuccessMessage: true }) } /** @@ -50,10 +46,13 @@ export function editSixSpeed(params: Record) { * @returns */ export function deleteSixSpeed(id: number) { - return request.delete(`six_speed/six_speed/${id}`, { - showErrorMessage: true, - showSuccessMessage: true, - }) + return request.delete(`six_speed/six_speed/${id}`, { showErrorMessage: true, showSuccessMessage: true }) +} + +export function getWithPersonnelList(params: Record){ + return request.get('six_speed/personnel_all', {params}) +}export function getWithCustomerResourcesList(params: Record){ + return request.get('six_speed/customer_resources_all', {params}) } // USER_CODE_END -- six_speed diff --git a/admin/src/app/api/sys.ts b/admin/src/app/api/sys.ts index 285cc133..2ae8b5b0 100644 --- a/admin/src/app/api/sys.ts +++ b/admin/src/app/api/sys.ts @@ -720,3 +720,15 @@ export function deleteExport(id: number) { export function getInstallConfig() { return request.get('sys/install/config') } + + + +//业绩配置 + +export function getYjpzConfig() { + return request.get('sys/get_yjpz_config') +} + +export function yjpzConfig(params: Record) { + return request.post(`sys/yjpz_config`, params) +} diff --git a/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json b/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json index 1a539222..57befe1e 100644 --- a/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json +++ b/admin/src/app/lang/zh-cn/customer_resources.customer_resources.json @@ -1,38 +1,38 @@ { - "source": "来源", - "sourcePlaceholder": "请输入来源", - "sourceChannel": "来源渠道", - "sourceChannelPlaceholder": "请输入来源渠道", - "consultant": "顾问", - "name": "姓名", - "namePlaceholder": "请输入姓名", - "age": "年龄", - "agePlaceholder": "请输入年龄", - "gender": "性别", - "genderPlaceholder": "请输入性别", - "phoneNumber": "联系电话", - "phoneNumberPlaceholder": "请输入联系电话", - "demand": "需求", - "demandPlaceholder": "请输入需求", - "purchasingPower": "购买力", - "purchasingPowerPlaceholder": "请输入购买力", - "cognitiveIdea": "认知理念", - "cognitiveIdeaPlaceholder": "请输入认知理念", - "optionalClassTime": "可选上课时间", - "optionalClassTimePlaceholder": "请输入可选上课时间", - "distance": "距离", - "distancePlaceholder": "请输入距离", - "decisionMaker": "决策人", - "decisionMakerPlaceholder": "请输入决策人", - "initialIntent": "客户初步意向度", - "initialIntentPlaceholder": "请输入客户初步意向度", - "campus": "所属校区", - "campusPlaceholder": "请输入所属校区", - "status": "客户状态", - "statusPlaceholder": "请输入客户状态", - "addCustomerResources": "添加客户资源", - "updateCustomerResources": "编辑客户资源", - "customerResourcesDeleteTips": "确定要删除该数据吗?", - "startDate": "请选择开始时间", - "endDate": "请选择结束时间" -} + "source":"来源", + "sourcePlaceholder":"请输入来源", + "sourceChannel":"来源渠道", + "sourceChannelPlaceholder":"请输入来源渠道", + "consultant":"顾问", + "name":"姓名", + "namePlaceholder":"请输入姓名", + "age":"年龄", + "agePlaceholder":"请输入年龄", + "gender":"性别", + "genderPlaceholder":"请输入性别", + "phoneNumber":"联系电话", + "phoneNumberPlaceholder":"请输入联系电话", + "demand":"需求", + "demandPlaceholder":"请输入需求", + "purchasingPower":"购买力", + "purchasingPowerPlaceholder":"请输入购买力", + "cognitiveIdea":"认知理念", + "cognitiveIdeaPlaceholder":"请输入认知理念", + "optionalClassTime":"可选上课时间", + "optionalClassTimePlaceholder":"请输入可选上课时间", + "distance":"距离", + "distancePlaceholder":"请输入距离", + "decisionMaker":"决策人", + "decisionMakerPlaceholder":"请输入决策人", + "initialIntent":"客户初步意向度", + "initialIntentPlaceholder":"请输入客户初步意向度", + "campus":"所属校区", + "campusPlaceholder":"请输入所属校区", + "status":"客户状态", + "statusPlaceholder":"请输入客户状态", + "addCustomerResources":"添加客户资源", + "updateCustomerResources":"编辑客户资源", + "customerResourcesDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/six_speed.six_speed.json b/admin/src/app/lang/zh-cn/six_speed.six_speed.json index ad597a10..07515f52 100644 --- a/admin/src/app/lang/zh-cn/six_speed.six_speed.json +++ b/admin/src/app/lang/zh-cn/six_speed.six_speed.json @@ -1,35 +1,29 @@ { - "id": "编号", - "idPlaceholder": "请输入编号", - "purchasePower": "需求购买力", - "purchasePowerPlaceholder": "请输入需求购买力", - "conceptAwareness": "认知理念", - "conceptAwarenessPlaceholder": "请输入认知理念", - "preferredClassTime": "可选上课时间", - "preferredClassTimePlaceholder": "请输入可选上课时间", - "distance": "距离", - "distancePlaceholder": "请输入距离", - "communication": "沟通备注", - "communicationPlaceholder": "请输入沟通备注", - "promisedVisitTime": "承诺到访时间", - "promisedVisitTimePlaceholder": "请输入承诺到访时间", - "actualVisitTime": "实际到访时间", - "actualVisitTimePlaceholder": "请输入实际到访时间", - "callIntent": "电话后的意向程度: low-低, medium-中, high-高", - "callIntentPlaceholder": "请输入电话后的意向程度: low-低, medium-中, high-高", - "firstVisitStatus": "一访情况", - "firstVisitStatusPlaceholder": "请输入一访情况", - "secondVisitStatus": "二访情况", - "secondVisitStatusPlaceholder": "请输入二访情况", - "isClosed": "是否关单: 1-是, 0-否", - "isClosedPlaceholder": "请输入是否关单: 1-是, 0-否", - "staffId": "人员ID", - "staffIdPlaceholder": "请输入人员ID", - "resourceId": "资源ID", - "resourceIdPlaceholder": "请输入资源ID", - "addSixSpeed": "添加六一速", - "updateSixSpeed": "编辑六一速", - "sixSpeedDeleteTips": "确定要删除该数据吗?", - "startDate": "请选择开始时间", - "endDate": "请选择结束时间" -} + "purchasePower":"需求购买力", + "purchasePowerPlaceholder":"请输入需求购买力", + "conceptAwareness":"认知理念", + "conceptAwarenessPlaceholder":"请输入认知理念", + "preferredClassTime":"可选上课时间", + "preferredClassTimePlaceholder":"请输入可选上课时间", + "distance":"距离", + "distancePlaceholder":"请输入距离", + "communication":"沟通备注", + "communicationPlaceholder":"请输入沟通备注", + "promisedVisitTime":"承诺到访时间", + "promisedVisitTimePlaceholder":"请输入承诺到访时间", + "actualVisitTime":"实际到访时间", + "actualVisitTimePlaceholder":"请输入实际到访时间", + "callIntent":"电话后的意向程度", + "callIntentPlaceholder":"请输入电话后的意向程度", + "firstVisitStatus":"一访情况", + "firstVisitStatusPlaceholder":"请输入一访情况", + "secondVisitStatus":"二访情况", + "secondVisitStatusPlaceholder":"请输入二访情况", + "isClosed":"是否关单", + "isClosedPlaceholder":"请输入是否关单", + "addSixSpeed":"添加六一速", + "updateSixSpeed":"编辑六一速", + "sixSpeedDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/app/views/customer_resources/components/customer-resources-edit.vue b/admin/src/app/views/customer_resources/components/customer-resources-edit.vue index 8ba98fce..2b9beb29 100644 --- a/admin/src/app/views/customer_resources/components/customer-resources-edit.vue +++ b/admin/src/app/views/customer_resources/components/customer-resources-edit.vue @@ -1,553 +1,574 @@ + .diy-dialog-wrap .el-form-item__label { + height: auto !important; + } + \ No newline at end of file diff --git a/admin/src/app/views/customer_resources/customer_resources.vue b/admin/src/app/views/customer_resources/customer_resources.vue index 834d68a9..047a83c0 100644 --- a/admin/src/app/views/customer_resources/customer_resources.vue +++ b/admin/src/app/views/customer_resources/customer_resources.vue @@ -1,311 +1,231 @@ - - - - - + + + + + diff --git a/admin/src/app/views/six_speed/components/six-speed-edit.vue b/admin/src/app/views/six_speed/components/six-speed-edit.vue index 6981866c..85cd6e1a 100644 --- a/admin/src/app/views/six_speed/components/six-speed-edit.vue +++ b/admin/src/app/views/six_speed/components/six-speed-edit.vue @@ -1,358 +1,323 @@ - - - - - - + + + + + + diff --git a/admin/src/app/views/six_speed/six_speed.vue b/admin/src/app/views/six_speed/six_speed.vue index a1401496..1ac9bf8c 100644 --- a/admin/src/app/views/six_speed/six_speed.vue +++ b/admin/src/app/views/six_speed/six_speed.vue @@ -1,372 +1,214 @@ - - - - - + + + + + diff --git a/niucloud/app/adminapi/controller/customer_resources/CustomerResources.php b/niucloud/app/adminapi/controller/customer_resources/CustomerResources.php index 9ec70666..f9152768 100644 --- a/niucloud/app/adminapi/controller/customer_resources/CustomerResources.php +++ b/niucloud/app/adminapi/controller/customer_resources/CustomerResources.php @@ -64,13 +64,23 @@ class CustomerResources extends BaseAdminController ["initial_intent",""], ["campus",""], ["status",""], - ["create_year_month",date("Y-m")], - ["create_date",date("Y-m-d")] - ]); + ["create_year_month",date("Y-m")], + ["create_date",date("Y-m-d")], + ["purchase_power",""], + ["concept_awareness",""], + ["preferred_class_time",""], + ["distance_tow",""], + ["communication",""], + ["promised_visit_time",""], + ["actual_visit_time",""], + ["call_intent",""], + ["first_visit_status",""], + ["second_visit_status",""], + ["is_closed",""] + ]); $this->validate($data, 'app\validate\customer_resources\CustomerResources.add'); - $id = (new CustomerResourcesService())->add($data); - return success('ADD_SUCCESS', ['id' => $id]); + return (new CustomerResourcesService())->add($data); } /** @@ -94,11 +104,27 @@ class CustomerResources extends BaseAdminController ["decision_maker",""], ["initial_intent",""], ["campus",""], - ["status",""] + ["status",""], + ["create_year_month",date("Y-m")], + ["create_date",date("Y-m-d")], + + ["purchase_power",""], + ["concept_awareness",""], + ["preferred_class_time",""], + ["distance_tow",""], + ["communication",""], + ["promised_visit_time",""], + ["actual_visit_time",""], + ["call_intent",""], + ["first_visit_status",""], + ["second_visit_status",""], + ["is_closed",""] + + ]); $this->validate($data, 'app\validate\customer_resources\CustomerResources.edit'); - (new CustomerResourcesService())->edit($id, $data); - return success('EDIT_SUCCESS'); + + return (new CustomerResourcesService())->edit($id, $data); } /** @@ -112,6 +138,10 @@ class CustomerResources extends BaseAdminController } + public function getPersonnelAll(){ + return success(( new CustomerResourcesService())->getPersonnelAll()); + } + public function getCampusAll(){ return success(( new CustomerResourcesService())->getCampusAll()); } diff --git a/niucloud/app/adminapi/controller/six_speed/SixSpeed.php b/niucloud/app/adminapi/controller/six_speed/SixSpeed.php index c034d5b7..6a3164b3 100644 --- a/niucloud/app/adminapi/controller/six_speed/SixSpeed.php +++ b/niucloud/app/adminapi/controller/six_speed/SixSpeed.php @@ -28,19 +28,7 @@ class SixSpeed extends BaseAdminController */ public function lists(){ $data = $this->request->params([ - ["purchase_power",""], - ["concept_awareness",""], - ["preferred_class_time",""], - ["distance",""], - ["communication",""], - ["promised_visit_time",""], - ["actual_visit_time",""], - ["call_intent",""], - ["first_visit_status",""], - ["second_visit_status",""], - ["is_closed",""], - ["staff_id",""], - ["resource_id",""] + ]); return success((new SixSpeedService())->getPage($data)); } @@ -65,14 +53,12 @@ class SixSpeed extends BaseAdminController ["preferred_class_time",""], ["distance",""], ["communication",""], - ["promised_visit_time","2025-05-16 17:57:14"], - ["actual_visit_time","2025-05-16 17:57:14"], + ["promised_visit_time","2025-05-18 16:21:59"], + ["actual_visit_time","2025-05-18 16:21:59"], ["call_intent",""], ["first_visit_status",""], ["second_visit_status",""], ["is_closed",0], - ["staff_id",0], - ["resource_id",0], ]); $this->validate($data, 'app\validate\six_speed\SixSpeed.add'); @@ -92,14 +78,12 @@ class SixSpeed extends BaseAdminController ["preferred_class_time",""], ["distance",""], ["communication",""], - ["promised_visit_time","2025-05-16 17:57:14"], - ["actual_visit_time","2025-05-16 17:57:14"], + ["promised_visit_time","2025-05-18 16:21:59"], + ["actual_visit_time","2025-05-18 16:21:59"], ["call_intent",""], ["first_visit_status",""], ["second_visit_status",""], ["is_closed",0], - ["staff_id",0], - ["resource_id",0], ]); $this->validate($data, 'app\validate\six_speed\SixSpeed.edit'); @@ -118,4 +102,12 @@ class SixSpeed extends BaseAdminController } + public function getPersonnelAll(){ + return success(( new SixSpeedService())->getPersonnelAll()); + } + + public function getCustomerResourcesAll(){ + return success(( new SixSpeedService())->getCustomerResourcesAll()); + } + } diff --git a/niucloud/app/adminapi/route/customer_resources.php b/niucloud/app/adminapi/route/customer_resources.php index b612a5b3..7dc8c08a 100644 --- a/niucloud/app/adminapi/route/customer_resources.php +++ b/niucloud/app/adminapi/route/customer_resources.php @@ -18,6 +18,8 @@ use app\adminapi\middleware\AdminLog; + + // USER_CODE_BEGIN -- customer_resources Route::group('customer_resources', function () { @@ -33,6 +35,8 @@ Route::group('customer_resources', function () { //删除客户资源 Route::delete('customer_resources/:id', 'customer_resources.CustomerResources/del'); + Route::get('personnel_all','customer_resources.CustomerResources/getPersonnelAll'); + Route::get('campus_all','customer_resources.CustomerResources/getCampusAll'); })->middleware([ diff --git a/niucloud/app/adminapi/route/six_speed.php b/niucloud/app/adminapi/route/six_speed.php index 6d721f88..d84effe4 100644 --- a/niucloud/app/adminapi/route/six_speed.php +++ b/niucloud/app/adminapi/route/six_speed.php @@ -14,6 +14,7 @@ use think\facade\Route; use app\adminapi\middleware\AdminCheckRole; use app\adminapi\middleware\AdminCheckToken; use app\adminapi\middleware\AdminLog; + // USER_CODE_BEGIN -- six_speed Route::group('six_speed', function () { @@ -29,6 +30,10 @@ Route::group('six_speed', function () { //删除六一速 Route::delete('six_speed/:id', 'six_speed.SixSpeed/del'); + Route::get('personnel_all','six_speed.SixSpeed/getPersonnelAll'); + + Route::get('customer_resources_all','six_speed.SixSpeed/getCustomerResourcesAll'); + })->middleware([ AdminCheckToken::class, AdminCheckRole::class, diff --git a/niucloud/app/common.php b/niucloud/app/common.php index 9abd2ef5..dbcc248f 100644 --- a/niucloud/app/common.php +++ b/niucloud/app/common.php @@ -1046,3 +1046,31 @@ function get_campus_where($user_id){ return $where; } + + +function getModifiedFields(array $oldData, array $newData): array +{ + $modifiedFields = []; + $oldValues = []; + $newValues = []; + + foreach ($newData as $key => $newValue) { + + if (!array_key_exists($key, $oldData)) { + continue; + } + + if ($oldData[$key] != $newValue) { + $modifiedFields[] = $key; + $oldValues[$key] = $oldData[$key]; + $newValues[$key] = $newValue; + } + } + + return [ + 'is_save' => !empty($modifiedFields), + 'modified_fields' => json_encode($modifiedFields, JSON_UNESCAPED_UNICODE), + 'old_values' => json_encode($oldValues, JSON_UNESCAPED_UNICODE), + 'new_values' => json_encode($newValues, JSON_UNESCAPED_UNICODE), + ]; +} diff --git a/niucloud/app/model/customer_resources/CustomerResources.php b/niucloud/app/model/customer_resources/CustomerResources.php index b173fe90..c9e00e87 100644 --- a/niucloud/app/model/customer_resources/CustomerResources.php +++ b/niucloud/app/model/customer_resources/CustomerResources.php @@ -16,6 +16,8 @@ use think\model\concern\SoftDelete; use think\model\relation\HasMany; use think\model\relation\HasOne; +use app\model\personnel\Personnel; + use app\model\campus\Campus; /** @@ -81,6 +83,10 @@ class CustomerResources extends BaseModel + public function personnel(){ + return $this->hasOne(Personnel::class, 'id', 'consultant')->joinType('left')->withField('name,id')->bind(['consultant_name'=>'name']); + } + public function campus(){ return $this->hasOne(Campus::class, 'id', 'campus')->joinType('left')->withField('campus_name,id')->bind(['campus_name'=>'campus_name']); } diff --git a/niucloud/app/model/six_speed/SixSpeed.php b/niucloud/app/model/six_speed/SixSpeed.php index d6d35c34..8a5c83fe 100644 --- a/niucloud/app/model/six_speed/SixSpeed.php +++ b/niucloud/app/model/six_speed/SixSpeed.php @@ -16,6 +16,10 @@ use think\model\concern\SoftDelete; use think\model\relation\HasMany; use think\model\relation\HasOne; +use app\model\personnel\Personnel; + +use app\model\customer_resources\CustomerResources; + /** * 六一速模型 * Class SixSpeed @@ -50,177 +54,17 @@ class SixSpeed extends BaseModel */ protected $defaultSoftDelete = 0; - /** - * 搜索器:六一速编号 - * @param $value - * @param $data - */ - public function searchIdAttr($query, $value, $data) - { - if ($value) { - $query->where("id", $value); - } - } - - /** - * 搜索器:六一速需求购买力 - * @param $value - * @param $data - */ - public function searchPurchasePowerAttr($query, $value, $data) - { - if ($value) { - $query->where("purchase_power", $value); - } - } - - /** - * 搜索器:六一速认知理念 - * @param $value - * @param $data - */ - public function searchConceptAwarenessAttr($query, $value, $data) - { - if ($value) { - $query->where("concept_awareness", $value); - } - } - - /** - * 搜索器:六一速可选上课时间 - * @param $value - * @param $data - */ - public function searchPreferredClassTimeAttr($query, $value, $data) - { - if ($value) { - $query->where("preferred_class_time", $value); - } - } - - /** - * 搜索器:六一速距离 - * @param $value - * @param $data - */ - public function searchDistanceAttr($query, $value, $data) - { - if ($value) { - $query->where("distance", $value); - } - } - - /** - * 搜索器:六一速沟通备注 - * @param $value - * @param $data - */ - public function searchCommunicationAttr($query, $value, $data) - { - if ($value) { - $query->where("communication", $value); - } - } - - /** - * 搜索器:六一速承诺到访时间 - * @param $value - * @param $data - */ - public function searchPromisedVisitTimeAttr($query, $value, $data) - { - if ($value) { - $query->where("promised_visit_time", $value); - } - } - - /** - * 搜索器:六一速实际到访时间 - * @param $value - * @param $data - */ - public function searchActualVisitTimeAttr($query, $value, $data) - { - if ($value) { - $query->where("actual_visit_time", $value); - } - } - - /** - * 搜索器:六一速电话后的意向程度: low-低, medium-中, high-高 - * @param $value - * @param $data - */ - public function searchCallIntentAttr($query, $value, $data) - { - if ($value) { - $query->where("call_intent", $value); - } - } - - /** - * 搜索器:六一速一访情况 - * @param $value - * @param $data - */ - public function searchFirstVisitStatusAttr($query, $value, $data) - { - if ($value) { - $query->where("first_visit_status", $value); - } - } - - /** - * 搜索器:六一速二访情况 - * @param $value - * @param $data - */ - public function searchSecondVisitStatusAttr($query, $value, $data) - { - if ($value) { - $query->where("second_visit_status", $value); - } - } - - /** - * 搜索器:六一速是否关单: 1-是, 0-否 - * @param $value - * @param $data - */ - public function searchIsClosedAttr($query, $value, $data) - { - if ($value) { - $query->where("is_closed", $value); - } - } - - /** - * 搜索器:六一速人员ID - * @param $value - * @param $data - */ - public function searchStaffIdAttr($query, $value, $data) - { - if ($value) { - $query->where("staff_id", $value); - } - } - - /** - * 搜索器:六一速资源ID - * @param $value - * @param $data - */ - public function searchResourceIdAttr($query, $value, $data) - { - if ($value) { - $query->where("resource_id", $value); - } + + + + + + public function personnel(){ + return $this->hasOne(Personnel::class, 'id', 'staff_id')->joinType('left')->withField('name,id')->bind(['staff_id_name'=>'name']); } - - - + public function customerResources(){ + return $this->hasOne(CustomerResources::class, 'id', 'resource_id')->joinType('left')->withField('name,id')->bind(['resource_id_name'=>'name']); + } - } diff --git a/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php b/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php index d66b5c8a..7d82ed54 100644 --- a/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php +++ b/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php @@ -11,9 +11,13 @@ namespace app\service\admin\customer_resources; +use app\model\customer_resource_changes\CustomerResourceChanges; use app\model\customer_resources\CustomerResources; +use app\model\personnel\Personnel; use app\model\campus\Campus; +use app\model\six_speed\SixSpeed; +use app\model\six_speed_modification_log\SixSpeedModificationLog; use core\base\BaseAdminService; @@ -40,7 +44,7 @@ class CustomerResourcesService extends BaseAdminService $field = 'id,create_year_month,create_date,source,source_channel,consultant,name,age,gender,phone_number,demand,purchasing_power,cognitive_idea,optional_class_time,distance,decision_maker,initial_intent,campus,created_at,updated_at,deleted_at,status'; $order = 'id desc'; - $search_model = $this->model->where(get_campus_where($this->uid))->withSearch(["name","phone_number"], $where)->with(['campus'])->field($field)->order($order); + $search_model = $this->model->withSearch(["name","phone_number"], $where)->with(['personnel'])->field($field)->order($order); $list = $this->pageQuery($search_model); return $list; } @@ -54,7 +58,12 @@ class CustomerResourcesService extends BaseAdminService { $field = 'id,create_year_month,create_date,source,source_channel,consultant,name,age,gender,phone_number,demand,purchasing_power,cognitive_idea,optional_class_time,distance,decision_maker,initial_intent,campus,created_at,updated_at,deleted_at,status'; - $info = $this->model->field($field)->where([['id', "=", $id]])->findOrEmpty()->toArray(); + $info = $this->model->field($field)->where([['id', "=", $id]])->with(['personnel'])->findOrEmpty()->toArray(); + + $sixSpeed = new SixSpeed(); + $data = $sixSpeed->where(['resource_id' => $id])->field("*,distance as distance_tow")->findOrEmpty()->toArray(); + $info = $info+$data; + return $info; } @@ -65,9 +74,41 @@ class CustomerResourcesService extends BaseAdminService */ public function add(array $data) { - $data['consultant'] = $this->username; + $personnel = new Personnel(); + $data['consultant'] = $personnel->where(['sys_user_id' => $this->uid])->value("id"); + if(!$data['consultant']){ + return fail("操作失败"); + } + $sixSpeed = new SixSpeed(); + $res = $this->model->create($data); - return $res->id; + + if($data['purchase_power']){ + $six_id = $sixSpeed->where(['resource_id' => $res->id])->value("id"); + $data['staff_id'] = $data['consultant']; + + $field = [ + 'purchase_power' => $data['purchase_power'], + 'concept_awareness' => $data['concept_awareness'], + 'preferred_class_time' => $data['preferred_class_time'], + 'distance' => $data['distance_tow'], + 'communication' => $data['communication'], + 'promised_visit_time' => $data['promised_visit_time'], + 'actual_visit_time' => $data['actual_visit_time'], + 'call_intent' => $data['call_intent'], + 'first_visit_status' => $data['first_visit_status'], + 'second_visit_status' => $data['second_visit_status'], + 'is_closed' => $data['is_closed'], + 'staff_id' => $data['staff_id'], + 'resource_id' => $res->id + ]; + if($six_id){ + $sixSpeed->where(['resource_id' => $res->id])->update($field); + }else{ + $sixSpeed->insert($field); + } + } + return success("操作成功"); } @@ -75,14 +116,101 @@ class CustomerResourcesService extends BaseAdminService * 客户资源编辑 * @param int $id * @param array $data - * @return bool */ public function edit(int $id, array $data) { - - $data['consultant'] = $this->username; - $this->model->where([['id', '=', $id]])->update($data); - return true; + $personnel = new Personnel(); +// $data['consultant'] = $personnel->where(['sys_user_id' => $this->uid])->value("id"); +// if(!$data['consultant']){ +// return fail("操作失败"); +// } + + $data['consultant'] = 1; + $res = $this->model->where([['id', '=', $id]])->findOrEmpty()->toArray(); + + + $this->model->where([['id', '=', $id]])->update([ + 'source' => $data['source'], + 'source_channel' => $data['source_channel'], + 'consultant' => $data['consultant'], + 'name' => $data['name'], + 'age' => $data['age'], + 'gender' => $data['gender'], + 'phone_number' => $data['phone_number'], + 'demand' => $data['demand'], + 'purchasing_power' => $data['purchasing_power'], + 'cognitive_idea' => $data['cognitive_idea'], + 'optional_class_time' => $data['optional_class_time'], + 'distance' => $data['distance'], + 'decision_maker' => $data['decision_maker'], + 'initial_intent' => $data['initial_intent'], + 'campus' => $data['campus'], + 'status' => $data['status'], + 'create_year_month' => $data['create_year_month'], + 'create_date' => $data['create_date'] + ]); + + $resources_save = getModifiedFields($res,$data); + + $customerResourceChanges = new CustomerResourceChanges(); + if($resources_save['is_save']){ + $customerResourceChanges->insert([ + 'customer_resource_id' => $id, + 'operator_id' => $data['consultant'], + 'campus_id' => $data['campus'], + 'modified_fields' => $resources_save['modified_fields'], + 'old_values' => $resources_save['old_values'], + 'new_values' => $resources_save['new_values'] + ]); + } + + + $sixSpeed = new SixSpeed(); + if($data['purchase_power']){ + $sixSpeedModificationLog = new SixSpeedModificationLog(); + $six_id = $sixSpeed->where(['resource_id' => $id])->value("id"); + $data['staff_id'] = $data['consultant']; + + + + $field = [ + 'purchase_power' => $data['purchase_power'], + 'concept_awareness' => $data['concept_awareness'], + 'preferred_class_time' => $data['preferred_class_time'], + 'distance' => $data['distance_tow'], + 'communication' => $data['communication'], + 'promised_visit_time' => $data['promised_visit_time'], + 'actual_visit_time' => $data['actual_visit_time'], + 'call_intent' => $data['call_intent'], + 'first_visit_status' => $data['first_visit_status'], + 'second_visit_status' => $data['second_visit_status'], + 'is_closed' => $data['is_closed'], + 'staff_id' => $data['staff_id'], + 'resource_id' => $id + ]; + if($six_id){ + $six_log = $sixSpeed->where(['resource_id' => $id])->findOrEmpty()->toArray(); + $six_save = getModifiedFields($six_log,$field); + + if($six_save['is_save']){ + + $sixSpeedModificationLog->insert([ + 'customer_resource_id' => $id, + 'operator_id' => $data['consultant'], + 'campus_id' => $data['campus'], + 'modified_field' => $six_save['modified_fields'], + 'old_value' => $six_save['old_values'], + 'new_value' => $six_save['new_values'] + ]); + } + + $sixSpeed->where(['resource_id' => $id])->update($field); + }else{ + $sixSpeed->insert($field); + } + } + + return success("操作成功"); } /** @@ -98,6 +226,11 @@ class CustomerResourcesService extends BaseAdminService } + public function getPersonnelAll(){ + $personnelModel = new Personnel(); + return $personnelModel->select()->toArray(); + } + public function getCampusAll(){ $campusModel = new Campus(); return $campusModel->select()->toArray(); diff --git a/niucloud/app/service/admin/six_speed/SixSpeedService.php b/niucloud/app/service/admin/six_speed/SixSpeedService.php index 3797b679..8e6c224f 100644 --- a/niucloud/app/service/admin/six_speed/SixSpeedService.php +++ b/niucloud/app/service/admin/six_speed/SixSpeedService.php @@ -12,6 +12,8 @@ namespace app\service\admin\six_speed; use app\model\six_speed\SixSpeed; +use app\model\personnel\Personnel; +use app\model\customer_resources\CustomerResources; use core\base\BaseAdminService; @@ -39,7 +41,7 @@ class SixSpeedService extends BaseAdminService $field = 'id,purchase_power,concept_awareness,preferred_class_time,distance,communication,promised_visit_time,actual_visit_time,call_intent,first_visit_status,second_visit_status,is_closed,staff_id,resource_id,created_at,updated_at,deleted_at'; $order = 'id desc'; - $search_model = $this->model->withSearch(["id","purchase_power","concept_awareness","preferred_class_time","distance","communication","promised_visit_time","actual_visit_time","call_intent","first_visit_status","second_visit_status","is_closed","staff_id","resource_id"], $where)->field($field)->order($order); + $search_model = $this->model->withSearch([], $where)->with(['personnel','customerResources'])->field($field)->order($order); $list = $this->pageQuery($search_model); return $list; } @@ -53,7 +55,7 @@ class SixSpeedService extends BaseAdminService { $field = 'id,purchase_power,concept_awareness,preferred_class_time,distance,communication,promised_visit_time,actual_visit_time,call_intent,first_visit_status,second_visit_status,is_closed,staff_id,resource_id,created_at,updated_at,deleted_at'; - $info = $this->model->field($field)->where([['id', "=", $id]])->findOrEmpty()->toArray(); + $info = $this->model->field($field)->where([['id', "=", $id]])->with(['personnel','customerResources'])->findOrEmpty()->toArray(); return $info; } @@ -95,5 +97,15 @@ class SixSpeedService extends BaseAdminService } + public function getPersonnelAll(){ + $personnelModel = new Personnel(); + return $personnelModel->select()->toArray(); + } + + public function getCustomerResourcesAll(){ + $customerResourcesModel = new CustomerResources(); + return $customerResourcesModel->select()->toArray(); + } + } diff --git a/niucloud/app/validate/six_speed/SixSpeed.php b/niucloud/app/validate/six_speed/SixSpeed.php index 73ae076f..3f636e9b 100644 --- a/niucloud/app/validate/six_speed/SixSpeed.php +++ b/niucloud/app/validate/six_speed/SixSpeed.php @@ -28,8 +28,6 @@ class SixSpeed extends BaseValidate 'promised_visit_time' => 'require', 'call_intent' => 'require', 'is_closed' => 'require', - 'staff_id' => 'require', - 'resource_id' => 'require', ]; protected $message = [ @@ -41,13 +39,11 @@ class SixSpeed extends BaseValidate 'promised_visit_time.require' => ['common_validate.require', ['promised_visit_time']], 'call_intent.require' => ['common_validate.require', ['call_intent']], 'is_closed.require' => ['common_validate.require', ['is_closed']], - 'staff_id.require' => ['common_validate.require', ['staff_id']], - 'resource_id.require' => ['common_validate.require', ['resource_id']], ]; protected $scene = [ - "add" => ['purchase_power', 'concept_awareness', 'preferred_class_time', 'distance', 'communication', 'promised_visit_time', 'actual_visit_time', 'call_intent', 'first_visit_status', 'second_visit_status', 'is_closed', 'staff_id', 'resource_id'], - "edit" => ['purchase_power', 'concept_awareness', 'preferred_class_time', 'distance', 'communication', 'promised_visit_time', 'actual_visit_time', 'call_intent', 'first_visit_status', 'second_visit_status', 'is_closed', 'staff_id', 'resource_id'] + "add" => ['purchase_power', 'concept_awareness', 'preferred_class_time', 'distance', 'communication', 'promised_visit_time', 'actual_visit_time', 'call_intent', 'first_visit_status', 'second_visit_status', 'is_closed'], + "edit" => ['purchase_power', 'concept_awareness', 'preferred_class_time', 'distance', 'communication', 'promised_visit_time', 'actual_visit_time', 'call_intent', 'first_visit_status', 'second_visit_status', 'is_closed'] ]; } From 9338bf1692d9f3a4e852150db1fa58c850dcbdc3 Mon Sep 17 00:00:00 2001 From: "1213317725@qq.com" <1213317725@qq.com> Date: Sun, 18 May 2025 17:54:45 +0800 Subject: [PATCH 04/10] consultant --- .../customer_resources/CustomerResourcesService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php b/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php index 7d82ed54..c9ce58b0 100644 --- a/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php +++ b/niucloud/app/service/admin/customer_resources/CustomerResourcesService.php @@ -120,12 +120,12 @@ class CustomerResourcesService extends BaseAdminService public function edit(int $id, array $data) { $personnel = new Personnel(); -// $data['consultant'] = $personnel->where(['sys_user_id' => $this->uid])->value("id"); -// if(!$data['consultant']){ -// return fail("操作失败"); -// } + $data['consultant'] = $personnel->where(['sys_user_id' => $this->uid])->value("id"); + if(!$data['consultant']){ + return fail("操作失败"); + } - $data['consultant'] = 1; +// $data['consultant'] = 1; $res = $this->model->where([['id', '=', $id]])->findOrEmpty()->toArray(); From 61aab0870580abaff1fa4370e29800a8130ecab5 Mon Sep 17 00:00:00 2001 From: wangzeyan <258785420@qq.com> Date: Sun, 18 May 2025 18:03:46 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=9C=BA=E5=9C=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/.env.development | 2 +- admin/.gitignore | 2 + admin/auto-imports.d.ts | 2 +- admin/components.d.ts | 5 +- admin/src/app/api/class.ts | 59 --- admin/src/app/api/classroom.ts | 66 ++++ admin/src/app/lang/zh-cn/class.class.json | 60 ++- .../app/lang/zh-cn/classroom.classroom.json | 27 ++ admin/src/app/lang/zh-cn/venue.venue.json | 2 +- admin/src/app/views/class/class.vue | 360 ------------------ .../app/views/class/components/class-edit.vue | 327 ---------------- admin/src/app/views/classroom/classroom.vue | 280 ++++++++++++++ .../classroom/components/classroom-edit.vue | 287 ++++++++++++++ .../app/views/venue/components/venue-edit.vue | 186 +++++++-- .../Class.php => classroom/Classroom.php} | 64 ++-- .../app/adminapi/controller/venue/Venue.php | 4 +- niucloud/app/adminapi/route/class.php | 28 ++ niucloud/app/adminapi/route/classroom.php | 43 +++ niucloud/app/adminapi/route/departments.php | 24 -- .../Class.php => classroom/Classroom.php} | 126 ++---- .../ClassroomService.php} | 47 ++- .../app/service/admin/venue/VenueService.php | 23 +- .../Class.php => classroom/Classroom.php} | 22 +- niucloud/app/validate/personnel/Personnel.php | 12 +- 24 files changed, 1044 insertions(+), 1014 deletions(-) delete mode 100644 admin/src/app/api/class.ts create mode 100644 admin/src/app/api/classroom.ts create mode 100644 admin/src/app/lang/zh-cn/classroom.classroom.json delete mode 100644 admin/src/app/views/class/class.vue delete mode 100644 admin/src/app/views/class/components/class-edit.vue create mode 100644 admin/src/app/views/classroom/classroom.vue create mode 100644 admin/src/app/views/classroom/components/classroom-edit.vue rename niucloud/app/adminapi/controller/{class/Class.php => classroom/Classroom.php} (62%) create mode 100644 niucloud/app/adminapi/route/classroom.php rename niucloud/app/model/{class/Class.php => classroom/Classroom.php} (55%) rename niucloud/app/service/admin/{class/ClassService.php => classroom/ClassroomService.php} (62%) rename niucloud/app/validate/{class/Class.php => classroom/Classroom.php} (56%) diff --git a/admin/.env.development b/admin/.env.development index 3eb397bf..819eabb4 100644 --- a/admin/.env.development +++ b/admin/.env.development @@ -1,5 +1,5 @@ # api请求地址 -VITE_APP_BASE_URL='http://146.56.228.75:20024/adminapi/' +VITE_APP_BASE_URL='http://zhjwxt.test/adminapi/' # 图片服务器地址 VITE_IMG_DOMAIN='' diff --git a/admin/.gitignore b/admin/.gitignore index a547bf36..de964337 100644 --- a/admin/.gitignore +++ b/admin/.gitignore @@ -22,3 +22,5 @@ dist-ssr *.njsproj *.sln *.sw? +.env.development +.env.production diff --git a/admin/auto-imports.d.ts b/admin/auto-imports.d.ts index 08908edd..a51b7a66 100644 --- a/admin/auto-imports.d.ts +++ b/admin/auto-imports.d.ts @@ -1,5 +1,5 @@ // Generated by 'unplugin-auto-import' export {} declare global { - + const ElNotification: typeof import('element-plus/es')['ElNotification'] } diff --git a/admin/components.d.ts b/admin/components.d.ts index e5b7f07b..8cdfc06d 100644 --- a/admin/components.d.ts +++ b/admin/components.d.ts @@ -10,7 +10,6 @@ declare module '@vue/runtime-core' { Attachment: typeof import('./src/components/upload-attachment/attachment.vue')['default'] DiyLink: typeof import('./src/components/diy-link/index.vue')['default'] Editor: typeof import('./src/components/editor/index.vue')['default'] - ElAlert: typeof import('element-plus/es')['ElAlert'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] @@ -45,7 +44,6 @@ declare module '@vue/runtime-core' { ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] - ElResult: typeof import('element-plus/es')['ElResult'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] @@ -58,8 +56,7 @@ declare module '@vue/runtime-core' { ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] - ElTimeline: typeof import('element-plus/es')['ElTimeline'] - ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] + ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] diff --git a/admin/src/app/api/class.ts b/admin/src/app/api/class.ts deleted file mode 100644 index 664832ca..00000000 --- a/admin/src/app/api/class.ts +++ /dev/null @@ -1,59 +0,0 @@ -import request from '@/utils/request' - -// USER_CODE_BEGIN -- class -/** - * 获取班级列表 - * @param params - * @returns - */ -export function getClassList(params: Record) { - return request.get(`class/class`, { params }) -} - -/** - * 获取班级详情 - * @param id 班级id - * @returns - */ -export function getClassInfo(id: number) { - return request.get(`class/class/${id}`) -} - -/** - * 添加班级 - * @param params - * @returns - */ -export function addClass(params: Record) { - return request.post('class/class', params, { - showErrorMessage: true, - showSuccessMessage: true, - }) -} - -/** - * 编辑班级 - * @param id - * @param params - * @returns - */ -export function editClass(params: Record) { - return request.put(`class/class/${params.id}`, params, { - showErrorMessage: true, - showSuccessMessage: true, - }) -} - -/** - * 删除班级 - * @param id - * @returns - */ -export function deleteClass(id: number) { - return request.delete(`class/class/${id}`, { - showErrorMessage: true, - showSuccessMessage: true, - }) -} - -// USER_CODE_END -- class diff --git a/admin/src/app/api/classroom.ts b/admin/src/app/api/classroom.ts new file mode 100644 index 00000000..89028d70 --- /dev/null +++ b/admin/src/app/api/classroom.ts @@ -0,0 +1,66 @@ +import request from '@/utils/request' + +// USER_CODE_BEGIN -- class +/** + * 获取场地管理列表 + * @param params + * @returns + */ +export function getClassroomList(params: Record) { + return request.get(`classroom/classroom`, { params }) +} + +/** + * 获取场地管理详情 + * @param id 场地管理id + * @returns + */ +export function getClassroomInfo(id: number) { + return request.get(`classroom/classroom/${id}`) +} + +/** + * 添加场地管理 + * @param params + * @returns + */ +export function addClassroom(params: Record) { + return request.post('classroom/classroom', params, { + showErrorMessage: true, + showSuccessMessage: true, + }) +} + +/** + * 编辑场地管理 + * @param id + * @param params + * @returns + */ +export function editClassroom(params: Record) { + return request.put(`classroom/classroom/${params.id}`, params, { + showErrorMessage: true, + showSuccessMessage: true, + }) +} + +/** + * 删除场地管理 + * @param id + * @returns + */ +export function deleteClassroom(id: number) { + return request.delete(`classroom/classroom/${id}`, { + showErrorMessage: true, + showSuccessMessage: true, + }) +} + +export function getWithCampusList(params: Record) { + return request.get('classroom/campus_all', { params }) +} +export function getWithPersonnelList(params: Record) { + return request.get('classroom/personnel_all', { params }) +} + +// USER_CODE_END -- class diff --git a/admin/src/app/lang/zh-cn/class.class.json b/admin/src/app/lang/zh-cn/class.class.json index 5740e53d..a13a7093 100644 --- a/admin/src/app/lang/zh-cn/class.class.json +++ b/admin/src/app/lang/zh-cn/class.class.json @@ -1,35 +1,27 @@ { - "id": "班级编号", - "idPlaceholder": "请输入班级编号", - "campusId": "校区ID", - "campusIdPlaceholder": "请输入校区ID", - "campusName": "校区名称", - "campusNamePlaceholder": "请输入校区名称", - "className": "班级名称", - "classNamePlaceholder": "请输入班级名称", - "headCoach": "班级主教练", - "headCoachPlaceholder": "请输入班级主教练", - "ageGroup": "班级授课年龄段", - "ageGroupPlaceholder": "请输入班级授课年龄段", - "classType": "班级类型", - "classTypePlaceholder": "请输入班级类型", - "assistantCoach": "班级助教", - "assistantCoachPlaceholder": "请输入班级助教", - "createdAt": "创建时间", - "createdAtPlaceholder": "请输入创建时间", - "updatedAt": "修改时间", - "updatedAtPlaceholder": "请输入修改时间", - "deletedAt": "逻辑删除时间", - "deletedAtPlaceholder": "请输入逻辑删除时间", - "status": "班级状态", - "statusPlaceholder": "请输入班级状态", - "sortOrder": "班级排序", - "sortOrderPlaceholder": "请输入班级排序", - "remarks": "班级备注", - "remarksPlaceholder": "请输入班级备注", - "addClass": "添加班级", - "updateClass": "编辑班级", - "classDeleteTips": "确定要删除该数据吗?", - "startDate": "请选择开始时间", - "endDate": "请选择结束时间" -} + "campusId":"所属校区", + "campusIdPlaceholder":"全部", + "className":"场地名称", + "classNamePlaceholder":"请输入场地名称", + "headCoach":"主教练", + "headCoachPlaceholder":"全部", + "ageGroup":"授课年龄段", + "ageGroupPlaceholder":"请输入授课年龄段", + "classType":"场地类型", + "classTypePlaceholder":"请输入场地类型", + "assistantCoach":"助教", + "assistantCoachPlaceholder":"全部", + "createdAt":"创建时间", + "createdAtPlaceholder":"请输入创建时间", + "status":"班级状态", + "statusPlaceholder":"请输入班级状态", + "sortOrder":"班级排序", + "sortOrderPlaceholder":"请输入班级排序", + "remarks":"班级备注", + "remarksPlaceholder":"请输入班级备注", + "addClass":"添加场地管理", + "updateClass":"编辑场地管理", + "classDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/classroom.classroom.json b/admin/src/app/lang/zh-cn/classroom.classroom.json new file mode 100644 index 00000000..6216a9aa --- /dev/null +++ b/admin/src/app/lang/zh-cn/classroom.classroom.json @@ -0,0 +1,27 @@ +{ + "campusId":"所属校区", + "campusIdPlaceholder":"全部", + "className":"班级名称", + "classNamePlaceholder":"请输入班级名称", + "headCoach":"主教练", + "headCoachPlaceholder":"全部", + "ageGroup":"授课年龄段", + "ageGroupPlaceholder":"请输入授课年龄段", + "classType":"班级类型", + "classTypePlaceholder":"请输入班级类型", + "assistantCoach":"助教", + "assistantCoachPlaceholder":"全部", + "createdAt":"创建时间", + "createdAtPlaceholder":"请输入创建时间", + "status":"班级状态", + "statusPlaceholder":"请输入班级状态", + "sortOrder":"班级排序", + "sortOrderPlaceholder":"请输入班级排序", + "remarks":"班级备注", + "remarksPlaceholder":"请输入班级备注", + "addClassroom":"添加场地管理", + "updateClassroom":"编辑场地管理", + "classroomDeleteTips":"确定要删除该数据吗?", + "startDate":"请选择开始时间", + "endDate":"请选择结束时间" +} \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/venue.venue.json b/admin/src/app/lang/zh-cn/venue.venue.json index 45c03127..a379efef 100644 --- a/admin/src/app/lang/zh-cn/venue.venue.json +++ b/admin/src/app/lang/zh-cn/venue.venue.json @@ -7,7 +7,7 @@ "capacityPlaceholder":"请输入场地可容纳人数上限", "availabilityStatus":"场地可用状态", "availabilityStatusPlaceholder":"请输入场地可用状态", - "timeRangeType":"场地可用时间范围类型", + "timeRangeType":"时间范围类型", "timeRangeTypePlaceholder":"请输入场地可用时间范围类型", "fixedTimeRanges":"时间范围", "fixedTimeRangesPlaceholder":"请输入时间范围", diff --git a/admin/src/app/views/class/class.vue b/admin/src/app/views/class/class.vue deleted file mode 100644 index 59b54cb0..00000000 --- a/admin/src/app/views/class/class.vue +++ /dev/null @@ -1,360 +0,0 @@ - - - - - diff --git a/admin/src/app/views/class/components/class-edit.vue b/admin/src/app/views/class/components/class-edit.vue deleted file mode 100644 index 6c103c43..00000000 --- a/admin/src/app/views/class/components/class-edit.vue +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - diff --git a/admin/src/app/views/classroom/classroom.vue b/admin/src/app/views/classroom/classroom.vue new file mode 100644 index 00000000..a1b11ddd --- /dev/null +++ b/admin/src/app/views/classroom/classroom.vue @@ -0,0 +1,280 @@ + + + + + diff --git a/admin/src/app/views/classroom/components/classroom-edit.vue b/admin/src/app/views/classroom/components/classroom-edit.vue new file mode 100644 index 00000000..569d3824 --- /dev/null +++ b/admin/src/app/views/classroom/components/classroom-edit.vue @@ -0,0 +1,287 @@ + + + + + + diff --git a/admin/src/app/views/venue/components/venue-edit.vue b/admin/src/app/views/venue/components/venue-edit.vue index 79e38621..35c47b61 100644 --- a/admin/src/app/views/venue/components/venue-edit.vue +++ b/admin/src/app/views/venue/components/venue-edit.vue @@ -56,15 +56,13 @@ v-model="formData.availability_status" :placeholder="t('availabilityStatusPlaceholder')" > - - - - - - - - 可用 - 不可用 + + {{ item.name }} + @@ -83,16 +81,81 @@ - - - + +
+
+ + + +
+
+
+ +
+
+
+ + + +
+ 新增 + 删除 +
+
@@ -112,6 +175,7 @@