| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.asrs.entity.BasLocSts; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import com.zy.asrs.service.BasLocStsService; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.core.annotations.ManagerAuth; |
| | |
| | | |
| | | @Autowired |
| | | private BasWrkIotypeService basWrkIotypeService; |
| | | |
| | | @Autowired |
| | | private BasLocStsService basLocStsService; |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locStacQuery/auth") |
| | | @ManagerAuth |
| | | public R queryloc(String condition) { |
| | | EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("lo_sts", condition); |
| | | Page<BasLocSts> page = basLocStsService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasLocSts basLocSts : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basLocSts.getLocSts()); |
| | | map.put("value", basLocSts.getLocDesc()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/locDetl/list/sts") |
| | | @ManagerAuth |
| | | public R stsList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | String value= null; |
| | | for (String s : param.keySet()) { |
| | | value= (String) param.get(s); |
| | | } |
| | | LocMast loc_no = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", value)); |
| | | if (loc_no.getLocSts().equals("O")||loc_no.getLocSts().equals("F")){ |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | }else { |
| | | return R.error("该库位当前状态不能调整"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/locDetl/add/auth") |
| | | @ManagerAuth(memo = "库位明细添加") |
| | | public R add(LocDetl locDetl) { |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | //查询库位状态 |
| | | if (locMast.getLocSts().equals("O")){ |
| | | //更新库位状态 |
| | | locMast.setLocSts("F"); |
| | | // boolean b = locMastService.updateById(locMast); |
| | | if (!locMastService.updateById(locMast)){ |
| | | throw new CoolException("更新库位状态失败"); |
| | | } |
| | | } |
| | | |
| | | for (LocDetlAdjustParam.LocDetlAdjust adjust : param.getList()) { |
| | | if (Cools.isEmpty(adjust.getMatNo())) { |
| | |
| | | function autoShow(id) { |
| | | var cac = document.getElementById(id).parentNode; |
| | | var cacw = cac.getElementsByClassName("cool-auto-complete-window")[0]; |
| | | console.log(cacw) |
| | | if (cacw.style.display === "none" || cacw.style.display === ""){ |
| | | cacw.style.display = "block"; |
| | | var cacwi = cacw.getElementsByClassName("cool-auto-complete-window-input")[0]; |
| | |
| | | }); |
| | | } |
| | | |
| | | function autoLoad2(val) { |
| | | var inputDomVal = document.querySelector("input[data-key="+val+"]").value; |
| | | var selectDom = document.querySelector("select[data-key="+val+"Select]"); |
| | | selectDom.length = 0; |
| | | var defaultOption = new Option("取消选择", ""); |
| | | defaultOption.title = ""; |
| | | selectDom.appendChild(defaultOption); |
| | | selectDom.style.display='none'; |
| | | $.ajax({ |
| | | url: baseUrl+"/"+getForeignKeyQuery(val)+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {condition: inputDomVal}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var list = res.data; |
| | | for (var i=0;i<list.length;i++){ |
| | | var option = new Option(list[i].value, i); |
| | | option.title = list[i].id; |
| | | selectDom.options[i+1] = option; |
| | | } |
| | | selectDom.style.display='block'; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 搜索自动补全 -- select |
| | | */ |
| | |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var dropdown = layui.dropdown |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', function (obj) { |
| | | var searchData = {}; |
| | |
| | | return; |
| | | } |
| | | } |
| | | console.log(matCodeData) |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/store/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | }); |
| | | |
| | | function init(locNo) { |
| | | http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) { |
| | | http.post(baseUrl + "/locDetl/list/sts", {locNo: locNo,limit: 1000}, function (res) { |
| | | matCodeData = []; |
| | | let data = res.data.records; |
| | | for (var i = 0; i<data.length; i++) { |
| | |
| | | ,{field: 'row1', align: 'center',title: '排'} |
| | | ,{field: 'bay1', align: 'center',title: '列'} |
| | | ,{field: 'lev1', align: 'center',title: '层'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_sts" placeholder="库位状态" autocomplete="off"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="locSts" name="loc_sts" class="layui-input" type="text" style="display: none"> |
| | | <input id="locSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位状态" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locStacQueryBylocSts" onkeyup="autoLoad2(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locStacQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="loc_sts" placeholder="库位状态" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="row1" placeholder="排" autocomplete="off"> |
| | |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="locSts" name="loc_sts" class="layui-input" type="text" style="display: none"> |
| | | <input id="locSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位状态" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locStacQueryBylocSts" onkeyup="autoLoad2(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locStacQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="row1" placeholder="排" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="bay1" placeholder="列" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lev1" placeholder="层" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |