| | |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <el-col> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryRef" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="90px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å·¥åå·" prop="num"> |
| | | <el-input |
| | | v-model="queryParams.workOrderNo" |
| | | placeholder="请è¾å
¥é£é计åå·¥åå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | v-model="queryParams.workOrderNo" |
| | | placeholder="请è¾å
¥é£é计åå·¥åå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-col :span="12" style="text-align: right"> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button type="primary" icon="Search" @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10" class="mb8"> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['apsPlateProcessStat:export']" |
| | | >导åº</el-button> |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['apsPlateProcessStat:export']" |
| | | >导åº</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['apsPlateProcessStat:edit']" |
| | | >æ´æ°</el-button> |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['apsPlateProcessStat:edit']" |
| | | >æ´æ°</el-button |
| | | > |
| | | </el-col> |
| | | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | <right-toolbar |
| | | v-model:showSearch="showSearch" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | </el-row> |
| | | |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="aps_plate_process_statList" |
| | | :loading="loading" |
| | | :height="height" |
| | | style="width: 100%" |
| | | ref="xGrid" |
| | | :key="columnsVersion" |
| | | :columns="columns" |
| | | :data="aps_plate_process_statList" |
| | | :loading="loading" |
| | | :height="height" |
| | | > |
| | | </HxlhTable> |
| | | <!-- æ·»å æä¿®æ¹é£éç»è®¡å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="aps_plate_process_statRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form |
| | | ref="aps_plate_process_statRef" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="80px" |
| | | > |
| | | <el-form-item label="æåº" prop="num"> |
| | | <el-input v-model="form.num" placeholder="请è¾å
¥æåº" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç产æ°é" prop="productionQuantity"> |
| | | <el-input v-model="form.productionQuantity" placeholder="请è¾å
¥ç产æ°é" /> |
| | | <el-input |
| | | v-model="form.productionQuantity" |
| | | placeholder="请è¾å
¥ç产æ°é" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ åå·¥æ¶" prop="standardTime"> |
| | | <el-input v-model="form.standardTime" placeholder="请è¾å
¥æ åå·¥æ¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åºæ»å·¥æ¶" prop="processTotalTime"> |
| | | <el-input v-model="form.processTotalTime" placeholder="请è¾å
¥å·¥åºæ»å·¥æ¶" /> |
| | | <el-input |
| | | v-model="form.processTotalTime" |
| | | placeholder="请è¾å
¥å·¥åºæ»å·¥æ¶" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="设计工æ¶" prop="designTimes"> |
| | | <el-input v-model="form.designTimes" placeholder="请è¾å
¥è®¾è®¡å·¥æ¶" /> |
| | |
| | | </template> |
| | | |
| | | <script setup name="Aps_plate_process_stat"> |
| | | import { listPlateStat,updateStat } from "@/api/mainPlan/plateProcessStat"; |
| | | import { listPlateStat, updateStat } from "@/api/mainPlan/plateProcessStat"; |
| | | import { listApsPlateProcessShopStat } from "@/api/mainPlan/apsPlatePlanList"; |
| | | import HxlhTable from "@/components/HxlhTable/index.vue"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { ref } from "vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import { nextTick, onMounted, ref } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const aps_plate_process_statList = ref([]); |
| | | const dynamicList = ref([]); |
| | | const generateColumnList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const height = ref(document.documentElement.clientHeight - 270 + "px;") |
| | | |
| | | |
| | | const height = ref(document.documentElement.clientHeight - 270 + "px;"); |
| | | const columnsVersion = ref(0); |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | |
| | | designTimes: null, |
| | | batchNumber: null, |
| | | }, |
| | | rules: { |
| | | } |
| | | rules: {}, |
| | | }); |
| | | |
| | | const xGrid = ref(); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | | /* { type: 'seq', title: 'åºå·', width: 60 },*/ |
| | | /* { type: 'seq', title: 'åºå·', width: 60 },*/ |
| | | { |
| | | title: 'å·¥åå·', |
| | | field: 'workOrderNo', |
| | | title: "主件æå·", |
| | | field: "mainPartNumber", |
| | | width: 150, |
| | | } , |
| | | { |
| | | title: 'å·¥åºåç§°', |
| | | field: 'processName', |
| | | }, |
| | | { |
| | | title: 'å·¥åºå·', |
| | | field: 'routeProcessNumberTxt', |
| | | title: "ä¸å¡ç±»å", |
| | | field: "businessType", |
| | | }, |
| | | { |
| | | title: "åæ®å·", |
| | | field: "documentNumber", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'å½åå·¥åºå·', |
| | | field: 'currentProcessNumberTxt', |
| | | title: "å½åå·¥åºå·", |
| | | field: "currentProcessNumberTxt", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'ç产æ°é', |
| | | field: 'productionQuantity', |
| | | title: "éæ±åç±»", |
| | | field: "requirementType", |
| | | width: 80, |
| | | }, |
| | | { |
| | | title: 'æ åå·¥æ¶', |
| | | field: 'standardTime', |
| | | title: "åæ®ç¶æ", |
| | | field: "documentStatus", |
| | | width: 80, |
| | | }, |
| | | { |
| | | title: 'å·¥åºæ»å·¥æ¶', |
| | | field: 'processTotalTime', |
| | | title: "å½åå·¥åº", |
| | | field: "workCenter", |
| | | width: 80, |
| | | |
| | | }, |
| | | { |
| | | title: '计åå¼å·¥æ¥', |
| | | field: 'processPlanStartDaytxt', |
| | | title: "计åå¼å·¥æ¥", |
| | | field: "processPlanStartDaytxt", |
| | | width: 140, |
| | | type:'html' |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: '计åå®å·¥æ¥', |
| | | field: 'processPlanEndDaytxt', |
| | | title: "æå·", |
| | | field: "itemNumber", |
| | | width: 140, |
| | | type:'html' |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: '订åå®å·¥æ¥', |
| | | field: 'orderPlanEndDay', |
| | | title: "å¾å·", |
| | | field: "drawingNo", |
| | | width: 120, |
| | | format: 'YYYY-MM-DD' |
| | | } |
| | | // format: 'YYYY-MM-DD' |
| | | }, |
| | | { |
| | | title: "çæ¬å·", |
| | | field: "versionNumber", |
| | | width: 140, |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: "ç产æ°é", |
| | | field: "productionQuantity", |
| | | width: 140, |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: "计åå®å·¥æ¥", |
| | | field: "planEndDay", |
| | | width: 140, |
| | | format: "YYYY-MM-DD hh:mm:ss", |
| | | }, |
| | | ]); |
| | | |
| | | |
| | | |
| | | /** æ¥è¯¢é£éç»è®¡å表 */ |
| | | function getList() { |
| | | async function getList() { |
| | | loading.value = true; |
| | | listPlateStat(queryParams.value).then(response => { |
| | | const listValue = response.rows; |
| | | listValue.forEach(listItem => { |
| | | listItem[`processPlanStartDaytxt`]= listItem.warning? `<font color="red">${listItem.processPlanStartDay}</font>` :listItem.processPlanStartDay; |
| | | listItem[`processPlanEndDaytxt`]= listItem.warning? `<font color="red">${listItem.processPlanEndDay}</font>` :listItem.processPlanEndDay; |
| | | listItem[`routeProcessNumberTxt`]= listItem.routeProcessNumber.toString().padStart(3, '0'); |
| | | listItem[`currentProcessNumberTxt`]= listItem.currentProcessNumber.toString().padStart(3, '0'); |
| | | |
| | | |
| | | const response = await listApsPlateProcessShopStat(queryParams.value); |
| | | 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 |
| | | }); |
| | | aps_plate_process_statList.value =listValue |
| | | debugger; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | console.log(resData,'resDataresDataresData') |
| | | 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) => [ |
| | | { |
| | | title: `${item}å¼å§æ¶é´`, |
| | | field:`${index}_startDate`, |
| | | width: 140, |
| | | formatter: ({ cellValue, row, column }) => { |
| | | let dateStr = ""; |
| | | if (cellValue) { |
| | | row.deptPlans.map((n, i) => { |
| | | if (item === n.shopName) { |
| | | // console.log( |
| | | // item, |
| | | // n.shopName, |
| | | // n.planStartDate, |
| | | // `${item}å¼å§æ¶é´`, |
| | | // "planStartDate" |
| | | // ); |
| | | dateStr = n.planStartDate; |
| | | } |
| | | }); |
| | | } |
| | | return dateStr |
| | | }, |
| | | }, |
| | | { |
| | | title: `${item}ç»ææ¶é´`, |
| | | field:`${index}_endDate`, |
| | | width: 140, |
| | | formatter: ({ cellValue, row, column }) => { |
| | | let dateStr = ""; |
| | | if (cellValue) { |
| | | row.deptPlans.map((n, i) => { |
| | | if (item === n.shopName) { |
| | | // console.log( |
| | | // item, |
| | | // n.shopName, |
| | | // n.planStartDate, |
| | | // `${item}å¼å§æ¶é´`, |
| | | // "planStartDate" |
| | | // ); |
| | | dateStr = n.planEndDate; |
| | | } |
| | | }); |
| | | } |
| | | return dateStr |
| | | }, |
| | | }, |
| | | ]); |
| | | await nextTick(); |
| | | console.log(xGrid.value, "llll"); |
| | | columns.value = [...columns.value, ...newArray]; // 强å¶ç»ä»¶éæ°æ¸²æ |
| | | |
| | | } |
| | | |
| | | function generateColumnDynamic() {} |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | |
| | | designTimes: null, |
| | | batchNumber: null, |
| | | createBy: null, |
| | | delFlag: null |
| | | delFlag: null, |
| | | }; |
| | | proxy.resetForm("aps_plate_process_statRef"); |
| | | } |
| | |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | queryParams.value.workOrderNo =''; |
| | | queryParams.value.workOrderNo = ""; |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.id); |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | updateStat().then(response => { |
| | | updateStat().then((response) => { |
| | | form.value = response.data; |
| | | ElMessage({ |
| | | message: 'æ°æ®æ´æ°æå', |
| | | type: 'success', |
| | | }) |
| | | message: "æ°æ®æ´æ°æå", |
| | | type: "success", |
| | | }); |
| | | getList(); |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["aps_plate_process_statRef"].validate(valid => { |
| | | proxy.$refs["aps_plate_process_statRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateAps_plate_process_stat(form.value).then(response => { |
| | | updateAps_plate_process_stat(form.value).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addAps_plate_process_stat(form.value).then(response => { |
| | | 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(() => {}); |
| | | 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_plate_process_stat_${new Date().getTime()}.xlsx`) |
| | | proxy.download( |
| | | "/aps/plateProcessStat/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `aps_plate_process_stat_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | const headerCellClassName = ({ column }) => { |
| | | if (column.field === 'name') { |
| | | return 'col-blue' |
| | | if (column.field === "name") { |
| | | return "col-blue"; |
| | | } |
| | | return null |
| | | } |
| | | return null; |
| | | }; |
| | | const rowClassName = ({ rowIndex }) => { |
| | | if ([2, 3, 5].includes(rowIndex)) { |
| | | return 'row-green' |
| | | return "row-green"; |
| | | } |
| | | return null |
| | | } |
| | | return null; |
| | | }; |
| | | const cellClassName = ({ row, column }) => { |
| | | if (column.field === 'processPlanStartDay'||column.field === 'processPlanEndDay') { |
| | | if ( |
| | | column.field === "processPlanStartDay" || |
| | | column.field === "processPlanEndDay" |
| | | ) { |
| | | if (row.warning) { |
| | | return 'col-orange' |
| | | return "col-orange"; |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | getList(); |
| | | return null; |
| | | }; |
| | | onMounted(async () => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | ::v-deep(.mytable-style.vxe-table .vxe-body--row.row-green) { |
| | |
| | | background-color: red; |
| | | color: #fff; |
| | | } |
| | | </style> |
| | | </style> |