新增合同

master
lynn 6 months ago
parent f007ae4417
commit dee24ac102

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

Loading…
Cancel
Save