Commit b36a4e46 by 吴娟华

'1.2.1'

1 parent 9d5f0e8e
......@@ -104,7 +104,7 @@ export default {
},
methods: {
selectChange(val,item) {
//console.log(item)
console.log(val,item)
if(item.selectChange){
item.selectChange(val,item);
}
......
......@@ -11,6 +11,7 @@
v-for="(item, index) in formList"
:key="index"
:label="item.label || ''"
:class="item.class||''"
>
<template>
<template v-if="item.type === 'input'">
......
......@@ -162,7 +162,7 @@ export default {
url: `${store.state.baseURL}${REPORT_API.REPORT_EXPORT}`,
method: 'GET',
data: this.searchDataForm,
fileName: '无在店统计报表'+this.statDate
fileName: '无在店统计报表'+moment().format('YYYY.MM.DD')
})
},
tableDataFinished(data) {
......
......@@ -33,12 +33,26 @@
placement="bottom-start"
width="400"
@show="selectStore"
trigger="click">
trigger="click"
>
<div v-loading="loading">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
size="small"
>
</el-input>
<el-tree style="max-height:50vh;overflow:auto" class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
<el-tree
style="max-height:50vh;overflow:auto"
class="filter-tree"
:data="filterTextData"
:filter-node-method="filterNode"
highlight-current
ref="tree"
node-key="id"
check-on-click-node
>
</el-tree>
<p style="text-align: right; margin-top: 10px">
<el-button @click="filterConfirm" type="primary">确定</el-button>
......@@ -49,7 +63,7 @@
v-model="form.specialShopName"
:placeholder="form.specialShopName || '请选择特约店名称'"
slot="reference"
>
>
</el-input>
</el-popover>
</el-form-item>
......@@ -64,22 +78,13 @@
</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>
<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"
......@@ -88,10 +93,7 @@
: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"
......@@ -109,33 +111,25 @@
:size="btn_size"
@click="updateFence"
:disabled="readonlyStatus"
>更新线路</el-button>
>更新线路</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"
......@@ -165,152 +159,159 @@
@click="saveFence"
size="small"
:loading="submitting"
>{{btnText}}</el-button>
<el-button
@click="cancel"
size="small"
>取消</el-button>
>{{ btnText }}</el-button
>
<el-button @click="cancel" size="small">取消</el-button>
</div>
</div>
</template>
<script>
import { getSpecialShopList } from 'services/vehicle'
import { getSpecialShopList } from "services/vehicle";
import { getOrgTree } from "services/common";
import {
getOrgTree,
} from "services/common";
import { getFenceDetailById, saveFence, updateFence } from 'services/specialshop'
import fenceMap from 'components/map/fenceMap.vue'
import mapService from 'utils/mapService.js'
getFenceDetailById,
saveFence,
updateFence,
} from "services/specialshop";
import fenceMap from "components/map/fenceMap.vue";
import mapService from "utils/mapService.js";
export default {
components: { fenceMap },
data() {
let checkSpecialShop = (rule, value, cb) => {
if (!this.form.specialShopName) {
cb(new Error('请选择特约店'))
cb(new Error("请选择特约店"));
} 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)) {
cb(new Error('请输入正确的格式'))
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 {
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)) {
cb(new Error('请输入正确的格式'))
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 {
cb();
}
}
};
let checkRadius = (rule, vaule, cb) => {
if (this.form.shapeType == 1 && !/^\d+$/.test(this.form.radius)) { console.log(this.form.radius)
cb(new Error('请输入正确的格式,不能输入小数点'))
if (this.form.shapeType == 1 && !/^\d+$/.test(this.form.radius)) {
console.log(this.form.radius);
cb(new Error("请输入正确的格式,不能输入小数点"));
} else {
cb();
}
}
};
let checkTransferAddr = (rule, vaule, cb) => {
if (this.form.shapeType == 1) {
if (this.transferError) {
cb(new Error('所填经纬度不能正确解析地址,请重新输入'));
cb(new Error("所填经纬度不能正确解析地址,请重新输入"));
} else {
cb();
}
} else {
cb()
cb();
}
}
};
return {
refresh: new Date().getTime(),
btn_size: 'small',
btn_size: "small",
configForm: {},
mapData: [],
submitting: false,
btnText: '保存',
restainFenceName: '',
btnText: "保存",
restainFenceName: "",
specialShopOptions: [],
specialShopDefaultProps: {
children: 'children',
label: 'label',
value: 'code',
children: "children",
label: "label",
value: "code",
},
readonlyStatus: false,
form: {
shopName: '',
shopCode: '',
shopLevel: '一级店',
fenceName: '',
lng: '',
lat: '',
shopName: "",
shopCode: "",
shopLevel: "一级店",
fenceName: "",
lng: "",
lat: "",
radius: 150,
bizFenceType: '12',
bizFenceType: "12",
shapeType: 1,
specialShopId: '',
specialShopName: '',
specialShopId: "",
specialShopName: "",
// fenceNo: '',
electricFenceType: 1,
startTime: '',
endTime: '',
des: '',
areaCode: '',
analysisAddress: '',
startTime: "",
endTime: "",
des: "",
areaCode: "",
analysisAddress: "",
status: 1,
transferError: false,
timeType: 2,
electricTimeFenceType: '',
electricTimeFenceType: "",
electricTimeFenceTypes: [
{
value: 1,
label: '1个月'
}, {
label: "1个月",
},
{
value: 2,
label: '2个月'
}, {
label: "2个月",
},
{
value: 3,
label: '3个月'
}, {
label: "3个月",
},
{
value: 4,
label: '4个月'
}, {
label: "4个月",
},
{
value: 5,
label: '5个月'
}, {
label: "5个月",
},
{
value: 6,
label: '6个月'
}
label: "6个月",
},
],
dateRange: [],
msgtel: ''
msgtel: "",
},
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' },
],
radius: [
{ validator: checkRadius, trigger: 'blur' }
],
lng: [
{ required: true, validator: checkLng, trigger: 'blur' }
],
lat: [
{ required: true, validator: checkLat, trigger: 'blur' }
],
analysisAddress: [
{ validator: checkTransferAddr, trigger: 'change' }
{ required: true, message: "请输入特约店线路名称", trigger: "blur" },
{ pattern: /^\S{2,200}$/, message: "至少2字", trigger: "blur" },
],
radius: [{ validator: checkRadius, trigger: "blur" }],
lng: [{ required: true, validator: checkLng, trigger: "blur" }],
lat: [{ required: true, validator: checkLat, trigger: "blur" }],
analysisAddress: [{ validator: checkTransferAddr, trigger: "change" }],
},
loading: true,
......@@ -318,24 +319,34 @@ export default {
filterText: "",
filterTextData: [],
isOpen: true,
shopNameId: '',
}
shopNameId: "",
};
},
created() {
this.getSpecialShopList();
//this.getSpecialShopList();
},
mounted() {
this.init();
},
watch: {
filterText(val) {
this._timeout && clearTimeout(this._timeout)
this._timeout = setTimeout(()=>{
this.$refs.tree.filter(val)
},500)
}
},
methods: {
selectStore() {
if (this.isReadonly) return;
this.filterText = "";
this.filterDialogTitle = "选择所属组织";
if(!this.filterTextData.length) {
if (!this.filterTextData.length) {
this.getStoreList();
}
//this.closeFilter();
},
closeFilter() {
......@@ -345,7 +356,7 @@ export default {
getStoreList() {
let _this = this;
_this.loading = true;
getOrgTree({hasUserLeaf: true}).then((res) => {
getOrgTree({ hasUserLeaf: true }).then((res) => {
const { code, data } = res;
_this.loading = false;
if (code == 200) {
......@@ -355,43 +366,44 @@ export default {
},
filterConfirm() {
const { label, id, origin } = this.$refs.tree.getCurrentNode();
if (origin.type != 'u') {
if (origin.type != "u") {
this.$message({
message: "请选择下级所属组织",
type: "error",
});
return;
}
this.form.specialShopName = label.split('/')[1]
this.form.specialShopCode = label.split('/')[0]
this.form.specialShopName = label.split("/")[1];
this.form.specialShopCode = label.split("/")[0];
//this.$set(this, "form.specialShopName", label);
this.form.specialShopId = id;
this.closeFilter();
},
filterNode(value, data) {
console.log(value, data);
this.loading = false
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
init() {
const { id, readonlyStatus } = this.$route.query;
this.readonlyStatus = readonlyStatus || false;
if (typeof id != 'undefined') {
if (typeof id != "undefined") {
this.getFenceDetail(id);
} else {
this.$refs.fenceMap.initFence({
fenceType: 'circle'
fenceType: "circle",
});
this.restainFenceName = undefined;
}
},
getSpecialShopList() {
getSpecialShopList().then(res => {
getSpecialShopList().then((res) => {
const { code, data } = res;
if (code == 200) {
this.specialShopOptions = data;
}
})
});
},
getFenceDetail(id) {
getFenceDetailById({ shopId: id }).then((res) => {
......@@ -402,12 +414,12 @@ export default {
return;
}
for (let key in data) {
form[key] = data[key]
form[key] = data[key];
}
this.form.shapeType = 1;
this.shopId = data.id;
this.form.dateRange = [form.startTime, form.endTime];
this.areaCode = form.areaCode
this.areaCode = form.areaCode;
this.restainFenceName = form.fenceName;
this.form.fenceName = form.fenceName;
this.form.msgtel = data.telNumbers;
......@@ -419,28 +431,28 @@ export default {
if (form.shapeType === 1) {
this.mapData = {
fenceType: 'circle',
fenceType: "circle",
lng: form.lng,
lat: form.lat,
radius: form.radius,
}
};
} else if (form.shapeType === 4) {
this.mapData = {
fenceType: 'area',
areaCode: this.form.areaCode
}
fenceType: "area",
areaCode: this.form.areaCode,
};
} else if (form.shapeType === 3) {
if (data.lnglat) {
this.polygonPath = data.lnglat.split('|').map((item) => {
return [item.split(',')[0], item.split(',')[1]]
})
this.polygonPath = data.lnglat.split("|").map((item) => {
return [item.split(",")[0], item.split(",")[1]];
});
}
console.log(this.polygonPath)
console.log(this.polygonPath);
this.mapData = {
fenceType: 'polygon',
polygonPath: this.polygonPath
}
fenceType: "polygon",
polygonPath: this.polygonPath,
};
}
this.$refs.fenceMap.initFence(this.mapData);
......@@ -454,11 +466,11 @@ export default {
if (data.lng && data.lat) {
this.form.lng = data.lng;
this.form.lat = data.lat;
this.transfer()
this.transfer();
}
if (data.polygonPath && data.polygonPath.length) {
this.polygonPath = data.polygonPath
this.polygonPath = data.polygonPath;
}
},
handleSpecialShopChange(val) {
......@@ -467,38 +479,40 @@ export default {
if (val && val.length > 1) {
this.$nextTick(() => {
this.refresh = new Date().getTime();
const thisNodes = this.$refs['specialShopCascader'].getCheckedNodes()[0];
const thisNodes = this.$refs[
"specialShopCascader"
].getCheckedNodes()[0];
if (thisNodes && thisNodes.data) {
const { data } = thisNodes;
this.form.specialShopId = data.id;
this.form.specialShopCode = data.code;
this.form.specialShopName = data.label;
}
})
});
}
},
updateFence() {
this.$refs.fenceMap.updateFence({
fenceType: 'circle',
fenceType: "circle",
lng: this.form.lng,
lat: this.form.lat,
radius: this.form.radius
radius: this.form.radius,
});
this.transfer()
this.transfer();
},
validateLngLat() {
let pass = true;
this.$refs.shopForm.validateField('lng', (error) => {
this.$refs.shopForm.validateField("lng", (error) => {
if (error) {
pass = false;
}
});
this.$refs.shopForm.validateField('lat', (error) => {
this.$refs.shopForm.validateField("lat", (error) => {
if (error) {
pass = false;
}
});
this.$refs.shopForm.validateField('radius', (error) => {
this.$refs.shopForm.validateField("radius", (error) => {
if (error) {
pass = false;
}
......@@ -518,25 +532,25 @@ export default {
});
} else {
this.getAddress(flag);
}
}, 500)
}, 500);
}
},
getAddress(flag) {
const lnglatXY = [this.form.lng, this.form.lat];
this.form.analysisAddress = ''
this.form.analysisAddress = "";
this.geocoder.getAddress(lnglatXY, (status, result) => {
if (flag == this.transferFlag) {
if (status === 'complete' && result.info === 'OK') {//获取地址成功
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.shopForm.validateField("analysisAddress");
//this.$refs.fenceMap.updateMap(this.form)
} else {
this.transferError = true;
this.$refs.shopForm.validateField('analysisAddress');
this.$refs.shopForm.validateField("analysisAddress");
}
}
});
......@@ -565,7 +579,7 @@ export default {
params.radius = form.radius;
params.address = form.analysisAddress;
} else if (form.shapeType == 3) {
params.lnglat = this.polygonPath.join('|')
params.lnglat = this.polygonPath.join("|");
}
// params.bizFenceType = form.bizFenceType
// params.status = form.status;
......@@ -587,23 +601,21 @@ export default {
// }
return params;
},
saveFence() {
if (this.form.shapeType == 3) {
if (this.polygonPath.length === 0) {
this.$message({
message: '请绘制线路',
type: 'error'
message: "请绘制线路",
type: "error",
});
return;
}
}
this.$refs.shopForm.validate((valid) => {
if (valid) {
this.submitting = true;
if (typeof this.shopId != 'undefined') {
if (typeof this.shopId != "undefined") {
const params = this.getParams();
params.id = this.shopId;
......@@ -611,14 +623,14 @@ export default {
if (res.code == 200) {
//this.closeDialog();
this.$message({
message: '提交成功',
type: 'success'
message: "提交成功",
type: "success",
});
history.go(-1)
history.go(-1);
} else {
this.$message({
message: res.message,
type: 'error'
type: "error",
});
}
this.submitting = false;
......@@ -628,31 +640,29 @@ export default {
if (res.code == 200) {
//this.closeDialog();
this.$message({
message: '提交成功',
type: 'success'
message: "提交成功",
type: "success",
});
history.go(-1)
history.go(-1);
} else {
this.$message({
message: res.message,
type: 'error'
type: "error",
});
}
this.submitting = false;
});
}
} else {
return false;
}
});
},
cancel() {
history.go(-1)
history.go(-1);
},
}
}
},
};
</script>
<style scoped>
......@@ -672,4 +682,4 @@ export default {
margin-left: 220px;
padding-right: 260px;
}
</style>
\ No newline at end of file
</style>
......@@ -407,8 +407,13 @@ export default {
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
this._timeout && clearTimeout(this._timeout)
this._timeout = setTimeout(()=>{
this.$refs.tree.filter(val)
},500)
}
},
mounted() {
this.getModels();
......
......@@ -195,7 +195,7 @@
class="choose-list-checkbox"
>
<div class="choose-list-content">
<p>{{ item.name }}/{{ item.vin }}</p>
<p>{{ item.ownerName }}/{{ item.vin }}</p>
<p class="choose-list-group">
<el-tag
type="info"
......@@ -218,7 +218,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="sure" size="small">确认</el-button>
<el-button @click="$emit('onUserListModalChange', false)" size="small"
<el-button @click="closeDialog" size="small"
>取消</el-button
>
</div>
......@@ -246,6 +246,9 @@ import {
listtestdrive,
getSpecialShopList,
} from "services/vehicle";
import {
getOrgTree,
} from "services/common";
export default {
props: ["userListModalVisible", "userData", "init"],
data() {
......@@ -374,7 +377,10 @@ export default {
}
},
filterText(val) {
this.$refs.tree.filter(val);
this._timeout && clearTimeout(this._timeout)
this._timeout = setTimeout(()=>{
this.$refs.tree.filter(val)
},500)
},
},
methods: {
......@@ -396,7 +402,7 @@ export default {
console.log(obj)
});
this.$emit("onUpdateUserData", userdata);
this.$emit("onUserListModalChange", false);
this.closeDialog()
this.checkedCancel = true
},
search() {
......@@ -641,7 +647,7 @@ export default {
getStoreList() {
let _this = this;
_this.loading = true;
getSpecialShopList().then((res) => {
getOrgTree({hasUserLeaf: true}).then((res) => {
const { code, data } = res;
_this.loading = false;
if (code == 200) {
......
......@@ -37,7 +37,7 @@
<el-col :span="20">
<el-row v-for="(item, index) in snForm.deviceArr" :key="index">
<i @click="removeDevice(index)" class="el-icon-remove-outline" style="position: absolute;font-size: 20px; margin-left:20px; line-height:30px;"></i>
<i v-show="!isViewMode" @click="removeDevice(index)" class="el-icon-remove-outline" style="position: absolute;font-size: 20px; margin-left:20px; line-height:30px;"></i>
<el-col :span="12">
<el-form-item
label="设备SN号"
......@@ -54,17 +54,17 @@
</el-row>
</el-col>
<el-col :span="4">
<i @click="addDevice" class="el-icon-circle-plus-outline" style="font-size: 20px; margin-left:20px; line-height:30px;"></i>
<i v-show="!isViewMode" @click="addDevice" class="el-icon-circle-plus-outline" style="font-size: 20px; margin-left:20px; line-height:30px;"></i>
</el-col>
</el-row>
</el-form>
<rule-form :ruleForm="vehicleForm" :rules="vehicleRules" :ruleData="vehicleData" :labelWidth="'140px'" ref='vehicleRuleForm'></rule-form>
<el-row>
<el-col :span="24">
<el-form label-width="120px" style="min-height:20px" v-loading="freqLoading" >
<el-form-item label="操作日志" v-show="freqTableData.length">
<table class="freq_table">
<tr>
<el-form label-width="120px">
<el-form-item label="操作日志" v-show="isViewMode">
<table class="freq_table" v-loading="freqLoading" style="min-height: 40px">
<tr v-show="freqTableData.length">
<th width="80">调频时间</th>
<th width="80">调频模式</th>
<th width="100">上点频次</th>
......@@ -89,6 +89,9 @@
</el-row>
</div>
</slot>
<!-- <template v-slot:btn-front>
<el-button type="primary" @click="gotoMonitor()" size="small">监控</el-button>
</template> -->
</basic-dialog>
<!-- 导入 -->
<basic-dialog :title="importTitle" :isVisible="vehicleImport" @confirmDialog="handleConfirm('import')" @closeDialog="handleClose('import')">
......@@ -231,11 +234,12 @@ export default {
value: '0'
}]
},
{
/* {
label: "设备状态",
type: 'select',
prop: 'deviceState',
placeholder: '请选择',
class: 'unvisible',
options: [{
label: '全部',
value: ''
......@@ -252,7 +256,7 @@ export default {
label: '在线',
value: '3'
}]
},
}, */
{
label: '激活时间',
type: 'daterange',
......@@ -722,12 +726,19 @@ export default {
vehicleListPromise: null,
isCreateMode: false,
freqLoading: false,
isViewMode: false,
};
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
this._timeout && clearTimeout(this._timeout)
this._timeout = setTimeout(()=>{
this.$refs.tree.filter(val)
},500)
}
},
created() {
this.vehicleListPromise = new Promise((resolve, reject)=>{
......@@ -780,6 +791,7 @@ export default {
this.isReadonly = false;
this.isCreateMode = true
this.freqLoading = false
this.isViewMode = false
this.vehicleListPromise.then(()=>{
if (this.vehicleVisible) {
let _list = _.cloneDeep(this.vehicleDefalutData);
......@@ -815,6 +827,7 @@ export default {
this.formLoading = true
this.isCreateMode = false
this.freqLoading = false
this.isViewMode = false
this.vehicleListPromise.then(()=>{
if (this.vehicleVisible) {
//let _list = this.vehicleDefalutData;
......@@ -824,10 +837,13 @@ export default {
getVehicleInfo({ id: scope.id }).then((res) => {
const { code, data } = res;
if (code == 200) {
//动态创建车系、车型选择框
let _list = this.creatSelect(data);
_list.map((k) => {console.log(k.prop)
if (k.prop === "vin" || k.prop == "organizationName") {
if (k.prop === "vin" || k.prop == "organizationName" || k.prop == "licensePlate") {
this.$set(k, "disabled", true);
}else{
if(k.prop == 'brandId') {
......@@ -838,12 +854,18 @@ export default {
});
this.vehicleData = _.cloneDeep(_list);
this.vehicleArr.forEach((item) => {
if (item == "serveType")
if (item == "serveType"){
this.$set(this.vehicleForm, item, data[item] + "");
else this.$set(this.vehicleForm, item, data[item]);
}else {
this.$set(this.vehicleForm, item, data[item]);
if(item == 'brandId') {
this.changeCarBrand(data.brandId, true)
}
}
});
this.vehicleForm.id = scope.id;
this.snForm.deviceArr = data.deviceInfoDtos.map((item, i)=>{
//this.snRules['device'+i] = this.snRules['device0']
......@@ -866,14 +888,17 @@ export default {
this.vehicleVisible = !this.vehicleVisible;
this.isReadonly = true;
this.isCreateMode = false
this.isViewMode = true
this.vehicleListPromise.then(()=>{
if (this.vehicleVisible) {
getVehicleInfo({ id: scope.id }).then((res) => {
const { code, data } = res;
if (code == 200) {
//动态创建车系、车型选择框
let _list = this.creatSelect(data);
_list.map((k) => {
this.$set(k, "disabled", true);
if(k.prop == 'brandId') {
......@@ -883,9 +908,14 @@ export default {
this.vehicleData = _.cloneDeep(_list);
this.vehicleArr.forEach((item) => {
if (item == "serveType")
if (item == "serveType"){
this.$set(this.vehicleForm, item, data[item] + "");
else this.$set(this.vehicleForm, item, data[item]);
}else {
this.$set(this.vehicleForm, item, data[item]);
if(item == 'brandId') {
this.changeCarBrand(data.brandId, 'view')
}
}
});
this.snForm.deviceArr = data.deviceInfoDtos.map((item, i)=>{
......@@ -1249,7 +1279,7 @@ export default {
},
// 监听车型选择
changeCarBrand(e) {
changeCarBrand(e, flag) {
let list = this.vehicleDefalutData;
let m = this.vehicleList;
let o = m.find((k) => k.id == e);
......@@ -1274,8 +1304,35 @@ export default {
} else {
list.splice(idx + 1, 0, n);
}
if(flag) {
let row = list.find((item)=>item.prop === 'seriesId')
setTimeout(()=>{
let id = this.vehicleForm.typeId
this.changeCarModel(this.vehicleForm.seriesId, row)
this.vehicleForm.typeId = id
},500)
}
list.map((k) => {
if(flag == 'view') {
this.$set(k, "disabled", true);
}else if(!this.isCreateMode){
if (k.prop === "vin" || k.prop == "organizationName" || k.prop == "licensePlate") {
this.$set(k, "disabled", true);
}else{
this.$set(k, "disabled", false);
}
}else{
this.$set(k, "disabled", false);
}
});
this.$set(this, "vehicleDefalutData", list);
this.vehicleData = _.cloneDeep(list);
delete this.vehicleForm.seriesId;
delete this.vehicleForm.typeId;
},
......@@ -1315,13 +1372,24 @@ export default {
} else {
list.splice(idx + 1, 0, n);
}
list.map((k) => {
if(k.prop === 'typeId') {
if(this.isViewMode){
this.$set(k, 'disabled', true)
}else{
this.$set(k, 'disabled', false)
}
}
});
this.$set(this, "vehicleDefalutData", list);
this.vehicleData = _.cloneDeep(list);
delete this.vehicleForm.typeId;
},
// 动态创建选择框
creatSelect(data) {
creatSelect(data) {console.log(data)
let nList = this.vehicleList;
let _list = _.cloneDeep(this.vehicleDefalutData);
//动态创建车系、车型选择框
......@@ -1381,6 +1449,9 @@ export default {
} else {
_list.splice(idx + 2, 0, _models);
}
//this.changeCarBrand(data.brandId)
//this.changeCarModel(data.seriesId, _series)
}
return _list;
......@@ -1405,6 +1476,21 @@ export default {
FreqModalChange(isOpen){
this.freqVisible = isOpen;
},
gotoMonitor() {
console.log(this.vehicleForm)
/* let snO = {
name: this.vehicleForm.name,
standNo: this.vehicleForm.vin,
sn: this.vehicleForm.trackInfo.sn,
sourceType: this.vehicleForm.trackInfo.source === 0?'无线':'有线',
source: this.vehicleForm.trackInfo.source
}
//this.$router.push({ name: 'monitor', params: { snArr: [snO], mode: 'monitor' }})
let routeData = this.$router.resolve({ path: 'oEshield#/monitor/monitor', query: { snArr: JSON.stringify([snO]), mode: 'monitor' }});
// window.open(routeData.href, '_blank');
location.href = routeData.href */
}
},
components: {
......@@ -1442,4 +1528,7 @@ export default {
padding: 2px;
text-align: center;
}
.unvisible{
visibility: hidden;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!