物业普遍反馈 车辆 品牌和颜色 改成可选

This commit is contained in:
java110 2022-06-01 16:52:45 +08:00
parent eb040ae0ca
commit 2b182598f3
4 changed files with 75 additions and 112 deletions

View File

@ -16,7 +16,7 @@
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="车品牌" namespace="addCar"></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="addCarInfo.carBrand" type="text" :placeholder="vc.i18n('必填,请填写车品牌,如 宝马X6','addCar')" class="form-control">
<input v-model="addCarInfo.carBrand" type="text" :placeholder="vc.i18n('可选,请填写车品牌,如 宝马X6','addCar')" class="form-control">
</div>
</div>
<div class="form-group row">
@ -33,7 +33,7 @@
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="颜色" namespace="addCar"></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="addCarInfo.carColor" type="text" :placeholder="vc.i18n('必填,请填写车颜色,如白色','addCar')" class="form-control">
<input v-model="addCarInfo.carColor" type="text" :placeholder="vc.i18n('可选,请填写车颜色,如白色','addCar')" class="form-control">
</div>
</div>
<div class="form-group row">
@ -63,8 +63,7 @@
<div class="form-group row" v-if="item.specType == '2233'">
<label class="col-sm-2 col-form-label">{{item.specName}}</label>
<div class="col-sm-10">
<input v-model="item.value" type="text" :placeholder="item.specHoldplace"
class="form-control">
<input v-model="item.value" type="text" :placeholder="item.specHoldplace" class="form-control">
</div>
</div>
<div class="form-group row" v-if="item.specType == '3344'">

View File

