|
|
@@ -28,94 +28,27 @@
|
|
|
<div class="home-wrapper" v-if="activeIndex==1">
|
|
|
<el-form label-width="135px" ref="formData" :model="formData" :rules="rules">
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="公司名称" label-width="150px" style="width: 100%" prop="SupplierName">
|
|
|
- <el-input v-model="formData.SupplierName" placeholder="请输入公司名称"></el-input>
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-form-item label="手机号" style="width: 100%" prop="Telephone">
|
|
|
+ <el-input v-model="formData.Telephone" placeholder="请输入手机号"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="组织机构代码" label-width="150px" style="width: 100%" prop="OrganCode">
|
|
|
- <el-input v-model="formData.OrganCode" placeholder="请输入组织机构代码"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" style="margin-left: 15%;" :disabled="isVisual" @click="getCode">{{captcha}}</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="法定代表人姓名" label-width="150px" style="width: 100%" prop="LegalPerson">
|
|
|
- <el-input v-model="formData.LegalPerson" placeholder="请输入法定代表人姓名"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="法定代表人身份证号" label-width="150px" style="width: 100%" prop="LegalPersonId">
|
|
|
- <el-input v-model="formData.LegalPersonId" placeholder="请输入法定代表人身份证号"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" label-width="60px" prop="LegalPersonImg">
|
|
|
- <el-upload action="" ref="LegalPersonUpload"
|
|
|
- :limit="2"
|
|
|
- :http-request="uploadRequest"
|
|
|
- :show-file-list="true"
|
|
|
- :before-upload="beforeUpload">
|
|
|
- <el-button size="small" type="primary">上传身份证扫描件<i class="el-icon-upload el-icon--right"></i></el-button>
|
|
|
- </el-upload>
|
|
|
+ <el-form-item label="新密码" style="width: 100%" prop="UserPass" >
|
|
|
+ <el-input type="password" v-model="formData.UserPass" auto-complete="off" placeholder="请输入新密码(8-20位,字母数字组合)"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="联系人姓名" label-width="150px" style="width: 100%" prop="ContactName">
|
|
|
- <el-input v-model="formData.ContactName" placeholder="请输入联系人姓名"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="联系人身份证号" label-width="150px" style="width: 100%" prop="ContactId">
|
|
|
- <el-input v-model="formData.ContactId" placeholder="请输入联系人身份证号"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" label-width="60px" prop="ContactImg">
|
|
|
- <el-upload action="" ref="ContactUpload"
|
|
|
- :limit="2"
|
|
|
- :http-request="uploadRequest"
|
|
|
- :show-file-list="true"
|
|
|
- :before-upload="beforeUpload">
|
|
|
- <el-button size="small" type="primary">上传身份证扫描件<i class="el-icon-upload el-icon--right"></i></el-button>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="账号/Email" label-width="150px" style="width: 100%" prop="UserName">
|
|
|
- <el-input v-model="formData.UserName" placeholder="请输入账号"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="用户名" label-width="150px" style="width: 100%" prop="Realname">
|
|
|
- <el-input v-model="formData.Realname" placeholder="请输入用户名"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="手机号" style="width: 100%" prop="Telephone">
|
|
|
- <el-input v-model="formData.Telephone" placeholder="用于审核通知和密码找回"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="密码" label-width="150px" style="width: 100%" prop="UserPass" >
|
|
|
- <el-input type="password" v-model="formData.UserPass" auto-complete="off" placeholder="请输入密码(8-20位,字母数字组合)"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="确认密码" style="width: 100%" prop="UserPass2" >
|
|
|
+ <el-form-item label="确认密码" style="width: 100%" prop="UserPass2" >
|
|
|
<el-input type="password" v-model="formData.UserPass2" auto-complete="off" placeholder="请输入确认密码"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!-- <el-form-item label="验证码" prop="telep" style="width: 100%">
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="短信验证码" prop="phober" style="width: 100%">
|
|
|
- </el-form-item>
|
|
|
- <el-checkbox v-model="checked1" style="margin-left: 80px">阅读并同意</el-checkbox>
|
|
|
- <router-link to="#">《麦吉轮用户注册协议》</router-link><router-link to="#">《隐私政策》</router-link> -->
|
|
|
</el-row>
|
|
|
<el-row style="margin-left: 50%; margin-top: 10px; margin-bottom: 20px;">
|
|
|
- <el-button type="primary" @click="register" style="width: 30%">立即注册</el-button>
|
|
|
+ <el-button type="primary" @click="register" style="width: 30%">提交</el-button>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -139,139 +72,21 @@
|
|
|
import Component from 'class-component'
|
|
|
import Sticky from '@/components/Sticky'
|
|
|
import axios from 'axios'
|
|
|
- import api from '@/api/oilsupplier/supplier'
|
|
|
- import uploadajax from '../assets/js/uploadajax.js'
|
|
|
|
|
|
@Component({
|
|
|
data () {
|
|
|
- var checkSupplierName = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('请输入公司名称!'));
|
|
|
- } else {
|
|
|
- for (let i = 0; i < this.supplierNameList.length; i++) {
|
|
|
- if (value == this.supplierNameList[i].SupplierName) {
|
|
|
- this.$alert('该公司已注册!', '提示:', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- })
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- var checkUpload = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('请上传身份证扫描件! '))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- };
|
|
|
return {
|
|
|
activeIndex: '1',
|
|
|
-
|
|
|
- supplierNameList: [], //公司名列表
|
|
|
- waituploads: [], // 等待上传的文件列表
|
|
|
+ isVisual: false,
|
|
|
+ captcha: '获取验证码',
|
|
|
|
|
|
formData: {
|
|
|
- Id: '', //int
|
|
|
- UserId: '', //int
|
|
|
- UserName: '', //账号/Email
|
|
|
- Realname: '', //用户名
|
|
|
Telephone: '', //用户手机号
|
|
|
UserPass: '',
|
|
|
- UserPass2: '',
|
|
|
- SupplierName: '',
|
|
|
- OilCertificateNo: '',
|
|
|
- Grade: '',
|
|
|
- MgrUnit: '',
|
|
|
- OperType: '',
|
|
|
- Country: '',
|
|
|
- CommercialNo: '',
|
|
|
- OrganCode: '',
|
|
|
- CountryTaxNo: '',
|
|
|
- LocalTaxNo: '',
|
|
|
- Address: '',
|
|
|
- DetailAddress: '',
|
|
|
- Province: '',
|
|
|
- City: '',
|
|
|
- Street: '',
|
|
|
- HouseNo: '',
|
|
|
- ZipCode: '',
|
|
|
- BusinessScope: '',
|
|
|
- LegalPerson: '',
|
|
|
- LegalPersonId: '',
|
|
|
- LegalPersonURL: '',
|
|
|
- CategoryCode: '',
|
|
|
- CategoryName: '',
|
|
|
- RegCapital: 0, //float32
|
|
|
- Currency: '',
|
|
|
- ContactName: '',
|
|
|
- ContactId: '',
|
|
|
- ContactURL: '',
|
|
|
- CompanyType: '',
|
|
|
- SetupTime: '', //time
|
|
|
- DepositBank: '',
|
|
|
- BankAccount: '',
|
|
|
- EMail: '',
|
|
|
- BankCreditRating: '',
|
|
|
- Mobile: '',
|
|
|
- Telphone: '',
|
|
|
- Fax: '',
|
|
|
- CompanyTel: '',
|
|
|
- QQ: '',
|
|
|
- CompanyUrl: '',
|
|
|
- Remark: '',
|
|
|
- CheckStatus: 0, //二级单位审核状态,0:未通过,1:通过
|
|
|
- IsDelete: 0, //删除状态,0正常,1已删除
|
|
|
- LinkAddress: '',
|
|
|
- LinkProvince: '',
|
|
|
- LinkCity: '',
|
|
|
- LinkStreet: '',
|
|
|
- LinkHouseNo: '',
|
|
|
- LinkZipCode: '',
|
|
|
- HseTraining: ''
|
|
|
+ UserPass2: ''
|
|
|
},
|
|
|
|
|
|
rules: {
|
|
|
- SupplierName: [
|
|
|
- { required: true,
|
|
|
- validator: checkSupplierName,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- OrganCode: [
|
|
|
- { required: true, message: '请输入组织机构代码', trigger: 'blur' }
|
|
|
- ],
|
|
|
- LegalPerson: [
|
|
|
- { required: true, message: '请输入法定代表人姓名', trigger: 'blur' }
|
|
|
- ],
|
|
|
- LegalPersonId: [
|
|
|
- { required: true, message: '请输入法定代表人身份证号', trigger: 'blur' }
|
|
|
- ],
|
|
|
- LegalPersonImg: [
|
|
|
- { required: true,
|
|
|
- validator: checkUpload,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- ContactName: [
|
|
|
- { required: true, message: '请输入联系人姓名', trigger: 'blur' }
|
|
|
- ],
|
|
|
- ContactId: [
|
|
|
- { required: true, message: '请输入联系人身份证号', trigger: 'blur' }
|
|
|
- ],
|
|
|
- ContactImg: [
|
|
|
- { required: true,
|
|
|
- validator: checkUpload,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- UserName: [
|
|
|
- { required: true, message: '请输入账号', trigger: 'blur' }
|
|
|
- ],
|
|
|
- Realname: [
|
|
|
- { required: true, message: '请输入用户名', trigger: 'blur' }
|
|
|
- ],
|
|
|
Telephone: [
|
|
|
{ required: true, message: '请输入手机号', trigger: 'blur' }
|
|
|
],
|
|
|
@@ -289,58 +104,42 @@
|
|
|
},
|
|
|
|
|
|
created () {
|
|
|
- this.getSupplierNameList() //获取已注册的公司
|
|
|
+
|
|
|
},
|
|
|
components: {
|
|
|
Sticky
|
|
|
},
|
|
|
methods: {
|
|
|
- //注册
|
|
|
- register () {
|
|
|
- let _this = this
|
|
|
-
|
|
|
- //判断公司是否注册
|
|
|
- for (let i = 0; i < _this.supplierNameList.length; i++) {
|
|
|
- if (_this.formData.SupplierName == _this.supplierNameList[i].SupplierName) {
|
|
|
- this.$alert('该公司已注册!', '提示:', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- //身份证号验证
|
|
|
- let re1 = /(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
|
|
- if (!re1.test(_this.formData.LegalPersonId)) {
|
|
|
- this.$alert('请填写正确的法定代表人身份证号!', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (!re1.test(_this.formData.ContactId)) {
|
|
|
- this.$alert('请填写正确的联系人身份证号!', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- // 判断法定代表人身份证文件上传是否完成
|
|
|
- if (!_this.checkSuccess(_this.$refs.LegalPersonUpload.uploadFiles)) {
|
|
|
- this.$alert('上传文件失败,请重新上传法定代表人身份证文件! ', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- _this.formData.LegalPersonURL = _this.getFileURL(_this.$refs.LegalPersonUpload.uploadFiles) //获取地址
|
|
|
+ //获取验证码
|
|
|
+ getCode() {
|
|
|
+ // 调用获取手机验证码的API,返回Promise对象
|
|
|
+ // this.$axios.get('/', {})
|
|
|
+ // .then(res => {
|
|
|
+ // // 将按钮设置为不可点击状态
|
|
|
+ // this.isVisual = true
|
|
|
+ // // 60秒倒计时
|
|
|
+ // let time = 60
|
|
|
+ // let timer = setInterval(() => {
|
|
|
+ // if (time <= 0) {
|
|
|
+ // this.isVisual = false
|
|
|
+ // this.captcha = '获取验证码'
|
|
|
+ // clearInterval(timer)
|
|
|
+ // } else {
|
|
|
+ // this.btnText = time + 's'
|
|
|
+ // time--
|
|
|
+ // }
|
|
|
+ // }, 1000)
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // console.log(err.message)
|
|
|
+ // this.isVisual = false
|
|
|
+ // })
|
|
|
+ },
|
|
|
|
|
|
- // 判断联系人身份证文件上传是否完成
|
|
|
- if (!_this.checkSuccess(_this.$refs.ContactUpload.uploadFiles)) {
|
|
|
- this.$alert('上传文件失败,请重新上传联系人身份证文件! ', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- _this.formData.ContactURL = _this.getFileURL(_this.$refs.ContactUpload.uploadFiles)
|
|
|
+ //提交
|
|
|
+ save() {
|
|
|
+ let _this = this
|
|
|
|
|
|
//手机号验证
|
|
|
let re3 = /^[1][3456789]\d{9}$/
|
|
|
@@ -366,7 +165,7 @@
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- _this.$axios.post('/register/addentity', _this.formData)
|
|
|
+ _this.$axios.post('/', _this.formData)
|
|
|
.then(function (response) {
|
|
|
if (response.data.code === 0) {
|
|
|
_this.$message({
|
|
|
@@ -385,121 +184,6 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- //获取已注册的公司
|
|
|
- getSupplierNameList() {
|
|
|
- let _this = this
|
|
|
- _this.$axios.get('/register/getsuppliername', {})
|
|
|
- .then(res => {
|
|
|
- _this.supplierNameList = res.data.items
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //图片格式以及文件大小限制
|
|
|
- beforeUpload(file) {
|
|
|
- let isLt10m = file.size / 1024 / 1024 / 10 < 1
|
|
|
- let isIMAGE1 = file.name.split('.')[1] === 'jpg'
|
|
|
- let isIMAGE2 = file.name.split('.')[1] === 'jpeg'
|
|
|
- let isIMAGE3 = file.name.split('.')[1] === 'png'
|
|
|
-
|
|
|
- if (!isIMAGE1 && !isIMAGE2 && !isIMAGE3) {
|
|
|
- this.$message.error('上传文件只能是图片格式(jpg/jpeg/png)!')
|
|
|
- }
|
|
|
- if (!isLt10m) {
|
|
|
- this.$message.error('上传文件大小不能超过 10MB!')
|
|
|
- }
|
|
|
- return isIMAGE1 || isIMAGE2 || isIMAGE3 && isLt10m
|
|
|
- },
|
|
|
-
|
|
|
- //判断是否上传成功
|
|
|
- checkSuccess(uploadFiles) {
|
|
|
- if (uploadFiles.length < 1) {
|
|
|
- return false
|
|
|
- } else {
|
|
|
- for (let i = 0; i < uploadFiles.length; i++) {
|
|
|
- if (uploadFiles[i].status !== 'success') {
|
|
|
- return false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return true
|
|
|
- },
|
|
|
-
|
|
|
- //上传请求
|
|
|
- uploadRequest(option) {
|
|
|
- let _this = this
|
|
|
- axios.post(process.env.upfilehost, {})
|
|
|
- .then(function (res) {
|
|
|
- if (res.data && res.data.fid && res.data.fid !== '') {
|
|
|
- option.action = `http://${res.data.url}/${res.data.fid}`
|
|
|
- _this.waituploads.push({
|
|
|
- uid: option.file.uid,
|
|
|
- url: res.data.publicUrl,
|
|
|
- fid: res.data.fid
|
|
|
- })
|
|
|
- uploadajax(option)
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '未上传成功!请重新上传!'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(function (error) {
|
|
|
- console.log(error)
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '未上传成功!请重新上传!'
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //获取上传文件的路径
|
|
|
- getFileURL(uploadFiles) {
|
|
|
- let fileURL = ''
|
|
|
- if (uploadFiles && uploadFiles.length > 0) {
|
|
|
- for (let i = 0; i < uploadFiles.length; i++) {
|
|
|
- if (uploadFiles[i].status === 'success') {
|
|
|
- for (let j = 0; j < this.waituploads.length; j++) {
|
|
|
- if (this.waituploads[j].uid === uploadFiles[i].uid) {
|
|
|
- fileURL = `${this.waituploads[j].url}/${this.waituploads[j].fid}|${uploadFiles[i].name}`
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return fileURL
|
|
|
- },
|
|
|
-
|
|
|
- //格式化页面到数据库的时间格式
|
|
|
- formatDateTime(date) {
|
|
|
- var y = date.getFullYear()
|
|
|
- var m = date.getMonth() + 1
|
|
|
- m = m < 10 ? ('0' + m) : m
|
|
|
- var d = date.getDate()
|
|
|
- d = d < 10 ? ('0' + d) : d
|
|
|
- var h = date.getHours()
|
|
|
- var minute = date.getMinutes()
|
|
|
- minute = minute < 10 ? ('0' + minute) : minute
|
|
|
- return y + '-' + m + '-' + d + ' ' + h + ':' + minute
|
|
|
- },
|
|
|
-
|
|
|
- //格式化时间
|
|
|
- jstimehandle(val) {
|
|
|
- if (val === '') {
|
|
|
- return '----'
|
|
|
- } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
- return '----'
|
|
|
- } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
- return '永久'
|
|
|
- } else {
|
|
|
- val = val.replace('T', ' ')
|
|
|
- return val.substring(0, 10)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
handleSelect (key, keyPath) {
|
|
|
this.activeIndex = key
|
|
|
}
|