|
|
|
|
@ -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>
|
|
|
|
|
|