| | |
| | | v-model="dataList" |
| | | :auto="false" |
| | | @query="queryList" |
| | | refresher-only |
| | | show-refresher-update-time |
| | | > |
| | | <template #top> |
| | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | const queryList = () => { |
| | | // 这里的pageNo和pageSize会自动计算好,直接传给服务器即可 |
| | | // 这里的请求只是演示,请替换成自己的项目的网络请求,并在网络请求回调中通过paging.value.complete(请求回来的数组)将请求结果传给z-paging |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | inspCode: inspSt.inspCode, |
| | | } |
| | | |
| | | getInspStRecordList(params) |
| | | .then((res: any) => { |
| | | // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了 |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | | paging.value.complete(res.rows, res.total) |
| | | }) |
| | | .catch((res) => { |
| | | // 如果请求失败写paging.value.complete(false),会自动展示错误页面 |
| | |
| | | v-model="dataList" |
| | | @query="queryList" |
| | | :auto="false" |
| | | refresher-only |
| | | show-refresher-update-time |
| | | > |
| | | <template #top> |
| | |
| | | dyzCount: null, |
| | | specialNote: '', |
| | | }) |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | const queryList = () => { |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize: 30, |
| | | maintCode: maintCode.value, |
| | | } |
| | | getMaintStOrderList(params) |
| | |
| | | } |
| | | }) |
| | | }) |
| | | console.log(res) |
| | | // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了 |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | |
| | | let className = ''; |
| | | |
| | | switch (value) { |
| | | case '保养中': { |
| | | className = 'dot-blue'; |
| | | break; |
| | | } |
| | | case '已完成': { |
| | | className = 'dot-green'; |
| | | break; |
| | | } |
| | | case '未完成': { |
| | | case '待保养': { |
| | | className = 'dot-gray'; |
| | | break; |
| | | } |
| | | case '待验证': { |
| | | className = 'dot-orange'; |
| | | break; |
| | | } |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="试产列表"> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="保养报表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <span class="ml-4 mr-2">-</span>未生成计划 <span class="dot-orange ml-4"></span>未完成 <span class="dot-green ml-4"></span>已完成 |
| | | <span class="ml-4 mr-2">-</span>未生成计划 <span class="dot-gray ml-4"></span>待保养 <span class="dot-blue ml-4"></span>保养中 <span class="dot-orange ml-4"></span>待验证 <span class="dot-green ml-4"></span>已完成 |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | |
| | | border-radius: 50%; |
| | | background-color: #8a2ad8; |
| | | } |
| | | :deep(.dot-gray) { |
| | | display: inline-block; |
| | | width: 10px; |
| | | height: 10px; |
| | | border-radius: 50%; |
| | | background-color: #d9d9d9; |
| | | } |
| | | </style> |
| | |
| | | planBoQueryWrapper.eq("mp.status", DictConstants.SYS_NORMAL_DISABLE_DETAIL.NORMAL); |
| | | planBoQueryWrapper .eq("equ.status", DictConstants.EIMS_EQU_STATUS_DETAIL.SHIYONG); |
| | | // 过滤下次运行时间等于当天时间的 |
| | | planBoQueryWrapper.eq("mp.maint_next_time", DateUtils.getDate()); |
| | | // planBoQueryWrapper.eq("mp.maint_next_time", DateUtils.getDate()); |
| | | // 过滤没有保养周期的数据 |
| | | planBoQueryWrapper.isNotNull("mp.maint_cycle"); |
| | | planBoQueryWrapper.isNotNull("mp.maint_cycle_unit"); |
| | |
| | | order -> String.valueOf(order.getPlanTime().toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate().getMonthValue()), |
| | | // 按月份分组后,判断该月是否全部status=3 |
| | | Collectors.collectingAndThen( |
| | | Collectors.toList(), |
| | | orders -> orders.stream().allMatch(o -> o.getStatus().equals("3")) |
| | | ? "已完成" |
| | | : "未完成" |
| | | orders -> { |
| | | boolean allZero = orders.stream().allMatch(o -> o.getStatus().equals("0")); |
| | | if (allZero) { |
| | | return MAINT_0; // 待保养 |
| | | } |
| | | boolean allGtOne = orders.stream().allMatch(o -> Integer.parseInt(o.getStatus()) > 1); |
| | | if (allGtOne) { |
| | | return MAINT_2; // 待验证 |
| | | } |
| | | boolean allGtTwo = orders.stream().allMatch(o -> Integer.parseInt(o.getStatus()) > 2); |
| | | if (allGtTwo) { |
| | | return MAINT_3; // 已完成 |
| | | } |
| | | return "保养中"; |
| | | } |
| | | ) |
| | | )); |
| | | Map<String, EimsMaintPlan> planMap = equMaintPlanList.stream() |
| | |
| | | for (int month = 1; month <= monthInYear; month++) { |
| | | String monthKey = "month_" + month; |
| | | if (planMap.containsKey(String.valueOf(month))) { |
| | | item.put(monthKey, UNCHECKED); |
| | | item.put(monthKey, MAINT_0); |
| | | } else if (orderMap.containsKey(String.valueOf(month))) { |
| | | String result = orderMap.get(String.valueOf(month)); |
| | | item.put(monthKey, result); |