Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/XianNingChuXing
| | |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITWithdrawalService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | /** |
| | | * 提现相关控制器 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/withdrawal") |
| | | @Controller |
| | | @RequestMapping("/withdrawal") |
| | | public class TWithdrawalController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String receivePaymentName, |
| | | String driverName, |
| | | Integer status) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(withdrawalService.getWithdrawalList(page,beginTime,endTime,receivePaymentName,status)); |
| | | page.setRecords(withdrawalService.getWithdrawalList(page,beginTime,endTime,driverName,status)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | * @param page |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param receivePaymentName |
| | | * @param driverName |
| | | * @param status |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getWithdrawalList(@Param("page") Page<Map<String, Object>> page, |
| | | @Param("beginTime")String beginTime, |
| | | @Param("endTime")String endTime, |
| | | @Param("receivePaymentName")String receivePaymentName, |
| | | @Param("driverName")String driverName, |
| | | @Param("status")Integer status); |
| | | } |
| | |
| | | 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 >= #{beginTime} and t.withdrawalTime <= #{endTime} |
| | | and t.withdrawalTime >= CONCAT(#{beginTime},' 00:00:00') and t.withdrawalTime <= CONCAT(#{endTime},' 23:59:59') |
| | | </if> |
| | | <if test="receivePaymentName != null and receivePaymentName != ''"> |
| | | and t.receivePaymentName like concat('%',#{receivePaymentName},'%') |
| | | <if test="driverName != null and driverName != ''"> |
| | | and d.name like concat('%',#{driverName},'%') |
| | | </if> |
| | | <if test="status != null"> |
| | | and t.status = #{status} |
| | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TCompany{" + |
| | | return "TWithdrawal{" + |
| | | "id=" + id + |
| | | ", isSpe=" + isSpe + |
| | | ", isTaxi=" + isTaxi + |
| | |
| | | * @param page |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param receivePaymentName |
| | | * @param driverName |
| | | * @param status |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String receivePaymentName, Integer status); |
| | | List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String driverName, Integer status); |
| | | } |
| | |
| | | public class TWithdrawalServiceImpl extends ServiceImpl<TWithdrawalMapper, TWithdrawal> implements ITWithdrawalService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String receivePaymentName, Integer status) { |
| | | return this.baseMapper.getWithdrawalList(page, beginTime, endTime, receivePaymentName, status); |
| | | 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); |
| | | } |
| | | } |
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="insertTime" name="添加时间" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="driverName" name="提现人" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="status" name="提现状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">待处理</option> |
| | | <option value="2">成功</option> |
| | | <option value="3">失败</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TWithdrawal.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TWithdrawal.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TWithdrawalTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tWithdrawal/export")){ |
| | | <#button name="导出" icon="" clickFun="TWithdrawal.export()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TWithdrawalTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tWithdrawal/tWithdrawal.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#insertTime' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @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-12"> |
| | | <div class=""> |
| | | <h3 style="margin-left: 100px;">站点信息</h3> |
| | | </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> |
| | | </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> |
| | | </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> |
| | | <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> |
| | | </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> |
| | | </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> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <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()"/> |
| | | </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> |
| | | @} |
New file |
| | |
| | | /** |
| | | * 分公司管理管理初始化 |
| | | */ |
| | | var TWithdrawal = { |
| | | id: "TWithdrawalTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TWithdrawal.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '申请时间', field: 'withdrawalTime', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.withdrawalTime != '' && row.withdrawalTime != null) { |
| | | var time = row.withdrawalTime.replace(" ",'<br>'); |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.withdrawalTime + '" onfocus="TUser.tooltip()">' + time + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '提现人', field: 'driverName', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.driverName != '' && row.driverName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.driverName + '" onfocus="TUser.tooltip()">' + row.driverName + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '提现方式', field: 'withdrawalType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.withdrawalType != '' && row.withdrawalType != null) { |
| | | if (row.withdrawalType == 1){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: black;" title="待处理" onfocus="TUser.tooltip()">支付宝</p>'] |
| | | }else { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="银行卡" onfocus="TUser.tooltip()">银行卡</p>'] |
| | | } |
| | | } else{ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="-" onfocus="TUser.tooltip()">-</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '收款人信息', field: 'receivePaymentName', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.receivePaymentName != '' && row.receivePaymentName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.receivePaymentName + '" onfocus="TUser.tooltip()">' + row.receivePaymentName + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '账户余额', field: 'driverBalance', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.driverBalance != '' && row.driverBalance != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.driverBalance + '" onfocus="TUser.tooltip()">' + row.driverBalance + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '提现金额', field: 'withdrawalMoney', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.withdrawalMoney != '' && row.withdrawalMoney != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.withdrawalMoney + '" onfocus="TUser.tooltip()">' + row.withdrawalMoney + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '联系电话', field: 'driverPhone', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.driverPhone != '' && row.driverPhone != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.driverPhone + '" onfocus="TUser.tooltip()">' + row.driverPhone + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.remark != '' && row.remark != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.remark + '" onfocus="TUser.tooltip()">' + row.remark + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle',width:'10%', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.status != '' && row.status != null) { |
| | | if (row.status == 1){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: black;" title="待处理" onfocus="TUser.tooltip()">待处理</p>'] |
| | | }else if (row.status == 2){ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: forestgreen;" title="转账成功" onfocus="TUser.tooltip()">转账成功</p>'] |
| | | }else { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color: red;" title="转账失败" onfocus="TUser.tooltip()">转账失败</p>'] |
| | | } |
| | | } else{ |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="-" onfocus="TUser.tooltip()">-</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | { |
| | | title: '操作', visible: true, align: 'center', valign: 'middle', formatter: function (value, row, index) { |
| | | return '<button type="button" class="btn btn-primary button-margin" onclick="TWithdrawal.detail(' + row.id + ')" id=""><i class="fa fa-search"></i> 详情</button>'; } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TWithdrawal.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TWithdrawal.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加分公司管理 |
| | | */ |
| | | TWithdrawal.openAddTWithdrawal = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加分公司', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/withdrawal/tWithdrawal_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看分公司管理详情 |
| | | */ |
| | | TWithdrawal.openTWithdrawalDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑分公司', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/withdrawal/tWithdrawal_update/' + TWithdrawal.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查看 |
| | | */ |
| | | 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.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TWithdrawal.seItem.name; |
| | | if (nickname == "" || nickname == null || nickname == undefined) { |
| | | nickname = "该分公司"; |
| | | } else { |
| | | nickname = "【" + nickname + "】"; |
| | | } |
| | | var franchiseeNum = TWithdrawal.seItem.franchiseeNum; |
| | | var carNumber = TWithdrawal.seItem.carNumber; |
| | | var driverNumber = TWithdrawal.seItem.driverNumber; |
| | | if (parseInt(franchiseeNum) > 0 ||parseInt(carNumber) > 0 || parseInt(driverNumber) > 0){ |
| | | swal("操作失败", nickname + "下还有加盟商或车辆或司机!", "warning"); |
| | | return; |
| | | } |
| | | swal({ |
| | | title: "您是否确认删除" + nickname + "?", |
| | | text: "请谨慎操作,删除后数据无法恢复!", |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: "删除", |
| | | closeOnConfirm: false |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/withdrawal/delete", function (data) { |
| | | swal("删除成功", "您已经删除了" + nickname + "。", "success"); |
| | | TWithdrawal.table.refresh(); |
| | | }, function (data) { |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("tWithdrawalId", TWithdrawal.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询分公司管理列表 |
| | | */ |
| | | TWithdrawal.search = function () { |
| | | var queryData = {}; |
| | | queryData['insertTime'] = $("#insertTime").val(); |
| | | queryData['driverName'] = $("#driverName").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | TWithdrawal.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TWithdrawal.resetSearch = function () { |
| | | $("#insertTime").val(""); |
| | | $("#driverName").val(""); |
| | | $("#status").val(""); |
| | | TWithdrawal.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TWithdrawal.initColumn(); |
| | | var table = new BSTable(TWithdrawal.id, "/withdrawal/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TWithdrawal.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化分公司管理详情对话框 |
| | | */ |
| | | var TWithdrawalInfoDlg = { |
| | | tWithdrawalInfoData : {}, |
| | | editor: null, |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TWithdrawalInfoDlg.clearData = function() { |
| | | this.tWithdrawalInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TWithdrawalInfoDlg.set = function(key, val) { |
| | | this.tWithdrawalInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TWithdrawalInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TWithdrawalInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TWithdrawal.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TWithdrawalInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('driverId') |
| | | .set('receivePaymentName') |
| | | .set('receivePaymentAccount') |
| | | .set('withdrawalType') |
| | | .set('withdrawalMoney') |
| | | .set('withdrawalTime') |
| | | .set('status') |
| | | .set('openBank') |
| | | .set('remark') |
| | | .set('receiptVoucher'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TWithdrawalInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | var serverBox =[]; |
| | | $('input[name="checkbox"]:checked').each(function(){ |
| | | serverBox.push($(this).val()); |
| | | }); |
| | | if (serverBox.length == 0){ |
| | | Feng.info("请选择经营业务!"); |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tWithdrawal/add", function(data){ |
| | | if ("error" == data){ |
| | | Feng.error("登录账户已存在,请重新输入"); |
| | | return; |
| | | } |
| | | Feng.success("添加成功!"); |
| | | window.parent.TWithdrawal.table.refresh(); |
| | | TWithdrawalInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(TWithdrawalInfoDlg.tWithdrawalInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TWithdrawalInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | var serverBox =[]; |
| | | $('input[name="checkbox"]:checked').each(function(){ |
| | | serverBox.push($(this).val()); |
| | | }); |
| | | if (serverBox.length == 0){ |
| | | Feng.info("请选择经营业务!"); |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tWithdrawal/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TWithdrawal.table.refresh(); |
| | | TWithdrawalInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(TWithdrawalInfoDlg.tWithdrawalInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | // 初始化图片上传 |
| | | var receiptVoucher = new $WebUpload("receiptVoucher"); |
| | | receiptVoucher.setUploadBarId("progressBar"); |
| | | receiptVoucher.init(); |
| | | }); |
| | | |
| | | function regexp(value, msg){ |
| | | var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数 两位小数 |
| | | //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 |
| | | if(reg.test(value)){ |
| | | if(value == 0){ |
| | | Feng.error(msg+"请输入大于0的整数或保留两位小数"); |
| | | return; |
| | | } |
| | | }else{ |
| | | Feng.error(msg+"请输入整数或保留两位小数"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | function deleteSub(e) { |
| | | $(e).parent().parent().remove(); |
| | | } |