Prechádzať zdrojové kódy

代码提交:
0829用户信息代码提交

sunruiqi 2 rokov pred
rodič
commit
937f4e911c
1 zmenil súbory, kde vykonal 37 pridanie a 24 odobranie
  1. 37 24
      src/views/modules/sys/userInfo/UserInfoForm.vue

+ 37 - 24
src/views/modules/sys/userInfo/UserInfoForm.vue

@@ -417,7 +417,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=educationCertificateUrl`"
-                :on-success="handleAvatarSuccess3"
+                :on-success="(res,file)=> handleAvatarSuccess3(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.educationCertificateUrl" :src="scope.row.educationCertificateUrl" class="avatar">
@@ -430,7 +430,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=degreeCertificateUrl`"
-                :on-success="handleAvatarSuccess4"
+                :on-success="(res,file)=> handleAvatarSuccess4(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.degreeCertificateUrl" :src="scope.row.degreeCertificateUrl" class="avatar">
@@ -507,7 +507,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=fileUrl`"
-                :on-success="handleAvatarSuccess5"
+                :on-success="(res,file)=> handleAvatarSuccess5(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.fileUrl" :src="scope.row.fileUrl" class="avatar">
@@ -581,7 +581,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=fileUrl`"
-                :on-success="handleAvatarSuccess6"
+                :on-success="(res,file)=> handleAvatarSuccess6(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.fileUrl" :src="scope.row.fileUrl" class="avatar">
@@ -727,7 +727,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=fileUrl`"
-                :on-success="handleAvatarSuccess7"
+                :on-success="(res,file)=> handleAvatarSuccess7(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.fileUrl" :src="scope.row.fileUrl" class="avatar">
@@ -792,7 +792,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=fileUrl`"
-                :on-success="handleAvatarSuccess8"
+                :on-success="(res,file)=> handleAvatarSuccess8(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.fileUrl" :src="scope.row.fileUrl" class="avatar">
@@ -938,7 +938,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=fileUrl`"
-                :on-success="handleAvatarSuccess9"
+                :on-success="(res,file)=> handleAvatarSuccess9(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.fileUrl" :src="scope.row.fileUrl" class="avatar">
@@ -1175,7 +1175,7 @@
               <el-upload
                 class="avatar-uploader"
                 :action="`${$http.BASE_URL}/sys/file/webupload/upload?uploadPath=fileUrl`"
-                :on-success="handleAvatarSuccess10"
+                :on-success="(res,file)=> handleAvatarSuccess10(res,file,scope)"
                 :before-upload="beforeAvatarUpload"
                 :show-file-list="false">
                 <img v-if="scope.row.fileUrl" :src="scope.row.fileUrl" class="avatar">
@@ -1224,6 +1224,7 @@
   export default {
     data () {
       return {
+        scope: {},
         visable: false,
         gridData: [],
         radio: 0,
@@ -1416,33 +1417,43 @@
     methods: {
       handleAvatarSuccess1 (res, file) {
         this.inputForm.headPortraitUrl = res.url
+        this.$forceUpdate()
       },
       handleAvatarSuccess2 (res, file) {
         this.inputForm.signatureUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess3 (res, file) {
-        this.sysUserEducation.educationCertificateUrl = res.url
+      handleAvatarSuccess3 (res, file ,scope) {
+          this.sysUserEducations[scope.$rowIndex].educationCertificateUrl = res.url
+          this.$forceUpdate()
       },
-      handleAvatarSuccess4 (res, file) {
-        this.sysUserEducation.degreeCertificateUrl = res.url
+      handleAvatarSuccess4 (res, file, scope) {
+        this.sysUserEducations[scope.$rowIndex].degreeCertificateUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess5 (res, file) {
-        this.sysUserContract.fileUrl = res.url
+      handleAvatarSuccess5 (res, file, scope) {
+        this.sysUserContracts[scope.$rowIndex].fileUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess6 (res, file) {
-        this.sysUserLanguage.fileUrl = res.url
+      handleAvatarSuccess6 (res, file, scope) {
+        this.sysUserLanguages[scope.$rowIndex].fileUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess7 (res, file) {
-        this.sysUserCertificate.fileUrl = res.url
+      handleAvatarSuccess7 (res, file, scope) {
+        this.sysUserCertificates[scope.$rowIndex].fileUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess8 (res, file) {
-        this.sysUserTitle.fileUrl = res.url
+      handleAvatarSuccess8 (res, file, scope) {
+        this.sysUserTitles[scope.$rowIndex].fileUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess9 (res, file) {
-        this.sysUserTrain.fileUrl = res.url
+      handleAvatarSuccess9 (res, file, scope) {
+        this.sysUserTrains[scope.$rowIndex].fileUrl = res.url
+        this.$forceUpdate()
       },
-      handleAvatarSuccess10 (res, file) {
-        this.sysUserArchives.fileUrl = res.url
+      handleAvatarSuccess10 (res, file, scope) {
+        this.sysUserArchives[scope.$rowIndex].fileUrl = res.url
+        this.$forceUpdate()
       },
 
       beforeAvatarUpload (file) {
@@ -1694,6 +1705,8 @@
             this.loading = true
             this.userInfoService.getUserInfoById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm.headPortraitUrl = data.headPortraitUrl
+              this.inputForm.signatureUrl = data.signatureUrl
               data.sysUserEducations.forEach(i => {
                 this.sysUserEducations.push(i)
               })