浏览代码

流程联调

lipenghui 4 月之前
父节点
当前提交
ba88088475

+ 3 - 0
src/api/pms/failure/index.ts

@@ -55,4 +55,7 @@ export const IotFailureReportApi = {
   exportIotFailureReport: async (params) => {
     return await request.download({ url: `/rq/iot-failure-report/export-excel`, params })
   },
+  updateIotMaintainProcess: async (id:any, type:any,assigneeUserId:any) => {
+    return await request.put({ url: `/rq/iot-failure-report/process-info?id=`+id+"&type="+type+"&assigneeUserId="+assigneeUserId })
+  },
 }

+ 57 - 57
src/api/pms/maintain/index.ts

@@ -1,57 +1,57 @@
-import request from '@/config/axios'
-
-// 维修工单 VO
-export interface IotMaintainVO {
-  id: number // 主键id
-  failureCode: string // 故障编码
-  failureName: string // 故障名称
-  deviceId: number // 设备id
-  status: string // 状态
-  ifStop: boolean // 是否停机
-  failureTime: Date // 故障时间
-  failureInfluence: string // 故障影响
-  failureSystem: string // 故障系统
-  description: string // 故障描述
-  pic: string // 图片
-  solution: string // 解决办法
-  maintainStartTime: Date // 维修开始时间
-  maintainEndTime: Date // 维修结束时间
-  remark: string // 备注
-  deviceName: string // 设备名称
-  processInstanceId: string // 流程实例id
-  auditStatus: number // 审核状态
-  deptId: number // 部门id
-}
-
-// 维修工单 API
-export const IotMaintainApi = {
-  // 查询维修工单分页
-  getIotMaintainPage: async (params: any) => {
-    return await request.get({ url: `/rq/iot-maintain/page`, params })
-  },
-
-  // 查询维修工单详情
-  getIotMaintain: async (id: number) => {
-    return await request.get({ url: `/rq/iot-maintain/get?id=` + id })
-  },
-
-  // 新增维修工单
-  createIotMaintain: async (data: IotMaintainVO) => {
-    return await request.post({ url: `/rq/iot-maintain/create`, data })
-  },
-
-  // 修改维修工单
-  updateIotMaintain: async (data: IotMaintainVO) => {
-    return await request.put({ url: `/rq/iot-maintain/update`, data })
-  },
-
-  // 删除维修工单
-  deleteIotMaintain: async (id: number) => {
-    return await request.delete({ url: `/rq/iot-maintain/delete?id=` + id })
-  },
-
-  // 导出维修工单 Excel
-  exportIotMaintain: async (params) => {
-    return await request.download({ url: `/rq/iot-maintain/export-excel`, params })
-  },
-}
+import request from '@/config/axios'
+
+// 维修工单 VO
+export interface IotMaintainVO {
+  id: number // 主键id
+  failureCode: string // 故障编码
+  failureName: string // 故障名称
+  deviceId: number // 设备id
+  status: string // 状态
+  ifStop: boolean // 是否停机
+  failureTime: Date // 故障时间
+  failureInfluence: string // 故障影响
+  failureSystem: string // 故障系统
+  description: string // 故障描述
+  pic: string // 图片
+  solution: string // 解决办法
+  maintainStartTime: Date // 维修开始时间
+  maintainEndTime: Date // 维修结束时间
+  remark: string // 备注
+  deviceName: string // 设备名称
+  processInstanceId: string // 流程实例id
+  auditStatus: number // 审核状态
+  deptId: number // 部门id
+}
+
+// 维修工单 API
+export const IotMaintainApi = {
+  // 查询维修工单分页
+  getIotMaintainPage: async (params: any) => {
+    return await request.get({ url: `/rq/iot-maintain/page`, params })
+  },
+
+  // 查询维修工单详情
+  getIotMaintain: async (id: number) => {
+    return await request.get({ url: `/rq/iot-maintain/get?id=` + id })
+  },
+
+  // 新增维修工单
+  createIotMaintain: async (data: IotMaintainVO) => {
+    return await request.post({ url: `/rq/iot-maintain/create`, data })
+  },
+
+  // 修改维修工单
+  updateIotMaintain: async (data: IotMaintainVO) => {
+    return await request.put({ url: `/rq/iot-maintain/update`, data })
+  },
+
+  // 删除维修工单
+  deleteIotMaintain: async (id: number) => {
+    return await request.delete({ url: `/rq/iot-maintain/delete?id=` + id })
+  },
+
+  // 导出维修工单 Excel
+  exportIotMaintain: async (params) => {
+    return await request.download({ url: `/rq/iot-maintain/export-excel`, params })
+  },
+}

+ 9 - 1
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue

@@ -552,6 +552,8 @@ import SignDialog from './SignDialog.vue'
 import ProcessInstanceTimeline from '../detail/ProcessInstanceTimeline.vue'
 import { isEmpty } from '@/utils/is'
 import {DICT_TYPE, getBoolDictOptions, getStrDictOptions} from "@/utils/dict";
+import {IotMaintainApi} from "@/api/pms/maintain";
+import {IotFailureReportApi} from "@/api/pms/failure";
 
 defineOptions({ name: 'ProcessInstanceBtnContainer' })
 
