2 Incheckningar f34c15de8c ... 59602de300

Upphovsman SHA1 Meddelande Datum
  lipenghui 59602de300 Merge remote-tracking branch 'origin/master' 1 vecka sedan
  lipenghui ca99d9945c 维修物料处理,维修流程处理 1 vecka sedan

+ 2 - 2
src/api/pms/failure/index.ts

@@ -59,7 +59,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 })
+  updateIotMaintainProcess: async (processId:any,id:any, type:any,assigneeUserId:any, trans:any) => {
+    return await request.put({ url: `/rq/iot-failure-report/process-info?processId=`+processId+`&id=`+id+`&type=`+type+`&assigneeUserId=`+assigneeUserId+`&trans=`+ trans})
   },
 }

+ 11 - 3
src/components/UserSelectForm/index.vue

@@ -42,6 +42,8 @@
 import { defaultProps, handleTree } from '@/utils/tree'
 import * as DeptApi from '@/api/system/dept'
 import * as UserApi from '@/api/system/user'
+import {companyLevelChildrenDepts} from "@/api/system/dept";
+import {companyDeptsEmployee} from "@/api/system/user";
 
 defineOptions({ name: 'UserSelectForm' })
 const emit = defineEmits<{
@@ -78,12 +80,18 @@ const transferUserList = computed(() => {
 const open = async (id: number, selectedList?: any[]) => {
   activityId.value = id
   resetForm()
-
   // 加载部门、用户列表
-  const deptData = await DeptApi.getSimpleDeptList()
+  // const deptData = await DeptApi.getSimpleDeptList()
+  const deptData = await DeptApi.companyLevelChildrenDepts()
   deptList.value = deptData // 保存扁平结构的部门数据
   deptTree.value = handleTree(deptData) // 转换成树形结构
-  userList.value = await UserApi.getSimpleUserList()
+  // userList.value = await UserApi.getSimpleUserList()
+  const ids = deptData.map(item => item.id)
+  const params = {
+    deptIds: ids
+  };
+  debugger
+  userList.value = await UserApi.companyDeptsEmployee(params)
 
   // 初始状态下,过滤列表等于所有用户列表
   filteredUserList.value = [...userList.value]

+ 2 - 2
src/router/modules/remaining.ts

@@ -969,7 +969,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
     children: [
       {
         path: 'maintain/add/:id?(\\d+)',
-        component: () => import('@/views/pms/maintain/IotMaintain.vue'),
+        component: () => import('@/views/pms/maintain/IotMaintainAddEdit.vue'),
         name: 'MaintainAdd',
         meta: {
           noCache: false,
@@ -982,7 +982,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
       },
       {
         path: 'maintain/edit/:id(\\d+)',
-        component: () => import('@/views/pms/maintain/IotMaintain.vue'),
+        component: () => import('@/views/pms/maintain/IotMaintainAddEdit.vue'),
         name: 'MaintainEdit',
         meta: {
           noCache: true,

+ 32 - 7
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue

@@ -36,7 +36,19 @@
               :rule="approveForm.rule"
             />
           </el-card>
-          <el-form-item label="负责人" prop="assigneeUserId" v-if="processInstance.name==='故障上报流程'||processInstance.name==='委外维修工单流程'">
+
+          <el-form-item label="是否转工单" prop="ifTrans">
+            <el-select v-model="approveReasonForm.ifTrans" placeholder="请选择是否转工单" clearable @change="ifShowApproval">
+              <el-option
+                v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
+                :key="dict.label"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="负责人" prop="assigneeUserId" v-if="processInstance.name==='故障上报流程'&&approveReasonForm.ifTrans">
             <el-select v-model="approveReasonForm.assigneeUserId" filterable clearable style="width: 100%">
               <el-option
                 v-for="item in deptUsers"
@@ -47,7 +59,7 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item label="维修类型" v-if="processInstance.name==='故障上报流程'" prop="type">
+          <el-form-item label="维修类型" v-if="processInstance.name==='故障上报流程'&&approveReasonForm.ifTrans" prop="type">
             <el-select v-model="approveReasonForm.type">
               <el-option
                 v-for="dict in getStrDictOptions(DICT_TYPE.PMS_MAIN_TYPE)"
@@ -68,7 +80,7 @@
           <el-form-item
             label="下一个节点的审批人"
             prop="nextAssignees"
-            v-if="nextAssigneesActivityNode.length > 0"
+            v-if="ifShow"
           >
             <div class="ml-10px -mt-15px -mb-35px">
               <ProcessInstanceTimeline
@@ -604,6 +616,7 @@ const approveReasonForm = reactive({
   nextAssignees: {},
   type:undefined,
   assigneeUserId: undefined,
+  ifTrans: undefined,
 })
 const approveReasonRule = computed(() => {
   return {
@@ -614,7 +627,15 @@ const approveReasonRule = computed(() => {
     nextAssignees: [{ required: true, message: '审批人不能为空', trigger: 'blur' }]
   }
 })
-
+const ifShow = ref(false)
+const ifShowApproval = ()=>{
+  // if (props.processInstance.name==='故障上报流程') {
+  //   debugger
+  //   ifShow.value = !approveReasonForm.ifTrans
+  // } else {
+    ifShow.value = nextAssigneesActivityNode.value.length > 0&&!approveReasonForm.ifTrans
+  // }
+}
 // 拒绝表单
 const rejectFormRef = ref<FormInstance>()
 const rejectReasonForm = reactive({
@@ -648,6 +669,7 @@ const transferFormRule = reactive<FormRules<typeof transferForm>>({
   reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }]
 })
 const transferFormRuleType = reactive<FormRules<typeof transferForm>>({
+  ifTrans: [{ required: true, message: '是否专工单不能为空', trigger: 'change' }],
   type: [{ required: true, message: '维修类型不能为空', trigger: 'change' }],
   reason: [
     { required: reasonRequire.value, message: nodeTypeName + '意见不能为空', trigger: 'blur' }
@@ -815,8 +837,10 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
     }
 
     if (pass) {
-      const nextAssigneesValid = validateNextAssignees()
-      if (!nextAssigneesValid) return
+      if (props.processInstance.name==='故障上报流程'&&!approveReasonForm.ifTrans) {
+        const nextAssigneesValid = validateNextAssignees()
+        if (!nextAssigneesValid) return
+      }
       const variables = getUpdatedProcessInstanceVariables()
       // 审批通过数据
       const data = {
@@ -913,7 +937,8 @@ const handleTransferType = async (formRef: FormInstance | undefined) => {
     if (!approveFormRef.value) return
     await approveFormRef.value.validate()
     // 1.2 提交转交
-    await IotFailureReportApi.updateIotMaintainProcess(props.processInstance.businessKey, approveReasonForm.type, approveReasonForm.assigneeUserId);
+    debugger
+    await IotFailureReportApi.updateIotMaintainProcess(props.processInstance.id, props.processInstance.businessKey, approveReasonForm.type, approveReasonForm.assigneeUserId,approveReasonForm.ifTrans);
     await handleAudit(true, formRef)
     // await TaskApi.transferTask(data)
     // transferFormRef.value.resetFields()