Ver código fonte

fix: 执行照片

lxf 1 dia atrás
pai
commit
524c9d926c

+ 24 - 7
src/views/old_mini/work_detail/components/executePopup.vue

@@ -6,8 +6,9 @@
                     请选择实际执行时间
                 </div>
                 <div class="time-input">
-                    <el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="executeTime" :disabled-date="disabledDate" size="large" style="width: 100%"
-                        type="date" placeholder="请选择日期" :editable="false" />
+                    <el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="executeTime"
+                        :disabled-date="disabledDate" size="large" style="width: 100%" type="date" placeholder="请选择日期"
+                        :editable="false" />
                 </div>
             </div>
             <div class="upload-wrap" :class="{ 'upload-cont': fileList.length }">
@@ -29,9 +30,9 @@
             <div class="name">
                 <span class="required">*</span>请选择下次提醒时间
             </div>
-            <div class="time-input">
-                <el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="remindTime" :disabled-date="disabledDate" size="large" style="width: 100%"
-                    type="date" placeholder="请选择日期" :editable="false" />
+            <div class="time-number-input">
+                <el-input-number v-model="remindTime" :min="1" :max="30" :step="1" size="large" style="width: 100%" />
+                <span class="time-unit">天后</span>
             </div>
             <div class="button-wrap">
                 <div @click="handleRemind" class="button primary">确认</div>
@@ -68,12 +69,12 @@ const uploadFileObj = new UploadFile();
 const afterRead = (file) => {
     // 处理多张照片的情况:file 可能是数组
     const files = Array.isArray(file) ? file : [file];
-    
+
     files.forEach((item) => {
         // 将文件上传至服务器
         let fileVal = item.file;
         if (!fileVal) return; // 如果没有 file 属性,跳过
-        
+
         item.status = "uploading";
         item.message = "上传中...";
         let ext = getFileExt(fileVal.name);
@@ -192,6 +193,7 @@ defineExpose({
         .van-image__img {
             border-radius: 8px;
         }
+
         .avatar-uploader .el-upload {
             width: 100%;
             border: 1px dashed #dddddd;
@@ -222,12 +224,14 @@ defineExpose({
     display: flex;
     justify-content: center;
     margin: 24px 4px 0 4px;
+
     .button {
         border-radius: 20px;
         color: #fff;
         padding: 7px 0;
         text-align: center;
         font-size: 16px;
+
         &.primary {
             flex: 1;
             background: #2199f8;
@@ -243,4 +247,17 @@ defineExpose({
         width: 100%;
     }
 }
+
+.time-number-input {
+    display: flex;
+    align-items: center;
+    width: 100%;
+
+    .time-unit {
+        font-size: 14px;
+        color: rgba(0, 0, 0, 0.4);
+        flex: none;
+        margin-left: 8px;
+    }
+}
 </style>

+ 38 - 24
src/views/old_mini/work_detail/index.vue

@@ -114,6 +114,23 @@
                             </span>
                         </div>
                     </div>
+
+
+                    <!-- 执行照片 -->
+                    <div class="photo-box" v-if="prescription.cropAlbum && prescription.cropAlbum.length">
+                        <div class="photo-title">执行照片</div>
+                        <div class="photo-img-wrap">
+                            <photo-provider :photo-closable="true">
+                                <photo-consumer v-for="(src, index) in prescription.cropAlbum" intro="执行照片" :key="index"
+                                    :src="base_img_url2 + src.filename">
+                                    <div class="photo-img">
+                                        <img :src="base_img_url2 + src.filename" />
+                                    </div>
+                                </photo-consumer>
+                            </photo-provider>
+                        </div>
+                    </div>
+
                     <!-- 执行操作 -->
                     <div class="execute-action" v-if="info?.appType === 1 && prescription.tagType === 0">
                         <div class="action-item second" @click="handleRemind">稍后执行</div>
@@ -121,21 +138,6 @@
                     </div>
                 </div>
 
-                <!-- 执行照片 -->
-                <div class="photo-box">
-                    <div class="photo-title">执行照片</div>
-                    <div class="photo-img-wrap">
-                        <photo-provider :photo-closable="true">
-                            <photo-consumer v-for="(src, index) in cropAlbum" intro="执行照片" :key="index"
-                                :src="base_img_url2 + src.filename">
-                                <div class="photo-img">
-                                    <img :src="base_img_url2 + src.filename" />
-                                </div>
-                            </photo-consumer>
-                        </photo-provider>
-                    </div>
-                </div>
-
                 <!-- 底部按钮 -->
                 <div class="fixed-btn-wrap" v-if="info?.appType === 2">
                     <div class="fixed-btn" @click="handleConvert">
@@ -160,7 +162,7 @@ import { base_img_url2, resize_300 } from "@/api/config";
 const route = useRoute();
 const router = useRouter();
 // const info = JSON.parse(localStorage.getItem("localUserInfo") || "{}");
-const info = { appType: 2 };
+const info = { appType: 1 };
 
 const detail = ref({
     "consequenceText": "",
@@ -246,6 +248,14 @@ const detail = ref({
         {
             "name": "蒂蛀虫防治",
             "tagType": 1,
+            "cropAlbum": [
+                {
+                    "filename": "6e707c1f-7095-409e-8b3a-2633e7b36bd5/1e2dc0e7-6f8b-4952-a574-8e8e0713529c/DJI_202601251415_001_1e2dc0e7-6f8b-4952-a574-8e8e0713529c/DJI_20260125141713_0003_V_code-ws0gefwtn5n4.jpeg"
+                },
+                {
+                    "filename": "dfb387fa-e7d3-4f49-a40c-fcbb9be2baf9/c727d4e9-f5bb-4e40-be2d-efdec3b91702/DJI_202511270800_001_c727d4e9-f5bb-4e40-be2d-efdec3b91702/DJI_20251127080720_0056_V_code-ws0gefyb37kp.jpeg"
+                }
+            ],
             "pesticideList": [
                 {
                     "code": "1009",
@@ -460,13 +470,6 @@ const triggerDateText = computed(() => {
     return d.replace(/-/g, ".");
 });
 
-const cropAlbum = ref([
-    {
-        filename: '6e707c1f-7095-409e-8b3a-2633e7b36bd5/1e2dc0e7-6f8b-4952-a574-8e8e0713529c/DJI_202601251415_001_1e2dc0e7-6f8b-4952-a574-8e8e0713529c/DJI_20260125141713_0003_V_code-ws0gefwtn5n4.jpeg'
-    }, {
-        filename: 'dfb387fa-e7d3-4f49-a40c-fcbb9be2baf9/c727d4e9-f5bb-4e40-be2d-efdec3b91702/DJI_202511270800_001_c727d4e9-f5bb-4e40-be2d-efdec3b91702/DJI_20251127080720_0056_V_code-ws0gefyb37kp.jpeg'
-    }])
-
 const stageList = computed(() => detail.value.groupList || []);
 
 
@@ -603,6 +606,18 @@ const changeExecutionMethod = (stageIndex, value) => {
     }
 }
 
+.photo-box {
+    margin-top: 10px;
+    border: 0.5px dashed #2199F8;
+    border-radius: 5px;
+    padding: 11px 10px;
+    .photo-title {
+        font-size: 14px;
+        color: #000;
+        padding-bottom: 8px;
+    }
+}
+
 .group-info {
     margin-bottom: 10px;
 
@@ -793,7 +808,6 @@ const changeExecutionMethod = (stageIndex, value) => {
     display: flex;
     flex-wrap: wrap;
     gap: 10px;
-    margin-top: 8px;
 
     ::v-deep {
         .PhotoConsumer {