Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev

shibei_master
13176889840 4 years ago
parent
commit
e748de655f
  1. 10
      src/views/modules/base/community/buildForm.vue
  2. 34
      src/views/modules/base/community/buildTable.vue
  3. 3
      src/views/modules/base/community/communityForm.vue
  4. 36
      src/views/modules/base/community/communityTable.vue
  5. 52
      src/views/modules/base/community/roomForm.vue
  6. 30
      src/views/modules/base/community/roomTable.vue
  7. 155
      src/views/pages/login copy.vue
  8. 307
      src/views/pages/login.vue

10
src/views/modules/base/community/buildForm.vue

@ -28,7 +28,7 @@
prop="type"
label-width="150px"
style="display: block">
<el-radio-group v-model="dataForm.type">
<el-radio-group v-model="buildType">
<el-radio :label="'1'">商品房</el-radio>
<el-radio :label="'2'">自建房</el-radio>
@ -120,6 +120,7 @@ export default {
formType: 'add', // addeditdetail
buildingId: '', //ID
buildType: "1",
dataForm: {
agencyId: '', // ID
agencyName: '',
@ -130,7 +131,7 @@ export default {
totalUnitNum: 0,//
totalFloorNum: 0,//
totalHouseNum: 0,//
type: '1',//
type: '',//
location: '', //
longitude: '', //
latitude: '' //
@ -160,7 +161,9 @@ export default {
if (row) {
this.buildingId = row.buildingId
this.dataForm = row
this.buildType = row.buildingTypeKey
}
console.log(row)
},
@ -173,13 +176,14 @@ export default {
this.dataForm.buildingId = this.buildingId
}
this.dataForm.type = this.buildType
const { data, code, msg } = await requestPost(url, this.dataForm)
if (code === 0) {
this.$message({
type: 'success',
message: '添加楼栋成功'
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')

34
src/views/modules/base/community/buildTable.vue

@ -32,15 +32,15 @@
</div>
<div class="div_btn">
<el-button style="float:left"
type="warning"
type="yellow"
size="small"
@click="handleExport">导出</el-button>
<el-button style="float:left"
type="success"
type="green"
size="small"
@click="handleAdd">新增楼宇</el-button>
<el-button style="float:left"
type="primary"
type="blue"
size="small"
@click="handleExportModule">下载楼宇模板</el-button>
<el-upload ref="upload"
@ -54,7 +54,7 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="danger">导入小区数据</el-button>
type="red">导入小区数据</el-button>
</el-upload>
</div>
@ -83,9 +83,7 @@
<el-table-column prop="totalHouseNum"
label="户数">
</el-table-column>
<el-table-column prop="remark"
label="备注">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="140"
@ -231,7 +229,9 @@ export default {
handleEdit (row) {
this.formTitle = '修改楼栋'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row, this.agencyObj)
})
},
addFormCancle () {
@ -442,6 +442,26 @@ export default {
}
</script>
<style lang="scss" scoped >
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search {
display: flex;

3
src/views/modules/base/community/communityForm.vue

@ -2,7 +2,7 @@
<div>
<div>
<div v-show="!propertyFormShow">
<el-form :inline="false"
<el-form :inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
@ -280,6 +280,7 @@ export default {
this.neighborHoodId = row.neighborHoodId
this.dataForm = row
}
console.log(row)
await this.loadAgency()
await this.loadGrid()

36
src/views/modules/base/community/communityTable.vue

@ -32,15 +32,15 @@
</div>
<div class="div_btn">
<el-button style="float:left"
type="warning"
type="yellow"
size="small"
@click="handleExport">导出</el-button>
<el-button style="float:left"
type="success"
type="green"
size="small"
@click="handleAdd">新增小区</el-button>
<el-button style="float:left"
type="primary"
type="blue"
size="small"
@click="handleExportModule">下载小区模板</el-button>
@ -55,7 +55,7 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="danger">导入小区数据</el-button>
type="red">导入小区数据</el-button>
</el-upload>
</div>
@ -90,6 +90,10 @@
class="operate">
<template slot-scope="scope">
<!-- <el-button type="text"
style="color:#00A7A9;text-decoration: underline;"
size="small"
@click="handleToBuild(scope.row)">进入</el-button> -->
<el-button type="text"
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@ -123,7 +127,7 @@
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="900px"
width="850px"
top="5vh"
@closed="diaClose">
<community-form ref="ref_form"
@ -232,7 +236,9 @@ export default {
handleEdit (row) {
this.formTitle = '修改小区'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row, this.agencyObj)
})
},
addFormCancle () {
@ -444,6 +450,26 @@ export default {
}
</script>
<style lang="scss" scoped >
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search {
display: flex;

52
src/views/modules/base/community/roomForm.vue

@ -43,7 +43,7 @@
prop="houseType"
label-width="150px"
style="display: block">
<el-radio-group v-model="dataForm.houseType">
<el-radio-group v-model="houseType">
<el-radio :label="'1'">楼房</el-radio>
<el-radio :label="'2'">平房</el-radio>
@ -55,11 +55,15 @@
prop="purpose"
label-width="150px"
style="display: block">
<el-radio-group v-model="dataForm.purpose">
<el-radio :label="'1'">商品房</el-radio>
<el-radio :label="'2'">自建房</el-radio>
<el-radio :label="'3'">别墅</el-radio>
<el-radio-group v-model="purpose">
<el-radio :label="'1'">住宅</el-radio>
<el-radio :label="'2'">商业</el-radio>
<el-radio :label="'3'">办公</el-radio>
<el-radio :label="'4'">工业</el-radio>
<el-radio :label="'5'">仓储</el-radio>
<el-radio :label="'6'">商住混用</el-radio>
<el-radio :label="'7'">其他</el-radio>
</el-radio-group>
</el-form-item>
@ -67,10 +71,10 @@
prop="rentFlag"
label-width="150px"
style="display: block">
<el-radio-group v-model="dataForm.rentFlag">
<el-radio-group v-model="rentFlag">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
@ -80,8 +84,6 @@
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入房主姓名"
v-model="dataForm.ownerName">
</el-input>
@ -132,13 +134,16 @@ export default {
unitList: [],
houseId: '', //ID
houseType: '1',
purpose: '1',
rentFlag: false,
dataForm: {
neighborHoodId: '', // ID
buildingId: '',//ID
buildingUnitId: '',//ID
doorName: '',//
houseType: '1',//
purpose: '1',//
houseType: '',//
purpose: '',//
rentFlag: 0,//10
ownerPhone: '', //
ownerName: '', //
@ -166,8 +171,19 @@ export default {
if (row) {
this.houseId = row.houseId
this.dataForm = row
this.dataForm.buildingUnitId = row.unitNumKey
this.houseType = row.houseTypeKey
this.purpose = row.purposeKey
if (row.rentFlagKey) {
this.rentFlag = 1
} else {
this.rentFlag = 0
}
}
console.log(row)
await this.loadUnitList()
},
@ -189,11 +205,9 @@ export default {
}
},
async handleComfirm () {
let url = ''
// this.dataForm.buildingUnitId = '14a8df50bc43fda1753088fb458d2942'
if (this.formType === 'add') {
url = '/gov/org/house/houseadd'
} else {
@ -201,12 +215,16 @@ export default {
this.dataForm.houseId = this.houseId
}
this.dataForm.houseType = this.houseType
this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag
const { data, code, msg } = await requestPost(url, this.dataForm)
if (code === 0) {
this.$message({
type: 'success',
message: '添加楼栋成功'
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')

30
src/views/modules/base/community/roomTable.vue

@ -32,15 +32,15 @@
</div>
<div class="div_btn">
<el-button style="float:left"
type="warning"
type="yellow"
size="small"
@click="handleExport">导出</el-button>
<el-button style="float:left"
type="success"
type="green"
size="small"
@click="handleAdd">新增房屋</el-button>
<el-button style="float:left"
type="primary"
type="blue"
size="small"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload ref="upload"
@ -54,7 +54,7 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="danger">导入小区数据</el-button>
type="red">导入小区数据</el-button>
</el-upload>
</div>
@ -244,7 +244,9 @@ export default {
handleEdit (row) {
this.formTitle = '修改房屋'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row, this.agencyObj)
})
},
addFormCancle () {
@ -453,6 +455,26 @@ export default {
}
</script>
<style lang="scss" scoped >
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search {
display: flex;

155
src/views/pages/login copy.vue

@ -0,0 +1,155 @@
<template>
<div class="aui-wrapper aui-page__login">
<div class="aui-content__wrapper">
<main class="aui-content">
<div class="login-header">
<h2 class="login-brand">{{ $t('brand.lg') }}</h2>
</div>
<div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3>
<el-form :model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon>
<!-- <el-form-item>
<el-select v-model="$i18n.locale"
class="w-percent-100">
<el-option v-for="(val, key) in i18nMessages"
:key="key"
:label="val._lang"
:value="key"></el-option>
</el-select>
</el-form-item> -->
<el-form-item prop="phone">
<el-input v-model="dataForm.phone"
placeholder="手机号">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-user"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password"
type="password"
:placeholder="$t('login.password')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-lock"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha"
:placeholder="$t('login.captcha')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use>
</svg>
</span>
</el-input>
</el-col>
<el-col :span="10"
class="login-captcha">
<img :src="captchaPath"
@click="getCaptcha()">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="dataFormSubmitHandle()"
class="w-percent-100">{{ $t('login.title') }}</el-button>
</el-form-item>
</el-form>
</div>
<div class="login-footer">
<p>
<a href="https://demo.cloud.renren.io/renren-cloud"
target="_blank">{{ $t('login.demo') }}</a>
</p>
<!-- 2020 © renren.io -->
<p><a href="https://www.renren.io/"
target="_blank">{{ $t('login.copyright') }}</a></p>
</div>
</main>
</div>
</div>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
import { messages } from '@/i18n'
import { getUUID } from '@/utils'
export default {
data () {
return {
i18nMessages: messages,
captchaPath: '',
dataForm: {
app: 'oper',
client: 'web',
username: '',
phone: '',
password: '',
uuid: '',
captcha: ''
}
}
},
computed: {
dataRule () {
return {
phone: [
{ required: true, message: '手机号不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
captcha: [
{ required: true, message: '验证码不能为空', trigger: 'blur' }
]
}
}
},
created () {
this.getCaptcha()
},
methods: {
//
getCaptcha () {
this.dataForm.uuid = getUUID()
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
}
this.$http.post('/auth/login/operweb/loginbypassword', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.getCaptcha()
return this.$message.error(res.msg)
}
localStorage.setItem('userType', 'oper')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => { })
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

307
src/views/pages/login.vue

@ -1,120 +1,132 @@
<template>
<div class="aui-wrapper aui-page__login">
<div class="aui-content__wrapper">
<main class="aui-content">
<div class="login-header">
<h2 class="login-brand">{{ $t('brand.lg') }}</h2>
</div>
<div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3>
<div class="g-app">
<div class="g-bd"
v-if="isShowLogin || true">
<div class="m-fm">
<div class="wrap">
<h2 class="title">{{ $t('brand.work') }}</h2>
<div class="fm">
<el-form :model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon>
<!-- <el-form-item>
<el-select v-model="$i18n.locale"
class="w-percent-100">
<el-option v-for="(val, key) in i18nMessages"
:key="key"
:label="val._lang"
:value="key"></el-option>
</el-select>
</el-form-item> -->
<el-form-item prop="phone">
<el-input v-model="dataForm.phone"
placeholder="手机号">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-user"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password"
type="password"
:placeholder="$t('login.password')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-lock"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha"
:placeholder="$t('login.captcha')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use>
</svg>
</span>
</el-input>
</el-col>
<el-col :span="10"
class="login-captcha">
<div class="fm-item">
<div class="ico">
<img src="@/assets/img/login/zhanghao.png"
alt="" />
</div>
<div class="input">
<input type="text"
v-model="dataForm.phone"
placeholder="账号" />
</div>
</div>
<div class="fm-item">
<div class="ico">
<img src="@/assets/img/login/mima.png"
alt="" />
</div>
<div class="input">
<input type="password"
v-model="dataForm.password"
:placeholder="$t('login.password')" />
</div>
</div>
<div class="fm-captcha">
<div class="fm-item">
<div class="input">
<input type="text"
v-model="dataForm.captcha"
placeholder="验证码" />
</div>
</div>
<div class="captcha">
<img :src="captchaPath"
@click="getCaptcha()">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="dataFormSubmitHandle()"
class="w-percent-100">{{ $t('login.title') }}</el-button>
</el-form-item>
@click="getCaptcha()" />
</div>
</div>
<div class="fm-btn"
@click="dataFormSubmitHandle()">
{{ $t('login.title') }}
</div>
<div class="hint">请使用小程序端的账号密码登录</div>
</el-form>
</div>
</div>
</div>
<div class="m-footer">
<div class="login-footer">
<p>
<a href="https://demo.cloud.renren.io/renren-cloud"
target="_blank">{{ $t('login.demo') }}</a>
<a href=""
target="_blank">{{ $t('login.copyright') }}</a>
</p>
<!-- 2020 © renren.io -->
<p><a href="https://www.renren.io/"
target="_blank">{{ $t('login.copyright') }}</a></p>
</div>
</main>
</div>
</div>
</template>
<c-dialog :showFooter="false"
:title="'选择客户'"
:isNest="false"
:visible="diaVisible"
:dialogHeight="0.8"
:width="30"
:top="'120px'"
@cancel="diaCancel">
<!-- <div class="div_total"> -->
<div v-for="(item, index) in tableData"
:key="index"
class="div_row">
<span @click="selectCustomer(item)"
class="span_name">{{
item.customerName
}}</span>
</div>
</c-dialog>
</div>
</template>
<script>
import Cookies from 'js-cookie'
import CDialog from '@c/CDialog'
import debounce from 'lodash/debounce'
import { messages } from '@/i18n'
import { getUUID } from '@/utils'
import { Loading } from 'element-ui' // Loading
import JSEncrypt from 'jsencrypt' //
let loading //
export default {
data () {
return {
pubKey: null, //
isShowLogin: true,
i18nMessages: messages,
captchaPath: '',
dataForm: {
app: 'oper',
customerId: '',
app: 'gov',
client: 'web',
username: '',
phone: '',
password: '',
uuid: '',
captcha: ''
}
},
//
diaVisible: false,
tableLoading: false,
tableData: []
}
},
components: {
CDialog
},
computed: {
dataRule () {
return {
phone: [
{ required: true, message: '手机号不能为空', trigger: 'blur' }
],
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
@ -125,31 +137,156 @@ export default {
}
},
created () {
//
if (this.$route.query.platformToken) {
this.isShowLogin = false
this.getAutoLogin(this.$route.query.platformToken)
} else {
this.getCaptcha()
//
this.getPubKey()
}
},
mounted () {
localStorage.removeItem('showHeader')
},
methods: {
//
getPubKey () {
this.$http
.post('/auth/govweb/getKey')
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.pubKey = res.data // ;
})
.catch(() => { })
},
//
getCaptcha () {
this.dataForm.uuid = getUUID()
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
},
//
dataFormSubmitHandle: debounce(function () {
dataFormSubmitHandle () {
this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
}
this.$http.post('/auth/login/operweb/loginbypassword', this.dataForm).then(({ data: res }) => {
this.startLoading()
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/epmetuser/customerstaff/customerlist'
const url = '/epmetuser/customerstaff/customerlist'
const params = {
phone: this.dataForm.phone
}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
if (data.length === 0) {
//
this.$message.error('账号不存在')
this.endLoading()
} else if (data.length === 1) {
this.selectCustomer(data[0])
} else {
this.endLoading()
this.diaVisible = true
this.$nextTick(() => {
this.tableData = data
})
}
},
(rspMsg, data) => {
this.endLoading()
this.$message.error(rspMsg)
}
)
})
},
//
getAutoLogin (platformToken) {
this.dataForm.thirdToken = platformToken
this.dataForm.platform = 'pyld'
this.$http
.post(`/auth/sso/oper/third/login`, this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
if (res.code == 8302) {
return this.$message.error(res.msg)
}
return this.$message.error(res.msg)
}
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' })
})
.catch(() => { })
// epmet-ext9.elinkservice.cn/platform-admin
},
//
selectCustomer (row) {
localStorage.setItem('customerId', row.customerId)
localStorage.setItem('customerName', row.customerName)
this.startLoading()
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/auth/govweb/login'
const url = '/auth/govweb/login'
this.dataForm.customerId = row.customerId
let param = {}
Object.assign(param, this.dataForm)
param.password = this.encryptedData(this.pubKey, this.dataForm.password)
this.$http
.post(url, param)
.then(({ data: res }) => {
if (res.code !== 0) {
this.getCaptcha()
return this.$message.error(res.msg)
}
localStorage.setItem('userType', 'oper')
this.diaVisible = false
localStorage.setItem('userType', 'work')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => { })
}).catch(() => { })
this.$router.replace({ name: 'indexWork' }).catch(() => { })
})
.catch(() => { })
this.endLoading()
},
//
diaCancel () {
this.diaVisible = false
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
}, 1000, { 'leading': true, 'trailing': false })
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
},
//
encryptedData (key, data) {
// JSEncrypt
let encryptor = new JSEncrypt()
//
encryptor.setPublicKey(key)
//
return encryptor.encrypt(data)
}
}
}
</script>
<style lang="scss" src="@/assets/scss/pages/loginWork.scss"></style>

Loading…
Cancel
Save