|
|
@@ -118,7 +118,7 @@
|
|
|
<text class="form-label required">开始时间<text style="color: red;">*</text></text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <view class="form-picker" @click="showStartTimePicker = true">
|
|
|
+ <view class="form-picker" @click="infoEntry == '1' ? showStartTimePicker = false : showStartTimePicker = true">
|
|
|
<input
|
|
|
class="input-field"
|
|
|
placeholder="请选择开始时间"
|
|
|
@@ -136,13 +136,13 @@
|
|
|
<text class="form-label required">结束时间<text style="color: red;">*</text></text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <view class="form-picker" @click="showEndTimePicker = true">
|
|
|
+ <view class="form-picker" @click="infoEntry == '1' ? showEndTimePicker = false : showEndTimePicker = true">
|
|
|
<input
|
|
|
class="input-field"
|
|
|
placeholder="请选择结束时间"
|
|
|
v-model="realEndTime"
|
|
|
type="none"
|
|
|
-
|
|
|
+ style="pointer-events: none;"
|
|
|
/>
|
|
|
<!-- <text class="input-field">
|
|
|
{{ realEndTime != '' ? realEndTime : '请选择结束时间' }}
|
|
|
@@ -150,7 +150,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 挂起结束时间 -->
|
|
|
<view class="info-item" v-if="resumeInfo != null && resumeShow">
|
|
|
<view class="info-label">
|
|
|
@@ -163,7 +163,7 @@
|
|
|
placeholder="请选择挂起结束时间"
|
|
|
v-model="resumeTime"
|
|
|
type="none"
|
|
|
-
|
|
|
+
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -230,6 +230,7 @@
|
|
|
placeholder="请选择工作负责人"
|
|
|
v-model="teamLeaderName"
|
|
|
@click="showLeaderPicker = true"
|
|
|
+ :disabled="infoEntry == '1'"
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -317,7 +318,7 @@
|
|
|
@cancel="showEndTimePicker = false">
|
|
|
</l-date-time-picker>
|
|
|
</l-popup>
|
|
|
-
|
|
|
+
|
|
|
<l-popup v-model="showResumeTimePicker" position="bottom" :safe-area-inset-bottom="true" :z-index="10000">
|
|
|
<l-date-time-picker
|
|
|
title="选择挂起结束时间"
|
|
|
@@ -389,11 +390,11 @@
|
|
|
@click="selectMisItem(item, index)"
|
|
|
>
|
|
|
<!-- <text class="option-text">{{ option.label }}</text> -->
|
|
|
- <view>
|
|
|
+ <view>
|
|
|
<text class="option-text">MIS工单编码</text>
|
|
|
<text class="option-text">工作票编号</text>
|
|
|
</view>
|
|
|
- <view>
|
|
|
+ <view>
|
|
|
<text class="option-text">{{ ((item['misNo'] as string | null) ?? '-')}}</text>
|
|
|
<text class="option-text">{{ item['workPermitNum'] as string | null ?? '-' }}</text>
|
|
|
</view>
|
|
|
@@ -487,7 +488,7 @@
|
|
|
import type { acceptOrderInfo } from '../../../types/order'
|
|
|
import type { WorkOrderFlow } from '../../../types/flow'
|
|
|
import { getOrderInfoById, getRepairOrderInfoById, returnRepairOrder, repairFinishOrder } from '../../../api/order/detail'
|
|
|
- import { getMisInfoList, listWorkPerson, getOrderList, listAutoMisInfo } from '../../../api/order/list'
|
|
|
+ import { getMisInfoList, listWorkPerson, getOrderList, listAutoMisInfo, allListOrder } from '../../../api/order/list'
|
|
|
import type { SysDictData } from '../../../types/dict'
|
|
|
import { getDictDataByType } from '../../../api/dict/index'
|
|
|
import type { UserInfo } from '../../../types/user'
|
|
|
@@ -569,7 +570,6 @@
|
|
|
|
|
|
// 监听开始时间和结束时间变化
|
|
|
watch(realStartTime, (value: string) => {
|
|
|
- console.log('开始时间变化:', value)
|
|
|
// 在这里添加开始时间变化时的处理逻辑
|
|
|
if (resumeInfo.value != null && value != '') {
|
|
|
const suspendTime = (suspendInfo.value?.['actionTime'] as string | null) ?? ''
|
|
|
@@ -602,7 +602,6 @@
|
|
|
})
|
|
|
|
|
|
watch(realEndTime, (value: string) => {
|
|
|
- console.log('结束时间变化:', value)
|
|
|
// 在这里添加结束时间变化时的处理逻辑
|
|
|
if (resumeInfo.value != null && value != '') {
|
|
|
const suspendTime = (suspendInfo.value?.['actionTime'] as string | null) ?? ''
|
|
|
@@ -614,7 +613,7 @@
|
|
|
} else {
|
|
|
resumeShow.value = false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else if(suspendTime != '' && realStartTime.value != '' && new Date(suspendTime).getTime() >= new Date(realStartTime.value).getTime()) { // 作业中挂起
|
|
|
if (realStartTime.value != '' && resumeTime.value != '' && new Date(resumeTime.value).getTime() < new Date(realStartTime.value).getTime()) {
|
|
|
resumeShow.value = true
|
|
|
@@ -819,12 +818,15 @@
|
|
|
workGroupMemberName.value = '';
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 工作票编号变化处理
|
|
|
const handleWorkPermitNumChange = async(): Promise<void> => {
|
|
|
if (infoEntry.value == '2') {
|
|
|
// 查询工作票编号是否已存在
|
|
|
- const response = await getOrderList(1, 10, workPermitNum.value, '')
|
|
|
+ const queryParams = {
|
|
|
+ workPermitNum: workPermitNum.value,
|
|
|
+ } as UTSJSONObject;
|
|
|
+ const response = await allListOrder(queryParams)
|
|
|
const responseObj = response as UTSJSONObject
|
|
|
const rows = responseObj['rows'] as UTSJSONObject[] | null
|
|
|
if (rows != null && rows.length > 0) {
|
|
|
@@ -1024,14 +1026,14 @@
|
|
|
realEndTime.value = value
|
|
|
showEndTimePicker.value = false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function onResumeTimeConfirm(value: string) {
|
|
|
// 检查新的结束时间是否小于开始时间
|
|
|
if (resumeTime.value != '' && new Date(realStartTime.value as string) > new Date(value)) {
|
|
|
uni.showToast({ title: '结束时间不能小于开始时间', icon: 'none' })
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
resumeTime.value = value
|
|
|
showResumeTimePicker.value = false
|
|
|
}
|
|
|
@@ -1297,13 +1299,13 @@
|
|
|
isDealing.value = true
|
|
|
// 确保附件URLs是最新的逗号分隔格式
|
|
|
attachmentUrls.value = uploadedFiles.value.map(file => file.fileName).join(',');
|
|
|
-
|
|
|
+
|
|
|
flowList.value = []
|
|
|
if (resumeTime.value != '' && resumeInfo.value != null && resumeTime.value != (resumeInfo.value['actionTime'] as string | null)) { //存入新的挂起结束时间
|
|
|
resumeInfo.value['actionTime'] = resumeTime.value
|
|
|
flowList.value.push(resumeInfo.value as UTSJSONObject)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const finishData = {
|
|
|
id: orderId.value,
|
|
|
orderType: orderType.value,
|
|
|
@@ -1346,17 +1348,16 @@
|
|
|
setTimeout(() => {
|
|
|
uni.navigateBack();
|
|
|
}, 800);
|
|
|
- } else {
|
|
|
- const msg = resultObj['msg'] as string;
|
|
|
- uni.showToast({
|
|
|
- title: msg.length > 0 ? msg : '结单失败',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (error: any) {
|
|
|
- console.error('结单失败:', error);
|
|
|
- uni.showToast({
|
|
|
- title: '结单失败',
|
|
|
+ } else {
|
|
|
+ const msg = resultObj['msg'] as string;
|
|
|
+ uni.showToast({
|
|
|
+ title: msg.length > 0 ? msg : '结单失败',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error: Error) {
|
|
|
+ uni.showToast({
|
|
|
+ title: error.message,
|
|
|
icon: 'none'
|
|
|
});
|
|
|
} finally {
|
|
|
@@ -1428,7 +1429,7 @@
|
|
|
}
|
|
|
uploadedFiles.value = fileArr
|
|
|
}
|
|
|
- pauseTime.value = (data['pauseTime'] as string | null) ?? ''
|
|
|
+ pauseTime.value = (data['occurTime'] as string | null) ?? ''
|
|
|
restartTime.value = (data['restartTime'] as string | null) ?? ''
|
|
|
|
|
|
if(pauseTime.value != '' && restartTime.value != '') {
|
|
|
@@ -1449,7 +1450,7 @@
|
|
|
// 有工作票号提示
|
|
|
const workPermitNum2 = misInfo[0]['workPermitNum'] as string | null
|
|
|
const misNo2 = misInfo[0]['misNo'] as string | null
|
|
|
-
|
|
|
+
|
|
|
if (workPermitNum2 != null && workPermitNum2.length > 0) {
|
|
|
|
|
|
const response = await getOrderList(1, 10, misNo2 ?? '', '')
|
|
|
@@ -1469,7 +1470,7 @@
|
|
|
realEndTime.value = (misInfo[0]['realEndTime'] as string | null) ?? ''
|
|
|
workPermitNum.value = (misInfo[0]['workPermitNum'] as string | null) ?? ''
|
|
|
// 查询相关工作班成员
|
|
|
- await listWorkPerson(misNo.value).then(response => {
|
|
|
+ listWorkPerson(misNo.value).then(response => {
|
|
|
const responseObj = response as UTSJSONObject
|
|
|
const rows = responseObj['rows'] as UTSJSONObject[] | null
|
|
|
repairOrderPersonList.value = rows ?? []
|
|
|
@@ -1488,6 +1489,30 @@
|
|
|
.map(person => (person.nickName as string | null) ?? '')
|
|
|
.join(',');
|
|
|
workGroupMemberName.value = nickNames;
|
|
|
+
|
|
|
+ repairOrderPersonList.value.map(person => {
|
|
|
+ // 构造查询参数:username 和 nickName
|
|
|
+ const queryParams = {
|
|
|
+ userName: person.userName, // 假设person对象有username字段
|
|
|
+ nickName: person.nickName // 假设person对象有nickName字段
|
|
|
+ };
|
|
|
+ getUserList(queryParams).then(response => {
|
|
|
+ const responseObj = response as UTSJSONObject
|
|
|
+ const rows = responseObj['rows'] as UTSJSONObject[] | null
|
|
|
+ if (rows == null || rows.length == 0) {
|
|
|
+ let msg = "已匹配到MIS工单,但工作班成员'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
|
|
|
+ if (person.isLeader == 1) {
|
|
|
+ msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
|
|
|
+ }
|
|
|
+ uni.showToast({
|
|
|
+ title: msg,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000 // 自定义显示时间,单位ms
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -1522,7 +1547,7 @@
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
flowList.value = data['repairOrderFlowList'] as UTSJSONObject[]
|
|
|
if (suspendReason.value != '' && flowList.value.length > 0) {
|
|
|
// 获取最后一个 actionType 等于 'resume' 的项
|
|
|
@@ -1532,12 +1557,12 @@
|
|
|
// 直接给 resumeTime 赋值,无需 formData
|
|
|
resumeTime.value = (lastResumeItem['actionTime'] as string | null) ?? ''
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const lastSuspendItem = flowList.value.findLast(item => (item['actionType'] as string | null) === 'to_approve') as UTSJSONObject | null
|
|
|
if (lastSuspendItem != null) {
|
|
|
suspendInfo.value = lastSuspendItem
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
const msg = resultObj['msg'] as string | null
|
|
|
@@ -1906,19 +1931,19 @@
|
|
|
.picker-option.selected {
|
|
|
background-color: #f8f9fa;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
.picker-mis-option {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 24rpx 30rpx;
|
|
|
border-bottom: 1rpx solid #f0f0f0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.picker-mis-option:last-child {
|
|
|
border-bottom: none;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.picker-mis-option.selected {
|
|
|
background-color: #f8f9fa;
|
|
|
}
|