| | |
| | | param.remove("supplier"); |
| | | } |
| | | /* 生产单号为空,删除生产单号warehouse */ |
| | | if (Cools.isEmpty(param.get("warehouse"))) { |
| | | param.remove("warehouse"); |
| | | if (Cools.isEmpty(param.get("mnemonic"))) { |
| | | param.remove("mnemonic"); |
| | | } |
| | | return R.ok(locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class))); |
| | | } |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.entity.param.LocNormalStockOutParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.LocNormalService; |
| | | import com.zy.asrs.service.OutStockService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.common.service.erp.ErpService; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | public class OutStockController extends BaseController { |
| | | |
| | |
| | | private OutStockService outStockService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private LocNormalService locNormalService; |
| | | @Autowired |
| | | private ErpService erpService; |
| | | |
| | | /** |
| | | * |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检索符合通知单的库存物料 |
| | | * 检索符合通知单的立库库存物料 |
| | | * @param fbillNo |
| | | * @return |
| | | */ |
| | |
| | | outStockService.startupFullTakeStore(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | /** |
| | | * 检索符合通知单的平仓库存物料 |
| | | * @param fbillNo |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/outStock/query/locNormalList") |
| | | @ManagerAuth |
| | | public R queryMatWithLocNormal(String fbillNo) { |
| | | List<LocNormal> list = locNormalService.queryLocNorlMatnr(fbillNo); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 平仓对接erp出库 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/outStock/locNormal") |
| | | @ManagerAuth |
| | | public R outStockLocNormal(@RequestBody LocNormalStockOutParam param) { |
| | | Long modiUser = getUserId(); |
| | | Date modiTime = new Date(); |
| | | for (LocNormal locNormals:param.getList()) { |
| | | // erp中间表更新数据 |
| | | Integer FInterI = outStockService.queryOutStockFInterID(param.getSupplier()); // 获取出库单主表主键 |
| | | if (!erpService.incrementCPakOut(FInterI, locNormals.getMatnr(), locNormals.getAnfme().doubleValue(), param.getSupplier())) { |
| | | log.info("更新ERP成品出库数据[matnr={0}]失败", locNormals.getMatnr()); |
| | | } |
| | | // 把对应物料平仓库存出库 |
| | | locNormalService.outLocNormal(locNormals.getMatnr(), modiUser, modiTime, locNormals.getId()); |
| | | } |
| | | return R.ok("平仓出库成功"); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value= "仓库") |
| | | private String warehouse; |
| | | |
| | | @TableField(exist = false) |
| | | private String warehouseName; |
| | | |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class LocNormalStockOutParam { |
| | | // 单据编号 |
| | | private String supplier; |
| | | // 平仓物料清单 |
| | | List<LocNormal> list = new ArrayList<>(); |
| | | } |
| | |
| | | public List<LocNormal> pdaLocNormalWarehouseQuery(@Param("warehouse") String warehouse, @Param("matnr") String matnr); |
| | | |
| | | public void pdaLocNormalMove(List<LocNormal> list); |
| | | |
| | | public List<LocNormal> queryLocNorlMatnr(String matnr); |
| | | } |
| | |
| | | List<LocDetl> queryMatWithLoc(String matnr); |
| | | |
| | | List<OutStockBillEntry> queryMatnrWithBillNo(String fbillNo); |
| | | |
| | | Integer queryOutStockFInterID(String supplier); |
| | | } |
| | |
| | | public List<LocNormal> pdaLocNormalWarehouseQuery(String warehouse, String matnr); |
| | | |
| | | public void pdaLocNormalMove(List<LocNormal> list); |
| | | |
| | | public List<LocNormal> queryLocNorlMatnr(String fbillNo); |
| | | |
| | | |
| | | } |
| | |
| | | public interface OutStockService extends IService<OutStockBillEntry> { |
| | | Page<OutStockBillEntry> queryOutStock(Page<OutStockBillEntry> page); |
| | | |
| | | List<LocDetl> queryMatWithLoc(String matnr); |
| | | List<LocDetl> queryMatWithLoc(String fbillNo); |
| | | |
| | | Integer queryOutStockFInterID(String supplier); |
| | | |
| | | /** |
| | | * 出库作业 |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.mapper.LocNormalMapper; |
| | | import com.zy.asrs.mapper.OutStockMapper; |
| | | import com.zy.asrs.service.LocNormalService; |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.common.service.erp.entity.CPICMO; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("locNormalService") |
| | | public class LocNormalServiceImpl extends ServiceImpl<LocNormalMapper, LocNormal> implements LocNormalService { |
| | | @Autowired |
| | | ErpSqlServer erpSqlServer; |
| | | @Autowired |
| | | OutStockMapper outStockMapper; |
| | | |
| | | @Override |
| | | public List<LocNormal> getLocNormalData() { |
| | |
| | | // 平仓入库后更新中间表数据,Fflag_finish改为1,表示平仓入库成功 |
| | | if (list.size() > 0) { |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | String sql = "update CPICMO set Fflag_finish = 1 where FBillNo = '" + list.get(i).getSupplier() + "' and Fnumber = '" + list.get(i).getMatnr() +"'"; |
| | | erpSqlServer.update(sql); |
| | | if (!Cools.isEmpty(list.get(i).getSupplier())) { // 存在入库单号的才进行erp更新 |
| | | String sql = "update CPICMO set FAuxCommitQty = (FAuxCommitQty + {0,number,#}) where 1=1 and Fnumber = ''{1}'' and FBillNo = ''{2}''"; |
| | | sql = MessageFormat.format(sql, list.get(i).getAnfme(), list.get(i).getMatnr(), list.get(i).getSupplier()); |
| | | if (erpSqlServer.update(sql) > 0) { |
| | | sql = "select * from CPICMO where 1=1 and Fnumber = ''{0}'' and FBillNo = ''{1}''"; |
| | | sql = MessageFormat.format(sql, list.get(i).getMatnr(), list.get(i).getSupplier()); |
| | | List<CPICMO> select = erpSqlServer.select(sql, CPICMO.class); |
| | | CPICMO cpicmo = select.get(0); |
| | | boolean complete = false; |
| | | if (cpicmo.getFQty() > 0) { |
| | | if (cpicmo.getFAuxCommitQty() >= cpicmo.getFQty()) { |
| | | complete = true; |
| | | } |
| | | } else { |
| | | if (cpicmo.getFAuxCommitQty() >= cpicmo.getFAuxQty()) { |
| | | complete = true; |
| | | } |
| | | } |
| | | if (complete) { |
| | | if (!completeCPakIn(list.get(i).getSupplier(), list.get(i).getMatnr())) { |
| | | log.error("{}平仓入库单标记完成失败", list.get(i).getSupplier()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 平仓入库逻辑 |
| | | baseMapper.locNormalIn(list); |
| | | } |
| | | |
| | | /** |
| | | * 成品入库单标记完成 |
| | | */ |
| | | private boolean completeCPakIn(String FBillNo, String Fnumber){ |
| | | String sql = "update CPICMO set Fflag_finish = 1 where FBillNo = ''{0}'' and Fnumber = ''{1}''"; |
| | | sql = MessageFormat.format(sql, FBillNo, Fnumber); |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void pdaLocNormalMove(List<LocNormal> list) { |
| | | baseMapper.pdaLocNormalMove(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocNormal> queryLocNorlMatnr(String fbillNo) { |
| | | List<OutStockBillEntry> matList = outStockMapper.queryMatnrWithBillNo(fbillNo); |
| | | List<LocNormal> locNormal = new ArrayList<>(); |
| | | List<LocNormal> locNormalResult = new ArrayList<>(); |
| | | for (Integer i = 0; i < matList.size(); i++) { |
| | | locNormal = baseMapper.queryLocNorlMatnr(matList.get(i).getFnumber()) ; |
| | | if (locNormal.size() > 0) { |
| | | for (LocNormal e:locNormal) { |
| | | LocNormal obj = new LocNormal(); |
| | | obj.setMatnr(e.getMatnr()); |
| | | obj.setMaktx(e.getMaktx()); |
| | | obj.setLgnum(e.getLgnum()); |
| | | obj.setType(e.getType()); |
| | | obj.setMnemonic(e.getMnemonic()); |
| | | obj.setSupplier(e.getSupplier()); |
| | | obj.setWarehouse(e.getWarehouse()); |
| | | obj.setBrand(e.getBrand()); |
| | | obj.setAnfme(e.getAnfme()); |
| | | obj.setBname(e.getBname()); |
| | | obj.setMemo(e.getMemo()); |
| | | obj.setModiUser(e.getModiUser()); |
| | | obj.setModiTime(e.getModiTime()); |
| | | obj.setAppeUser(e.getAppeUser()); |
| | | obj.setAppeTime(e.getAppeTime()); |
| | | obj.setState(e.getState()); |
| | | obj.setWarehouseName(e.getWarehouseName()); |
| | | obj.setId(e.getId()); |
| | | locNormalResult.add(obj); |
| | | } |
| | | } |
| | | } |
| | | return locNormalResult; |
| | | } |
| | | } |
| | |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private LocNormalService locNormalService; |
| | | |
| | | @Override |
| | | public Page<OutStockBillEntry> queryOutStock(Page<OutStockBillEntry> page) { |
| | |
| | | } |
| | | } |
| | | return locList; |
| | | } |
| | | |
| | | @Override |
| | | public Integer queryOutStockFInterID(String supplier) { |
| | | return baseMapper.queryOutStockFInterID(supplier); |
| | | } |
| | | |
| | | @Override |
| | |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setWarehouse(fbillNo); |
| | | wrkDetl.setSupplier(fbillNo); |
| | | wrkDetl.setMemo(detlDto.getLocDetl().getMemo()); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.service.erp.ErpService; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private WaitPakinLogService waitPakinLogService; |
| | | @Autowired |
| | | private ErpService erpService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | |
| | | @GetMapping("/test1") |
| | | public String test1(String barcode){ |
| | |
| | | waitPakinService.delete(wrapper); |
| | | } |
| | | |
| | | // erp关联出库订单处理 |
| | | if (wrkMast.getIoType() == 101) { |
| | | EntityWrapper<WrkDetl> wrapper = new EntityWrapper<>(); |
| | | // 获取工作档内物料清单 |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(wrapper.eq("wrk_no", wrkMast.getWrkNo()).and().isNotNull("supplier")); |
| | | for (WrkDetl wrkDetl: wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getMemo())) { |
| | | if (wrkDetl.getMemo().equals("原材料")) { |
| | | // 待实现 |
| | | } else if (wrkDetl.getMemo().equals("成品")) { |
| | | Integer FInterI = outStockService.queryOutStockFInterID(wrkDetl.getSupplier()); // 获取出库单主表主键 |
| | | if (!erpService.incrementCPakOut(FInterI, wrkDetl.getMatnr(), wrkDetl.getAnfme(), wrkDetl.getSupplier())) { |
| | | exceptionHandle("更新ERP成品出库数据[matnr={0}]失败", wrkDetl.getMatnr()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | exceptionHandle("保存工作历史档[workNo={0}]失败", wrkMast.getWrkNo()); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | return erpSqlServer.select("SELECT * FROM xtyasrs_dual.dbo.OutStockBillEntry", OutStockBillEntry.class); |
| | | } |
| | | |
| | | /* 成品增量出库 */ |
| | | public boolean incrementCPakOut(Integer FInterID, String Fnumber, Double increment, String FBillNo) { |
| | | String sql = "update OutStockbillEntry set FAuxCommitQty = (FAuxCommitQty + {0,number,#}) where 1=1 and Fnumber = ''{1}'' and FInterID = {2,number,#}"; |
| | | sql = MessageFormat.format(sql, increment, Fnumber, FInterID); |
| | | if (erpSqlServer.update(sql) > 0) { |
| | | sql = "select * from OutStockbillEntry where 1=1 and Fnumber = ''{0}'' and FInterID = {1,number,#}"; |
| | | sql = MessageFormat.format(sql, Fnumber, FInterID); |
| | | List<OutStockBillEntry> select = erpSqlServer.select(sql, OutStockBillEntry.class); |
| | | OutStockBillEntry outStockBillEntry = select.get(0); |
| | | boolean complete = false; |
| | | if (outStockBillEntry.getFQty().compareTo(BigDecimal.ZERO) == 1) { |
| | | if (outStockBillEntry.getFAuxCommitQty().compareTo(outStockBillEntry.getFQty()) > -1) { |
| | | complete = true; |
| | | } |
| | | } else { |
| | | if (outStockBillEntry.getFAuxCommitQty().compareTo(outStockBillEntry.getFAuxQty()) > -1) { |
| | | complete = true; |
| | | } |
| | | } |
| | | if (complete) { |
| | | if (!completeCPakOut(FBillNo)) { |
| | | log.error("{}出库单标记完成失败", FBillNo); |
| | | } |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /* 成品出库单标记完成 */ |
| | | private boolean completeCPakOut(String FBillNo){ |
| | | String sql = "update OutStockbill set Fflag_finish = 1 where FBillNo = ''{0}''"; |
| | | sql = MessageFormat.format(sql, FBillNo); |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | /*地址-OutStockBill表数据*/ |
| | | @TableField(exist = false) |
| | | private String FAdd; |
| | | /* 完成标志(Fflag_finish)-OutStockBill表数据 */ |
| | | @TableField(exist = false) |
| | | private Integer FflagFinish; |
| | | @TableField("FBrNo") |
| | | private String FBrNo; |
| | | /*通知单内码*/ |
| | |
| | | if (!outStockMainService.insert(result.get(i))) { |
| | | log.info("出库通知主表OutStockBill同步失败"); |
| | | }; |
| | | } else { |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | <if test="supplier!=null and supplier!=null"> |
| | | and a.supplier like '%' + #{supplier} + '%' |
| | | </if> |
| | | <if test="warehouse!=null and warehouse!=null"> |
| | | and a.warehouse like '%' + #{warehouse} + '%' |
| | | <if test="mnemonic!=null and mnemonic!=null"> |
| | | and a.mnemonic like '%' + #{mnemonic} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | <result column="mnemonic" property="mnemonic"/> |
| | | <result column="supplier" property="supplier"/> |
| | | <result column="warehouse" property="warehouse"/> |
| | | <result column="warehouseName" property="warehouseName"/> |
| | | <result column="brand" property="brand"/> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="bname" property="bname"/> |
| | |
| | | </foreach> |
| | | END; |
| | | </update> |
| | | |
| | | <select id="queryLocNorlMatnr" resultMap="BaseResultMap"> |
| | | select a.*,b.name as warehouseName from asr_loc_normal a left join asr_loc_area b on a.warehouse = b.uuid |
| | | where matnr = #{matnr} and state = '1' |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="FSourceBillNo" property="FSourceBillNo"/> |
| | | <result column="FBillNo" property="FBillNo"/> |
| | | <result column="FAdd" property="FAdd"/> |
| | | <result column="workRecord" property="workRecord"/> |
| | | <result column="Fname" property="Fname" /> |
| | | <result column="Fmodel" property="Fmodel" /> |
| | | <result column="Fflag_finish" property="FflagFinish" /> |
| | | </resultMap> |
| | | |
| | | <!-- asr_loc_detl映射结果 --> |
| | |
| | | <result column="mat_status" property="matStatus" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <sql id="stockOutCondition"> |
| | | <if test="FBillNo!=null and FBillNo!='' "> |
| | | and b.FBillNo like '%' + #{FBillNo} + '%' |
| | |
| | | ( |
| | | select ROW_NUMBER() over (order by a.FInterID,a.FEntryID) as row,a.FBrNo,a.FInterID,a.FEntryID, |
| | | a.FOrderInterID,a.FAuxQty,a.FCommitQty,a.FAuxPrice,a.FDate,a.FNote, a.Fnumber, a.FSourceBillNo, b.FBillNo, |
| | | b.FAdd, |
| | | ((select COUNT(*) from asr_wrk_detl where warehouse = b.FBillNo and matnr = a.Fnumber) + (select COUNT(*) from asr_wrk_detl_log where warehouse = b.FBillNo and matnr = a.Fnumber)) as workRecord |
| | | b.FAdd,b.Fflag_finish, a.Fname, a.Fmodel |
| | | from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID |
| | | where 1=1 |
| | | <if test="FBillNo!=null and FBillNo!='' "> |
| | | <if test="FSourceBillNo!=null and FSourceBillNo!='' "> |
| | | and a.FSourceBillNo = #{FSourceBillNo} |
| | | </if> |
| | | <if test="FBillNo != null and FBillNo != ''"> |
| | | and b.FBillNo = #{FBillNo} |
| | | </if> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) and workRecord = 0 |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="queryOutStockCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | |
| | | <select id="queryMatnrWithBillNo" resultMap="OutStockResultMap"> |
| | | select * from (select ROW_NUMBER() over (order by a.FInterID,a.FEntryID) as row,a.FBrNo,a.FInterID,a.FEntryID, |
| | | a.FOrderInterID,a.FAuxQty,a.FCommitQty,a.FAuxPrice,a.FDate,a.FNote, a.Fnumber, a.FSourceBillNo, b.FBillNo, |
| | | b.FAdd, |
| | | ((select COUNT(*) from asr_wrk_detl where warehouse = b.FBillNo and matnr = a.Fnumber) + (select COUNT(*) from asr_wrk_detl_log where warehouse = b.FBillNo and matnr = a.Fnumber)) as workRecord |
| | | b.FAdd |
| | | from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID |
| | | where b.FBillNo = #{FBillNo}) t where t.workRecord = 0 |
| | | where b.FBillNo = #{FBillNo}) t where 1 = 1 |
| | | </select> |
| | | |
| | | <select id="queryMatWithLoc" resultMap="BaseResultMap"> |
| | |
| | | end |
| | | desc |
| | | </select> |
| | | |
| | | <select id="queryOutStockFInterID" resultType="integer"> |
| | | select FInterID from OutStockBill where FBillNo = #{supplier} |
| | | </select> |
| | | </mapper> |
| | |
| | | ,{field: 'supplier', align: 'center',title: '通知单号'} |
| | | // ,{field: 'warehouse', align: 'center',title: '库区'} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'altme', align: 'center',title: '单位', hide: true} |
| | | ] |
| | |
| | | var cols = []; |
| | | cols.push( |
| | | {field: 'fbillNo', merge: true, align: 'center', title: '单据编号'} |
| | | , {field: 'fsourceBillNo', align: 'center', title: '订单单号' } |
| | | , {field: 'fnumber', align: 'center', title: '物料编号'} |
| | | , {field: 'fname', align: 'center', title: '物料名称'} |
| | | , {field: 'fmodel', align: 'center', title: '规格'} |
| | | , {field: 'fentryID', align: 'center', title: '分录号'} |
| | | , {field: 'forderInterID', align: 'center', title: '销售订单单号'} |
| | | , {field: 'forderInterID', align: 'center', title: '单据编号', hide: true} |
| | | , {field: 'fauxQty', align: 'center', title: '数量'} |
| | | , {field: 'fcommitQty', align: 'center', title: '发货数量'} |
| | | , {field: 'fauxPrice', align: 'center', title: '单价'} |
| | | , {field: 'fdate', align: 'center', title: '日期'} |
| | | , {field: 'fnote', align: 'center', title: '备注'} |
| | | , {field: 'fadd', align: 'center', title: '地址'} |
| | | , {merge: ['fbillNo'], title: '操作', align: 'center', toolbar: '#operate', width: 80} |
| | | , {field: 'fdate', align: 'center', title: '日期', hide: true} |
| | | , {field: 'fnote', align: 'center', title: '备注', hide: true} |
| | | , {field: 'fadd', align: 'center', title: '地址', hide: true} |
| | | , {merge: ['fbillNo'], title: '操作', align: 'center', toolbar: '#operate', width: 140} |
| | | ); |
| | | return cols; |
| | | } |
| | |
| | | outStockDetail = layer.open( |
| | | { |
| | | type: 2, |
| | | title: '选择出库-单据编号[' + orderData.fbillNo + ']', |
| | | title: '立库出库-单据编号[' + orderData.fbillNo + ']', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | |
| | | } |
| | | ); |
| | | } |
| | | if (layEvent == 'btnNormalOut') { |
| | | outStockDetail = layer.open( |
| | | { |
| | | type: 2, |
| | | title: '平仓出库-单据编号[' + orderData.fbillNo + ']', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'outStockNormalDetail.html', |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="warehouse" placeholder="生产单号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="mnemonic" placeholder="生产单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | |
| | | <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="FSourceBillNo" placeholder="请输入订单单号" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="FBillNo" placeholder="请输入单据编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="btnOut">出库</button> |
| | | <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="btnOut">出立库</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="btnNormalOut">出平库</button> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| 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"> |
| | | <link rel="stylesheet" href="../../static/css/print.css" media="all"> |
| | | |
| | | </head> |
| | | <body> |
| | | <div> |
| | | <div class="layui-form" style="padding-top: 8px; padding-left: 8px"> |
| | | <button style="margin-bottom: 0px" class="layui-btn layui-btn-sm layui-form-item" style="display: inline-block" |
| | | id="outbound" lay-submit |
| | | lay-event="outbound" onclick="outbound()">启动出库 |
| | | </button> |
| | | </div> |
| | | <table class="layui-hide" id="stockOut" lay-filter="stockOut" style="margin-top: 0px"></table> |
| | | </div> |
| | | |
| | | </body> |
| | | <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/handlebars/handlebars-v4.5.3.js"></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> |
| | | var orderData = parent.getOrderData(); |
| | | var locData = []; |
| | | var table; |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | , {field: 'warehouseName', align: 'center', title: '库区名称'} |
| | | , {field: 'warehouse', align: 'center', title: '库位编号'} |
| | | , {field: 'anfme', align: 'center', title: '数量'} |
| | | ]; |
| | | cols.push.apply(cols, locNormalCols); |
| | | cols.push({field: 'modiUser$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | // 数据渲染 |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/outStock/query/locNormalList?fbillNo=' + orderData.fbillNo, |
| | | page: true, |
| | | limit: 9999, |
| | | limits: [9999], |
| | | even: true, |
| | | // cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'data': res.data, |
| | | 'code': res.code, |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | locData = res.data; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | /* 启动出库 */ |
| | | function outbound() { |
| | | locData |
| | | var checkStatus = table.checkStatus('stockOut'); |
| | | var checkData = checkStatus.data; |
| | | var obj = { |
| | | list: checkData, |
| | | supplier: orderData.fbillNo, |
| | | } |
| | | if (checkData.length > 0) { |
| | | $.ajax({ |
| | | url: baseUrl + "/outStock/locNormal", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify(obj), |
| | | method: 'POST', |
| | | traditional: true, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | parent.closeDetail(res.msg); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | | layer.msg("请选择需要出库物料"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | </html> |