diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue
index f002432..c7ac7bf 100644
--- a/pages-order/orderDetail/orderDetail.vue
+++ b/pages-order/orderDetail/orderDetail.vue
@@ -4,53 +4,54 @@
-
+
-
- {{ orderInfo.flag == 5 ? '已完成' : '待处理' }}
- 当前工单维修项目{{ orderInfo.flag == 5 ? '已全部完成' : '正在进行维修' }}
+ {{ ticketInfo.ticketsStatus == '02' ? '已完成' : ticketInfo.statusStr }}
+ 当前工单维修项目{{ ticketInfo.flag == '02' ? '已全部完成' : ticketInfo.statusStr }}
车辆信息
车架号
- {{ carInfo.cjNo }}
+ {{ ticketInfo.carVin }}
+
+
+
+
- 发动机号
- {{ carInfo.fdjNo }}
+ 注册日期
+ {{ ticketInfo.carRegisterDate }}
年检时间
- {{ carInfo.njDate }}
+ {{ ticketInfo.inspectionDate }}
保险时间
- {{ carInfo.bxDate }}
+ {{ ticketInfo.insuranceDate }}
-
- 注册日期
- {{ carInfo.zcrqDate }}
-
+
-
+
客户信息
姓名
- {{ userInfo.name }}
+ {{ ticketInfo.userName }}
性别
- {{ userInfo.sex === '1' ? '女' : '男' }}
+ {{ ticketInfo.customerInfo.sex === '1' ? '女' : '男' }}
联系方式
- {{ userInfo.phone }}
+ {{ ticketInfo.userMobile }}
- 出生年月
- {{ userInfo.birthday }}
+ 生日
+ {{ ticketInfo.birthday }}
联系地址
- {{ userInfo.provinceName }} {{ userInfo.cityName }} {{ userInfo.areaName }} {{ userInfo.address }}
+ {{ ticketInfo.customerInfo.address }}
-
-
+
维修项目
-
-
+
+
+
+
+ 当前项目有待审批的配件申请单!
+
+
+
+ {{ item.itemName }}
+ ¥{{ item.itemMoney }}
+
+
+ 规格:{{item.project.spec}}
+ 售价:{{ item.itemPrice }}
+ 数量:{{ item.itemCount }}
+ 单位:{{ item.itemUnit}}
+ 折扣:{{ item.itemDiscount }}
+ 金额:{{ item.itemMoney }}
+
+
+
+
+
+
+
+ 维修记录
+
+
+
- {{ item.projName }}
- ${{ item.amount }}
+ {{ item.typeStr }}
+
- {{ item.date }}
+ {{ item.createTime }}
-
-
- 当前项目有待审批的配件申请单!
-
-
-
+
- {{ item.desc }}
+ {{ item.remark }}
-
@@ -147,70 +206,13 @@
-
-
-
-
-
-
-
- {{ item.projName }}
- ¥{{ item.amount }}
-
-
- 规格:{{ '轿车' }}
- 售价:{{ '280' }}
- 数量:{{ '1' }}
- 单位:{{ '辆' }}
- 折扣:{{ '10' }}
- 金额:{{ '280.00' }}
-
-
-
-
@@ -221,39 +223,25 @@
import VNavigationBar from '@/components/VNavigationBar.vue'
import {bus} from "@/utils/eventBus";
import request from '@/utils/request';
-import {getOrderStatusText} from "@/utils/utils";
-
+import {getOrderStatusText,formatDate,formatTimestamp,getDictTextByCodeAndValue} from "@/utils/utils";
+import {getUserInfo} from '@/utils/auth'
+import config from '@/config'
export default {
components: {
VNavigationBar,
},
data() {
return {
+ imgUrlPrex:config.baseImageUrl,
//是否详情页(0否1是)
isDetail:'1',
// role: 'yewu',
ticketId: '',
+ //工单信息
ticketInfo: {},
- carInfo: {
- licenseNumber: '川A 184AO1',
- carCategory: '一汽奥迪 2024款 A6L',
- cjNo: '124105112425',
- fdjNo: '124109581905',
- njDate: '2024年',
- bxDate: '2024年',
- zcrqDate: '2023-10-20',
- image: ''
- },
- userInfo: {
- name: '2其',
- sex: '1',
- phone: '131111111',
- birthday: '2000-01-01',
- provinceName: '山东省',
- cityName: '泰安市',
- areaName: 'xx区',
- address: 'xxxxxx'
- },
+ carInfo: {},
+ userInfo: {},
+ loginUser:{},
selectedProj: [
{
projName: '清洗内饰',
@@ -305,13 +293,15 @@ export default {
};
},
onLoad(data) {
+ this.loginUser = getUserInfo()
+ console.log(this.loginUser,294)
if (data.id) {
this.ticketId = data.id
}
if (data.isDetail){
this.isDetail = data.isDetail
}
- // this.getOrderDetail()
+ this.getOrderDetail()
},
methods: {
@@ -325,8 +315,36 @@ export default {
params:{id:this.ticketId}
}).then((res)=>{
this.ticketInfo = res.data;
- this.ticketInfo.statusStr = getOrderStatusText()
- console.log(res.data,327)
+ this.ticketInfo.statusStr = getOrderStatusText(res.data.ticketsStatus)
+ //注册日期
+ if (null != this.ticketInfo.carInfo.carRegisterDate){
+ this.ticketInfo.carRegisterDate = formatDate(this.ticketInfo.carInfo.carRegisterDate)
+ }
+ //年检时间
+ if (null != this.ticketInfo.carInfo.inspectionDate){
+ this.ticketInfo.inspectionDate = formatDate(this.ticketInfo.carInfo.inspectionDate)
+ } else {
+ this.ticketInfo.inspectionDate = '未知'
+ }
+ //保险时间
+ if (null != this.ticketInfo.carInfo.insuranceDate) {
+ this.ticketInfo.insuranceDate = formatDate(this.ticketInfo.carInfo.insuranceDate)
+ } else {
+ this.ticketInfo.insuranceDate = '未知'
+ }
+ //生日
+ if (null != this.ticketInfo.customerInfo.birthday) {
+ this.ticketInfo.birthday = formatDate(this.ticketInfo.customerInfo.birthday)
+ } else {
+ this.ticketInfo.birthday = '未知'
+ }
+ //维修记录匹配数据字典
+ if (null != this.ticketInfo.records){
+ this.ticketInfo.records.map((item)=>{
+ item.typeStr = getDictTextByCodeAndValue('repair_records_type',item.type)
+ item.createTime = formatTimestamp(item.createTime)
+ })
+ }
})
},
diff --git a/utils/utils.js b/utils/utils.js
index c7f9afa..955aee2 100644
--- a/utils/utils.js
+++ b/utils/utils.js
@@ -111,10 +111,22 @@ function formatTimestamp(timestamp) {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
+function formatDate(timestamp) {
+ // 将时间戳转换为Date对象
+ const date = new Date(timestamp);
+ // 获取年月日时分秒
+ const year = date.getFullYear();
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
+ const day = date.getDate().toString().padStart(2, '0');
+ // 组合成日期时间字符串
+ return `${year}-${month}-${day}`;
+}
+
export {
getWXStatusHeight,
formatTimestamp,
getOrderStatusText,
getDictByCode,
- getDictTextByCodeAndValue
+ getDictTextByCodeAndValue,
+ formatDate
}