| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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-info"> |
| | | <text class="scan-device-text">å½åæ«ç æºå°: {{ scannedDeviceModel || "æªæ«ç " }}</text> |
| | | </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(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" required> |
| | | <template v-if="isEdit"> |
| | | <wd-input v-model="formData.maxDia" placeholder="请è¾å
¥æå¤§ç´å¾(mm)" type="number" /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.maxDia, "mm") || "-" }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item label="æå°ç´å¾" prop="minDia" required> |
| | | <template v-if="isEdit"> |
| | | <wd-input v-model="formData.minDia" placeholder="请è¾å
¥æå°ç´å¾(mm)" type="number" /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.minDia, "mm") || "-" }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item label="å¤è§" prop="appearance" required> |
| | | <template v-if="isEdit"> |
| | | <view style="display: flex; flex-wrap: wrap; gap: 10px"> |
| | | <wd-checkbox |
| | | v-for="(opt, idx) in appearanceOptions" |
| | | :key="idx" |
| | | :value="opt.value" |
| | | :modelValue="formData.appearance?.includes(opt.value) || false" |
| | | @click="handleAppearanceClick(opt.value)" |
| | | style="width: 100px" |
| | | > |
| | | {{ opt.label }} |
| | | </wd-checkbox> |
| | | </view> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatProductAppearance(formData.appearance) }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item label="å·ç»ç´§å¯" prop="windingTightness" required> |
| | | <template v-if="isEdit"> |
| | | <wd-radio-group |
| | | v-model="formData.windingTightness" |
| | | inline |
| | | class="conclusion-radio-group" |
| | | > |
| | | <wd-radio |
| | | v-for="(opt, idx) in sampleCompleteOptions" |
| | | :key="idx" |
| | | :value="opt.value" |
| | | shape="dot" |
| | | > |
| | | {{ opt.label }} |
| | | </wd-radio> |
| | | </wd-radio-group> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.windingTightness) }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item label="æåæ´é½" prop="arrangementNeatness" required> |
| | | <template v-if="isEdit"> |
| | | <wd-radio-group |
| | | v-model="formData.arrangementNeatness" |
| | | inline |
| | | class="conclusion-radio-group" |
| | | > |
| | | <wd-radio |
| | | v-for="(opt, idx) in sampleCompleteOptions" |
| | | :key="idx" |
| | | :value="opt.value" |
| | | shape="dot" |
| | | > |
| | | {{ opt.label }} |
| | | </wd-radio> |
| | | </wd-radio-group> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.arrangementNeatness) }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item |
| | | label="å¤å±é线离侧æ¿è¾¹ç¼è·ç¦»" |
| | | prop="aluminumWireDistance" |
| | | label-width="360rpx" |
| | | required |
| | | > |
| | | <template v-if="isEdit"> |
| | | <wd-input |
| | | v-model="formData.aluminumWireDistance" |
| | | placeholder="请è¾å
¥è·ç¦»(mm)" |
| | | type="number" |
| | | /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.aluminumWireDistance, "mm") || "-" }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item label="æåæ¨¡åæ¥å¤´æ
åµ" prop="jointCondition" label-width="280rpx" required> |
| | | <template v-if="isEdit"> |
| | | <wd-radio-group v-model="formData.jointCondition" inline class="conclusion-radio-group"> |
| | | <wd-radio |
| | | v-for="(opt, idx) in jointConditionOptions" |
| | | :key="idx" |
| | | :value="opt.value" |
| | | shape="dot" |
| | | > |
| | | {{ opt.label }} |
| | | </wd-radio> |
| | | </wd-radio-group> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.jointCondition) || "-" }} |
| | | </template> |
| | | </wd-form-item> |
| | | |
| | | <wd-form-item label="ç»è®º" prop="conclusion" required> |
| | | <template v-if="isEdit"> |
| | | <wd-radio-group v-model="formData.conclusion" inline class="conclusion-radio-group"> |
| | | <wd-radio |
| | | v-for="(opt, idx) in conclusionOptions" |
| | | :key="idx" |
| | | :value="opt.value" |
| | | shape="dot" |
| | | > |
| | | {{ opt.label }} |
| | | </wd-radio> |
| | | </wd-radio-group> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(detailData.inspectionResult?.conclusion) || "-" }} |
| | | </template> |
| | | </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="isFully" |
| | | required |
| | | label-width="420rpx" |
| | | > |
| | | <template v-if="isEdit"> |
| | | <wd-radio-group v-model="formData.isFully" inline class="conclusion-radio-group"> |
| | | <wd-radio |
| | | v-for="(opt, idx) in sampleCompleteOptions" |
| | | :key="idx" |
| | | :value="opt.value" |
| | | shape="dot" |
| | | > |
| | | {{ opt.label }} |
| | | </wd-radio> |
| | | </wd-radio-group> |
| | | </template> |
| | | <template v-else> |
| | | <wd-tag |
| | | custom-class="space" |
| | | :type="detailData.processInspectionResult?.isFully ? 'success' : 'danger'" |
| | | > |
| | | {{ detailData.processInspectionResult?.isFully ? "æ¯" : "å¦" }} |
| | | </wd-tag> |
| | | </template> |
| | | </wd-form-item> |
| | | </wd-col> |
| | | </wd-row> |
| | | |
| | | <!-- é件模å --> |
| | | <wd-row class="attachment-section"> |
| | | <view style="margin: 10rpx"> |
| | | <text class="title">{{ "éä»¶" }}</text> |
| | | </view> |
| | | <wd-col :span="24"> |
| | | <AttachmentUpload |
| | | :detailData="detailData" |
| | | :isEdit="isEdit" |
| | | :deviceType="paramsType" |
| | | ref="attachmentRef" |
| | | /> |
| | | </wd-col> |
| | | </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> |
| | | <wd-toast /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, reactive, computed, onUnmounted } from "vue"; |
| | | import { onLoad, onShow, onHide } from "@dcloudio/uni-app"; |
| | | import RoutingInspectionApi from "@/api/routingInspection/routingInspection"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import AttachmentUpload from "../upload.vue"; |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import { useScanCode } from "@/composables/useScanCode"; |
| | | |
| | | // æ ¸å¿ç¶æ |
| | | const paramsId = ref(""); |
| | | const paramsType = ref(""); |
| | | const detailData = ref<any>({}); |
| | | const show = ref(false); |
| | | const previewImageUrl = ref(""); |
| | | const isEdit = ref(false); |
| | | const tempFiles = ref<any[]>([]); |
| | | const toast = useToast(); |
| | | const attachmentRef = ref<any>(null); |
| | | |
| | | // è·åå½åç»å½ç¨æ·ä¿¡æ¯ |
| | | const userStore = useUserStore(); |
| | | const userInfo: any = computed(() => userStore.userInfo); |
| | | |
| | | // ä½¿ç¨æ«ç 管ç composableï¼å
¨å±çå¬å¨ï¼ä¸é页é¢åæ¢å
³éï¼ |
| | | const { |
| | | deviceUid, |
| | | deviceModel: scannedDeviceModel, |
| | | loadFromCache, |
| | | enableListener, |
| | | } = useScanCode("scanLS"); |
| | | |
| | | // è¡¨åæ°æ® |
| | | const formData = reactive({ |
| | | dia: "", |
| | | maxDia: "", |
| | | minDia: "", |
| | | appearance: [] as string[], |
| | | windingTightness: "", |
| | | arrangementNeatness: "", |
| | | aluminumWireDistance: "", |
| | | jointCondition: "", |
| | | conclusion: "", |
| | | isFully: "", |
| | | }); |
| | | |
| | | // å¤è§é项 |
| | | const appearanceOptions = [ |
| | | { label: "æ å¤è§é®é¢", value: "æ å¤è§é®é¢" }, |
| | | { label: "表é¢å伤", value: "表é¢å伤" }, |
| | | { label: "ç´å¾ä¸å", value: "ç´å¾ä¸å" }, |
| | | { label: "å
¶ä»ç¼ºé·", value: "å
¶ä»ç¼ºé·" }, |
| | | ]; |
| | | const sampleCompleteOptions = [ |
| | | { label: "æ¯", value: "æ¯" }, |
| | | { label: "å¦", value: "å¦" }, |
| | | ]; |
| | | const jointConditionOptions = [ |
| | | { label: "æ", value: "æ" }, |
| | | { label: "æ ", value: "æ " }, |
| | | ]; |
| | | const conclusionOptions = [ |
| | | { label: "åæ ¼", value: "åæ ¼" }, |
| | | { label: "ä¸åæ ¼", value: "ä¸åæ ¼" }, |
| | | ]; |
| | | // ç¶ææ å° |
| | | const getStatusType = (status: number) => { |
| | | switch (status) { |
| | | case 0: |
| | | return "warning"; |
| | | case 1: |
| | | return "danger"; |
| | | case 2: |
| | | return "primary"; |
| | | case 3: |
| | | return "success"; |
| | | default: |
| | | return "default"; |
| | | } |
| | | }; |
| | | |
| | | const getStatusText = (status: number) => { |
| | | switch (status) { |
| | | case 0: |
| | | return "å¾
å·¡æ£"; |
| | | case 1: |
| | | return "已驳å"; |
| | | case 2: |
| | | return "å¾
å®¡æ ¸"; |
| | | case 3: |
| | | return "éè¿"; |
| | | default: |
| | | return "æªç¥"; |
| | | } |
| | | }; |
| | | |
| | | // æ ¼å¼åå·¥å
· |
| | | const formatProductAppearance = (productAppearance: string[]) => { |
| | | if (!productAppearance || !Array.isArray(productAppearance) || !productAppearance.length) { |
| | | return "-"; |
| | | } |
| | | return productAppearance.join("ã"); |
| | | }; |
| | | |
| | | // å¤çå¤è§éæ©çäºæ¥é»è¾ |
| | | const handleAppearanceClick = (value: string) => { |
| | | // ç¡®ä¿ appearance æ¯æ°ç» |
| | | if (!Array.isArray(formData.appearance)) { |
| | | formData.appearance = []; |
| | | } |
| | | |
| | | const currentValues = [...formData.appearance]; |
| | | const isCurrentlyChecked = currentValues.includes(value); |
| | | |
| | | let newSelection: string[] = []; |
| | | |
| | | if (value === "æ å¤è§é®é¢") { |
| | | if (isCurrentlyChecked) { |
| | | // åæ¶éä¸"æ å¤è§é®é¢" |
| | | newSelection = []; |
| | | } else { |
| | | // éä¸"æ å¤è§é®é¢"ï¼æ¸
空å
¶ä»é项 |
| | | newSelection = ["æ å¤è§é®é¢"]; |
| | | } |
| | | } else { |
| | | // ç¹å»å
¶ä»é项 |
| | | if (isCurrentlyChecked) { |
| | | // åæ¶éä¸è¯¥é项 |
| | | newSelection = currentValues.filter((v) => v !== value); |
| | | } else { |
| | | // éä¸è¯¥é项ï¼ç§»é¤"æ å¤è§é®é¢" |
| | | const filteredValues = currentValues.filter((v) => v !== "æ å¤è§é®é¢"); |
| | | newSelection = [...filteredValues, value]; |
| | | } |
| | | } |
| | | |
| | | formData.appearance = newSelection; |
| | | }; |
| | | |
| | | 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 initFormData = () => { |
| | | const inspectionResult = detailData.value.inspectionResult || {}; |
| | | const processInspectionResult = detailData.value.processInspectionResult || {}; |
| | | formData.dia = inspectionResult.dia || ""; |
| | | formData.maxDia = inspectionResult.maxDia || ""; |
| | | formData.minDia = inspectionResult.minDia || ""; |
| | | // ç¡®ä¿ appearance æ¯æ°ç» |
| | | formData.appearance = Array.isArray(inspectionResult.appearance) |
| | | ? inspectionResult.appearance |
| | | : inspectionResult.appearance |
| | | ? [inspectionResult.appearance] |
| | | : []; |
| | | formData.windingTightness = inspectionResult.windingTightness || ""; |
| | | formData.arrangementNeatness = inspectionResult.arrangementNeatness || ""; |
| | | formData.aluminumWireDistance = inspectionResult.aluminumWireDistance || ""; |
| | | formData.jointCondition = inspectionResult.jointCondition || ""; |
| | | formData.conclusion = inspectionResult.conclusion || ""; |
| | | formData.isFully = processInspectionResult.isFully ? "æ¯" : "å¦"; |
| | | }; |
| | | |
| | | // è·å详æ
|
| | | const getDetailData = async (id: string, deviceType: string) => { |
| | | try { |
| | | const response = await RoutingInspectionApi.getDrawInspectInfoById({ id }); |
| | | detailData.value = response.data; |
| | | |
| | | // 妿巡æ£å为空ï¼é»è®¤è®¾ç½®ä¸ºå½åç»å½ç¨æ· |
| | | if (!detailData.value.processInspectionUserName) { |
| | | detailData.value.processInspectionUserName = |
| | | userInfo.value?.nickName || userInfo.value?.userName || ""; |
| | | } |
| | | |
| | | tempFiles.value = []; |
| | | initFormData(); |
| | | } catch (error) { |
| | | console.error("è·å详æ
失败:", error); |
| | | } |
| | | }; |
| | | |
| | | // 页é¢å è½½ |
| | | onLoad((options: any) => { |
| | | paramsId.value = options.id; |
| | | paramsType.value = options.deviceType; |
| | | getDetailData(options.id, options.deviceType); |
| | | }); |
| | | |
| | | // ç¼è¾åæ¢ |
| | | const editList = () => { |
| | | isEdit.value = true; |
| | | }; |
| | | |
| | | // åæ¶ç¼è¾ |
| | | const close = () => { |
| | | isEdit.value = false; |
| | | tempFiles.value = []; |
| | | initFormData(); |
| | | }; |
| | | |
| | | // ä¿åç¼è¾ |
| | | const saveList = async () => { |
| | | // æ ¡éª |
| | | if (!formData.maxDia) return uni.showToast({ title: "æå¤§ç´å¾ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.minDia) return uni.showToast({ title: "æå°ç´å¾ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.appearance.length) return uni.showToast({ title: "å¤è§ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.windingTightness) return uni.showToast({ title: "å·ç»ç´§å¯ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.arrangementNeatness) |
| | | return uni.showToast({ title: "æåæ´é½ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.aluminumWireDistance) |
| | | return uni.showToast({ title: "å¤å±é线离侧æ¿è¾¹ç¼è·ç¦»ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.jointCondition) |
| | | return uni.showToast({ title: "æåæ¨¡åæ¥å¤´æ
åµä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.conclusion) return uni.showToast({ title: "ç»è®ºä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.isFully) return uni.showToast({ title: "éææ ·åæ¯å¦é½å
¨ä¸ºå¿
填项", icon: "none" }); |
| | | |
| | | // éªè¯æ«ç æ°æ®ï¼ä»ç¼åææ°æ«ç è·åï¼ |
| | | console.log("ä¿ååæ£æ¥ deviceUid:", deviceUid.value); |
| | | if (!deviceUid.value) { |
| | | return uni.showToast({ |
| | | title: "请å
æ«æè®¾å¤äºç»´ç ", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | const { newFiles } = attachmentRef.value.getSubmitFiles(); |
| | | console.log("newFiles", newFiles); |
| | | const allFileIds = [...newFiles]; |
| | | // æäº¤ |
| | | try { |
| | | const res = await RoutingInspectionApi.drawPatrolCheckInspection({ |
| | | deviceUid: deviceUid.value, |
| | | id: paramsId.value, |
| | | inspectionResult: { |
| | | dia: formData.dia, |
| | | maxDia: formData.maxDia, |
| | | minDia: formData.minDia, |
| | | appearance: formData.appearance, |
| | | windingTightness: formData.windingTightness, |
| | | arrangementNeatness: formData.arrangementNeatness, |
| | | aluminumWireDistance: formData.aluminumWireDistance, |
| | | jointCondition: formData.jointCondition, |
| | | conclusion: formData.conclusion, |
| | | }, |
| | | result: { isFully: formData.isFully }, |
| | | processInspectionAttachmentList: allFileIds, |
| | | }); |
| | | if (res.code === 200) { |
| | | // è®¾ç½®å·æ°æ è®°ï¼åè¯å表页éè¦å·æ° |
| | | uni.setStorageSync("needRefreshInspectionList", true); |
| | | |
| | | uni.showToast({ |
| | | title: "ä¿åæå", |
| | | icon: "success", |
| | | duration: 1500, |
| | | }); |
| | | // å»¶è¿è¿åå表页ï¼è®©ç¨æ·çå°æåæç¤º |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | }, 1500); |
| | | } else { |
| | | uni.showModal({ title: res.msg || "ä¿å失败", icon: "error" }); |
| | | } |
| | | } catch (e) { |
| | | console.error("ä¿å失败:", e); |
| | | uni.showModal({ title: e.message || "ä¿å失败", icon: "error" }); |
| | | } |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | | show.value = false; |
| | | }; |
| | | |
| | | const openScan = () => { |
| | | console.log("indexLS - ç¹å»æ«ç æé®ï¼å
¨å±æ«ç 模å¼ï¼æ éæå¨è§¦åï¼"); |
| | | // å
¨å±æ«ç 模å¼ä¸ï¼ç¡¬ä»¶æ«ç ä¼èªå¨è§¦åï¼æ éæå¨è°ç¨ |
| | | uni.showToast({ |
| | | title: "è¯·ä½¿ç¨æ«ç æªæ«æ", |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | // 页颿¾ç¤ºæ¶çå¤ç |
| | | onShow(() => { |
| | | console.log("========== indexLS - onShow 触å =========="); |
| | | // éæ°å¯ç¨çå¬å¨ï¼ç¡®ä¿çå¬å¨ææï¼ |
| | | enableListener(); |
| | | // å è½½ç¼åï¼æ´æ°UIæ¾ç¤ºï¼ |
| | | const cachedData = loadFromCache(); |
| | | |
| | | // å¦ææ²¡æç¼åæ°æ®ï¼æç¤ºç¨æ·éè¦æ«ç |
| | | if (!cachedData || !cachedData.uid) { |
| | | console.log("â ï¸ æªæ£æµå°æ«ç ç¼åï¼ç¨æ·éè¦æ«æè®¾å¤äºç»´ç "); |
| | | // å¨ç¼è¾æ¨¡å¼ä¸ææç¤º |
| | | if (isEdit.value) { |
| | | setTimeout(() => { |
| | | uni.showToast({ |
| | | title: "è¯·æ«æè®¾å¤äºç»´ç ååä¿å", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | }, 500); |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .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; |
| | | } |
| | | |
| | | .placeholder { |
| | | flex: 1; |
| | | } |
| | | |
| | | .scan-info { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-right: 10px; |
| | | |
| | | .scan-device-text { |
| | | font-size: 14px; |
| | | color: #0d867f; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | |
| | | .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; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .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; |
| | | position: relative; |
| | | } |
| | | |
| | | .upload-btn { |
| | | width: 80px; |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 1px dashed #ccc; |
| | | border-radius: 4px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .upload-icon { |
| | | font-size: 32px; |
| | | color: #0d867f; |
| | | } |
| | | |
| | | .delete-icon { |
| | | position: absolute; |
| | | top: -8px; |
| | | right: -8px; |
| | | width: 24px; |
| | | height: 24px; |
| | | background-color: rgba(255, 0, 0, 0.8); |
| | | color: white; |
| | | border-radius: 50%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 10; |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .attachment-item { |
| | | width: calc(25% - 10px); |
| | | margin: 10; |
| | | } |
| | | } |
| | | |
| | | :deep(.wd-form-item) { |
| | | margin-bottom: 8rpx; |
| | | } |
| | | |
| | | :deep(.wd-input, .wd-select, .wd-radio-group, .wd-checkbox-group) { |
| | | width: 100%; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | :deep(.wd-form-item__label)::after { |
| | | content: "*"; |
| | | color: red; |
| | | margin-left: 4rpx; |
| | | } |
| | | |
| | | :deep(.wd-select) { |
| | | width: 100%; |
| | | } |
| | | |
| | | :deep(.wd-checkbox) { |
| | | margin-right: 0; |
| | | } |
| | | .conclusion-radio-group { |
| | | display: flex; |
| | | align-items: flex-start; // åç´æ¹åé¡¶é¨å¯¹é½ï¼ä¸ç§»å
³é®ï¼ |
| | | gap: 20rpx; // é项ä¹é´çé´è· |
| | | } |
| | | </style> |