diff --git a/src/api/repair/repairworker/index.js b/src/api/repair/repairworker/index.js index 0ffa801..76bae95 100644 --- a/src/api/repair/repairworker/index.js +++ b/src/api/repair/repairworker/index.js @@ -1,53 +1,69 @@ -import request from '@/utils/request' - -// 创建维修工人 -export function createWorker(data) { - return request({ - url: '/repair/worker/create', - method: 'post', - data: data - }) -} - -// 更新维修工人 -export function updateWorker(data) { - return request({ - url: '/repair/worker/update', - method: 'put', - data: data - }) -} - -// 删除维修工人 -export function deleteWorker(id) { - return request({ - url: '/repair/worker/delete?id=' + id, - method: 'delete' - }) -} - -// 获得维修工人 -export function getWorker(id) { - return request({ - url: '/repair/worker/get?id=' + id, - method: 'get' - }) -} - -// 获得维修工人分页 -export function getWorkerPage(params) { - return request({ - url: '/repair/worker/page', - method: 'get', - params - }) -} -// 导出维修工人 Excel -export function exportWorkerExcel(params) { - return request({ - url: '/repair/worker/export-excel', - method: 'get', - params, - responseType: 'blob' - }) -} \ No newline at end of file +import request from '@/utils/request' + +// 创建维修工人 +export function createWorker(data) { + return request({ + url: '/repair/worker/create', + method: 'post', + data: data + }) +} + +// 更新维修工人 +export function updateWorker(data) { + return request({ + url: '/repair/worker/update', + method: 'put', + data: data + }) +} + +// 删除维修工人 +export function deleteWorker(id) { + return request({ + url: '/repair/worker/delete?id=' + id, + method: 'delete' + }) +} + +// 获得维修工人 +export function getWorker(id) { + return request({ + url: '/repair/worker/get?id=' + id, + method: 'get' + }) +} + +// 获得维修工人分页 +export function getWorkerPage(params) { + return request({ + url: '/repair/worker/page', + method: 'get', + params + }) +} +// 导出维修工人 Excel +export function exportWorkerExcel(params) { + return request({ + url: '/repair/worker/export-excel', + method: 'get', + params, + responseType: 'blob' + }) +} + +// 通过工单ID查到工单ID中所选择的员工信息 +export function listByTicketId(id){ + return request({ + url: '/repair/worker/listByTicketId?ticketId=' + id, + method: 'get' + }) +} + +// 通过班组长的id查该班组的员工 +export function listByLeads(){ + return request({ + url: '/repair/worker/listByLeadsId', + method: 'get' + }) +} diff --git a/src/api/repair/tickets/Tickets.js b/src/api/repair/tickets/Tickets.js index f21fef6..148a618 100644 --- a/src/api/repair/tickets/Tickets.js +++ b/src/api/repair/tickets/Tickets.js @@ -72,3 +72,28 @@ export function getPageType(params){ params }) } + +// 判断登录用户的角色,针对维修工单中的四个角色 +export function getUserRole(){ + return request({ + url: preUrl + "/userRole", + method: "get" + }) +} + +// 接单 +export function updateTake(id){ + return request({ + url: preUrl + "/take?id=" + id, + method: "get", + }) +} + +// 指派员工,通知施工 +export function updateRepair(data){ + return request({ + url: preUrl + "/notify", + method: "post", + data + }) +} diff --git a/src/utils/dict.js b/src/utils/dict.js index fe544c4..4326514 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -212,6 +212,8 @@ export const DICT_TYPE = { REPAIR_NOTICE_SERVER: 'weixiu', //工种(维修项目类型) REPAIR_WORK_TYPE: 'repair_work_type', + // 维修工单进行状态 + REPAIR_TICKETS_WORK_STATUS: 'repair_tickets_work_status', // ---------会员相关---------member_coupon_type,member_coupon_out_rule,member_car,member_active //卡券类型 diff --git a/src/views/repair/Components/StaffChoose.vue b/src/views/repair/Components/StaffChoose.vue index 7f43a1f..fee0d3b 100644 --- a/src/views/repair/Components/StaffChoose.vue +++ b/src/views/repair/Components/StaffChoose.vue @@ -1,5 +1,6 @@ @@ -14,7 +15,7 @@ export default { value: { type: Object, }, - isGet:{ + isGet: { type: String, default: '', required: false @@ -32,7 +33,9 @@ export default { watch: { staffSelected(val) { const staff = this.staffList.find(item => item.id === val); - this.$emit("input", staff); + if (staff) { + this.$emit("input", staff); + } }, value(newVal) { if (newVal) { @@ -52,12 +55,11 @@ export default { if (!this.isGet) return; const res = await getStaffList(this.query) this.staffList = res.data - this.hasRequest = true } finally { this.selectLoading = false } }, - changeQuery(val){ + changeQuery(val) { this.query = val this.listStaff() } diff --git a/src/views/repair/tickets/Components/TicketItem.vue b/src/views/repair/tickets/Components/TicketItem.vue index abbb80e..0555d50 100644 --- a/src/views/repair/tickets/Components/TicketItem.vue +++ b/src/views/repair/tickets/Components/TicketItem.vue @@ -185,7 +185,6 @@ export default { watch: { list: { handler(val) { - // console.log(val) this.$emit("tableData", val) const coupons = val.filter(item => item.coupon).map(item => item.coupon) if (coupons && coupons.length > 0) { @@ -195,7 +194,6 @@ export default { deep: true }, inListData(val) { - // console.log(val) if (val && val.length > 0) { val.forEach(item => { item = { @@ -204,20 +202,10 @@ export default { totalPrice: item.itemMoney, } }) - // console.log(val) - // this.list = val.map(item => { - // return { - // ...item, - // count: item?.itemCount, - // } - // }) } } }, computed: { - // DICT_TYPE() { - // return DICT_TYPE - // }, getLabelName() { switch (this.itemType) { case "project": diff --git a/src/views/repair/tickets/Components/TicketManagerItem.vue b/src/views/repair/tickets/Components/TicketManagerItem.vue index 56e851c..496f15d 100644 --- a/src/views/repair/tickets/Components/TicketManagerItem.vue +++ b/src/views/repair/tickets/Components/TicketManagerItem.vue @@ -39,14 +39,31 @@ - + @@ -55,19 +72,26 @@ @pagination="listTickets" /> + + +