| | |
| | | <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="nowProcessId">{{selectProcessName}}</div> |
| | | <div v-else>未绑定流程</div> |
| | | </div> |
| | | </div> |
| | |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="danger" @click="startProcess">启动</el-button> |
| | | <el-button type="danger" @click="startProcess" :disable="!this.selectProcessId">启动流程</el-button> |
| | | <el-button type="primary" @click="changeProcess">变更</el-button> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {projectSetProcess} from "@/api/projectProcess/projectProcess"; |
| | | import {projectSetProcess, startProcess} from "@/api/projectProcess/projectProcess"; |
| | | |
| | | export default { |
| | | dicts: ['sys_project_type', 'sys_funding_type', 'sys_investment_type', 'sys_key_categories'], |
| | |
| | | nowProcessId: { // 当前项目绑定的流程id |
| | | required: true, |
| | | type: String |
| | | }, |
| | | nowProcessName: { |
| | | required: true, |
| | | type: String |
| | | } |
| | | }, |
| | | watch: { |
| | | // 监听回显值 |
| | | nowProcessId(newVal, oldVal) { |
| | | console.log("传入值:", newVal, this.processList) |
| | | this.processList.forEach((item,index) => { |
| | | console.log(item.id, newVal, item.id === newVal) |
| | | if(item.id === newVal){ |
| | | console.log("wwwwwww") |
| | | this.selectProcessId = newVal |
| | | this.$nextTick(() => { |
| | | this.$refs.myTable.toggleRowSelection(item); |
| | | }) |
| | | } |
| | | }) |
| | | projectInfo: { |
| | | handler(newVal, oldVal) { |
| | | console.log("传入值:", newVal, this.processList) |
| | | this.setSelect(this.nowProcessId) |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | selectProcessId: '', // 组件内部选中的流程id |
| | | selectProcessName: '', // 组件内部选中的流程id |
| | | } |
| | | }, |
| | | methods: { |
| | | setSelect(value) { |
| | | console.log("调用值:", value) |
| | | this.processList.forEach((item,index) => { |
| | | console.log(item.id, value, item.id === value) |
| | | if(item.id === value){ |
| | | this.selectProcessName = item.name |
| | | this.$nextTick(() => { |
| | | this.$refs.myTable.toggleRowSelection(item); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 实现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; |
| | | console.log("选中id:", this.selectProcessId) |
| | | } |
| | | }, |
| | | // 启动流程 |
| | | startProcess() { |
| | | |
| | | startProcess(this.projectInfo.projectId, this.selectProcessId).then(res => { |
| | | this.$message.success(res.msg); |
| | | }) |
| | | }, |
| | | // 变更流程 |
| | | changeProcess() { |
| | |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.selectProcessId = "" |
| | | this.selectProcessName = "" |
| | | this.$emit("close") |
| | | } |
| | | } |