|
|
@ -139,21 +139,36 @@
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[12].visible"/>
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[12].visible"/>
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 启动工单按钮 -->
|
|
|
|
|
|
|
|
<el-tooltip content="启动工单" placement="top"v-if="!scope.row.wfDefinitionId" >
|
|
|
|
|
|
|
|
<el-button link type="success" icon="View" @click="handleStartWorkflow(scope.row)">
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-tooltip content="修改" placement="top">
|
|
|
|
<!-- <el-tooltip content="修改" placement="top">
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsBillsLubeInstance:edit']"></el-button>
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['dms:dmsBillsLubeInstance:edit']"></el-button>
|
|
|
|
</el-tooltip>
|
|
|
|
</el-tooltip>
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsBillsLubeInstance:remove']"></el-button>
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['dms:dmsBillsLubeInstance:remove']"></el-button>
|
|
|
|
</el-tooltip>-->
|
|
|
|
</el-tooltip>-->
|
|
|
|
<el-tooltip content="详情" placement="top">
|
|
|
|
<!-- <el-tooltip content="详情" placement="top">
|
|
|
|
<el-button link type="primary" icon="View" @click="handleShowDetail(scope.row)" v-hasPermi="['dms:dmsBillsLubeInstance:edit']"></el-button>
|
|
|
|
<el-button link type="primary" icon="View" @click="handleShowDetail(scope.row)" v-hasPermi="['dms:dmsBillsLubeInstance:edit']"></el-button>
|
|
|
|
</el-tooltip>
|
|
|
|
</el-tooltip> -->
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
</el-card>
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 工作流处理组件 -->
|
|
|
|
|
|
|
|
<submitVerify
|
|
|
|
|
|
|
|
ref="submitVerifyRef"
|
|
|
|
|
|
|
|
:task-variables="taskVariables"
|
|
|
|
|
|
|
|
@submit-callback="submitCallback" />
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改润滑工单对话框 -->
|
|
|
|
<!-- 添加或修改润滑工单对话框 -->
|
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
|
<el-form ref="dmsBillsLubeInstanceFormRef" :model="form" :rules="rules" label-width="160px">
|
|
|
|
<el-form ref="dmsBillsLubeInstanceFormRef" :model="form" :rules="rules" label-width="160px">
|
|
|
@ -251,6 +266,8 @@
|
|
|
|
import { listDmsBillsLubeInstance, getDmsBillsLubeInstance, delDmsBillsLubeInstance, addDmsBillsLubeInstance, updateDmsBillsLubeInstance } from '@/api/dms/dmsBillsLubeInstance';
|
|
|
|
import { listDmsBillsLubeInstance, getDmsBillsLubeInstance, delDmsBillsLubeInstance, addDmsBillsLubeInstance, updateDmsBillsLubeInstance } from '@/api/dms/dmsBillsLubeInstance';
|
|
|
|
import { DmsBillsLubeInstanceVO, DmsBillsLubeInstanceQuery, DmsBillsLubeInstanceForm } from '@/api/dms/dmsBillsLubeInstance/types';
|
|
|
|
import { DmsBillsLubeInstanceVO, DmsBillsLubeInstanceQuery, DmsBillsLubeInstanceForm } from '@/api/dms/dmsBillsLubeInstance/types';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
import { startWorkFlow } from '@/api/workflow/task'
|
|
|
|
|
|
|
|
import SubmitVerify from '@/components/Process/submitVerify.vue'
|
|
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
const { active_flag, lube_level, lube_status } = toRefs<any>(proxy?.useDict('active_flag', 'lube_level', 'lube_status'));
|
|
|
|
const { active_flag, lube_level, lube_status } = toRefs<any>(proxy?.useDict('active_flag', 'lube_level', 'lube_status'));
|
|
|
@ -430,11 +447,92 @@ const handleExport = () => {
|
|
|
|
}, `dmsBillsLubeInstance_${new Date().getTime()}.xlsx`)
|
|
|
|
}, `dmsBillsLubeInstance_${new Date().getTime()}.xlsx`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 详情按钮 */
|
|
|
|
const router = useRouter();
|
|
|
|
const router = useRouter();
|
|
|
|
const handleShowDetail = (row: DmsBillsLubeInstanceVO) => {
|
|
|
|
const handleShowDetail = (row: DmsBillsLubeInstanceVO) => {
|
|
|
|
router.push('/dms/dmsBillsLubeInstanceActivity/index/' + row.lubeInstanceId)
|
|
|
|
router.push('/dms/dmsBillsLubeInstanceActivity/index/' + row.lubeInstanceId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 启动工单工作流
|
|
|
|
|
|
|
|
const handleStartWorkflow = async (row: DmsBillsLubeInstanceVO) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const confirmResult = await proxy?.$modal.confirm(
|
|
|
|
|
|
|
|
`确认启动润滑工单"${row.billsLubeCode}"的工作流?`
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (confirmResult) {
|
|
|
|
|
|
|
|
buttonLoading.value = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 启动工作流
|
|
|
|
|
|
|
|
const workflowData = {
|
|
|
|
|
|
|
|
businessId: row.lubeInstanceId,
|
|
|
|
|
|
|
|
flowCode: 'Lube01',
|
|
|
|
|
|
|
|
variables: {
|
|
|
|
|
|
|
|
lubeInstanceId: row.lubeInstanceId,
|
|
|
|
|
|
|
|
billsLubeCode: row.billsLubeCode,
|
|
|
|
|
|
|
|
lubeLevel: row.lubeLevel
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const workflowRes = await startWorkFlow(workflowData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新工单的工作流定义ID
|
|
|
|
|
|
|
|
await updateDmsBillsLubeInstance({
|
|
|
|
|
|
|
|
...row,
|
|
|
|
|
|
|
|
wfDefinitionId: workflowRes.data.taskId,
|
|
|
|
|
|
|
|
status: 'waiting'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 准备第一个节点的任务变量
|
|
|
|
|
|
|
|
taskVariables.value = {
|
|
|
|
|
|
|
|
entity: {
|
|
|
|
|
|
|
|
lubeInstanceId: row.lubeInstanceId,
|
|
|
|
|
|
|
|
lubeLevel: row.lubeLevel,
|
|
|
|
|
|
|
|
lubeGroup: row.lubeGroup,
|
|
|
|
|
|
|
|
lubeSupervisor: row.lubeSupervisor,
|
|
|
|
|
|
|
|
processStepOrder: 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy?.$modal.msgSuccess('工单工作流启动成功');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 立即打开审批组件处理第一个节点(工单创建)
|
|
|
|
|
|
|
|
if (submitVerifyRef.value && workflowRes.data.taskId) {
|
|
|
|
|
|
|
|
submitVerifyRef.value.openDialog(workflowRes.data.taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.error('启动工作流失败:', error);
|
|
|
|
|
|
|
|
proxy?.$modal.msgError('启动工作流失败');
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
buttonLoading.value = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查看工单进度
|
|
|
|
|
|
|
|
const handleWorkflowProgress = (row: DmsBillsLubeInstanceVO) => {
|
|
|
|
|
|
|
|
// 跳转到审批记录查看页面
|
|
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
|
|
path: '/workflow/process/record',
|
|
|
|
|
|
|
|
query: { businessId: row.lubeInstanceId }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
|
|
|
|
|
|
|
const taskVariables = ref<any>({});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 提交回调 - 处理工作流节点完成后的逻辑
|
|
|
|
|
|
|
|
const submitCallback = async () => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// 工作流节点处理完成,刷新列表
|
|
|
|
|
|
|
|
await getList();
|
|
|
|
|
|
|
|
proxy?.$modal.msgSuccess('工单创建节点处理完成,工作流已流转到下一步');
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.error('刷新列表失败:', error);
|
|
|
|
|
|
|
|
proxy?.$modal.msgError('刷新列表失败');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getList();
|
|
|
|
getList();
|
|
|
|
});
|
|
|
|
});
|
|
|
|