ÎļþÃû´Ó eims-ui-mobile/src/pages/repair/feedback.vue ÐÞ¸Ä |
| | |
| | | </view> |
| | | </template> |
| | | <wd-steps :active="repairRecordList.length" vertical class="px-4"> |
| | | <wd-step v-for="(item,index) in repairRecordList" > |
| | | <wd-step v-for="(item, index) in repairRecordList"> |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="ml-1 text-xs">{{ item?.operaResult }}</view> |
| | |
| | | </view> |
| | | </template> |
| | | </wd-step> |
| | | |
| | | </wd-steps> |
| | | </wd-card> |
| | | |
| | |
| | | </view> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { getRepairRes, getRepairFb, getRepairRecordList } from '@/service/repair' |
| | | import { |
| | | getRepairRes, |
| | | getRepairFb, |
| | | getRepairRecordList, |
| | | addRepairFb, |
| | | updateRepairFb, |
| | | } from '@/service/repair' |
| | | import { reactive } from 'vue' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { RepairResVO, RepairFbVO, RepairRecordVO } from '@/service/repair.d' |
| | | |
| | | const isUpdate = ref(false) |
| | | const repairRes = reactive<RepairResVO>({ |
| | | id: '', |
| | | resCode: '', |
| | |
| | | |
| | | const repairFb = reactive<RepairFbVO>({ |
| | | id: '', |
| | | resId: '', |
| | | resCode: '', |
| | | fbResult: '', |
| | | suggestions: '', |
| | |
| | | } |
| | | |
| | | function getRepairRecord() { |
| | | if(!repairRes.id){ |
| | | return false |
| | | if (!repairRes.id) { |
| | | return false |
| | | } |
| | | const params = { |
| | | resId: repairRes.id, |
| | |
| | | getRepairRecordList(params) |
| | | .then((res: any) => { |
| | | console.error(res) |
| | | if(res?.code === 200){ |
| | | if (res?.code === 200) { |
| | | repairRecordList.value = res?.rows?.sort((a, b) => { |
| | | if (a.handleTime < b.handleTime) { |
| | | return -1 |
| | |
| | | }) |
| | | .catch((res) => {}) |
| | | } |
| | | |
| | | |
| | | function initRepairRes(id: any) { |
| | | getRepairRes(id) |
| | |
| | | function getFeedBack(id: any) { |
| | | getRepairFb(id) |
| | | .then((res: any) => { |
| | | // å¨è¿éè¿è¡æ°æ®ç±»åè½¬æ¢ |
| | | res.repairSatisfaction = Number(res?.repairSatisfaction) |
| | | res.repairTimeliness = Number(res?.repairTimeliness) |
| | | res.serviceAttitude = Number(res?.serviceAttitude) |
| | | res.repairSs = Number(res?.repairSs) |
| | | Object.assign(repairFb, res) |
| | | }) |
| | | .catch((res) => {}) |
| | | } |
| | | async function initData(options: any) { |
| | | initRepairRes(options.id) |
| | | |
| | | function handleRepairFb() { |
| | | if(isOperatorOrRepair()){ |
| | | uni.showToast({ |
| | | title: 'æ æé,请ç»å½ç®¡çåè´¦å·æä½', |
| | | icon: 'none', |
| | | }) |
| | | return false |
| | | } |
| | | const id = repairFb.id |
| | | isUpdate.value = !!id |
| | | if (isUpdate.value) { |
| | | updateRepairFb(repairFb) |
| | | .then((res: any) => { |
| | | if (res?.code === 200) { |
| | | uni.showToast({ |
| | | title: 'ä¿®æ¹æå', |
| | | icon: 'none', |
| | | }) |
| | | } |
| | | }) |
| | | .catch((res) => {}) |
| | | } else { |
| | | addRepairFb(repairFb) |
| | | .then((res: any) => { |
| | | if (res?.code === 200) { |
| | | uni.showToast({ |
| | | title: 'è¯ä»·æå', |
| | | icon: 'none', |
| | | }) |
| | | } |
| | | }) |
| | | .catch((res) => {}) |
| | | } |
| | | } |
| | | |
| | | async function initData(options: any) { |
| | | repairFb.resId = options.id |
| | | initRepairRes(options.id) |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | handleRepairFb() |
| | | } |
| | | }) |
| | | |
| | | onLoad((options) => { |
| | | initData(options) |
| | | }) |