|
|
@@ -61,56 +61,44 @@
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- MIS工单编码选择(当信息录入为1时显示) -->
|
|
|
<view class="info-item" v-if="infoEntry == '1'">
|
|
|
<view class="info-label">
|
|
|
<text class="form-label required">MIS工单编码<text style="color: red;">*</text></text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <input
|
|
|
- class="input-field"
|
|
|
- placeholder="请输入或选择MIS工单编码"
|
|
|
- v-model="misNo"
|
|
|
- @focus="handleMisNoInputFocus"
|
|
|
- @blur="handleMisNoInputBlur"
|
|
|
- @input="handleMisNoInput"
|
|
|
- :disabled="infoEntry == '1'"
|
|
|
- />
|
|
|
- <!-- 选择MIS工单按钮 -->
|
|
|
- <button class="select-mis-btn" @click="openMisListModal">选择MIS工单</button>
|
|
|
- <!-- 快速检索下拉框 -->
|
|
|
- <!-- <view class="quick-select-dropdown" v-show="showMisNoQuickSelect && quickMisNoList.length > 0">
|
|
|
- <view
|
|
|
- v-for="(item, index) in quickMisNoList"
|
|
|
- :key="index"
|
|
|
- class="quick-select-item"
|
|
|
- @click="handleMisNoQuickSelect(item)">
|
|
|
- <text class="mis-no">{{ item['misNo'] }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="quick-select-dropdown no-data" v-show="showMisNoQuickSelect && quickMisNoList.length === 0 && misNo != ''">
|
|
|
- <view>未找到匹配的MIS工单</view>
|
|
|
- </view> -->
|
|
|
+ <view class="input-with-select">
|
|
|
+ <input
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请输入或选择MIS工单编码"
|
|
|
+ v-model="misNo"
|
|
|
+ @focus="handleMisNoInputFocus"
|
|
|
+ @blur="handleMisNoInputBlur"
|
|
|
+ @input="handleMisNoInput"
|
|
|
+ :readonly="infoEntry == '1'"
|
|
|
+ :style="{ paddingRight: '120rpx' }" />
|
|
|
+ <text class="select-mis-btn" @click="openMisListModal">选择</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 工作票编号(当信息录入为2时可编辑) -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
<text class="form-label required">工作票编号<text style="color: red;">*</text></text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <input
|
|
|
- class="input-field"
|
|
|
- placeholder="请输入工作票编号"
|
|
|
+ <input
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请输入工作票编号"
|
|
|
v-model="workPermitNum"
|
|
|
maxlength="20"
|
|
|
:disabled="infoEntry == '1'"
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 开始时间 -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
@@ -119,18 +107,14 @@
|
|
|
<view class="info-value">
|
|
|
<view class="form-picker" @click="showStartTimePicker = true">
|
|
|
<input
|
|
|
- class="input-field"
|
|
|
- placeholder="请选择开始时间"
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请选择开始时间"
|
|
|
v-model="realStartTime"
|
|
|
/>
|
|
|
- <!-- <view class="picker-display">
|
|
|
- <text v-if="realStartTime" class="selected-value">{{ realStartTime }}</text>
|
|
|
- <text v-else>请选择开始时间</text>
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 结束时间 -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
@@ -139,80 +123,79 @@
|
|
|
<view class="info-value">
|
|
|
<view class="form-picker" @click="showEndTimePicker = true">
|
|
|
<input
|
|
|
- class="input-field"
|
|
|
- placeholder="请选择结束时间"
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请选择结束时间"
|
|
|
v-model="realEndTime"
|
|
|
/>
|
|
|
- <!-- <view class="picker-display">
|
|
|
- <text v-if="realEndTime" class="selected-value">{{ realEndTime }}</text>
|
|
|
- <text v-else>请选择结束时间</text>
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 外委人员数 -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
<text class="form-label required">外委人员数(人)</text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <input
|
|
|
+ <input
|
|
|
type="number"
|
|
|
- class="input-field"
|
|
|
- placeholder="请输入外委人员数"
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请输入外委人员数"
|
|
|
v-model="wwryNum"
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 外来人员数 -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
<text class="form-label required">外来人员数(人)</text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <input
|
|
|
+ <input
|
|
|
type="number"
|
|
|
- class="input-field"
|
|
|
- placeholder="请输入外来人员数"
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请输入外来人员数"
|
|
|
v-model="wlryNum"
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 工作负责人 -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
<text class="form-label required">工作负责人</text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <input
|
|
|
- class="input-field"
|
|
|
- placeholder="请输入工作负责人"
|
|
|
+ <input
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请输入工作负责人"
|
|
|
v-model="teamLeaderName"
|
|
|
:disabled="true"
|
|
|
/>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 检修人员选择(当信息录入为2时可编辑) -->
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
<text class="form-label required">检修人员</text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
- <input
|
|
|
- class="input-field"
|
|
|
- placeholder="请选择检修人员"
|
|
|
- v-model="workGroupMemberName"
|
|
|
- @click="showUserSelect = true"
|
|
|
- :disabled="infoEntry == '1'"
|
|
|
- />
|
|
|
- <text class="select-users-count" v-if="selectedUserIds.length > 0">({{ selectedUserIds.length }}人)</text>
|
|
|
+ <view class="input-with-clear">
|
|
|
+ <input
|
|
|
+ class="input-field"
|
|
|
+ placeholder="请选择检修人员"
|
|
|
+ v-model="workGroupMemberName"
|
|
|
+ @click="showUserSelect = true"
|
|
|
+ :disabled="infoEntry == '1'"
|
|
|
+ />
|
|
|
+ <text class="select-users-count" v-if="selectedUserIds.length > 0" :style="{ marginRight: selectedUserIds.length > 0 ? '60rpx' : '0' }">({{ selectedUserIds.length }}人)</text>
|
|
|
+ <text class="select-clear" v-if="selectedUserIds.length > 0" @click="clearSelectedUsers">×</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 维保内容 -->
|
|
|
<view class="info-item full-width">
|
|
|
<view class="info-label">
|
|
|
@@ -230,7 +213,7 @@
|
|
|
></textarea>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 附件上传 -->
|
|
|
<view class="info-item full-width">
|
|
|
<view class="info-label">
|
|
|
@@ -248,7 +231,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
<!-- 时间选择器弹窗 -->
|
|
|
<!-- Start Date Picker -->
|
|
|
<l-popup v-model="showStartTimePicker" position="bottom">
|
|
|
@@ -263,7 +245,7 @@
|
|
|
@cancel="showStartTimePicker = false">
|
|
|
</l-date-time-picker>
|
|
|
</l-popup>
|
|
|
-
|
|
|
+
|
|
|
<!-- End Date Picker -->
|
|
|
<l-popup v-model="showEndTimePicker" position="bottom">
|
|
|
<l-date-time-picker
|
|
|
@@ -277,7 +259,7 @@
|
|
|
@cancel="showEndTimePicker = false">
|
|
|
</l-date-time-picker>
|
|
|
</l-popup>
|
|
|
-
|
|
|
+
|
|
|
<!-- 人员选择弹窗 -->
|
|
|
<view v-if="showUserSelect" class="picker-modal">
|
|
|
<view class="modal-mask" @click="showUserSelect = false"></view>
|
|
|
@@ -294,9 +276,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<scroll-view class="modal-body" scroll-y="true">
|
|
|
- <view
|
|
|
- v-for="(user, index) in userList"
|
|
|
- :key="index"
|
|
|
+ <view
|
|
|
+ v-for="(user, index) in userList"
|
|
|
+ :key="index"
|
|
|
class="picker-option"
|
|
|
@click="toggleUserSelection(user)"
|
|
|
>
|
|
|
@@ -307,7 +289,7 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- MIS工单列表弹窗 -->
|
|
|
<view v-if="showMisListModal" class="picker-modal">
|
|
|
<view class="modal-mask" @click="closeMisListModal"></view>
|
|
|
@@ -324,24 +306,8 @@
|
|
|
<text v-if="misListKeyword.length > 0" class="clear-icon" @click="clearMisListSearch">✕</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 列表内容 -->
|
|
|
- <!-- <scroll-view class="modal-body" scroll-y="true">
|
|
|
- <view v-if="misList.length > 0">
|
|
|
- <view
|
|
|
- v-for="(item, index) in misList"
|
|
|
- :key="index"
|
|
|
- class="picker-option"
|
|
|
- @click="selectMisItem(item)"
|
|
|
- >
|
|
|
- <text class="option-text">{{ ((item['misNo'] as string | null) ?? '-') }}</text>
|
|
|
- <text class="option-text">{{ item['pcsDeviceName'] as string | null ?? '-' }}</text>
|
|
|
- <text class="option-text">{{ item['workPermitNum'] as string | null ?? '-' }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-if="misList.length === 0" class="empty-tip">未找到匹配的MIS工单</view>
|
|
|
- </scroll-view> -->
|
|
|
-
|
|
|
<scroll-view class="modal-body" scroll-y="true">
|
|
|
<!-- 有数据时显示列表 -->
|
|
|
<view v-if="misList.length > 0">
|
|
|
@@ -360,7 +326,7 @@
|
|
|
</view>
|
|
|
<!-- 无数据时显示提示 -->
|
|
|
<view v-else class="empty-tip">
|
|
|
- <text>未找到匹配的人员</text>
|
|
|
+ <text>未找到匹配的MIS工单</text>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
@@ -391,8 +357,7 @@
|
|
|
import type { UploadResponse } from '../../../types/workbench'
|
|
|
import {checkPermi} from '../../../utils/storage'
|
|
|
import { getUserList, getLeaderList } from '../../../api/user/list'
|
|
|
- // import uploadImage from '../../../components/upload-image/upload-image.uvue'
|
|
|
-
|
|
|
+ import uploadImage from '../../../components/upload-image/upload-image.uvue'
|
|
|
|
|
|
// 工单信息
|
|
|
const orderId = ref<string>('')
|
|
|
@@ -431,11 +396,9 @@
|
|
|
const attachmentUrls = ref<string>('') // 附件URLs(逗号分隔的字符串格式)
|
|
|
const uploadedFiles = ref<UploadResponse[]>([]) // 上传的文件对象数组
|
|
|
const workOrderPersonList = ref<UTSJSONObject[]>([]) // 检修人员数组
|
|
|
- const selectedUserIds = ref<string[]>([]) // 选中的用户ID数组
|
|
|
- const selectedUsers = ref<UTSJSONObject[]>([]) // 选中的用户对象数组
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ const selectedUserIds = ref<string[]>([]) // 选中的用户ID数组
|
|
|
+ const selectedUsers = ref<UTSJSONObject[]>([]) // 选中的用户对象数组
|
|
|
+
|
|
|
// 时间选择器相关变量
|
|
|
const showStartTimePicker = ref<boolean>(false)
|
|
|
const showEndTimePicker = ref<boolean>(false)
|
|
|
@@ -443,7 +406,7 @@
|
|
|
const startTimeTime = ref<string>('')
|
|
|
const endTimeDate = ref<string>('')
|
|
|
const endTimeTime = ref<string>('')
|
|
|
-
|
|
|
+
|
|
|
// MIS工单选择相关变量
|
|
|
const showMisNoQuickSelect = ref<boolean>(false)
|
|
|
const quickMisNoList = ref<UTSJSONObject[]>([])
|
|
|
@@ -459,16 +422,16 @@
|
|
|
// 搜索关键词
|
|
|
const misListKeyword = ref<string>('')
|
|
|
const userKeyword = ref<string>('')
|
|
|
-
|
|
|
+
|
|
|
// 人员选择相关变量
|
|
|
const showUserSelect = ref<boolean>(false)
|
|
|
const userList = ref<UTSJSONObject[]>([])
|
|
|
const userAllList = ref<UTSJSONObject[]>([])
|
|
|
-
|
|
|
+
|
|
|
// 信息录入选项
|
|
|
const infoEntryOptions = ref<SysDictData[]>([])
|
|
|
const selectedMisInfoIndex = ref<number>(-1)
|
|
|
-
|
|
|
+
|
|
|
// 获取信息录入字典列表
|
|
|
const loadInfoEntryDictList = async (): Promise<void> => {
|
|
|
try {
|
|
|
@@ -512,7 +475,7 @@
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 获取用户列表
|
|
|
const getUserAllList = async (): Promise<void> => {
|
|
|
try {
|
|
|
@@ -536,13 +499,13 @@
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 验证和提交
|
|
|
const submitLoading = ref<boolean>(false)
|
|
|
-
|
|
|
+
|
|
|
// 信息录入禁用状态
|
|
|
const infoEntryDisabled = ref<boolean>(false)
|
|
|
-
|
|
|
+
|
|
|
// 接受用户名
|
|
|
const acceptUserName = ref<string>('')
|
|
|
|
|
|
@@ -643,7 +606,7 @@
|
|
|
};
|
|
|
|
|
|
const handleMisNoInput = (e: SysDictData): void => {
|
|
|
- misNo.value = (e['detail'] as string | null) ?? '';
|
|
|
+ // misNo.value = (e['detail'] as string | null) ?? '';
|
|
|
// 这里可以添加实时搜索MIS工单的逻辑
|
|
|
};
|
|
|
|
|
|
@@ -656,25 +619,26 @@
|
|
|
misNo.value = (item['misNo'] as string | null) ?? '';
|
|
|
showMisNoQuickSelect.value = false;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 获取MIS工单列表
|
|
|
const getMisList = async (): Promise<void> => {
|
|
|
try {
|
|
|
+ const queryParams = {
|
|
|
+ pauseTime: pauseTime.value,
|
|
|
+ restartTime: restartTime.value,
|
|
|
+ pcsDeviceName: pcsDeviceName.value,
|
|
|
+ pcsStationName: pcsStationName.value,
|
|
|
+ workOrderStatus: '结束'
|
|
|
+ } as UTSJSONObject;
|
|
|
// 调用获取MIS工单列表的API
|
|
|
- const result = await getMisInfoList(
|
|
|
- misListPage.value,
|
|
|
- misListPageSize.value,
|
|
|
- misListKeyword.value,
|
|
|
- '结束'
|
|
|
- // null // 状态筛选,可根据需要添加
|
|
|
- );
|
|
|
+ const result = await listAutoMisInfo(queryParams);
|
|
|
const resultObj = result as UTSJSONObject;
|
|
|
if (resultObj['code'] == 200) {
|
|
|
// 解析列表数据
|
|
|
const rows = resultObj['rows'] as UTSJSONObject[]
|
|
|
misList.value = rows;
|
|
|
allMisList.value = rows
|
|
|
-
|
|
|
+
|
|
|
// 解析总数
|
|
|
misListTotal.value = resultObj['total'] as number;
|
|
|
} else {
|
|
|
@@ -692,14 +656,14 @@
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 打开MIS工单选择弹窗
|
|
|
const openMisListModal = (): void => {
|
|
|
showMisListModal.value = true;
|
|
|
misListPage.value = 1; // 重置为第一页
|
|
|
getMisList(); // 获取列表数据
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 选择MIS工单
|
|
|
const selectMisItem = async (item: UTSJSONObject, index: number): Promise<void> => {
|
|
|
selectedMisInfoIndex.value = index
|
|
|
@@ -726,14 +690,14 @@
|
|
|
workGroupMemberName.value = nickNames;
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
workPermitNum.value = item['workPermitNum'] as string | '';
|
|
|
realStartTime.value = item['realStartTime'] as string | '';
|
|
|
realEndTime.value = item['realEndTime'] as string | '';
|
|
|
// 关闭弹窗
|
|
|
showMisListModal.value = false;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 搜索
|
|
|
const handleSearch = (): void => {
|
|
|
const keyword = userKeyword.value
|
|
|
@@ -742,12 +706,12 @@
|
|
|
return nickName != null && nickName.indexOf(keyword) >= 0
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 关闭MIS工单选择弹窗
|
|
|
const closeMisListModal = (): void => {
|
|
|
showMisListModal.value = false;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 搜索
|
|
|
const searchMisList = (): void => {
|
|
|
const keyword = misListKeyword.value
|
|
|
@@ -755,47 +719,46 @@
|
|
|
const misNo = misInfo['misNo'] as string | null
|
|
|
// return misNo != null && misNo.indexOf(keyword) >= 0
|
|
|
const workPermitNum = misInfo['workPermitNum'] as string | null
|
|
|
-
|
|
|
+
|
|
|
// 逻辑或(||)连接两个条件,满足其一即可
|
|
|
const misNoMatch = misNo != null && misNo.indexOf(keyword) >= 0
|
|
|
const workPermitNumMatch = workPermitNum != null && workPermitNum.indexOf(keyword) >= 0
|
|
|
-
|
|
|
+
|
|
|
return misNoMatch || workPermitNumMatch
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 清除MIS工单搜索
|
|
|
const clearMisListSearch = (): void => {
|
|
|
misListKeyword.value = "";
|
|
|
misList.value = allMisList.value
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 清除用户搜索
|
|
|
const clearSearch = (): void => {
|
|
|
userKeyword.value = "";
|
|
|
userList.value = userAllList.value
|
|
|
};
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
function onStartDateConfirm(value: string) {
|
|
|
// 检查结束时间是否小于新的开始时间
|
|
|
if (realEndTime.value != '' && new Date(value) > new Date(realEndTime.value as string)) {
|
|
|
uni.showToast({ title: '开始时间不能大于结束时间', icon: 'none' })
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
realStartTime.value = value
|
|
|
showStartTimePicker.value = false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function onEndDateConfirm(value: string) {
|
|
|
// 检查新的结束时间是否小于开始时间
|
|
|
if (realStartTime.value != '' && new Date(realStartTime.value as string) > new Date(value)) {
|
|
|
uni.showToast({ title: '结束时间不能小于开始时间', icon: 'none' })
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
realEndTime.value = value
|
|
|
showEndTimePicker.value = false
|
|
|
}
|
|
|
@@ -809,7 +772,7 @@
|
|
|
// 如果没有userId,则比较nickName
|
|
|
const nickName = user['nickName'] as string | null;
|
|
|
if (nickName !== null) {
|
|
|
- return selectedUsers.value.some(selected =>
|
|
|
+ return selectedUsers.value.some(selected =>
|
|
|
(selected['nickName'] as string | null) === nickName
|
|
|
);
|
|
|
}
|
|
|
@@ -820,14 +783,14 @@
|
|
|
const toggleUserSelection = (user: UTSJSONObject): void => {
|
|
|
const userId = user['userId'] as string | number | null;
|
|
|
const nickName = user['nickName'] as string | null;
|
|
|
-
|
|
|
+
|
|
|
if (userId !== null) {
|
|
|
const userIdStr = userId.toString();
|
|
|
const index = selectedUserIds.value.indexOf(userIdStr);
|
|
|
if (index > -1) {
|
|
|
// 取消选择
|
|
|
selectedUserIds.value.splice(index, 1);
|
|
|
- selectedUsers.value = selectedUsers.value.filter(selected =>
|
|
|
+ selectedUsers.value = selectedUsers.value.filter(selected =>
|
|
|
(selected['userId'] as string | number | null)?.toString() !== userIdStr
|
|
|
);
|
|
|
} else {
|
|
|
@@ -837,7 +800,7 @@
|
|
|
}
|
|
|
} else if (nickName !== null) {
|
|
|
// 如果没有userId,通过nickName来识别
|
|
|
- const index = selectedUsers.value.findIndex(selected =>
|
|
|
+ const index = selectedUsers.value.findIndex(selected =>
|
|
|
(selected['nickName'] as string | null) === nickName
|
|
|
);
|
|
|
if (index > -1) {
|
|
|
@@ -869,14 +832,27 @@
|
|
|
.map(user => (user['nickName'] as string | null) ?? '')
|
|
|
.filter(name => name !== '')
|
|
|
.join(',');
|
|
|
-
|
|
|
+
|
|
|
workGroupMemberName.value = nickNames;
|
|
|
-
|
|
|
+
|
|
|
// 更新workOrderPersonList为选中的用户
|
|
|
workOrderPersonList.value = [...selectedUsers.value];
|
|
|
-
|
|
|
+
|
|
|
showUserSelect.value = false;
|
|
|
};
|
|
|
+
|
|
|
+ // 清空已选择的用户
|
|
|
+ const clearSelectedUsers = (): void => {
|
|
|
+ // 清空选中的用户数组
|
|
|
+ selectedUsers.value = [];
|
|
|
+ selectedUserIds.value = [];
|
|
|
+
|
|
|
+ // 清空显示的用户名
|
|
|
+ workGroupMemberName.value = '';
|
|
|
+
|
|
|
+ // 清空检修人员列表
|
|
|
+ workOrderPersonList.value = [];
|
|
|
+ };
|
|
|
|
|
|
|
|
|
// 表单验证
|
|
|
@@ -889,14 +865,6 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if (infoEntry.value == '2' && (workGroupMemberName.value == '' || selectedUsers.value.length == 0)) {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择检修人员',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
if (infoEntry.value == '1' && (misNo.value == '')) {
|
|
|
uni.showToast({
|
|
|
title: '请输入MIS工单编码',
|
|
|
@@ -936,18 +904,18 @@
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- // if (infoEntry.value == '2' && (workGroupMemberName.value == '')) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '请选择检修人员',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- // return false;
|
|
|
- // }
|
|
|
+
|
|
|
+ // if (infoEntry.value == '2' && (workGroupMemberName.value == '' || selectedUsers.value.length == 0)) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '请选择检修人员',
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
|
|
|
return true;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
const isDealing = ref(false)
|
|
|
const hasDealed = ref(false)
|
|
|
// 提交表单
|
|
|
@@ -955,14 +923,14 @@
|
|
|
if (!validateForm()) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
submitLoading.value = true;
|
|
|
try {
|
|
|
if (isDealing.value || hasDealed.value) return // 双重保险
|
|
|
isDealing.value = true
|
|
|
// 确保附件URLs是最新的逗号分隔格式
|
|
|
attachmentUrls.value = uploadedFiles.value.map(file => file.fileName).join(',');
|
|
|
-
|
|
|
+
|
|
|
const finishData = {
|
|
|
id: orderId.value,
|
|
|
orderType: orderType.value,
|
|
|
@@ -983,11 +951,11 @@
|
|
|
finalizeMethod: '2',
|
|
|
workOrderStatus: 'completed'
|
|
|
} as UTSJSONObject;
|
|
|
-
|
|
|
+
|
|
|
const result = await finishOrder(finishData);
|
|
|
const resultObj = result as UTSJSONObject;
|
|
|
const code = resultObj['code'] as number;
|
|
|
-
|
|
|
+
|
|
|
if (code == 200) {
|
|
|
uni.showToast({
|
|
|
title: '结单成功',
|
|
|
@@ -998,7 +966,7 @@
|
|
|
uni.$emit('refreshOrderList', {});
|
|
|
uni.$emit('refreshAssignedCount');
|
|
|
uni.$emit('refreshOverdueCount');
|
|
|
-
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
uni.navigateBack();
|
|
|
}, 800);
|
|
|
@@ -1028,11 +996,7 @@
|
|
|
const loadDetail = async (id: string, orderType?: string): Promise<void> => {
|
|
|
try {
|
|
|
loading.value = true
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
let result: any;
|
|
|
-
|
|
|
// 根据orderType决定调用哪个API
|
|
|
if (orderType == '1') {
|
|
|
// 维修工单
|
|
|
@@ -1087,8 +1051,8 @@
|
|
|
}
|
|
|
pauseTime.value = (data['pauseTime'] as string | null) ?? ''
|
|
|
restartTime.value = (data['restartTime'] as string | null) ?? ''
|
|
|
-
|
|
|
- if(pauseTime.value != '' && restartTime.value != '') {
|
|
|
+
|
|
|
+ if(pauseTime.value != '' && restartTime.value != '') {
|
|
|
const queryParams = {
|
|
|
pauseTime: pauseTime.value,
|
|
|
restartTime: restartTime.value,
|
|
|
@@ -1106,9 +1070,9 @@
|
|
|
// 有工作票号提示
|
|
|
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 ?? '', '')
|
|
|
const responseObj = response as UTSJSONObject
|
|
|
const rows = responseObj['rows'] as UTSJSONObject[] | null
|
|
|
@@ -1121,7 +1085,7 @@
|
|
|
});
|
|
|
return
|
|
|
} else {
|
|
|
-
|
|
|
+
|
|
|
misNo.value = (misInfo[0]['misNo'] as string | null) ?? ''
|
|
|
realStartTime.value = (misInfo[0]['realStartTime'] as string | null) ?? ''
|
|
|
realEndTime.value = (misInfo[0]['realEndTime'] as string | null) ?? ''
|
|
|
@@ -1147,7 +1111,7 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
misNo.value = ''
|
|
|
infoEntry.value = '2'
|
|
|
@@ -1178,8 +1142,7 @@
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
// await dictList()
|
|
|
if (returnTypeOptions.value.length > 0 && workOrderStatus.value == 'to_finish') {
|
|
|
// returnTypeLabel.value = returnTypeOptions.value[0].label
|
|
|
@@ -1319,6 +1282,44 @@
|
|
|
border-radius: 8rpx;
|
|
|
padding: 10rpx;
|
|
|
}
|
|
|
+ .input-with-clear {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .select-clear {
|
|
|
+ position: absolute;
|
|
|
+ right: 20rpx;
|
|
|
+ color: #ccc;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .input-with-select {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .select-mis-btn {
|
|
|
+ line-height: 50rpx;
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ right: 0rpx;
|
|
|
+ padding: 6rpx 12rpx;
|
|
|
+ background-color: #007aff;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 6rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ z-index: 1;
|
|
|
+ max-width: 100rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1472,7 +1473,7 @@
|
|
|
padding: 24rpx 30rpx;
|
|
|
border-bottom: 1rpx solid #f0f0f0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.picker-option.selected {
|
|
|
background-color: #f8f9fa;
|
|
|
}
|
|
|
@@ -1496,7 +1497,7 @@
|
|
|
font-size: 28rpx;
|
|
|
color: #007aff;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.empty-tip {
|
|
|
justify-content: space-between;
|
|
|
padding: 24rpx 30rpx;
|