Merge branches 'dev' and 'master' of https://gitee.com/luxiaotao1123/xtywms into master
40个文件已添加
1个文件已删除
33个文件已修改
New file |
| | |
| | | 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.LocArea; |
| | | import com.zy.asrs.service.LocAreaService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class LocAreaController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LocAreaService locAreaService; |
| | | |
| | | @RequestMapping(value = "/locArea/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(locAreaService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<LocArea> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locAreaService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/add/auth") |
| | | @ManagerAuth |
| | | public R add(LocArea locArea) { |
| | | Long createUser = getUserId(); |
| | | Date createTime = new Date(); |
| | | locArea.setCreateBy(createUser); |
| | | locArea.setCreateTime(createTime); |
| | | locAreaService.insert(locArea); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/update/auth") |
| | | @ManagerAuth |
| | | public R update(LocArea locArea){ |
| | | if (Cools.isEmpty(locArea) || null==locArea.getId()){ |
| | | return R.error(); |
| | | } |
| | | Long modiUser = getUserId(); |
| | | Date modiTime = new Date(); |
| | | locArea.setUpdateBy(modiUser); |
| | | locArea.setUpdateTime(modiTime); |
| | | locAreaService.updateById(locArea); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam String param){ |
| | | List<LocArea> list = JSONArray.parseArray(param, LocArea.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | } |
| | | for (LocArea entity : list){ |
| | | locAreaService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<LocArea> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("locArea")); |
| | | convert(map, wrapper); |
| | | List<LocArea> list = locAreaService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locAreaQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<LocArea> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("uuid", condition); |
| | | Page<LocArea> page = locAreaService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (LocArea locArea : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", locArea.getId()); |
| | | map.put("value", locArea.getUuid()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<LocArea> wrapper = new EntityWrapper<LocArea>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != locAreaService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(LocArea.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locArea/queryAll/auth") |
| | | @ManagerAuth |
| | | public R queryAll(String areaType) { |
| | | List<LocArea> result = locAreaService.queryAllLocArea(areaType); |
| | | return R.ok(result); |
| | | } |
| | | } |
| | |
| | | param.remove("modi_time"); |
| | | } |
| | | } |
| | | /* 通知单号为空,删除入参通知单号supplier */ |
| | | if (Cools.isEmpty(param.get("supplier"))) { |
| | | param.remove("supplier"); |
| | | } |
| | | /* 生产单号为空,删除生产单号warehouse */ |
| | | if (Cools.isEmpty(param.get("warehouse"))) { |
| | | param.remove("warehouse"); |
| | | } |
| | | return R.ok(locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class))); |
| | | } |
| | | |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | |
| | | excludeTrash(param); |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | if ("0".equals(param.get("mat_status"))) { |
| | | wrapper.isNull("mat_status"); |
| | | param.remove("mat_status"); |
| | | } |
| | | convert(param, wrapper); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | |
| | | */ |
| | | @RequestMapping(value = "/locDetl/getAllLocDetlData") |
| | | @ManagerAuth |
| | | public List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String matStatusFlag) { |
| | | return locDetlService.getAllLocDetlData(loc_no, matnr, matStatusFlag); |
| | | public List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String mat_status) { |
| | | return locDetlService.getAllLocDetlData(loc_no, matnr, mat_status); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | 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.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.entity.param.LocNormalParam; |
| | | import com.zy.asrs.service.LocNormalService; |
| | | import com.zy.common.utils.excel.locNomal.LocNormalExcel; |
| | | import com.zy.common.utils.excel.locNomal.LocNormalExcelListener; |
| | | import com.zy.common.utils.excel.matcode.MatCodeExcel; |
| | | import com.zy.common.utils.excel.matcode.MatCodeExcelListener; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | 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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static jdk.nashorn.api.scripting.ScriptUtils.convert; |
| | | |
| | | @RestController |
| | | public class LocNormalController extends BaseController { |
| | | @Autowired |
| | | private LocNormalService locNormalService; |
| | | |
| | | @RequestMapping(value = "/locNomal/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String orderByField, |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<LocNormal> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(LocNormal.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | if (Cools.isEmpty(param.get("state"))) { |
| | | wrapper.in("state", "1,2"); |
| | | } |
| | | return R.ok(locNormalService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNomal/add/auth") |
| | | @ManagerAuth |
| | | public R add(LocNormal locNormalList) { |
| | | // 插入创建信息 |
| | | locNormalList.setModiUser(getUserId()); |
| | | locNormalList.setModiTime(new Date()); |
| | | locNormalList.setAppeUser(getUserId()); |
| | | locNormalList.setAppeTime(new Date()); |
| | | // 默认新增为已入库 |
| | | locNormalList.setState("1"); |
| | | locNormalService.insert(locNormalList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matnr/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<LocNormal> wrapper = new EntityWrapper<LocNormal>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != locNormalService.selectOne(wrapper)) { |
| | | return R.parse(BaseRes.REPEAT).add(getComment(LocNormal.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNormal/update/auth") |
| | | @ManagerAuth |
| | | public void updateLocNormal(LocNormal param) { |
| | | Long modiUser = getUserId(); |
| | | Date modiTime = new Date(); |
| | | locNormalService.updateLocNormal(param.getMatnr(), param.getAnfme(), modiUser, modiTime, param.getId()); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNormal/outLoc/auth") |
| | | @ManagerAuth |
| | | public void outLocNormal(LocNormal param) { |
| | | Long modiUser = getUserId(); |
| | | Date modiTime = new Date(); |
| | | locNormalService.outLocNormal(param.getMatnr(), modiUser, modiTime, param.getId()); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNormal/removeLoc/auth") |
| | | @ManagerAuth |
| | | public void removeLoc(LocNormal param) { |
| | | Long modiUser = getUserId(); |
| | | Date modiTime = new Date(); |
| | | locNormalService.removeLocNormal(param.getMatnr(), modiUser, modiTime, param.getId()); |
| | | } |
| | | |
| | | /* 导入 */ |
| | | @RequestMapping(value = "/locNormal/import/auth") |
| | | @ManagerAuth(memo = "平仓管理导入") |
| | | @Transactional |
| | | public R locNormalImport(MultipartFile file) throws IOException, InterruptedException { |
| | | LocNormalExcelListener listener = new LocNormalExcelListener(getUserId()); |
| | | EasyExcel.read(file.getInputStream(), LocNormalExcel.class, listener).sheet().doRead(); |
| | | return R.ok("成功导入" + listener.getTotal() + "条物料信息"); |
| | | } |
| | | |
| | | /* 平仓入库 */ |
| | | @RequestMapping(value = "/locNormal/in") |
| | | @ManagerAuth(memo = "平仓入库") |
| | | @Transactional |
| | | public R locNormalIn(@RequestBody LocNormalParam param) { |
| | | Long userId = getUserId(); |
| | | Date timeNow = new Date(); |
| | | for (Integer i = 0; i < param.getNormalList().size(); i++) { |
| | | param.getNormalList().get(i).setAppeUser(userId); |
| | | param.getNormalList().get(i).setAppeTime(timeNow); |
| | | } |
| | | locNormalService.locNormalIn(param.getNormalList()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* pda入库 */ |
| | | @RequestMapping(value = "/locNormal/pda/in") |
| | | @ManagerAuth(memo = "平仓管理pda入库") |
| | | @Transactional |
| | | public R locNormalPdaIn(@RequestBody LocNormalParam param) { |
| | | Long userId = getUserId(); |
| | | Date timeNow = new Date(); |
| | | for (Integer i = 0; i < param.getNormalList().size(); i++) { |
| | | param.getNormalList().get(i).setAppeUser(userId); |
| | | param.getNormalList().get(i).setAppeTime(timeNow); |
| | | } |
| | | locNormalService.pdaLocNormalIn(param.getNormalList()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* pda出库查询 */ |
| | | @RequestMapping(value = "/locNormal/pda/out/query") |
| | | @ManagerAuth(memo = "pda出库查询") |
| | | @Transactional |
| | | public R locNormalPdaOutQuery(String matnr, String warehouse, String billNo) { |
| | | List<LocNormal> list = new ArrayList<>(); |
| | | list = locNormalService.pdaLocNormalQuery(matnr, warehouse, billNo); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNormal/pda/out") |
| | | @ManagerAuth(memo = "pda出库") |
| | | @Transactional |
| | | public R locNormalPdaOut(@RequestBody LocNormalParam param) { |
| | | Long userId = getUserId(); |
| | | Date timeNow = new Date(); |
| | | List<LocNormal> list = param.getNormalList(); |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | list.get(i).setModiUser(userId); |
| | | list.get(i).setModiTime(timeNow); |
| | | } |
| | | locNormalService.pdaLocNormalOut(list); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNormal/pda/warehouseQuery") |
| | | @ManagerAuth(memo = "pda根据库区查询物料清单") |
| | | @Transactional |
| | | public R locNormalPdaWarehouseQuery(String warehouse, String matnr) { |
| | | List<LocNormal> list = locNormalService.pdaLocNormalWarehouseQuery(warehouse, matnr); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNormal/pda/move") |
| | | @ManagerAuth(memo = "pda移库") |
| | | @Transactional |
| | | public R LocNormalPdaMove(@RequestBody LocNormalParam param) { |
| | | Long userId = getUserId(); |
| | | Date timeNow = new Date(); |
| | | List<LocNormal> list = param.getNormalList(); |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | list.get(i).setModiUser(userId); |
| | | list.get(i).setModiTime(timeNow); |
| | | } |
| | | locNormalService.pdaLocNormalMove(list); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | @RequestMapping("/locDetl") |
| | | @ManagerAuth |
| | | public R getLocDetl(@RequestParam(required = false)String locNo, |
| | | @RequestParam(required = false)String matNo){ |
| | | @RequestParam(required = false)String matNo, |
| | | @RequestParam(required = false)String supplier |
| | | ){ |
| | | if (!Cools.isEmpty(locNo)) { |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (null == locMast || !"F".equals(locMast.getLocSts())) { |
| | |
| | | }); |
| | | return R.ok().add(res); |
| | | } |
| | | if (!Cools.isEmpty(supplier)) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("supplier", supplier).orderBy("appe_time", false)); |
| | | List<MobileLocDetlVo> res = new ArrayList<>(); |
| | | locDetls.forEach(locDetl -> { |
| | | MobileLocDetlVo vo = new MobileLocDetlVo(); |
| | | vo.setLocNo(locDetl.getLocNo()); |
| | | vo.setMatnr(locDetl.getMatnr()); |
| | | vo.setMaktx(locDetl.getMaktx()); |
| | | vo.setCount(locDetl.getAnfme()); |
| | | res.add(vo); |
| | | }); |
| | | return R.ok().add(res); |
| | | } |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | |
| | |
| | | vo.setMatNo(waitPakin.getMatnr()); |
| | | vo.setMatName(waitPakin.getMaktx()); |
| | | vo.setCount(waitPakin.getAnfme()); |
| | | vo.setMnemonic(waitPakin.getMnemonic()); |
| | | vo.setSupplier(waitPakin.getSupplier()); |
| | | vo.setAltme(waitPakin.getAltme()); |
| | | vo.setType(waitPakin.getType()); |
| | | vo.setLgnum(waitPakin.getLgnum()); |
| | | vos.add(vo); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.OutStockService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class OutStockController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | /** |
| | | * |
| | | * @param curr |
| | | * @param limit |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/outStock/query/list") |
| | | @ManagerAuth |
| | | public R outStockQueryList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | return R.ok(outStockService.queryOutStock(toPage(curr, limit, param, OutStockBillEntry.class))); |
| | | } |
| | | |
| | | /** |
| | | * 检索符合通知单的库存物料 |
| | | * @param fbillNo |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/outStock/query/locList") |
| | | @ManagerAuth |
| | | public R queryMatWithLoc(String fbillNo) { |
| | | List<LocDetl> list = outStockService.queryMatWithLoc(fbillNo); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/plate/outStock/start") |
| | | @ManagerAuth(memo = "出库作业") |
| | | public R fullStoreTakeStart(@RequestBody StockOutParam param) { |
| | | outStockService.startupFullTakeStore(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | } |
| | |
| | | |
| | | private Double count; |
| | | |
| | | private String warehouse; |
| | | |
| | | private String mnemonic; |
| | | |
| | | private String supplier; |
| | | |
| | | private String lgnum; |
| | | |
| | | private String type; |
| | | |
| | | private String altme; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.core.common.SpringUtils; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.core.common.SpringUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @TableName("asr_loc_area") |
| | | public class LocArea implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value = "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 库区编号 |
| | | */ |
| | | @ApiModelProperty(value = "库区编号") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 库区名称 |
| | | */ |
| | | @ApiModelProperty(value = "库区名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value = "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value = "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value = "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value = "修改时间") |
| | | @TableField("update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 库区类型 |
| | | */ |
| | | @ApiModelProperty(value = "库区类型") |
| | | @TableField("area_type") |
| | | private String areaType; |
| | | |
| | | public LocArea() { |
| | | } |
| | | |
| | | public LocArea(String uuid, String name, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo, String areaType) { |
| | | this.uuid = uuid; |
| | | this.name = name; |
| | | this.status = status; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | this.areaType = areaType; |
| | | } |
| | | |
| | | // LocArea locArea = new LocArea( |
| | | // null, // 库区编号 |
| | | // null, // 库区名称 |
| | | // null, // 状态 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getUuid() { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) { |
| | | this.uuid = uuid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public String getStatus$() { |
| | | if (null == this.status) { |
| | | return null; |
| | | } |
| | | switch (this.status) { |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Long getCreateBy() { |
| | | return createBy; |
| | | } |
| | | |
| | | public String getCreateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setCreateBy(Long createBy) { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public String getCreateTime$() { |
| | | if (Cools.isEmpty(this.createTime)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Long getUpdateBy() { |
| | | return updateBy; |
| | | } |
| | | |
| | | public String getUpdateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setUpdateBy(Long updateBy) { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public String getUpdateTime$() { |
| | | if (Cools.isEmpty(this.updateTime)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | |
| | | public String getAreaType() { |
| | | return areaType; |
| | | } |
| | | |
| | | public void setAreaType(String areaType) { |
| | | this.areaType = areaType; |
| | | } |
| | | } |
| | |
| | | @TableField("mat_status") |
| | | private String matStatus; |
| | | |
| | | /** |
| | | * 物料状态批量修改标识 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String matStatusFlag; |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
New file |
| | |
| | | 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; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("asr_loc_normal") |
| | | public class LocNormal implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "自增ID") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value= "物料") |
| | | @TableId(value = "matnr", type = IdType.INPUT) |
| | | private String matnr; |
| | | |
| | | @ApiModelProperty(value= "物料描述") |
| | | private String maktx; |
| | | |
| | | @ApiModelProperty(value= "规格") |
| | | private String lgnum; |
| | | |
| | | @ApiModelProperty(value= "物料类别") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value= "助记码") |
| | | private String mnemonic; |
| | | |
| | | @ApiModelProperty(value= "通知单号") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value= "仓库") |
| | | private String warehouse; |
| | | |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value= "数量") |
| | | private BigDecimal anfme; |
| | | |
| | | @ApiModelProperty(value= "单位") |
| | | private String altme; |
| | | |
| | | @ApiModelProperty(value= "用户ID") |
| | | private String bname; |
| | | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | private Date modiTime; |
| | | |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | private Date appeTime; |
| | | |
| | | @ApiModelProperty(value= "物料出入库状态") |
| | | @TableField("state") |
| | | private String state; |
| | | |
| | | @TableField(exist = false) |
| | | private BigDecimal anfmeOut; |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | } |
| | |
| | | // 成品码 |
| | | private String productCode; |
| | | |
| | | // 生产单号 |
| | | private String warehouse; |
| | | |
| | | private String billNo; |
| | | |
| | | public String getWarehouse() { |
| | | return warehouse; |
| | | } |
| | | |
| | | public void setWarehouse(String warehouse) { |
| | | this.warehouse = warehouse; |
| | | } |
| | | |
| | | public static class CombMat { |
| | | |
| | | // 物料编号 |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.zy.asrs.entity.LocNormal; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class LocNormalParam { |
| | | private List<LocNormal> normalList; |
| | | |
| | | public List<LocNormal> getNormalList() { |
| | | return normalList; |
| | | } |
| | | |
| | | public void setNormalList(List<LocNormal> normalList) { |
| | | this.normalList = normalList; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class StockOutParam { |
| | | |
| | | // 单据编号 |
| | | private String fbillNo; |
| | | |
| | | // 出站口 |
| | | private Integer outSite; |
| | | |
| | |
| | | this.locDetls = locDetls; |
| | | } |
| | | |
| | | public String getFbillNo() { |
| | | return fbillNo; |
| | | } |
| | | |
| | | public void setFbillNo(String fbillNo) { |
| | | this.fbillNo = fbillNo; |
| | | } |
| | | |
| | | public static class LocDetl { |
| | | |
| | | // 库位号 |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.LocArea; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocAreaMapper extends BaseMapper<LocArea> { |
| | | List<LocArea> queryAllLocArea(@Param("areaType") String areaType); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocNormalMapper extends BaseMapper<LocNormal> { |
| | | List<LocNormal> getLocNormalData(); |
| | | |
| | | public void updateLocNormal(@Param("matnr") String matnr,@Param("anfme") BigDecimal anfme, @Param("modiUser") Long modiUser, @Param("modiTime") Date modiTime, @Param("id") Integer id); |
| | | |
| | | public void outLocNormal(@Param("matnr") String matnr, @Param("modiUser") Long modiUser, @Param("modiTime") Date modiTime, @Param("id") Integer id); |
| | | |
| | | public void removeLocNormal(@Param("matnr") String matnr, @Param("modiUser") Long modiUser, @Param("modiTime") Date modiTime, @Param("id") Integer id); |
| | | |
| | | public void locNormalIn(List<LocNormal> list); |
| | | |
| | | public void pdaLocNormalIn(List<LocNormal> list); |
| | | |
| | | public List<LocNormal> pdaLocNormalQuery(@Param("matnr") String matnr, @Param("warehouse") String warehouse, @Param("billNo") String billNo); |
| | | |
| | | public void pdaLocNormalOut1(@Param("id") Integer id,@Param("matnr") String matnr, @Param("modiUser") Long modiUser, @Param("modiTime") Date modiTime, @Param("warehouse") String warehouse); |
| | | |
| | | public void pdaLocNormalOut2(@Param("id") Integer id,@Param("matnr") String matnr,@Param("anfme") BigDecimal anfme, @Param("modiUser") Long modiUser, @Param("modiTime") Date modiTime, @Param("warehouse") String warehouse); |
| | | |
| | | public List<LocNormal> pdaLocNormalWarehouseQuery(@Param("warehouse") String warehouse, @Param("matnr") String matnr); |
| | | |
| | | public void pdaLocNormalMove(List<LocNormal> list); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OutStockMapper extends BaseMapper<OutStockBillEntry> { |
| | | List<OutStockBillEntry> queryOutStock(Map<String, Object> map); |
| | | |
| | | Integer queryOutStockCount(Map<String, Object> map); |
| | | |
| | | List<LocDetl> queryMatWithLoc(String matnr); |
| | | |
| | | List<OutStockBillEntry> queryMatnrWithBillNo(String fbillNo); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.LocArea; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LocAreaService extends IService<LocArea> { |
| | | List<LocArea> queryAllLocArea (String areaType); |
| | | } |
| | |
| | | * @param matnr |
| | | * @return |
| | | */ |
| | | List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String matStatusFlag); |
| | | List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String mat_status); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import io.swagger.models.auth.In; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface LocNormalService extends IService<LocNormal> { |
| | | List<LocNormal> getLocNormalData(); |
| | | |
| | | public void updateLocNormal(String matnr, BigDecimal anfme, Long modiUser, Date modiTime, Integer id); |
| | | |
| | | public void outLocNormal(String matnr, Long modiUser, Date modiTime, Integer id); |
| | | |
| | | public void removeLocNormal(String matnr, Long modiUser, Date modiTime, Integer id); |
| | | |
| | | public void locNormalIn(List<LocNormal> list); |
| | | |
| | | public void pdaLocNormalIn(List<LocNormal> list); |
| | | |
| | | public List<LocNormal> pdaLocNormalQuery(String matnr, String warehouse, String billNo); |
| | | |
| | | public void pdaLocNormalOut(List<LocNormal> list); |
| | | |
| | | public List<LocNormal> pdaLocNormalWarehouseQuery(String warehouse, String matnr); |
| | | |
| | | public void pdaLocNormalMove(List<LocNormal> list); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface OutStockService extends IService<OutStockBillEntry> { |
| | | Page<OutStockBillEntry> queryOutStock(Page<OutStockBillEntry> page); |
| | | |
| | | List<LocDetl> queryMatWithLoc(String matnr); |
| | | |
| | | /** |
| | | * 出库作业 |
| | | */ |
| | | void startupFullTakeStore(StockOutParam param, Long userId); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.LocAreaMapper; |
| | | import com.zy.asrs.entity.LocArea; |
| | | import com.zy.asrs.service.LocAreaService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("locAreaService") |
| | | public class LocAreaServiceImpl extends ServiceImpl<LocAreaMapper, LocArea> implements LocAreaService { |
| | | |
| | | @Override |
| | | public List<LocArea> queryAllLocArea(String areaType) { |
| | | return baseMapper.queryAllLocArea(areaType); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String matStatusFlag) { |
| | | public List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String mat_status) { |
| | | List<LocDetl> allLocDetlData = baseMapper.getAllLocDetlData(loc_no, matnr); |
| | | for (int i = 0; i < allLocDetlData.size(); i++) { |
| | | allLocDetlData.get(i).setMatStatusFlag(matStatusFlag); |
| | | allLocDetlData.get(i).setMatStatus(mat_status); |
| | | } |
| | | baseMapper.updateMatStatus(allLocDetlData); |
| | | return baseMapper.getAllLocDetlData(loc_no, matnr); |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.mapper.LocNormalMapper; |
| | | import com.zy.asrs.service.LocNormalService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("locNormalService") |
| | | public class LocNormalServiceImpl extends ServiceImpl<LocNormalMapper, LocNormal> implements LocNormalService { |
| | | |
| | | @Override |
| | | public List<LocNormal> getLocNormalData() { |
| | | return baseMapper.getLocNormalData(); |
| | | } |
| | | |
| | | @Override |
| | | public void updateLocNormal(String matnr, BigDecimal anfme, Long modiUser, Date modiTime, Integer id) { |
| | | baseMapper.updateLocNormal(matnr, anfme, modiUser, modiTime, id); |
| | | } |
| | | |
| | | @Override |
| | | public void outLocNormal(String matnr, Long modiUser, Date modiTime, Integer id) { |
| | | baseMapper.outLocNormal(matnr, modiUser, modiTime, id); |
| | | } |
| | | |
| | | @Override |
| | | public void removeLocNormal(String matnr, Long modiUser, Date modiTime, Integer id) { |
| | | baseMapper.removeLocNormal(matnr, modiUser, modiTime, id); |
| | | } |
| | | |
| | | @Override |
| | | public void locNormalIn(List<LocNormal> list) { |
| | | baseMapper.locNormalIn(list); |
| | | } |
| | | |
| | | @Override |
| | | public void pdaLocNormalIn(List<LocNormal> list) { |
| | | baseMapper.pdaLocNormalIn(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocNormal> pdaLocNormalQuery(String matnr, String warehouse, String billNo) { |
| | | return baseMapper.pdaLocNormalQuery(matnr, warehouse, billNo); |
| | | } |
| | | |
| | | @Override |
| | | public void pdaLocNormalOut(List<LocNormal> list) { |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | if (list.get(i).getAnfme().equals(list.get(i).getAnfmeOut())) { |
| | | baseMapper.pdaLocNormalOut1(list.get(i).getId(), list.get(i).getMatnr(), list.get(i).getModiUser(), list.get(i).getModiTime(), list.get(i).getWarehouse()); |
| | | } |
| | | if (list.get(i).getAnfmeOut().compareTo(list.get(i).getAnfme()) == -1) { |
| | | BigDecimal diff = (list.get(i).getAnfme()).subtract(list.get(i).getAnfmeOut()); |
| | | baseMapper.pdaLocNormalOut2(list.get(i).getId(), list.get(i).getMatnr(), diff, list.get(i).getModiUser(), list.get(i).getModiTime(), list.get(i).getWarehouse()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<LocNormal> pdaLocNormalWarehouseQuery(String warehouse, String matnr) { |
| | | return baseMapper.pdaLocNormalWarehouseQuery(warehouse, matnr); |
| | | } |
| | | |
| | | @Override |
| | | public void pdaLocNormalMove(List<LocNormal> list) { |
| | | baseMapper.pdaLocNormalMove(list); |
| | | } |
| | | } |
| | |
| | | .eq("matnr", combMat.getMatNo()) |
| | | .isNull("zpallet")); |
| | | if (one == null) { |
| | | throw new CoolException("通知单不存在"+combMat.getMatNo()+"数据!"); |
| | | throw new CoolException("通知单不存在" + combMat.getMatNo() + "数据!"); |
| | | } |
| | | if (combMat.getCount() > one.getAnfme()) { |
| | | throw new CoolException(combMat.getMatNo()+"物料数量不足!"); |
| | | throw new CoolException(combMat.getMatNo() + "物料数量不足!"); |
| | | } |
| | | MatCode matCode = matCodeService.selectById(combMat.getMatNo()); |
| | | if (Cools.isEmpty(matCode)) { |
| | |
| | | waitPakinService.delete(new EntityWrapper<WaitPakin>() |
| | | .eq("supplier", param.getBillNo()) |
| | | .eq("matnr", combMat.getMatNo()) |
| | | .eq("warehouse", param.getWarehouse()) |
| | | .isNull("zpallet")); |
| | | } else { |
| | | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | .eq("supplier", param.getBillNo()) |
| | | .eq("matnr", combMat.getMatNo()) |
| | | .isNull("zpallet"); |
| | | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>(); |
| | | if ("".equals(param.getWarehouse())) { |
| | | wrapper.eq("supplier", param.getBillNo()) |
| | | .eq("matnr", combMat.getMatNo()) |
| | | .isNull("zpallet"); |
| | | } else { |
| | | wrapper.eq("supplier", param.getBillNo()) |
| | | .eq("matnr", combMat.getMatNo()) |
| | | .eq("warehouse", param.getWarehouse()) |
| | | .isNull("zpallet"); |
| | | } |
| | | WaitPakin pakin = new WaitPakin(); |
| | | pakin.setAnfme(one.getAnfme() - waitPakin.getAnfme()); |
| | | if (!waitPakinService.update(pakin, wrapper)) { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.mapper.OutStockMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.model.OutLocDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.service.erp.entity.OutStockBillEntry; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | @Service("outStockService") |
| | | public class OutStockServiceImpl extends ServiceImpl<OutStockMapper, OutStockBillEntry> implements OutStockService{ |
| | | // 工作号生成规则默认类型 |
| | | private static final int DEFAULT_WORK_NO_TYPE = 0; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | |
| | | @Override |
| | | public Page<OutStockBillEntry> queryOutStock(Page<OutStockBillEntry> page) { |
| | | page.setRecords(baseMapper.queryOutStock(page.getCondition())); |
| | | page.setTotal(baseMapper.queryOutStockCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> queryMatWithLoc(String fbillNo) { |
| | | List<OutStockBillEntry> matList = baseMapper.queryMatnrWithBillNo(fbillNo); |
| | | List<LocDetl> tempLocList = new ArrayList<LocDetl>(); |
| | | List<LocDetl> locList = new ArrayList<LocDetl>(); |
| | | for (Integer i = 0; i < matList.size(); i++) { |
| | | /*自动根据物料编码选取最优出货顺序(先进先出,靠外货物先出)*/ |
| | | tempLocList = baseMapper.queryMatWithLoc(matList.get(i).getFNumber()); |
| | | BigDecimal needNum = matList.get(i).getFAuxQty(); |
| | | BigDecimal locNum = BigDecimal.ZERO; |
| | | if (tempLocList.size() > 0) { |
| | | for (Integer j = 0; j < tempLocList.size(); j ++) { |
| | | locNum = locNum.add(new BigDecimal(tempLocList.get(j).getAnfme())); |
| | | /* 计算需要的数量,符合数量后结束循环 */ |
| | | if (needNum.compareTo(locNum) == 1) { |
| | | locList.add(tempLocList.get(j)); |
| | | } else { |
| | | locList.add(tempLocList.get(j)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return locList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStore(StockOutParam param, Long userId) { |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl sqlParam = new LocDetl(); |
| | | sqlParam.setLocNo(paramLocDetl.getLocNo()); |
| | | sqlParam.setMatnr(paramLocDetl.getMatnr()); |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<>(sqlParam)); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId, param.getFbillNo()); |
| | | } else { |
| | | throw new CoolException("库位物料不存在"); |
| | | } |
| | | } |
| | | |
| | | // @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, Integer ioType, Long userId, String fbillNo) { |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | | locDetlDtos.forEach(dto -> locNos.add(dto.getLocDetl().getLocNo())); |
| | | List<OutLocDto> dtos = new ArrayList<>(); |
| | | for (String locNo : locNos) { |
| | | List<LocDetlDto> list = new ArrayList<>(); |
| | | Iterator<LocDetlDto> iterator = locDetlDtos.iterator(); |
| | | while (iterator.hasNext()) { |
| | | LocDetlDto dto = iterator.next(); |
| | | if (locNo.equals(dto.getLocDetl().getLocNo())) { |
| | | list.add(dto); |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | dtos.add(new OutLocDto(locNo, list)); |
| | | } |
| | | // 生成工作档 |
| | | for (OutLocDto dto : dtos) { |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | | if (ioType == null) { |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | } |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | // 获取路径 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", ioType) |
| | | .eq("stn_no", staNo.getDevNo()) |
| | | .eq("crn_no", locMast.getCrnNo()); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new CoolException("出库路径不存在"); |
| | | } |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(ioType); // 入出库状态 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo()); // 目标站 |
| | | wrkMast.setSourceLocNo(dto.getLocNo()); // 源库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | // 出库时,数量为0的直接忽略 |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(new Date()); |
| | | Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | VersionUtils.setWrkDetl(wrkDetl, detlDto.getLocDetl()); // 版本控制 |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setWarehouse(fbillNo); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | } |
| | | // todo:luxiaotao |
| | | // 同一列的同时出库,则优先出浅库位 |
| | | } |
| | | } |
| | |
| | | public static void setMatCode(MatCode matCode, M_item item) { |
| | | matCode.setMatNo(item.getMnumber()); // 物料编号 |
| | | matCode.setMatName(item.getMname()); // 物料描述 |
| | | matCode.setStr2(item.getMmodel()); // 物料类别 |
| | | matCode.setStr2(item.getMtypename()); |
| | | matCode.setStr3(item.getMmodel()); // 物料类别 |
| | | matCode.setStr2(item.getMtypename()); // 规格型号 |
| | | } |
| | | |
| | | // excel ---------------------------------------------------------------------- |
| | |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | public boolean syncOutStock() { |
| | | return erpSqlServer.update("MERGE INTO xtyasrs.dbo.OutStockBill AS a \n" + |
| | | "USING (SELECT * FROM xtyasrs_dual.dbo.OutStockBill c)\n" + |
| | | "AS b\n" + |
| | | " ON a.FInterID = b.FInterID\n" + |
| | | "WHEN MATCHED THEN\n" + |
| | | "UPDATE SET \n" + |
| | | "FBrNo = b.FBrNo,\n" + |
| | | "FInterID = b.FInterID,\n" + |
| | | "FBillNo = b.FBillNo,\n" + |
| | | "FTranType = b.FTranType,\n" + |
| | | "FSalType = b.FSalType,\n" + |
| | | "FCustID = b.FCustID,\n" + |
| | | "FDate = b.FDate,\n" + |
| | | "FStockID = b.FStockID,\n" + |
| | | "FAdd = b.FAdd,\n" + |
| | | "FNote = b.FNote,\n" + |
| | | "FEmpID = b.FEmpID,\n" + |
| | | "FCheckerID = b.FCheckerID,\n" + |
| | | "FBillerID = b.FBillerID,\n" + |
| | | "FManagerID = b.FManagerID,\n" + |
| | | "FClosed = b.FClosed,\n" + |
| | | "FInvoiceClosed = b.FInvoiceClosed,\n" + |
| | | "FBClosed = b.FBClosed,\n" + |
| | | "FDeptID = b.FDeptID,\n" + |
| | | "FSettleID = b.FSettleID,\n" + |
| | | "FTranStatus = b.FTranStatus,\n" + |
| | | "FExchangeRate = b.FExchangeRate,\n" + |
| | | "FCurrencyID = b.FCurrencyID,\n" + |
| | | "FStatus = b.FStatus,\n" + |
| | | "FCancellation = b.FCancellation,\n" + |
| | | "FMultiCheckLevel1 = b.FMultiCheckLevel1,\n" + |
| | | "FMultiCheckLevel2 = b.FMultiCheckLevel2,\n" + |
| | | "FMultiCheckLevel3 = b.FMultiCheckLevel3,\n" + |
| | | "FMultiCheckLevel4 = b.FMultiCheckLevel4,\n" + |
| | | "FMultiCheckLevel5 = b.FMultiCheckLevel5,\n" + |
| | | "FMultiCheckLevel6 = b.FMultiCheckLevel6,\n" + |
| | | "FMultiCheckDate1 = b.FMultiCheckDate1,\n" + |
| | | "FMultiCheckDate2 = b.FMultiCheckDate2,\n" + |
| | | "FMultiCheckDate3 = b.FMultiCheckDate3,\n" + |
| | | "FMultiCheckDate4 = b.FMultiCheckDate4,\n" + |
| | | "FMultiCheckDate5 = b.FMultiCheckDate5,\n" + |
| | | "FMultiCheckDate6 = b.FMultiCheckDate6,\n" + |
| | | "FCurCheckLevel = b.FCurCheckLevel,\n" + |
| | | "FRelateBrID = b.FRelateBrID,\n" + |
| | | "FCheckDate = b.FCheckDate,\n" + |
| | | "FExplanation = b.FExplanation,\n" + |
| | | "FFetchAdd = b.FFetchAdd,\n" + |
| | | "FSelTranType = b.FSelTranType,\n" + |
| | | "FChildren = b.FChildren,\n" + |
| | | "FBrID = b.FBrID,\n" + |
| | | "FAreaPS = b.FAreaPS,\n" + |
| | | "FPOOrdBillNo = b.FPOOrdBillNo,\n" + |
| | | "FManageType = b.FManageType,\n" + |
| | | "FPrintCount = b.FPrintCount,\n" + |
| | | "Fflag_rw = b.Fflag_rw,\n" + |
| | | "Fflag_finish = b.Fflag_finish,\n" + |
| | | "FWeiOrder = b.FWeiOrder,\n" + |
| | | "FWeiOpenID = b.FWeiOpenID,\n" + |
| | | "FOrderBillNo = b.FOrderBillNo,\n" + |
| | | "FWLNumber = b.FWLNumber,\n" + |
| | | "FWLCompany = b.FWLCompany,\n" + |
| | | "FReturnFundType = b.FReturnFundType\n" + |
| | | "WHEN NOT MATCHED THEN\n" + |
| | | "\tINSERT (FBrNo, FInterID, FBillNo, FTranType, FSalType, FCustID, FDate, FStockID, FAdd, FNote, FEmpID, FCheckerID, FBillerID, FManagerID, FClosed, FInvoiceClosed, FBClosed, FDeptID, FSettleID, FTranStatus, FExchangeRate, FCurrencyID, FStatus, FCancellation, FMultiCheckLevel1, FMultiCheckLevel2, FMultiCheckLevel3, FMultiCheckLevel4, FMultiCheckLevel5, FMultiCheckLevel6, FMultiCheckDate1, FMultiCheckDate2, FMultiCheckDate3, FMultiCheckDate4, FMultiCheckDate5, FMultiCheckDate6, FCurCheckLevel, FRelateBrID, FCheckDate, FExplanation, FFetchAdd, FSelTranType, FChildren, FBrID, FAreaPS, FPOOrdBillNo, FManageType, FPrintCount, Fflag_rw, Fflag_finish, FWeiOrder, FWeiOpenID, FOrderBillNo, FWLNumber, FWLCompany, FReturnFundType) \n" + |
| | | "\tVALUES (b.FBrNo, b.FInterID, b.FBillNo, FTranType, FSalType, FCustID, FDate, FStockID, FAdd, FNote, FEmpID, FCheckerID, FBillerID, FManagerID, FClosed, FInvoiceClosed, FBClosed, FDeptID, FSettleID, FTranStatus, FExchangeRate, FCurrencyID, FStatus, FCancellation, FMultiCheckLevel1, FMultiCheckLevel2, FMultiCheckLevel3, FMultiCheckLevel4, FMultiCheckLevel5, FMultiCheckLevel6, FMultiCheckDate1, FMultiCheckDate2, FMultiCheckDate3, FMultiCheckDate4, FMultiCheckDate5, FMultiCheckDate6, FCurCheckLevel, FRelateBrID, FCheckDate, FExplanation, FFetchAdd, FSelTranType, FChildren, FBrID, FAreaPS, FPOOrdBillNo, FManageType, FPrintCount, Fflag_rw, Fflag_finish, FWeiOrder, FWeiOpenID, FOrderBillNo, FWLNumber, FWLCompany, FReturnFundType);")> 0; |
| | | } |
| | | |
| | | |
| | | public boolean syncOutStockDetail() { |
| | | return erpSqlServer.update("MERGE INTO xtyasrs.dbo.OutStockBillEntry AS a \n" + |
| | | "USING (SELECT * FROM xtyasrs_dual.dbo.OutStockBillEntry c)\n" + |
| | | "AS b\n" + |
| | | " ON (a.FInterID = b.FInterID and a.FEntryID = b.FEntryID)\n" + |
| | | "WHEN MATCHED THEN\n" + |
| | | "UPDATE SET\n" + |
| | | "FBrNo = b.FBrNo,\n" + |
| | | "FInterID = b.FInterID,\n" + |
| | | "FEntryID = b.FEntryID,\n" + |
| | | "FDetailID = b.FDetailID,\n" + |
| | | "FItemID = b.FItemID,\n" + |
| | | "FQty = b.FQty,\n" + |
| | | "FCommitQty = b.FCommitQty,\n" + |
| | | "FPrice = b.FPrice,\n" + |
| | | "FAmount = b.FAmount,\n" + |
| | | "FOrderInterID = b.FOrderInterID,\n" + |
| | | "FDate = b.FDate,\n" + |
| | | "FNote = b.FNote,\n" + |
| | | "FInvoiceQty = b.FInvoiceQty,\n" + |
| | | "FBCommitQty = b.FBCommitQty,\n" + |
| | | "FUnitID = b.FUnitID,\n" + |
| | | "FAuxBCommitQty = b.FAuxBCommitQty,\n" + |
| | | "FAuxCommitQty = b.FAuxCommitQty,\n" + |
| | | "FAuxInvoiceQty = b.FAuxInvoiceQty,\n" + |
| | | "FAuxPrice = b.FAuxPrice,\n" + |
| | | "FAuxQty = b.FAuxQty,\n" + |
| | | "FSourceEntryID = b.FSourceEntryID,\n" + |
| | | "FMapNumber = b.FMapNumber,\n" + |
| | | "FMapName = b.FMapName,\n" + |
| | | "FAuxPropID = b.FAuxPropID,\n" + |
| | | "FBatchNo = b.FBatchNo,\n" + |
| | | "FCheckDate = b.FCheckDate,\n" + |
| | | "FExplanation = b.FExplanation,\n" + |
| | | "FFetchAdd = b.FFetchAdd,\n" + |
| | | "FFetchDate = b.FFetchDate,\n" + |
| | | "FMultiCheckDate1 = b.FMultiCheckDate1,\n" + |
| | | "FMultiCheckDate2 = b.FMultiCheckDate2,\n" + |
| | | "FMultiCheckDate3 = b.FMultiCheckDate3,\n" + |
| | | "FMultiCheckDate4 = b.FMultiCheckDate4,\n" + |
| | | "FMultiCheckDate5 = b.FMultiCheckDate5,\n" + |
| | | "FMultiCheckDate6 = b.FMultiCheckDate6,\n" + |
| | | "FSecCoefficient = b.FSecCoefficient,\n" + |
| | | "FSecQty = b.FSecQty,\n" + |
| | | "FSecCommitQty = b.FSecCommitQty,\n" + |
| | | "FSourceTranType = b.FSourceTranType,\n" + |
| | | "FSourceInterId = b.FSourceInterId,\n" + |
| | | "FSourceBillNo = b.FSourceBillNo,\n" + |
| | | "FContractInterID = b.FContractInterID,\n" + |
| | | "FContractEntryID = b.FContractEntryID,\n" + |
| | | "FContractBillNo = b.FContractBillNo,\n" + |
| | | "FOrderEntryID = b.FOrderEntryID,\n" + |
| | | "FOrderBillNo = b.FOrderBillNo,\n" + |
| | | "FStockID = b.FStockID,\n" + |
| | | "FBackQty = b.FBackQty,\n" + |
| | | "FAuxBackQty = b.FAuxBackQty,\n" + |
| | | "FSecBackQty = b.FSecBackQty,\n" + |
| | | "FStdAmount = b.FStdAmount,\n" + |
| | | "FPlanMode = b.FPlanMode,\n" + |
| | | "FMTONo = b.FMTONo,\n" + |
| | | "FStockQtyOnlyForShow = b.FStockQtyOnlyForShow,\n" + |
| | | "FComplexQty = b.FComplexQty,\n" + |
| | | "Fmodel = b.Fmodel,\n" + |
| | | "Fname = b.Fname,\n" + |
| | | "Fnumber = b.Fnumber,\n" + |
| | | "FBarCode = b.FBarCode,\n" + |
| | | "FBTPLCommitQty = b.FBTPLCommitQty,\n" + |
| | | "FTPLCommitQty = b.FTPLCommitQty,\n" + |
| | | "fsecinvoiceqty = b.fsecinvoiceqty\n" + |
| | | "WHEN NOT MATCHED THEN\n" + |
| | | "\tINSERT (FBrNo, FInterID, FEntryID, FDetailID, FItemID, FQty, FCommitQty, FPrice, FAmount, FOrderInterID, FDate, FNote, FInvoiceQty, FBCommitQty, FUnitID, FAuxBCommitQty, FAuxCommitQty, FAuxInvoiceQty, FAuxPrice, FAuxQty, FSourceEntryID, FMapNumber, FMapName, FAuxPropID, FBatchNo, FCheckDate, FExplanation, FFetchAdd, FFetchDate, FMultiCheckDate1, FMultiCheckDate2, FMultiCheckDate3, FMultiCheckDate4, FMultiCheckDate5, FMultiCheckDate6, FSecCoefficient, FSecQty, FSecCommitQty, FSourceTranType, FSourceInterId, FSourceBillNo, FContractInterID, FContractEntryID, FContractBillNo, FOrderEntryID, FOrderBillNo, FStockID, FBackQty, FAuxBackQty, FSecBackQty, FStdAmount, FPlanMode, FMTONo, FStockQtyOnlyForShow, FComplexQty, Fmodel, Fname, Fnumber, FBarCode, FBTPLCommitQty, FTPLCommitQty, fsecinvoiceqty) \n" + |
| | | "\tVALUES (b.FBrNo, b.FInterID, b.FEntryID, b.FDetailID, b.FItemID, b.FQty, b.FCommitQty, b.FPrice, b.FAmount, b.FOrderInterID, b.FDate, b.FNote, b.FInvoiceQty, b.FBCommitQty, b.FUnitID, b.FAuxBCommitQty, b.FAuxCommitQty, b.FAuxInvoiceQty, b.FAuxPrice, b.FAuxQty, b.FSourceEntryID, b.FMapNumber, b.FMapName, b.FAuxPropID, b.FBatchNo, b.FCheckDate, b.FExplanation, b.FFetchAdd, b.FFetchDate, b.FMultiCheckDate1, b.FMultiCheckDate2, b.FMultiCheckDate3, b.FMultiCheckDate4, b.FMultiCheckDate5, b.FMultiCheckDate6, b.FSecCoefficient, b.FSecQty, b.FSecCommitQty, b.FSourceTranType, b.FSourceInterId, b.FSourceBillNo, b.FContractInterID, b.FContractEntryID, b.FContractBillNo, b.FOrderEntryID, b.FOrderBillNo, b.FStockID, b.FBackQty, b.FAuxBackQty, b.FSecBackQty, b.FStdAmount, b.FPlanMode, b.FMTONo, b.FStockQtyOnlyForShow, b.FComplexQty, b.Fmodel, b.Fname, b.Fnumber, b.FBarCode, b.FBTPLCommitQty, b.FTPLCommitQty, b.fsecinvoiceqty);")> 0; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | package com.zy.common.service.erp.entity; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 出库表头 |
| | |
| | | */ |
| | | @Data |
| | | public class OutStockBill { |
| | | private String FBrNo; |
| | | /*通知单内码*/ |
| | | private Integer FInterID; |
| | | /*单据编号*/ |
| | | private String FBillNo; |
| | | /*单据类型*/ |
| | | private Integer FTranType; |
| | | /*销售方式*/ |
| | | private Integer FSalType; |
| | | /*购货单位*/ |
| | | private Integer FCustID; |
| | | /*日期*/ |
| | | private Date FDate; |
| | | /*收货仓库*/ |
| | | private Integer FStockID; |
| | | /*地址*/ |
| | | private String FAdd; |
| | | /*退料原因*/ |
| | | private String FNote; |
| | | /*业务员*/ |
| | | private Integer FEmpID; |
| | | /*审核人*/ |
| | | private Integer FCheckerID; |
| | | /*制单*/ |
| | | private Integer FBillerID; |
| | | /*主管*/ |
| | | private Integer FManagerID; |
| | | |
| | | private Integer FClosed; |
| | | |
| | | private Short FInvoiceClosed; |
| | | |
| | | private Short FBClosed; |
| | | /*部门*/ |
| | | private Integer FDeptID; |
| | | /*结算方式*/ |
| | | private Integer FSettleID; |
| | | /*传输状态*/ |
| | | private Integer FTranStatus; |
| | | /*汇率*/ |
| | | private Double FExchangeRate; |
| | | /*币别*/ |
| | | private Integer FCurrencyID; |
| | | /*状态*/ |
| | | private Short FStatus; |
| | | /*作废*/ |
| | | private Long FCancellation; |
| | | /*一审*/ |
| | | private Integer FMultiCheckLevel1; |
| | | /*二审*/ |
| | | private Integer FMultiCheckLevel2; |
| | | /*三审*/ |
| | | private Integer FMultiCheckLevel3; |
| | | /*四审*/ |
| | | private Integer FMultiCheckLevel4; |
| | | /*五审*/ |
| | | private Integer FMultiCheckLevel5; |
| | | /*六审*/ |
| | | private Integer FMultiCheckLevel6; |
| | | /*一级审核日期*/ |
| | | private Date FMultiCheckDate1; |
| | | /*二级审核日期*/ |
| | | private Date FMultiCheckDate2; |
| | | /*三级审核日期*/ |
| | | private Date FMultiCheckDate3; |
| | | /*四级审核日期*/ |
| | | private Date FMultiCheckDate4; |
| | | /*五级审核日期*/ |
| | | private Date FMultiCheckDate5; |
| | | /*六级审核日期*/ |
| | | private Date FMultiCheckDate6; |
| | | |
| | | private Integer FCurCheckLevel; |
| | | /*订货机构*/ |
| | | private Integer FRelateBrID; |
| | | /*审核日期*/ |
| | | private Date FCheckDate; |
| | | |
| | | private String FExplanation; |
| | | |
| | | private String FFetchAdd; |
| | | |
| | | private Integer FSelTranType; |
| | | |
| | | private Integer FChildren; |
| | | |
| | | private Integer FBrID; |
| | | |
| | | private Integer FAreaPS; |
| | | |
| | | private String FPOOrdBillNo; |
| | | |
| | | private Integer FManageType; |
| | | |
| | | private Short FPrintCount; |
| | | |
| | | private Integer Fflag_rw; |
| | | |
| | | private Integer Fflag_finish; |
| | | |
| | | private String FWeiOrder; |
| | | |
| | | private String FWeiOpenID; |
| | | |
| | | private String FOrderBillNo; |
| | | |
| | | private String FWLNumber; |
| | | |
| | | private String FWLCompany; |
| | | |
| | | private String FReturnFundType; |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 出库表体 |
| | | * Created by vincent on 2020/11/27 |
| | | */ |
| | | @Data |
| | | public class OutStockBillEntry { |
| | | /* 订单状态,出库中或已出库 */ |
| | | private Integer workRecord; |
| | | /*单据编号-OutStockBill表数据 */ |
| | | private String FBillNo; |
| | | /*地址-OutStockBill表数据*/ |
| | | private String FAdd; |
| | | |
| | | private String FBrNo; |
| | | /*通知单内码*/ |
| | | private Integer FInterID; |
| | | /*分录号*/ |
| | | private Integer FEntryID; |
| | | /*产品代码内码*/ |
| | | private Integer FItemID; |
| | | /*基本单位数量*/ |
| | | private BigDecimal FQty; |
| | | /*发货数量*/ |
| | | private BigDecimal FCommitQty; |
| | | /*单价*/ |
| | | private BigDecimal FPrice; |
| | | /*金额*/ |
| | | private BigDecimal FAmount; |
| | | /*销售订单单号*/ |
| | | private Integer FOrderInterID; |
| | | /*日期*/ |
| | | private Date FDate; |
| | | /*备注*/ |
| | | private String FNote; |
| | | /*开票数量*/ |
| | | private BigDecimal FInvoiceQty; |
| | | /*退货数量*/ |
| | | private BigDecimal FBCommitQty; |
| | | /*计量单位*/ |
| | | private BigDecimal FUnitID; |
| | | /*辅助退货数量*/ |
| | | private BigDecimal FAuxBCommitQty; |
| | | /*辅助发货数量*/ |
| | | private BigDecimal FAuxCommitQty; |
| | | /*辅助开票数量*/ |
| | | private BigDecimal FAuxInvoiceQty; |
| | | /*单价*/ |
| | | private BigDecimal FAuxPrice; |
| | | /*数量*/ |
| | | private BigDecimal FAuxQty; |
| | | /*源单行号*/ |
| | | private Integer FSourceEntryID; |
| | | /*对应代码*/ |
| | | private String FMapNumber; |
| | | /*对应名称*/ |
| | | private String FMapName; |
| | | |
| | | private Integer FAuxPropID; |
| | | |
| | | private String FBatchNo; |
| | | |
| | | private Date FCheckDate; |
| | | |
| | | private String FExplanation; |
| | | |
| | | private String FFetchAdd; |
| | | |
| | | private Date FFetchDate; |
| | | |
| | | private Date FMultiCheckDate1; |
| | | |
| | | private Date FMultiCheckDate2; |
| | | |
| | | private Date FMultiCheckDate3; |
| | | |
| | | private Date FMultiCheckDate4; |
| | | |
| | | private Date FMultiCheckDate5; |
| | | |
| | | private Date FMultiCheckDate6; |
| | | |
| | | private BigDecimal FSecCoefficient; |
| | | |
| | | private BigDecimal FSecQty; |
| | | |
| | | private BigDecimal FSecCommitQty; |
| | | |
| | | private Integer FSourceTranType; |
| | | |
| | | private Integer FSourceInterId; |
| | | /*生产单号*/ |
| | | private String FSourceBillNo; |
| | | |
| | | private Integer FContractInterID; |
| | | |
| | | private Integer FContractEntryID; |
| | | |
| | | private String FContractBillNo; |
| | | |
| | | private Integer FOrderEntryID; |
| | | |
| | | private String FOrderBillNo; |
| | | |
| | | private Integer FStockID; |
| | | |
| | | private BigDecimal FBackQty; |
| | | |
| | | private BigDecimal FAuxBackQty; |
| | | |
| | | private BigDecimal FSecBackQty; |
| | | |
| | | private BigDecimal FStdAmount; |
| | | |
| | | private Integer FPlanMode; |
| | | |
| | | private String FMTONo; |
| | | |
| | | private Integer FDetailID; |
| | | |
| | | private BigDecimal FStockQtyOnlyForShow; |
| | | |
| | | private String FComplexQty; |
| | | |
| | | private String Fmodel; |
| | | |
| | | private String Fname; |
| | | /*物料编码(产品代码)*/ |
| | | private String FNumber; |
| | | |
| | | private String FBarCode; |
| | | |
| | | private String FBTPLCommitQty; |
| | | |
| | | private String FTPLCommitQty; |
| | | |
| | | private String fsecinvoiceqty; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 成品出库-发货通知单表头 |
| | | */ |
| | | @Scheduled(cron = "0/30 * * * * ? ") |
| | | public void syncOutStock(){ |
| | | boolean result = erpService.syncOutStock(); |
| | | if (result) { |
| | | // System.out.format("%s\33[%d;%dm%s%n", "", 32, 3, "==========OutStockBill表同步成功=========="); |
| | | } else { |
| | | System.out.format("%s\33[%d;%dm%s%n", "", 31, 3, "==========OutStockBill表同步失败=========="); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 成品出库-发货通知单表体 |
| | | */ |
| | | @Scheduled(cron = "0/30 * * * * ? ") |
| | | public void syncOutStockDetail(){ |
| | | boolean result = erpService.syncOutStockDetail(); |
| | | if (result) { |
| | | // System.out.format("%s\33[%d;%dm%s%n", "", 32, 3, "==========OutStockBillEntry表同步成功=========="); |
| | | } else { |
| | | System.out.format("%s\33[%d;%dm%s%n", "", 31, 3, "==========OutStockBillEntry表同步失败=========="); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 原材料出库 |
New file |
| | |
| | | package com.zy.common.utils.excel.locNomal; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class LocNormalExcel { |
| | | @ExcelProperty(index = 0) |
| | | private String matnr; |
| | | @ExcelProperty(index = 1) |
| | | private String maktx; |
| | | @ExcelProperty(index = 2) |
| | | private String lgnum; |
| | | @ExcelProperty(index = 3) |
| | | private String type; |
| | | @ExcelProperty(index = 4) |
| | | private String mnemonic; |
| | | @ExcelProperty(index = 5) |
| | | private String supplier; |
| | | @ExcelProperty(index = 6) |
| | | private String warehouse; |
| | | @ExcelProperty(index = 7) |
| | | private String brand; |
| | | @ExcelProperty(index = 8) |
| | | private BigDecimal anfme; |
| | | @ExcelProperty(index = 9) |
| | | private String altme; |
| | | @ExcelProperty(index = 10) |
| | | private String bname; |
| | | @ExcelProperty(index = 11) |
| | | private String memo; |
| | | |
| | | private Long appeUser; |
| | | |
| | | private Date appeTime; |
| | | @ExcelProperty(index = 12) |
| | | private String state; |
| | | |
| | | public LocNormalExcel() { |
| | | |
| | | } |
| | | |
| | | public LocNormalExcel(String matnr, String maktx, String lgnum, String type, String mnemonic, String supplier, String warehouse, String brand, BigDecimal anfme, String altme, String bname, String memo, Long appeUser, Date appeTime,String state) { |
| | | this.matnr = matnr; |
| | | this.maktx = maktx; |
| | | this.lgnum = lgnum; |
| | | this.type = type; |
| | | this.mnemonic = mnemonic; |
| | | this.supplier = supplier; |
| | | this.warehouse = warehouse; |
| | | this.brand = brand; |
| | | this.anfme = anfme; |
| | | this.altme = altme; |
| | | this.bname = bname; |
| | | this.memo = memo; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getMatnr() { |
| | | return matnr; |
| | | } |
| | | |
| | | public void setMatnr(String matnr) { |
| | | this.matnr = matnr; |
| | | } |
| | | |
| | | public String getMaktx() { |
| | | return maktx; |
| | | } |
| | | |
| | | public void setMaktx(String maktx) { |
| | | this.maktx = maktx; |
| | | } |
| | | |
| | | public String getLgnum() { |
| | | return lgnum; |
| | | } |
| | | |
| | | public void setLgnum(String lgnum) { |
| | | this.lgnum = lgnum; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getMnemonic() { |
| | | return mnemonic; |
| | | } |
| | | |
| | | public void setMnemonic(String mnemonic) { |
| | | this.mnemonic = mnemonic; |
| | | } |
| | | |
| | | public String getSupplier() { |
| | | return supplier; |
| | | } |
| | | |
| | | public void setSupplier(String supplier) { |
| | | this.supplier = supplier; |
| | | } |
| | | |
| | | public String getWarehouse() { |
| | | return warehouse; |
| | | } |
| | | |
| | | public void setWarehouse(String warehouse) { |
| | | this.warehouse = warehouse; |
| | | } |
| | | |
| | | public String getBrand() { |
| | | return brand; |
| | | } |
| | | |
| | | public void setBrand(String brand) { |
| | | this.brand = brand; |
| | | } |
| | | |
| | | public BigDecimal getAnfme() { |
| | | return anfme; |
| | | } |
| | | |
| | | public void setAnfme(BigDecimal anfme) { |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public String getAltme() { |
| | | return altme; |
| | | } |
| | | |
| | | public void setAltme(String altme) { |
| | | this.altme = altme; |
| | | } |
| | | |
| | | public String getBname() { |
| | | return bname; |
| | | } |
| | | |
| | | public void setBname(String bname) { |
| | | this.bname = bname; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Long getAppeUser() { |
| | | return appeUser; |
| | | } |
| | | |
| | | public void setAppeUser(Long appeUser) { |
| | | this.appeUser = appeUser; |
| | | } |
| | | |
| | | public Date getAppeTime() { |
| | | return appeTime; |
| | | } |
| | | |
| | | public void setAppeTime(Date appeTime) { |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.common.utils.excel.locNomal; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.service.LocNormalService; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.utils.excel.matcode.MatCodeExcel; |
| | | import com.zy.common.utils.excel.matcode.MatCodeExcelListener; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class LocNormalExcelListener extends AnalysisEventListener<LocNormalExcel> { |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(MatCodeExcelListener.class); |
| | | |
| | | private int total = 0; |
| | | private Long userId; |
| | | |
| | | public LocNormalExcelListener(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 50; |
| | | |
| | | private final List<LocNormal> list = new ArrayList<>(); |
| | | |
| | | /** |
| | | * 这里会一行行的返回头 |
| | | */ |
| | | @Override |
| | | public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 这个每一条数据解析都会来调用 |
| | | */ |
| | | @Override |
| | | public void invoke(LocNormalExcel data, AnalysisContext ctx) { |
| | | LocNormalService locNormalService = SpringUtils.getBean(LocNormalService.class); |
| | | if (locNormalService.selectById(data.getMatnr()) == null) { |
| | | LocNormal locNormal = new LocNormal(); |
| | | // 插入 |
| | | locNormal.setMatnr(data.getMatnr()); |
| | | locNormal.setMaktx(data.getMaktx()); |
| | | locNormal.setLgnum(data.getLgnum()); |
| | | locNormal.setType(data.getType()); |
| | | locNormal.setMnemonic(data.getMnemonic()); |
| | | locNormal.setSupplier(data.getSupplier()); |
| | | locNormal.setWarehouse(data.getWarehouse()); |
| | | locNormal.setBrand(data.getBrand()); |
| | | locNormal.setAnfme(data.getAnfme()); |
| | | locNormal.setAltme(data.getAltme()); |
| | | locNormal.setBname(data.getBname()); |
| | | locNormal.setMemo(data.getMemo()); |
| | | locNormal.setState(data.getState()); |
| | | |
| | | locNormal.setModiTime(new Date()); |
| | | locNormal.setModiUser(this.userId); |
| | | locNormal.setAppeTime(new Date()); |
| | | locNormal.setAppeUser(this.userId); |
| | | if (!locNormalService.insert(locNormal)) { |
| | | throw new CoolException("导入数据异常"); |
| | | } |
| | | total ++; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 所有数据解析完成了调用 |
| | | * 适合事务 |
| | | */ |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext ctx) { |
| | | LOGGER.info("新增{}条物料信息!", total); |
| | | } |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | } |
| | |
| | | import java.lang.reflect.Modifier; |
| | | import java.util.*; |
| | | |
| | | import static sun.security.krb5.internal.crypto.Nonce.value; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-09-09 |
| | | */ |
| | |
| | | } |
| | | String column = null; |
| | | if (field.isAnnotationPresent(TableField.class)) { |
| | | column = field.getAnnotation(TableField.class).value(); |
| | | TableField annotation = field.getAnnotation(TableField.class); |
| | | if (!annotation.exist()) { |
| | | continue; |
| | | } |
| | | column = annotation.value(); |
| | | } |
| | | if (Cools.isEmpty(column)) { |
| | | column = field.getName(); |
New file |
| | |
| | | -- save locArea record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea/locArea.html', 'locArea管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea#btn-export', '导出', '', '3', '4', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locArea#btn-into', '导入', '', '3', '5', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea/locArea.html', N'平仓', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea#view', N'查询', '20385', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea#btn-add', N'新增', '20385', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea#btn-edit', N'编辑', '20385', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea#btn-delete', N'删除', '20385', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea#btn-export', N'导出', '20385', '3', '4', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locArea#btn-into', N'导入', '20385', '3', '5', '1'); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.LocAreaMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocArea"> |
| | | <id column="id" property="id"/> |
| | | <result column="uuid" property="uuid"/> |
| | | <result column="name" property="name"/> |
| | | <result column="status" property="status"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="memo" property="memo"/> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryAllLocArea" resultMap="BaseResultMap"> |
| | | <choose> |
| | | <when test="areaType == 1"> |
| | | select * from asr_loc_area where area_type = '1' |
| | | </when> |
| | | <otherwise> |
| | | select * from asr_loc_area where area_type != '1' or area_type is null |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | </mapper> |
| | |
| | | <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> |
| | | </sql> |
| | | |
| | | <select id="getStockOutPage" resultMap="BaseResultMap"> |
| | |
| | | BEGIN |
| | | <foreach collection="list" item="item" index="index"> |
| | | update dbo.asr_loc_detl |
| | | set mat_status = #{item.matStatusFlag,jdbcType=VARCHAR} |
| | | set mat_status = #{item.matStatus,jdbcType=VARCHAR} |
| | | where 1 = 1 |
| | | <if test="item.locNo!=null and item.locNo!='' "> |
| | | and loc_no = #{item.locNo,jdbcType=VARCHAR} |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.LocNormalMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocNormal"> |
| | | <result column="matnr" property="matnr"/> |
| | | <result column="maktx" property="maktx"/> |
| | | <result column="lgnum" property="lgnum"/> |
| | | <result column="type" property="type"/> |
| | | <result column="mnemonic" property="mnemonic"/> |
| | | <result column="supplier" property="supplier"/> |
| | | <result column="warehouse" property="warehouse"/> |
| | | <result column="brand" property="brand"/> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="bname" property="bname"/> |
| | | <result column="memo" property="memo"/> |
| | | <result column="modi_user" property="modiUser"/> |
| | | <result column="modi_time" property="modiTime"/> |
| | | <result column="appe_user" property="appeUser"/> |
| | | <result column="appe_time" property="appeTime"/> |
| | | <result column="state" property="state"/> |
| | | </resultMap> |
| | | |
| | | <select id="getLocNormalData" resultMap="BaseResultMap"> |
| | | select * from asr_loc_normal |
| | | </select> |
| | | |
| | | <!-- 更新平仓物料的数量 --> |
| | | <update id="updateLocNormal"> |
| | | update asr_loc_normal set anfme = #{anfme,jdbcType=DECIMAL}, |
| | | modi_user = #{modiUser, jdbcType=DECIMAL}, modi_time = #{modiTime, jdbcType=TIMESTAMP} |
| | | where matnr = #{matnr,jdbcType=VARCHAR} and id = #{id, jdbcType=DECIMAL} |
| | | </update> |
| | | |
| | | <update id="outLocNormal"> |
| | | update asr_loc_normal set state = '2',modi_user = #{modiUser, jdbcType=DECIMAL}, |
| | | modi_time = #{modiTime, jdbcType=TIMESTAMP} where matnr = #{matnr,jdbcType=VARCHAR} and id = #{id, jdbcType=DECIMAL} |
| | | </update> |
| | | |
| | | <update id="removeLocNormal"> |
| | | update asr_loc_normal set state = '3',modi_user = #{modiUser, jdbcType=DECIMAL}, |
| | | modi_time = #{modiTime, jdbcType=TIMESTAMP} where matnr = #{matnr,jdbcType=VARCHAR} and id = #{id, jdbcType=DECIMAL} |
| | | </update> |
| | | |
| | | <insert id="locNormalIn"> |
| | | BEGIN |
| | | <foreach collection="list" item="item" index="index"> |
| | | INSERT INTO asr_loc_normal (matnr, maktx, anfme, altme, lgnum, type, supplier, brand, warehouse, state, |
| | | appe_user, appe_time) |
| | | VALUES (#{item.matnr,jdbcType=VARCHAR}, #{item.maktx,jdbcType=VARCHAR}, #{item.anfme,jdbcType=DECIMAL}, |
| | | #{item.altme,jdbcType=VARCHAR},#{item.lgnum, jdbcType=VARCHAR}, #{item.type, jdbcType=VARCHAR}, |
| | | #{item.supplier, jdbcType=VARCHAR},#{item.brand, jdbcType=VARCHAR}, |
| | | #{item.warehouse,jdbcType=VARCHAR}, '1', #{item.appeUser,jdbcType=DECIMAL}, |
| | | #{item.appeTime,jdbcType=TIMESTAMP}) |
| | | </foreach> |
| | | END; |
| | | </insert> |
| | | |
| | | <insert id="pdaLocNormalIn"> |
| | | BEGIN |
| | | <foreach collection="list" item="item" index="index"> |
| | | INSERT INTO asr_loc_normal (matnr, maktx, anfme, mnemonic, supplier, warehouse, state, lgnum, type, altme, |
| | | appe_user, appe_time) |
| | | VALUES (#{item.matnr,jdbcType=VARCHAR}, #{item.maktx,jdbcType=VARCHAR}, #{item.anfme,jdbcType=DECIMAL}, |
| | | #{item.mnemonic, jdbcType=VARCHAR}, #{item.supplier, jdbcType=VARCHAR}, |
| | | #{item.warehouse,jdbcType=VARCHAR}, '1', |
| | | #{item.lgnum, jdbcType=VARCHAR}, #{item.type, jdbcType=VARCHAR}, |
| | | #{item.altme, jdbcType=VARCHAR}, |
| | | #{item.appeUser,jdbcType=DECIMAL},#{item.appeTime,jdbcType=TIMESTAMP}) |
| | | </foreach> |
| | | END; |
| | | </insert> |
| | | |
| | | <select id="pdaLocNormalQuery" resultMap="BaseResultMap"> |
| | | select id, matnr,maktx, warehouse,anfme from asr_loc_normal |
| | | where 1 = 1 |
| | | <if test="warehouse != null and warehouse != ''"> |
| | | and warehouse = #{warehouse,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and matnr =#{matnr,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="billNo != null and billNo != ''"> |
| | | and supplier = #{billNo, jdbcType=VARCHAR} |
| | | </if> |
| | | and state = '1' COLLATE Chinese_PRC_CS_AS |
| | | </select> |
| | | |
| | | <update id="pdaLocNormalOut1"> |
| | | update asr_loc_normal set state = '2',modi_user = #{modiUser, jdbcType=DECIMAL},modi_time = #{modiTime, jdbcType=TIMESTAMP} |
| | | where matnr = #{matnr,jdbcType=VARCHAR} and warehouse = #{warehouse,jdbcType=VARCHAR} and id = #{id,jdbcType=DECIMAL} |
| | | </update> |
| | | |
| | | <update id="pdaLocNormalOut2"> |
| | | update asr_loc_normal set anfme = #{anfme, jdbcType=DECIMAL},modi_user = #{modiUser, jdbcType=DECIMAL},modi_time = #{modiTime, jdbcType=TIMESTAMP} |
| | | where matnr = #{matnr,jdbcType=VARCHAR} and warehouse = #{warehouse,jdbcType=VARCHAR} and id = #{id,jdbcType=DECIMAL} |
| | | </update> |
| | | |
| | | <select id="pdaLocNormalWarehouseQuery" resultMap="BaseResultMap"> |
| | | select id,matnr, maktx, warehouse from asr_loc_normal |
| | | where warehouse = #{warehouse, jdbcType=VARCHAR} |
| | | and state = '1' |
| | | <if test="matnr != ''"> |
| | | and matnr = #{matnr, jdbcType=VARCHAR} |
| | | </if> |
| | | COLLATE Chinese_PRC_CS_AS |
| | | </select> |
| | | |
| | | <update id="pdaLocNormalMove"> |
| | | BEGIN |
| | | <foreach collection="list" item="item" index="index"> |
| | | update asr_loc_normal set warehouse = #{item.warehouse,jdbcType=VARCHAR}, |
| | | modi_user = #{item.modiUser, jdbcType=DECIMAL},modi_time = #{item.modiTime, jdbcType=TIMESTAMP} |
| | | where id = #{item.id,jdbcType=DECIMAL} |
| | | </foreach> |
| | | END; |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.OutStockMapper"> |
| | | |
| | | <!-- OutStockBillEntry映射结果 --> |
| | | <resultMap id="OutStockResultMap" type="com.zy.common.service.erp.entity.OutStockBillEntry"> |
| | | <result column="FBrNo" property="FBrNo"/> |
| | | <result column="FInterID" property="FInterID"/> |
| | | <result column="FEntryID" property="FEntryID"/> |
| | | <result column="FOrderInterID" property="FOrderInterID"/> |
| | | <result column="FAuxQty" property="FAuxQty"/> |
| | | <result column="FCommitQty" property="FCommitQty"/> |
| | | <result column="FAuxPrice" property="FAuxPrice"/> |
| | | <result column="FDate" property="FDate"/> |
| | | <result column="FNote" property="FNote"/> |
| | | <result column="Fnumber" property="FNumber"/> |
| | | <result column="FSourceBillNo" property="FSourceBillNo"/> |
| | | <result column="FBillNo" property="FBillNo"/> |
| | | <result column="FAdd" property="FAdd"/> |
| | | <result column="workRecord" property="workRecord"/> |
| | | </resultMap> |
| | | |
| | | <!-- asr_loc_detl映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocDetl"> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="lgnum" property="lgnum" /> |
| | | <result column="type" property="type" /> |
| | | <result column="mnemonic" property="mnemonic" /> |
| | | <result column="supplier" property="supplier" /> |
| | | <result column="warehouse" property="warehouse" /> |
| | | <result column="brand" property="brand" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="altme" property="altme" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="bname" property="bname" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | <result column="mat_status" property="matStatus" /> |
| | | </resultMap> |
| | | |
| | | <sql id="stockOutCondition"> |
| | | <if test="FBillNo!=null and FBillNo!='' "> |
| | | and b.FBillNo like '%' + #{FBillNo} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="queryOutStock" 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 |
| | | from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID |
| | | where 1=1 |
| | | <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 |
| | | </select> |
| | | |
| | | <select id="queryOutStockCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select |
| | | count(1) |
| | | from OutStockBillEntry a |
| | | left join OutStockBill b on a.FInterID = b.FInterID |
| | | where 1=1 |
| | | </select> |
| | | |
| | | <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 |
| | | from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID |
| | | where b.FBillNo = #{FBillNo}) t where t.workRecord = 0 |
| | | </select> |
| | | |
| | | <select id="queryMatWithLoc" resultMap="BaseResultMap"> |
| | | select * from asr_loc_detl a left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time) |
| | | desc, |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |
| | | when (left(a.loc_no, 2) = '02') then 1 |
| | | when (left(a.loc_no, 2) = '03') then 1 |
| | | when (left(a.loc_no, 2) = '04') then 0 |
| | | when (left(a.loc_no, 2) = '05') then 0 |
| | | when (left(a.loc_no, 2) = '06') then 1 |
| | | when (left(a.loc_no, 2) = '07') then 1 |
| | | when (left(a.loc_no, 2) = '08') then 0 |
| | | when (left(a.loc_no, 2) = '09') then 0 |
| | | when (left(a.loc_no, 2) = '10') then 1 |
| | | when (left(a.loc_no, 2) = '11') then 1 |
| | | when (left(a.loc_no, 2) = '12') then 0 |
| | | else 0 |
| | | end |
| | | desc |
| | | </select> |
| | | </mapper> |
| | |
| | | line-height: 30px; |
| | | } |
| | | #code { |
| | | width: 75%; |
| | | width: 70%; |
| | | height: 40px; |
| | | margin-right: 0; |
| | | } |
| | | #uuid { |
| | | width: 65%; |
| | | height: 40px; |
| | | margin-right: 0; |
| | | } |
| | |
| | | // 详情窗口-宽度 |
| | | var detailWidth = '90%'; |
| | | |
| | | function getQueryVariable(variable) |
| | | { |
| | | var query = window.location.search.substring(1); |
| | | var vars = query.split("&"); |
| | | for (var i=0;i<vars.length;i++) { |
| | | var pair = vars[i].split("="); |
| | | if(pair[0] == variable){return pair[1];} |
| | | } |
| | | return(false); |
| | | } |
| | | |
| | | // 非空判断 |
| | | function isEmpty(obj){ |
| | | return typeof obj == "undefined" || obj == null || obj === ""; |
| | |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | | ,{field: 'mnemonic', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号'} |
| | | // ,{field: 'warehouse', align: 'center',title: '仓库'} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号', hide: true} |
| | | ,{field: 'warehouse', align: 'center',title: '生产单号'} |
| | | // ,{field: 'brand', align: 'center',title: '品牌'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | // ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ] |
| | | |
| | | var locNormalCols = [ |
| | | {field: 'matnr', align: 'center',title: '物料编码'} |
| | | ,{field: 'maktx', align: 'center',title: '物料名称', width: 400} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | | ,{field: 'mnemonic', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号'} |
| | | // ,{field: 'warehouse', align: 'center',title: '库区'} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ] |
| | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | var tips2; |
| | | // 是否存在校验 |
| | | function exist(id, domain, dom) { |
| | | var param = { |
| | | key: id, |
| | | val: $('#'+ (dom ? dom : id)).val() |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/"+domain+"/check/column/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | tips2 = layer.tips( |
| | | "<span style='color:red;'>不存在</span>", |
| | | '#'+(dom ? dom : id), |
| | | { |
| | | // tipsMore: true, |
| | | tips: [3,'#fff'], |
| | | time:0 |
| | | ,area: 'auto' |
| | | ,maxWidth:500 |
| | | }); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 407) { |
| | | layer.close(tips2); |
| | | } |
| | | } |
| | | }); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locArea', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locArea/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'uuid', align: 'center',title: '库区编号'} |
| | | ,{field: 'name', align: 'center',title: '库区名称'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员',event: 'createBy', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员',event: 'updateBy', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(locArea)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'locArea_detail.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locArea/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'locArea': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/locArea/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locArea)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'locArea_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'locArea_detail.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-save', index).hide(); |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | top.convertDisabled(layer.getChildFrame('#id', index), true); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | | }); |
| | | break; |
| | | case 'createBy': |
| | | var param = top.reObject(data).createBy; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '添加人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: "baseUrl+/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'updateBy': |
| | | var param = top.reObject(data).updateBy; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改人员详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: "baseUrl+/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | method("add"); |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | method("update") |
| | | }); |
| | | |
| | | function method(name){ |
| | | var uuid = $('#uuid').val(); |
| | | var areaName = $('#name').val(); |
| | | if (uuid === '' || !uuid) { |
| | | layer.msg('请输入库区编号'); |
| | | return; |
| | | } |
| | | if (areaName === '' || !areaName) { |
| | | layer.msg('请输入库区名称'); |
| | | return; |
| | | } |
| | | |
| | | var data = { |
| | | id: $('#id').val(), |
| | | uuid: $('#uuid').val(), |
| | | name: $('#name').val(), |
| | | status: $('#status').val(), |
| | | createBy: $('#createBy').val(), |
| | | createTime: top.strToDate($('#createTime\\$').val()), |
| | | updateBy: $('#updateBy').val(), |
| | | updateTime: top.strToDate($('#updateTime\\$').val()), |
| | | memo: $('#memo').val(), |
| | | areaType: $('#areaType').val() === "" ? null : $('#areaType').val(), |
| | | }; |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl+"/locArea/"+name+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | parent.$(".layui-laypage-btn")[0].click(); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 复选框事件 |
| | | form.on('checkbox(detailCheckbox)', function (data) { |
| | | var el = data.elem; |
| | | if (el.checked) { |
| | | $(el).val('Y'); |
| | | } else { |
| | | $(el).val('N'); |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | if (find[0]!=null){ |
| | | if (find[0].type === 'checkbox'){ |
| | | if (data[val]==='Y'){ |
| | | find.attr("checked","checked"); |
| | | find.val('Y'); |
| | | } else { |
| | | find.remove("checked"); |
| | | find.val('N'); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.8); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | } |
| | | // 更新物料状态 |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/getAllLocDetlData?loc_no=" + param.loc_no + "&matnr=" + param.matnr + "&matStatusFlag=" + param.matStatusFlag, |
| | | url: baseUrl+"/locDetl/getAllLocDetlData?loc_no=" + param.loc_no + "&matnr=" + param.matnr + "&mat_status=" + param.matStatusFlag, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // data: JSON.stringify(param), |
| | | dataType:'json', |
New file |
| | |
| | | // 关闭动作 |
| | | $(document).on('click', '#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var upload = layui.upload; |
| | | var form = layui.form; |
| | | |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl+"/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value="+item.id+">"+item.name+"</Option>"; |
| | | }); |
| | | } |
| | | $('#warehouse').append(html); |
| | | form.render('select'); |
| | | }, |
| | | }); |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null) { |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | // 数量输入校验 |
| | | var reg=/^\d{1,}$/ |
| | | var pattern=new RegExp(reg); |
| | | var anfme = $('#anfme').val(); |
| | | if (!pattern.test(anfme)) { |
| | | layer.msg("请输入正确的数量"); |
| | | return; |
| | | } |
| | | // loading加载效果 |
| | | var loadingIndex = layer.load(1, { |
| | | shade: [0.5,'#000'] |
| | | }); |
| | | // 表单入参 |
| | | var data = { |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | lgnum: $('#lgnum').val(), |
| | | type: $('#type').val(), |
| | | mnemonic: $('#mnemonic').val(), |
| | | supplier: $('#supplier').val(), |
| | | warehouse: $('#warehouse').val(), |
| | | brand: $('#brand').val(), |
| | | anfme: $('#anfme').val(), |
| | | altme: $('#altme').val(), |
| | | }; |
| | | // 请求保存接口 |
| | | $.ajax({ |
| | | url: baseUrl+"/locNomal/add/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | parent.tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg); |
| | | } |
| | | // 关闭loading加载效果 |
| | | layer.close(loadingIndex); |
| | | }, |
| | | }); |
| | | }); |
| | | }); |
New file |
| | |
| | | var pageCurr; |
| | | var locNormalList = []; |
| | | var locArea = []; |
| | | |
| | | function getCol() { |
| | | var cols = []; |
| | | cols.push( |
| | | {field: 'anfme', align: 'center', title: '数量', sort: true, edit: 'text'} |
| | | ) |
| | | cols.push.apply(cols, locNormalCols); |
| | | cols.push( |
| | | {field: 'warehouse', align: 'center', title: '库区'} |
| | | , {field: 'state', align: 'center', title: '出入库状态', templet: '#locNormalState'} |
| | | , {field: 'modiUser$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true} |
| | | , {field: 'appeTime$', align: 'center', title: '创建时间', hide: true} |
| | | , {field: '', align: 'center', title: '操作', width: 135, fixed: 'right', templet: '#operate'} |
| | | ); |
| | | return cols; |
| | | } |
| | | |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl+"/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.data && res.data.length > 0) { |
| | | locArea = res.data; |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | // 库区下拉 |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#putSiteSelect').append(html); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var upload = layui.upload; |
| | | |
| | | // 导入excel |
| | | var uploader = upload.render({ |
| | | elem: '#uploadEx' |
| | | , url: baseUrl + '/locNormal/import/auth' |
| | | , headers: {token: localStorage.getItem('token')} |
| | | , accept: 'file' |
| | | , exts: 'xls|excel|xlsx' |
| | | , auto: false |
| | | , bindAction: '#uploadDo' |
| | | , before: function (obj) { |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1, '#fff']}); |
| | | } |
| | | , choose: function (obj) { |
| | | $('#uploadDesc').hide(); |
| | | $('#uploadDemoView').show(); |
| | | obj.preview(function (index, file, result) { |
| | | $('#fileMame').html(file.name); |
| | | }); |
| | | } |
| | | , done: function (res) { |
| | | limit(); |
| | | $('#uploadDesc').show(); |
| | | $('#uploadDemoView').hide(); |
| | | $('#fileMame').html(""); |
| | | layer.closeAll('loading'); |
| | | layer.msg(res.msg); |
| | | tableReload(false); |
| | | } |
| | | , error: function (index, upload) { |
| | | layer.closeAll('loading'); |
| | | } |
| | | }); |
| | | |
| | | /* 导入 */ |
| | | table.on('toolbar(locNormal)', function (obj) { |
| | | switch (obj.event) { |
| | | // 导入 |
| | | case 'intoData': |
| | | layer.open({ |
| | | type: 1, |
| | | title: '数据导入', |
| | | shadeClose: true, |
| | | content: $('#importDataDiv'), |
| | | success: function (layero, index) { |
| | | uploader.reload(); |
| | | }, |
| | | end: function () { |
| | | $('#uploadDesc').show(); |
| | | $('#uploadDemoView').hide(); |
| | | $('#fileMame').html(""); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locNormal', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/locNomal/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | // 解析库区名称 |
| | | var records = res.data.records; |
| | | records.map(function (item) { |
| | | locArea.map(function (d) { |
| | | if (d.uuid == item.warehouse) { |
| | | item.warehouse = d.name; |
| | | } |
| | | }) |
| | | }); |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records, |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | limit(); |
| | | // 当前分页数据存储 |
| | | locNormalList = res.data; |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locNormal)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | limit(); |
| | | // 当前分页数据存储 |
| | | locNormalList = res.data; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(locNormal)', function (obj) { |
| | | var count = obj.value; |
| | | var matnr = obj.data.matnr; |
| | | var id = obj.data.id; |
| | | |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | // 数据重载 |
| | | tableIns.reload({ |
| | | data: locNormalList, done: function (res) { |
| | | limit(); |
| | | } |
| | | }); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i = 0; i < locNormalList.length; i++) { |
| | | if (locNormalList[i]["matnr"] === matnr) { |
| | | locNormalList[i]["anfme"] = count; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | // 请求更新接口完成数量的更新 |
| | | const param = { |
| | | matnr: matnr, |
| | | anfme: count, |
| | | id: id, |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | }, |
| | | }); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locNormal)', function (obj) { |
| | | var data = obj.data; |
| | | var param = { |
| | | matnr: data.matnr, |
| | | id: data.id, |
| | | } |
| | | switch (obj.event) { |
| | | case 'outLocNormal': |
| | | layer.confirm('确定要出库['+data.matnr+']吗?', { |
| | | btn: ['确定', '取消'] //可以无限个按钮 |
| | | }, function(index, layero){ |
| | | //确定回调-出库 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/outLoc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | tableReload(false); |
| | | layer.closeAll(); |
| | | layer.msg("出库成功"); |
| | | }, |
| | | }); |
| | | }, function(index){ |
| | | //按钮【按钮二】的回调 |
| | | }); |
| | | break; |
| | | case 'removeLocNormal': |
| | | // 移除 |
| | | layer.confirm('确定要移除['+data.matnr+']吗?', { |
| | | btn: ['确定', '取消'] //可以无限个按钮 |
| | | }, function(index, layero){ |
| | | //确定回调-移除 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/removeLoc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(param), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | tableReload(false); |
| | | layer.closeAll(); |
| | | layer.msg("移除成功"); |
| | | }, |
| | | }); |
| | | }, function(index){ |
| | | //按钮【按钮二】的回调 |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | |
| | | }); |
| | | |
| | | /* 表格数据重载 */ |
| | | 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); |
| | | // 当前分页数据存储 |
| | | locNormalList = res.data; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 监听回车事件 */ |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | | |
| | | // 提取物料 |
| | | var addLocNormalIdx; |
| | | |
| | | function addLocNormal() { |
| | | addLocNormalIdx = layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, '550px'], |
| | | shadeClose: true, |
| | | content: 'addLocNormal.html', |
| | | success: function (layero, index) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | var initCountVal = 0; |
| | | var matCodeData = []; |
| | | var index = 0; |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | // {type: 'checkbox', fixed: 'left'}, |
| | | { |
| | | fixed: 'left', |
| | | field: 'anfme', |
| | | title: '数量(必填)', |
| | | align: 'center', |
| | | edit: 'text', |
| | | width: 120, |
| | | style: 'color: blue;font-weight: bold' |
| | | } |
| | | ]; |
| | | locNormalCols.map(function (item) { |
| | | if (item.field === 'supplier') { |
| | | item.edit = 'text'; |
| | | } |
| | | }) |
| | | cols.push.apply(cols, locNormalCols); |
| | | // cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'}); |
| | | cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80}); |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | even: true, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | done: function (res, curr, count) { |
| | | $('td[data-field=count] div').html(initCountVal); |
| | | setMatCodeData(res.data); |
| | | limit(); |
| | | getInBound(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | if (obj.field === 'anfme') { |
| | | updateMatCodeData(obj.data.matnr, Number(obj.value), obj.data.index); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch (obj.event) { |
| | | case 'comb': |
| | | // 判断是否存在物料 |
| | | if (matCodeData.length === 0) { |
| | | layer.msg("请先添加物料"); |
| | | return; |
| | | } |
| | | // 判断物料数量是否存在异常 |
| | | for (var i = 0; i < matCodeData.length; i++) { |
| | | if (isNaN(matCodeData[i].anfme)) { |
| | | layer.msg("请输入数字"); |
| | | return; |
| | | } |
| | | if (matCodeData[i].anfme === 0) { |
| | | layer.msg("数量不能为零"); |
| | | return; |
| | | } |
| | | } |
| | | // 判断库区是否为空 |
| | | var warehouse = $('#putSiteSelect').val(); |
| | | if (!warehouse || warehouse === '') { |
| | | layer.msg("请选择库区"); |
| | | return; |
| | | } |
| | | // 入库数据赋值库区 |
| | | matCodeData.map(function (item) { |
| | | item.warehouse = warehouse; |
| | | }); |
| | | // 请求接口进行平仓入库 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/in", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: matCodeData, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("入库启动成功"); |
| | | matCodeData = []; |
| | | tableIns.reload({ |
| | | data: matCodeData, done: function (res) { |
| | | limit(); |
| | | getInBound(); |
| | | } |
| | | }); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = matCodeData.length - 1; i >= 0; i--) { |
| | | if (matCodeData[i].matnr === data.matnr && matCodeData[i].index === data.index) { |
| | | matCodeData.splice(i, 1); |
| | | } |
| | | } |
| | | tableIns.reload({ |
| | | data: matCodeData, |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | function setMatCodeData(data) { |
| | | matCodeData = data; |
| | | for (var i = 0; i < matCodeData.length; i++) { |
| | | matCodeData[i]["count"] = initCountVal; |
| | | } |
| | | } |
| | | |
| | | function updateMatCodeData(matnr, count, index) { |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | for (var i = 0; i < matCodeData.length; i++) { |
| | | if (matCodeData[i]["matnr"] === matnr && matCodeData[i]["index"] === index) { |
| | | matCodeData[i]["anfme"] = count; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | |
| | | tableIns.reload({ |
| | | data: matCodeData, |
| | | }); |
| | | } |
| | | |
| | | // 获取可用入库站点 |
| | | function getInBound() { |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#putSiteSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | // 提取物料 |
| | | var matCodeLayerIdx; |
| | | function getMat() { |
| | | matCodeLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '提取物料', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../pakStore/matQuery.html', |
| | | success: function (layero, index) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | // 数据格式转换 |
| | | var newData = []; |
| | | data.map(function (item) { |
| | | newData.push({ |
| | | matnr: item.matNo, |
| | | maktx: item.matName, |
| | | lgnum: item.str3, |
| | | type: item.str2, |
| | | supplier: item.str6, |
| | | warehouse: item.str7, |
| | | brand: item.str8, |
| | | altme: item.str1, |
| | | state: 1, // 入库状态 |
| | | anfme: 0, |
| | | index: index, |
| | | }); |
| | | }); |
| | | index++; |
| | | |
| | | for (var i = 0; i < newData.length; i++) { |
| | | let pass = false; |
| | | for (var j = 0; j < matCodeData.length; j++) { |
| | | if (newData[i].matnr === matCodeData[j].matNo) { |
| | | pass = true; |
| | | break; |
| | | } |
| | | } |
| | | if (pass) { |
| | | newData.splice(i--, 1); |
| | | } else { |
| | | newData[i]["count"] = initCountVal; |
| | | } |
| | | } |
| | | matCodeData.push.apply(matCodeData, newData); |
| | | tableIns.reload({data: matCodeData}); |
| | | layer.close(matCodeLayerIdx); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | var tableMerge; |
| | | var orderData; |
| | | var outStockDetail; |
| | | |
| | | function getCol() { |
| | | var cols = []; |
| | | cols.push( |
| | | {field: 'fbillNo', merge: true, align: 'center', title: '单据编号'} |
| | | , {field: 'fnumber', align: 'center', title: '物料编号'} |
| | | , {field: 'fentryID', align: 'center', title: '分录号'} |
| | | , {field: 'forderInterID', align: 'center', title: '销售订单单号'} |
| | | , {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: '地址'} |
| | | , {fixed: 'right', merge: ['fbillNo'], title: '操作', align: 'center', toolbar: '#operate', width: 80} |
| | | ); |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var upload = layui.upload; |
| | | tableMerge = layui.tableMerge; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#salesOrder', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/outStock/query/list', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | layui.tableMerge.render(this); |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | , type: 'datetime' |
| | | , range: true |
| | | }); |
| | | |
| | | table.on('tool(salesOrder)', function (obj) { |
| | | var data = obj.data; //获得当前行数据 |
| | | var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值) |
| | | orderData = data; |
| | | // 如果是点击操作按钮 |
| | | if (layEvent == 'btnOut') { |
| | | outStockDetail = layer.open( |
| | | { |
| | | type: 2, |
| | | title: '选择出库-单据编号[' + orderData.fbillNo + ']', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'outStockDetail.html', |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | function getOrderData() { |
| | | return orderData; |
| | | } |
| | | |
| | | /* 表格数据重载 */ |
| | | 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; |
| | | tableMerge.render(this); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 关闭明细 */ |
| | | function closeDetail(msg) { |
| | | layer.close(outStockDetail); |
| | | layer.msg(msg); |
| | | } |
| | | |
| | | /* 监听回车事件 */ |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | style: 'color: blue;font-weight: bold' |
| | | } |
| | | ]; |
| | | matCols.map(function (item) { |
| | | if (item.field === 'str6') { |
| | | item.edit = 'text'; |
| | | item.style = 'color: blue;font-weight: bold'; |
| | | } |
| | | }) |
| | | cols.push.apply(cols, matCols); |
| | | cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'}); |
| | | cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80}); |
| | |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateMatCodeData(obj.data.matNo, Number(obj.value)); |
| | | if (obj.field === 'count') { |
| | | updateMatCodeData(obj.data.matNo, Number(obj.value)); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
New file |
| | |
| | | var pageCurr; |
| | | |
| | | function getCol() { |
| | | var cols = []; |
| | | cols.push( |
| | | {field: 'orderCode', align: 'center', title: '订单编号'} |
| | | , {field: 'orderDate', align: 'center', title: '订单日期'} |
| | | , {field: 'invCode', align: 'center', title: '物料编码'} |
| | | , {field: 'invName', align: 'center', title: '物料名称'} |
| | | , {field: 'invStd', align: 'center', title: '规格型号'} |
| | | , {field: 'invUnit', align: 'center', title: '单位'} |
| | | , {field: 'orderQty', align: 'center', title: '订单数量'} |
| | | , {field: 'izMrp', align: 'center', title: '是否mrp计算', hide: true} |
| | | , {field: 'productQty', align: 'center', title: '生产任务单数量'} |
| | | , {field: 'izReceive', align: 'center', title: '是否收料', hide: true} |
| | | , {field: 'inQty', align: 'center', title: '产成品入库数量'} |
| | | , {field: 'outQty', align: 'center', title: '发货数量'} |
| | | , {fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80} |
| | | ); |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var upload = layui.upload; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#salesOrder', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | // url: baseUrl+'/matCode/list/auth', |
| | | data: [ |
| | | { |
| | | "orderCode": 20210315000001, |
| | | "orderDate": "2021-03-26 13:40", |
| | | "invCode": "CPXXX00123", |
| | | "invName": "兰博基尼授权儿童车", |
| | | "invStd": "21×25", |
| | | "invUnit": "辆", |
| | | "orderQty": 300, |
| | | "izMrp": "否", |
| | | "productQty": 150, |
| | | "izReceive": "是", |
| | | "inQty": 50, |
| | | "outQty": 0, |
| | | } |
| | | ], |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | , type: 'datetime' |
| | | , range: true |
| | | }); |
| | | }); |
| | | |
| | | /* 表格数据重载 */ |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | |
| | | console.log('搜索内容', searchData); |
| | | |
| | | // (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); |
| | | // // 当前分页数据存储 |
| | | // locNormalList = res.data; |
| | | // } |
| | | // }); |
| | | } |
| | | |
| | | /* 监听回车事件 */ |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | return html; |
| | | }} |
| | | ,{field: 'ioStatus', align: 'center',title: '入出状态', templet:function(row){ |
| | | var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='运行中|待处理' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='已处理|待处理' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.ioStatus === 'Y'){html += " checked ";} |
| | | html += ">"; |
| | | return html; |
New file |
| | |
| | | /** |
| | | * Created by YujieYang. |
| | | * @name: 子表格扩展 |
| | | * @author: 杨玉杰 |
| | | * @version 1.0 |
| | | */ |
| | | layui.define(['table'], function (exports) { |
| | | |
| | | var $ = layui.jquery; |
| | | |
| | | // 封装方法 |
| | | var mod = { |
| | | /** |
| | | * 渲染入口 |
| | | * @param myTable |
| | | */ |
| | | render: function (myTable) { |
| | | var tableBox = $(myTable.elem).next().children('.layui-table-box'), |
| | | $main = $(tableBox.children('.layui-table-body').children('table').children('tbody').children('tr').toArray().reverse()), |
| | | $fixLeft = $(tableBox.children('.layui-table-fixed-l').children('.layui-table-body').children('table').children('tbody').children('tr').toArray().reverse()), |
| | | $fixRight = $(tableBox.children('.layui-table-fixed-r').children('.layui-table-body').children('table').children('tbody').children('tr').toArray().reverse()), |
| | | cols = myTable.cols[0], mergeRecord = {}; |
| | | |
| | | for (let i = 0; i < cols.length; i++) { |
| | | var item3 = cols[i], field=item3.field; |
| | | if (item3.merge) { |
| | | var mergeField = [field]; |
| | | if (item3.merge !== true) { |
| | | if (typeof item3.merge == 'string') { |
| | | mergeField = [item3.merge] |
| | | } else { |
| | | mergeField = item3.merge |
| | | } |
| | | } |
| | | mergeRecord[i] = {mergeField: mergeField, rowspan:1} |
| | | } |
| | | } |
| | | |
| | | $main.each(function (i) { |
| | | |
| | | for (var item in mergeRecord) { |
| | | if (i==$main.length-1 || isMaster(i, item)) { |
| | | $(this).children('[data-key$="-'+item+'"]').attr('rowspan', mergeRecord[item].rowspan).css('position','static'); |
| | | $fixLeft.eq(i).children('[data-key$="-'+item+'"]').attr('rowspan', mergeRecord[item].rowspan).css('position','static'); |
| | | $fixRight.eq(i).children('[data-key$="-'+item+'"]').attr('rowspan', mergeRecord[item].rowspan).css('position','static'); |
| | | mergeRecord[item].rowspan = 1; |
| | | } else { |
| | | $(this).children('[data-key$="-'+item+'"]').remove(); |
| | | $fixLeft.eq(i).children('[data-key$="-'+item+'"]').remove(); |
| | | $fixRight.eq(i).children('[data-key$="-'+item+'"]').remove(); |
| | | mergeRecord[item].rowspan +=1; |
| | | } |
| | | } |
| | | }) |
| | | |
| | | function isMaster (index, item) { |
| | | var mergeField = mergeRecord[item].mergeField; |
| | | var dataLength = layui.table.cache[myTable.id].length; |
| | | for (var i=0; i<mergeField.length; i++) { |
| | | |
| | | if (layui.table.cache[myTable.id][dataLength-2-index][mergeField[i]] |
| | | !== layui.table.cache[myTable.id][dataLength-1-index][mergeField[i]]) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | }; |
| | | |
| | | // 输出 |
| | | exports('tableMerge', mod); |
| | | }); |
| | | |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
| | | <link rel="icon" type="image/x-icon" href="../static/image/log.png" /> |
| | | <link rel="stylesheet" href="../static/layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../static/layuiadmin/style/admin.css" media="all"> |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/layuiadmin/layui/layui.js"></script> |
| | | <style> |
| | | .layui-layout-admin .layui-footer { |
| | | box-sizing: border-box; |
| | | background-color: #fff; |
| | | z-index: 999; |
| | | height: 30px; |
| | | padding: 0; |
| | | font-size: 13px; |
| | | margin: 0; |
| | | line-height: 30px; |
| | | } |
| | | .layui-layout-admin .layui-footer a { |
| | | color: #3573ab; |
| | | font-weight: bold |
| | | } |
| | | <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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
| | | <link rel="icon" type="image/x-icon" href="../static/image/log.png"/> |
| | | <link rel="stylesheet" href="../static/layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../static/layuiadmin/style/admin.css" media="all"> |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/layuiadmin/layui/layui.js"></script> |
| | | <style> |
| | | .layui-layout-admin .layui-footer { |
| | | box-sizing: border-box; |
| | | background-color: #fff; |
| | | z-index: 999; |
| | | height: 30px; |
| | | padding: 0; |
| | | font-size: 13px; |
| | | margin: 0; |
| | | line-height: 30px; |
| | | } |
| | | |
| | | .layui-layout-admin .layui-logo { |
| | | letter-spacing: 2px; |
| | | font-size: 22px; |
| | | height: 110px; |
| | | padding: 20px 10px; |
| | | font-weight: bolder; |
| | | /*color: #2c7dc2;*/ |
| | | color: #f3f3f3; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | } |
| | | .layadmin-side-shrink .layui-layout-admin .layui-logo { |
| | | background-image: none; |
| | | } |
| | | .layui-side-menu .layui-nav { |
| | | margin-top: 110px; |
| | | } |
| | | </style> |
| | | .layui-layout-admin .layui-footer a { |
| | | color: #3573ab; |
| | | font-weight: bold |
| | | } |
| | | |
| | | .layui-layout-admin .layui-logo { |
| | | letter-spacing: 2px; |
| | | font-size: 22px; |
| | | height: 110px; |
| | | padding: 20px 10px; |
| | | font-weight: bolder; |
| | | /*color: #2c7dc2;*/ |
| | | color: #f3f3f3; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | } |
| | | |
| | | .layadmin-side-shrink .layui-layout-admin .layui-logo { |
| | | background-image: none; |
| | | } |
| | | |
| | | .layui-side-menu .layui-nav { |
| | | margin-top: 110px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body class="layui-layout-body"> |
| | | |
| | | <div id="LAY_app"> |
| | | <div id="LAY_app"> |
| | | <div class="layui-layout layui-layout-admin"> |
| | | <div class="layui-header"> |
| | | <!-- 头部区域 --> |
| | | <ul id="cool-header-left" class="layui-nav layui-layout-left"> |
| | | <li class="layui-nav-item layadmin-flexible" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩"> |
| | | <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i> |
| | | </a> |
| | | </li> |
| | | <!--<li class="layui-nav-item layui-hide-xs" lay-unselect>--> |
| | | <!--<a lay-href="report/viewLocMap.html?resourceId=10286" title="Map">--> |
| | | <!--<i class="layui-icon layui-icon-website"></i>--> |
| | | <!--</a>--> |
| | | <!--</li>--> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="refresh" title="刷新"> |
| | | <i class="layui-icon layui-icon-refresh-3"></i> |
| | | </a> |
| | | </li> |
| | | <!--<li class="layui-nav-item layui-hide-xs" lay-unselect>--> |
| | | <!--<input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search" layadmin-event="serach" lay-action="template/search.html?keywords=">--> |
| | | <!--</li>--> |
| | | </ul> |
| | | <ul id="cool-header-right" class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right"> |
| | | |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="theme"> |
| | | <i class="layui-icon layui-icon-theme"></i> |
| | | </a> |
| | | </li> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a id="activation-icon" href="javascript:;" layadmin-event="note"> |
| | | <i class="layui-icon layui-icon-note"></i> |
| | | </a> |
| | | </li> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="fullscreen"> |
| | | <i class="layui-icon layui-icon-screen-full"></i> |
| | | </a> |
| | | </li> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a href="javascript:;"> |
| | | <cite id="person-username">管理员</cite> |
| | | </a> |
| | | <dl class="layui-nav-child"> |
| | | <dd><a lay-href="detail.html">基本资料</a></dd> |
| | | <!--<dd><a lay-href="set/user/password.html">修改密码</a></dd>--> |
| | | <hr> |
| | | <dd style="text-align: center;"><a id="logout" href="/">退出</a></dd> |
| | | </dl> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | |
| | | <!-- 侧边菜单 --> |
| | | <div class="layui-side layui-side-menu"> |
| | | <div class="layui-side-scroll"> |
| | | <div class="layui-logo" lay-href="home/console.html"> |
| | | <img src="../static/image/logo.png" style="display: inline-block; width: 90%;height: auto"> |
| | | <span style="margin-top: 0">中扬立库</span> |
| | | </div> |
| | | <div class="layui-header"> |
| | | <!-- 头部区域 --> |
| | | <ul id="cool-header-left" class="layui-nav layui-layout-left"> |
| | | <li class="layui-nav-item layadmin-flexible" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩"> |
| | | <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i> |
| | | </a> |
| | | </li> |
| | | <!--<li class="layui-nav-item layui-hide-xs" lay-unselect>--> |
| | | <!--<a lay-href="report/viewLocMap.html?resourceId=10286" title="Map">--> |
| | | <!--<i class="layui-icon layui-icon-website"></i>--> |
| | | <!--</a>--> |
| | | <!--</li>--> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="refresh" title="刷新"> |
| | | <i class="layui-icon layui-icon-refresh-3"></i> |
| | | </a> |
| | | </li> |
| | | <!--<li class="layui-nav-item layui-hide-xs" lay-unselect>--> |
| | | <!--<input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search" layadmin-event="serach" lay-action="template/search.html?keywords=">--> |
| | | <!--</li>--> |
| | | </ul> |
| | | <ul id="cool-header-right" class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right"> |
| | | |
| | | <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu"> |
| | | </ul> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="theme"> |
| | | <i class="layui-icon layui-icon-theme"></i> |
| | | </a> |
| | | </li> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a id="activation-icon" href="javascript:;" layadmin-event="note"> |
| | | <i class="layui-icon layui-icon-note"></i> |
| | | </a> |
| | | </li> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a href="javascript:;" layadmin-event="fullscreen"> |
| | | <i class="layui-icon layui-icon-screen-full"></i> |
| | | </a> |
| | | </li> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a href="javascript:;"> |
| | | <cite id="person-username">管理员</cite> |
| | | </a> |
| | | <dl class="layui-nav-child"> |
| | | <dd><a lay-href="detail.html">基本资料</a></dd> |
| | | <!--<dd><a lay-href="set/user/password.html">修改密码</a></dd>--> |
| | | <hr> |
| | | <dd style="text-align: center;"><a id="logout" href="/">退出</a></dd> |
| | | </dl> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!-- 页面标签 --> |
| | | <div class="layadmin-pagetabs" id="LAY_app_tabs"> |
| | | <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div> |
| | | <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div> |
| | | <div class="layui-icon layadmin-tabs-control layui-icon-down"> |
| | | <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav"> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a href="javascript:;"></a> |
| | | <dl class="layui-nav-child layui-anim-fadein"> |
| | | <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd> |
| | | <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd> |
| | | <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd> |
| | | </dl> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs"> |
| | | <ul class="layui-tab-title" id="LAY_app_tabsheader"> |
| | | <li lay-id="home/console.html" lay-attr="home/console.html" class="layui-this"><i class="layui-icon layui-icon-home"></i></li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 主体内容 --> |
| | | <div class="layui-body" id="LAY_app_body"> |
| | | <div class="layadmin-tabsbody-item layui-show"> |
| | | <iframe src="home/console.html" frameborder="0" class="layadmin-iframe"></iframe> |
| | | </div> |
| | | </div> |
| | | <!-- 侧边菜单 --> |
| | | <div class="layui-side layui-side-menu"> |
| | | <div class="layui-side-scroll"> |
| | | <div class="layui-logo" lay-href="home/console.html"> |
| | | <img src="../static/image/logo.png" style="display: inline-block; width: 90%;height: auto"> |
| | | <span style="margin-top: 0">中扬立库</span> |
| | | </div> |
| | | |
| | | <div class="layui-footer"> |
| | | Copyright © 2015 All Rights Reserved. <a href="http://www.zoneyung.com" target="_blank">浙江中扬立库技术有限公司</a> 保留所有权利 |
| | | </div> |
| | | <!-- 辅助元素,一般用于移动设备下遮罩 --> |
| | | <div class="layadmin-body-shade" layadmin-event="shade"></div> |
| | | <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" |
| | | lay-filter="layadmin-system-side-menu"> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!-- 页面标签 --> |
| | | <div class="layadmin-pagetabs" id="LAY_app_tabs"> |
| | | <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div> |
| | | <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div> |
| | | <div class="layui-icon layadmin-tabs-control layui-icon-down"> |
| | | <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav"> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a href="javascript:;"></a> |
| | | <dl class="layui-nav-child layui-anim-fadein"> |
| | | <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd> |
| | | <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd> |
| | | <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd> |
| | | </dl> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs"> |
| | | <ul class="layui-tab-title" id="LAY_app_tabsheader"> |
| | | <li lay-id="home/console.html" lay-attr="home/console.html" class="layui-this"><i |
| | | class="layui-icon layui-icon-home"></i></li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 主体内容 --> |
| | | <div class="layui-body" id="LAY_app_body"> |
| | | <div class="layadmin-tabsbody-item layui-show"> |
| | | <iframe src="home/console.html" frameborder="0" class="layadmin-iframe"></iframe> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-footer"> |
| | | Copyright © 2015 All Rights Reserved. <a href="http://www.zoneyung.com" target="_blank">浙江中扬立库技术有限公司</a> |
| | | 保留所有权利 |
| | | </div> |
| | | <!-- 辅助元素,一般用于移动设备下遮罩 --> |
| | | <div class="layadmin-body-shade" layadmin-event="shade"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script> |
| | | layui.config({ |
| | | base: '../static/layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index','element'], function () { |
| | | var element = layui.element; |
| | | var $ = layui.jquery; |
| | | <script> |
| | | layui.config({ |
| | | base: '../static/layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index', //主入口模块 |
| | | tableMerge: 'tableMerge', |
| | | }).use(['index', 'element', 'tableMerge'], function () { |
| | | var element = layui.element; |
| | | var $ = layui.jquery; |
| | | |
| | | // 替换退出按钮变量 |
| | | var logout = document.getElementById('logout'); |
| | | var url = logout.getAttribute('href'); |
| | | logout.setAttribute('href', baseUrl + url); |
| | | // 替换退出按钮变量 |
| | | var logout = document.getElementById('logout'); |
| | | var url = logout.getAttribute('href'); |
| | | logout.setAttribute('href', baseUrl + url); |
| | | |
| | | $('#person-username').text(localStorage.getItem('username')); |
| | | $('#person-username').text(localStorage.getItem('username')); |
| | | |
| | | $(function () { |
| | | if ("" === localStorage.getItem('token')){ |
| | | top.location.href = baseUrl+"/login"; |
| | | } |
| | | |
| | | // 激活码验证 |
| | | $.ajax({ |
| | | url: baseUrl+"/system/activation/auth", |
| | | dataType:'json', |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | $("#activation-icon").hide(); |
| | | } else { |
| | | $("#activation-icon").click(); |
| | | } |
| | | $(function () { |
| | | if ("" === localStorage.getItem('token')) { |
| | | top.location.href = baseUrl + "/login"; |
| | | } |
| | | }); |
| | | |
| | | getMenu() |
| | | |
| | | // 注销 |
| | | $(document).on('click','#logout',function () { |
| | | localStorage.removeItem("token"); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 加载菜单 |
| | | function getMenu() { |
| | | $.ajax({ |
| | | url: baseUrl+ "/menu/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var menuHtml = ""; |
| | | if (res.data != null){ |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | menuHtml += '<li data-name="' + res.data[i].menuCode +'" class="layui-nav-item">\n'; |
| | | menuHtml += '<a href="javascript:;" lay-tips=' +res.data[i].menu+ ' lay-direction="2">\n'; |
| | | menuHtml += '<i class="layui-icon '+ res.data[i].menuIcon +'"></i>\n'; |
| | | menuHtml += ' <cite>' +res.data[i].menu+ '</cite>\n'; |
| | | menuHtml += '</a>\n'; |
| | | menuHtml += '<dl class="layui-nav-child">\n'; |
| | | for (var j = 0; j < res.data[i].subMenu.length; j++) { |
| | | menuHtml += '<dd><a lay-href="' +res.data[i].subMenu[j].code+ '?resourceId='+ res.data[i].subMenu[j].id + '">' + res.data[i].subMenu[j].name + '</a></dd>\n'; |
| | | } |
| | | menuHtml += '</dl>\n'; |
| | | menuHtml += '</li>\n'; |
| | | // 激活码验证 |
| | | $.ajax({ |
| | | url: baseUrl + "/system/activation/auth", |
| | | dataType: 'json', |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | $("#activation-icon").hide(); |
| | | } else { |
| | | $("#activation-icon").click(); |
| | | } |
| | | } |
| | | } |
| | | $('#LAY-system-side-menu').append(menuHtml); |
| | | element.init(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/login"; |
| | | }else { |
| | | layer.alert(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | |
| | | getMenu() |
| | | |
| | | // 注销 |
| | | $(document).on('click', '#logout', function () { |
| | | localStorage.removeItem("token"); |
| | | }); |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | // 加载菜单 |
| | | function getMenu() { |
| | | $.ajax({ |
| | | url: baseUrl + "/menu/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var menuHtml = ""; |
| | | if (res.data != null) { |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | menuHtml += '<li data-name="' + res.data[i].menuCode + '" class="layui-nav-item">\n'; |
| | | menuHtml += '<a href="javascript:;" lay-tips=' + res.data[i].menu + ' lay-direction="2">\n'; |
| | | menuHtml += '<i class="layui-icon ' + res.data[i].menuIcon + '"></i>\n'; |
| | | menuHtml += ' <cite>' + res.data[i].menu + '</cite>\n'; |
| | | menuHtml += '</a>\n'; |
| | | menuHtml += '<dl class="layui-nav-child">\n'; |
| | | for (var j = 0; j < res.data[i].subMenu.length; j++) { |
| | | menuHtml += '<dd><a lay-href="' + res.data[i].subMenu[j].code + '?resourceId=' + res.data[i].subMenu[j].id + '">' + res.data[i].subMenu[j].name + '</a></dd>\n'; |
| | | } |
| | | menuHtml += '</dl>\n'; |
| | | menuHtml += '</li>\n'; |
| | | } |
| | | } |
| | | $('#LAY-system-side-menu').append(menuHtml); |
| | | element.init(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/login"; |
| | | } else { |
| | | layer.alert(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="uuid" placeholder="库区编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="name" placeholder="库区名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="locArea" lay-filter="locArea"></table> |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locArea/locArea.js" charset="utf-8"></script> |
| | | |
| | | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> |
| | | |
| | | </body> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/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"> |
| | | <div class="layui-inline" style="width:31%; display: none"> |
| | | <label class="layui-form-label">ID:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="id" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">库区编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="uuid" class="layui-input" onkeyup="check(this.id, 'locArea')" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">库区名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="name" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">状 态:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="status"> |
| | | <option value="" style="display: none"></option> |
| | | <option value="1">正常</option> |
| | | <option value="0">禁用</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">库区类型:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="areaType"> |
| | | <option value="0">无</option> |
| | | <option value="1">材料仓库</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">备 注:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="memo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <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> |
| | | |
| | | <div id="prompt"> |
| | | 温馨提示:请仔细填写相关信息,<span class="extrude"><span class="not-null">*</span> 为必填选项。</span> |
| | | </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/locArea/locArea.js" charset="utf-8"></script> |
| | | </html> |
| | | |
| | |
| | | <div class="layui-inline"> |
| | | <select id="matStatusSelect" name="mat_status"> |
| | | <option value="">请选择物料状态</option> |
| | | <option value="0">待检</option> |
| | | <option value="1">良品</option> |
| | | <option value="2">不良品</option> |
| | | </select> |
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> |
| | | <style> |
| | | </style> |
| | | <body> |
| | | |
| | | <!-- 详情 --> |
| | | <div id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form"> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>物料编码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="matnr" class="layui-input" type="text" onkeyup="check(this.id, 'matnr')" |
| | | lay-verify="required" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">物料名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="maktx" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">规格:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="lgnum" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">类别:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="type" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">单据编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="mnemonic" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">通知单号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="supplier" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">库区:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="warehouse"> |
| | | <option value="" style="display: none"></option> |
| | | <option value="">请选择库区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">品牌:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="brand" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">数量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="anfme" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">单位:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="altme" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <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-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | <div id="prompt"> |
| | | 温馨提示:请仔细填写相关信息,<span class="extrude"><span class="not-null">*</span> 为必填选项。</span> |
| | | </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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/locNormal/addLocNormal.js" charset="utf-8"></script> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/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> |
| | | <style> |
| | | #search-box { |
| | | padding: 30px 30px 10px 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .btn-print { |
| | | display: none; |
| | | } |
| | | |
| | | #btn-print-batch { |
| | | display: none; |
| | | } |
| | | |
| | | .layui-btn-danger { |
| | | background-color: lightsalmon; |
| | | color: #333; |
| | | } |
| | | |
| | | /* ------------------------- 打印表格 ----------------------- */ |
| | | .template-preview { |
| | | height: 200px; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .contain { |
| | | } |
| | | |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*line-height: 46px;*/ |
| | | } |
| | | |
| | | .function-area { |
| | | padding: 15px 0 20px 40px; |
| | | } |
| | | |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 120px; |
| | | height: 40px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 1px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | </style> |
| | | <body> |
| | | <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="matnr" 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 class="layui-inline" style="width: 150px"> |
| | | <select id="matStatusSelect" name="state"> |
| | | <option value="">出入库状态</option> |
| | | <option value="1">已入库</option> |
| | | <option value="2">已出库</option> |
| | | </select> |
| | | </div> |
| | | <div class="layui-inline" style="width: 150px"> |
| | | <select id="putSiteSelect" name="warehouse"> |
| | | <option value="">请选择库区</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 功能区 --> |
| | | <!--<div class="function-area">--> |
| | | <!--<button id="mat-query" class="function-btn" onclick="addLocNormal()">新增库存</button>--> |
| | | <!--</div>--> |
| | | |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="locNormal" lay-filter="locNormal"></table> |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-locNormal-into" lay-event="intoData">导入</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 导入操作弹窗 --> |
| | | <div id="importDataDiv" style="display: none;padding: 20px 40px"> |
| | | <div class="layui-upload-drag" id="uploadEx" |
| | | style="width: 200px; font-size: x-small; padding: 10px; text-align: center; box-sizing: border-box"> |
| | | <div id="uploadDesc" style="display: inline-block; "> |
| | | <i class="layui-icon"></i> |
| | | <p>点击添加,或将文件拖拽到此处</p> |
| | | </div> |
| | | <div id="uploadDemoView" style="display: none"> |
| | | <img src="../../static/image/Excel.png" alt="上传成功后渲染" style="max-width: 196px; padding: 20px 0 10px 0"> |
| | | <span id="fileMame" style="display: block; font-size: small; color: #333"></span> |
| | | </div> |
| | | </div> |
| | | <div style="text-align: center; margin-top: 20px"> |
| | | <button class="layui-btn layui-btn-radius" id="uploadDo">开始导入</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格自定义列 --> |
| | | <script type="text/html" id="locNormalState"> |
| | | {{# if(d.state === '1'){ }} |
| | | <span style="color: green">已入库</span> |
| | | {{# } else if(d.state === '2'){ }} |
| | | <span style="color: red">已出库</span> |
| | | {{# } else { }} |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="locArea"> |
| | | {{ |
| | | locArea.map(function(item){ |
| | | if (d.warehouse == item.uuid) { |
| | | return item.name; |
| | | } |
| | | }); |
| | | }} |
| | | </script> |
| | | <script type="text/html" id="operate"> |
| | | {{# if(d.state === '1'){ }} |
| | | <button class="layui-btn layui-btn-xs layui-btn-normal" lay-event="outLocNormal">出库</button> |
| | | {{# } else { }} |
| | | <button class="layui-btn layui-btn-xs layui-btn-disabled">出库</button> |
| | | {{# } }} |
| | | <button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="removeLocNormal">移除</button> |
| | | </script> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/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 type="text/javascript" src="../../static/js/locNormal/locNormal.js"></script> |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | } |
| | | |
| | | .function-area { |
| | | padding: 20px 50px; |
| | | } |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 100px; |
| | | height: 50px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 2px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | letter-spacing: 3px; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | .layui-layer-page .layui-layer-content { |
| | | position: relative; |
| | | overflow: visible !important; |
| | | } |
| | | |
| | | #staNoSpan { |
| | | text-align: center; |
| | | display: inline-block; |
| | | width: 100px; |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-form-select { |
| | | display: inline-block; |
| | | width: 150px; |
| | | height: 30px; |
| | | } |
| | | .layui-btn-container .layui-form-select.layui-form-selected { |
| | | display: inline-block; |
| | | width: 150px; |
| | | } |
| | | .layui-btn-container .layui-select-title input { |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-anim.layui-anim-upbit dd { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | #btn-locIn { |
| | | margin-left: 60px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 功能区 --> |
| | | <div class="function-area"> |
| | | <button id="mat-query" class="function-btn" onclick="getMat()">新增</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <!-- 表格 --> |
| | | <div style="padding-bottom: 5px; margin-bottom: 45px"> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container" style="margin-bottom: 8px"> |
| | | <!-- 1.选择入库口 --> |
| | | <span id="staNoSpan">库区:</span> |
| | | <select id="putSiteSelect" lay-verify="required"> |
| | | <option value="">请选择库区</option> |
| | | </select> |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-normal layui-btn-lg" id="btn-locIn" lay-event="comb">启动入库</button> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/locNormal/locNormalIn.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="putSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | <script type="text/html" id="matStatus"> |
| | | {{ d.matStatus == '1' ? '<span style="color: green">良品</span>' : '<span style="color: red">不良品</span>' }} |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | <input class="layui-input" type="text" name="lgnum" placeholder="规格" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px;"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <br /> |
| | | <div class="layui-inline" style="margin-left: 30px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="supplier" placeholder="通知单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px;margin-left: 30px"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | <input class="layui-input" type="text" name="warehouse" placeholder="生产单号" autocomplete="off"> |
| | | </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"> |
| | | <link rel="stylesheet" href="../../static/css/print.css" media="all"> |
| | | </head> |
| | | <style> |
| | | #search-box { |
| | | padding: 30px 30px 10px 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*line-height: 46px;*/ |
| | | } |
| | | |
| | | </style> |
| | | <body> |
| | | |
| | | <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="FBillNo" placeholder="请输入单据编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<!– 日期范围 –>--> |
| | | <!--<div class="layui-inline" style="width: 300px">--> |
| | | <!--<div class="layui-input-inline">--> |
| | | <!--<input class="layui-input layui-laydate-range" name="orderTime" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">--> |
| | | <!--</div>--> |
| | | <!--</div>--> |
| | | |
| | | |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="salesOrder" lay-filter="salesOrder"></table> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="btnOut">出库</button> |
| | | </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/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 type="text/javascript" src="../../static/layuiadmin/modules/tableMerge.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/outStock.js"></script> |
| | | |
| | | </body> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/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: 8px"> |
| | | <span id="staNoSpan">出库口:</span> |
| | | <div style="display: inline-block; width: 200px"> |
| | | <select id="staNoSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | </div> |
| | | <button class="layui-btn layui-btn-sm" style="display: inline-block" id="btn-outbound" lay-event="outbound" |
| | | onclick="outbound()">启动出库 |
| | | </button> |
| | | </div> |
| | | <table class="layui-hide" id="stockOut" lay-filter="stockOut"></table> |
| | | </div> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{siteId}}">{{desc}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | </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 form; |
| | | |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: '', align: 'center', title: '', width: 50, type: 'numbers'} |
| | | , {field: 'locNo$', align: 'center', title: '库位号'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | form = layui.form; |
| | | // 数据渲染 |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/outStock/query/locList?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; |
| | | } |
| | | }); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/available/take/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | /* 启动出库 */ |
| | | function outbound() { |
| | | if (locData.length == 0) { |
| | | layer.msg('请先添加库位物料'); |
| | | return; |
| | | } else { |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | var locDetls = []; |
| | | locData.forEach(function(elem) { |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.anfme}); |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | | locDetls: locDetls, |
| | | fbillNo: orderData.fbillNo, |
| | | } |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/outStock/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | 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) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <label class="layui-form-label">托盘码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div style="margin: 5px 5px"> |
| | |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" style="margin-left: 20px">组托</button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" style="margin-left: 20px">返回</button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | width: 320, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'mnemonic', align: 'center', title: '生产单号'}, |
| | | {field: 'count', align: 'center', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | |
| | | type: 2, |
| | | title: '提取物料', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '80%'], |
| | | area: ['90%', '90%'], |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | |
| | | width: 50px; |
| | | padding: 0; |
| | | } |
| | | |
| | | #confirm { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | #remove { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | color: darkred; |
| | | } |
| | | |
| | | .form-box span { |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | } |
| | | |
| | | .form-box input { |
| | | width: 165px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline" style="margin-top: 5px"> |
| | | <label class="layui-form-label">单号</label> |
| | | <input class="layui-input" id="billNo" onkeyup="find(this)" placeholder="扫码 / 输入" autocomplete="off" style="width: 75%; height: 40px; margin-right: 0;"> |
| | | <label class="layui-form-label" style="margin-left: 16px">单号</label> |
| | | <input class="layui-input" id="billNo" oninput="find(this)" placeholder="扫码 / 输入" autocomplete="off" |
| | | style="width: 175px; height: 40px; margin-right: 0;"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">托盘码</label> |
| | | <input class="layui-input" style="width: 175px;" type="number" id="code" onkeyup="findCode(this)" |
| | | oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | </header> |
| | | |
| | |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" style="margin-left: 20px">组托</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" |
| | | style="margin-left: 20px">组托 |
| | | </button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" |
| | | style="margin-left: 20px">返回 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; text-align: center;padding-top: 10px"> |
| | | <div class="form-item"> |
| | | <span>物料</span> |
| | | <input id="matNo" type="text" disabled="disabled" style="width: 70%"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>名称</span> |
| | | <input id="matName" type="text" disabled="disabled" style="width: 70%"> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">物料</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matNo" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="3" style="resize: none; width: 165px" id="matName" type="text" disabled="disabled" |
| | | readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">单号</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="mnemonic" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <div class="form-item" style="margin-top: 5px"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button><input id="count" type="number"><button onclick="add()">+</button> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | |
| | | </body> |
| | | <script> |
| | | window.onload = function(){document.getElementById("code").focus();} |
| | | window.onload = function () { |
| | | document.getElementById("billNo").focus(); |
| | | } |
| | | var tableIns; |
| | | var countLayer; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | width: 320, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', event: 'modify', style:'cursor: pointer;color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | {field: 'matNo', align: 'center', title: '物料编码',event: 'modify',}, |
| | | {field: 'mnemonic', align: 'center', title: '生产单号',event: 'modify',}, |
| | | { |
| | | align: 'center', |
| | | field: 'count', |
| | | title: '数量', |
| | | event: 'modify', |
| | | style: 'cursor: pointer;color: blue', |
| | | width: 50 |
| | | }, |
| | | {field: 'matName', align: 'center', title: '物料名称',event: 'modify',} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj) { |
| | | table.on('tool(chooseData)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'modify': |
| | |
| | | offset: '20px', |
| | | title: '修改数量', |
| | | shadeClose: true, |
| | | area: ['80%', '200px'], |
| | | area: ['80%', '300px'], |
| | | content: $("#modify"), |
| | | success: function (layero, index) { |
| | | $('#matNo').val(data.matNo); |
| | | $('#matName').val(data.matName); |
| | | $('#count').val(data.count); |
| | | $('#mnemonic').val(data.mnemonic); |
| | | maxCount = data.count; |
| | | } |
| | | }); |
| | |
| | | }); |
| | | |
| | | function findCode(el) { |
| | | if (el.value.length === 7) { |
| | | $('#billNo').focus(); |
| | | } |
| | | // if (el.value.length === 7) { |
| | | // $('#code').focus(); |
| | | // } |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | var toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data[i].matNo === matData[j].matNo) { |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (data[i].matNo === matData[j].matNo && data[i].mnemonic === matData[j].mnemonic) { |
| | | matData[j].count = Number(matData[j].count) + Number(data[i].count); |
| | | toPush = false; |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | $("#comb-btn").focus(); |
| | | // $("#comb-btn").focus(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据通知单号查询物料详情 |
| | | */ |
| | | function find(el){ |
| | | function find(el) { |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | var billNo = el.value.split(",")[0].split("=")[1]; |
| | | var billNo = el.value; |
| | | if (billNo.indexOf('=') > -1) { |
| | | billNo = billNo.split(",")[0].split("=")[1]; |
| | | } |
| | | if (isEmpty(billNo)) { |
| | | return; |
| | | } |
| | | // 赋值前清空表格 |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | /************************************* 数量 ****************************************/ |
| | | var countDom = $('#count'); |
| | | var minCount = 1; |
| | | var maxCount = 1; |
| | | |
| | | function add() { |
| | | if (countDom.val() >= maxCount) { |
| | | return; |
| | | } |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | |
| | | function reduce() { |
| | | if (countDom.val() <= minCount) { |
| | | return; |
| | |
| | | } |
| | | |
| | | // 修改数量 |
| | | function confirm(){ |
| | | function confirm() { |
| | | var matNo = $('#matNo').val(); |
| | | var count = $('#count').val(); |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (matNo === matData[j].matNo) { |
| | | var mnemonic = $("#mnemonic").val() === '' ? null : $("#mnemonic").val(); |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (matNo === matData[j].matNo && mnemonic === matData[j].mnemonic) { |
| | | if (count > maxCount || count < minCount) { |
| | | tips("数量不能超过范围", true); |
| | | return; |
| | |
| | | // 移除物料 |
| | | function remove() { |
| | | var matNo = $('#matNo').val(); |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (matNo === matData[j].matNo) { |
| | | var mnemonic = $("#mnemonic").val() === '' ? null : $("#mnemonic").val(); |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (matNo === matData[j].matNo && mnemonic === matData[j].mnemonic) { |
| | | matData.splice(j, 1); |
| | | } |
| | | } |
| | |
| | | layer.close(countLayer); |
| | | tips("移除成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 重置 |
| | |
| | | return; |
| | | } |
| | | var billNo = $('#billNo').val(); |
| | | var mnemonic = $('#mnemonic').val(); |
| | | $.ajax({ |
| | | url: baseUrl+"/mobile/comb/auth", |
| | | url: baseUrl + "/mobile/comb/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | combMats: matData, |
| | | billNo: billNo |
| | | billNo: billNo, |
| | | mnemonic: mnemonic, |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | |
| | | -webkit-box-sizing: border-box; |
| | | -moz-box-sizing: border-box; |
| | | } |
| | | |
| | | html { |
| | | height: 100%; |
| | | /*line-height: 1.5;*/ |
| | | } |
| | | |
| | | body { |
| | | height: 100%; |
| | | /*overflow: hidden;*/ |
| | |
| | | position: fixed; |
| | | width: 100%; |
| | | overflow: hidden; |
| | | box-shadow: 0 1px 2px 0 rgba(0,0,0,.1) |
| | | box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1) |
| | | } |
| | | |
| | | .nav li { |
| | | float: left; |
| | | border-right: 1px solid #f1f1f1; /*todo*/ |
| | | } |
| | | |
| | | .nav li a { |
| | | font-size: 20px; |
| | | letter-spacing: 1px; |
| | |
| | | /*-webkit-transform:scale(1.5);*/ |
| | | /*-moz-transform:scale(1.5);*/ |
| | | } |
| | | |
| | | .nav li a:hover { |
| | | color: #000; |
| | | } |
| | | |
| | | .nav-unselect { |
| | | color: #666; |
| | | color: blue; |
| | | } |
| | | |
| | | .nav-select { |
| | | background-color: #f1f1f1; /*todo*/ |
| | | color: #000; |
| | | background-color: #f1f1f1; /*todo*/ |
| | | color: blue; |
| | | } |
| | | |
| | | /* 主体 */ |
| | | #content { |
| | | padding-top: 32px; |
| | | /*padding-top: 32px;*/ |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | iframe { |
| | | border-width: 0; |
| | | } |
| | | |
| | | td { |
| | | color: white; |
| | | background-image: linear-gradient(to top, #09203f 0%, #537895 100%); |
| | | /*background-color: rgba(204,204,204,.6);*/ |
| | | border-radius: 8px; |
| | | text-align: center; |
| | | vertical-align: middle; |
| | | height: 80px; |
| | | font-size: 24px; |
| | | } |
| | | .nav-font-size { |
| | | font-size: 18px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 导航栏 --> |
| | | <ul class="nav"> |
| | | <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">组托</a></li> |
| | | <li><a id="combPro" onclick="nav(this.id)" class="nav-unselect" href="#">关联组托</a></li> |
| | | <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li> |
| | | <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li> |
| | | </ul> |
| | | <!-- 导航菜单 --> |
| | | <table id="navList" style="width: 100%; border-color: #e6e6e6;" border="0" cellspacing="2"> |
| | | <tr> |
| | | <td> |
| | | <div id="comb" onclick="nav(this.id)" class="nav-font-size">立库组托入库</div> |
| | | </td> |
| | | <td> |
| | | <div id="combPro" onclick="nav(this.id)" style="font-size: 15px">立库任务单入库</div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="stockIn" onclick="nav(this.id)" class="nav-font-size">立库配件入库</div> |
| | | </td> |
| | | <td> |
| | | <div id="stockOut" onclick="nav(this.id)" class="nav-font-size">立库配件出库</div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="locNormalIn1" onclick="nav(this.id)" class="nav-font-size">平仓材料入库</div> |
| | | </td> |
| | | <td> |
| | | <div id="locNormalOut1" onclick="nav(this.id)" class="nav-font-size">平仓材料出库</div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="locNormalIn" onclick="nav(this.id)" class="nav-font-size">平仓成品入库</div> |
| | | </td> |
| | | <td> |
| | | <div id="locNormalOut" onclick="nav(this.id)" class="nav-font-size">平仓成品出库</div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div id="locNormalMove" onclick="nav(this.id)" class="nav-font-size">平仓成品移库</div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <!-- 主体内容 --> |
| | | <iframe id="content" src="comb.html"></iframe> |
| | | <iframe id="content" src=""></iframe> |
| | | |
| | | |
| | | </body> |
| | | <script> |
| | | // 导航栏 |
| | | function nav(id) { |
| | | $('.nav-select').attr("class", "nav-unselect"); |
| | | $('#'+id).attr("class", "nav-select"); |
| | | $('#content').attr("src", id+".html"); |
| | | // $('.nav-select').attr("class", "nav-unselect"); |
| | | // $('#' + id).attr("class", "nav-select"); |
| | | |
| | | if (id === 'locNormalIn1') { |
| | | $('#content').attr("src", "locNormalIn.html?areaType=1"); |
| | | } else if (id === 'locNormalOut1') { |
| | | $('#content').attr("src", "locNormalOut.html?areaType=1"); |
| | | } else { |
| | | $('#content').attr("src", id + ".html"); |
| | | } |
| | | $('#navList').css('display', 'none'); |
| | | $('#content').css('display', 'block'); |
| | | } |
| | | |
| | | function backIndex() { |
| | | $('#navList').css('display', 'inline-table'); |
| | | $('#content').css('display', 'none'); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | .form-box span { |
| | | display: inline-block; |
| | | text-align: right; |
| | | width: 70px; |
| | | } |
| | | .form-box input { |
| | | width: 120px; |
| | | margin-left: 10px; |
| | | width: 160px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | |
| | | <body> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <span>库位号</span> |
| | | <input id="locNo" type="text" disabled="disabled"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">库位</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="locNo" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料编码</span> |
| | | <input id="matnr" type="text" disabled="disabled"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">编码</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matnr" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料名称</span> |
| | | <input id="maktx" type="text" disabled="disabled"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="4" style="width: 165px; resize: none" id="maktx" type="text" disabled="disabled" readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>平仓入库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">单号</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <input id="billNo" class="layui-input" autocomplete="off" oninput="find(this)"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库区</label> |
| | | <div class="layui-input-inline" style="width: 175px"> |
| | | <select id="uuid"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin: 5px 5px"> |
| | | <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i |
| | | class="layui-icon">+</i>提取 |
| | | </button> |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" |
| | | style="margin-left: 20px">入库 |
| | | </button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" |
| | | style="margin-left: 20px">返回 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | var tableIns; |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | document.getElementById("billNo").focus(); |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | width: 320, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'mnemonic', align: 'center', title: '生产单号'}, |
| | | { field: 'count', align: 'center', title: '数量', style: 'color: blue', width: 50}, |
| | | {field: 'matName', align: 'center', title: '物料名称'}, |
| | | |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | var areaType = getQueryVariable('areaType'); |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth?areaType=" + (areaType ? areaType : ""), |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#uuid').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | window.onload = function () { |
| | | document.getElementById("uuid").focus(); |
| | | } |
| | | |
| | | var matCodeLayerIdx; |
| | | |
| | | function getMat() { |
| | | matCodeLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '提取物料', |
| | | shade: [0.3, '#000'], |
| | | area: ['90%', '90%'], |
| | | content: 'matQuery.html', |
| | | success: function (layero, index) { |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | | }, |
| | | end: function () { |
| | | $('#mat-btn').focus(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | |
| | | function addTableData(data) { |
| | | if (isEmpty(data.matName)) { |
| | | tips("提取失败", true); |
| | | return; |
| | | } |
| | | let toPush = true; |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (data.matNo === matData[j].matNo) { |
| | | matData[j].count = Number(matData[j].count) + Number(data.count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data); |
| | | } |
| | | tips("提取成功"); |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 组托 |
| | | function comb() { |
| | | let barcode = $('#uuid').val(); |
| | | console.log('barcode', barcode); |
| | | if (isEmpty(barcode)) { |
| | | tips("请选择库区", true); |
| | | document.getElementById("uuid").focus(); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | | tips("请提取物料", true); |
| | | return; |
| | | } |
| | | |
| | | // 构造平仓入库数据 |
| | | var data = [] |
| | | matData.map(function (item) { |
| | | data.push({ |
| | | matnr: item.matNo, |
| | | maktx: item.matName, |
| | | anfme: item.count, |
| | | warehouse: barcode, |
| | | mnemonic: item.mnemonic, |
| | | supplier: item.supplier, |
| | | lgnum: item.lgnum, |
| | | type: item.type, |
| | | altme: item.altme, |
| | | }); |
| | | }); |
| | | |
| | | // 请求保存接口 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/in", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(true); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知单号查询物料详情 |
| | | */ |
| | | function find(el) { |
| | | var billNo = el.value; |
| | | if (isEmpty(billNo)) { |
| | | return; |
| | | } |
| | | if (billNo.indexOf('=') > -1) { |
| | | billNo = billNo.split(",")[0].split("=")[1]; |
| | | } |
| | | // 赋值前清空表格 |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | billNo: billNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | console.log('单号数据', res.data); |
| | | var data = res.data; |
| | | if (data.length > 0) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | addTableData(data[i]); |
| | | } |
| | | } |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | // var tips = $('#tips'); |
| | | // tips.html(msg); |
| | | // tips.css("color", warn?"red":'#666'); |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | $("#uuid").val(""); |
| | | $("#uuid").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | layer.closeAll(); |
| | | $("#billNo").val(""); |
| | | $("#uuid").val(""); |
| | | layui.form.render('select'); |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>平仓移库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">物料编码</label> |
| | | <input class="layui-input" id="matnr" onkeyup="find()" placeholder="扫码 / 输入" |
| | | autocomplete="off" style="width: 60%"> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label" style="margin-left: 16px">源库区</label> |
| | | <!--<input class="layui-input" id="warehouse1" onkeyup="find(true)" placeholder="扫码 / 输入"--> |
| | | <!--autocomplete="off" style="width: 60%">--> |
| | | <div class="layui-input-inline" style="width: 180px"> |
| | | <select id="warehouse1" lay-filter="warehouse1"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">目标库区</label> |
| | | <!--<input class="layui-input" id="warehouse2" placeholder="扫码 / 输入"--> |
| | | <!--autocomplete="off" style="width: 60%" onkeyup="exist('uuid', 'locArea', 'warehouse2')">--> |
| | | <div class="layui-input-inline" style="width: 180px"> |
| | | <select id="warehouse2"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="locNormalMove" lay-filter="locNormalMove"></table> |
| | | </main> |
| | | |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="move()" |
| | | style="margin-left: 20px">转移 |
| | | </button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" |
| | | style="margin-left: 20px">返回 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | </body> |
| | | <script> |
| | | var tableIns; |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | id: 'locNormalMove', |
| | | elem: '#locNormalMove', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail', width: 80}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'warehouse', align: 'center', title: '库区', event: 'detail', width: 50}, |
| | | {type: 'checkbox', fixed: 'right', width: 30}, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | form.on('select(warehouse1)', function (data) { |
| | | var val = data.value; |
| | | find(true); |
| | | }); |
| | | |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#warehouse1').append(html); |
| | | $('#warehouse2').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | /* 库存转移 */ |
| | | move = () => { |
| | | // 判断目标库区是否为空 |
| | | var warehouse1 = $("#warehouse1").val(); |
| | | var warehouse2 = $("#warehouse2").val(); |
| | | if (!warehouse2 || warehouse2 == '') { |
| | | layer.msg("请确定目标库区"); |
| | | return; |
| | | } |
| | | if (warehouse1 == warehouse2) { |
| | | layer.msg("目标库区和源库区不能一致"); |
| | | return; |
| | | } |
| | | // 判断勾选数据是否为空 |
| | | var table = layui.table; |
| | | var checkStatus = table.checkStatus('locNormalMove'); |
| | | var data = checkStatus.data; |
| | | if (data.length == 0) { |
| | | layer.msg("请选择物料"); |
| | | return; |
| | | } |
| | | // 处理勾选数据修改warehouse为目标库区 |
| | | data.map(function (item) { |
| | | item.warehouse = warehouse2; |
| | | }); |
| | | // 请求移库接口,选中的物料的warehouse更新为目标库区 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/move", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | tips("移库成功") |
| | | reset(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | /* 根据库区号检索物料信息 */ |
| | | find = (flag) => { |
| | | if (flag) { |
| | | exist('uuid', 'locArea', 'warehouse1'); |
| | | } |
| | | var warehouse = $("#warehouse1").val(); |
| | | var matnr = $("#matnr").val(); |
| | | // 查询接口 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/warehouseQuery?warehouse=" + warehouse + "&matnr=" + matnr, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | tableIns.reload({ |
| | | data: res.data, |
| | | }); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | window.onload = function () { |
| | | document.getElementById("matnr").focus(); |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | function reset() { |
| | | $('#warehouse1').val(""); |
| | | $('#warehouse2').val(""); |
| | | $('#matnr').val(""); |
| | | layui.form.render('select'); |
| | | tableIns.reload({data: []}); |
| | | layer.closeAll(); |
| | | } |
| | | </script> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>平仓出库</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | </head> |
| | | <style> |
| | | .form-box span { |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | } |
| | | .form-box input { |
| | | width: 165px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow:hidden; |
| | | white-space:nowrap; |
| | | text-overflow:ellipsis; |
| | | } |
| | | .number-tool { |
| | | margin-left: 10px; |
| | | padding: 1px 0 1px 5px; |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | | font-size: 16px; |
| | | height: 25px; |
| | | float: left; |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | | float: left; |
| | | margin: 0 5px; |
| | | width: 50px; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | <body> |
| | | |
| | | <header class="layui-form"> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label" style="margin-left: 32px">单号</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="billNo" class="layui-input" autocomplete="off" oninput="findCode(this, 'billNo')" |
| | | style="width: 175px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">物料编码</label> |
| | | <input class="layui-input" id="matnr" onkeyup="findCode(this, 'matnr')" placeholder="扫码 / 输入" |
| | | style="width: 175px" |
| | | autocomplete="off"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label" style="margin-left: 28px;">库区</label> |
| | | <div class="layui-input-inline" style="margin-left: 5px;width: 175px"> |
| | | <select id="uuid" lay-filter="uuid"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </header> |
| | | |
| | | <main> |
| | | <table class="layui-table" id="locNormalOut" lay-filter="locNormalOut"></table> |
| | | </main> |
| | | |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="out-btn" class="layui-btn layui-btn-normal " onclick="locNormalOut()" |
| | | style="margin-left: 20px">出库 |
| | | </button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" |
| | | style="margin-left: 20px">返回 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; padding-top: 10px; text-align: center;"> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">编码</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matnr2" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="3" style="resize: none; width: 165px" id="maktx2" type="text" disabled="disabled" |
| | | readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <input id="index" type="text" disabled="disabled" style="display: none;"> |
| | | <div class="form-item" style="margin-top: 5px; margin-bottom: 8px;"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="anfme2" type="number" onchange="fix(this)"> |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | |
| | | </body> |
| | | <script> |
| | | var countLayer; |
| | | // 当前点击物料的最大数量 |
| | | var maxCount; |
| | | // 表格数据 |
| | | var normalOutList = []; |
| | | window.onload = function () { |
| | | document.getElementById("billNo").focus(); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | |
| | | var tableIns; |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | id: 'locNormalOut', |
| | | elem: '#locNormalOut', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail', width: 80}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'warehouse', align: 'center', title: '库区', event: 'detail', width: 50}, |
| | | { |
| | | field: 'anfmeOut', |
| | | align: 'center', |
| | | title: '数量', |
| | | event: 'detail', |
| | | style: 'color: blue', |
| | | event: 'modify', |
| | | style: 'cursor: pointer;color: blue', |
| | | width: 50 |
| | | }, |
| | | {type: 'checkbox', fixed: 'right', width: 30}, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locNormalOut)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'modify': |
| | | countLayer = layer.open({ |
| | | type: 1, |
| | | offset: '20px', |
| | | title: '修改数量', |
| | | shadeClose: true, |
| | | area: ['80%', '240px'], |
| | | content: $("#modify"), |
| | | success: function (layero, index) { |
| | | $('#matnr2').val(data.matnr); |
| | | $('#maktx2').val(data.maktx); |
| | | $('#index').val(data.id); |
| | | $('#anfme2').val(0); |
| | | maxCount = data.anfme; |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | form.on('select(uuid)', function (data) { |
| | | var val = data.value; |
| | | findCode(this, 'uuid'); |
| | | }); |
| | | |
| | | var areaType = getQueryVariable('areaType'); |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth?areaType=" + (areaType ? areaType : ""), |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#uuid').append(html); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | var warehouseBar; |
| | | var matnrBar; |
| | | var billNo; |
| | | |
| | | /* 扫码、输入库区和物料编码 */ |
| | | function findCode(el, type) { |
| | | warehouseBar = $('#uuid').val(); |
| | | billNo = $("#billNo").val(); |
| | | if (billNo && billNo != '' && billNo.indexOf('=') > -1) { |
| | | billNo = billNo.split(",")[0].split("=")[1]; |
| | | } |
| | | switch (type) { |
| | | case 'uuid': |
| | | // exist('uuid', 'locArea'); |
| | | break; |
| | | case 'matnr': |
| | | matnrBar = el.value; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // 判断库区或者物料编码都不为空 |
| | | // if (!warehouseBar || !matnrBar) { |
| | | // return; |
| | | // } |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/out/query?matnr=" + (matnrBar ? matnrBar : "") + "&warehouse=" + (warehouseBar ? warehouseBar : "") + "&billNo=" + (billNo ? billNo : ""), |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // contentType: 'application/json;charset=UTF-8', |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.map(function (item) { |
| | | // 默认赋值0开始 |
| | | item.anfmeOut = 0; |
| | | }); |
| | | } |
| | | tableIns.reload({ |
| | | data: res.data, |
| | | }); |
| | | normalOutList = res.data; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | /* 修改数量 */ |
| | | var countDom = $('#anfme2'); |
| | | |
| | | function add() { |
| | | if (countDom.val() >= maxCount) { |
| | | return; |
| | | } |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | |
| | | function reduce() { |
| | | if (countDom.val() <= 0) { |
| | | return; |
| | | } |
| | | countDom.val(Number(countDom.val()) - 1); |
| | | } |
| | | |
| | | function fix(e) { |
| | | if (Number(e.value) > maxCount) { |
| | | countDom.val(maxCount); |
| | | } |
| | | } |
| | | |
| | | function remove() { |
| | | var matnr = $('#matnr2').val(); |
| | | var index = $('#index').val(); |
| | | for (var j = 0; j < normalOutList.length; j++) { |
| | | if (matnr === normalOutList[j].matnr && index == normalOutList[j].id) { |
| | | normalOutList.splice(j, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: normalOutList}); |
| | | layer.close(countLayer); |
| | | tips("移除成功"); |
| | | } |
| | | |
| | | // 修改数量 |
| | | function confirm() { |
| | | var matnr = $('#matnr2').val(); |
| | | var count = $('#anfme2').val(); |
| | | var index = $('#index').val(); |
| | | for (var j = 0; j < normalOutList.length; j++) { |
| | | if (matnr === normalOutList[j].matnr && index == normalOutList[j].id) { |
| | | if (count > maxCount || count < 0) { |
| | | tips("数量不能超过范围", true); |
| | | return; |
| | | } |
| | | normalOutList[j].anfmeOut = Number(count); |
| | | } |
| | | } |
| | | tableIns.reload({data: normalOutList}); |
| | | layer.close(countLayer); |
| | | tips("修改成功"); |
| | | } |
| | | |
| | | /* 平仓出库 */ |
| | | function locNormalOut() { |
| | | // 调用出库接口,如果数量不是全部则进行update更新anfme字段,如果是全部数量则直接update更新state字段1→2 |
| | | var table = layui.table; |
| | | var checkStatus = table.checkStatus('locNormalOut'); |
| | | var data = checkStatus.data; |
| | | if (data.length == 0) { |
| | | layer.msg("请选择物料!"); |
| | | return; |
| | | } |
| | | // 库区赋值 |
| | | var warehouse = $('#uuid').val(); |
| | | data.map(function (item) { |
| | | item.warehouse = warehouse; |
| | | }); |
| | | // 出库接口 |
| | | $.ajax({ |
| | | url: baseUrl + "/locNormal/pda/out", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | normalList: data, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("出库成功"); |
| | | $("#matnr").val(null); |
| | | $("#billNo").val(null); |
| | | warehouseBar = null; |
| | | matnrBar = null; |
| | | normalOutList = []; |
| | | tableIns.reload({ |
| | | data: normalOutList, |
| | | }) |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | function reset() { |
| | | $("#uuid").val(null); |
| | | $("#matnr").val(null); |
| | | $("#billNo").val(null); |
| | | layui.form.render('select'); |
| | | normalOutList = []; |
| | | tableIns.reload({data: normalOutList}); |
| | | layer.closeAll(); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | width: 70px; |
| | | } |
| | | .form-box input { |
| | | width: 120px; |
| | | margin-left: 10px; |
| | | width: 160px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | |
| | | |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <span>物料编码</span> |
| | | <input id="matNo" type="text" placeholder="扫码 / 输入" onkeyup="find(this)" autocomplete="off"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">编码</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matNo" type="text" placeholder="扫码 / 输入" onkeyup="find(this)" autocomplete="off"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料名称</span> |
| | | <input id="matName" type="text" disabled="disabled"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="4" style="width: 165px; resize: none" id="matName" type="text" disabled="disabled" readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料规格</span> |
| | | <input id="str2" type="text" disabled="disabled"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">规格</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="str2" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>单位</span> |
| | | <input id="str1" type="text" disabled="disabled"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">单号</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="mnemonic" type="text" autocomplete="off"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <!--<div class="form-item">--> |
| | | <!--<span>单位</span>--> |
| | | <!--<input id="str1" type="text" disabled="disabled">--> |
| | | <!--</div>--> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | |
| | | var data = { |
| | | matNo: $('#matNo').val(), |
| | | matName: $('#matName').val(), |
| | | count: countDom.val() |
| | | count: countDom.val(), |
| | | mnemonic: $("#mnemonic").val() |
| | | }; |
| | | parent.addTableData(data); |
| | | parent.layer.close(parent.matCodeLayerIdx); |
| | |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <label class="layui-form-label">托盘码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div style="margin: 5px 5px" class="layui-form"> |
| | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <footer style="margin-top: -5px"> |
| | | <div class="layui-btn-container" style="text-align: center; margin-bottom: 8px"> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" >返回</button> |
| | | </div> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button id="empty-pakin" type="button" class="layui-btn layui-btn-normal" onclick="emptyPakIn()" style="margin-left: 15px">空板入库</button> |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'mnemonic', align: 'center', title: '生产单号'}, |
| | | {field: 'count', align: 'center', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | |
| | | type: 2, |
| | | title: '物料', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '80%'], |
| | | area: ['90%', '90%'], |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | </script> |
| | | <script type="text/template" id="putSiteSelectTemplate"> |
| | | {{#each data}} |
| | |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库位</label> |
| | | <label class="layui-form-label">单号</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="number" id="locNo" onkeyup="findByLocNo(this)" autocomplete="off"> |
| | | <input class="layui-input" type="text" id="billNo" onkeyup="findByBillNo(this)" autocomplete="off"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">物料</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="text" id="matNo" onkeyup="findByMatNo(this)" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库位</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="number" id="locNo" onkeyup="findByLocNo(this)" autocomplete="off"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">出库口</label> |
| | |
| | | <div class="layui-btn-container"> |
| | | <button id="reset" type="button" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button id="pakOut" type="button" class="layui-btn layui-btn-normal" onclick="pakOut()" style="margin-left: 20px">出库</button> |
| | | <button type="button" id="retrun-btn" class="layui-btn layui-btn-primary " onclick="back()" style="margin-left: 20px">返回</button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | |
| | | <script> |
| | | |
| | | window.onload = function(){ |
| | | document.getElementById("locNo").focus(); |
| | | document.getElementById("billNo").focus(); |
| | | getOutBound(); |
| | | } |
| | | |
| | |
| | | $("#locNo").val(""); |
| | | find(null, el.value); |
| | | } |
| | | function find(locNo, matNo) { |
| | | |
| | | /** |
| | | * 根据通知单号查找库存明细 |
| | | * */ |
| | | function findByBillNo(el) { |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | |
| | | find(null, null, el.value); |
| | | } |
| | | |
| | | function find(locNo, matNo, billNo) { |
| | | if (billNo.indexOf('=') > -1) { |
| | | billNo = billNo.split(",")[0].split("=")[1]; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/locDetl", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | locNo: locNo, |
| | | matNo: matNo |
| | | matNo: matNo, |
| | | supplier: billNo, |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | |
| | | locDetlData = res.data; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | $('#pakOut').focus(); |
| | | // $('#pakOut').focus(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left', width:30}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'} |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {type: 'checkbox', fixed: 'right', width:30}, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | |
| | | type: 2, |
| | | title: '库存明细', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '70%'], |
| | | area: ['90%', '75%'], |
| | | content: 'locDetlIframe.html', |
| | | success: function(layero, index){ |
| | | // 设置弹窗样式 |
| | |
| | | function reset() { |
| | | $("#matNo").val(""); |
| | | $("#locNo").val(""); |
| | | $("#billNo").val(""); |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | $('#staNoSelect').val(""); |
| | |
| | | $("#locNo").focus(); |
| | | } |
| | | } |
| | | |
| | | function back() { |
| | | parent.backIndex(); |
| | | } |
| | | </script> |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
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> |
| | | <style> |
| | | #search-box { |
| | | padding: 30px 30px 10px 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*line-height: 46px;*/ |
| | | } |
| | | |
| | | </style> |
| | | <body> |
| | | |
| | | <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="orderCode" placeholder="订单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="orderTime" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<div class="layui-inline" style="width: 150px">--> |
| | | <!--<select id="orderState" name="orderState">--> |
| | | <!--<option value="">订单状态</option>--> |
| | | <!--<option value="1">初始</option>--> |
| | | <!--<option value="2">执行中</option>--> |
| | | <!--<option value="3">结束</option>--> |
| | | <!--</select>--> |
| | | <!--</div>--> |
| | | |
| | | |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="salesOrder" lay-filter="salesOrder"></table> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="btnPrint">质检</button> |
| | | </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/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 type="text/javascript" src="../../static/js/salesOrder/salsesOrder.js"></script> |
| | | |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | <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="zpallet" placeholder="托盘码" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="pakin_id" placeholder="入库通知号" autocomplete="off"> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | /* v1.0.1 */ |
| | | --表结构变更 |
| | | alter table dbo.asr_loc_detl add mat_status varchar(10); |
| | | alter table dbo.asr_wrk_detl add mat_status varchar(10); |
| | | /* v1.0.2 2021.03.05 */ |
| | | --表结构变更 |
| | | CREATE TABLE [dbo].[asr_loc_normal]( |
| | | [matnr] [varchar](50) NOT NULL, |
| | | [maktx] [nvarchar](50) NULL, |
| | | [lgnum] [varchar](255) NULL, |
| | | [type] [varchar](50) NULL, |
| | | [mnemonic] [varchar](255) NULL, |
| | | [supplier] [varchar](255) NULL, |
| | | [warehouse] [varchar](255) NULL, |
| | | [brand] [varchar](255) NULL, |
| | | [anfme] [decimal](24, 9) NULL, |
| | | [altme] [nvarchar](50) NULL, |
| | | [bname] [nvarchar](50) NULL, |
| | | [memo] [varchar](600) NULL, |
| | | [modi_user] [bigint] NULL, |
| | | [modi_time] [datetime] NULL, |
| | | [appe_user] [bigint] NULL, |
| | | [appe_time] [datetime] NULL, |
| | | [state] [varchar](10) NULL |
| | | ) ON [PRIMARY] |
| | | |
| | | CREATE TABLE [dbo].[asr_loc_area]( |
| | | [id] [bigint] IDENTITY(1,1) NOT NULL, |
| | | [uuid] [varchar](50) NULL, |
| | | [name] [varchar](255) NULL, |
| | | [status] [int] NULL, |
| | | [create_by] [bigint] NULL, |
| | | [create_time] [datetime] NULL, |
| | | [update_by] [bigint] NULL, |
| | | [update_time] [datetime] NULL, |
| | | [memo] [varchar](255) NULL |
| | | ) ON [PRIMARY] |
| | | |
| | | /* v1.0.3 2021.03.11 */ |
| | | --表结构变更 |
| | | alter table asr_loc_normal add id int identity(1,1) |
| | | |
| | | /* v1.0.4 2021.03.17 */ |
| | | USE [xtyasrs] |
| | | GO |
| | | /****** Object: Table [dbo].[OutStockbill] Script Date: 2021/3/17 10:18:26 ******/ |
| | | SET ANSI_NULLS ON |
| | | GO |
| | | SET QUOTED_IDENTIFIER ON |
| | | GO |
| | | SET ANSI_PADDING ON |
| | | GO |
| | | CREATE TABLE [dbo].[OutStockbill]( |
| | | [FBrNo] [varchar](10) NOT NULL, |
| | | [FInterID] [int] NOT NULL, |
| | | [FBillNo] [nvarchar](255) NOT NULL, |
| | | [FTranType] [smallint] NULL, |
| | | [FSalType] [int] NULL, |
| | | [FCustID] [int] NULL, |
| | | [FDate] [datetime] NULL, |
| | | [FStockID] [int] NULL, |
| | | [FAdd] [char](255) NULL, |
| | | [FNote] [char](255) NULL, |
| | | [FEmpID] [int] NULL, |
| | | [FCheckerID] [int] NULL, |
| | | [FBillerID] [int] NULL, |
| | | [FManagerID] [int] NULL, |
| | | [FClosed] [int] NOT NULL, |
| | | [FInvoiceClosed] [smallint] NULL, |
| | | [FBClosed] [smallint] NOT NULL, |
| | | [FDeptID] [int] NULL, |
| | | [FSettleID] [int] NULL, |
| | | [FTranStatus] [int] NOT NULL, |
| | | [FExchangeRate] [float] NULL, |
| | | [FCurrencyID] [int] NULL, |
| | | [FStatus] [smallint] NOT NULL, |
| | | [FCancellation] [bit] NOT NULL, |
| | | [FMultiCheckLevel1] [int] NULL, |
| | | [FMultiCheckLevel2] [int] NULL, |
| | | [FMultiCheckLevel3] [int] NULL, |
| | | [FMultiCheckLevel4] [int] NULL, |
| | | [FMultiCheckLevel5] [int] NULL, |
| | | [FMultiCheckLevel6] [int] NULL, |
| | | [FMultiCheckDate1] [datetime] NULL, |
| | | [FMultiCheckDate2] [datetime] NULL, |
| | | [FMultiCheckDate3] [datetime] NULL, |
| | | [FMultiCheckDate4] [datetime] NULL, |
| | | [FMultiCheckDate5] [datetime] NULL, |
| | | [FMultiCheckDate6] [datetime] NULL, |
| | | [FCurCheckLevel] [int] NULL, |
| | | [FRelateBrID] [int] NULL, |
| | | [FCheckDate] [datetime] NULL, |
| | | [FExplanation] [nvarchar](255) NOT NULL, |
| | | [FFetchAdd] [nvarchar](255) NOT NULL, |
| | | [FSelTranType] [int] NOT NULL, |
| | | [FChildren] [int] NOT NULL, |
| | | [FBrID] [int] NULL, |
| | | [FAreaPS] [int] NOT NULL, |
| | | [FPOOrdBillNo] [nvarchar](255) NULL, |
| | | [FManageType] [int] NULL, |
| | | [FPrintCount] [smallint] NULL, |
| | | [Fflag_rw] [int] NULL, |
| | | [Fflag_finish] [int] NULL |
| | | ) ON [PRIMARY] |
| | | SET ANSI_PADDING OFF |
| | | ALTER TABLE [dbo].[OutStockbill] ADD [FWeiOrder] [varchar](255) NOT NULL |
| | | ALTER TABLE [dbo].[OutStockbill] ADD [FWeiOpenID] [nvarchar](255) NOT NULL |
| | | ALTER TABLE [dbo].[OutStockbill] ADD [FOrderBillNo] [nvarchar](255) NOT NULL |
| | | SET ANSI_PADDING ON |
| | | ALTER TABLE [dbo].[OutStockbill] ADD [FWLNumber] [varchar](255) NULL |
| | | ALTER TABLE [dbo].[OutStockbill] ADD [FWLCompany] [varchar](255) NULL |
| | | SET ANSI_PADDING OFF |
| | | ALTER TABLE [dbo].[OutStockbill] ADD [FReturnFundType] [varchar](255) NOT NULL |
| | | CONSTRAINT [pk_OutStockbill_1__16] PRIMARY KEY CLUSTERED |
| | | ( |
| | | [FBrNo] ASC, |
| | | [FInterID] ASC |
| | | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
| | | |
| | | GO |
| | | SET ANSI_PADDING OFF |
| | | GO |
| | | /****** Object: Table [dbo].[OutStockbillEntry] Script Date: 2021/3/17 10:18:26 ******/ |
| | | SET ANSI_NULLS ON |
| | | GO |
| | | SET QUOTED_IDENTIFIER ON |
| | | GO |
| | | SET ANSI_PADDING ON |
| | | GO |
| | | CREATE TABLE [dbo].[OutStockbillEntry]( |
| | | [FBrNo] [varchar](10) NOT NULL, |
| | | [FInterID] [int] NOT NULL, |
| | | [FEntryID] [int] NOT NULL, |
| | | [FItemID] [int] NULL, |
| | | [FQty] [decimal](28, 10) NOT NULL, |
| | | [FCommitQty] [decimal](28, 10) NOT NULL, |
| | | [FPrice] [decimal](28, 10) NOT NULL, |
| | | [FAmount] [decimal](20, 2) NOT NULL, |
| | | [FOrderInterID] [int] NOT NULL, |
| | | [FDate] [datetime] NULL, |
| | | [FNote] [varchar](1024) NULL, |
| | | [FInvoiceQty] [decimal](28, 10) NOT NULL, |
| | | [FBCommitQty] [decimal](28, 10) NOT NULL, |
| | | [FUnitID] [int] NOT NULL, |
| | | [FAuxBCommitQty] [decimal](28, 10) NOT NULL, |
| | | [FAuxCommitQty] [decimal](28, 10) NOT NULL, |
| | | [FAuxInvoiceQty] [decimal](28, 10) NOT NULL, |
| | | [FAuxPrice] [decimal](28, 10) NOT NULL, |
| | | [FAuxQty] [decimal](28, 10) NOT NULL, |
| | | [FSourceEntryID] [int] NOT NULL, |
| | | [FMapNumber] [varchar](80) NOT NULL, |
| | | [FMapName] [nvarchar](256) NULL, |
| | | [FAuxPropID] [int] NOT NULL, |
| | | [FBatchNo] [nvarchar](255) NOT NULL, |
| | | [FCheckDate] [datetime] NULL, |
| | | [FExplanation] [nvarchar](255) NOT NULL, |
| | | [FFetchAdd] [nvarchar](255) NOT NULL, |
| | | [FFetchDate] [datetime] NULL, |
| | | [FMultiCheckDate1] [datetime] NULL, |
| | | [FMultiCheckDate2] [datetime] NULL, |
| | | [FMultiCheckDate3] [datetime] NULL, |
| | | [FMultiCheckDate4] [datetime] NULL, |
| | | [FMultiCheckDate5] [datetime] NULL, |
| | | [FMultiCheckDate6] [datetime] NULL, |
| | | [FSecCoefficient] [decimal](28, 10) NOT NULL, |
| | | [FSecQty] [decimal](28, 10) NOT NULL, |
| | | [FSecCommitQty] [decimal](28, 10) NOT NULL, |
| | | [FSourceTranType] [int] NOT NULL, |
| | | [FSourceInterId] [int] NOT NULL, |
| | | [FSourceBillNo] [nvarchar](255) NOT NULL, |
| | | [FContractInterID] [int] NOT NULL, |
| | | [FContractEntryID] [int] NOT NULL, |
| | | [FContractBillNo] [nvarchar](255) NOT NULL, |
| | | [FOrderEntryID] [int] NOT NULL, |
| | | [FOrderBillNo] [nvarchar](255) NOT NULL, |
| | | [FStockID] [int] NOT NULL, |
| | | [FBackQty] [decimal](28, 10) NOT NULL, |
| | | [FAuxBackQty] [decimal](28, 10) NOT NULL, |
| | | [FSecBackQty] [decimal](28, 10) NOT NULL, |
| | | [FStdAmount] [decimal](23, 10) NOT NULL, |
| | | [FPlanMode] [int] NOT NULL, |
| | | [FMTONo] [nvarchar](50) NOT NULL, |
| | | [FDetailID] [int] NOT NULL, |
| | | [FStockQtyOnlyForShow] [decimal](23, 10) NOT NULL, |
| | | [FComplexQty] [varchar](255) NULL, |
| | | [Fmodel] [varchar](80) NULL, |
| | | [Fname] [varchar](80) NULL, |
| | | [Fnumber] [varchar](80) NULL |
| | | ) ON [PRIMARY] |
| | | SET ANSI_PADDING OFF |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD [FBarCode] [varchar](100) NOT NULL |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD [FBTPLCommitQty] [decimal](28, 10) NOT NULL |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD [FTPLCommitQty] [decimal](28, 10) NOT NULL |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD [fsecinvoiceqty] [decimal](23, 10) NULL |
| | | CONSTRAINT [pk_OutStockbillEntry_1__16] PRIMARY KEY CLUSTERED |
| | | ( |
| | | [FBrNo] ASC, |
| | | [FInterID] ASC, |
| | | [FEntryID] ASC |
| | | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] |
| | | |
| | | GO |
| | | SET ANSI_PADDING OFF |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FClosed] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FInvoiceClosed] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FBClosed] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((-1)) FOR [FSettleID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FTranStatus] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FStatus] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FCancellation] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD CONSTRAINT [DF__OutStockbill__FConsig] DEFAULT ((0)) FOR [FRelateBrID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FExplanation] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FFetchAdd] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FSelTranType] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FChildren] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ((0)) FOR [FAreaPS] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FWeiOrder] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FWeiOpenID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FOrderBillNo] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FWLNumber] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FWLCompany] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbill] ADD DEFAULT ('') FOR [FReturnFundType] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FPrice] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAmount] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD CONSTRAINT [DF_OutStockbillEntry_FOrderInterID] DEFAULT ((0)) FOR [FOrderInterID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FInvoiceQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FBCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FUnitID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxBCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxInvoiceQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxPrice] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD CONSTRAINT [DF__SEOutStoc__FSour__558158D4] DEFAULT ((0)) FOR [FSourceEntryID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FMapNumber] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD CONSTRAINT [DF__SEOutStoc__FMapN__5769A146] DEFAULT ('') FOR [FMapName] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxPropID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FBatchNo] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FExplanation] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FFetchAdd] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FSecCoefficient] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FSecQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FSecCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FSourceTranType] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FSourceInterId] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FSourceBillNo] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FContractInterID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FContractEntryID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FContractBillNo] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FOrderEntryID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FOrderBillNo] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FStockID] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FBackQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FAuxBackQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FSecBackQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FStdAmount] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((14036)) FOR [FPlanMode] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FMTONo] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('0') FOR [FStockQtyOnlyForShow] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ('') FOR [FBarCode] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FBTPLCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [FTPLCommitQty] |
| | | GO |
| | | ALTER TABLE [dbo].[OutStockbillEntry] ADD DEFAULT ((0)) FOR [fsecinvoiceqty] |
| | | GO |
| | | /* v1.0.5 2021.03.24 */ |
| | | alter table asr_loc_area add area_type varchar(10); |