| src/api/routingInspection/routingInspection.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/detail/indexJX.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/detail/indexLS.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/routingInspection/list/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | 
src/api/routingInspection/routingInspection.ts
@@ -18,6 +18,22 @@ 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": { @@ -145,12 +143,6 @@ "path": "pages/production/index", "style": { "navigationBarTitleText": "ç产管ç" } }, { "path": "pages/routingInspection/index", "style": { "navigationBarTitleText": "å·¡æ£" } }, { @@ -290,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": { src/pages/routingInspection/detail/indexJX.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,285 @@ <template> <view class="list"> <div class="inspection-report"> <!-- åºæ¬ä¿¡æ¯æ¨¡å --> <wd-row> <text class="title">{{ "åºæ¬ä¿¡æ¯" }}</text> <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> <text class="title">{{ "èªæ£è®°å½è¯¦æ " }}</text> <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> <text class="title">{{ "ç»ææ£æ¥" }}</text> <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"> <text class="title">{{ "ç»ææ åå¼å宿µ" }}</text> <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"> <text class="title">{{ "ç»çº¿å·¥èºè´¨éæ§å¶" }}</text> <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> <text class="title">{{ "å¤è§åç»è®º" }}</text> <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> <text class="title">{{ "å·¡æ£ç»æ" }}</text> <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"> <text class="title">{{ "éä»¶" }}</text> <!-- ç¨ 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> </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 recordData = ref<any>({}); const show = ref(false); const previewImageUrl = ref(""); // ç¶æç±»åæ å° 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; }; </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/detail/indexLS.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,294 @@ <template> <view class="list"> <div class="inspection-report"> <!-- åºæ¬ä¿¡æ¯æ¨¡å --> <wd-row> <text class="title">{{ "åºæ¬ä¿¡æ¯" }}</text> <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> <text class="title">{{ "èªæ£è®°å½è¯¦æ " }}</text> <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> <text class="title">{{ "æ£éªç»æ" }}</text> <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"> <text class="title">{{ "å·¡æ£ç»æ" }}</text> <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"> <text class="title">{{ "éä»¶" }}</text> <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 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; }; </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/list/index.vue
@@ -55,14 +55,15 @@ const toDetail = (id: number, deviceType: number) => { console.log('ç¹å»å¡ç', id, deviceType); toast.show("ç¹å»å¡ç"); if (deviceType == 0) { if (deviceType == 1) { // ç»çº¿ uni.navigateTo({ url: `/pages/production/detail/wireDetail?id=${id}`, url: `/pages/routingInspection/detail/indexJX?id=${id}&deviceType=${deviceType}`, }); } else if (deviceType == 1) { } else if (deviceType == 0) { // æä¸ uni.navigateTo({ url: `/pages/production/detail/twistDetail?id=${id}`, url: `/pages/routingInspection/detail/indexLS?id=${id}&deviceType=${deviceType}`, }); } };