zxl
2025-03-03 c78889e71d16d26c03ff59746db47c6d4d2b98e0
src/views/projectProcess/index.vue
@@ -88,7 +88,7 @@
              <el-row>
                <el-col :span="12">
                  <el-form-item label="项目码">
                    <el-select v-model="queryParams.projectColorCode" clearable placeholder="请选择" class="select-option" @change="handleQuery">
                    <el-select v-model="queryParams.coding" clearable placeholder="请选择" class="select-option" @change="handleQuery">
                      <el-option v-for="item in dict.type.sys_project_code" :key="item.value" :label="item.label"
                                 :value="item.value"/>
                    </el-select>
@@ -179,80 +179,68 @@
    </el-form>
    <el-table
      :key="tableKey"
      ref="elTable"
      style="margin-top: 20px"
      v-loading="loading"
      :data="projectInfoList"
      @selection-change="handleSelectionChange"
      height="60vh"
      height="100%"
      sortable="custom"
      row-key="id"
      border
      default-expand-all
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
      :show-overflow-tooltip="true">
      <el-table-column type="selection" width="55" align="center"/>
      <!-- 动态列 -->
      <el-table-column
        v-for="item in columns"
        :key="item.id"
        v-if="item.visible"
        :prop="item.id"
        :label="item.label"
        :min-width="item.minWidth"
      >
      <el-table-column label="项目名称" min-width="250" :show-overflow-tooltip="true" prop="projectName" />
      <el-table-column label="项目推进类型" align="center" prop="projectType">
        <template slot-scope="scope">
          <!-- 使用具名插槽 -->
          <template v-if="item.slotName">
            <!-- projectStatus插槽 -->
            <template v-if="item.slotName === 'projectStatus'">
              <div class="mx-1">{{ '自定义样式' }}</div>
            </template>
            <!-- projectColorCode插槽 -->
            <template v-if="item.slotName === 'projectColorCode'">
              <div class="mx-1 has-dot">{{ '自定义样式' }}<span class="dot" style="margin-left: 5px"></span></div>
            </template>
            <!-- projectType插槽 -->
            <template v-if="item.slotName === 'projectType'">
              <div class="mx-1">{{ '自定义样式' }}</div>
            </template>
            <!-- investType插槽 -->
            <template v-if="item.slotName === 'investType'">
              <div class="mx-1">{{ '自定义样式' }}</div>
            </template>
            <!-- planStartTime插槽 -->
            <template v-if="item.slotName === 'planStartTime'">
              {{ '自定义样式' }}
            </template>
          </template>
          <!-- 默认显示 -->
          <span v-else>{{ scope.row[item.id] }}</span>
          <dict-tag :options="dict.type.sys_project_type" :value="scope.row.projectType"/>
        </template>
      </el-table-column>
      <el-table-column label="主管部门" align="center" prop="competentDepartmentName">
      </el-table-column>
      <el-table-column label="业主单位" align="center" prop="projectOwnerUnitName">
      </el-table-column>
      <el-table-column label="年份" align="center" prop="year">
        <template slot-scope="scope">
          {{ scope.row.year ? scope.row.year + '年' : '' }}
        </template>
      </el-table-column>
      <el-table-column label="投资额(万)" align="center" prop="investmentAmount" />
      <el-table-column label="开工状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_project_status" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <!-- 操作列 -->
      <el-table-column label="操作" width="140" align="center" >
        <template slot-scope="scope">
          <el-button
            size="medium"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
          >
          </el-button>
          <el-button
            v-if="isReserve"
            size="medium"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
          >
          </el-button>
          <el-button
            v-if="isReserve"
            size="medium"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
          >
          </el-button>
                    <el-button
                      size="medium"
                      type="text"
                      icon="el-icon-view"
                      v-if="scope.row.processInsId"
                      @click="lookProcessDetail(scope.row)"
                    >
                    </el-button>
          <!--          <el-button-->
          <!--            v-if="isReserve"-->
          <!--            size="medium"-->
          <!--            type="text"-->
          <!--            icon="el-icon-edit"-->
          <!--            @click="handleUpdate(scope.row)"-->
          <!--          >-->
          <!--          </el-button>-->
          <el-tooltip content="流程" placement="top" effect="light" :enterable="false">
            <el-button
              v-if="isReserve"
              size="medium"
              type="text"
              icon="el-icon-s-operation"
              @click="openOpProcess(scope.row)"
            >
            </el-button>
          </el-tooltip>
        </template>
      </el-table-column>
    </el-table>
@@ -260,7 +248,7 @@
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :page.sync="queryParams.currentPage"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
@@ -271,13 +259,26 @@
      @fileDialogCancel="fileDialogCancel"
      :currentColumns="columns"
    />
    <RunProcess ref="runProcess" :show="showRunProcess"
                :now-process-def-id="nowProcessDefId"
                :now-process-ins-id="nowProcessInsId"
                :project-info="projectRunFrom"
                :process-list="processList"
                :project-type="projectType"
                @close="closeRunProcess">
    </RunProcess>
  </div>
