mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-25 14:17:54 +08:00
优化车辆黑白名单
This commit is contained in:
parent
594271253d
commit
5f1929ac42
@ -1,4 +1,4 @@
|
||||
<div id="addCarBlackWhiteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
<div id="addCarBlackWhiteModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
@ -16,6 +16,14 @@
|
||||
<option value="2222">白名单</option>
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group row" >
|
||||
<label class="col-sm-2 col-form-label">归属停车场</label>
|
||||
<div class="col-sm-10">
|
||||
<vc:create path="property/parkingAreaSelect2" parentModal="addCarBlackWhiteModel"
|
||||
callBackListener="addCarBlackWhite" callBackFunction="notify" namespace="addCarBlackWhite">
|
||||
</vc:create>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">车牌号</label>
|
||||
<div class="col-sm-10">
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
(function(vc) {
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
@ -13,18 +13,26 @@
|
||||
carNum: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
paId: ''
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod: function() {
|
||||
_initMethod: function () {
|
||||
vc.component._initAddCarBlackWhiteDateInfo();
|
||||
|
||||
},
|
||||
_initEvent: function() {
|
||||
_initEvent: function () {
|
||||
vc.on('addCarBlackWhite', 'openAddCarBlackWhiteModal',
|
||||
function() {
|
||||
$('#addCarBlackWhiteModel').modal('show');
|
||||
});
|
||||
function () {
|
||||
$('#addCarBlackWhiteModel').modal('show');
|
||||
});
|
||||
|
||||
vc.on('addCarBlackWhite', 'notify',
|
||||
function (_param) {
|
||||
if (_param.hasOwnProperty('paId')) {
|
||||
$that.addCarBlackWhiteInfo.paId = _param.paId;
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_initAddCarBlackWhiteDateInfo: function () {
|
||||
@ -63,58 +71,63 @@
|
||||
return vc.validate.validate({
|
||||
addCarBlackWhiteInfo: vc.component.addCarBlackWhiteInfo
|
||||
},
|
||||
{
|
||||
'addCarBlackWhiteInfo.blackWhite': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "名单类型不能为空"
|
||||
},
|
||||
{
|
||||
limit: "num",
|
||||
param: "",
|
||||
errInfo: "名单类型格式错误"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.carNum': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "车牌号不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxin",
|
||||
param: "1,12",
|
||||
errInfo: "车牌号大于12位"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.startTime': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "开始时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "dateTime",
|
||||
param: "",
|
||||
errInfo: "不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.endTime': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "结束时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "dateTime",
|
||||
param: "",
|
||||
errInfo: "不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.blackWhite': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "名单类型不能为空"
|
||||
},
|
||||
{
|
||||
limit: "num",
|
||||
param: "",
|
||||
errInfo: "名单类型格式错误"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.carNum': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "车牌号不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxin",
|
||||
param: "1,12",
|
||||
errInfo: "车牌号大于12位"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.paId': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "停车场不能为空"
|
||||
}
|
||||
],
|
||||
'addCarBlackWhiteInfo.startTime': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "开始时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "dateTime",
|
||||
param: "",
|
||||
errInfo: "不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
'addCarBlackWhiteInfo.endTime': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "结束时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "dateTime",
|
||||
param: "",
|
||||
errInfo: "不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
saveCarBlackWhiteInfo: function() {
|
||||
saveCarBlackWhiteInfo: function () {
|
||||
if (!vc.component.addCarBlackWhiteValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -129,32 +142,33 @@
|
||||
vc.http.post('addCarBlackWhite', 'save', JSON.stringify(vc.component.addCarBlackWhiteInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if (res.status == 200) {
|
||||
//关闭model
|
||||
$('#addCarBlackWhiteModel').modal('hide');
|
||||
vc.component.clearAddCarBlackWhiteInfo();
|
||||
vc.emit('carBlackWhiteManage', 'listCarBlackWhite', {});
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if (res.status == 200) {
|
||||
//关闭model
|
||||
$('#addCarBlackWhiteModel').modal('hide');
|
||||
vc.component.clearAddCarBlackWhiteInfo();
|
||||
vc.emit('carBlackWhiteManage', 'listCarBlackWhite', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.toast(errInfo);
|
||||
vc.toast(errInfo);
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
clearAddCarBlackWhiteInfo: function() {
|
||||
clearAddCarBlackWhiteInfo: function () {
|
||||
vc.component.addCarBlackWhiteInfo = {
|
||||
blackWhite: '',
|
||||
carNum: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
paId: ''
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -62,6 +62,7 @@
|
||||
<tr>
|
||||
<th class="text-center">名单ID</th>
|
||||
<th class="text-center">名单类型</th>
|
||||
<th class="text-center">停车场</th>
|
||||
<th class="text-center">车牌号</th>
|
||||
<th class="text-center">开始时间</th>
|
||||
<th class="text-center">结束时间</th>
|
||||
@ -74,6 +75,7 @@
|
||||
<tr v-for="carBlackWhite in carBlackWhiteManageInfo.carBlackWhites">
|
||||
<td class="text-center">{{carBlackWhite.bwId}}</td>
|
||||
<td class="text-center">{{carBlackWhite.blackWhiteName}}</td>
|
||||
<td class="text-center">{{carBlackWhite.paNum}}</td>
|
||||
<td class="text-center">{{carBlackWhite.carNum}}</td>
|
||||
<td class="text-center">{{carBlackWhite.startTime}}</td>
|
||||
<td class="text-center">{{carBlackWhite.endTime}}</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user