master
xy 2 years ago
parent 3e1dad04a8
commit 460781a463

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

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

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

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

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

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

Loading…
Cancel
Save