进度计划添加计划,添加日报

This commit is contained in:
Teo
2025-05-28 19:52:30 +08:00
parent e2e4550736
commit 0a2d8b06f8
7 changed files with 790 additions and 133 deletions

View File

@ -6,13 +6,16 @@
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="请选择方阵:" prop="pid" label-width="100">
<!-- <el-input v-model="queryParams.pid" placeholder="请选择" clearable /> -->
<el-cascader
<!-- <el-cascader
:options="matrixOptions"
placeholder="请选择"
@change="handleChange"
:props="{ value: 'id', label: 'matrixName' }"
clearable
/>
/> -->
<el-select v-model="matrixValue" placeholder="请选择" @change="handleChange" clearable>
<el-option v-for="item in matrixOptions" :key="item.id" :label="item.matrixName" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Download" @click="handleQuery">导出周报</el-button>
@ -117,7 +120,7 @@
icon="Plus"
link
size="small"
@click="dailyRef.openDialog(scope.row)"
@click="handleDayAdd(scope.row)"
v-hasPermi="['progress:progressCategory:add']"
>
日报
@ -162,8 +165,9 @@
</template>
</el-dialog>
<!-- 创建计划对话框 -->
<CreatePlan ref="planRef"></CreatePlan>
<CreateDaily ref="dailyRef"></CreateDaily>
<CreatePlan ref="planRef" @getProgressList="getList"></CreatePlan>
<CreateDaily ref="dailyRef" @getProgressList="getList"></CreateDaily>
<CreateDailyRate ref="dailyRateRef" @getProgressList="getList"></CreateDailyRate>
</div>
</template>
@ -183,6 +187,7 @@ const { progress_unit_type, progress_status } = toRefs<any>(proxy?.useDict('prog
import { useUserStoreHook } from '@/store/modules/user';
import CreatePlan from './component/createPlan.vue';
import CreateDaily from './component/createDaily.vue';
import CreateDailyRate from './component/createDailyRate.vue';
type ProgressCategoryOption = {
id: number;
name: string;
@ -201,16 +206,11 @@ const isExpandAll = ref(true);
const loading = ref(false);
const planRef = ref<InstanceType<typeof CreatePlan>>();
const dailyRef = ref<InstanceType<typeof CreateDaily>>();
const dailyRateRef = ref<InstanceType<typeof CreateDailyRate>>();
const queryFormRef = ref<ElFormInstance>();
const progressCategoryFormRef = ref<ElFormInstance>();
const progressCategoryTableRef = ref<ElTableInstance>();
const matrixOptions = ref([
{
id: currentProject.value.id,
matrixName: currentProject.value.name,
children: []
}
]);
const matrixOptions = ref([]);
const dialog = reactive<any>({
dailyStatus: false,
planStatus: false,
@ -219,7 +219,7 @@ const dialog = reactive<any>({
title: '',
file: ''
});
const matrixValue = ref<number | undefined>(matrixOptions.value.length > 0 ? matrixOptions.value[0].id : undefined);
const initFormData: ProgressCategoryForm = {
id: undefined,
pid: undefined,
@ -254,9 +254,8 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => {
if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id);
console.log('🚀 ~ getList ~ res:', res);
matrixOptions.value[0].children = res.rows;
if (!matrixValue.value) matrixValue.value = res.rows[0].id;
matrixOptions.value = res.rows;
queryParams.value.matrixId = res.rows[0].id;
}
loading.value = true;
@ -295,12 +294,20 @@ const handleQuery = () => {
};
/** 级联选择器改变事件 */
const handleChange = (value: number[]) => {
queryParams.value.matrixId = value[1];
const handleChange = (value: number) => {
queryParams.value.matrixId = value;
getList();
};
const handleDayAdd = (row: ProgressCategoryVO) => {
if (row.unitType === '2') {
dailyRef.value.openDialog(row);
} else {
dailyRateRef.value.openDialog(row);
}
};
/** 导入按钮操作 */
const openDialog = (row: ProgressCategoryVO, status: string, title: string) => {
reset();