</template>
<script>
import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "@/api/projectInfo";
import {current, currentRest} from '@/views/projectEngineering/projectLibrary/list';
import { listDefinition } from "@/api/flowable/definition";
import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "@/api/projectEngineering/projectInfo";
import { getProjectProcess } from "@/api/projectProcess/projectProcess"
import {projectProcessCurrent, projectProcessCurrentRest} from '@/views/projectEngineering/projectLibrary/list';
import FileDialog from '@/views/projectEngineering/projectLibrary/component/FileDialog';
import RunProcess from "@/views/projectProcess/components/RunProcess";
import {getProcessConfigInfoList} from "@/api/projectProcess/processConfigInfo";
export default {
  dicts: ['sys_administrative_divisions', 'sys_investment_type', 'sys_project_phases',
@@ -285,10 +286,19 @@
    'sys_project_tags', 'sys_key_categories', 'sys_project_type'],
  name: "projectInfo",
  components: {
    FileDialog
    FileDialog, RunProcess
  },
  data() {
    return {
      projectType: '',
      projectRunFrom: {
        projectId: null,
        projectName: ''
      },
      processList: [],
      showRunProcess: false,
      nowProcessDefId: '',
      nowProcessInsId: '',
      isImportOrExport: false,
      fileDialogVisible: false,
      //是否需要新增按钮(储蓄项目需要)
@@ -322,7 +332,7 @@
      timeRange: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        currentPage: 1,
        pageSize: 10,
        projectName: null,
        projectCode: null,
@@ -331,7 +341,7 @@
        projectType: '', // 项目类型
        importanceType: '', // 重点分类
        projectStatus: '', // 项目状态
        projectColorCode: '', // 项目码
        coding: '', // 项目码
        investmentType: '', // 资金类型
        projectPhase: '', // 项目阶段
        investType: '', // 投资类别
@@ -360,7 +370,7 @@
    if(projectCategory){
      this.isProjectCategory = true;
    }
    const columns = current.map((item, index) => {
    const columns = projectProcessCurrent.map((item, index) => {
      item.index = index + 1;
      item.key = index;
      item.serialNumber = index + 1;
@@ -371,15 +381,62 @@
    this.getList();
  },
  methods: {
    // 查看详情
    lookProcessDetail(row) {
      sessionStorage.removeItem("projectProDetail")
      this.$router.push({
        path: '/projectFlow/detail',
        query: {
          projectId: row.id,
          processDefId: row.processDefId,
          processInsId: row.processInsId,
          deployId: row.deployId,
          processName: row.flowableProcessName
        }
      })
    },
    closeRunProcess() {
      this.projectRunFrom = {
        projectId: null,
        projectName: ''
      }
      this.nowProcessDefId = "";
      this.nowProcessInsId = "";
      this.projectType = ""
      this.showRunProcess = false
      this.getList()
    },
    // 打开流程页面
    openOpProcess(row) {
      this.nowProcessDefId = row.processDefId ? row.processDefId : '';
      this.nowProcessInsId = row.processInsId ? row.processInsId : '';
      const numericPattern = /^\d+(\.\d+)?$/;
      if (numericPattern.test(row.id)) {
        this.projectType = "PROJECT"
      } else {
        this.projectType = "ENGINEERING"
      }
      // // 防止:id没变不触发监听
      // this.$refs.runProcess.setSelect(row.flowableProcessId);
      this.projectRunFrom.projectId = row.id;
      this.projectRunFrom.projectName = row.projectName;
      this.showRunProcess = true;
      // 拿到流程列表 TODO 根据项目类型做筛选
      // getProcessConfigInfoList().then(response => {
      //   this.processList = response.data;
      //
      // });
    },
    // 重置排序的方法
    handleResetSort() {
      this.defaultColumns = currentRest.map((item, index) => {
      this.defaultColumns = projectProcessCurrentRest.map((item, index) => {
        item.index = index + 1;
        item.key = index;
        item.serialNumber = index + 1
        return item;
      });
      this.columns = currentRest.map((item, index) => {
      this.columns = projectProcessCurrentRest.map((item, index) => {
        item.index = index + 1;
        item.key = index;
        item.serialNumber = index + 1
@@ -426,11 +483,12 @@
    /** 查询项目管理基础信息列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then(response => {
      getProjectProcess(this.queryParams).then(response => {
        this.projectInfoList = response.data;
        console.log(this.projectInfoList)
        this.total = response.total;
        this.loading = false;
      });
      this.loading = false;
    },
    // 取消按钮
    cancel() {
@@ -480,7 +538,7 @@
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.queryParams.currentPage = 1;
      this.getList();
    },
    /** 重置按钮操作 */