| | |
| | | </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="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="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-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="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="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"> |
| | | <wd-checkbox-group |
| | | v-model="formData.appearance" |
| | | inline |
| | | v-for="(opt, idx) in appearanceOptions" |
| | | :key="idx" |
| | | style="text-align: justify" |
| | | > |
| | | <wd-checkbox :modelValue="opt.value" style="width: 100px"> |
| | | {{ opt.label }} |
| | | </wd-checkbox> |
| | | </wd-checkbox-group> |
| | | </template> |
| | | <template v-else> |
| | | {{ |
| | | formatProductAppearance(detailData.inspectionResult?.appearance).join("ã") || "-" |
| | | }} |
| | | </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 v-if="detailData.processInspectionResult?.isFully"> |
| | | <view style="margin: 10rpx"> |
| | | <text class="title">{{ "å·¡æ£ç»æ" }}</text> |
| | | </view> |
| | | <wd-col :span="24"> |
| | | <wd-form-item label="éæåãä¸ãå°¾æ ·åæ¯å¦é½å
¨" prop="isFully" required> |
| | | <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" 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-icon |
| | | v-if="isEdit" |
| | | name="close-circle" |
| | | class="delete-icon" |
| | | @click.stop="deleteFile(index)" |
| | | ></wd-icon> --> |
| | | </wd-col> |
| | | <wd-col v-if="isEdit" class="attachment-item upload-btn"> |
| | | <wd-upload |
| | | :multiple="true" |
| | | :max-count="5" |
| | | :before-upload="beforeUpload" |
| | | @success="handleUploadSuccess" |
| | | @fail="handleUploadFail" |
| | | accept="all" |
| | | <wd-form-item label="å¤è§" prop="appearance" required> |
| | | <template v-if="isEdit"> |
| | | <wd-checkbox-group |
| | | v-model="formData.appearance" |
| | | inline |
| | | v-for="(opt, idx) in appearanceOptions" |
| | | :key="idx" |
| | | style="text-align: justify" |
| | | > |
| | | <view class="upload-icon">+</view> |
| | | </wd-upload> |
| | | </wd-col> |
| | | </view> |
| | | </wd-row> |
| | | </div> |
| | | <wd-checkbox :modelValue="opt.value" style="width: 100px"> |
| | | {{ opt.label }} |
| | | </wd-checkbox> |
| | | </wd-checkbox-group> |
| | | </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 v-if="detailData.processInspectionResult?.isFully"> |
| | | <view style="margin: 10rpx"> |
| | | <text class="title">{{ "å·¡æ£ç»æ" }}</text> |
| | | </view> |
| | | <wd-col :span="24"> |
| | | <wd-form-item label="éæåãä¸ãå°¾æ ·åæ¯å¦é½å
¨" prop="isFully" required> |
| | | <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" v-if="detailData.files && detailData.files.length > 0"> |
| | | <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" /> |
| | |
| | | import RoutingInspectionApi from "@/api/routingInspection/routingInspection"; |
| | | import Scan from "@/components/scan/index.vue"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import AttachmentUpload from "../upload.vue"; |
| | | |
| | | // æ ¸å¿ç¶æ |
| | | const paramsId = ref(""); |
| | | const paramsType = ref(""); |
| | | const detailData = ref<any>({}); |
| | | const show = ref(false); |
| | | const previewImageUrl = ref(""); |
| | |
| | | const deviceUid = ref(""); |
| | | const scanRef = ref(); |
| | | const toast = useToast(); |
| | | const attachmentRef = ref<any>(null); |
| | | |
| | | // è¡¨åæ°æ® |
| | | const formData = reactive({ |
| | | dia: "", |
| | | maxDia: "", |
| | | minDia: "", |
| | | appearance: "", |
| | | appearance: [], |
| | | windingTightness: "", |
| | | arrangementNeatness: "", |
| | | aluminumWireDistance: "", |
| | |
| | | }; |
| | | |
| | | // æ ¼å¼åå·¥å
· |
| | | const formatProductAppearance = (productAppearance: string) => { |
| | | return !productAppearance ? "-" : productAppearance; |
| | | const formatProductAppearance = (productAppearance: string[]) => { |
| | | return !productAppearance.length ? "-" : productAppearance.join("ã"); |
| | | }; |
| | | |
| | | const formatValue = (value: any, unit?: string) => { |
| | |
| | | formData.dia = inspectionResult.dia || ""; |
| | | formData.maxDia = inspectionResult.maxDia || ""; |
| | | formData.minDia = inspectionResult.minDia || ""; |
| | | formData.appearance = inspectionResult.appearance || ""; |
| | | formData.appearance = inspectionResult.appearance || []; |
| | | formData.windingTightness = inspectionResult.windingTightness || ""; |
| | | formData.arrangementNeatness = inspectionResult.arrangementNeatness || ""; |
| | | formData.aluminumWireDistance = inspectionResult.aluminumWireDistance || ""; |
| | |
| | | // 页é¢å è½½ |
| | | onLoad((options: any) => { |
| | | paramsId.value = options.id; |
| | | paramsType.value = options.deviceType; |
| | | getDetailData(options.id, options.deviceType); |
| | | }); |
| | | |
| | |
| | | // æ ¡éª |
| | | if (!formData.maxDia) return uni.showToast({ title: "æå¤§ç´å¾ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.minDia) return uni.showToast({ title: "æå°ç´å¾ä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.appearance) 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.conclusion) return uni.showToast({ title: "ç»è®ºä¸ºå¿
填项", icon: "none" }); |
| | | if (!formData.isFully) return uni.showToast({ title: "éææ ·åæ¯å¦é½å
¨ä¸ºå¿
填项", icon: "none" }); |
| | | if (!deviceUid.value) return uni.showToast({ title: "è¯·æ«æäºç»´ç ", icon: "none" }); |
| | | const { newFiles } = attachmentRef.value.getSubmitFiles(); |
| | | console.log("newFiles", newFiles); |
| | | const allFileIds = [...newFiles]; |
| | | // æäº¤ |
| | | try { |
| | | const res = await RoutingInspectionApi.drawPatrolCheckInspection({ |
| | |
| | | conclusion: formData.conclusion, |
| | | }, |
| | | inspectionResult: { isFully: formData.isFully }, |
| | | processInspectionAttachmentList: tempFiles.value.map((f) => f.url), |
| | | processInspectionAttachmentList: allFileIds, |
| | | }); |
| | | if (res.code === 200) { |
| | | uni.showToast({ title: "ä¿åæå", icon: "success" }); |
| | | isEdit.value = false; |
| | | getDetailData(paramsId.value, detailData.value.deviceType); |
| | | getDetailData(paramsId.value, paramsType.value); |
| | | } else { |
| | | uni.showModal({ title: res.msg || "ä¿å失败", icon: "error" }); |
| | | } |
| | |
| | | console.error("ä¿å失败:", e); |
| | | uni.showModal({ title: e.message || "ä¿å失败", icon: "error" }); |
| | | } |
| | | }; |
| | | |
| | | // éä»¶ä¸ä¼ æ ¡éª |
| | | const beforeUpload = (file: any) => { |
| | | const maxSize = 2 * 1024 * 1024; |
| | | if (file.size > maxSize) { |
| | | uni.showToast({ title: "å¾ç大å°ä¸è½è¶
è¿2M", icon: "none" }); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | // éä»¶ä¸ä¼ æå |
| | | const handleUploadSuccess = (res: any) => { |
| | | if (Array.isArray(res)) { |
| | | tempFiles.value = [ |
| | | ...tempFiles.value, |
| | | ...res.map((file) => ({ |
| | | ...file, |
| | | id: `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, |
| | | })), |
| | | ]; |
| | | } else { |
| | | tempFiles.value.push({ |
| | | ...res, |
| | | id: `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // éä»¶ä¸ä¼ 失败 |
| | | const handleUploadFail = (err: any) => { |
| | | uni.showToast({ title: "éä»¶ä¸ä¼ 失败", icon: "error" }); |
| | | }; |
| | | |
| | | // å é¤éä»¶ |
| | | const deleteFile = (index: number) => { |
| | | if (index >= detailData.value.files.length) { |
| | | tempFiles.value = tempFiles.value.filter( |
| | | (_, idx) => idx !== index - detailData.value.files.length |
| | | ); |
| | | } else { |
| | | detailData.value.files = detailData.value.files.filter((_, idx) => idx !== index); |
| | | } |
| | | }; |
| | | |
| | | // å¾çé¢è§ |
| | | const previewImage = (url: string) => { |
| | | previewImageUrl.value = url; |
| | | show.value = true; |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | |
| | | scanRef.value.triggerScan(); |
| | | }; |
| | | const getScanCode = (params: any) => { |
| | | console.log("宿´åæ°ï¼", params); |
| | | let codeObj = {}; |
| | | try { |
| | | codeObj = JSON.parse(params.code); |
| | | } catch (err) { |
| | | console.error("JSONè§£æå¤±è´¥ï¼", err); |
| | | toast.error("æ«ç æ°æ®å¼å¸¸"); |
| | | return; // è§£æå¤±è´¥ç´æ¥è¿åï¼é¿å
åç»é误 |
| | | } |