@@ -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;
+ }
+
+
+
diff --git a/src/views/contract/paymentRegistrationList.vue b/src/views/contract/paymentRegistrationList.vue
index 9a07116..55d953b 100644
--- a/src/views/contract/paymentRegistrationList.vue
+++ b/src/views/contract/paymentRegistrationList.vue
@@ -213,6 +213,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 已选择:{{
+ select.plan_name
+ }}
+
+
清空选择
+
+
+
+
+
+
+ 点击行进行选择
+
+
+
+
+
+