mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
1、时间插件更换2、为折扣设置时间限制(仅前端)
This commit is contained in:
parent
b2d4dc1feb
commit
b439368a2f
@ -26,6 +26,20 @@
|
||||
:value="item.discountId">{{item.discountName}}</option>
|
||||
</select> </div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">有效期起始时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addPayFeeConfigDiscountInfo.startTime" type="text" placeholder="必填,请填写有效期起始时间"
|
||||
class="form-control addPayFeeConfigDiscountStartTime" name="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="addPayFeeConfigDiscountInfo.endTime" type="text" placeholder="必填,请填写有效期终止时间"
|
||||
class="form-control addPayFeeConfigDiscountEndTime" name="endTime">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
|
||||
@ -12,10 +12,13 @@
|
||||
configId: '',
|
||||
discountType: '',
|
||||
discounts: [],
|
||||
startTime: '', // 新增开始时间
|
||||
endTime: '', // 结束时间
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
// 初始化方法(时间插件)
|
||||
vc.component._initAddPayFeeConfigDiscountDateInfo();
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addPayFeeConfigDiscount', 'openAddPayFeeConfigDiscountModal', function (_param) {
|
||||
@ -25,6 +28,57 @@
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 新增初始化时间插件方法
|
||||
_initAddPayFeeConfigDiscountDateInfo: function () {
|
||||
// vc.component.addPayFeeConfigDiscountInfo.startTime = vc.dateTimeFormat(new Date().getTime());
|
||||
$('.addPayFeeConfigDiscountStartTime').datetimepicker({
|
||||
language: 'zh-CN',
|
||||
fontAwesome: 'fa',
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
initTime: true,
|
||||
initialDate: new Date(),
|
||||
autoClose: 1,
|
||||
todayBtn: true
|
||||
});
|
||||
$('.addPayFeeConfigDiscountStartTime').datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
var value = $(".addPayFeeConfigDiscountStartTime").val();
|
||||
vc.component.addPayFeeConfigDiscountInfo.startTime = value;
|
||||
});
|
||||
$('.addPayFeeConfigDiscountEndTime').datetimepicker({
|
||||
language: 'zh-CN',
|
||||
fontAwesome: 'fa',
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
initTime: true,
|
||||
initialDate: new Date(),
|
||||
autoClose: 1,
|
||||
todayBtn: true
|
||||
});
|
||||
$('.addPayFeeConfigDiscountEndTime').datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
var value = $(".addPayFeeConfigDiscountEndTime").val();
|
||||
var start = Date.parse(new Date(vc.component.addPayFeeConfigDiscountInfo.startTime))
|
||||
var end = Date.parse(new Date(value))
|
||||
if (start - end >= 0) {
|
||||
vc.toast("计费终止时间必须大于计费起始时间")
|
||||
$(".addPayFeeConfigDiscountEndTime").val('')
|
||||
} else {
|
||||
vc.component.addPayFeeConfigDiscountInfo.endTime = value;
|
||||
}
|
||||
});
|
||||
//防止多次点击时间插件失去焦点
|
||||
document.getElementsByName('startTime')[0].addEventListener('click', myfunc)
|
||||
|
||||
function myfunc(e) {
|
||||
e.currentTarget.blur();
|
||||
}
|
||||
|
||||
document.getElementsByName("endTime")[0].addEventListener('click', myfunc)
|
||||
|
||||
function myfunc(e) {
|
||||
e.currentTarget.blur();
|
||||
}
|
||||
},
|
||||
addPayFeeConfigDiscountValidate() {
|
||||
return vc.validate.validate({
|
||||
addPayFeeConfigDiscountInfo: vc.component.addPayFeeConfigDiscountInfo
|
||||
@ -52,6 +106,30 @@
|
||||
param: "",
|
||||
errInfo: "折扣格式错误"
|
||||
},
|
||||
],
|
||||
'addPayFeeConfigDiscountInfo.startTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "有效期起始时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "dateTime",
|
||||
param: "",
|
||||
errInfo: "有效期起始时间不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
'addPayFeeConfigDiscountInfo.endTime': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "有效期终止时间不能为空"
|
||||
},
|
||||
{
|
||||
limit: "dateTime",
|
||||
param: "",
|
||||
errInfo: "有效期终止时间不是有效的时间格式"
|
||||
},
|
||||
]
|
||||
});
|
||||
},
|
||||
@ -68,7 +146,6 @@
|
||||
$('#addPayFeeConfigDiscountModel').modal('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
vc.http.apiPost(
|
||||
'/payFeeConfigDiscount/savePayFeeConfigDiscount',
|
||||
JSON.stringify(vc.component.addPayFeeConfigDiscountInfo),
|
||||
|
||||
1966
public/js/bootstrap/bootstrap-datetimepicker-back.js
vendored
Normal file
1966
public/js/bootstrap/bootstrap-datetimepicker-back.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3723
public/js/bootstrap/bootstrap-datetimepicker.js
vendored
3723
public/js/bootstrap/bootstrap-datetimepicker.js
vendored
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,8 @@
|
||||
<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>
|
||||
<th class="text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -39,6 +41,8 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">{{payFeeConfigDiscount.discountType == '1001'?'优惠':'违约'}}</td>
|
||||
<td class="text-center">{{payFeeConfigDiscount.startTime}}</td>
|
||||
<td class="text-center">{{payFeeConfigDiscount.endTime}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user