master
xy 2 years ago
parent 40e997ec6d
commit 4e68d155e0

@ -236,7 +236,7 @@
<Input v-model="planSearch" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" /> <Input v-model="planSearch" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;" <xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
ref="editorPlanTable" @select="selectPlan"> ref="editorPlanTable" row-key="id" border default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @select="selectPlan">
<template v-slot:btns> <template v-slot:btns>
<el-table-column label="使用金额" header-align="center"> <el-table-column label="使用金额" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -448,7 +448,7 @@ import { resetSelect } from '@/utils'
planSearch: '', planSearch: '',
planTable: [{ planTable: [{
sortable: false, sortable: false,
width: 36, width: 44,
type: "selection" type: "selection"
}, },
{ {
@ -633,10 +633,11 @@ import { resetSelect } from '@/utils'
let res = await getBudget({ let res = await getBudget({
name: this.planSearch, name: this.planSearch,
page_size: 10, page_size: 10,
page: this.plansPageIndex page: this.plansPageIndex,
is_tree: 1
}) })
this.plans = res.list.data this.plans = res.list;
this.planTotal = res.list.total this.planTotal = res.list.total || 0;
var selPlans = [...this.detail.plan, ...this.plan] var selPlans = [...this.detail.plan, ...this.plan]
//let selPlans = this.detail.plan.contact([]); //let selPlans = this.detail.plan.contact([]);
@ -654,14 +655,28 @@ import { resetSelect } from '@/utils'
toggleSelection(plans) { toggleSelection(plans) {
var selPlans = [...this.detail.plan, ...this.plan] var selPlans = [...this.detail.plan, ...this.plan]
if (plans) { if (plans) {
this.plans.filter(plan => { this.plans.forEach(plan => {
if (plans.includes(plan.id)) { if (plans.includes(plan.id)) {
plan.useMoney = selPlans[plans.indexOf(plan.id)].value.use_money plan.useMoney = selPlans[plans.indexOf(plan.id)].value.use_money
return true this.$refs.editorPlanTable.toggleRowSelection(plan)
}
if (plan.children?.length > 0) {
plan.children.forEach(cplan => {
if (plans.includes(cplan.id)) {
cplan.useMoney = selPlans[plans.indexOf(cplan.id)].value.use_money
this.$refs.editorPlanTable.toggleRowSelection(cplan)
}
})
} }
}).map(row => {
this.$refs.editorPlanTable.toggleRowSelection(row)
}) })
// this.plans.filter(plan => {
// if (plans.includes(plan.id)) {
// plan.useMoney = selPlans[plans.indexOf(plan.id)].value.use_money
// return true
// }
// }).map(row => {
// this.$refs.editorPlanTable.toggleRowSelection(row)
// })
} else { } else {
this.$refs.editorPlanTable.clearSelection() this.$refs.editorPlanTable.clearSelection()
} }

@ -955,6 +955,10 @@
:show-index="false" :show-index="false"
:table-item="planTable" :table-item="planTable"
style="margin-top: 10px" style="margin-top: 10px"
row-key="id"
border
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@select="selectPlan" @select="selectPlan"
> >
<template v-slot:btns> <template v-slot:btns>
@ -965,7 +969,7 @@
width="140" width="140"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<Input <Input v-if="scope.row.pid !== 0"
:value="scope.row.useMoney" :value="scope.row.useMoney"
@input="planInput($event, scope.row)" @input="planInput($event, scope.row)"
/> />
@ -1763,10 +1767,13 @@ export default {
], ],
planTable: [ planTable: [
{ {
width: 40, width: 44,
sortable: false, sortable: false,
type: "selection", type: "selection",
fixed: "left", fixed: "left",
selectable: (row, index) => {
return row.pid !== 0
}
}, },
{ {
label: "分类", label: "分类",
@ -2266,6 +2273,9 @@ export default {
// //
async buyProcess(row) { async buyProcess(row) {
let zijinlaiyuanjuti = row.plans?.map(plan => {
return this.plans.find(p => p.id === plan.pid)?.name
})
this.setNowContract(row, "caigou"); this.setNowContract(row, "caigou");
let baseInfo = { let baseInfo = {
title: row?.name, title: row?.name,
@ -2284,6 +2294,7 @@ export default {
return prev + "," + cur?.value; return prev + "," + cur?.value;
} }
}, ""), }, ""),
zijinlaiyuanjuti: zijinlaiyuanjuti.toString()
}; };
// let res = await getOatoken() // let res = await getOatoken()
let url = `${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/8&auth_token=${this.$store.getters.oa_token}&out_caigou_id=${ let url = `${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/8&auth_token=${this.$store.getters.oa_token}&out_caigou_id=${
@ -2374,11 +2385,12 @@ export default {
page_size: 10, page_size: 10,
page: this.plansPageIndex, page: this.plansPageIndex,
plan_department_id: this.planSearch.plan_department_id, plan_department_id: this.planSearch.plan_department_id,
top_pid: 1, top_pid: '',
is_tree: 1
}); });
this.plans = res.list.data; this.plans = res.list;
this.planTotal = res.list.total; this.planTotal = res.list.total || 0;
this.toggleSelection( this.toggleSelection(
this.plan.map((item) => { this.plan.map((item) => {
@ -2754,15 +2766,16 @@ export default {
}; };
}, },
created() { created() {
this.getBudgets();
this.select.keyword = this.$route.query.keyword; this.select.keyword = this.$route.query.keyword;
iframe = document.createElement("iframe"); // iframe = document.createElement("iframe");
iframe.src = `${process.env.VUE_APP_OUT_OLD}/login/oss_login?id=${this.$store.state.user.userId}&username=${this.$store.state.user.username}`; // iframe.src = `${process.env.VUE_APP_OUT_OLD}/login/oss_login?id=${this.$store.state.user.userId}&username=${this.$store.state.user.username}`;
iframe.style.display = "none"; // iframe.style.display = "none";
document.body.appendChild(iframe); // document.body.appendChild(iframe);
}, },
destroyed() { destroyed() {
window.onfocus = null; window.onfocus = null;
document.body.removeChild(iframe); //document.body.removeChild(iframe);
}, },
}; };
</script> </script>

Loading…
Cancel
Save