| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.service.PakoutService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | |
| | | return R.ok("拣货单删除成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pakout/deleteDetl/auth") |
| | | @ManagerAuth(memo = "手动删除订单") |
| | | public R deleteDetl(@RequestParam String wrkNo){ |
| | | try{ |
| | | pakoutService.deletePakoutByWrkNo(wrkNo); |
| | | }catch (Exception e){ |
| | | return R.error(e+""); |
| | | } |
| | | return R.ok("拣货单删除成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pakout/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | |
| | | |
| | | for (Pla pla : plas){ |
| | | |
| | | if(pla.getStockFreeze() == 0){ |
| | | throw new CoolException("库存已被冻结,请重新选择库存"); |
| | | } |
| | | |
| | | allOrderWeight += pla.getOrderWeight(); |
| | | |
| | | if(pla.getWeightAnfme() - pla.getQtyAnfme() - pla.getOrderWeight() < 0){ |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/updateStockFreeze") |
| | | @Transactional |
| | | @ManagerAuth(memo = "库位冻结") |
| | | public R updateStockFreeze(@RequestBody List<Pla> plas){ |
| | | if (Cools.isEmpty(plas)){ |
| | | return R.error("无数据"); |
| | | } |
| | | for (Pla pla : plas){ |
| | | if (pla.getStockFreeze() == 0){ |
| | | throw new CoolException("库存已被冻结!"); |
| | | } |
| | | pla.setStockFreeze(0); |
| | | pla.setStockFreezeBy(getUser().getUsername()); |
| | | pla.setStockFreezeDate(new Date()); |
| | | pla.setModifyTime(new Date()); |
| | | plaService.updateById(pla); |
| | | } |
| | | return R.ok("冻结成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/updateStockDisFreeze") |
| | | @ManagerAuth(memo = "库位解冻") |
| | | public R updateStockDisFreeze(@RequestBody List<Pla> plas){ |
| | | if (Cools.isEmpty(plas)){ |
| | | return R.error("无数据"); |
| | | } |
| | | for (Pla pla : plas){ |
| | | if (pla.getStockFreeze() == 1){ |
| | | throw new CoolException("库位未冻结,无需解冻"); |
| | | } |
| | | if(!Cools.eq(pla.getStockFreezeBy(),getUser().getUsername())){ |
| | | throw new CoolException("无法解冻其他用户冻结的库位"); |
| | | } |
| | | pla.setStockFreeze(1); |
| | | pla.setStockFreezeBy(getUser().getUsername()); |
| | | pla.setStockFreezeDate(new Date()); |
| | | pla.setModifyTime(new Date()); |
| | | plaService.updateById(pla); |
| | | |
| | | } |
| | | return R.ok("解除冻结成功"); |
| | | } |
| | | |
| | | /** |
| | | * excel导入模板下载 |
| | | */ |
| | |
| | | @TableField("memo") |
| | | private String memo; |
| | | |
| | | @TableField("stock_freeze") |
| | | private int stockFreeze; |
| | | |
| | | @TableField("stock_freeze_by") |
| | | private String stockFreezeBy; |
| | | |
| | | @TableField("stock_freeze_date") |
| | | private Date stockFreezeDate; |
| | | |
| | | public String getPakinTime$() { |
| | | if (Cools.isEmpty(this.pakinTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.pakinTime); |
| | | } |
| | | |
| | | public String getStockFreezeDate$() { |
| | | if (Cools.isEmpty(this.stockFreezeDate)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd").format(this.stockFreezeDate); |
| | | } |
| | | } |
| | |
| | | public interface PakoutService extends IService<Pakout> { |
| | | |
| | | void deletePakout(String docNum); |
| | | |
| | | void deletePakoutByWrkNo(String wrkNo); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.GlobleParameter; |
| | | import com.zy.asrs.mapper.PakoutMapper; |
| | | import com.zy.asrs.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | throw new RuntimeException("拣货单删除失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void deletePakoutByWrkNo(String wrkNo) { |
| | | Pakout pakout = this.selectById(wrkNo); |
| | | //更新单据信息 |
| | | if(pakout.getCount() > 0){ |
| | | throw new CoolException("该条拣货信息已完成,无法删除"); |
| | | } |
| | | OrderDetl orderDetl = orderDetlService.selectById(pakout.getDocId()); |
| | | orderDetl.setWorkQty(orderDetl.getWorkQty() - pakout.getAnfme()); |
| | | orderDetl.setUpdateTime(new Date()); |
| | | orderDetlService.updateById(orderDetl); |
| | | |
| | | Order order = orderService.selectByNo(pakout.getDocNum()); |
| | | List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(order.getId()); |
| | | //判断单据是否有正在作业的任务,true为没有 |
| | | boolean flag = true; |
| | | for (OrderDetl od : orderDetlList){ |
| | | if(od.getWorkQty() + od.getQty() > 0){ |
| | | flag = false; |
| | | } |
| | | } |
| | | |
| | | if(flag){ |
| | | order.setSettle(1L); |
| | | order.setUpdateTime(new Date()); |
| | | orderService.updateById(order); |
| | | } |
| | | |
| | | //更新pla信息 |
| | | Pla pla = plaService.selectByBatchAndPackageNo(pakout.getBatch(), pakout.getBarcode()); |
| | | pla.setQtyAnfme(pla.getQtyAnfme() - pakout.getAnfme()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | pla.setModifyTime(new Date()); |
| | | plaService.updateById(pla); |
| | | |
| | | //更新plaQty信息 |
| | | plaQtyService.deleteById(pakout.getNodeId()); |
| | | |
| | | //删除拣货单 |
| | | this.deleteById(wrkNo); |
| | | |
| | | } |
| | | } |
| | |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'type', align: 'center',title: '类型'} |
| | | ,{field: 'type', align: 'center',title: '类型',hide:true} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'value', align: 'center',title: '值'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'} |
| | | ,{field: 'id', align: 'center',title: 'id', hide:true} |
| | | ,{field: 'wrkNo', align: 'center',title: 'id', hide:true} |
| | | ,{field: 'docNum', align: 'center',title: '拣货单号'} |
| | | ,{field: 'uuid', align: 'center',title: 'uuid'} |
| | | ,{field: 'locNo', align: 'center',title: '库位'} |
| | |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | | ,{align: 'center', title: '操作', toolbar: '#operateDetl'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | } |
| | | }); |
| | | |
| | | table.on('tool(lookSSXMTable)', function(obj) { |
| | | var data = obj.data; |
| | | console.log(data); |
| | | switch (obj.event) { |
| | | case "delDetl": |
| | | layer.confirm('确定要删除吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/pakout/deleteDetl/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data:{ |
| | | wrkNo:data.wrkNo |
| | | }, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | tableIns.reload({page: {curr: 1}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | break; |
| | | } |
| | | }) |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | |
| | | ,{field: 'weight', align: 'center',title: '重量KG',edit:true} |
| | | ,{field: 'packageType', align: 'center',title: '包装类型',edit:true} |
| | | ,{field: 'zpalletType', align: 'center',title: '托盘类型',edit:true} |
| | | ,{field: 'filmWrap', align: 'center',title: '缠膜',edit:true} |
| | | ,{field: 'filmWrap', align: 'center',title: '缠膜',edit:true,hide:true} |
| | | ,{field: 'fingerMelting', align: 'center',title: '熔指,g/10min',edit:true} |
| | | ,{field: 'water', align: 'center',title: '水分,ppm', hide:true,edit:true} |
| | | ,{field: 'fusingPoint', align: 'center',title: '熔点,℃',edit:true} |
| | |
| | | ,{field: 'str5', align: 'center',title: '半结晶时间,min',hide:true,edit:true} |
| | | ,{field: 'str6', align: 'center',title: '结晶度.%',hide:true,edit:true} |
| | | ,{field: 'massState', align: 'center',title: '质量状态',edit:true} |
| | | ,{field: 'problem', align: 'center',title: '备注',edit:true} |
| | | ,{field: 'direction', align: 'center',title: '应用方向',edit:true} |
| | | ,{field: 'position', align: 'center',title: '存放位置',edit:true} |
| | | ,{field: 'stash', align: 'center',title: '仓库',edit:true} |
| | | ,{field: 'problem', align: 'center',title: '备注',edit:true,hide:true} |
| | | ,{field: 'direction', align: 'center',title: '应用方向',edit:true,hide:true} |
| | | ,{field: 'position', align: 'center',title: '存放位置',edit:true,hide:true} |
| | | ,{field: 'stash', align: 'center',title: '仓库',edit:true,hide:true} |
| | | ,{field: 'locNo', align: 'center',title: '库位',edit:true} |
| | | ,{field: 'weightAnfme', align: 'center',title: '剩余重量(KG)',edit:true} |
| | | ,{field: 'qtyAnfme', align: 'center',title: '待出库重量(KG)',hide:true} |
| | | ,{field: 'status', align: 'center',title: '状态', templet: setState ,edit:true} |
| | | ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'} |
| | | ,{field: 'stockFreezeBy', align: 'center',title: '操作人员',hide:true} |
| | | ,{field: 'stockFreezeDate$', align: 'center',title: '操作日期',hide:true} |
| | | ,{align: 'center', title: '流转明细', toolbar: '#tbLook'} |
| | | // ,{field: 'orderNo', align: 'center',title: '单号', hide:true} |
| | | // ,{field: 'pakoutTime', align: 'center',title: '出库时间', hide:true} |
| | |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'freezeData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定冻结'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/updateStockFreeze", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | layer.msg(res.msg,{icon:1}) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg,{icon:2}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'disFreezeData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定解除'+(data.length===1?'此':data.length)+'条数据的冻结吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/updateStockDisFreeze", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | layer.msg(res.msg,{icon:1}) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg,{icon:2}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | brand = brand ? brand : data[i].brand; |
| | | |
| | | if( brand != data[i].brand){ |
| | | if(brand != data[i].brand){ |
| | | layer.msg("选中的明细中含有多种牌号,请重新选择"); |
| | | return; |
| | | } |
| | | if(data[i].stockFreeze === 0){ |
| | | layer.msg("选中的明细中含有冻结的库存,请解冻后操作"); |
| | | return; |
| | | } |
| | | dataSave.push(data[i]); |
| | |
| | | } |
| | | }); |
| | | }) |
| | | $(document).on('click','#updateOwner', function () { |
| | | let data = table.cache.plaDetl; |
| | | let dataSave = []; |
| | | let dataOld = []; |
| | | for(var i=0; i<data.length; i++){ |
| | | if(data[i].LAY_CHECKED){ |
| | | data[i].step = 1; |
| | | dataSave.push(data[i]); |
| | | }else { |
| | | dataOld.push(data[i]); |
| | | } |
| | | } |
| | | dataCheck = dataSave; |
| | | |
| | | if(!dataSave || dataSave.length < 1){ |
| | | layer.msg("未勾选,请先勾选需要更改的库存"); |
| | | return; |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 2, |
| | | title: '变更主体', |
| | | maxmin: true, |
| | | area: ['500px', top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'updateOwner.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | | iframe.child(dataSave) |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | |
| | | <option value="zpalletType">托盘类型</option> |
| | | <option value="filmWrap">缠膜</option> |
| | | <option value="allocate">调拨到</option> |
| | | <option value="owner">主体</option> |
| | | </select> |
| | | <!-- <input id="type" class="layui-input" type="select" list="typelist" lay-verify="required" >--> |
| | | <!-- <datalist id="typelist">--> |
| | |
| | | --> |
| | | </script> |
| | | |
| | | <!-- 明细表格操作列 --> |
| | | <script type="text/html" id="operateDetl"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="delDetl">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/html" id="orderNoTpl"> |
| | | {{d.docNum}} |
| | | <!-- {{# if(d.settle > 1 && d.settle !== 3){ }}--> |
| | |
| | | <button id="sellout" style="alignment: right; display: none" class="function-btn">出库</button> |
| | | <!-- <button id="pickup" style="alignment: right" class="function-btn">取货</button> |--> |
| | | <button id="returned" style="alignment: right; display: none" class="function-btn">退回</button> |
| | | <button id="updateOwner" style="alignment: right; display: none" class="function-btn">变更主体</button> |
| | | </div> |
| | | |
| | | <!-- 搜索栏 --> |
| | |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData" style="display: none">删除</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-update" lay-event="updateData" style="display: none">修改</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-viladate" lay-event="viladate" style="display: none">校验</button> |
| | | |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger " id="btn-freeze" lay-event="freezeData" style="display: none">冻结</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-checked " id="btn-disfreeze" lay-event="disFreezeData" style="display: none">解冻</button> |
| | | <!-- 商品/物料 数据中心 --> |
| | | <div class="dropdown-menu" style="float: right"> |
| | | <button id="syncData" style="display: none;" class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm"> 数据同步 <i class="layui-icon layui-icon-drop"></i></button> |
| | |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="stockFreezeTpl"> |
| | | <input type="checkbox" disabled name="stockFreeze" value="{{d.stockFreeze}}" lay-skin="switch" lay-text="正常|冻结" lay-filter="stockFreezeSwitch" {{ d.stockFreeze === 1 ? 'checked' : '' }}> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 详情 --> |
| | | <div id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form" style="text-align: center"> |
| | | |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">变更主体:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="owner" class="layui-input" type="text" style="display: none"> |
| | | <input id="ownerV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="configTypeQueryByOwner" data-value="owner" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="configTypeQueryByOwnerSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | </form> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/pla/plaDetl.js" charset="utf-8"></script> |
| | | </html> |
| | | <script> |
| | | var checkData = []; |
| | | function child(data){ |
| | | checkData = data; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(save)', function () { |
| | | |
| | | for(var i in checkData){ |
| | | checkData[i].owner = $('#ownerV').val() ? $('#ownerV').val() : checkData[i].packageType; |
| | | checkData[i].step = 2; |
| | | } |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(checkData), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("修改成功"); |
| | | tableReload(true); |
| | | } else if (res.code === 403){ |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | } |
| | | parent.layer.closeAll(); |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |