代码提交

This commit is contained in:
userName 2024-02-21 16:05:24 +08:00
parent 2c8b5f0a51
commit 6be2ec8054
1 changed files with 16 additions and 11 deletions

View File

@ -31,15 +31,16 @@
</el-row> </el-row>
<el-table v-if="refreshTable" v-loading="loading" :data="planDetailList" row-key="id" height="800" <el-table v-if="refreshTable" v-loading="loading" :data="planDetailList" row-key="id" height="800"
:default-expand-all="isExpandAll" :span-method="objectSpanMethod" :cell-style="handleChangeCellStyle"> :default-expand-all="isExpandAll" :span-method="objectSpanMethod" :cell-style="handleChangeCellStyle" border>
<el-table-column fixed="left" label="名称" align="left" prop="name" width="180"> <el-table-column fixed="left" label="名称" align="left" prop="name" width="180">
<template #default="scope"> <!-- <template #default="scope">
<span v-html="handleName(scope.row)"></span> <span v-html="handleName(scope.row)"></span>
{{ scope.row.name }} {{ scope.row.name }}
</template> </template> -->
<!-- <template #default="scope"> <template #default="scope">
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<span v-html="handleName(scope.row)"></span>
{{ scope.row.name }} {{ scope.row.name }}
<el-icon class="el-icon--right"> <el-icon class="el-icon--right">
<arrow-down /> <arrow-down />
@ -56,11 +57,11 @@
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</template> --> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划/实际" align="center" prop="flag" width="80"> <el-table-column label="计划/实际" align="center" prop="flag" width="100">
<template #default="scope"> <template #default="scope">
<span>{{ scope.rowIndex % 2 === 0 ? '实际' : '计划' }}</span> <span>{{ scope.row.category === 1 ? '计划' : '实际' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="计划时间" align="center" prop="planDate" width="180"> <!-- <el-table-column label="计划时间" align="center" prop="planDate" width="180">
@ -78,7 +79,7 @@
<el-button link @click="handleDate(scope.row)" style="opacity: 0;">{{ item.label }}</el-button> <el-button link @click="handleDate(scope.row)" style="opacity: 0;">{{ item.label }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="210"> <!-- <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="210">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['mts:planDetail:edit']">修改</el-button> v-hasPermi="['mts:planDetail:edit']">修改</el-button>
@ -87,7 +88,7 @@
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['mts:planDetail:remove']">删除</el-button> v-hasPermi="['mts:planDetail:remove']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<!-- 添加或修改生产计划明细对话框 --> <!-- 添加或修改生产计划明细对话框 -->
@ -164,6 +165,7 @@ import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { listPlanDetail, getPlanDetail, delPlanDetail, addPlanDetail, updatePlanDetail } from "@/api/mts/planDetail"; import { listPlanDetail, getPlanDetail, delPlanDetail, addPlanDetail, updatePlanDetail } from "@/api/mts/planDetail";
import { getPlanMain } from "@/api/mts/planMain";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const route = useRoute(); const route = useRoute();
@ -215,8 +217,11 @@ const { queryParams, form, rules } = toRefs(data);
const dateColumns = ref([]) const dateColumns = ref([])
const allDates = []; const allDates = [];
onMounted(() => { onMounted(async () => {
for (const date of getDays('2024-02-01', '2024-02-25')) { const res = await getPlanMain(route.params.mainId);
const { startDate, endDate } = res.data
for (const date of getDays(startDate, endDate)) {
allDates.push(date); allDates.push(date);
dateColumns.value.push({ dateColumns.value.push({
label: date, label: date,