master
xy 2 years ago
parent f24067f30d
commit 8721ad3066

@ -2,3 +2,6 @@
// Here are the variables to cover, such as:
@primary-color: #338de3;
.ivu-table-fixed,.ivu-table-fixed-right{
height: calc(100% - 8px) !important;
}

@ -130,7 +130,7 @@
<template v-slot:plan>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>关联预算计划
关联预算计划
</div>
<div class="xy-table-item-content">
<div class="contract-add-plan" style="min-width: 300px;" @click="isShowPlan = true,getBudgets()">
@ -253,7 +253,50 @@
<!-- 编辑中 预算计划 -->
<xy-dialog :is-show.sync="isShowPlan" title="预算计划" :width="820" @on-ok="planSelect">
<template>
<Input v-model="planSearch" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
<div style="display: flex;">
<DatePicker
:value="planSelect.year"
placeholder="选择所属年份"
placement="bottom-start"
style="margin-right: 10px;"
type="year"
@on-change="(e) => {
plansSelect.year = e
getBudgets()
}"
></DatePicker>
<el-select
placeholder="科室选择"
clearable
size="small"
v-model="plansSelect.plan_department_id"
style="margin-right: 10px;"
@change="getBudgets"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
<el-cascader
placeholder="资金类型选择"
:options="planTypes"
:props="{
checkStrictly: true,
label: 'name',
value: 'id',
}"
:value="plansSelect.type"
clearable
size="small"
style="width: 220px;margin-right: 10px;"
@change="handleTypePick"
/>
<Input v-model="planSearch" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
</div>
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
ref="editorPlanTable" row-key="id" border default-expand-all :tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }" @select="selectPlan">
@ -322,6 +365,8 @@ import {
Message
} from 'element-ui'
import { resetSelect } from '@/utils'
import { getparameterTree } from '@/api/system/dictionary'
import { listdeptNoAuth } from '@/api/system/department'
export default {
props: {
purchaseType: Array,
@ -330,7 +375,10 @@ import { resetSelect } from '@/utils'
},
data() {
var planPass = (rule, value, callback) => {
if (this.detail.isBudget && !this.detail.is_substitute) {
if (this.detail.use_framework_buy) {
callback()
}
if ((this.detail.isBudget && !this.detail.is_substitute)) {
if (this.detail.plan.length === 0) {
return callback(new Error('必选'))
} else {
@ -464,7 +512,18 @@ import { resetSelect } from '@/utils'
trigger: 'change'
}]
},
departments: [],
planTypes: [],
plans: [],
plansSelect: {
page_size: 10,
page: 1,
is_tree: 1,
name: "",
year: "",
plan_department_id: "",
type: ""
},
planSearch: '',
planTable: [{
sortable: false,
@ -576,6 +635,48 @@ import { resetSelect } from '@/utils'
}
},
methods: {
handleTypePick(e) {
if (e.length === 1) {
this.plansSelect.type_pid = e[0] || ''
this.plansSelect.type = ''
}
else if (e.length === 2) {
this.plansSelect.type_pid = e[1] || ''
this.plansSelect.type = ''
}
else if (e.length === 3) {
this.plansSelect.type_pid = ''
this.plansSelect.type = e[e.length - 1] || ''
} else {
this.plansSelect.type = ''
this.plansSelect.type_pid = ''
}
this.getBudgets()
},
getDepartment() {
listdeptNoAuth().then((res) => {
this.departments = res;
});
},
async getPlanTypes() {
const res = await getparameterTree({
id: 3
});
const dataHandler = (data) => {
data.forEach(i => {
if (i.hasOwnProperty('detail')) {
i.children = i.detail.map(j => {
j.name = j.value
return j;
})
} else {
dataHandler(i['children'])
}
})
return data;
}
this.planTypes = dataHandler(res?.children) || []
},
//
planInput(e, row) {
if (!/^[0-9]+.?[0-9]*$/.test(e) && e) {
@ -653,12 +754,7 @@ import { resetSelect } from '@/utils'
},
//
async getBudgets() {
let res = await getBudget({
name: this.planSearch,
page_size: 10,
page: this.plansPageIndex,
is_tree: 1
})
let res = await getBudget(this.plansSelect)
this.plans = res.list;
this.planTotal = res.list.total || 0;
@ -671,7 +767,7 @@ import { resetSelect } from '@/utils'
}))
},
planPageChange(e) {
this.plansPageIndex = e
this.plansSelect.page = e
this.getBudgets()
},
//
@ -852,6 +948,10 @@ import { resetSelect } from '@/utils'
}
}).catch(error => {})
},
created() {
this.getPlanTypes()
this.getDepartment()
}
}
</script>

@ -288,7 +288,7 @@
@delete="(row) => deleteContract(row.id)"
@editor=""
>
<template v-slot:btns>
<template v-slot:btns v-if="!/contractLedger/g.test($route.path)">
<el-table-column
fixed="right"
header-align="center"
@ -511,7 +511,7 @@
scope.row.invite_status != 1 ||
scope.row.purchase_status != 1 ||
scope.row.status === 2
)
) || (scope.row.is_substitute && scope.row.join_status === 1)
"
>
<Poptip
@ -585,6 +585,9 @@
</template>
</el-table-column>
</template>
<template #btns v-else>
<div></div>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
@ -2821,7 +2824,7 @@ export default {
},
created() {
this.getBudgets();
this.selecit.keyword = this.$route.query.keyword || "";
this.select.keyword = this.$route.query.keyword || "";
this.select.is_myself = this.$route.path.split('_')[1] ? Number(this.$route.path.split('_')[1]) : 0;
if (/contractLedger/g.test(this.$route.path)) {
this.select.is_contract = 1;

@ -154,7 +154,7 @@
</div>
</div>
</el-col>
<el-col v-if="allowAuth" :span="($store.state.user.department && $store.state.user.department.name === '中心领导') ? 7 : 8">
<el-col v-if="allowAuth" :span="authShowStatic ? 7 : 8">
<el-card class="box-card" style="margin: 20px 0">
<div class="text item">
<pie-chart :chartData="rptChartData"></pie-chart>
@ -162,7 +162,7 @@
</el-card>
</el-col>
<el-col :span="1" v-if="$store.state.user.department && $store.state.user.department.name === '中心领导'">
<el-col :span="1" v-if="authShowStatic">
<div style="display: flex;flex-direction: column;height: 310px;padding-top: 20px;">
<div class="show-static-btn" @click="$refs['budgetStatic'].show()">
统计查看
@ -939,6 +939,9 @@ export default {
},
allowAuth () {
return this.$store.state.user.min_allow_level !== 2
},
authShowStatic () {
return this.$store.state.user.myroles.find(i => i.name === "首页统计")
}
},
};

Loading…
Cancel
Save