/**
|
* 初始化实名认证列表详情对话框
|
*/
|
var TTaxiCardInfoDlg = {
|
tTaxiCardInfoData : {}
|
};
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TTaxiCardInfoDlg.set = function(key, val) {
|
this.tTaxiCardInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
};
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TTaxiCardInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
};
|
|
/**
|
* 关闭此对话框
|
*/
|
TTaxiCardInfoDlg.close = function() {
|
parent.layer.close(window.parent.TTaxiCard.layerIndex);
|
};
|
|
/**
|
* 收集数据
|
*/
|
TTaxiCardInfoDlg.collectData = function() {
|
this.tTaxiCardInfoData['note'] = note.getContent();
|
this
|
.set('id')
|
.set('type')
|
.set('taxiCardType')
|
.set('name')
|
.set('time')
|
.set('validDate')
|
.set('discount')
|
.set('originalPrice')
|
.set('sellingPrice');
|
};
|
|
/**
|
* 清除数据
|
*/
|
TTaxiCardInfoDlg.clearData = function() {
|
this.tTaxiCardInfoData = {};
|
};
|
|
/**
|
* 提交添加
|
*/
|
TTaxiCardInfoDlg.addSubmit = function() {
|
|
if (TTaxiCardInfoDlg.dataCollectRule() === true){
|
|
// console.log(this.tTaxiCardInfoData);
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tTaxiCard/add", function(data){
|
Feng.success("添加成功!");
|
window.parent.TTaxiCard.table.refresh();
|
TTaxiCardInfoDlg.close();
|
},function(data){
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tTaxiCardInfoData);
|
ajax.start();
|
}
|
};
|
|
|
function compareDate(date1,date2){
|
var odate1 = new Date(date1);
|
var odate2 = new Date(date2);
|
return odate1.getTime() < odate2.getTime();
|
}
|
|
|
/**
|
* 提交编辑
|
*/
|
TTaxiCardInfoDlg.editSubmit = function() {
|
|
var flag = true;
|
var ajax1 = new $ax(Feng.ctxPath + '/tTaxiCard/searchPayment', function (data) {
|
if (data === "该打车卡已经产生交易记录,不允许再编辑"){
|
Feng.error("该打车卡已经产生交易记录,不允许再编辑");
|
flag = false;
|
return false;
|
}
|
});
|
ajax1.set("id",$("#id").val());
|
ajax1.start();
|
|
|
if (TTaxiCardInfoDlg.dataCollectRule() === true && flag === true) {
|
|
// console.log(this.tTaxiCardInfoData);
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tTaxiCard/edit", function (data) {
|
Feng.success("编辑成功!");
|
window.parent.TTaxiCard.table.refresh();
|
TTaxiCardInfoDlg.close();
|
}, function (data) {
|
Feng.error("编辑失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tTaxiCardInfoData);
|
ajax.start();
|
}
|
};
|
|
|
/// 切换通用卡和普通卡
|
TTaxiCardInfoDlg.changeCardType = function(t){
|
if ($(t).val() == 1){
|
$("#areaModel").show();
|
}else {
|
$("#areaModel").hide();
|
}
|
};
|
|
|
/// 数据收集规则封装
|
TTaxiCardInfoDlg.dataCollectRule = function(){
|
this.clearData();
|
this.collectData();
|
|
if ($("#name").val() === ""){
|
Feng.error("请输入优惠券名称");
|
return false;
|
}
|
|
if ($("#roleType").val() == 1){
|
if ($("#taxiCardType").val() === ""){
|
Feng.error("请选择卡类型");
|
return false;
|
}
|
|
if ($("#taxiCardType").val() == 1){
|
if (!$("#companyCityId").val()){
|
Feng.error("请选择适用地区");
|
return false;
|
}
|
|
var arrr = $("#companyCityId").val();
|
var arrrcopy = "";
|
for (let i = 0; i < arrr.length; i++) {
|
arrrcopy += arrr[i] + ";";
|
}
|
this.tTaxiCardInfoData['companyCityId'] = arrrcopy.slice(0,arrrcopy.length-1);
|
}
|
}else {
|
if (!$("#companyCityId").val()){
|
Feng.error("请选择适用地区");
|
return false;
|
}
|
|
var arrr = $("#companyCityId").val();
|
var arrrcopy = "";
|
for (let i = 0; i < arrr.length; i++) {
|
arrrcopy += arrr[i] + ";";
|
}
|
this.tTaxiCardInfoData['companyCityId'] = arrrcopy.slice(0,arrrcopy.length-1);
|
}
|
|
if ($("#type").val() === ""){
|
Feng.error("请选择优惠卡类型");
|
return false;
|
}
|
if ($("#validDate").val() === ""){
|
Feng.error("请输入有效期");
|
return false;
|
}
|
if ($("#originalPrice").val() === ""){
|
Feng.error("请输入原价");
|
return false;
|
}
|
if ($("#sellingPrice").val() === ""){
|
Feng.error("请输入售价");
|
return false;
|
}
|
if (note.getContent() === ""){
|
Feng.error("请输入其他信息");
|
return false;
|
}
|
|
var type = $('#type').val();
|
|
if (type == 1){ /// 打折次数卡
|
if ($("#time").val() === ""){
|
Feng.error("请输入次数");
|
return false;
|
}
|
if ($("#discount").val() === ""){
|
Feng.error("请输入折扣");
|
return false;
|
}
|
if (!$("#businessTypes").val()){
|
Feng.error("请选择服务类型");
|
return false;
|
}
|
|
var length = $('input[name="timeCount"]').length;
|
|
var array = [];
|
if (length == 1){
|
var str = '';
|
if ($("#startTime1").val() === ""){
|
str += '00:00:00';
|
}else {
|
str += $("#startTime1").val();
|
}
|
|
str += ' - ';
|
|
if ($("#endTime1").val() === ""){
|
str += '23:59:59';
|
}else {
|
str += $("#endTime1").val();
|
}
|
array.push(str);
|
}else {
|
for (let i = 1; i <= length; i++) {
|
if ($("#startTime" + i).val() === "" || $("#endTime" + i).val() === ""){
|
Feng.error("请完善适用时间段");
|
return false;
|
}
|
|
if (compareDate("2022-02-25 " + $("#startTime" + i).val(),"2022-02-25 " + $("#endTime" + i).val()) === false){
|
Feng.error("请核对使用时间段,开始时间不能大于结束时间");
|
return false;
|
}
|
array.push($("#startTime" + i).val() + ' - ' + $("#endTime" + i).val());
|
}
|
}
|
|
|
var arr = $("#businessTypes").val();
|
var arrcopy = [];
|
for (let i = 0; i < arr.length; i++) {
|
arrcopy.push(parseInt(arr[i]));
|
}
|
|
var content = {};
|
content.businessTypes = arrcopy;
|
content.time = parseInt(this.tTaxiCardInfoData['time']);
|
content.timeQuantum = array;
|
content.discount = parseFloat(this.tTaxiCardInfoData['discount']);
|
this.tTaxiCardInfoData['content'] = JSON.stringify(content);
|
}else if (type == 2){ /// 优惠卡
|
if (!$("#businessTypes").val()){
|
Feng.error("请选择服务类型");
|
return false;
|
}
|
|
var length = $('input[name="timeCount"]').length;
|
|
var length1 = $('input[name="moneyCount"]').length;
|
|
var checkModel = [];
|
for (let i = 1; i <= length1; i++) {
|
if ($("#money" + i).val() !== ""){
|
checkModel.push($("#money" + i).val());
|
}
|
}
|
|
|
var nary = checkModel.sort();
|
for (var i = 0; i < checkModel.length; i++) {
|
if (nary[i] == nary[i + 1]) {
|
Feng.error("消费金额门槛设置重复,请调整设置");
|
return false;
|
}
|
}
|
|
|
var moneyArr = [];
|
for (let i = 1; i <= length1; i++) {
|
if ($("#money" + i).val() === "" || $("#moneys" + i).val() === ""){
|
Feng.error("请完善满减信息");
|
return false;
|
}
|
var moneyArr1 = [];
|
moneyArr1.push(parseFloat($("#money" + i).val()));
|
moneyArr1.push(parseFloat($("#moneys" + i).val()));
|
moneyArr.push(moneyArr1);
|
}
|
|
for (let i = 0; i < moneyArr.length-1; i++) {
|
for(var j = i+1; j < moneyArr.length; j++){
|
if(moneyArr[i][0] > moneyArr[j][0]){
|
// 因为需要交换值,所以会把后一个值替换,我们要先保存下来
|
var index = moneyArr[j];
|
// 交换值
|
moneyArr[j] = moneyArr[i];
|
moneyArr[i] = index;
|
}
|
}
|
}
|
|
var array = [];
|
if (length == 1){
|
var str = '';
|
if ($("#startTime1").val() === ""){
|
str += '00:00:00';
|
}else {
|
str += $("#startTime1").val();
|
}
|
|
str += ' - ';
|
|
if ($("#endTime1").val() === ""){
|
str += '23:59:59';
|
}else {
|
str += $("#endTime1").val();
|
}
|
array.push(str);
|
}else {
|
for (let i = 1; i <= length; i++) {
|
if ($("#startTime" + i).val() === "" || $("#endTime" + i).val() === ""){
|
Feng.error("请完善适用时间段");
|
return false;
|
}
|
|
if (compareDate("2022-02-25 " + $("#startTime" + i).val(),"2022-02-25 " + $("#endTime" + i).val()) === false){
|
Feng.error("请核对使用时间段,开始时间不能大于结束时间");
|
return false;
|
}
|
array.push($("#startTime" + i).val() + ' - ' + $("#endTime" + i).val());
|
}
|
}
|
|
var arr = $("#businessTypes").val();
|
var arrcopy = [];
|
for (let i = 0; i < arr.length; i++) {
|
arrcopy.push(parseInt(arr[i]));
|
}
|
|
var content = {};
|
content.businessTypes = arrcopy;
|
// content.time = parseInt(this.tTaxiCardInfoData['time']);
|
content.timeQuantum = array;
|
// content.discount = parseInt(this.tTaxiCardInfoData['discount']);
|
content.fullReduction = moneyArr;
|
this.tTaxiCardInfoData['content'] = JSON.stringify(content);
|
}else if (type == 3){ /// 次数卡
|
if (!$("#businessTypes").val()){
|
Feng.error("请选择服务类型");
|
return false;
|
}
|
if ($("#time").val() === ""){
|
Feng.error("请输入次数");
|
return false;
|
}
|
if ($("#reduceMoney").val() === ""){
|
Feng.error("请输入优惠金额");
|
return false;
|
}
|
var length = $('input[name="timeCount"]').length;
|
|
var array = [];
|
if (length == 1){
|
var str = '';
|
if ($("#startTime1").val() === ""){
|
str += '00:00:00';
|
}else {
|
str += $("#startTime1").val();
|
}
|
|
str += ' - ';
|
|
if ($("#endTime1").val() === ""){
|
str += '23:59:59';
|
}else {
|
str += $("#endTime1").val();
|
}
|
array.push(str);
|
}else {
|
for (let i = 1; i <= length; i++) {
|
if ($("#startTime" + i).val() === "" || $("#endTime" + i).val() === ""){
|
Feng.error("请完善适用时间段");
|
return false;
|
}
|
|
if (compareDate("2022-02-25 " + $("#startTime" + i).val(),"2022-02-25 " + $("#endTime" + i).val()) === false){
|
Feng.error("请核对使用时间段,开始时间不能大于结束时间");
|
return false;
|
}
|
array.push($("#startTime" + i).val() + ' - ' + $("#endTime" + i).val());
|
}
|
}
|
|
var arr = $("#businessTypes").val();
|
var arrcopy = [];
|
for (let i = 0; i < arr.length; i++) {
|
arrcopy.push(parseInt(arr[i]));
|
}
|
|
var content = {};
|
content.businessTypes = arrcopy;
|
content.timeQuantum = array;
|
content.time = parseInt(this.tTaxiCardInfoData['time']);
|
content.discountAmount = parseFloat($("#reduceMoney").val());
|
// content.discount = parseInt(this.tTaxiCardInfoData['discount']);
|
// content.fullReduction = moneyArr;
|
this.tTaxiCardInfoData['content'] = JSON.stringify(content);
|
}else if (type == 4){ /// 打折天数卡
|
if (!$("#businessTypes").val()){
|
Feng.error("请选择服务类型");
|
return false;
|
}
|
if ($("#discount").val() === ""){
|
Feng.error("请输入折扣");
|
return false;
|
}
|
var length = $('input[name="timeCount"]').length;
|
|
var array = [];
|
if (length == 1){
|
var str = '';
|
if ($("#startTime1").val() === ""){
|
str += '00:00:00';
|
}else {
|
str += $("#startTime1").val();
|
}
|
|
str += ' - ';
|
|
if ($("#endTime1").val() === ""){
|
str += '23:59:59';
|
}else {
|
str += $("#endTime1").val();
|
}
|
array.push(str);
|
}else {
|
for (let i = 1; i <= length; i++) {
|
if ($("#startTime" + i).val() === "" || $("#endTime" + i).val() === ""){
|
Feng.error("请完善适用时间段");
|
return false;
|
}
|
|
if (compareDate("2022-02-25 " + $("#startTime" + i).val(),"2022-02-25 " + $("#endTime" + i).val()) === false){
|
Feng.error("请核对使用时间段,开始时间不能大于结束时间");
|
return false;
|
}
|
array.push($("#startTime" + i).val() + ' - ' + $("#endTime" + i).val());
|
}
|
}
|
|
var arr = $("#businessTypes").val();
|
var arrcopy = [];
|
for (let i = 0; i < arr.length; i++) {
|
arrcopy.push(parseInt(arr[i]));
|
}
|
|
var content = {};
|
content.businessTypes = arrcopy;
|
// content.time = parseInt(this.tTaxiCardInfoData['time']);
|
// content.discountAmount = parseInt($("#reduceMoney").val());
|
content.discount = parseFloat(this.tTaxiCardInfoData['discount']);
|
content.timeQuantum = array;
|
// content.fullReduction = moneyArr;
|
this.tTaxiCardInfoData['content'] = JSON.stringify(content);
|
}else if (type == 5){ /// 物流打折卡
|
if (!$("#businessTypes").val()){
|
Feng.error("请选择服务类型");
|
return false;
|
}
|
if ($("#discount").val() === ""){
|
Feng.error("请输入折扣");
|
return false;
|
}
|
|
var arr = $("#businessTypes").val();
|
var arrcopy = [];
|
for (let i = 0; i < arr.length; i++) {
|
arrcopy.push(parseInt(arr[i]));
|
}
|
|
var content = {};
|
content.businessTypes = arrcopy;
|
// content.time = parseInt(this.tTaxiCardInfoData['time']);
|
// content.discountAmount = parseInt($("#reduceMoney").val());
|
content.discount = parseFloat(this.tTaxiCardInfoData['discount']);
|
// content.timeQuantum = array;
|
// content.fullReduction = moneyArr;
|
this.tTaxiCardInfoData['content'] = JSON.stringify(content);
|
}else if (type == 6){ /// 优惠包
|
var length1 = $('input[name="couponsCount"]').length;
|
|
var couponsArr = [];
|
for (let i = 1; i <= length1; i++) {
|
if ($("#coupons" + i).val() === "" || $("#couponss" + i).val() === ""){
|
Feng.error("请完善赠送优惠券信息");
|
return false;
|
}
|
var arr = [];
|
arr.push(parseInt($("#coupons" + i).val()));
|
arr.push(parseInt($("#couponsId" + i).val()));
|
couponsArr.push(arr);
|
}
|
|
var content = {};
|
// content.businessTypes = arrcopy;
|
content.coupons = couponsArr;
|
this.tTaxiCardInfoData['content'] = JSON.stringify(content);
|
}
|
|
return true;
|
};
|
|
|
/**
|
* 新增优惠卡的使用时间段
|
*/
|
TTaxiCardInfoDlg.addTimeDuring = function () {
|
var length = $('input[name="timeCount"]').length + 1;
|
|
var html = '<div class="form-group"><label class="col-sm-2 control-label"></label>' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + length + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>' +
|
'<input type="hidden" name="timeCount">' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + length + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeTimeDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
|
$("#timeDuring").append(html);
|
|
//时间选择器
|
laydate.render({
|
elem: '#startTime' + length
|
,type: 'time'
|
});
|
laydate.render({
|
elem: '#endTime' + length
|
,type: 'time'
|
});
|
};
|
|
/**
|
* 移除优惠卡的使用时间段
|
*/
|
TTaxiCardInfoDlg.removeTimeDuring = function (t) {
|
$(t).parent('div').parent('div').remove();
|
};
|
|
|
/**
|
* 增加优惠卡满减模块
|
*/
|
TTaxiCardInfoDlg.addMoneyDuring = function(){
|
var length = $('input[name="moneyCount"]').length + 1;
|
|
var html = '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">消费满</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="money' + length + '">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="moneyCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">元,优惠</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -50px">\n' +
|
' <input class="form-control" id="moneys' + length + '">\n' +
|
' </div>\n' +
|
' <label class="col-sm-1" style="top: 6px">元</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeMoneyDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
|
$("#moneyModel").append(html);
|
};
|
|
|
/**
|
* 移除优惠卡满减模块
|
*/
|
TTaxiCardInfoDlg.removeMoneyDuring = function(t){
|
$(t).parent('div').parent('div').remove();
|
};
|
|
|
/**
|
* 新增优惠包赠送优惠券模块
|
*/
|
TTaxiCardInfoDlg.addCouponsDuring = function(){
|
var length = $('input[name="couponsCount"]').length + 1;
|
|
var html = '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">送</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <input class="form-control" id="coupons' + length + '" ' +
|
'onkeyup="this.value=this.value.replace(/\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="couponsCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">张</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -90px">\n';
|
// ' <select data-style="btn-primary" title="请选择或搜索" class="selectpicker show-tick form-control" data-live-search="true" id="couponss' + length + '">\n';
|
|
/// 查询优惠券
|
// var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/searchCoupons', function (data) {
|
// for (let i = 0; i < data.length; i++) {
|
// html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
// }
|
// });
|
// ajax.start();
|
|
// html += ' </select>\n' +
|
html += '<input type="hidden" id="couponsId' + length + '"><input class="form-control" onclick="TTaxiCardInfoDlg.checkCoupons(this)" id="couponss' + length + '" placeholder="请选择优惠券">' +
|
' </div>\n' +
|
// ' <label class="col-sm-1" style="top: 6px">优惠券</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeCouponsDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
|
|
$("#couponsModel").append(html);
|
|
$("#couponss" + length).selectpicker('refresh');
|
};
|
|
/**
|
* 移除优惠包赠送优惠券模块
|
*/
|
TTaxiCardInfoDlg.removeCouponsDuring = function(t){
|
$(t).parent('div').parent('div').remove();
|
};
|
|
|
/**
|
* 根据服务类型查询优惠卡类型
|
*/
|
TTaxiCardInfoDlg.searchBusinessTypes = function () {
|
var type = $('#type').val();
|
|
var html = '';
|
|
var modelHtml = '';
|
if (type == 1){ /// 打折次数卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
modelHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">次数</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')" id="time">\n' +
|
' </div>\n' +
|
' <label class="control-label">次</label>\n' +
|
' </div>';
|
|
$("#serviceModel").show();
|
$("#timeDuring").show();
|
$("#discountModel").show();
|
}else if (type == 2){ /// 优惠卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
modelHtml += '<div id="moneyModel" style="margin-top: 50px">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">消费满</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="money1">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="moneyCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">元,优惠</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -50px">\n' +
|
' <input class="form-control" id="moneys1">\n' +
|
' </div>\n' +
|
' <label class="col-sm-1" style="top: 6px">元</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addMoneyDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div><br/><br/>';
|
|
$("#serviceModel").show();
|
$("#timeDuring").show();
|
$("#discountModel").hide();
|
}else if (type == 3){ /// 次数卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
modelHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">次数</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="time" onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <label class="control-label">次</label>\n' +
|
' </div>\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">优惠金额</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="reduceMoney">\n' +
|
' </div>\n' +
|
' <label class="control-label">元</label>\n' +
|
' </div>';
|
|
$("#serviceModel").show();
|
$("#timeDuring").show();
|
$("#discountModel").hide();
|
}else if (type == 4){ /// 打折天数卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
$("#serviceModel").show();
|
$("#timeDuring").show();
|
$("#discountModel").show();
|
}else if (type == 5){ /// 物流打折卡
|
html += '<option value="4">同城小件物流</option>' +
|
'<option value="5">跨城小件物流</option>';
|
|
$("#serviceModel").show();
|
$("#timeDuring").hide();
|
$("#discountModel").show();
|
}else if (type == 6){ /// 优惠包
|
modelHtml += '<div id="couponsModel" style="margin-top: 50px">\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">送</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <input class="form-control" id="coupons1" onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="couponsCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">张</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -90px">\n';
|
// ' <select data-style="btn-primary" title="请选择或搜索" class="selectpicker show-tick form-control" id="couponss1" data-live-search="true">\n';
|
|
// 查询优惠券
|
// var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/searchCoupons', function (data) {
|
// for (let i = 0; i < data.length; i++) {
|
// modelHtml += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
// }
|
// });
|
// ajax.start();
|
|
// modelHtml += '</select>\n' +
|
modelHtml += '<input type="hidden" id="couponsId1"><input class="form-control" onclick="TTaxiCardInfoDlg.checkCoupons(this)" id="couponss1" placeholder="请选择优惠券">' +
|
' </div>\n' +
|
// ' <label class="col-sm-1" style="top: 6px">优惠券</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addCouponsDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div><br/><br/>';
|
|
$("#timeDuring").hide();
|
$("#discountModel").hide();
|
$("#serviceModel").hide();
|
}
|
|
$("#businessTypes").empty();
|
$("#businessTypes").append(html);
|
$("#businessTypes").selectpicker('refresh');
|
// $('#couponssss1 .selectpicker').selectpicker('refresh');
|
|
/// 更换模块
|
$("#changeModel").empty();
|
$("#changeModel").append(modelHtml);
|
// if (type == 6){
|
// $("#couponss1").selectpicker('refresh');
|
// }
|
};
|
|
TTaxiCardInfoDlg.checkCoupons = function (t) {
|
|
var s = $(t).attr("id");
|
var num = s.replace(/[^0-9]/ig,"");
|
|
var index = layer.open({
|
type: 2,
|
title: '选择优惠券',
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tTaxiCard/openCheckCoupons/' + num
|
});
|
this.layerIndex = index;
|
};
|
|
///参数跨js回传
|
TTaxiCardInfoDlg.rollBackCheck = function (id,name,num) {
|
$("#couponsId" + num).val(id);
|
$("#couponss" + num).val(name);
|
};
|
|
|
function commonReview(type,data) {
|
var json = JSON.parse(data);
|
|
|
var html = '';
|
var modelHtml = '';
|
if (type == 1){ /// 打折次数卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
modelHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">次数</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="time" value="' + json.time + '" ' +
|
'onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <label class="control-label">次</label>\n' +
|
' </div>';
|
|
$("#discount").val(json.discount);
|
|
/// 注入使用时间段
|
var timeQuantum = json.timeQuantum;
|
|
for (let i = 0; i < timeQuantum.length; i++) {
|
var timeHtml = '';
|
var arr = timeQuantum[i].split(" - ");
|
if (i == 0){
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">使用时间段</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addTimeDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}else {
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label"></label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeTimeDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}
|
|
$("#timeDuring").append(timeHtml);
|
|
//时间选择器
|
laydate.render({
|
elem: '#startTime' + (i+1)
|
,type: 'time'
|
,value: arr[0]
|
});
|
laydate.render({
|
elem: '#endTime' + (i+1)
|
,type: 'time'
|
,value: arr[1]
|
});
|
}
|
|
$("#discountModel").show();
|
}else if (type == 2){ /// 优惠卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
var arrs = json.fullReduction;
|
modelHtml += '<div id="moneyModel" style="margin-top: 50px">\n';
|
for (let i = 0; i < arrs.length; i++) {
|
if (i == 0){
|
modelHtml += ' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">消费满</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="money1" value="' + arrs[i][0] + '">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="moneyCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">元,优惠</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -50px">\n' +
|
' <input class="form-control" id="moneys1" value="' + arrs[i][1] + '">\n' +
|
' </div>\n' +
|
' <label class="col-sm-1" style="top: 6px">元</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addMoneyDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>\n';
|
}else {
|
modelHtml += ' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">消费满</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="money' + (i+1) + '" value="' + arrs[i][0] + '">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="moneyCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">元,优惠</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -50px">\n' +
|
' <input class="form-control" id="moneys' + (i+1) + '" value="' + arrs[i][1] + '">\n' +
|
' </div>\n' +
|
' <label class="col-sm-1" style="top: 6px">元</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeMoneyDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>\n';
|
}
|
}
|
modelHtml += '</div><br/><br/>';
|
|
/// 注入使用时间段
|
var timeQuantum = json.timeQuantum;
|
for (let i = 0; i < timeQuantum.length; i++) {
|
var timeHtml = '';
|
var arr = timeQuantum[i].split(" - ");
|
if (i == 0){
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">使用时间段</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addTimeDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}else {
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label"></label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeTimeDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}
|
|
$("#timeDuring").append(timeHtml);
|
//时间选择器
|
laydate.render({
|
elem: '#startTime' + (i+1)
|
,type: 'time'
|
,value: arr[0]
|
});
|
laydate.render({
|
elem: '#endTime' + (i+1)
|
,type: 'time'
|
,value: arr[1]
|
});
|
}
|
|
$("#discountModel").hide();
|
}else if (type == 3){ /// 次数卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
modelHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">次数</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="time" value="' + json.time + '" ' +
|
'onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <label class="control-label">次</label>\n' +
|
' </div>\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">优惠金额</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <input class="form-control" id="reduceMoney" value="' + json.discountAmount + '">\n' +
|
' </div>\n' +
|
' <label class="control-label">元</label>\n' +
|
' </div>';
|
|
/// 注入使用时间段
|
var timeQuantum = json.timeQuantum;
|
for (let i = 0; i < timeQuantum.length; i++) {
|
var timeHtml = '';
|
var arr = timeQuantum[i].split(" - ");
|
if (i == 0){
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">使用时间段</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addTimeDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}else {
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label"></label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeTimeDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}
|
|
$("#timeDuring").append(timeHtml);
|
//时间选择器
|
laydate.render({
|
elem: '#startTime' + (i+1)
|
,type: 'time'
|
,value: arr[0]
|
});
|
laydate.render({
|
elem: '#endTime' + (i+1)
|
,type: 'time'
|
,value: arr[1]
|
});
|
}
|
|
$("#discountModel").hide();
|
}else if (type == 4){ /// 打折天数卡
|
html += '<option value="1">快车</option>' +
|
'<option value="2">出租车</option>' +
|
'<option value="3">跨城出行</option>';
|
|
$("#discount").val(json.discount);
|
|
/// 注入使用时间段
|
var timeQuantum = json.timeQuantum;
|
for (let i = 0; i < timeQuantum.length; i++) {
|
var timeHtml = '';
|
var arr = timeQuantum[i].split(" - ");
|
if (i == 0){
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">使用时间段</label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addTimeDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}else {
|
timeHtml += '<div class="form-group">\n' +
|
' <label class="col-sm-2 control-label"></label>\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="startTime' + (i+1) + '" placeholder="开始时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <input type="hidden" name="timeCount">\n' +
|
' <div class="col-sm-2">\n' +
|
' <div class="layui-inline">\n' +
|
' <div class="layui-input-inline">\n' +
|
' <input type="text" class="layui-input" id="endTime' + (i+1) + '" placeholder="结束时间">\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 8px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeTimeDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>';
|
}
|
|
$("#timeDuring").append(timeHtml);
|
//时间选择器
|
laydate.render({
|
elem: '#startTime' + (i+1)
|
,type: 'time'
|
,value: arr[0]
|
});
|
laydate.render({
|
elem: '#endTime' + (i+1)
|
,type: 'time'
|
,value: arr[1]
|
});
|
}
|
|
$("#discountModel").show();
|
}else if (type == 5){ /// 物流打折卡
|
html += '<option value="4">同城小件物流</option>' +
|
'<option value="5">跨城小件物流</option>';
|
|
$("#discount").val(json.discount);
|
|
$("#timeDuring").hide();
|
$("#discountModel").show();
|
}else if (type == 6){
|
// var length = $('input[name="couponsCount"]').length + 1;
|
|
var arrs = json.coupons;
|
modelHtml += '<div id="couponsModel" style="margin-top: 50px">\n';
|
for (let i = 0; i < arrs.length; i++) {
|
if (i == 0){
|
modelHtml += ' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">送</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <input class="form-control" id="coupons1" value="' + arrs[i][0] + '" ' +
|
'onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="couponsCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">张</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -90px">\n';
|
// ' <select data-style="btn-primary" title="请选择或搜索" class="selectpicker show-tick form-control" id="couponss1" data-live-search="true">\n';
|
|
/// 查询优惠券
|
// var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/searchCoupons', function (data) {
|
// for (let i = 0; i < data.length; i++) {
|
// modelHtml += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
|
// }
|
// });
|
// ajax.start();
|
|
/// 查询优惠券
|
var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/searchCouponsById', function (data) {
|
modelHtml += '<input type="hidden" id="couponsId1" value="' + arrs[i][1] + '"><input value="' + data.name + '" class="form-control" onclick="TTaxiCardInfoDlg.checkCoupons(this)" id="couponss1" placeholder="请选择优惠券">' +
|
' </div>\n';
|
});
|
ajax.set("id",arrs[i][1]);
|
ajax.start();
|
|
modelHtml += '<div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-plus" onclick="TTaxiCardInfoDlg.addCouponsDuring()"></span>\n' +
|
' </div>\n' +
|
' </div>\n';
|
|
}else {
|
modelHtml += ' <div class="form-group">\n' +
|
' <label class="col-sm-2 control-label">送</label>\n' +
|
' <div class="col-sm-1">\n' +
|
' <input class="form-control" id="coupons' + (i+1) + '" value="' + arrs[i][0] + '" ' +
|
'onkeyup="this.value=this.value.replace(/\\D/g,\'\').replace(/^0{1,}/g,\'\')">\n' +
|
' </div>\n' +
|
' <input type="hidden" name="couponsCount">\n' +
|
' <label class="col-sm-1" style="top: 6px">张</label>\n' +
|
' <div class="col-sm-2" style="margin-left: -90px">\n';
|
// ' <select data-style="btn-primary" title="请选择或搜索" class="selectpicker show-tick form-control" id="couponss' + (i+1) + '" data-live-search="true">\n';
|
|
/// 查询优惠券
|
var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/searchCouponsById', function (data) {
|
modelHtml += '<input type="hidden" id="couponsId' + (i+1) + '" value="' + arrs[i][1] + '"><input value="' + data.name + '" class="form-control" onclick="TTaxiCardInfoDlg.checkCoupons(this)" id="couponss' + (i+1) + '" placeholder="请选择优惠券">' +
|
' </div>\n';
|
});
|
ajax.set("id",arrs[i][1]);
|
ajax.start();
|
|
modelHtml += '<div class="col-sm-1">\n' +
|
' <span style="font-size: 20px;top: 6px" class="glyphicon glyphicon-remove" onclick="TTaxiCardInfoDlg.removeCouponsDuring(this)"></span>\n' +
|
' </div>\n' +
|
' </div>\n';
|
|
}
|
}
|
modelHtml += '</div><br/><br/>';
|
|
$("#timeDuring").hide();
|
$("#discountModel").hide();
|
$("#serviceModel").hide();
|
}
|
|
$("#businessTypes").empty();
|
$("#businessTypes").append(html);
|
$("#businessTypes").selectpicker('refresh');
|
|
/// 更换模块
|
$("#changeModel").empty();
|
$("#changeModel").append(modelHtml);
|
|
if (type == 6){
|
/// 注入优惠券
|
var couponsArr = json.coupons;
|
for (let i = 0; i < couponsArr.length; i++) {
|
$("#couponss" + (i+1)).selectpicker('val',couponsArr[i][1]);
|
}
|
}
|
|
/// 回显注入服务类型
|
$('#businessTypes').selectpicker('val',json.businessTypes);
|
$('#businessTypes .selectpicker').selectpicker('refresh');
|
}
|
|
|
var note = null;
|
|
$(function() {
|
|
//初始化编辑器
|
note = UE.getEditor('note',{
|
enterTag: "<p><br /></p>"
|
});
|
|
if ($("#viewIdentity").val() === "myself"){
|
var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/initSuitCity', function (data) {
|
var html = '';
|
|
for (let i = 0; i < data.length; i++) {
|
var arr = data[i].split(";");
|
html += '<option value="' + arr[0] + '">' + arr[1] + '</option>';
|
}
|
|
$('#companyCityId').append(html);
|
$('#companyCityId .selectpicker').selectpicker('refresh');
|
});
|
ajax.start();
|
}else if ($("#viewIdentity").val() === "you"){
|
var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/initSuitCityBranch', function (data) {
|
var html = '';
|
|
for (let i = 0; i < data.length; i++) {
|
var arr = data[i].split(";");
|
html += '<option value="' + arr[0] + '">' + arr[1] + '</option>';
|
}
|
|
$('#companyCityId').append(html);
|
$('#companyCityId .selectpicker').selectpicker('refresh');
|
});
|
ajax.set("id",$("#id").val());
|
ajax.start();
|
}
|
|
if ($("#html").val() == 2){
|
/// 回显注入适用地区
|
$('#companyCityId').selectpicker('val',$("#companyCityId1").val().split(";"));
|
$('#companyCityId .selectpicker').selectpicker('refresh');
|
|
/// 回显注入优惠卡类型
|
var type = $('#type1').val();
|
$('#type').val(type);
|
|
/// 请求content对应的json字符串
|
var ajax = new $ax(Feng.ctxPath + '/tTaxiCard/searchContent', function (data) {
|
commonReview(type,data);
|
});
|
ajax.set("id",$("#id").val());
|
ajax.start();
|
|
/// 注入通用卡或者普通卡
|
$("#taxiCardType").val($("#taxiCardType1").val());
|
}
|
});
|