Commit b30ea4fa by 胡悦

修改页面文字

1 parent 6e2b8b63
......@@ -2,7 +2,7 @@
<div class="system-container">
<div class="container">
<h1>有效试驾(日报)</h1>
<div class="m-b-md">用于<span class="red-text">展示日运营数据并支持下载Excel文件</span></div>
<div class="m-b-md">用于展示日运营数据并支持下载Excel文件</div>
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
......
......@@ -9,7 +9,11 @@
label-width="135px"
:inline="true"
>
<el-form-item class="special-shop-input" label="特约店名称:" prop="specialShopName">
<el-form-item
class="special-shop-input"
label="特约店名称:"
prop="specialShopName"
>
<el-cascader
:key="refresh"
ref="specialShopCascader"
......@@ -36,13 +40,22 @@
</el-form-item>
<el-form-item label="特约店级别:">
<el-radio-group v-model="form.shopLevel">
<el-radio label="一级店" :disabled="readonlyStatus">一级店</el-radio>
<el-radio label="二级店" :disabled="readonlyStatus">二级店</el-radio>
<el-radio
label="一级店"
:disabled="readonlyStatus"
>一级店</el-radio>
<el-radio
label="二级店"
:disabled="readonlyStatus"
>二级店</el-radio>
</el-radio-group>
</el-form-item>
<h2>特约店线路配置</h2>
<h2>特约店围栏配置</h2>
<el-divider></el-divider>
<el-form-item label="特约店线路名称:" prop="fenceName">
<el-form-item
label="特约店线路名称:"
prop="fenceName"
>
<el-input
v-model.trim="form.fenceName"
:size="btn_size"
......@@ -51,12 +64,16 @@
:disabled="readonlyStatus"
></el-input>
</el-form-item>
<el-form-item label="监控范围:" prop="radius">
<el-form-item
label="监控范围:"
prop="radius"
>
<el-input
v-model="form.radius"
:size="btn_size"
Placeholder="请输入半径"
style="width:140px" maxlength="10"
style="width:140px"
maxlength="10"
:disabled="readonlyStatus"
>
<template slot="append">M</template>
......@@ -71,21 +88,30 @@
>更新线路</el-button>
</el-form-item>
<div>
<el-form-item label="经度:" prop="lng">
<el-form-item
label="经度:"
prop="lng"
>
<el-input
v-model="form.lng"
size="small"
:disabled="readonlyStatus"
></el-input>
</el-form-item>
<el-form-item label="纬度:" prop="lat">
<el-form-item
label="纬度:"
prop="lat"
>
<el-input
v-model="form.lat"
size="small"
:disabled="readonlyStatus"
></el-input>
</el-form-item>
<el-form-item label="特约店详细地址:" prop="analysisAddress">
<el-form-item
label="特约店详细地址:"
prop="analysisAddress"
>
<el-input
v-model="form.analysisAddress"
size="medium"
......@@ -109,8 +135,17 @@
</fence-map>
</div>
<div class="fenceModalfooter">
<el-button v-if="!readonlyStatus" type="primary" @click="saveFence" size="small" :loading="submitting">{{btnText}}</el-button>
<el-button @click="cancel" size="small">取消</el-button>
<el-button
v-if="!readonlyStatus"
type="primary"
@click="saveFence"
size="small"
:loading="submitting"
>{{btnText}}</el-button>
<el-button
@click="cancel"
size="small"
>取消</el-button>
</div>
</div>
</template>
......@@ -123,46 +158,46 @@ import mapService from 'utils/mapService.js'
export default {
components: { fenceMap },
data() {
let checkSpecialShop = (rule, value, cb)=>{
if(!this.form.specialShopName){
let checkSpecialShop = (rule, value, cb) => {
if (!this.form.specialShopName) {
cb(new Error('请选择特约店'))
}else{
} else {
cb();
}
}
let checkLng = (rule, vaule, cb)=>{
if(this.form.shapeType == 1 && !/^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$/.test(this.form.lng)){
let checkLng = (rule, vaule, cb) => {
if (this.form.shapeType == 1 && !/^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$/.test(this.form.lng)) {
cb(new Error('请输入正确的格式'))
}else{
} else {
cb();
}
}
let checkLat = (rule, vaule, cb)=>{
if(this.form.shapeType == 1 && !/^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$/.test(this.form.lat)){
let checkLat = (rule, vaule, cb) => {
if (this.form.shapeType == 1 && !/^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$/.test(this.form.lat)) {
cb(new Error('请输入正确的格式'))
}else{
} else {
cb();
}
}
let checkRadius = (rule, vaule, cb)=>{
if(this.form.shapeType == 1 && !/^\d+$/.test(this.form.radius)){console.log(this.form.radius)
let checkRadius = (rule, vaule, cb) => {
if (this.form.shapeType == 1 && !/^\d+$/.test(this.form.radius)) { console.log(this.form.radius)
cb(new Error('请输入正确的格式,不能输入小数点'))
}else{
} else {
cb();
}
}
let checkTransferAddr = (rule, vaule, cb)=>{
if(this.form.shapeType == 1){
if(this.transferError){
let checkTransferAddr = (rule, vaule, cb) => {
if (this.form.shapeType == 1) {
if (this.transferError) {
cb(new Error('所填经纬度不能正确解析地址,请重新输入'));
}else{
} else {
cb();
}
}else{
} else {
cb()
}
......@@ -203,8 +238,8 @@ export default {
analysisAddress: '',
status: 1,
transferError: false,
timeType:2,
electricTimeFenceType:'',
timeType: 2,
electricTimeFenceType: '',
electricTimeFenceTypes: [
{
value: 1,
......@@ -231,23 +266,23 @@ export default {
},
rules: {
specialShopName: [
{required: true, validator: checkSpecialShop, trigger: 'change'}
{ required: true, validator: checkSpecialShop, trigger: 'change' }
],
fenceName: [
{required: true, message: '请输入特约店线路名称', trigger: 'blur'},
{pattern: /^\S{2,200}$/, message: '至少2字', trigger: 'blur' },
{ required: true, message: '请输入特约店线路名称', trigger: 'blur' },
{ pattern: /^\S{2,200}$/, message: '至少2字', trigger: 'blur' },
],
radius: [
{validator: checkRadius, trigger: 'blur'}
{ validator: checkRadius, trigger: 'blur' }
],
lng: [
{required: true, validator: checkLng, trigger: 'blur'}
{ required: true, validator: checkLng, trigger: 'blur' }
],
lat: [
{required: true, validator: checkLat, trigger: 'blur'}
{ required: true, validator: checkLat, trigger: 'blur' }
],
analysisAddress: [
{validator: checkTransferAddr, trigger: 'change'}
{ validator: checkTransferAddr, trigger: 'change' }
],
}
}
......@@ -274,20 +309,20 @@ export default {
getSpecialShopList() {
getSpecialShopList().then(res => {
const { code, data } = res;
if(code == 200) {
if (code == 200) {
this.specialShopOptions = data;
}
})
},
getFenceDetail(id){
getFenceDetailById({shopId: id}).then((res)=>{
if(res.code == 200){
getFenceDetail(id) {
getFenceDetailById({ shopId: id }).then((res) => {
if (res.code == 200) {
const form = this.form;
const data = res.data;
if(!data) {
if (!data) {
return;
}
for(let key in data){
for (let key in data) {
form[key] = data[key]
}
this.form.shapeType = 1;
......@@ -303,21 +338,21 @@ export default {
this.form.shopLevel = data.shopLevel;
this.form.analysisAddress = data.address;
if(form.shapeType === 1){
if (form.shapeType === 1) {
this.mapData = {
fenceType: 'circle',
lng: form.lng,
lat: form.lat,
radius: form.radius,
}
}else if(form.shapeType === 4){
} else if (form.shapeType === 4) {
this.mapData = {
fenceType: 'area',
areaCode: this.form.areaCode
}
}else if(form.shapeType === 3){
if(data.lnglat){
this.polygonPath = data.lnglat.split('|').map((item)=>{
} else if (form.shapeType === 3) {
if (data.lnglat) {
this.polygonPath = data.lnglat.split('|').map((item) => {
return [item.split(',')[0], item.split(',')[1]]
})
}
......@@ -334,27 +369,27 @@ export default {
});
},
updateMapData(data) {
if(data.radius){
if (data.radius) {
this.form.radius = data.radius;
}
if(data.lng && data.lat){
if (data.lng && data.lat) {
this.form.lng = data.lng;
this.form.lat = data.lat;
this.transfer()
}
if(data.polygonPath && data.polygonPath.length){
if (data.polygonPath && data.polygonPath.length) {
this.polygonPath = data.polygonPath
}
},
handleSpecialShopChange(val) {
// 特约店级联选项
this.form.specialShopName = val[1];
if(val && val.length > 1) {
this.$nextTick(()=> {
if (val && val.length > 1) {
this.$nextTick(() => {
this.refresh = new Date().getTime();
const thisNodes = this.$refs['specialShopCascader'].getCheckedNodes()[0];
if(thisNodes && thisNodes.data) {
if (thisNodes && thisNodes.data) {
const { data } = thisNodes;
this.form.specialShopId = data.id;
this.form.specialShopCode = data.code;
......@@ -363,7 +398,7 @@ export default {
})
}
},
updateFence(){
updateFence() {
this.$refs.fenceMap.updateFence({
fenceType: 'circle',
lng: this.form.lng,
......@@ -372,62 +407,62 @@ export default {
});
this.transfer()
},
validateLngLat(){
validateLngLat() {
let pass = true;
this.$refs.shopForm.validateField('lng', (error)=>{
if(error){
this.$refs.shopForm.validateField('lng', (error) => {
if (error) {
pass = false;
}
});
this.$refs.shopForm.validateField('lat', (error)=>{
if(error){
this.$refs.shopForm.validateField('lat', (error) => {
if (error) {
pass = false;
}
});
this.$refs.shopForm.validateField('radius', (error)=>{
if(error){
this.$refs.shopForm.validateField('radius', (error) => {
if (error) {
pass = false;
}
});
return pass;
},
transfer(){
if(this.form.lng && this.form.lat && this.validateLngLat()){
transfer() {
if (this.form.lng && this.form.lat && this.validateLngLat()) {
this.transferTimeoutId && window.clearTimeout(this.transferTimeoutId);
this.transferTimeoutId = window.setTimeout(()=>{
this.transferTimeoutId = window.setTimeout(() => {
const flag = new Date();
this.transferFlag = flag;
if(!this.geocoder){
mapService.getGeocoder().then((gc)=>{
if (!this.geocoder) {
mapService.getGeocoder().then((gc) => {
this.geocoder = gc;
this.getAddress(flag);
});
}else{
} else {
this.getAddress(flag);
}
}, 500)
}
},
getAddress(flag){
getAddress(flag) {
const lnglatXY = [this.form.lng, this.form.lat];
this.form.analysisAddress = ''
this.geocoder.getAddress(lnglatXY, (status, result)=>{
if(flag == this.transferFlag){
this.geocoder.getAddress(lnglatXY, (status, result) => {
if (flag == this.transferFlag) {
if (status === 'complete' && result.info === 'OK') {//获取地址成功
//console.log(result.regeocode.formattedAddress)
this.form.analysisAddress = result.regeocode.formattedAddress;
this.transferError = false;
this.$refs.shopForm.validateField('analysisAddress');
//this.$refs.fenceMap.updateMap(this.form)
}else{
} else {
this.transferError = true;
this.$refs.shopForm.validateField('analysisAddress');
}
}
});
},
getParams(){
getParams() {
const form = this.form;
const params = {};
......@@ -443,14 +478,14 @@ export default {
// params.shapeType = form.shapeType;
// params.des = form.des;
// params.timeType = form.timeType;
if(form.shapeType == 4){
if (form.shapeType == 4) {
params.areaCode = form.areaCode;
params.areaString = form.areaString;
}else if(form.shapeType == 1){
} else if (form.shapeType == 1) {
params.lnglat = `${form.lng},${form.lat}`;
params.radius = form.radius;
params.address = form.analysisAddress;
}else if(form.shapeType == 3){
} else if (form.shapeType == 3) {
params.lnglat = this.polygonPath.join('|')
}
// params.bizFenceType = form.bizFenceType
......@@ -475,9 +510,9 @@ export default {
return params;
},
saveFence(){
if(this.form.shapeType == 3){
if(this.polygonPath.length === 0){
saveFence() {
if (this.form.shapeType == 3) {
if (this.polygonPath.length === 0) {
this.$message({
message: '请绘制线路',
type: 'error'
......@@ -486,15 +521,15 @@ export default {
}
}
this.$refs.shopForm.validate((valid) => {
if(valid){
if (valid) {
this.submitting = true;
if(typeof this.shopId != 'undefined'){
if (typeof this.shopId != 'undefined') {
const params = this.getParams();
params.id = this.shopId;
updateFence(params).then((res)=>{
if(res.code == 200){
updateFence(params).then((res) => {
if (res.code == 200) {
//this.closeDialog();
this.$message({
message: '提交成功',
......@@ -509,9 +544,9 @@ export default {
}
this.submitting = false;
});
}else{
saveFence(this.getParams()).then((res)=>{
if(res.code == 200){
} else {
saveFence(this.getParams()).then((res) => {
if (res.code == 200) {
//this.closeDialog();
this.$message({
message: '提交成功',
......@@ -528,13 +563,13 @@ export default {
});
}
}else{
} else {
return false;
}
});
},
cancel(){
cancel() {
history.go(-1)
},
}
......@@ -542,7 +577,7 @@ export default {
</script>
<style scoped>
.fenceModalfooter{
.fenceModalfooter {
margin: 0;
padding: 20px;
padding-top: 10px;
......@@ -550,7 +585,7 @@ export default {
box-sizing: border-box;
z-index: 500;
position: fixed;
left:0;
left: 0;
bottom: 0;
width: 100%;
border-top: 1px solid #e7eaec;
......
......@@ -86,16 +86,6 @@
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
......
......@@ -46,16 +46,6 @@
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!