合并
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user