master
xy 2 years ago
parent 3e1dad04a8
commit 460781a463

@ -21,6 +21,7 @@ const getDefaultState = () => {
name: '',
username:'',
avatar: '',
min_allow_level: 2,
department: {},
roles: [],
oaToken: ''
@ -36,6 +37,9 @@ const mutations = {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_LEVEL: (state, level=2) => {
state.min_allow_level = level
},
SET_NAME: (state, name) => {
state.name = name
},
@ -134,7 +138,8 @@ const actions = {
name,
username,
avatar,
department
department,
min_allow_level
} = response
commit('SET_USERNAME',username)
@ -142,7 +147,8 @@ const actions = {
commit('SET_ROLES', roles)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
commit('SET_DEPARTMENT',department)
commit('SET_DEPARTMENT', department)
commit('SET_LEVEL', min_allow_level)
getOatoken().then(res => {

@ -400,7 +400,7 @@ import { resetSelect } from '@/utils'
}
}
return {
userList: ["liuxiangyu", "zhushulan", "admin", "jiangjiao"],
userList: ["ma_sm", "admin", "yu_l","wang_yx","li_f","chen_y"],
user: null,
adminEdit: false,
isFocus: false,

@ -26,7 +26,7 @@
default: '300px'
},
chartData: {
type: Object
type: [Object,Array]
}
},
data() {

@ -8,8 +8,8 @@
</div>
<el-row :gutter="20">
<el-col :span="16">
<el-card class="box-card" style="margin: 20px 0">
<el-col :span="allowAuth ? 16 : 24">
<el-card v-if="allowAuth" class="box-card" style="margin: 20px 0">
<div slot="header" class="clearfix">
<span>预算总体执行情况</span>
<DatePicker
@ -154,7 +154,7 @@
</div>
</div>
</el-col>
<el-col :span="($store.state.user.department && $store.state.user.department.name === '中心领导') ? 7 : 8">
<el-col v-if="allowAuth" :span="($store.state.user.department && $store.state.user.department.name === '中心领导') ? 7 : 8">
<el-card class="box-card" style="margin: 20px 0">
<div class="text item">
<pie-chart :chartData="rptChartData"></pie-chart>
@ -191,7 +191,7 @@
</el-col>
</el-row>
<div class="demo-split">
<div class="demo-split" v-if="allowAuth">
<Split v-model="split" style="height: 440px">
<template #left>
<div class="demo-split-pane" style="padding-right: 5px">
@ -276,7 +276,7 @@
</Split>
</div>
<Card>
<Card v-if="allowAuth">
<template #title>
<div style="display: flex;justify-content: space-between;align-items: center;">
<p>各科室预算计划完成对比图</p>
@ -932,11 +932,14 @@ export default {
},
},
computed: {
moneyFormat() {
moneyFormat () {
return function (price) {
return moneyFormatter(price);
};
},
allowAuth () {
return this.$store.state.user.min_allow_level !== 2
}
},
};
</script>

@ -160,7 +160,7 @@
</div>
</template>
<template v-slot:extraFormBottom>
<Input search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
<Input v-model="budgetSelect.name" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
<div style="min-width: 300px;">
<template v-if="form.plan_link.length > 0">
<template v-for="item in form.plan_link">
@ -168,8 +168,8 @@
</template>
</template>
</div>
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
ref="planTable" @select="selectPlan">
<xy-table :list="budgets" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
ref="budgetTable" @select="selectPlan">
<template v-slot:btns>
<el-table-column label="使用金额" header-align="center" width="140">
<template slot-scope="scope">
@ -180,8 +180,9 @@
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="planTotal" show-elevator @on-change="e => {
p
<Page :total="budgetTotal" show-elevator @on-change="e => {
budgetSelect.page = e;
getBudgets();
}" />
</div>
</template>
@ -269,6 +270,15 @@ export default {
list_rows: 10,
p: 1
},
budgets: [],
budgetTotal: 0,
budgetSelect: {
name: "",
top_pid: '',
is_tree: 1,
page: 1,
page_size: 10
},
planOutTable: [
{
width: 46,
@ -513,6 +523,9 @@ export default {
async getDetail() {
const res = await show({ id: this.id });
for (var m of res.plan_link) {
m.label = m.plan ? m.plan.name : "无计划名称";
}
this.$integrateData(this.form, res);
this.fileList = res.files_detail.map(i => {
return {
@ -528,7 +541,7 @@ export default {
submit() {
this.form.outcome_type = this.outcomeType;
this.form.files = this.fileList.map(i => i.response?.id);
this.form.contract_plan_act_links = this.form.plan_link;
this.form.contract_plan_links = this.form.plan_link;
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
@ -586,12 +599,9 @@ export default {
this.isShowPlan = true;
},
async getBudgets() {
let res = await getBudget({
top_pid: 1,
...this.plansSelect
})
this.plans = res.list.data
this.planTotal = res.list.total
let res = await getBudget(this.budgetSelect)
this.budgets = res.list.data
this.budgetTotal = res.list.total
this.toggleSelection(this.form.plan_link.map(item => {
return item.plan_id
@ -600,16 +610,16 @@ export default {
//
toggleSelection(plans) {
if (plans) {
this.plans.filter(plan => {
this.budgets.filter(plan => {
if (plans.includes(plan.id)) {
plan.use_money = this.form.plan_link[plans.indexOf(plan.id)].use_money
return true
}
}).map(row => {
this.$refs.planTable.toggleRowSelection(row)
}).forEach(row => {
this.$refs.budgetTable.toggleRowSelection(row)
})
} else {
this.$refs.planTable.clearSelection()
this.$refs.budgetTable.clearSelection()
}
},
//
@ -657,6 +667,7 @@ export default {
},
created() {
this.getBudgets();
this.getMoneyWay();
},
};

@ -300,8 +300,8 @@ export default {
page_size: 10,
start_created_at: "",
end_created_at: undefined,
start_plan_price: "",
end_plan_price: "",
start_plan_price: null,
end_plan_price: null,
department_id: "",
report_type: "",
other_type: "",

Loading…
Cancel
Save