|
|
@@ -38,7 +38,7 @@
|
|
|
|
|
|
<view class="info-item" v-if="acceptReturnType">
|
|
|
<text class="info-label">接单退回原因</text>
|
|
|
- <text class="info-value">{{ getReturnTypeName(acceptReturnType)}}</text>
|
|
|
+ <text class="info-value">{{ getAcceptReturnTypeName(acceptReturnType)}}</text>
|
|
|
</view>
|
|
|
<view class="info-item" v-if="acceptReturnReason">
|
|
|
<text class="info-label">接单退回说明</text>
|
|
|
@@ -100,6 +100,7 @@
|
|
|
const acceptReturnType = ref<string>("")
|
|
|
const acceptReturnReason = ref<string>("")
|
|
|
const returnTypeDictList = ref<SysDictData[]>([]) // 退回原因字典列表
|
|
|
+ const acceptReturnTypeDictList = ref<SysDictData[]>([]) // 退回原因字典列表
|
|
|
|
|
|
|
|
|
const formatDate = (dateString: string): string => {
|
|
|
@@ -302,17 +303,26 @@
|
|
|
const dictItem = returnTypeDictList.value.find(dict => dict.dictValue == rawStatus)
|
|
|
return dictItem!=null ? dictItem.dictLabel : rawStatus
|
|
|
}
|
|
|
+ const getAcceptReturnTypeName = (item: string | null): string | null => {
|
|
|
+ if (item == null) return ''
|
|
|
+ // const orderInfoItem = item as orderInfo
|
|
|
+ const rawStatus = item
|
|
|
+
|
|
|
+ if (rawStatus==null) return ''
|
|
|
+
|
|
|
+ // 如果字典尚未加载,返回原始值
|
|
|
+ if (dictLoaded.value == false) {
|
|
|
+ return rawStatus
|
|
|
+ }
|
|
|
|
|
|
- const loadReturnDictList = async (): Promise<void> => {
|
|
|
+ // 查找字典中对应的标签
|
|
|
+ const dictItem = acceptReturnTypeDictList.value.find(dict => dict.dictValue == rawStatus)
|
|
|
+ return dictItem!=null ? dictItem.dictLabel : rawStatus
|
|
|
+ }
|
|
|
+
|
|
|
+ const loadReturnDictList = async (returnTypeDict: string): Promise<void> => {
|
|
|
try {
|
|
|
- const dictString = ref("")
|
|
|
- if(detailData.value.workOrderStatus == 'assigned') {
|
|
|
- dictString.value = "gxt_accept_return_type"
|
|
|
- } else {
|
|
|
- dictString.value = "gxt_return_type"
|
|
|
- }
|
|
|
-
|
|
|
- const result = await getDictDataByType(dictString.value)
|
|
|
+ const result = await getDictDataByType(returnTypeDict)
|
|
|
const resultObj = result as UTSJSONObject
|
|
|
|
|
|
if (resultObj['code'] == 200) {
|
|
|
@@ -340,8 +350,12 @@
|
|
|
dictData.push(dictItem)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- returnTypeDictList.value = dictData
|
|
|
+ if(returnTypeDict == 'gxt_return_type') {
|
|
|
+ returnTypeDictList.value = dictData
|
|
|
+ } else {
|
|
|
+ acceptReturnTypeDictList.value = dictData
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
} catch (e: any) {
|
|
|
console.error('获取工单状态字典失败:', e.message)
|
|
|
@@ -432,7 +446,8 @@
|
|
|
workEndTime: data['workEndTime'] as string | null // 新增字段
|
|
|
}
|
|
|
detailData.value = orderDtail
|
|
|
- await loadReturnDictList()
|
|
|
+ await loadReturnDictList('gxt_return_type')
|
|
|
+ await loadReturnDictList('gxt_accept_return_type')
|
|
|
returnType.value = (data['returnType'] as string | null) ?? ''
|
|
|
returnReason.value = (data['returnReason'] as string | null) ?? ''
|
|
|
acceptReturnType.value = (data['acceptReturnType'] as string | null) ?? ''
|