| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <!-- <el-row :gutter="20"> |
| | | <el-col> |
| | | <el-form |
| | | :model="queryParams" |
| | |
| | | </el-row> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | </template> |
| | | |
| | | <script setup name="Aps_plate_process_stat"> |
| | | import { listPlateStat, updateStat } from "@/api/mainPlan/plateProcessStat"; |
| | | import { listApsPlateProcessShopStat } 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 height = ref(document.documentElement.clientHeight - 270 + "px;"); |
| | | const columnsVersion = ref(0); |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | workOrderNo: null, |
| | | processName: null, |
| | | num: null, |
| | | routeProcessNumber: null, |
| | | currentProcessNumber: null, |
| | | productionQuantity: null, |
| | | standardTime: null, |
| | | processTotalTime: null, |
| | | processPlanEndDay: null, |
| | | computePlanEndDay: null, |
| | | designTimes: null, |
| | | batchNumber: null, |
| | | }, |
| | | rules: {}, |
| | | // form: {}, |
| | | // queryParams: { |
| | | // pageNum: 1, |
| | | // pageSize: 10, |
| | | // workOrderNo: null, |
| | | // processName: null, |
| | | // num: null, |
| | | // routeProcessNumber: null, |
| | | // currentProcessNumber: null, |
| | | // productionQuantity: null, |
| | | // standardTime: null, |
| | | // processTotalTime: null, |
| | | // processPlanEndDay: null, |
| | | // computePlanEndDay: null, |
| | | // designTimes: null, |
| | | // batchNumber: null, |
| | | // }, |
| | | // rules: {}, |
| | | }); |
| | | const xGrid = ref(); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | |
| | | /** æ¥è¯¢é£éç»è®¡å表 */ |
| | | async function getList() { |
| | | loading.value = true; |
| | | const response = await listApsPlateProcessShopStat(queryParams.value); |
| | | const response = await listApsPlateProcessShopStat(); |
| | | const listValue = response.data; |
| | | const resData = listValue.map((item,index)=>{ |
| | | item.deptPlans.map((n, i) => { |
| | |
| | | }, |
| | | ]); |
| | | await nextTick(); |
| | | console.log(xGrid.value, "llll"); |
| | | columns.value = [...columns.value, ...newArray]; // 强å¶ç»ä»¶éæ°æ¸²æ |
| | | |
| | | } |
| | | |
| | | function generateColumnDynamic() {} |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | // // åæ¶æé® |
| | | // function cancel() { |
| | | // open.value = false; |
| | | // reset(); |
| | | // } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | workOrderNo: null, |
| | | processName: null, |
| | | num: null, |
| | | routeProcessNumber: null, |
| | | currentProcessNumber: null, |
| | | productionQuantity: null, |
| | | standardTime: null, |
| | | processTotalTime: null, |
| | | processPlanEndDay: null, |
| | | computePlanEndDay: null, |
| | | designTimes: null, |
| | | batchNumber: null, |
| | | createBy: null, |
| | | delFlag: null, |
| | | }; |
| | | proxy.resetForm("aps_plate_process_statRef"); |
| | | } |
| | | // // 表åéç½® |
| | | // function reset() { |
| | | // form.value = { |
| | | // id: null, |
| | | // workOrderNo: null, |
| | | // processName: null, |
| | | // num: null, |
| | | // routeProcessNumber: null, |
| | | // currentProcessNumber: null, |
| | | // productionQuantity: null, |
| | | // standardTime: null, |
| | | // processTotalTime: null, |
| | | // processPlanEndDay: null, |
| | | // computePlanEndDay: null, |
| | | // designTimes: null, |
| | | // batchNumber: null, |
| | | // createBy: null, |
| | | // delFlag: null, |
| | | // }; |
| | | // proxy.resetForm("aps_plate_process_statRef"); |
| | | // } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | // /** æç´¢æé®æä½ */ |
| | | // function handleQuery() { |
| | | // queryParams.value.pageNum = 1; |
| | | // getList(); |
| | | // } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | queryParams.value.workOrderNo = ""; |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | // function resetQuery() { |
| | | // queryParams.value.workOrderNo = ""; |
| | | // proxy.resetForm("queryRef"); |
| | | // handleQuery(); |
| | | // } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | // function handleSelectionChange(selection) { |
| | | // ids.value = selection.map((item) => item.id); |
| | | // single.value = selection.length != 1; |
| | | // multiple.value = !selection.length; |
| | | // } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å é£éç»è®¡"; |
| | | } |
| | | // /** æ°å¢æé®æä½ */ |
| | | // function handleAdd() { |
| | | // reset(); |
| | | // open.value = true; |
| | | // title.value = "æ·»å é£éç»è®¡"; |
| | | // } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | updateStat().then((response) => { |
| | | form.value = response.data; |
| | | listApsPlateProcessShopStatUpdate().then((response) => { |
| | | // form.value = response.data; |
| | | ElMessage({ |
| | | message: "æ°æ®æ´æ°æå", |
| | | type: "success", |
| | |
| | | getList(); |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["aps_plate_process_statRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateAps_plate_process_stat(form.value).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addAps_plate_process_stat(form.value).then((response) => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal |
| | | .confirm('æ¯å¦ç¡®è®¤å é¤é£éç»è®¡ç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼') |
| | | .then(function () { |
| | | return delAps_plate_process_stat(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "/aps/plateProcessStat/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | "/aps/plateProcessShopStat/export", |
| | | // { |
| | | // ...queryParams.value, |
| | | // }, |
| | | `aps_plate_process_stat_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | const headerCellClassName = ({ column }) => { |
| | | if (column.field === "name") { |
| | | return "col-blue"; |
| | | } |
| | | return null; |
| | | }; |
| | | const rowClassName = ({ rowIndex }) => { |
| | | if ([2, 3, 5].includes(rowIndex)) { |
| | | return "row-green"; |
| | | } |
| | | return null; |
| | | }; |
| | | const cellClassName = ({ row, column }) => { |
| | | if ( |
| | | column.field === "processPlanStartDay" || |
| | | column.field === "processPlanEndDay" |
| | | ) { |
| | | if (row.warning) { |
| | | return "col-orange"; |
| | | } |
| | | } |
| | | return null; |
| | | }; |
| | | |
| | | onMounted(async () => { |
| | | getList(); |
| | | }); |