From 5c929cfb5286a31a4e067cbc61e8774f4e7d42ae Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 06 五月 2025 11:25:41 +0800
Subject: [PATCH] 任务查看:任务名称undefined解决
---
src/views/projectProcess/components/RunProcess.vue | 197 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 165 insertions(+), 32 deletions(-)
diff --git a/src/views/projectProcess/components/RunProcess.vue b/src/views/projectProcess/components/RunProcess.vue
index 27e9699..fe229da 100644
--- a/src/views/projectProcess/components/RunProcess.vue
+++ b/src/views/projectProcess/components/RunProcess.vue
@@ -1,19 +1,30 @@
<template>
<div>
<el-dialog
- title="娴佺▼鍚姩"
+ :title="`娴佺▼鍚姩锛歚 + projectInfo.projectName"
:visible.sync="show"
- width="750px"
+ width="1050px"
+ :destroy-on-close="true"
:close-on-click-modal="false"
:before-close="handleClose">
<div>
<div style="display: flex; flex-direction: row; justify-content: center; align-items: center;font-size: 24px">
<div>褰撳墠娴佺▼锛�</div>
- <div v-if="nowProcessId">{{nowProcessName}}</div>
+ <div v-if="nowProcessDefId">{{selectProcessName}}<span v-if="nowProcessInsId" style="color: red">锛堣繍琛屼腑锛�</span></div>
<div v-else>鏈粦瀹氭祦绋�</div>
</div>
</div>
- <div style="margin-top: 20px">
+ <div style="margin-top: 10px">
+ <el-form :inline="true" :model="queryParams" size="small">
+ <el-form-item label="娴佺▼鍚嶇О">
+ <el-input placeholder="娴佺▼鍚嶇О鎼滅储" clearable @clear="search" v-model="queryParams.name"></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="search">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div style="margin-top: 0px">
<el-table
ref="myTable"
:data="processList"
@@ -26,7 +37,14 @@
</el-table-column>
<el-table-column
prop="name"
+ :show-overflow-tooltip="true"
+ min-width="200"
label="娴佺▼鍚嶇О"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="version"
+ label="娴佺▼鐗堟湰"
>
</el-table-column>
<el-table-column
@@ -34,79 +52,194 @@
label="娴佺▼绫诲瀷"
>
</el-table-column>
+ <el-table-column label="椤圭洰绫诲瀷" >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="dict.type.sys_project_type"
+ :value="scope.row.projectType"
+ >
+ </dict-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="璧勯噾绫诲瀷" >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="dict.type.sys_funding_type"
+ :value="scope.row.fundType"
+ >
+ </dict-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎶曡祫绫诲埆" >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="dict.type.sys_investment_type"
+ :value="scope.row.investType"
+ >
+ </dict-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="閲嶇偣鍒嗙被" >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="dict.type.sys_key_categories"
+ :value="scope.row.importanceType"
+ >
+ </dict-tag>
+ </template>
+ </el-table-column>
</el-table>
+ <pagination
+ v-show="total>0"
+ :total="total"
+ :page.sync="queryParams.currentPage"
+ :limit.sync="queryParams.pageSize"
+ :page-sizes="[8]"
+ @pagination="getList"
+ />
</div>
<span slot="footer" class="dialog-footer">
- <el-button @click="startProcess">鍚姩</el-button>
- <el-button type="primary" @click="changeProcess">鍙樻洿</el-button>
+ <el-button type="danger" v-loading="startLoading" @click="startProcess" :disabled="(nowProcessInsId !== '') || (selectProcessDefId === '')">鍚姩娴佺▼</el-button>
+ <el-button type="primary" v-loading="setLoading" @click="changeProcess" :disabled="((nowProcessDefId === selectProcessDefId) && nowProcessInsId !== '') || selectProcessDefId === '' || nowProcessInsId === ''">娴佺▼鍙樻洿</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
+import {projectSetProcess, startProcess} from "@/api/projectProcess/projectProcess";
+import {getProcessConfigInfoPage} from "@/api/projectProcess/processConfigInfo";
+
export default {
+ dicts: ['sys_project_type', 'sys_funding_type', 'sys_investment_type', 'sys_key_categories'],
name: "RunProcess",
props: {
show: {
- require: true,
+ required: true,
type: Boolean
},
- projectId: {
- require: true, // 椤圭洰id
- type: Number
+ projectInfo: {
+ required: true, // 椤圭洰id銆佸悕绉�
+ type: Object
},
- processList: { // 娴佺▼鍒楄〃
- require: true,
- type: Array
- },
- nowProcessId: { // 褰撳墠椤圭洰缁戝畾鐨勬祦绋媔d
- require: true,
+ nowProcessDefId: { // 褰撳墠椤圭洰缁戝畾鐨勫畾涔塱d
+ required: true,
type: String
},
- nowProcessName: {
- require: true,
+ nowProcessInsId: { // 褰撳墠椤圭洰缁戝畾鐨勫疄渚媔d
+ required: true,
+ type: String
+ },
+ projectType: {
+ required: true,
type: String
}
},
watch: {
// 鐩戝惉鍥炴樉鍊�
- nowProcessId(newVal, oldVal) {
+ projectInfo: {
+ handler(newVal, oldVal) {
+ console.log("浼犲叆鍊硷細", newVal, this.processList)
+ this.setSelect(this.nowProcessDefId)
+ },
+ deep: true
+ },
+ processList: {
+ handler(newVal, oldVal) {
+ this.setSelect(this.nowProcessDefId)
+ },
+ deep: true
+ }
+ },
+ data() {
+ return {
+ startLoading: false,
+ setLoading: false,
+ processList: [],
+ total:0,
+ queryParams: {
+ pageSize: 8,
+ currentPage: 1,
+ name: ""
+ },
+ selectProcessDefId: '', // 缁勪欢鍐呴儴閫変腑鐨勬祦绋媔d
+ selectProcessName: '', // 缁勪欢鍐呴儴閫変腑鐨勬祦绋媔d
+ }
+ },
+ created() {
+ this.getList()
+ console.log(this.nowProcessInsId, typeof this.nowProcessInsId, "wwwww")
+ },
+ methods: {
+ search() {
+ this.queryParams.currentPage = 1
+ this.getList()
+ },
+ getList() {
+ getProcessConfigInfoPage(this.queryParams).then(res => {
+ this.processList = res.data;
+ this.total = res.total
+ });
+ },
+ setSelect(value) {
+ console.log("璋冪敤鍊硷細", value)
this.processList.forEach((item,index) => {
- if(item.id == newVal){
+ console.log(item.id, value, item.id === value)
+ if(item.id === value){
+ this.selectProcessName = item.name
this.$nextTick(() => {
this.$refs.myTable.toggleRowSelection(item);
})
}
})
- }
- },
- data() {
- return {
- selectProcessId: '', // 缁勪欢鍐呴儴閫変腑鐨勬祦绋媔d
- }
- },
- methods: {
+ },
// 瀹炵幇el-table鍗曢��
handleSelectionChange(val) {
console.log(val, "閫変腑")
if (val.length > 1) {
this.$refs.myTable.clearSelection();
- this.$refs.myTable.toggleRowSelection(val.pop());
+ this.$refs.myTable.toggleRowSelection(val[val.length - 1]);
}
if(val.length != 0){
- this.selectProcessId = val[val.length - 1].id;
+ this.selectProcessDefId = val[val.length - 1].id;
+ console.log("閫変腑id锛�", this.selectProcessDefId)
}
},
// 鍚姩娴佺▼
startProcess() {
-
+ this.startLoading = true
+ const data = {
+ projectId: this.projectInfo.projectId,
+ processDefId: this.selectProcessDefId,
+ projectType: this.projectType
+ }
+ startProcess(data).then(res => {
+ this.$message.success(res.msg);
+ this.startLoading = false
+ this.handleClose()
+ })
},
// 鍙樻洿娴佺▼
changeProcess() {
-
+ if (!this.selectProcessDefId) {
+ this.$message.error("閫夊垯涓�涓祦绋嬪悗鎵嶈兘鍙樻洿")
+ return
+ }
+ const data = {
+ projectId: this.projectInfo.projectId,
+ processDefId: this.selectProcessDefId,
+ projectType: this.projectType
+ }
+ this.setLoading = true
+ projectSetProcess(data).then(res => {
+ this.$message.success("鍙樻洿鎴愬姛")
+ this.setLoading = false
+ this.handleClose()
+ })
},
handleClose() {
+ this.selectProcessDefId = ""
+ this.selectProcessName = ""
this.$emit("close")
}
}
--
Gitblit v1.8.0