xuxy
2024-06-26 563a0f248d37b8820cdb3e46479d7c8c891b3386
pages/user/user-info/user-info.vue
@@ -16,12 +16,12 @@
            </view>
         </view>
         <view class="form-item">
            <view class="label">姓名</view>
            <view class="label">昵称</view>
            <view class="m-l-a m-r-0 flex text-right">
               <!-- {{dto.nickName || '-'}} -->
               <input v-model="dto.nickName" type="nickname" placeholder="请输入昵称"  @blur="bindblur"  @input="bindinput"
                  style="margin-top: 16px;text-align: right;"></input>
               <input v-model="dto.nickName" type="nickname" placeholder="请输入昵称" @blur="bindblur"
                  @input="bindinput" style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view>
@@ -51,49 +51,6 @@
            </view>
         </view>
         <!--          <view class="form-item">
            <view class="label">用户名</view>
            <view class="m-l-a m-r-0 flex">
               <input v-model="dto.birthday" placeholder="请输入用户名" style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view> -->
         <!-- #ifndef MP -->
         <view class="form-item">
            <view class="label">部门</view>
            <view class="m-l-a m-r-0 flex desc-gray">
               <input v-model="dto.departmentName" disabled style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view>
         <view class="form-item">
            <view class="label">邮箱</view>
            <view class="m-l-a m-r-0 flex desc-gray">
               <input v-model="dto.email" disabled style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view>
         <view class="form-item">
            <view class="label">性别</view>
            <view class="m-l-a m-r-0 flex desc-gray">
               <input v-model="dto.genderStr" disabled style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view>
         <view class="form-item">
            <view class="label">工号</view>
            <view class="m-l-a m-r-0 flex desc-gray">
               <input v-model="dto.workNo" disabled style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view>
         <view class="form-item">
            <view class="label">岗位</view>
            <view class="m-l-a m-r-0 flex desc-gray">
               <input v-model="dto.positionName" disabled style="margin-top: 16px;text-align: right;"></input>
            </view>
         </view>
         <!-- #endif -->
      </view>
      <view class="button-green-1 m-t-20 button-fixed-bottom" @click="update">
@@ -118,27 +75,9 @@
      },
      async mounted() {
         // await this.$store.dispatch('getCurrentInfo');
         // #ifdef MP
         this.dto = {
            ...this.currentInfo,
         }
         // #endif
         // #ifndef MP
         this.$message.showLoading()
         const {
            data
         } = await this.$http.request('get', '/api/personnel/employee/get/' + this.currentInfo.id)
         console.log('data', data)
         this.$message.hideLoading()
         this.dto = {
            // address:this.currentInfo.customerInfo.address||'',
            // email:this.currentInfo.customerInfo.email||'',
            ...this.currentInfo,
            ...data
         }
         // #endif
      },
      methods: {
         bindblur(e) {
@@ -155,12 +94,13 @@
            }
            // "/api/current/user/update"
            this.$message.showLoading()
            if(this.dto.picture&&this.dto.picture.indexOf('http://tmp/')>=0){
            if (this.dto.picture && this.dto.picture.indexOf('http://tmp/') >= 0) {
               //上传
               const res = await this.$http.upload(this.dto.picture)
               var picture = res.data && res.data.length > 0 && res.data[0].url || ''
               this.dto.picture = picture
            }
            // #ifdef MP
            const {
               code
@@ -191,12 +131,14 @@
            // // #endif
            this.$message.hideLoading()
            // #ifdef MP
            if (code == 0) {
               this.$message.showToast('更新成功')
               // this.$store.commit('updateInfo',this.dto)
               // }
               await this.$store.dispatch('getCurrentInfo');
            }
            // #endif
         },
@@ -365,7 +307,7 @@
      border: 1px solid #fff;
      // border-radius: 200%;
      color: #fff;
      &::after {
         border: none;
      }