| | |
| | | <el-option :label="$t('sorter.advancerequests')" value="4"></el-option> |
| | | <el-option :label="$t('sorter.releaserequest')" value="5"></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-date-picker |
| | | style="margin-left: 15px;" |
| | | v-model="timeRange" |
| | | type="datetimerange" |
| | | :shortcuts="shortcuts" |
| | | range-separator="至" |
| | | :start-placeholder="$t('reportmanage.starttime')" |
| | | :end-placeholder="$t('reportmanage.endtime')" |
| | | /> |
| | | <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="startSlot" align="center" :label="$t('film.originateslot')" min-width="80" /> |
| | | <el-table-column prop="endSlot" align="center" :label="$t('film.endslot')" min-width="80" /> |
| | | <el-table-column prop="shelf" align="center" :label="$t('film.resetnumber')" min-width="80" /> |
| | | <el-table-column prop="patternQuantity" align="center" :label="$t('film.thickremainquant')" min-width="80" /> |
| | | <el-table-column prop="startSlot" align="center" :label="$t('film.originateslot')" min-width="50" /> |
| | | <el-table-column prop="endSlot" align="center" :label="$t('film.endoriginateslot')" min-width="50" /> |
| | | <el-table-column prop="shelf" align="center" :label="$t('film.resetnumber')" min-width="50" /> |
| | | <el-table-column prop="patternQuantity" align="center" :label="$t('film.thickremainquant')" min-width="50" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.taskstatus')" |
| | | min-width="80" |
| | | min-width="50" |
| | | prop="taskState" |
| | | > |
| | | <template #default="scope"> |
| | |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.enabletype')" |
| | | min-width="80" |
| | | min-width="50" |
| | | prop="taskType" |
| | | > |
| | | <template #default="scope"> |
| | |
| | | </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-column prop="formattedCreateTime" align="center" :label="$t('reportmanage.starttime')" min-width="50" /> |
| | | <el-table-column prop="formattedUpdateTime" align="center" :label="$t('reportmanage.endtime')" min-width="50" /> |
| | | <el-table-column fixed="right" :label="$t('film.operate')" align="center"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="(scope.row.taskState !== 0)" type="text" plain @click="successfull(scope.row)">{{ $t('searchOrder.successfullyprocessed') }}</el-button> |
| | | <el-button :disabled="(scope.row.taskState !== 0)" type="text" plain @click="handleptask(scope.row)">{{ $t('searchOrder.taskfailure') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="margin-top: 20px;margin-left: 40%;"> |
| | | <el-pagination |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | const successfull = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.psuccessfullyprocessed'), |
| | | t('workOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('workOrder.yes'), |
| | | cancelButtonText: t('workOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | var url="/glassStorage/rawGlassStorageTask/taskSuccess?taskId="+ row.id; |
| | | const response = await request.post(url) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | } |
| | | }; |
| | | // 任务失败处理 |
| | | const handleptask = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.ptaskfailure'), |
| | | t('workOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('workOrder.yes'), |
| | | cancelButtonText: t('workOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | var url="/glassStorage/rawGlassStorageTask/taskError?taskId="+ row.id; |
| | | const response = await request.post(url) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | } |
| | | }; |
| | | const handlePageChange2 = (newPage) => { |
| | | currentPage2.value = newPage; |
| | | console.log(currentPage2.value); |
| | | window.localStorage.setItem('pagenumber', currentPage2.value) |
| | | historicala(currentPage2.value); |
| | | }; |
| | |
| | | stateList=[selectValuesa[1]]; |
| | | } |
| | | } |
| | | console.log(startSlot.value); |
| | | |
| | | if(startSlot.value != ""){ |
| | | pstartSlot = startSlot.value |
| | | }else{ |
| | |
| | | pageSize: 20, |
| | | taskState: celllist, |
| | | taskType: stateList, |
| | | beginDate: (timeRange.value && timeRange.value[0]) || '', |
| | | endDate: (timeRange.value && timeRange.value[1]) || '', |
| | | beginDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[0])) || '', |
| | | endDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[1])) || '', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 历史查询点击 |
| | |
| | | pageSize: 20, |
| | | taskState: celllist, |
| | | taskType: stateList, |
| | | beginDate: (timeRange.value && timeRange.value[0]) || '', |
| | | endDate: (timeRange.value && timeRange.value[1]) || '', |
| | | beginDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[0])) || '', |
| | | endDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[1])) || '', |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 格式化时间戳为年月日时间字符串的函数 |
| | |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | const shortcuts = [ |
| | | { |
| | | text: '最近一周', |
| | | value: () => { |
| | | const backendTime = new Date(getglobalDate) |
| | | const oneWeekAgo = new Date(getglobalDate) |
| | | oneWeekAgo.setHours(0, 0, 0, 0); |
| | | oneWeekAgo.setDate(oneWeekAgo.getDate() - 7) |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)] |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | }, |
| | | }, |
| | | { |
| | | text: '最近一个月', |
| | | value: () => { |
| | | const backendTime = new Date(getglobalDate) |
| | | const oneWeekAgo = new Date(getglobalDate) |
| | | oneWeekAgo.setHours(0, 0, 0, 0); |
| | | oneWeekAgo.setMonth(oneWeekAgo.getMonth() - 1) |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)] |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | }, |
| | | }, |
| | | { |
| | | text: '最近三个月', |
| | | value: () => { |
| | | const backendTime = new Date(getglobalDate) |
| | | const oneWeekAgo = new Date(getglobalDate) |
| | | oneWeekAgo.setHours(0, 0, 0, 0); |
| | | oneWeekAgo.setMonth(oneWeekAgo.getMonth() - 3) |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)] |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | }, |
| | | }, |
| | | ] |
| | | // 格式化后端时间并计算一周前的时间 |
| | | 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天 |
| | | oneWeekAgo.setHours(0, 0, 0, 0); |
| | | console.log(formatTimestamp(oneWeekAgo)); |
| | | console.log(oneWeekAgo); |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]; |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | } |