This commit is contained in:
Sliverber 2024-05-30 10:23:53 +08:00
parent 5a7f1e399e
commit 8be65ddfe3
4 changed files with 153 additions and 226 deletions

View File

@ -5,7 +5,7 @@ VUE_APP_TITLE = 共享电动车管理系统
ENV = 'development' ENV = 'development'
# 共享电动车管理系统/开发环境 # 共享电动车管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.2.6:8080' VUE_APP_BASE_API = 'https://dche.ccttiot.com/prod-api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -5,7 +5,7 @@ VUE_APP_TITLE = 共享电动车管理系统
ENV = 'production' ENV = 'production'
# 共享电动车管理系统/生产环境 # 共享电动车管理系统/生产环境
VUE_APP_BASE_API = 'https://dianche.chuantewulian.cn/prod-api' VUE_APP_BASE_API = 'https://dche.ccttiot.com/prod-api'
# 小程序外链跳转设备 # 小程序外链跳转设备
VUE_APP_WX_DEVICE_URL = 'weixin://dl/business/?appid=wx4d178f8c80348214&env_version=release' VUE_APP_WX_DEVICE_URL = 'weixin://dl/business/?appid=wx4d178f8c80348214&env_version=release'

View File

@ -5,6 +5,6 @@ NODE_ENV = production
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
VUE_APP_BASE_API = 'https://dianche.chuantewulian.cn/prod-api' VUE_APP_BASE_API = 'https://dche.ccttiot.com/prod-api'
# 共享电动车管理系统/测试环境 # 共享电动车管理系统/测试环境
VUE_APP_BASE_API = 'https://dianche.chuantewulian.cn/stage-api' # VUE_APP_BASE_API = 'https://dianche.chuantewulian.cn/stage-api'

View File