@ -90,27 +90,21 @@
}
],
'addCarInfo.carBrand': [{
limit: "required",
param: "",
errInfo: "车品牌不能为空"
},
{
limit: "maxLength",
param: "50",
errInfo: "车品牌超出限制"
}
],
limit: "maxLength",
param: "50",
errInfo: "车品牌超出限制"
}],
'addCarInfo.carType': [{
limit: "required",
param: "",
errInfo: "车类型不能为空"
}],
// 'addCarInfo.value': [{
// limit: "required",
// param: "",
// errInfo: "是否是预约车不能为空"
// }],
// 'addCarInfo.value': [{
// limit: "required",
// param: "",
// errInfo: "是否是预约车不能为空"
// }],
'addCarInfo.startTime': [{
limit: "required",
param: "",
@ -122,16 +116,10 @@
errInfo: "结租时间不能为空"
}],
'addCarInfo.carColor': [{
limit: "required",
param: "",
errInfo: "车颜色不能为空"
},
{
limit: "maxLength",
param: "12",
errInfo: "车颜色超出限制"
}
]
limit: "maxLength",
param: "12",
errInfo: "车颜色超出限制"
}]
});
},
_loadCarAttrSpec: function() {
@ -157,7 +145,7 @@
});
});
},
saveAddCarInfo: function () {
saveAddCarInfo: function() {
let _carNumType = $that.addCarInfo.carNumType;
if (_carNumType == 'S') {
$that.addCarInfo.startTime = vc.dateTimeFormat(new Date().getTime());

View File

@ -17,7 +17,7 @@
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="车品牌" namespace="editCar"></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="editCarInfo.carBrand" type="text" :placeholder="vc.i18n('必填,请填写车品牌,如 宝马X6','editCar')" class="form-control">
<input v-model="editCarInfo.carBrand" type="text" :placeholder="vc.i18n('可选,请填写车品牌,如 宝马X6','editCar')" class="form-control">
</div>
</div>
<div class="form-group row">
@ -32,7 +32,7 @@
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name="颜色" namespace="editCar"></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="editCarInfo.carColor" type="text" :placeholder="vc.i18n('必填,请填写车颜色,如白色','editCar')" class="form-control">
<input v-model="editCarInfo.carColor" type="text" :placeholder="vc.i18n('可选,请填写车颜色,如白色','editCar')" class="form-control">
</div>
</div>
<div class="form-group row">
@ -67,4 +67,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,13 +1,13 @@
/**
权限组
**/
(function (vc) {
(function(vc) {
vc.extends({
data: {
editCarInfo: {
carId: '',
memberId:'',
memberId: '',
carNum: '',
carBrand: '',
carType: '',
@ -17,8 +17,7 @@
endTime: '',
carNumType: ''
},
carTypes: [
{
carTypes: [{
key: '9901',
value: '家用小汽车'
},
@ -32,36 +31,37 @@
}
]
},
_initMethod: function () {
_initMethod: function() {
var param = {
params: {
name: 'owner_car',
type: 'car_type'
params: {
name: 'owner_car',
type: 'car_type'
}
}
}
//发送get请求
//发送get请求
vc.http.get('hireParkingSpace',
'listCarType',
param,
function (json, res) {
function(json, res) {
var carTypes = JSON.parse(json);
vc.component.carTypes = carTypes;
}, function (errInfo, error) {
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
//vc.component._initEditCarDateInfo();
},
_initEvent: function () {
vc.on('editCar', 'openEditCar', function (_carInfo) {
_initEvent: function() {
vc.on('editCar', 'openEditCar', function(_carInfo) {
vc.copyObject(_carInfo, $that.editCarInfo);
if (_carInfo.startTime.indexOf(":") > -1) {
$that.editCarInfo.startTime = $that.editCarInfo.startTime.substring(0,10);
$that.editCarInfo.startTime = $that.editCarInfo.startTime.substring(0, 10);
}
if (_carInfo.endTime.indexOf(":") > -1) {
$that.editCarInfo.endTime = $that.editCarInfo.endTime.substring(0,10);
$that.editCarInfo.endTime = $that.editCarInfo.endTime.substring(0, 10);
}
$('#editCarModal').modal('show');
vc.component._initEditCarDateInfo();
@ -69,13 +69,12 @@
},
methods: {
editCarValidate: function () {
editCarValidate: function() {
return vc.validate.validate({
editCarInfo: vc.component.editCarInfo
}, {
'editCarInfo.carNum': [
{
'editCarInfo.carNum': [{
limit: "required",
param: "",
errInfo: "车牌号不能为空"
@ -86,61 +85,39 @@
errInfo: "车牌号不正确"
}
],
'editCarInfo.carBrand': [
{
limit: "required",
param: "",
errInfo: "车品牌不能为空"
},
{
limit: "maxLength",
param: "50",
errInfo: "车品牌超出限制"
}
],
'editCarInfo.carType': [
{
limit: "required",
param: "",
errInfo: "车类型不能为空"
}
],
'editCarInfo.startTime': [
{
limit: "required",
param: "",
errInfo: "起租时间不能为空"
}
],
'editCarInfo.endTime': [
{
limit: "required",
param: "",
errInfo: "结租时间不能为空"
}
],
'editCarInfo.carColor': [
{
limit: "required",
param: "",
errInfo: "车颜色不能为空"
},
{
limit: "maxLength",
param: "12",
errInfo: "车颜色超出限制"
}
],
'editCarInfo.memberId': [
{
limit: "required",
param: "",
errInfo: "车辆数据错误"
}
],
'editCarInfo.carBrand': [{
limit: "maxLength",
param: "50",
errInfo: "车品牌超出限制"
}],
'editCarInfo.carType': [{
limit: "required",
param: "",
errInfo: "车类型不能为空"
}],
'editCarInfo.startTime': [{
limit: "required",
param: "",
errInfo: "起租时间不能为空"
}],
'editCarInfo.endTime': [{
limit: "required",
param: "",
errInfo: "结租时间不能为空"
}],
'editCarInfo.carColor': [{
limit: "maxLength",
param: "12",
errInfo: "车颜色超出限制"
}],
'editCarInfo.memberId': [{
limit: "required",
param: "",
errInfo: "车辆数据错误"
}],
});
},
_submitEditCarInfo: function () {
_submitEditCarInfo: function() {
if (!vc.component.editCarValidate()) {
vc.toast(vc.validate.errInfo);
return;
@ -150,11 +127,10 @@
vc.http.apiPost(
'owner.editOwnerCar',
JSON.stringify(vc.component.editCarInfo),
{
JSON.stringify(vc.component.editCarInfo), {
emulateJSON: true
},
function (json, res) {
function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
if (res.status == 200) {
//关闭model
@ -169,13 +145,13 @@
}
vc.toast(json);
},
function (errInfo, error) {
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
_initEditCarDateInfo: function () {
_initEditCarDateInfo: function() {
//vc.component.editCarInfo.startTime = vc.dateTimeFormat(new Date().getTime());
$('.editCarStartTime').datetimepicker({
minView: "month",
@ -189,7 +165,7 @@
});
$('.editCarStartTime').datetimepicker()
.on('changeDate', function (ev) {
.on('changeDate', function(ev) {
var value = $(".editCarStartTime").val();
vc.component.editCarInfo.startTime = value;
});
@ -204,7 +180,7 @@
todayBtn: true
});
$('.editCarEndTime').datetimepicker()
.on('changeDate', function (ev) {
.on('changeDate', function(ev) {
var value = $(".editCarEndTime").val();
var start = Date.parse(new Date(vc.component.editCarInfo.startTime))
var end = Date.parse(new Date(value))