diff --git a/src/api/repair/orderinfo/index.js b/src/api/repair/orderinfo/index.js index 31ac54e..73504c7 100644 --- a/src/api/repair/orderinfo/index.js +++ b/src/api/repair/orderinfo/index.js @@ -56,7 +56,7 @@ export function exportOrderInfoExcel(params) { export function toPay(params) { return request({ - url: '/admin-api/pay/toPay', + url: '/admin-api/pay/toPayCode', method: 'get', params }) diff --git a/src/api/repair/repairRecord/index.js b/src/api/repair/repairRecord/index.js new file mode 100644 index 0000000..38d7675 --- /dev/null +++ b/src/api/repair/repairRecord/index.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// 根据条件查询维修记录 +export function queryList(params){ + return request({ + url: '/dl/repair-records/list', + method: 'get', + params + }) +} + +// 设置图片是否开放给用户 +export function updateOpen(ids, isOpen){ + return request({ + url: '/dl/repair-records-item/updateOpen?ids=' + ids + '&isOpen=' + isOpen, + method: 'get', + }) +} diff --git a/src/api/repair/tickets/Tickets.js b/src/api/repair/tickets/Tickets.js index 4df93e4..1babdd4 100644 --- a/src/api/repair/tickets/Tickets.js +++ b/src/api/repair/tickets/Tickets.js @@ -149,3 +149,12 @@ export function noticeCus(data){ data }) } + +// 新增工单子项 +export function addItems(data){ + return request({ + url: preUrl + "/addItems", + method: 'post', + data + }) +} diff --git a/src/api/repair/tickets/TicketsItem.js b/src/api/repair/tickets/TicketsItem.js index 5d6ae96..868a03c 100644 --- a/src/api/repair/tickets/TicketsItem.js +++ b/src/api/repair/tickets/TicketsItem.js @@ -18,3 +18,28 @@ export function getProjectList(ticketId){ method: 'get' }) } + +// 查看单个维修子表的数据 +export function getItemById(id){ + return request({ + url: preUrl + "/getById?id=" + id, + method: 'get' + }) +} + +// 修改单个工单子项的内容 +export function updateById(data){ + return request({ + url: preUrl + "/updateById", + method: 'post', + data + }) +} + +// 维修工单单个子项 +export function removeItemById(id){ + return request({ + url: preUrl + "/removeById?id=" + id, + method: 'delete' + }) +} diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 3aca219..d80e855 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -37,8 +37,9 @@ const permission = { // 将 menus 菜单,转换为 route 路由数组 const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据 const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据 - const sidebarRoutes = filterAsyncRouter(sdata) - const rewriteRoutes = filterAsyncRouter(rdata, false, true) + const sss = JSON.parse(JSON.stringify(menus)) + const sidebarRoutes = filterAsyncRouter(sdata,sss) + const rewriteRoutes = filterAsyncRouter(rdata,sss, false, true) rewriteRoutes.push({path: '*', redirect: '/404', hidden: true}) commit('SET_ROUTES', rewriteRoutes) commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) @@ -51,13 +52,12 @@ const permission = { } // 遍历后台传来的路由字符串,转换为组件对象 -function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { +function filterAsyncRouter(asyncRouterMap,sdata, lastRouter = false, type = false) { return asyncRouterMap.filter(function(route,index) { // 将 ruoyi 后端原有耦合前端的逻辑,迁移到此处 // 处理 meta 属性 route.meta = { - title:dealMenuText(index) +' '+ route.name, - icon: route.icon, + title:dealMenuText(index,route,sdata) +' '+ route.name, noCache: !route.keepAlive, } route.hidden = !route.visible @@ -89,23 +89,56 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { route.children = filterChildren(route.children) } if (route.children != null && route.children && route.children.length) { - route.children = filterAsyncRouter(route.children, route, type) + route.children = filterAsyncRouter(route.children,sdata, route, type) route.alwaysShow = route.alwaysShow !== undefined ? route.alwaysShow : true } else { delete route['children'] delete route['alwaysShow'] // 如果没有子菜单,就不需要考虑 alwaysShow 字段 } - console.log(route,989898) return true }) } -function dealMenuText(num){ - let tempData =['(一)','(二)','(三)','(四)','(五)','(六)','(七)','(八)','(九)','(十)' - ,'(十一)','(十二)','(十三)','(十四)','(十五)','(十六)','(十七)','(十八)','(十九)','(二十)','(二十一)','(二十二)','(二十三)'] - if (num>tempData.length){ - return ""; +function dealMenuText(num,data,list){ + if (data.parentId==0){ + let tempData =['一','二','三','四','五','六','七','八','九','十' + ,'十一','十二','十三','十四','十五','十六','十七','十八','十九','二十','二十一','二十二','二十三'] + if (num>tempData.length){ + return ""; + } + return tempData[num] +'、' + }else { + let level =1; + let parData ={}; + for (const item of list) { + if ( data.parentId == item.id){ + parData = item + level++ + break; + } + } + for (const item of list) { + if ( parData.parentId == 0){ + parData = item + level++ + break; + } + } + if (level==2){ + let tempData2 =['(一)','(二)','(三)','(四)','(五)','(六)','(七)','(八)','(九)','(十)' + ,'(十一)','(十二)','(十三)','(十四)','(十五)','(十六)','(十七)','(十八)','(十九)','(二十)','(二十一)','(二十二)','(二十三)'] + if (num>tempData2.length){ + return ""; + } + return tempData2[num] + }else if (level == 3){ + return (num+1)+'.' + }else { + return "" + } + + } - return tempData[num] + } function filterChildren(childrenMap, lastRouter = false) { let children = []; diff --git a/src/utils/dict.js b/src/utils/dict.js index a5009c8..bebda61 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -220,6 +220,8 @@ export const DICT_TYPE = { TICKET_WARES_STATUS: 'ticket_wares_status', // 领料、退料配件状态 TW_ITEM_STATUS: 'tw_item_status', + // 维修记录类型 + REPAIR_RECORDS_TYPE: 'repair_records_type', // ---------会员相关---------member_coupon_type,member_coupon_out_rule,member_car,member_active //卡券类型 diff --git a/src/views/index.vue b/src/views/index.vue index 0319fcd..42eb991 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,14 +1,15 @@ @@ -138,6 +146,8 @@ 退料全部 + + @@ -151,10 +161,11 @@ import {updateTicketWares} from "@/api/repair/tickets/TicketWares"; import {getIfLeader} from "@/api/repair/repairworker"; import UpdateRecord from "@/views/repair/tickets/form/UpdateRecord.vue"; import {getUserProfile} from "@/api/system/user"; +import RecordSetting from "@/views/repair/tickets/form/RecordSetting.vue"; export default { name: "TicketManagerItem", - components: {UpdateRecord, TWOperate, UpdateRepair, TicketsShow}, + components: {RecordSetting, UpdateRecord, TWOperate, UpdateRepair, TicketsShow}, props: { isFinish: { type: Boolean, @@ -192,7 +203,7 @@ export default { formData: {}, remark: null, leader: false, - nowUser: null + nowUser: null, } }, mounted() { @@ -294,6 +305,9 @@ export default { case 'handleBack': this.handleBack(row) break + case 'handleEditRecord': + this.handleEditRecord(row) + break default: break } @@ -379,7 +393,11 @@ export default { clickType: type } this.$refs.updateRecord.open(row) - } + }, + // 设置维修图片可不可见 + handleEditRecord(row){ + this.$refs.recordSet.open(row.id) + }, } } diff --git a/src/views/repair/tickets/form/EditTickets.vue b/src/views/repair/tickets/form/EditTickets.vue index 32fd63b..1e5dab2 100644 --- a/src/views/repair/tickets/form/EditTickets.vue +++ b/src/views/repair/tickets/form/EditTickets.vue @@ -1,28 +1,350 @@ diff --git a/src/views/repair/tickets/form/RecordSetting.vue b/src/views/repair/tickets/form/RecordSetting.vue new file mode 100644 index 0000000..1b3192e --- /dev/null +++ b/src/views/repair/tickets/form/RecordSetting.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/src/views/repair/tickets/form/TicketFinishManager.vue b/src/views/repair/tickets/form/TicketFinishManager.vue index 251d382..be84783 100644 --- a/src/views/repair/tickets/form/TicketFinishManager.vue +++ b/src/views/repair/tickets/form/TicketFinishManager.vue @@ -44,9 +44,12 @@ 查看 - + 编辑工单 + + 维修记录设置 + 处理 @@ -97,20 +100,6 @@ - - - - - - - - @@ -140,6 +129,8 @@ + + @@ -148,10 +139,12 @@ import {getPageByRole, inspection, confirm, noticeCus} from "@/api/repair/ticket import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue"; import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue"; import {getUserProfile} from "@/api/system/user"; +import EditTickets from "@/views/repair/tickets/form/EditTickets.vue"; +import RecordSetting from "@/views/repair/tickets/form/RecordSetting.vue"; export default { name: "TicketFinishManager", - components: {UpdateRepair, TicketsShow}, + components: {RecordSetting, EditTickets, UpdateRepair, TicketsShow}, props:{ userRole: String }, @@ -176,14 +169,12 @@ export default { formRules:{}, formLoading:{}, noticeData:{ - time: [], name: null, mobile: null, id: null, remark: null, }, noticeRules:{ - time: [{required: true, message: '时间不能为空', trigger: 'blur'}], mobile: [{required: true, message: '联系电话不能为空', trigger: 'blur'}] }, noticeLoading: false, @@ -283,7 +274,14 @@ export default { this.$modal.msgSuccess("操作成功") await this.getList() }catch {} - } + }, + handleEdit(row){ + this.$refs.editTickets.open(row) + }, + // 设置维修图片可不可见 + handleEditRecord(row){ + this.$refs.recordSet.open(row.id) + }, } }