mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-25 06:09:11 +08:00
加入车辆 续租 车位 和释放车位
This commit is contained in:
parent
dc19363bb2
commit
20d18af95b
@ -62,7 +62,7 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="addCarInfo.carRemark" type="text" placeholder="请填写备注信息" rows="3" class="form-control"></textarea>
|
||||
<textarea v-model="addCarInfo.remark" type="text" placeholder="请填写备注信息" rows="3" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
carBrand:'',
|
||||
carType:'',
|
||||
carColor:'',
|
||||
carRemark:"",
|
||||
remark:"",
|
||||
startTime:'',
|
||||
endTime:'',
|
||||
carNumType:''
|
||||
|
||||
@ -127,6 +127,7 @@
|
||||
},
|
||||
_submitEditCarInfo: function () {
|
||||
if (!vc.component.editCarValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
<div>
|
||||
|
||||
<!-- 选择 应用信息 -->
|
||||
<div>
|
||||
<!-- 选择停车位 -->
|
||||
<vc:create path="property/viewSelectParkingSpace" callBackComponent="carAddParkingSpace"
|
||||
callBackFunction="notify"></vc:create>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox ">
|
||||
<div class="ibox-title">
|
||||
<h5>车辆信息</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">车牌号</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="carAddParkingSpaceInfo.carNum" type="text" disabled="disabled"
|
||||
placeholder="必填,请填写车牌号" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">起租时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="carAddParkingSpaceInfo.startTime" type="text"
|
||||
placeholder="必填,请填写起租时间" class="form-control startTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">结租时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="carAddParkingSpaceInfo.endTime" type="text" placeholder="必填,请填写结租时间"
|
||||
class="form-control endTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="carAddParkingSpaceInfo.remark" type="text" placeholder="请填写备注信息"
|
||||
rows="3" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10"></div>
|
||||
<div class="col-md-2 " style="margin-bottom:10px; text-align:right">
|
||||
<button type="button" class="btn btn-primary" style="margin-left:10px;" v-on:click="_submit()">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
160
public/pages/property/carAddParkingSpace/carAddParkingSpace.js
Normal file
160
public/pages/property/carAddParkingSpace/carAddParkingSpace.js
Normal file
@ -0,0 +1,160 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
vc.extends({
|
||||
data: {
|
||||
carAddParkingSpaceInfo: {
|
||||
carNum: '',
|
||||
remark: "",
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
carId: '',
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
psId: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
$that.carAddParkingSpaceInfo.carId = vc.getParam('carId');
|
||||
$that._loadCarInfo();
|
||||
$that._initDateInfo();
|
||||
},
|
||||
|
||||
_initEvent: function () {
|
||||
vc.on("carAddParkingSpace", "notify", function (_info) {
|
||||
$that.carAddParkingSpaceInfo.psId = _info.psId;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_initDateInfo: function () {
|
||||
$('.startTime').datetimepicker({
|
||||
language: 'zh-CN',
|
||||
fontAwesome: 'fa',
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
initTime: true,
|
||||
initialDate: new Date(),
|
||||
autoClose: 1,
|
||||
todayBtn: true
|
||||
|
||||
});
|
||||
$('.startTime').datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
var value = $(".startTime").val();
|
||||
vc.component.carAddParkingSpaceInfo.startTime = value;
|
||||
});
|
||||
$('.endTime').datetimepicker({
|
||||
language: 'zh-CN',
|
||||
fontAwesome: 'fa',
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
initTime: true,
|
||||
initialDate: new Date(),
|
||||
autoClose: 1,
|
||||
todayBtn: true
|
||||
});
|
||||
$('.endTime').datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
var value = $(".endTime").val();
|
||||
var start = Date.parse(new Date(vc.component.carAddParkingSpaceInfo.startTime))
|
||||
var end = Date.parse(new Date(value))
|
||||
if (start - end >= 0) {
|
||||
vc.toast("结租时间必须大于起租时间")
|
||||
$(".endTime").val('')
|
||||
} else {
|
||||
vc.component.carAddParkingSpaceInfo.endTime = value;
|
||||
}
|
||||
});
|
||||
},
|
||||
_validate: function () {
|
||||
return vc.validate.validate({
|
||||
carAddParkingSpaceInfo: vc.component.carAddParkingSpaceInfo
|
||||
}, {
|
||||
|
||||
'carAddParkingSpaceInfo.carNum': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "车牌号不能为空"
|
||||
},
|
||||
{
|
||||
limit: "maxin",
|
||||
param: "2,12",
|
||||
errInfo: "车牌号不正确"
|
||||
}
|
||||
],
|
||||
'carAddParkingSpaceInfo.startTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "起租时间不能为空"
|
||||
}
|
||||
],
|
||||
'carAddParkingSpaceInfo.endTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "结租时间不能为空"
|
||||
}
|
||||
],
|
||||
'carAddParkingSpaceInfo.psId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "车位不能为空"
|
||||
}
|
||||
]
|
||||
});
|
||||
},
|
||||
|
||||
_loadCarInfo: function () {
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 1,
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
carId: $that.carAddParkingSpaceInfo.carId
|
||||
}
|
||||
}
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('owner.queryOwnerCars',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _json = JSON.parse(json);
|
||||
let data = _json.data[0];
|
||||
data.psId = '';
|
||||
vc.copyObject(data, $that.carAddParkingSpaceInfo);
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_submit: function () {
|
||||
if (!$that._validate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'owner.carAddParkingSpace',
|
||||
JSON.stringify($that.carAddParkingSpaceInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
if (res.status == 200) {
|
||||
vc.toast("请记得收费哦!");
|
||||
//关闭model
|
||||
vc.jumpToPage("/admin.html#/pages/property/listOwnerCar");
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.toast(errInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -118,10 +118,14 @@
|
||||
{{car.stateName}}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<div class="btn-group" v-if="car.psId != '-1'">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_deleteCarParkingSpace(car)">释放车位</button>
|
||||
</div>
|
||||
<div class="btn-group" v-else>
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_addCarParkingSpace(car)">续租车位</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openEditOwnerCar(car)">修改</button>
|
||||
|
||||
@ -98,6 +98,9 @@
|
||||
|
||||
vc.toast(errInfo);
|
||||
});
|
||||
},
|
||||
_addCarParkingSpace: function (_car) {
|
||||
vc.jumpToPage('/admin.html#/pages/property/carAddParkingSpace?carId=' + _car.carId);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user