master
xy 2 years ago
parent 40e997ec6d
commit 4e68d155e0

@ -236,7 +236,7 @@
<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;"
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>
<el-table-column label="使用金额" header-align="center">
<template slot-scope="scope">
@ -448,7 +448,7 @@ import { resetSelect } from '@/utils'
planSearch: '',
planTable: [{
sortable: false,
width: 36,
width: 44,
type: "selection"
},
{
@ -633,10 +633,11 @@ import { resetSelect } from '@/utils'
let res = await getBudget({
name: this.planSearch,
page_size: 10,
page: this.plansPageIndex
page: this.plansPageIndex,
is_tree: 1
})
this.plans = res.list.data
this.planTotal = res.list.total
this.plans = res.list;
this.planTotal = res.list.total || 0;
var selPlans = [...this.detail.plan, ...this.plan]
//let selPlans = this.detail.plan.contact([]);
@ -654,14 +655,28 @@ import { resetSelect } from '@/utils'
toggleSelection(plans) {
var selPlans = [...this.detail.plan, ...this.plan]
if (plans) {
this.plans.filter(plan => {
this.plans.forEach(plan => {
if (plans.includes(plan.id)) {
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 {
this.$refs.editorPlanTable.clearSelection()
}

@ -955,6 +955,10 @@
:show-index="false"
:table-item="planTable"
style="margin-top: 10px"
row-key="id"
border
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@select="selectPlan"
>
<template v-slot:btns>
@ -965,7 +969,7 @@
width="140"
>
<template slot-scope="scope">
<Input
<Input v-if="scope.row.pid !== 0"
:value="scope.row.useMoney"
@input="planInput($event, scope.row)"
/>
@ -1763,10 +1767,13 @@ export default {
],
planTable: [
{
width: 40,
width: 44,
sortable: false,
type: "selection",
fixed: "left",
selectable: (row, index) => {
return row.pid !== 0
}
},
{
label: "分类",
@ -2266,6 +2273,9 @@ export default {
//
async buyProcess(row) {
let zijinlaiyuanjuti = row.plans?.map(plan => {
return this.plans.find(p => p.id === plan.pid)?.name
})
this.setNowContract(row, "caigou");
let baseInfo = {
title: row?.name,
@ -2284,6 +2294,7 @@ export default {
return prev + "," + cur?.value;
}
}, ""),
zijinlaiyuanjuti: zijinlaiyuanjuti.toString()
};
// 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=${
@ -2374,11 +2385,12 @@ export default {
page_size: 10,
page: this.plansPageIndex,
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.plan.map((item) => {
@ -2754,15 +2766,16 @@ export default {
};
},
created() {
this.getBudgets();
this.select.keyword = this.$route.query.keyword;
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.style.display = "none";
document.body.appendChild(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.style.display = "none";
// document.body.appendChild(iframe);
},
destroyed() {
window.onfocus = null;
document.body.removeChild(iframe);
//document.body.removeChild(iframe);
},
};
</script>

Loading…
Cancel
Save