Commit b30ea4fa by 胡悦

修改页面文字

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