lion 9 months ago
commit 78bb73a5f6

@ -110,10 +110,12 @@
import { getBudget } from "@/api/budget/budget"; import { getBudget } from "@/api/budget/budget";
import { listdeptNoAuth } from "@/api/system/department"; import { listdeptNoAuth } from "@/api/system/department";
import { getparameterTree } from "@/api/system/dictionary"; import { getparameterTree } from "@/api/system/dictionary";
import { getQueryParam } from "@/utils";
export default { export default {
data() { data() {
return { return {
myFlowModId: '',
boxHeight: 0, boxHeight: 0,
planTypes: [], planTypes: [],
departments: [], departments: [],
@ -211,6 +213,8 @@ export default {
res.list.forEach((item) => (item._inputMoney = 0)); res.list.forEach((item) => (item._inputMoney = 0));
this.plans = res.list; this.plans = res.list;
this.planTotal = res.list.total || 0; this.planTotal = res.list.total || 0;
this.toggleBudgetByFlowModId()
}, },
getDepartment() { getDepartment() {
@ -271,7 +275,26 @@ export default {
new_money: i.money, 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: {}, computed: {},
mounted() { mounted() {
@ -281,6 +304,7 @@ export default {
}) })
}, },
created() { created() {
this.getParentFlowModId()
window.$getPlans = this.getSelections window.$getPlans = this.getSelections
this.getPlanTypes() this.getPlanTypes()
this.getDepartment() this.getDepartment()

@ -920,7 +920,7 @@
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;"> <span slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
<el-button @click="step = 2,myPurchaseType = 2,isWeixiu=false,form.is_common_purchase = 1,form.flow_mod_id = 99,showTypes = false,showEdit=true">一般采购</el-button> <el-button @click="step = 2,myPurchaseType = 2,isWeixiu=false,form.is_common_purchase = 1,form.flow_mod_id = 99,showTypes = false,showEdit=true">一般采购</el-button>
<el-button @click="showTypes = false,myPurchaseType = 1,isWeixiu=true,form.is_common_purchase = 0,step=2,showEdit=true">维修相关</el-button> <el-button @click="showTypes = false,myPurchaseType = 1,isWeixiu=true,form.is_common_purchase = 0,step=2,showEdit=true">维修相关</el-button>
<el-button type="primary" @click="showTypes = false,isWeixiu=false,myPurchaseType = 1,form.is_common_purchase = 0,showEdit=true">预算计划支出</el-button> <el-button type="primary" @click="showTypes = false,isWeixiu=false,myPurchaseType = 1,form.is_common_purchase = 0,showEdit=true,toggleBudgetByFlowModId()">预算计划支出</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -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() { async getBudgets() {
let res = await getBudget(this.planSelect); let res = await getBudget(this.planSelect);
res.list.forEach((item) => (item._inputMoney = 0)); res.list.forEach((item) => (item._inputMoney = 0));
this.plans = res.list; this.plans = res.list;
this.planTotal = res.list.total || 0; this.planTotal = res.list.total || 0;
this.toggleBudgetByFlowModId()
}, },
handleDrawerClose(done) { handleDrawerClose(done) {

@ -218,6 +218,7 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<el-date-picker style="width: 160px" size="small" v-model="plansSelect.year" value-format="yyyy" type="year" />
<el-cascader <el-cascader
:options="planTypes" :options="planTypes"
:props="{ :props="{
@ -384,7 +385,8 @@ import {listdeptNoAuth} from "@/api/system/department";
plansSelect: { plansSelect: {
page: 1, page: 1,
page_size: 10, page_size: 10,
name: '' name: '',
year: ''
}, },
planTable: [{ planTable: [{
sortable: false, sortable: false,
@ -591,8 +593,8 @@ import {listdeptNoAuth} from "@/api/system/department";
this.paymentRegistrationForm.actMoney = res.apply_money this.paymentRegistrationForm.actMoney = res.apply_money
this.paymentRegistrationForm.moneyWay = res.money_way_id?.split(',').map(item => Number(item)) this.paymentRegistrationForm.moneyWay = res.money_way_id?.split(',').map(item => Number(item))
this.getBudgets()
await this.getContract(res.contract) await this.getContract(res.contract)
this.getBudgets(this.paymentRegistrationForm.plan?.map(i => i.plan_id)?.toString())
await this.moneyWayChange() await this.moneyWayChange()
}, },
@ -625,14 +627,6 @@ import {listdeptNoAuth} from "@/api/system/department";
// }) // })
// return // return
// } // }
console.log({
id: this.registrationId,
contract_id: this.contract.id,
act_money: this.paymentRegistrationForm.actMoney,
status: 1,
// money_way_id: this.paymentRegistrationForm.moneyWay.toString(),
contract_plan_act_links: this.paymentRegistrationForm.plan
})
editorFundLog({ editorFundLog({
id: this.registrationId, id: this.registrationId,
contract_id: this.contract.id, contract_id: this.contract.id,
@ -656,19 +650,17 @@ import {listdeptNoAuth} from "@/api/system/department";
// //
// //
async getBudgets() { async getBudgets(pid) {
let res = await getBudget({ let res = await getBudget({
top_pid: 0, top_pid: 1,
...this.plansSelect ...this.plansSelect,
pid
}) })
if (res.list.data) { if (res.list.data) {
this.plans = [...this.paymentRegistrationForm.plan.map(i => ({ this.plans = res.list.data.map(i => ({
use_money: i.use_money,
...i.plan
})), ...res.list.data.map(i => ({
use_money: 0, use_money: 0,
...i ...i
}))].reduce((accumulator, current) => { })).reduce((accumulator, current) => {
const duplicate = accumulator.find(item => item.id === current.id); const duplicate = accumulator.find(item => item.id === current.id);
if (!duplicate) { if (!duplicate) {
return accumulator.concat([current]); return accumulator.concat([current]);
@ -727,11 +719,11 @@ import {listdeptNoAuth} from "@/api/system/department";
toggleSelection(plans) { toggleSelection(plans) {
if (plans) { if (plans) {
this.plans.filter(plan => { this.plans.filter(plan => {
if (plans.includes(plan.id)) { if (plans.includes(plan.pid)) {
plan.use_money = this.paymentRegistrationForm.plan[plans.indexOf(plan.id)].use_money plan.use_money = this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money
return true return true
} }
}).map(row => { }).forEach(row => {
this.$refs.planTable.toggleRowSelection(row) this.$refs.planTable.toggleRowSelection(row)
}) })
} else { } else {

Loading…
Cancel
Save