| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Resource |
| | | private LocDetlMapper locDetlMapper; |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Resource |
| | | private WrkMastLogService wrkMastLogService; |
| | | |
| | | @Resource |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | |
| | | @RequestMapping(value = "/locMast/init/pwd") |
| | | public R locMastInitPwd(@RequestParam(required = false) String pwd) { |
| | |
| | | if (oldLocMast.getLocSts().equals("R") || oldLocMast.getLocSts().equals("F") || oldLocMast.getLocSts().equals("S")) { |
| | | if (locMast.getLocSts().equals("O") || locMast.getLocSts().equals("D")) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | // 添加历史工作主档 |
| | | WrkMastLog wrkMastLog = new WrkMastLog(); |
| | | wrkMastLog.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMastLog.setIoTime(now); |
| | | wrkMastLog.setWrkSts(5); |
| | | wrkMastLog.setIoType(19); |
| | | wrkMastLog.setIoPri(13D); // 优先级 |
| | | wrkMastLog.setCrnNo(locMast.getCrnNo()); |
| | | wrkMastLog.setSourceLocNo(locMast.getLocNo()); |
| | | wrkMastLog.setLocNo(locMast.getLocNo()); |
| | | wrkMastLog.setBarcode(locMast.getBarcode()); // 托盘码 |
| | | wrkMastLog.setFullPlt("Y"); // 满板:Y |
| | | wrkMastLog.setPicking("N"); // 拣料 |
| | | wrkMastLog.setExitMk("N"); // 退出 |
| | | wrkMastLog.setEmptyMk("N"); // 空板 |
| | | wrkMastLog.setLinkMis("Y"); |
| | | // 操作人员数据 |
| | | wrkMastLog.setAppeTime(now); |
| | | wrkMastLog.setModiTime(now); |
| | | wrkMastLog.setAppeUser(getUserId()); |
| | | wrkMastLog.setModiUser(getUserId()); |
| | | boolean res = wrkMastLogService.insert(wrkMastLog); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | for (LocDetl locDetl : locDetls) { |
| | | // 保存调整记录 |
| | | AdjDetl adjDetl = new AdjDetl(); |
| | |
| | | if (!adjDetlService.insert(adjDetl)) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMastLog.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMastLog.getIoTime()); |
| | | wrkDetl.setAnfme(0.0); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMastLog.setAppeUser(getUserId()); |
| | | wrkMastLog.setModiUser(getUserId()); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()))) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | |
| | | return R.ok(wrkMastLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryFlow/list/auth") |
| | | @ManagerAuth(memo = "库存移动流水记录") |
| | | public R inventoryFlowList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | if (Cools.isEmpty(param.get("io_time"))) { |
| | | param.put("startTime",""); |
| | | param.put("endTime",""); |
| | | } else { |
| | | String ioTime = (String) param.get("io_time"); |
| | | if (ioTime.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = ioTime.split(RANGE_TIME_LINK); |
| | | param.put("startTime",dates[0]); |
| | | param.put("endTime",dates[1]); |
| | | } |
| | | } |
| | | return wrkMastLogService.inventoryFlowList(curr,limit,param); |
| | | } |
| | | |
| | | 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()); |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.asrs.service.BasWrkStatusService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import lombok.Data; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author pang.jiabao |
| | | * @description 库存移动流水dto |
| | | * @createDate 2025/1/3 13:59 |
| | | */ |
| | | @Data |
| | | public class InventoryFlowDto { |
| | | |
| | | private Integer wrkNo; |
| | | private Date ioTime; |
| | | private Integer ioType; |
| | | private Integer wrkSts; |
| | | private String sourceLocNo; |
| | | private String locNo; |
| | | private String orderNo; |
| | | private String matnr; |
| | | private String maktx; |
| | | private String batch; |
| | | private Double anfme; |
| | | private String zpallet; |
| | | private Long modiUser; |
| | | private Date modiTime; |
| | | |
| | | public String getIoType$() { |
| | | BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); |
| | | BasWrkIotype basWrkIotype = service.selectById(this.ioType); |
| | | if (!Cools.isEmpty(basWrkIotype)) { |
| | | return String.valueOf(basWrkIotype.getIoDesc()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getWrkSts$() { |
| | | BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class); |
| | | BasWrkStatus basWrkStatus = service.selectById(this.wrkSts); |
| | | if (!Cools.isEmpty(basWrkStatus)) { |
| | | return String.valueOf(basWrkStatus.getWrkDesc()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getLocNo$() { |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)) { |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getSourceLocNo$() { |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)) { |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getIoTime$() { |
| | | if (Cools.isEmpty(this.ioTime)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public String getModiTime$() { |
| | | if (Cools.isEmpty(this.modiTime)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getModiUser$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.InventoryFlowDto; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | |
| | | @Insert("insert into asr_wrk_mast_log select * from asr_wrk_mast where wrk_no=#{workNo}") |
| | | int save(Integer workNo); |
| | | |
| | | /** |
| | | * 查询库存移动流水记录 |
| | | */ |
| | | List<InventoryFlowDto> inventoryFlowList(@Param("curr") Integer curr,@Param("limit") Integer limit, @Param("param") Map<String, Object> param); |
| | | |
| | | /** |
| | | * 统计库存移动流水记录数 |
| | | */ |
| | | int inventoryFlowListCount(@Param("param") Map<String, Object> param); |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface WrkMastLogService extends IService<WrkMastLog> { |
| | | |
| | | boolean save(Integer workNo); |
| | | |
| | | /** |
| | | * 查询库存移动流水记录 |
| | | */ |
| | | R inventoryFlowList(Integer curr, Integer limit, Map<String, Object> param); |
| | | } |
| | |
| | | |
| | | List<LocDetlAdjustParam.LocDetlAdjust> list = param.getList(); |
| | | |
| | | // 添加历史工作主档 |
| | | WrkMastLog wrkMast = new WrkMastLog(); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(5); |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceLocNo(locMast.getLocNo()); |
| | | wrkMast.setLocNo(locMast.getLocNo()); |
| | | wrkMast.setBarcode(locMast.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | |
| | | // 增删改只创建一次工作主档 |
| | | boolean updateFlag = true; |
| | | boolean deleteFlag = true; |
| | | boolean addFlag = true; |
| | | |
| | | // 修改数量 |
| | | Iterator<LocDetl> iterator = locDetls.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetlService.save(adjDetl, userId); |
| | | |
| | | if (updateFlag) { |
| | | wrkMast.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMast.setIoType(23); |
| | | boolean res = wrkMastLogService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("库存调整-修改 保存工作档失败"); |
| | | } |
| | | updateFlag = false; |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAnfme(adjust.getCount()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | iterator.remove(); |
| | | iterator1.remove(); |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetlService.save(adjDetl, userId); |
| | | |
| | | if (deleteFlag) { |
| | | wrkMast.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMast.setIoType(22); |
| | | boolean res = wrkMastLogService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("库存调整-删除 保存工作档失败"); |
| | | } |
| | | deleteFlag = false; |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAnfme(0.0); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | |
| | | // 添加库存 |
| | |
| | | locDetl.sync(mat); |
| | | locDetl.setBatch(adjust.getBatch()); |
| | | locDetl.setLocNo(locMast.getLocNo()); |
| | | locDetl.setZpallet(locMast.getBarcode()); |
| | | locDetl.setAnfme(adjust.getCount()); // 数量 |
| | | locDetl.setModiUser(userId); // 操作人员信息 |
| | | locDetl.setModiTime(now); |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetlService.save(adjDetl, userId); |
| | | |
| | | if (addFlag) { |
| | | wrkMast.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMast.setIoType(21); |
| | | boolean res = wrkMastLogService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("库存调整-新增 保存工作档失败"); |
| | | } |
| | | addFlag = false; |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAnfme(adjust.getCount()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | // 修改库位状态 |
| | | int count = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.InventoryFlowDto; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.service.WrkMastLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Service("wrkMastLogService") |
| | | public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService { |
| | |
| | | return this.baseMapper.save(workNo) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public R inventoryFlowList(Integer curr, Integer limit, Map<String, Object> param) { |
| | | Page<InventoryFlowDto> page = new Page<>(); |
| | | page.setCurrent(curr); |
| | | page.setSize(limit); |
| | | page.setTotal(this.baseMapper.inventoryFlowListCount(param)); |
| | | page.setRecords(this.baseMapper.inventoryFlowList(curr, limit, param)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | } |
| | |
| | | <result column="pre_have" property="preHave" /> |
| | | <result column="take_none" property="takeNone" /> |
| | | </resultMap> |
| | | <sql id="queryWhere"> |
| | | <where> |
| | | <if test="param.wrk_no != null and param.wrk_no != ''"> and a.wrk_no = #{param.wrk_no}</if> |
| | | <if test="param.io_type != null and param.io_type != ''"> and a.io_type = #{param.io_type}</if> |
| | | <if test="param.matnr != null and param.matnr != ''"> and b.matnr = #{param.matnr}</if> |
| | | <if test="param.maktx != null and param.maktx != ''"> and b.maktx = #{param.maktx}</if> |
| | | <if test="param.batch != null and param.batch != ''"> and b.batch = #{param.batch}</if> |
| | | <if test="param.zpallet != null and param.zpallet != ''"> and a.barcode = #{param.zpallet}</if> |
| | | <if test="param.loc_no != null and param.loc_no != ''"> and (a.loc_no = #{param.loc_no} or a.source_loc_no = #{param.loc_no})</if> |
| | | <if test="param.startTime != null and param.startTime != ''"> and a.io_time >= #{param.startTime}</if> |
| | | <if test="param.endTime != null and param.endTime != ''"> and a.io_time <= #{param.endTime}</if> |
| | | </where> |
| | | </sql> |
| | | <select id="inventoryFlowList" resultType="com.zy.asrs.entity.InventoryFlowDto"> |
| | | select |
| | | * |
| | | from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by a.modi_time desc) id, |
| | | a.wrk_no wrkNo, |
| | | a.io_type ioType, |
| | | a.io_time ioTime, |
| | | a.wrk_sts wrkSts, |
| | | a.source_loc_no sourceLocNo, |
| | | a.loc_no locNo, |
| | | a.barcode zpallet, |
| | | b.matnr , |
| | | b.maktx , |
| | | b.order_no orderNo, |
| | | b.batch , |
| | | b.anfme , |
| | | b.modi_time modiTime, |
| | | b.modi_user modiUser |
| | | from |
| | | asr_wrk_mast_log a |
| | | inner join asr_wrk_detl_log b on |
| | | a.wrk_no = b.wrk_no |
| | | and a.io_time = b.io_time |
| | | and a.wrk_sts in(5, 15) |
| | | <include refid="queryWhere"></include> |
| | | ) c |
| | | where |
| | | c.id BETWEEN (#{curr} - 1) * (#{limit} + 1) and #{curr} * #{limit} |
| | | </select> |
| | | <select id="inventoryFlowListCount" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from |
| | | asr_wrk_mast_log a |
| | | inner join asr_wrk_detl_log b on |
| | | a.wrk_no = b.wrk_no |
| | | and a.io_time = b.io_time |
| | | and a.wrk_sts in(5, 15) |
| | | <include refid="queryWhere"></include> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | select * from asr_wrk_mast |
| | | where wrk_sts=5 |
| | | or (wrk_sts=15 and ove_mk='Y' and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and dateadd(mi,15,crn_end_time) <= getdate() and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and dateadd(mi,3,crn_end_time) <= getdate() and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and crn_end_time is null and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | order by io_time,wrk_no asc |
| | | </select> |
| | |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | ,{field: 'frozen$', align: 'center',title: '冻结否', |
| | | ,{field: 'frozen$', align: 'center',title: '冻结否',hide: true, |
| | | templet: function(d) { |
| | | // 根据条件判断字体颜色 |
| | | if (d.frozen$ === '已冻结') { |
New file |
| | |
| | | var pageCurr; |
| | | var wrkNo; |
| | | var ioTime; |
| | | 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: '#wrkMastLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/inventoryFlow/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'wrkNo', align: 'center',title: '工作号', style: 'font-weight: bold',event: 'wrkNo'} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间', width:160} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型', width:160} |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态', width:160} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'batch', align: 'center',title: '批号'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ]], |
| | | 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(wrkMastLog)', 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(wrkMastLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | 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 = { |
| | | 'wrkMastLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastLog/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) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | // 搜索栏搜索事件 |
| | | 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: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(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 clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
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="wrk_no" placeholder="工作号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="ioType" class="layui-input" name="io_type" type="text" placeholder="请输入" autocomplete="off" style="display: none"> |
| | | <input id="ioType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="入出库类型" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basWrkIotypeQueryByioType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWrkIotypeQueryByioTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="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"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="batch" 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="loc_no" 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="io_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </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"> |
| | | <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> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="wrkMastLog" lay-filter="wrkMastLog"></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/inventoryFlow/inventoryFlow.js" charset="utf-8"></script> |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | layer.msg("冻结的库存不允许出库!"); |
| | | return; |
| | | } |
| | | |
| | | let locNos = []; |
| | | data.forEach(function(elem) { |
| | | locNos.push(elem.locNo); |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {locNos:locNos}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | data = res.data; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | parent.addTableData(data); |
| | | break; |
| | | } |