ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TWithdrawalController.java
@@ -5,14 +5,26 @@ import com.stylefeng.guns.core.common.constant.factory.PageFactory; import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; import com.stylefeng.guns.modular.system.model.TWithdrawal; import com.stylefeng.guns.modular.system.service.ITDriverService; import com.stylefeng.guns.modular.system.service.ITWithdrawalService; import com.stylefeng.guns.modular.system.util.DateUtil; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; /** @@ -52,9 +64,16 @@ @RequestMapping("/tWithdrawal_update/{tWithdrawalId}") public String tWithdrawalUpdate(@PathVariable Integer tWithdrawalId, Model model) { TWithdrawal tWithdrawal = withdrawalService.selectById(tWithdrawalId); tWithdrawal.setWithdrawalTimeStr(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(tWithdrawal.getWithdrawalTime())); tWithdrawal.setWithdrawalTypeStr(tWithdrawal.getWithdrawalType()==1?"支付宝":"银行卡"); model.addAttribute("item",tWithdrawal); LogObjectHolder.me().set(tWithdrawal); return PREFIX + "tWithdrawal_edit.html"; if(tWithdrawal.getStatus() == 1){ return PREFIX + "tWithdrawal_edit.html"; }else { return PREFIX + "tWithdrawal_detail.html"; } } /** @@ -118,5 +137,86 @@ return SUCCESS_TIP; } @RequestMapping(value = "/excel") @ResponseBody public Object excel(String insertTime, String driverName, Integer status, HttpServletResponse response) { String beginTime = null; String endTime = null; if (SinataUtil.isNotEmpty(insertTime)){ String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } List<Map<String, Object>> list = withdrawalService.excel(beginTime, endTime, driverName, status); try { String fileName = "提现管理" + System.currentTimeMillis() + ".xls"; // 文件名 String sheetName = "提现管理";// sheet名 Map<String,Object> object = null; String[] title = new String[] { "下单时间", "提现人", "提现方式", "收款人信息", "账户余额", "提现金额", "联系电话", "备注", "状态" };// 标题 String[][] values = new String[list.size()][]; for (int i = 0; i < list.size(); i++) { values[i] = new String[title.length]; // 将对象内容转换成string object = list.get(i); values[i][0] = new SimpleDateFormat("yyyy-MM-dd HH:mm").format((Date) object.get("withdrawalTime")); values[i][1] = object.get("driverName").toString(); values[i][2] = (Integer)object.get("withdrawalType")==1?"支付宝": "银行卡"; values[i][3] = (Integer)object.get("withdrawalType")==1? "收款人:"+object.get("receivePaymentName").toString()+"/n"+"支付宝号:"+object.get("receivePaymentAccount").toString() : "开户行:"+object.get("openBank").toString()+"/n"+"收款人:"+object.get("receivePaymentName").toString()+"/n"+"银行卡号:"+object.get("receivePaymentAccount").toString(); values[i][4] = new BigDecimal(object.get("driverBalance").toString()).setScale(2, RoundingMode.HALF_UP).toString(); values[i][5] = object.get("withdrawalMoney").toString(); values[i][6] = object.get("driverPhone").toString(); values[i][7] = object.get("remark")!=null?object.get("remark").toString():"-"; values[i][8] = (Integer)object.get("status")==1?"待处理":(Integer)object.get("status")==2?"成功":"失败"; } HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook(sheetName, title, values, null); this.setResponseHeader(response, fileName); OutputStream os = response.getOutputStream(); wb.write(os); os.flush(); os.close(); } catch (Exception e) { e.printStackTrace(); } return SUCCESS_TIP; } /** * 设置相应头部信息 * @param response * @param fileName * @return */ public void setResponseHeader(HttpServletResponse response, String fileName) { try { try { fileName = new String(fileName.getBytes(), "ISO8859-1"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } response.setContentType("application/octet-stream;charset=ISO8859-1"); response.setHeader("Content-Disposition", "attachment;filename=" + fileName); response.addHeader("Pargam", "no-cache"); response.addHeader("Cache-Control", "no-cache"); } catch (Exception ex) { ex.printStackTrace(); } } } ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/ExcelUtil.java
New file @@ -0,0 +1,89 @@ package com.stylefeng.guns.modular.system.controller.util; import org.apache.poi.hssf.usermodel.*; import org.springframework.util.StringUtils; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletResponse; import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.List; import java.util.Map; public class ExcelUtil { public static HSSFWorkbook getHSSFWorkbook(String sheetName, String[] title, String[][] values, HSSFWorkbook wb) { // 第一步,创建一个webbook,对应一个Excel文件 if (wb == null) { wb = new HSSFWorkbook(); } // 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet HSSFSheet sheet = wb.createSheet(sheetName); // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short HSSFRow row = sheet.createRow(0); // 第四步,创建单元格,并设置值表头 设置表头居中 HSSFCellStyle style = wb.createCellStyle(); style.setLocked(true); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式 HSSFCell cell = null; // 创建标题 for (int i = 0; i < title.length; i++) { cell = row.createCell(i); cell.setCellValue(title[i]); cell.setCellStyle(style); } // 创建内容 for (int i = 0; i < values.length; i++) { row = sheet.createRow(i + 1); for (int j = 0; j < values[i].length; j++) { cell = row.createCell(j); cell.setCellValue(values[i][j]); cell.setCellStyle(style); } } return wb; } private static BufferedImage flipImage(BufferedImage originalImage, boolean horizontalFlip, boolean verticalFlip) { AffineTransform tx = new AffineTransform(); if (horizontalFlip) { tx.scale(-1.0, 1.0); } if (verticalFlip) { tx.translate(originalImage.getWidth(null), 0); tx.scale(1.0, -1.0); } else if (horizontalFlip) { tx.translate(-originalImage.getWidth(null), 0); } AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); return op.filter(originalImage, null); } /** * 设置相应头部信息 * @param response * @param fileName * @return */ public static void setResponseHeader(HttpServletResponse response, String fileName) { try { try { fileName = new String(fileName.getBytes(), "ISO8859-1"); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } response.setContentType("application/octet-stream;charset=ISO8859-1"); response.setHeader("Content-Disposition", "attachment;filename=" + fileName); response.addHeader("Pargam", "no-cache"); response.addHeader("Cache-Control", "no-cache"); } catch (Exception ex) { ex.printStackTrace(); } } } ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TWithdrawalMapper.java
@@ -24,4 +24,11 @@ @Param("endTime")String endTime, @Param("driverName")String driverName, @Param("status")Integer status); List<Map<String, Object>> excel(@Param("beginTime")String beginTime, @Param("endTime")String endTime, @Param("driverName")String driverName, @Param("status")Integer status); } ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TWithdrawalMapper.xml
@@ -47,6 +47,37 @@ </where> order by t.withdrawalTime desc </select> <select id="excel" resultType="java.util.Map"> select t.id, t.driverId, t.receivePaymentName, t.receivePaymentAccount, t.withdrawalType, t.withdrawalMoney, t.withdrawalTime, t.status, t.openBank, t.remark, t.receiptVoucher, d.name as driverName, d.phone as driverPhone, d.balance as driverBalance from t_withdrawal t left join t_driver d on t.driverId = d.id <where> <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> and t.withdrawalTime >= CONCAT(#{beginTime},' 00:00:00') and t.withdrawalTime <= CONCAT(#{endTime},' 23:59:59') </if> <if test="driverName != null and driverName != ''"> and d.name like concat('%',#{driverName},'%') </if> <if test="status != null"> and t.status = #{status} </if> </where> order by t.withdrawalTime desc </select> </mapper> ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TWithdrawal.java
@@ -39,7 +39,11 @@ */ @TableField("withdrawalType") private Integer withdrawalType; /** * 提现方式 1=支付宝 2=银行卡 */ @TableField(exist = false) private String withdrawalTypeStr; /** * 提现金额 @@ -73,6 +77,25 @@ @TableField("receiptVoucher") private String receiptVoucher; @TableField(exist = false) private String withdrawalTimeStr; public String getWithdrawalTypeStr() { return withdrawalTypeStr; } public void setWithdrawalTypeStr(String withdrawalTypeStr) { this.withdrawalTypeStr = withdrawalTypeStr; } public String getWithdrawalTimeStr() { return withdrawalTimeStr; } public void setWithdrawalTimeStr(String withdrawalTimeStr) { this.withdrawalTimeStr = withdrawalTimeStr; } public Integer getId() { return id; } ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITWithdrawalService.java
@@ -20,4 +20,7 @@ * @return */ List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String driverName, Integer status); List<Map<String, Object>> excel(String beginTime, String endTime, String driverName, Integer status); } ManagementOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TWithdrawalServiceImpl.java
@@ -20,4 +20,9 @@ public List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String driverName, Integer status) { return this.baseMapper.getWithdrawalList(page, beginTime, endTime, driverName, status); } @Override public List<Map<String, Object>> excel(String beginTime, String endTime, String driverName, Integer status) { return this.baseMapper.excel(beginTime, endTime, driverName, status); } } ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tWithdrawal/tWithdrawal_detail.html
New file @@ -0,0 +1,82 @@ @layout("/common/_container.html"){ <div class="ibox float-e-margins"> <div class="ibox-content"> <div class="form-horizontal" id="siteInfoForm"> <input type="hidden" id="id" name="id" value="${item.id}"> <div class="row"> <div class="col-sm-6"> <div class="form-group"> <label class="col-sm-3 control-label">提现时间:</label> <label class="control-label">${item.withdrawalTimeStr}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">提现金额:</label> <label class="control-label">¥${item.withdrawalMoney}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">提现方式:</label> <label class="control-label">${item.withdrawalTypeStr}</label> </div> @if(item.withdrawalType == 1){ <div class="form-group"> <label class="col-sm-3 control-label">收款人:</label> <label class="control-label">${item.receivePaymentName}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">支付宝账号:</label> <label class="control-label">${item.receivePaymentAccount}</label> </div> @} @if(item.withdrawalType == 2){ <div class="form-group"> <label class="col-sm-3 control-label">开户行:</label> <label class="control-label">${item.openBank}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">收款人:</label> <label class="control-label">${item.receivePaymentName}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">收款账号:</label> <label class="control-label">${item.receivePaymentAccount}</label> </div> @} @if(item.status == 2){ <div class="form-group"> <label class="col-sm-3 control-label">处理:</label> <label class="control-label" style="color: #00B83F">提现成功</label> </div> <div class="form-group" id="success"> <div class="form-group"> <#avatar id="receiptVoucher" name="转账凭证:" value="${item.receiptVoucher}"/> </div> </div> @} @if(item.status == 3){ <div class="form-group"> <label class="col-sm-3 control-label">处理:</label> <label class="control-label" style="color: red">提现失败</label> </div> <div class="form-group" id="fail"> <label class="col-sm-3 control-label">备注:</label> <div class="col-sm-6 control-label"> <input type="text" class="form-control" id="remark" name="remark" value="${item.remark}" disabled> </div> </div> @} </div> </div> <div class="row btn-group-m-t"> <div class="col-sm-10 col-sm-offset-5"> <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TWithdrawalInfoDlg.close()"/> </div> </div> </div> </div> </div> <script src="${ctxPath}/static/modular/system/tWithdrawal/tWithdrawal.js"></script> <script src="${ctxPath}/static/modular/system/tWithdrawal/tWithdrawal_info.js"></script> @} ManagementOKTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tWithdrawal/tWithdrawal_edit.html
@@ -4,173 +4,65 @@ <div class="form-horizontal" id="siteInfoForm"> <input type="hidden" id="id" name="id" value="${item.id}"> <div class="row"> <div class="col-sm-12"> <div class=""> <h3 style="margin-left: 100px;">站点信息</h3> <div class="col-sm-6"> <div class="form-group"> <label class="col-sm-3 control-label">提现时间:</label> <label class="control-label">${item.withdrawalTimeStr}</label> </div> <div class="form-group"> <label class="col-sm-2 control-label">站点名称:</label> <div class="col-sm-6"> <input type="text" class="form-control" id="name" name="name" value="${item.name}"> </div> <label class="col-sm-3 control-label">提现金额:</label> <label class="control-label">¥${item.withdrawalMoney}</label> </div> <div class="form-group"> <label class="col-sm-2 control-label">所属城市:</label> <div class="col-sm-2"> <select class="form-control" id="provinceCode" onchange="TSiteInfoDlg.provinceChange(this)"> <option value="">选择省</option> @for(obj in provinceList){ <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> @} </select> <label class="col-sm-3 control-label">提现方式:</label> <label class="control-label">${item.withdrawalTypeStr}</label> </div> @if(item.withdrawalType == 1){ <div class="form-group"> <label class="col-sm-3 control-label">收款人:</label> <label class="control-label">${item.receivePaymentName}</label> </div> <div class="col-sm-2"> <select class="form-control" id="cityCode" onchange="TSiteInfoDlg.cityChange(this)"> <option value="">选择市</option> @for(obj in cityList){ <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> @} </select> <div class="form-group"> <label class="col-sm-3 control-label">支付宝账号:</label> <label class="control-label">${item.receivePaymentAccount}</label> </div> <div class="col-sm-2"> <select class="form-control" id="districtCode"> <option value="">选择区</option> @for(obj in areaList){ <option value="${obj.code}" ${obj.code == item.districtCode ? 'selected=selected' : ''}>${obj.name}</option> @} </select> @} @if(item.withdrawalType == 2){ <div class="form-group"> <label class="col-sm-3 control-label">开户行:</label> <label class="control-label">${item.openBank}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">收款人:</label> <label class="control-label">${item.receivePaymentName}</label> </div> <div class="form-group"> <label class="col-sm-3 control-label">收款账号:</label> <label class="control-label">${item.receivePaymentAccount}</label> </div> @} <div class="form-group"> <label class="col-sm-3 control-label">处理:</label> <div class="form-group col-sm-2"> <input type="radio" id="status1" name="status" value="2" checked="" onclick="TWithdrawalInfoDlg.statusClick(2)"> <label for="status1">已转账</label><br> </div> <div class="form-group col-sm-2"> <input type="radio" id="status2" name="status" value="3" onclick="TWithdrawalInfoDlg.statusClick(3)"> <label for="status2">转账失败</label><br> </div> </div> <div class=""> <h3 style="margin-left: 100px;margin-top: 70px;">站点区域</h3> </div> <div class="form-group"> <label class="col-sm-2 control-label">区域名称:</label> <div class="col-sm-2"> <input type="text" class="form-control" id="areaName" name="areaName"> </div> <label class="col-sm-1 control-label">类型:</label> <div class="col-sm-2" style="display: flex;align-items: center;"> <div class="radio radio-info radio-inline"> <input type="radio" id="areaType1" value="1" name="areaType" ${checked1} disabled onclick="TSiteInfoDlg.areaTypeClick(1)"> <label for="areaType1"> 行政区域 </label> </div> <div class="radio radio-success radio-inline"> <input type="radio" id="areaType2" value="2" name="areaType" ${checked2} disabled onclick="TSiteInfoDlg.areaTypeClick(2)"> <label for="areaType2"> 电子围栏 </label> </div> </div> <div class="col-sm-2"> <#button btnCss="info" name="添加" id="ensure" icon="fa-check" clickFun="TSiteInfoDlg.addArea()"/> <div class="form-group" id="success"> <div class="form-group"> <#avatar id="receiptVoucher" name="转账凭证:"/> </div> </div> <div class="form-group" id="areaType1Div" style="display: ${type1};"> <label class="col-sm-2 control-label">行政区域:</label> <div class="col-sm-2"> <select class="form-control" id="provinceCode1" onchange="TSiteInfoDlg.provinceChange1(this)"> <option value="">选择省</option> @for(obj in provinceList){ <option value="${obj.code}">${obj.name}</option> @} </select> </div> <div class="col-sm-2"> <select class="form-control" id="cityCode1" onchange="TSiteInfoDlg.cityChange1(this)"> <option value="">选择市</option> </select> </div> <div class="col-sm-2"> <select class="form-control" id="districtCode1"> <option value="">选择区</option> </select> </div> </div> <div class="form-group" id="areaType2Div" style="display: ${type2};"> <label class="col-sm-2 control-label">电子围栏:</label> <div class="col-sm-8"> <div id="container" style="height: 350px;width: 1000px;"></div> <div class='info' style="margin-top:10px;position: absolute; z-index: 999; left: 20px; width: 450px;">操作说明:圆和矩形通过拖拽来绘制,其他覆盖物通过点击来绘制</div> <div class="input-card" style='margin-top:28px;width: 100rem; z-index: 999; bottom: 20px;'> <div class="input-item"> <!--<input type="radio" name='func' checked="" value='marker'><span class="input-text">画点</span>--> <!--<input type="radio" name='func' value='polyline'><span class="input-text">画折线</span> --> <input type="radio" name='func' value='polygon'><span class="input-text" style='width:5rem;'>画多边形</span> <!--<input type="radio" name='func' value='rectangle'><span class="input-text" style='width:5rem;'>画矩形</span> --> <input type="radio" name='func' value='circle'><span class="input-text" style='width:5rem;'>画圆</span> </div> <div class="input-item"> <input id="clear" type="button" class="btn" value="清除" /> <input id="close" type="button" class="btn" value="关闭绘图" /> <input type="button" class="btn" value="开始编辑" onclick="editAll()" /> <input type="button" class="btn" value="结束编辑" onclick="closeEdit()" /> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label style='color:grey'>行政区边界查询</label> <div class="input-group"> <div class="input-group-btn"> <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">行政级别 </button> </div> <select id="level" class="form-control"> <option value="district">区</option> <option value="city">市</option> <option value="province">省</option> </select> </div> </div> <div class="form-group"> <div class="input-group"> <div class="input-group-btn"> <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">名称/adcode </button> </div> <input id='district' class="layui-input form-control" type="text" value=''> </div> </div> <input id="find" type="button" class="btn btn-primary btn-sm" value="查询" /> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">已添加区域</label> <div class="col-sm-6"> <div style="height: 200px; border: 1px solid #e5e6e7;overflow-y: auto;"> <table class="table table-striped table-bordered table-hover table-condensed"> <thead> <tr> <th style="width: 300px;text-align: center;">添加时间</th> <th style="width: 300px;text-align: center;">区域名称</th> <th style="width: 100px;text-align: center;">操作</th> </tr> </thead> <tbody id="areaValue"> @for(obj in locationList!){ <tr class="areaValueClass"> <td style="text-align: center;"><input type="hidden" id="areaType1" name="areaType1" value="${obj.type}"> <input type="hidden" id="time" name="time" value="${obj.addTime}">${obj.addTime}</td> <td style="text-align: center;"> <input type="hidden" id="id" name="id" value="${obj.id}"> <input type="hidden" id="name" name="name" value="${obj.name}"> <input type="hidden" id="provinceCode1" name="provinceCode1" value="${obj.provinceCode}"> <input type="hidden" id="province1" name="province1" value="${obj.province}"> <input type="hidden" id="cityCode1" name="cityCode1" value="${obj.cityCode}"> <input type="hidden" id="city1" name="city1" value="${obj.city}"> <input type="hidden" id="districtCode1" name="districtCode1" value="${obj.districtCode}"> <input type="hidden" id="district1" name="district1" value="${obj.district}"> <input type="hidden" id="coordinate1" name="coordinate1" value="${obj.coordinate}"> ${obj.name}</td> <td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td> </tr> @} </tbody> </table> </div> <div class="form-group" hidden id="fail"> <label class="col-sm-3 control-label">备注:</label> <div class="col-sm-6 control-label"> <input type="text" class="form-control" id="remark" name="remark" placeholder="请输入"> </div> </div> @@ -179,15 +71,14 @@ <div class="row btn-group-m-t"> <div class="col-sm-10 col-sm-offset-5"> <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSiteInfoDlg.editSubmit()"/> <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TSiteInfoDlg.close()"/> <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TWithdrawalInfoDlg.editSubmit()"/> <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TWithdrawalInfoDlg.close()"/> </div> </div> </div> </div> </div> <script src="https://webapi.amap.com/maps?v=1.4.15&key=c59c0ec8058a8305009eb315584e07d1&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> <script src="${ctxPath}/static/modular/system/tSite/electricFence.js"></script> <script src="${ctxPath}/static/modular/system/tSite/tSite_info.js"></script> <script src="${ctxPath}/static/modular/system/tWithdrawal/tWithdrawal.js"></script> <script src="${ctxPath}/static/modular/system/tWithdrawal/tWithdrawal_info.js"></script> @} ManagementOKTravel/guns-admin/src/main/webapp/static/modular/system/tWithdrawal/tWithdrawal.js
@@ -167,19 +167,18 @@ /** * 查看 */ TWithdrawal.detail = function () { if (this.check()) { var index = layer.open({ type: 2, title: '查看详情', area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/withdrawal/tWithdrawal_detail/' + TWithdrawal.seItem.id }); this.layerIndex = index; } TWithdrawal.detail = function (id) { var index = layer.open({ type: 2, title: '查看详情', area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/withdrawal/tWithdrawal_update/' + id }); this.layerIndex = index; }; /** * 删除分公司管理 @@ -219,7 +218,14 @@ }); } }; /** * 导出 */ TWithdrawal.export = function () { window.location.href=Feng.ctxPath + "/withdrawal/excel?insertTime="+$("#insertTime").val()+ "&driverName="+$("#driverName").val()+ "&status="+$("#status").val(); }; /** * 查询分公司管理列表 */ ManagementOKTravel/guns-admin/src/main/webapp/static/modular/system/tWithdrawal/tWithdrawal_info.js
@@ -76,7 +76,7 @@ } //提交信息 var ajax = new $ax(Feng.ctxPath + "/tWithdrawal/add", function(data){ var ajax = new $ax(Feng.ctxPath + "/withdrawal/add", function(data){ if ("error" == data){ Feng.error("登录账户已存在,请重新输入"); return; @@ -98,23 +98,17 @@ this.clearData(); this.collectData(); var serverBox =[]; $('input[name="checkbox"]:checked').each(function(){ serverBox.push($(this).val()); }); if (serverBox.length == 0){ Feng.info("请选择经营业务!"); return; } var status = $("input[name='status']:checked").val(); //提交信息 var ajax = new $ax(Feng.ctxPath + "/tWithdrawal/update", function(data){ var ajax = new $ax(Feng.ctxPath + "/withdrawal/update", function(data){ Feng.success("修改成功!"); window.parent.TWithdrawal.table.refresh(); TWithdrawalInfoDlg.close(); },function(data){ Feng.error("修改失败!" + data.responseJSON.message + "!"); }); this.set("status",status) ajax.set(TWithdrawalInfoDlg.tWithdrawalInfoData); ajax.start(); } @@ -140,6 +134,18 @@ } } TWithdrawalInfoDlg.statusClick = function (status) { console.log(status); if (2 == status){ $("#success").show(); $("#fail").hide(); } if (3 == status){ $("#fail").show(); $("#success").hide(); } } function deleteSub(e) { $(e).parent().parent().remove(); }