瀏覽代碼

农业执法

wulanhaote
庞东旭 3 年之前
父節點
當前提交
48bb4f7a3a
共有 9 個文件被更改,包括 598 次插入150 次删除
  1. +44
    -0
      src/api/lawEnforcement/index.js
  2. +0
    -8
      src/api/register/index.js
  3. +10
    -1
      src/router/index.js
  4. +2
    -0
      src/views/lawEnforcement/login.vue
  5. +119
    -57
      src/views/lawEnforcement/register/companyRegister.vue
  6. +149
    -84
      src/views/lawEnforcement/register/userRegister.vue
  7. +6
    -0
      src/views/lawEnforcement/user/index.vue
  8. +268
    -0
      src/views/lawEnforcement/user/userInformation.vue
  9. 二進制
      static/images/lawEnforcement/icon/icon_xgxx.png

+ 44
- 0
src/api/lawEnforcement/index.js 查看文件

@@ -328,3 +328,47 @@ export function getCompanyByUserId(userId) {
method: 'get'
})
}

// 个体户通过手机号码查询是否已经存在个体户的基本信息
export function personalList(data) {
return request({
url: '/enforce/personal/personalList',
method: 'get',
params: data
})
}

// 企业通过负责人手机号码查询是否已经存在企业基本信息
export function companyList(data) {
return request({
url: '/enforce/company/companyList',
method: 'get',
params: data
})
}

// 存在基本信息,将手机号等信息注册成账号
export function createUser(data) {
return request({
url: '/enforce/personal/createUser',
method: 'post',
data: data
})
}

// 存在基本信息,将手机号等信息注册成账号
export function companyCreateUser(data) {
return request({
url: '/enforce/company/createUser',
method: 'post',
data: data
})
}

// 查询部门下拉树结构
export function treeselectUser() {
return request({
url: '/enforce/website/treeselect',
method: 'get'
})
}

+ 0
- 8
src/api/register/index.js 查看文件

@@ -38,11 +38,3 @@ export function userRegister(data) {
})
}

// 查询部门下拉树结构
export function treeselect() {
return request({
url: '/system/dept/treeselect',
method: 'get'
})
}


+ 10
- 1
src/router/index.js 查看文件

