兰宝车间质量管理系统-前端
gssong
2024-03-21 f50ed6b2c54615fa3e540bc6788a08239084d8e2
src/views/workflow/processInstance/index.vue
@@ -56,12 +56,11 @@
            </el-row>
          </template>
          <el-table v-loading="loading" :data="processInstanceList" @selection-change="handleSelectionChange">
          <el-table v-loading="loading" border :data="processInstanceList" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column fixed align="center" type="index" label="序号" width="50"></el-table-column>
            <el-table-column v-if="false" fixed align="center" prop="id" label="id"></el-table-column>
            <el-table-column fixed align="center" prop="processDefinitionName" label="流程定义名称"></el-table-column>
            <el-table-column fixed align="center" prop="processDefinitionKey" label="流程定义KEY"></el-table-column>
            <el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
            <el-table-column align="center" prop="processDefinitionName" label="流程定义名称"></el-table-column>
            <el-table-column align="center" prop="processDefinitionKey" label="流程定义KEY"></el-table-column>
            <el-table-column align="center" prop="processDefinitionVersion" label="版本号" width="90">
              <template #default="scope"> v{{ scope.row.processDefinitionVersion }}.0</template>
            </el-table-column>
@@ -127,7 +126,7 @@
    </el-row>
    <el-dialog v-if="processDefinitionDialog.visible" v-model="processDefinitionDialog.visible" :title="processDefinitionDialog.title" width="70%">
      <el-table v-loading="loading" :data="processDefinitionHistoryList">
        <el-table-column fixed align="center" type="index" label="序号" width="50"></el-table-column>
        <el-table-column fixed align="center" type="index" label="序号" width="60"></el-table-column>
        <el-table-column fixed align="center" prop="name" label="流程定义名称"></el-table-column>
        <el-table-column align="center" prop="key" label="标识Key"></el-table-column>
        <el-table-column align="center" prop="version" label="版本号" width="90">
@@ -154,13 +153,13 @@
<script lang="ts" setup>
import {
  getProcessInstanceRunningByPage,
  getProcessInstanceFinishByPage,
  deleteRuntimeProcessAndHisInst,
  deleteFinishProcessAndHisInst,
  deleteRuntimeProcessInst
  getPageByRunning,
  getPageByFinish,
  deleteRunAndHisInstance,
  deleteFinishAndHisInstance,
  deleteRunInstance
} from '@/api/workflow/processInstance';
import { getProcessDefinitionListByKey, migrationProcessDefinition } from '@/api/workflow/processDefinition';
import { getListByKey, migrationDefinition } from '@/api/workflow/processDefinition';
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
import { listCategory } from '@/api/workflow/category';
import { CategoryVO } from '@/api/workflow/category/types';
@@ -282,7 +281,7 @@
//分页
const getProcessInstanceRunningList = () => {
  loading.value = true;
  getProcessInstanceRunningByPage(queryParams.value).then((resp) => {
  getPageByRunning(queryParams.value).then((resp) => {
    processInstanceList.value = resp.rows;
    total.value = resp.total;
    loading.value = false;
@@ -291,7 +290,7 @@
//分页
const getProcessInstanceFinishList = () => {
  loading.value = true;
  getProcessInstanceFinishByPage(queryParams.value).then((resp) => {
  getPageByFinish(queryParams.value).then((resp) => {
    processInstanceList.value = resp.rows;
    total.value = resp.total;
    loading.value = false;
@@ -304,10 +303,10 @@
  await proxy?.$modal.confirm('是否确认删除id为【' + id + '】的数据项?');
  loading.value = true;
  if ('running' === tab.value) {
    await deleteRuntimeProcessAndHisInst(id).finally(() => (loading.value = false));
    await deleteRunAndHisInstance(id).finally(() => (loading.value = false));
    getProcessInstanceRunningList();
  } else {
    await deleteFinishProcessAndHisInst(id).finally(() => (loading.value = false));
    await deleteFinishAndHisInstance(id).finally(() => (loading.value = false));
    getProcessInstanceFinishList();
  }
  proxy?.$modal.msgSuccess('删除成功');
@@ -329,7 +328,7 @@
      processInstanceId: row.id,
      deleteReason: deleteReason.value
    };
    await deleteRuntimeProcessInst(param).finally(() => (loading.value = false));
    await deleteRunInstance(param).finally(() => (loading.value = false));
    getProcessInstanceRunningList();
    proxy?.$modal.msgSuccess('操作成功');
  }
@@ -342,7 +341,7 @@
  processDefinitionDialog.visible = true;
  processDefinitionId.value = id;
  loading.value = true;
  getProcessDefinitionListByKey(key).then((resp) => {
  getListByKey(key).then((resp) => {
    if (resp.data && resp.data.length > 0) {
      processDefinitionHistoryList.value = resp.data.filter((item: any) => item.id !== id);
    }
@@ -353,7 +352,7 @@
const handleChange = async (id: string) => {
  await proxy?.$modal.confirm('是否确认切换?');
  loading.value = true;
  migrationProcessDefinition(processDefinitionId.value, id).then((resp) => {
  migrationDefinition(processDefinitionId.value, id).then((resp) => {
    proxy?.$modal.msgSuccess('操作成功');
    getProcessInstanceRunningList();
    processDefinitionDialog.visible = false;