| | |
| | | <template> |
| | | <div> |
| | | <div style="display: flex;width: 1770px;"> |
| | | <el-input v-model="rawGlassWidth" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('Mounting.width')" /> |
| | | <el-input v-model="rawGlassHeight" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('Mounting.height')" /> |
| | | <el-input v-model="rawGlassThickness" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('Mounting.thickness')" /> |
| | | <el-input v-model="rawGlassfilmsId" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('workOrder.coatingtypesbe')" /> |
| | | <el-input v-model="slot" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('workOrder.upnumber')" /> |
| | | <el-select |
| | | :placeholder="$t('searchOrder.taskstatus')" |
| | | clearable |
| | | style="width: 270px;margin-left: 10px;" |
| | | v-model="taskStateList"> |
| | | <el-option |
| | | v-for="item in optionsa" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" :start-placeholder="$t('reportmanage.starttime')" |
| | | style="margin-left: 15px;" value-format = "YYYY-MM-DD hh:mm:ss" |
| | | :end-placeholder="$t('reportmanage.endtime')"> |
| | | </el-date-picker> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="sethistorical()">{{$t('reportmanage.inquire')}}</el-button> |
| | | </div> |
| | | <el-table ref="table" style="margin-top: 20px;height: 580px;width: 1770px;" :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="rawGlassWidth" align="center" :label="$t('Mounting.width')" min-width="80" /> |
| | | <el-table-column prop="rawGlassHeight" align="center" :label="$t('Mounting.height')" min-width="80" /> |
| | | <el-table-column prop="rawGlassThickness" align="center" :label="$t('Mounting.thickness')" min-width="80" /> |
| | | <el-table-column prop="slot" align="center" :label="$t('workOrder.upnumber')" min-width="80" /> |
| | | <el-table-column prop="totalCount" align="center" :label="$t('basicData.tonumber')" min-width="80" /> |
| | | <el-table-column prop="finishCount" align="center" :label="$t('basicData.finishnumber')" min-width="80" /> |
| | | <el-table-column prop="damageCount" align="center" :label="$t('hellow.damagenumber')" min-width="80" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.taskstatus')" |
| | | min-width="80" |
| | | prop="taskState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row.taskState)"> |
| | | {{ getStatusTextb(scope.row.taskState) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('sorter.taskRunning')" |
| | | min-width="80" |
| | | prop="taskRunning" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypea(scope.row.taskRunning)"> |
| | | {{ getStatusTexta(scope.row.taskRunning) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="formattedCreateTime" align="center" :label="$t('reportmanage.starttime')" min-width="100" /> |
| | | <el-table-column prop="formattedUpdateTime" align="center" :label="$t('reportmanage.endtime')" min-width="100" /> |
| | | </el-table> |
| | | <div style="margin-top: 20px;margin-left: 40%;"> |
| | | <el-pagination |
| | | v-model:current-page="currentPage2" |
| | | :page-size="pageSize" |
| | | :size="large" |
| | | :disabled="disabled" |
| | | layout="prev, pager, next, jumper" |
| | | :total="totalRecords" |
| | | @current-change="handlePageChange2" |
| | | style="margin-top: 10px;" |
| | | /> |
| | | </div> |
| | | <div> |
| | | <div style="display: flex;width: 1770px;"> |
| | | <el-input v-model="rawGlassWidth" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('Mounting.width')" /> |
| | | <el-input v-model="rawGlassHeight" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('Mounting.height')" /> |
| | | <el-input v-model="rawGlassThickness" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('Mounting.thickness')" /> |
| | | <el-input v-model="rawGlassfilmsId" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('workOrder.coatingtypesbe')" /> |
| | | <el-input v-model="slot" clearable style="margin-left: 10px;margin-bottom: 10px;width: 200px;" :placeholder="$t('workOrder.upnumber')" /> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('searchOrder.taskstatus')" clearable |
| | | style="width: 200px;margin-left: 10px;"> |
| | | <el-option :label="$t('searchOrder.empty')" value="0"></el-option> |
| | | <el-option :label="$t('film.execution')" value="1"></el-option> |
| | | <el-option :label="$t('searchOrder.endtask')" value="2"></el-option> |
| | | </el-select> |
| | | <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" :start-placeholder="$t('reportmanage.starttime')" |
| | | style="margin-left: 15px;" value-format = "YYYY-MM-DD hh:mm:ss" |
| | | :end-placeholder="$t('reportmanage.endtime')"> |
| | | </el-date-picker> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="sethistorical()">{{$t('reportmanage.inquire')}}</el-button> |
| | | </div> |
| | | <el-table ref="table" style="margin-top: 20px;height: 580px;width: 1770px;" :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="rawGlassWidth" align="center" :label="$t('Mounting.width')" min-width="80" /> |
| | | <el-table-column prop="rawGlassHeight" align="center" :label="$t('Mounting.height')" min-width="80" /> |
| | | <el-table-column prop="rawGlassThickness" align="center" :label="$t('Mounting.thickness')" min-width="80" /> |
| | | <el-table-column prop="rawGlassFilmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="80" /> |
| | | <el-table-column prop="slot" align="center" :label="$t('workOrder.upnumber')" min-width="80" /> |
| | | <el-table-column prop="totalCount" align="center" :label="$t('basicData.tonumber')" min-width="80" /> |
| | | <el-table-column prop="finishCount" align="center" :label="$t('basicData.finishnumber')" min-width="80" /> |
| | | <el-table-column prop="damageCount" align="center" :label="$t('hellow.damagenumber')" min-width="80" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.taskstatus')" |
| | | min-width="80" |
| | | prop="taskState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row.taskState)"> |
| | | {{ getStatusTextb(scope.row.taskState) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column |
| | | align="center" |
| | | :label="$t('sorter.taskRunning')" |
| | | min-width="80" |
| | | prop="taskRunning" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypea(scope.row.taskRunning)"> |
| | | {{ getStatusTexta(scope.row.taskRunning) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> --> |
| | | <el-table-column prop="formattedCreateTime" align="center" :label="$t('reportmanage.starttime')" min-width="100" /> |
| | | <el-table-column prop="formattedUpdateTime" align="center" :label="$t('reportmanage.endtime')" min-width="100" /> |
| | | </el-table> |
| | | <div style="margin-top: 20px;margin-left: 40%;"> |
| | | <el-pagination |
| | | v-model:current-page="currentPage2" |
| | | :page-size="pageSize" |
| | | :size="large" |
| | | :disabled="disabled" |
| | | layout="prev, pager, next, jumper" |
| | | :total="totalRecords" |
| | | @current-change="handlePageChange2" |
| | | style="margin-top: 10px;" |
| | | /> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {useI18n} from 'vue-i18n' |
| | | import {useRouter} from "vue-router" |
| | |
| | | const globalDate = inject('globalDate'); |
| | | const router = useRouter() |
| | | const timeRange = ref([]) |
| | | const taskStateList = reactive([]); |
| | | const selectValuesa = reactive([]); |
| | | const tableDatax = ref([]) |
| | | const currentPage2 = ref(1) |
| | | const totalRecords = ref(0) |
| | |
| | | const slot = ref(''); |
| | | let getglobalDate = window.localStorage.getItem('getglobalDate') |
| | | const historical = async () => { |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.post("/loadGlass/loadglassdevicetaskhistory/queryLoadGlassHistoryTask", { |
| | | pageNo: 1, |
| | | pageSize: 20, |
| | | rawGlassHeight: '', |
| | | rawGlassThickness: '', |
| | | rawGlassWidth: '', |
| | | rawGlassfilmsId: '', |
| | | slot: '', |
| | | station: 2, |
| | | taskStateList: '', |
| | | beginDate: startTime, |
| | | endDate: getglobalDate |
| | | }) |
| | | if (response.code == 200) { |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.post("/loadGlass/loadglassdevicetaskhistory/queryLoadGlassHistoryTask", { |
| | | pageNo: 1, |
| | | pageSize: 20, |
| | | rawGlassHeight: '', |
| | | rawGlassThickness: '', |
| | | rawGlassWidth: '', |
| | | rawGlassfilmsId: '', |
| | | slot: 0, |
| | | station: 2, |
| | | taskStateList: [], |
| | | beginDate: startTime, |
| | | endDate: getglobalDate |
| | | }) |
| | | if (response.code == 200) { |
| | | currentPage2.value = 1 |
| | | ElMessage.success(response.message); |
| | | const formattedData = response.data.records.map(record => ({ |
| | | ...record, |
| | | formattedCreateTime: formatTimestamp(record.createTime), |
| | | formattedUpdateTime: formatTimestamp(record.updateTime), |
| | | })); |
| | | // tableDatax.value = response.data.records; |
| | | tableDatax.value = formattedData; |
| | | console.log(response.data.pages); |
| | | totalRecords.value = response.data.total/2 || 0 |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | const formattedData = response.data.records.map(record => ({ |
| | | ...record, |
| | | formattedCreateTime: formatTimestamp(record.createTime), |
| | | formattedUpdateTime: formatTimestamp(record.updateTime), |
| | | })); |
| | | // tableDatax.value = response.data.records; |
| | | tableDatax.value = formattedData; |
| | | console.log(response.data.pages); |
| | | totalRecords.value = response.data.total/2 || 0 |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | console.error(error); |
| | | } |
| | | } |
| | | const handlePageChange2 = (newPage) => { |
| | | currentPage2.value = newPage; |
| | | console.log(currentPage2.value); |
| | | window.localStorage.setItem('pagenumber', currentPage2.value) |
| | | historicala(currentPage2.value); |
| | | currentPage2.value = newPage; |
| | | console.log(currentPage2.value); |
| | | window.localStorage.setItem('pagenumber', currentPage2.value) |
| | | historicala(currentPage2.value); |
| | | }; |
| | | const historicala = async (page) => { |
| | | try { |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.post("/loadGlass/loadglassdevicetaskhistory/queryLoadGlassHistoryTask", { |
| | | pageNo: page, |
| | | pageSize: 20, |
| | | rawGlassHeight: '', |
| | | rawGlassThickness: '', |
| | | rawGlassWidth: '', |
| | | rawGlassfilmsId: '', |
| | | slot: '', |
| | | station: 2, |
| | | taskStateList: '', |
| | | beginDate: startTime, |
| | | endDate: getglobalDate |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | const formattedData = response.data.records.map(record => ({ |
| | | ...record, |
| | | formattedCreateTime: formatTimestamp(record.createTime), |
| | | formattedUpdateTime: formatTimestamp(record.updateTime), |
| | | })); |
| | | // tableDatax.value = response.data.records; |
| | | tableDatax.value = formattedData; |
| | | totalRecords.value = response.data.total/2 || 0 |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | try { |
| | | let pslot= '' |
| | | let celllist=[] |
| | | if(selectValuesa[0]!=null&&selectValuesa[0]!='undefined'){ |
| | | if(selectValuesa[0]!=""){ |
| | | celllist=[selectValuesa[0]]; |
| | | } |
| | | } |
| | | if(slot.value != ""){ |
| | | pslot = slot.value |
| | | }else{ |
| | | pslot = '0' |
| | | } |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.post("/loadGlass/loadglassdevicetaskhistory/queryLoadGlassHistoryTask", { |
| | | pageNo: page, |
| | | pageSize: 20, |
| | | rawGlassHeight: rawGlassHeight.value, |
| | | rawGlassThickness: rawGlassThickness.value, |
| | | rawGlassWidth: rawGlassWidth.value, |
| | | rawGlassfilmsId: rawGlassfilmsId.value, |
| | | slot: pslot, |
| | | station: 2, |
| | | taskStateList: celllist, |
| | | beginDate: (timeRange.value && timeRange.value[0]) || '', |
| | | endDate: (timeRange.value && timeRange.value[1]) || '', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | const formattedData = response.data.records.map(record => ({ |
| | | ...record, |
| | | formattedCreateTime: formatTimestamp(record.createTime), |
| | | formattedUpdateTime: formatTimestamp(record.updateTime), |
| | | })); |
| | | // tableDatax.value = response.data.records; |
| | | tableDatax.value = formattedData; |
| | | totalRecords.value = response.data.total/2 || 0 |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 历史查询点击 |
| | | const sethistorical = async () => { |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | console.log(page); |
| | | const response = await request.post("/loadGlass/loadglassdevicetaskhistory/queryLoadGlassHistoryTask", { |
| | | pageNo: 1, |
| | | pageSize: 20, |
| | | rawGlassHeight: rawGlassHeight.value, |
| | | rawGlassThickness: rawGlassThickness.value, |
| | | rawGlassWidth: rawGlassWidth.value, |
| | | rawGlassfilmsId: rawGlassfilmsId.value, |
| | | slot: slot.value, |
| | | station: 2, |
| | | taskStateList: '', |
| | | beginDate: (timeRange.value && timeRange.value[0]) || '', |
| | | endDate: (timeRange.value && timeRange.value[1]) || '', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | const formattedData = response.data.records.map(record => ({ |
| | | ...record, |
| | | formattedCreateTime: formatTimestamp(record.createTime), |
| | | formattedUpdateTime: formatTimestamp(record.updateTime), |
| | | })); |
| | | // tableDatax.value = response.data.records; |
| | | tableDatax.value = formattedData; |
| | | totalRecords.value = response.data.total/2 || 0 |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | try { |
| | | let pslot= '' |
| | | let celllist=[] |
| | | if(selectValuesa[0]!=null&&selectValuesa[0]!='undefined'){ |
| | | if(selectValuesa[0]!=""){ |
| | | celllist=[selectValuesa[0]]; |
| | | } |
| | | } |
| | | if(slot.value != ""){ |
| | | pslot = slot.value |
| | | }else{ |
| | | pslot = '0' |
| | | } |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | console.log(page); |
| | | const response = await request.post("/loadGlass/loadglassdevicetaskhistory/queryLoadGlassHistoryTask", { |
| | | pageNo: 1, |
| | | pageSize: 20, |
| | | rawGlassHeight: rawGlassHeight.value, |
| | | rawGlassThickness: rawGlassThickness.value, |
| | | rawGlassWidth: rawGlassWidth.value, |
| | | rawGlassfilmsId: rawGlassfilmsId.value, |
| | | slot: pslot, |
| | | station: 2, |
| | | taskStateList: celllist, |
| | | beginDate: (timeRange.value && timeRange.value[0]) || '', |
| | | endDate: (timeRange.value && timeRange.value[1]) || '', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | const formattedData = response.data.records.map(record => ({ |
| | | ...record, |
| | | formattedCreateTime: formatTimestamp(record.createTime), |
| | | formattedUpdateTime: formatTimestamp(record.updateTime), |
| | | })); |
| | | // tableDatax.value = response.data.records; |
| | | tableDatax.value = formattedData; |
| | | totalRecords.value = response.data.total/2 || 0 |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 格式化时间戳为年月日时间字符串的函数 |
| | | function formatTimestamp(timestamp) { |
| | | const date = new Date(timestamp); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并补零 |
| | | const day = String(date.getDate()).padStart(2, '0'); // 补零 |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | const date = new Date(timestamp); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并补零 |
| | | const day = String(date.getDate()).padStart(2, '0'); // 补零 |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | // 格式化后端时间并计算一周前的时间 |
| | | const defaultTime = ref<[Date, Date]>([new Date(), new Date()]); |
| | | function parseAndSetTime() { |
| | | const backendTime = new Date(getglobalDate); |
| | | const oneWeekAgo = new Date(backendTime.getTime() - 7 * 24 * 60 * 60 * 1000); // 减去7天 |
| | | console.log(formatTimestamp(oneWeekAgo)); |
| | | console.log(oneWeekAgo); |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]; |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | const backendTime = new Date(getglobalDate); |
| | | const oneWeekAgo = new Date(backendTime.getTime() - 7 * 24 * 60 * 60 * 1000); // 减去7天 |
| | | console.log(formatTimestamp(oneWeekAgo)); |
| | | console.log(oneWeekAgo); |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]; |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | } |
| | | function getStatusTypeb(taskState: number) { |
| | | switch (taskState) { |
| | | case 0: |
| | | return 'primary'; |
| | | case 1: |
| | | return 'success'; |
| | | case 2: |
| | | return 'success'; |
| | | } |
| | | switch (taskState) { |
| | | case 0: |
| | | return 'primary'; |
| | | case 1: |
| | | return 'success'; |
| | | case 2: |
| | | return 'info'; |
| | | } |
| | | } |
| | | function getStatusTextb(taskState: number) { |
| | | switch (taskState) { |
| | | case 0: |
| | | return t('searchOrder.empty'); |
| | | case 1: |
| | | return t('film.execution'); |
| | | case 2: |
| | | return t('searchOrder.endtask'); |
| | | } |
| | | switch (taskState) { |
| | | case 0: |
| | | return t('searchOrder.empty'); |
| | | case 1: |
| | | return t('film.execution'); |
| | | case 2: |
| | | return t('searchOrder.endtask'); |
| | | } |
| | | } |
| | | function getStatusTypea(taskRunning: number) { |
| | | switch (taskRunning) { |
| | | case 0: |
| | | return 'primary'; |
| | | case 1: |
| | | return 'success'; |
| | | } |
| | | switch (taskRunning) { |
| | | case 0: |
| | | return 'primary'; |
| | | case 1: |
| | | return 'success'; |
| | | } |
| | | } |
| | | function getStatusTexta(taskRunning: number) { |
| | | switch (taskRunning) { |
| | | case 0: |
| | | return t('basicData.untask'); |
| | | case 1: |
| | | return t('basicData.up'); |
| | | } |
| | | switch (taskRunning) { |
| | | case 0: |
| | | return t('basicData.untask'); |
| | | case 1: |
| | | return t('basicData.up'); |
| | | } |
| | | } |
| | | const optionsa = [ |
| | | { |
| | | value: 0, |
| | | label: t('searchOrder.empty'), |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: t('film.execution'), |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: t('searchOrder.endtask'), |
| | | } |
| | | ] |
| | | onMounted(() => { |
| | | parseAndSetTime(); |
| | | historical(); |
| | | parseAndSetTime(); |
| | | historical(); |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | </style> |
| | | </script> |
| | | <style scoped> |
| | | </style> |