| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class ConfigTypeController extends BaseController { |
| | |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/configTypeQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | |
| | | String type = condition.split(",")[1]; |
| | | condition = condition.split(",")[0]; |
| | | |
| | | EntityWrapper<ConfigType> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("type",type); |
| | | wrapper.like("value", condition); |
| | | Page<ConfigType> page = configTypeService.selectPage(new Page<>(0, 32), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ConfigType configType : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", configType.getId()); |
| | | map.put("value", configType.getValue()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | 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()); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class LocOwnerController extends BaseController { |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", locOwner.getId()); |
| | | map.put("value", locOwner.getOwner()); |
| | | map.put("phone", locOwner.getPhone()); |
| | | map.put("addr", locOwner.getAddr()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/plaDetl/packout1/v1") |
| | | // @ManagerAuth(memo="pla出库") |
| | | public R plaPackOut1(@RequestBody JSONObject json){ |
| | | String locNo = json.get("locNo").toString(); |
| | | String batch = json.get("batch").toString(); |
| | | String packageNo = json.get("packageNo").toString(); |
| | | String orderNo = json.get("orderNo").toString(); |
| | | String orderDetlId = json.get("orderDetlId").toString(); |
| | | String wrkNo = json.get("wrkNo").toString(); |
| | | Double anfme = Double.parseDouble(json.get("anfme").toString()); |
| | | |
| | | if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | return R.error("有参数为空,无法入库"); |
| | | } |
| | | |
| | | mobileService.plaPakout(locNo,batch,packageNo,orderNo,orderDetlId,wrkNo,anfme); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/plaDetl/packout/v1") |
| | | // @ManagerAuth(memo="pla出库") |
| | | public R plaPackOut(@RequestBody JSONObject json){ |
| | |
| | | if(Cools.isEmpty(plaQty.getLocNo())){ |
| | | continue; |
| | | } |
| | | //插入一条pla的拣货信息 |
| | | plaQtyService.insert(plaQty); |
| | | addPakOUT(plaQty); |
| | | |
| | | Pla pla = plaService.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo()); |
| | | //pla明细中修改锁定出库的重量 |
| | | pla.setQtyAnfme(pla.getQtyAnfme() + plaQty.getQtyAnfme()); |
| | | plaService.updateById(pla); |
| | | |
| | |
| | | manPakOut.setCount(0.0); |
| | | manPakOut.setDocNum(plaQty.getOrderNo()); |
| | | manPakOut.setNodeId(plaQty.getOrderDetlId()); |
| | | manPakOut.setStatus(0); |
| | | manPakOutService.insert(manPakOut); |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.ManPakOut; |
| | | import com.zy.asrs.entity.Pla; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | import com.zy.asrs.service.ManPakOutService; |
| | | import com.zy.asrs.service.PlaQtyService; |
| | | import com.zy.asrs.service.PlaService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.BeanUtils; |
| | | 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; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private PlaService plaService; |
| | | @Autowired |
| | | private PlaQtyService plaQtyService; |
| | | @Autowired |
| | | private ManPakOutService manPakOutService; |
| | | |
| | | @RequestMapping(value = "/pla/list/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/delivery/auth") |
| | | @ManagerAuth |
| | | public R delivery() { |
| | | return R.ok(plaQtyService.getDeliveryDate()); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/sellout/auth") |
| | | @ManagerAuth |
| | | public R sellout(@RequestBody List<Pla> plas) { |
| | | |
| | | plas.forEach(pla -> { |
| | | |
| | | if(pla.getWeightAnfme() - pla.getQtyAnfme() - pla.getOrderWeight() < 0){ |
| | | throw new CoolException("该库存剩余重量不足,请调整出库重量"); |
| | | } |
| | | pla.setQtyAnfme(pla.getQtyAnfme() + pla.getOrderWeight()); |
| | | pla.setHandlerBy(getUser().getUsername()); |
| | | pla.setStatus("待出库"); |
| | | pla.setPakoutTime(pla.getPakoutTime().split("\\(")[0]); |
| | | PlaQty plaQty = new PlaQty(); |
| | | BeanUtils.copyProperties(pla,plaQty); |
| | | plaQty.setCreateTime(new Date()); |
| | | plaQty.setId(null); |
| | | |
| | | plaService.updateById(pla); |
| | | plaQtyService.insert(plaQty); |
| | | |
| | | //生成拣货单 |
| | | addPakOUT(plaQty); |
| | | |
| | | }); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/returned/auth") |
| | | @ManagerAuth |
| | | public R returned(@RequestBody List<PlaQty> plaQties) { |
| | | plaService.returned(plaQties,getUser()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pla/rework/auth") |
| | | @ManagerAuth |
| | | public R rework(@RequestBody List<Pla> plas) { |
| | | plas.forEach(pla -> { |
| | | Double anfme = pla.getWeightAnfme(); |
| | | pla.setStatus("全部出库"); |
| | | pla.setModifyTime(new Date()); |
| | | pla.setWeightAnfme(0.0); |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(1,pla.getLocNo(),pla.getBatch()+","+pla.getPackageNo(),anfme,getUser().getUsername()); |
| | | }); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | 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()); |
| | |
| | | } |
| | | } |
| | | |
| | | private R addPakOUT(PlaQty plaQty){ |
| | | ManPakOut manPakOut=new ManPakOut(); |
| | | manPakOut.setWrkNo(plaQty.getOrderNo()+"-"+System.currentTimeMillis()); |
| | | manPakOut.setWrkSts((long)1); |
| | | manPakOut.setAnfme(plaQty.getOrderWeight()); |
| | | manPakOut.setLocNo(plaQty.getLocNo()); |
| | | manPakOut.setBatch(plaQty.getBatch()); |
| | | manPakOut.setBarcode(plaQty.getPackageNo()); |
| | | manPakOut.setUuid(String.valueOf(System.currentTimeMillis())); |
| | | manPakOut.setCreateTime(new Date()); |
| | | manPakOut.setUpdateTime(new Date()); |
| | | manPakOut.setCount(0.0); |
| | | manPakOut.setDocNum(plaQty.getOrderNo()); |
| | | manPakOut.setStatus(0); |
| | | manPakOut.setNodeId(plaQty.getId()); |
| | | //manPakOut.setNodeId(plaQty.getOrderDetlId()); |
| | | manPakOutService.insert(manPakOut); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.ManPakOut; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | import com.zy.asrs.service.ManPakOutService; |
| | | import com.zy.asrs.service.PlaQtyService; |
| | | import com.zy.asrs.service.PlaService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | public class PlaQtyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PlaService plaService; |
| | | @Autowired |
| | | private PlaQtyService plaQtyService; |
| | | @Autowired |
| | | private ManPakOutService manPakOutService; |
| | | |
| | | @RequestMapping(value = "/plaQty/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<PlaQty> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(PlaQty.class, param.keySet(), wrapper, condition); |
| | | return R.ok(plaQtyService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/plaQty/orderDetail/auth") |
| | | @ManagerAuth |
| | | public R getOrderDetail(String orderNo) { |
| | | |
| | | List<PlaQty> plaQties = plaQtyService.selectList(new EntityWrapper<PlaQty>().eq("order_no", orderNo).eq(false,"returned",1)); |
| | | |
| | | plaQties = plaQties.stream().filter(plaQty -> { |
| | | ManPakOut manPakOut = manPakOutService.selectOne(new EntityWrapper<ManPakOut>().eq("node_id", plaQty.getId())); |
| | | if (Cools.isEmpty(manPakOut)) { |
| | | return false; |
| | | } |
| | | if (Cools.isEmpty(manPakOut.getStatus()) || manPakOut.getStatus() != 1) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | |
| | | return R.ok(plaQties); |
| | | } |
| | | |
| | | @RequestMapping(value = "/plaQty/delivery/auth") |
| | | @ManagerAuth |
| | | public R delivery() { |
| | | return R.ok(plaQtyService.getDeliveryDate()); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderNoQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<PlaQty> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("order_no"); |
| | | wrapper.like("id", condition); |
| | | wrapper.groupBy("order_no"); |
| | | List<String> list = plaQtyService.selectOrderNo(); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (String orderNo : list){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | PlaQty plaQty = plaQtyService.selectOne(new EntityWrapper<PlaQty>().eq("order_no", orderNo)); |
| | | map.put("id", plaQty.getId()); |
| | | map.put("value", orderNo); |
| | | map.put("customer", plaQty.getCustomer()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | private String type; |
| | | private String value; |
| | | private Date createTime; |
| | | private String name; |
| | | } |
| | |
| | | @ApiModelProperty(value= "") |
| | | private String owner; |
| | | |
| | | private String phone; |
| | | |
| | | private String addr; |
| | | |
| | | public LocOwner() {} |
| | | |
| | | public LocOwner(String owner) { |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | |
| | | |
| | | //入库时间 |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("pakin_time") |
| | | private String pakinTime; |
| | | |
| | | //批号 |
| | | @TableField("batch") |
| | | private String batch; |
| | | |
| | | //包装号 |
| | | @TableField("package_no") |
| | | private String packageNo; |
| | | |
| | | //牌号 |
| | | @TableField("brand") |
| | | private String brand; |
| | | |
| | | //重量 |
| | | @TableField("weight") |
| | | private Double weight; |
| | | |
| | | //车间 |
| | | @TableField("workshop") |
| | | private String workshop; |
| | | |
| | | //生产线 |
| | | @TableField("line") |
| | | private String line; |
| | | |
| | | //包装类型 |
| | | @TableField("package_type") |
| | | private String packageType; |
| | | |
| | | //托盘类型 |
| | | @TableField("zpallet_type") |
| | | private String zpalletType; |
| | | |
| | | //缠膜 |
| | | @TableField("film_wrap") |
| | | private String filmWrap; |
| | | |
| | | //熔指 |
| | | @TableField("finger_melting") |
| | | private Double fingerMelting; |
| | | |
| | | //熔点 |
| | | @TableField("fusing_point") |
| | | private Double fusingPoint; |
| | | |
| | | //挥发份1 |
| | | @TableField("vadf1") |
| | | private Double vadf1; |
| | | |
| | | //挥发份2 |
| | | @TableField("vadf2") |
| | | private Double vadf2; |
| | | |
| | | //黄度 |
| | | @TableField("yellowness") |
| | | private Double yellowness; |
| | | |
| | | //不透明度 |
| | | @TableField("opacity") |
| | | private Double opacity; |
| | | |
| | | //水分 |
| | | @TableField("water") |
| | | private Double water; |
| | | |
| | | //L值 |
| | | @TableField("l") |
| | | private Double l; |
| | | |
| | | //a值 |
| | | @TableField("a") |
| | | private Double a; |
| | | |
| | | //b值 |
| | | @TableField("b") |
| | | private Double b; |
| | | |
| | | //填充 |
| | | @TableField("fill_in") |
| | | private Double fillIn; |
| | | |
| | | //质量状态 |
| | | @TableField("mass_state") |
| | | private String massState; |
| | | |
| | | //质量问题 |
| | | @TableField("problem") |
| | | private String problem; |
| | | |
| | | //仓库 |
| | | @TableField("stash") |
| | | private String stash; |
| | | |
| | | //库位 |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | //剩余重量 |
| | | @TableField("weight_anfme") |
| | | private Double weightAnfme = 0.0; |
| | | //剩余重量 |
| | | //待出库数量 |
| | | @TableField("qty_anfme") |
| | | private Double qtyAnfme = 0.0; |
| | | |
| | | //状态 |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | //步骤 |
| | | @TableField("step") |
| | | private int step; |
| | | |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | @TableField("modify_time") |
| | | private Date modifyTime; |
| | | |
| | | @TableField("create_user") |
| | | private String createUser; |
| | | |
| | | @TableField("modify_user") |
| | | private String modifyUser; |
| | | |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | @TableField("pakout_time") |
| | | private String pakoutTime; |
| | | |
| | | @TableField("order_weight") |
| | | private Double orderWeight; |
| | | |
| | | @TableField("handler_by") |
| | | private String handlerBy; |
| | | |
| | | @TableField("transfer") |
| | | private String transfer; |
| | | |
| | | @TableField("customer") |
| | | private String customer; |
| | | |
| | | @TableField("allocate") |
| | | private String allocate; |
| | | |
| | | @TableField("memo") |
| | | private String memo; |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | |
| | | //创建时间 |
| | | private Date createTime; |
| | | |
| | | @TableField("pakout_time") |
| | | private String pakoutTime; |
| | | |
| | | @TableField("order_weight") |
| | | private Double orderWeight; |
| | | |
| | | @TableField("handler_by") |
| | | private String handlerBy; |
| | | |
| | | @TableField("transfer") |
| | | private String transfer; |
| | | |
| | | @TableField("customer") |
| | | private String customer; |
| | | |
| | | @TableField("allocate") |
| | | private String allocate; |
| | | |
| | | @TableField("memo") |
| | | private String memo; |
| | | |
| | | private int returned; |
| | | |
| | | public PlaQty(String batch, String packageNo, Long orderDetlId, Long orderId, String orderNo, Double qtyAnfme, String locNo, Date createTime) { |
| | | this.batch = batch; |
| | | this.packageNo = packageNo; |
| | |
| | | this.createTime = createTime; |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public PlaQty(){ |
| | | |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface PlaQtyMapper extends BaseMapper<PlaQty> { |
| | | |
| | | @Select("select top(10) order_no from asr_pla_qty group by order_no") |
| | | List<String> selectOrderNo(); |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PlaQtyService extends IService<PlaQty> { |
| | | |
| | | JSONArray getDeliveryDate(); |
| | | |
| | | List<String> selectOrderNo(); |
| | | |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.Pla; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | import com.zy.system.entity.User; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | void queryStock(OrderDetl orderDetl, List<PlaQty> plaQties); |
| | | |
| | | void returned(List<PlaQty> plaQties, User user); |
| | | |
| | | } |
| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.SaasLogService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private LocOwnerService locOwnerService; |
| | | @Autowired |
| | | private PlaService plaService; |
| | | @Autowired |
| | | private PlaQtyService plaQtyService; |
| | | @Autowired |
| | | private SaasLogService saasLogService; |
| | | |
| | | |
| | | |
| | |
| | | @Override |
| | | public void plaPakin(String locNo, String batch, String packageNo) { |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | if(!pla.getLocNo().equals(locNo)){ |
| | | throw new CoolException("该物料入库的库位错误"); |
| | | } |
| | | if("已入库".equals(pla.getStatus())){ |
| | | throw new CoolException("该物料已入库"); |
| | | } |
| | | pla.setStatus("已入库"); |
| | | pla.setModifyTime(new Date()); |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(0,locNo,batch+","+packageNo,pla.getWeightAnfme(),null); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void plaPakout(String locNo, String batch, String packageNo, String orderNo, String orderDetlId, String wrkNo, Double anfme) { |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | //Order order = orderService.selectByNo(orderNo); |
| | | OrderDetl orderDetl = orderDetlService.selectById(orderDetlId); |
| | | |
| | | ManPakOut manPakOut = manPakOutService.selectById(wrkNo); |
| | | |
| | | PlaQty plaQty = plaQtyService.selectById(orderDetlId); |
| | | |
| | | //更新拣货单信息 |
| | | if(manPakOut.getCount() + anfme > manPakOut.getAnfme()){ |
| | | throw new CoolException("拣货重量大于拣货单所需拣货重量,请重新分配拣货重量"); |
| | | } |
| | | if(manPakOut.getStatus() == 1){ |
| | | throw new CoolException("该拣料单已出库"); |
| | | } |
| | | manPakOut.setCount(manPakOut.getCount() + anfme); |
| | | if (manPakOut.getAnfme().equals(manPakOut.getCount())){ |
| | |
| | | manPakOutService.updateById(manPakOut); |
| | | } |
| | | |
| | | //更新单据明细 |
| | | orderDetl.setQty(orderDetl.getQty() + anfme); |
| | | orderDetlService.updateById(orderDetl); |
| | | |
| | | //更新单据信息 |
| | | orderService.checkComplete(orderNo); |
| | | |
| | | //更新pla明细 |
| | | pla.setWeightAnfme(pla.getWeightAnfme() - anfme); |
| | | pla.setQtyAnfme(pla.getQtyAnfme() - anfme); |
| | | if(pla.getWeightAnfme() <= 0){ |
| | | pla.setStatus("全部出库"); |
| | | }else { |
| | | pla.setStatus("部分出库"); |
| | | } |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(1,locNo,batch+","+packageNo,anfme,null); |
| | | |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.PlaQty; |
| | | import com.zy.asrs.mapper.PlaQtyMapper; |
| | | import com.zy.asrs.service.PlaQtyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | @Service("plaQtyService") |
| | | public class PlaQtyServiceImpl extends ServiceImpl<PlaQtyMapper, PlaQty> implements PlaQtyService { |
| | | |
| | | @Override |
| | | public JSONArray getDeliveryDate() { |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | |
| | | for (int i=0; i<8; i++){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.add(Calendar.DAY_OF_YEAR, i/2); |
| | | int month = calendar.get(Calendar.MONTH) + 1; |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | |
| | | String isAm = i % 2 == 0 ? "上午" : "下午"; |
| | | |
| | | String pakoutTimeQuery = month + "月" + day + "日" + isAm; |
| | | List<PlaQty> plaQties = this.selectList(new EntityWrapper<PlaQty>().eq("pakout_time", pakoutTimeQuery)); |
| | | |
| | | Double daysOutWeight = 0.0; |
| | | String handlerBy = ""; |
| | | for (PlaQty plaQty : plaQties){ |
| | | daysOutWeight += plaQty.getOrderWeight(); |
| | | if(!handlerBy.contains(plaQty.getHandlerBy())){{ |
| | | handlerBy += "、" + plaQty.getHandlerBy(); |
| | | }} |
| | | } |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | String text = daysOutWeight > 0 ? pakoutTimeQuery + "(" + daysOutWeight/1000 + "吨)" : pakoutTimeQuery; |
| | | |
| | | object.put("text",text); |
| | | object.put("user",handlerBy); |
| | | |
| | | jsonArray.add(object); |
| | | } |
| | | |
| | | return jsonArray; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectOrderNo() { |
| | | return this.baseMapper.selectOrderNo(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String str = "aaaa"; |
| | | |
| | | |
| | | System.out.println(str.split("\\(" )[0]); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.mapper.PlaMapper; |
| | | import com.zy.asrs.service.PlaQtyService; |
| | | import com.zy.asrs.service.PlaService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //退回 |
| | | public void returned(List<PlaQty> plaQties, User user) { |
| | | plaQties.forEach(plaQty -> { |
| | | PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId()); |
| | | plaQtyOut.setReturned(1); |
| | | plaQtyService.updateById(plaQtyOut); |
| | | |
| | | PlaQty plaQtyReturned = new PlaQty(); |
| | | plaQtyReturned.setBatch(plaQtyOut.getBatch()); |
| | | plaQtyReturned.setPackageNo(plaQtyOut.getPackageNo()); |
| | | plaQtyReturned.setCreateTime(new Date()); |
| | | plaQtyReturned.setLocNo(plaQtyOut.getLocNo()); |
| | | plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo()); |
| | | plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date())); |
| | | plaQtyReturned.setOrderWeight(0 - plaQtyOut.getOrderWeight()); |
| | | plaQtyReturned.setHandlerBy(user.getUsername()); |
| | | plaQtyReturned.setCustomer(plaQtyOut.getCustomer()); |
| | | plaQtyReturned.setMemo(plaQty.getMemo()); |
| | | plaQtyService.insert(plaQtyReturned); |
| | | |
| | | Pla pla = this.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo()); |
| | | pla.setStatus("待入库"); |
| | | |
| | | this.updateById(pla); |
| | | |
| | | }); |
| | | } |
| | | } |
| | |
| | | import com.zy.common.properties.SlaveProperties; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | } |
| | | |
| | | public static String getDateStr(Date date){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | return simpleDateFormat.format(date); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SlaveProperties slaveProperties = new SlaveProperties(); |
| | | slaveProperties.setDoubleDeep(true); |
| | |
| | | System.out.println(deepRow); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // http请求 |
| | | !function (n) { |
| | | "use strict"; |
| | |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'type', align: 'center',title: '类型'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'value', align: 'center',title: '值'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | |
| | | shadeClose: false, |
| | | content: 'configTypeAdd.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | // clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | |
| | | } |
| | | }); |
| | | break; |
| | |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | name: $('#type option:selected').text(), |
| | | type: $('#type').val(), |
| | | value: $('#value').val(), |
| | | }; |
| | |
| | | } |
| | | } |
| | | |
| | | function test() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 搜索自动补全 -- input |
| | | */ |
| | | function autoLoad(val) { |
| | | var inputDomVal = document.querySelector("input[data-key="+val+"]").value; |
| | | var selectDom = document.querySelector("select[data-key="+val+"Select]"); |
| | | var type = document.querySelector("input[data-key="+val+"]").getAttribute('data-value'); |
| | | if(type){ |
| | | inputDomVal = inputDomVal + "," + type; |
| | | } |
| | | //debugger; |
| | | selectDom.length = 0; |
| | | var defaultOption = new Option("取消选择", ""); |
| | | defaultOption.title = ""; |
| | |
| | | for (var i=0;i<list.length;i++){ |
| | | var option = new Option(list[i].value, i); |
| | | option.title = list[i].id; |
| | | option.addr = list[i].addr; |
| | | option.phone = list[i].phone; |
| | | option.customer = list[i].customer; |
| | | selectDom.options[i+1] = option; |
| | | } |
| | | selectDom.style.display='block'; |
| | |
| | | } else { |
| | | cacd.val(selectOptionDom.html()); |
| | | realDom.val(selectOptionDom.attr("title")); |
| | | if(selectOptionDom[0].phone){ |
| | | $('#phone').val(selectOptionDom[0].phone); |
| | | } |
| | | if(selectOptionDom[0].addr){ |
| | | $('#addr').val(selectOptionDom[0].addr); |
| | | } |
| | | if(selectOptionDom[0].customer){ |
| | | $('#customerR').val(selectOptionDom[0].customer); |
| | | tableReload(); |
| | | |
| | | }else { |
| | | $('#customerR').val(""); |
| | | } |
| | | } |
| | | inputDom.val(""); |
| | | } |
| | | |
| | | function tableReload(){ |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | var orderNo = $('#orderNoV').val(); |
| | | table.render({ |
| | | elem: '#formSSXMTable', |
| | | height: 312, |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/plaQty/orderDetail/auth', |
| | | where: { |
| | | orderNo: orderNo |
| | | }, |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'id', title: 'id', hide:true}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'packageNo', title: '包号'}, |
| | | {field: 'orderWeight', title: '重量'} |
| | | |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | console.log(res) |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | tableData = table.cache.locDetl; |
| | | console.log(tableData); |
| | | 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'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | } |
| | | |
| | | function reviewImg(src) { |
| | | window.open().document.write("<img src="+src+" />"); |
| | | } |
| | |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | debugger; |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | |
| | | cols: [[ |
| | | // {type: 'checkbox'} |
| | | {field: 'owner', align: 'center',title: '客户名称'} |
| | | ,{field: 'id', align: 'center',title: '客户编码'} |
| | | ,{field: 'phone', align: 'center',title: '电话'} |
| | | ,{field: 'addr', align: 'center',title: '地址'} |
| | | ,{field: 'id', align: 'center',title: '客户编码',hide:true} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | |
| | | |
| | | |
| | | if (layEvent === 'edit') { |
| | | showEditModel(data); |
| | | } else if (layEvent === 'del') { |
| | |
| | | var matCodeLayerIdx; |
| | | var data = []; |
| | | var checkStatus = []; |
| | | var dataCheck = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'id', title: 'id', align: 'center',hide:true} |
| | |
| | | ,{field: 'weight', align: 'center',title: '重量(KG)', hide:true} |
| | | ,{field: 'workshop', align: 'center',title: '生产车间', hide:true} |
| | | ,{field: 'line', align: 'center',title: '生产线', hide:true} |
| | | ,{field: 'packageType', align: 'center',title: '包装类型', hide:true} |
| | | ,{field: 'zpalletType', align: 'center',title: '托盘类型', hide:true} |
| | | ,{field: 'packageType', align: 'center',title: '包装类型'} |
| | | ,{field: 'zpalletType', align: 'center',title: '托盘类型'} |
| | | ,{field: 'filmWrap', align: 'center',title: '缠膜', edit: true} |
| | | ,{field: 'fingerMelting', align: 'center',title: '熔指(g/10min)'} |
| | | ,{field: 'fusingPoint', align: 'center',title: '熔点(℃)'} |
| | | ,{field: 'vadf1', align: 'center',title: '挥发份1(%)', hide:true} |
| | |
| | | ,{field: 'yellowness', align: 'center',title: '黄度', hide:true} |
| | | ,{field: 'opacity', align: 'center',title: '不透明度(0-100%)', hide:true} |
| | | ,{field: 'water', align: 'center',title: '水分(ppm)', hide:true} |
| | | ,{field: 'l', align: 'center',title: 'l值', edit: true} |
| | | ,{field: 'a', align: 'center',title: 'a值', edit: true} |
| | | ,{field: 'b', align: 'center',title: 'b值', edit: true} |
| | | ,{field: 'l', align: 'center',title: 'l值', edit: true, hide:true} |
| | | ,{field: 'a', align: 'center',title: 'a值', edit: true, hide:true} |
| | | ,{field: 'b', align: 'center',title: 'b值', edit: true, hide:true} |
| | | ,{field: 'fillIn', align: 'center',title: '填充(%)', edit: true} |
| | | ,{field: 'massState', align: 'center',title: '质量状态', hide:true} |
| | | ,{field: 'problem', align: 'center',title: '质量问题', hide:true} |
| | |
| | | ,{field: 'locNo', align: 'center',title: '库位', edit:true} |
| | | ,{field: 'weightAnfme', align: 'center',title: '剩余重量(KG)', edit:true} |
| | | ,{field: 'status', align: 'center',title: '状态', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '单号', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '出库时间', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '重量', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '经办人', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '流转形式', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '客户名称', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '调拨到', edit:true} |
| | | ,{field: 'createUser', align: 'center',title: '备注', edit:true} |
| | | ,{align: 'center', title: '明细', toolbar: '#tbLook'} |
| | | ,{field: 'orderNo', align: 'center',title: '单号', edit:true} |
| | | ,{field: 'pakoutTime', align: 'center',title: '出库时间', edit:true} |
| | | ,{field: 'orderWeight', align: 'center',title: '重量', edit:true} |
| | | ,{field: 'handlerBy', align: 'center',title: '经办人', edit:true} |
| | | ,{field: 'transfer', align: 'center',title: '流转形式', edit:true} |
| | | ,{field: 'customer', align: 'center',title: '客户名称', edit:true} |
| | | ,{field: 'allocate', align: 'center',title: '调拨到', edit:true} |
| | | ,{field: 'memo', align: 'center',title: '备注', edit:true} |
| | | ]; |
| | | return cols; |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | table.on('tool(plaDetl)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'look') { |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '1200px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/plaQty/list/auth', |
| | | where: { |
| | | batch: data.batch, |
| | | package_no: data.packageNo |
| | | }, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'orderNo', title: '单号'}, |
| | | {field: 'pakoutTime', title: '出库时间'}, |
| | | {field: 'orderWeight', title: '重量'}, |
| | | {field: 'handlerBy', title: '经办人'}, |
| | | {field: 'transfer', title: '流转形式'}, |
| | | {field: 'customer', title: '客户名称'}, |
| | | {field: 'allocate', title: '调拨到'}, |
| | | {field: 'memo', 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 () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }) |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | |
| | | } |
| | | |
| | | // 重载表格 |
| | | function tableReload() { |
| | | tableIns.reload({data: matCodeData}); |
| | | // function tableReload() { |
| | | // tableIns.reload({data: matCodeData}); |
| | | // } |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | }) |
| | | }) |
| | | |
| | | $(document).on('click','#rework', function () { |
| | | let data = table.cache.plaDetl; |
| | | let dataSave = []; |
| | | let dataOld = []; |
| | | for(var i=0; i<data.length; i++){ |
| | | if(data[i].LAY_CHECKED){ |
| | | dataSave.push(data[i]); |
| | | }else { |
| | | dataOld.push(data[i]); |
| | | } |
| | | } |
| | | |
| | | if(!dataSave || dataSave.length < 1){ |
| | | layer.msg("未勾选,请先勾选需要重做的库存"); |
| | | return; |
| | | } |
| | | |
| | | layer.confirm('确定重做选中的库存吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/rework/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(dataSave), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("提交成功"); |
| | | table.reload('productionInfoTable',{ |
| | | data: dataOld |
| | | }) |
| | | } else if (res.code === 403){ |
| | | |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | |
| | | $(document).on('click','#updateZpallet', function () { |
| | | let data = table.cache.plaDetl; |
| | | let dataSave = []; |
| | | let dataOld = []; |
| | | for(var i=0; i<data.length; i++){ |
| | | if(data[i].LAY_CHECKED){ |
| | | data[i].step = 1; |
| | | dataSave.push(data[i]); |
| | | }else { |
| | | dataOld.push(data[i]); |
| | | } |
| | | } |
| | | dataCheck = dataSave; |
| | | |
| | | if(!dataSave || dataSave.length < 1){ |
| | | layer.msg("未勾选,请先勾选需要更改的库存"); |
| | | return; |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 2, |
| | | title: '换包装/托盘/缠膜', |
| | | maxmin: true, |
| | | area: ['500px', top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'update.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | | iframe.child(dataSave) |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | $(document).on('click','#sellout', function () { |
| | | |
| | | let data = table.cache.plaDetl; |
| | | let dataSave = []; |
| | | let dataOld = []; |
| | | for(var i=0; i<data.length; i++){ |
| | | if(data[i].LAY_CHECKED){ |
| | | if(data[i].status === "待入库" || data[i].status === "全部出库"){ |
| | | layer.msg("选中的明细还未入库或者已全部出库,请重新选择"); |
| | | return; |
| | | } |
| | | dataSave.push(data[i]); |
| | | }else { |
| | | dataOld.push(data[i]); |
| | | } |
| | | } |
| | | dataCheck = dataSave; |
| | | |
| | | if(!dataSave || dataSave.length < 1){ |
| | | layer.msg("未勾选,请先勾选需要更改的库存"); |
| | | return; |
| | | } |
| | | if(dataSave.length > 1){ |
| | | layer.msg("请勾选一条库存明细"); |
| | | return; |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 2, |
| | | title: '卖出', |
| | | maxmin: true, |
| | | area: ['800px', top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'sellout.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | | iframe.child(dataSave) |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | $(document).on('click','#pickup', function () { |
| | | |
| | | let data = table.cache.plaDetl; |
| | | let dataSave = []; |
| | | let dataOld = []; |
| | | for(var i=0; i<data.length; i++){ |
| | | if(data[i].LAY_CHECKED){ |
| | | if(data[i].status === "待入库" || data[i].status === "全部出库"){ |
| | | layer.msg("选中的明细还未入库或者已全部出库,请重新选择"); |
| | | return; |
| | | } |
| | | dataSave.push(data[i]); |
| | | }else { |
| | | dataOld.push(data[i]); |
| | | } |
| | | } |
| | | dataCheck = dataSave; |
| | | |
| | | if(!dataSave || dataSave.length < 1){ |
| | | layer.msg("未勾选,请先勾选需要更改的库存"); |
| | | return; |
| | | } |
| | | if(dataSave.length > 1){ |
| | | layer.msg("请勾选一条库存明细"); |
| | | return; |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 2, |
| | | title: '卖出', |
| | | maxmin: true, |
| | | area: ['800px', top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'pickup.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | | iframe.child(dataSave) |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | $(document).on('click','#returned', function () { |
| | | |
| | | layer.open({ |
| | | type: 2, |
| | | title: '退回', |
| | | maxmin: true, |
| | | area: ['800px', '800px'], |
| | | shadeClose: false, |
| | | content: 'returned.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | |
| | |
| | | ,{field: 'line', align: 'center',title: '生产线', edit: true} |
| | | ,{field: 'packageType', align: 'center',title: '包装类型', edit: true} |
| | | ,{field: 'zpalletType', align: 'center',title: '托盘类型', edit: true} |
| | | ,{field: 'filmWrap', align: 'center',title: '缠膜', edit: true} |
| | | ]; |
| | | return cols; |
| | | } |
| | |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | initSelector(); |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#productionInfoTable', |
| | | data: [], |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | function initSelector(){ |
| | | $('#package').append('<option value="value">Text</option>'); |
| | | |
| | | var selectDom = $('#package'); |
| | | $.ajax({ |
| | | url: baseUrl+"/configTypeQuery/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {condition: ',packageType'}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var list = res.data; |
| | | for (var i=0;i<list.length;i++){ |
| | | var option = new Option(list[i].value, i); |
| | | selectDom.append($("<option></option>").attr("value",option["value"])); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | $('#packageCheck').val(); |
| | | } |
| | | |
| | | form.on('select(selectDemo1)', function (data) { |
| | | debugger |
| | | console.log(data.elem); |
| | | var elem = $(data.elem); |
| | | var trElem = elem.parents('tr'); |
| | | console.log(trElem); |
| | | var tableData = table.cache.productionInfoTable; // 为table id |
| | | console.log(tableData); |
| | | // 更新到表格的缓存数据中,才能在获得选中行等等其他的方法中得到更新之后的值 |
| | | tableData[trElem.data('index')][elem.attr('name')] = data.value; |
| | | }); |
| | | |
| | | // 重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | |
| | | function tableReload() { |
| | | tableIns.reload({data: matCodeData}); |
| | | } |
| | | |
| | | |
| | | |
| | | $(document).on('click','#add', function () { |
| | |
| | | <div class="layui-inline" style="width:45%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>类 型:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="type" class="layui-input" type="text" lay-verify="required" > |
| | | <select id="type" lay-verify="required"> |
| | | <option value="packageType" selected = "selected">包装类型</option> |
| | | <option value="zpalletType">托盘类型</option> |
| | | <option value="filmWrap">缠膜</option> |
| | | <option value="allocate">调拨到</option> |
| | | </select> |
| | | <!-- <input id="type" class="layui-input" type="select" list="typelist" lay-verify="required" >--> |
| | | <!-- <datalist id="typelist">--> |
| | | <!-- <option value="packageType">包装类型</option>--> |
| | | <!-- <option value="zpalletType">托盘类型</option>--> |
| | | <!-- </datalist>--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:45%;"> |
| | |
| | | <input class="layui-input" name="owner" placeholder="客户名称" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">客户电话: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="phone" placeholder="客户电话" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">客户地址: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="addr" placeholder="客户地址" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
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="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form" style="text-align: center"> |
| | | <div class="layui-inline" style="width:83%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>订单号 :</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="orderNo" class="layui-input" type="text" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>取货重量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="weight" class="layui-input" type="text" lay-verify="required" placeholder="KG"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"></span>备 注:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="memo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form layui-card-header" > |
| | | <label class="layui-form-label"><span class="not-null">*</span>选择发货时间:</label> </br> |
| | | <i class="layui-icon layui-icon-date" style="font-size: 30px; color: #3F3F3F;"></i> |
| | | <div class="layui-form-item"> |
| | | <button id="btn-day1-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">今天下午 80 ✔</button> |
| | | <button id="btn-day2-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">明天下午</button> |
| | | <button id="btn-day3-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | <button id="btn-day4-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | </div> |
| | | <div class="layui-form-item "> |
| | | <button id="btn-day1-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">今天下午</button> |
| | | <button id="btn-day2-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">明天下午</button> |
| | | <button id="btn-day3-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | <button id="btn-day4-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | </form> |
| | | </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/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/pla/plaDetl.js" charset="utf-8"></script> |
| | | </html> |
| | | <script> |
| | | var checkData = []; |
| | | var deliveryTime; |
| | | function child(data){ |
| | | checkData = data; |
| | | delivery(); |
| | | |
| | | } |
| | | |
| | | function delivery(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/plaQty/delivery/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | $('#btn-day1-am').text(res.data[0].text); |
| | | $('#btn-day1-pm').text(res.data[1].text); |
| | | $('#btn-day2-am').text(res.data[2].text); |
| | | $('#btn-day2-pm').text(res.data[3].text); |
| | | $('#btn-day3-am').text(res.data[4].text); |
| | | $('#btn-day3-pm').text(res.data[5].text); |
| | | $('#btn-day4-am').text(res.data[6].text); |
| | | $('#btn-day4-pm').text(res.data[7].text); |
| | | $("#btn-day1-am").hover(function(){ |
| | | $(this).attr("title", res.data[0].user); |
| | | }, function(){ |
| | | $(this).removeAttr("title"); |
| | | }); |
| | | |
| | | } else if (res.code === 403){ |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | $('.delivery').click(function (){ |
| | | delivery(); |
| | | deliveryTime = this.textContent; |
| | | this.append(' ✔'); |
| | | $('.delivery').addClass('layui-btn-primary'); |
| | | this.classList.remove('layui-btn-primary'); |
| | | |
| | | }) |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(save)', function () { |
| | | |
| | | for(var i in checkData){ |
| | | checkData[i].packageType = $('#packageTypeV').val(); |
| | | checkData[i].zpalletType = $('#zpalletTypeV').val(); |
| | | checkData[i].filmWrap = $('#filmWrapV').val(); |
| | | checkData[i].step = 3; |
| | | } |
| | | |
| | | checkData[0].type = "pickup"; |
| | | |
| | | checkData[0].orderNo = $('#orderNo').val(); |
| | | checkData[0].customer = $('#customerV').val() ? $('#customerV').val() : ""; |
| | | checkData[0].phone = $('#phone').val() ? $('#phone').val() : " "; |
| | | checkData[0].addr = $('#addr').val() ? $('#addr').val() : " "; |
| | | checkData[0].orderWeight = $('#weight').val(); |
| | | checkData[0].allocate = $('#allocateV').val() ? $('#allocateV').val() : ""; |
| | | checkData[0].memo = $('#memo').val() ? $('#memo').val() : ""; |
| | | if(!deliveryTime){ |
| | | layer.msg("请选择发货时间"); |
| | | return; |
| | | } |
| | | checkData[0].pakoutTime = deliveryTime; |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/sellout/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(checkData), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("修改成功"); |
| | | tableReload(true); |
| | | } else if (res.code === 403){ |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | } |
| | | 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: 1 |
| | | }, |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <button id="returned" style="alignment: right" class="function-btn">退回</button> |
| | | </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="batch" placeholder="批号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="package_no" placeholder="包号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="brand" placeholder="牌号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="row" placeholder="排数" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | <!-- <button id="unreason" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="unreason">查看异常数据</button>--> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | |
| | | <!-- 表格 --> |
| | | <table class="layui-table" id="plaDetl" lay-filter="plaDetl"></table> |
| | | |
| | | <script type="text/html" id="tbLook"> |
| | | <span class="layui-text"> |
| | | <a href="javascript:;" lay-event="look"> |
| | | <i class="layui-icon" style="font-size: 12px;"></i> 更多 |
| | | </a> |
| | | </span> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | |
| | | <!-- 表格 --> |
| | | <table class="layui-table" id="productionInfoTable" lay-filter="productionInfoTable"></table> |
| | | |
| | | |
| | | <script type="text/html" id="packageCheck"> |
| | | <select name="packageType" lay-filter="selectDemo1" data-key="packageType"> |
| | | <option value="">请选择</option> |
| | | <option value="1">1</option> |
| | | </select> |
| | | </script> |
| | | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
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="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form" style="text-align: center"> |
| | | <div class="layui-inline" style="width:83%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>订单号 :</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="orderNo" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="orderNoV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" onchange="tableReload()" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="orderNoQueryByorderNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="orderNoQueryByorderNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="customerR" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>退回产品:</label> |
| | | <div class="layui-input-block"> |
| | | <table id="formSSXMTable" lay-filter="formSSXMTable"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"></span>备 注:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="memo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | </form> |
| | | </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/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/pla/plaDetl.js" charset="utf-8"></script> |
| | | </html> |
| | | <script> |
| | | var checkData = []; |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | |
| | | table.render({ |
| | | elem: '#formSSXMTable', |
| | | height: 312, |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/plaQty/orderDetail/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'packageNo', title: '包号'}, |
| | | {field: 'orderWeight', title: '重量'} |
| | | |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | console.log(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+"/"; |
| | | } |
| | | tableData = table.cache.locDetl; |
| | | console.log(tableData); |
| | | 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'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(save)', function () { |
| | | debugger |
| | | let data = table.cache.formSSXMTable; |
| | | let dataSave = []; |
| | | for(var i in data){ |
| | | if(data[i].LAY_CHECKED){ |
| | | data[i].memo = $('#memo').val(); |
| | | dataSave.push(data[i]); |
| | | } |
| | | } |
| | | if(!dataSave || dataSave.length < 1){ |
| | | layer.msg("未勾选提交项,无法提交"); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/returned/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(dataSave), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("提交成功"); |
| | | table.reload('productionInfoTable',{ |
| | | data: dataOld |
| | | }) |
| | | } else if (res.code === 403){ |
| | | |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | debugger |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | </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"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 详情 --> |
| | | <div id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form" style="text-align: center"> |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>订单号 :</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="orderNo" class="layui-input" type="text" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户名称:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="customer" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="customerV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locOwnerQueryBylocOwner" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locOwnerQueryBylocOwnerSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:40%;margin-top: 0px;margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户电话:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="phone" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>客户地址:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="addr" class="layui-input" type="text" lay-verify="required" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>发货重量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="weight" class="layui-input" type="text" lay-verify="required" placeholder="KG"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>调拨到 :</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="allocate" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="allocateV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="configTypeQueryByAllocate" data-value="allocate" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="configTypeQueryByAllocateSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:83%; margin-bottom: 5px;"> |
| | | <label class="layui-form-label"></span>备 注:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="memo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form layui-card-header" > |
| | | <label class="layui-form-label"><span class="not-null">*</span>选择发货时间:</label> </br> |
| | | <i class="layui-icon layui-icon-date" style="font-size: 30px; color: #3F3F3F;"></i> |
| | | <div class="layui-form-item"> |
| | | <button id="btn-day1-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">今天下午 80 ✔</button> |
| | | <button id="btn-day2-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">明天下午</button> |
| | | <button id="btn-day3-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | <button id="btn-day4-am" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | </div> |
| | | <div class="layui-form-item "> |
| | | <button id="btn-day1-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">今天下午</button> |
| | | <button id="btn-day2-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">明天下午</button> |
| | | <button id="btn-day3-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | <button id="btn-day4-pm" type="button" class="delivery layui-btn layui-btn-radius layui-btn-primary">后天下午</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | </form> |
| | | </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/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/pla/plaDetl.js" charset="utf-8"></script> |
| | | </html> |
| | | <script> |
| | | var checkData = []; |
| | | var deliveryTime; |
| | | function child(data){ |
| | | checkData = data; |
| | | delivery(); |
| | | |
| | | } |
| | | |
| | | function delivery(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/plaQty/delivery/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | $('#btn-day1-am').text(res.data[0].text); |
| | | $('#btn-day1-pm').text(res.data[1].text); |
| | | $('#btn-day2-am').text(res.data[2].text); |
| | | $('#btn-day2-pm').text(res.data[3].text); |
| | | $('#btn-day3-am').text(res.data[4].text); |
| | | $('#btn-day3-pm').text(res.data[5].text); |
| | | $('#btn-day4-am').text(res.data[6].text); |
| | | $('#btn-day4-pm').text(res.data[7].text); |
| | | $("#btn-day1-am").hover(function(){ |
| | | $(this).attr("title", res.data[0].user); |
| | | }, function(){ |
| | | $(this).removeAttr("title"); |
| | | }); |
| | | |
| | | } else if (res.code === 403){ |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | $('.delivery').click(function (){ |
| | | delivery(); |
| | | deliveryTime = this.textContent; |
| | | this.append(' ✔'); |
| | | $('.delivery').addClass('layui-btn-primary'); |
| | | this.classList.remove('layui-btn-primary'); |
| | | |
| | | }) |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(save)', function () { |
| | | |
| | | for(var i in checkData){ |
| | | checkData[i].packageType = $('#packageTypeV').val(); |
| | | checkData[i].zpalletType = $('#zpalletTypeV').val(); |
| | | checkData[i].filmWrap = $('#filmWrapV').val(); |
| | | checkData[i].step = 3; |
| | | } |
| | | |
| | | checkData[0].type = 'sellOut'; |
| | | |
| | | checkData[0].orderNo = $('#orderNo').val(); |
| | | checkData[0].customer = $('#customerV').val(); |
| | | checkData[0].phone = $('#phone').val(); |
| | | checkData[0].addr = $('#addr').val(); |
| | | checkData[0].orderWeight = $('#weight').val(); |
| | | checkData[0].allocate = $('#allocateV').val(); |
| | | checkData[0].memo = $('#memo').val(); |
| | | if(!deliveryTime){ |
| | | layer.msg("请选择发货时间"); |
| | | return; |
| | | } |
| | | checkData[0].pakoutTime = deliveryTime; |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/sellout/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(checkData), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("修改成功"); |
| | | tableReload(true); |
| | | } else if (res.code === 403){ |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | } |
| | | 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: 1 |
| | | }, |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | |
| | | </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"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 详情 --> |
| | | <div id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form" style="text-align: center"> |
| | | |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>换包装:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="packageType" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="packageTypeV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="configTypeQueryByPackageType" data-value="packageType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="configTypeQueryByPackageTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>换托盘:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="zpalletType" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="zpalletTypeV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="configTypeQueryByzpalletType" data-value="zpalletType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="configTypeQueryByzpalletTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>缠膜:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="filmWrap" class="layui-input" type="text" style="display: none" lay-verify="required"> |
| | | <input id="filmWrapV" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="configTypeQueryByfilmWrap" data-value="filmWrap" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="configTypeQueryByfilmWrapSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | </form> |
| | | </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/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/pla/plaDetl.js" charset="utf-8"></script> |
| | | </html> |
| | | <script> |
| | | var checkData = []; |
| | | function child(data){ |
| | | checkData = data; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(save)', function () { |
| | | |
| | | for(var i in checkData){ |
| | | checkData[i].packageType = $('#packageTypeV').val(); |
| | | checkData[i].zpalletType = $('#zpalletTypeV').val(); |
| | | checkData[i].filmWrap = $('#filmWrapV').val(); |
| | | checkData[i].step = 3; |
| | | } |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(checkData), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("修改成功"); |
| | | tableReload(true); |
| | | } else if (res.code === 403){ |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | return; |
| | | } |
| | | 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: 1 |
| | | }, |
| | | 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); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |