|
|
|
|
@ -199,7 +199,6 @@
|
|
|
|
|
:table-item="table"
|
|
|
|
|
@cellClick="showPaymentPlan"
|
|
|
|
|
@delete="(row)=>deleteContract(row.id)"
|
|
|
|
|
@editor=""
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column fixed="right" header-align="center" label="操作" width="200">
|
|
|
|
|
@ -643,16 +642,50 @@
|
|
|
|
|
<!-- 搜索使用 预算计划 -->
|
|
|
|
|
<xy-dialog :is-show.sync="isShowPlanForSearch" title="预算计划" :width="720" @on-ok="planSelectForSearch">
|
|
|
|
|
<template v-slot:normalContent>
|
|
|
|
|
<Input
|
|
|
|
|
v-model="planSearch.name"
|
|
|
|
|
search
|
|
|
|
|
enter-button="搜 索"
|
|
|
|
|
placeholder="搜索预算计划.."
|
|
|
|
|
@on-search="searchBudgets"
|
|
|
|
|
/>
|
|
|
|
|
<div class="search-controls">
|
|
|
|
|
<Input
|
|
|
|
|
v-model="planSearch.name"
|
|
|
|
|
search
|
|
|
|
|
enter-button="搜 索"
|
|
|
|
|
placeholder="搜索预算计划名称"
|
|
|
|
|
style="width: 300px; margin-right: 10px"
|
|
|
|
|
@on-search="searchBudgets"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
v-model="planSearch.plan_department_id"
|
|
|
|
|
placeholder="选择部门"
|
|
|
|
|
style="width: 200px; margin-right: 10px"
|
|
|
|
|
clearable
|
|
|
|
|
@on-change="searchBudgets"
|
|
|
|
|
>
|
|
|
|
|
<Option
|
|
|
|
|
v-for="dept in departments"
|
|
|
|
|
:key="dept.id"
|
|
|
|
|
:value="dept.id"
|
|
|
|
|
>
|
|
|
|
|
{{ dept.name }}
|
|
|
|
|
</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
<Select
|
|
|
|
|
v-model="planSearch.year"
|
|
|
|
|
placeholder="选择年份"
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
clearable
|
|
|
|
|
@on-change="searchBudgets"
|
|
|
|
|
>
|
|
|
|
|
<Option
|
|
|
|
|
v-for="year in availableYears"
|
|
|
|
|
:key="year"
|
|
|
|
|
:value="year"
|
|
|
|
|
>
|
|
|
|
|
{{ year }}
|
|
|
|
|
</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin: 10px 0;display: flex;justify-content: space-between;align-items: center;">
|
|
|
|
|
<div v-if="planSource === 'search'">已选择:<span style="margin-right:10px">{{ select.plan_name }}</span></div>
|
|
|
|
|
<div v-if="planSource === 'modal'">已选择:<span style="margin-right:10px">{{ form.plan_display }}</span></div>
|
|
|
|
|
<div>已选择:<span style="margin-right:10px; color: #409EFF; font-weight: 500;">{{ select.plan_name || '未选择' }}</span></div>
|
|
|
|
|
<el-link type="success" @click="clearSelectForSearch">清空选择</el-link>
|
|
|
|
|
</div>
|
|
|
|
|
<xy-table
|
|
|
|
|
@ -665,11 +698,8 @@
|
|
|
|
|
@rowClick="selectPlanForSearch"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column v-if="planSource === 'modal'" label="使用金额" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Input :value="scope.row.useMoney" @input="planInput($event, scope.row)" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
<div style="display: flex;justify-content: flex-end;">
|
|
|
|
|
@ -994,7 +1024,7 @@ export default {
|
|
|
|
|
request: true,
|
|
|
|
|
purchaseApproval: true,
|
|
|
|
|
tenderReview: true,
|
|
|
|
|
contractSign: true
|
|
|
|
|
contractSign: true
|
|
|
|
|
},
|
|
|
|
|
planSource: 'search',
|
|
|
|
|
isShowPlanForSearch: false,
|
|
|
|
|
@ -1553,9 +1583,11 @@ export default {
|
|
|
|
|
plans: [], // 预算数据
|
|
|
|
|
planSearch: {
|
|
|
|
|
name: '',
|
|
|
|
|
plan_department_id: [], // 修改为数组类型
|
|
|
|
|
plan_department_id: '', // 搜索时使用单选
|
|
|
|
|
year: (new Date().getFullYear() )+ ''
|
|
|
|
|
},
|
|
|
|
|
// 可用年份列表
|
|
|
|
|
availableYears: [],
|
|
|
|
|
planTotal: 0,
|
|
|
|
|
plansPageIndex: 1,
|
|
|
|
|
|
|
|
|
|
@ -1607,6 +1639,7 @@ export default {
|
|
|
|
|
this.getDepartment(-1)
|
|
|
|
|
this.getPurchaseWay()
|
|
|
|
|
this.getMoneyWay()
|
|
|
|
|
this.initAvailableYears()
|
|
|
|
|
|
|
|
|
|
// 页面激活后刷新合同列表
|
|
|
|
|
window.onfocus = () => {
|
|
|
|
|
@ -1625,7 +1658,16 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
clearSelectForSearch() {
|
|
|
|
|
this.select.plan_id = ''
|
|
|
|
|
this.select.plan_name = '请选择预算计划'
|
|
|
|
|
this.select.plan_name = ''
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 初始化可用年份列表
|
|
|
|
|
initAvailableYears() {
|
|
|
|
|
const currentYear = new Date().getFullYear()
|
|
|
|
|
this.availableYears = []
|
|
|
|
|
for (let i = currentYear - 5; i <= currentYear + 2; i++) {
|
|
|
|
|
this.availableYears.push(i)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getPlanTypes() {
|
|
|
|
|
const res = await getparameter({
|
|
|
|
|
@ -1946,27 +1988,16 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 获取预算计划
|
|
|
|
|
async getBudgets() {
|
|
|
|
|
if (this.form.contract_carry_department && this.form.contract_carry_department.length > 0) {
|
|
|
|
|
// 使用所有已选择的科室ID
|
|
|
|
|
this.planSearch.plan_department_id = this.form.contract_carry_department
|
|
|
|
|
}
|
|
|
|
|
console.log('科室选择:', this.planSearch.plan_department_id)
|
|
|
|
|
const res = await getBudget({
|
|
|
|
|
name: this.planSearch.name,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
page: this.plansPageIndex,
|
|
|
|
|
plan_department_id: this.planSearch.plan_department_id,
|
|
|
|
|
top_pid: 1,
|
|
|
|
|
year:this.planSearch.year
|
|
|
|
|
|
|
|
|
|
year: this.planSearch.year
|
|
|
|
|
})
|
|
|
|
|
this.plans = res.list.data
|
|
|
|
|
|
|
|
|
|
this.planTotal = res.list.total
|
|
|
|
|
|
|
|
|
|
this.toggleSelection(this.plan.map(item => {
|
|
|
|
|
return item.value.plan_id
|
|
|
|
|
}), 1)
|
|
|
|
|
},
|
|
|
|
|
// 获取资金渠道
|
|
|
|
|
async getMoneyWay() {
|
|
|
|
|
@ -2074,67 +2105,29 @@ export default {
|
|
|
|
|
this.isShowPlan = true
|
|
|
|
|
await this.getBudgets()
|
|
|
|
|
},
|
|
|
|
|
showPlanForSearch(source) {
|
|
|
|
|
this.planSource = source
|
|
|
|
|
this.isShowPlan = true
|
|
|
|
|
showPlanForSearch() {
|
|
|
|
|
this.isShowPlanForSearch = true
|
|
|
|
|
this.getBudgets()
|
|
|
|
|
// 初始化 plan 数组
|
|
|
|
|
if (source === 'modal') {
|
|
|
|
|
this.plan = this.form.plan || []
|
|
|
|
|
} else {
|
|
|
|
|
this.plan = []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
selectPlanForSearch(sel, row) {
|
|
|
|
|
if (this.planSource === 'modal') {
|
|
|
|
|
if (sel) {
|
|
|
|
|
const select = sel.map(item => {
|
|
|
|
|
const plan = this.plans.find(p => p.id === item.id)
|
|
|
|
|
return {
|
|
|
|
|
label: plan.name,
|
|
|
|
|
value: {
|
|
|
|
|
plan_id: plan.id,
|
|
|
|
|
use_money: plan.useMoney || 0,
|
|
|
|
|
new_money: plan.money
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.plan = [...this.form.plan, ...select]
|
|
|
|
|
// 更新显示文本,显示所有已选择的计划
|
|
|
|
|
this.form.plan_display = this.plan.map(item => item.label).join(', ')
|
|
|
|
|
} else {
|
|
|
|
|
this.plan = this.form.plan
|
|
|
|
|
// 更新显示文本,显示所有已选择的计划
|
|
|
|
|
this.form.plan_display = this.plan.map(item => item.label).join(', ')
|
|
|
|
|
}
|
|
|
|
|
console.log(sel,row)
|
|
|
|
|
if (sel) {
|
|
|
|
|
this.select.plan_name = '[' + sel.year + '] - ' + sel.name
|
|
|
|
|
this.select.plan_id = sel.id
|
|
|
|
|
} else {
|
|
|
|
|
this.select.plan_name = row.name
|
|
|
|
|
this.select.plan_id = row.id
|
|
|
|
|
this.select.plan_id = ''
|
|
|
|
|
this.select.plan_name = ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
planSelectForSearch() {
|
|
|
|
|
if (this.plan.length === 0) {
|
|
|
|
|
if (!this.select.plan_id) {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '选择计划不能为空'
|
|
|
|
|
message: '请选择预算计划'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
for (const item of this.plan) {
|
|
|
|
|
if (!item.value.use_money) {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '金额不能为空'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 设置表单数据
|
|
|
|
|
this.form.plan = this.plan
|
|
|
|
|
// 设置显示文本
|
|
|
|
|
this.form.plan_display = this.plan.map(item => item.label).join(', ')
|
|
|
|
|
// 关闭对话框
|
|
|
|
|
this.isShowPlan = false
|
|
|
|
|
this.isShowPlanForSearch = false
|
|
|
|
|
},
|
|
|
|
|
// 选择计划
|
|
|
|
|
selectPlan(sel, row) {
|
|
|
|
|
@ -4039,4 +4032,16 @@ export default {
|
|
|
|
|
.payment-preview-modal {
|
|
|
|
|
z-index: 4000 !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-controls {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
background-color: #f8f9fa;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|