@@ -901,13 +903,19 @@ const handleTransfer = async () => {
 }
 
 const handleTransferType = async () => {
-  debugger
   formLoading.value = true
   try {
     // 1.1 校验表单
     if (!transferFormRef.value) return
     await transferFormRef.value.validate()
     // 1.2 提交转交
+    const dataFailure = {
+      id: props.processInstance.businessKey,
+      type: transferForm.type,
+      assigneeUserId: transferForm.assigneeUserId
+    }
+    debugger
+    await IotFailureReportApi.updateIotMaintainProcess(props.processInstance.businessKey, transferForm.type, transferForm.assigneeUserId);
     const data = {
       id: runningTask.value.id,
       reason: transferForm.reason,

+ 4 - 4
src/views/pms/maintain/IotMaintain.vue

@@ -344,11 +344,11 @@ const submitForm = async () => {
   // 校验表单
   await formRef.value.validate()
   if (list.value.length > 0) {
-    const length = list.value.filter((item) => {
-      item.depleteCount===null||item.depleteCount===undefined
-    }).length
-    if (length > 0) {
+    const nullList = list.value.filter((item) => item.depleteCount===null)
+    debugger
+    if (nullList.length > 0) {
       message.error('请填写消耗数量')
+      return
     }
   }
 

+ 15 - 18
src/views/pms/maintain/IotMaintainDetail.vue

@@ -15,13 +15,12 @@
               <el-select
                 disabled
                 v-model="formData.deviceName"
-                placeholder="请选择设备"
               />
             </el-form-item>
           </el-col>
           <el-col :span="6">
             <el-form-item label="状态" prop="status">
-              <el-select v-model="formData.status" placeholder="请选择状态" clearable disabled>
+              <el-select v-model="formData.status" clearable disabled>
                 <el-option
                   v-for="dict in getStrDictOptions(DICT_TYPE.PMS_MAIN_STATUS)"
                   :key="dict.value"
@@ -33,7 +32,7 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="维修类型" prop="type">
-              <el-select disabled v-model="formData.type" placeholder="请选择维修类型" clearable>
+              <el-select disabled v-model="formData.type" clearable>
                 <el-option
                   v-for="dict in getStrDictOptions(DICT_TYPE.PMS_MAIN_TYPE)"
                   :key="dict.value"
@@ -45,7 +44,7 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="是否停机" prop="ifStop">
-              <el-select v-model="formData.ifStop" placeholder="请选择是否停机" clearable disabled>
+              <el-select v-model="formData.ifStop" clearable disabled>
                 <el-option
                   v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
                   :key="dict.value"
@@ -63,7 +62,6 @@
                 v-model="formData.failureTime"
                 type="date"
                 value-format="x"
-                placeholder="选择故障时间"
               />
             </el-form-item>
           </el-col>
@@ -75,7 +73,6 @@
                 v-model="formData.maintainStartTime"
                 type="date"
                 value-format="x"
-                placeholder="选择维修开始时间"
               />
             </el-form-item>
           </el-col>
@@ -93,12 +90,12 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="故障影响" prop="failureInfluence">
-              <el-input v-model="formData.failureInfluence" placeholder="请输入故障影响" disabled/>
+              <el-input v-model="formData.failureInfluence"  disabled/>
             </el-form-item>
           </el-col>
           <el-col :span="6">
             <el-form-item label="故障系统" prop="failureSystem">
-              <el-input v-model="formData.failureSystem" placeholder="请输入故障系统" disabled/>
+              <el-input v-model="formData.failureSystem"  disabled/>
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -109,13 +106,12 @@
                 v-model="formData.maintainEndTime"
                 type="date"
                 value-format="x"
-                placeholder="选择维修结束时间"
               />
             </el-form-item>
           </el-col>
           <el-col :span="6">
             <el-form-item label="图片" prop="pic" >
-              <UploadImg v-model="formData.pic" height="55px" />
+              <UploadImg v-model="formData.pic" :disabled="true" height="55px" />
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -135,7 +131,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="备注" prop="remark">
-              <el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" disabled/>
+              <el-input v-model="formData.remark" type="textarea"  disabled/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -151,15 +147,15 @@
         <el-table-column label="单位" align="center" prop="unit" />
         <el-table-column label="单价" align="center" prop="price" />
         <el-table-column label="消耗数量" align="center" prop="depleteCount">
-          <template #default="scope">
-            <el-input v-model="scope.row.depleteCount" />
-          </template>
+<!--          <template #default="scope">-->
+<!--            <el-input v-model="scope.row.depleteCount" disabled/>-->
+<!--          </template>-->
         </el-table-column>
         <el-table-column label="总库存数量" align="center" prop="totalCount" />
         <el-table-column label="备注" align="center" prop="remark">
-          <template #default="scope">
-            <el-input v-model="scope.row.remark" />
-          </template>
+<!--          <template #default="scope">-->
+<!--            <el-input v-model="scope.row.remark" />-->
+<!--          </template>-->
         </el-table-column>
         <el-table-column label="物料来源" align="center" prop="sourceType" />
       </el-table>
@@ -249,10 +245,11 @@ const close = () => {
 onMounted(async () => {
   await IotMaintainApi.getIotMaintain(id).then((res) => {
     formData.value = res
+    list.value = res.maintainMaterialDOS
     UserApi.getUser(formData.value.maintainPerson).then((res) => {
-      debugger
       formData.value.maintainPerson = res.nickname;
     })
+    IotMaintainMaterialApi.getMaterialsByDeviceId()
   })
 })
 </script>

+ 1 - 0
src/views/pms/maintain/index.vue

@@ -201,6 +201,7 @@
               </el-button>
               <el-button
                 link
+                v-if="scope.row.status==='tx'"
                 type="danger"
                 @click="handleDelete(scope.row.id)"
               >

+ 0 - 1
src/views/pms/maintain/material/ChooseMaterial.vue

@@ -115,7 +115,6 @@ const getList = async () => {
   loading.value = true
   try {
     queryParams.deptId = props.deptId
-    debugger
     const data =
       await MaintainMaterialApi.IotMaintainMaterialApi.getMaterialsByDeviceId(queryParams)
     list.value = data.list