瀏覽代碼

待办列表挂起

HD_wangm 4 月之前
父節點
當前提交
dd75f7037a

+ 5 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/OrderScoreInfo.java

@@ -108,6 +108,7 @@ public class OrderScoreInfo {
     private String modifyReason;
 
     /** 重启时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date restartTime;
 
     /** 优先级 */
@@ -148,18 +149,22 @@ public class OrderScoreInfo {
     private String faultDesc;
 
     /** 发生时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date occurTime;
 
     /** 挂起时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date suspendTime;
 
     /** 暂停原因 */
     private String pauseReason;
 
     /** 暂停时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date pauseTime;
 
     /** 完成时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date completeTime;
 
     /** 状态(0-待处理,1-已完成,2-已归档) */

+ 163 - 0
ygtx-ui/src/components/gxtOrder/suspend.vue

@@ -0,0 +1,163 @@
+<template>
+  <el-dialog title="申请挂起工单" v-model="visible" width="800px" append-to-body @close="handleClose">
+    <el-form ref="suspendFormRef" :model="formData" :rules="suspendRules" label-width="120px" label-position="top">
+      <el-alert type="warning" :closable="false" title="请选择挂起原因,提交后需等待班长审批。" show-icon />
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="工单编码">
+            <el-input v-model="formData.workOrderProjectNo" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="风机编号">
+            <el-input v-model="formData.pcsDeviceName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" v-if="formData.faultBarcode">
+          <el-form-item label="维保内容">
+            <el-input v-model="formData.content" type="textarea" :rows="3" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="挂起原因" prop="suspendReason">
+            <el-select v-model="formData.suspendReason" placeholder="请选择挂起原因" style="width: 100%">
+              <el-option
+                v-for="dict in suspendReasonOptions"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="handleCancel">取 消</el-button>
+        <el-button type="primary" @click="handleSubmit" :loading="submitLoading">提交申请</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import { ref, defineProps, defineEmits, getCurrentInstance, watch } from 'vue'
+
+// 获取当前实例
+const { proxy } = getCurrentInstance()
+
+// 定义属性
+const props = defineProps({
+  modelValue: {
+    type: Boolean,
+    default: false
+  },
+  data: {
+    type: Object,
+    default: () => ({})
+  },
+  suspendReasonOptions: {
+    type: Array,
+    default: () => ([])
+  },
+  onSubmit: {
+    type: Function,
+    default: null
+  }
+})
+
+// 定义事件
+const emit = defineEmits(['update:modelValue', 'success'])
+
+// 响应式数据
+const visible = ref(false)
+const formData = ref({})
+const suspendFormRef = ref()
+const submitLoading = ref(false)
+
+// 表单验证规则
+const suspendRules = ref({
+  suspendReason: [
+    { required: true, message: "请选择挂起原因", trigger: "change" }
+  ]
+})
+
+// 监听modelValue变化
+watch(() => props.modelValue, (val) => {
+  visible.value = val
+  if (val) {
+    // 初始化表单数据
+    formData.value = { ...props.data }
+  }
+})
+
+// 监听props.data变化
+watch(() => props.data, (newData) => {
+  if (visible.value) {
+    // 只有在对话框打开时才更新数据
+    formData.value = { ...newData }
+  }
+}, { deep: true })
+
+// 监听visible变化
+watch(visible, (val) => {
+  emit('update:modelValue', val)
+  if (val) {
+    // 打开对话框后重置表单验证错误
+    proxy.$nextTick(() => {
+      if (suspendFormRef.value) {
+        suspendFormRef.value.clearValidate()
+      }
+    })
+  }
+})
+
+// 关闭对话框
+const handleClose = () => {
+  visible.value = false
+}
+
+// 取消操作
+const handleCancel = () => {
+  visible.value = false
+}
+
+// 提交操作
+const handleSubmit = async () => {
+  if (!suspendFormRef.value) return
+
+  await suspendFormRef.value.validate(async (valid) => {
+    if (valid) {
+      try {
+        submitLoading.value = true
+
+        // 调用父组件传入的提交函数
+        if (props.onSubmit && typeof props.onSubmit === 'function') {
+          formData.value.createTime = null
+          formData.value.updateTime = null
+          await props.onSubmit(formData.value)
+        } else {
+          throw new Error("未提供提交方法")
+        }
+
+        proxy.$modal.msgSuccess("挂起申请提交成功")
+        visible.value = false
+        emit('success')
+      } catch (error) {
+        proxy.$modal.msgError("操作失败: " + (error.message || "未知错误"))
+      } finally {
+        submitLoading.value = false
+      }
+    }
+  })
+}
+</script>
+
+<style scoped>
+/* 表单中的列间距调整 */
+:deep(.el-col) {
+  padding-left: 5px;
+  padding-right: 5px;
+}
+</style>

+ 163 - 0
ygtx-ui/src/components/repairOrder/suspend.vue

@@ -0,0 +1,163 @@
+<template>
+  <el-dialog title="申请挂起工单" v-model="visible" width="800px" append-to-body @close="handleClose">
+    <el-form ref="suspendFormRef" :model="formData" :rules="suspendRules" label-width="120px" label-position="top">
+      <el-alert type="warning" :closable="false" title="请选择挂起原因,提交后需等待班长审批。" show-icon />
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="工单编码">
+            <el-input v-model="formData.workOrderProjectNo" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="风机编号">
+            <el-input v-model="formData.pcsDeviceName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" v-if="formData.faultBarcode">
+          <el-form-item label="故障信息">
+            <el-input v-model="formData.faultBarcode" type="textarea" :rows="3" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="挂起原因" prop="suspendReason">
+            <el-select v-model="formData.suspendReason" placeholder="请选择挂起原因" style="width: 100%">
+              <el-option
+                v-for="dict in suspendReasonOptions"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="handleCancel">取 消</el-button>
+        <el-button type="primary" @click="handleSubmit" :loading="submitLoading">提交申请</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import { ref, defineProps, defineEmits, getCurrentInstance, watch } from 'vue'
+
+// 获取当前实例
+const { proxy } = getCurrentInstance()
+
+// 定义属性
+const props = defineProps({
+  modelValue: {
+    type: Boolean,
+    default: false
+  },
+  data: {
+    type: Object,
+    default: () => ({})
+  },
+  suspendReasonOptions: {
+    type: Array,
+    default: () => ([])
+  },
+  onSubmit: {
+    type: Function,
+    default: null
+  }
+})
+
+// 定义事件
+const emit = defineEmits(['update:modelValue', 'success'])
+
+// 响应式数据
+const visible = ref(false)
+const formData = ref({})
+const suspendFormRef = ref()
+const submitLoading = ref(false)
+
+// 表单验证规则
+const suspendRules = ref({
+  suspendReason: [
+    { required: true, message: "请选择挂起原因", trigger: "change" }
+  ]
+})
+
+// 监听modelValue变化
+watch(() => props.modelValue, (val) => {
+  visible.value = val
+  if (val) {
+    // 初始化表单数据
+    formData.value = { ...props.data }
+  }
+})
+
+// 监听props.data变化
+watch(() => props.data, (newData) => {
+  if (visible.value) {
+    // 只有在对话框打开时才更新数据
+    formData.value = { ...newData }
+  }
+}, { deep: true })
+
+// 监听visible变化
+watch(visible, (val) => {
+  emit('update:modelValue', val)
+  if (val) {
+    // 打开对话框后重置表单验证错误
+    proxy.$nextTick(() => {
+      if (suspendFormRef.value) {
+        suspendFormRef.value.clearValidate()
+      }
+    })
+  }
+})
+
+// 关闭对话框
+const handleClose = () => {
+  visible.value = false
+}
+
+// 取消操作
+const handleCancel = () => {
+  visible.value = false
+}
+
+// 提交操作
+const handleSubmit = async () => {
+  if (!suspendFormRef.value) return
+
+  await suspendFormRef.value.validate(async (valid) => {
+    if (valid) {
+      try {
+        submitLoading.value = true
+
+        // 调用父组件传入的提交函数
+        if (props.onSubmit && typeof props.onSubmit === 'function') {
+          formData.value.createTime = null
+          formData.value.updateTime = null
+          await props.onSubmit(formData.value)
+        } else {
+          throw new Error("未提供提交方法")
+        }
+
+        proxy.$modal.msgSuccess("挂起申请提交成功")
+        visible.value = false
+        emit('success')
+      } catch (error) {
+        proxy.$modal.msgError("操作失败: " + (error.message || "未知错误"))
+      } finally {
+        submitLoading.value = false
+      }
+    }
+  })
+}
+</script>
+
+<style scoped>
+/* 表单中的列间距调整 */
+:deep(.el-col) {
+  padding-left: 5px;
+  padding-right: 5px;
+}
+</style>

+ 77 - 71
ygtx-ui/src/views/gxt/gxtOrder/index.vue

@@ -429,60 +429,60 @@
       </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">
-        <el-row style="margin-bottom: 20px;">
-          <el-col :span="24">
-            <el-alert type="warning" :closable="false">
-              <template #default>
-                <i class="fa fa-exclamation-circle mr-2"></i>
-                请选择挂起原因,提交后需等待班长审批。
-              </template>
-            </el-alert>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="工单编码">
-              <el-input v-model="suspendForm.workOrderProjectNo" disabled />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="风机编号">
-              <el-input v-model="suspendForm.pcsDeviceName" disabled />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row v-if="suspendForm.content">
-          <el-col :span="24">
-            <el-form-item label="维保内容" prop="content">
-              <el-input v-model="suspendForm.content" type="textarea" :rows="3" disabled />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="挂起原因" prop="suspendReason">
-              <el-select v-model="suspendForm.suspendReason" placeholder="请选择挂起原因" style="width: 100%">
-                <el-option
-                    v-for="dict in gxt_order_suspend_reason"
-                    :key="dict.value"
-                    :label="dict.label"
-                    :value="dict.value"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button @click="suspendDialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="submitSuspend">提交申请</el-button>
-        </div>
-      </template>
-    </el-dialog>
+<!--    &lt;!&ndash; 挂起对话框 &ndash;&gt;-->
+<!--    <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">-->
+<!--        <el-row style="margin-bottom: 20px;">-->
+<!--          <el-col :span="24">-->
+<!--            <el-alert type="warning" :closable="false">-->
+<!--              <template #default>-->
+<!--                <i class="fa fa-exclamation-circle mr-2"></i>-->
+<!--                请选择挂起原因,提交后需等待班长审批。-->
+<!--              </template>-->
+<!--            </el-alert>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row>-->
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="工单编码">-->
+<!--              <el-input v-model="suspendForm.workOrderProjectNo" disabled />-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="风机编号">-->
+<!--              <el-input v-model="suspendForm.pcsDeviceName" disabled />-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row v-if="suspendForm.content">-->
+<!--          <el-col :span="24">-->
+<!--            <el-form-item label="维保内容" prop="content">-->
+<!--              <el-input v-model="suspendForm.content" type="textarea" :rows="3" disabled />-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row>-->
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="挂起原因" prop="suspendReason">-->
+<!--              <el-select v-model="suspendForm.suspendReason" placeholder="请选择挂起原因" style="width: 100%">-->
+<!--                <el-option-->
+<!--                    v-for="dict in gxt_order_suspend_reason"-->
+<!--                    :key="dict.value"-->
+<!--                    :label="dict.label"-->
+<!--                    :value="dict.value"-->
+<!--                />-->
+<!--              </el-select>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--      </el-form>-->
+<!--      <template #footer>-->
+<!--        <div class="dialog-footer">-->
+<!--          <el-button @click="suspendDialogVisible = false">取 消</el-button>-->
+<!--          <el-button type="primary" @click="submitSuspend">提交申请</el-button>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-dialog>-->
     <!-- 接单对话框 -->
     <el-dialog :title="'接单'" v-model="acceptDialogVisible" width="800px" append-to-body>
 <!--      <div style="max-height: 500px; overflow-y: auto; padding-right: 10px;">-->
@@ -669,6 +669,15 @@
       :on-submit="submitFinishFromParent"
       @success="handleFinishSuccess"
     />
+
+    <!-- 维保挂起对话框 -->
+    <SuspendDialog
+        v-model="suspendDialogVisible"
+        :data="suspendForm"
+        :suspend-reason-options="gxt_order_suspend_reason"
+        :on-submit="submitSuspendFromParent"
+        @success="handleSuspendSuccess"
+    />
     <!-- 复运对话框 -->
     <el-dialog title="复运" v-model="restartDialogVisible" width="800px" append-to-body>
       <div class="space-y-4">
@@ -1160,12 +1169,6 @@
             <div class="info-content">
               <el-form label-width="100px" label-position="top">
                 <el-row :gutter="20">
-<!--                  <el-col :span="24">-->
-<!--                    <el-form-item label="下发人">{{ detailData.assignUserName }}</el-form-item>-->
-<!--                  </el-col>-->
-<!--                  <el-col :span="24">-->
-<!--                    <el-form-item label="下发时间">{{ parseTime(detailData.assignTime) }}</el-form-item>-->
-<!--                  </el-col>-->
                   <el-col :span="24">
                     <el-form-item label="接单人">{{ detailData.acceptUserName || '-'}}</el-form-item>
                   </el-col>
@@ -1196,15 +1199,6 @@
                   <el-col :span="24">
                     <el-form-item label="外来人员数(人)">{{ detailData.wlryNum || '-' }}</el-form-item>
                   </el-col>
-<!--                  <el-col :span="24">-->
-<!--                    <el-form-item label="维保类型">-->
-<!--                      <dict-tag v-if="detailData.inspectionType" :options="gxt_inspection_type" :value="detailData.inspectionType" />-->
-<!--                      <span v-else>-</span>-->
-<!--                    </el-form-item>-->
-<!--                  </el-col>-->
-<!--                  <el-col :span="24">-->
-<!--                    <el-form-item label="实际维保内容">{{ detailData.realContent || '-' }}</el-form-item>-->
-<!--                  </el-col>-->
                   <el-col :span="24">
                     <el-form-item label="恢复运行时间">{{ parseTime(detailData.restartTime,'{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
                   </el-col>
@@ -1416,6 +1410,7 @@ import {listMisInfo, listWorkPerson} from "@/api/gxt/misInfo.js";
 import {ElMessageBox} from "element-plus";
 import EquipmentSelectSingle from "@/components/equipmentSelect/single.vue";
 import useUserStore from '@/store/modules/user'
+import SuspendDialog from "@/components/repairOrder/suspend.vue";
 
 // 工作负责人快速检索相关响应式数据
 const showTeamLeaderQuickSelect = ref(false)
@@ -2350,6 +2345,17 @@ function handleFinishSuccess() {
   getList()
 }
 
+// 用于传递给退回组件的提交方法
+async function submitSuspendFromParent(data) {
+  await suspendWorkOrder(data.id, data)
+}
+
+// 在提交退回成功后的回调函数
+function handleSuspendSuccess() {
+  suspendDialogVisible.value = false
+  getList()
+}
+
 /** 复运 */
 function handleRestart(row) {
   getGxtOrder(row.id).then(response => {
@@ -2438,7 +2444,7 @@ function handleSuspend(row) {
     suspendForm.value.orderId = row.id
     suspendDialogVisible.value = true
     // 打开对话框后重置表单验证错误
-    proxy.resetForm("suspendRef")
+    proxy.resetForm("suspendFormRef")
   })
 }
 
@@ -2516,7 +2522,7 @@ function submitSuspend() {
       }
 
       suspendWorkOrder(suspendForm.value.orderId, gxtWorkOrder).then(response => {
-        proxy.$modal.msgSuccess("挂起申请提交")
+        proxy.$modal.msgSuccess("挂起申请提交成功")
         suspendDialogVisible.value = false
         getList()
       }).catch(error => {

+ 84 - 7
ygtx-ui/src/views/gxt/orderMyTodo/index.vue

@@ -165,7 +165,14 @@
                 v-hasPermi="['gxt:repairOrder:accept']"
             ><i class="fa fa-check"></i>接单</el-button>
             <el-button
-                v-if="scope.row.workOrderStatus === 'to_finish'&& (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin')) && scope.row.orderType == '1'"
+                v-if="(scope.row.workOrderStatus === 'to_finish') && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
+                type="danger"
+                link
+                @click="handleRepairSuspend(scope.row)"
+                v-hasPermi="['gxt:repairOrder:suspend']"
+            ><i class="fa fa-stop"></i>挂起</el-button>
+            <el-button
+                v-if="(scope.row.workOrderStatus === 'to_finish') && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
                 type="warning"
                 link
                 @click="handleReturn(scope.row)"
@@ -179,14 +186,14 @@
                 v-hasPermi="['gxt:repairOrder:acceptReturn']"
             ><i class="fa fa-sign-in"></i>退回</el-button> <!--接单退回,班长退回至下发环节 -->
             <el-button
-                v-if="scope.row.workOrderStatus === 'to_finish' && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin')) && scope.row.orderType == '1'"
+                v-if="scope.row.workOrderStatus === 'to_finish' && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
                 type="success"
                 link
                 @click="handleRepairOrderFinalize(scope.row)"
                 v-hasPermi="['gxt:repairOrder:finalize']"
             ><i class="fa fa-check"></i>结单</el-button>
             <el-button
-                v-if="scope.row.workOrderStatus === 'to_finish' && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin')) && scope.row.orderType == '1'"
+                v-if="scope.row.workOrderStatus === 'to_finish' && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
                 type="primary"
                 link
                 @click="handleReset(scope.row)"
@@ -228,7 +235,15 @@
             ><i class="fa fa-check"></i>接单</el-button>
 
             <el-button
-                v-if="(scope.row.workOrderStatus === 'processing' || scope.row.workOrderStatus === 'to_finish') && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
+                v-if="(scope.row.workOrderStatus === 'to_finish') && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin')) "
+                type="danger"
+                link
+                @click="handleSuspend(scope.row)"
+                v-hasPermi="['gxt:maintenance:order:suspend']"
+            ><i class="fa fa-stop"></i>挂起</el-button>
+
+            <el-button
+                v-if="(scope.row.workOrderStatus === 'to_finish') && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
                 type="success"
                 link
                 @click="handleFinish(scope.row)"
@@ -1625,6 +1640,24 @@
         :on-submit="submitFinishFromParent"
         @success="handleFinishSuccess"
     />
+
+    <!-- 维修挂起对话框 -->
+    <SuspendDialog
+        v-model="suspendRepairDialogVisible"
+        :data="suspendForm"
+        :suspend-reason-options="gxt_order_suspend_reason"
+        :on-submit="submitSuspendFromParent"
+        @success="handleSuspendSuccess"
+    />
+
+    <!-- 维保挂起对话框 -->
+    <SuspendDialog
+        v-model="suspendDialogVisible"
+        :data="suspendForm"
+        :suspend-reason-options="gxt_order_suspend_reason"
+        :on-submit="submitSuspendFromParent"
+        @success="handleSuspendSuccess"
+    />
   </div>
 </template>
 
@@ -1651,19 +1684,21 @@ import preview from '@/components/FileUpload/preview.vue'
 import MisInfoSelectSingle from "@/components/misInfoSelect/single.vue";
 import useUserStore from '@/store/modules/user'
 import {
-  listRepairOrder,updateRepairOrder,finalizeRepairOrder,getRepairOrder,returnRepairOrder
+  listRepairOrder,updateRepairOrder,finalizeRepairOrder,getRepairOrder,returnRepairOrder,suspendRepairOrder
 } from "@/api/gxt/repairOrder";
 import ResetDialog from '@/components/repairOrder/reset.vue'
 import {
   listGxtOrder,
   updateGxtOrder,
   completeWorkOrder,
-  getGxtOrder
+  getGxtOrder,
+  suspendWorkOrder
 } from "@/api/gxt/gxtOrder"
 import EquipmentSelectSingle from "@/components/equipmentSelect/single.vue"
 import FinalizeDialog from "@/components/repairOrder/finalize.vue";
 import ReturnDialog from "@/components/repairOrder/return.vue";
 import FinishDialog from "@/components/gxtOrder/finalize.vue";
+import SuspendDialog from "@/components/repairOrder/suspend.vue";
 
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore();
@@ -1716,6 +1751,11 @@ const assignWorkDialogVisible = ref(false);
 // 退回
 const returnDialogVisible = ref(false)
 
+// 维修挂起
+const suspendRepairDialogVisible = ref(false)
+// 维保挂起
+const suspendDialogVisible = ref(false)
+
 // 维保中心选项
 const maintenanceCenterOptions = ref([]);
 
@@ -1763,6 +1803,9 @@ const assignWorkForm = ref({});
 // 退回表单
 const returnForm = ref({})
 
+// 挂起表单
+const suspendForm = ref({})
+
 // 工作负责人快速检索相关响应式数据
 const showTeamLeaderQuickSelect = ref(false);
 const quickTeamLeaderList = ref([]);
@@ -2042,6 +2085,7 @@ onMounted(() => {
 function getList() {
   loading.value = true;
   listMyTodo(queryParams.value).then(response => {
+    debugger
     orderList.value = response.rows;
     total.value = response.total;
     loading.value = false;
@@ -2959,7 +3003,6 @@ function handleRepairOrderFinalize(row) {
 // 在提交结单成功后的回调函数
 function handleFinalizeSuccess() {
   finalizeDialogVisible.value = false
-  // resetTimeOutOrder()
   getList()
 }
 
@@ -3059,7 +3102,41 @@ function handleFinishSuccess() {
   getList()
 }
 
+/** 挂起维修工单 */
+function handleRepairSuspend(row) {
+  debugger
+  suspendForm.value = row
+  suspendForm.value.suspendReason = undefined
+  suspendRepairDialogVisible.value = true
+}
 
+// 用于传递给退回组件的提交方法
+async function submitSuspendFromParent(data) {
+  if (data.orderType == '1') {
+    await suspendRepairOrder(data)
+  }
+  if (data.orderType == '2') {
+    await suspendWorkOrder(data.id, data)
+  }
+}
+
+// 在提交退回成功后的回调函数
+function handleSuspendSuccess() {
+  suspendRepairDialogVisible.value = false
+  suspendDialogVisible.value = false
+  getList()
+}
+
+/** 维保挂起 */
+function handleSuspend(row) {
+  getGxtOrder(row.id).then(response => {
+    suspendForm.value = response.data
+    suspendForm.value.orderId = row.id
+    suspendDialogVisible.value = true
+    // 打开对话框后重置表单验证错误
+    proxy.resetForm("suspendFormRef")
+  })
+}
 </script>
 
 <style scoped>

+ 83 - 61
ygtx-ui/src/views/gxt/repairOrder/index.vue

@@ -729,67 +729,67 @@
     </el-dialog>
 
     <!-- 挂起对话框 -->
-    <el-dialog title="申请挂起工单" v-model="suspendDialogVisible" width="800px" append-to-body @close="closeSuspendDialog">
-      <el-form ref="suspendFormRef" :model="suspendForm" :rules="suspendRules" label-width="120px" label-position="top">
-        <el-alert type="warning" :closable="false" title="请选择挂起原因,提交后需等待班长审批。" show-icon />
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="工单编码">
-              <el-input v-model="suspendForm.workOrderProjectNo" disabled />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="风机编号">
-              <el-input v-model="suspendForm.pcsDeviceName" disabled />
-            </el-form-item>
-          </el-col>
-          <el-col :span="24" v-if="suspendForm.faultBarcode">
-            <el-form-item label="故障信息">
-              <el-input v-model="suspendForm.faultBarcode" type="textarea" :rows="3" disabled />
-            </el-form-item>
-          </el-col>
-<!--            <el-form-item label="挂起原因" prop="suspendReason">
-              <el-input
-                  v-model="suspendForm.suspendReason"
-                  type="textarea"
-                  placeholder="请输入挂起原因"
-                  maxlength="100"
-                  show-word-limit
-                  :rows="3"
-              />
-            </el-form-item>-->
-          <el-col :span="12">
-            <el-form-item label="挂起原因" prop="suspendReason">
-              <el-select v-model="suspendForm.suspendReason" placeholder="请选择挂起原因" style="width: 100%">
-                <el-option
-                    v-for="dict in gxt_order_suspend_reason"
-                    :key="dict.value"
-                    :label="dict.label"
-                    :value="dict.value"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <!--
-                <el-form-item label="详细说明" prop="suspendDescription">
-                  <el-input
-                    v-model="suspendForm.suspendDescription"
-                    type="textarea"
-                    placeholder="请输入详细说明"
-                    maxlength="100"
-                    show-word-limit
-                    :rows="3"
-                  />
-                </el-form-item>-->
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button @click="closeSuspendDialog">取 消</el-button>
-          <el-button type="primary" @click="submitSuspend">提交申请</el-button>
-        </div>
-      </template>
-    </el-dialog>
+<!--    <el-dialog title="申请挂起工单" v-model="suspendDialogVisible" width="800px" append-to-body @close="closeSuspendDialog">-->
+<!--      <el-form ref="suspendFormRef" :model="suspendForm" :rules="suspendRules" label-width="120px" label-position="top">-->
+<!--        <el-alert type="warning" :closable="false" title="请选择挂起原因,提交后需等待班长审批。" show-icon />-->
+<!--        <el-row>-->
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="工单编码">-->
+<!--              <el-input v-model="suspendForm.workOrderProjectNo" disabled />-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="风机编号">-->
+<!--              <el-input v-model="suspendForm.pcsDeviceName" disabled />-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--          <el-col :span="24" v-if="suspendForm.faultBarcode">-->
+<!--            <el-form-item label="故障信息">-->
+<!--              <el-input v-model="suspendForm.faultBarcode" type="textarea" :rows="3" disabled />-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--&lt;!&ndash;            <el-form-item label="挂起原因" prop="suspendReason">-->
+<!--              <el-input-->
+<!--                  v-model="suspendForm.suspendReason"-->
+<!--                  type="textarea"-->
+<!--                  placeholder="请输入挂起原因"-->
+<!--                  maxlength="100"-->
+<!--                  show-word-limit-->
+<!--                  :rows="3"-->
+<!--              />-->
+<!--            </el-form-item>&ndash;&gt;-->
+<!--          <el-col :span="12">-->
+<!--            <el-form-item label="挂起原因" prop="suspendReason">-->
+<!--              <el-select v-model="suspendForm.suspendReason" placeholder="请选择挂起原因" style="width: 100%">-->
+<!--                <el-option-->
+<!--                    v-for="dict in gxt_order_suspend_reason"-->
+<!--                    :key="dict.value"-->
+<!--                    :label="dict.label"-->
+<!--                    :value="dict.value"-->
+<!--                />-->
+<!--              </el-select>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        &lt;!&ndash;-->
+<!--                <el-form-item label="详细说明" prop="suspendDescription">-->
+<!--                  <el-input-->
+<!--                    v-model="suspendForm.suspendDescription"-->
+<!--                    type="textarea"-->
+<!--                    placeholder="请输入详细说明"-->
+<!--                    maxlength="100"-->
+<!--                    show-word-limit-->
+<!--                    :rows="3"-->
+<!--                  />-->
+<!--                </el-form-item>&ndash;&gt;-->
+<!--      </el-form>-->
+<!--      <template #footer>-->
+<!--        <div class="dialog-footer">-->
+<!--          <el-button @click="closeSuspendDialog">取 消</el-button>-->
+<!--          <el-button type="primary" @click="submitSuspend">提交申请</el-button>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-dialog>-->
 
     <!-- 审批对话框 -->
     <el-dialog title="审批挂起申请" v-model="approveDialogVisible" width="800px" append-to-body @close="closeApproveDialog">
@@ -938,6 +938,15 @@
         @success="handleReturnSuccess"
     />
 
+    <!-- 维修挂起对话框 -->
+    <SuspendDialog
+        v-model="suspendDialogVisible"
+        :data="suspendForm"
+        :suspend-reason-options="gxt_order_suspend_reason"
+        :on-submit="submitSuspendFromParent"
+        @success="handleSuspendSuccess"
+    />
+
     <!-- 评分对话框 -->
     <el-dialog title="工单评分" v-model="ratingDialogVisible" width="800px" append-to-body @close="closeRatingDialog">
       <el-form ref="ratingFormRef" :model="ratingForm" :rules="ratingRules" label-width="120px" label-position="top">
@@ -1632,6 +1641,7 @@ import { decryptParams } from '@/utils/encrypt'
 import ResetDialog from '@/components/repairOrder/reset.vue'
 import FinalizeDialog from '@/components/repairOrder/finalize.vue'
 import ReturnDialog from '@/components/repairOrder/return.vue'
+import SuspendDialog from '@/components/repairOrder/suspend.vue'
 
 const { proxy } = getCurrentInstance()
 const { gxt_maintenance_type, gxt_work_order_status, gxt_order_priority_type,gxt_repair_order_flow_action_type,gxt_order_suspend_reason,gxt_repair_method,gxt_reset_method,gxt_return_type,gxt_info_entry,gxt_work_area } = proxy.useDict("gxt_maintenance_type", "gxt_work_order_status", "gxt_order_priority_type","gxt_repair_order_flow_action_type","gxt_order_suspend_reason","gxt_repair_method","gxt_reset_method","gxt_return_type","gxt_info_entry","gxt_work_area")
@@ -3466,6 +3476,18 @@ function handleReturnSuccess() {
   getList()
 }
 
+// 用于传递给挂起组件的提交方法
+async function submitSuspendFromParent(data) {
+  await suspendRepairOrder(data)
+}
+
+// 在提交挂起成功后的回调函数
+function handleSuspendSuccess() {
+  suspendDialogVisible.value = false
+  resetTimeOutOrder()
+  getList()
+}
+
 /** 检修人员选择变化 */
 function handleMembersChange(formName) {
   // 默认使用 acceptForm,但也支持其他表单