@@ -1610,7 +1610,7 @@ export const constantRoutes = [
},
{
path: '/lawEnforcement/login',
name: 'login',
name: 'lawEnforcementLogin',
meta: {
title: '登录',
hidden: true,
@@ -1635,6 +1635,15 @@ export const constantRoutes = [
},
component: (resolve) => require(['@/views/lawEnforcement/register/companyRegister'], resolve)
},
{
path: '/lawEnforcement/userInformation',
name: 'lawUserInformation',
meta: {
title: '修改信息',
hidden: true,
},
component: (resolve) => require(['@/views/lawEnforcement/user/userInformation'], resolve)
},
{
path: '/lawEnforcement/indexComplaint',
name: 'indexComplaint',


+ 2
- 0
src/views/lawEnforcement/login.vue 查看文件

@@ -57,11 +57,13 @@
<p style="font-family: zqkhyt;font-size: 0.4rem;margin-top: 3%">个体工商户</p>
</van-col>
<van-col :span="12" align="center">
<router-link :to="{name:'lawEnforcementCompanyRegister'}">
<van-image
round
width="50%"
src="../../../static/images/lawEnforcement/qy.png"
/>
</router-link>
<p style="font-family: zqkhyt;font-size: 0.4rem;margin-top: 3%">企业</p>
</van-col>
</van-row>


+ 119
- 57
src/views/lawEnforcement/register/companyRegister.vue 查看文件

@@ -1,57 +1,59 @@
<template>
<div class="app-container" :style="{height:height+'px'}">
<van-nav-bar
title="单位用户注册"
title="企业用户注册"
left-arrow
fixed
placeholder
@click-left="onClickLeft"
/>
<van-form @submit="getSubmit">
<van-field v-model="form.phone" type="tel" label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" @input="phoneChange" />
<van-field readonly v-model="form.companyName" label="企业名称" placeholder="企业名称"/>
<van-field readonly v-model="form.uniformCode" label="社会信用代码" placeholder="社会信用代码"/>
<van-field readonly v-model="form.legalName" label="法人/负责人" placeholder="法人/负责人"/>
<van-field
v-model="deptName"
readonly
clickable
name="picker"
:value="value"
label="供求类型"
placeholder="点击选择供求类型"
@click="showPicker = true"
required
:rules="[{ required:true }]"
name="area"
label="所在地区"
placeholder="所在地区"
@click="showArea = true"
/>
<van-popup v-model="showPicker" position="bottom">
<van-picker
show-toolbar
:columns="columns"
@confirm="onConfirm"
@cancel="showPicker = false"
/>
</van-popup>
<van-field v-model="form.phone" type="tel" label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" />
<!-- <van-popup v-model:show="showArea" position="bottom">-->
<!-- <van-picker-->
<!-- show-toolbar-->
<!-- value-key="label"-->
<!-- :columns="deptOptions"-->
<!-- @confirm="onConfirmAdress"-->
<!-- @cancel="showArea = false"-->
<!-- />-->
<!-- </van-popup>-->
<van-field readonly v-model="form.companyBranch" label="企业分支机构" placeholder="企业分支机构"/>
<van-field readonly v-model="form.address" label="详细地址" placeholder="详细地址" />
<van-field readonly v-model="form.investor" label="企业投资人" placeholder="企业投资人" />
<van-field readonly v-model="form.businessMode" label="经营方式" placeholder="经营方式" />
<van-field
v-model="form.code"
center
clearable
label="验证码"
placeholder="图形验证码"
required :rules="[{ required:true }]"
>
<template #button>
<img class="code-img" :src="codeUrl" @click="getCode" />
</template>
</van-field>
<van-field v-model="form.password" type="password" label="密码" placeholder="请输入密码" required :rules="[{ required:true }]"/>
<van-field v-model="confirmPassWord" type="password" label="确认密码" placeholder="请再次输入密码" required :rules="[{ required:true }]"/>
v-model="businessTypeText"
readonly
label="经营类别"
placeholder="经营类别"
@click="showBusiness = true"
/>
<!-- <van-popup v-model:show="showBusiness" position="bottom">-->
<!-- <van-picker-->
<!-- title="经营类别"-->
<!-- show-toolbar-->
<!-- :columns="businessTypeOptions"-->
<!-- @confirm="onConfirmBusiness"-->
<!-- value-key="dictLabel"-->
<!-- />-->
<!-- </van-popup>-->

<van-field readonly v-model="form.businessScope" label="经营范围" placeholder="经营范围" />

<van-field v-model="form.companyName" label="公司名称" placeholder="请输入公司名称" required :rules="[{ required:true }]"/>
<van-field v-model="form.realname" label="负责人姓名" placeholder="请输入负责人姓名" required :rules="[{ required:true }]"/>
<van-field v-model="form.idCardNum" label="身份证号" placeholder="请输入法人身份证号" required :rules="[{ required:true }]"/>
<van-field v-model="form.companyCode" label="社会信用代码" placeholder="请输入公司的社会信用代码" required :rules="[{ required:true }]"/>
<van-field v-model="form.companyLicense" label="营业执照号" placeholder="请输入公司的营业执照号" required :rules="[{ required:true }]"/>
<van-field v-model="form.address" label="联系地址" placeholder="请输入联系地址" />
<div class="submit">
<p>我已阅读并同意<span>《农村产权交易信息服务平台会员注册协议》</span></p>
<van-button round block type="info" color="#007E72" native-type="submit">立即注册</van-button>
<van-button round block type="info" color="#007E72" native-type="submit" :disabled="btnDisabled">立即注册</van-button>
</div>
</van-form>
</div>
@@ -60,6 +62,7 @@
<script>
import { getCodeImg } from "@/api/login";
import { userRegister } from "@/api/register/index";
import { companyList,treeselectUser , companyCreateUser } from "@/api/lawEnforcement/index";
export default {
name: "companyRegister",
data() {
@@ -68,21 +71,18 @@ export default {
tel:'',
value:'',
confirmPassWord:'',
businessTypeText:'',
showBusiness:false,
btnDisabled:true,
// 经营类别
businessTypeOptions: [],
showPicker: false,
columns:[],
deptName:'',
showArea:false,
// 部门列表
deptOptions: [],
form: {
phone: "", //账号
code: "", //验证码
password: "", //密码
realname: "", //姓名
idCardNum: "", //身份证号
address: "", //地址
uuid:'',//图形验证码ID
memberType:2,
economicType:1,
companyName:'',
companyLicense:'',
companyCode:''
},
codeUrl:''
};
@@ -94,9 +94,35 @@ export default {
this.columns.push(item.dictLabel);
});
});
/** 查询部门下拉树结构 */
treeselectUser().then((response) => {
this.deptOptions = response.data;
});

this.getDicts("business_type").then(response => {
this.businessTypeOptions = response.data;
});
this.height = document.body.clientHeight
},
methods: {
onConfirmBusiness(value){
this.showBusiness = false;
this.businessTypeText = value.dictLabel;
this.form.businessType = value.dictValue;
console.log(value)
},
onConfirmAdress(value){
console.log(value)
this.showArea = false;

this.deptName = value[0]+'/'+value[1]+'/'+value[2]

let array1 = eval(this.deptOptions).filter(function (e) { return e.label == value[0]; });
let array2 = eval(array1[0].children).filter(function (e) { return e.label == value[1]; });
let array3 = eval(array2[0].children).filter(function (e) { return e.label == value[2]; });

this.form.deptId = array3[0].value
},
getCode() {
getCodeImg().then((res) => {
this.form.uuid = res.uuid;
@@ -109,9 +135,42 @@ export default {
this.form.supplyDemandType = index + 1 ;
},
getSubmit(){
console.log(this.form)
userRegister(this.form).then((res) => {
companyCreateUser(this.form).then((res) => {
console.log(res)
if (res.code == 200){
this.$dialog.alert({
title: '提示',
message: "注册成功!账号为您的手机号,初始密码为123456,登录后可前往个人中心-密码修改进行修改密码操作。",
}).then(() => {
this.$router.push({name:'lawEnforcementLogin'})
});
}
});
},
phoneChange(){
if (this.form.phone.length<11){
if (this.form.phone.length == 0){
this.form = {}
this.deptName = '';
this.nationText = '';
this.businessTypeText = '';
this.sex = '';
}
this.btnDisabled = true;
return;
}
let data = {
phone:this.form.phone,
}
companyList(data).then((res) => {
if(res.data.id == null){
this.$notify({ type: 'danger' , message: "无企业信息,无法注册账号,请与执法机构联系添加!" });
}else{
this.btnDisabled = false;
this.form = res.data;
this.deptName = this.selectDictLabel(this.deptOptions, res.data.deptId);
this.businessTypeText = this.selectDictLabel(this.businessTypeOptions, res.data.businessType);
}
});
}
},
@@ -126,10 +185,13 @@ export default {
}
}
.submit{
position: absolute;
bottom: 5%;
width: 90%;
left: 5%;
position: fixed;
bottom: 0;
width: 100%;
left: 0;
background: #FFF;
padding: 5% 3%;
box-shadow: 0px -5px 9px #eee;
p{
text-align: center;
margin-bottom: 0.2rem;


+ 149
- 84
src/views/lawEnforcement/register/userRegister.vue 查看文件

@@ -8,92 +8,98 @@
@click-left="onClickLeft"
/>
<van-form @submit="getSubmit" style="padding-bottom: 22%;">
<van-field v-model="form.name" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/>
<van-field v-model="form.cardNum" label="身份证号" placeholder="请输入身份证号" required :rules="[{ required:true }]"/>
<van-field name="radio" label="性别" :rules="[{ required:true }]" required>
<template #input>
<van-radio-group v-model="form.sex" direction="horizontal">
<van-radio name="0">男</van-radio>
<van-radio name="1">女</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="form.phone" type="tel" label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" @input="phoneChange" />
<van-field
v-model="deptName"
readonly
name="area"
label="所在地区"
placeholder="所在地区"
@click="showArea = true"
/>
<!-- <van-popup v-model:show="showArea" position="bottom">-->
<!-- <van-picker-->
<!-- show-toolbar-->
<!-- value-key="label"-->
<!-- :columns="deptOptions"-->
<!-- @confirm="onConfirmAdress"-->
<!-- @cancel="showArea = false"-->
<!-- />-->
<!-- </van-popup>-->
<van-field readonly v-model="form.name" label="姓名" placeholder="姓名"/>
<van-field readonly v-model="form.cardNum" label="身份证号" placeholder="身份证号"/>
<van-field readonly v-model="sex" label="性别" placeholder="性别"/>
<van-field
v-model="nationText"
is-link
readonly
label="民族"
placeholder="点击选择民族"
placeholder="民族"
@click="showNation = true"
/>
<van-popup v-model:show="showNation" position="bottom">
<van-picker
title="民族"
show-toolbar
:columns="nationOptions"
@confirm="onConfirmNation"
value-key="dictLabel"
/>
<!-- @confirm="onConfirm"-->
<!-- @cancel="onCancel"-->
<!-- @change="onChange"-->
</van-popup>
<van-field v-model="form.phone" type="tel" label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" />
<van-field
v-model="form.code"
center
clearable
label="验证码"
placeholder="图形验证码"
required :rules="[{ required:true }]"
>
<template #button>
<img class="code-img" :src="codeUrl" @click="getCode" />
</template>
</van-field>
<van-field v-model="form.password" type="password" label="密码" placeholder="请输入密码" required :rules="[{ required:true }]"/>
<van-field v-model="confirmPassWord" type="password" label="确认密码" placeholder="请再次输入密码" required :rules="[{ required:true }]"/>
<!-- <van-popup v-model:show="showNation" position="bottom">-->
<!-- <van-picker-->
<!-- title="民族"-->
<!-- show-toolbar-->
<!-- :columns="nationOptions"-->
<!-- @confirm="onConfirmNation"-->
<!-- value-key="dictLabel"-->
<!-- />-->
<!-- </van-popup>-->
<!-- <van-field-->
<!-- v-model="form.code"-->
<!-- center-->
<!-- clearable-->
<!-- label="验证码"-->
<!-- placeholder="图形验证码"-->
<!-- required-->
<!-- :rules="[{ required:true }]"-->
<!-- >-->
<!-- <template #button>-->
<!-- <img class="code-img" :src="codeUrl" @click="getCode" />-->
<!-- </template>-->
<!-- </van-field>-->
<!-- <van-field v-model="form.password" type="password" label="密码" placeholder="请输入密码" required :rules="[{ required:true }]"/>-->
<!-- <van-field v-model="confirmPassWord" type="password" label="确认密码" placeholder="请再次输入密码" required :rules="[{ required:true }]"/>-->
<van-field
v-model="form.birthday"
is-link
readonly
name="datetimePicker"
label="出生日期"
placeholder="点击选择出生日期"
placeholder="出生日期"
@click="showDate = true"
/>
<van-popup v-model:show="showDate" position="bottom">
<van-datetime-picker
type="date"
title="选择年月日"
:min-date="minDate"
:max-date="maxDate"
@confirm="onConfirmBirthday"
@cancel="showDate = false"
/>
</van-popup>
<van-field v-model="form.companyPosition" label="工作单位及职务" placeholder="请输入工作单位及职务" required :rules="[{ required:true }]"/>
<van-field v-model="form.uniformCode" label="统一社会信用代码" placeholder="请输入统一社会信用代码" required :rules="[{ required:true }]"/>
<!-- <van-popup v-model:show="showDate" position="bottom">-->
<!-- <van-datetime-picker-->
<!-- type="date"-->
<!-- title="选择年月日"-->
<!-- :min-date="minDate"-->
<!-- :max-date="maxDate"-->
<!-- @confirm="onConfirmBirthday"-->
<!-- @cancel="showDate = false"-->
<!-- />-->
<!-- </van-popup>-->
<van-field readonly v-model="form.companyPosition" label="工作单位及职务" placeholder="工作单位及职务"/>
<van-field readonly v-model="form.uniformCode" label="统一社会信用代码" placeholder="统一社会信用代码"/>

<van-field readonly v-model="form.zihao" label="字号名称" placeholder="字号名称"/>
<van-field readonly v-model="form.address" label="详细地址" placeholder="详细地址"/>
<van-field
v-model="form.deptId"
is-link
v-model="businessTypeText"
readonly
name="area"
label="所在地区"
placeholder="点击选择地区"
@click="showArea = true"
label="经营类别"
placeholder="经营类别"
@click="showBusiness = true"
/>
<van-popup v-model:show="showArea" position="bottom">
<van-area
:area-list="deptOptions"
@confirm="onConfirmAdress"
@cancel="showArea = false"
/>
</van-popup>
<van-field v-model="form.zihao" label="字号名称" placeholder="请输入字号名称" required :rules="[{ required:true }]"/>
<van-field v-model="form.address" label="详细地址" placeholder="请输入详细地址" required :rules="[{ required:true }]"/>
<van-field v-model="form.businessType" label="经营类别" placeholder="请输入经营类别" required :rules="[{ required:true }]"/>
<van-field v-model="form.businessScope" label="经营范围" placeholder="请输入经营范围" required :rules="[{ required:true }]"/>
<!-- <van-popup v-model:show="showBusiness" position="bottom">-->
<!-- <van-picker-->
<!-- title="经营类别"-->
<!-- show-toolbar-->
<!-- :columns="businessTypeOptions"-->
<!-- @confirm="onConfirmBusiness"-->
<!-- value-key="dictLabel"-->
<!-- />-->
<!-- </van-popup>-->
<van-field readonly v-model="form.businessScope" label="经营范围" placeholder="经营范围"/>
<div class="submit">
<van-button round block type="info" color="#007E72" native-type="submit">立即注册</van-button>
</div>
@@ -103,7 +109,8 @@

<script>
import { getCodeImg } from "@/api/login";
import { userRegister,treeselect } from "@/api/register/index";
import { personalList,treeselectUser , createUser } from "@/api/lawEnforcement/index";
import $ from "jquery";
// import { areaList } from '@vant/area-data';
export default {
name: "userRegister",
@@ -111,23 +118,26 @@ export default {
return {
height:0,
tel:'',
result:'',
deptName:'',
confirmPassWord:'',
areaList:areaList,
businessTypeText:'',
areaList:[],
showArea:false,
showDate:false,
showNation:false,
showBusiness:false,
minDate: new Date(1900, 1, 1),
maxDate: new Date(),
form: {
sex:'0'
},
form: {},
sex:'',
codeUrl:'',
nationText:'',
// 民族字典
nationOptions: [],
// 部门列表
deptOptions: [],
// 经营类别
businessTypeOptions: [],
};
},
created() {
@@ -137,17 +147,32 @@ export default {
this.nationOptions = response.data;
});
/** 查询部门下拉树结构 */
treeselect().then((response) => {
treeselectUser().then((response) => {
this.deptOptions = response.data;
});

this.getDicts("business_type").then(response => {
this.businessTypeOptions = response.data;
});

this.getDicts("sex").then(response => {
this.sexOptions = response.data;
});
},
methods: {
onConfirmAdress(areaValues){
onConfirmAdress(value){
console.log(value)
this.showArea = false;
this.result = areaValues
.filter((item) => !!item)
.map((item) => item.name)
.join('/');

this.deptName = value[0]+'/'+value[1]+'/'+value[2]

let array1 = eval(this.deptOptions).filter(function (e) { return e.label == value[0]; });
let array2 = eval(array1[0].children).filter(function (e) { return e.label == value[1]; });
let array3 = eval(array2[0].children).filter(function (e) { return e.label == value[2]; });

this.form.deptId = array3[0].value

this.phoneChange();
},
onConfirmBirthday(value){
console.log(this.timeFormat(value))
@@ -159,6 +184,12 @@ export default {
this.nationText = value.dictLabel;
this.form.nation = value.dictValue;
},
onConfirmBusiness(value){
this.showBusiness = false;
this.businessTypeText = value.dictLabel;
this.form.businessType = value.dictValue;
console.log(value)
},
timeFormat(time) { // 时间格式化 2019-09-08

let year = time.getFullYear();
@@ -177,9 +208,43 @@ export default {
});
},
getSubmit(){
console.log(this.form)
userRegister(this.form).then((res) => {
createUser(this.form).then((res) => {
console.log(res)
if (res.code == 200){
this.$dialog.alert({
title: '提示',
message: "注册成功!账号为您的手机号,初始密码为123456,登录后可前往个人中心-密码修改进行修改密码操作。",
}).then(() => {
this.$router.push({name:'lawEnforcementLogin'})
});
}
});
},
phoneChange(){

if (this.form.phone.length<11){
if (this.form.phone.length == 0){
this.form = {}
this.deptName = '';
this.nationText = '';
this.businessTypeText = '';
this.sex = '';
}
return;
}
let data = {
phone:this.form.phone,
}
personalList(data).then((res) => {
if(res.data.id == null){
this.$notify({ type: 'danger' , message: "无个体户信息,无法注册账号,请与执法机构联系添加!" });
}else{
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);
}
});
}
},


+ 6
- 0
src/views/lawEnforcement/user/index.vue 查看文件

@@ -66,6 +66,12 @@
<span class="custom-title">密码修改</span>
</template>
</van-cell>
<van-cell is-link :to="{name:loginType ? 'lawUserInformation':'',params: { userId: user.userId,} }" >
<template #title>
<van-icon name="../../../static/images/lawEnforcement/icon/icon_xgxx.png" size="20"></van-icon>
<span class="custom-title">修改信息</span>
</template>
</van-cell>
<van-cell is-link :to="{name:loginType ? 'feedback':''}" >
<template #title>
<van-icon name="../../../static/images/lawEnforcement/icon/icon_bzfk.png" size="20"></van-icon>


+ 268
- 0
src/views/lawEnforcement/user/userInformation.vue 查看文件

@@ -0,0 +1,268 @@
<template>
<div class="app-container" :style="{height:height+'px'}">
<van-nav-bar
title="修改信息"
left-arrow
fixed
placeholder
@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="deptName"
is-link
readonly
name="area"
label="所在地区"
placeholder="请选择所在地区"
@click="showArea = true"
/>
<van-popup v-model:show="showArea" position="bottom">
<van-picker
show-toolbar
value-key="label"
:columns="deptOptions"
@confirm="onConfirmAdress"
@cancel="showArea = false"
/>
</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
v-model="nationText"
is-link
readonly
label="民族"
placeholder="请选择民族"
@click="showNation = true"
/>
<van-popup v-model:show="showNation" position="bottom">
<van-picker
title="民族"
show-toolbar
:columns="nationOptions"
@confirm="onConfirmNation"
value-key="dictLabel"
/>
</van-popup>
<!-- <van-field-->
<!-- v-model="form.code"-->
<!-- center-->
<!-- clearable-->
<!-- label="验证码"-->
<!-- placeholder="图形验证码"-->
<!-- required-->
<!-- :rules="[{ required:true }]"-->
<!-- >-->
<!-- <template #button>-->
<!-- <img class="code-img" :src="codeUrl" @click="getCode" />-->
<!-- </template>-->
<!-- </van-field>-->
<!-- <van-field v-model="form.password" type="password" label="密码" placeholder="请输入密码" required :rules="[{ required:true }]"/>-->
<!-- <van-field v-model="confirmPassWord" type="password" label="确认密码" placeholder="请再次输入密码" required :rules="[{ required:true }]"/>-->
<van-field
v-model="form.birthday"
is-link
readonly
name="datetimePicker"
label="出生日期"
placeholder="请选择出生日期"
@click="showDate = true"
/>
<van-popup v-model:show="showDate" position="bottom">
<van-datetime-picker
type="date"
title="选择年月日"
:min-date="minDate"
:max-date="maxDate"
@confirm="onConfirmBirthday"
@cancel="showDate = false"
/>
</van-popup>
<van-field v-model="form.companyPosition" label="工作单位及职务" placeholder="请输入工作单位及职务"/>
<van-field v-model="form.uniformCode" label="统一社会信用代码" placeholder="请输入统一社会信用代码"/>

<van-field v-model="form.zihao" label="字号名称" placeholder="请输入字号名称"/>
<van-field v-model="form.address" label="详细地址" placeholder="请输入详细地址"/>
<van-field
v-model="businessTypeText"
is-link
readonly
label="经营类别"
placeholder="请选择经营类别"
@click="showBusiness = true"
/>
<van-popup v-model:show="showBusiness" position="bottom">
<van-picker
title="经营类别"
show-toolbar
:columns="businessTypeOptions"
@confirm="onConfirmBusiness"
value-key="dictLabel"
/>
</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>
</div>
</van-form>
</div>
</template>

<script>
import { getCodeImg } from "@/api/login";
import { personalList,treeselectUser , createUser } from "@/api/lawEnforcement/index";
import $ from "jquery";
// import { areaList } from '@vant/area-data';
export default {
name: "userRegister",
data() {
return {
height:0,
tel:'',
deptName:'',
confirmPassWord:'',
businessTypeText:'',
areaList:[],
showArea:false,
showDate:false,
showNation:false,
showBusiness:false,
minDate: new Date(1900, 1, 1),
maxDate: new Date(),
form: {},
sex:'',
codeUrl:'',
nationText:'',
// 民族字典
nationOptions: [],
// 部门列表
deptOptions: [],
// 经营类别
businessTypeOptions: [],
};
},
created() {
this.getCode()
this.height = document.body.clientHeight
this.getDicts("nationality").then(response => {
this.nationOptions = response.data;
});
/** 查询部门下拉树结构 */
treeselectUser().then((response) => {
this.deptOptions = response.data;
});

this.getDicts("business_type").then(response => {
this.businessTypeOptions = response.data;
});

this.getDicts("sex").then(response => {
this.sexOptions = response.data;
});
this.getInformation();
},
methods: {
getInformation(){

let data = {
userId:this.$route.params.userId,
}
personalList(data).then((res) => {
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);
});
},
onConfirmAdress(value){
console.log(value)
this.showArea = false;

this.deptName = value[0]+'/'+value[1]+'/'+value[2]

let array1 = eval(this.deptOptions).filter(function (e) { return e.label == value[0]; });
let array2 = eval(array1[0].children).filter(function (e) { return e.label == value[1]; });
let array3 = eval(array2[0].children).filter(function (e) { return e.label == value[2]; });

this.form.deptId = array3[0].value

this.phoneChange();
},
onConfirmBirthday(value){
console.log(this.timeFormat(value))
this.showDate = false;
this.form.birthday = this.timeFormat(value);
},
onConfirmNation(value,index){
this.showNation = false;
this.nationText = value.dictLabel;
this.form.nation = value.dictValue;
},
onConfirmBusiness(value){
this.showBusiness = false;
this.businessTypeText = value.dictLabel;
this.form.businessType = value.dictValue;
console.log(value)
},
timeFormat(time) { // 时间格式化 2019-09-08

let year = time.getFullYear();

let month = time.getMonth() + 1;

let day = time.getDate();

return year + '-' + month + '-' + day

},
getCode() {
getCodeImg().then((res) => {
this.form.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img;
});
},
getSubmit(){
createUser(this.form).then((res) => {
console.log(res)
if (res.code == 200){
this.$dialog.alert({
title: '提示',
message: "注册成功!账号为您的手机号,初始密码为123456,登录后可前往个人中心-密码修改进行修改密码操作。",
}).then(() => {
this.$router.push({name:'lawEnforcementLogin'})
});
}
});
},
},
};
</script>

<style scoped lang="scss">
.app-container {
background-color: #FFF;
.code-img {
width: 220px;
}
}
.submit{
position: fixed;
bottom: 0;
width: 100%;
left: 0;
background: #FFF;
padding: 5% 3%;
box-shadow: 0px -5px 9px #eee;
p{
text-align: center;
margin-bottom: 0.2rem;
span{
color: #007E72;
}
}
}
</style>

二進制
static/images/lawEnforcement/icon/icon_xgxx.png 查看文件

Before After
Width: 40  |  Height: 40  |  Size: 1.7 KiB

Loading…
取消
儲存