From d30d3d2d352abfcd9e16cece8a34f2a517f8abc0 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 05 三月 2025 16:05:19 +0800
Subject: [PATCH] 动态表单必填提示修改
---
src/views/projectProcess/index.vue | 168 ++++++++++++++++++++++++++++++++++----------------------
1 files changed, 102 insertions(+), 66 deletions(-)
diff --git a/src/views/projectProcess/index.vue b/src/views/projectProcess/index.vue
index cdb3acc..84fc791 100644
--- a/src/views/projectProcess/index.vue
+++ b/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,60 +179,50 @@
</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'">
- <dict-tag :options="dict.type.sys_project_status" :value="scope.row.projectStatus"/>
- </template>
- <!-- projectColorCode鎻掓Ы -->
- <template v-if="item.slotName === 'projectColorCode'">
- <dict-tag :options="dict.type.sys_project_code" :value="scope.row.projectColorCode"/>
- </template>
- <!-- projectType鎻掓Ы -->
- <template v-if="item.slotName === 'projectType'">
- <dict-tag :options="dict.type.sys_project_type" :value="scope.row.projectType"/>
- </template>
- <!-- investType鎻掓Ы -->
- <template v-if="item.slotName === 'investType'">
- <dict-tag :options="dict.type.sys_investment_type" :value="scope.row.investType"/>
- </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="lookProcessDetail(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"-->
@@ -258,7 +248,7 @@
<pagination
v-show="total>0"
:total="total"
- :page.sync="queryParams.pageNum"
+ :page.sync="queryParams.currentPage"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
@@ -270,17 +260,25 @@
:currentColumns="columns"
/>
- <RunProcess :show="showRunProcess" :now-process-id="nowProcessId" :now-process-name="nowProcessName" :process-list="processList" @close="closeRunProcess"></RunProcess>
+ <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 { listDefinition } from "@/api/flowable/definition";
-import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "@/api/projectInfo";
-import { getProjectProcesss } from "@/api/projectProcess/projectProcess"
-import {current, currentRest} from '@/views/projectEngineering/projectLibrary/list';
+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',
@@ -292,11 +290,15 @@
},
data() {
return {
+ projectType: '',
+ projectRunFrom: {
+ projectId: null,
+ projectName: ''
+ },
processList: [],
showRunProcess: false,
- projectId: null,
- nowProcessId: '',
- nowProcessName: '',
+ nowProcessDefId: '',
+ nowProcessInsId: '',
isImportOrExport: false,
fileDialogVisible: false,
//鏄惁闇�瑕佹柊澧炴寜閽�(鍌ㄨ搫椤圭洰闇�瑕�)
@@ -330,7 +332,7 @@
timeRange: [],
// 鏌ヨ鍙傛暟
queryParams: {
- pageNum: 1,
+ currentPage: 1,
pageSize: 10,
projectName: null,
projectCode: null,
@@ -339,7 +341,7 @@
projectType: '', // 椤圭洰绫诲瀷
importanceType: '', // 閲嶇偣鍒嗙被
projectStatus: '', // 椤圭洰鐘舵��
- projectColorCode: '', // 椤圭洰鐮�
+ coding: '', // 椤圭洰鐮�
investmentType: '', // 璧勯噾绫诲瀷
projectPhase: '', // 椤圭洰闃舵
investType: '', // 鎶曡祫绫诲埆
@@ -368,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;
@@ -379,29 +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.projectId = row.id;
- this.nowProcessId = row.flowableProcessId;
- this.nowProcessName = row.flowableProcessName;
- // 鎷垮埌娴佺▼鍒楄〃
- listDefinition(this.queryParams).then(response => {
- this.processList = response.data.records;
- this.showRunProcess = true;
- });
+ 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"
+ }
+ // // 闃叉锛歩d娌″彉涓嶈Е鍙戠洃鍚�
+ // 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
@@ -448,11 +483,12 @@
/** 鏌ヨ椤圭洰绠$悊鍩虹淇℃伅鍒楄〃 */
getList() {
this.loading = true;
- getProjectProcesss(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() {
@@ -502,7 +538,7 @@
},
/** 鎼滅储鎸夐挳鎿嶄綔 */
handleQuery() {
- this.queryParams.pageNum = 1;
+ this.queryParams.currentPage = 1;
this.getList();
},
/** 閲嶇疆鎸夐挳鎿嶄綔 */
--
Gitblit v1.8.0