diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue
index f2f22e9..4fb395e 100644
--- a/src/views/contract/components/editorContract.vue
+++ b/src/views/contract/components/editorContract.vue
@@ -236,7 +236,7 @@
+ ref="editorPlanTable" row-key="id" border default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @select="selectPlan">
@@ -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()
}
diff --git a/src/views/contract/contractList.vue b/src/views/contract/contractList.vue
index 53c1346..25cda32 100644
--- a/src/views/contract/contractList.vue
+++ b/src/views/contract/contractList.vue
@@ -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"
>
@@ -965,7 +969,7 @@
width="140"
>
-
@@ -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);
},
};