Parcourir la source

客户信息、评估/咨询项目模块中的文件上传修改为组件

lizhenhao il y a 2 ans
Parent
commit
1073dbfaf0

+ 17 - 161
src/views/modules/sys/project/AssessForm.vue

@@ -318,84 +318,9 @@
               <el-input v-model="inputForm.evaluationPersonTwo" placeholder="请填写签字评估师2"     ></el-input>
             </el-form-item>
           </el-col>
-          <!--<el-col :span="12">
-            <el-form-item label="项目状态" prop="status"
-                          :rules="[
-                 ]">
-              &lt;!&ndash;              <el-input v-model="inputForm.status" placeholder="请填写项目状态"     ></el-input>&ndash;&gt;
-              <el-select v-model="inputForm.status" placeholder="请选择" style="width:100%;">
-                <el-option
-                  v-for="item in $dictUtils.getDictList('project_status')"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>-->
         </el-row>
-        <el-divider content-position="left"><i class="el-icon-document"></i> 附件信息</el-divider>
-          <el-upload ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status'" action=""
-                     :limit="999" :http-request="httpRequest"
-                     multiple
-                     :on-exceed="(files, fileList) =>{
-                      $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
-                     }"
-                     :on-remove="handleRemove"
-                     :show-file-list="false"
-                     :on-change="changes"
-                     :on-progress="uploadVideoProcess"
-                     :file-list="filesArra2">
-            <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi">点击上传</el-button>
-          </el-upload>
-          <div style="height: calc(100% - 80px);margin-top: 10px">
-            <!-- 进度条 -->
-            <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
-          <vxe-table
-            style="margin-left: 5em"
-            border="inner"
-            auto-resize
-            resizable
-            :loading="loading"
-            size="small"
-            ref="projectTable"
-            show-header-overflow
-            show-overflow
-            highlight-hover-row
-            :menu-config="{}"
-            :print-config="{}"
-            @sort-change="sortChangeHandle"
-            :sort-config="{remote:true}"
-            :data="dataListNew"
-            :checkbox-config="{}">
-            <vxe-column type="seq" width="40"></vxe-column>
-            <vxe-column title="文件名称" field="name">
-              <template slot-scope="scope">
-<!--                <div v-if="ifName(scope.row) === true">-->
-<!--                  <el-image-->
-<!--                    style="width: 100px; height: 100px"-->
-<!--                    :src="src"-->
-<!--                    :preview-src-list="srcList" lazy>-->
-<!--                  </el-image>-->
-<!--                </div>-->
-<!--                <div v-else>-->
-<!--                  <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>-->
-<!--                </div>-->
-                <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
-              </template>
-            </vxe-column>
-            <vxe-column title="创建人" field="createBy"></vxe-column>
-            <vxe-column title="创建时间" field="createDate"></vxe-column>
-<!--            <vxe-column title="文件描述" field="description"></vxe-column>-->
-            <vxe-column title="操作" width="200px" fixed="right" align="center">
-              <template  slot-scope="scope">
-                <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
-                <el-button type="text"  icon="el-icon-delete" size="small" v-if="inputForm.permissionFlag&&showVi" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
-              </template>
-            </vxe-column>
-          </vxe-table>
-          </div>
-
+        <!--        附件-->
+        <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
       </el-form>
       <el-image-viewer
         v-if="showViewer"
@@ -413,14 +338,8 @@
 <script>
   import ProjectService from '@/api/sys/ProjectService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
