fix(purchase): 修复合同流程状态判断问题
- 将 contractFlowStatus 从独立 ref 改为 form 对象中的属性 - 确保通过 v-model 传递时状态正确同步 - 更新所有判断条件使用 form.contractFlowStatus
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<span>正在查询合同...</span>
|
||||
</div>
|
||||
|
||||
<div v-else-if="form.hasContract === '1' && contractFlowStatus === '1'" class="contract-card success">
|
||||
<div v-else-if="form.hasContract === '1' && form.contractFlowStatus === '1'" class="contract-card success">
|
||||
<div class="contract-card-header">
|
||||
<el-icon><CircleCheckFilled /></el-icon>
|
||||
<span>已签订合同</span>
|
||||
@@ -55,7 +55,7 @@
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-alert v-else-if="form.hasContract === '1' && contractFlowStatus !== '1'" type="error" :closable="false" show-icon class="mb20">
|
||||
<el-alert v-else-if="form.hasContract === '1' && form.contractFlowStatus !== '1'" type="error" :closable="false" show-icon class="mb20">
|
||||
<template #title>
|
||||
<span>合同正在流程审批中,无法进行履约操作</span>
|
||||
</template>
|
||||
@@ -175,7 +175,6 @@ const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const contractLoading = ref(false);
|
||||
const contractFlowStatus = ref('');
|
||||
|
||||
const purchaserOptions = ref<any[]>([]);
|
||||
const purchaserLoading = ref(false);
|
||||
@@ -189,6 +188,7 @@ const form = reactive({
|
||||
contractName: '',
|
||||
contractNo: '',
|
||||
contractMoney: null as number | null,
|
||||
contractFlowStatus: '',
|
||||
isInstallment: '0',
|
||||
totalPhases: 1,
|
||||
projectName: '',
|
||||
@@ -202,7 +202,7 @@ const form = reactive({
|
||||
});
|
||||
|
||||
const canEdit = computed(() => {
|
||||
return form.hasContract !== '1' || contractFlowStatus.value === '1';
|
||||
return form.hasContract !== '1' || form.contractFlowStatus === '1';
|
||||
});
|
||||
|
||||
const syncFormFromModel = (val: Record<string, any> | undefined) => {
|
||||
@@ -212,7 +212,7 @@ const syncFormFromModel = (val: Record<string, any> | undefined) => {
|
||||
form.contractName = val.contractName || '';
|
||||
form.contractNo = val.contractNo || '';
|
||||
form.contractMoney = val.contractMoney || null;
|
||||
contractFlowStatus.value = val.contractFlowStatus || '';
|
||||
form.contractFlowStatus = val.contractFlowStatus || '';
|
||||
form.isInstallment = val.isInstallment || '0';
|
||||
form.totalPhases = val.totalPhases || 1;
|
||||
form.supplierName = val.supplierName || '';
|
||||
@@ -323,7 +323,7 @@ const rules: FormRules = {
|
||||
};
|
||||
|
||||
const validate = async () => {
|
||||
if (form.hasContract === '1' && contractFlowStatus.value !== '1') {
|
||||
if (form.hasContract === '1' && form.contractFlowStatus !== '1') {
|
||||
useMessage().error('合同正在流程审批中,无法进行履约操作');
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user