合并
This commit is contained in:
@ -217,7 +217,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: SafetyInspectionForm = {
|
||||
id: undefined,
|
||||
pid: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
checkType: undefined,
|
||||
violationType: undefined,
|
||||
inspectionResult: undefined,
|
||||
@ -247,7 +247,7 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
|
||||
pageSize: 10,
|
||||
id: undefined,
|
||||
pid: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
checkType: undefined,
|
||||
violationType: undefined,
|
||||
inspectionResult: undefined,
|
||||
@ -286,7 +286,7 @@ const getList = async () => {
|
||||
safetyInspectionList.value = res.rows;
|
||||
total.value = res.total;
|
||||
// 获取项目班组信息
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value.id);
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
|
||||
teamList.value = teamRes.data;
|
||||
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.teamName,
|
||||
@ -367,7 +367,7 @@ const submitForm = () => {
|
||||
safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -402,7 +402,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目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