Forráskód Böngészése

Merge remote-tracking branch 'origin/demo_' into demo_

hfxc226 2 éve
szülő
commit
b0288db9f4

+ 1 - 1
src/utils/tool.js

@@ -1016,7 +1016,7 @@ BaseTool.UPLOAD = {
         fileDTO.fileName = data.fileName
         fileDTO.fileFormat = data.fileFormat
         fileDTO.url = data.url
-        fileDTO.id = data.id
+        fileDTO.id = data.id || fileList[i].uid
         temp.push(fileDTO)
       }
     }

+ 19 - 11
src/views/fill/task/modules/BaseForm.vue

@@ -113,9 +113,9 @@
                 <a-button type="link" @click="handleRepair(item)">
                   报修
                 </a-button>
-                <a-button type="link" @click="uploadVisible = true">上传图片 </a-button>
+                <a-button type="link" @click="uploadImg(item,i)">{{ item.images&&item.images.length?'查看图片':'上传图片' }}</a-button>
 
-                <a-modal v-model="uploadVisible" title="上传图片" @cancel="uploadVisible = false">
+                <a-modal v-model="uploadVisible" title="上传图片" :footer="null" @cancel="uploadVisible = false">
                   <a-upload
                     :action="uploadUrl"
                     list-type="picture-card"
@@ -195,8 +195,7 @@ export default {
   data () {
     return {
       uploadUrl: uploadUrl,
-      defaultApplicationFileList: [
-      ],
+      defaultApplicationFileList: [],
       applicationFileList: [],
       headers: {
         Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
@@ -217,6 +216,7 @@ export default {
         pageSize: 10,
         total: 0
       },
+      imgId: '',
       loading: false,
       ListForm: [],
       id: '',
@@ -304,18 +304,28 @@ export default {
             val.fillValue = val.fillValue ? val.fillValue : ''
             return val
           })
+          item.images = item.content.filter(item => item.fileFormat)
+          item.content = item.content.filter(item => !item.fileFormat)
           return item
         })
+        console.log(this.ListForm)
       })
-      console.log(this.ListForm)
+    },
+    uploadImg (val, i) {
+      this.uploadVisible = true
+      console.log(val)
+      this.imgId = i
+      this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(val.images)
+      console.log(this.defaultApplicationFileList)
+      console.log(this.applicationFileList)
     },
     handleRepair (val) {
       const data = {
         sbId: val.sbId,
         sbName: val.sbName,
         sbCph: val.positionName,
-        applicationFileList: this.applicationFileList,
-        defaultApplicationFileList: this.defaultApplicationFileList,
+        applicationFileList: val.images,
+        defaultApplicationFileList: this.BaseTool.UPLOAD.transImg(val.images),
         treeData: val.content.map((item) => {
           return {
             title: item.name + ':' + item.fillValue,
@@ -324,8 +334,6 @@ export default {
           }
         })
       }
-      console.log(data)
-
       const modal = this.$refs.baseFormRepairModal
       modal.base(data)
     },
@@ -347,6 +355,7 @@ export default {
     handleApplicationFileChange (info) {
       this.defaultApplicationFileList = info.fileList
       this.applicationFileList = this.setFileList(info, 11)
+      this.ListForm[this.imgId].images = this.applicationFileList
     },
     setFileList (info, type) {
       const file = info.file
@@ -401,14 +410,13 @@ export default {
       this.getFillUpdates()
     },
     onChange (page) {
-      console.log(page)
       this.getInfo()
     },
     save () {
       const detail = this.ListForm.map(item => {
         return {
           id: item.id,
-          content: JSON.stringify(item.content)
+          content: JSON.stringify([...item.content, ...item.images])
         }
       })
       const params = {

+ 6 - 2
src/views/repair/application-form/RepairForm.vue

@@ -104,7 +104,7 @@
               :type="2"
               title="是否要接单?"
               @confirm="receiveRepair(record)">接单</operation-button>
-<!--            <operation-button
+            <!--            <operation-button
               v-show="editFlag"
               v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REFUSED_REPAIR === record.status && $auth('repair-application-forms-edit')"
               @click="handleEdit(record)" >再次报修</operation-button>
@@ -129,6 +129,9 @@
               @confirm="handleRefused(record)">报修驳回</operation-button>-->
           </template>
         </span>
+        <span slot="content" slot-scope="content">
+          <span v-html="content"></span>
+        </span>
         <span slot="status" slot-scope="text">
           <badge :text="BaseTool.Object.getField(statusMap,text)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[text]"/>
         </span>
@@ -236,7 +239,8 @@ export default {
           title: '故障描述',
           checked: true,
           width: '150px',
-          dataIndex: 'content'
+          dataIndex: 'content',
+          scopedSlots: { customRender: 'content' }
         },
         {
           title: '工单类型',