| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | import { BaseResult } from "@/models/base"; |
| | | |
| | | const RoutingInspectionApi = { |
| | | // æ¥è¯¢å·¡æ£è®°å½ |
| | | getDeviceInspectListByPatrol(params: any) { |
| | | return request<BaseResult<any>>({ |
| | | url: "/wireInspection/getDeviceInspectListByPatrol", |
| | | method: "GET", |
| | | data: params, |
| | | }); |
| | | }, |
| | | // è·åå·¡æ£æ°æ® |
| | | getInspectListByPatrol(data: any) { |
| | | return request<BaseResult<any>>({ |
| | | url: "/wireInspection/getInspectListByPatrol", |
| | | method: "POST", |
| | | data: data, |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | export default RoutingInspectionApi; |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/routingInspection/index", |
| | | "style": { |
| | | "navigationBarTitleText": "å·¡æ£" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/production/detail/wireDetail", |
| | | "style": { |
| | | "navigationBarTitleText": "æä¸è¯¦æ
" |
| | |
| | | url: "/pages/timely/index", |
| | | show: false, |
| | | }, |
| | | { |
| | | icon: "/static/icons/routingInspection.png", |
| | | title: "å·¡æ£", |
| | | url: "/pages/routingInspection/index", |
| | | show: true, |
| | | }, |
| | | ]); |
| | | |
| | | // å 载访é®ç»è®¡æ°æ® |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <wd-row> |
| | | <wd-col :span="21"> |
| | | <wd-search placeholder-left hide-cancel></wd-search> |
| | | </wd-col> |
| | | <wd-col :span="3"> |
| | | <view class="scan_box" @click="openScan"> |
| | | <wd-icon name="scan" size="24px" color="#0D867F"></wd-icon> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | <wd-tabs v-model="tab" auto-line-width slidable="always" map-num> |
| | | <wd-tab |
| | | v-for="(item, index) in patrolList" |
| | | :key="index" |
| | | :title="`${item.deviceModel}ï¼å¾
æ£æ¥${item.pendingNum}æ¡ï¼`" |
| | | class="tab_bg" |
| | | > |
| | | <ProductList |
| | | :api="RoutingInspectionApi.getInspectListByPatrol" |
| | | :ProList="item" |
| | | /> |
| | | </wd-tab> |
| | | </wd-tabs> |
| | | <Scan ref="scanRef" emitName="scan" /> |
| | | <wd-toast /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref, reactive, computed, onMounted, onUnmounted } from "vue"; |
| | | import ProductList from "./list/index.vue"; |
| | | import Scan from "@/components/scan/index.vue"; |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import reportApi from "@/api/work/report"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import RoutingInspectionApi from "@/api/routingInspection/routingInspection"; |
| | | |
| | | const scanRef = ref(); |
| | | const userStore = useUserStore(); |
| | | const userInfo: any = computed(() => userStore.userInfo); |
| | | const toast = useToast(); |
| | | const tab = ref<number>(0); |
| | | const patrolList = ref<any[]>([]);// å·¡æ£è®¾å¤åè¡¨æ°æ® |
| | | |
| | | |
| | | const handlePatrolData = (index: number, count: number) => { |
| | | // å¯ä»¥å¨è¿éæ´æ°ç¹å®å·¡æ£è®¾å¤çå¾
æ£æ¥æ°é |
| | | // ä¾å¦ï¼patrolList.value[index].pendingNum = count; |
| | | }; |
| | | |
| | | const openScan = () => { |
| | | scanRef.value.triggerScan(); |
| | | }; |
| | | |
| | | const getScanCode = async () => { |
| | | const { code } = await reportApi.sendWorkTime({ |
| | | userName: userInfo.value.userName, |
| | | }); |
| | | if (code == 200) { |
| | | toast.success("æ«ç æå"); |
| | | } |
| | | }; |
| | | |
| | | // è·åç¹å®å·¡æ£è®¾å¤çæ°æ® |
| | | const getPatrolData = (item: any) => { |
| | | return async (params: any) => { |
| | | // è¿éå¯ä»¥æ ¹æ®itemä¸çä¿¡æ¯è°ç¨ç¸åºçæ¥å£è·å详æ
|
| | | // è¿åçæ°æ®æ ¼å¼éè¦ä¸ProductListç»ä»¶ææçæ ¼å¼ä¸è´ |
| | | return { |
| | | code: 200, |
| | | data: { |
| | | type: "å·¡æ£", |
| | | data: { |
| | | total: 0, |
| | | records: [] |
| | | } |
| | | } |
| | | }; |
| | | }; |
| | | }; |
| | | |
| | | // è·åå·¡æ£è®¾å¤å表 |
| | | const loadPatrolList = async () => { |
| | | try { |
| | | const { data } = await RoutingInspectionApi.getDeviceInspectListByPatrol({}); |
| | | if (data) { |
| | | patrolList.value = data; |
| | | } |
| | | } catch (error) { |
| | | toast.error("è·åå·¡æ£è®¾å¤å表失败"); |
| | | } |
| | | }; |
| | | |
| | | // ç¡®ä¿å
ç§»é¤åæ·»å çå¬ |
| | | const setupScanListener = () => { |
| | | uni.$off("scan", getScanCode); // å
ç§»é¤æ§ç |
| | | uni.$on("scan", getScanCode); // åæ·»å æ°ç |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // å¼å¯å¹¿æçå¬äºä»¶ |
| | | setupScanListener(); |
| | | console.log("æ¾ç¤º1"); |
| | | // 页é¢å è½½æ¶è·åå·¡æ£è®¾å¤å表 |
| | | loadPatrolList(); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | // å¼å¯å¹¿æçå¬äºä»¶ |
| | | uni.$off("scan", getScanCode); |
| | | console.log("离å¼1"); |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep .wd-search__block { |
| | | border-radius: unset; |
| | | } |
| | | .scan_box { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 38px; |
| | | height: 38px; |
| | | padding: 6px; |
| | | background: #fff; |
| | | } |
| | | ::v-deep .wd-tabs__line { |
| | | background: #0d867f; |
| | | } |
| | | ::v-deep .wd-tabs__nav { |
| | | border-bottom: 1px #dddddd solid; |
| | | } |
| | | .tab_bg { |
| | | background: #f3f9f8; |
| | | } |
| | | |
| | | .icon_box { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 20px; |
| | | height: 20px; |
| | | background: #e7f4ec99; |
| | | border-radius: 50%; |
| | | } |
| | | |
| | | .statistics_box { |
| | | margin: 15px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="card_box"> |
| | | <z-paging ref="pagingRef" v-model="list" :fixed="false" :auto-show-back-to-top="true" @query="getList"> |
| | | <ProductCard v-for="(item, index) in list" :key="index" :data="item" :map="map" |
| | | @click="toDetail(item.id, item.deviceType)" /> |
| | | </z-paging> |
| | | <wd-toast /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import ProductCard from "../product_card/index.vue"; |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import zPaging from "@/components/z-paging/z-paging.vue"; |
| | | import { useToast } from "wot-design-uni"; |
| | | |
| | | const toast = useToast(); |
| | | const userStore = useUserStore(); |
| | | const userInfo : any = computed(() => userStore.userInfo); |
| | | const pagingRef = ref(); |
| | | const map = reactive({ |
| | | deviceModel: "deviceModel", |
| | | model: "model", |
| | | firstNo: "firstNo", |
| | | recordDate: "recordDate", |
| | | workShift: "workShift", |
| | | teamName: "teamName", |
| | | poleModel: "poleModel", |
| | | poleNumber: "poleNumber", |
| | | outputNumber: "outputNumber", |
| | | inspectPerson: "inspectPerson", |
| | | status: "status", |
| | | rejectList: [ |
| | | { |
| | | rejectPerson: "rejectPerson", |
| | | rejectTime: "rejectTime", |
| | | rejectReason: { |
| | | reason: "reason" |
| | | }, |
| | | }, |
| | | ], // æ¹ä¸ºå¯¹è±¡ï¼å
嫿éçåµå¥å±æ§ |
| | | }); |
| | | const props = defineProps({ |
| | | api: { |
| | | type: Function, |
| | | default: () => { }, |
| | | }, |
| | | ProList: { |
| | | type: Object, |
| | | default: () => { }, |
| | | }, |
| | | }); |
| | | |
| | | const list = ref<any[]>([]); |
| | | |
| | | const toDetail = (id: number, deviceType: number) => { |
| | | console.log('ç¹å»å¡ç', id, deviceType); |
| | | toast.show("ç¹å»å¡ç"); |
| | | if (deviceType == 0) { |
| | | uni.navigateTo({ |
| | | url: `/pages/production/detail/wireDetail?id=${id}`, |
| | | }); |
| | | } else if (deviceType == 1) { |
| | | uni.navigateTo({ |
| | | url: `/pages/production/detail/twistDetail?id=${id}`, |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const getList = async () => { |
| | | const { code, data } = await props.api({ |
| | | deviceModel: props.ProList.deviceModel, |
| | | status: "0", |
| | | deviceType: props.ProList.deviceType, |
| | | }); |
| | | if (code == 200) { |
| | | map.deviceModel = "deviceModel"; |
| | | map.model = "model"; |
| | | map.firstNo = "firstNo"; |
| | | map.recordDate = "recordDate"; |
| | | map.workShift = "workShift"; |
| | | map.teamName = "teamName"; |
| | | map.poleModel = "poleModel"; |
| | | map.poleNumber = "poleNumber"; |
| | | map.outputNumber = "outputNumber"; |
| | | map.inspectPerson = "inspectPerson"; |
| | | map.rejectList = [ |
| | | { |
| | | rejectPerson: "rejectPerson", |
| | | rejectTime: "rejectTime", |
| | | rejectReason: { |
| | | reason: "reason" |
| | | }, |
| | | }, |
| | | ]; |
| | | map.status = "status"; |
| | | if (data.total == 0) { |
| | | pagingRef.value.complete(true); |
| | | } else { |
| | | console.log('data.records', data.records); |
| | | pagingRef.value.complete(data.records); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .card_box { |
| | | height: calc(100vh - 120px); |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <wd-card class="card_bg" @click="handleCardClick"> |
| | | <template #title> |
| | | <view class="flex justify-between w-full"> |
| | | <text class="font-medium text-[#252525]">æºå°: {{ data[map.deviceModel] }}</text> |
| | | <wd-tag color="#0D867F" bg-color="#E7F4EC"> |
| | | <text class="text-xs">{{ data[map.model] }}</text> |
| | | </wd-tag> |
| | | </view> |
| | | </template> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="24"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | 馿£åå·: |
| | | <text class="text-[#252525]">{{ data[map.firstNo] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="24"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | çæ¬¡: |
| | | <text class="text-[#252525]">{{ data[map.workShift] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="24"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | çç»: |
| | | <text class="text-[#252525]">{{ data[map.teamName] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="24"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | é¢ç¨æå·: |
| | | <text class="text-[#252525]">{{ data[map.poleNumber] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | <wd-col :span="12"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | æåå·: |
| | | <text class="text-[#252525]">{{ data[map.poleModel] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="12"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | ç产轴æ°: |
| | | <text class="text-[#252525]">{{ data[map.outputNumber] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | |
| | | </wd-row> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="12"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | èªæ£äºº: |
| | | <text class="text-[#252525]">{{ data[map.inspectPerson] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | <wd-col :span="12"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | ç¶æ: |
| | | <text class="text-[#252525]">{{ data[map.status] == 1 ? "被驳å" : "å·¡æ£" }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | <wd-row class="my-2"> |
| | | <wd-col :span="16"> |
| | | <view class="flex"> |
| | | <view class="icon_box"> |
| | | <wd-icon name="folder" color="#0D867F"></wd-icon> |
| | | </view> |
| | | <text class="text-[#646874] mx-2"> |
| | | è®°å½æ¶é´: |
| | | <text class="text-[#252525]">{{ data[map.recordDate] }}</text> |
| | | </text> |
| | | </view> |
| | | </wd-col> |
| | | <wd-col :span="8"> |
| | | <view class="flex"> |
| | | <wd-button v-if="data[map.status] == 1" size="small" type="primary" @click.stop="showRejectPopup = true" |
| | | style="margin-left: auto;"> |
| | | æ¥ç驳åä¿¡æ¯ |
| | | </wd-button> |
| | | </view> |
| | | </wd-col> |
| | | </wd-row> |
| | | </wd-card> |
| | | <wd-popup v-model="showRejectPopup" title="驳åä¿¡æ¯" custom-style="border-radius:32rpx;height: 500rpx;width: 600rpx;"> |
| | | <wd-card v-for="(item, index) in data.rejectList" :key="index" |
| | | :class="index % 2 === 0 ? 'reject-card-bg-1' : 'reject-card-bg-2'" |
| | | style="margin-bottom: 15px; padding: 10px; border-radius: 8px;"> |
| | | <view class="content"> |
| | | <view> |
| | | <view style="display: flex; justify-content: space-between; align-items: center; color: rgba(0,0,0,0.85); font-size: 14px; margin-bottom: 8px;"> |
| | | <view>{{ item.rejectPerson }}</view> |
| | | <view>{{ item.rejectTime }}</view> |
| | | </view> |
| | | <view style="color: rgba(0,0,0,0.85); font-size: 14px; word-break: break-word; overflow-wrap: break-word; max-width: 100%; padding: 5px 0;"> |
| | | {{ item.rejectReason.reason }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </wd-popup> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from "vue"; |
| | | const emit = defineEmits(['click']); |
| | | defineProps({ |
| | | data: { |
| | | type: Object, |
| | | default: () => { }, |
| | | }, |
| | | map: { |
| | | type: Object, |
| | | default: () => { }, |
| | | }, |
| | | }); |
| | | const showRejectPopup = ref<boolean>(false) |
| | | const handleCardClick = () => { |
| | | emit('click'); |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .card_bg { |
| | | box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.05); |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | // æ·»å ï¼ä¸¤ç§ä¸åçèæ¯è²æ ·å¼ |
| | | .reject-card-bg-1 { |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | .reject-card-bg-2 { |
| | | background-color: #eef2f7; |
| | | } |
| | | |
| | | .page-class { |
| | | :deep() { |
| | | .custom-shadow { |
| | | box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%); |
| | | } |
| | | } |
| | | } |
| | | |
| | | .header { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | // ä¿®æ¹ï¼è°æ´å
容åºåçæ ·å¼ |
| | | .content { |
| | | padding: 5px; |
| | | } |
| | | </style> |