| @@ -328,3 +328,47 @@ export function getCompanyByUserId(userId) { | |||||
| method: 'get' | 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' | |||||
| }) | |||||
| } | |||||
| @@ -38,11 +38,3 @@ export function userRegister(data) { | |||||
| }) | }) | ||||
| } | } | ||||
| // 查询部门下拉树结构 | |||||
| export function treeselect() { | |||||
| return request({ | |||||
| url: '/system/dept/treeselect', | |||||
| method: 'get' | |||||
| }) | |||||
| } | |||||
| @@ -1610,7 +1610,7 @@ export const constantRoutes = [ | |||||
| }, | }, | ||||
| { | { | ||||
| path: '/lawEnforcement/login', | path: '/lawEnforcement/login', | ||||
| name: 'login', | |||||
| name: 'lawEnforcementLogin', | |||||
| meta: { | meta: { | ||||
| title: '登录', | title: '登录', | ||||
| hidden: true, | hidden: true, | ||||
| @@ -1635,6 +1635,15 @@ export const constantRoutes = [ | |||||
| }, | }, | ||||
| component: (resolve) => require(['@/views/lawEnforcement/register/companyRegister'], resolve) | 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', | path: '/lawEnforcement/indexComplaint', | ||||
| name: 'indexComplaint', | name: 'indexComplaint', | ||||
| @@ -57,11 +57,13 @@ | |||||
| <p style="font-family: zqkhyt;font-size: 0.4rem;margin-top: 3%">个体工商户</p> | <p style="font-family: zqkhyt;font-size: 0.4rem;margin-top: 3%">个体工商户</p> | ||||
| </van-col> | </van-col> | ||||
| <van-col :span="12" align="center"> | <van-col :span="12" align="center"> | ||||
| <router-link :to="{name:'lawEnforcementCompanyRegister'}"> | |||||
| <van-image | <van-image | ||||
| round | round | ||||
| width="50%" | width="50%" | ||||
| src="../../../static/images/lawEnforcement/qy.png" | src="../../../static/images/lawEnforcement/qy.png" | ||||
| /> | /> | ||||
| </router-link> | |||||
| <p style="font-family: zqkhyt;font-size: 0.4rem;margin-top: 3%">企业</p> | <p style="font-family: zqkhyt;font-size: 0.4rem;margin-top: 3%">企业</p> | ||||
| </van-col> | </van-col> | ||||
| </van-row> | </van-row> | ||||
| @@ -1,57 +1,59 @@ | |||||
| <template> | <template> | ||||
| <div class="app-container" :style="{height:height+'px'}"> | <div class="app-container" :style="{height:height+'px'}"> | ||||
| <van-nav-bar | <van-nav-bar | ||||
| title="单位用户注册" | |||||
| title="企业用户注册" | |||||
| left-arrow | left-arrow | ||||
| fixed | fixed | ||||
| placeholder | placeholder | ||||
| @click-left="onClickLeft" | @click-left="onClickLeft" | ||||
| /> | /> | ||||
| <van-form @submit="getSubmit"> | <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 | <van-field | ||||
| v-model="deptName" | |||||
| readonly | 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 | <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"> | <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> | </div> | ||||
| </van-form> | </van-form> | ||||
| </div> | </div> | ||||
| @@ -60,6 +62,7 @@ | |||||
| <script> | <script> | ||||
| import { getCodeImg } from "@/api/login"; | import { getCodeImg } from "@/api/login"; | ||||
| import { userRegister } from "@/api/register/index"; | import { userRegister } from "@/api/register/index"; | ||||
| import { companyList,treeselectUser , companyCreateUser } from "@/api/lawEnforcement/index"; | |||||
| export default { | export default { | ||||
| name: "companyRegister", | name: "companyRegister", | ||||
| data() { | data() { | ||||
| @@ -68,21 +71,18 @@ export default { | |||||
| tel:'', | tel:'', | ||||
| value:'', | value:'', | ||||
| confirmPassWord:'', | confirmPassWord:'', | ||||
| businessTypeText:'', | |||||
| showBusiness:false, | |||||
| btnDisabled:true, | |||||
| // 经营类别 | |||||
| businessTypeOptions: [], | |||||
| showPicker: false, | showPicker: false, | ||||
| columns:[], | columns:[], | ||||
| deptName:'', | |||||
| showArea:false, | |||||
| // 部门列表 | |||||
| deptOptions: [], | |||||
| form: { | form: { | ||||
| phone: "", //账号 | |||||
| code: "", //验证码 | |||||
| password: "", //密码 | |||||
| realname: "", //姓名 | |||||
| idCardNum: "", //身份证号 | |||||
| address: "", //地址 | |||||
| uuid:'',//图形验证码ID | |||||
| memberType:2, | |||||
| economicType:1, | |||||
| companyName:'', | |||||
| companyLicense:'', | |||||
| companyCode:'' | |||||
| }, | }, | ||||
| codeUrl:'' | codeUrl:'' | ||||
| }; | }; | ||||
| @@ -94,9 +94,35 @@ export default { | |||||
| this.columns.push(item.dictLabel); | 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 | this.height = document.body.clientHeight | ||||
| }, | }, | ||||
| methods: { | 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() { | getCode() { | ||||
| getCodeImg().then((res) => { | getCodeImg().then((res) => { | ||||
| this.form.uuid = res.uuid; | this.form.uuid = res.uuid; | ||||
| @@ -109,9 +135,42 @@ export default { | |||||
| this.form.supplyDemandType = index + 1 ; | this.form.supplyDemandType = index + 1 ; | ||||
| }, | }, | ||||
| getSubmit(){ | getSubmit(){ | ||||
| console.log(this.form) | |||||
| userRegister(this.form).then((res) => { | |||||
| companyCreateUser(this.form).then((res) => { | |||||
| console.log(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{ | .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{ | p{ | ||||
| text-align: center; | text-align: center; | ||||
| margin-bottom: 0.2rem; | margin-bottom: 0.2rem; | ||||
| @@ -8,92 +8,98 @@ | |||||
| @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.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 | <van-field | ||||
| v-model="nationText" | v-model="nationText" | ||||
| is-link | |||||
| readonly | readonly | ||||
| label="民族" | label="民族" | ||||
| placeholder="点击选择民族" | |||||
| placeholder="民族" | |||||
| @click="showNation = true" | @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 | <van-field | ||||
| v-model="form.birthday" | v-model="form.birthday" | ||||
| is-link | |||||
| readonly | readonly | ||||
| name="datetimePicker" | name="datetimePicker" | ||||
| label="出生日期" | label="出生日期" | ||||
| placeholder="点击选择出生日期" | |||||
| placeholder="出生日期" | |||||
| @click="showDate = true" | @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 | <van-field | ||||
| v-model="form.deptId" | |||||
| is-link | |||||
| v-model="businessTypeText" | |||||
| readonly | 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"> | <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> | ||||
| @@ -103,7 +109,8 @@ | |||||
| <script> | <script> | ||||
| import { getCodeImg } from "@/api/login"; | 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'; | // import { areaList } from '@vant/area-data'; | ||||
| export default { | export default { | ||||
| name: "userRegister", | name: "userRegister", | ||||
| @@ -111,23 +118,26 @@ export default { | |||||
| return { | return { | ||||
| height:0, | height:0, | ||||
| tel:'', | tel:'', | ||||
| result:'', | |||||
| deptName:'', | |||||
| confirmPassWord:'', | confirmPassWord:'', | ||||
| areaList:areaList, | |||||
| businessTypeText:'', | |||||
| areaList:[], | |||||
| showArea:false, | showArea:false, | ||||
| showDate:false, | showDate:false, | ||||
| showNation:false, | showNation:false, | ||||
| showBusiness:false, | |||||
| minDate: new Date(1900, 1, 1), | minDate: new Date(1900, 1, 1), | ||||
| maxDate: new Date(), | maxDate: new Date(), | ||||
| form: { | |||||
| sex:'0' | |||||
| }, | |||||
| form: {}, | |||||
| sex:'', | |||||
| codeUrl:'', | codeUrl:'', | ||||
| nationText:'', | nationText:'', | ||||
| // 民族字典 | // 民族字典 | ||||
| nationOptions: [], | nationOptions: [], | ||||
| // 部门列表 | // 部门列表 | ||||
| deptOptions: [], | deptOptions: [], | ||||
| // 经营类别 | |||||
| businessTypeOptions: [], | |||||
| }; | }; | ||||
| }, | }, | ||||
| created() { | created() { | ||||
| @@ -137,17 +147,32 @@ export default { | |||||
| this.nationOptions = response.data; | this.nationOptions = response.data; | ||||
| }); | }); | ||||
| /** 查询部门下拉树结构 */ | /** 查询部门下拉树结构 */ | ||||
| treeselect().then((response) => { | |||||
| treeselectUser().then((response) => { | |||||
| this.deptOptions = response.data; | this.deptOptions = response.data; | ||||
| }); | }); | ||||
| this.getDicts("business_type").then(response => { | |||||
| this.businessTypeOptions = response.data; | |||||
| }); | |||||
| this.getDicts("sex").then(response => { | |||||
| this.sexOptions = response.data; | |||||
| }); | |||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| onConfirmAdress(areaValues){ | |||||
| onConfirmAdress(value){ | |||||
| console.log(value) | |||||
| this.showArea = false; | 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){ | onConfirmBirthday(value){ | ||||
| console.log(this.timeFormat(value)) | console.log(this.timeFormat(value)) | ||||
| @@ -159,6 +184,12 @@ export default { | |||||
| this.nationText = value.dictLabel; | this.nationText = value.dictLabel; | ||||
| this.form.nation = value.dictValue; | 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 | timeFormat(time) { // 时间格式化 2019-09-08 | ||||
| let year = time.getFullYear(); | let year = time.getFullYear(); | ||||
| @@ -177,9 +208,43 @@ export default { | |||||
| }); | }); | ||||
| }, | }, | ||||
| getSubmit(){ | getSubmit(){ | ||||
| console.log(this.form) | |||||
| userRegister(this.form).then((res) => { | |||||
| createUser(this.form).then((res) => { | |||||
| console.log(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); | |||||
| } | |||||
| }); | }); | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -66,6 +66,12 @@ | |||||
| <span class="custom-title">密码修改</span> | <span class="custom-title">密码修改</span> | ||||
| </template> | </template> | ||||
| </van-cell> | </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':''}" > | <van-cell is-link :to="{name:loginType ? 'feedback':''}" > | ||||
| <template #title> | <template #title> | ||||
| <van-icon name="../../../static/images/lawEnforcement/icon/icon_bzfk.png" size="20"></van-icon> | <van-icon name="../../../static/images/lawEnforcement/icon/icon_bzfk.png" size="20"></van-icon> | ||||
| @@ -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> | |||||