This commit is contained in:
Teo
2025-08-14 01:58:00 +08:00
parent 606722f19e
commit 3158dc84f7
99 changed files with 620 additions and 554 deletions

View File

@ -155,7 +155,7 @@ const initFormData: ContractorForm = {
contractorType: undefined,
fileMap: undefined,
remark: undefined,
projectId: currentProject.value.id
projectId: currentProject.value?.id
};
const data = reactive<PageData<ContractorForm, ContractorQuery>>({
form: { ...initFormData },
@ -170,7 +170,7 @@ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
custodian: undefined,
custodianPhone: undefined,
contractorType: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
params: {}
},
rules: {
@ -255,7 +255,7 @@ const handleUpdate = async (row?: ContractorVO) => {
const submitForm = () => {
contractorFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
form.value.projectId = currentProject.value.id;
form.value.projectId = currentProject.value?.id;
buttonLoading.value = true;
if (form.value.id) {
await updateContractor(form.value).finally(() => (buttonLoading.value = false));
@ -299,7 +299,7 @@ const handleContractorFile = (row?: ContractorVO) => {
};
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;