| | |
| | | import zy.cloud.wms.common.utils.BarcodeUtils; |
| | | import zy.cloud.wms.common.utils.QrCode; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | import zy.cloud.wms.manager.entity.Wave; |
| | | import zy.cloud.wms.manager.entity.WaveDetl; |
| | | import zy.cloud.wms.manager.service.OrderDetlService; |
| | | import zy.cloud.wms.manager.service.OrderService; |
| | | import zy.cloud.wms.manager.service.WaveDetlService; |
| | | import zy.cloud.wms.manager.service.WaveService; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.entity.dto.OrderDetlDTO; |
| | | import zy.cloud.wms.manager.entity.param.StockOutParam; |
| | | import zy.cloud.wms.manager.service.*; |
| | | import zy.cloud.wms.manager.utils.AddZero; |
| | | |
| | | import javax.imageio.ImageIO; |
| | |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private WaveDetlService waveDetlService; |
| | | @Autowired |
| | | private PickoutService pickoutService; |
| | | @Autowired |
| | | private PickoutDetlService pickoutDetlService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | |
| | | |
| | | @RequestMapping(value = "/order/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | Page<OrderDetl> orderDetlPage = orderDetlService.selectPage(new Page<>(curr, limit),orderDetailWrapper); |
| | | return R.ok(orderDetlPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 开始播种,更新订单细节,减少库存量 |
| | | * @param orderDetls |
| | | * @return |
| | | */ |
| | | @RequestMapping("/order/waveBack") |
| | | public R waveBack(@RequestBody OrderDetlDTO orderDetls){ |
| | | /** |
| | | * 控管与初始化 |
| | | */ |
| | | if (Cools.isEmpty(orderDetls.getOrderDetls())) { |
| | | |
| | | throw new CoolException("未收到有效播种信息,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 更新原出库单,根据拣货单来减去库存 |
| | | */ |
| | | for (OrderDetl newOne : orderDetls.getOrderDetls()) { |
| | | Order order = orderService.selectOne(new EntityWrapper<Order>() |
| | | .eq("id", newOne.getOrderId())); |
| | | Pickout pickout = pickoutService.selectOne(new EntityWrapper<Pickout>() |
| | | .eq("wave_no", order.getWaveNo())); |
| | | OrderDetl oldOne = orderDetlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("id", newOne.getId())); |
| | | /** |
| | | * 计算出差值,减去库存 |
| | | */ |
| | | double diffValue = newOne.getOutQty() - oldOne.getOutQty(); |
| | | if (diffValue !=0) { |
| | | /** |
| | | * 获取拣货单分配的库位 |
| | | */ |
| | | List<PickoutDetl> pickoutDetls = pickoutDetlService.selectList(new EntityWrapper<PickoutDetl>() |
| | | .eq("head_id", pickout.getId()) |
| | | .eq("matnr", newOne.getMatnr())); |
| | | /** |
| | | * 通过拣货单分配的库位,遍历库存, |
| | | */ |
| | | for (PickoutDetl pickoutDetl : pickoutDetls) { |
| | | if (diffValue == 0) break; |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("node_id", pickoutDetl.getNodeId()) |
| | | .eq("matnr",newOne.getMatnr())); |
| | | if (Cools.isEmpty(locDetl) || locDetl.getAnfme() == 0) { |
| | | continue; |
| | | } |
| | | if (locDetl.getAnfme() > diffValue){ |
| | | locDetl.setAnfme(locDetl.getAnfme() - diffValue); |
| | | locDetlService.update(locDetl, new EntityWrapper<LocDetl>() |
| | | .eq("node_id",locDetl.getNodeId() ) |
| | | .eq("matnr",locDetl.getMatnr())); |
| | | break; |
| | | } |
| | | if (locDetl.getAnfme() < diffValue){ |
| | | locDetl.setAnfme(0.0); |
| | | diffValue = diffValue - locDetl.getAnfme(); |
| | | locDetlService.update(locDetl, new EntityWrapper<LocDetl>() |
| | | .eq("node_id",locDetl.getNodeId() ) |
| | | .eq("matnr",locDetl.getMatnr())); |
| | | } |
| | | |
| | | } |
| | | orderDetlService.update(newOne, new EntityWrapper<OrderDetl>() |
| | | .eq("id", newOne.getId() )); |
| | | } |
| | | Boolean result = orderDetlService.checkFinish(order.getId()); |
| | | if (result) { |
| | | orderDetlService.finishOrder(order.getId()); |
| | | } |
| | | } |
| | | return R.ok("播种成功"); |
| | | } |
| | | } |
| | |
| | | @RequestMapping("docType/out/get") |
| | | @ManagerAuth |
| | | public R getDocOutTypeData(Integer docClass){ |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("status", 1). |
| | | eq("host_id", getHostId()).orderBy("create_time", false).eq("doc_class",docClass)); |
| | | |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>() |
| | | .eq("host_id", "2") |
| | | .orderBy("create_time", false) |
| | | .eq("doc_class",docClass)); |
| | | return R.ok().add(docTypes); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | // this.memo = memo; |
| | | // } |
| | | |
| | | public String getWaveNo$(){ |
| | | OrderService orderService = SpringUtils.getBean(OrderService.class); |
| | | Order id1 = orderService.selectOne(new EntityWrapper<Order>() |
| | | .eq("id", this.orderId)); |
| | | if (!Cools.isEmpty(id1)) { |
| | | return id1.getWaveNo(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
New file |
| | |
| | | package zy.cloud.wms.manager.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | @Data |
| | | public class OrderDetlDTO { |
| | | private ArrayList<OrderDetl> orderDetls; |
| | | } |
| | |
| | | List<OrderDetl> selectBatchByOrderNo(List<Order> orders); |
| | | |
| | | List<OrderDetl> selectOutList(String matnr, ArrayList<String> strings); |
| | | |
| | | Boolean checkFinish(Long id); |
| | | |
| | | void finishOrder(Long id); |
| | | } |
| | |
| | | package zy.cloud.wms.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | import zy.cloud.wms.manager.entity.Pickout; |
| | | import zy.cloud.wms.manager.entity.Wave; |
| | | import zy.cloud.wms.manager.mapper.OrderDetlMapper; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | import zy.cloud.wms.manager.service.OrderDetlService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import zy.cloud.wms.manager.service.OrderService; |
| | | import zy.cloud.wms.manager.service.PickoutService; |
| | | import zy.cloud.wms.manager.service.WaveService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("orderDetlService") |
| | | public class OrderDetlServiceImpl extends ServiceImpl<OrderDetlMapper, OrderDetl> implements OrderDetlService { |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private PickoutService pickoutService; |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectByOrderNo(String orderNo, Long hostId) { |
| | |
| | | public List<OrderDetl> selectOutList(String matnr, ArrayList<String> strings) { |
| | | return this.baseMapper.selectOutList(matnr,strings); |
| | | } |
| | | |
| | | /** |
| | | * 通过orderid来查询所有orderDetl |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean checkFinish(Long id) { |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>() |
| | | .eq("order_id", id)); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (orderDetl.getAnfme() - orderDetl.getOutQty() != 0 ){ |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void finishOrder(Long id) { |
| | | /** |
| | | * 更改order状态 |
| | | */ |
| | | Order order = orderService.selectOne(new EntityWrapper<Order>() |
| | | .eq("id", id)); |
| | | order.setSettle(5L); |
| | | orderService.update(order,new EntityWrapper<Order>() |
| | | .eq("id", id)); |
| | | /** |
| | | * 更改波次状态 |
| | | */ |
| | | Wave wave = waveService.selectOne(new EntityWrapper<Wave>() |
| | | .eq("wave_no", order.getWaveNo())); |
| | | wave.setStatus((short) 2); |
| | | waveService.update(wave,new EntityWrapper<Wave>() |
| | | .eq("wave_no", order.getWaveNo())); |
| | | |
| | | /** |
| | | * 更改拣货单状态 |
| | | */ |
| | | Pickout pickout = pickoutService.selectOne(new EntityWrapper<Pickout>() |
| | | .eq("wave_no", wave.getWaveNo())); |
| | | pickout.setWrkSts(3L); |
| | | pickoutService.update(pickout,new EntityWrapper<Pickout>() |
| | | .eq("wave_no", wave.getWaveNo())); |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | PickoutDetl pickoutDetl = new PickoutDetl(); |
| | | pickoutDetl.setHeadId(pickout.getId()); |
| | | pickoutDetl.setNodeId(pickOutDto.getNodeId().longValue()); |
| | | if (!Cools.isEmpty(pickOutDto.getNodeId())) { |
| | | |
| | | pickoutDetl.setNodeId(pickOutDto.getNodeId().longValue()); |
| | | } |
| | | |
| | | pickoutDetl.setNodeName(pickOutDto.getLocNo()); |
| | | pickoutDetl.setAnfme(pickOutDto.getAnfme().doubleValue()); |
| | | pickoutDetl.setAnfme(pickOutDto.getReduce().doubleValue()); |
| | | pickoutDetl.setMatnr(pickOutDto.getMatnr()); |
| | | pickoutDetl.setMaktx(mat.getMaktx()); |
| | | pickoutDetl.setName(mat.getName()); |
| | |
| | | # password: xltys1995 |
| | | # sql-server |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | # url: jdbc:sqlserver://127.0.0.1:51433;databasename=zypms |
| | | # username: sa |
| | | # password: Zoneyung@zy56$ |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=wms_saas |
| | | username: sa |
| | | password: sa@123 |
| | |
| | | id: LTAI4GDzr6ioSHuRw2mk22ug |
| | | secret: 84CHL7tF21LbU1qpaP0jn9mIAZP9bv |
| | | bucket: tjdt |
| | | endpoint: http://oss-cn-hangzhou.aliyuncs.com |
| | | endpoint: http://oss-cn-hangzhou.aliyuncs.com |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | tableIns = table.render({ |
| | | elem: '#comb', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/comb/list/auth', |
| | | url: baseUrl + '/comb/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘码'} |
| | | ,{field: 'anfme', align: 'center',title: '库存余量'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | , {field: 'zpallet', align: 'center', title: '托盘码'} |
| | | , {field: 'anfme', align: 'center', title: '库存余量'} |
| | | , {field: 'matnr', align: 'center', title: '商品编号'} |
| | | , {field: 'maktx', align: 'center', title: '商品名称'} |
| | | // ,{field: 'name', align: 'center',title: '名称'} |
| | | // ,{field: 'specs', align: 'center',title: '规格'} |
| | | // ,{field: 'model', align: 'center',title: '型号'} |
| | |
| | | // ,{field: 'count', align: 'center',title: '数量'} |
| | | // ,{field: 'weight', align: 'center',title: '重量'} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'ioStatus$', align: 'center',title: '执行状态'} |
| | | , {field: 'ioStatus$', align: 'center', title: '执行状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员',event: 'createBy', style: 'cursor:pointer'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员',event: 'updateBy', style: 'cursor:pointer'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | , {field: 'memo', align: 'center', title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | var _index = $(data.elem).attr('table-index') || 0; |
| | | if (data.elem.checked) { |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | } else { |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | limit(); |
| | | } |
| | | }); |
| | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(comb)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | switch (obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'comb_detail.html', |
| | | success: function(layero, index){ |
| | | success: function (layero, index) { |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | if (data.length === 0) { |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | layer.confirm('确定删除' + (data.length === 1 ? '此' : data.length) + '条数据吗', function () { |
| | | $.ajax({ |
| | | url: baseUrl+"/comb/delete/auth", |
| | | url: baseUrl + "/comb/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | traditional: true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function () { |
| | | var titles = []; |
| | | var fields = []; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/comb/export/auth", |
| | | url: baseUrl + "/comb/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | table.exportFile(titles, res.data, 'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(comb)', function(obj){ |
| | | table.on('tool(comb)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'comb_detail.html', |
| | | success: function(layero, index){ |
| | | success: function (layero, index) { |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'comb_detail.html', |
| | | success: function(layero, index){ |
| | | success: function (layero, index) { |
| | | layer.getChildFrame('#data-detail-submit-save', index).hide(); |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | top.convertDisabled(layer.getChildFrame('', index), true); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '添加人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: "baseUrl+/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '添加人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function (layero, index) { |
| | | $.ajax({ |
| | | url: "baseUrl+/user/" + param + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'updateBy': |
| | |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: "baseUrl+/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function (layero, index) { |
| | | $.ajax({ |
| | | url: "baseUrl+/user/" + param + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index); |
| | | layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | | if (banMsg != null) { |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | |
| | | method("update") |
| | | }); |
| | | |
| | | function method(name){ |
| | | function method(name) { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | shade: [0.5, '#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | // id: $('#id').val(), |
| | |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/comb/"+name+"/auth", |
| | | url: baseUrl + "/comb/" + name + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | parent.layer.closeAll(); |
| | | parent.$(".layui-laypage-btn")[0].click(); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | $(document).on('click', '#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | curr: pageCurr - 1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | if (find[0]!=null){ |
| | | if (find[0].type === 'checkbox'){ |
| | | if (data[val]==='Y'){ |
| | | find.attr("checked","checked"); |
| | | if (find[0] != null) { |
| | | if (find[0].type === 'checkbox') { |
| | | if (data[val] === 'Y') { |
| | | find.attr("checked", "checked"); |
| | | find.val('Y'); |
| | | } else { |
| | | find.remove("checked"); |
| | |
| | | } |
| | | } |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | if (showImg) { |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0)) { |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.8); |
| | | var height = detail.height() + 60; |
| | | if (height > ($(window).height() * 0.9)) { |
| | | height = ($(window).height() * 0.8); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | height: height + 'px' |
| | | }); |
| | | } |
| | | |
| | |
| | | return false; |
| | | }); |
| | | |
| | | $('#waveback').click(function (data) { |
| | | layer.open({ |
| | | type: 2, |
| | | title: false, |
| | | area: ['1000px','700px'], |
| | | content: "waveback_detl.html", |
| | | }) |
| | | }); |
| | | |
| | | |
| | | /* 表格2头工具栏点击事件 */ |
| | | table.on('toolbar(orderTable)', function (obj) { |
| | | if (obj.event === 'add') { // 添加 |
| | |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'seqNo', align:'center',title: '行号'}, |
| | | {field: 'matnr', align:'center',title: '商品编号'}, |
| | | {field: 'matnr', align:'center',title: '商品编号'}, |
| | | {field: 'maktx', align:'center',title: '商品名称', width: 200}, |
| | | {field: 'anfme', align:'center',title: '数量', width: 70}, |
| | |
| | | /** layui-v2.5.4 MIT License By https://www.layui.com */ |
| | | ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.5.4"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;o<e.length&&!t.call(e[o],o,e[o]);o++);return n},n.prototype.sort=function(e,t,o){var n=JSON.parse(JSON.stringify(e||[]));return t?(n.sort(function(e,o){var n=/^-?\d+$/,r=e[t],i=o[t];return n.test(r)&&(r=parseFloat(r)),n.test(i)&&(i=parseFloat(i)),r&&!i?1:!r&&i?-1:r>i?1:r<i?-1:0}),o&&n.reverse(),n):n},n.prototype.stope=function(t){t=t||e.event;try{t.stopPropagation()}catch(o){t.cancelBubble=!0}},n.prototype.onevent=function(e,t,o){return"string"!=typeof e||"function"!=typeof o?this:n.event(e,t,null,o)},n.prototype.event=n.event=function(e,t,n,r){var i=this,a=null,u=t.match(/\((.*)\)$/)||[],l=(e+"."+t).replace(u[0],""),s=u[1]||"",c=function(e,t){var o=t&&t.call(i,n);o===!1&&null===a&&(a=!1)};return r?(o.event[l]=o.event[l]||{},o.event[l][s]=[r],this):(layui.each(o.event[l],function(e,t){return"{*}"===s?void layui.each(t,c):(""===e&&layui.each(t,c),void(s&&e===s&&layui.each(t,c)))}),a)},e.layui=new n}(window); |
| | | ;!function (e) { |
| | | "use strict"; |
| | | var t = document, o = {modules: {}, status: {}, timeout: 10, event: {}}, n = function () { |
| | | this.v = "2.5.4" |
| | | }, r = function () { |
| | | var e = t.currentScript ? t.currentScript.src : function () { |
| | | for (var e, o = t.scripts, n = o.length - 1, r = n; r > 0; r--) if ("interactive" === o[r].readyState) { |
| | | e = o[r].src; |
| | | break |
| | | } |
| | | return e || o[n].src |
| | | }(); |
| | | return e.substring(0, e.lastIndexOf("/") + 1) |
| | | }(), i = function (t) { |
| | | e.console && console.error && console.error("Layui hint: " + t) |
| | | }, a = "undefined" != typeof opera && "[object Opera]" === opera.toString(), u = { |
| | | layer: "modules/layer", |
| | | laydate: "modules/laydate", |
| | | laypage: "modules/laypage", |
| | | laytpl: "modules/laytpl", |
| | | layim: "modules/layim", |
| | | layedit: "modules/layedit", |
| | | form: "modules/form", |
| | | upload: "modules/upload", |
| | | transfer: "modules/transfer", |
| | | tree: "modules/tree", |
| | | table: "modules/table", |
| | | element: "modules/element", |
| | | rate: "modules/rate", |
| | | colorpicker: "modules/colorpicker", |
| | | slider: "modules/slider", |
| | | carousel: "modules/carousel", |
| | | flow: "modules/flow", |
| | | util: "modules/util", |
| | | code: "modules/code", |
| | | jquery: "modules/jquery", |
| | | mobile: "modules/mobile", |
| | | "layui.all": "../layui.all" |
| | | }; |
| | | n.prototype.cache = o, n.prototype.define = function (e, t) { |
| | | var n = this, r = "function" == typeof e, i = function () { |
| | | var e = function (e, t) { |
| | | layui[e] = t, o.status[e] = !0 |
| | | }; |
| | | return "function" == typeof t && t(function (n, r) { |
| | | e(n, r), o.callback[n] = function () { |
| | | t(e) |
| | | } |
| | | }), this |
| | | }; |
| | | return r && (t = e, e = []), !layui["layui.all"] && layui["layui.mobile"] ? i.call(n) : (n.use(e, i), n) |
| | | }, n.prototype.use = function (e, n, l) { |
| | | function s(e, t) { |
| | | var n = "PLaySTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/; |
| | | ("load" === e.type || n.test((e.currentTarget || e.srcElement).readyState)) && (o.modules[f] = t, d.removeChild(v), function r() { |
| | | return ++m > 1e3 * o.timeout / 4 ? i(f + " is not a valid module") : void (o.status[f] ? c() : setTimeout(r, 4)) |
| | | }()) |
| | | } |
| | | |
| | | function c() { |
| | | l.push(layui[f]), e.length > 1 ? y.use(e.slice(1), n, l) : "function" == typeof n && n.apply(layui, l) |
| | | } |
| | | |
| | | var y = this, p = o.dir = o.dir ? o.dir : r, d = t.getElementsByTagName("head")[0]; |
| | | e = "string" == typeof e ? [e] : e, window.jQuery && jQuery.fn.on && (y.each(e, function (t, o) { |
| | | "jquery" === o && e.splice(t, 1) |
| | | }), layui.jquery = layui.$ = jQuery); |
| | | var f = e[0], m = 0; |
| | | if (l = l || [], o.host = o.host || (p.match(/\/\/([\s\S]+?)\//) || ["//" + location.host + "/"])[0], 0 === e.length || layui["layui.all"] && u[f] || !layui["layui.all"] && layui["layui.mobile"] && u[f]) return c(), y; |
| | | if (o.modules[f]) !function g() { |
| | | return ++m > 1e3 * o.timeout / 4 ? i(f + " is not a valid module") : void ("string" == typeof o.modules[f] && o.status[f] ? c() : setTimeout(g, 4)) |
| | | }(); else { |
| | | var v = t.createElement("script"), |
| | | h = (u[f] ? p + "lay/" : /^\{\/\}/.test(y.modules[f]) ? "" : o.base || "") + (y.modules[f] || f) + ".js"; |
| | | h = h.replace(/^\{\/\}/, ""), v.async = !0, v.charset = "utf-8", v.src = h + function () { |
| | | var e = o.version === !0 ? o.v || (new Date).getTime() : o.version || ""; |
| | | return e ? "?v=" + e : "" |
| | | }(), d.appendChild(v), !v.attachEvent || v.attachEvent.toString && v.attachEvent.toString().indexOf("[native code") < 0 || a ? v.addEventListener("load", function (e) { |
| | | s(e, h) |
| | | }, !1) : v.attachEvent("onreadystatechange", function (e) { |
| | | s(e, h) |
| | | }), o.modules[f] = h |
| | | } |
| | | return y |
| | | }, n.prototype.getStyle = function (t, o) { |
| | | var n = t.currentStyle ? t.currentStyle : e.getComputedStyle(t, null); |
| | | return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](o) |
| | | }, n.prototype.link = function (e, n, r) { |
| | | var a = this, u = t.createElement("link"), l = t.getElementsByTagName("head")[0]; |
| | | "string" == typeof n && (r = n); |
| | | var s = (r || e).replace(/\.|\//g, ""), c = u.id = "layuicss-" + s, y = 0; |
| | | return u.rel = "stylesheet", u.href = e + (o.debug ? "?v=" + (new Date).getTime() : ""), u.media = "all", t.getElementById(c) || l.appendChild(u), "function" != typeof n ? a : (function p() { |
| | | return ++y > 1e3 * o.timeout / 100 ? i(e + " timeout") : void (1989 === parseInt(a.getStyle(t.getElementById(c), "width")) ? function () { |
| | | n() |
| | | }() : setTimeout(p, 100)) |
| | | }(), a) |
| | | }, o.callback = {}, n.prototype.factory = function (e) { |
| | | if (layui[e]) return "function" == typeof o.callback[e] ? o.callback[e] : null |
| | | }, n.prototype.addcss = function (e, t, n) { |
| | | return layui.link(o.dir + "css/" + e, t, n) |
| | | }, n.prototype.img = function (e, t, o) { |
| | | var n = new Image; |
| | | return n.src = e, n.complete ? t(n) : (n.onload = function () { |
| | | n.onload = null, "function" == typeof t && t(n) |
| | | }, void (n.onerror = function (e) { |
| | | n.onerror = null, "function" == typeof o && o(e) |
| | | })) |
| | | }, n.prototype.config = function (e) { |
| | | e = e || {}; |
| | | for (var t in e) o[t] = e[t]; |
| | | return this |
| | | }, n.prototype.modules = function () { |
| | | var e = {}; |
| | | for (var t in u) e[t] = u[t]; |
| | | return e |
| | | }(), n.prototype.extend = function (e) { |
| | | var t = this; |
| | | e = e || {}; |
| | | for (var o in e) t[o] || t.modules[o] ? i("模块名 " + o + " 已被占用") : t.modules[o] = e[o]; |
| | | return t |
| | | }, n.prototype.router = function (e) { |
| | | var t = this, e = e || location.hash, o = {path: [], search: {}, hash: (e.match(/[^#](#.*$)/) || [])[1] || ""}; |
| | | return /^#\//.test(e) ? (e = e.replace(/^#\//, ""), o.href = "/" + e, e = e.replace(/([^#])(#.*$)/, "$1").split("/") || [], t.each(e, function (e, t) { |
| | | /^\w+=/.test(t) ? function () { |
| | | t = t.split("="), o.search[t[0]] = t[1] |
| | | }() : o.path.push(t) |
| | | }), o) : o |
| | | }, n.prototype.data = function (t, o, n) { |
| | | if (t = t || "layui", n = n || localStorage, e.JSON && e.JSON.parse) { |
| | | if (null === o) return delete n[t]; |
| | | o = "object" == typeof o ? o : {key: o}; |
| | | try { |
| | | var r = JSON.parse(n[t]) |
| | | } catch (i) { |
| | | var r = {} |
| | | } |
| | | return "value" in o && (r[o.key] = o.value), o.remove && delete r[o.key], n[t] = JSON.stringify(r), o.key ? r[o.key] : r |
| | | } |
| | | }, n.prototype.sessionData = function (e, t) { |
| | | return this.data(e, t, sessionStorage) |
| | | }, n.prototype.device = function (t) { |
| | | var o = navigator.userAgent.toLowerCase(), n = function (e) { |
| | | var t = new RegExp(e + "/([^\\s\\_\\-]+)"); |
| | | return e = (o.match(t) || [])[1], e || !1 |
| | | }, r = { |
| | | os: function () { |
| | | return /windows/.test(o) ? "windows" : /linux/.test(o) ? "linux" : /iphone|ipod|ipad|ios/.test(o) ? "ios" : /mac/.test(o) ? "mac" : void 0 |
| | | }(), ie: function () { |
| | | return !!(e.ActiveXObject || "ActiveXObject" in e) && ((o.match(/msie\s(\d+)/) || [])[1] || "11") |
| | | }(), weixin: n("micromessenger") |
| | | }; |
| | | return t && !r[t] && (r[t] = n(t)), r.android = /android/.test(o), r.ios = "ios" === r.os, r |
| | | }, n.prototype.hint = function () { |
| | | return {error: i} |
| | | }, n.prototype.each = function (e, t) { |
| | | var o, n = this; |
| | | if ("function" != typeof t) return n; |
| | | if (e = e || [], e.constructor === Object) { |
| | | for (o in e) if (t.call(e[o], o, e[o])) break |
| | | } else for (o = 0; o < e.length && !t.call(e[o], o, e[o]); o++) ; |
| | | return n |
| | | }, n.prototype.sort = function (e, t, o) { |
| | | var n = JSON.parse(JSON.stringify(e || [])); |
| | | return t ? (n.sort(function (e, o) { |
| | | var n = /^-?\d+$/, r = e[t], i = o[t]; |
| | | return n.test(r) && (r = parseFloat(r)), n.test(i) && (i = parseFloat(i)), r && !i ? 1 : !r && i ? -1 : r > i ? 1 : r < i ? -1 : 0 |
| | | }), o && n.reverse(), n) : n |
| | | }, n.prototype.stope = function (t) { |
| | | t = t || e.event; |
| | | try { |
| | | t.stopPropagation() |
| | | } catch (o) { |
| | | t.cancelBubble = !0 |
| | | } |
| | | }, n.prototype.onevent = function (e, t, o) { |
| | | return "string" != typeof e || "function" != typeof o ? this : n.event(e, t, null, o) |
| | | }, n.prototype.event = n.event = function (e, t, n, r) { |
| | | var i = this, a = null, u = t.match(/\((.*)\)$/) || [], l = (e + "." + t).replace(u[0], ""), s = u[1] || "", |
| | | c = function (e, t) { |
| | | var o = t && t.call(i, n); |
| | | o === !1 && null === a && (a = !1) |
| | | }; |
| | | return r ? (o.event[l] = o.event[l] || {}, o.event[l][s] = [r], this) : (layui.each(o.event[l], function (e, t) { |
| | | return "{*}" === s ? void layui.each(t, c) : ("" === e && layui.each(t, c), void (s && e === s && layui.each(t, c))) |
| | | }), a) |
| | | }, e.layui = new n |
| | | }(window); |
| | |
| | | body { |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | .layui-table-box { |
| | | border-right: 1px solid #9F9F9F; |
| | | border-left: 1px solid #9F9F9F; |
| | |
| | | #search-box { |
| | | padding: 30px 0 20px 0; |
| | | } |
| | | |
| | | #search-box .layui-inline:first-child { |
| | | margin-left: 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | |
| | | margin-left: 10px; |
| | | display: inline-block; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | |
| | | <script> |
| | | |
| | | var pageCurr; |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push( |
| | | {field: 'stock', align: 'center',title: '库存余量', style: 'font-weight: bold'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true}) |
| | | {field: 'stock', align: 'center', title: '库存余量', style: 'font-weight: bold'} |
| | | , {field: 'updateBy$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'updateTime$', align: 'center', title: '修改时间', hide: true}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/mat/list/auth', |
| | | url: baseUrl + '/mat/list/auth', |
| | | page: true, |
| | | limit: 8, |
| | | even: true, |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | } |
| | | }); |
| | | |
| | |
| | | table.on('toolbar(stockOut)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | switch (obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | if (data.length === 0) { |
| | | layer.msg("请选择数据"); |
| | | return; |
| | | } |
| | |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | , type: 'datetime' |
| | | , range: true |
| | | }); |
| | | }) |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | locDetlTableIns.reload({ |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | } |
| | | }); |
| | | } |
| | |
| | | /* font-weight: bold; */ |
| | | text-align: left; |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <!-- 表格工具栏2 --> |
| | | <form class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">订单编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="order_no" class="layui-input" id="orderNo" placeholder="输入订单编号"/> |
| | | <div class="layui-row"> |
| | | <form class="layui-form toolbar layui-col-md4"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">订单编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="order_no" class="layui-input" id="orderNo" placeholder="输入订单编号"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="orderTbSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="orderTbReset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="orderTbSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="orderTbReset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </form> |
| | | <button class="layui-btn icon-btn" id="waveback"> |
| | | <i class="layui-icon"></i>播种 |
| | | </button> |
| | | </div> |
| | | |
| | | |
| | | <!-- 数据表格2 --> |
| | | <table id="orderTable" lay-filter="orderTable"></table> |
| | | </div> |
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/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | body { |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | .layui-table-box { |
| | | border-right: 1px solid #9F9F9F; |
| | | border-left: 1px solid #9F9F9F; |
| | | } |
| | | |
| | | #search-box { |
| | | padding: 30px 0 20px 0; |
| | | } |
| | | |
| | | #search-box .layui-inline:first-child { |
| | | margin-left: 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-left: 10px; |
| | | display: inline-block; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | .red{ |
| | | color: #CF1900; |
| | | } |
| | | .blue{ |
| | | color: #0c64eb; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | |
| | | <fieldset class="layui-elem-field" style="margin-top: 10px"> |
| | | <legend>搜索</legend> |
| | | <div class="layui-row" style="padding-top: 10px; padding-left: 10px"> |
| | | <div class="layui-col-md5"> |
| | | <form class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline" > |
| | | <input id="waveNo$" name="waveNo$" class="layui-input" placeholder="输入波次号"/> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" lay-filter="wavaBackResearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | <div class="layui-inline"> |
| | | <input id="backOrderOne" class="layui-input" placeholder="请输入播种物料号"/> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" id="once"> |
| | | <i class="layui-icon"></i>播种一次 |
| | | </button> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" id="submit" > |
| | | <i class="layui-icon"></i>提交 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header" id="cardTitile">使用说明</div> |
| | | <div class="layui-card-body" id="cardBody"> |
| | | 首先搜索波次号,然后输入需要播种的物料ID(每次播种一个)<br> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </fieldset> |
| | | <div class="layui-form"> |
| | | <table id="showWave" lay-filter="showWave"></table> |
| | | </div> |
| | | |
| | | <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/handlebars/handlebars-v4.5.3.js"></script> |
| | | |
| | | |
| | | </body> |
| | | <script> |
| | | var pageCurr; |
| | | var allRecord = []; |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'util'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var util = layui.util; |
| | | var insTb = table.render({ |
| | | elem: '#showWave', |
| | | url: baseUrl + '/order/orderByWave/auth', |
| | | height: 'full-100', |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | page: true, |
| | | headers: {token: localStorage.getItem('token')}, |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | |
| | | parseData: function (res) { |
| | | if (allRecord.length === 0) { |
| | | allRecord = res.data.records; |
| | | } |
| | | |
| | | |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': allRecord |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | |
| | | defaultToolbar: [], |
| | | cols: [[ |
| | | {field: 'waveNo$', title: '波次号', minWidth: 175} |
| | | , {field: 'orderNo', align: 'center', title: '单据编号'} |
| | | , {field: 'matnr', align: 'center', title: '物料ID' , minWidth: 175} |
| | | , {field: 'maktx', align: 'center', title: '物料名称'} |
| | | , {field: 'anfme', align: 'center', title: '应出库量', minWidth: 50} |
| | | , {field: 'outQty', align: 'center', title: '已出库量', minWidth: 50} |
| | | |
| | | ]] |
| | | }); |
| | | $('#once').click(function () { |
| | | |
| | | var matNo = $('input[id="backOrderOne"]').val(); |
| | | for (let i = 0; i < allRecord.length; i++) { |
| | | if (matNo === allRecord[i].matnr) { |
| | | if (allRecord[i].anfme > allRecord[i].outQty){ |
| | | allRecord[i].outQty = allRecord[i].outQty + 1 |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | insTb.reload({ |
| | | page: {curr: 1} |
| | | }) |
| | | }); |
| | | |
| | | $('#submit').click(function (data) { |
| | | layer.confirm('[重要]确定提交吗?',{ |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | },function (data) { |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/order/waveBack", |
| | | |
| | | header:{'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data:JSON.stringify({ |
| | | orderDetls: allRecord |
| | | }), |
| | | // data:{ |
| | | // orders: allRecord |
| | | // }, |
| | | |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.msg(res.msg, {icon: 1}) |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | form.on('submit(wavaBackResearch)', function (data) { |
| | | var newRecord = []; |
| | | if (data.field.waveNo$ === "") { |
| | | allRecord.length = 0; |
| | | |
| | | } else { |
| | | for (let i = 0; i < allRecord.length; i++) { |
| | | let record = allRecord[i]; |
| | | if (record.waveNo$ === data.field.waveNo$) { |
| | | newRecord.push(record); |
| | | } |
| | | } |
| | | allRecord = newRecord; |
| | | } |
| | | insTb.reload({ |
| | | page: {curr: 1} |
| | | |
| | | }); |
| | | return false; |
| | | }); |
| | | form.on('submit(reset)', function (data) { |
| | | $('#waveNo$').val = ""; |
| | | allRecord.length = 0; |
| | | insTb.reload({ |
| | | page: {curr: 1} |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
| | | </html> |