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

@ -198,7 +198,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ConstructionSchedulePlanForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
parentId: undefined,
nodeName: undefined,
projectStructure: undefined,
@ -213,7 +213,7 @@ const initFormData: ConstructionSchedulePlanForm = {
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
form: { ...initFormData },
queryParams: {
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
parentId: undefined,
nodeName: undefined,
status: undefined,
@ -348,7 +348,7 @@ onMounted(() => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -245,7 +245,7 @@ const initFormData: ProgressCategoryForm = {
name: undefined,
matrixId: undefined,
unitType: undefined,
projectId: currentProject.value.id
projectId: currentProject.value?.id
};
const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
@ -254,7 +254,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
pid: undefined,
name: undefined,
unitType: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
matrixId: undefined,
params: {}
},
@ -272,7 +272,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询进度类别列表 */
const getList = async () => {
if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id);
const res = await getProjectSquare(currentProject.value?.id);
if (!res.data || res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else {
@ -424,7 +424,7 @@ onMounted(() => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -161,7 +161,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ProgressCategoryForm = {
id: undefined,
parentId: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
matrixId: undefined,
matrixName: undefined,
name: undefined,
@ -182,7 +182,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
form: { ...initFormData },
queryParams: {
parentId: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
matrixId: undefined,
matrixName: undefined,
name: undefined,
@ -217,7 +217,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询分项工程单价列表 */
const getList = async () => {
if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id);
const res = await getProjectSquare(currentProject.value?.id);
if (res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else {
@ -367,7 +367,7 @@ onMounted(() => {
});
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -309,7 +309,7 @@ const handleDelete = async (row: ProgressCategoryTemplateVO) => {
* 获取子项目列表
*/
const getSubProjectList = async () => {
const res = await getChildProject(currentProject.value.id);
const res = await getChildProject(currentProject.value?.id);
projectSon.value = res.data;
queryParams.value.projectId = projectSon.value[0]?.id;
getList();

View File

@ -97,7 +97,7 @@ const queryParams = ref({
pid: undefined,
name: undefined,
unitType: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
matrixId: undefined,
params: {}
});
@ -382,7 +382,7 @@ const resetMatrix = () => {
/** 查询进度类别列表 */
const getList = async () => {
if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id);
const res = await getProjectSquare(currentProject.value?.id);
if (res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else {
@ -398,7 +398,7 @@ const getList = async () => {
}
}
loading.value = true;
queryParams.value.projectId = currentProject.value.id;
queryParams.value.projectId = currentProject.value?.id;
const res = await listProgressCategory(queryParams.value);
const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'pid');
if (data) {