Merge remote-tracking branch 'origin/master'
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriverFacialFail; |
| | | import com.stylefeng.guns.modular.system.model.TOrderTape; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderTapeService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 行程录音管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 14:31:28 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderTape") |
| | | public class TOrderTapeController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderTape/"; |
| | | |
| | | @Autowired |
| | | private ITOrderTapeService tOrderTapeService; |
| | | |
| | | /** |
| | | * 跳转到行程录音管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOrderTape.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取行程录音管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String fileName, |
| | | String orderNum, |
| | | String state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(createTime)){ |
| | | String[] timeArray = createTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tOrderTapeService.getOrderTapeList(page,beginTime,endTime,fileName,orderNum,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 删除行程录音管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderTapeId) { |
| | | TOrderTape tOrderTape = tOrderTapeService.selectById(tOrderTapeId); |
| | | tOrderTape.setIsDelete(2); |
| | | tOrderTapeService.updateById(tOrderTape); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除行程录音管理 |
| | | */ |
| | | @RequestMapping(value = "/deleteBatch") |
| | | @ResponseBody |
| | | public Object deleteBatch(@RequestParam String tOrderTapeIds) { |
| | | |
| | | if(!StringUtils.hasLength(tOrderTapeIds)){ |
| | | return ResultUtil.error("请选择要删除的数据"); |
| | | } |
| | | |
| | | String[] split = tOrderTapeIds.split(","); |
| | | List<Integer> orderTapeIds = new ArrayList<>(); |
| | | for (String s : split) { |
| | | orderTapeIds.add(Integer.valueOf(s)); |
| | | } |
| | | |
| | | List<TOrderTape> orderTapes = tOrderTapeService.selectList(new EntityWrapper<TOrderTape>() |
| | | .in("id", orderTapeIds)); |
| | | orderTapes.forEach(item -> { |
| | | item.setIsDelete(2); |
| | | }); |
| | | tOrderTapeService.updateBatchById(orderTapes); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.modular.system.model.TOrderTape; |
| | | import com.stylefeng.guns.modular.system.model.TPhone; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOrderTapeMapper extends BaseMapper<TOrderTape> { |
| | | |
| | | /** |
| | | * 行程录音分页列表 |
| | | * @param page |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param fileName |
| | | * @param orderNum |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getOrderTapeList(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("beginTime")String beginTime, |
| | | @Param("endTime")String endTime, |
| | | @Param("fileName")String fileName, |
| | | @Param("orderNum")String orderNum, |
| | | @Param("state")String state); |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id,orderId,orderType,fileLink,fileName,fileFormat,fileSize,afterTime,insertTime,isDelete |
| | | </sql> |
| | | <select id="getOrderTapeList" resultType="java.util.Map"> |
| | | SELECT tot.id,tot.orderId,tot.orderType,tot.fileLink,tot.fileName,tot.fileFormat,tot.fileSize,tot.afterTime,tot.insertTime,tot.isDelete,o.orderNum, |
| | | (case when tot.afterTime <= now() then 2 when tot.afterTime >= now() then 1 end) as state |
| | | from t_order_tape tot |
| | | LEFT JOIN |
| | | ( |
| | | SELECT id,orderNum,isDelete,1 as orderType from t_order_private_car |
| | | UNION ALL |
| | | SELECT id,orderNum,isDelete,3 as orderType from t_order_cross_city |
| | | UNION ALL |
| | | SELECT id,orderNum,isDelete,7 as orderType from t_order_transfer |
| | | ) o |
| | | on tot.orderId = o.id |
| | | where tot.isDelete = 1 and o.isDelete = 1 and tot.orderType = o.orderType |
| | | <if test="beginTime != null and endTime != null"> |
| | | and tot.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59') |
| | | </if> |
| | | <if test="fileName != null and fileName != ''"> |
| | | and tot.fileName like concat('%',#{fileName},'%') |
| | | </if> |
| | | <if test="orderNum != null and orderNum != ''"> |
| | | and o.orderNum like concat('%',#{orderNum},'%') |
| | | </if> |
| | | <if test="state != null and state == 1"> |
| | | and tot.afterTime >= now() |
| | | </if> |
| | | <if test="state != null and state == 2"> |
| | | and tot.afterTime <= now() |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.TOrderTape; |
| | | import com.stylefeng.guns.modular.system.model.TPhone; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ITOrderTapeService extends IService<TOrderTape> { |
| | | |
| | | /** |
| | | * 行程录音分页列表 |
| | | * @param page |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param fileName |
| | | * @param orderNum |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getOrderTapeList(Page<Map<String, Object>> page, String beginTime, String endTime, String fileName, String orderNum, String state); |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.TOrderTapeMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TPhoneMapper; |
| | |
| | | import com.stylefeng.guns.modular.system.service.ITOrderTapeService; |
| | | import com.stylefeng.guns.modular.system.service.ITPhoneService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TOrderTapeServiceImpl extends ServiceImpl<TOrderTapeMapper, TOrderTape> implements ITOrderTapeService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getOrderTapeList(Page<Map<String, Object>> page, String beginTime, String endTime, String fileName, String orderNum, String state) { |
| | | return this.baseMapper.getOrderTapeList(page, beginTime, endTime, fileName, orderNum, state); |
| | | } |
| | | } |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>行程录音管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="createTime" name="添加时间" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="fileName" name="文件名" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="orderNum" name="订单号" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">未过期</option> |
| | | <option value="2">已过期</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TOrderTape.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TOrderTape.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TOrderTapeTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tOrderTape/deleteBatch")){ |
| | | <#button name="批量删除" icon="fa-remove" clickFun="TOrderTape.deleteBatch()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TOrderTapeTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tOrderTape/tOrderTape.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="orderTapeInfoForm"> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tOrderTape/tOrderTape_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="orderTapeInfoForm"> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tOrderTape/tOrderTape_info.js"></script> |
| | | @} |
New file |
| | |
| | | /** |
| | | * 行程录音管理管理初始化 |
| | | */ |
| | | var TOrderTape = { |
| | | id: "TOrderTapeTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TOrderTape.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: false}, |
| | | {title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.insertTime != '' && row.insertTime != null) { |
| | | var time = row.insertTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.insertTime + '" onfocus="TUser.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '过期时间', field: 'afterTime', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.afterTime != '' && row.afterTime != null) { |
| | | var time = row.afterTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.afterTime + '" onfocus="TUser.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '文件名', field: 'fileName', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.fileName != '' && row.fileName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.fileName + '" onfocus="TUser.tooltip()">' + row.fileName + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '文件格式', field: 'fileFormat', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '文件大小', field: 'fileSize', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.fileSize != '' && row.fileSize != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.fileSize + '" onfocus="TUser.tooltip()">' + row.fileSize + "mb" + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '关联订单', field: 'orderNum', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.orderNum != '' && row.orderNum != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.orderNum + '" onfocus="TUser.tooltip()">' + row.orderNum + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.state != '' && row.state != null) { |
| | | if(row.state == 1){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.state + '" onfocus="TUser.tooltip()"> 未过期 </p>'] |
| | | }else { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red" title="' + row.state + '" onfocus="TUser.tooltip()"> 已过期 </p>'] |
| | | } |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:'16%', |
| | | formatter: function (value, row) { |
| | | return '<a href="#" onclick="TOrderTape.orderDetail('+row.orderId+','+row.orderType+')" style="color:cornflowerblue">查看订单</a>' +' ' + |
| | | '<a href="#" onclick="TOrderTape.openTCharteredServiceDetail('+row.id+')" style="color:cornflowerblue">播放录音</a>' +' ' + |
| | | '<a href="#" onclick="TOrderTape.delete('+row.id+')" style="color:cornflowerblue">删除</a>' |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TOrderTape.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TOrderTape.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看订单详情 |
| | | */ |
| | | TOrderTape.orderDetail = function (id,orderType) { |
| | | if(orderType == 1){ |
| | | console.log("专车订单详情"); |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '专车订单详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tOrderPrivateCar/tOrderPrivateCar_orderDetail/' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }else if(orderType == 2){ |
| | | console.log("直通车出行订单详情"); |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '直通车出行订单详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tOrderCrossCity/tOrderCrossCity_detail/' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }else { |
| | | console.log("接送机订单详情"); |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '接送机订单详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tOrderTransfer/tOrderTransfer_orderDetail/' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除行程录音管理 |
| | | */ |
| | | TOrderTape.delete = function (id, nickname) { |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该录音"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: "您是否确认删除"+ nickname + "?", |
| | | text: "请谨慎操作,删除后数据无法恢复!", |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: "删除", |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tOrderTape/delete", function (data) { |
| | | swal("删除成功", "您已经删除了" + nickname + "。", "success"); |
| | | TOrderTape.table.refresh(); |
| | | }, function (data) { |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("tOrderTapeId", id); |
| | | ajax.start(); |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 批量删除行程录音管理 |
| | | */ |
| | | TOrderTape.deleteBatch = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | var ids = ''; |
| | | if (selected.length > 0) { |
| | | for (var i = 0; i < selected.length; i++) { |
| | | ids += selected[i]['id'] + ","; |
| | | } |
| | | ids = ids.substring(0, ids.length - 1); |
| | | } |
| | | console.log(ids); |
| | | if(this.check()){ |
| | | var nickname = TOrderTape.seItem.name; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该录音"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: "您是否确认删除"+ nickname + "?", |
| | | text: "请谨慎操作,删除后数据无法恢复!", |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: "删除", |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tOrderTape/deleteBatch", function (data) { |
| | | swal("删除成功", "您已经删除了" + nickname + "。", "success"); |
| | | TOrderTape.table.refresh(); |
| | | }, function (data) { |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("tOrderTapeIds", ids); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询行程录音管理列表 |
| | | */ |
| | | TOrderTape.search = function () { |
| | | var queryData = {}; |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | queryData['fileName'] = $("#fileName").val(); |
| | | queryData['orderNum'] = $("#orderNum").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | TOrderTape.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TOrderTape.resetSearch = function () { |
| | | $("#createTime").val(""); |
| | | $("#fileName").val(""); |
| | | $("#orderNum").val(""); |
| | | $("#state").val(""); |
| | | TOrderTape.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TOrderTape.initColumn(); |
| | | var table = new BSTable(TOrderTape.id, "/tOrderTape/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TOrderTape.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化车辆类型管理详情对话框 |
| | | */ |
| | | var TOrderTapeInfoDlg = { |
| | | tOrderTapeInfoData : {}, |
| | | validateFields: { |
| | | name: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '类型名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | seat: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '座位数不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^[1-9]\d*$/, |
| | | message: '座位数不正确' |
| | | } |
| | | } |
| | | }, |
| | | brandId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择所属车辆品牌' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TOrderTapeInfoDlg.validate = function () { |
| | | $('#orderTapeInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#orderTapeInfoForm').bootstrapValidator('validate'); |
| | | return $("#orderTapeInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TOrderTapeInfoDlg.clearData = function() { |
| | | this.tOrderTapeInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TOrderTapeInfoDlg.set = function(key, val) { |
| | | this.tOrderTapeInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TOrderTapeInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TOrderTapeInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TOrderTape.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TOrderTapeInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('name') |
| | | .set('remark') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('seat') |
| | | .set('brandId'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TOrderTapeInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tOrderTape/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TOrderTape.table.refresh(); |
| | | TOrderTapeInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tOrderTapeInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TOrderTapeInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tOrderTape/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TOrderTape.table.refresh(); |
| | | TOrderTapeInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tOrderTapeInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("orderTapeInfoForm", TOrderTapeInfoDlg.validateFields); |
| | | }); |