Pārlūkot izejas kodu

修改信息

wulanhaote
庞东旭 pirms 3 gadiem
vecāks
revīzija
de04faf72f
3 mainītis faili ar 54 papildinājumiem un 18 dzēšanām
  1. +9
    -0
      src/api/lawEnforcement/index.js
  2. +1
    -1
      src/views/lawEnforcement/user/index.vue
  3. +44
    -17
      src/views/lawEnforcement/user/userInformation.vue

+ 9
- 0
src/api/lawEnforcement/index.js Parādīt failu

@@ -381,3 +381,12 @@ export function updateCompany(data) {
data: data
})
}

// 修改农业执法-监管对象(个体户)
export function updatePersonal(data) {
return request({
url: '/enforce/personal/edit',
method: 'post',
data: data
})
}

+ 1
- 1
src/views/lawEnforcement/user/index.vue Parādīt failu

@@ -6,7 +6,7 @@
<van-col :span="24" v-show="loginType">
<p class="userName">{{user.nickName}}<span style="font-size: 0.4rem;float: right;">{{roleGroup}}</span></p>
<!-- <i style="margin-right: 0.5rem;"></i>-->
<p class="userDept"><span style="float: left;">({{companyName}})</span>{{user.dept.deptName}}</p>
<p class="userDept"><span v-if="companyName" style="float: left;">({{companyName}})</span>{{user.dept.deptName}}</p>
<p class="userDept">{{postGroup}}</p>
</van-col>
<van-col :span="24" v-show="loginButton">


+ 44
- 17
src/views/lawEnforcement/user/userInformation.vue Parādīt failu

@@ -8,7 +8,7 @@
@click-left="onClickLeft"
/>
<van-form @submit="getSubmit" style="padding-bottom: 22%;">
<van-field v-model="form.phone" type="tel" label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" />
<van-field v-model="form.phone+' ( 不可修改 )'" type="tel" readonly label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" />
<van-field
v-model="deptName"
is-link
@@ -29,7 +29,14 @@
</van-popup>
<van-field v-model="form.name" label="姓名" placeholder="请输入姓名"/>
<van-field v-model="form.cardNum" label="身份证号" placeholder="请输入身份证号"/>
<van-field v-model="sex" label="性别" placeholder="性别"/>
<van-field name="radio" label="性别">
<template #input>
<van-radio-group v-model="form.sex" direction="horizontal">
<van-radio name="1">男</van-radio>
<van-radio name="2">女</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-model="nationText"
is-link
@@ -105,7 +112,7 @@
</van-popup>
<van-field v-model="form.businessScope" label="经营范围" placeholder="请输入经营范围"/>
<div class="submit">
<van-button round block type="info" color="#007E72" native-type="submit">立即注册</van-button>
<van-button round block type="info" color="#007E72" native-type="submit">保存</van-button>
</div>
</van-form>
</div>
@@ -113,8 +120,10 @@

<script>
import { getCodeImg } from "@/api/login";
import { personalList,treeselectUser , createUser } from "@/api/lawEnforcement/index";
import { logout ,getInfo } from "@/api/login/index";
import { personalList,treeselectUser , updatePersonal } from "@/api/lawEnforcement/index";
import $ from "jquery";
import Cookies from "js-cookie";
// import { areaList } from '@vant/area-data';
export default {
name: "userRegister",
@@ -132,7 +141,9 @@ export default {
showBusiness:false,
minDate: new Date(1900, 1, 1),
maxDate: new Date(),
form: {},
form: {
sex:1
},
sex:'',
codeUrl:'',
nationText:'',
@@ -153,6 +164,7 @@ export default {
/** 查询部门下拉树结构 */
treeselectUser().then((response) => {
this.deptOptions = response.data;
this.getInformation();
});

this.getDicts("business_type").then(response => {
@@ -162,17 +174,31 @@ export default {
this.getDicts("sex").then(response => {
this.sexOptions = response.data;
});
this.getInformation();
},
methods: {
getInformation(){

let data = {
userId:this.$route.params.userId,
userId:this.$route.query.userId,
}
personalList(data).then((res) => {
for (var i = 0 ; i < this.deptOptions.length ; i ++ ){
if (this.deptOptions[i].id == res.data.deptId){
this.deptName = this.deptOptions[i].label;
}else{
for (var j = 0 ; j < this.deptOptions[i].children.length ; j++){
if (this.deptOptions[i].children[j].id == res.data.deptId){
this.deptName = this.deptOptions[i].children[j].label;
}else{
for (var z = 0 ; z < this.deptOptions[i].children[j].children.length ; z++){
if (this.deptOptions[i].children[j].children[z].id == res.data.deptId){
this.deptName = this.deptOptions[i].children[j].children[z].label;
}
}
}
}
}
}
this.form = res.data;
this.deptName = this.selectDictLabel(this.deptOptions, res.data.deptId);
this.nationText = this.selectDictLabel(this.nationOptions, res.data.nation);
this.businessTypeText = this.selectDictLabel(this.businessTypeOptions, res.data.businessType);
this.sex = this.selectDictLabel(this.sexOptions, res.data.sex);
@@ -226,16 +252,17 @@ export default {
});
},
getSubmit(){
createUser(this.form).then((res) => {
console.log(res)
if (res.code == 200){
this.$dialog.alert({
title: '提示',
message: "注册成功!账号为您的手机号,初始密码为123456,登录后可前往个人中心-密码修改进行修改密码操作。",
}).then(() => {
updatePersonal(this.form).then(response => {

this.$dialog.alert({
title: '提示',
message: "修改成功!即将退出登录,重新登录后修改生效!",
}).then(() => {
logout().then(response => {
Cookies.remove("User-Token");
this.$router.push({name:'lawEnforcementLogin'})
});
}
});
});
},
},


Notiek ielāde…
Atcelt
Saglabāt