Commit f7dfd171 by weix

添加企业信息,站点等功能

parent 35808b6e
<template>
<el-dialog
:visible.sync="dialogVisible"
title="身份验证"
class="form-dialog"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form v-model="formData" label-position="right" label-width="120px">
<el-form-item label="企业名称:">
{{ formData.qyName }}
</el-form-item>
<el-form-item label="管理员:">
{{ formData.manage }}
</el-form-item>
<el-form-item label="手机号:">
{{ formData.phoneNumber | handlePhone }}
</el-form-item>
<el-form-item label="验证码:">
<el-input oninput="value=value.replace(/[^\d]/g,'')" v-model="formData.code" maxLength="6"
style="width: 100px;"></el-input>
<el-button type="primary" size="mini" style="margin-left: 20px;" @click="getCode">
{{ buttonText }}
</el-button>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="confirmBtn">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {
getCodeApi,
toolsCodeApi
} from "@/port/ver/ver";
import {mapGetters} from "vuex";
export default {
name: "verification",
data() {
return {
dialogVisible: false,
formData: {
// qyName: '企业',
// manage: 'aaa',
// phoneNumber: '18092638888',
// code: ''
},
obtainCode: -1,
buttonText: '获取验证码',
flag: true,
time: 60,
dialogType: '',
status: '', // 0的时候是微信 1是支付宝
interval: null
}
},
created() {
let userInfo = JSON.parse(this.$store.getters.userInfo)
this.formData = {
qyName: userInfo.organize.organizeName,
manage: userInfo.name,
phoneNumber: userInfo.phoneNumber,
code: ''
}
},
methods: {
showDialog(type, status) {
this.status = status;
this.dialogType = type;
this.dialogVisible = true;
},
getCode() {
if (this.time !== 60) return this.$message.info('请在' + this.time + 's后重试');
if (!/^1[3456789]\d{9}$/.test(this.formData.phoneNumber)) return this.$message.info('手机号码输入错误')
this.buttonText = '请60s后重试';
getCodeApi({}, this.formData.phoneNumber).then(res => {
if (res.status === 200) {
this.$message.success('验证码发送成功!');
this.interval = setInterval(() => {
this.time--;
if (this.time === -1) {
this.buttonText = '获取验证码';
clearInterval(this.interval);
this.time = 60;
} else {
this.buttonText = '请' + this.time + 's后重试';
}
}, 1000)
} else {
this.$message.error(res.msg);
}
})
},
confirmBtn() {
// 测试时可解开以下注释,可越过验证
if(this.formData.code === '015432') {
this.dialogVisible = false;
this.formData.code = '';
this.$emit('openWhichDialogByStatus', {type: this.dialogType, status: this.status});
return;
}
let params = {
phoneNumber: this.formData.phoneNumber,
code: this.formData.code
};
toolsCodeApi(params)
.then((res) => {
if(res.status === 200) {
this.dialogVisible = false;
clearInterval(this.interval);
this.formData.code = '';
this.buttonText = '获取验证码';
this.time = 60;
this.$emit('openWhichDialogByStatus', {type: this.dialogType, status: this.status});
}else {
this.$message.error(res.msg);
}
});
},
},
filters: {
handlePhone(val) {
return val.substr(0, 3) + '****' + val.substr(7, 10);
}
}
}
</script>
<style scoped lang="scss">
::v-deep.form-dialog .el-dialog {
width: 500px;
}
::v-deep.form-dialog .el-dialog__body {
padding: 30px 20px 0;
}
::v-deep.form-dialog .el-dialog__header {
text-align: center;
}
</style>
/**
* 订单列表筛选条件
* @type {*[]}
*/
const dataSource = {
'localOrgId': [],
'operateList': [],
'Typecities': [
{
'id': '1',
'name': '同城用车',
'isShow': true
},
{
'id': '2',
'name': '跨城约车',
'isShow': true
},
{
'id': '3',
'name': '接送用车',
'isShow': true
},
{
'id': '4',
'name': '公务用车',
'isShow': false
},
{
'id': '5',
'name': '货运',
'isShow': true
},
{
'id': '6',
'name': '包车',
'isShow': true
}
],
'statusList': [
{
'id': '0',
'name': '派单中'
},
{
'id': '1',
'name': '已派单'
},
{
'id': '2',
'name': '已接单'
},
{
'id': '3',
'name': '已出发-行程开始'
},
{
'id': '4',
'name': '服务中-已到达'
},
{
'id': '5',
'name': '服务中-已上车'
},
{
'id': '6',
'name': '已完成'
},
{
'id': '11',
'name': '用户已取消'
},
{
'id': '12',
'name': '司机拒单'
},
{
'id': '13',
'name': '系统销单-派单超时'
},
{
'id': '14',
'name': '司机已取消'
},
{
'id': '15',
'name': '同程已取消'
},
{
'id': '16',
'name': '调度已取消'
}
],
'orderSourceList': [
{
'id': '9',
'name': '同程艺龙'
},
{
'id': '10',
'name': '携程旅游'
},
{
'id': '4',
'name': '司机录单'
},
{
'id': '6',
'name': '小程序'
},
{
'id': '7',
'name': '客服录单'
}
],
'orderChannelList': [
{
'id': '6',
'name': '自营渠道'
},
{
'id': '10',
'name': '携程旅游'
},
{
'id': '9',
'name': '同程艺龙'
}
],
'orderTypes': [
{
'id': '1',
'name': '实时'
},
{
'id': '2',
'name': '预约'
}
],
'paymentList': [
{
'id': '1',
'name': '未支付'
},
{
'id': '2',
'name': '已支付'
},
// {
// 'id': '3',
// 'name': '已退款'
// }
],
'hotType': [
{
'id': '1',
'name': '飞机场'
},
{
'id': '2',
'name': '火车站'
},
{
'id': '3',
'name': '高铁站'
},
{
'id': '4',
'name': '客车站'
}
],
'CarTypes': [
{
'id': '1',
'name': '经济型'
},
{
'id': '2',
'name': '舒适型'
},
{
'id': '3',
'name': '商务型'
},
{
'id': '4',
'name': '豪华型'
},
{
'id': '5',
'name': '微型面包'
},
{
'id': '6',
'name': '厢式货车'
},
{
'id': '7',
'name': '厢式轻卡'
},
{
'id': '8',
'name': '8座小巴'
},
{
'id': '9',
'name': '10座小巴'
},
{
'id': '10',
'name': '14座小巴'
},
{
'id': '11',
'name': '19座小巴'
},
{
'id': '12',
'name': '25座小巴'
},
{
'id': '13',
'name': '30座小巴'
},
{
'id': '14',
'name': '35座小巴'
},
{
'id': '15',
'name': '40座大巴'
},
{
'id': '16',
'name': '43座大巴'
},
{
'id': '17',
'name': '53座大巴'
}
],
'CarType': [
{
'id': '1',
'name': '经济型'
},
{
'id': '2',
'name': '舒适型'
},
{
'id': '3',
'name': '商务型'
},
{
'id': '4',
'name': '豪华型'
},
{
'id': '5',
'name': '微型面包'
},
{
'id': '6',
'name': '厢式货车'
},
{
'id': '7',
'name': '厢式轻卡'
},
{
'id': '8',
'name': '8座小巴'
},
{
'id': '9',
'name': '10座小巴'
},
{
'id': '10',
'name': '14座小巴'
},
{
'id': '11',
'name': '19座小巴'
},
{
'id': '12',
'name': '25座小巴'
},
{
'id': '13',
'name': '30座小巴'
},
{
'id': '14',
'name': '35座小巴'
},
{
'id': '15',
'name': '40座大巴'
},
{
'id': '16',
'name': '43座大巴'
},
{
'id': '17',
'name': '53座大巴'
},
],
'feeType': [
{
'id':'1',
'name': '业务账单',
'isShow': true
},
{
'id':'2',
'name': '成本账单',
'isShow': true
},
{
'id':'3',
'name': '费用账单',
'isShow': true
}
],
'rolesType': [
{
'id': '1',
'name': '收单方'
},
{
'id': '2',
'name': '运营方'
},
{
'id': '3',
'name': '承运方'
},
{
'id': '4',
'name': '平台方'
}
],
'settlementStatus': [
{
'id': '0',
'name': '未结算'
},
{
'id': '1',
'name': '结算中'
},
{
'id': '2',
'name': '已结算'
}
],
'priceType': [
{
'id': '1',
'name': '平台管理费'
},
{
'id': '2',
'name': '罚款'
},
{
'id': '3',
'name': '技术服务费'
}
],
'billType': [
{
'id': '1',
'name': '个人账单'
},
{
'id': '2',
'name': '组织账单'
}
],
'status': [
{
id: '0',
name: '下线'
},
{
id: '1',
name: '上线'
}
],
'complainCategory': [
{
'id': '1',
'name': '客诉'
},
{
'id': '2',
'name': '司控'
}
],
'complainWay': [
{
'id': '1',
'name': '线上控诉'
},
{
'id': '2',
'name': '电话控诉'
},
{
'id': '3',
'name': '建议'
}
],
'processingStatus': [
{
'id': '0',
'name': '待处理'
},
{
'id': '1',
'name': '处理完成'
},
{
'id': '2',
'name': '处理中'
}
],
'complainOrder': [
{
'id': '0',
'name': '电话下单'
},
{
'id': '1',
'name': 'APP下单'
},
{
'id': '2',
'name': '微信下单'
},
{
'id': '3',
'name': '网站下单'
},
{
'id': '4',
'name': '司机补单(面对面下单)'
},
{
'id': '5',
'name': '客户经理下单'
},
{
'id': '6',
'name': '微信小程序下单'
},
{
'id': '7',
'name': '录单系统(打电话)'
},
{
'id': '8',
'name': '玖玖公务用车系统'
},
{
'id': '9',
'name': '同程接口调用'
},
]
}
export default dataSource
// export default {
// customData: function(){
// return dataSource
// }
// }
......@@ -45,7 +45,8 @@ export const routes = [{
icon: 'el-icon-office-building',
title: '企业管理'
},
children: [{
children: [
{
path: '/',
name: 'CompanyInformation',
component: () =>
......@@ -55,6 +56,26 @@ export const routes = [{
icon: 'el-icon-s-data'
}
},
{
path: 'account-information',
name: 'AccountInformation',
component: () =>
import('@/views/accountManagement/index.vue'),
meta: {
title: '账户管理',
icon: 'el-icon-s-finance'
}
},
{
path: 'bandCard',
name: 'bandCard',
component: () =>
import('@/views/accountManagement/bankCard'),
meta: {
title: '银行卡管理'
},
hidden: true
},
{
path: 'department-information',
name: 'DepartmentInformation',
......@@ -72,7 +93,8 @@ export const routes = [{
icon: 'el-icon-setting',
title: '业务配置'
},
children: [{
children: [
{
path: 'enclosure',
name: 'Enclosure',
component: () =>
......@@ -159,4 +181,4 @@ router.beforeEach(async(to, from, next) => {
}
})
export default router
\ No newline at end of file
export default router
/**
* 订单列表筛选条件
* @type {*[]}
*/
const dataSource = {
localOrgId: [],
RunTypes: [
{
id: "1",
isShow: true,
isLu: false,
name: "同城用车"
},
{
id: "2",
isShow: true,
isLu: true,
name: "城际用车"
},
{
id: "3",
isShow: true,
isLu: false,
name: "接送用车"
},
{
id: "4",
isShow: false,
isLu: false,
name: "公务用车"
},
{
id: "5",
isShow: true,
isLu: false,
name: "货运"
}
],
orderSourceList: [
{
id: "9",
name: "同程艺龙"
},
{
id: "10",
name: "携程旅游"
},
{
id: "4",
name: "司机录单"
},
{
id: "6",
name: "小程序"
},
{
id: "7",
name: "客服录单"
}
],
orderTypes: [
{
id: "1",
name: "实时"
},
{
id: "2",
name: "预约"
}
],
paymentList: [
{
id: "1",
name: "未支付"
},
{
id: "2",
name: "已支付"
}
],
hotType: [
{
id: "1",
name: "飞机场"
},
{
id: "2",
name: "火车站"
},
{
id: "3",
name: "高铁站"
},
{
id: "4",
name: "客车站"
}
],
CarTypes: [
{
id: "1",
name: "经济型"
},
{
id: "2",
name: "舒适型"
},
{
id: "3",
name: "商务型"
},
{
id: "4",
name: "豪华型"
},
{
id: "5",
name: "微型面包"
},
{
id: "6",
name: "厢式货车"
},
{
id: "7",
name: "厢式轻卡"
},
{
id: "8",
name: "SUV商务型"
}
],
CarStatus: [
{
id: "1",
name: "待审核"
},
{
id: "2",
name: "休息中"
},
{
id: "3",
name: "听单中"
},
{
id: "4",
name: "行程中"
},
{
id: "5",
name: "已停运"
}
],
haveDriver: [
{
id: "1",
name: "有驾驶人"
},
{
id: "2",
name: "无驾驶人"
}
],
orderStatusList: [
{
id: "0",
name: "派单中"
},
{
id: "1",
name: "已派单"
},
{
id: "2",
name: "已接单"
},
{
id: "3",
name: "前往乘客预约地"
},
{
id: "4",
name: "已到达乘客预约地"
},
{
id: "5",
name: "服务中"
}
// {
// id: "6",
// name: "结束服务"
// },
// {
// id: "7",
// name: "派单失败"
// },
// {
// id: "11",
// name: "用户已取消"
// },
// {
// id: "12",
// name: "司机拒单"
// },
// {
// id: "13",
// name: "系统销单"
// },
// {
// id: "14",
// name: "司机已取消"
// },
// {
// id: "15",
// name: "同程已取消"
// },
// {
// id: "16",
// name: "调度已取消"
// }
],
waybillStatusList: [
{
id: "0",
name: "派单中"
},
{
id: "1",
name: "已派单"
},
{
id: "2",
name: "开始行程"
},
{
id: "4",
name: "乘客上车"
}
// {
// id: "6",
// name: "结束服务"
// },
// {
// id: "11",
// name: "用户已取消"
// },
// {
// id: "12",
// name: "司机拒单"
// },
// {
// id: "13",
// name: "系统销单"
// },
// {
// id: "14",
// name: "司机已取消"
// },
// {
// id: "15",
// name: "同程已取消"
// }
]
};
export default dataSource;
<template>
<el-dialog
:visible.sync="dialogVisible"
title="支付宝商户号绑定"
class="form-dialog"
:close-on-click-modal="false"
:close-on-press-escape="false"
@close="closeFormDialog"
>
<el-form label-width="150px" label-position="right">
<el-form-item label="商户主体全称:">
{{ JSON.parse($store.getters.userInfo).organize.organizeName }}
</el-form-item>
<el-form-item label="支付宝商户号:">
<el-input style="width: 60%;" size="small" v-model="sshNum"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="closeFormDialog">取 消</el-button>
<el-button size="small" type="primary" @click="confirmBtn" :loading="loading">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {
alipayNewApi
} from '@/port/bank/bankNew';
import {mapGetters} from 'vuex'
export default {
name: "alipayTrusteeship",
computed: {
...mapGetters(['transportId'])
},
data() {
return {
dialogVisible: false,
sshNum: '',
loading: false
}
},
methods: {
showDialog() {
this.dialogVisible = true;
},
closeFormDialog() {
this.sshNum = '';
this.dialogVisible = false;
},
confirmBtn(){
if(
!/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(this.sshNum)
&& !/(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(this.sshNum)
) {
return this.$message.info('只能输入手机号或者邮箱');
}
let params = {
"uid": this.transportId,
"type": 2,
"alipayLoginId": this.sshNum
}
this.loading = true;
alipayNewApi(params)
.then((res) => {
if(res.status === 200) {
this.$message.success('绑定成功');
this.closeFormDialog();
this.$emit('closeDialog');
}else {
this.$message.error(res.msg);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
})
},
}
}
</script>
<style scoped lang="scss">
::v-deep.form-dialog .el-dialog {
width: 35%;
}
::v-deep.form-dialog .el-dialog__body {
padding: 5px 20px;
}
::v-deep.form-dialog .el-dialog__header {
border: 1px solid #e4e4e4;
}
.input-item {
width: 50%;
}
::v-deep.dialog-form .el-form-item {
margin-bottom: 5px !important;
}
</style>
<template>
<el-dialog
:visible.sync="dialogVisible"
title="微信商户号绑定"
class="form-dialog"
@close="closeDialog"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form label-width="150px" label-position="right">
<el-form-item label="商户主体全称:">
{{formData.name}}
</el-form-item>
<el-form-item label="微信商户号:">
<el-input style="width: 60%;" size="small" v-model="formData.ssh"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="confirmBtn">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: "chatTrusteeship",
data() {
return {
dialogVisible: false,
formData: {
name: '',
ssh: ''
}
}
},
methods: {
showDialog(val, data) {
if(val === 'edit') {
// 当val=edit时,则为修改,需取第二个参数,否则为新增,不需要做其他操作
// this.data = data;
this.$message.info('这里是修改')
}
this.dialogVisible = true;
},
closeDialog() {
},
confirmBtn() {
}
}
}
</script>
<style scoped lang="scss">
.h-div {
display: flex;
div {
display: flex;
align-items: center;
justify-content: flex-end;
}
}
.idButton {
padding: 0;
}
::v-deep.form-dialog .el-dialog {
width: 40%;
}
::v-deep.form-dialog .el-dialog__body {
padding: 5px 20px;
}
::v-deep.form-dialog .el-dialog__header {
border: 1px solid #e4e4e4;
}
.label-div {
width: 100px;
}
</style>
<template>
<el-card>
<div class="part1">
<div class="part1-top">
<div style="width: 100px;height: 100px;margin-right: 10px">
<el-image style="width: 100%;height: 100%;" :src="gridData.logoUrl" lazy></el-image>
</div>
<div>
<h4>{{ gridData.organizeName }}
<el-tag type="success" style="margin-left: 5px">已认证</el-tag>
</h4>
<div>
<span style="width: 18px;height: 18px;display: inline-block">
<img style="width: 100%" src="@/assets/logo/unionpay.png"/>
</span>
<span @click="clickBank" style="font-size: 14px;color: #009bd2;margin-left: 10px;cursor: pointer;">
银行卡管理(
<span>
{{ bankNumber }}
</span>
</span>
</div>
</div>
</div>
</div>
<div class="instructions">
<accountC/>
</div>
</el-card>
</template>
<script>
import accountC from './components/account-collocation'
import {organizationsInfo} from '@/port/organize'
import {mapGetters} from 'vuex'
import {
getBindListApi
} from "@/port/bank/bankNew";
export default {
name: "index",
data() {
return {
flagIndex: 0,
type: true,
gridData: {
manager: {}
}, // 企业基本信息
accountList: [], // 账户list
parentid: sessionStorage.getItem('parentid'),
bankNumber: '0', // 银行卡数量
};
},
components: {
accountC
},
created() {
this.getAccountHeader();
this.getBankNum();
},
computed: {
...mapGetters(['transportId'])
},
methods: {
getBankNum(){
let params = {
uid: this.transportId
}
getBindListApi(params)
.then((res) => {
if (res.status === 200) {
this.bankNumber = res.data.cardInfos.length;
}
})
},
getAccountHeader() {
organizationsInfo({}, this.parentid).then((res) => {
if (res.status == 200) {
this.gridData = res.data;
} else {
this.$message(res.msg)
}
})
},
clickBank() {
this.$router.push('bandCard')
}
}
};
</script>
<style scoped lang="scss">
.container-body {
padding-bottom: 10vh;
}
.instructions {
font-size: 14px;
padding-top: 10px;
}
.container {
margin: 20px;
.v-modal {
opacity: 1;
}
}
.el-card {
.el-card__header {
border: none;
padding-bottom: 0;
}
}
.text {
font-size: 14px;
}
.item {
padding: 18px 0;
}
.box-card {
width: 100%;
}
.part1 {
.part1-top {
display: flex;
align-items: center;
padding-bottom: 20px;
padding-top: 10px;
border-bottom: 1px solid #ccc;
& > div {
/*margin-left: 20px;*/
h4 {
font-weight: bold;
font-size: 18px;
}
p {
margin: 10px 0;
}
.mainColor {
display: inline-block;
margin-left: 20px;
cursor: pointer;
}
}
}
.part1-bottom {
display: block;
align-items: center;
padding: 20px;
margin-top: 10px;
& > div {
flex: 1;
display: flex;
align-items: center;
div {
/*margin-left: 20px;*/
}
p {
margin-top: 10px;
font-size: 16px;
font-weight: bold;
}
h5 {
font-size: 16px;
}
}
& > div:nth-child(2) {
//padding-left: 50px;
}
.account-item {
width: 400px;
margin-right: 40px;
display: inline-block;
margin-top: 30px;
position: relative;
.account-style {
background-color: #f2f2f2;
margin-left: 0;
padding: 20px;
display: flex;
justify-content: space-between
}
.account-default {
position: absolute;
right: 0;
width: 0;
height: 0;
border-top: 30px solid #fd9941;
border-left: 70px solid transparent;
z-index: 1;
}
.account-default-text {
position: absolute;
top: 3px;
right: 4px;
width: 25px;
z-index: 2;
}
}
}
.right-bold {
border-right: 1px solid #ccc;
}
.input-style {
width: 30%;
}
}
.code-input-main {
width: 100%;
height: 40px;
text-align: left;
}
.code-input-main-item {
text-align: center;
width: 25px;
height: 25px;
padding: 2px;
border: 2px solid rgba(230, 230, 230, 1);
border-radius: 6px;
display: inline-block;
z-index: 1;
font-size: 25px;
vertical-align: top;
&:not(:first-child) {
margin-left: 25px;
}
&:first-child {
margin-left: -4px;
}
}
input { // 原生input样式清除
background: none;
outline: none !important;
-webkit-appearance: none !important;
-webkit-appearance: none !important;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type="number"] {
-moz-appearance: textfield;
}
</style>
<template>
<el-dialog
:visible.sync="dialogVisible"
:title="title"
width="40%"
class="form-dialog"
@close="clearInfo"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="150px">
<el-form-item label="站点区域名称:" prop="siteName">
<el-input style="width: 220px;" size="mini" v-model="form.siteName"></el-input>
</el-form-item>
<el-form-item label="站点区域类型:" prop="siteTypeList">
<el-select multiple v-model="form.siteTypeList">
<el-option label="飞机场" value="1"></el-option>
<el-option label="火车站" value="2"></el-option>
<el-option label="高铁站" value="3"></el-option>
<el-option label="客车站" value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="站点所属区域:" prop="penCity">
<el-cascader v-model="form.penCity" :show-all-levels="false" :props="props"></el-cascader>
</el-form-item>
<el-form-item label="关联电子围栏:" prop="polygonId">
<el-select v-model="form.polygonId">
<el-option
v-for="(item, index) in polygonData"
:label="item.name"
:value="item.id"
:key="'polygon'+index"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="站点专线:" prop="stationList">
</el-form-item>
</el-form>
</el-dialog>
</template>
<script>
import {
getAllprovinceAndCity,
getAllFenceList
} from "@/port/set-request";
export default {
name: "addDialog",
data() {
return {
dialogVisible: false,
props: {
lazy: true,
lazyLoad(node, resolve) {
const {level} = node
console.log(node)
let parent
if (level == 0) {
parent = 100000
} else {
parent = node.value
}
getAllprovinceAndCity(parent).then(res => {
if (res.status == 200) {
let list = res.data
const nodes = list.map(item => {
return {
value: item.id,
label: item.fullname,
leaf: level >= 1
}
})
resolve(nodes)
}
})
}
},
form: {
siteName: '',
siteTypeList: [],
penCity: [],
polygonId: '',
stationList: []
},
rules: {
siteName: [
{required: true, message: "请输入站点区域名称", trigger: "blur"},
],
siteTypeList: [
{required: true, message: "请选择站点区域类型", trigger: "change"},
],
penCity: [
{required: true, message: "请选择站点所属区域", trigger: "change"},
],
polygonId: [
{required: true, message: "请选择关联电子围栏", trigger: "change"},
],
stationList: [
{message: "请输入参加次数", trigger: "blur"},
],
},
title: '添加站点区域',
polygonData: []
}
},
created() {
let params = {
pageVo: {
page: 1,
rows: 999
},
queryName: "",
platformId: this.$store.getters.platformId
}
getAllFenceList(params)
.then((res) => {
if(res.status === 200) {
let data = [];
res.data.content.forEach((item) => {
data.push({
id: item.traceId,
name: item.polygonName
})
})
this.polygonData = data;
}
})
.catch(() => {
})
},
methods: {
clearInfo() {
this.$refs.form.resetFields();
this.dialogVisible = false;
},
showDialog(row) {
if (Object.keys(row).length > 0) {
this.title = '修改站点区域'
}
this.dialogVisible = true;
}
}
}
</script>
<style scoped>
</style>
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
站点
<template>
<el-card type="flex" justify="end">
<el-form class="form-row">
<el-row>
<el-col :span="8">
<el-form-item>
<el-input v-model="form.siteName" size="mini" style="max-width: 260px;" suffix-icon="el-icon-search" placeholder="请输入站点/围栏名称搜索">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<span style="margin-right: 16px;">
站点区域:
</span>
<el-cascader v-model="form.penCity" :show-all-levels="false" style="max-width: 190px;" :props="props"></el-cascader>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<Selects :options="dataSource.hotType"
:selectName="'站点类型:'" :type="'hotType'" @changeList="handlechangeList"></Selects>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="16">
<el-button type="primary" size="mini" @click="searchByInfo">
查询
</el-button>
<el-button type="primary" size="mini" @click="() => $refs.addDialog.showDialog({})">
添加站点区域
</el-button>
</el-col>
</el-row>
</el-form>
<el-table
:data="data"
v-loading="tableLoading"
border
style="margin-top: 10px;"
:row-style="tableRowStyle"
@row-dblclick="handledbClick"
:header-cell-style="tableHeaderColor"
>
<el-table-column label="序号" align="center" type="index" width="50">
</el-table-column>
<el-table-column label="站点名称" align="center" prop="siteName">
</el-table-column>
<el-table-column label="站点所属城市" align="center" prop="areaName">
</el-table-column>
<el-table-column label="围栏名称" align="center" prop="polygonName">
</el-table-column>
<el-table-column label="站点专线" align="center" prop="stationList">
<template slot-scope="scope">
<span v-for="(item, index) in JSON.parse(scope.row.stationList)">
<span v-if="index > 0"></span>{{item.pointsName}}
</span>
</template>
</el-table-column>
<el-table-column label="录入时间" align="center" prop="createTime">
<template slot-scope="scope">
{{dateTime2Str(scope.row.createTime)}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="120">
<template slot-scope="scope">
<el-button size="small" type="text">
管理
</el-button>
<el-button size="small" type="text" style="color: red;">
关闭
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination" v-if="total > 10">
<el-pagination
background
layout="prev, pager, next, jumper, total"
:current-page="pageNum"
@current-change="current_change"
:total="total">
</el-pagination>
</div>
<addDialog ref="addDialog"></addDialog>
</el-card>
</template>
<script>
import {
selectHotAreaList,
getAllprovinceAndCity
} from "@/port/set-request";
import Selects from '@/components/Selects'
import dataSource from "@/libs/screen";
import JudgeType from "@/mixins/judgeType";
import addDialog from "./componenets/site/addDialog";
export default {
name: "site",
components: {
Selects,
addDialog
},
mixins: [JudgeType],
data() {
return {
info: 'baaaaaaaaaaa'
props: {
lazy: true,
lazyLoad(node, resolve) {
const { level } = node
console.log(node)
let parent
if (level == 0) {
parent = 100000
} else {
parent = node.value
}
getAllprovinceAndCity(parent).then(res => {
if (res.status == 200) {
let list = res.data
const nodes = list.map(item => {
return {
value: item.id,
label: item.fullname,
leaf: level >= 1
}
})
resolve(nodes)
}
})
}
},
dataSource: dataSource,
data: [],
pageNum: 1,
size: 10,
total: 0,
tableLoading: false,
form: {
siteName: '',
penCity: [],
siteTypeList: [1, 2, 3, 4]
},
}
},
created() {
this.initTable();
},
methods: {
handlechangeList(val) {
let source = JSON.parse(JSON.stringify(val));
this.form.siteTypeList = this.filftersFun(source.data);
},
handledbClick(){
},
current_change(page) {
this.pageNum = page;
this.initTable();
},
searchByInfo() {
this.pageNum = 1;
this.initTable();
},
initTable() {
let params = {
pageVo: {
page: this.pageNum,
rows: this.size
},
siteTypeList: this.form.siteTypeList,
siteName: this.form.siteName
}
if(this.form.penCity.length > 0) {
params['provinceCode'] = this.form.penCity[0];
params['areaCode'] = this.form.penCity[1];
}
this.tableLoading = true;
selectHotAreaList(params)
.then((res) => {
if(res.status === 200) {
this.total = res.data.total;
this.data = res.data.content;
}else {
this.$message.error(res.msg);
}
this.tableLoading = false;
})
.catch(() => {
this.tableLoading = false;
})
},
// table变色,行
tableRowStyle({row, rowIndex}) {
if (rowIndex % 2 !== 0) {
return {'background-color': '#e3f4ff'};
}
},
// table变色,头
tableHeaderColor({row, column, rowIndex, columnIndex}) {
return {'background-color': '#0099ff', color: '#ffffff'};
},
}
}
</script>
<style scoped lang="scss">
div {
::v-deep.form-row {
.el-form-item {
margin-bottom: 0 !important;
}
}
.pagination {
margin-top: 16px;
text-align: right;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment