From b52b59232747e44a4abd0acbeef34e20b3859a62 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 21 Mar 2025 16:41:17 +0800 Subject: [PATCH] init --- src/components/PlanPicker/index.vue | 26 +++++++++++++++++++++++++- src/views/contract/contractEdit.vue | 13 ++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/components/PlanPicker/index.vue b/src/components/PlanPicker/index.vue index 414ffb5..67eba00 100644 --- a/src/components/PlanPicker/index.vue +++ b/src/components/PlanPicker/index.vue @@ -110,10 +110,12 @@ import { getBudget } from "@/api/budget/budget"; import { listdeptNoAuth } from "@/api/system/department"; import { getparameterTree } from "@/api/system/dictionary"; +import { getQueryParam } from "@/utils"; export default { data() { return { + myFlowModId: '', boxHeight: 0, planTypes: [], departments: [], @@ -211,6 +213,8 @@ export default { res.list.forEach((item) => (item._inputMoney = 0)); this.plans = res.list; this.planTotal = res.list.total || 0; + + this.toggleBudgetByFlowModId() }, getDepartment() { @@ -271,7 +275,26 @@ export default { new_money: i.money, }))) }) - } + }, + + getParentFlowModId() { + const parentUrl = parent.location.href + const splitArr = parentUrl.split('?') + + if (splitArr[1]) { + const query = splitArr[1].split('&') + this.myFlowModId = query.find(i => /^module_id/.test(i))?.split('=')[1] + } + }, + toggleBudgetByFlowModId() { + this.$nextTick(_ => { + this.plans.forEach(row => { + if (row.flow_mod_id == this.myFlowModId) { + this.$refs['editorPlanTable']?.toggleRowSelection(row, true) + } + }) + }) + }, }, computed: {}, mounted() { @@ -281,6 +304,7 @@ export default { }) }, created() { + this.getParentFlowModId() window.$getPlans = this.getSelections this.getPlanTypes() this.getDepartment() diff --git a/src/views/contract/contractEdit.vue b/src/views/contract/contractEdit.vue index 47a8a2d..dc019ac 100644 --- a/src/views/contract/contractEdit.vue +++ b/src/views/contract/contractEdit.vue @@ -920,7 +920,7 @@ 一般采购 维修相关 - 预算计划支出 + 预算计划支出 @@ -1611,12 +1611,23 @@ export default { } }, + toggleBudgetByFlowModId() { + this.$nextTick(_ => { + this.plans.forEach(row => { + if (row.flow_mod_id == this.form.flow_mod_id) { + this.$refs['editorPlanTable']?.toggleRowSelection(row, true) + } + }) + }) + }, //获取预算计划 async getBudgets() { let res = await getBudget(this.planSelect); res.list.forEach((item) => (item._inputMoney = 0)); this.plans = res.list; this.planTotal = res.list.total || 0; + + this.toggleBudgetByFlowModId() }, handleDrawerClose(done) {