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 3522bb1c
authored
Sep 20, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v1.11.0版本需求
1 parent
bafc2090
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
675 additions
and
231 deletions
src/services/vehicle.js
src/views/vehicleManage/freqModal copy.vue
src/views/vehicleManage/freqModal.vue
src/views/vehicleManage/vehicleList.vue
src/services/vehicle.js
View file @
3522bb1
...
@@ -111,6 +111,16 @@ function getAdjFreqInfo(params) {
...
@@ -111,6 +111,16 @@ function getAdjFreqInfo(params) {
return
request
(
params
,
'/trialdrive/vehicle/getadjfreqinfo'
);
return
request
(
params
,
'/trialdrive/vehicle/getadjfreqinfo'
);
}
}
// 获取生效调频记录详情
function
GET_FREQ_DETAILS
(
params
)
{
return
request
(
params
,
'/trialdrive/vehicle/effectFreqInfo'
);
}
// 关闭调频
function
REST_FREQ_INFO
(
params
)
{
return
request
(
params
,
'/trialdrive/vehicle/resetAdjFreq'
);
}
export
{
export
{
getList
,
getList
,
getSpecialShopList
,
getSpecialShopList
,
...
@@ -134,4 +144,6 @@ export {
...
@@ -134,4 +144,6 @@ export {
deleteNewVehicle
,
deleteNewVehicle
,
updateNewVehicle
,
updateNewVehicle
,
getAdjFreqInfo
,
getAdjFreqInfo
,
GET_FREQ_DETAILS
,
REST_FREQ_INFO
};
};
src/views/vehicleManage/freqModal copy.vue
0 → 100644
View file @
3522bb1
<
template
>
<!-- 一键调频弹框 -->
<el-dialog
title=
"一键调频"
:visible=
"freqVisible"
@
open=
"openDialog"
@
close=
"closeDialog"
append-to-body
width=
"640px"
:close-on-click-modal=
"false"
>
<el-form
:model=
"freqForm"
ref=
"form"
:rules=
"rules"
:show-message=
"true"
:inline=
"true"
size=
"mini"
label-width=
"80px"
>
<el-row>
<el-radio
v-model=
"freqForm.fqType"
label=
"0"
>
追车模式
</el-radio>
<span
class=
"freq-des"
>
(适用于收车场景,指定设备每隔几分钟更新定位信息)
</span
>
</el-row>
<el-row
class=
"row-ct"
>
<el-form-item
label=
""
prop=
"catchingTimer"
>
<el-input
v-model=
"freqForm.catchingTimer"
:placeholder=
"`1~$
{maxNumber}`"
:maxlength="String(maxNumber).length"
>
</el-input>
</el-form-item
>
分钟
</el-row>
<el-row>
<el-radio
v-model=
"freqForm.fqType"
label=
"1"
>
闹钟模式
</el-radio>
<span
class=
"freq-des"
>
(适用于催款环节,增加设备每天的上点频率,防止人车失联)
</span
>
</el-row>
<el-row
class=
"row-ct"
>
<el-col
:span=
"12"
>
<el-checkbox
v-model=
"freqForm.fqClock1"
>
第一组
</el-checkbox>
<el-form-item>
<el-time-select
v-model=
"freqForm.timer1"
:editable=
"false"
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-checkbox
v-model=
"freqForm.fqClock2"
>
第二组
</el-checkbox>
<el-form-item>
<el-time-select
v-model=
"freqForm.timer2"
:editable=
"false"
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-checkbox
v-model=
"freqForm.fqClock3"
>
第三组
</el-checkbox>
<el-form-item>
<el-time-select
v-model=
"freqForm.timer3"
:editable=
"false"
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-checkbox
v-model=
"freqForm.fqClock4"
>
第四组
</el-checkbox>
<el-form-item>
<el-time-select
v-model=
"freqForm.timer4"
:editable=
"false"
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-col>
</el-row>
<el-row
class=
"row-ct el-form-item__error"
v-show=
"freqForm.clockError"
>
请选择至少一组闹钟模式
</el-row
>
<el-row>
<el-radio
v-model=
"freqForm.fqType"
label=
"2"
>
星期模式
</el-radio>
<span
class=
"freq-des"
>
(适用于日常场景,可按需设置每周的设备回传次数。)
</span
>
</el-row>
<el-row
class=
"row-ct"
>
<el-form-item
label=
"上点时间"
>
<el-time-select
v-model=
"freqForm.weekTimer"
:editable=
"false"
:clearable=
"false"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-row>
<el-row
class=
"row-ct"
>
<el-form-item
label=
""
>
<el-checkbox
v-model=
"freqForm.fqWeekday1"
>
周一
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday2"
>
周二
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday3"
>
周三
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday4"
>
周四
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday5"
>
周五
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday6"
>
周六
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday7"
>
周日
</el-checkbox>
</el-form-item>
</el-row>
<el-row
class=
"row-ct el-form-item__error"
v-show=
"freqForm.weekError"
>
请选择至少一组星期模式
</el-row
>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
size=
"small"
>
确认
</el-button
>
<el-button
@
click=
"$emit('onFreqModalChange', false)"
size=
"small"
>
取消
</el-button
>
</div>
</el-dialog>
<!-- 查看详情弹框 /-->
</
template
>
<
script
>
import
{
adjFreq
}
from
"services/vehicle"
;
export
default
{
props
:
[
"freqVisible"
,
"sn"
,
"enableFreq"
],
data
()
{
let
checkCatchingTimer
=
(
rule
,
vaule
,
cb
)
=>
{
if
(
this
.
freqForm
.
fqType
==
"0"
)
{
if
(
!
/^
[^
0
]\d{0,3}
$/
.
test
(
this
.
freqForm
.
catchingTimer
))
{
cb
(
new
Error
(
`请输入分钟数,1~
${
this
.
maxNumber
}
`
));
}
else
if
(
this
.
freqForm
.
catchingTimer
>
this
.
maxNumber
)
{
cb
(
new
Error
(
`请输入分钟数,1~
${
this
.
maxNumber
}
`
));
}
}
cb
();
};
const
timePattern
=
/^
(([
0-1
]\d
|2
[
0-3
])\:[
0-5
]\d)
$|^24
\:
00$/
;
/*let checkTimer1 = (rule, vaule, cb)=>{console.log(this.freqForm.timer1)
if(this.freqForm.fqType == '1' && this.freqForm.fqClock1 && !timePattern.test(this.freqForm.timer1)){
cb(new Error('请输入正确的时间格式'))
}
}*/
return
{
freqForm
:
{
fqType
:
"0"
,
catchingTimer
:
""
,
fqClock1
:
true
,
fqClock2
:
false
,
fqClock3
:
false
,
fqClock4
:
false
,
timer1
:
"01:00"
,
timer2
:
"10:00"
,
timer3
:
"14:00"
,
timer4
:
"23:00"
,
weekTimer
:
"10:00"
,
fqWeekday1
:
true
,
fqWeekday2
:
false
,
fqWeekday3
:
false
,
fqWeekday4
:
false
,
fqWeekday5
:
false
,
fqWeekday6
:
false
,
fqWeekday7
:
false
,
clockError
:
false
,
weekError
:
false
,
},
rules
:
{
catchingTimer
:
[{
validator
:
checkCatchingTimer
,
trigger
:
"blur"
}],
},
};
},
computed
:
{
maxNumber
()
{
return
this
.
enableFreq
?
5555
:
999
;
},
},
methods
:
{
openDialog
()
{
this
.
$emit
(
"onFreqModalChange"
,
true
);
},
closeDialog
()
{
this
.
$refs
.
form
.
resetFields
();
this
.
$emit
(
"onFreqModalChange"
,
false
);
},
getParams
()
{
const
form
=
this
.
freqForm
;
const
params
=
{};
params
.
sn
=
this
.
sn
;
params
.
type
=
form
.
fqType
;
switch
(
form
.
fqType
)
{
case
"0"
:
params
.
catchingTimer
=
form
.
catchingTimer
;
break
;
case
"1"
:
let
_timer
=
[];
if
(
form
.
fqClock1
)
{
_timer
.
push
(
form
.
timer1
);
}
if
(
form
.
fqClock2
)
{
_timer
.
push
(
form
.
timer2
);
}
if
(
form
.
fqClock3
)
{
_timer
.
push
(
form
.
timer3
);
}
if
(
form
.
fqClock4
)
{
_timer
.
push
(
form
.
timer4
);
}
params
.
timer
=
_timer
.
join
(
","
);
break
;
case
"2"
:
let
_week
=
[];
if
(
form
.
fqWeekday1
)
{
_week
.
push
(
1
);
}
if
(
form
.
fqWeekday2
)
{
_week
.
push
(
2
);
}
if
(
form
.
fqWeekday3
)
{
_week
.
push
(
3
);
}
if
(
form
.
fqWeekday4
)
{
_week
.
push
(
4
);
}
if
(
form
.
fqWeekday5
)
{
_week
.
push
(
5
);
}
if
(
form
.
fqWeekday6
)
{
_week
.
push
(
6
);
}
if
(
form
.
fqWeekday7
)
{
_week
.
push
(
7
);
}
params
.
week
=
_week
.
join
(
""
);
params
.
weekTimer
=
form
.
weekTimer
;
break
;
}
console
.
log
(
params
);
return
params
;
},
submitForm
()
{
if
(
!
this
.
validateClock
()
||
!
this
.
validateWeak
())
{
return
false
;
}
const
params
=
this
.
getParams
();
this
.
$refs
.
form
.
validate
((
valid
,
field
)
=>
{
if
(
valid
)
{
adjFreq
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
({
type
:
"success"
,
message
:
res
.
message
,
});
this
.
closeDialog
();
}
});
}
else
{
return
false
;
}
});
},
validateClock
()
{
if
(
this
.
freqForm
.
fqType
==
"1"
)
{
if
(
this
.
freqForm
.
fqClock1
||
this
.
freqForm
.
fqClock2
||
this
.
freqForm
.
fqClock3
||
this
.
freqForm
.
fqClock4
)
{
this
.
freqForm
.
clockError
=
false
;
return
true
;
}
else
{
this
.
freqForm
.
clockError
=
true
;
return
false
;
}
}
else
{
this
.
freqForm
.
clockError
=
false
;
return
true
;
}
},
validateWeak
()
{
if
(
this
.
freqForm
.
fqType
==
"2"
)
{
if
(
this
.
freqForm
.
fqWeekday1
||
this
.
freqForm
.
fqWeekday2
||
this
.
freqForm
.
fqWeekday3
||
this
.
freqForm
.
fqWeekday4
||
this
.
freqForm
.
fqWeekday5
||
this
.
freqForm
.
fqWeekday6
||
this
.
freqForm
.
fqWeekday7
)
{
this
.
freqForm
.
weekError
=
false
;
return
true
;
}
else
{
this
.
freqForm
.
weekError
=
true
;
return
false
;
}
}
else
{
this
.
freqForm
.
weekError
=
false
;
return
true
;
}
},
validateForm
()
{},
},
components
:
{},
};
</
script
>
<
style
scoped
>
.freq-des
{
color
:
#999
;
}
.row-ct
{
padding-left
:
20px
;
margin-bottom
:
10px
;
}
</
style
>
src/views/vehicleManage/freqModal.vue
View file @
3522bb1
<
template
>
<
template
>
<!-- 一键调频弹框 -->
<!-- 一键调频弹框 -->
<el-dialog
<el-dialog
title=
"一键调频"
:visible=
"freqVisible"
@
open=
"openDialog"
@
close=
"closeDialog"
append-to-body
width=
"700px"
:close-on-click-modal=
"false"
>
title=
"一键调频"
<el-form
:model=
"freqForm"
ref=
"freqForm"
:rules=
"freqFormRules"
size=
"mini"
label-width=
"150px"
>
:visible=
"freqVisible"
<el-form-item
label=
"调频开关:"
>
@
open=
"openDialog"
<el-switch
v-model=
"freqForm.enableFreq"
@
change=
"closeFreq"
></el-switch>
@
close=
"closeDialog"
<span
class=
"type_tips"
>
(关闭时,恢复出厂设置,打开时支持模式选择,默认关闭)
</span>
append-to-body
width=
"640px"
:close-on-click-modal=
"false"
>
<el-form
:model=
"freqForm"
ref=
"form"
:rules=
"rules"
:show-message=
"true"
:inline=
"true"
size=
"mini"
label-width=
"80px"
>
<el-row>
<el-radio
v-model=
"freqForm.fqType"
label=
"0"
>
追车模式
</el-radio>
<span
class=
"freq-des"
>
(适用于收车场景,指定设备每隔几分钟更新定位信息)
</span
>
</el-row>
<el-row
class=
"row-ct"
>
<el-form-item
label=
""
prop=
"catchingTimer"
>
<el-input
v-model=
"freqForm.catchingTimer"
:placeholder=
"`1~$
{maxNumber}`"
:maxlength="String(maxNumber).length"
>
</el-input>
</el-form-item
>
分钟
</el-row>
<el-row>
<el-radio
v-model=
"freqForm.fqType"
label=
"1"
>
闹钟模式
</el-radio>
<span
class=
"freq-des"
>
(适用于催款环节,增加设备每天的上点频率,防止人车失联)
</span
>
</el-row>
<el-row
class=
"row-ct"
>
<el-col
:span=
"12"
>
<el-checkbox
v-model=
"freqForm.fqClock1"
>
第一组
</el-checkbox>
<el-form-item>
<el-time-select
v-model=
"freqForm.timer1"
:editable=
"false"
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-form-item>
</el-col>
<el-form-item
label=
"调频模式:"
prop=
"fqType"
>
<el-col
:span=
"12"
>
<el-radio-group
v-model=
"freqForm.fqType"
:disabled=
"!freqForm.enableFreq"
@
change=
"onChange"
>
<el-checkbox
v-model=
"freqForm.fqClock2"
>
第二组
</el-checkbox>
<el-radio
:label=
"0"
>
追车模式
</el-radio>
<el-form-item>
<el-radio
:label=
"1"
>
闹钟模式
</el-radio>
<el-time-select
<el-radio
:label=
"2"
>
星期模式
</el-radio>
v-model=
"freqForm.timer2"
</el-radio-group>
:editable=
"false"
<div
class=
"type_tips"
>
{{
typeTips
[
freqForm
.
fqType
]
}}
</div>
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-form-item>
</el-col>
<el-form-item
label=
"调频内容:"
v-if=
"freqForm.fqType == 0"
prop=
"catchingTimer"
>
<el-col
:span=
"12"
>
<!--
<el-input
v-model=
"freqForm.catchingTimer"
class=
"sort_input"
:placeholder=
"`1~$
{maxNumber}`" :maxlength="String(maxNumber).length" :disabled="!freqForm.enableFreq">
</el-input>
-->
<el-checkbox
v-model=
"freqForm.fqClock3"
>
第三组
</el-checkbox>
<el-input-number
v-model=
"freqForm.catchingTimer"
class=
"sort_input"
:placeholder=
"`1~$
{maxNumber}`" :controls="false" :min="1" :max="maxNumber" :disabled="!freqForm.enableFreq">
</el-input-number>
<el-form-item>
<span>
分钟
</span>
<el-time-select
v-model=
"freqForm.timer3"
:editable=
"false"
:clearable=
"false"
style=
"width:100px"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-form-item>
</el-form-item>
</el-col>
<el-form-item
label=
"调频内容:"
v-if=
"freqForm.fqType == 1"
prop=
"teamList"
class=
"is-required"
>
<el-col
:span=
"12"
>
<el-checkbox-group
v-model=
"freqForm.teamList"
class=
"freq_check_group"
:disabled=
"!freqForm.enableFreq"
>
<el-checkbox
v-model=
"freqForm.fqClock4"
>
第四组
</el-checkbox>
<el-checkbox
:label=
"1"
>
<el-form-item>
<span>
第一组
</span>
<el-time-select
<el-time-select
v-model=
"freqForm.timer1"
:editable=
"false"
:clearable=
"false"
class=
"sort_input"
:picker-options=
"pickerOptions"
:disabled=
"!freqForm.enableFreq"
>
v-model=
"freqForm.timer4"
</el-time-select>
:editable=
"false"
</el-checkbox>
:clearable=
"false"
<el-checkbox
:label=
"2"
>
style=
"width:100px"
<span>
第二组
</span>
:picker-options=
"
{
<el-time-select
v-model=
"freqForm.timer2"
:editable=
"false"
:clearable=
"false"
class=
"sort_input"
:picker-options=
"pickerOptions"
:disabled=
"!freqForm.enableFreq"
>
start: '00:00',
</el-time-select>
step: '00:15',
</el-checkbox>
end: '23:45',
<el-checkbox
:label=
"3"
>
format: 'HH:mm',
<span>
第三组
</span>
}"
<el-time-select
v-model=
"freqForm.timer3"
:editable=
"false"
:clearable=
"false"
class=
"sort_input"
:picker-options=
"pickerOptions"
:disabled=
"!freqForm.enableFreq"
>
>
</el-time-select>
</el-time-select>
</el-checkbox>
<el-checkbox
:label=
"4"
>
<span>
第四组
</span>
<el-time-select
v-model=
"freqForm.timer4"
:editable=
"false"
:clearable=
"false"
class=
"sort_input"
:picker-options=
"pickerOptions"
:disabled=
"!freqForm.enableFreq"
>
</el-time-select>
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form-item>
</el-col>
<el-form-item
label=
"调频内容:"
v-if=
"freqForm.fqType == 2"
class=
"is-required"
>
</el-row>
<el-form-item
label=
""
label-width=
"0"
class=
"week_item"
prop=
"weekTimer"
>
<el-row
class=
"row-ct el-form-item__error"
v-show=
"freqForm.clockError"
<span
class=
"name"
>
上点时间
</span>
>
请选择至少一组闹钟模式
</el-row
<el-time-select
v-model=
"freqForm.weekTimer"
class=
"sort_input"
:editable=
"false"
:clearable=
"false"
:picker-options=
"pickerOptions"
:disabled=
"!freqForm.enableFreq"
>
>
<el-row>
<el-radio
v-model=
"freqForm.fqType"
label=
"2"
>
星期模式
</el-radio>
<span
class=
"freq-des"
>
(适用于日常场景,可按需设置每周的设备回传次数。)
</span
>
</el-row>
<el-row
class=
"row-ct"
>
<el-form-item
label=
"上点时间"
>
<el-time-select
v-model=
"freqForm.weekTimer"
:editable=
"false"
:clearable=
"false"
:picker-options=
"
{
start: '00:00',
step: '00:15',
end: '23:45',
format: 'HH:mm',
}"
>
</el-time-select>
</el-time-select>
</el-form-item>
</el-form-item>
</el-row>
<el-form-item
label=
""
label-width=
"0"
prop=
"weekList"
>
<el-row
class=
"row-ct"
>
<el-checkbox-group
v-model=
"freqForm.weekList"
class=
"week_checkbox"
:disabled=
"!freqForm.enableFreq"
>
<el-form-item
label=
""
>
<el-checkbox
label=
"1"
>
周一
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday1"
>
周一
</el-checkbox>
<el-checkbox
label=
"2"
>
周二
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday2"
>
周二
</el-checkbox>
<el-checkbox
label=
"3"
>
周三
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday3"
>
周三
</el-checkbox>
<el-checkbox
label=
"4"
>
周四
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday4"
>
周四
</el-checkbox>
<el-checkbox
label=
"5"
>
周五
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday5"
>
周五
</el-checkbox>
<el-checkbox
label=
"6"
>
周六
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday6"
>
周六
</el-checkbox>
<el-checkbox
label=
"7"
>
周日
</el-checkbox>
<el-checkbox
v-model=
"freqForm.fqWeekday7"
>
周日
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"调频操作持续时长:"
class=
"is-required"
>
<div
class=
"duration_type"
>
<el-form-item
label=
""
label-width=
"0"
>
<el-select
v-model=
"freqForm.durationType"
class=
"sort_select"
:disabled=
"!freqForm.enableFreq"
>
<el-option
:value=
"1"
label=
"永久有效"
></el-option>
<el-option
:value=
"2"
label=
"自定义时长"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
""
label-width=
"0"
prop=
"duration"
v-if=
"freqForm.durationType == 2"
>
<!--
<el-input
v-model=
"freqForm.duration"
class=
"sort_input"
placeholder=
"1~7200"
maxlength=
"4"
:disabled=
"!freqForm.enableFreq"
></el-input>
-->
<el-input-number
v-model=
"freqForm.duration"
class=
"sort_input"
placeholder=
"1~7200"
:controls=
"false"
:min=
"1"
:max=
"7200"
:disabled=
"!freqForm.enableFreq"
></el-input-number>
<span>
分钟
</span>
</el-form-item>
</div>
</el-form-item>
</el-form-item>
</el-row>
<el-row
class=
"row-ct el-form-item__error"
v-show=
"freqForm.weekError"
>
请选择至少一组星期模式
</el-row
>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
size=
"small"
<el-button
type=
"primary"
@
click=
"submitForm"
size=
"small"
>
确认
</el-button>
>
确认
</el-button
<el-button
@
click=
"$emit('onFreqModalChange', false)"
size=
"small"
>
取消
</el-button>
>
<el-button
@
click=
"$emit('onFreqModalChange', false)"
size=
"small"
>
取消
</el-button
>
</div>
</div>
</el-dialog>
</el-dialog>
<!-- 查看详情弹框 /-->
<!-- 查看详情弹框 /-->
</
template
>
</
template
>
<
script
>
<
script
>
import
{
adjFreq
}
from
"services/vehicle"
;
import
{
adjFreq
,
GET_FREQ_DETAILS
}
from
"services/vehicle"
;
import
{
deepClone
,
showToast
}
from
"@/utils/util"
;
export
default
{
export
default
{
props
:
[
"freqVisible"
,
"sn"
,
"enableFreq"
],
props
:
[
"freqVisible"
,
"sn"
,
"enableFreq"
],
...
@@ -191,30 +110,45 @@ export default {
...
@@ -191,30 +110,45 @@ export default {
return
{
return
{
freqForm
:
{
freqForm
:
{
fqType
:
"0"
,
fqType
:
0
,
catchingTimer
:
""
,
fqClock1
:
true
,
fqClock2
:
false
,
fqClock3
:
false
,
fqClock4
:
false
,
timer1
:
"01:00"
,
timer2
:
"10:00"
,
timer3
:
"14:00"
,
timer4
:
"23:00"
,
weekTimer
:
"10:00"
,
weekTimer
:
"10:00"
,
fqWeekday1
:
true
,
teamList
:
[],
fqWeekday2
:
false
,
weekList
:
[],
fqWeekday3
:
false
,
durationType
:
1
,
fqWeekday4
:
false
,
},
fqWeekday5
:
false
,
freqFormRules
:
{
fqWeekday6
:
false
,
fqType
:
[
fqWeekday7
:
false
,
{
required
:
true
,
message
:
"请选择调频模式"
,
trigger
:
"change"
},
clockError
:
false
,
],
weekError
:
false
,
catchingTimer
:
[
{
required
:
true
,
message
:
`请输入分钟数,1~
${
this
.
enableFreq
?
5555
:
999
}
`
,
trigger
:
"blur"
,
},
},
rules
:
{
{
validator
:
checkCatchingTimer
,
trigger
:
"blur"
},
catchingTimer
:
[{
validator
:
checkCatchingTimer
,
trigger
:
"blur"
}],
],
teamList
:
[
{
required
:
true
,
message
:
"请选择调频内容"
,
trigger
:
"change"
},
],
weekTimer
:
[
{
required
:
true
,
message
:
"请输入上点时间"
,
trigger
:
"blur"
},
],
weekList
:
[{
required
:
true
,
message
:
"请选择"
,
trigger
:
"blur"
}],
duration
:
[{
required
:
true
,
message
:
"请输入持续时长"
}],
},
},
typeTips
:
{
0
:
"注:适用于收车场景,指定设备每隔几分钟更新定位信息"
,
1
:
"注:适用于催款环节,增加设备每天的上点频率,防止人车失联"
,
2
:
"注:适用于日常场景,可按需设置每周的设备回传次数。"
,
},
pickerOptions
:
{
start
:
"00:00"
,
step
:
"00:15"
,
end
:
"23:45"
,
format
:
"HH:mm"
,
},
loading
:
false
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -222,92 +156,91 @@ export default {
...
@@ -222,92 +156,91 @@ export default {
return
this
.
enableFreq
?
5555
:
999
;
return
this
.
enableFreq
?
5555
:
999
;
},
},
},
},
watch
:
{
sn
:
{
handler
:
function
(
n
,
o
)
{
if
(
n
||
n
==
o
)
{
console
.
log
(
this
);
this
.
getFreqInfo
(
n
);
}
},
immediate
:
true
,
},
},
methods
:
{
methods
:
{
openDialog
()
{
openDialog
()
{
this
.
$emit
(
"onFreqModalChange"
,
true
);
this
.
$emit
(
"onFreqModalChange"
,
true
);
},
},
// 关闭弹框
closeDialog
()
{
closeDialog
()
{
this
.
$refs
.
f
orm
.
resetFields
();
this
.
$refs
.
f
reqForm
.
clearValidate
();
this
.
$emit
(
"onFreqModalChange"
,
false
);
this
.
$emit
(
"onFreqModalChange"
,
false
);
},
},
// 获取参数
getParams
()
{
getParams
()
{
const
form
=
this
.
freqForm
;
const
form
=
deepClone
(
this
.
freqForm
)
;
const
params
=
{};
const
params
=
{};
params
.
sn
=
this
.
sn
;
params
.
sn
=
this
.
sn
;
params
.
type
=
form
.
fqType
;
params
.
type
=
form
.
fqType
;
params
.
duration
=
form
.
duration
;
//params.nableFreq = form.enableFreq
switch
(
form
.
fqType
)
{
// 追车模式
case
"0"
:
if
(
form
.
fqType
==
0
)
{
params
.
catchingTimer
=
form
.
catchingTimer
;
params
.
catchingTimer
=
form
.
catchingTimer
;
break
;
case
"1"
:
let
_timer
=
[];
if
(
form
.
fqClock1
)
{
_timer
.
push
(
form
.
timer1
);
}
if
(
form
.
fqClock2
)
{
_timer
.
push
(
form
.
timer2
);
}
if
(
form
.
fqClock3
)
{
_timer
.
push
(
form
.
timer3
);
}
}
if
(
form
.
fqClock4
)
{
_timer
.
push
(
form
.
timer4
);
}
params
.
timer
=
_timer
.
join
(
","
);
break
;
case
"2"
:
let
_week
=
[];
if
(
form
.
fqWeekday1
)
{
// 闹钟模式
_week
.
push
(
1
);
if
(
form
.
fqType
==
1
)
{
}
let
arr
=
form
.
teamList
;
if
(
form
.
fqWeekday2
)
{
let
_timer
=
[];
_week
.
push
(
2
);
arr
.
map
((
k
)
=>
{
}
console
.
log
(
k
);
if
(
form
.
fqWeekday3
)
{
_timer
.
push
(
form
[
"timer"
+
k
]);
_week
.
push
(
3
);
});
}
params
.
timer
=
_timer
.
join
(
","
);
if
(
form
.
fqWeekday4
)
{
_week
.
push
(
4
);
}
if
(
form
.
fqWeekday5
)
{
_week
.
push
(
5
);
}
if
(
form
.
fqWeekday6
)
{
_week
.
push
(
6
);
}
if
(
form
.
fqWeekday7
)
{
_week
.
push
(
7
);
}
}
params
.
week
=
_week
.
join
(
""
);
// 星期模式
if
(
form
.
fqType
==
2
)
{
params
.
week
=
form
.
weekList
.
join
(
""
);
params
.
weekTimer
=
form
.
weekTimer
;
params
.
weekTimer
=
form
.
weekTimer
;
break
;
}
}
console
.
log
(
params
);
// 持续时长
if
(
form
.
durationType
==
1
)
{
params
.
duration
=
"-1"
;
}
console
.
log
(
params
);
return
params
;
return
params
;
},
},
// 保存调频信息
submitForm
()
{
submitForm
()
{
if
(
!
this
.
validateClock
()
||
!
this
.
validateWeak
())
{
let
_this
=
this
;
let
params
=
this
.
getParams
();
console
.
log
(
params
)
if
(
!
this
.
freqForm
.
enableFreq
)
{
_this
.
closeDialog
();
return
false
;
}
this
.
$refs
.
freqForm
.
validate
((
valid
,
field
)
=>
{
if
(
!
valid
)
{
return
false
;
return
false
;
}
}
const
params
=
this
.
getParams
();
this
.
$refs
.
form
.
validate
((
valid
,
field
)
=>
{
if
(
valid
)
{
adjFreq
(
params
).
then
((
res
)
=>
{
adjFreq
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
this
.
$message
({
showToast
({
type
:
"success"
,
type
:
"success"
,
message
:
res
.
message
,
message
:
res
.
message
,
});
});
this
.
closeDialog
();
_
this
.
closeDialog
();
}
}
});
});
}
else
{
return
false
;
}
});
});
},
},
validateClock
()
{
validateClock
()
{
...
@@ -351,12 +284,100 @@ export default {
...
@@ -351,12 +284,100 @@ export default {
return
true
;
return
true
;
}
}
},
},
validateForm
()
{},
// 获取调频配置信息
async
getFreqInfo
(
sn
)
{
let
res
=
await
GET_FREQ_DETAILS
({
sn
:
sn
});
console
.
log
(
res
);
if
(
res
.
code
==
200
)
{
let
obj
=
res
.
data
||
{};
let
teamList
=
[];
let
weekList
=
[];
// 星期
if
(
obj
.
week
)
{
weekList
=
obj
.
week
.
split
(
""
);
}
// 闹钟
if
(
obj
.
timer
)
{
let
arr
=
obj
.
timer
.
split
(
","
);
let
len
=
arr
.
length
;
console
.
log
(
arr
);
arr
.
forEach
((
k
,
i
)
=>
{
console
.
log
(
k
,
i
);
teamList
.
push
(
i
+
1
);
obj
[
"timer"
+
(
i
+
1
)]
=
k
;
});
if
(
len
==
3
)
{
obj
.
timer4
=
"23:00"
;
}
if
(
len
==
2
)
{
obj
.
timer3
=
"14:00"
;
obj
.
timer4
=
"23:00"
;
}
if
(
len
==
1
)
{
obj
.
timer2
=
"10:00"
;
obj
.
timer3
=
"14:00"
;
obj
.
timer4
=
"23:00"
;
}
}
// 非闹钟模式,设置默认值
if
(
!
obj
.
timer
)
{
obj
.
timer1
=
"01:00"
;
obj
.
timer2
=
"10:00"
;
obj
.
timer3
=
"14:00"
;
obj
.
timer4
=
"23:00"
;
}
obj
.
fqType
=
obj
.
freqType
;
obj
.
teamList
=
teamList
;
obj
.
weekList
=
weekList
;
obj
.
weekTimer
=
obj
.
weekTimer
||
"10:00"
;
obj
.
enableFreq
=
obj
.
freqType
==
3
?
false
:
true
;
if
(
!
obj
.
duration
||
obj
.
duration
==
"-1"
)
{
obj
.
durationType
=
1
;
}
else
{
obj
.
durationType
=
2
;
}
console
.
log
(
obj
);
this
.
freqForm
=
obj
;
}
},
// 关闭一键调频
async
closeFreq
(
e
)
{
console
.
log
(
e
);
if
(
e
)
{
this
.
$set
(
this
.
freqForm
,
"fqType"
,
0
);
return
false
;
}
let
oParams
=
{};
oParams
.
sn
=
this
.
sn
;
let
res
=
REST_FREQ_INFO
(
oParams
);
if
(
res
.
returnCode
==
0
)
{
showToast
({
message
:
"调频已关闭"
,
});
}
},
// 监听调频模式切换
onChange
()
{
let
_this
=
this
;
setTimeout
(
function
()
{
_this
.
$refs
.
freqForm
.
clearValidate
();
},
10
);
},
},
},
components
:
{},
components
:
{},
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.freq-des
{
.freq-des
{
color
:
#999
;
color
:
#999
;
}
}
...
@@ -364,4 +385,48 @@ export default {
...
@@ -364,4 +385,48 @@ export default {
padding-left
:
20px
;
padding-left
:
20px
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.type_tips
{
font-size
:
12px
;
color
:
#999
;
}
.sort_input
,
.sort_select
{
width
:
120px
;
margin-right
:
10px
;
::v-deep
.el-input__inner
{
text-align
:
left
;
}
}
.freq_check_group
{
display
:
flex
;
align-items
:
center
;
flex-wrap
:
wrap
;
.el-checkbox
{
flex
:
0
0
50%
;
margin
:
0
0
10px
0
;
.sort_input
{
margin-left
:
10px
;
width
:
100px
;
}
}
}
.week_item
{
display
:
flex
;
align-items
:
center
;
.name
{
margin-right
:
10px
;
}
}
.week_checkbox
{
.el-checkbox
{
margin
:
0
20px
10px
0
;
.el-checkbox__label
{
padding-left
:
5px
!important
;
}
}
}
.duration_type
{
display
:
flex
;
align-items
:
center
;
}
</
style
>
</
style
>
src/views/vehicleManage/vehicleList.vue
View file @
3522bb1
...
@@ -344,7 +344,7 @@
...
@@ -344,7 +344,7 @@
<!-- 车辆归属弹框 end -->
<!-- 车辆归属弹框 end -->
<!-- 一键调频 弹框 开始 -->
<!-- 一键调频 弹框 开始 -->
<freq-modal
:freqVisible=
"freqVisible"
:frequencyForm=
"frequencyForm"
@
onFreqModalChange=
"FreqModalChange"
:sn=
"freqSn"
:enableFreq=
"enableFreq"
></freq-modal>
<freq-modal
:freqVisible=
"freqVisible"
v-if=
"freqVisible"
:frequencyForm=
"frequencyForm"
@
onFreqModalChange=
"FreqModalChange"
:sn=
"freqSn"
:enableFreq=
"enableFreq"
></freq-modal>
<!-- 一键调频 弹框 end -->
<!-- 一键调频 弹框 end -->
</div>
</div>
...
...
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