-  import OSSSerive, {
-    httpRequest,
-    openWindowOnUrl,
-    toHref,
-    handleRemove,
-    fileName
-  } from '@/api/sys/OSSService'
-  import moment from 'moment'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import OSSSerive from '@/api/sys/OSSService'
   import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
   export default {
     data () {
@@ -490,7 +409,8 @@
     },
     components: {
       ElImageViewer,
-      SelectUserTree
+      SelectUserTree,
+      UpLoadComponent
     },
     projectService: null,
     ossService: null,
@@ -499,50 +419,17 @@
       this.projectService = new ProjectService()
     },
     mounted () {
-      window.onPreview = this.onPreview
     },
     methods: {
-      uploadVideoProcess (event, file, fileList) {
-        this.progressFlag = true // 显示进度条
-        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
-        if (this.loadProgress >= 100) {
-          this.loadProgress = 100
-          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
-        }
-      },
-      // async getsrc (row) {
-      //   if (row.id === null || row.id === undefined || row.id === '') {
-      //     await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
-      //       return data.data
-      //     })
-      //   } else {
-      //     return row.url
-      //   }
-      // },
-      // async ifName (row) {
-      //   let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
-      //   if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
-      //     return true
-      //   } else {
-      //     return false
-      //   }
-      // },
-      async toHref (row) {
-        toHref(row)
-      },
-      onPreview (url) {
-        this.url = url
-        this.showViewer = true
-      },
       // 关闭查看器
       closeViewer () {
         this.url = ''
         this.showViewer = false
       },
-      init (method, id) {
+      async init (method, id) {
         this.dataList = []
         this.dataListNew = []
-        this.ossService.findFileList(id).then(({data}) => {
+        await this.ossService.findFileList(id).then(({data}) => {
           data.forEach((item) => {
             item.name = item.attachmentName
             // item.createBy = item.createBy
@@ -610,7 +497,6 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
-          this.$refs.upload.clearFiles()
           this.$refs.inputForm.resetFields()
           if (method === 'edit' || method === 'view') { // 修改或者查看
             this.loading = true
@@ -622,15 +508,19 @@
               this.inputForm.reimbursementDateUi = data.reimbursementDate
               this.inputForm.permissionFlag = data.permissionFlag
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.$refs.uploadComponent.newUpload(method, this.dataListNew, 'projectRecords', 1024)
               this.loading = false
             })
           }
+          if (method !== 'edit' && method !== 'view') {
+            this.$refs.uploadComponent.newUpload(method, [], 'projectRecords', 1024)
+          }
         })
       },
       // 表单提交
       doSubmit () {
-        if (this.progressFlag === true) {
-          this.$message.warning('文件正在上传中,请稍等')
+        if (this.$refs.uploadComponent.checkProgress()) {
+          this.loading = false
           return
         }
         this.$refs['inputForm'].validate((valid) => {
@@ -638,6 +528,7 @@
             this.loading = true
             this.inputForm.itemType = '1'
             this.inputForm.workAttachments = []
+            this.dataListNew = this.$refs.uploadComponent.getDataList()
             this.dataListNew.forEach((item) => {
               if (item.id === null || item.id === undefined || item.id === '') {
                 item.url = item.raw.url
@@ -645,6 +536,7 @@
               item.attachmentFlag = 'projectRecords'
               item.fileSize = item.size
               item.attachmentName = item.name
+              item.createBy = null
               this.inputForm.workAttachments.push(item)
             })
             if (this.inputForm.evaluationReportDateUi === null || this.inputForm.evaluationReportDateUi === undefined || this.inputForm.evaluationReportDateUi === '') {
@@ -664,42 +556,12 @@
         })
       },
       close () {
+        this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
         this.showVi = true
         this.visible = false
         this.$emit('refreshDataList')
       },
-      async httpRequest (file) {
-        await httpRequest(file, fileName(file), 'projectRecords')
-      },
-      handleRemove () {
-        this.fileList = handleRemove()
-      },
-      changes (file, fileList) {
-        this.dataListNew = []
-        this.dataList.forEach((item) => {
-          this.dataListNew.push(item)
-        })
-        fileList.forEach((item) => {
-          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-          item.createBy = this.$store.state.user.name
-          this.dataListNew.push(item)
-        })
-        const isLt2M = file.size / 1024 / 1024 < 1024
-        if (isLt2M === false) {
-          this.$message.error('文件大小不能超过 ' + 1 + 'G !')
-          this.fileList = []
-          this.filesArra2 = []
-        } else {
-          // if (exnameFix(file, '1') === false) {
-          //   this.fileList = []
-          //   this.filesArra2 = []
-          // }
-        }
-      },
-      async showFile (row) {
-        await openWindowOnUrl(row)
-      },
       // 排序
       sortChangeHandle (column) {
         this.orders = []
@@ -708,12 +570,6 @@
         }
         this.refreshList()
       },
-      deleteMsgById (row, index) {
-        this.dataListNew.splice(index, 1)
-        if (row.id !== null && row.id !== '' && row.id !== undefined) {
-          this.ossService.deleteMsgById(row.id)
-        }
-      },
       twoDecimalPlaces (num) {
         let str = num.toString()
         var len1 = str.substr(0, 1)

+ 17 - 123
src/views/modules/sys/project/ConsultationForm.vue

@@ -337,67 +337,8 @@
           </el-col>-->
 
         </el-row>
-        <el-divider content-position="left"><i class="el-icon-document"></i> 附件信息</el-divider>
-        <el-upload ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status'" action=""
-                   :limit="999" :http-request="httpRequest"
-                   multiple
-                   :on-exceed="(files, fileList) =>{
-                      $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
-                     }"
-                   :on-remove="handleRemove"
-                   :show-file-list="false"
-                   :on-change="changes"
-                   :on-progress="uploadVideoProcess"
-                   :file-list="filesArra2">
-          <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi" >点击上传</el-button>
-        </el-upload>
-        <div style="height: calc(100% - 80px);margin-top: 10px">
-          <!-- 进度条 -->
-          <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
-          <vxe-table
-            style="margin-left: 5em"
-            border="inner"
-            auto-resize
-            resizable
-            :loading="loading"
-            size="small"
-            ref="projectTable"
-            show-header-overflow
-            show-overflow
-            highlight-hover-row
-            :menu-config="{}"
-            :print-config="{}"
-            @sort-change="sortChangeHandle"
-            :sort-config="{remote:true}"
-            :data="dataListNew"
-            :checkbox-config="{}">
-            <vxe-column type="seq" width="40"></vxe-column>
-            <vxe-column title="文件名称" field="name">
-              <template slot-scope="scope">
-                <!--                <div v-if="ifName(scope.row) === true">-->
-                <!--                  <el-image-->
-                <!--                    style="width: 100px; height: 100px"-->
-                <!--                    :src="src"-->
-                <!--                    :preview-src-list="srcList" lazy>-->
-                <!--                  </el-image>-->
-                <!--                </div>-->
-                <!--                <div v-else>-->
-                <!--                  <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>-->
-                <!--                </div>-->
-                <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
-              </template>
-            </vxe-column>
-            <vxe-column title="创建人" field="createBy"></vxe-column>
-            <vxe-column title="创建时间" field="createDate"></vxe-column>
-            <!--            <vxe-column title="文件描述" field="description"></vxe-column>-->
-            <vxe-column title="操作" width="200px" fixed="right" align="center">
-              <template  slot-scope="scope">
-                <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
-                <el-button type="text"  icon="el-icon-delete" size="small" v-if="inputForm.permissionFlag&&showVi" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
-              </template>
-            </vxe-column>
-          </vxe-table>
-        </div>
+        <!--        附件-->
+        <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
 
       </el-form>
       <el-image-viewer
@@ -416,14 +357,8 @@
 <script>
   import ProjectService from '@/api/sys/ProjectService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
-  import OSSSerive, {
-    httpRequest,
-    toHref,
-    openWindowOnUrl,
-    handleRemove,
-    fileName
-  } from '@/api/sys/OSSService'
-  import moment from 'moment'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import OSSSerive from '@/api/sys/OSSService'
   import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
   export default {
     data () {
@@ -493,7 +428,8 @@
     },
     components: {
       ElImageViewer,
-      SelectUserTree
+      SelectUserTree,
+      UpLoadComponent
     },
     projectService: null,
     ossService: null,
@@ -502,34 +438,17 @@
       this.projectService = new ProjectService()
     },
     mounted () {
-      window.onPreview = this.onPreview
     },
     methods: {
-
-      uploadVideoProcess (event, file, fileList) {
-        this.progressFlag = true // 显示进度条
-        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
-        if (this.loadProgress >= 100) {
-          this.loadProgress = 100
-          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
-        }
-      },
-      async toHref (row) {
-        toHref(row)
-      },
-      onPreview (url) {
-        this.url = url
-        this.showViewer = true
-      },
       // 关闭查看器
       closeViewer () {
         this.url = ''
         this.showViewer = false
       },
-      init (method, id) {
+      async init (method, id) {
         this.dataList = []
         this.dataListNew = []
-        this.ossService.findFileList(id).then(({data}) => {
+        await this.ossService.findFileList(id).then(({data}) => {
           data.forEach((item) => {
             item.name = item.attachmentName
             // item.createBy = item.createBy
@@ -596,7 +515,6 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
-          this.$refs.upload.clearFiles()
           this.$refs.inputForm.resetFields()
           if (method === 'edit' || method === 'view') { // 修改或者查看
             this.loading = true
@@ -608,15 +526,19 @@
               this.inputForm.reimbursementDateUi = data.reimbursementDate
               this.inputForm.permissionFlag = data.permissionFlag
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.$refs.uploadComponent.newUpload(method, this.dataListNew, 'projectRecords', 1024)
               this.loading = false
             })
           }
+          if (method !== 'edit' && method !== 'view') {
+            this.$refs.uploadComponent.newUpload(method, [], 'projectRecords', 1024)
+          }
         })
       },
       // 表单提交
       doSubmit () {
-        if (this.progressFlag === true) {
-          this.$message.warning('文件正在上传中,请稍等')
+        if (this.$refs.uploadComponent.checkProgress()) {
+          this.loading = false
           return
         }
         this.$refs['inputForm'].validate((valid) => {
@@ -624,6 +546,7 @@
             this.loading = true
             this.inputForm.itemType = '2'
             this.inputForm.workAttachments = []
+            this.dataListNew = this.$refs.uploadComponent.getDataList()
             this.dataListNew.forEach((item) => {
               if (item.id === null || item.id === undefined || item.id === '') {
                 item.url = item.raw.url
@@ -631,6 +554,7 @@
               item.attachmentFlag = 'projectRecords'
               item.fileSize = item.size
               item.attachmentName = item.name
+              item.createBy = null
               this.inputForm.workAttachments.push(item)
             })
             if (this.inputForm.evaluationReportDateUi === null || this.inputForm.evaluationReportDateUi === undefined || this.inputForm.evaluationReportDateUi === '') {
@@ -650,42 +574,12 @@
         })
       },
       close () {
+        this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
         this.visible = false
         this.showVi = true
         this.$emit('refreshDataList')
       },
-      async httpRequest (file) {
-        await httpRequest(file, fileName(file), 'projectRecords')
-      },
-      handleRemove () {
-        this.fileList = handleRemove()
-      },
-      changes (file, fileList) {
-        this.dataListNew = []
-        this.dataList.forEach((item) => {
-          this.dataListNew.push(item)
-        })
-        fileList.forEach((item) => {
-          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-          item.createBy = this.$store.state.user.name
-          this.dataListNew.push(item)
-        })
-        const isLt2M = file.size / 1024 / 1024 < 1024
-        if (isLt2M === false) {
-          this.$message.error('文件大小不能超过 ' + 1 + 'G !')
-          this.fileList = []
-          this.filesArra2 = []
-        } else {
-          // if (exnameFix(file, '1') === false) {
-          //   this.fileList = []
-          //   this.filesArra2 = []
-          // }
-        }
-      },
-      async showFile (row) {
-        await openWindowOnUrl(row)
-      },
       // 排序
       sortChangeHandle (column) {
         this.orders = []

+ 17 - 106
src/views/modules/sys/workClient/WorkClientForm.vue

@@ -319,57 +319,8 @@
           </template>
         </vxe-table-column>
         </vxe-table>
-        <el-divider content-position="left"><i class="el-icon-document"></i> 附件信息</el-divider>
-        <el-upload  ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status' ;" action=""
-                   :limit="999" :http-request="httpRequest"
-                   multiple
-                   :on-exceed="(files, fileList) =>{
-                    $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
-                   }"
-                   :on-remove="handleRemove"
-                   :show-file-list="false"
-                   :on-change="changes"
-                    :on-progress="uploadVideoProcess"
-                   :file-list="filesArra2">
-          <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi">点击上传</el-button>
-          </el-upload>
-          <div style="height: calc(100% - 80px);margin-top: 10px">
-            <!-- 进度条 -->
-            <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
-          <vxe-table
-            style="margin-left: 5em"
-            border="inner"
-            auto-resize
-            resizable
-            height="200px"
-            :loading="loading"
-            size="small"
-            ref="projectTable"
-            show-header-overflow
-            show-overflow
-            highlight-hover-row
-            :menu-config="{}"
-            :print-config="{}"
-            @sort-change="sortChangeHandle"
-            :sort-config="{remote:true}"
-            :data="dataListNew"
-            :checkbox-config="{}">
-            <vxe-column type="seq" width="40"></vxe-column>
-            <vxe-column title="文件名称" field="name">
-              <template slot-scope="scope">
-                <el-link  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
-              </template>
-            </vxe-column>
-            <vxe-column title="创建人" field="createBy"></vxe-column>
-            <vxe-column title="创建时间" field="createDate"></vxe-column>
-            <vxe-column title="操作" width="200px" fixed="right" align="center">
-              <template  slot-scope="scope">
-                <el-button type="text"  icon="el-icon-delete" size="small" v-if="inputForm.permissionFlag&&showVi" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
-                <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
-              </template>
-            </vxe-column>
-          </vxe-table>
-          </div>
+        <!--        附件-->
+        <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
       </el-form>
 
       <el-image-viewer
@@ -388,14 +339,8 @@
 <script>
   import WorkClientService from '@/api/sys/WorkClientService'
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
-  import OSSSerive, {
-    httpRequest,
-    toHref,
-    openWindowOnUrl,
-    handleRemove,
-    fileName
-  } from '@/api/sys/OSSService'
-  import moment from 'moment'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import OSSSerive from '@/api/sys/OSSService'
   import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
   export default {
     data () {
@@ -521,7 +466,8 @@
     },
     components: {
       ElImageViewer,
-      SelectTree
+      SelectTree,
+      UpLoadComponent
     },
     ossService: null,
     workClientService: null,
@@ -530,17 +476,8 @@
       this.workClientService = new WorkClientService()
     },
     mounted () {
-      window.onPreview = this.onPreview
     },
     methods: {
-      uploadVideoProcess (event, file, fileList) {
-        this.progressFlag = true // 显示进度条
-        this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
-        if (this.loadProgress >= 100) {
-          this.loadProgress = 100
-          setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
-        }
-      },
       isExistByName () {
         let value = this.inputForm.workClientInfo.name
         if (value !== null && value !== undefined && value !== '') {
@@ -569,22 +506,15 @@
           })
         }
       },
-      async toHref (row) {
-        toHref(row)
-      },
-      onPreview (url) {
-        this.url = url
-        this.showViewer = true
-      },
       // 关闭查看器
       closeViewer () {
         this.url = ''
         this.showViewer = false
       },
-      init (method, id) {
+      async init (method, id) {
         this.dataList = []
         this.dataListNew = []
-        this.ossService.findFileList(id).then(({data}) => {
+        await this.ossService.findFileList(id).then(({data}) => {
           data.forEach((item) => {
             item.name = item.attachmentName
             this.dataList.push(item)
@@ -703,21 +633,26 @@
               this.inputForm.workClientInfo.deputyList = deputyList
               this.inputForm.workClientInfo = JSON.parse(JSON.stringify(this.inputForm.workClientInfo))
               this.inputForm.workClientInfo.hasUscc = JSON.stringify(this.inputForm.workClientInfo.hasUscc)
+              this.$refs.uploadComponent.newUpload(method, this.dataListNew, 'workClient', 300)
             })
           }
+          if (method !== 'edit' && method !== 'view') {
+            this.$refs.uploadComponent.newUpload(method, [], 'workClient', 300)
+          }
           this.loading = false
         })
       },
       // 表单提交
       doSubmit () {
-        if (this.progressFlag === true) {
-          this.$message.warning('文件正在上传中,请稍等')
+        if (this.$refs.uploadComponent.checkProgress()) {
+          this.loading = false
           return
         }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
             this.inputForm.workAttachments = []
+            this.dataListNew = this.$refs.uploadComponent.getDataList()
             this.dataListNew.forEach((item) => {
               if (item.id === null || item.id === undefined || item.id === '') {
                 item.url = item.raw.url
@@ -725,6 +660,7 @@
               item.attachmentFlag = 'workClient'
               item.fileSize = item.size
               item.attachmentName = item.name
+              item.createBy = null
               this.inputForm.workAttachments.push(item)
             })
             this.inputForm.workClientBank = []
@@ -807,36 +743,11 @@
         })
       },
       close () {
+        this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
         this.visible = false
         this.showVi = true
       },
-      httpRequest (file) {
-        httpRequest(file, fileName(file), 'workClient')
-      },
-      handleRemove () {
-        this.fileList = handleRemove()
-      },
-      changes (file, fileList) {
-        this.dataListNew = []
-        this.dataList.forEach((item) => {
-          this.dataListNew.push(item)
-        })
-        fileList.forEach((item) => {
-          item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-          item.createBy = this.$store.state.user.name
-          this.dataListNew.push(item)
-        })
-        const isLt2M = file.size / 1024 / 1024 < 300
-        if (isLt2M === false) {
-          this.$message.error('文件大小不能超过 ' + 300 + 'M !')
-          this.fileList = []
-          this.filesArra2 = []
-        }
-      },
-      async showFile (row) {
-        await openWindowOnUrl(row)
-      },
       // 排序
       sortChangeHandle (column) {
         this.orders = []