From 47fae47ca4155a1645cb6f8fbdbc0f83df39cf68 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期一, 27 五月 2024 14:47:32 +0800 Subject: [PATCH] 行程录音 --- ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape_info.js | 139 ++++++++++++ ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderTapeController.java | 105 +++++++++ ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape.js | 238 +++++++++++++++++++++ ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTapeMapper.java | 21 + ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape.html | 52 ++++ ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml | 30 ++ ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTapeServiceImpl.java | 8 ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTapeService.java | 16 + ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_add.html | 10 ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_edit.html | 10 10 files changed, 629 insertions(+), 0 deletions(-) diff --git a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderTapeController.java b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderTapeController.java new file mode 100644 index 0000000..d2e1bc9 --- /dev/null +++ b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderTapeController.java @@ -0,0 +1,105 @@ +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; + } + +} diff --git a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTapeMapper.java b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTapeMapper.java index d021089..1c26b42 100644 --- a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTapeMapper.java +++ b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTapeMapper.java @@ -1,8 +1,13 @@ 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> @@ -14,4 +19,20 @@ */ 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); } diff --git a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml index 641d374..3875635 100644 --- a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml +++ b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml @@ -20,5 +20,35 @@ <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> diff --git a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTapeService.java b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTapeService.java index ad554f1..87d5a9c 100644 --- a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTapeService.java +++ b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTapeService.java @@ -1,8 +1,12 @@ 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> @@ -14,4 +18,16 @@ */ 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); + } diff --git a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTapeServiceImpl.java b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTapeServiceImpl.java index e24a57e..30b2203 100644 --- a/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTapeServiceImpl.java +++ b/ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTapeServiceImpl.java @@ -1,5 +1,6 @@ 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; @@ -8,6 +9,9 @@ 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> @@ -20,4 +24,8 @@ @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); + } } diff --git a/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape.html b/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape.html new file mode 100644 index 0000000..41f4ff5 --- /dev/null +++ b/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape.html @@ -0,0 +1,52 @@ +@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> +@} diff --git a/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_add.html b/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_add.html new file mode 100644 index 0000000..ea5b3e7 --- /dev/null +++ b/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_add.html @@ -0,0 +1,10 @@ +@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> +@} diff --git a/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_edit.html b/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_edit.html new file mode 100644 index 0000000..ea5b3e7 --- /dev/null +++ b/ManagementNTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTape/tOrderTape_edit.html @@ -0,0 +1,10 @@ +@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> +@} diff --git a/ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape.js b/ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape.js new file mode 100644 index 0000000..2e92e94 --- /dev/null +++ b/ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape.js @@ -0,0 +1,238 @@ +/** + * 行程录音管理管理初始化 + */ +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(); +}); diff --git a/ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape_info.js b/ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape_info.js new file mode 100644 index 0000000..eedcad4 --- /dev/null +++ b/ManagementNTTravel/guns-admin/src/main/webapp/static/modular/system/tOrderTape/tOrderTape_info.js @@ -0,0 +1,139 @@ +/** + * 初始化车辆类型管理详情对话框 + */ +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); +}); -- Gitblit v1.7.1