|
|
|
@ -4,30 +4,30 @@
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<div style="display: flex; justify-content: space-between">
|
|
|
|
|
<div>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="submitButtonShow"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
type="info"
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="submitButtonShow"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
type="info"
|
|
|
|
|
@click="submitForm('draft')">
|
|
|
|
|
暂存
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="submitButtonShow"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
type="primary"
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="submitButtonShow"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="submitForm('submit')">
|
|
|
|
|
提交
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="approvalButtonShow"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
type="primary"
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="approvalButtonShow"
|
|
|
|
|
:loading="buttonLoading"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="approvalVerifyOpen">
|
|
|
|
|
{{ currentStepName }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="workOrder?.wfDefinitionId"
|
|
|
|
|
type="primary"
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="workOrder?.wfDefinitionId"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleApprovalRecord">
|
|
|
|
|
流程进度
|
|
|
|
|
</el-button>
|
|
|
|
@ -65,14 +65,14 @@
|
|
|
|
|
<!-- 当前步骤处理区域 -->
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<h4 class="form-header">{{ currentStepTitle }}</h4>
|
|
|
|
|
<el-form
|
|
|
|
|
ref="processFormRef"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:disabled="routeParams.type === 'view'"
|
|
|
|
|
:model="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
<el-form
|
|
|
|
|
ref="processFormRef"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:disabled="routeParams.type === 'view'"
|
|
|
|
|
:model="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
label-width="120px">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="巡检线路" prop="inspectRouteId">
|
|
|
|
@ -85,18 +85,18 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="执行人员" prop="performer">
|
|
|
|
|
<el-input v-model="form.performer" placeholder="请输入执行人员" />
|
|
|
|
|
<el-form-item label="负责人员" prop="performer">
|
|
|
|
|
<el-input v-model="form.performer" placeholder="请输入负责人员" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 处理意见:除第一步外都需要 -->
|
|
|
|
|
<el-col :span="24" v-if="needProcessResolution">
|
|
|
|
|
<el-form-item label="处理意见" prop="processHandleResolution">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form.processHandleResolution"
|
|
|
|
|
type="textarea"
|
|
|
|
|
:rows="3"
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form.processHandleResolution"
|
|
|
|
|
type="textarea"
|
|
|
|
|
:rows="3"
|
|
|
|
|
placeholder="请输入处理意见" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -105,11 +105,11 @@
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<!-- 审批组件 -->
|
|
|
|
|
<submitVerify
|
|
|
|
|
ref="submitVerifyRef"
|
|
|
|
|
:task-variables="taskVariables"
|
|
|
|
|
<submitVerify
|
|
|
|
|
ref="submitVerifyRef"
|
|
|
|
|
:task-variables="taskVariables"
|
|
|
|
|
@submit-callback="submitCallback" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 审批记录组件 -->
|
|
|
|
|
<approvalRecord ref="approvalRecordRef" />
|
|
|
|
|
</div>
|
|
|
|
@ -167,7 +167,7 @@ const form = reactive<Partial<DmsBillsInspectInstanceActivityForm>>({ ...initFor
|
|
|
|
|
const rules = reactive<FormRules>({
|
|
|
|
|
inspectRouteId: [{ required: true, message: "巡检线路不能为空", trigger: "blur" }],
|
|
|
|
|
deviceAmount: [{ required: true, message: "设备总数不能为空", trigger: "blur" }],
|
|
|
|
|
performer: [{ required: true, message: "执行人员不能为空", trigger: "blur" }],
|
|
|
|
|
performer: [{ required: true, message: "负责人员不能为空", trigger: "blur" }],
|
|
|
|
|
processHandleResolution: [{ required: false, message: "处理意见不能为空", trigger: "blur" }]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -204,19 +204,19 @@ const submitButtonShow = computed(() => {
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
routeParams.value = route.query;
|
|
|
|
|
loading.value = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// 获取工单信息
|
|
|
|
|
await loadWorkOrderInfo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取当前任务信息
|
|
|
|
|
if (routeParams.value.type === 'approval') {
|
|
|
|
|
await loadCurrentTask();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化表单数据
|
|
|
|
|
initializeFormData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('初始化失败:', error);
|
|
|
|
|
proxy?.$modal.msgError('加载数据失败');
|
|
|
|
@ -232,10 +232,10 @@ const loadWorkOrderInfo = async () => {
|
|
|
|
|
proxy?.$modal.msgError('缺少工单ID参数');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const res = await getDmsBillsInspectInstance(businessId);
|
|
|
|
|
workOrder.value = res.data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置状态显示文本
|
|
|
|
|
if (inspect_status.value && workOrder.value.inspectStatus !== undefined) {
|
|
|
|
|
const statusItem = inspect_status.value.find((item: any) => String(item.value) === String(workOrder.value.inspectStatus));
|
|
|
|
@ -250,21 +250,21 @@ const loadCurrentTask = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const businessId = routeParams.value.id;
|
|
|
|
|
const taskId = routeParams.value.taskId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通过taskId或businessId获取当前任务
|
|
|
|
|
const taskRes = await pageByTaskWait({
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
flowCode: 'Inspect01' // 巡检流程代码
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const tasks = taskRes.rows.filter(task =>
|
|
|
|
|
|
|
|
|
|
const tasks = taskRes.rows.filter(task =>
|
|
|
|
|
task.businessId === businessId || task.id === taskId
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tasks.length > 0) {
|
|
|
|
|
currentTask.value = tasks[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 动态设置处理意见校验规则
|
|
|
|
|
if (needProcessResolution.value) {
|
|
|
|
|
rules.processHandleResolution = [
|
|
|
|
@ -289,7 +289,7 @@ const initializeFormData = () => {
|
|
|
|
|
// 新增:提交表单方法
|
|
|
|
|
const submitForm = async (status: string) => {
|
|
|
|
|
if (!processFormRef.value) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const valid = await processFormRef.value.validate();
|
|
|
|
|
if (valid) {
|
|
|
|
@ -305,7 +305,7 @@ const submitForm = async (status: string) => {
|
|
|
|
|
processHandleResolution: form.processHandleResolution || '',
|
|
|
|
|
handleTime: getCurrentDateTime()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy?.$modal.msgSuccess('暂存成功');
|
|
|
|
|
goBack();
|
|
|
|
|
} else {
|
|
|
|
@ -320,7 +320,7 @@ const submitForm = async (status: string) => {
|
|
|
|
|
processHandleResolution: form.processHandleResolution || ''
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 启动工作流或继续处理
|
|
|
|
|
if (routeParams.value.taskId) {
|
|
|
|
|
submitVerifyRef.value?.openDialog(routeParams.value.taskId);
|
|
|
|
@ -342,7 +342,7 @@ const submitForm = async (status: string) => {
|
|
|
|
|
// 审批处理
|
|
|
|
|
const approvalVerifyOpen = async () => {
|
|
|
|
|
if (!processFormRef.value) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const valid = await processFormRef.value.validate();
|
|
|
|
|
if (valid) {
|
|
|
|
@ -356,7 +356,7 @@ const approvalVerifyOpen = async () => {
|
|
|
|
|
processHandleResolution: form.processHandleResolution || ''
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 直接使用传入的taskId进行审批
|
|
|
|
|
submitVerifyRef.value?.openDialog(routeParams.value.taskId);
|
|
|
|
|
}
|
|
|
|
@ -382,9 +382,9 @@ const submitCallback = async () => {
|
|
|
|
|
processHandleResolution: form.processHandleResolution || '',
|
|
|
|
|
handleTime: getCurrentDateTime()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy?.$modal.msgSuccess(`${currentStepName.value}完成`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭页面返回
|
|
|
|
|
goBack();
|
|
|
|
|
} catch (error) {
|
|
|
|
|