新增合同

master
lynn 5 months ago
parent f007ae4417
commit dee24ac102

@ -32,9 +32,9 @@
</div>
<div>
<span style="padding: 0 6px;word-break: keep-all;">服务商/供应商</span>
<span style="padding: 0 6px;word-break: keep-all;">供应商/付款对象</span>
<span>
<Input v-model="select.supply" clearable placeholder="请输入服务商/供应商" style="width: 200px"/>
<Input v-model="select.supply" clearable placeholder="请输入供应商/付款对象" style="width: 200px"/>
</span>
</div>
@ -422,11 +422,14 @@
<!-- 新增承包商/供应商输入框 -->
<el-form-item
label="承包商/供应商"
:label="formType === 'contract' ? '承包商/供应商' : '付款对象'"
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>
:rules="[{ required: true, message: formType === 'contract' ? '请输入承包商/供应商' : '请输入付款对象', trigger: 'submit' }]"
v-show="true">
<el-input
v-model="form.supply"
:placeholder="formType === 'contract' ? '请输入承包商/供应商' : '请输入付款对象'"
></el-input>
</el-form-item>
<!-- 新增执行科室选择 -->
@ -1422,6 +1425,7 @@ export default {
},
showPaymentFormPreview: false,
previewType: '', // 'before' or 'after'
formType: 'contract', //
}
},
methods: {
@ -2103,7 +2107,8 @@ export default {
submitData.purchase_type_id = this.form.purchaseForm
submitData.purchase_way_id = this.form.purchaseMethod
submitData.plan_price = this.form.price
submitData.is_contract = this.formType === 'contract' ? 1 : 0
//
if (this.form.skipBeforeTemplate && !this.isEditMode) {
//
@ -3309,34 +3314,30 @@ export default {
this.getContracts();
},
//
async handleAddContractByCategory(category) {
// loading
async handleAddContractByCategory(type) {
this.formType = type;
this.loading = true;
try {
//
// 1. id
const userDeptId = this.$store.state.user.info.department_id;
// 2.
this.isShowAdd = true;
this.isEditMode = false;
this.isFromPayment = false;
//
await this.getCategoryOptions();
//
this.resetForm();
//
// 3.
if (userDeptId) {
this.form.contract_carry_department = [userDeptId];
}
// ......
if (this.categoryOptions && this.categoryOptions.length > 0) {
//
const categoryOption = this.categoryOptions.find(item => {
const name = item.name || item.value || '';
return name.includes(category === 'contract' ? '合同' :
category === 'reimbursement' ? '报销' : '其他支出');
return name.includes(type === 'contract' ? '合同' : type === 'reimbursement' ? '报销' : '其他支出');
});
if (categoryOption) {
this.form.category = categoryOption.id;
//
this.handleCategoryChange();
}
}
@ -3344,7 +3345,6 @@ export default {
console.error('加载数据失败:', error);
this.$message.error('加载数据失败');
} finally {
// loading
this.loading = false;
}
},

Loading…
Cancel
Save