Merge remote-tracking branch 'gitbit/hylyasrs' into hylyasrs
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | 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.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | // Page<ManLocDetl> page = manLocDetlService.getPage(manLocDetlPage); |
| | | return R.ok(outPage); |
| | | } |
| | | |
| | | @RequestMapping("/manLocDetl/adjust/start") |
| | | @ManagerAuth(memo = "库存调整") |
| | | public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) { |
| | | manLocDetlService.adjustLocDetl(param, getUserId()); |
| | | return R.ok("库存调整成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/manLocDetl/asrsAndSaas/list") |
| | | @ManagerAuth |
| | | public R list(@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){ |
| | | |
| | | Page<ManLocDetl> manLocDetlPage = toPage(curr, limit, param, ManLocDetl.class); |
| | | Page<ManLocDetl> all = manLocDetlService.selectAllPage(manLocDetlPage); |
| | | return R.ok().add(all); |
| | | } |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | if (entry.getKey().equals("locNo")) { |
| | | wrapper.eq("loc_no", String.valueOf(entry.getValue())); |
| | | } else { |
| | | wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @RequestMapping("/work/stock/pakout") |
| | | @ManagerAuth(memo = "生成拣货单") |
| | | @ManagerAuth(memo = "出库") |
| | | public R initPakout(@RequestBody List<InitPakoutParam> params) { |
| | | return nodeService.initPakout(params, getUserId(), getHostId()); |
| | | } |
| | | |
| | | @PostMapping(value = "/work/empty/stock") |
| | | public R getGroupEmptyStock(@RequestParam(required = false) String sourceLocNo) { |
| | | List<Node> allEmptys = nodeService.selectList(new EntityWrapper<Node>() |
| | | .eq("type","3")); |
| | | return R.ok().add(allEmptys); |
| | | } |
| | | @RequestMapping("/work/move/start") |
| | | @ManagerAuth(memo = "库位移转") |
| | | public R locMoveStart(@RequestParam String sourceLocNo, |
| | | @RequestParam String targetLocNo) { |
| | | nodeService.locMove(sourceLocNo, targetLocNo, getUserId()); |
| | | return R.ok("移库启动成功"); |
| | | } |
| | | @RequestMapping(value = "/node/select/{id}/auth") |
| | | @ManagerAuth |
| | | public R getById(@PathVariable("id") String id) { |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>() |
| | | .eq("uuid",id)); |
| | | return R.ok(node); |
| | | } |
| | | |
| | | } |
| | |
| | | List<ManLocDetl> listByOutPage(Map<String, Object> condition); |
| | | |
| | | long listByOutPageCount(Map<String, Object> condition); |
| | | |
| | | List<ManLocDetl> selectAllPage(Map<String, Object> condition); |
| | | |
| | | long selectAllPageSize(Map<String, Object> condition); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | |
| | | import java.util.List; |
| | |
| | | Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage); |
| | | |
| | | |
| | | void adjustLocDetl(LocDetlAdjustParam param, Long userId); |
| | | |
| | | Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param); |
| | | |
| | | } |
| | |
| | | R stockPakin(PakinParam number, Long userId, Long hostId); |
| | | |
| | | R initPakout(List<InitPakoutParam> params, Long userId, Long hostId); |
| | | |
| | | void locMove(String sourceLocNo, String targetLocNo, Long userId); |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.NodeService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | |
| | | @Service("manLocDetlService") |
| | | public class ManLocDetlServiceImpl extends ServiceImpl<ManLocDetlMapper, ManLocDetl> implements ManLocDetlService{ |
| | | public class ManLocDetlServiceImpl extends ServiceImpl<ManLocDetlMapper, ManLocDetl> implements ManLocDetlService { |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private NodeService nodeService; |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getPage(Page<ManLocDetl> page) { |
| | | Map<String, Object> condition = page.getCondition(); |
| | | List<ManLocDetl> manLocDetls = baseMapper.listByPage(condition); |
| | | page.setRecords(manLocDetls); |
| | | page.setTotal(baseMapper.listByPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getStockOut(Page<ManLocDetl> page) { |
| | | page.setRecords(baseMapper.getStockOutPage(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockOutPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getPage(Page<ManLocDetl> page) { |
| | | Map<String, Object> condition = page.getCondition(); |
| | | List<ManLocDetl> manLocDetls = baseMapper.listByPage(condition); |
| | | page.setRecords(manLocDetls); |
| | | page.setTotal(baseMapper.listByPageCount(page.getCondition())); |
| | | return page; |
| | | @Override |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch) { |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(locNo, matnr, batch) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, locNo, matnr, batch) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getStockOut(Page<ManLocDetl> page) { |
| | | page.setRecords(baseMapper.getStockOutPage(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockOutPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch) { |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(locNo, matnr, batch) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, locNo, matnr, batch) > 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean updateLocNo(String newLocNo, String oldLocNo) { |
| | | return baseMapper.updateLocNo(newLocNo, oldLocNo) > 0; |
| | | } |
| | | @Override |
| | | public boolean updateLocNo(String newLocNo, String oldLocNo) { |
| | | return baseMapper.updateLocNo(newLocNo, oldLocNo) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getSameDetlToday(String matnr, Integer start, Integer end) { |
| | | return this.baseMapper.selectSameDetlToday(matnr, start, end); |
| | | } |
| | | @Override |
| | | public List<String> getSameDetlToday(String matnr, Integer start, Integer end) { |
| | | return this.baseMapper.selectSameDetlToday(matnr, start, end); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getStockStatis(Page<ManLocDetl> page) { |
| | | page.setRecords(baseMapper.getStockStatis(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockStatisCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | @Override |
| | | public Page<ManLocDetl> getStockStatis(Page<ManLocDetl> page) { |
| | | page.setRecords(baseMapper.getStockStatis(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockStatisCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public Double getSumAnfme(String matnr) { |
| | | return this.baseMapper.selectSumAnfmeByMatnr(matnr); |
| | | } |
| | | @Override |
| | | public Double getSumAnfme(String matnr) { |
| | | return this.baseMapper.selectSumAnfmeByMatnr(matnr); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> selectPakoutByRule(String matnr) { |
| | | return this.baseMapper.selectPakoutByRule(matnr); |
| | | } |
| | | @Override |
| | | public List<ManLocDetl> selectPakoutByRule(String matnr) { |
| | | return this.baseMapper.selectPakoutByRule(matnr); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getAsrsLocDetl(String matnr) { |
| | | return this.baseMapper.getAsrsLocDetl(matnr); |
| | | } |
| | | @Override |
| | | public List<ManLocDetl> getAsrsLocDetl(String matnr) { |
| | | return this.baseMapper.getAsrsLocDetl(matnr); |
| | | } |
| | | |
| | | @Override |
| | | public Integer countLocNoNum(String locNo) { |
| | | return this.baseMapper.countLocNoNum(locNo); |
| | | } |
| | | @Override |
| | | public Integer countLocNoNum(String locNo) { |
| | | return this.baseMapper.countLocNoNum(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos) { |
| | | return this.baseMapper.queryStock(matnr, batch, orderNo, locNos); |
| | | } |
| | | @Override |
| | | public List<ManLocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos) { |
| | | return this.baseMapper.queryStock(matnr, batch, orderNo, locNos); |
| | | } |
| | | |
| | | @Override |
| | | public Double queryStockAnfme(String matnr, String batch) { |
| | | return this.baseMapper.queryStockAnfme(matnr, batch); |
| | | } |
| | | @Override |
| | | public Double queryStockAnfme(String matnr, String batch) { |
| | | return this.baseMapper.queryStockAnfme(matnr, batch); |
| | | } |
| | | |
| | | @Override |
| | | public List<StockVo> queryStockTotal() { |
| | | return this.baseMapper.queryStockTotal(); |
| | | } |
| | | @Override |
| | | public List<StockVo> queryStockTotal() { |
| | | return this.baseMapper.queryStockTotal(); |
| | | } |
| | | |
| | | /** |
| | | * 获取库存总数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer sum() { |
| | | /** |
| | | * 获取库存总数 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer sum() { |
| | | |
| | | return this.baseMapper.sum(); |
| | | } |
| | | return this.baseMapper.sum(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> unreason() { |
| | | return this.baseMapper.unreason(); |
| | | } |
| | | @Override |
| | | public List<ManLocDetl> unreason() { |
| | | return this.baseMapper.unreason(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ManLocDetl selectItem(String locNo, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(locNo, matnr, batch); |
| | | } |
| | | @Override |
| | | public ManLocDetl selectItem(String locNo, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(locNo, matnr, batch); |
| | | } |
| | | |
| | | @Override |
| | | public Double getLocDetlSumQty(String locNo) { |
| | | return this.baseMapper.selectLocDetlSumQty(locNo); |
| | | } |
| | | @Override |
| | | public Double getLocDetlSumQty(String locNo) { |
| | | return this.baseMapper.selectLocDetlSumQty(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage) { |
| | |
| | | return manLocDetlPage; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void adjustLocDetl(LocDetlAdjustParam param, Long userId) { |
| | | Date now = new Date(); |
| | | this.baseMapper.delete(new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no", param.getLocNo())); |
| | | for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("matnr", locDetlAdjust.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("无法找到需要调整的物料,请联系管理员"); |
| | | } |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>() |
| | | .eq("uuid", param.getLocNo())); |
| | | if (node == null) { |
| | | throw new CoolException("无法找到需要调整的库位,请联系管理员"); |
| | | |
| | | } |
| | | ManLocDetl manLocDetl = new ManLocDetl(); |
| | | manLocDetl.setLocNo(param.getLocNo()); |
| | | manLocDetl.setNodeId(node.getId()); |
| | | manLocDetl.setZpallet(mat.getBarcode()); |
| | | manLocDetl.setAnfme(locDetlAdjust.getCount()); |
| | | manLocDetl.setMatnr(mat.getMatnr()); |
| | | manLocDetl.setMaktx(mat.getMaktx()); |
| | | manLocDetl.setName(mat.getName()); |
| | | manLocDetl.setSpecs(mat.getSpecs()); |
| | | manLocDetl.setModel(mat.getModel()); |
| | | manLocDetl.setBatch(locDetlAdjust.getBatch()); |
| | | manLocDetl.setUnit(mat.getUnit()); |
| | | manLocDetl.setBarcode(mat.getBarcode()); |
| | | manLocDetl.setPrice(mat.getPrice()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme()); |
| | | this.baseMapper.insert(manLocDetl); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param) { |
| | | Map<String, Object> condition = param.getCondition(); |
| | | List<ManLocDetl> manLocDetls = baseMapper.selectAllPage(condition); |
| | | param.setRecords(manLocDetls); |
| | | param.setTotal(baseMapper.selectAllPageSize(condition)); |
| | | return param; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.NodeService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | manLocDetl.setCreateTime(now); |
| | | manLocDetl.setModiTime(now); |
| | | manLocDetl.setCreateBy(userId); |
| | | SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme()); |
| | | manLocDetlService.insert(manLocDetl); |
| | | |
| | | } |
| | |
| | | if (manLocDetl.getAnfme() - param.getCount() < 0) { |
| | | return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足"); |
| | | }else { |
| | | |
| | | manLocDetl.setAnfme(manLocDetl.getAnfme() - param.getCount()); |
| | | manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no",node.getUuid()) |
| | | .eq("matnr",param.getMatnr())); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok("出库成功"); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void locMove(String sourceLocNo, String targetLocNo, Long userId) { |
| | | List<ManLocDetl> targets = manLocDetlService.selectList(new EntityWrapper<ManLocDetl>() |
| | | .like("loc_no", sourceLocNo)); |
| | | for (ManLocDetl target : targets) { |
| | | Node uuid = nodeService.selectOne(new EntityWrapper<Node>() |
| | | .eq("uuid", targetLocNo)); |
| | | if (uuid == null || uuid.equals("")) { |
| | | throw new RuntimeException("无法查询到移库的目标库位"); |
| | | } |
| | | manLocDetlService.deleteById(target); |
| | | target.setLocNo(uuid.getUuid()); |
| | | target.setNodeId(uuid.getId()); |
| | | SaasUtils.insertLog(2,target.getLocNo(), target.getMatnr(), target.getAnfme()); |
| | | manLocDetlService.insert(target); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.fasterxml.jackson.databind.util.BeanUtil; |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.zy.system.service.SaasLogService; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class SaasUtils { |
| | | public static void insertLog(Integer type, String locNo, String matnr,Double anfme){ |
| | | SaasLogService bean = SpringUtils.getBean(SaasLogService.class); |
| | | SaasLog saasLog = new SaasLog(); |
| | | saasLog.setType(type); |
| | | saasLog.setLocNo(locNo); |
| | | saasLog.setMatnr(matnr); |
| | | saasLog.setIoTime(new Date()); |
| | | saasLog.setAnfme(anfme); |
| | | saasLog.setCreateBy(1L); |
| | | bean.insert(saasLog); |
| | | } |
| | | } |
| | |
| | | // generator.table="sys_host"; |
| | | // sqlserver |
| | | generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | generator.url="localhost:1433;databasename=jkasrs"; |
| | | generator.url="192.168.4.15:1433;databasename=hylyasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="asr_wrkin_count_view"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.table="sys_saas_log"; |
| | | generator.packagePath="com.zy.system"; |
| | | generator.build(); |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.system.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.common.DateUtils; |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.zy.system.service.SaasLogService; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class SaasLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SaasLogService saasLogService; |
| | | |
| | | @RequestMapping(value = "/saasLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(saasLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<SaasLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("io_time",false); |
| | | return R.ok(saasLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(SaasLog saasLog) { |
| | | saasLogService.insert(saasLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLog/update/auth") |
| | | @ManagerAuth |
| | | public R update(SaasLog saasLog){ |
| | | if (Cools.isEmpty(saasLog) || null==saasLog.getId()){ |
| | | return R.error(); |
| | | } |
| | | saasLogService.updateById(saasLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | saasLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<SaasLog> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("saasLog")); |
| | | convert(map, wrapper); |
| | | List<SaasLog> list = saasLogService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<SaasLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<SaasLog> page = saasLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (SaasLog saasLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", saasLog.getId()); |
| | | map.put("value", saasLog.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/saasLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<SaasLog> wrapper = new EntityWrapper<SaasLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != saasLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(SaasLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("sys_saas_log") |
| | | public class SaasLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ApiModelProperty(value= "id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * {0:入库,1:出库} |
| | | */ |
| | | @ApiModelProperty(value= "{0:入库,1:出库}") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String matnr; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("io_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date ioTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | @TableField("anfme") |
| | | private Double anfme; |
| | | |
| | | public SaasLog() {} |
| | | |
| | | public SaasLog(Long id,Integer type,String locNo,String matnr,Date ioTime,Long createBy) { |
| | | this.id = id; |
| | | this.type = type; |
| | | this.locNo = locNo; |
| | | this.matnr = matnr; |
| | | this.ioTime = ioTime; |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | // SaasLog saasLog = new SaasLog( |
| | | // null, // id[非空] |
| | | // null, // {0:入库,1:出库} |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public String getType$(){ |
| | | if (this.type ==0) { |
| | | return "入库"; |
| | | } else if (this.type == 1) { |
| | | return "出库"; |
| | | } else if (this.type == 2) { |
| | | return "库位移转"; |
| | | } else if (this.type == 3) { |
| | | return "库存调整"; |
| | | }else { |
| | | return ""; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface SaasLogMapper extends BaseMapper<SaasLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface SaasLogService extends IService<SaasLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.zy.system.mapper.SaasLogMapper; |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.zy.system.service.SaasLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saasLogService") |
| | | public class SaasLogServiceImpl extends ServiceImpl<SaasLogMapper, SaasLog> implements SaasLogService { |
| | | |
| | | } |
New file |
| | |
| | | -- save saasLog record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'saasLog/saasLog.html', 'saasLog管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'saasLog#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'saasLog#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'saasLog#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'saasLog#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'saasLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'saasLog/saasLog.html', N'saasLog管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'saasLog#view', N'查询', '60558', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'saasLog#btn-add', N'新增', '60558', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'saasLog#btn-edit', N'编辑', '60558', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'saasLog#btn-delete', N'删除', '60558', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'saasLog#btn-export', N'导出', '60558', '3', '4', '1'); |
| | |
| | | <if test="loc_no != null and loc_no != ''"> |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | </if> |
| | | <if test="locNo != null and locNo != ''"> |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mld.matnr like concat('%',#{matnr},'%') |
| | | </if> |
| | |
| | | </if> |
| | | <if test="startTime!=null and endTime!=null"> |
| | | and mld.update_time between #{startTime} and #{endTime} |
| | | </if> |
| | | </sql> |
| | | <sql id="locDetlCondition2"> |
| | | <if test="host_id != null and host_id != ''"> |
| | | and v.host_id = #{host_id} |
| | | </if> |
| | | <if test="loc_no != null and loc_no != ''"> |
| | | and v.loc_no like concat('%',#{loc_no},'%') |
| | | </if> |
| | | <if test="locNo != null and locNo != ''"> |
| | | and v.loc_no like concat('%',#{loc_no},'%') |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and v.matnr like concat('%',#{matnr},'%') |
| | | </if> |
| | | <if test="maktx != null and maktx != ''"> |
| | | and v.maktx like concat('%',#{maktx},'%') |
| | | </if> |
| | | <if test="startTime!=null and endTime!=null"> |
| | | and v.update_time between #{startTime} and #{endTime} |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | WHERE 1=1 |
| | | <include refid="locDetlCondition"></include> |
| | | </select> |
| | | <select id="selectAllPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | SELECT |
| | | ROW_NUMBER() over (order by v.loc_no desc) as row, |
| | | v.* |
| | | FROM [dbo].[man_view_asrs_saas] v |
| | | WHERE 1=1 |
| | | <include refid="locDetlCondition2"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="selectAllPageSize" resultType="java.lang.Long"> |
| | | select |
| | | count(1) |
| | | FROM [dbo].[man_view_asrs_saas] v |
| | | WHERE 1=1 |
| | | <include refid="locDetlCondition2"></include> |
| | | </select> |
| | | |
| | | |
| | | <update id="updateLocNo0"> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.system.mapper.SaasLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.system.entity.SaasLog"> |
| | | <result column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号'}, |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false, hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true , hide: true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '配置' , hide: true} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | | ,{field: 'manu', align: 'center',title: '厂家', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | |
| | | ]; |
| | | |
| | | // cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locDetl', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/manLocDetl/asrsAndSaas/list', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locDetl)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(locDetl)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'locDetl_detail.html', |
| | | 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"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } 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=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'locDetl': exportData, |
| | | 'fields': fields |
| | | }; |
| | | var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false}); |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locDetl)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'locDetl_detail.html', |
| | | 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"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'locDetl_detail.html', |
| | | 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('#locNo,#matnr', index), true); |
| | | 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'); |
| | | } |
| | | }); |
| | | break; |
| | | case 'locNo': |
| | | var param = top.reObject(data).locNo; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库位号详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: '../locMast/locMast_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/"+ 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){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'modiUser': |
| | | var param = top.reObject(data).modiUser; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | 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){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'appeUser': |
| | | var param = top.reObject(data).appeUser; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '创建者详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | 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){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | method("add"); |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | method("update") |
| | | }); |
| | | |
| | | function method(name){ |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | // id: $('#id').val(), |
| | | locNo: $('#locNo').val(), |
| | | matnr: $('#matnr').val(), |
| | | lgnum: $('#lgnum').val(), |
| | | tbnum: $('#tbnum').val(), |
| | | tbpos: $('#tbpos').val(), |
| | | zmatid: $('#zmatid').val(), |
| | | maktx: $('#maktx').val(), |
| | | werks: $('#werks').val(), |
| | | anfme: $('#anfme').val(), |
| | | altme: $('#altme').val(), |
| | | zpallet: $('#zpallet').val(), |
| | | bname: $('#bname').val(), |
| | | memo: $('#memo').val(), |
| | | modiUser: $('#modiUser').val(), |
| | | modiTime: top.strToDate($('#modiTime\\$').val()), |
| | | appeUser: $('#appeUser').val(), |
| | | appeTime: top.strToDate($('#appeTime\\$').val()), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/"+name+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | 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 { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 复选框事件 |
| | | form.on('checkbox(detailCheckbox)', function (data) { |
| | | var el = data.elem; |
| | | if (el.checked) { |
| | | $(el).val('Y'); |
| | | } else { |
| | | $(el).val('N'); |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | 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: pageCurr |
| | | }, |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | 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"); |
| | | find.val('Y'); |
| | | } else { |
| | | find.remove("checked"); |
| | | find.val('N'); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
New file |
| | |
| | | var pageCurr = 0; |
| | | var tableIns; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var form = layui.form; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locMatCode', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | // url: baseUrl+'/locDetl/list/auth', |
| | | data:[], |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 50, 100, 200, 500], |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | clearSelect(); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 搜索库位物料 |
| | | function getLoc(el) { |
| | | tableIns.reload({ |
| | | url: baseUrl+'/manLocDetl/list' |
| | | , where: {loc_no: el.value} |
| | | , done:function (res) { |
| | | limit(); |
| | | clearSelect(); |
| | | // 获取同一堆垛机的空库位 |
| | | http.post(baseUrl + "/work/empty/stock", {sourceLocNo: el.value}, function (res) { |
| | | if (res.data != null) { |
| | | var tpl = $("#emptyLocStock").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#targetLocNo').append(html); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 移库启动 |
| | | function locMove() { |
| | | var sourceLocNo = $("#sourceLocNo").val(); |
| | | var targetLocNo = $("#targetLocNo").val(); |
| | | if (sourceLocNo === null || sourceLocNo === ""){ |
| | | $("#sourceLocNo").css("border-color", "red"); |
| | | setTimeout(function () { |
| | | $("#sourceLocNo").css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | layer.msg("请输入源库位"); |
| | | return; |
| | | } |
| | | if (targetLocNo === null || targetLocNo === "") { |
| | | $(".layui-select-title .layui-input").css("border-color", "red"); |
| | | setTimeout(function () { |
| | | $(".layui-select-title .layui-input").css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | layer.msg("请输入目标库位"); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/work/move/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | data: { |
| | | sourceLocNo: sourceLocNo, |
| | | targetLocNo: targetLocNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | $("#sourceLocNo").val(""); |
| | | $("#targetLocNo").empty(); |
| | | layui.form.render('select'); |
| | | tableIns.reload({ |
| | | data: [], |
| | | url: '', |
| | | done:function (res) { |
| | | limit();clearSelect(); |
| | | } |
| | | }); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function clearSelect() { |
| | | $("#targetLocNo").empty(); |
| | | layui.form.render('select'); |
| | | } |
New file |
| | |
| | | var initCountVal = 0; |
| | | var initAnfmeVal = "-"; |
| | | var matCodeData = []; |
| | | var currLocNo; |
| | | var matCodeLayerIdx; |
| | | function getCol() { |
| | | var cols = [ |
| | | {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'batch', align: 'center',title: '批号(编辑)', edit: true, style: 'font-weight:bold'} |
| | | ]; |
| | | arrRemove(detlCols, "field", "anfme"); |
| | | arrRemove(detlCols, "field", "batch"); |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | even: true, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | done: function (res, curr, count) { |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | let index = obj.tr.attr("data-index"); |
| | | let data = matCodeData[index]; |
| | | let modify = true; |
| | | if (obj.field === 'count'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | modify = false; |
| | | } else { |
| | | if (vle <= 0) { |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | modify = false; |
| | | } |
| | | } |
| | | } |
| | | if (modify) { |
| | | data[obj.field] = obj.value; |
| | | } |
| | | tableIns.reload({data: matCodeData}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | switch(obj.event) { |
| | | case 'adjust': |
| | | if (isEmpty(currLocNo)) { |
| | | layer.msg("请先检索库位", {icon: 2}) |
| | | inputTip($("#searchLocNo")); |
| | | return; |
| | | } |
| | | if (matCodeData.length === 0) { |
| | | layer.msg("请先添加明细", {icon: 2}); |
| | | return; |
| | | } |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (isNaN(matCodeData[i].count)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | return; |
| | | } |
| | | if (matCodeData[i].count < 0){ |
| | | layer.msg("数量不能小于零", {icon: 2}); |
| | | return; |
| | | } |
| | | } |
| | | layer.confirm('确定调整'+currLocNo+'库位的明细吗?', {shadeClose: true}, function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/manLocDetl/adjust/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | locNo: currLocNo, |
| | | list: matCodeData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg(currLocNo + res.msg, {icon: 1}); |
| | | init(currLocNo) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | let index = obj.tr.attr("data-index"); |
| | | matCodeData.splice(index, 1); |
| | | tableIns.reload({data: matCodeData}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 检索事件 |
| | | form.on('submit(search)', function (data) { |
| | | let loc_no = data.field.loc_no; |
| | | if (loc_no === "") { |
| | | inputTip($("#searchLocNo")); |
| | | layer.msg("请输入库位号"); |
| | | return; |
| | | } |
| | | init(loc_no); |
| | | }); |
| | | |
| | | // 重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | reset(); |
| | | }); |
| | | |
| | | function init(locNo) { |
| | | http.post(baseUrl + "/manLocDetl/list", {loc_no: locNo,limit: 1000}, function (res) { |
| | | matCodeData = []; |
| | | matCodeData = res.data.records; |
| | | for (var i = 0; i<matCodeData.length; i++) { |
| | | matCodeData[i]["count"] = matCodeData[i]["anfme"]; |
| | | } |
| | | locTips(true, locNo); |
| | | tableReload(); |
| | | }) |
| | | } |
| | | |
| | | function reset() { |
| | | clearFormVal($('#search-box')); |
| | | matCodeData = []; |
| | | tableReload(); |
| | | locTips(false); |
| | | } |
| | | |
| | | // 重载表格 |
| | | function tableReload() { |
| | | tableIns.reload({data: matCodeData}); |
| | | } |
| | | |
| | | // 库位提示框 |
| | | function locTips(retrieve, locNo) { |
| | | if (retrieve) { |
| | | http.post(baseUrl+"/node/select/"+locNo+"/auth", null, function (res) { |
| | | console.log(res); |
| | | let data = res.data; |
| | | if (data != null) { |
| | | $(".retrieve").show(); |
| | | // $("#locMsg").html(locNo + " ,库位状态:" + data.locSts$); |
| | | $("#locMsg").html(locNo + " "); |
| | | $('.not-retrieve').hide(); |
| | | currLocNo = locNo; |
| | | } else { |
| | | layer.msg("请输入有效库位号", {icon: 2}); |
| | | $('.not-retrieve').show(); |
| | | $("#locMsg").html(""); |
| | | $(".retrieve").hide(); |
| | | currLocNo = null; |
| | | inputTip($("#searchLocNo")); |
| | | } |
| | | }) |
| | | } else { |
| | | $('.not-retrieve').show(); |
| | | $("#locMsg").html(""); |
| | | $(".retrieve").hide(); |
| | | currLocNo = null; |
| | | } |
| | | } |
| | | |
| | | $(document).on('click','#mat-query', function () { |
| | | if (isEmpty(currLocNo)) { |
| | | layer.msg("请先检索库位") |
| | | inputTip($("#searchLocNo")); |
| | | return; |
| | | } |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | matCodeLayerIdx = admin.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 搜索框空值提示 |
| | | function inputTip(el) { |
| | | el.css("border-color", "red"); |
| | | setTimeout(function () { |
| | | el.css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (let i=0;i<data.length;i++){ |
| | | for (let j=0;j<matCodeData.length;j++){ |
| | | if (data[i].matnr === matCodeData[j].matnr && data[i].batch === matCodeData[j].batch) { |
| | | data.splice(i, 1); |
| | | break; |
| | | } else { |
| | | data[i]['anfme'] = initAnfmeVal; |
| | | data[i]['count'] = initCountVal; |
| | | } |
| | | } |
| | | } |
| | | matCodeData.push.apply(matCodeData, data); |
| | | tableIns.reload({data: matCodeData}); |
| | | layer.close(matCodeLayerIdx); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#saasLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/saasLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | // toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: 'id', hide:true} |
| | | ,{field: 'locNo', align: 'center',title: '库位'} |
| | | ,{field: 'type$', align: 'center',title: '操作类型'} |
| | | ,{field: 'matnr', align: 'center',title: '物料号'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'ioTime$', align: 'center',title: '操作时间'} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(saasLog)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(saasLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.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); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'saasLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/saasLog/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | 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'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(saasLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/saasLog/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/saasLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['ioTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
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="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <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="zpallet" placeholder="托盘码" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="row" placeholder="排数" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | |
| | | </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="unreason" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="unreason">查看异常数据</button>--> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="locDetl" lay-filter="locDetl"></table> |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | </script> |
| | | |
| | | <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/saas/locDetl.js" charset="utf-8"></script> |
| | | |
| | | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> |
| | | |
| | | </body> |
| | | </html> |
| | | |
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> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | box-sizing: border-box; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | padding-bottom: 20px; |
| | | } |
| | | .function-area { |
| | | padding: 50px 80px 50px 70px; |
| | | display: inline-block; |
| | | } |
| | | .cool-auto-complete-div { |
| | | height: 40px; |
| | | border-radius: 5px; |
| | | border: 1px solid #b8b8b8; |
| | | color: #888; |
| | | box-shadow: inset 0 1px 2px #ECECEC; |
| | | -moz-box-shadow: inset 0 1px 2px #ECECEC; |
| | | -webkit-box-shadow: inset 0 1px 2px #ECECEC; |
| | | } |
| | | |
| | | .function-btn { |
| | | margin-left: 15px; |
| | | background: #E27575; |
| | | border: none; |
| | | padding: 10px 25px 10px 25px; |
| | | color: #FFF; |
| | | box-shadow: 1px 1px 5px #B6B6B6; |
| | | border-radius: 3px; |
| | | text-shadow: 1px 1px 1px #9E3F3F; |
| | | cursor: pointer; |
| | | } |
| | | .function-btn:hover { |
| | | opacity: 0.8 |
| | | } |
| | | |
| | | .layui-layer-lan .layui-layer-btn a { |
| | | background: #4476A7; |
| | | border-color: #4476A7; |
| | | color: #fff; |
| | | } |
| | | .layui-layer-lan .layui-layer-btn .layui-layer-btn1 { |
| | | background: #fff; |
| | | color: #333; |
| | | border-color: #E9E7E7; |
| | | } |
| | | .layui-layer-lan .layui-layer-btn .layui-layer-btn1:hover { |
| | | background-color: #f7f7f7; |
| | | } |
| | | |
| | | #loc-move-btn { |
| | | /*display: none;*/ |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="function-area layui-form"> |
| | | <!-- 源库位 --> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input id="sourceLocNo" class="layui-input" onkeyup="getLoc(this)" type="text" placeholder="源库位" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-mid" style="float: none; display: inline-block; margin-left: 10px">-</div> |
| | | <div class="layui-input-inline"> |
| | | <select id="targetLocNo" name="modules" lay-verify="required" lay-search=""> |
| | | <option value="">目标空库位</option> |
| | | </select> |
| | | </div> |
| | | <button id="loc-move-btn" class="function-btn" onclick="locMove()" style="background: #4476A7;text-shadow: inherit;height: 45px;font-size: 15px;margin-left: 20px">库位移转</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <table class="layui-table" id="locMatCode" lay-filter="locMatCode"></table> |
| | | |
| | | <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> |
| | | <script type="text/javascript" src="../../static/js/saas/locMove.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="emptyLocStock"> |
| | | <option value="">请输入并选择</option> |
| | | {{#each data}} |
| | | <option value="{{this.uuid}}">{{this.uuid}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <div id="locMoveWindow" style="height: 100%;display: none"> |
| | | <div style="float: left;width: 35%;height: 100%"> |
| | | <div> |
| | | <span style="display: block">源库位</span> |
| | | <input type="text"> |
| | | </div> |
| | | </div> |
| | | <div style="float: left;width: 30%;height: 100%;position: relative;"> |
| | | <span style="position:absolute;top: 45%;left: 50%;color: #666;transform: translateX(-50%);;display: block">移转至</span> |
| | | <hr style="position: absolute; top: 50%;width: 100%;border: none;height: 1px;background-color: #666"> |
| | | |
| | | </div> |
| | | <div style="float: right;width: 35%;height: 100%"> |
| | | <div> |
| | | <span style="display: block">目标库位</span> |
| | | <input type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | </html> |
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; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin: 20px;"> |
| | | <legend>搜索栏</legend> |
| | | <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"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="商品名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="update_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </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> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="matCode" lay-filter="matCode"></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> |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push( |
| | | {field: 'updateBy$', align: 'center',title: '修改人员', hide: true}, |
| | | {field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ) |
| | | return cols; |
| | | } |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | // 物料查询数据表 |
| | | matQueryTable = table.render({ |
| | | elem: '#matCode', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/mat/list/auth', |
| | | page: true, |
| | | limit: 7, |
| | | limits: [7, 10, 30,50,100], |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(matCode)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据"); |
| | | return; |
| | | } |
| | | parent.addTableData(data); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(); |
| | | }); |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | }) |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | matQueryTable.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | 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; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | </script> |
| | | </html> |
| | | |
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> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | box-sizing: border-box; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | } |
| | | |
| | | /* search */ |
| | | .layui-card-header { |
| | | border-bottom: none; |
| | | } |
| | | #search-box { |
| | | padding: 30px 0 10px 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; |
| | | } |
| | | |
| | | /* add */ |
| | | .function-area { |
| | | padding: 15px 0 20px 40px; |
| | | } |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 120px; |
| | | height: 40px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 1px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | #mat-query { |
| | | /*display: none;*/ |
| | | } |
| | | #btn-adjust { |
| | | /*display: none;*/ |
| | | } |
| | | </style> |
| | | </head> |
| | | <body style="padding-bottom: 30px"> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input id="searchLocNo" class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off" style="height: 45px;border-color: #b8b8b8"> |
| | | </div> |
| | | </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> |
| | | </div> |
| | | <!-- 库位提示 --> |
| | | <div style="display: inline-block; font-size: 20px;font-weight: 300"> |
| | | <div class="not-retrieve" style="color: #ff0000;font-family: '黑体';"> |
| | | 请先检索库位 |
| | | </div> |
| | | <div class="retrieve" style="display: none;color: #0097ff;font-family: '黑体';"> |
| | | 当前检索库位: <span id="locMsg" style=""></span> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <!-- 功能区 --> |
| | | <div class="function-area"> |
| | | <button id="mat-query" class="function-btn">新增库存</button> |
| | | </div> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <button class="layui-btn layui-btn-lg" id="btn-adjust" lay-event="adjust" style="">调整库存</button> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | | <!-- 表格 --> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | |
| | | <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> |
| | | <script type="text/javascript" src="../../static/js/saas/stockAdjust.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | </html> |
| | | |
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"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" 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> |
| | | </div> |
| | | <table class="layui-hide" id="saasLog" lay-filter="saasLog"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <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/saasLog/saasLog.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">id: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="id" placeholder="请输入id" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">{0:入库,1:出库}: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="type" placeholder="请输入{0:入库,1:出库}"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNo" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matnr" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="ioTime" id="ioTime$" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="createBy" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |