From 328d8e41cefa598b59862549b5d615f990933587 Mon Sep 17 00:00:00 2001 From: PQZ Date: Fri, 18 Oct 2024 16:10:56 +0800 Subject: [PATCH] 1 --- pages-order/choosePeople/choosePeople.vue | 53 +++++++++++++++++------ utils/utils.js | 6 +-- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/pages-order/choosePeople/choosePeople.vue b/pages-order/choosePeople/choosePeople.vue index 84de317..c5e334f 100644 --- a/pages-order/choosePeople/choosePeople.vue +++ b/pages-order/choosePeople/choosePeople.vue @@ -2,22 +2,22 @@ - + + + + + +
- + {{item.userName}} - {{item.gz}}{{item.checked}} + {{item.workTypeText}} - + @@ -34,7 +34,7 @@ import VNavigationBar from '@/components/VNavigationBar.vue' import {bus} from "@/utils/eventBus"; import request from '@/utils/request'; -import {getDictByCode} from "@/utils/utils"; +import {getDictTextByCodeAndValue} from "@/utils/utils"; export default { components: { VNavigationBar, @@ -63,13 +63,38 @@ export default { params:{ticketId:this.ticketId} }).then((res)=>{ this.list = res.data + this.list.map((item)=>{ + item.workTypeText = getDictTextByCodeAndValue('repair_work_type',item.workType) + }) }) }, submit() { - console.log('this.checked', this.checked) - const selected = this.list.filter(f => this.checked.includes(f.id)) - bus.$emit('choosePeople', selected) - uni.navigateBack() + const nowRepairId = this.checked[0] + const nowRepair = this.list.filter(item => nowRepairId===item.userId); + const param = { + id:this.ticketId, + nowRepairId:nowRepairId, + nowRepairName:nowRepair[0].userName, + } + console.log(param) + request({ + url: '/admin-api/repair/tickets/notify', + method: 'post', + data:param + }).then((res)=>{ + uni.showToast({ + title: '指派成功!', + icon: 'none' + }) + setTimeout(()=>{ + uni.navigateBack() + },700) + }) + // + // console.log('this.checked', this.checked) + // const selected = this.list.filter(f => this.checked.includes(f.id)) + // bus.$emit('choosePeople', selected) + // uni.navigateBack() } } } diff --git a/utils/utils.js b/utils/utils.js index 4074893..abade69 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -86,11 +86,11 @@ function getDictByCode(dictCode){ function getDictTextByCodeAndValue(dictCode,value){ let dictArray = getStorageWithExpiry(dictCode); if(null==dictArray){ - dictArray = this.getDictByCode(dictCode) + dictArray = getDictByCode(dictCode) } - let dictObj = dictArray.find(item=>item.dictValue==value) + let dictObj = dictArray.find(item=>item.value==value) if(dictObj){ - return dictObj.dictLabel + return dictObj.label }else{ return "未知数据" }