Procházet zdrojové kódy

修改信息

wulanhaote
庞东旭 před 3 roky
rodič
revize
de04faf72f
3 změnil soubory, kde provedl 54 přidání a 18 odebrání
  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 Zobrazit soubor

@@ -381,3 +381,12 @@ export function updateCompany(data) {
data: 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 Zobrazit soubor

@@ -6,7 +6,7 @@
<van-col :span="24" v-show="loginType"> <van-col :span="24" v-show="loginType">
<p class="userName">{{user.nickName}}<span style="font-size: 0.4rem;float: right;">{{roleGroup}}</span></p> <p class="userName">{{user.nickName}}<span style="font-size: 0.4rem;float: right;">{{roleGroup}}</span></p>
<!-- <i style="margin-right: 0.5rem;"></i>--> <!-- <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> <p class="userDept">{{postGroup}}</p>
</van-col> </van-col>
<van-col :span="24" v-show="loginButton"> <van-col :span="24" v-show="loginButton">


+ 44
- 17
src/views/lawEnforcement/user/userInformation.vue Zobrazit soubor

@@ -8,7 +8,7 @@
@click-left="onClickLeft" @click-left="onClickLeft"
/> />
<van-form @submit="getSubmit" style="padding-bottom: 22%;"> <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 <van-field
v-model="deptName" v-model="deptName"
is-link is-link
@@ -29,7 +29,14 @@
</van-popup> </van-popup>
<van-field v-model="form.name" label="姓名" placeholder="请输入姓名"/> <van-field v-model="form.name" label="姓名" placeholder="请输入姓名"/>
<van-field v-model="form.cardNum" 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 <van-field
v-model="nationText" v-model="nationText"
is-link is-link
@@ -105,7 +112,7 @@
</van-popup> </van-popup>
<van-field v-model="form.businessScope" label="经营范围" placeholder="请输入经营范围"/> <van-field v-model="form.businessScope" label="经营范围" placeholder="请输入经营范围"/>
<div class="submit"> <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> </div>
</van-form> </van-form>
</div> </div>
@@ -113,8 +120,10 @@


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


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

let data = { let data = {
userId:this.$route.params.userId,
userId:this.$route.query.userId,
} }
personalList(data).then((res) => { 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.form = res.data;
this.deptName = this.selectDictLabel(this.deptOptions, res.data.deptId);
this.nationText = this.selectDictLabel(this.nationOptions, res.data.nation); this.nationText = this.selectDictLabel(this.nationOptions, res.data.nation);
this.businessTypeText = this.selectDictLabel(this.businessTypeOptions, res.data.businessType); this.businessTypeText = this.selectDictLabel(this.businessTypeOptions, res.data.businessType);
this.sex = this.selectDictLabel(this.sexOptions, res.data.sex); this.sex = this.selectDictLabel(this.sexOptions, res.data.sex);
@@ -226,16 +252,17 @@ export default {
}); });
}, },
getSubmit(){ 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'}) this.$router.push({name:'lawEnforcementLogin'})
}); });
}
});
}); });
}, },
}, },


Načítá se…
Zrušit
Uložit