yusheng 1 rok temu
rodzic
commit
a2127756ae

+ 25 - 0
src/views/maintenance/equipment/workOrder/details.vue

@@ -228,6 +228,24 @@
                       </div>
                     </template>
                   </el-table-column>
+                  <el-table-column
+                    label="现场照片"
+                    prop="photoList"
+                    width="300"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <el-image
+                          v-for="imgItem in scope.row.photoList"
+                          :key="imgItem"
+                          style="width: 100px; height: 100px"
+                          :src="imgItem"
+                          :preview-src-list="scope.row.photoList"
+                        >
+                        </el-image>
+                      </div>
+                    </template>
+                  </el-table-column>
                   <el-table-column label="结果" prop="result" width="200">
                   </el-table-column>
                 </el-table>
@@ -383,6 +401,13 @@
         this.pageLoading = true;
         getWordOrderDetail(this.$route.query.id)
           .then((data) => {
+            data.deviceList.forEach((item) => {
+              item.workItems.forEach((val) => {
+                val.photoList.map(url=>{
+                  return window.location.origin+url
+                })
+              });
+            });
             this.infoData = data;
             // if (res.success) {
             //   this.data = res.data;

+ 25 - 0
src/views/maintenance/patrol/workOrder/details.vue

@@ -250,6 +250,24 @@
                       </div>
                     </template>
                   </el-table-column>
+                  <el-table-column
+                    label="现场照片"
+                    prop="photoList"
+                    width="300"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <el-image
+                          v-for="imgItem in scope.row.photoList"
+                          :key="imgItem"
+                          style="width: 100px; height: 100px"
+                          :src="imgItem"
+                          :preview-src-list="scope.row.photoList"
+                        >
+                        </el-image>
+                      </div>
+                    </template>
+                  </el-table-column>
                   <el-table-column label="结果" prop="result" width="200">
                   </el-table-column>
                 </el-table>
@@ -406,6 +424,13 @@
         this.pageLoading = true;
         getWordOrderDetail(this.$route.query.id)
           .then((data) => {
+            data.deviceList.forEach((item) => {
+              item.workItems.forEach((val) => {
+                val.photoList.map(url=>{
+                  return window.location.origin+url
+                })
+              });
+            });
             this.infoData = data;
             // if (res.success) {
             //   this.data = res.data;

+ 18 - 18
src/views/maintenance/repair/components/RepairDetailsDialog.vue

@@ -158,11 +158,11 @@
             <span>图片:</span>
 
             <el-image
-              v-for="(item, index) in infoData.repairsImg"
+              v-for="(item, index) in infoData.images"
               :key="index"
               style="width: 100px; height: 100px; margin-right: 5px"
-              :src="item.url"
-              :preview-src-list="[item.url]"
+              :src="item"
+              :preview-src-list="infoData.images"
             />
           </el-col>
         </el-row>
@@ -222,6 +222,18 @@
             <span>{{ infoData ? infoData.remark : '' }}</span>
           </el-col>
         </el-row>
+        <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span>图片:</span>
+            <el-image
+              v-for="(item, index) in infoData.images"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item"
+              :preview-src-list="infoData.images"
+            />
+          </el-col>
+        </el-row>
         <!--        <el-row class="repair_row">
           <el-col :span="24" class="repair_column">
             <span>图片:</span>
@@ -421,21 +433,9 @@
           this.infoData = res ? res : {};
           this.repairInfoLogs = res.repairLogVOList.reverse();
           // 处理图片
-          // if (this.infoData && this.infoData.repairsImg) {
-          //   const repairsImg = this.infoData.repairsImg
-          //   this.infoData.repairsImg = []
-          //   repairsImg.split(',').map(item => {
-          //     imageView(item).then(res => {
-          //       this.infoData.repairsImg.push({
-          //         name: item.substring('/download/'.length),
-          //         url: res
-          //       })
-          //     })
-
-          //     console.log(this.infoData.repairsImg)
-          //     return
-          //   })
-          // }
+          if (this.infoData && this.infoData?.images?.length) {
+            this.infoData.images.forEach((url) => window.location.origin + url);
+          }
         } else if (row.title === '消息信息详情') {
           this.getSbinfo(this.row.deviceId);
           const res = await getRepairById(row.id);

+ 15 - 5
src/views/maintenance/repair/components/WorkOrderTab.vue

@@ -70,7 +70,17 @@
         <div slot="description" class="create_workerOrder_desc">
           <div> 报修人:{{ logs[item.id].requestUserName }} </div>
           <div> 故障描述:{{ logs[item.id].remark }} </div>
+          <div class="work_report_imgs" >
+          <el-image
+            v-for="(item, index) in logs[item.id]?.content?.images"
+            :key="index"
+            style="width: 100px; height: 100px; margin-right: 5px"
+            :src="item"
+            :preview-src-list="[item]"
+          />
         </div>
+        </div>
+   
       </el-step>
       <el-step v-if="item.type == 'SPARE_PARTS_APPLY'">
         <span
@@ -160,13 +170,13 @@
               type="view"
             ></fileMain>
           </div>
-          <div class="work_report_imgs" style="width: 50px; height: 50px">
-            <img
-              v-for="(item, index) in logs[item.id].content.workOrderImgList"
+          <div class="work_report_imgs" >
+            <el-image
+              v-for="(item, index) in logs[item.id].content?.images"
               :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
               :src="item"
-              alt=""
-              style="width: 40%"
+              :preview-src-list="logs[item.id].content?.images"
             />
           </div>
           <!-- <div>