完成新建合同的各个表单字段核对

master
lynn 8 months ago
parent e9ea05bbab
commit dc3e42a89a

@ -308,7 +308,7 @@
<div v-show="currentStep === 2" class="step-content">
<!-- 选择的合同模版类型信息 -->
<div class="template-info">
<div class="info-title">已选合同模版类型</div>
<div class="info-title">合同类型</div>
<div class="info-content">
<div class="info-item">
<span class="label">合同分类</span>
@ -335,7 +335,7 @@
<!-- 流程控制 -->
<div class="form-section">
<div class="section-title">流程控制</div>
<div class="section-title">合同配置</div>
<div class="process-control-grid">
<div class="control-item">
<div class="control-label">是否为简易流程</div>
@ -394,14 +394,74 @@
</el-select>
</el-form-item>
<!-- 新增承包商/供应商输入框 -->
<el-form-item
label="承包商/供应商"
prop="supply"
:rules="[{ required: form.is_simple === 1, message: '请输入承包商/供应商', trigger: 'submit' }]"
v-show="form.is_simple === 1">
<el-input v-model="form.supply" placeholder="请输入承包商/供应商"></el-input>
</el-form-item>
<!-- 新增执行科室选择 -->
<el-form-item label="执行科室" prop="contract_carry_department" :rules="[{ required: true, message: '请选择执行科室', trigger: 'submit' }]">
<div class="department-selector">
<el-select
v-model="form.contract_carry_department"
placeholder="请选择执行科室"
style="width: 100%"
multiple
collapse-tags
@remove-tag="removeDepartment">
<el-option
v-for="item in departments"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<div class="department-tags" v-if="form.contract_carry_department && form.contract_carry_department.length > 0">
<el-tag
v-for="id in form.contract_carry_department"
:key="id"
closable
@close="removeDepartment(id)">
{{ getDepartmentName(id) }}
</el-tag>
</div>
</div>
</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>
<div class="money-way-selector">
<el-select
v-model="form.moneyWay"
placeholder="请选择资金渠道"
style="width: 100%"
multiple
collapse-tags
@remove-tag="removeMoneyWay">
<el-option
v-for="item in moneyWay"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
<div class="money-way-tags" v-if="form.moneyWay && form.moneyWay.length > 0">
<el-tag
v-for="id in form.moneyWay"
:key="id"
closable
@close="removeMoneyWay(id)">
{{ getMoneyWayName(id) }}
</el-tag>
</div>
</div>
</el-form-item>
<el-form-item label="关联预算计划" prop="plan" v-show="showFields.budgetPlan" :rules="[{ required: true, message: '请选择关联预算计划', trigger: 'change' }]">
@ -436,10 +496,15 @@
<div v-html="form.before_contract_template.template"></div>
</div>
<!-- 事后支付表格 -->
<div v-else-if="form.contract_template && form.showAfterPayment" class="form-section">
<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 v-else class="form-section">
<div class="section-title">无支付表格</div>
<div class="no-payment-form">当前选择的合同类型没有配置支付表格</div>
</div>
</div>
</div>
@ -447,8 +512,10 @@
<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 && form.before_contract_template && !form.showAfterPayment" type="primary" @click="nextPaymentStep" class="action-button"></Button>
<Button v-if="currentStep === 3 && form.contract_template && form.showAfterPayment" type="primary" @click="submit" class="action-button"></Button>
<!-- 当显示事后支付表格或没有事前支付表格时显示"提交"按钮 -->
<Button v-if="currentStep === 3 && (form.showAfterPayment || !form.before_contract_template)" type="primary" @click="submit" class="action-button"></Button>
<Button @click="cancel" class="action-button">取消</Button>
</div>
</div>
@ -1160,7 +1227,7 @@ export default {
purchaseMethod: '',
name: '',
type: '', //
moneyWay: '',
moneyWay: [],
plan: [],
plan_display: '', //
price: 0,
@ -1182,7 +1249,9 @@ export default {
ratio: '',
payee: ''
}
]
],
showAfterPayment: false, //
contract_carry_department: [] //
},
categoryOptions: [],
purchaseMethodsMap: {},
@ -1762,8 +1831,8 @@ export default {
type: this.form.type,
is_plan: this.form.isBudget ? 1 : 0,
purchase_type_id: this.form.purchaseForm, // 使 purchaseForm methods
purchase_way_id: this.form.modality,
money_way_id: `${this.form.moneyWay.toString()}`,
purchase_way_id: this.form.purchaseMethod,
money_way_id: this.form.moneyWay.toString(), //
plan_price: this.form.price,
name: this.form.name,
contract_plan_links: this.form.plan.map(item => {
@ -1892,10 +1961,10 @@ export default {
nextStep() {
//
if (this.currentStep === 1) {
//
if (!this.form.category || !this.form.affairType || !this.form.contractType ||
!this.form.purchaseForm || !this.form.purchaseMethod) {
this.$Message.warning('请填写所有必填项')
//
if (!this.form.category && !this.form.affairType && !this.form.contractType &&
!this.form.purchaseForm && !this.form.purchaseMethod) {
this.$Message.warning('请至少选择一个选项')
return
}
//
@ -1958,10 +2027,10 @@ export default {
async getTemplateConfig() {
try {
const params = {
category: this.form.category,
work_type: this.form.affairType,
contract_type: this.form.contractType,
purchase_form: this.form.purchaseForm
category: this.form.category || 0,
work_type: this.form.affairType || 0,
contract_type: this.form.contractType || 0,
purchase_form: this.form.purchaseForm || 0
}
console.log('请求模版配置参数:', params)
@ -2038,11 +2107,11 @@ export default {
purchaseMethod: '',
name: '',
type: '', //
money_way_id: '',
moneyWay: [],
plan: [],
plan_display: '', //
price: 0,
supply: '',
supply: '', // /
//
is_simple: 0, //
has_charge: 0, //
@ -2061,7 +2130,8 @@ export default {
payee: ''
}
],
showAfterPayment: false //
showAfterPayment: false, //
contract_carry_department: [] //
}
this.affairTypeOptions = []
@ -2229,6 +2299,27 @@ export default {
nextPaymentStep() {
this.form.showAfterPayment = true
},
//
getMoneyWayName(id) {
const way = this.moneyWay.find(item => item.id === id)
return way ? way.value : ''
},
//
removeMoneyWay(id) {
this.form.moneyWay = this.form.moneyWay.filter(item => item !== id)
},
//
getDepartmentName(id) {
const dept = this.departments.find(item => item.id === id)
return dept ? dept.name : ''
},
//
removeDepartment(id) {
this.form.contract_carry_department = this.form.contract_carry_department.filter(item => item !== id)
},
},
mounted() {
this.window.width = screen.availWidth * 0.95
@ -2625,4 +2716,43 @@ export default {
min-width: 100px;
}
}
.no-payment-form {
padding: 20px;
text-align: center;
color: #909399;
font-size: 14px;
background-color: #f5f7fa;
border-radius: 4px;
}
.money-way-selector {
width: 100%;
.money-way-tags {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 8px;
.el-tag {
margin-right: 0;
}
}
}
.department-selector {
width: 100%;
.department-tags {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 8px;
.el-tag {
margin-right: 0;
}
}
}
</style>

Loading…
Cancel
Save