| src/api/routingInspection/routingInspection.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/index/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/detail/indexJX.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/detail/indexLS.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/list/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/product_card/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/static/icons/routingInspection.png | 补丁 | 查看 | 原始文档 | blame | 历史 | 
src/api/routingInspection/routingInspection.ts
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,39 @@ 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, }); }, // è·åæä¸åä¸ªç»æè®°å½ 0 getDrawInspectInfoById(params: any) { return request<BaseResult<any>>({ url: "/wireInspection/getDrawInspectInfoById/" + params.id, method: "GET", // data: params, }); }, // è·åç»çº¿åä¸ªç»æè®°å½ 1 getStrandedInspectionStructureInfoById(params: any) { return request<BaseResult<any>>({ url: "/wireInspection/getStrandedInspectionStructureInfoById/" + params.id, method: "GET", // data: params, }); }, }; export default RoutingInspectionApi; src/pages.json
@@ -6,7 +6,6 @@ "^cu-(.*)": "@/components/cu-$1/index.vue" } }, "pages": [ { "path": "pages/index/index", @@ -98,7 +97,6 @@ "navigationBarTitleText": "ä¸ªäººèµæ" } }, { "path": "pages/work/user/index", "style": { @@ -284,6 +282,24 @@ "style": { "navigationBarTitleText": "æ¶ææ¥å·¥" } }, { "path": "pages/routingInspection/index", "style": { "navigationBarTitleText": "å·¡æ£" } }, { "path": "pages/routingInspection/detail/indexJX", "style": { "navigationBarTitleText": "ç»çº¿å·¡æ£è¯¦æ " } }, { "path": "pages/routingInspection/detail/indexLS", "style": { "navigationBarTitleText": "æä¸å·¡æ£è¯¦æ " } } ], "globalStyle": { @@ -317,4 +333,4 @@ } ] } } } src/pages/index/index.vue
@@ -177,6 +177,12 @@ url: "/pages/timely/index", show: false, }, { icon: "/static/icons/routingInspection.png", title: "å·¡æ£", url: "/pages/routingInspection/index", show: true, }, ]); // å 载访é®ç»è®¡æ°æ® src/pages/routingInspection/detail/indexJX.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,463 @@ <template> <view class="fixed-header"> <view class="header-container"> <wd-button icon="file-add" :round="false" size="small" custom-class="add_btn" @click="editList" v-if="!isEdit" > ç¼è¾ </wd-button> <wd-button icon="close" type="info" :round="false" size="small" custom-class="add_btn" @click="close" v-if="isEdit" > åæ¶ </wd-button> <wd-button icon="check" type="success" :round="false" size="small" custom-class="add_btn" @click="saveList" v-if="isEdit" > ä¿å </wd-button> <view class="placeholder"></view> <view class="scan-wrapper" @click="openScan"> <wd-icon name="scan" size="24px" color="#0D867F"></wd-icon> </view> </view> </view> <view class="list"> <!-- åºæ¬ä¿¡æ¯æ¨¡å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "åºæ¬ä¿¡æ¯" }}</text> </view> <wd-col :span="24"> <wd-form-item label="æ¥æ" prop="recordDate"> {{ formatDate(recordData.fixedInfo?.recordDate) }} </wd-form-item> <wd-form-item label="çæ¬¡" prop="workShift"> {{ formatValue(recordData.fixedInfo?.workShift) }} </wd-form-item> <wd-form-item label="åå·è§æ ¼" prop="model"> {{ formatValue(recordData.fixedInfo?.model) }} </wd-form-item> <wd-form-item label="æå线çå·" prop="systemNo"> {{ formatValue(recordData.fixedInfo?.systemNo) }} </wd-form-item> <wd-form-item label="è®°å½äºº" prop="createUserName"> {{ formatValue(recordData.fixedInfo?.createUserName) }} </wd-form-item> <wd-form-item label="æºå°" prop="deviceModel"> {{ formatValue(recordData.fixedInfo?.deviceModel) }} </wd-form-item> <wd-form-item label="产åç±»å«" prop="productType"> {{ formatValue(recordData.fixedInfo?.productType) }} </wd-form-item> <wd-form-item label="ç产é¿åº¦" prop="actuallyLength"> {{ formatValue(recordData.fixedInfo?.actuallyLength, "m") }} </wd-form-item> <wd-form-item label="å¼ å设置" prop="twistTension"> {{ formatValue(recordData.fixedInfo?.twistTension, "N/m") }} </wd-form-item> <wd-form-item label="ç»å¶å¤å¾" prop="twistDiameter"> {{ formatValue(recordData.inspectionResult?.twistDiameter, "mm") }} </wd-form-item> </wd-col> </wd-row> <!-- èªæ£è®°å½è¯¦æ 模å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "èªæ£è®°å½è¯¦æ " }}</text> </view> <wd-col :span="24"> <wd-form-item label="è®°å½ä½ç½®" prop="recordPosition"> {{ recordData.structureInfo?.recordPosition || "-" }} </wd-form-item> <wd-form-item label="è®°å½äºº" prop="createUserName"> {{ recordData.structureInfo?.createUserName || "-" }} </wd-form-item> <wd-form-item label="ç¶æ" prop="status"> <wd-tag custom-class="space" :type="getStatusType(recordData.structureInfo?.status)"> {{ getStatusText(recordData.structureInfo?.status) }} </wd-tag> </wd-form-item> </wd-col> </wd-row> <!-- ç»ææ£æ¥æ¨¡å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "ç»ææ£æ¥" }}</text> </view> <wd-col :span="24"> <wd-form-item label="æåç»æ" prop="inspectStructure"> {{ recordData.structureInfo.structureRecordResult.inspectStructure.structureFormula || "-" }} </wd-form-item> </wd-col> </wd-row> <wd-row v-if="recordData.structureInfo.structureRecordResult.inspectStructure.structureItems"> <view style="margin: 10rpx"> <text class="title">{{ "ç»ææ åå¼å宿µ" }}</text> </view> <wd-col :span="24" v-for="(item, index) in recordData.structureInfo.structureRecordResult.inspectStructure .structureItems" :key="index" style="padding-bottom: 10px" > <wd-form-item :label="formatValue(item.structureName)" label-width="400rpx" style="color: red" ></wd-form-item> <wd-form-item label="æ åå¼" prop="structureValue"> {{ formatValue(item.structureValue) }} </wd-form-item> <wd-form-item label="宿µæ ¹æ°" prop="actualValue1"> {{ formatValue(item.actualValue1, "æ ¹") }} </wd-form-item> <wd-form-item label="宿µç´å¾" prop="actualValue2"> {{ formatValue(item.actualValue2, "mm") }} </wd-form-item> </wd-col> </wd-row> <!-- ç»çº¿å·¥èºè´¨éæ§å¶æ¨¡å --> <wd-row v-if="recordData.structureInfo?.structureRecordResult?.inspectTwist"> <view style="margin: 10rpx"> <text class="title">{{ "ç»çº¿å·¥èºè´¨éæ§å¶" }}</text> </view> <wd-col :span="24" v-for="(item, index) in recordData.structureInfo.structureRecordResult.inspectTwist" :key="index" style="padding-bottom: 10px" > <wd-form-item :label="formatValue(item.twistName)" label-width="400rpx" style="color: red" ></wd-form-item> <wd-form-item label="ç»å" prop="direction"> {{ formatValue(item.direction) }} </wd-form-item> <wd-form-item label="èè·" prop="pitch">{{ formatValue(item.pitch, "mm") }}</wd-form-item> <wd-form-item label="è徿¯" prop="pitchRatio"> {{ formatValue(item.pitchRatio) }} </wd-form-item> </wd-col> </wd-row> <!-- å¤è§åç»è®ºæ¨¡å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "å¤è§åç»è®º" }}</text> </view> <wd-col :span="24"> <wd-form-item label="ç»è®º" prop="conclusion"> {{ formatValue(recordData.structureInfo.structureRecordResult.conclusion) }} </wd-form-item> <wd-form-item label="产åå¤è§" prop="productAppearance"> {{ formatProductAppearance( recordData.structureInfo.structureRecordResult.productAppearance ) }} </wd-form-item> </wd-col> </wd-row> <!-- å·¡æ£ç»ææ¨¡å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "å·¡æ£ç»æ" }}</text> </view> <wd-col :span="24"> <wd-form-item label="æ ·åæ¯å¦é½å ¨" prop="sampleComplete"> {{ formatValue(recordData.inspectionResult?.sampleComplete) }} </wd-form-item> </wd-col> </wd-row> <!-- é件模å --> <wd-row class="attachment-section"> <view style="margin: 10rpx"> <text class="title">{{ "éä»¶" }}</text> </view> <!-- ç¨ flex 容å¨å 裹å¾çåï¼å®ç°èªå¨æ¢è¡ --> <view class="attachment-grid"> <wd-col v-for="(file, index) in recordData.structureInfo.files" :key="index" class="attachment-item" > <wd-img :width="80" :height="80" :src="file.url" @click="previewImage(file.url)"> <template #error> <view class="error-wrap">å 载失败</view> </template> <template #loading> <view class="loading-wrap"> <wd-loading /> </view> </template> </wd-img> </wd-col> </view> </wd-row> <wd-popup v-model="show" custom-style="border-radius:32rpx;" @close="handleClose"> <div class="image-preview"> <img :src="previewImageUrl" alt="é¢è§å¾ç" style="width: 100%; height: auto" /> </div> </wd-popup> </view> </template> <script setup lang="ts"> import { onLoad } from "@dcloudio/uni-app"; import RoutingInspectionApi from "@/api/routingInspection/routingInspection"; const paramsId = ref(""); const recordData = ref<any>({}); const show = ref(false); const previewImageUrl = ref(""); const isEdit = ref(false); // ç¶æç±»åæ å° const getStatusType = (status: number) => { switch (status) { case 0: return "warning"; // å¾ å·¡æ£ case 1: return "danger"; // 已驳å case 2: return "info"; // å¾ å®¡æ ¸ case 3: return "success"; // éè¿ default: return "info"; } }; // ç¶æææ¬æ å° const getStatusText = (status: number) => { switch (status) { case 0: return "å¾ å·¡æ£"; case 1: return "已驳å"; case 2: return "å¾ å®¡æ ¸"; case 3: return "éè¿"; default: return "æªç¥"; } }; // è·åå¤è§ææ¬ const getAppearanceText = (appearance: string[]) => { if (!appearance || appearance.length === 0) return "-"; return appearance.join("ã"); }; // æ ¼å¼å产åå¤è§æ¾ç¤º const formatProductAppearance = (productAppearance: string[]) => { if (!productAppearance || productAppearance.length === 0) return "-"; return productAppearance.join("ã"); }; // æ ¼å¼åæ°å¼æ¾ç¤º const formatValue = (value: any, unit?: string) => { if (value === null || value === undefined || value === "") return "-"; return unit ? `${value}${unit}` : value; }; // æ ¼å¼åæ¥ææ¾ç¤º const formatDate = (date: string) => { if (!date) return "-"; return new Date(date).toLocaleDateString("zh-CN", { year: "numeric", month: "2-digit", day: "2-digit", }); }; // æ ¼å¼åç»æå¼æ¾ç¤º const formatStructureValue = (value1: any, value2: any) => { const val1 = value1 || "-"; const val2 = value2 ? `${value2}mm` : "-"; return { count: val1, diameter: val2 }; }; const getDetailData = async (id: string, deviceType: string) => { try { let response; // è·åç»çº¿åä¸ªç»æ response = await RoutingInspectionApi.getStrandedInspectionStructureInfoById({ id: id, }); recordData.value = response.data; console.log(recordData.value); } catch (error) { console.error("è·å详æ 失败:", error); } }; onLoad((options: any) => { paramsId.value = options.id; getDetailData(options.id, options.deviceType); }); const previewImage = (url: string) => { previewImageUrl.value = url; show.value = true; }; const handleClose = () => { show.value = false; }; // ç¼è¾å表 const editList = () => {}; // å ³é const close = () => {}; // ä¿åå表 const saveList = async () => { // try { // let response; // // ä¿åå表 // response = await RoutingInspectionApi.saveStrandedInspectionStructureInfo({ // id: paramsId.value, // structureInfo: recordData.value.structureInfo, // }); // if (response.code === 200) { // uni.showToast({ // title: "ä¿åæå", // icon: "success", // }); // // å·æ°è¯¦æ æ°æ® // getDetailData(paramsId.value, recordData.value.deviceType); // } else { // uni.showToast({ // title: response.msg || "ä¿å失败", // icon: "error", // }); // } // } catch (error) { // console.error("ä¿åå表失败:", error); // uni.showToast({ // title: "ä¿å失败", // icon: "error", // }); // } }; </script> <style lang="scss" scoped> .placeholder { flex: 1; } .fixed-header { position: fixed; top: 44; left: 0; right: 0; background: #f3f9f8; z-index: 999; padding: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); min-height: 60px; box-sizing: border-box; overflow: visible; } .header-container { display: flex; align-items: center; width: 100%; gap: 10px; } .search-wrapper { flex: 1; min-width: 0; } :deep(.search-wrapper .wd-search) { width: 100% !important; min-width: 0 !important; } .scan-wrapper { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; padding: 6px; flex-shrink: 0; } .list { padding: 12px; padding-top: 84px; background: #f3f9f8; min-height: 100vh; box-sizing: border-box; } .title { position: relative; margin-left: 10px; font-size: 16px; font-weight: 500; color: #0d867f; } .title::after { position: absolute; content: ""; top: 4px; left: -10px; width: 4px; height: 16px; background: #0d867f; border-radius: 2px; } .attachment-section { width: 100%; } .attachment-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0; } .attachment-item { width: calc(25% - 10px); box-sizing: border-box; } @media (max-width: 768px) { .attachment-item { width: calc(25% - 10px); } } </style> src/pages/routingInspection/detail/indexLS.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,382 @@ <template> <view class="fixed-header"> <view class="header-container"> <wd-button icon="file-add" :round="false" size="small" custom-class="add_btn" @click="editList" v-if="!isEdit" > ç¼è¾ </wd-button> <wd-button icon="close" type="info" :round="false" size="small" custom-class="add_btn" @click="close" v-if="isEdit" > åæ¶ </wd-button> <wd-button icon="check" type="success" :round="false" size="small" custom-class="add_btn" @click="saveList" v-if="isEdit" > ä¿å </wd-button> <view class="placeholder"></view> <view class="scan-wrapper" @click="openScan"> <wd-icon name="scan" size="24px" color="#0D867F"></wd-icon> </view> </view> </view> <view class="list"> <div class="inspection-report"> <!-- åºæ¬ä¿¡æ¯æ¨¡å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "åºæ¬ä¿¡æ¯" }}</text> </view> <wd-col :span="24"> <wd-form-item label="æ¥æ" prop="recordDate"> {{ formatDate(detailData.fixedInfo?.recordDate) }} </wd-form-item> <wd-form-item label="æºå°" prop="deviceModel"> {{ formatValue(detailData.fixedInfo?.deviceModel) }} </wd-form-item> <wd-form-item label="çæ¬¡" prop="workShift"> {{ formatValue(detailData.fixedInfo?.workShift) }} </wd-form-item> <wd-form-item label="çç»" prop="teamName"> {{ formatValue(detailData.fixedInfo?.teamName) }} </wd-form-item> <wd-form-item label="åä¸è§æ ¼" prop="model"> {{ formatValue(detailData.fixedInfo?.model) }} </wd-form-item> <wd-form-item label="ç产轴æ°" prop="outputNumber"> {{ formatValue(detailData.fixedInfo?.outputNumber, "è½´") }} </wd-form-item> <wd-form-item label="åå·" prop="poleModel"> {{ formatValue(detailData.fixedInfo?.poleModel) }} </wd-form-item> <wd-form-item label="æ¹æ¬¡" prop="poleNumber"> {{ formatValue(detailData.fixedInfo?.poleNumber) }} </wd-form-item> <wd-form-item label="è®°å½äºº" prop="createUserName"> {{ formatValue(detailData.fixedInfo?.createUserName) }} </wd-form-item> <wd-form-item label="馿£çå·" prop="firstNo"> {{ formatValue(detailData.fixedInfo?.firstNo) }} </wd-form-item> </wd-col> </wd-row> <!-- èªæ£è®°å½è¯¦æ 模å --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "èªæ£è®°å½è¯¦æ " }}</text> </view> <wd-col :span="24"> <wd-form-item label="å·¡æ£å" prop="processInspectionUserName"> {{ detailData.processInspectionUserName || "-" }} </wd-form-item> <wd-form-item label="ç¶æ" prop="status"> <wd-tag custom-class="space" :type="getStatusType(detailData.status)"> {{ getStatusText(detailData.status) }} </wd-tag> </wd-form-item> </wd-col> </wd-row> <!-- æ£éªç»æ --> <wd-row> <view style="margin: 10rpx"> <text class="title">{{ "æ£éªç»æ" }}</text> </view> <wd-col :span="24"> <wd-form-item label="åä¸ç´å¾" prop="dia"> {{ formatValue(detailData.inspectionResult?.dia, "mm") || "-" }} </wd-form-item> <wd-form-item label="æå¤§ç´å¾" prop="maxDia"> {{ formatValue(detailData.inspectionResult?.maxDia, "mm") || "-" }} </wd-form-item> <wd-form-item label="æå°ç´å¾" prop="minDia"> {{ formatValue(detailData.inspectionResult?.minDia, "mm") || "-" }} </wd-form-item> <wd-form-item label="å¤è§" prop="appearance"> {{ formatProductAppearance(detailData.inspectionResult?.appearance) || "-" }} </wd-form-item> <wd-form-item label="å·ç»ç´§å¯" prop="windingTightness"> {{ formatValue(detailData.inspectionResult?.windingTightness) }} </wd-form-item> <wd-form-item label="æåæ´é½" prop="arrangementNeatness"> {{ formatValue(detailData.inspectionResult?.arrangementNeatness) }} </wd-form-item> <wd-form-item label="å¤å±é线离侧æ¿è¾¹ç¼è·ç¦»" prop="aluminumWireDistance" label-width="500rpx" > {{ formatValue(detailData.inspectionResult?.aluminumWireDistance, "mm") || "-" }} </wd-form-item> <wd-form-item label="æåæ¨¡åæ¥å¤´æ åµ" prop="jointCondition" label-width="250rpx"> {{ formatValue(detailData.inspectionResult?.jointCondition) || "-" }} </wd-form-item> <wd-form-item label="ç»è®º" prop="conclusion"> {{ formatValue(detailData.inspectionResult?.conclusion) || "-" }} </wd-form-item> </wd-col> </wd-row> <!-- å·¡æ£ç»æ --> <wd-row v-if="detailData.processInspectionResult?.isFully"> <view style="margin: 10rpx"> <text class="title">{{ "å·¡æ£ç»æ" }}</text> </view> <wd-col :span="24"> <wd-form-item label="éæåãä¸ãå°¾æ ·åæ¯å¦é½å ¨" prop="processInspectionUserName"> <wd-tag custom-class="space" :type="detailData.processInspectionResult?.isFully ? 'success' : 'danger'" > {{ detailData.processInspectionResult?.isFully ? "æ¯" : "å¦" }} </wd-tag> </wd-form-item> </wd-col> </wd-row> <!-- é件模å --> <wd-row class="attachment-section" v-if="detailData.files && detailData.files.length > 0"> <view style="margin: 10rpx"> <text class="title">{{ "éä»¶" }}</text> </view> <view class="attachment-grid"> <wd-col v-for="(file, index) in detailData.files" :key="index" class="attachment-item"> <wd-img :width="80" :height="80" :src="file.url" @click="previewImage(file.url)"> <template #error> <view class="error-wrap">å 载失败</view> </template> <template #loading> <view class="loading-wrap"> <wd-loading /> </view> </template> </wd-img> </wd-col> </view> </wd-row> </div> <wd-popup v-model="show" custom-style="border-radius:32rpx;" @close="handleClose"> <div class="image-preview"> <img :src="previewImageUrl" alt="é¢è§å¾ç" style="width: 100%; height: auto" /> </div> </wd-popup> </view> </template> <script setup lang="ts"> import { onLoad } from "@dcloudio/uni-app"; import RoutingInspectionApi from "@/api/routingInspection/routingInspection"; const paramsId = ref(""); const detailData = ref<any>({}); const show = ref(false); const previewImageUrl = ref(""); const isEdit = ref(false); // ç¶æç±»åæ å° const getStatusType = (status: number) => { switch (status) { case 0: return "warning"; // å¾ å·¡æ£ case 1: return "danger"; // 已驳å case 2: return "info"; // å¾ å®¡æ ¸ case 3: return "success"; // éè¿ default: return "info"; } }; // ç¶æææ¬æ å° const getStatusText = (status: number) => { switch (status) { case 0: return "å¾ å·¡æ£"; case 1: return "已驳å"; case 2: return "å¾ å®¡æ ¸"; case 3: return "éè¿"; default: return "æªç¥"; } }; // è·åå¤è§ææ¬ const getAppearanceText = (appearance: string[]) => { if (!appearance || appearance.length === 0) return "-"; return appearance.join("ã"); }; // æ ¼å¼å产åå¤è§æ¾ç¤º const formatProductAppearance = (productAppearance: string[]) => { if (!productAppearance || productAppearance.length === 0) return "-"; return productAppearance.join("ã"); }; // æ ¼å¼åæ°å¼æ¾ç¤º const formatValue = (value: any, unit?: string) => { if (value === null || value === undefined || value === "") return "-"; return unit ? `${value}${unit}` : value; }; // æ ¼å¼åæ¥ææ¾ç¤º const formatDate = (date: string) => { if (!date) return "-"; return new Date(date).toLocaleDateString("zh-CN", { year: "numeric", month: "2-digit", day: "2-digit", }); }; // æ ¼å¼åç»æå¼æ¾ç¤º const formatStructureValue = (value1: any, value2: any) => { const val1 = value1 || "-"; const val2 = value2 ? `${value2}mm` : "-"; return { count: val1, diameter: val2 }; }; const getDetailData = async (id: string, deviceType: string) => { try { let response; // è·åæä¸åä¸ªç»æ response = await RoutingInspectionApi.getDrawInspectInfoById({ id: id, }); detailData.value = response.data; console.log(detailData.value); } catch (error) { console.error("è·å详æ 失败:", error); } }; onLoad((options: any) => { paramsId.value = options.id; getDetailData(options.id, options.deviceType); }); const previewImage = (url: string) => { previewImageUrl.value = url; show.value = true; }; const handleClose = () => { show.value = false; }; // ç¼è¾å表 const editList = () => {}; // å ³é const close = () => {}; // ä¿åå表 const saveList = async () => { // try { // let response; // // ä¿åå表 // response = await RoutingInspectionApi.saveStrandedInspectionStructureInfo({ // id: paramsId.value, // structureInfo: recordData.value.structureInfo, // }); // if (response.code === 200) { // uni.showToast({ // title: "ä¿åæå", // icon: "success", // }); // // å·æ°è¯¦æ æ°æ® // getDetailData(paramsId.value, recordData.value.deviceType); // } else { // uni.showToast({ // title: response.msg || "ä¿å失败", // icon: "error", // }); // } // } catch (error) { // console.error("ä¿åå表失败:", error); // uni.showToast({ // title: "ä¿å失败", // icon: "error", // }); // } }; </script> <style lang="scss" scoped> .list { height: calc(100vh - 80px); padding: 12px; background: #f3f9f8; :deep() { .round { border-radius: 4px; } } } .title { position: relative; margin-left: 10px; font-size: 16px; font-weight: 500; color: #0d867f; } .title::after { position: absolute; content: ""; top: 4px; left: -10px; width: 4px; height: 16px; background: #0d867f; border-radius: 2px; } .attachment-section { width: 100%; } .attachment-grid { display: flex; flex-wrap: wrap; /* è¶ åºèªå¨æ¢è¡ */ gap: 10px; /* å¾çä¹é´çé´è· */ padding: 10px 0; } .attachment-item { width: calc(25% - 10px); /* æ¯è¡4å¼ ï¼é´è·ç±gapæ§å¶ï¼é计ç®å®½åº¦ */ box-sizing: border-box; } /* éé å°å±å¹ï¼å¯è°æ´æ¯è¡æ°éï¼å¦æ¯è¡2å¼ ï¼ */ @media (max-width: 768px) { .attachment-item { width: calc(25% - 10px); } } </style> src/pages/routingInspection/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,149 @@ <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="patrolList.length"> <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> src/pages/routingInspection/list/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,112 @@ <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); if (deviceType == 1) { // ç»çº¿ uni.navigateTo({ url: `/pages/routingInspection/detail/indexJX?id=${id}&deviceType=${deviceType}`, }); } else if (deviceType == 0) { // æä¸ uni.navigateTo({ url: `/pages/routingInspection/detail/indexLS?id=${id}&deviceType=${deviceType}`, }); } }; 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> src/pages/routingInspection/product_card/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,235 @@ <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: 800rpx;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: 8px; 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> src/static/icons/routingInspection.png