|
|
@@ -103,28 +103,37 @@
|
|
|
</el-col> -->
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- type="info"
|
|
|
- icon="Upload"
|
|
|
- @click="handleImport('order')"
|
|
|
- v-hasPermi="['gxt:maintenance:order:import']"
|
|
|
- >工单导入</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- icon="Upload"
|
|
|
- @click="handleImport('person')"
|
|
|
- v-hasPermi="['gxt:maintenance:order:import']"
|
|
|
- >工单人员导入</el-button>
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['gxt:maintenance:order:add']"
|
|
|
+ >新建工单</el-button>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
<!-- <el-button-->
|
|
|
-<!-- type="warning"-->
|
|
|
-<!-- icon="Download"-->
|
|
|
-<!-- @click="handleExport"-->
|
|
|
-<!-- v-hasPermi="['gxt:maintenance:order:export']"-->
|
|
|
-<!-- >导出</el-button>-->
|
|
|
+<!-- type="info"-->
|
|
|
+<!-- icon="Upload"-->
|
|
|
+<!-- @click="handleImport('order')"-->
|
|
|
+<!-- v-hasPermi="['gxt:maintenance:order:import']"-->
|
|
|
+<!-- >工单导入</el-button>-->
|
|
|
<!-- </el-col>-->
|
|
|
+<!-- <el-col :span="1.5">-->
|
|
|
+<!-- <el-button-->
|
|
|
+<!-- type="info"-->
|
|
|
+<!-- icon="Upload"-->
|
|
|
+<!-- @click="handleImport('person')"-->
|
|
|
+<!-- v-hasPermi="['gxt:maintenance:order:import']"-->
|
|
|
+<!-- >工单人员导入</el-button>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="Download"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['gxt:maintenance:order:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
|
|
|
</el-row>
|
|
|
|
|
|
@@ -204,6 +213,13 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" min-width="200" class-name="small-padding fixed-width" fixed="right" >
|
|
|
<template #default="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.workOrderStatus === 'draft'"
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['gxt:maintenance:order:edit']"
|
|
|
+ ><i class="fa fa-edit"></i>编辑</el-button>
|
|
|
<!-- 已派单状态:只显示确认按钮 -->
|
|
|
<el-button link type="success" @click="handleAccept(scope.row)" v-if="scope.row.workOrderStatus === 'assigned'" v-hasPermi="['gxt:maintenance:order:accept']">
|
|
|
<i class="fa fa-check"></i>接单
|
|
|
@@ -225,7 +241,7 @@
|
|
|
|
|
|
<!-- 待结单状态:显示结单按钮 -->
|
|
|
<el-button link type="success" @click="handleFinish(scope.row)" v-if="scope.row.workOrderStatus === 'processing' || scope.row.workOrderStatus === 'to_finish'" v-hasPermi="['gxt:maintenance:order:complete']">
|
|
|
- <i class="fa fa-check"></i>自评
|
|
|
+ <i class="fa fa-check"></i>结单
|
|
|
</el-button>
|
|
|
|
|
|
<!-- 已完成状态:显示评分按钮 -->
|
|
|
@@ -253,6 +269,93 @@
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
+
|
|
|
+ <!-- 新增对话框 -->
|
|
|
+ <el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
|
|
+ <div style="max-height: 500px; overflow-y: auto; padding-right: 10px;">
|
|
|
+ <el-form ref="orderRef" :model="form" :rules="rules" label-width="120px" label-position="top">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工单编码" prop="workOrderProjectNo">
|
|
|
+ <el-input v-model="form.workOrderProjectNo" maxlength="50" show-word-limit v-chinese-limit/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="MIS系统编码" prop="misNo">
|
|
|
+ <el-input v-model="form.misNo">
|
|
|
+ <template #append>
|
|
|
+ <el-button @click="handleSelectMisInfo" icon="Search"></el-button>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- MIS选择组件 -->
|
|
|
+ <MisInfoSelectSingle v-model="misInfoSelectVisible" @onSelected="onMisInfoSelected"></MisInfoSelectSingle>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="风机编号" prop="pcsDeviceName">
|
|
|
+ <el-input v-model="form.pcsDeviceName" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维保中心" prop="gxtCenter">
|
|
|
+ <el-input v-model="form.gxtCenter" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="场站" prop="pcsStationName">
|
|
|
+ <el-input v-model="form.pcsStationName" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="品牌" prop="brand">
|
|
|
+ <el-input v-model="form.brand" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="机型" prop="model">
|
|
|
+ <el-input v-model="form.model" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="维保内容" prop="content">
|
|
|
+ <el-input v-model="form.content" type="textarea" placeholder="请输入维保内容" :rows="3" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+<!-- <el-row :gutter="20">-->
|
|
|
+<!-- <el-col :span="24">-->
|
|
|
+<!-- <el-form-item label="工作负责人" prop="teamLeaderId">-->
|
|
|
+<!-- <el-select v-model="acceptForm.teamLeaderId" placeholder="请选择工作负责人" style="width: 100%" @change="(userId) => acceptForm.teamLeaderName = userList.find(u => u.userId === userId)?.nickName">-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="user in userList"-->
|
|
|
+<!-- :key="user.userId"-->
|
|
|
+<!-- :label="user.nickName"-->
|
|
|
+<!-- :value="user.userId"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-select>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </el-row>-->
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+<!-- <el-button type="primary" @click="submitAccept">确 认</el-button>-->
|
|
|
+ <el-button @click="open = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('draft')">保 存</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('assigned')">保存并下发</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 挂起对话框 -->
|
|
|
<el-dialog title="申请挂起工单" v-model="suspendDialogVisible" width="800px" append-to-body>
|
|
|
<el-form ref="suspendRef" :model="suspendForm" :rules="suspendRules" label-width="120px" label-position="top">
|
|
|
@@ -436,7 +539,7 @@
|
|
|
</div>
|
|
|
<h4 class="text-lg font-medium mb-2">确定要恢复工单吗?</h4>
|
|
|
<p class="text-gray-500 mb-4">工单编号:{{ resumeForm.orderCode }}</p>
|
|
|
- <p class="text-gray-500 text-sm">恢复后,工单状态将变为"待自评"</p>
|
|
|
+ <p class="text-gray-500 text-sm">恢复后,工单状态将变为"待结单"</p>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
@@ -445,12 +548,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <!-- 自评对话框 -->
|
|
|
- <el-dialog title="自评" v-model="finishDialogVisible" width="800px" append-to-body>
|
|
|
+ <!-- 结单对话框 -->
|
|
|
+ <el-dialog title="结单" v-model="finishDialogVisible" width="800px" append-to-body>
|
|
|
<div class="space-y-4">
|
|
|
<el-alert type="info" :closable="false" style="border-color: #14b8a6; background-color: #f0fdfa; color: #0d9488; height: 35px;">
|
|
|
<template #default>
|
|
|
- <i class="fa fa-file-text-o mr-2" style="color: #0d9488;"> 请补充维保详情并上传相关附件完成自评。</i>
|
|
|
+ <i class="fa fa-file-text-o mr-2" style="color: #0d9488;"> 请补充维保详情并上传相关附件完成结单。</i>
|
|
|
</template>
|
|
|
</el-alert>
|
|
|
<el-form ref="finishRef" :model="finishForm" :rules="finishRules" label-width="120px" label-position="top">
|
|
|
@@ -579,7 +682,7 @@
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="finishDialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitFinish">确认自评</el-button>
|
|
|
+ <el-button type="primary" @click="submitFinish">确认结单</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
@@ -1153,7 +1256,7 @@
|
|
|
|
|
|
<!-- 附件信息 -->
|
|
|
<div class="info-section" v-if="detailData.attachmentUrls">
|
|
|
- <h3 class="section-title">自评附件</h3>
|
|
|
+ <h3 class="section-title">结单附件</h3>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="附件">
|
|
|
@@ -1246,7 +1349,9 @@ import {
|
|
|
import { listUser } from "@/api/system/user"
|
|
|
import {getToken} from "@/utils/auth.js";
|
|
|
import {getRepairOrder} from "@/api/gxt/repairOrder.js";
|
|
|
-import {listMaintenanceCenters, listStationsByMaintenanceCenter} from "@/api/gxt/equipment.js";
|
|
|
+import {listEquipment, listMaintenanceCenters, listStationsByMaintenanceCenter} from "@/api/gxt/equipment.js";
|
|
|
+import MisInfoSelectSingle from "@/components/misInfoSelect/single.vue";
|
|
|
+import {genCode} from "@/api/system/autocode/rule.js";
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
const {
|
|
|
@@ -1293,6 +1398,9 @@ const stationOptions = ref([])
|
|
|
// 在 data 部分添加
|
|
|
const fileUploadRef = ref(null)
|
|
|
|
|
|
+const tableHeight = ref(window.innerHeight - 300)
|
|
|
+const misInfoSelectVisible = ref(false)
|
|
|
+
|
|
|
const upload = reactive({
|
|
|
// 是否显示弹出层(设备导入)
|
|
|
open: false,
|
|
|
@@ -1336,7 +1444,9 @@ const data = reactive({
|
|
|
},
|
|
|
rules: {
|
|
|
workOrderProjectNo: [{ required: true, message: "工单编码不能为空", trigger: "blur" }],
|
|
|
- workOrderStatus: [{ required: true, message: "工单状态不能为空", trigger: "change" }],
|
|
|
+ misNo: [{ required: true, message: "MIS编码不能为空", trigger: "blur" }],
|
|
|
+ pcsDeviceName: [{ required: true, message: "风机编号不能为空", trigger: "blur" }],
|
|
|
+ // workOrderStatus: [{ required: true, message: "工单状态不能为空", trigger: "change" }],
|
|
|
gxtCenter: [{ required: true, message: "维保中心不能为空", trigger: "blur" }],
|
|
|
pcsStationName: [{ required: true, message: "风电场不能为空", trigger: "blur" }]
|
|
|
},
|
|
|
@@ -1603,6 +1713,10 @@ function handleSelectionChange(selection) {
|
|
|
/** 新增按钮操作 */
|
|
|
function handleAdd() {
|
|
|
reset()
|
|
|
+ //生成工单编号
|
|
|
+ genCode('WORK_ORDER_CODE').then(response =>{
|
|
|
+ form.value.workOrderProjectNo = response;
|
|
|
+ });
|
|
|
open.value = true
|
|
|
title.value = "添加维保工单"
|
|
|
}
|
|
|
@@ -1619,9 +1733,10 @@ function handleUpdate(row) {
|
|
|
}
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
-function submitForm() {
|
|
|
+function submitForm(status) {
|
|
|
proxy.$refs["orderRef"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ form.value.workOrderStatus = status
|
|
|
if (form.value.id != undefined) {
|
|
|
updateGxtOrder(form.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("修改成功")
|
|
|
@@ -1701,50 +1816,6 @@ function submitFinish() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-/** 上传附件 */
|
|
|
-function uploadAttachmentsFn(files, orderId) {
|
|
|
- const formData = new FormData()
|
|
|
- debugger
|
|
|
- // 处理文件
|
|
|
- let fileCount = 0
|
|
|
- files.forEach((file) => {
|
|
|
- // 需要处理两种情况:有file属性的新文件,或需要上传的文件
|
|
|
- debugger
|
|
|
- // if (file.file) {
|
|
|
- // 新上传的文件
|
|
|
- formData.append('files', file)
|
|
|
- fileCount++
|
|
|
- // } else if (file.rawFile) {
|
|
|
- // // 来自 FileUpload 组件的文件
|
|
|
- // formData.append('files', file.rawFile)
|
|
|
- // fileCount++
|
|
|
- // }
|
|
|
- })
|
|
|
-
|
|
|
- if (fileCount === 0) {
|
|
|
- // 如果没有需要上传的文件,直接保存工单
|
|
|
- saveFinishWorkOrder()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- // 显示加载提示
|
|
|
- proxy.$modal.loading("上传中...")
|
|
|
-
|
|
|
- // 调用上传接口,orderId 作为 URL 参数
|
|
|
- uploadAttachments(orderId, formData).then(response => {
|
|
|
- proxy.$modal.closeLoading()
|
|
|
- if (response.code === 200 || response.code === 0) {
|
|
|
- // 上传成功,保存工单
|
|
|
- saveFinishWorkOrder()
|
|
|
- } else {
|
|
|
- proxy.$modal.msgError('附件上传失败' + (response.msg || '未知错误'))
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- proxy.$modal.closeLoading()
|
|
|
- proxy.$modal.msgError('附件上传失败:' + (error?.message || '未知错误'))
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
/** 保存结单工单 */
|
|
|
function saveFinishWorkOrder() {
|
|
|
finishForm.value.workOrderStatus = 'completed'
|
|
|
@@ -1753,10 +1824,10 @@ function saveFinishWorkOrder() {
|
|
|
finishDialogVisible.value = false
|
|
|
// 清空附件列表
|
|
|
finishForm.value.attachmentUrls = undefined
|
|
|
- proxy.$modal.msgSuccess("自评成功")
|
|
|
+ proxy.$modal.msgSuccess("结单成功")
|
|
|
getList()
|
|
|
}).catch(error => {
|
|
|
- proxy.$modal.msgError("自评失败:" + (error?.response?.data?.msg || "未知错误"))
|
|
|
+ proxy.$modal.msgError("结单失败:" + (error?.response?.data?.msg || "未知错误"))
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -2078,33 +2149,6 @@ function isImageFile(fileName) {
|
|
|
return imageExts.includes(ext)
|
|
|
}
|
|
|
|
|
|
-/** 预览附件 */
|
|
|
-function previewAttachment(attachment) {
|
|
|
- if (isImageFile(attachment.fileName)) {
|
|
|
- // 创建预览窗口
|
|
|
- const previewWindow = window.open()
|
|
|
- previewWindow.document.write(`<img src="${attachment.filePath}" style="width: 100%; height: auto;"/>`)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/** 下载附件 */
|
|
|
-function downloadAttachment(attachment) {
|
|
|
- // 创建临时链接下载
|
|
|
- const link = document.createElement('a')
|
|
|
- link.href = attachment.filePath
|
|
|
- link.download = attachment.fileName
|
|
|
- link.click()
|
|
|
-}
|
|
|
-
|
|
|
-/** 格式化文件大小 */
|
|
|
-function formatFileSize(bytes) {
|
|
|
- if (bytes === 0) return '0 B'
|
|
|
- const k = 1024
|
|
|
- const sizes = ['B', 'KB', 'MB', 'GB']
|
|
|
- const i = Math.floor(Math.log(bytes) / Math.log(k))
|
|
|
- return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i]
|
|
|
-}
|
|
|
-
|
|
|
/**文件上传中处理 */
|
|
|
const handleFileUploadProgress = (event, file, fileList) => {
|
|
|
upload.isUploading = true
|
|
|
@@ -2227,6 +2271,48 @@ function handleResize() {
|
|
|
tableHeight.value = window.innerHeight - 300
|
|
|
}
|
|
|
|
|
|
+/** 打开设备选择对话框 */
|
|
|
+function handleSelectMisInfo() {
|
|
|
+ misInfoSelectVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
+/** 设备选择回调 */
|
|
|
+function onMisInfoSelected(row) {
|
|
|
+ if (row) {
|
|
|
+ // 检查维保中心ID和场站ID是否存在
|
|
|
+ // if (!row.maintenanceCenterId) {
|
|
|
+ // proxy.$modal.msgError("该设备的维保中心没有对应的部门,请完善部门信息后再更新设备数据!");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (!row.stationId) {
|
|
|
+ // proxy.$modal.msgError("该设备的场站没有对应的部门,请完善部门信息后再更新设备数据!");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ form.value.misNo = row.misNo
|
|
|
+ form.value.pcsDeviceName = row.pcsDeviceName
|
|
|
+ form.value.pcsStationName = row.pcsStationName
|
|
|
+ form.value.content = row.content
|
|
|
+ listEquipment({ station: row.pcsStationName, equipmentCode: row.pcsDeviceName }).then(response => {
|
|
|
+ const equipments = response.rows
|
|
|
+ debugger
|
|
|
+ if (equipments) {
|
|
|
+ form.value.pcsDeviceId = equipments[0].equipmentId
|
|
|
+ form.value.gxtCenter = equipments[0].maintenanceCenter
|
|
|
+ form.value.brand = equipments[0].brand
|
|
|
+ form.value.model = equipments[0].model
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ misInfoSelectVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//自动编码生成
|
|
|
+function handleAutoGenChange(){
|
|
|
+ genCode('WORK_ORDER_CODE').then(response =>{
|
|
|
+ this.form.workOrderProjectNo = response;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
getList()
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
@@ -2390,10 +2476,5 @@ getList()
|
|
|
text-overflow: ellipsis;
|
|
|
}
|
|
|
|
|
|
-.attachment-action {
|
|
|
- flex-shrink: 0;
|
|
|
- margin-left: 12px;
|
|
|
- white-space: nowrap;
|
|
|
-}
|
|
|
|
|
|
</style>
|