zhouhailu
2021-01-15 cc2f9738215a5eac135d953974fe2b35d2ef2c0c
综合版带用户监听
6个文件已修改
8450 ■■■■ 已修改文件
src/store/module/user.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/accountInformation/accountInformation.vue 361 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/diligenceTools/editFundMonitoring.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/diligenceTools/fundMonitoring.vue 4104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/diligenceTools/paymentMonitoring.vue 3930 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/single-page/home/home.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/module/user.js
@@ -13,6 +13,7 @@
export default {
  state: {
    RealName:'',
    userName: '',
    userId: '',
    defaultworkflow: '',
@@ -42,6 +43,9 @@
    },
    setUserName(state, name) {
      state.userName = name
    },
    setRealName(state,RealName){
      state.RealName = RealName
    },
    setAccess(state, access) {
      state.access = access
@@ -124,17 +128,20 @@
          getUserInfo(state.token).then(res => {
            const data = res.data
            if (data.Check) {
              let ran = Math.random()
              commit('setRateGradeFlag', data.Data.defaultrategrade)
              commit('setAvator', data.Data.avator)
              commit('setUserName', data.Data.name)
              commit('setUserId', data.Data.user_id)
              commit('setDefaultworkflow', data.Data.defaultworkflow)
              commit('setAccess', data.Data.access)
              console.log('查看后台返回RealName',data.Data.releName)
              commit('setRealName',data.Data.releName + ran)
              localStorage.setItem('RateGradeFlag',data.Data.defaultrategrade)
              localStorage.setItem('RiskProjectId',data.Data.defaultproj_id)
              localStorage.setItem('RiskCompanyId',data.Data.company_id)
              localStorage.setItem('userId',data.Data.user_id)
              localStorage.setItem('releName', data.Data.releName)
              localStorage.setItem('RealName', data.Data.releName)
              localStorage.setItem('defaultworkflow',data.Data.defaultworkflow)
              localStorage.setItem('defaultmoneymonitorflag',data.Data.defaultmoneymonitorflag)
              if (data.Data.access[0] == 'super_admin'){
src/view/accountInformation/accountInformation.vue
@@ -81,201 +81,204 @@
</template>
<script>
import axios from '@/libs/api.request'
import Cookies from 'js-cookie'
import {mapActions} from 'vuex'
export default {
  name: 'accountInformation',
  data () {
    return {
      ProjId: 1, // 项目Id
      pageType: 'baseMessage', // 页面类型
      homeTypeList: [
        {
          title: '基本信息',
          type: 'baseMessage'
  import axios from '@/libs/api.request'
  import Cookies from 'js-cookie'
  import {mapActions} from 'vuex'
  // import {mapActions} from 'vuex'
  export default {
    name: 'accountInformation',
    data () {
      return {
        ProjId: 1,//项目Id
        pageType:'baseMessage',//页面类型
        homeTypeList:[
          {
            title: '基本信息',
            type:'baseMessage',
          },
          {
            title: '修改密码',
            type:'changePassword',
          }
        ],//页面类型列表
        accountMsg: {
          id: 0,
          LoginName: 'testuser',
          RealName: '',
          Mobile: '',
          Mail: '',
          QQ: '',
          Wechat: '',
          Address: '',
          // AccountLimit: '',
          // CompanyName: '',
          // CompanyChar: '',
          // Location: [],
          // ClassLabelSet: [],
          // CompanyId: '',
          // AuthResultFlag:false
        },//修改信息
        ruleValidate: {
          LoginName: [
            {required: true, message: '账号不能为空'},
            {pattern: /^[a-zA-Z]([a-zA-Z0-9]{3,15})$/, message: '请输入字母开头的4-16位字母和数字组合'}
          ],
          // Password: [
          //   {required: true, message: '密码不能为空'},
          //   {pattern: /^(\w){6,20}$/, message: '只能输入6-20个字母、数字、下划线'}
          // ],
          // AccountLimit: [
          //   {required: true, message: '授权账号数量不能为空'},
          //   {pattern: /^(0|\+?[1-9][0-9]*)$/, message: '请输入正整数'}
          // ],
          // CompanyName: [
          //   {required: true, message: '机构名称不能为空'}
          // ],
          // CompanyChar: [
          //   {required: true, message: '机构属性不能为空'}
          // ],
          // Location: [
          //   {required: true, message: '地区属性不能为空'},
          //   {type: 'array', min: 1, max: 3, message: '地区属性不能为空', trigger: 'change'}
          // ],
          // ClassLabelSet: [
          //   {required: true, message: '行业属性不能为空'},
          //   {type: 'array', min: 4, max: 4, message: '行业属性不能为空', trigger: 'change'}
          // ],
          RealName: [
            {required: true, message: '姓名不能为空'}
          ],
          // Password: [
          //   {required: true, message: '密码不能为空'},
          //   {type: 'string', min: 6, max: 100, message: '请输入6位以上密码', trigger: 'change'}
          // ],
          Mobile: [
            {required: true, message: '手机号不能为空'},
            {pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号'}
          ],
          Mail: [
            {type: 'email', message: '请输入正确的邮箱'}
          ],
          QQ: [
            {pattern: /^[1-9][0-9]{4,11}$/, message: '请输入正确的QQ号'}
          ],
          Wechat: [
            {pattern: /^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, message: '请输入正确的微信号'}
          ],
        },
        {
          title: '修改密码',
          type: 'changePassword'
        }
      ], // 页面类型列表
      accountMsg: {
        id: 0,
        LoginName: 'testuser',
        RealName: '',
        Mobile: '',
        Mail: '',
        QQ: '',
        Wechat: '',
        Address: ''
        // AccountLimit: '',
        // CompanyName: '',
        // CompanyChar: '',
        // Location: [],
        // ClassLabelSet: [],
        // CompanyId: '',
        // AuthResultFlag:false
      }, // 修改信息
      ruleValidate: {
        LoginName: [
          {required: true, message: '账号不能为空'},
          {pattern: /^[a-zA-Z]([a-zA-Z0-9]{3,15})$/, message: '请输入字母开头的4-16位字母和数字组合'}
        ],
        // Password: [
        //   {required: true, message: '密码不能为空'},
        //   {pattern: /^(\w){6,20}$/, message: '只能输入6-20个字母、数字、下划线'}
        // ],
        // AccountLimit: [
        //   {required: true, message: '授权账号数量不能为空'},
        //   {pattern: /^(0|\+?[1-9][0-9]*)$/, message: '请输入正整数'}
        // ],
        // CompanyName: [
        //   {required: true, message: '机构名称不能为空'}
        // ],
        // CompanyChar: [
        //   {required: true, message: '机构属性不能为空'}
        // ],
        // Location: [
        //   {required: true, message: '地区属性不能为空'},
        //   {type: 'array', min: 1, max: 3, message: '地区属性不能为空', trigger: 'change'}
        // ],
        // ClassLabelSet: [
        //   {required: true, message: '行业属性不能为空'},
        //   {type: 'array', min: 4, max: 4, message: '行业属性不能为空', trigger: 'change'}
        // ],
        RealName: [
          {required: true, message: '姓名不能为空'}
        ],
        // Password: [
        //   {required: true, message: '密码不能为空'},
        //   {type: 'string', min: 6, max: 100, message: '请输入6位以上密码', trigger: 'change'}
        // ],
        Mobile: [
          {required: true, message: '手机号不能为空'},
          {pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号'}
        ],
        Mail: [
          {type: 'email', message: '请输入正确的邮箱'}
        ],
        QQ: [
          {pattern: /^[1-9][0-9]{4,11}$/, message: '请输入正确的QQ号'}
        ],
        Wechat: [
          {pattern: /^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, message: '请输入正确的微信号'}
        ]
      },
      savePassLoading: false, // 修改密码loading
      editPasswordForm: {
        Name: '',
        oldpwd: '',
        newpwd: '',
        ConfirmPassword: ''
        savePassLoading:false,//修改密码loading
        editPasswordForm: {
          Name: '',
          oldpwd: '',
          newpwd: '',
          ConfirmPassword: ''
        },
      }
    }
  },
  mounted () {
    this.ProjId = localStorage.getItem('RiskProjectId')
    this.getAccountInfo()
  },
  methods: {
    ...mapActions([
      'handleLogOut'
    ]),
    /**
    },
    mounted () {
      this.ProjId = localStorage.getItem('RiskProjectId')
      this.getAccountInfo()
    },
    methods:{
      ...mapActions([
        'getUserInfo'
      ]),
      /**
       * 获取账号信息
       */
    getAccountInfo () {
      let data = {
        token: Cookies.get('riskControlToken'),
        id: localStorage.getItem('userId')
      }
      axios.request({
        url: '/User/GetUserInfo',
        data,
        method: 'post'
      }).then(res => {
        if (res.data.Check) {
          this.accountMsg = {
            id: res.data.Data.Id,
            LoginName: res.data.Data.LoginName,
            RealName: res.data.Data.RealName,
            Mobile: res.data.Data.Mobile,
            Mail: res.data.Data.Mail,
            QQ: res.data.Data.QQ,
            Wechat: res.data.Data.Wechat,
            Address: res.data.Data.Address
          }
        } else {
      getAccountInfo(){
        let data = {
          token: Cookies.get("riskControlToken"),
          id:localStorage.getItem("userId")
        }
      }, res => {
        axios.request({
          url: '/User/GetUserInfo',
          data,
          method: 'post'
        }).then(res => {
          if (res.data.Check) {
            this.accountMsg={
              id: res.data.Data.Id,
              LoginName: res.data.Data.LoginName,
              RealName: res.data.Data.RealName,
              Mobile: res.data.Data.Mobile,
              Mail: res.data.Data.Mail,
              QQ: res.data.Data.QQ,
              Wechat: res.data.Data.Wechat,
              Address: res.data.Data.Address,
            }
          } else {
      })
    },
    /**
          }
        }, res => {
        })
      },
      /**
       * 修改账号信息
       */
    updateAccountBasic () {
      this.$refs['accountInformationValidate'].validate((valid) => {
        if (valid) {
          let data = JSON.parse(JSON.stringify(this.accountMsg))
          axios.request({
            url: '/user/UpdateAccountBasic',
            data,
            method: 'post'
          }).then(res => {
            if (res.data.Check) {
              this.handleLogOut().then(() => {
                this.loading = false
                this.$router.push({
                  name: 'login'
                })
                this.$Message.info('请重新登录!')
              })
            } else {
      updateAccountBasic(){
        this.$refs['accountInformationValidate'].validate((valid) => {
          if (valid) {
            let data = JSON.parse(JSON.stringify(this.accountMsg))
            axios.request({
              url: '/user/UpdateAccountBasic',
              data,
              method: 'post'
            }).then(res => {
              if (res.data.Check) {
                this.$emit('getsontemplate',false)
                this.getUserInfo()
                // this.handleLogOut().then(() => {
                //   this.loading = false
                //   this.$router.push({
                //     name: 'login'
                //   })
                //   this.$Message.info("请重新登录!")
                // })
              } else {
            }
          }, res => {
              }
            }, res => {
          })
        } else {
          this.$Message.error('请修改标红部分!')
            })
          } else {
            this.$Message.error('请修改标红部分!')
            return false
          }
        })
      },
      saveEditPass () {
        if (this.editPasswordForm.oldpwd.replace(/\s/g, '').length < 6) {
          this.$Message.error('原密码输入错误!')
          return false
        } else if (this.editPasswordForm.newpwd.length < 6) {
          this.$Message.error('新密码输入不符合要求!')
          return false
        } else if (this.editPasswordForm.newpwd != this.editPasswordForm.ConfirmPassword) {
          this.$Message.error('两次密码输入不一致!')
          return false
        }
      })
    },
    saveEditPass () {
      if (this.editPasswordForm.oldpwd.replace(/\s/g, '').length < 6) {
        this.$Message.error('原密码输入错误!')
        return false
      } else if (this.editPasswordForm.newpwd.length < 6) {
        this.$Message.error('新密码输入不符合要求!')
        return false
      } else if (this.editPasswordForm.newpwd != this.editPasswordForm.ConfirmPassword) {
        this.$Message.error('两次密码输入不一致!')
        return false
      }
      this.savePassLoading = true
      let data = this.editPasswordForm
      axios.request({
        url: '/user/ChangePassword',
        data,
        method: 'post'
      }).then(res => {
        if (res.data.Check) {
        this.savePassLoading = true
        let data = this.editPasswordForm
        axios.request({
          url: '/user/ChangePassword',
          data,
          method: 'post'
        }).then(res => {
          if (res.data.Check) {
        } else {
          } else {
        }
        this.savePassLoading = false
      }, response => {
        this.savePassLoading = false
        this.$Message.error('服务器错误!')
      })
          }
          this.savePassLoading = false
        }, response => {
          this.savePassLoading = false
          this.$Message.error('服务器错误!')
        })
      },
    }
  }
}
</script>
<style lang="less">
src/view/diligenceTools/editFundMonitoring.vue
@@ -513,6 +513,10 @@
      }
    },
    watch:{
      getRealName(newCount, oldCount){
        console.log('重新请求接口')
        this.getcustodianList()
      },
      /**
       * 监听邮箱数据变化
       **/
@@ -521,12 +525,12 @@
      }
    },
    mounted(){
      this.realName=localStorage.getItem('releName')
      this.realName=localStorage.getItem('RealName')
      this.UserIdinfo = localStorage.getItem('userId')
      this.loading_05=true
      this.CompanyId = localStorage.getItem('RiskCompanyId')
      this.getReceivablesList()
      //this.addfundmodel.Custodian=this.$store.state.user.userName
      this.UserIdinfo = localStorage.getItem('userId')
      this.pid=this.$route.query.Id
      this.GMFlag=this.$route.query.GMFlag
      this.cptype=this.$route.query.cptype
@@ -553,9 +557,6 @@
        }
        this.addfundmodel=this.editFundList1
      },3000)
    },
    watch:{
    },
    methods:{
@@ -624,15 +625,16 @@
        }).then(res => {
          if (res.data.Check) {
            this.custodianlist=res.data.Data;
            // if(this.custodianlist.length>0){
            //   this.custodianlist.forEach((val,index)=>{
            //     if(val.Id==this.UserIdinfo){
            //       this.addfundmodel.Custodian=val.RealName
            //     }
            //   })
            // }else{
            //
            // }
            console.log(this.UserIdinfo)
            if(this.custodianlist.length>0){
              this.custodianlist.forEach((val,index)=>{
                if(val.Id==this.UserIdinfo){
                  this.addfundmodel.Custodian=val.RealName
                }
              })
            }else{
            }
          } else {
          }
@@ -990,6 +992,11 @@
      },
    },
    computed:{
      getRealName(){
        console.log('获取realName',this.$store.state.user.RealName)
        console.log('获取userName',this.$store.state.user.userName)
        return this.$store.state.user.RealName
      },
      fundtableColumns(){
        let columns=[];
        columns.push({
src/view/diligenceTools/fundMonitoring.vue
Diff too large
src/view/diligenceTools/paymentMonitoring.vue
Diff too large
src/view/single-page/home/home.vue
@@ -393,6 +393,12 @@
      this.changePageSize()
      window.addEventListener('resize', this.changePageSize)
    },
    watch:{
      getRealName(newCount, oldCount){
        console.log('重新请求接口')
        this.getProjectList()
      }
    },
    methods: {
      ...mapActions([
        'getUserInfo'
@@ -776,6 +782,11 @@
      },
    },
    computed: {
      getRealName(){
        console.log('获取realName',this.$store.state.user.RealName)
        console.log('获取userName',this.$store.state.user.userName)
        return this.$store.state.user.RealName
      },
      projectListColumns() {
        let columns = []
        columns.push({