| | |
| | | > |
| | | </el-col> |
| | | |
| | | <right-toolbar |
| | | :search="false" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | <right-toolbar :search="false" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <HxlhTable |
| | |
| | | </template> |
| | | |
| | | <script setup name="Aps_plate_process_stat"> |
| | | import { listApsPlateProcessShopStat, listApsPlateProcessShopStatUpdate } from "@/api/mainPlan/apsPlatePlanList"; |
| | | import { |
| | | listApsPlateProcessShopStat, |
| | | listApsPlateProcessShopStatUpdate, |
| | | } from "@/api/mainPlan/apsPlatePlanList"; |
| | | import HxlhTable from "@/components/HxlhTable/index.vue"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { nextTick, onMounted, ref } from "vue"; |
| | |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const height = ref(document.documentElement.clientHeight-180 + "px;"); |
| | | const height = ref(document.documentElement.clientHeight - 180 + "px;"); |
| | | const columnsVersion = ref(0); |
| | | const data = reactive({ |
| | | // form: {}, |
| | |
| | | title: "主件料号", |
| | | field: "mainPartNumber", |
| | | width: 150, |
| | | fixed:"left" |
| | | fixed: "left", |
| | | }, |
| | | { |
| | | title: "业务类型", |
| | | field: "businessType", |
| | | width: 120, |
| | | fixed:"left" |
| | | fixed: "left", |
| | | }, |
| | | { |
| | | title: "单据号", |
| | | field: "documentNumber", |
| | | width: 160, |
| | | fixed:"left" |
| | | fixed: "left", |
| | | }, |
| | | { |
| | | title: "需求分类", |
| | | field: "requirementType", |
| | | width: 100, |
| | | fixed:"left" |
| | | fixed: "left", |
| | | }, |
| | | { |
| | | title: "单据状态", |
| | | field: "documentStatus", |
| | | width: 100, |
| | | fixed:"left" |
| | | fixed: "left", |
| | | }, |
| | | { |
| | | title: "审核时间", |
| | | field: "updateBy", |
| | | width: 100 |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "当前工序", |
| | |
| | | { |
| | | title: "下一工序", |
| | | field: "updateBy", |
| | | width: 100 |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "下一工序工序负责人", |
| | |
| | | { |
| | | title: "低阶码", |
| | | field: "updateBy", |
| | | width: 100 |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "生产数量", |
| | |
| | | { |
| | | title: "工单计划下发时间", |
| | | field: "updateBy", |
| | | width: 200 |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: "系统完工时间", |
| | |
| | | async function getList() { |
| | | loading.value = true; |
| | | const response = await listApsPlateProcessShopStat(); |
| | | const listValue = response.data; |
| | | const resData = listValue.map((item,index)=>{ |
| | | item.deptPlans.map((n, i) => { |
| | | item[`${i}_startDate`] = n.planStartDate |
| | | item[`${i}_endDate`] = n.planEndDate |
| | | }); |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | console.log(resData,'resDataresDataresData') |
| | | let listValue = response.data; |
| | | dynamicList.value = response.shopNames; |
| | | aps_plate_process_statList.value = listValue; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | await nextTick(); |
| | | const newArray = dynamicList.value.flatMap((item, index) => [ |
| | | aps_plate_process_statList.value = aps_plate_process_statList.value.map( |
| | | (item, index) => { |
| | | item.deptPlans.map((n, i) => { |
| | | item[`${i}_startDate`] = n.planStartDate; |
| | | item[`${i}_endDate`] = n.planEndDate; |
| | | }); |
| | | return { |
| | | ...item, |
| | | }; |
| | | } |
| | | ); |
| | | console.log(aps_plate_process_statList.value, "resDataresDataresData"); |
| | | let newArray = []; |
| | | newArray = dynamicList.value.flatMap((item, index) => [ |
| | | { |
| | | title: `${item}开始时间`, |
| | | field:`${index}_startDate`, |
| | | field: `${index}_startDate`, |
| | | width: 140, |
| | | formatter: ({ cellValue, row, column }) => { |
| | | let dateStr = ""; |
| | |
| | | // `${item}开始时间`, |
| | | // "planStartDate" |
| | | // ); |
| | | dateStr = n.planStartDate; |
| | | dateStr = n.planStartDate; |
| | | } |
| | | }); |
| | | } |
| | | return dateStr |
| | | return dateStr; |
| | | }, |
| | | }, |
| | | { |
| | | title: `${item}结束时间`, |
| | | field:`${index}_endDate`, |
| | | field: `${index}_endDate`, |
| | | width: 140, |
| | | formatter: ({ cellValue, row, column }) => { |
| | | let dateStr = ""; |
| | |
| | | // `${item}开始时间`, |
| | | // "planStartDate" |
| | | // ); |
| | | dateStr = n.planEndDate; |
| | | dateStr = n.planEndDate; |
| | | } |
| | | }); |
| | | } |
| | | return dateStr |
| | | return dateStr; |
| | | }, |
| | | }, |
| | | ]); |
| | | newArray.splice(2,0,{ |
| | | title: "焊接件齐套开始时间", |
| | | field:"hanjie_startDate", |
| | | width: 140, |
| | | }) |
| | | await nextTick(); |
| | | columns.value = [...columns.value, ...newArray]; // 强制组件重新渲染 |
| | | |
| | | newArray.splice(2, 0, { |
| | | title: "焊接件齐套开始时间", |
| | | field: "hanjie_startDate", |
| | | width: 140, |
| | | }); |
| | | columns.value = [ |
| | | ...columns.value, |
| | | ...newArray.filter( |
| | | (item) => !columns.value.some((col) => col.field === item.field) |
| | | ), |
| | | ]; |
| | | // columns.value = columns.value |
| | | } |
| | | |
| | | // // 取消按钮 |
| | |
| | | /** 导出按钮操作 */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "/aps/plateProcessShopStat/export", {}, |
| | | "/aps/plateProcessShopStat/export", |
| | | {}, |
| | | `aps_plate_process_stat_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |