|
@@ -11,90 +11,90 @@
|
|
|
<view class="info-column">
|
|
|
<label-text
|
|
|
label="工单类型"
|
|
|
- text="告警"
|
|
|
+ :text="valueToConst(WorkOrderTypes,state.orderInfo.type).label"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="工单号"
|
|
|
:line="2"
|
|
|
- text="GJ20241107000971"
|
|
|
+ :text="state.orderInfo.code"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="紧急程度"
|
|
|
- text="一般"
|
|
|
+ :text="valueToConst(WorkOrderLevel,state.orderInfo.status).label"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="是否逾期"
|
|
|
- text="处理预期"
|
|
|
+ :text="getDeviceStatus(state.orderInfo)"
|
|
|
/>
|
|
|
</view>
|
|
|
- <u--image
|
|
|
- :showLoading="true"
|
|
|
- src="https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png"
|
|
|
- width="160rpx"
|
|
|
- height="150rpx"
|
|
|
- />
|
|
|
+ <images-h :url="state.orderInfo.problemImgSingle"/>
|
|
|
</view>
|
|
|
<view class="line-info-wrap">
|
|
|
<label-text
|
|
|
label="预计处理时间"
|
|
|
- text="2023-01-14 16:34:23"
|
|
|
+ :text="state.orderInfo.estimatedStartTime"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="预计结束时间"
|
|
|
- text="2023-01-14 16:34:23"
|
|
|
+ :text="state.orderInfo.estimatedEndTime"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="问题原因"
|
|
|
- line="3"
|
|
|
+ line="2"
|
|
|
+ :text="formatTxt(state.orderInfo.reason)"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="解决方案"
|
|
|
- line="3"
|
|
|
+ line="2"
|
|
|
+ :text="formatTxt(state.orderInfo.solution)"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="费用/材料"
|
|
|
- line="3"
|
|
|
+ line="1"
|
|
|
+ :text="formatTxt(state.orderInfo.consumables)"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="是否需要补充材料"
|
|
|
- text="否"
|
|
|
+ :text="state.orderInfo.rewrite ? '是': '否'"
|
|
|
/>
|
|
|
<label-text
|
|
|
+ v-if="state.orderInfo.rewrite"
|
|
|
label="补充材料说明"
|
|
|
line="3"
|
|
|
+ :text="formatTxt(state.orderInfo.rewriteDes)"
|
|
|
/>
|
|
|
<label-text
|
|
|
label="描述"
|
|
|
line="3"
|
|
|
- text="这是华设智能机箱,这是华设智能机箱,这是华设智能机箱,这是华设智能机箱,这是华设智能机箱。"
|
|
|
+ :text="formatTxt(state.orderInfo.description)"
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
</panel>
|
|
|
- <panel>
|
|
|
+ <panel v-if="state.orderInfo.problemImg && state.orderInfo.problemImg.length>0">
|
|
|
<template v-slot:header>
|
|
|
<up-icon size="28rpx" :name="list"></up-icon>
|
|
|
问题图片
|
|
|
</template>
|
|
|
<template v-slot:content>
|
|
|
<view>
|
|
|
- <up-album :urls="urls2" :autoWrap="true" :maxCount="8"></up-album>
|
|
|
+ <up-album :urls="state.orderInfo.problemImg" :autoWrap="true" :maxCount="8"></up-album>
|
|
|
</view>
|
|
|
</template>
|
|
|
</panel>
|
|
|
- <panel>
|
|
|
+ <panel v-if="state.orderInfo.solveImg && state.orderInfo.solveImg.length>0">
|
|
|
<template v-slot:header>
|
|
|
<up-icon size="28rpx" :name="list"></up-icon>
|
|
|
处置图
|
|
|
</template>
|
|
|
<template v-slot:content>
|
|
|
<view>
|
|
|
- <up-album :urls="urls2" :autoWrap="true" :maxCount="8"></up-album>
|
|
|
+ <up-album :urls="state.orderInfo.solveImg" :autoWrap="true" :maxCount="8"></up-album>
|
|
|
</view>
|
|
|
</template>
|
|
|
</panel>
|
|
|
- <panel>
|
|
|
+ <panel v-if="state.steps.length>0">
|
|
|
<template v-slot:header>
|
|
|
<up-icon size="28rpx" :name="list"></up-icon>
|
|
|
工单历程
|
|
@@ -102,16 +102,18 @@
|
|
|
<template v-slot:content>
|
|
|
<steps
|
|
|
:orientation="'vertical'"
|
|
|
- :steps="stepList"
|
|
|
- :options="option"
|
|
|
- :active="current"
|
|
|
- @update:active="getActiveIndex">
|
|
|
+ :steps="state.steps"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<template #stepTitle="props">
|
|
|
- <view class="title-info">{{ props.stepInfo.label }}</view>
|
|
|
- <view class="title-date">2024-08-09 12:20:00</view>
|
|
|
+ <view class="title-info">{{ props.stepInfo.username }}</view>
|
|
|
+ <view class="title-date">{{ props.stepInfo.handleTime }}</view>
|
|
|
</template>
|
|
|
- <template #stepItem="stepInfo">
|
|
|
- {{ JSON.stringify(stepInfo) }}
|
|
|
+ <template #stepItem="props">
|
|
|
+ <view class="step-content">
|
|
|
+ 由{{ props.stepInfo.username }} {{ getStepInfo(props.stepInfo).content }}
|
|
|
+
|
|
|
+ </view>
|
|
|
</template>
|
|
|
</steps>
|
|
|
</template>
|
|
@@ -135,40 +137,54 @@ import list from "@/static/aiot/list.svg";
|
|
|
import Panel from "@/components/pannel/index.vue";
|
|
|
import LabelText from "@/components/labeltext/index.vue";
|
|
|
import Steps from "@/components/steps/index.vue";
|
|
|
-import {ref} from 'vue';
|
|
|
-
|
|
|
-const urls2 = ref([
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
- 'https://uview-plus.jiangruyi.com/h5/static/uview/common/logo.png',
|
|
|
-]);
|
|
|
-const current = ref(0)
|
|
|
-const option = ref({
|
|
|
- titleKey: "name",
|
|
|
- content1Key: "details",
|
|
|
- content2Key: "label"
|
|
|
+import {onMounted, reactive, ref} from 'vue';
|
|
|
+import {onLoad} from "@dcloudio/uni-app";
|
|
|
+import {getWorkOrderDetail, getWorkOrderSteps} from "@/api/workorder.js";
|
|
|
+import {valueToConst} from "@/common/consts/CommonConst.js";
|
|
|
+import {WorkOrderLevel, WorkOrderTypes} from "@/common/consts/WorkOrderConst.js";
|
|
|
+import {formatTxt, getImgs, getStepInfo} from "@/util/index.js";
|
|
|
+import ImagesH from "@/components/imagesh/index.vue";
|
|
|
+
|
|
|
+const order = ref('')
|
|
|
+const state = reactive({
|
|
|
+ orderInfo: {
|
|
|
+ problemImg: [],
|
|
|
+ solveImg: []
|
|
|
+ },
|
|
|
+ steps: []
|
|
|
+})
|
|
|
+onLoad((option) => {
|
|
|
+ order.value = option.id
|
|
|
+});
|
|
|
+onMounted(() => {
|
|
|
+ getWorkOrderDetail(order.value).then((data) => {
|
|
|
+ state.orderInfo = data
|
|
|
+ state.orderInfo.statusMsg = getDeviceStatus(data)
|
|
|
+ data.problemImg && (state.orderInfo.problemImg = getImgs(data.problemImg))
|
|
|
+ data.solveImg && (state.orderInfo.solveImg = getImgs(data.solveImg))
|
|
|
+ state.orderInfo.problemImgSingle = state.orderInfo.problemImg.length > 0 && state.orderInfo.problemImg[0]
|
|
|
+ })
|
|
|
+ getWorkOrderSteps(order.value).then((data) => {
|
|
|
+ state.steps = data
|
|
|
+ })
|
|
|
})
|
|
|
-const stepList = ref([{
|
|
|
- name: '进度一',
|
|
|
- details: '描述一',
|
|
|
- label: '测试'
|
|
|
-}, {
|
|
|
- name: '进度二',
|
|
|
- details: '描述二'
|
|
|
-}, {
|
|
|
- name: '进度三',
|
|
|
- details: '描述三'
|
|
|
-}, {
|
|
|
- name: '进度四',
|
|
|
- details: '描述四'
|
|
|
-}])
|
|
|
+const getDeviceStatus = (dataDetail) => {
|
|
|
+ let statusMsg = []
|
|
|
+ if (dataDetail.status === 1 && isLessThanNow(dataDetail.estimatedStartTime)) {
|
|
|
+ statusMsg.push('处理逾期')
|
|
|
+ }
|
|
|
+ if ((dataDetail.status === 1 || dataDetail.status === 2) && isLessThanNow(dataDetail.estimatedEndTime)) {
|
|
|
+ statusMsg.push('结束逾期')
|
|
|
+ }
|
|
|
+ return statusMsg.join('、')
|
|
|
+}
|
|
|
+const isLessThanNow = (date) => {
|
|
|
+ let str1 = new Date(date).getTime();
|
|
|
+ let str2 = new Date().getTime();
|
|
|
+ // 小于0则str1时间小,大于0则str1时间大
|
|
|
+ return str1 - str2 < 0
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
|