@ -2,12 +2,7 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="运营区" prop="areaName"> <el-form-item label="运营区" prop="areaName">
<el-input <el-input v-model="queryParams.areaName" placeholder="请输入运营区" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.areaName"
placeholder="请输入运营区"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -17,25 +12,12 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
type="primary" v-hasPermi="['system:area:add']">新增</el-button>
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:area:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
type="success" v-hasPermi="['system:area:edit']">修改</el-button>
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:area:edit']"
>修改</el-button>
<!-- <el-button <!-- <el-button
type="success" type="success"
plain plain
@ -47,25 +29,12 @@
>电子围栏修改</el-button> --> >电子围栏修改</el-button> -->
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
type="danger" v-hasPermi="['system:area:remove']">删除</el-button>
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:area:remove']"
>删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
type="warning" v-hasPermi="['system:area:export']">导出</el-button>
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:area:export']"
>导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -98,16 +67,12 @@
<el-table-column label="收费方式" align="center" prop="ruleStr" /> <el-table-column label="收费方式" align="center" prop="ruleStr" />
<el-table-column label="联系人" align="center" prop="contact" /> <el-table-column label="联系人" align="center" prop="contact" />
<el-table-column label="联系人电话" align="center" prop="phone" /> <el-table-column label="联系人电话" align="center" prop="phone" />
<el-table-column label="状态" align="center" key="status" > <el-table-column label="状态" align="center" key="status">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
v-model="scope.row.status" @change="handleStatusChange(scope.row)"></el-switch>
active-value="0" </template>
inactive-value="1" </el-table-column>
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -115,53 +80,34 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
size="mini" v-hasPermi="['system:area:edit']">修改</el-button>
type="text" <el-button size="mini" type="text" icon="el-icon-edit" @click="openmaps(scope.row)"
icon="el-icon-edit" v-hasPermi="['system:area:edit']">修改电子围栏</el-button>
@click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:area:edit']" v-hasPermi="['system:area:remove']">删除</el-button>
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="openmaps(scope.row)"
v-hasPermi="['system:area:edit']"
>修改电子围栏</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:area:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
v-show="total>0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog title="电子围栏" :visible.sync="mapopen" width="1200px" append-to-body> <el-dialog title="电子围栏" :visible.sync="mapopen" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="电子围栏" prop="boundaryStr"> <el-form-item label="电子围栏" prop="boundaryStr">
<area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :pathList="form.boundaryStr" @center="center" @mapList="mapList" /> <area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :pathList="form.boundaryStr"
@center="center" @mapList="mapList" />
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="经度" prop="longitude"> <el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" disabled/> <el-input v-model="form.longitude" placeholder="请输入经度" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="纬度" prop="latitude"> <el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" disabled/> <el-input v-model="form.latitude" placeholder="请输入纬度" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -172,7 +118,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加或修改运营区对话框 --> <!-- 添加或修改运营区对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1200px" :before-close="handleClose">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -182,15 +128,18 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运营区域"> <el-form-item label="运营区域">
<el-select v-model="form.province" clearable size="small" placeholder="请选择省" class="filter-item" style="width: 90px" @change="provinceChange($event)"> <el-select v-model="form.province" clearable size="small" placeholder="请选择省" class="filter-item"
<el-option v-for="item in form.provinceList" :key="item.name" :label="item.name" :value="item.name"/> style="width: 90px" @change="provinceChange($event)">
<el-option v-for="item in form.provinceList" :key="item.name" :label="item.name" :value="item.name" />
</el-select> </el-select>
<el-select v-model="form.city" clearable size="small" placeholder="请选择城市" class="filter-item" style="width: 100px" @change="cityChange($event)"> <el-select v-model="form.city" clearable size="small" placeholder="请选择城市" class="filter-item"
style="width: 100px" @change="cityChange($event)">
<el-option v-for="item in form.cityList" :key="item.name" :label="item.name" :value="item.name" /> <el-option v-for="item in form.cityList" :key="item.name" :label="item.name" :value="item.name" />
</el-select> </el-select>
<el-select v-model="form.county" clearable size="small" placeholder="请选择区县" class="filter-item" style="width: 100px" > <el-select v-model="form.county" clearable size="small" placeholder="请选择区县" class="filter-item"
style="width: 100px">
<el-option v-for="item in form.countyList" :key="item.name" :label="item.name" :value="item.name" /> <el-option v-for="item in form.countyList" :key="item.name" :label="item.name" :value="item.name" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -199,11 +148,11 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运营个性化图片" prop="picture" label-width="140px"> <el-form-item label="运营个性化图片" prop="picture" label-width="140px">
<image-upload v-model="form.picture"/> <image-upload v-model="form.picture" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运营个性化标语" prop="slogan" label-width="120px"> <el-form-item label="运营个性化标语" prop="slogan" label-width="120px">
<el-input v-model="form.slogan" placeholder="请输入运营个性化标语" style="" /> <el-input v-model="form.slogan" placeholder="请输入运营个性化标语" style="" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -224,69 +173,49 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运营时间" prop="areaTime"> <el-form-item label="运营时间" prop="areaTime">
<el-select v-model="form.areaTime" placeholder="请选择运营时间" style="width: 100%;"> <el-select v-model="form.areaTime" placeholder="请选择运营时间" style="width: 100%;">
<el-option <el-option v-for="dict in dict.type.et_operating_area_time" :key="dict.value" :label="dict.label"
v-for="dict in dict.type.et_operating_area_time" :value="dict.value" />
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客服电话" prop="phone"> <el-form-item label="客服电话" prop="phone">
<el-input v-model="form.servicePhone " placeholder="请输入客服电话" /> <el-input v-model="form.servicePhone" placeholder="请输入客服电话" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="form.areaTime==2"> <el-row v-if="form.areaTime == 2">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="自定义"> <el-form-item label="自定义">
<el-time-picker <el-time-picker v-model="form.areaTimeStart" value-format="HH:mm:ss" placeholder="开始时间">
v-model="form.areaTimeStart" </el-time-picker>
value-format="HH:mm:ss" <el-time-picker arrow-control v-model="form.areaTimeEnd" value-format="HH:mm:ss" placeholder="结束时间">
placeholder="开始时间"> </el-time-picker>
</el-time-picker> </el-form-item>
<el-time-picker </el-col>
arrow-control
v-model="form.areaTimeEnd"
value-format="HH:mm:ss"
placeholder="结束时间">
</el-time-picker>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="运营区域外断电" label-width="120"> <el-form-item label="运营区域外断电" label-width="120">
<el-radio-group v-model="form.areaOutOutage" style="width: 50%"> <el-radio-group v-model="form.areaOutOutage" style="width: 50%">
<el-radio <el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
v-for="dict in dict.type.et_business_switch" :label="dict.value">{{ dict.label }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="停车点外还车调度" label-width="150"> <el-form-item label="停车点外还车调度" label-width="150">
<el-radio-group v-model="form.parkingOutDispatch" style="width: 50%"> <el-radio-group v-model="form.parkingOutDispatch" style="width: 50%">
<el-radio <el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
v-for="dict in dict.type.et_business_switch" :label="dict.value">{{ dict.label }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="电子围栏外还车调度" label-width="150"> <el-form-item label="电子围栏外还车调度" label-width="150">
<el-radio-group v-model="form.areaOutDispatch" style="width: 50%"> <el-radio-group v-model="form.areaOutDispatch" style="width: 50%">
<el-radio <el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
v-for="dict in dict.type.et_business_switch" :label="dict.value">{{ dict.label }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -295,33 +224,24 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="禁行区内断电" label-width="90"> <el-form-item label="禁行区内断电" label-width="90">
<el-radio-group v-model="form.noRidingOutage" style="width: 60%"> <el-radio-group v-model="form.noRidingOutage" style="width: 60%">
<el-radio <el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
v-for="dict in dict.type.et_business_switch" :label="dict.value">{{ dict.label }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="实名认证" > <el-form-item label="实名认证">
<el-radio-group v-model="form.authentication" style="width: 60%"> <el-radio-group v-model="form.authentication" style="width: 60%">
<el-radio <el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
v-for="dict in dict.type.et_business_switch" :label="dict.value">{{ dict.label }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="短信通知服务" label-width="90"> <el-form-item label="短信通知服务" label-width="90">
<el-radio-group v-model="form.msgSwitch" style="width: 60%"> <el-radio-group v-model="form.msgSwitch" style="width: 60%">
<el-radio <el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
v-for="dict in dict.type.et_business_switch" :label="dict.value">{{ dict.label }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -330,21 +250,18 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="收费方式"> <el-form-item label="收费方式">
<el-select v-model="form.ruleIds" multiple placeholder="请选择收费方式"> <el-select v-model="form.ruleIds" multiple placeholder="请选择收费方式">
<el-option <el-option v-for="item in ruleOptions" :key="item.ruleId" :label="item.name"
v-for="item in ruleOptions" :value="item.ruleId"></el-option>
:key="item.ruleId"
:label="item.name"
:value="item.ruleId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="低于电量(%)不得骑行" label-width="150"> <el-form-item label="低于电量(%)不得骑行" label-width="150">
<el-input-number style="width: 50%" v-model="form.undercharge" placeholder="低于电量(%)不得骑行"></el-input-number> <el-input-number style="width: 50%" v-model="form.undercharge"
placeholder="低于电量(%)不得骑行"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -354,31 +271,36 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="预约服务费" label-width="150"> <el-form-item label="预约服务费" label-width="150">
<el-input-number style="width: 50%" v-model="form.appointmentServiceFee" placeholder="预约时每十分钟的计费"></el-input-number> <el-input-number style="width: 50%" v-model="form.appointmentServiceFee"
placeholder="预约时每十分钟的计费"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="调度费" label-width="150"> <el-form-item label="调度费" label-width="150">
<el-input-number style="width: 50%" v-model="form.dispatchFee" placeholder="车辆超出运行区外的调度费用"></el-input-number> <el-input-number style="width: 50%" v-model="form.dispatchFee"
placeholder="车辆超出运行区外的调度费用"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="管理费" label-width="150"> <el-form-item label="管理费" label-width="150">
<el-input-number style="width: 50%" v-model="form.vehicleManagementFee" placeholder="车辆在运营区内但没在停车区产生的调度费用"></el-input-number> <el-input-number style="width: 50%" v-model="form.vehicleManagementFee"
placeholder="车辆在运营区内但没在停车区产生的调度费用"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="电量低于多少值自动生成换电订单" label-width="150" prop="autoReplacementOrder"> <el-form-item label="电量低于多少值自动生成换电订单" label-width="150" prop="autoReplacementOrder">
<el-input-number style="width: 50%" v-model="form.autoReplacementOrder" placeholder="电量低于多少值自动生成换电订单"></el-input-number> <el-input-number style="width: 50%" v-model="form.autoReplacementOrder"
placeholder="电量低于多少值自动生成换电订单"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最大预约时间" label-width="150"> <el-form-item label="最大预约时间" label-width="150">
<el-input-number style="width: 50%" v-model="form.timeoutMinutes" placeholder="车辆可最长预约多少分钟"></el-input-number> <el-input-number style="width: 50%" v-model="form.timeoutMinutes"
placeholder="车辆可最长预约多少分钟"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -397,22 +319,23 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="安全协议"> <el-form-item label="安全协议">
<editor v-model="form.agreement" :min-height="192"/> <editor v-model="form.agreement" :min-height="192" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="电子围栏" prop="boundaryStr"> <el-form-item label="电子围栏" prop="boundaryStr">
<area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :pathList="form.boundaryStr" @center="center" @mapList="mapList" /> <area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :pathList="form.boundaryStr"
@center="center" @mapList="mapList" />
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="经度" prop="longitude"> <el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" disabled/> <el-input v-model="form.longitude" placeholder="请输入经度" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="纬度" prop="latitude"> <el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" disabled/> <el-input v-model="form.latitude" placeholder="请输入纬度" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -428,12 +351,12 @@
<script> <script>
import { listArea, getArea, delArea, addArea, updateArea } from "@/api/system/area"; import { listArea, getArea, delArea, addArea, updateArea } from "@/api/system/area";
import AreaMap from "@/components/AreaMap"; import AreaMap from "@/components/AreaMap";
import {listFee} from "@/api/system/fee"; import { listFee } from "@/api/system/fee";
import {getDistrictList} from "@/api/common/common"; import { getDistrictList } from "@/api/common/common";
export default { export default {
name: "Area", name: "Area",
dicts: ['et_operating_area_status','et_operating_area_time','et_business_switch'], dicts: ['et_operating_area_status', 'et_operating_area_time', 'et_business_switch'],
components: { AreaMap }, components: { AreaMap },
data() { data() {
return { return {
@ -464,7 +387,7 @@ export default {
title: "", title: "",
// //
open: false, open: false,
mapopen:false, mapopen: false,
// keyarea-map // keyarea-map
key: 0, key: 0,
// //
@ -475,7 +398,7 @@ export default {
}, },
// //
form: { form: {
status:'1', status: '1',
province: '', province: '',
city: '', city: '',
county: '', county: '',
@ -483,7 +406,7 @@ export default {
cityList: [], cityList: [],
countyList: [], countyList: [],
}, },
loading:false, loading: false,
// //
rules: { rules: {
areaName: [{ required: true, message: "运营区域不能为空", trigger: "blur" }], areaName: [{ required: true, message: "运营区域不能为空", trigger: "blur" }],
@ -495,11 +418,11 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
getCityList() { getCityList() {
this.loading=false this.loading = false
getDistrictList().then(res => { getDistrictList().then(res => {
this.form.provinceList = JSON.parse(res.data) this.form.provinceList = JSON.parse(res.data)
// console.log("provinceList======"+JSON.stringify(this.form.provinceList)) // console.log("provinceList======"+JSON.stringify(this.form.provinceList))
@ -507,87 +430,91 @@ export default {
/* 进行遍历赋值*/ /* 进行遍历赋值*/
/* 市区和县区*/ /* 市区和县区*/
let newProvince = this.form.provinceList let newProvince = this.form.provinceList
for(let i = 0; i < newProvince.length; i++){ /* 省级*/ for (let i = 0; i < newProvince.length; i++) { /* 省级*/
for(let j = 0; j < newProvince[i].districts.length; j++){ /* 市级*/ for (let j = 0; j < newProvince[i].districts.length; j++) { /* 市级*/
let city = newProvince[i].districts[j].name let city = newProvince[i].districts[j].name
this.CITY.push({id:j+1,name:city,code:i+1}) this.CITY.push({ id: j + 1, name: city, code: i + 1 })
for(let k = 0;k<newProvince[i].districts[j].districts.length; k++){/* 县级*/ for (let k = 0; k < newProvince[i].districts[j].districts.length; k++) {/* 县级*/
let xian = newProvince[i].districts[j].districts[k].name let xian = newProvince[i].districts[j].districts[k].name
this.XIAN.push({id:k+1,name:xian,code:j+1,cityCountyName:city}) this.XIAN.push({ id: k + 1, name: xian, code: j + 1, cityCountyName: city })
} }
} }
} }
for(let m = 0; m < newProvince.length;m++){ for (let m = 0; m < newProvince.length; m++) {
newProvince[m] = {...newProvince[m],...{code:m+1}} newProvince[m] = { ...newProvince[m], ...{ code: m + 1 } }
} }
// console.log("newProvince======"+JSON.stringify(newProvince)) // console.log("newProvince======"+JSON.stringify(newProvince))
this.form.provinceList = newProvince this.form.provinceList = newProvince
this.loading=true // this.loading = true
console.log(console.log( this.form.provinceList,' this.form.provinceList')) console.log(console.log(this.form.provinceList, ' this.form.provinceList'))
}) })
}, },
handleClose(){
this.open=false
this.loading = false
},
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用"; let text = row.status === "0" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + row.areaName + '"运营区吗?').then(function() { this.$modal.confirm('确认要"' + text + row.areaName + '"运营区吗?').then(function () {
let data={ let data = {
areaId:row.areaId, areaId: row.areaId,
status:row.status status: row.status
} }
updateArea(data).then(response => { updateArea(data).then(response => {
this.getList(); this.getList();
}); });
}).then(() => { }).then(() => {
this.$modal.msgSuccess(text + "成功"); this.$modal.msgSuccess(text + "成功");
}).catch(function() { }).catch(function () {
row.status = row.status === "0" ? "1" : "0"; row.status = row.status === "0" ? "1" : "0";
}); });
}, },
cityChange(that){ cityChange(that) {
let countyCode = 0 let countyCode = 0
let cityname = '' let cityname = ''
let newCountyArry = [] let newCountyArry = []
this.form.cityList.forEach((item,index)=>{ this.form.cityList.forEach((item, index) => {
if(item.name == that){ if (item.name == that) {
countyCode = item.id countyCode = item.id
cityname = item.name cityname = item.name
} }
}) })
if(countyCode){ if (countyCode) {
this.form.countyList = [] this.form.countyList = []
this.XIAN.forEach((item,index)=>{ this.XIAN.forEach((item, index) => {
if(item.code == countyCode && item.cityCountyName == cityname){ if (item.code == countyCode && item.cityCountyName == cityname) {
this.form.countyList.push(item) this.form.countyList.push(item)
} }
}) })
} }
}, },
provinceChange(that){ provinceChange(that) {
// //
let cityCode = 0 let cityCode = 0
let newCityArry = [] let newCityArry = []
this.form.provinceList.forEach((item,index)=>{ this.form.provinceList.forEach((item, index) => {
if(item.name == that){ if (item.name == that) {
cityCode = item.code cityCode = item.code
} }
}) })
// console.log(cityCode) // console.log(cityCode)
if(cityCode){ if (cityCode) {
this.form.cityList = [] this.form.cityList = []
this.CITY.forEach((item,index)=>{ this.CITY.forEach((item, index) => {
if(item.code == cityCode){ if (item.code == cityCode) {
this.form.cityList.push(item) this.form.cityList.push(item)
} }
}) /* 市匹配成功*/ }) /* 市匹配成功*/
} }
}, },
mapList(data){ mapList(data) {
let mapListJson = JSON.stringify(data); let mapListJson = JSON.stringify(data);
console.log("mapListJson:"+mapListJson); console.log("mapListJson:" + mapListJson);
this.form.boundaryStr = mapListJson; this.form.boundaryStr = mapListJson;
}, },
center(data){ center(data) {
this.form.longitude = data.lng; this.form.longitude = data.lng;
this.form.latitude = data.lat; this.form.latitude = data.lat;
}, },
@ -603,7 +530,7 @@ export default {
}, },
// //
cancel() { cancel() {
this.mapopen=false this.mapopen = false
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
@ -618,7 +545,7 @@ export default {
// parkingPoint: null, // parkingPoint: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
status:'1', status: '1',
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -635,7 +562,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.areaId) this.ids = selection.map(item => item.areaId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -652,26 +579,26 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const areaId = row.areaId || this.ids const areaId = row.areaId || this.ids
getArea(areaId).then(response => { getArea(areaId).then(response => {
this.form = response.data; this.form = response.data;
this.form.ruleIds=response.ruleIds this.form.ruleIds = response.ruleIds
this.open = true; this.open = true;
this.title = "修改运营区"; this.title = "修改运营区";
this.key++; this.key++;
listFee().then(response => { listFee().then(response => {
this.ruleOptions = response.rows; this.ruleOptions = response.rows;
this.open = true; this.open = true;
this.title = "添加运营区"; this.title = "添加运营区";
this.key++; this.key++;
}); });
// this.getCityList() // this.getCityList()
this.getCityList(); this.getCityList();
}); });
}, },
openmaps(row) { openmaps(row) {
this.reset(); this.reset();
const areaId = row.areaId || this.ids const areaId = row.areaId || this.ids
getArea(areaId).then(response => { getArea(areaId).then(response => {
@ -687,24 +614,24 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
const { cityList, countyList, provinceList, ...rest } = this.form; const { cityList, countyList, provinceList, ...rest } = this.form;
// rest data
let data = { ...rest };
// console.log(data, 'data without cityList, countyList, provinceList'); // rest data
let data = { ...rest };
// console.log(data, 'data without cityList, countyList, provinceList');
// console.log(this.form,'formformformformform'); // console.log(this.form,'formformformformform');
if (this.form.areaId != null) { if (this.form.areaId != null) {
updateArea(data).then(response => { updateArea(data).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.mapopen=false this.mapopen = false
this.getList(); this.getList();
}); });
} else { } else {
addArea(data).then(response => { addArea(data).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} }
@ -714,12 +641,12 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const areaIds = row.areaId || this.ids; const areaIds = row.areaId || this.ids;
this.$modal.confirm('是否确认删除运营区编号为"' + areaIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除运营区编号为"' + areaIds + '"的数据项?').then(function () {
return delArea(areaIds); return delArea(areaIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -731,7 +658,7 @@ export default {
}; };
</script> </script>
<style> <style>
.el-dialog:not(.is-fullscreen) { .el-dialog:not(.is-fullscreen) {
margin-top: 2vh !important; margin-top: 2vh !important;
} }
</style> </style>