完成关联预算计划

master
lynn 1 year ago
parent dafbd181ff
commit fbddbf82cd

@ -51,6 +51,15 @@ export function getContractCategoryTemplate(params) {
})
}
// 获取合同分类模版配置参数
export function getContractCategoryTemplateConfigParams(params) {
return request({
method: 'get',
url: '/api/admin/contract-category/config',
params
})
}
// 删除合同分类模版
export function deleteContractCategoryTemplate(id) {
return request({

@ -231,11 +231,10 @@
<div class="checkbox-group">
<el-checkbox v-model="form.projectName"></el-checkbox>
<el-checkbox v-model="form.projectType"></el-checkbox>
<el-checkbox v-model="form.purchaseWay"></el-checkbox>
<el-checkbox v-model="form.budgetPrice"></el-checkbox>
</div>
<div class="checkbox-group">
<el-checkbox v-model="form.budgetPrice"></el-checkbox>
<el-checkbox v-model="form.fundChannel"></el-checkbox>
<el-checkbox v-model="form.budgetPlan"></el-checkbox>
</div>

@ -268,215 +268,188 @@
</div>
</div>
<!-- Step 1: Type Selection -->
<div v-show="currentStep === 1" class="step-content">
<div class="form-group">
<label class="form-label">分类</label>
<Select v-model="form.category" @on-change="handleCategoryChange" placeholder="请选择分类" class="form-input">
<Option v-for="item in categoryOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">事项类型</label>
<Select v-model="form.affairType" @on-change="handleAffairTypeChange" placeholder="请选择事项类型" class="form-input">
<Option v-for="item in affairTypeOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">合同类型</label>
<Select v-model="form.contractType" @on-change="handleContractTypeChange" placeholder="请选择合同类型" class="form-input">
<Option v-for="item in contractTypeOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">采购形式</label>
<Select v-model="form.purchaseForm" @on-change="handlePurchaseFormChange" placeholder="请选择采购形式" class="form-input">
<Option v-for="item in purchaseFormOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">采购方式</label>
<Select v-model="form.purchaseMethod" @on-change="handlePurchaseMethodChange" placeholder="请选择采购方式" class="form-input">
<Option v-for="item in purchaseMethodOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
<!-- Step Content -->
<div class="step-content">
<!-- Step 1: Type Selection -->
<div v-show="currentStep === 1" class="step-content">
<div class="form-group">
<label class="form-label">分类</label>
<Select v-model="form.category" @on-change="handleCategoryChange" placeholder="请选择分类" class="form-input">
<Option v-for="item in categoryOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">事项类型</label>
<Select v-model="form.affairType" @on-change="handleAffairTypeChange" placeholder="请选择事项类型" class="form-input">
<Option v-for="item in affairTypeOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">合同类型</label>
<Select v-model="form.contractType" @on-change="handleContractTypeChange" placeholder="请选择合同类型" class="form-input">
<Option v-for="item in contractTypeOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">采购形式</label>
<Select v-model="form.purchaseForm" @on-change="handlePurchaseFormChange" placeholder="请选择采购形式" class="form-input">
<Option v-for="item in purchaseFormOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="form-group">
<label class="form-label">采购方式</label>
<Select v-model="form.purchaseMethod" @on-change="handlePurchaseMethodChange" placeholder="请选择采购方式" class="form-input">
<Option v-for="item in purchaseMethodOptions" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</div>
</div>
</div>
<!-- Step 2: Basic Information -->
<div v-show="currentStep === 2" class="step-content">
<!-- 选择的合同模版类型信息 -->
<div class="template-info">
<div class="info-title">已选合同模版类型</div>
<div class="info-content">
<div class="info-item">
<span class="label">合同分类</span>
<span class="value">{{ getCategoryName(form.category) }}</span>
</div>
<div class="info-item">
<span class="label">事务类型</span>
<span class="value">{{ getAffairTypeName(form.affairType) }}</span>
</div>
<div class="info-item">
<span class="label">合同类型</span>
<span class="value">{{ getContractTypeName(form.contractType) }}</span>
</div>
<div class="info-item">
<span class="label">采购形式</span>
<span class="value">{{ getPurchaseFormName(form.purchaseForm) }}</span>
</div>
<div class="info-item">
<span class="label">采购方式</span>
<span class="value">{{ getPurchaseMethodName(form.purchaseMethod) }}</span>
<!-- Step 2: Basic Information -->
<div v-show="currentStep === 2" class="step-content">
<!-- 选择的合同模版类型信息 -->
<div class="template-info">
<div class="info-title">已选合同模版类型</div>
<div class="info-content">
<div class="info-item">
<span class="label">合同分类</span>
<span class="value">{{ getCategoryName(form.category) }}</span>
</div>
<div class="info-item">
<span class="label">事务类型</span>
<span class="value">{{ getAffairTypeName(form.affairType) }}</span>
</div>
<div class="info-item">
<span class="label">合同类型</span>
<span class="value">{{ getContractTypeName(form.contractType) }}</span>
</div>
<div class="info-item">
<span class="label">采购形式</span>
<span class="value">{{ getPurchaseFormName(form.purchaseForm) }}</span>
</div>
<div class="info-item">
<span class="label">采购方式</span>
<span class="value">{{ getPurchaseMethodName(form.purchaseMethod) }}</span>
</div>
</div>
</div>
</div>
<!-- 流程控制 -->
<div class="form-section">
<div class="section-title">流程控制</div>
<div class="process-control-grid">
<div class="control-item">
<div class="control-label">是否为简易流程</div>
<div class="control-content">
<el-radio-group v-model="form.is_simple">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<div class="helper-text">(水电煤报刊订阅网络通讯车辆使用等费用付款)</div>
<!-- 流程控制 -->
<div class="form-section">
<div class="section-title">流程控制</div>
<div class="process-control-grid">
<div class="control-item">
<div class="control-label">是否为简易流程</div>
<div class="control-content">
<el-radio-group v-model="form.is_simple">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<div class="helper-text">(水电煤报刊订阅网络通讯车辆使用等费用付款)</div>
</div>
</div>
</div>
<div class="control-item">
<div class="control-label">是否为河道处收费类项目</div>
<div class="control-content">
<el-radio-group v-model="form.has_charge">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<div class="control-item">
<div class="control-label">是否为河道处收费类项目</div>
<div class="control-content">
<el-radio-group v-model="form.has_charge">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
</div>
</div>
<div class="control-item">
<div class="control-label">是否为预算内确定项目</div>
<div class="control-content">
<el-radio-group v-model="form.isBudget">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<div class="control-item">
<div class="control-label">是否为预算内确定项目</div>
<div class="control-content">
<el-radio-group v-model="form.isBudget">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
</div>
</div>
<div class="control-item">
<div class="control-label">是否为代建项目</div>
<div class="control-content">
<el-radio-group v-model="form.is_substitute">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<div class="control-item">
<div class="control-label">是否为代建项目</div>
<div class="control-content">
<el-radio-group v-model="form.is_substitute">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
</div>
</div>
</div>
</div>
<!-- 基本信息表单 -->
<div class="form-section">
<div class="section-title">基本信息</div>
<el-form :model="form" label-width="140px" ref="basicInfoForm">
<el-form-item label="项目名称" prop="name" :rules="[{ required: true, message: '请输入项目名称', trigger: 'submit' }]" v-show="showFields.projectName">
<el-input v-model="form.name" placeholder="请输入项目名称"></el-input>
</el-form-item>
<el-form-item label="项目类型" prop="type" :rules="[{ required: true, message: '请选择项目类型', trigger: 'submit' }]" v-show="showFields.projectType">
<el-select v-model="form.type" placeholder="请选择项目类型" style="width: 100%">
<el-option v-for="item in type" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="合同预算金额(元)" prop="price" :rules="[{ required: true, message: '请输入预算金额', trigger: 'submit' }]" v-show="showFields.budgetPrice">
<el-input-number v-model="form.price" :min="0" :precision="2" :step="1000" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item label="资金渠道" prop="moneyWay" :rules="[{ required: true, message: '请选择资金渠道', trigger: 'submit' }]" v-show="showFields.fundChannel">
<el-select v-model="form.moneyWay" placeholder="请选择资金渠道" style="width: 100%">
<el-option v-for="item in moneyWay" :key="item.id" :label="item.value" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="关联预算计划" prop="plan" v-show="showFields.budgetPlan">
<div class="plan-selector">
<el-input
v-model="form.plan_display"
placeholder="请选择预算计划"
readonly
class="plan-input"
@focus="showPlanForSearch('modal')">
</el-input>
<div class="plan-tags" v-if="form.plan && form.plan.length > 0">
<el-tag
v-for="item in form.plan"
:key="item.id"
closable
@close="removePlan(item)">
{{ item.name }}
</el-tag>
<!-- 基本信息表单 -->
<div class="form-section">
<div class="section-title">基本信息</div>
<el-form :model="form" label-width="140px" ref="basicInfoForm">
<el-form-item label="项目名称" prop="name" :rules="[{ required: true, message: '请输入项目名称', trigger: 'submit' }]" v-show="showFields.projectName">
<el-input v-model="form.name" placeholder="请输入项目名称"></el-input>
</el-form-item>
<el-form-item label="项目类型" prop="type" :rules="[{ required: true, message: '请选择项目类型', trigger: 'submit' }]" v-show="showFields.projectType">
<el-select v-model="form.type" placeholder="请选择项目类型" style="width: 100%">
<el-option v-for="item in type" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="合同预算金额(元)" prop="price" :rules="[{ required: true, message: '请输入预算金额', trigger: 'submit' }]" v-show="showFields.budgetPrice">
<el-input-number v-model="form.price" :min="0" :precision="2" :step="1000" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item label="资金渠道" prop="moneyWay" :rules="[{ required: true, message: '请选择资金渠道', trigger: 'submit' }]" v-show="showFields.fundChannel">
<el-select v-model="form.moneyWay" placeholder="请选择资金渠道" style="width: 100%">
<el-option v-for="item in moneyWay" :key="item.id" :label="item.value" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="关联预算计划" prop="plan" v-show="showFields.budgetPlan" :rules="[{ required: true, message: '请选择关联预算计划', trigger: 'change' }]">
<div class="plan-selector">
<el-input
v-model="form.plan_display"
placeholder="请选择预算计划"
readonly
class="plan-input"
@focus="showPlanForSearch('modal')">
</el-input>
<div class="plan-tags" v-if="form.plan && form.plan.length > 0">
<el-tag
v-for="item in form.plan"
:key="item.id"
closable
@close="removePlan(item)">
{{ item.label }}
</el-tag>
</div>
</div>
</div>
</el-form-item>
</el-form>
</el-form-item>
</el-form>
</div>
</div>
</div>
<!-- Step 3: Attachment Information -->
<div v-show="currentStep === 3" class="step-content">
<div class="form-group">
<label class="form-label">部门</label>
<Input v-model="form.department" placeholder="请输入部门" class="form-input" />
</div>
<div class="form-group">
<label class="form-label">员工姓名</label>
<Input v-model="form.employee_name" placeholder="请输入员工姓名" class="form-input" />
</div>
<div class="form-group">
<label class="form-label">就业状态</label>
<Input v-model="form.employment_status" placeholder="请输入就业状态" class="form-input" />
</div>
<div class="form-group">
<label class="form-label">家属姓名</label>
<Input v-model="form.family_name" placeholder="请输入家属姓名" class="form-input" />
</div>
<div class="form-group">
<label class="form-label">关系</label>
<Input v-model="form.relationship" placeholder="请输入关系" class="form-input" />
</div>
<div class="form-group">
<label class="form-label">费用明细</label>
<table class="expense-table">
<thead>
<tr>
<th>内容</th>
<th>金额</th>
<th>比例</th>
<th>收款人</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in form.expenses" :key="index">
<td><Input v-model="item.content" /></td>
<td><Input v-model="item.amount" type="number" /></td>
<td><Input v-model="item.ratio" /></td>
<td><Input v-model="item.payee" /></td>
</tr>
</tbody>
</table>
<!-- Step 3: Attachment Information -->
<div v-show="currentStep === 3" class="step-content">
<!-- 事前支付表格 -->
<div v-if="form.before_contract_template" class="form-section">
<div class="section-title">事前支付表格</div>
<div v-html="form.before_contract_template.template"></div>
</div>
<!-- 事后支付表格 -->
<div v-else-if="form.contract_template" class="form-section">
<div class="section-title">事后支付表格</div>
<div v-html="form.contract_template.template"></div>
</div>
</div>
</div>
<!-- Navigation Buttons -->
<div class="step-actions">
<Button v-if="currentStep > 1" @click="prevStep" class="action-button"></Button>
<Button v-if="currentStep < 3" type="primary" @click="nextStep" class="action-button"></Button>
<Button v-if="currentStep === 3" type="primary" @click="submit" class="action-button"></Button>
<Button @click="cancel" class="action-button">取消</Button>
<div slot="footer">
<div class="modal-footer">
<Button v-if="currentStep > 1" @click="prevStep" class="action-button"></Button>
<Button v-if="currentStep < 3" type="primary" @click="nextStep" class="action-button"></Button>
<Button v-if="currentStep === 3" type="primary" @click="submit" class="action-button"></Button>
<Button @click="cancel" class="action-button">取消</Button>
</div>
</div>
</Modal>
@ -485,28 +458,61 @@
<template v-slot:normalContent>
<Input v-model="planSearch.name" search enter-button=" " placeholder="搜索预算计划.."
@on-search="searchBudgets"/>
<div style="margin: 10px 0;display: flex;justify-content: space-between;
align-items: center;">
<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>
<el-link type="success" @click="clearSelectForSearch"></el-link>
</div>
<xy-table :list="plans" @rowClick="selectPlanForSearch" :show-index="false" :table-item="planTableSearch"
:height="310" style="margin-top: 10px;" ref="singlePlanTable">
<template v-slot:btns>
<el-table-column label="使用金额" header-align="center" v-if="planSource === 'modal'">
<template slot-scope="scope">
<Input :value="scope.row.useMoney" @input="planInput($event, scope.row)" />
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="planTotal" show-elevator @on-change="planPageChange"/>
</div>
<el-tag type="warning">点击行进行选择</el-tag>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="planSelectForSearch"></Button>
</template>
</xy-dialog>
<!-- 新增表 预算计划 -->
<xy-dialog :is-show.sync="isShowPlan" :width="720" title="预算计划" @on-ok="planSelect">
<template v-slot:normalContent>
<div style="display: flex;">
<el-select placeholder="科室选择" clearable size="small" v-model="planSearch.plan_department_id"
style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
<Input v-model="planSearch.name" enter-button=" " placeholder="搜索预算计划.." search
@on-search="searchBudgets"/>
</div>
<xy-table ref="planTable" :height="300" :list="plans" :show-index="false" :table-item="planTable"
style="margin-top: 10px;" @select="selectPlan">
<template v-slot:btns>
<el-table-column header-align="center" label="使用金额" fixed="right" width="140">
<template slot-scope="scope">
<Input :value="scope.row.useMoney" @input="planInput($event,scope.row)"/>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="planTotal" show-elevator @on-change="planPageChange"/>
</div>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="confirmPlanForSearch"></Button>
<Button type="primary" @click="isShowPlan = false"></Button>
</template>
</xy-dialog>
@ -1204,6 +1210,7 @@ export default {
{ label: '工程合同', value: 'project' },
{ label: '服务合同', value: 'service' }
],
plan: [], //
}
},
methods: {
@ -1234,10 +1241,7 @@ export default {
row.useMoney = 0
return
}
let money = Number(row.update_money) == 0 ? Number(row.money) : Number(row.update_money);
console.log(e, money, row.use_money_total)
console.log(e <= (money - Number(row.use_money_total)))
if (e <= (money - Number(row.use_money_total))) {
if (e <= (Number(row.money) - Number(row.use_money_total))) {
row.useMoney = e
this.plan.forEach(item => {
if (item.value.plan_id == row.id) {
@ -1620,32 +1624,68 @@ export default {
this.isShowPlan = true
await this.getBudgets()
},
async showPlanForSearch(search='search') {
console.log("sdfsdfsdfsdfsfsfsd:"+search)
this.planSource = search
this.isShowPlanForSearch = true
await this.getBudgets();
},
//
selectPlanForSearch(sel) {
console.log(sel)
if (this.planSource === 'search') {
if (sel) {
this.select.plan_id = sel.id;
this.select.plan_name = sel.name;
} else {
this.select.plan_id = "";
this.select.plan_name = "";
}
showPlanForSearch(source) {
this.planSource = source
this.isShowPlan = true
this.getBudgets()
// plan
if (source === 'modal') {
this.plan = this.form.plan || []
} else {
this.plan = []
}
},
selectPlanForSearch(sel, row) {
if (this.planSource === 'modal') {
if (sel) {
this.form.plan_display = sel.name;
let select = sel.map(item => {
let 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.form.plan_display = "";
this.plan = this.form.plan
//
this.form.plan_display = this.plan.map(item => item.label).join(', ')
}
} else {
this.select.plan_name = row.name
this.select.plan_id = row.id
}
},
planSelectForSearch() {
if (this.plan.length === 0) {
Message({
type: 'warning',
message: '选择计划不能为空'
})
return
}
for (let 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
},
//
selectPlan(sel, row) {
console.log(sel)
@ -1660,87 +1700,49 @@ export default {
}
}
})
//
if (sel.filter(plan => {
return plan.id == row.id
}).length == 0) {
this.delPlan({
value: {
plan_id: row.id
}
})
}
let _plan = JSON.parse(JSON.stringify(this.plan));
var _select = [];
select.map(item => {
if (_plan.filter(plan => {
return plan.value.plan_id == item.value.plan_id
}).length == 0) {
_select.push(item)
}
});
this.plan = [..._plan, ..._select]
this.plan = [...this.form.plan, ...select]
} else {
this.plan = []
this.plan = this.form.plan
}
},
//
planSelect() {
const selectedRows = this.$refs.planTable.getSelection()
if (!selectedRows || selectedRows.length === 0) {
this.$Message.warning('请选择至少一个预算计划')
if (this.plan.length === 0) {
Message({
type: 'warning',
message: '选择计划不能为空'
})
return
}
//
this.form.plan = selectedRows.map(item => ({
id: item.id,
name: item.name,
money: item.money,
useMoney: item.useMoney || 0
}))
//
this.updatePlanDisplay()
//
for (let 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
},
delPlan(val) {
this.form.plan.map((item, index) => {
if (item.value.plan_id === val.value.plan_id) {
this.form.plan.splice(index, 1)
}
})
this.plan.map((item, index) => {
if (item.value.plan_id === val.value.plan_id) {
this.plan.splice(index, 1)
}
})
},
//
planSelectForSearch() {
// if (this.select.plan_id == "") {
// Message({
// type: 'warning',
// message: ''
// })
// return
// }
this.isShowPlanForSearch = false
this.form.plan = this.form.plan.filter(item => item.value.plan_id !== val.value.plan_id)
},
//
toggleSelection(plans, type) {
toggleSelection(plans) {
if (plans) {
this.plans.filter(plan => {
if (plans.includes(plan.id)) {
plan.useMoney = this.plan[plans.indexOf(plan.id)].value.use_money
let selectedPlan = this.plan.find(item => item.value.plan_id === plan.id)
if (selectedPlan) {
plan.useMoney = selectedPlan.value.use_money
}
return true
}
}).map(row => {
@ -1888,7 +1890,22 @@ export default {
},
nextStep() {
if (this.validateCurrentStep()) {
//
if (this.currentStep === 2) {
this.$refs.basicInfoForm.validate((valid) => {
if (valid) {
//
if (this.showFields.budgetPlan && (!this.form.plan || this.form.plan.length === 0)) {
Message({
type: 'warning',
message: '请选择关联预算计划'
})
return
}
this.currentStep++
}
})
} else {
this.currentStep++
}
},
@ -1961,6 +1978,14 @@ export default {
fundChannel: config.fund_channel === 1, //
budgetPlan: config.budget_plan === 1 //
})
//
if (config.before_contract_template) {
this.form.before_contract_template = config.before_contract_template
}
if (config.contract_template) {
this.form.contract_template = config.contract_template
}
},
handleAddContract() {
@ -1972,26 +1997,16 @@ export default {
},
handleAddContractOk() {
if (this.currentStep < 2) {
//
if (this.validateCurrentStep()) {
this.currentStep++;
}
} else {
//
if (this.validateCurrentStep()) {
this.submit()
}
}
// nextStep submit
},
handleAddContractCancel() {
this.resetForm()
this.isShowAdd = false
// cancel
},
cancel() {
this.handleAddContractCancel()
this.isShowAdd = false
this.resetForm()
},
resetForm() {
@ -2183,18 +2198,13 @@ export default {
}
},
//
removePlan(plan) {
const index = this.form.plan.findIndex(item => item.id === plan.id)
if (index !== -1) {
this.form.plan.splice(index, 1)
//
if (this.form.plan && this.form.plan.length > 0) {
this.form.plan_display = `已选择 ${this.form.plan.length} 个预算计划`
} else {
this.form.plan_display = ''
}
}
removePlan(item) {
// plan
this.plan = this.plan.filter(p => p.value.plan_id !== item.value.plan_id)
// form.plan
this.form.plan = this.form.plan.filter(p => p.value.plan_id !== item.value.plan_id)
//
this.form.plan_display = this.plan.map(p => p.label).join(', ')
},
},
mounted() {
@ -2581,4 +2591,15 @@ export default {
height: 400px;
overflow-y: auto;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
padding: 10px 0;
.action-button {
min-width: 100px;
}
}
</style>

Loading…
Cancel
Save