From 8ddc6f6e1f715ff8aac9b30b12afdb28305fa35e Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Sun, 4 Jan 2026 20:09:33 +0800 Subject: [PATCH] 登录 修改样式 --- api/common.js | 10 ++++++++++ api/tree-archive/tree-archive.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ pages-sub/data/tree-archive/addTree.vue | 345 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages-sub/data/tree-archive/editTree.vue | 15 +++++++++++++++ pages-sub/data/tree-archive/index.vue | 278 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- pages-sub/data/tree-archive/treeRecord.vue | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages-sub/problem/ai-manage/index.vue | 667 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages-sub/problem/regional-order-manage/add-order.vue | 648 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages-sub/problem/regional-order-manage/add-patrol-order.vue | 9 ++++++++- pages-sub/problem/regional-order-manage/distribution-order.vue | 12 ++++++++++-- pages-sub/problem/regional-order-manage/index.vue | 661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages-sub/problem/regional-order-manage/order-detail.vue | 34 +++++++++++++++++----------------- pages-sub/problem/work-order-manage/add-maintain-order.vue | 10 +++++----- pages.json | 19 +++++++++++++++++-- pages/login/index.vue | 359 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ static/imgs/tree/tree-high.png | Bin 0 -> 1003 bytes static/imgs/tree/treearound.png | Bin 0 -> 927 bytes 17 files changed, 1802 insertions(+), 1450 deletions(-) create mode 100644 api/tree-archive/tree-archive.js create mode 100644 pages-sub/data/tree-archive/addTree.vue create mode 100644 pages-sub/data/tree-archive/editTree.vue create mode 100644 pages-sub/data/tree-archive/treeRecord.vue create mode 100644 static/imgs/tree/tree-high.png create mode 100644 static/imgs/tree/treearound.png diff --git a/api/common.js b/api/common.js index b40c2dd..41a1cbe 100644 --- a/api/common.js +++ b/api/common.js @@ -11,6 +11,16 @@ export const getRoadListByLatLng = (params) => { return get('/app-api/bpm/garden/workorder/listRoadInfo', params); }; + +/** + * 根据公司 + * @param {Object} params {mobile, password, code} + * @returns {Promise} + */ +export const getCompanyList = (params) => { + return get('/admin-api/system/dept/sub-list', params); +}; + // export const fileUpload = (params) => { // return post('/app-api/infra/file/upload', params); // }; diff --git a/api/tree-archive/tree-archive.js b/api/tree-archive/tree-archive.js new file mode 100644 index 0000000..e3b6d2d --- /dev/null +++ b/api/tree-archive/tree-archive.js @@ -0,0 +1,48 @@ + +import { post, get } from '@/common/utils/request'; + + +/** + * 班组集合 + * @param {Object} params + * @returns {Promise} + */ +export const deptListReq = (params) => { + return get('/app-api/garden/tree/dept/list', params); +}; + +/** + * 道路树木列表 + * @param {Object} params + * @returns {Promise} + */ +export const treeRoadReq = (params) => { + return get('/app-api/garden/tree/road/list', params); +}; + + +/** + * 新增树 + * @param {Object} params + * @returns {Promise} + */ +export const addTree = (params) => { + return get('/app-api/garden/tree/create', params); +}; + + + +// // 树基本详情 +// export const treeDetailReq = (params) => request.get('/business/tree/'+params ) +// ==> +// /app-api/garden/tree/get +// +// // 修改树 +// export const updateTree = (params) => request.put('/business/tree/',params ) +// ==> +// /app-api/garden/tree/update +// +// // 树更变记录 +// export const treeLogReq = (params) => request.get('/gardentree/logs/list/',params ) +// ==> +// /app-api/garden/tree-change-log/page diff --git a/pages-sub/data/tree-archive/addTree.vue b/pages-sub/data/tree-archive/addTree.vue new file mode 100644 index 0000000..6472943 --- /dev/null +++ b/pages-sub/data/tree-archive/addTree.vue @@ -0,0 +1,345 @@ + + + + + + + + + + + + + 厘米 + + + + + + + + 米 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 年 + + + + + + + + 厘米 + + + + + + + + + + + 米 + + + + + + + + 米 + + + + + + + + + {{ isShow ? '- 隐藏区域' : '+ 显示区域' }} + + + + + + + + 提交 + + + + + + + + + + + \ No newline at end of file diff --git a/pages-sub/data/tree-archive/editTree.vue b/pages-sub/data/tree-archive/editTree.vue new file mode 100644 index 0000000..5566baf --- /dev/null +++ b/pages-sub/data/tree-archive/editTree.vue @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/pages-sub/data/tree-archive/index.vue b/pages-sub/data/tree-archive/index.vue index 96c0baf..5426617 100644 --- a/pages-sub/data/tree-archive/index.vue +++ b/pages-sub/data/tree-archive/index.vue @@ -1,11 +1,281 @@ - + + + + - + + + + + + {{ item.deptName }} + + + + + + + + + + + + + {{ item.roadName }} + {{ item.treeCount }}棵 + + 已录入行道树:{{ item.recordedCount }}棵 + 起点:{{ item.startRemark }} + 终点:{{ item.endRemark }} + + + + + + + + + + - \ No newline at end of file diff --git a/pages-sub/data/tree-archive/treeRecord.vue b/pages-sub/data/tree-archive/treeRecord.vue new file mode 100644 index 0000000..93105dc --- /dev/null +++ b/pages-sub/data/tree-archive/treeRecord.vue @@ -0,0 +1,137 @@ + + + + + + + + + + + + {{ i.treetype }} + {{ i.updatetime.substring(0, 10) }} + + + 高度:{{ i.treeheight }} 米 + + + 胸径:{{ i.dbh }} 厘米 + + + + + 树木编号:{{ i.treenumber }} + + + + + + + 新增树木录入 + + + + + + + + + \ No newline at end of file diff --git a/pages-sub/problem/ai-manage/index.vue b/pages-sub/problem/ai-manage/index.vue index 2297b41..7072e1b 100644 --- a/pages-sub/problem/ai-manage/index.vue +++ b/pages-sub/problem/ai-manage/index.vue @@ -3,7 +3,6 @@ - - - - - - + @@ -86,7 +80,7 @@ 情况描述: {{ item.remark || '无' }} - + 紧急程度: {{ uni.$dict.getDictLabel('workorder_pressing_type', item.pressingType) }} @@ -101,20 +95,10 @@ {{ timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }} - - 回退 - - - 重新提交 - - - {{ - nextStepMap[item.taskKey].btnText - }} - + 回退 + 重新提交 + {{ nextStepMap[item.taskKey].btnText }} 详情 @@ -123,11 +107,11 @@ @@ -149,12 +133,11 @@ 情况描述: {{ item.remark || '无' }} - 紧急程度:{{ uni.$dict.getDictLabel('workorder_pressing_type', item.pressingType) }} - + 工单详情 @@ -172,21 +155,12 @@ - - - - - - - + - - 新增工单 - + 新增工单 - - + - - 上传图片(选填) - + - - - - - 上传验收图片(选填) { - // patrol_global 全域巡查员 - // regional_manager 大区经理 - // AI_dispatcher AI工单派发人员 - // 增加可选链,避免用户信息不存在报错 - console.log('123') - console.log(!userStore.userInfo?.roles?.includes('AI_dispatcher')) - return !userStore.userInfo?.roles?.includes('AI_dispatcher') ; - // return true + // AI工单派发人员 不显示新增按钮,其他角色显示 + return !USER_ROLES.includes('AI_dispatcher'); }); -// 回退弹窗相关 -const rejectModalShow = ref(false); // 回退modal显示开关 -const rejectReason = ref(''); // 回退原因 -const currentRejectItem = ref(null); // 当前回退工单 -// 回退图片上传配置(与参考页面风格一致) + +// ========== 回退弹窗相关 ========== +const rejectModalShow = ref(false); +const rejectReason = ref(''); +const currentRejectItem = ref(null); const rejectImgs = useUploadImgs({ - maxCount: 3, // 最多上传3张 - uploadText: '选择回退图片', // 自定义上传提示文字 - sizeType: ['compressed'], // 仅上传压缩图 - formRef: null, // 该弹窗无表单校验 - fieldName: 'rejectImgs' // 自定义字段名 + maxCount: 3, uploadText: '选择回退图片', sizeType: ['compressed'], formRef: null, fieldName: 'rejectImgs' }) -// ========== 验收弹窗相关状态(含图片上传) ========== -const acceptModalShow = ref(false); // 验收弹窗显示开关 -const acceptRadioValue = ref('0'); // 单选框值,默认0(通过) -const acceptReason = ref(''); // 验收原因 -const currentAcceptItem = ref(null); // 当前验收的工单项 -// 验收图片上传配置(独立实例,参考回退弹窗) + +// ========== 验收弹窗相关 ========== +const acceptModalShow = ref(false); +const acceptRadioValue = ref('0'); // 默认通过 +const acceptReason = ref(''); +const currentAcceptItem = ref(null); const acceptImgs = useUploadImgs({ - maxCount: 3, // 最多上传3张,与回退弹窗一致 - uploadText: '选择验收图片', // 自定义上传提示文字 - sizeType: ['compressed'], // 仅上传压缩图,优化性能 - formRef: null, // 验收弹窗无表单校验 - fieldName: 'acceptImgs' // 自定义字段名,区分回退图片 + maxCount: 3, uploadText: '选择验收图片', sizeType: ['compressed'], formRef: null, fieldName: 'acceptImgs' }) + +// ========== 公共封装方法 (核心优化:消灭重复代码) ========== +/** + * 生成统一的临时存储key + * @param {String} prefix 前缀标识 + * @returns {String} 唯一key + */ +const generateTempKey = (prefix = 'order') => { + return `${prefix}_${Date.now()}_${Math.floor(Math.random() * 10000)}`; +}; + +/** + * 存储工单数据到本地缓存 + * @param {Object} item 工单数据 + * @param {String} prefix key前缀 + * @returns {String|null} 成功返回key,失败返回null + */ +const setOrderStorage = (item, prefix) => { + if (!item?.id) return null; + const tempKey = generateTempKey(prefix); + try { + uni.setStorageSync(tempKey, item); + return tempKey; + } catch (error) { + console.error('存储工单数据失败:', error); + uni.showToast({title: '数据存储异常,请重试', icon: 'none'}); + return null; + } +}; + +/** + * 获取分页请求公共参数 + * @param {Number} pageNo 页码 + * @param {Number} pageSize 页大小 + * @returns {Object} 请求参数 + */ +const getQueryParams = (pageNo, pageSize) => { + return { + searchContent: searchValue.value.trim() || '', + pageNo, + pageSize, + type: selectedSortValue.value + }; +}; + +/** + * 统一调用审批接口 + * @param {Object} params 请求参数 + * @param {String} taskKey 工单任务key + * @returns {Promise} 接口请求Promise + */ +const callApprovalApi = async (params, taskKey) => { + if (taskKey === 'shRegionManager') return await dcyUniversalApproval(params); + if (taskKey === 'regionManager') return await qyUniversalApproval(params); + // 根据角色匹配对应接口 + if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params); + if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params); + if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params); +}; + +/** + * 统一跳转工单页面 + * @param {String} path 页面路径 + * @param {Object} query 拼接参数 + */ +const navToOrderPage = (path, query = {}) => { + const queryStr = Object.keys(query).map(k => `${k}=${query[k]}`).join('&'); + uni.navigateTo({ url: `${path}${queryStr ? '?' + queryStr : ''}` }); +}; + +/** + * 刷新列表 - 统一封装,避免空指针 + */ +const refreshOrderList = () => { + pagingRef.value && pagingRef.value.reload(); +}; + +// ========== 业务核心方法 ========== // 分页查询列表 const queryList = async (pageNo, pageSize) => { try { - const apiParams = { - searchContent: searchValue.value.trim() || '', - pageNo, - pageSize, - type: selectedSortValue.value // 1-位置 2-工单名称 3-情况描述 4-工单编号 - }; + const params = getQueryParams(pageNo, pageSize); let res; - if (activeTab.value == 0) { - // 待办工单 - res = await todoBuzSimplePage(apiParams); - } else if (activeTab.value == 1) { - // 我发起的任务 - res = await myBuzSimplePage(apiParams); - } else { - // 已办工单 - res = await doneBuzSimplePage(apiParams); - } - // 适配z-paging分页 - paging.value.complete(res.list, res.total); + if (activeTab.value === 0) res = await todoBuzSimplePage(params); + else if (activeTab.value === 1) res = await myBuzSimplePage(params); + else res = await doneBuzSimplePage(params); + pagingRef.value.complete(res?.list || [], res?.total || 0); } catch (error) { console.error('加载工单失败:', error); - paging.value?.complete(false); + pagingRef.value?.complete(false); uni.showToast({title: '加载失败,请重试', icon: 'none'}); } }; -// ========== 事件处理 ========== + // 标签页切换 const handleTabChange = (item) => { - orderList.value = []; - console.log(item) activeTab.value = item.index; - paging.value?.reload(); // 切换标签页刷新列表 + orderList.value = []; + refreshOrderList(); }; + // 排序变更 const handleSortChange = (val) => { selectedSortValue.value = val.id; searchValue.value = ''; - paging.value?.reload(); // 排序变更刷新列表 + refreshOrderList(); }; + // 搜索 const handleSearch = (val) => { searchValue.value = val; - paging.value?.reload(); // 搜索刷新列表 + refreshOrderList(); }; + // 工单详情 const handleDetail = (item) => { - // 0-待办 1我发起的- 2-已办 - uni.navigateTo({ - url: `/pages-sub/problem/regional-order-manage/order-detail?taskId=${item.taskId}&activeTab=${activeTab.value}&processInstanceId=${item.processInstanceId}`, - events: { - // 自定义事件名:needRefresh(与详情页保持一致) - needRefresh: () => { - console.log('详情页返回,触发工单列表刷新'); - if (paging.value) { - paging.value.reload(); // 刷新z-paging列表 - } - } - } + if (!item?.taskId) return uni.showToast({title: '工单信息异常', icon: 'none'}); + navToOrderPage('/pages-sub/problem/regional-order-manage/order-detail', { + taskId: item.taskId, + activeTab: activeTab.value, + processInstanceId: item.processInstanceId + }, { + needRefresh: () => refreshOrderList() }); }; -// 生成临时key -const generateTempKey = () => { - return 'renew_order_' + Date.now() + '_' + Math.floor(Math.random() * 10000); -}; -// 待办-重新提交工单(改造后:大数据存本地,仅传唯一标识) + +// 重新提交工单 const handleRenew = (item) => { + const tempKey = setOrderStorage(item, 'renew_order'); + if (!tempKey) return; - // 1. 生成唯一临时标识 - const tempKey = generateTempKey(); - // 2. 将完整工单数据存入本地临时存储(同步存储,确保数据立即生效) - try { - console.log(item) - console.log('123') - uni.setStorageSync(tempKey, item); - } catch (error) { - console.error('存储工单数据失败:', error); - uni.showToast({title: '数据存储异常,无法重新提交', icon: 'none'}); - return; - } + const pageUrl = USER_ROLES.includes('patrol_global') + ? '/pages-sub/problem/regional-order-manage/add-patrol-order' + : '/pages-sub/problem/regional-order-manage/add-order'; - if (userStore.userInfo?.roles.includes('patrol_global')) { // 全域巡查员 - uni.navigateTo({ - url: `/pages-sub/problem/regional-order-manage/add-patrol-order?isRenew=1&tempKey=${tempKey}` - }); - } - if (userStore.userInfo?.roles.includes('regional_manager')) { // 大区经理 - uni.navigateTo({ - url: `/pages-sub/problem/regional-order-manage/add-order?isRenew=1&tempKey=${tempKey}` - }); - } - if (userStore.userInfo?.roles.includes('Inspector_global')) { // 督察员 - uni.navigateTo({ - url: `/pages-sub/problem/regional-order-manage/add-order?isRenew=1&tempKey=${tempKey}` - }); - } - // // 3. URL 仅传递「唯一标识」和「重新提交标记」(数据量极小,无长度问题) - // uni.navigateTo({ - // url: `/pages-sub/problem/regional-order-manage/add-patrol-order?isRenew=1&tempKey=${tempKey}` - // }); + navToOrderPage(pageUrl, { isRenew: 1, tempKey }); }; -// 待办-处理工单 + +// 处理工单核心逻辑 const handleProcess = async (item) => { - console.log(nextStepMap[item.taskKey].name) + if (!item) return uni.showToast({title: '工单信息异常', icon: 'none'}); + const stepName = nextStepMap[item.taskKey]?.name; + try { - if (nextStepMap[item.taskKey]?.name == '大区经理分配') { - // ① 生成唯一临时key(统一规则,避免冲突) - const tempKey = `distribute_order_${Date.now()}_${Math.floor(Math.random() * 10000)}`; - // ② 存储完整item到本地缓存(同步存储,确保立即生效) - try { - uni.setStorageSync(tempKey, item); - } catch (error) { - console.error('存储分配工单数据失败:', error); - uni.showToast({title: '数据存储异常,无法跳转', icon: 'none'}); - return; - } - // ③ URL仅传递临时key,无其他冗余参数 - uni.navigateTo({ - url: `/pages-sub/problem/regional-order-manage/distribution-order?tempKey=${tempKey}` - }) + // 大区经理分配 + if (stepName === '大区经理分配') { + const tempKey = setOrderStorage(item, 'distribute_order'); + tempKey && navToOrderPage('/pages-sub/problem/regional-order-manage/distribution-order', { tempKey }); } - if (nextStepMap[item.taskKey]?.name == '督察员单子大区经理分配') { - let postData = { - "taskKey":item.taskKey, - "taskId": item.taskId, - "operateType":60, - "workerDataId":item.id, - "agree":0, - "reason":item.remark, - "roadId":item.roadId, - "roadName":item.roadName, - "pressingType":item.pressingType, - "orderName":item.orderName, - "expectedFinishDate": item.expectedFinishDate, - "busiLine":item.busiLine, - } - const res = await dcyUniversalApproval(postData); - uni.showToast({title: '分配成功', icon: 'success', duration: 1000}); - paging.value?.reload(); // 刷新列表 + // 督察员单子大区经理分配 + else if (stepName === '督察员单子大区经理分配') { + const postData = { taskKey: item.taskKey, taskId: item.taskId, operateType:60, workerDataId:item.id, agree:0, reason:item.remark, roadId:item.roadId, roadName:item.roadName, pressingType:item.pressingType, orderName:item.orderName, expectedFinishDate: item.expectedFinishDate, busiLine:item.busiLine }; + await dcyUniversalApproval(postData); + uni.showToast({title: '分配成功', icon: 'success'}); + refreshOrderList(); } - - - // 验收 - 打开弹窗 - if (nextStepMap[item.taskKey]?.name == '巡查员验收' || nextStepMap[item.taskKey]?.name == '养护组长验收') { - currentAcceptItem.value = item; // 存储当前工单信息 - acceptReason.value = ''; // 清空上次的验收原因 - acceptRadioValue.value = '0'; // 重置默认选中“通过” - acceptModalShow.value = true; // 显示验收弹窗 + // 验收弹窗 + else if (['巡查员验收', '养护组长验收'].includes(stepName)) { + currentAcceptItem.value = item; + acceptReason.value = ''; + acceptRadioValue.value = '0'; + acceptModalShow.value = true; } - - // 发起人确认 - if (nextStepMap[item.taskKey]?.name == '发起人确认') { - console.log(item) + // 发起人确认-结束工单 + else if (stepName === '发起人确认') { uni.showModal({ title: "结束工单", content: "请确定是否结束工单?", - success: async function (res) { + success: async (res) => { if (res.confirm) { - // 构建请求参数 const requestData = { - - "workerDataId": item.id, - "taskKey": 'ylInspectorStart', - "taskId": item.taskId, - "operateType": 200, - "agree": 1, - "reason": '结束工单' + workerDataId: item.id, taskKey: 'ylInspectorStart', taskId: item.taskId, + operateType: 200, agree: 1, reason: '结束工单' }; - // 调用回退工单接口 daquUniversalApproval - - if( userStore.userInfo.roles.includes('regional_manager')){ // 大区经理 - await daquUniversalApproval(requestData) - } - if( userStore.userInfo.roles.includes('Inspector_global')){ // 督察员 - await dcyUniversalApproval(requestData); - } - if( userStore.userInfo.roles.includes('patrol_global')){ // 全域巡查员 - await qyUniversalApproval(requestData); - } - - uni.showToast({title: '结束成功', icon: 'success', duration: 1000}); - rejectModalShow.value = false; - paging.value?.reload(); // 刷新列表 - } else if (res.cancel) { - console.log("用户点击取消"); + await callApprovalApi(requestData, item.taskKey); + uni.showToast({title: '结束成功', icon: 'success'}); + refreshOrderList(); } - }, + } }); } } catch (error) { @@ -548,168 +484,92 @@ const handleProcess = async (item) => { uni.showToast({title: '处理失败,请重试', icon: 'none'}); } }; -// 待办-回退工单(打开回退modal) + +// 回退工单-打开弹窗 const handleReject = (item) => { - console.log('123213') - // 校验工单有效性 - if (!item || !item.id) { - uni.showToast({title: '工单信息异常,无法回退', icon: 'none'}); - return; - } + if (!item?.id) return uni.showToast({title: '工单信息异常,无法回退', icon: 'none'}); currentRejectItem.value = item; - rejectReason.value = ''; // 清空上次输入 - rejectImgs.clearImgs(); // 改造后:使用组合式函数的清空方法 - rejectModalShow.value = true; // 显示回退modal + rejectReason.value = ''; + rejectImgs.clearImgs(); + rejectModalShow.value = true; }; -// 回退modal - 取消按钮 + +// 关闭回退弹窗-重置状态 const handleRejectModalCancel = () => { rejectModalShow.value = false; rejectReason.value = ''; - rejectImgs.clearImgs(); // 改造后:使用组合式函数的清空方法 + rejectImgs.clearImgs(); }; + // 确认回退工单 const confirmReject = async () => { - // 严格校验回退原因(去除首尾空格) - const rejectReasonTrim = rejectReason.value.trim(); - if (!rejectReasonTrim) { - uni.showToast({title: '请填写回退原因', icon: 'none', duration: 1000}); - return; - } - // 校验当前工单有效性 - if (!currentRejectItem.value || !currentRejectItem.value.id) { - uni.showToast({title: '工单信息异常,无法提交', icon: 'none', duration: 1000}); - rejectModalShow.value = false; - return; - } + const reason = rejectReason.value.trim(); + if (!reason) return uni.showToast({title: '请填写回退原因', icon: 'none'}); + const item = currentRejectItem.value; + if (!item?.id) return uni.showToast({title: '工单信息异常', icon: 'none'}); + + uni.showLoading({title: '提交中...', mask: true}); try { - // 显示加载中,防止重复提交 - uni.showLoading({title: '提交中...', mask: true}); - // 构建请求参数 const requestData = { - "returnImgs": rejectImgs.getSuccessImgUrls(), // 改造后:获取上传成功的图片URL数组 - "workerDataId": currentRejectItem.value.id, - "taskKey": currentRejectItem.value.taskKey, - "taskId": currentRejectItem.value.taskId, - - "operateType": nextStepMap[currentRejectItem.value.taskKey].operateTypeNoPass, - "agree": 1, - "reason": rejectReasonTrim + returnImgs: rejectImgs.getSuccessImgUrls(), workerDataId: item.id, taskKey: item.taskKey, + taskId: item.taskId, operateType: nextStepMap[item.taskKey].operateTypeNoPass, agree:1, reason }; - // 调用回退工单接口 - if(currentRejectItem.value.taskKey=='shRegionManager'){ // 对督察员单子 回退 - const res = await dcyUniversalApproval(requestData); - } - if(currentRejectItem.value.taskKey=='regionManager'){ // 对全域巡查员单子 回退 - const res = await qyUniversalApproval(requestData); - } - // 对大区经理单子 回退 - uni.showToast({title: '回退成功', icon: 'success', duration: 1000}); - rejectModalShow.value = false; - paging.value?.reload(); // 刷新列表 + await callApprovalApi(requestData, item.taskKey); + uni.showToast({title: '回退成功', icon: 'success'}); + handleRejectModalCancel(); + refreshOrderList(); } catch (error) { console.error('回退工单失败:', error); - uni.showToast({title: '网络异常,回退失败', icon: 'none', duration: 1000}); + uni.showToast({title: '回退失败,请重试', icon: 'none'}); } finally { - // 隐藏加载中 uni.hideLoading(); } }; + // 新增工单 const handleAddOrder = () => { - if (userStore.userInfo?.roles.includes('patrol_global')) { // 全域巡查员 - uni.navigateTo({ - url: '/pages-sub/problem/regional-order-manage/add-patrol-order' - }); - } - if (userStore.userInfo?.roles.includes('regional_manager')) { // 大区经理 - uni.navigateTo({ - url: '/pages-sub/problem/regional-order-manage/add-order' - }); - } - if (userStore.userInfo?.roles.includes('Inspector_global')) { // 督察员 - uni.navigateTo({ - url: '/pages-sub/problem/regional-order-manage/add-order' - }); - } + const pageUrl = USER_ROLES.includes('patrol_global') + ? '/pages-sub/problem/regional-order-manage/add-patrol-order' + : '/pages-sub/problem/regional-order-manage/add-order'; + navToOrderPage(pageUrl); }; -// 验收弹窗 - 取消按钮(清空状态) + +// 关闭验收弹窗-重置状态 const handleAcceptModalCancel = () => { acceptModalShow.value = false; - acceptReason.value = ''; // 清空验收原因 - acceptRadioValue.value = '0'; // 重置单选框为“通过” - acceptImgs.clearImgs(); // 清空验收图片 + acceptReason.value = ''; + acceptRadioValue.value = '0'; + acceptImgs.clearImgs(); }; -// 验收弹窗 - 确定按钮(含returnImgs传参) + +// 验收提交 const handleAcceptModalConfirm = async () => { - // 1. 校验验收原因是否为空 - if (!acceptReason.value.trim()) { - uni.showToast({title: '请填写验收原因', icon: 'none', duration: 1000}); - return; - } - // 2. 校验验收原因长度 - if (acceptReason.value.length > 200) { - uni.showToast({title: '验收原因最多200字', icon: 'none', duration: 1000}); - return; - } - try { - // 3. 构建请求参数(含returnImgs) - console.log(currentAcceptItem.value) - console.log( userStore.userInfo.roles) - console.log( userStore.userInfo.roles.includes('Inspector_global')) - // - if( userStore.userInfo.roles.includes('regional_manager')){ // 大区经理验收 - let postData = { - "returnImgs": acceptImgs.getSuccessImgUrls(), // 验收图片URL数组 - "taskKey": currentAcceptItem.value.taskKey, - "workerDataId": currentAcceptItem.value.id, - "taskId": currentAcceptItem.value.taskId, - "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass, - "reason": acceptReason.value.trim(), - "agree":acceptRadioValue.value, - } - await daquUniversalApproval(postData); - } - // - if( userStore.userInfo.roles.includes('patrol_global')){ // 全域巡查员验收 - let postData = { - "returnImgs": acceptImgs.getSuccessImgUrls(), // 验收图片URL数组 - "taskKey": currentAcceptItem.value.taskKey, - "taskId": currentAcceptItem.value.taskId, - "workerDataId": currentAcceptItem.value.id, - "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass, - "reason": acceptReason.value.trim(), - "agree": acceptRadioValue.value - } - await qyUniversalApproval(postData); - } - // - if( userStore.userInfo.roles.includes('Inspector_global')){ // 督察员验收 - let postData = { - "returnImgs": acceptImgs.getSuccessImgUrls(), // 验收图片URL数组 - "taskKey": currentAcceptItem.value.taskKey, - "taskId": currentAcceptItem.value.taskId, - "workerDataId": currentAcceptItem.value.id, - "operateType": acceptRadioValue.value == 0 ? nextStepMap[currentAcceptItem.value.taskKey].operateTypePass : nextStepMap[currentAcceptItem.value.taskKey].operateTypeNoPass, - "reason": acceptReason.value.trim(), - "agree": acceptRadioValue.value - } - await dcyUniversalApproval(postData); - } + const reason = acceptReason.value.trim(); + if (!reason) return uni.showToast({title: '请填写验收原因', icon: 'none'}); + if (reason.length > 200) return uni.showToast({title: '验收原因最多200字', icon: 'none'}); - // 4. 操作成功处理 - uni.showToast({title: '提交成功', icon: 'success', duration: 1000}); - handleAcceptModalCancel(); // 清空状态 - paging.value?.reload(); // 刷新工单列表 + const item = currentAcceptItem.value; + if (!item?.id) return uni.showToast({title: '工单信息异常', icon: 'none'}); + + try { + const postData = { + returnImgs: acceptImgs.getSuccessImgUrls(), taskKey: item.taskKey, workerDataId: item.id, + taskId: item.taskId, agree: acceptRadioValue.value, reason, + operateType: acceptRadioValue.value === '0' ? nextStepMap[item.taskKey].operateTypePass : nextStepMap[item.taskKey].operateTypeNoPass + }; + await callApprovalApi(postData, item.taskKey); + uni.showToast({title: '提交成功', icon: 'success'}); + handleAcceptModalCancel(); + refreshOrderList(); } catch (error) { - // 5. 操作失败处理 console.error('验收失败:', error); - uni.showToast({title: '验收提交失败,请重试', icon: 'none', duration: 1000}); + uni.showToast({title: '验收提交失败,请重试', icon: 'none'}); } }; -// 页面初始化 + +// ========== 页面生命周期 ========== onLoad(() => { - // 初始化加载列表 - paging.value?.reload(); + refreshOrderList(); }); @@ -734,15 +594,10 @@ onLoad(() => { .select-wrap { width: 120rpx; margin-right: 20rpx; - - :deep(.u-select) { + :deep(.u-select), :deep(.u-input__placeholder) { width: 100%; font-size: 28rpx; } - - :deep(.u-input__placeholder) { - font-size: 28rpx; - } } .search-input-wrap { @@ -758,31 +613,14 @@ onLoad(() => { box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04); } -.card-body { - -} - -// 回退modal样式 -.reject-modal-content { +// 弹窗公共样式 +.reject-modal-content, .accept-modal-content { width: 100%; box-sizing: border-box; padding: 10rpx 0; } -.textarea-label { - font-size: 28rpx; - color: #333; - margin-bottom: 10rpx; - - .required-mark { - color: #f56c6c; - margin-left: 4rpx; - } -} - .upload-wrap { - margin-top: 20rpx; - .upload-title { font-size: 28rpx; color: #333; @@ -790,37 +628,20 @@ onLoad(() => { } } -.mt-20 { - margin-top: 20rpx; -} - -.mt-30 { - margin-top: 30rpx; -} - -// 养护组长验收弹窗样式 -.accept-modal-content { - width: 100%; - box-sizing: border-box; -} - +// 验收弹窗单选框样式 .radio-group-wrap { display: flex; align-items: center; - gap: 40rpx; // 单选框之间的间距 + gap: 40rpx; font-size: 28rpx; margin-bottom: 20rpx; } .textarea-wrap { width: 100%; - margin-top: 30rpx; } -.modal-btn-wrap { - display: flex; - align-items: center; - justify-content: flex-end; - padding-right: 10rpx; -} +// 间距公共样式 +.mt-20 { margin-top: 20rpx; } +.mt-30 { margin-top: 30rpx; } \ No newline at end of file diff --git a/pages-sub/problem/regional-order-manage/add-order.vue b/pages-sub/problem/regional-order-manage/add-order.vue index 494d88d..82a8594 100644 --- a/pages-sub/problem/regional-order-manage/add-order.vue +++ b/pages-sub/problem/regional-order-manage/add-order.vue @@ -63,7 +63,7 @@ - - + 派单情况 - - + @@ -156,11 +154,7 @@ > - + @@ -170,11 +164,7 @@ - + @@ -199,116 +189,73 @@ @@ -734,15 +608,10 @@ onLoad(() => { .select-wrap { width: 120rpx; margin-right: 20rpx; - - :deep(.u-select) { + :deep(.u-select), :deep(.u-input__placeholder) { width: 100%; font-size: 28rpx; } - - :deep(.u-input__placeholder) { - font-size: 28rpx; - } } .search-input-wrap { @@ -758,31 +627,14 @@ onLoad(() => { box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04); } -.card-body { - -} - -// 回退modal样式 -.reject-modal-content { +// 弹窗公共样式 +.reject-modal-content, .accept-modal-content { width: 100%; box-sizing: border-box; padding: 10rpx 0; } -.textarea-label { - font-size: 28rpx; - color: #333; - margin-bottom: 10rpx; - - .required-mark { - color: #f56c6c; - margin-left: 4rpx; - } -} - .upload-wrap { - margin-top: 20rpx; - .upload-title { font-size: 28rpx; color: #333; @@ -790,37 +642,20 @@ onLoad(() => { } } -.mt-20 { - margin-top: 20rpx; -} - -.mt-30 { - margin-top: 30rpx; -} - -// 养护组长验收弹窗样式 -.accept-modal-content { - width: 100%; - box-sizing: border-box; -} - +// 验收弹窗单选框样式 .radio-group-wrap { display: flex; align-items: center; - gap: 40rpx; // 单选框之间的间距 + gap: 40rpx; font-size: 28rpx; margin-bottom: 20rpx; } .textarea-wrap { width: 100%; - margin-top: 30rpx; } -.modal-btn-wrap { - display: flex; - align-items: center; - justify-content: flex-end; - padding-right: 10rpx; -} +// 间距公共样式 +.mt-20 { margin-top: 20rpx; } +.mt-30 { margin-top: 30rpx; } \ No newline at end of file diff --git a/pages-sub/problem/regional-order-manage/order-detail.vue b/pages-sub/problem/regional-order-manage/order-detail.vue index 2dfd502..540f99e 100644 --- a/pages-sub/problem/regional-order-manage/order-detail.vue +++ b/pages-sub/problem/regional-order-manage/order-detail.vue @@ -267,23 +267,23 @@ - - - 回退 - - - 重新提交 - - - {{ - nextStepMap[orderDetail.taskKey].btnText - }} - - - - + + + + + + + + + + + + + + + + + { }).filter(Boolean); // 过滤null项 } else { coProcessorList.value = [] - uni.showToast({ - title: '暂无共同处理人数据', - icon: 'none', - duration: 2000 - }); + // uni.showToast({ + // title: '暂无共同处理人数据', + // icon: 'none', + // duration: 1000 + // }); console.warn('loadCoProcessorList提示:处理人列表为空'); } } catch (err) { diff --git a/pages.json b/pages.json index 427e567..7ae41c7 100644 --- a/pages.json +++ b/pages.json @@ -10,7 +10,8 @@ { "path": "pages/login/index", "style": { - "navigationBarTitleText": "登录" + "navigationBarTitleText": "登录", + "navigationStyle": "custom" } }, { @@ -166,7 +167,7 @@ { "path": "regional-order-manage/add-patrol-order", - "style": { "navigationBarTitleText": "待派单" } + "style": { "navigationBarTitleText": "提交工单" } }, { @@ -197,7 +198,21 @@ { "path": "tree-archive/index", "style": { "navigationBarTitleText": "行道树档案" } + }, + { + "path": "tree-archive/treeRecord", + "style": { "navigationBarTitleText": "行道树记录" } + }, + { + "path": "tree-archive/addTree", + "style": { "navigationBarTitleText": "新增行道树" } + }, + { + "path": "tree-archive/editTree", + "style": { "navigationBarTitleText": "编辑行道树" } } + + ] } ], diff --git a/pages/login/index.vue b/pages/login/index.vue index c8033d1..a04518d 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -1,61 +1,63 @@ - - + + + 你好,欢迎光临 + 全域智能运营管理平台 + - + - - 园林登录 + + 账户登录 - - - + + + - - - - - - {{ error.account }} - + loginFormRef.validateField('account')" + /> + - - - + - - - - - - {{ error.password }} - + loginFormRef.validateField('password')" + /> + + 登录 + + + 蓟城山水集团版权所有
+ {{ item.roadName }} + {{ item.treeCount }}棵 +
已录入行道树:{{ item.recordedCount }}棵
起点:{{ item.startRemark }}
终点:{{ item.endRemark }}