bibi 3 years ago
parent 4fa7841331
commit c73689a26a

@ -16,3 +16,11 @@ export function settledInsert(params) {
data: params,
})
}
// 新增小区
export function communityInsert(params) {
return httpService({
url: `/user/community/insert`,
method: 'post',
data: params,
})
}

@ -0,0 +1,40 @@
<template>
<a-cascader
:options="cityList"
placeholder="请选择"
:field-names="{
label: 'name',
value: 'id',
children: 'cityList',
}"
@change="change"
style="width: 60%"
></a-cascader>
</template>
<script>
import store from "@/store";
import { allCity } from "@/api/public"
export default {
data(){
return{
cityList:[]
}
},
methods: {
change(data){
this.$emit('onchange',data)
}
},
mounted() {
if(store.getters.getCity.length===0){
allCity().then(res=>{
this.cityList = res.data
})
}
}
};
</script>
<style>
</style>

@ -22,10 +22,12 @@ import router from "@/permission";
Vue.config.productionTip = false
import commonTable from './components/table'
import commonUpload from './components/upload/index.vue'
import allCity from './components/allCity/index.vue'
// 注册组件
Vue.component('commonTable', commonTable)
Vue.component('commonUpload', commonUpload)
Vue.component('allCity', allCity)
router.beforeEach((to, from, next) => {
// 让页面回到顶部

@ -12,10 +12,10 @@ export default {
install(Vue) {
Vue.mixin({
computed: {
...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys'])
...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys','getCity'])
},
methods: {
...mapActions(['setToken','setSelectedKeys', 'setOpenKeys'])
...mapActions(['setToken','setSelectedKeys', 'setOpenKeys','setCity'])
}
})
}

@ -3,13 +3,15 @@ import "nprogress/nprogress.css"
import router from "@/router"
import store from '@/store'
const whitePath = [ '/login']
// 判断登录
router.beforeEach((to, from, next) => {
NProgress.start()
const token = store.getters.getToken;
if(!token && !whitePath.includes(to.path)) {
if (!token && !whitePath.includes(to.path)) {
next('/login');
} else {
next();
NProgress.done()

@ -16,6 +16,9 @@ const actions = {
setOpenKeys: ({commit}, log) => {
commit('setOpenKeys', log)
},
setCity: ({commit}, log) => {
commit('setCity', log)
},
}
export default actions

@ -16,6 +16,9 @@ const getters = {
getToken(state) {
return state.token
},
getCity(state) {
return state.cityList
},
}
export default getters

@ -21,6 +21,9 @@ const mutations = {
state.token = log;
sessionStorage.setItem('token', log);
},
setCity (state, data) { // 设置参数
state.cityList = data
}
}
export default mutations

@ -12,6 +12,7 @@ const state = {
token: sessionStorage.getItem('token') || "",
Info: {
name:'11'
}
},
cityList:[]
}
export default state

@ -1,223 +1,284 @@
<template>
<div>
<div class="tips">
<div class="tips" v-if="companyInfo === null">
<a-space size="large">
第一步请完善企业信息后提交至工作人员审核
<a-button type="primary" shape="round" size="default">添加小区</a-button>
<a-button type="primary" shape="round" size="default"
>关联企业信息</a-button
>
</a-space>
</div>
<div class="tips" v-else-if="estateList===null">
<a-space size="large" >
第二步请添加小区信息用于绑定后续的功能
<a-button type="primary" shape="round" size="default"
>创建小区</a-button
>
</a-space>
</div>
<div class="tips" v-else>
第三步请在添加的小区中绑定购买的套餐 在购买功能时直接选择小区绑定
</div>
<div class="content">
<div class="top" v-if='companyInfo===null||[]'>
<span style="margin-left:30px">
<div class="top-a">你好{{username}}</div>
<div class="top-b">请尽快绑定企业信息进行下一步</div>
</span>
<span>
<a-button type="primary" class="top-c" shape="round" size="default" @click="settled()"></a-button>
</span>
</div>
<div v-else class="top">
<a-row>
<a-col class='com-name'>{{companyInfo.companyName}}</a-col>
</a-row>
</div>
<div class="top" v-if="companyInfo === null">
<span style="margin-left: 30px">
<div class="top-a">你好{{ username }}</div>
<div class="top-b">请尽快绑定企业信息进行下一步</div>
</span>
<span>
<a-button
type="primary"
class="top-c"
shape="round"
size="default"
@click="settled()"
>入驻企业申请</a-button
>
</span>
</div>
<div v-else style="background: #fff">
<a-row style="padding-left:40px;vertical-align:middle;height:130px;padding: 20px;">
<a-col :span="3">
<!-- 头像没接口 -->
</a-col>
<a-col :span="16">
<a-col class="com-name">{{ companyInfo.companyName }}</a-col>
<a-col class="com-sta">{{
companyInfo.status === 1
? "待确认"
: companyInfo.status === 2
? "已通过"
: companyInfo.status === 3
? "已驳回"
: "已取消"
}}</a-col>
<a-col :span="3" class="com-conta"
><a-icon type="user" />&nbsp;{{ companyInfo.contactsName }}</a-col
>
<a-col :span="6" class="com-conta"
><a-icon type="phone" />&nbsp;{{ companyInfo.contactsTel }}</a-col
>
<a-col :span="10" class="com-conta"
><a-icon type="mail" />&nbsp;{{
companyInfo.contactsEmail
}}</a-col
>
</a-col>
<a-col :span="5" style="line-height:130px;margin-top:-20px"
><a-button shape="round" size="default" @click="edit()"
>修改公司信息</a-button
></a-col
>
</a-row>
</div>
</div>
<div class="content">
<a-row>
<a-col :span='18'>
<div class="card-a">
<div class="cardTitle">小区后台</div>
<div class="card-a-content">
<div v-if="estateList!==null">
<div style="color:#D53131" v-show="estateList===null"></div>
<div class="cardBox">
<a-card hoverable style="width: 30%;margin:10px;" v-for="(item,index) in estateList" :key="index">
<template slot="actions" class="ant-card-actions">
<span>绑定</span>
<span>详情</span>
</template>
<a-card-meta :title="item.name" :description="'小区地址:'+item.addressDetails">
</a-card-meta>
</a-card>
<a-card class="card-add">
<div class="card-a-content-add" @click="addVillage">
点击新建小区
</div>
</a-card>
</div>
</div>
</div>
<a-row>
<a-col :span="18">
<div class="card-a">
<div class="cardTitle">小区后台</div>
<div class="card-a-content">
<div v-if="estateList !== null">
<div style="color: #d53131" v-show="estateList === null">
当前尚未添加小区信息
</div>
<div class="cardBox">
<a-card
hoverable
style="width: 30%; margin: 10px"
v-for="(item, index) in estateList"
:key="index"
>
<template slot="actions" class="ant-card-actions">
<span>绑定</span>
<span>详情</span>
</template>
<a-card-meta
:title="item.name"
:description="'小区地址:' + item.addressDetails"
>
</a-card-meta>
</a-card>
<a-card class="card-add">
<div class="card-a-content-add" @click="addVillage">
点击新建小区
</div>
</a-col>
<a-col :span='6'>
<div class="card-b">
<div class="cardTitle">订单列表</div>
<div class="cardBox" v-if="orderList!==null">
<a-card hoverable v-for="item,index in orderList" :key="index" :title="item.code" style="width: 80%;margin:auto;margin-top:20px">
<span slot="extra" href="#">{{item.status}}</span>
<span style="color:#00000073;font-size:14px;display:flex;justify-content:space-between;"><span>购买功能</span> <span style="color:#D53131;">{{'¥'+item.amount}}</span></span>
<div class="functionBox">
<div class="functionList" v-for="ele,indexs in item.functionList" :key="indexs">{{ele}}</div>
</div>
<div style="margin-top:10px;">{{item.time}}<span style="color:#00000073;font-size:14px;">到期</span></div>
<template slot="actions" class="ant-card-actions">
<span>续费</span>
<span>解绑</span>
<span>详情</span>
<!-- <span>支付</span>
</a-card>
</div>
</div>
</div>
</div>
</a-col>
<a-col :span="6">
<div class="card-b">
<div class="cardTitle">订单列表</div>
<div class="cardBox" v-if="orderList !== null">
<a-card
hoverable
v-for="(item, index) in orderList"
:key="index"
:title="item.code"
style="width: 80%; margin: auto; margin-top: 20px"
>
<span slot="extra" href="#">{{ item.status }}</span>
<span
style="
color: #00000073;
font-size: 14px;
display: flex;
justify-content: space-between;
"
><span>购买功能</span>
<span style="color: #d53131">{{
"¥" + item.amount
}}</span></span
>
<div class="functionBox">
<div
class="functionList"
v-for="(ele, indexs) in item.functionList"
:key="indexs"
>
{{ ele }}
</div>
</div>
<div style="margin-top: 10px">
{{ item.time
}}<span style="color: #00000073; font-size: 14px">到期</span>
</div>
<template slot="actions" class="ant-card-actions">
<span>续费</span>
<span>解绑</span>
<span>详情</span>
<!-- <span>支付</span>
<span>取消</span> -->
</template>
</a-card>
<a-card hoverable class="addOrder">
<div class="card-b-content-add" @click="newOrder">
点击新建订单
</div>
</a-card>
</div>
<div class="card-b-content" v-else>
<div>当前无订单</div>
<div>请购买后台功能</div>
<a-card hoverable class="addOrder">
<div class="card-b-content-add" @click="newOrder">
点击新建订单
</div>
</a-card>
</div>
</div>
</a-col>
</a-row>
</template>
</a-card>
<a-card hoverable class="addOrder">
<div class="card-b-content-add" @click="newOrder">
点击新建订单
</div>
</a-card>
</div>
<div class="card-b-content" v-else>
<div>当前无订单</div>
<div>请购买后台功能</div>
<a @click="newOrder"> </a>
</div>
</div>
</a-col>
</a-row>
</div>
<a-modal
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
<a-modal
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
>
<div class="modalContent">
<div class="cardTitle">小区信息</div>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<div class="modalContent">
<div class="cardTitle">小区信息</div>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
label-col="inline"
layout="vertical"
>
<a-form-model-item label="小区全称">
<a-input style="60%"></a-input>
</a-form-model-item>
<a-form-model-item label="小区地址">
<a-input style="60%"></a-input>
</a-form-model-item>
<a-form-model-item label="小区图片">
<span>要求文件大小不超过5mb支持jpgpng格式</span>
<a-row>
<a-col :span='12'>
<div class="uploadImg">+</div>
</a-col>
</a-row>
</a-form-model-item>
</a-form-model>
</div>
<a-form-model-item label="小区全称" prop='name'>
<a-input v-model="form.name" style="60%"></a-input>
</a-form-model-item>
<a-form-model-item label="小区地址" prop='address'>
<allCity></allCity>
</a-form-model-item>
<a-form-model-item label="小区详细地址" prop='addressDetails'>
<a-input v-model="form.addressDetails" style="60%"></a-input>
</a-form-model-item>
<a-form-model-item label="小区图片">
<span>要求文件大小不超过5mb支持jpgpng格式</span>
<a-row>
<a-col :span="12">
<commonUpload @handleChange='handleChange'></commonUpload>
</a-col>
</a-row>
</a-form-model-item>
</a-form-model>
</div>
</a-modal>
</div>
</template>
<script>
import { consoleShow } from "@/api/basic/console";
import { consoleShow, communityInsert } from "@/api/basic/console";
import store from "@/store";
export default {
name: "Console",
computed:{
username(){
return store.state.Info.name //
}
computed: {
username() {
return store.state.Info.name; //
},
},
data(){
return{
form:{},
rules:{},
orderList:[
{
code:'N20212121212',
status:'付款成功',
time:'2023/3/3',
amount:'25000',
functionList:['基础功能','缴费管理','智慧商城','运营管理','设置']
},{
code:'N20212121212',
status:'付款成功',
time:'2023/3/3',
functionList:['基础功能','缴费管理','智慧商城','运营管理','设置']
},{
code:'N20212121212',
status:'付款成功',
time:'2023/3/3',
functionList:['基础功能','缴费管理','智慧商城','运营管理','设置']
},
],
estateList:[
{
name:'万科·滨江花园',
addressDetails:'江苏省盐城市建湖县沿河镇 11 单元 250 室',
status:'生效中'
},{
name:'万科·滨江花园',
address:'江苏省盐城市建湖县沿河镇 11 单元 250 室',
status:'生效中'
},{
name:'万科·滨江花园',
address:'江苏省盐城市建湖县沿河镇 11 单元 250 室',
status:'生效中'
},{
name:'万科·滨江花园',
address:'江苏省盐城市建湖县沿河镇 11 单元 250 室',
status:'生效中'
},{
name:'万科·滨江花园',
address:'江苏省盐城市建湖县沿河镇 11 单元 250 室',
status:'生效中'
},
{
name:'万科·滨江花园',
address:'江苏省盐城市建湖县沿河镇 11 单元 250 室 11 单元 250 室 11 单元 250 室 11 单元 250 室 11 单元苏省盐城市建湖县沿河镇 11 单元 250 室 11 单元 250 室 11 单元 250 室苏省盐城市建湖县沿河镇 11 单元 250 室 11 单元 250 室 11 单元 250 室 11 单元 250 室 11 单元 11 单元 250 室 11 单元 250 室',
status:'生效中'
},{
name:'万科·滨江花园',
address:'江苏省盐城市建湖县沿河镇 11 建湖县沿河镇 11 单元 250建湖县沿河镇 11 建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250单元 250建湖县沿河镇 11 单元 250建湖县沿河镇 11 单元 250单元 250 室',
status:'生效中'
}
],
data() {
return {
form: {
name:'',
address:undefined,
addressDetails:'',
communityUrls:[]
},
rules: {
name:[{required: true,message: "请输入",trigger: "blur"}],
address:[{required: true,message: "请选择",trigger: "change"}],
addressDetails:[{required: true,message: "请输入",trigger: "blur"}],
},
orderList: [],
estateList: [],
visible: false,
confirmLoading: false,
companyInfo:{}
}
companyInfo: {},
};
},
mounted(){
// this.getData()
mounted() {
this.getData();
},
methods:{
async getData(){
let res = await consoleShow()
methods: {
async getData() {
let res = await consoleShow();
// consoleCompanyVo
this.estateList = res.data.consoleCommunityVoList
this.orderList = res.data.consoleOrderVoList
this.companyInfo = res.data.consoleCompanyVo
this.estateList = res.data.consoleCommunityVoList;
this.orderList = res.data.consoleOrderVoList;
this.companyInfo = res.data.consoleCompanyVo;
},
settled() {
this.$router.push({ name: "settled" });
},
settled(){
this.$router.push({name:'settled'})
addVillage() {
this.visible = true;
},
addVillage(){
this.visible=true
edit(){},
handleOk() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
let res = await communityInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.handleCancel()
} else {
this.$message.error(res.msg);
}
}
});
},
handleOk(){},
handleCancel(){
this.visible = false
handleCancel() {
this.$refs.ruleForm.resetFields();
this.visible = false;
},
newOrder(){
this.$router.push({name:'newOrder'})
newOrder() {
this.$router.push({ name: "newOrder" });
},
handleChange(data){
this.form.communityUrls = data[0].response.data
}
}
},
};
</script>
@ -232,136 +293,154 @@ export default {
padding-left: 40px;
}
.top {
width: 100%;
display: flex;
background: #fff;
height: 132px;
line-height: 132px;
justify-content: space-between;
.top-a{
font-weight:500;
font-size:20px;
color:#000000;
line-height: 20px;
margin-top: 40px;
height: 30px;
width: 100%;
display: flex;
background: #fff;
height: 132px;
line-height: 132px;
justify-content: space-between;
.top-a {
font-weight: 500;
font-size: 20px;
color: #000000;
line-height: 20px;
margin-top: 40px;
height: 30px;
}
.top-b {
color: #000000a6;
line-height: 20px;
height: 20px;
}
.top-c {
margin-right: 30px;
}
}
.card-a {
background: #fff;
margin-right: 24px;
padding-top: 10px;
min-height: 600px;
.card-a-content {
color: #00000073;
font-size: 14px;
padding: 13px;
.cardBox {
display: flex;
flex-direction: row;
flex-wrap: wrap;
// justify-content:;
.card-add {
width: 30%;
margin: 10px;
border: 1px dashed #9db7df;
border-radius: 3%;
}
/deep/.ant-card-body {
padding-bottom: 50px;
min-height: 170px;
}
/deep/.ant-card {
position: relative;
}
/deep/.ant-card-actions {
position: absolute;
bottom: 0;
width: 100%;
// margin-top: 50px;
}
.card-a-content-add {
color: #9db7df;
font-size: 16px;
cursor: pointer;
text-align: center;
vertical-align: middle;
line-height: 72px;
}
}
.top-b{
color:#000000A6 ;
line-height: 20px;
height: 20px;
}
}
.card-b {
background: #fff;
padding-top: 10px;
min-height: 600px;
.card-b-content {
margin-top: 150px;
color: #00000073;
font-size: 14px;
text-align: center;
/deep/.ant-card-head {
background: #205fbd1a;
}
.top-c{
margin-right:30px
}
.cardBox {
// text-align: center;
/deep/.ant-card-head {
background: #205fbd1a;
}
}
.card-a{
background: #fff;
margin-right:24px;
padding-top:10px;
min-height: 600px;
.card-a-content{
color: #00000073;
font-size: 14px;
padding: 13px;
.cardBox{
display: flex;
flex-direction:row;
flex-wrap: wrap;
// justify-content:;
.card-add{
width: 30%;
margin:10px;
border:1px dashed #9DB7DF;
border-radius: 3%;
}
/deep/.ant-card-body{
padding-bottom: 50px;
min-height: 170px;
}
/deep/.ant-card {
position: relative;
}
/deep/.ant-card-actions{
position: absolute;
bottom: 0;
width: 100%;
// margin-top: 50px;
}
.card-a-content-add{
color:#9DB7DF;
font-size:16px;
cursor:pointer;
text-align: center;
vertical-align: middle;
line-height: 72px;
}
}
/deep/.ant-card-head-title {
font-size: 16px;
color: #000000a6;
}
}
.card-b{
background: #fff;
padding-top:10px;
min-height: 600px;
.card-b-content{
margin-top:150px;
color: #00000073;
font-size: 14px;
text-align: center;
/deep/.ant-card-head{
background: #205FBD1A;
}
.functionBox {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
width: 90%;
.functionList {
color: #1f519b;
border: 1px solid #1f519b;
border-radius: 5%;
margin: 2px;
padding: 2px;
white-space: nowrap;
}
}
.cardBox{
// text-align: center;
/deep/.ant-card-head{
background: #205FBD1A;
}
/deep/.ant-card-head-title{
font-size: 16px;
color: #000000A6;
}
.functionBox{
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
width: 90%;
.functionList{
color: #1F519B;
border:1px solid #1F519B;
border-radius: 5%;
margin: 2px;
padding:2px;
white-space: nowrap;
}
}
.addOrder{
border:1px dashed #9DB7DF;
border-radius: 3%;
width: 80%;
height: 200px;
margin:auto;
margin-top:20px;
.card-b-content-add{
color:#9DB7DF;
font-size:16px;
cursor:pointer;
text-align: center;
vertical-align: middle;
line-height: 72px;
}
}
.addOrder {
border: 1px dashed #9db7df;
border-radius: 3%;
width: 80%;
height: 200px;
margin: auto;
margin-top: 20px;
}
}
}
.uploadImg{
background: #0000000A;
border:2px solid #00000029;
.uploadImg {
background: #0000000a;
border: 2px solid #00000029;
color: #00000029;
width: 180px;
height: 120px;
text-align: center;
line-height: 110px;
font-size:60px;
font-size: 60px;
cursor: pointer;
}
.card-b-content-add {
color: #9db7df;
font-size: 16px;
cursor: pointer;
text-align: center;
vertical-align: middle;
line-height: 72px;
}
.com-name {
font-size: 20px;
font-weight: 500;
line-height: 26px;
color: #000000;
}
.com-sta {
font-size: 14px;
font-weight: 400;
line-height: 30px;
color: #5bc980;
}
.com-conta {
line-height: 30px;
font-size: 14px;
font-weight: 400;
color: #000000;
}
</style>

@ -282,9 +282,5 @@ export default {
/deep/.ant-col .ant-form-item-label {
margin-top: -10px;
}
.com-name{
font-size: 20px;
font-weight: 500;
line-height: 26px;
}
</style>

@ -196,6 +196,7 @@ import {
sendRegisterCode,
userInfo
} from "@/api/public/login";
import { allCity } from "@/api/public"
import { form, registerForm, registerRules } from './depend/config'
export default {
name: "Login",
@ -224,6 +225,7 @@ export default {
this.$message.success(res.msg);
// token
this.setToken(res.data);
this.gettheCity()
userInfo().then(res =>{
console.log(res.data);
sessionStorage.setItem('info',JSON.stringify(res.data))
@ -240,6 +242,7 @@ export default {
this.$message.success(res.msg);
// token
this.setToken(res.data);
this.gettheCity()
userInfo().then(res =>{
sessionStorage.setItem('info',JSON.stringify(res.data))
})
@ -286,6 +289,12 @@ export default {
resetForm() {
this.$refs.ruleForm.resetFields();
},
//
gettheCity(){
allCity().then(res => {
this.setCity(res.data);
})
}
},
};
</script>

Loading…
Cancel
Save