Merge branch 'xgmasrs' of https://gitee.com/luxiaotao1123/zy-asrs into xgmasrs
| | |
| | | <artifactId>cxf-spring-boot-starter-jaxws</artifactId> |
| | | <version>3.3.4</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!--Lombok--> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>1.18.14</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | return R.ok(locDetlService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/auth") |
| | | @GetMapping(value = "/locDetl/auth") |
| | | @ManagerAuth |
| | | public R stockOutList(@RequestParam(value = "locNos[]") List<String> locNos){ |
| | | if (!locNos.isEmpty()) { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.mat_no = #{matNo} AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC") |
| | | List<String> selectSameDetlToday(String matNo); |
| | | |
| | | List<LocDetl> selectLocDetlList(@Param("mat_no") String matNo); |
| | | |
| | | Double selectLocDetlSumQty(String locNo); |
| | | } |
| | |
| | | */ |
| | | List<String> getSameDetlToday(String matNo); |
| | | |
| | | /** |
| | | * |
| | | * @param matNo 产品号 |
| | | * @return kuwei |
| | | */ |
| | | List<LocDetl> getlocDetlList(String matNo); |
| | | |
| | | /** |
| | | * 查询库位详情中的产品数量 |
| | | * @return |
| | | */ |
| | | Double getLocDetlSumQty(String locNo); |
| | | } |
| | |
| | | * @param locDetls 待出库产品 |
| | | * @param ioType 入出库类型 |
| | | */ |
| | | void stockOut(BasDevp staNo, List<LocDetlDto> locDetls, Integer ioType, Long userId); |
| | | void stockOut(BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId); |
| | | } |
| | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | | @Autowired |
| | | private LocDetlMapper locDetlMapper; |
| | | |
| | | |
| | | @Override |
| | | public Page<LocDetl> getStockOut(Page<LocDetl> page) { |
| | |
| | | return this.baseMapper.selectSameDetlToday(matNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> getlocDetlList(String matNo) { |
| | | return locDetlMapper.selectLocDetlList(matNo); |
| | | } |
| | | |
| | | @Override |
| | | public Double getLocDetlSumQty(String locNo) { |
| | | return locDetlMapper.selectLocDetlSumQty(locNo); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.model.OutLocDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.mapper.WaitMatoutMapper; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WaitMatoutMapper waitMatoutMapper; |
| | | @Autowired |
| | | private WaitMatoutService waitMatoutService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void startupMatOut(StockOutParam param, Long userId){ |
| | | |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatNo(), paramLocDetl.getCount())) { |
| | | LocDetl sqlParam = new LocDetl(); |
| | | sqlParam.setLocNo(paramLocDetl.getLocNo()); |
| | | sqlParam.setMatNo(paramLocDetl.getMatNo()); |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<>(sqlParam)); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | if (!Cools.isEmpty(paramLocDetl.getMatNo())) { |
| | | //查询所有库位状态为F的库位信息 |
| | | List<LocDetl> locDetls=locDetlService.getlocDetlList(paramLocDetl.getMatNo()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()).eq("seq_no",paramLocDetl.getSeqNo())); |
| | | Double outQty = paramLocDetl.getCount() - waitMatout.getOutQty(); |
| | | if(waitMatout.getOutQty() >= waitMatout.getQty()){ |
| | | break; |
| | | } |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | | Double sumCount=locDetlService.getLocDetlSumQty(locDetl.getLocNo()); |
| | | int ioType=0; |
| | | ioType=sumCount-outQty>0?103 : 101; |
| | | |
| | | if (outQty >= locDetl.getQty()){ |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + locDetl.getQty()); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | | .eq("seq_no",paramLocDetl.getSeqNo())); |
| | | }else { |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + outQty); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | | .eq("seq_no",paramLocDetl.getSeqNo())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | } else { |
| | | throw new CoolException("库位产品不存在"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, Integer ioType, Long userId) { |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | | locDetlDtos.forEach(dto -> locNos.add(dto.getLocDetl().getLocNo())); |
| | | List<OutLocDto> dtos = new ArrayList<>(); |
| | | for (String locNo : locNos) { |
| | | List<LocDetlDto> list = new ArrayList<>(); |
| | | Iterator<LocDetlDto> iterator = locDetlDtos.iterator(); |
| | | while (iterator.hasNext()) { |
| | | LocDetlDto dto = iterator.next(); |
| | | if (locNo.equals(dto.getLocDetl().getLocNo())) { |
| | | list.add(dto); |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | dtos.add(new OutLocDto(locNo, list)); |
| | | } |
| | | public void stockOut(BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | // 生成工作档 |
| | | for (OutLocDto dto : dtos) { |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | | if (ioType == null) { |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | } |
| | | LocDetl locDetl=locDetlDtos.getLocDetl(); |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | LocMast locMast = locMastService.selectById(locDetl.getLocNo()); |
| | | // 获取路径 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", ioType) |
| | |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | | wrkMast.setSourceLocNo(dto.getLocNo()); // 源库位 |
| | | wrkMast.setSourceLocNo(locDetl.getLocNo()); // 源库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | throw new CoolException("保存工作档失败,出库库位号:"+locDetl.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | // 出库时,数量为0的直接忽略 |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | if (locDetlDtos.getCount()==null || locDetlDtos.getCount() <= 0.0D) {return;} |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(new Date()); |
| | | Double qty = ioType==101?detlDto.getLocDetl().getQty():detlDto.getCount(); |
| | | wrkDetl.setQty(qty); // 数量 |
| | | VersionUtils.setWrkDetl(wrkDetl, detlDto.getLocDetl()); // 版本控制 |
| | | wrkDetl.setQty(locDetlDtos.getCount()); // 数量 |
| | | VersionUtils.setWrkDetl(wrkDetl, locDetlDtos.getLocDetl()); // 版本控制 |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | locMast = locMastService.selectById(locDetl.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | throw new CoolException("预约库位状态失败,库位号:"+locDetl.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | throw new CoolException(locDetl.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | // 生成激活码 |
| | | public static void main(String[] args) { |
| | | String timeStr = "2020-08-01 17:48:35"; |
| | | String timeStr = "2023-08-01 17:48:35"; |
| | | Date exprTime = DateUtils.convert(timeStr); |
| | | String code = AesUtils.encrypt(DateUtils.convert(exprTime, DateUtils.yyyyMMddHHmmss), SystemProperties.SALT); |
| | | System.out.println("激活码:"+code); |
| | |
| | | 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.MatCode; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.common.entity.KeyValueVo; |
| | |
| | | and b.loc_sts = 'F' |
| | | <include refid="stockOutCondition"></include> |
| | | </select> |
| | | |
| | | <select id="selectLocDetlList" resultMap="BaseResultMap"> |
| | | select a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and a.mat_no= #{mat_no} |
| | | order by a.appe_time |
| | | </select> |
| | | <select id="selectLocDetlSumQty" resultType="double"> |
| | | select SUM(qty) qty |
| | | from asr_loc_detl |
| | | where loc_no=#{locNo} |
| | | </select> |
| | | </mapper> |
| | |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: '工作号'} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间'} |
| | | ,{field: 'matNo', align: 'center',title: '产品编码'} |
| | | ,{field: 'matName', align: 'center',title: '产品名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'size', align: 'center',title: '尺寸'} |
| | | ,{field: 'color', align: 'center',title: '颜色'} |
| | | // ,{field: 'zmatid', align: 'center',title: '产品标签ID'} |
| | | // ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'matnr', align: 'center',title: '产品'} |
| | | ,{field: 'lgnum', align: 'center',title: '仓库号'} |
| | | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} |
| | | ,{field: 'tbpos', align: 'center',title: '行项目'} |
| | | ,{field: 'zmatid', align: 'center',title: '产品标签ID'} |
| | | ,{field: 'maktx', align: 'center',title: '产品描述'} |
| | | ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: '工作号'} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间'} |
| | | ,{field: 'matNo', align: 'center',title: '产品编码'} |
| | | ,{field: 'matName', align: 'center',title: '产品名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'size', align: 'center',title: '尺寸'} |
| | | ,{field: 'color', align: 'center',title: '颜色'} |
| | | // ,{field: 'zmatid', align: 'center',title: '物料标签ID'} |
| | | // ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'matnr', align: 'center',title: '物料'} |
| | | ,{field: 'lgnum', align: 'center',title: '仓库号'} |
| | | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} |
| | | ,{field: 'tbpos', align: 'center',title: '行项目'} |
| | | ,{field: 'zmatid', align: 'center',title: '物料标签ID'} |
| | | ,{field: 'maktx', align: 'center',title: '物料描述'} |
| | | ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | |
| | | 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,#matNo', index), true); |
| | | 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'); |
| | |
| | | var data = { |
| | | // id: $('#id').val(), |
| | | locNo: $('#locNo').val(), |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | specs: $('#specs').val(), |
| | | size: $('#size').val(), |
| | | color: $('#color').val(), |
| | | matnr: $('#matnr').val(), |
| | | lgnum: $('#lgnum').val(), |
| | | tbnum: $('#tbnum').val(), |
| | | tbpos: $('#tbpos').val(), |
| | | zmatid: $('#zmatid').val(), |
| | | // werks: $('#werks').val(), |
| | | qty: $('#qty').val(), |
| | | unit: $('#unit').val(), |
| | | maktx: $('#maktx').val(), |
| | | werks: $('#werks').val(), |
| | | anfme: $('#anfme').val(), |
| | | altme: $('#altme').val(), |
| | | zpallet: $('#zpallet').val(), |
| | | bname: $('#bname').val(), |
| | | memo: $('#memo').val(), |
| | |
| | | var locDetlData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'billNo', title:'单据编号', align: 'center'} |
| | | // {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | // , |
| | | {field: 'billNo', title:'单据编号', align: 'center'} |
| | | ,{field: 'seqNo', title:'序号', align: 'center', width:80} |
| | | ,{field: 'qty', title:'通知出库量', align: 'center'} |
| | | ,{field: 'outQty', title:'已出库量', align: 'center'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'qty'); |
| | | cols.push.apply(cols, detlCols); |
| | | // cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | cols.push( |
| | | {field: 'memo', title:'备注', align: 'center'}, |
| | | {fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateLocDetlData(obj.data.billNo, obj.data.seqNo, obj.data.matNo, Number(obj.value)); |
| | | updateLocDetlData( obj.data.billNo, obj.data.seqNo, obj.data.matNo, obj.data.qty); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | debugger |
| | | |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | locDetls.push({billNo:elem.billNo, seqNo:elem.seqNo, matNo: elem.matNo, count: elem.count}); |
| | | locDetls.push({billNo:elem.billNo,seqNo:elem.seqNo, matNo: elem.matNo, count: elem.count}); |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].billNo === data.billNo && locDetlData[i].seqNo === data.seqNo) { |
| | | if (locDetlData[i].seqNo === data.seqNo && locDetlData[i].matNo === data.matNo) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | function updateLocDetlData(billNo, seqNo, matNo, count) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i=0;i<locDetlData.length;i++){ |
| | | if (locDetlData[i]["billNo"] === billNo && locDetlData[i]["seqNo"] === seqNo){ |
| | | if (count > locDetlData[i]["qty"]) { |
| | | layer.msg("不能超过原数量"); |
| | | } else { |
| | | locDetlData[i]["count"] = count; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit(); getOutBound();}}); |
| | | } |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if(count > (qty-inQty) ){ |
| | | count.html(59) |
| | | layer.msg("入库数量不能超过可入库量"); |
| | | } |
| | | if (count > 0) { |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateLocDetlData(obj.data.locNo, obj.data.matNo, Number(obj.value)); |
| | | updateLocDetlData(obj.data.locNo, obj.data.matnr, Number(obj.value)); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | } |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | // locDetls.push({locNo: elem.locNo, matNo: elem.matNo, count: elem.count}); // todo |
| | | locDetls.push({locNo: elem.locNo, matNo: elem.matNo}); |
| | | // locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.count}); // todo |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr}); |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matNo === data.matNo) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | function updateLocDetlData(locNo, matNo, count) { |
| | | function updateLocDetlData(locNo, matnr, count) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i=0;i<locDetlData.length;i++){ |
| | | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matNo"] === matNo){ |
| | | if (count > locDetlData[i]["qty"]) { |
| | | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){ |
| | | if (count > locDetlData[i]["anfme"]) { |
| | | layer.msg("不能超过原数量"); |
| | | } else { |
| | | locDetlData[i]["count"] = count; |
| | |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<locDetlData.length;j++){ |
| | | if (data[i].matNo === locDetlData[j].matNo && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | pass = true; |
| | | break; |
| | | } |
| | |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = data[i]["qty"]; |
| | | data[i]["count"] = data[i]["anfme"]; |
| | | } |
| | | |
| | | } |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ]; |
| | | arrRemove(detlCols, "field", "qty") |
| | | arrRemove(detlCols, "field", "anfme") |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateMatCodeData(obj.data.matNo, Number(obj.value)); |
| | | updateMatCodeData(obj.data.matnr, Number(obj.value)); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = matCodeData.length - 1; i >= 0; i--) { |
| | | if (matCodeData[i].matNo === data.matNo) { |
| | | if (matCodeData[i].matnr === data.matnr) { |
| | | matCodeData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | matCodeData = []; |
| | | let data = res.data.records; |
| | | for (var i = 0; i<data.length; i++) { |
| | | data[i]["count"] = data[i].qty; |
| | | data[i]["count"] = data[i].anfme; |
| | | data[i]["removeBtn"] = false; |
| | | matCodeData.push(data[i]); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | function updateMatCodeData(matNo, count) { |
| | | function updateMatCodeData(matnr, count) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count >= 0) { |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (matCodeData[i]["matNo"] === matNo){ |
| | | if (matCodeData[i]["matnr"] === matnr){ |
| | | matCodeData[i]["count"] = count; |
| | | } |
| | | } |
| | |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<matCodeData.length;j++){ |
| | | if (data[i].matNo === matCodeData[j].matNo) { |
| | | if (data[i].matNo === matCodeData[j].matnr) { |
| | | pass = true; |
| | | break; |
| | | } |
| | |
| | | count: initCountVal, |
| | | anfme: initAnfmeVal, |
| | | removeBtn: true, |
| | | matNo: data[i].matNo, |
| | | matName: data[i].matName, |
| | | specs: data[i].specs, |
| | | size: data[i].size, |
| | | unit: data[i].unit, |
| | | color: data[i].color, |
| | | matnr: data[i].matNo, |
| | | maktx: data[i].matName, |
| | | lgnum: data[i].str2, |
| | | color: data[i].str3, |
| | | bname: data[i].str4, |
| | | altme: data[i].str1, |
| | | }) |
| | | } |
| | | } |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | // {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | {field: 'qty', align: 'center',title: '数量'} |
| | | {field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'qty'); |
| | | arrRemove(detlCols, 'field', 'anfme'); |
| | | cols.push.apply(cols, detlCols); |
| | | // cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateLocDetlData(obj.data.locNo, obj.data.matNo, Number(obj.value)); |
| | | updateLocDetlData(obj.data.locNo, obj.data.matnr, Number(obj.value)); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | } |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | locDetls.push({locNo: elem.locNo, matNo: elem.matNo, count: elem.count}); |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.count}); |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matNo === data.matNo) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | function updateLocDetlData(locNo, matNo, count) { |
| | | function updateLocDetlData(locNo, matnr, count) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i=0;i<locDetlData.length;i++){ |
| | | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matNo"] === matNo){ |
| | | if (count > locDetlData[i]["qty"]) { |
| | | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){ |
| | | if (count > locDetlData[i]["anfme"]) { |
| | | layer.msg("不能超过原数量"); |
| | | } else { |
| | | locDetlData[i]["count"] = count; |
| | |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<locDetlData.length;j++){ |
| | | if (data[i].matNo === locDetlData[j].matNo && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | pass = true; |
| | | break; |
| | | } |
| | |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = data[i]["qty"]; |
| | | data[i]["count"] = data[i]["anfme"]; |
| | | } |
| | | |
| | | } |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'qty', align: 'center',title: '原数量'} |
| | | ,{field: 'anfme', align: 'center',title: '原数量'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'qty'); |
| | | arrRemove(detlCols, 'field', 'anfme'); |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateLocDetlData(obj.data.locNo, obj.data.matNo, Number(obj.value)); |
| | | updateLocDetlData(obj.data.locNo, obj.data.matnr, Number(obj.value)); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | } |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | locDetls.push({locNo: elem.locNo, matNo: elem.matNo, count: elem.count}); |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.count}); |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matNo === data.matNo) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | function updateLocDetlData(locNo, matNo, count) { |
| | | function updateLocDetlData(locNo, matnr, count) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i=0;i<locDetlData.length;i++){ |
| | | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matNo"] === matNo){ |
| | | if (count > locDetlData[i]["qty"]) { |
| | | if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){ |
| | | if (count > locDetlData[i]["anfme"]) { |
| | | layer.msg("不能超过原数量"); |
| | | } else { |
| | | locDetlData[i]["count"] = count; |
| | |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<locDetlData.length;j++){ |
| | | if (data[i].matNo === locDetlData[j].matNo && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | pass = true; |
| | | break; |
| | | } |
| | |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = data[i]["qty"]; |
| | | data[i]["count"] = data[i]["anfme"]; |
| | | } |
| | | |
| | | } |
| | |
| | | cols: [[ |
| | | // {type: 'checkbox'} |
| | | {field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'matNo', align: 'center',title: '产品编码'} |
| | | ,{field: 'matName', align: 'center',title: '产品名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'size', align: 'center',title: '尺寸'} |
| | | ,{field: 'matnr', align: 'center',title: '产品'} |
| | | ,{field: 'lgnum', align: 'center',title: '仓库号'} |
| | | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} |
| | | // ,{field: 'tbpos', align: 'center',title: '行项目'} |
| | | // ,{field: 'zmatid', align: 'center',title: '产品标签ID'} |
| | | ,{field: 'color', align: 'center',title: '颜色'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'zmatid', align: 'center',title: '产品标签ID'} |
| | | ,{field: 'maktx', align: 'center',title: '产品描述'} |
| | | ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ]], |
| | |
| | | // id: $('#id').val(), |
| | | id: $('#id').val(), |
| | | barcode: $('#barcode').val(), |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | qty: $('#qty').val(), |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | anfme: $('#anfme').val(), |
| | | unit: $('#unit').val(), |
| | | status: $('#status').val(), |
| | | memo: $('#memo').val(), |
| | |
| | | id: $('#id').val(), |
| | | pakinId: $('#pakinId').val(), |
| | | barcode: $('#barcode').val(), |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | qty: $('#qty').val(), |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | anfme: $('#anfme').val(), |
| | | unit: $('#unit').val(), |
| | | status: $('#status').val(), |
| | | memo: $('#memo').val(), |
| | |
| | | // id: $('#id').val(), |
| | | wrkNo: $('#wrkNo').val(), |
| | | ioTime: top.strToDate($('#ioTime\\$').val()), |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | specs: $('#specs').val(), |
| | | size: $('#size').val(), |
| | | color: $('#color').val(), |
| | | // zmatid: $('#zmatid').val(), |
| | | // werks: $('#werks').val(), |
| | | qty: $('#qty').val(), |
| | | unit: $('#unit').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(), |
| | |
| | | modiTime: top.strToDate($('#modiTime\\$').val()), |
| | | appeUser: $('#appeUser').val(), |
| | | appeTime: top.strToDate($('#appeTime\\$').val()), |
| | | // nista: $('#nista').val(), |
| | | nista: $('#nista').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | |
| | | // id: $('#id').val(), |
| | | wrkNo: $('#wrkNo').val(), |
| | | ioTime: top.strToDate($('#ioTime\\$').val()), |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | specs: $('#specs').val(), |
| | | size: $('#size').val(), |
| | | color: $('#color').val(), |
| | | // zmatid: $('#zmatid').val(), |
| | | // werks: $('#werks').val(), |
| | | qty: $('#qty').val(), |
| | | unit: $('#unit').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(), |
| | |
| | | modiTime: top.strToDate($('#modiTime\\$').val()), |
| | | appeUser: $('#appeUser').val(), |
| | | appeTime: top.strToDate($('#appeTime\\$').val()), |
| | | // nista: $('#nista').val(), |
| | | nista: $('#nista').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkDetlLog/"+name+"/auth", |
| | |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: '工作号'} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间'} |
| | | ,{field: 'matNo', align: 'center',title: '产品编码'} |
| | | ,{field: 'matName', align: 'center',title: '产品名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'size', align: 'center',title: '尺寸'} |
| | | ,{field: 'color', align: 'center',title: '颜色'} |
| | | // ,{field: 'zmatid', align: 'center',title: '产品标签ID'} |
| | | // ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'matnr', align: 'center',title: '产品'} |
| | | ,{field: 'lgnum', align: 'center',title: '仓库号'} |
| | | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} |
| | | ,{field: 'tbpos', align: 'center',title: '行项目'} |
| | | ,{field: 'zmatid', align: 'center',title: '产品标签ID'} |
| | | ,{field: 'maktx', align: 'center',title: '产品描述'} |
| | | ,{field: 'werks', align: 'center',title: '工厂'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品编码" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品代号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>物 料:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matNo" class="layui-input" type="text" onkeyup="check(this.id, 'locDetl')" lay-verify="required" > |
| | | <input id="matnr" class="layui-input" type="text" onkeyup="check(this.id, 'locDetl')" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;display: none"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品描述:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matName" class="layui-input" type="text"> |
| | | <input id="maktx" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;display: none"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">数 量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="qty" class="layui-input" type="text" lay-verify="number" > |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品编码" autocomplete="off"> |
| | | <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="mat_name" placeholder="产品名称" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="产品描述" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品编码" autocomplete="off"> |
| | | <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="mat_name" placeholder="产品名称" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="产品描述" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="商品编号" autocomplete="off"> |
| | | <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="mat_name" placeholder="物料描述" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="物料描述" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>产品代号</span> |
| | | <input id="matNo" type="text" disabled="disabled"> |
| | | <input id="matnr" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>产品名称</span> |
| | | <input id="matName" type="text" disabled="disabled"> |
| | | <input id="maktx" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | |
| | | } |
| | | parent.updateTableData({ |
| | | locNo: $('#locNo').val(), |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | count: countDom.val() |
| | | }) |
| | | parent.layer.closeAll(); |
| | |
| | | function remove() { |
| | | parent.removeTableData({ |
| | | locNo: $('#locNo').val(), |
| | | matNo: $('#matNo').val(), |
| | | matnr: $('#matnr').val(), |
| | | }) |
| | | parent.layer.closeAll(); |
| | | } |
| | |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left', width:30}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'matName', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | |
| | | // 修改表格数据 |
| | | function updateTableData(data) { |
| | | for (var i=0;i<locDetlData.length;i++) { |
| | | if (data.matNo === locDetlData[i].matNo && data.locNo === locDetlData[i].locNo) { |
| | | if (data.matnr === locDetlData[i].matnr && data.locNo === locDetlData[i].locNo) { |
| | | locDetlData[i].count = data.count; |
| | | break |
| | | } |
| | |
| | | // 删除表格行 |
| | | function removeTableData(data) { |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matNo === data.matNo) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'matNo', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'matName', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'pickNum', align: 'center', title: '拣料', event: 'detail', width:50}, |
| | |
| | | // 修改表格数据 |
| | | function updateTableData(data) { |
| | | for (var i=0;i<locDetlData.length;i++) { |
| | | if (data.matNo === locDetlData[i].matNo && data.locNo === locDetlData[i].locNo) { |
| | | if (data.matnr === locDetlData[i].matnr && data.locNo === locDetlData[i].locNo) { |
| | | locDetlData[i].count = data.count; |
| | | break |
| | | } |
| | |
| | | // 删除表格行 |
| | | function removeTableData(data) { |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matNo === data.matNo) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品代号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="产品代号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品编码" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="产品代号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | |
| | | </form> |
| | | </script> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="matEditDialog"> |
| | | <form id="matEditForm" lay-filter="matEditForm" class="layui-form model-form"> |
| | | <script type="text/html" id="eCourseCouEditDialog"> |
| | | <form id="eCourseCouEditForm" lay-filter="eCourseCouEditForm" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">物料编码:</label>--> |
| | |
| | | </div> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>保存</button> |
| | | <button class="layui-btn" lay-filter="eCourseCouEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | |
| | | admin.open({ |
| | | type: 1, |
| | | offset: '150px', |
| | | area: '480px', |
| | | title: (exp ? '修改' : '添加') + '明细', |
| | | content: $('#matEditDialog').html(), |
| | | content: $('#eCourseCouEditDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | var url = exp ? '../../json/ok.json' : '../../json/ok.json'; |
| | | // 回显数据 |
| | | form.val('matEditForm', exp); |
| | | form.val('eCourseCouEditForm', exp); |
| | | // 表单提交事件 |
| | | form.on('submit(matEditSubmit)', function (data) { |
| | | var existMats = []; |
| | | xxDataList.forEach(function(elem) { |
| | | existMats.push(elem.matNo); |
| | | }); |
| | | var selectList = matXmSelect.getValue(); |
| | | for (var i = 0; i<selectList.length; i++) { |
| | | var item = selectList[i]; |
| | | if (existMats.indexOf(item.value) === -1) { |
| | | // 查询物料详情 |
| | | |
| | | |
| | | xxDataList.push({matNo: item.value}); |
| | | form.on('submit(eCourseCouEditSubmit)', function (data) { |
| | | if (isExpAdd) { // 前端处理添加、修改 |
| | | if (exp) { // 前端修改 |
| | | for (var i = 0; i < xxDataList.length; i++) { |
| | | if (xxDataList[i].experimentName === data.field.experimentName && xxDataList[i].experimentId !== data.field.experimentId) { |
| | | layer.msg('实验项目名称已存在', {icon: 2}); |
| | | return false; |
| | | } |
| | | } |
| | | layer.close(dIndex); |
| | | for (var j = 0; j < xxDataList.length; j++) { |
| | | if (xxDataList[j].experimentId === data.field.experimentId) { |
| | | xxDataList[j].experimentName = data.field.experimentName; |
| | | } |
| | | } |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } else { // 前端添加 |
| | | for (var i = 0; i < xxDataList.length; i++) { |
| | | if (xxDataList[i].experimentName === data.field.experimentName) { |
| | | layer.msg('实验项目名称已存在', {icon: 2}); |
| | | return false; |
| | | } |
| | | } |
| | | layer.close(dIndex); |
| | | data.field.experimentId = new Date().getTime(); |
| | | xxDataList.push(data.field); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | } else { // 后端处理添加修改 |
| | | layer.load(2); |
| | | if (!exp) { |
| | | data.field.experimentTypeId = expTpe.experimentTypeId; |
| | | } |
| | | $.get(url, {json: JSON.stringify(data.field)}, function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200) { |
| | | layer.close(dIndex); |
| | | insTbSSXM.reload({page: {curr: 1}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | }, 'json'); |
| | | } |
| | | layer.close(dIndex); |
| | | |
| | | // if (isExpAdd) { // 前端处理添加、修改 |
| | | // if (exp) { // 前端修改 |
| | | // for (var i = 0; i < xxDataList.length; i++) { |
| | | // if (xxDataList[i].experimentName === data.field.experimentName && xxDataList[i].experimentId !== data.field.experimentId) { |
| | | // layer.msg('实验项目名称已存在', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | // } |
| | | // layer.close(dIndex); |
| | | // for (var j = 0; j < xxDataList.length; j++) { |
| | | // if (xxDataList[j].experimentId === data.field.experimentId) { |
| | | // xxDataList[j].experimentName = data.field.experimentName; |
| | | // } |
| | | // } |
| | | // insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | // } else { // 前端添加 |
| | | // for (var i = 0; i < xxDataList.length; i++) { |
| | | // if (xxDataList[i].experimentName === data.field.experimentName) { |
| | | // layer.msg('实验项目名称已存在', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | // } |
| | | // layer.close(dIndex); |
| | | // data.field.experimentId = new Date().getTime(); |
| | | // xxDataList.push(data.field); |
| | | // insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | // } |
| | | // } else { // 后端处理添加修改 |
| | | // layer.load(2); |
| | | // if (!exp) { |
| | | // data.field.experimentTypeId = expTpe.experimentTypeId; |
| | | // } |
| | | // $.get(url, {json: JSON.stringify(data.field)}, function (res) { |
| | | // layer.closeAll('loading'); |
| | | // if (res.code === 200) { |
| | | // layer.close(dIndex); |
| | | // insTbSSXM.reload({page: {curr: 1}}); |
| | | // layer.msg(res.msg, {icon: 1}); |
| | | // } else { |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | // } |
| | | // }, 'json'); |
| | | // } |
| | | return false; |
| | | }); |
| | | // 渲染物料选择 |
| | | var matXmSelect = xmSelect.render({ |
| | | el: '#mat', |
| | | style: { |
| | | width: '340px', |
| | | }, |
| | | // radio: true, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品代号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="产品代号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品代号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matNo" class="layui-input" type="text"> |
| | | <input id="matnr" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品描述:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matName" class="layui-input" type="text"> |
| | | <input id="maktx" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">数 量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="qty" class="layui-input" type="text" lay-verify="number" > |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品代号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matNo" class="layui-input" type="text"> |
| | | <input id="matnr" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品描述:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matName" class="layui-input" type="text"> |
| | | <input id="maktx" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">数 量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="qty" class="layui-input" type="text" lay-verify="number" > |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>物 料:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matNo" class="layui-input" type="text" lay-verify="required" > |
| | | <input id="matnr" class="layui-input" type="text" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品描述:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matName" class="layui-input" type="text"> |
| | | <input id="maktx" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">数 量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="qty" class="layui-input" type="text" lay-verify="number" > |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">单 位:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="unit" class="layui-input" type="text"> |
| | | <input id="altme" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>产品编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matNo" class="layui-input" type="text" lay-verify="required" > |
| | | <input id="matnr" class="layui-input" type="text" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">产品描述:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matName" class="layui-input" type="text"> |
| | | <input id="maktx" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">数 量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="qty" class="layui-input" type="text" lay-verify="number" > |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |