diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java index 0c07e644..d20d6026 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -499,6 +499,8 @@ public class DepositoryRecordController { UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(),userToken); // 创建展示对象 SimpleApplicationOutMinRecordP simpleApplicationOutMinRecordP = new SimpleApplicationOutMinRecordP(applicationOutMinById); + // 设置展示时的数量为申请数-已出库数 + simpleApplicationOutMinRecordP.setQuantity(applicationOutMinById.getQuantity() - applicationOutMinById.getTrueOut()); // 获取申请的物料信息 Material materialById = materialService.findMaterialById(applicationOutMinById.getMid()); // 获取当前物料所存在的库位 @@ -523,6 +525,8 @@ public class DepositoryRecordController { UserByPort checker = LinkInterfaceUtil.FindUserById(checkId,userToken); simpleApplicationOutMinRecordP.setCheckerName(checker.getName()); simpleApplicationOutMinRecordP.setPcode(placeByDid.getCode()); + // 当已经完成出库时设置数量为出库数 + simpleApplicationOutMinRecordP.setQuantity(applicationOutMinById.getQuantity()); } List materialAndProducedDateByMid = materialService.findMaterialAndProducedDateByMid(materialById.getId()); if (materialAndProducedDateByMid.size() > 0) { @@ -536,6 +540,7 @@ public class DepositoryRecordController { } } } + simpleApplicationOutMinRecordP.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getApplicantTime()))); simpleApplicationOutMinRecordP.setApplyRemark(applicationOutRecordPById.getApplyRemark()); simpleApplicationOutMinRecordP.setDepositoryId(depositoryRecordById.getId()); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index ab2df868..da66bc7e 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -1713,6 +1713,25 @@ public class PageController { return mv; } + // 用于展示当前库位所存在的物料 + @GetMapping("/ScanBarOrQrCodeOut_selectMaterial") + public ModelAndView ScanBarOrQrCodeOut_selectMaterial(Integer pid,String mcode){ + ModelAndView mv = new ModelAndView(); + // 获取当前库位中 + List placeAndMaterialByPid = placeService.findPlaceAndMaterialByPid(pid); + // 用于存储物料id + List midList = new ArrayList<>(); + for (int i = 0; i < placeAndMaterialByPid.size(); i++) { + MaterialAndPlace materialAndPlace = placeAndMaterialByPid.get(i); + midList.add(materialAndPlace.getMid()); + } + List materialByIds = materialService.findMaterialByIds(midList); + mv.addObject("materialList",materialByIds); + mv.addObject("mcode",mcode); + mv.setViewName("pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial"); + return mv; + } + @GetMapping("/scanQrCodeTransfer") public ModelAndView scanQrCodeTransfer(HttpServletRequest request) { ModelAndView mv = new ModelAndView(); diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfoByInventory.java b/src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfoByInventory.java index 6bb1c9f5..3e198967 100644 --- a/src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfoByInventory.java +++ b/src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfoByInventory.java @@ -30,6 +30,10 @@ public class ExcelInfoByInventory { @ExcelProperty("物料名称") private String mname; + /** 规格型号 */ + @ExcelProperty("规格型号") + private String version; + /** 数量 */ @ExcelProperty(value = "数量") @ExcelValid(message = "数量未填写") diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java index bda41bf5..61e63485 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java @@ -131,10 +131,10 @@ public interface MaterialMapper { /** * 根据id批量查询库存信息 - * @param ids 库存id集合 + * @param list 库存id集合 * @return 库存信息 */ - Material findMaterialByIds(List ids); + List findMaterialByIds(List list); /** * 查询所有库存条数 diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml index c3b7195c..3f06cbc5 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml @@ -544,7 +544,7 @@ SELECT FROM material m WHERE m.id IN - + #{id} diff --git a/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java b/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java index c02c2cf9..cdc3e7b0 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java @@ -102,7 +102,7 @@ public interface MaterialService { * @param ids 库存id集合 * @return 库存信息 */ - Material findMaterialByIds(List ids); + List findMaterialByIds(List ids); /** * 查询所有库存条数 diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index 968090f8..f3f5954e 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -744,6 +744,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { int result = 0; // 获取库存转移标志位 Integer istransfer = record.getIstransfer(); + + // 获取要出库的数量 + Integer trueOut = ObjectFormatUtil.toInteger(param.get("trueOut")); + // 获取出库库位 Integer placeId = ObjectFormatUtil.toInteger(param.get("placeId")); if (istransfer == 1) {// 如果是库存转移 @@ -760,7 +764,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(params); if (placeAndMaterialByMidAndPid != null) { // 如果当前库位存在该物料 - if (placeAndMaterialByMidAndPid.getQuantity() < record.getQuantity()) { + if (placeAndMaterialByMidAndPid.getQuantity() < trueOut) { // 如果当前库位数量不足 flag = false; } @@ -778,7 +782,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(params); if (placeAndMaterialByMidAndPid != null) { // 如果当前库位存在该物料 - if (placeAndMaterialByMidAndPid.getQuantity() < record.getQuantity()) { + if (placeAndMaterialByMidAndPid.getQuantity() < trueOut) { // 如果当前库位数量不足 flag = false; } @@ -792,11 +796,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取出库物料具体信息 Material material = materialMapper.findMaterialById(applicationOutMinById.getMid()); // 如果物料数量可以出库并且库位数量充足 - if (material.getQuantity() >= record.getQuantity() && flag) { + if (material.getQuantity() >= trueOut && flag) { // 当前出库金额 - Double sum = material.getPrice() * record.getQuantity(); + Double sum = material.getPrice() * trueOut; // 当前出库数量 - Integer quantity = applicationOutMinById.getQuantity(); + Integer quantity = trueOut; material.setAmounts(material.getAmounts() - sum); material.setQuantity(material.getQuantity() - quantity); material.setNumberOfTemporary(material.getNumberOfTemporary() - quantity); @@ -821,121 +825,132 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 修改redis中本子订单完成人 // redisTemplate.opsForHash().put(redisMinRecordKey,"manager",userByPort.getId().toString()); - // 获取当前订单中所有管理员 - String manager = (String) redisTemplate.opsForHash().get(redisMinRecordKey, "manager"); - String[] managerSplit = new String[0]; - if (manager != null) { - // 获取其他管理员 - managerSplit = manager.replace(userByPort.getId() + ",", "").split(","); - if (managerSplit.length == 0) { - managerSplit = new String[0]; + // 修改当前已经出库的数量 + applicationOutMinById.setTrueOut(trueOut+applicationOutMinById.getTrueOut()); + if(applicationOutMinById.getQuantity() - applicationOutMinById.getTrueOut() > 0){ + // 如果当前子订单中的物料并未完全出库 + + }else{ + // 如果完成出库 + + // 获取当前订单中所有管理员 + String manager = (String) redisTemplate.opsForHash().get(redisMinRecordKey, "manager"); + String[] managerSplit = new String[0]; + if (manager != null) { + // 获取其他管理员 + managerSplit = manager.replace(userByPort.getId() + ",", "").split(","); + if (managerSplit.length == 0) { + managerSplit = new String[0]; + } } - } - for (int i = 0; i < managerSplit.length; i++) { - // 删除其他管理员的订单记录 - String otherManager = "user:" + managerSplit[i]; - String minRecord = (String) redisTemplate.opsForHash().get(otherManager, "minRecord"); - // 删除其他管理员中当前已完成的订单 - if (minRecord == null) { - continue; + for (int i = 0; i < managerSplit.length; i++) { + // 删除其他管理员的订单记录 + String otherManager = "user:" + managerSplit[i]; + String minRecord = (String) redisTemplate.opsForHash().get(otherManager, "minRecord"); + // 删除其他管理员中当前已完成的订单 + if (minRecord == null) { + continue; + } + minRecord = minRecord.replace(redisMinRecordKey + ",", ""); + if (minRecord.length() == 2) { + // [] + // 如果当前用户已经没有剩余订单,则删除 + redisTemplate.delete(otherManager); + } else { + redisTemplate.opsForHash().put(otherManager, "minRecord", minRecord); + } } + // 删除已完成的订单 + redisTemplate.delete(redisMinRecordKey); + // 获取该用户在redis中的订单记录 + String key = "user:" + userByPort.getId().toString(); + // 获取当前用户所有订单 + String minRecord = (String) redisTemplate.opsForHash().get(key, "minRecord"); + // 删除用户中当前已完成的订单 minRecord = minRecord.replace(redisMinRecordKey + ",", ""); if (minRecord.length() == 2) { // [] // 如果当前用户已经没有剩余订单,则删除 - redisTemplate.delete(otherManager); + redisTemplate.delete("user:" + userByPort.getId()); } else { - redisTemplate.opsForHash().put(otherManager, "minRecord", minRecord); + redisTemplate.opsForHash().put(key, "minRecord", minRecord); } - } - // 删除已完成的订单 - redisTemplate.delete(redisMinRecordKey); - // 获取该用户在redis中的订单记录 - String key = "user:" + userByPort.getId().toString(); - // 获取当前用户所有订单 - String minRecord = (String) redisTemplate.opsForHash().get(key, "minRecord"); - // 删除用户中当前已完成的订单 - minRecord = minRecord.replace(redisMinRecordKey + ",", ""); - if (minRecord.length() == 2) { - // [] - // 如果当前用户已经没有剩余订单,则删除 - redisTemplate.delete("user:" + userByPort.getId()); - } else { - redisTemplate.opsForHash().put(key, "minRecord", minRecord); - } - - // 获取出库仓库信息 - Depository depositoryRecordById = depositoryMapper.findDepositoryById(applicationOutMinById.getDepositoryId()); - // 设置子订单新编码 - // 获取主订单单号 - StringBuilder code = new StringBuilder(record.getCode()); - // 获取申请用户信息 - UserByPort applicantUser = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userByPort); - // 获取申请用户行政组织 - Administration company = LinkInterfaceUtil.getCompany(applicantUser.getMaindeparment(), userByPort); - // 获取部门名称简写 - String conpanyName = WordUtil.getPinYinHeadChar(company.getName()); - // 获取仓库名称简写 - String depositoryName = WordUtil.getPinYinHeadChar(depositoryRecordById.getDname()); - // 获取部门名称在单号的起始位置 - int index = code.indexOf(conpanyName); - // 生产新子订单编号 - String newCode = code.replace(index, index + conpanyName.length(), depositoryName).toString(); - // 设置完成人 - applicationOutMinById.setCheckId(userByPort.getId()); - // 设置新编码 - applicationOutMinById.setCode(newCode); - // 设置新库位 - applicationOutMinById.setPlaceId(placeId); - // 修改子订单 - result += depositoryRecordMapper.updateApplicationOutRecordMin(applicationOutMinById); - - - String redisMainRecordKey = "record:" + record.getId(); // 设置redis中主订单键值 - // 获取redis中主订单的所有子订单 - String minRecordList = (String) redisTemplate.opsForHash().get(redisMainRecordKey, "minRecord"); - // 获取所有子订单键值 - String[] split = minRecordList.replace("[", "").replace("]", "").split(","); - int pass = 1; // 设置主订单最终状态 - for (int i = 0; i < split.length; i++) { - // 获取所有子订单状态 - String state = (String) redisTemplate.opsForHash().get(split[i], "state"); - if ("1".equals(state)) { - // 如果有子订单未完成 - pass = 3; // 设置主订单状态为处理中 - break; - } - } - if (pass == 1) { // 如果最终状态为完成 - Map map = new HashMap<>(); - map.put("pass", pass); - map.put("id", record.getId()); - // 修改状态为完成 - depositoryRecordMapper.updateApplicationOutRecord(map); - - // 将最终完成的订单抄送给仓储负责人 - String depositoryManagerIds = record.getDepositoryManager(); - String[] depositoryManagers = new String[0]; - if (depositoryManagerIds != null) { - depositoryManagers = depositoryManagerIds.split(","); + // 获取出库仓库信息 + Depository depositoryRecordById = depositoryMapper.findDepositoryById(applicationOutMinById.getDepositoryId()); + // 设置子订单新编码 + // 获取主订单单号 + StringBuilder code = new StringBuilder(record.getCode()); + // 获取申请用户信息 + UserByPort applicantUser = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userByPort); + // 获取申请用户行政组织 + Administration company = LinkInterfaceUtil.getCompany(applicantUser.getMaindeparment(), userByPort); + // 获取部门名称简写 + String conpanyName = WordUtil.getPinYinHeadChar(company.getName()); + // 获取仓库名称简写 + String depositoryName = WordUtil.getPinYinHeadChar(depositoryRecordById.getDname()); + // 获取部门名称在单号的起始位置 + int index = code.indexOf(conpanyName); + // 生产新子订单编号 + String newCode = code.replace(index, index + conpanyName.length(), depositoryName).toString(); + // 设置新编码 + applicationOutMinById.setCode(newCode); + + // 设置完成人 + applicationOutMinById.setCheckId(userByPort.getId()); + // 设置新库位 + applicationOutMinById.setPlaceId(placeId); + + + + String redisMainRecordKey = "record:" + record.getId(); // 设置redis中主订单键值 + // 获取redis中主订单的所有子订单 + String minRecordList = (String) redisTemplate.opsForHash().get(redisMainRecordKey, "minRecord"); + // 获取所有子订单键值 + String[] split = minRecordList.replace("[", "").replace("]", "").split(","); + int pass = 1; // 设置主订单最终状态 + for (int i = 0; i < split.length; i++) { + // 获取所有子订单状态 + String state = (String) redisTemplate.opsForHash().get(split[i], "state"); + if ("1".equals(state)) { + // 如果有子订单未完成 + pass = 3; // 设置主订单状态为处理中 + break; + } } - StringBuilder depositoryManagerByQyWx = new StringBuilder(); - for (int i = 0; i < depositoryManagers.length; i++) { - Integer uid = ObjectFormatUtil.toInteger(depositoryManagers[i]); - UserByPort depositoryManager = LinkInterfaceUtil.FindUserById(uid, userByPort); + if (pass == 1) { // 如果最终状态为完成 + Map map = new HashMap<>(); + map.put("pass", pass); + map.put("id", record.getId()); + // 修改状态为完成 + depositoryRecordMapper.updateApplicationOutRecord(map); + + // 将最终完成的订单抄送给仓储负责人 + String depositoryManagerIds = record.getDepositoryManager(); + String[] depositoryManagers = new String[0]; + if (depositoryManagerIds != null) { + depositoryManagers = depositoryManagerIds.split(","); + } + StringBuilder depositoryManagerByQyWx = new StringBuilder(); + for (int i = 0; i < depositoryManagers.length; i++) { + Integer uid = ObjectFormatUtil.toInteger(depositoryManagers[i]); + UserByPort depositoryManager = LinkInterfaceUtil.FindUserById(uid, userByPort); // depositoryManagerByQyWx.append(depositoryManager.getWorkwechat()+","); - } - depositoryManagerByQyWx.append("PangFuZhen,"); - JSONObject jsonObject = qyWxOperationService.sendCcMessageToUsers(depositoryManagerByQyWx.toString(), record.getId(), userAgent); + } + depositoryManagerByQyWx.append("PangFuZhen,"); + JSONObject jsonObject = qyWxOperationService.sendCcMessageToUsers(depositoryManagerByQyWx.toString(), record.getId(), userAgent); - // 删除redis中本订单 - redisTemplate.delete("record:" + record.getId()); + // 删除redis中本订单 + redisTemplate.delete("record:" + record.getId()); + } } + // 修改子订单 + result += depositoryRecordMapper.updateApplicationOutRecordMin(applicationOutMinById); + // 如果是库存转移订单 Map map = new HashMap<>(); if (record.getIstransfer() == 1) { - map.put("quantity", record.getQuantity().toString()); + map.put("quantity", trueOut.toString()); map.put("applicantId", record.getApplicantId()); map.put("minRecordId", applicationOutMinById.getId()); // 出库订单编号 transferMaterial(map); diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java index 4316a94b..c416432a 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java @@ -227,13 +227,17 @@ public class ExcelServiceImpl implements ExcelService { List excelVos = new ArrayList<>(); // 判断当前库位码是否正确,并存入库位中 for (int i = 0; i < excelInfoByInventories.size(); i++) { - Material materialByCode = materialService.findMaterialByCode(excelInfoByInventories.get(i).getCode()); - Map map = new HashMap<>(); - map.put("code",materialByCode.getCode()); - // 获取当前编码的库存 如果有库存,则跳过 - materialService.findInventory(map); - String placeCode = excelInfoByInventories.get(i).getDepositoryCode(); - Integer depositoryId = excelInfoByInventories.get(i).getDepositoryId(); + // 获取当前库存记录 + ExcelInfoByInventory excelInfoByInventory = excelInfoByInventories.get(i); + + // 获取库存明细名称 + String mname = excelInfoByInventory.getMname(); + // 获取当前库存明细规格 + String version = excelInfoByInventory.getVersion(); + + + String placeCode = excelInfoByInventory.getDepositoryCode(); + Integer depositoryId = excelInfoByInventory.getDepositoryId(); // 如果导入时输入库位信息 if (placeCode != null && !placeCode.isEmpty()) { Map placeMap = new HashMap<>(); @@ -245,26 +249,26 @@ public class ExcelServiceImpl implements ExcelService { // 如果有库位 Place place = placeByCondition.get(0); // 如果库位有物料且该库位存放的物料为当前物料 - Integer quantity = ObjectFormatUtil.toInteger(excelInfoByInventories.get(i).getQuantity()); + Integer quantity = ObjectFormatUtil.toInteger(excelInfoByInventory.getQuantity()); if (quantity > place.getMax() - place.getQuantity()) { // 如果当前库位无法放下 String s = dataIndex.get(i); - String msg = s + "出现异常:" + excelInfoByInventories.get(i).getDepositoryCode() + " 该库位无法存放当前数目的物料"; + String msg = s + "出现异常:" + excelInfoByInventory.getDepositoryCode() + " 该库位无法存放当前数目的物料"; errMsg.add(msg); continue; } else { - excelInfoByInventories.get(i).setDepositoryCode(place.getCode()); - excelVos.add(excelInfoByInventories.get(i)); + excelInfoByInventory.setDepositoryCode(place.getCode()); + excelVos.add(excelInfoByInventory); } } else { String s = dataIndex.get(i); - String msg = s + "出现异常:" + excelInfoByInventories.get(i).getDepositoryCode() + " 该仓库没有该库位"; + String msg = s + "出现异常:" + excelInfoByInventory.getDepositoryCode() + " 该仓库没有该库位"; errMsg.add(msg); continue; } } else { // 否则直接加入 - excelInfoByInventories.get(i).setDepositoryCode("0"); // 设置默认库位 - excelVos.add(excelInfoByInventories.get(i)); + excelInfoByInventory.setDepositoryCode("0"); // 设置默认库位 + excelVos.add(excelInfoByInventory); } } diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java index a954e83d..d698916a 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java @@ -392,11 +392,14 @@ public class MaterialServiceImpl implements MaterialService { * @return 库存信息 */ @Override - public Material findMaterialByIds(List ids) { - Material material = materialMapper.findMaterialByIds(ids); - material.setPrice(material.getPrice() / 100); - material.setAmounts(material.getAmounts() / 100); - return material; + public List findMaterialByIds(List ids) { + List materialList = materialMapper.findMaterialByIds(ids); + for (int i = 0; i < materialList.size(); i++) { + Material material = materialList.get(i); + materialList.get(i).setPrice(material.getPrice() / 100); + materialList.get(i).setAmounts(material.getAmounts() / 100); + } + return materialList; } /** diff --git a/src/main/resources/static/vuePage/index.vue b/src/main/resources/static/vuePage/index.vue deleted file mode 100644 index 78a8de12..00000000 --- a/src/main/resources/static/vuePage/index.vue +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - diff --git a/src/main/resources/static/vuePage/scanCode.vue b/src/main/resources/static/vuePage/scanCode.vue deleted file mode 100644 index 180f9e63..00000000 --- a/src/main/resources/static/vuePage/scanCode.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/src/main/resources/templates/pages/application/application-out_min-mobile.html b/src/main/resources/templates/pages/application/application-out_min-mobile.html index ab36f625..5749eaa3 100644 --- a/src/main/resources/templates/pages/application/application-out_min-mobile.html +++ b/src/main/resources/templates/pages/application/application-out_min-mobile.html @@ -59,7 +59,6 @@ var data = d.data; if(state === "0") { for (let i = 0; i < data.length; i++) { - console.log(data[i]); let producedDate = data[i].producedDate === null?"":data[i].producedDate; // 头部信息 lis.push('
  • ' + diff --git a/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html b/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html index cd02d887..53cdcfec 100644 --- a/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html +++ b/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html @@ -23,7 +23,7 @@ - +
    @@ -38,6 +38,7 @@ // 先定义,用于弹出确定框 function isOutTrue() { } + function outQuantityCheck() { } @@ -53,7 +54,7 @@ parent.parent.parent.wx.scanQRCode({ desc: 'scanQRCode desc', needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, - scanType: ["barCode","qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 success: function (res) { // 回调 var result = res.resultStr;//当needResult为1时返回处理结果 @@ -62,7 +63,7 @@ outboundLogic(req); }, - error: function(res) { + error: function (res) { if (res.errMsg.indexOf('function_not_exist') > 0) { alert('版本过低请升级') } @@ -76,52 +77,52 @@ // 弹出出库确定弹出框 isOutTrue = function (req) { var confirmIndex = layer.confirm("确定出库?", { - btn: ["确定", "取消"] - }, + btn: ["确定", "取消"] + }, function () { // 如果确定出库 - layui.$.ajax({ - url: "/depositoryRecord/isCheckOut", - type: "post", - dataType: 'json', - data: JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (res) { - if (res.status === 200) { - // 如果出库成功 - layer.msg("出库成功", - { - icon: 6, - time: 500 - } - , function () { - layer.close(layer.index); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); + layui.$.ajax({ + url: "/depositoryRecord/isCheckOut", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (res) { + if (res.status === 200) { + // 如果出库成功 + layer.msg("出库成功", + { + icon: 6, + time: 500 + } + , function () { + layer.close(layer.index); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); - }); - } else { - // 如果出库失败 - layer.msg(res.statusInfo.detail + ",请重试"); - depository = null; - material = null; - place = null; - // 继续扫描 - html5QrCode.start({facingMode: {exact: "environment"}}, config, qrCodeSuccessCallback); // 继续扫描 - return - } + }); + } else { + // 如果出库失败 + layer.msg(res.statusInfo.detail + ",请重试"); + depository = null; + material = null; + place = null; + // 继续扫描 + html5QrCode.start({facingMode: {exact: "environment"}}, config, qrCodeSuccessCallback); // 继续扫描 - } - }) - }, + } + + } + }) + }, function () { - // 如果取消 - depository = null; - material = null; - place = null; - layer.close(layer.index); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - } + // 如果取消 + depository = null; + material = null; + place = null; + layer.close(layer.index); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); + } ) }; @@ -140,8 +141,8 @@ if (flag === 0) { // 如果是无效码 layer.confirm("扫描失败,是否重新扫描", { - btn: ["确定","取消"] - },function () { + btn: ["确定", "取消"] + }, function () { parent.parent.parent.wx.scanQRCode({ desc: 'scanQRCode desc', needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, @@ -154,19 +155,18 @@ outboundLogic(req); } }) - },function () { + }, function () { // 关闭当前页 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); }) - } - else if (flag === 1) { + } else if (flag === 1) { // 如果是物料 material = data.material; - if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) { + if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) { layer.confirm("出库物料不正确,请重新扫描", { - btn: ["确定","取消"] - }, function(){ + btn: ["确定", "取消"] + }, function () { material = null; parent.parent.parent.wx.scanQRCode({ desc: 'scanQRCode desc', @@ -180,15 +180,14 @@ outboundLogic(req); } }) - }, + }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); + // 关闭当前页 + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); - }) - } - else { + }) + } else { if (depository !== null) { // 如果已经扫描仓库 if (depositoryId !== depository.did && Number(depositoryId) !== depository.did && depositoryId !== depository.did.toString()) { // 如果扫描的仓库不是订单要求的仓库 @@ -209,8 +208,7 @@ // 弹出确定框 outQuantityCheck(param); } - } - else if (place != null) { + } else if (place != null) { // 如果已经扫描库位 if (depositoryId !== place.did && Number(depositoryId) !== place.did && depositoryId !== place.did.toString()) { // 如果当前仓库不是订单对应仓库 @@ -243,14 +241,14 @@ // 弹出确定框 outQuantityCheck(param); } - } - else { + } else { var codeType = data.CodeType; - if(codeType === 1){ + if (codeType === 1) { qrCode = req.qrCode; - }else{ + } else { barCode = req.qrCode; - }; + } + layer.confirm("请扫描仓库或库位", { btn: ["扫描", "取消"] }, function () { // 继续 @@ -276,125 +274,141 @@ } } - } - else if (flag === 2) { - // 如果扫描的为库位 - place = data.place;// 将扫描结果保存到vue中 - if ( material == null) { - // 如果还没有扫描物料 - layer.confirm("请扫描物料", { - btn: ["扫描", "取消"] - }, function () { // 继续 - layer.close(layer.index); // 关闭弹窗 - parent.parent.parent.wx.scanQRCode({ - desc: 'scanQRCode desc', - needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, - scanType: ["barCode","qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 - success: function (res) { - // 回调 - var result = res.resultStr;//当needResult为1时返回处理结果 - var req = {}; - req.qrCode = result; - outboundLogic(req) - } - }) - }, function () { // 取消 + } else if (flag === 2) { + // 如果扫描的为库位 + place = data.place;// 将扫描结果保存到vue中 + if (material == null) { + // 如果还没有扫描物料 + layer.confirm("是否进行扫描物料", { + btn: ["扫描", "选择"] + }, function () { // 继续 + layer.close(layer.index); // 关闭弹窗 + parent.parent.parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + outboundLogic(req) + } + }) + }, function () { // 取消 + // 进行选择对应物料 + layer.open({ + title: '物料列表', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['50%', '50%'], + content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + place.id+'&mcode='+mcode, + end: function () { + var param = {}; + param.id = id; + param.placeId = place.id; + param.qrCode = qrCode; + param.barCode = barCode; + // 弹出确定框 + outQuantityCheck(param); + } + }) + /*var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index);*/ + + }) + } else { + if (depositoryId !== place.did && Number(depositoryId) !== place.did && depositoryId !== place.did.toString()) { + // 如果当前仓库不是订单对应仓库 + depository = null; + place = null; + layer.confirm("当前库位不符合要求,请移步至正确库位", { + btn: ["确定"] + }, function () { + // 关闭当前页 + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); + }) + } else if (place.mcodeList.indexOf(mcode) === -1) { + // 如果当前库位不存在该物料 + depository = null; + place = null; + layer.confirm("出库库位不含该物料,请重新扫描", { + btn: ["确定"] + }, function () { // 关闭当前页 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); - }) } else { - if (depositoryId !== place.did && Number(depositoryId) !== place.did && depositoryId !== place.did.toString()) { - // 如果当前仓库不是订单对应仓库 - depository = null; - place = null; - layer.confirm("当前库位不符合要求,请移步至正确库位", { - btn: ["确定"] - }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }) - } else if (place.mcodeList.indexOf(mcode) === -1) { - // 如果当前库位不存在该物料 - depository = null; - place = null; - layer.confirm("出库库位不含该物料,请重新扫描", { - btn: ["确定"] - }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }) - } else { - var param = {}; - param.id = id; - param.placeId = place.id; - param.qrCode = qrCode; - param.barCode = barCode; - // 弹出确定框 - outQuantityCheck(param); - } + var param = {}; + param.id = id; + param.placeId = place.id; + param.qrCode = qrCode; + param.barCode = barCode; + // 弹出确定框 + outQuantityCheck(param); } + } - } - else if (flag === 3) { + } else if (flag === 3) { // 如果是仓库 depository = data.depository;// 将扫描结果保存到vue中 - if (material == null) { - // 如果还没有扫描物料 - layer.confirm("请扫描物料", { - btn: ["扫描", "取消"] - }, function () { // 继续 - layer.close(layer.index); // 关闭弹窗 - parent.parent.parent.wx.scanQRCode({ - desc: 'scanQRCode desc', - needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, - scanType: ["barCode","qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 - success: function (res) { - // 回调 - var result = res.resultStr;//当needResult为1时返回处理结果 - var req = {}; - req.qrCode = result; - outboundLogic(req); + if (material == null) { + // 如果还没有扫描物料 + layer.confirm("请扫描物料", { + btn: ["扫描", "取消"] + }, function () { // 继续 + layer.close(layer.index); // 关闭弹窗 + parent.parent.parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + outboundLogic(req); - } + } - }); + }); - }, function () { // 取消 + }, function () { // 取消 + // 关闭当前页 + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); + }) + } else { + // 如果已经扫描物料 + if (depositoryId !== depository.id && Number(depositoryId) !== depository.id && depositoryId !== depository.id.toString()) { + // 如果当前仓库不是订单对应仓库 + depository = null; + place = null; + layer.confirm("当前仓库不符合要求,请移步至正确仓库", { + btn: ["确定"] + }, function () { // 关闭当前页 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); }) } else { - // 如果已经扫描物料 - if (depositoryId !== depository.id && Number(depositoryId) !== depository.id && depositoryId !== depository.id.toString()) { - // 如果当前仓库不是订单对应仓库 - depository = null; - place = null; - layer.confirm("当前仓库不符合要求,请移步至正确仓库", { - btn: ["确定"] - }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }) - } else { - // 如果正确 - var param = {}; - param.id = id; - param.qrCode = qrCode; - param.barCode = barCode; - // 弹出确定框 - outQuantityCheck(param); + // 如果正确 + var param = {}; + param.id = id; + param.qrCode = qrCode; + param.barCode = barCode; + // 弹出确定框 + outQuantityCheck(param); - } } } + } } }) @@ -405,17 +419,17 @@ formType: 0, value: quantity, title: '请输入出库数量', - }, function(value, index, elem){ - if(value > quantity){ - layer.msg("非法值,重新输入!",{ - icon: 0, - time: 500 - }, - function () { - outQuantityCheck(req); - }) - }else{ - req.quantity = value; + }, function (value, index, elem) { + if (value > quantity) { + layer.msg("非法值,重新输入!", { + icon: 0, + time: 500 + }, + function () { + outQuantityCheck(req); + }) + } else { + req.trueOut = value; layer.close(index); isOutTrue(req); } diff --git a/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html b/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html new file mode 100644 index 00000000..7c07e2b2 --- /dev/null +++ b/src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html @@ -0,0 +1,53 @@ + + + + + 首页二 + + + + + + + + + +
    + +
    + + + + + + \ No newline at end of file diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml index e5c56d61..c1d019d5 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -142,7 +142,7 @@ - aorm.id,aorm.mid,aorm.depositoryId,aorm.placeId,aorm.quantity,aorm.code,aorm.checkId,aorm.parentId,aorm.transferId + aorm.id,aorm.mid,aorm.depositoryId,aorm.placeId,aorm.quantity,aorm.code,aorm.checkId,aorm.parentId,aorm.transferId,aorm.trueOut @@ -918,7 +922,10 @@ checkId = #{checkId}, - parentId = #{parentId} + parentId = #{parentId}, + + + trueOut = #{trueOut} where id = #{id} diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml index c3b7195c..3f06cbc5 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml +++ b/target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml @@ -544,7 +544,7 @@ SELECT FROM material m WHERE m.id IN - + #{id} diff --git a/target/classes/static/vuePage/index.vue b/target/classes/static/vuePage/index.vue deleted file mode 100644 index 78a8de12..00000000 --- a/target/classes/static/vuePage/index.vue +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - diff --git a/target/classes/static/vuePage/scanCode.vue b/target/classes/static/vuePage/scanCode.vue deleted file mode 100644 index 180f9e63..00000000 --- a/target/classes/static/vuePage/scanCode.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/target/classes/templates/pages/application/application-out_min-mobile.html b/target/classes/templates/pages/application/application-out_min-mobile.html index ab36f625..5749eaa3 100644 --- a/target/classes/templates/pages/application/application-out_min-mobile.html +++ b/target/classes/templates/pages/application/application-out_min-mobile.html @@ -59,7 +59,6 @@ var data = d.data; if(state === "0") { for (let i = 0; i < data.length; i++) { - console.log(data[i]); let producedDate = data[i].producedDate === null?"":data[i].producedDate; // 头部信息 lis.push('
  • ' + diff --git a/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html b/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html index cd02d887..53cdcfec 100644 --- a/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html +++ b/target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html @@ -23,7 +23,7 @@ - +
    @@ -38,6 +38,7 @@ // 先定义,用于弹出确定框 function isOutTrue() { } + function outQuantityCheck() { } @@ -53,7 +54,7 @@ parent.parent.parent.wx.scanQRCode({ desc: 'scanQRCode desc', needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, - scanType: ["barCode","qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 success: function (res) { // 回调 var result = res.resultStr;//当needResult为1时返回处理结果 @@ -62,7 +63,7 @@ outboundLogic(req); }, - error: function(res) { + error: function (res) { if (res.errMsg.indexOf('function_not_exist') > 0) { alert('版本过低请升级') } @@ -76,52 +77,52 @@ // 弹出出库确定弹出框 isOutTrue = function (req) { var confirmIndex = layer.confirm("确定出库?", { - btn: ["确定", "取消"] - }, + btn: ["确定", "取消"] + }, function () { // 如果确定出库 - layui.$.ajax({ - url: "/depositoryRecord/isCheckOut", - type: "post", - dataType: 'json', - data: JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (res) { - if (res.status === 200) { - // 如果出库成功 - layer.msg("出库成功", - { - icon: 6, - time: 500 - } - , function () { - layer.close(layer.index); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); + layui.$.ajax({ + url: "/depositoryRecord/isCheckOut", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (res) { + if (res.status === 200) { + // 如果出库成功 + layer.msg("出库成功", + { + icon: 6, + time: 500 + } + , function () { + layer.close(layer.index); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); - }); - } else { - // 如果出库失败 - layer.msg(res.statusInfo.detail + ",请重试"); - depository = null; - material = null; - place = null; - // 继续扫描 - html5QrCode.start({facingMode: {exact: "environment"}}, config, qrCodeSuccessCallback); // 继续扫描 - return - } + }); + } else { + // 如果出库失败 + layer.msg(res.statusInfo.detail + ",请重试"); + depository = null; + material = null; + place = null; + // 继续扫描 + html5QrCode.start({facingMode: {exact: "environment"}}, config, qrCodeSuccessCallback); // 继续扫描 - } - }) - }, + } + + } + }) + }, function () { - // 如果取消 - depository = null; - material = null; - place = null; - layer.close(layer.index); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - } + // 如果取消 + depository = null; + material = null; + place = null; + layer.close(layer.index); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); + } ) }; @@ -140,8 +141,8 @@ if (flag === 0) { // 如果是无效码 layer.confirm("扫描失败,是否重新扫描", { - btn: ["确定","取消"] - },function () { + btn: ["确定", "取消"] + }, function () { parent.parent.parent.wx.scanQRCode({ desc: 'scanQRCode desc', needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, @@ -154,19 +155,18 @@ outboundLogic(req); } }) - },function () { + }, function () { // 关闭当前页 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); }) - } - else if (flag === 1) { + } else if (flag === 1) { // 如果是物料 material = data.material; - if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) { + if (mcode !== material.code && Number(mcode) !== material.code && mcode !== material.code.toString()) { layer.confirm("出库物料不正确,请重新扫描", { - btn: ["确定","取消"] - }, function(){ + btn: ["确定", "取消"] + }, function () { material = null; parent.parent.parent.wx.scanQRCode({ desc: 'scanQRCode desc', @@ -180,15 +180,14 @@ outboundLogic(req); } }) - }, + }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); + // 关闭当前页 + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); - }) - } - else { + }) + } else { if (depository !== null) { // 如果已经扫描仓库 if (depositoryId !== depository.did && Number(depositoryId) !== depository.did && depositoryId !== depository.did.toString()) { // 如果扫描的仓库不是订单要求的仓库 @@ -209,8 +208,7 @@ // 弹出确定框 outQuantityCheck(param); } - } - else if (place != null) { + } else if (place != null) { // 如果已经扫描库位 if (depositoryId !== place.did && Number(depositoryId) !== place.did && depositoryId !== place.did.toString()) { // 如果当前仓库不是订单对应仓库 @@ -243,14 +241,14 @@ // 弹出确定框 outQuantityCheck(param); } - } - else { + } else { var codeType = data.CodeType; - if(codeType === 1){ + if (codeType === 1) { qrCode = req.qrCode; - }else{ + } else { barCode = req.qrCode; - }; + } + layer.confirm("请扫描仓库或库位", { btn: ["扫描", "取消"] }, function () { // 继续 @@ -276,125 +274,141 @@ } } - } - else if (flag === 2) { - // 如果扫描的为库位 - place = data.place;// 将扫描结果保存到vue中 - if ( material == null) { - // 如果还没有扫描物料 - layer.confirm("请扫描物料", { - btn: ["扫描", "取消"] - }, function () { // 继续 - layer.close(layer.index); // 关闭弹窗 - parent.parent.parent.wx.scanQRCode({ - desc: 'scanQRCode desc', - needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, - scanType: ["barCode","qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 - success: function (res) { - // 回调 - var result = res.resultStr;//当needResult为1时返回处理结果 - var req = {}; - req.qrCode = result; - outboundLogic(req) - } - }) - }, function () { // 取消 + } else if (flag === 2) { + // 如果扫描的为库位 + place = data.place;// 将扫描结果保存到vue中 + if (material == null) { + // 如果还没有扫描物料 + layer.confirm("是否进行扫描物料", { + btn: ["扫描", "选择"] + }, function () { // 继续 + layer.close(layer.index); // 关闭弹窗 + parent.parent.parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + outboundLogic(req) + } + }) + }, function () { // 取消 + // 进行选择对应物料 + layer.open({ + title: '物料列表', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['50%', '50%'], + content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + place.id+'&mcode='+mcode, + end: function () { + var param = {}; + param.id = id; + param.placeId = place.id; + param.qrCode = qrCode; + param.barCode = barCode; + // 弹出确定框 + outQuantityCheck(param); + } + }) + /*var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index);*/ + + }) + } else { + if (depositoryId !== place.did && Number(depositoryId) !== place.did && depositoryId !== place.did.toString()) { + // 如果当前仓库不是订单对应仓库 + depository = null; + place = null; + layer.confirm("当前库位不符合要求,请移步至正确库位", { + btn: ["确定"] + }, function () { + // 关闭当前页 + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); + }) + } else if (place.mcodeList.indexOf(mcode) === -1) { + // 如果当前库位不存在该物料 + depository = null; + place = null; + layer.confirm("出库库位不含该物料,请重新扫描", { + btn: ["确定"] + }, function () { // 关闭当前页 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); - }) } else { - if (depositoryId !== place.did && Number(depositoryId) !== place.did && depositoryId !== place.did.toString()) { - // 如果当前仓库不是订单对应仓库 - depository = null; - place = null; - layer.confirm("当前库位不符合要求,请移步至正确库位", { - btn: ["确定"] - }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }) - } else if (place.mcodeList.indexOf(mcode) === -1) { - // 如果当前库位不存在该物料 - depository = null; - place = null; - layer.confirm("出库库位不含该物料,请重新扫描", { - btn: ["确定"] - }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }) - } else { - var param = {}; - param.id = id; - param.placeId = place.id; - param.qrCode = qrCode; - param.barCode = barCode; - // 弹出确定框 - outQuantityCheck(param); - } + var param = {}; + param.id = id; + param.placeId = place.id; + param.qrCode = qrCode; + param.barCode = barCode; + // 弹出确定框 + outQuantityCheck(param); } + } - } - else if (flag === 3) { + } else if (flag === 3) { // 如果是仓库 depository = data.depository;// 将扫描结果保存到vue中 - if (material == null) { - // 如果还没有扫描物料 - layer.confirm("请扫描物料", { - btn: ["扫描", "取消"] - }, function () { // 继续 - layer.close(layer.index); // 关闭弹窗 - parent.parent.parent.wx.scanQRCode({ - desc: 'scanQRCode desc', - needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, - scanType: ["barCode","qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 - success: function (res) { - // 回调 - var result = res.resultStr;//当needResult为1时返回处理结果 - var req = {}; - req.qrCode = result; - outboundLogic(req); + if (material == null) { + // 如果还没有扫描物料 + layer.confirm("请扫描物料", { + btn: ["扫描", "取消"] + }, function () { // 继续 + layer.close(layer.index); // 关闭弹窗 + parent.parent.parent.wx.scanQRCode({ + desc: 'scanQRCode desc', + needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果, + scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有 + success: function (res) { + // 回调 + var result = res.resultStr;//当needResult为1时返回处理结果 + var req = {}; + req.qrCode = result; + outboundLogic(req); - } + } - }); + }); - }, function () { // 取消 + }, function () { // 取消 + // 关闭当前页 + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); + }) + } else { + // 如果已经扫描物料 + if (depositoryId !== depository.id && Number(depositoryId) !== depository.id && depositoryId !== depository.id.toString()) { + // 如果当前仓库不是订单对应仓库 + depository = null; + place = null; + layer.confirm("当前仓库不符合要求,请移步至正确仓库", { + btn: ["确定"] + }, function () { // 关闭当前页 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); }) } else { - // 如果已经扫描物料 - if (depositoryId !== depository.id && Number(depositoryId) !== depository.id && depositoryId !== depository.id.toString()) { - // 如果当前仓库不是订单对应仓库 - depository = null; - place = null; - layer.confirm("当前仓库不符合要求,请移步至正确仓库", { - btn: ["确定"] - }, function () { - // 关闭当前页 - var index = parent.layer.getFrameIndex(window.name); - parent.layer.close(index); - }) - } else { - // 如果正确 - var param = {}; - param.id = id; - param.qrCode = qrCode; - param.barCode = barCode; - // 弹出确定框 - outQuantityCheck(param); + // 如果正确 + var param = {}; + param.id = id; + param.qrCode = qrCode; + param.barCode = barCode; + // 弹出确定框 + outQuantityCheck(param); - } } } + } } }) @@ -405,17 +419,17 @@ formType: 0, value: quantity, title: '请输入出库数量', - }, function(value, index, elem){ - if(value > quantity){ - layer.msg("非法值,重新输入!",{ - icon: 0, - time: 500 - }, - function () { - outQuantityCheck(req); - }) - }else{ - req.quantity = value; + }, function (value, index, elem) { + if (value > quantity) { + layer.msg("非法值,重新输入!", { + icon: 0, + time: 500 + }, + function () { + outQuantityCheck(req); + }) + } else { + req.trueOut = value; layer.close(index); isOutTrue(req); }