Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-trialrun
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9821da44
authored
Feb 28, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
58a15a4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
363 additions
and
358 deletions
src/views/vehicleManage/vehicleList copy.vue
src/views/vehicleManage/vehicleList.vue
src/views/vehicleManage/vehicleList copy.vue
View file @
9821da4
...
...
@@ -19,7 +19,7 @@
<el-button
v-for=
"(j, idx) in vehicleTableParams.tableOption.btnList"
:key=
"idx"
:type=
"j.type || 'text'"
size=
"mini"
plain
@
click=
"btnClick(j.pType, scope.scope)"
>
{{j.name}}
</el-button>
<el-button
v-if=
"scope.scope.sns"
type=
"text"
size=
"mini"
@
click=
"btnClick('unbind', scope.scope)"
>
解绑
</el-button>
<!-- <el-button v-if="scope.scope.adjFreq === 1" type="text" size="mini" @click="btnClick('freq', scope.scope)">一键调频</el-button> -->
<el-dropdown
v-if=
"scope.scope.adjFreq"
@
command=
"handleCommand"
style=
"margin-left:5px"
>
<el-dropdown
v-if=
"scope.scope.adjFreq"
@
command=
"handleCommand"
style=
"margin-left:5px"
>
<el-button
size=
"mini"
>
<i
class=
"el-icon-arrow-down"
></i>
</el-button>
...
...
@@ -32,22 +32,19 @@
<basic-dialog
width=
"800px"
:title=
"vehicleTitle"
:isVisible=
"vehicleVisible"
:hasOk=
"vehicleHasOk"
@
confirmDialog=
"handleConfirm('create')"
@
closeDialog=
"handleClose('create')"
>
<slot>
<div
v-loading=
"formLoading"
>
<el-form
ref=
"snForm"
:model=
"snForm"
:rules=
"snRules"
:inline=
"false"
size=
"mini"
label-width=
"140px"
>
<el-form
ref=
"snForm"
:model=
"snForm"
:rules=
"snRules"
:inline=
"false"
size=
"mini"
label-width=
"140px"
>
<el-row>
<el-col
:span=
"20"
>
<el-row
v-for=
"(item, index) in snForm.deviceArr"
:key=
"index"
>
<!-- <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号"
class=
"is-required"
:prop=
"'device'+index"
>
<el-input
v-model=
"item.sn"
:disabled=
"item.disabled"
></el-input>
<el-form-item
label=
"设备SN号"
class=
"is-required"
:prop=
"'device'+index"
>
<el-input
v-model=
"item.sn"
:disabled=
"item.disabled"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"设备型号:"
>
<el-input
disabled
v-model=
"item.deviceType"
></el-input>
<el-input
disabled
v-model=
"item.deviceType"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -61,8 +58,8 @@
<el-row>
<el-col
:span=
"24"
>
<el-form
label-width=
"120px"
>
<el-form-item
label=
"操作日志"
v-show=
"isViewMode"
>
<table
class=
"freq_table"
v-loading=
"freqLoading"
style=
"min-height: 40px"
>
<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>
...
...
@@ -136,7 +133,7 @@ import axios from "axios";
import
{
dictInfo
}
from
"services/common"
;
import
{
VEHICLE_API
}
from
"@/config/config"
;
import
store
from
"@/store"
;
import
freqModal
from
'./freqModal'
import
freqModal
from
"./freqModal"
;
import
{
getVehicleList
,
getSpecialShopList
,
...
...
@@ -157,14 +154,12 @@ import {
deleteNewVehicle
,
getAdjFreqInfo
,
}
from
"services/vehicle"
;
import
{
getOrgTree
,
}
from
"services/common"
;
import
{
getOrgTree
}
from
"services/common"
;
export
default
{
data
()
{
const
_this
=
this
const
_this
=
this
;
let
checkShopName
=
(
rule
,
vaule
,
cb
)
=>
{
console
.
log
(
this
.
vehicleForm
)
console
.
log
(
this
.
vehicleForm
)
;
if
(
this
.
vehicleForm
.
organizationName
==
""
)
{
cb
(
new
Error
(
"请选择所属组织"
));
}
else
{
...
...
@@ -172,39 +167,35 @@ export default {
}
};
let
checkDevice
=
(
rule
,
value
,
cb
)
=>
{
if
(
rule
.
field
)
{
let
i
=
rule
.
field
.
split
(
'device'
)[
1
]
let
sn
=
this
.
snForm
.
deviceArr
[
i
].
sn
if
(
this
.
snForm
.
deviceArr
[
i
].
disabled
)
return
cb
()
if
(
rule
.
field
)
{
let
i
=
rule
.
field
.
split
(
"device"
)[
1
];
let
sn
=
this
.
snForm
.
deviceArr
[
i
].
sn
;
if
(
this
.
snForm
.
deviceArr
[
i
].
disabled
)
return
cb
();
if
(
sn
==
""
)
{
cb
(
new
Error
(
"请输入设备号"
));
}
if
(
sn
)
{
if
(
sn
)
{
//this._timeoutId && clearTimeout(this._timeoutId)
//this._timeoutId = setTimeout(()=>{
verifydevice
({
sn
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
checkSn
({
sn
}).
then
((
res
)
=>
{
if
(
res
.
data
)
{
this
.
snForm
.
deviceArr
[
i
].
deviceType
=
res
.
data
}
})
cb
()
}
else
{
cb
(
new
Error
(
res
.
message
))
}
})
verifydevice
({
sn
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
checkSn
({
sn
}).
then
((
res
)
=>
{
if
(
res
.
data
)
{
this
.
snForm
.
deviceArr
[
i
].
deviceType
=
res
.
data
;
}
});
cb
();
}
else
{
cb
(
new
Error
(
res
.
message
));
}
});
//}, 500)
}
else
{
cb
()
cb
()
;
}
//cb();
//cb();
}
};
return
{
searchForm
:
{},
...
...
@@ -214,24 +205,28 @@ export default {
type
:
"input"
,
inputType
:
"text"
,
prop
:
"keywords"
,
width
:
'360'
,
width
:
"360"
,
placeholder
:
"车主姓名|车架号|设备号|车型"
,
},
{
label
:
"设备类型"
,
type
:
'select'
,
prop
:
'deviceType'
,
placeholder
:
'请选择'
,
options
:
[{
label
:
'全部'
,
value
:
''
},
{
label
:
'有线'
,
value
:
'1'
},
{
label
:
'无线'
,
value
:
'0'
}]
type
:
"select"
,
prop
:
"deviceType"
,
placeholder
:
"请选择"
,
options
:
[
{
label
:
"全部"
,
value
:
""
,
},
{
label
:
"有线"
,
value
:
"1"
,
},
{
label
:
"无线"
,
value
:
"0"
,
},
],
},
/* {
label: "设备状态",
...
...
@@ -257,61 +252,73 @@ export default {
}]
}, */
{
label
:
'激活时间'
,
type
:
'daterange'
,
dateType
:
'day'
,
prop
:
'date'
,
placeholder
:
'请选择年月'
,
selectStyle
:
'width:360px'
,
label
:
"激活时间"
,
type
:
"daterange"
,
dateType
:
"day"
,
prop
:
"date"
,
placeholder
:
"请选择年月"
,
selectStyle
:
"width:360px"
,
pickerOptions
:
{
disabledDate
(
time
)
{
return
time
.
getTime
()
<
new
Date
(
_this
.
date
).
getTime
()
}
}
return
time
.
getTime
()
<
new
Date
(
_this
.
date
).
getTime
()
;
}
,
}
,
},
{
label
:
"车辆标签"
,
type
:
'select'
,
prop
:
'vehicleType'
,
placeholder
:
'请选择'
,
options
:
[{
label
:
'全部'
,
value
:
''
},
{
label
:
'试驶车 '
,
value
:
'1'
},
{
label
:
'服务车'
,
value
:
'3'
},
{
label
:
'代步车'
,
value
:
'4'
},
{
label
:
'救援车'
,
value
:
'5'
},
{
label
:
'办公车'
,
value
:
'6'
},
{
label
:
'其他'
,
value
:
'7'
}]
type
:
"select"
,
prop
:
"vehicleType"
,
placeholder
:
"请选择"
,
options
:
[
{
label
:
"全部"
,
value
:
""
,
},
{
label
:
"试驶车 "
,
value
:
"1"
,
},
{
label
:
"服务车"
,
value
:
"3"
,
},
{
label
:
"代步车"
,
value
:
"4"
,
},
{
label
:
"救援车"
,
value
:
"5"
,
},
{
label
:
"办公车"
,
value
:
"6"
,
},
{
label
:
"其他"
,
value
:
"7"
,
},
],
},
{
label
:
"车辆用途"
,
type
:
'select'
,
prop
:
'vehicleUsages'
,
placeholder
:
'请选择'
,
options
:
[{
label
:
'全部'
,
value
:
''
},
{
label
:
'专属用途'
,
value
:
'1'
},
{
label
:
'非专属用途'
,
value
:
'2'
}]
type
:
"select"
,
prop
:
"vehicleUsages"
,
placeholder
:
"请选择"
,
options
:
[
{
label
:
"全部"
,
value
:
""
,
},
{
label
:
"专属用途"
,
value
:
"1"
,
},
{
label
:
"非专属用途"
,
value
:
"2"
,
},
],
},
],
vehicleTableParams
:
{
...
...
@@ -321,7 +328,6 @@ export default {
{
label
:
"车主姓名"
,
prop
:
"ownerName"
,
},
{
label
:
"车架号"
,
...
...
@@ -366,7 +372,6 @@ export default {
prop
:
"specialState"
,
width
:
110
,
},
],
tableOption
:
{
width
:
170
,
...
...
@@ -384,7 +389,7 @@ export default {
pType
:
"view"
,
},
],
align
:
'left'
,
align
:
"left"
,
},
},
getListApi
:
getVehicleList
,
...
...
@@ -432,7 +437,7 @@ export default {
"brandId"
,
"seriesId"
,
"typeId"
,
"remark"
"remark"
,
],
vehicleData
:
[
{
...
...
@@ -662,7 +667,12 @@ export default {
],
vehicleRules
:
{
ownerName
:
[
{
min
:
2
,
max
:
50
,
message
:
'长度在 2 到 50 个字符'
,
trigger
:
'blur'
},
{
min
:
2
,
max
:
50
,
message
:
"长度在 2 到 50 个字符"
,
trigger
:
"blur"
,
},
//{validator: this.$Common.checkName, trigger: "blur"}
],
organizationName
:
[
...
...
@@ -704,21 +714,19 @@ export default {
vehicleList
:
[],
loading
:
false
,
snForm
:
{
deviceArr
:
[{
sn
:
''
,
deviceType
:
''
}],
deviceArr
:
[
{
sn
:
""
,
deviceType
:
""
,
},
],
},
snRules
:
{
device0
:
[
{
validator
:
checkDevice
}
],
device0
:
[{
validator
:
checkDevice
}],
},
freqVisible
:
false
,
freqSn
:
''
,
frequencyForm
:
{
},
freqSn
:
""
,
frequencyForm
:
{},
enableFreq
:
false
,
freqTableData
:
[],
formLoading
:
true
,
...
...
@@ -733,22 +741,18 @@ export default {
},
watch
:
{
filterText
(
val
)
{
this
.
_timeout
&&
clearTimeout
(
this
.
_timeout
)
this
.
_timeout
=
setTimeout
(()
=>
{
this
.
$refs
.
tree
.
filter
(
val
)
},
500
)
}
this
.
_timeout
&&
clearTimeout
(
this
.
_timeout
);
this
.
_timeout
=
setTimeout
(()
=>
{
this
.
$refs
.
tree
.
filter
(
val
);
},
500
);
},
},
created
()
{
this
.
vehicleListPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
this
.
vehicleListPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
this
.
getModels
(
resolve
);
})
})
;
},
mounted
()
{
/* dictInfo("trialdrive_vehicle_model").then((res) => {
this.vehicleData.find((item) => item.prop == "modelId").options =
res.data;
...
...
@@ -766,14 +770,14 @@ export default {
methods
:
{
beforeSearchFn
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
this
.
searchForm
.
date
)
if
(
this
.
searchForm
.
date
)
{
this
.
searchForm
.
activateTimeStart
=
this
.
searchForm
.
date
[
0
]
this
.
searchForm
.
activateTimeEnd
=
this
.
searchForm
.
date
[
1
]
console
.
log
(
this
.
searchForm
.
date
)
;
if
(
this
.
searchForm
.
date
)
{
this
.
searchForm
.
activateTimeStart
=
this
.
searchForm
.
date
[
0
]
;
this
.
searchForm
.
activateTimeEnd
=
this
.
searchForm
.
date
[
1
]
;
}
resolve
()
})
resolve
()
;
})
;
},
tableDataFinished
()
{
this
.
$nextTick
(()
=>
{
...
...
@@ -787,25 +791,24 @@ export default {
btnClick
(
pType
,
scope
)
{
switch
(
pType
)
{
case
"create"
:
this
.
formLoading
=
true
this
.
formLoading
=
true
;
this
.
vehicleVisible
=
!
this
.
vehicleVisible
;
this
.
isReadonly
=
false
;
this
.
isCreateMode
=
true
this
.
freqLoading
=
false
this
.
isViewMode
=
false
this
.
vehicleListPromise
.
then
(()
=>
{
this
.
isCreateMode
=
true
;
this
.
freqLoading
=
false
;
this
.
isViewMode
=
false
;
this
.
vehicleListPromise
.
then
(()
=>
{
if
(
this
.
vehicleVisible
)
{
let
_list
=
_
.
cloneDeep
(
this
.
vehicleDefalutData
);
let
_arr
=
[];
_list
.
map
((
k
)
=>
{
this
.
$set
(
k
,
"disabled"
,
false
);
if
(
k
.
prop
==
'brandId'
)
{
if
(
k
.
prop
==
"brandId"
)
{
this
.
$set
(
k
,
"loading"
,
false
);
}
if
(
k
.
prop
!=
"seriesId"
&&
k
.
prop
!=
"typeId"
)
{
_arr
.
push
(
k
);
}
});
this
.
vehicleTitle
=
"新增车辆"
;
this
.
vehicleHasOk
=
true
;
...
...
@@ -815,119 +818,115 @@ export default {
if
(
this
.
$refs
.
vehicleRuleForm
)
this
.
$refs
.
vehicleRuleForm
.
$children
[
0
].
clearValidate
();
this
.
snForm
.
deviceArr
=
[{
sn
:
''
,
deviceType
:
''
}]
this
.
snForm
.
deviceArr
=
[{
sn
:
""
,
deviceType
:
""
}];
this
.
$refs
.
snForm
&&
this
.
$refs
.
snForm
.
clearValidate
();
this
.
freqTableData
=
[]
this
.
formLoading
=
false
})
this
.
freqTableData
=
[]
;
this
.
formLoading
=
false
;
})
;
break
;
case
"edit"
:
this
.
vehicleVisible
=
!
this
.
vehicleVisible
;
this
.
isReadonly
=
false
;
this
.
formLoading
=
true
this
.
isCreateMode
=
false
this
.
freqLoading
=
false
this
.
isViewMode
=
false
this
.
vehicleListPromise
.
then
(()
=>
{
this
.
formLoading
=
true
;
this
.
isCreateMode
=
false
;
this
.
freqLoading
=
false
;
this
.
isViewMode
=
false
;
this
.
vehicleListPromise
.
then
(()
=>
{
if
(
this
.
vehicleVisible
)
{
//let _list = this.vehicleDefalutData;
this
.
vehicleTitle
=
"编辑车辆"
;
this
.
vehicleHasOk
=
true
;
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
)
_list
.
map
((
k
)
=>
{
console
.
log
(
k
.
prop
);
if
(
k
.
prop
===
"vin"
||
k
.
prop
==
"organizationName"
)
{
this
.
$set
(
k
,
"disabled"
,
true
);
}
else
{
if
(
k
.
prop
==
'brandId'
)
{
}
else
{
if
(
k
.
prop
==
"brandId"
)
{
this
.
$set
(
k
,
"loading"
,
false
);
}
this
.
$set
(
k
,
"disabled"
,
false
);
}
});
this
.
vehicleData
=
_
.
cloneDeep
(
_list
);
this
.
vehicleArr
.
forEach
((
item
)
=>
{
if
(
item
==
"serveType"
){
if
(
item
==
"serveType"
)
{
this
.
$set
(
this
.
vehicleForm
,
item
,
data
[
item
]
+
""
);
}
else
{
}
else
{
this
.
$set
(
this
.
vehicleForm
,
item
,
data
[
item
]);
if
(
item
==
'brandId'
)
{
this
.
changeCarBrand
(
data
.
brandId
,
true
)
if
(
item
==
"brandId"
)
{
this
.
changeCarBrand
(
data
.
brandId
,
true
)
;
}
}
});
this
.
vehicleForm
.
id
=
scope
.
id
;
this
.
snForm
.
deviceArr
=
data
.
deviceInfoDtos
.
map
((
item
,
i
)
=>
{
this
.
snForm
.
deviceArr
=
data
.
deviceInfoDtos
.
map
((
item
,
i
)
=>
{
//this.snRules['device'+i] = this.snRules['device0']
return
{
sn
:
item
.
sn
,
deviceType
:
item
.
deviceClassifyName
,
disabled
:
true
,
}
})
this
.
formLoading
=
false
}
;
})
;
this
.
formLoading
=
false
;
}
});
this
.
freqTableData
=
[]
this
.
freqTableData
=
[]
;
}
})
})
;
break
;
case
"view"
:
console
.
log
(
"view"
);
this
.
formLoading
=
true
this
.
formLoading
=
true
;
this
.
vehicleVisible
=
!
this
.
vehicleVisible
;
this
.
isReadonly
=
true
;
this
.
isCreateMode
=
false
this
.
isViewMode
=
true
this
.
vehicleListPromise
.
then
(()
=>
{
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'
)
{
if
(
k
.
prop
==
"brandId"
)
{
this
.
$set
(
k
,
"loading"
,
false
);
}
});
this
.
vehicleData
=
_
.
cloneDeep
(
_list
);
this
.
vehicleArr
.
forEach
((
item
)
=>
{
if
(
item
==
"serveType"
){
if
(
item
==
"serveType"
)
{
this
.
$set
(
this
.
vehicleForm
,
item
,
data
[
item
]
+
""
);
}
else
{
}
else
{
this
.
$set
(
this
.
vehicleForm
,
item
,
data
[
item
]);
if
(
item
==
'brandId'
)
{
this
.
changeCarBrand
(
data
.
brandId
,
'view'
)
if
(
item
==
"brandId"
)
{
this
.
changeCarBrand
(
data
.
brandId
,
"view"
);
}
}
});
this
.
snForm
.
deviceArr
=
data
.
deviceInfoDtos
.
map
((
item
,
i
)
=>
{
this
.
snForm
.
deviceArr
=
data
.
deviceInfoDtos
.
map
((
item
,
i
)
=>
{
//this.snRules['device'+i] = this.snRules['device0']
return
{
sn
:
item
.
sn
,
deviceType
:
item
.
deviceClassifyName
,
disabled
:
true
}
})
this
.
formLoading
=
false
disabled
:
true
,
}
;
})
;
this
.
formLoading
=
false
;
}
});
this
.
vehicleTitle
=
"查看车辆"
;
...
...
@@ -936,16 +935,16 @@ export default {
// if (item.type == 'input') this.$set(item, 'readonly', true)
// else this.$set(item, 'disabled', true)
// })
this
.
freqTableData
=
[]
this
.
freqLoading
=
true
this
.
freqTableData
=
[]
;
this
.
freqLoading
=
true
;
getAdjFreqInfo
({
sn
:
scope
.
sn
sn
:
scope
.
sn
,
}).
then
((
res
)
=>
{
this
.
freqTableData
=
res
.
data
this
.
freqLoading
=
false
})
this
.
freqTableData
=
res
.
data
;
this
.
freqLoading
=
false
;
})
;
}
})
})
;
break
;
case
"delete"
:
this
.
$confirm
(
"是否要删除?"
,
"提示"
,
{
...
...
@@ -953,10 +952,10 @@ export default {
cancelButtonText
:
"取消"
,
type
:
"warning"
,
}).
then
(()
=>
{
deleteNewVehicle
({
deleteNewVehicle
({
vdId
:
scope
.
vdId
,
//sn: scope.sn
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
{
code
,
message
}
=
res
;
if
(
code
==
200
)
{
this
.
$message
({
...
...
@@ -1008,66 +1007,65 @@ export default {
url
:
`
${
store
.
state
.
baseURL
}
/trialdrive/vehicle/vehicleinfo/export`
,
method
:
"GET"
,
data
:
this
.
searchForm
,
fileName
:
'车辆列表'
+
moment
().
format
(
'YYYY.MM.DD'
)
+
'.xls'
fileName
:
"车辆列表"
+
moment
().
format
(
"YYYY.MM.DD"
)
+
".xls"
,
});
break
;
case
"freq"
:
this
.
freqSn
=
scope
.
sn
;
this
.
freqVisible
=
true
;
this
.
freqVisible
=
true
;
break
;
}
},
handleCommand
(
command
){
if
(
command
.
indexOf
(
'freq'
)
>-
1
)
{
this
.
freqSn
=
command
.
split
(
'freq'
)[
1
];
this
.
freqVisible
=
true
;
}
},
getCommand
(
type
,
val
,
enable
)
{
if
(
type
===
'freq'
)
{
this
.
enableFreq
=
enable
===
'true'
?
true
:
false
}
return
type
+
val
},
handleCommand
(
command
)
{
if
(
command
.
indexOf
(
"freq"
)
>
-
1
)
{
this
.
freqSn
=
command
.
split
(
"freq"
)[
1
];
this
.
freqVisible
=
true
;
}
},
getCommand
(
type
,
val
,
enable
)
{
if
(
type
===
"freq"
)
{
this
.
enableFreq
=
enable
===
"true"
?
true
:
false
;
}
return
type
+
val
;
},
// 弹框确定按钮方法
handleConfirm
(
type
)
{
switch
(
type
)
{
case
"create"
:
//console.log(this.vehicleForm, this.vehicleData);
Promise
.
all
([
this
.
formPromise
(),
this
.
snPromise
()]).
then
((
arr
)
=>
{
Promise
.
all
([
this
.
formPromise
(),
this
.
snPromise
()]).
then
((
arr
)
=>
{
let
params
=
arr
[
0
];
params
.
deviceInfoDtos
=
arr
[
1
]
console
.
log
(
arr
)
params
.
deviceInfoDtos
=
arr
[
1
]
;
console
.
log
(
arr
)
;
let
api
=
addNewVehicle
;
if
(
params
.
id
)
api
=
updateNewVehicle
;
api
(
params
).
then
((
res
)
=>
{
const
{
code
,
message
}
=
res
;
if
(
code
==
200
)
{
this
.
$message
({
message
:
"操作成功"
,
type
:
"success"
,
});
this
.
vehicleVisible
=
!
this
.
vehicleVisible
;
this
.
$refs
.
vehicleForm
.
refreshTable
();
}
else
{
this
.
$message
({
message
:
message
,
type
:
"error"
,
});
}
});
})
return
if
(
params
.
id
)
api
=
updateNewVehicle
;
api
(
params
).
then
((
res
)
=>
{
const
{
code
,
message
}
=
res
;
if
(
code
==
200
)
{
this
.
$message
({
message
:
"操作成功"
,
type
:
"success"
,
});
this
.
vehicleVisible
=
!
this
.
vehicleVisible
;
this
.
$refs
.
vehicleForm
.
refreshTable
();
}
else
{
this
.
$message
({
message
:
message
,
type
:
"error"
,
});
}
});
})
;
return
;
this
.
$refs
.
vehicleRuleForm
.
$children
[
0
].
validate
((
valid
)
=>
{
//console.log(valid, this.$refs.vehicleRuleForm);
if
(
valid
)
{
let
params
=
_
.
cloneDeep
(
this
.
vehicleForm
);
//const { typeId, configId } = params;
// let _list = this.vehicleData.find(
// (item) => item.prop == "typeId"
...
...
@@ -1081,15 +1079,15 @@ export default {
// .find((item) => item.prop == "configId")
// .options.find((j) => j.id == configId).dictLabel;
params
.
organizationId
=
params
.
organizationId
params
.
modelId
=
params
.
typeId
params
.
organizationId
=
params
.
organizationId
;
params
.
modelId
=
params
.
typeId
;
delete
params
.
brandId
;
delete
params
.
seriesId
;
delete
params
.
organizationId
;
delete
params
.
organizationName
;
delete
params
.
typeId
;
console
.
log
(
params
)
console
.
log
(
params
)
;
return
;
let
api
=
addVehicle
;
if
(
params
.
id
)
api
=
editVehicle
;
...
...
@@ -1114,10 +1112,10 @@ export default {
break
;
case
"import"
:
console
.
log
(
this
.
importForm
.
file
);
if
(
this
.
importing
)
return
if
(
this
.
importing
)
return
;
var
data
=
new
FormData
();
data
.
append
(
"file"
,
this
.
importForm
.
file
);
this
.
importing
=
true
this
.
importing
=
true
;
axios
({
headers
:
{
"Content-Type"
:
"multipart/form-data"
,
...
...
@@ -1128,7 +1126,7 @@ export default {
data
,
}).
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
importing
=
false
this
.
importing
=
false
;
if
(
res
.
data
.
code
==
200
)
{
this
.
exportData
=
res
.
data
.
data
;
}
else
{
...
...
@@ -1142,55 +1140,55 @@ export default {
}
},
formPromise
()
{
return
new
Promise
((
resovle
,
reject
)
=>
{
return
new
Promise
((
resovle
,
reject
)
=>
{
this
.
$refs
.
vehicleRuleForm
.
$children
[
0
].
validate
((
valid
)
=>
{
//console.log(valid, this.$refs.vehicleRuleForm);
//console.log(valid, this.$refs.vehicleRuleForm);
if
(
valid
)
{
let
params
=
_
.
cloneDeep
(
this
.
vehicleForm
);
//const { typeId, configId } = params;
// let _list = this.vehicleData.find(
// (item) => item.prop == "typeId"
// ).options;
// let o = _list.find((j) => j.id == typeId);
// if (o) {
// params.modelName = o.name;
// }
// else params.modelName = modelId
// params.configDesc = this.vehicleData
// .find((item) => item.prop == "configId")
// .options.find((j) => j.id == configId).dictLabel;
if
(
valid
)
{
let
params
=
_
.
cloneDeep
(
this
.
vehicleForm
);
//const { typeId, configId } = params;
// let _list = this.vehicleData.find(
// (item) => item.prop == "typeId"
// ).options;
// let o = _list.find((j) => j.id == typeId);
// if (o) {
// params.modelName = o.name;
// }
// else params.modelName = modelId
// params.configDesc = this.vehicleData
// .find((item) => item.prop == "configId")
// .options.find((j) => j.id == configId).dictLabel;
params
.
modelId
=
params
.
typeId
/* delete params.brandId;
params
.
modelId
=
params
.
typeId
;
/* delete params.brandId;
delete params.seriesId;
delete params.organizationId;
delete params.organizationName;
delete params.typeId; */
resovle
(
params
)
}
})
})
resovle
(
params
);
}
});
});
},
snPromise
()
{
return
new
Promise
((
resovle
,
reject
)
=>
{
return
new
Promise
((
resovle
,
reject
)
=>
{
this
.
$refs
.
snForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
resovle
(
this
.
snForm
.
deviceArr
.
filter
(
item
=>
item
.
sn
).
map
((
item
)
=>
{
return
{
sn
:
item
.
sn
,
deviceClassifyName
:
item
.
deviceType
}
}))
resovle
(
this
.
snForm
.
deviceArr
.
filter
((
item
)
=>
item
.
sn
)
.
map
((
item
)
=>
{
return
{
sn
:
item
.
sn
,
deviceClassifyName
:
item
.
deviceType
,
};
})
);
}
})
})
})
;
})
;
},
handleClose
(
type
)
{
this
.
btnClick
(
type
);
...
...
@@ -1211,7 +1209,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
)
{
...
...
@@ -1221,7 +1219,7 @@ export default {
},
filterConfirm
()
{
const
{
label
,
id
,
origin
}
=
this
.
$refs
.
tree
.
getCurrentNode
();
if
(
origin
.
type
!==
'u'
)
{
if
(
origin
.
type
!==
"u"
)
{
this
.
$message
({
message
:
"请选择下级所属组织"
,
type
:
"error"
,
...
...
@@ -1230,7 +1228,7 @@ export default {
}
this
.
$set
(
this
.
vehicleForm
,
"organizationName"
,
label
);
this
.
vehicleForm
.
organizationId
=
id
;
this
.
$refs
.
vehicleRuleForm
.
$children
[
0
].
validateField
(
'organizationName'
)
this
.
$refs
.
vehicleRuleForm
.
$children
[
0
].
validateField
(
"organizationName"
);
this
.
closeFilter
();
},
filterNode
(
value
,
data
)
{
...
...
@@ -1279,10 +1277,10 @@ export default {
let
o
=
_this
.
vehicleDefalutData
;
let
m
=
o
.
find
((
k
)
=>
k
.
prop
==
"brandId"
);
m
.
options
=
_list
;
m
.
loading
=
false
m
.
loading
=
false
;
_this
.
vehicleList
=
_list
;
this
.
vehicleListInit
=
true
resolve
()
this
.
vehicleListInit
=
true
;
resolve
()
;
});
},
...
...
@@ -1312,32 +1310,29 @@ 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
)
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'
)
{
if
(
flag
==
"view"
)
{
this
.
$set
(
k
,
"disabled"
,
true
);
}
else
if
(
!
this
.
isCreateMode
)
{
}
else
if
(
!
this
.
isCreateMode
)
{
if
(
k
.
prop
===
"vin"
||
k
.
prop
==
"organizationName"
)
{
this
.
$set
(
k
,
"disabled"
,
true
);
}
else
{
}
else
{
this
.
$set
(
k
,
"disabled"
,
false
);
}
}
else
{
}
else
{
this
.
$set
(
k
,
"disabled"
,
false
);
}
});
this
.
$set
(
this
,
"vehicleDefalutData"
,
list
);
this
.
vehicleData
=
_
.
cloneDeep
(
list
);
...
...
@@ -1382,11 +1377,11 @@ export default {
}
list
.
map
((
k
)
=>
{
if
(
k
.
prop
===
'typeId'
)
{
if
(
this
.
isViewMode
)
{
this
.
$set
(
k
,
'disabled'
,
true
)
}
else
{
this
.
$set
(
k
,
'disabled'
,
false
)
if
(
k
.
prop
===
"typeId"
)
{
if
(
this
.
isViewMode
)
{
this
.
$set
(
k
,
"disabled"
,
true
);
}
else
{
this
.
$set
(
k
,
"disabled"
,
false
);
}
}
});
...
...
@@ -1397,7 +1392,8 @@ export default {
},
// 动态创建选择框
creatSelect
(
data
)
{
console
.
log
(
data
)
creatSelect
(
data
)
{
console
.
log
(
data
);
let
nList
=
this
.
vehicleList
;
let
_list
=
_
.
cloneDeep
(
this
.
vehicleDefalutData
);
//动态创建车系、车型选择框
...
...
@@ -1464,28 +1460,29 @@ export default {
return
_list
;
},
addDevice
(){
if
(
this
.
snForm
.
deviceArr
.
length
===
9
)
return
this
.
snForm
.
deviceArr
.
push
({
sn
:
''
,
deviceType
:
''
})
this
.
snRules
[
'device'
+
(
this
.
snForm
.
deviceArr
.
length
-
1
)]
=
this
.
snRules
.
device0
},
addDevice
()
{
if
(
this
.
snForm
.
deviceArr
.
length
===
9
)
return
;
this
.
snForm
.
deviceArr
.
push
({
sn
:
""
,
deviceType
:
""
,
});
this
.
snRules
[
"device"
+
(
this
.
snForm
.
deviceArr
.
length
-
1
)]
=
this
.
snRules
.
device0
;
},
removeDevice
(
index
)
{
if
(
this
.
snForm
.
deviceArr
.
length
==
1
)
return
this
.
snForm
.
deviceArr
.
splice
(
index
,
1
)
if
(
this
.
snForm
.
deviceArr
.
length
==
1
)
return
;
this
.
snForm
.
deviceArr
.
splice
(
index
,
1
)
;
},
// 监听输入
onInput
(
e
){
onInput
(
e
)
{
console
.
log
(
this
.
searchForm
);
this
.
$refs
.
serchButton
.
$el
.
click
();
},
FreqModalChange
(
isOpen
){
FreqModalChange
(
isOpen
)
{
this
.
freqVisible
=
isOpen
;
},
gotoMonitor
()
{
console
.
log
(
this
.
vehicleForm
)
console
.
log
(
this
.
vehicleForm
)
;
/* let snO = {
name: this.vehicleForm.name,
standNo: this.vehicleForm.vin,
...
...
@@ -1493,52 +1490,56 @@ export default {
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])}});
// window.open(routeData.href, '_blank');
//this.$router.push({ name: 'monitor', params: { snArr: [snO], mode: 'monitor' }})
//location.href = '/trialRun#/vehicleSubmit'//'/oEshield#/monitor/monitor?vin='+this.vehicleForm.vin
history
.
pushState
(
null
,
'name'
,
'/oEshield#/monitor/monitor?vin='
+
this
.
vehicleForm
.
vin
)
}
//let routeData = this.$router.resolve({ path: '../oEshield#/monitor/monitor', query: { snArr: JSON.stringify([snO])}});
// window.open(routeData.href, '_blank');
//location.href = '/trialRun#/vehicleSubmit'//'/oEshield#/monitor/monitor?vin='+this.vehicleForm.vin
history
.
pushState
(
null
,
"name"
,
"/oEshield#/monitor/monitor?vin="
+
this
.
vehicleForm
.
vin
);
},
},
components
:
{
freqModal
}
freqModal
,
}
,
};
</
script
>
<
style
>
.searchTop.inline
.search-form
{
max-width
:
1200px
;
position
:
relative
;
}
.searchTop.inline
.el-form-item
{
width
:
auto
;
max-width
:
430px
;
}
.searchTop.inline
.search-form
.el-form-item__content
{
width
:
auto
;
}
.searchTop.inline
.el-input
.el-input__inner
{
width
:
360px
;
}
.searchTop.inline
.el-select
.el-input__inner
{
width
:
120px
;
}
.searchTop.inline
.el-form-item__label
{
width
:
5em
;
}
.freq_table
{
border-collapse
:
collapse
;
width
:
100%
;
}
.freq_table
th
,
.freq_table
td
{
border
:
1px
solid
#ccc
;
padding
:
2px
;
text-align
:
center
;
}
.unvisible
{
visibility
:
hidden
;
}
.searchTop.inline
.search-form
{
max-width
:
1200px
;
position
:
relative
;
}
.searchTop.inline
.el-form-item
{
width
:
auto
;
max-width
:
430px
;
}
.searchTop.inline
.search-form
.el-form-item__content
{
width
:
auto
;
}
.searchTop.inline
.el-input
.el-input__inner
{
width
:
360px
;
}
.searchTop.inline
.el-select
.el-input__inner
{
width
:
120px
;
}
.searchTop.inline
.el-form-item__label
{
width
:
5em
;
}
.freq_table
{
border-collapse
:
collapse
;
width
:
100%
;
}
.freq_table
th
,
.freq_table
td
{
border
:
1px
solid
#ccc
;
padding
:
2px
;
text-align
:
center
;
}
.unvisible
{
visibility
:
hidden
;
}
</
style
>
\ No newline at end of file
src/views/vehicleManage/vehicleList.vue
View file @
9821da4
...
...
@@ -411,6 +411,10 @@ export default {
listName
:
"list"
,
tableColumns
:
[
{
label
:
"业务工单号"
,
prop
:
"bizOrderNo"
,
},
{
label
:
"车主姓名"
,
prop
:
"ownerName"
,
},
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment