From e077a990751aa24d67e99caa8992d05510c299fa Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 21 Oct 2024 18:10:19 +0800 Subject: [PATCH] app --- pages-order/orderDetail/orderDetail.vue | 60 +++++++++++++++++++------ 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue index 1240b41..275f5e6 100644 --- a/pages-order/orderDetail/orderDetail.vue +++ b/pages-order/orderDetail/orderDetail.vue @@ -125,11 +125,11 @@ ¥{{ item.itemMoney }} - 售价:{{ item.itemPrice }} - 数量:{{ item.itemCount }} - 单位:{{ item.itemUnit}} - 折扣:{{ item.itemDiscount }} - 金额:{{ item.itemMoney }} + 售价:{{ item.itemPrice || "" }} + 数量:{{ item.itemCount || "" }} + + 折扣:{{ item.itemDiscount || "" }} + 金额:{{ item.itemMoney || "" }} @@ -137,7 +137,7 @@ 销售人员 - {{item.saleName}} + {{item.saleName || ""}} 施工人员 - {{ item.repairNames }} + {{ item.repairNames || ""}} @@ -183,11 +183,11 @@ ¥{{ item.itemMoney }} - 售价:{{ item.itemPrice }} - 数量:{{ item.itemCount }} - 单位:{{ item.itemUnit}} - 折扣:{{ item.itemDiscount }} - 金额:{{ item.itemMoney }} + 售价:{{ item.itemPrice || "" }} + 数量:{{ item.itemCount || "" }} + 单位:{{ getItemUnit(item.itemUnit) || ""}} + 折扣:{{ item.itemDiscount || "" }} + 金额:{{ item.itemMoney || "" }} @@ -257,7 +257,7 @@ import VNavigationBar from '@/components/VNavigationBar.vue' import {bus} from "@/utils/eventBus"; import request from '@/utils/request'; import upload from '@/utils/upload' -import {getOrderStatusText,formatDate,formatTimestamp,getDictTextByCodeAndValue,saveTicketsRecords} from "@/utils/utils"; +import {getOrderStatusText,formatDate,formatTimestamp,getDictTextByCodeAndValue,saveTicketsRecords,setStorageWithExpiry,getStorageWithExpiry} from "@/utils/utils"; import {getUserInfo,setJSONData} from '@/utils/auth' import config from '@/config' export default { @@ -685,6 +685,40 @@ export default { url: `/pages-order/choosePeople/choosePeople?type=${type}` }) }, + //翻译配件单位 + getItemUnit(unitCode){ + if(unitCode){ + let dictArray = getStorageWithExpiry("repair_unit"); + if(null==dictArray || undefined==dictArray){ + request({ + url: '/admin-api/system/dict-data/type', + method: 'get', + tenantIdFlag:false, + params:{type:"repair_unit"} + }).then((res) => { + console.log(res) + if (res.code == 200) { + setStorageWithExpiry("repair_unit",res.data,3600) + let dictObj = dictArray.find(dict => dict.value == unitCode) + console.log(dictObj, "dictObj") + if (dictObj) { + return dictObj.label + } else { + return "未知数据" + } + } + }) + }else{ + let dictObj = dictArray.find(dict => dict.value == unitCode) + console.log(dictObj, "dictObj") + if (dictObj) { + return dictObj.label + } else { + return "未知数据" + } + } + } + }, /** * 点击配件申请单提醒,查看相关配件 * @param wareId