|
@@ -22,7 +22,9 @@
|
|
|
class="mb-auto"
|
|
class="mb-auto"
|
|
|
ref="approveFormRef"
|
|
ref="approveFormRef"
|
|
|
:model="approveReasonForm"
|
|
:model="approveReasonForm"
|
|
|
- :rules="processInstance.name==='故障上报流程'?transferFormRuleType:approveReasonRule"
|
|
|
|
|
|
|
+ :rules="
|
|
|
|
|
+ processInstance.name === '故障上报流程' ? transferFormRuleType : approveReasonRule
|
|
|
|
|
+ "
|
|
|
label-width="100px"
|
|
label-width="100px"
|
|
|
>
|
|
>
|
|
|
<el-card v-if="runningTask?.formId > 0" class="mb-15px !-mt-10px">
|
|
<el-card v-if="runningTask?.formId > 0" class="mb-15px !-mt-10px">
|
|
@@ -37,8 +39,13 @@
|
|
|
/>
|
|
/>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
- <el-form-item label="是否转工单" prop="ifTrans">
|
|
|
|
|
- <el-select v-model="approveReasonForm.ifTrans" placeholder="请选择是否转工单" clearable @change="ifShowApproval">
|
|
|
|
|
|
|
+ <el-form-item label="是否转工单" prop="ifTrans" v-if="company!='rh'">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="approveReasonForm.ifTrans"
|
|
|
|
|
+ placeholder="请选择是否转工单"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @change="ifShowApproval"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
|
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
|
|
:key="dict.label"
|
|
:key="dict.label"
|
|
@@ -48,8 +55,33 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</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-form-item label="是否维修" prop="ifTrans" v-if="company=='rh'&&!ifRhGzShow&&processInstance.name==='瑞恒故障上报'">-->
|
|
|
|
|
+<!-- <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
|
|
<el-option
|
|
|
v-for="item in deptUsers"
|
|
v-for="item in deptUsers"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@@ -59,7 +91,11 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item label="维修类型" v-if="processInstance.name==='故障上报流程'&&approveReasonForm.ifTrans" prop="type">
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="维修类型"
|
|
|
|
|
+ v-if="processInstance.name === '故障上报流程' && approveReasonForm.ifTrans"
|
|
|
|
|
+ prop="type"
|
|
|
|
|
+ >
|
|
|
<el-select v-model="approveReasonForm.type">
|
|
<el-select v-model="approveReasonForm.type">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.PMS_MAIN_TYPE)"
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.PMS_MAIN_TYPE)"
|
|
@@ -77,11 +113,16 @@
|
|
|
:rows="4"
|
|
:rows="4"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
|
|
- label="下一个节点的审批人"
|
|
|
|
|
- prop="nextAssignees"
|
|
|
|
|
- v-if="ifShow"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-form-item label="下一个节点的审批人" prop="nextAssignees" v-if="ifShow">
|
|
|
|
|
+ <div class="ml-10px -mt-15px -mb-35px">
|
|
|
|
|
+ <ProcessInstanceTimeline
|
|
|
|
|
+ :activity-nodes="nextAssigneesActivityNode"
|
|
|
|
|
+ :show-status-icon="false"
|
|
|
|
|
+ @select-user-confirm="selectNextAssigneesConfirm"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="维修人员任务接收" prop="nextAssignees" v-if="company=='rh'&&ifRhGzShow&&processInstance.name==='瑞恒故障上报'">
|
|
|
<div class="ml-10px -mt-15px -mb-35px">
|
|
<div class="ml-10px -mt-15px -mb-35px">
|
|
|
<ProcessInstanceTimeline
|
|
<ProcessInstanceTimeline
|
|
|
:activity-nodes="nextAssigneesActivityNode"
|
|
:activity-nodes="nextAssigneesActivityNode"
|
|
@@ -108,7 +149,11 @@
|
|
|
<el-button
|
|
<el-button
|
|
|
:disabled="formLoading"
|
|
:disabled="formLoading"
|
|
|
type="success"
|
|
type="success"
|
|
|
- @click="processInstance.name==='故障上报流程'?handleTransferType(approveFormRef):handleAudit(true, approveFormRef)"
|
|
|
|
|
|
|
+ @click="
|
|
|
|
|
+ processInstance.name === '故障上报流程'||processInstance.name ==='瑞恒故障上报'
|
|
|
|
|
+ ? handleTransferType(approveFormRef)
|
|
|
|
|
+ : handleAudit(true, approveFormRef)
|
|
|
|
|
+ "
|
|
|
>
|
|
>
|
|
|
{{ getButtonDisplayName(OperationButtonType.APPROVE) }}
|
|
{{ getButtonDisplayName(OperationButtonType.APPROVE) }}
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -244,9 +289,14 @@
|
|
|
:rules="transferFormRule"
|
|
:rules="transferFormRule"
|
|
|
label-width="100px"
|
|
label-width="100px"
|
|
|
>
|
|
>
|
|
|
-<!-- <el-form-item label="新审批人" prop="assigneeUserId">-->
|
|
|
|
|
|
|
+ <!-- <el-form-item label="新审批人" prop="assigneeUserId">-->
|
|
|
<el-form-item label="新审批人" prop="assigneeUserId">
|
|
<el-form-item label="新审批人" prop="assigneeUserId">
|
|
|
- <el-select v-model="transferForm.assigneeUserId" filterable clearable style="width: 100%">
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="transferForm.assigneeUserId"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in userOptions"
|
|
v-for="item in userOptions"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@@ -546,25 +596,24 @@
|
|
|
<SignDialog ref="signRef" @success="handleSignFinish" />
|
|
<SignDialog ref="signRef" @success="handleSignFinish" />
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { useUserStoreWithOut } from '@/store/modules/user'
|
|
|
|
|
|
|
+import { useUserStoreWithOut, useUserStore } from '@/store/modules/user'
|
|
|
import { setConfAndFields2 } from '@/utils/formCreate'
|
|
import { setConfAndFields2 } from '@/utils/formCreate'
|
|
|
import * as TaskApi from '@/api/bpm/task'
|
|
import * as TaskApi from '@/api/bpm/task'
|
|
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
|
|
import * as UserApi from '@/api/system/user'
|
|
import * as UserApi from '@/api/system/user'
|
|
|
import {
|
|
import {
|
|
|
|
|
+ CandidateStrategy,
|
|
|
NodeType,
|
|
NodeType,
|
|
|
OPERATION_BUTTON_NAME,
|
|
OPERATION_BUTTON_NAME,
|
|
|
- OperationButtonType,
|
|
|
|
|
- CandidateStrategy
|
|
|
|
|
|
|
+ OperationButtonType
|
|
|
} from '@/components/SimpleProcessDesignerV2/src/consts'
|
|
} from '@/components/SimpleProcessDesignerV2/src/consts'
|
|
|
import { BpmModelFormType, BpmProcessInstanceStatus } from '@/utils/constants'
|
|
import { BpmModelFormType, BpmProcessInstanceStatus } from '@/utils/constants'
|
|
|
import type { FormInstance, FormRules } from 'element-plus'
|
|
import type { FormInstance, FormRules } from 'element-plus'
|
|
|
import SignDialog from './SignDialog.vue'
|
|
import SignDialog from './SignDialog.vue'
|
|
|
import ProcessInstanceTimeline from '../detail/ProcessInstanceTimeline.vue'
|
|
import ProcessInstanceTimeline from '../detail/ProcessInstanceTimeline.vue'
|
|
|
import { isEmpty } from '@/utils/is'
|
|
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";
|
|
|
|
|
|
|
+import { DICT_TYPE, getBoolDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
+import { IotFailureReportApi } from '@/api/pms/failure'
|
|
|
|
|
|
|
|
defineOptions({ name: 'ProcessInstanceBtnContainer' })
|
|
defineOptions({ name: 'ProcessInstanceBtnContainer' })
|
|
|
|
|
|
|
@@ -579,6 +628,7 @@ const props = defineProps<{
|
|
|
processDefinition: any // 流程定义信息
|
|
processDefinition: any // 流程定义信息
|
|
|
userOptions: UserApi.UserVO[]
|
|
userOptions: UserApi.UserVO[]
|
|
|
deptUsers: UserApi.UserVO[]
|
|
deptUsers: UserApi.UserVO[]
|
|
|
|
|
+ company: any
|
|
|
normalForm: any // 流程表单 formCreate
|
|
normalForm: any // 流程表单 formCreate
|
|
|
normalFormApi: any // 流程表单 formCreate Api
|
|
normalFormApi: any // 流程表单 formCreate Api
|
|
|
writableFields: string[] // 流程表单可以编辑的字段
|
|
writableFields: string[] // 流程表单可以编辑的字段
|
|
@@ -614,9 +664,9 @@ const approveReasonForm = reactive({
|
|
|
reason: '',
|
|
reason: '',
|
|
|
signPicUrl: '',
|
|
signPicUrl: '',
|
|
|
nextAssignees: {},
|
|
nextAssignees: {},
|
|
|
- type:undefined,
|
|
|
|
|
|
|
+ type: undefined,
|
|
|
assigneeUserId: undefined,
|
|
assigneeUserId: undefined,
|
|
|
- ifTrans: undefined,
|
|
|
|
|
|
|
+ ifTrans: undefined
|
|
|
})
|
|
})
|
|
|
const approveReasonRule = computed(() => {
|
|
const approveReasonRule = computed(() => {
|
|
|
return {
|
|
return {
|
|
@@ -628,12 +678,22 @@ const approveReasonRule = computed(() => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
const ifShow = ref(false)
|
|
const ifShow = ref(false)
|
|
|
-const ifShowApproval = ()=>{
|
|
|
|
|
|
|
+const ifShowApproval = () => {
|
|
|
|
|
+ // if (props.processInstance.name==='故障上报流程') {
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ // ifShow.value = !approveReasonForm.ifTrans
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ ifShow.value = nextAssigneesActivityNode.value.length > 0 && !approveReasonForm.ifTrans
|
|
|
|
|
+ // }
|
|
|
|
|
+}
|
|
|
|
|
+const ifRhGzShow = ref(false)
|
|
|
|
|
+const ifRhGzShowApproval = async () => {
|
|
|
// if (props.processInstance.name==='故障上报流程') {
|
|
// if (props.processInstance.name==='故障上报流程') {
|
|
|
// debugger
|
|
// debugger
|
|
|
// ifShow.value = !approveReasonForm.ifTrans
|
|
// ifShow.value = !approveReasonForm.ifTrans
|
|
|
// } else {
|
|
// } else {
|
|
|
- ifShow.value = nextAssigneesActivityNode.value.length > 0&&!approveReasonForm.ifTrans
|
|
|
|
|
|
|
+ ifRhGzShow.value = nextAssigneesActivityNode.value.length > 0
|
|
|
|
|
+ debugger
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
// 拒绝表单
|
|
// 拒绝表单
|
|
@@ -662,7 +722,7 @@ const transferFormRef = ref<FormInstance>()
|
|
|
const transferForm = reactive({
|
|
const transferForm = reactive({
|
|
|
assigneeUserId: undefined,
|
|
assigneeUserId: undefined,
|
|
|
reason: '',
|
|
reason: '',
|
|
|
- type:''
|
|
|
|
|
|
|
+ type: ''
|
|
|
})
|
|
})
|
|
|
const transferFormRule = reactive<FormRules<typeof transferForm>>({
|
|
const transferFormRule = reactive<FormRules<typeof transferForm>>({
|
|
|
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
|
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
|
@@ -746,13 +806,15 @@ watch(
|
|
|
/** 弹出气泡卡 */
|
|
/** 弹出气泡卡 */
|
|
|
const openPopover = async (type: string) => {
|
|
const openPopover = async (type: string) => {
|
|
|
if (type === 'approve') {
|
|
if (type === 'approve') {
|
|
|
|
|
+ debugger
|
|
|
// 校验流程表单
|
|
// 校验流程表单
|
|
|
const valid = await validateNormalForm()
|
|
const valid = await validateNormalForm()
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
message.warning('表单校验不通过,请先完善表单!!')
|
|
message.warning('表单校验不通过,请先完善表单!!')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- initNextAssigneesFormField()
|
|
|
|
|
|
|
+ await initNextAssigneesFormField()
|
|
|
|
|
+ await ifRhGzShowApproval();
|
|
|
}
|
|
}
|
|
|
if (type === 'return') {
|
|
if (type === 'return') {
|
|
|
// 获取退回节点
|
|
// 获取退回节点
|
|
@@ -788,6 +850,7 @@ const initNextAssigneesFormField = async () => {
|
|
|
processVariablesStr: JSON.stringify(variables)
|
|
processVariablesStr: JSON.stringify(variables)
|
|
|
})
|
|
})
|
|
|
if (data && data.length > 0) {
|
|
if (data && data.length > 0) {
|
|
|
|
|
+ debugger
|
|
|
data.forEach((node: any) => {
|
|
data.forEach((node: any) => {
|
|
|
if (
|
|
if (
|
|
|
// 情况一:当前节点没有审批人,并且是发起人自选
|
|
// 情况一:当前节点没有审批人,并且是发起人自选
|
|
@@ -837,7 +900,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (pass) {
|
|
if (pass) {
|
|
|
- if (props.processInstance.name==='故障上报流程'&&!approveReasonForm.ifTrans) {
|
|
|
|
|
|
|
+ if (props.processInstance.name === '故障上报流程' && !approveReasonForm.ifTrans) {
|
|
|
const nextAssigneesValid = validateNextAssignees()
|
|
const nextAssigneesValid = validateNextAssignees()
|
|
|
if (!nextAssigneesValid) return
|
|
if (!nextAssigneesValid) return
|
|
|
}
|
|
}
|
|
@@ -938,7 +1001,17 @@ const handleTransferType = async (formRef: FormInstance | undefined) => {
|
|
|
await approveFormRef.value.validate()
|
|
await approveFormRef.value.validate()
|
|
|
// 1.2 提交转交
|
|
// 1.2 提交转交
|
|
|
debugger
|
|
debugger
|
|
|
- await IotFailureReportApi.updateIotMaintainProcess(props.processInstance.id, props.processInstance.businessKey, approveReasonForm.type, approveReasonForm.assigneeUserId,approveReasonForm.ifTrans);
|
|
|
|
|
|
|
+ //如果是瑞恒的故障上报的话,责任人为当前工单领取人
|
|
|
|
|
+ if (props.company==='rh') {
|
|
|
|
|
+ approveReasonForm.assigneeUserId = useUserStore().getUser.id
|
|
|
|
|
+ }
|
|
|
|
|
+ await IotFailureReportApi.updateIotMaintainProcess(
|
|
|
|
|
+ props.processInstance.id,
|
|
|
|
|
+ props.processInstance.businessKey,
|
|
|
|
|
+ approveReasonForm.type,
|
|
|
|
|
+ approveReasonForm.assigneeUserId,
|
|
|
|
|
+ approveReasonForm.ifTrans
|
|
|
|
|
+ )
|
|
|
await handleAudit(true, formRef)
|
|
await handleAudit(true, formRef)
|
|
|
// await TaskApi.transferTask(data)
|
|
// await TaskApi.transferTask(data)
|
|
|
// transferFormRef.value.resetFields()
|
|
// transferFormRef.value.resetFields()
|