Browse Source

230619委外入库检验通知单,辅料领料单导出

erp、
ling li 1 year ago
parent
commit
783a59f60a
  1. 33
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/WorkOrderInfoController.java
  2. 14
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/WorkOrderDetail.java
  3. 22
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.java
  4. 20
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.java
  5. 51
      ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceInspectionNoticeController.java
  6. 13
      ruoyi-admin/src/main/java/com/ruoyi/outsource/domain/OutsourceOrderMaterial.java
  7. 43
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseAccountReconciliationController.java
  8. 38
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  9. 6
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.java
  10. 6
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.java
  11. 38
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/controller/WarehousingInInfoController.java
  12. 14
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/domain/exportDto/WarehousingInspectionDetailDto.java
  13. 1
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/mapper/WarehousingInInfoMapper.java
  14. 2
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/service/IWarehousingInInfoService.java
  15. 10
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/service/impl/WarehousingInInfoServiceImpl.java
  16. 6
      ruoyi-admin/src/main/resources/mapper/manufacture/WorkOrderDetailMapper.xml
  17. 6
      ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderMaterialMapper.xml
  18. 4
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseAccountReconciliationMapper.xml
  19. 12
      ruoyi-admin/src/main/resources/mapper/storehouse/WarehousingInInfoMapper.xml
  20. 2
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionFL/add.html
  21. 20
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/add.html
  22. 8
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/edit.html
  23. 1018
      ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/add.html
  24. 560
      ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/edit.html
  25. 47
      ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/workOrderInfo.html
  26. 2
      ruoyi-admin/src/main/resources/templates/outsource/outsourceInspectionNotice/add.html
  27. 2
      ruoyi-admin/src/main/resources/templates/outsource/outsourceInspectionNotice/edit.html
  28. 17
      ruoyi-admin/src/main/resources/templates/outsource/outsourceOrderInfo/add.html
  29. 17
      ruoyi-admin/src/main/resources/templates/outsource/outsourceOrderInfo/edit.html
  30. 34
      ruoyi-admin/src/main/resources/templates/purchase/purchaseAccountReconciliation/purchaseAccountReconciliation.html
  31. 797
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDBcp/add.html
  32. 443
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDBcp/edit.html
  33. 230
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDBcp/warehousingInPDBcp.html
  34. 5
      ruoyi-admin/src/main/resources/templates/system/bom/bom.html
  35. 40
      ruoyi-admin/src/main/resources/templates/system/bom/edit.html
  36. 20
      ruoyi-admin/src/main/resources/templates/system/procedure/add.html
  37. 24
      ruoyi-admin/src/main/resources/templates/system/procedure/edit.html
  38. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.class
  39. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/WorkOrderInfoController.class
  40. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/WorkOrderDetail.class
  41. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.class
  42. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.class
  43. BIN
      ruoyi-admin/target/classes/com/ruoyi/purchase/controller/PurchaseOrderController.class
  44. BIN
      ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.class
  45. BIN
      ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.class
  46. 6
      ruoyi-admin/target/classes/mapper/manufacture/WorkOrderDetailMapper.xml
  47. 1018
      ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/add.html
  48. 560
      ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/edit.html
  49. 47
      ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/workOrderInfo.html
  50. 5
      ruoyi-admin/target/classes/templates/system/bom/bom.html
  51. 40
      ruoyi-admin/target/classes/templates/system/bom/edit.html
  52. 20
      ruoyi-admin/target/classes/templates/system/procedure/add.html
  53. 24
      ruoyi-admin/target/classes/templates/system/procedure/edit.html

33
ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/WorkOrderInfoController.java

@ -7,7 +7,6 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -15,15 +14,15 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.manufacture.domain.WorkOrderDetail;
import com.ruoyi.manufacture.domain.WorkOrderInfo;
import com.ruoyi.manufacture.domain.exportDto.WorkOrderDetailDto;
import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto;
import com.ruoyi.system.utils.CellStyleStrategy;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import com.ruoyi.manufacture.domain.WorkOrderDetail;
import com.ruoyi.manufacture.domain.exportDto.WorkOrderInfoDto;
import com.ruoyi.manufacture.service.IWorkOrderDetailService;
import com.ruoyi.manufacture.service.IWorkOrderInfoService;
import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto;
import com.ruoyi.system.utils.CellStyleStrategy;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
@ -160,23 +159,23 @@ public class WorkOrderInfoController extends BaseController
@RequiresPermissions("manufacture:workOrderInfo:remove")
@Log(title = "制工单", businessType = BusinessType.DELETE)
@RequestMapping( "/removeSelectedOrder")
@RequestMapping( "/removeSelected")
@ResponseBody
public String removeSelectedOrder(@RequestParam(value = "orderData") String orderData) {
// System.out.println(orderData);
List<WorkOrderInfo> workOrderInfoList= JSONObject.parseArray(orderData, WorkOrderInfo.class);
WorkOrderInfo workOrderInfo = workOrderInfoService.selectWorkOrderInfoById(workOrderInfoList.get(0).getWorkOrderId());
System.out.println(workOrderInfo);
public String removeSelected(@RequestParam(value = "ids") String ids) {
System.out.println(ids);
String[] idsStr = ids.split(",");
for (int i = 0; i< idsStr.length; i++) {
WorkOrderInfo workOrderInfo = workOrderInfoService.selectWorkOrderInfoById(Long.valueOf(idsStr[i]));
WorkOrderDetail workOrderDetail = new WorkOrderDetail();
workOrderDetail.setWorkOrderNumber(workOrderInfo.getWorkOrderNumber());
List<WorkOrderDetail> WorkOrderDetail1 = workOrderDetailService.selectWorkOrderDetailList(workOrderDetail);
if (WorkOrderDetail1.size()>0) {
for (int i=0;i<WorkOrderDetail1.size();i++) {
workOrderDetailService.deleteWorkOrderDetailById(WorkOrderDetail1.get(i).getWorkOrderDetailId());
List<WorkOrderDetail> list = workOrderDetailService.selectWorkOrderDetailList(workOrderDetail);
if (list.size()>0) {
for (int j=0;j<list.size();j++) {
workOrderDetailService.deleteWorkOrderDetailById(list.get(i).getWorkOrderDetailId());
}
}
}
workOrderInfoService.deleteWorkOrderInfoById(workOrderInfoList.get(0).getWorkOrderId());
workOrderInfoService.deleteWorkOrderInfoByIds(ids);
return "操作成功!";
}

14
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/WorkOrderDetail.java

@ -46,6 +46,10 @@ public class WorkOrderDetail extends BaseEntity
@Excel(name = "用量")
private String materialConsumption;
/** 单位用量 */
@Excel(name = "单位用量")
private String unitUsage;
/** 料号 */
@Excel(name = "料号")
private String itemNumber;
@ -132,6 +136,15 @@ public class WorkOrderDetail extends BaseEntity
{
return materialConsumption;
}
public String getUnitUsage() {
return unitUsage;
}
public void setUnitUsage(String unitUsage) {
this.unitUsage = unitUsage;
}
public void setItemNumber(String itemNumber)
{
this.itemNumber = itemNumber;
@ -180,6 +193,7 @@ public class WorkOrderDetail extends BaseEntity
.append("inventoryUnit", getInventoryUnit())
.append("materialType", getMaterialType())
.append("materialConsumption", getMaterialConsumption())
.append("unitUsage", getUnitUsage())
.append("itemNumber", getItemNumber())
.append("description", getDescription())
.append("standbyOne", getStandbyOne())

22
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.java

@ -1,8 +1,6 @@
package com.ruoyi.manufacture.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -19,7 +17,7 @@ public class MaterialRequisitionDetailDto extends BaseEntity
private static final long serialVersionUID = 1L;
/** 序号 */
@ExcelProperty("序号")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private Integer number;
/** 领料物料id */
@ -31,22 +29,22 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 物料代码 */
@ExcelProperty("物料代码")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String materialCode;
/** 物料名称 */
@ExcelProperty("物料名称")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String materialName;
/** 规格型号 */
@ExcelProperty("规格型号")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String specificationModel;
/** 料号 */
@ExcelProperty("料号")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String itemNumber;
/** 机种 */
@ -55,12 +53,12 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 单位 */
@ExcelProperty("单位")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String inventoryUnit;
/** 计划数量 */
@ExcelProperty("计划数量")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String planQuantity;
/** 说明 */
@ -69,12 +67,12 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 单位用量 */
@ExcelProperty("单位用量")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String unitUsage;
/** 存放位置 */
@ExcelProperty("存放位置")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String storageLocation;
/** 物料类别 */
@ -89,7 +87,7 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 实发数量 */
@ExcelProperty("实发数量")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String actualQuantity;
/** bom阶 */

20
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.java

@ -1,8 +1,6 @@
package com.ruoyi.manufacture.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -22,22 +20,22 @@ public class MaterialRequisitionInfoDto extends BaseEntity
/** 领料单号 */
@ExcelProperty("领料单号")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String materialRequisitionNumber;
/** 订单号码 */
@ExcelProperty("订单号码")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String salesOrderNumber;
/** 制工单号 */
@ExcelProperty("制工单号")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String workOrderNumber;
/** 领料部门 */
@ExcelProperty("领料部门")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String deptName;
/** 领料人 */
@ -66,22 +64,22 @@ public class MaterialRequisitionInfoDto extends BaseEntity
/** 出库日期 */
@ExcelProperty("出库日期")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String outputDate;
/** 成品代码 */
@ExcelProperty("成品代码")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String finishProductCode;
/** 机种 */
@ExcelProperty("机种")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String typeMachine;
/** 工单数量 */
@ExcelProperty("工单数量")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String workOrderQuantity;
/** 备注内容 */
@ -94,7 +92,7 @@ public class MaterialRequisitionInfoDto extends BaseEntity
/** 录入时间 */
@ExcelProperty("录入时间")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String firstAddTime;
/** 修改时间 */

51
ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceInspectionNoticeController.java

@ -55,6 +55,11 @@ public class OutsourceInspectionNoticeController extends BaseController
{
private String prefix = "outsource/outsourceInspectionNotice";
/**
* excel数据量
*/
private Integer excelSize = 8;
@Autowired
private IOutsourceInspectionNoticeService outsourceInspectionNoticeService;
@Autowired
@ -211,23 +216,42 @@ public class OutsourceInspectionNoticeController extends BaseController
Object source = values.next();
WarehousingInspectionDetailDto target = WarehousingInspectionDetailDto.class.newInstance();
BeanUtils.copyProperties(source, target);
mergePrevColUtils.add(number+6,1,1);
++number;
// mergePrevColUtils.add(number+6,1,1);
target.setNumber(++number);
target.setProcedureName(outsourceInspectionNoticeDto.getProcedureName());
detailDtoList.add(target);
}
int size = detailDtoList.size();
if (detailDtoList.size()<excelSize) {
int excelMinus = excelSize-size;
for (int i =0;i<excelMinus;i++) {
WarehousingInspectionDetailDto warehousingInspectionDetailDto = new WarehousingInspectionDetailDto();
warehousingInspectionDetailDto.setNumber(++number);
warehousingInspectionDetailDto.setMaterialCode("");
warehousingInspectionDetailDto.setMaterialName("");
warehousingInspectionDetailDto.setSpecificationModel("");
warehousingInspectionDetailDto.setTypeMachine("");
warehousingInspectionDetailDto.setProductionOrderNumber("");
warehousingInspectionDetailDto.setQualifiedQuantity("");
warehousingInspectionDetailDto.setProductionOrderNumber("");
warehousingInspectionDetailDto.setMaterialQuantity("");
warehousingInspectionDetailDto.setProcedureName("");
detailDtoList.add(warehousingInspectionDetailDto);
}
}
}catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e);
}
System.out.println(detailDtoList);
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("物料检验通知单", "UTF-8").replaceAll("\\+", "%20");
String fileName = URLEncoder.encode("委外入库检验通知单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
String templateFileName = "C:\\exportTemplates\\exportOutsourceInspectionNotice.xlsx";
try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream(), PurchaseMaterialDto.class)
.withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils)
// .registerWriteHandler(mergePrevColUtils)
//样式注册
.registerWriteHandler(horizontalCellStyleStrategyBuilder())
.build()) {
@ -236,13 +260,8 @@ public class OutsourceInspectionNoticeController extends BaseController
excelWriter.fill(detailDtoList, fillConfig, writeSheet);
Map<String, Object> map = MapUtils.newHashMap();
// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now()));
map.put("outsourceOrderNumber", outsourceInspectionNoticeDto.getOutsourceOrderNumber());
map.put("inNoticeNumber", outsourceInspectionNoticeDto.getInNoticeNumber());
map.put("supplierName", outsourceInspectionNoticeDto.getSupplierName());
map.put("warehousingDate", outsourceInspectionNoticeDto.getWarehousingDate());
map.put("stockName", outsourceInspectionNoticeDto.getStockName());
map.put("processingType", outsourceInspectionNoticeDto.getProcessingType());
map.put("receivingPersonnel", outsourceInspectionNoticeDto.getReceivingPersonnel());
map.put("inspectionDate", outsourceInspectionNoticeDto.getInspectionDate().substring(0,10));
excelWriter.fill(map, writeSheet);
}
}
@ -251,8 +270,8 @@ public class OutsourceInspectionNoticeController extends BaseController
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置头字体
WriteFont headWriteFont = new WriteFont();
headWriteFont.setFontHeightInPoints((short) 13);
headWriteFont.setBold(true);
// headWriteFont.setFontHeightInPoints((short) 13);
// headWriteFont.setBold(true);
headWriteCellStyle.setWriteFont(headWriteFont);
//设置头居中
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
@ -263,10 +282,10 @@ public class OutsourceInspectionNoticeController extends BaseController
//垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//单元格边框
contentWriteCellStyle.setBorderTop(BorderStyle.DASHED);
contentWriteCellStyle.setBorderLeft(BorderStyle.DASHED);
contentWriteCellStyle.setBorderRight(BorderStyle.DASHED);
contentWriteCellStyle.setBorderBottom(BorderStyle.DASHED);
contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
return new CellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
}

13
ruoyi-admin/src/main/java/com/ruoyi/outsource/domain/OutsourceOrderMaterial.java

@ -22,6 +22,10 @@ public class OutsourceOrderMaterial extends BaseEntity
@Excel(name = "委外加工订单单号")
private String outsourceOrderNumber;
/** 工单号 */
@Excel(name = "工单号")
private String outsourceWorkNumber;
/** 物料代码 */
@Excel(name = "物料代码")
private String materialCode;
@ -89,6 +93,14 @@ public class OutsourceOrderMaterial extends BaseEntity
this.outsourceOrderNumber = outsourceOrderNumber;
}
public String getOutsourceWorkNumber() {
return outsourceWorkNumber;
}
public void setOutsourceWorkNumber(String outsourceWorkNumber) {
this.outsourceWorkNumber = outsourceWorkNumber;
}
public String getOutsourceOrderNumber()
{
return outsourceOrderNumber;
@ -207,6 +219,7 @@ public class OutsourceOrderMaterial extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceOrderMaterialId", getOutsourceOrderMaterialId())
.append("outsourceOrderNumber", getOutsourceOrderNumber())
.append("outsourceWorkNumber", getOutsourceWorkNumber())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("specificationModel", getSpecificationModel())

43
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseAccountReconciliationController.java

@ -17,6 +17,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.purchase.domain.PurchaseAccountReconciliation;
import com.ruoyi.purchase.domain.exportDto.PurchaseAccountReconciliationDto;
import com.ruoyi.purchase.service.IPurchaseAccountReconciliationService;
import com.ruoyi.storehouse.utils.CustomRowWriteCellHandler;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
@ -31,10 +32,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log;
@ -53,6 +51,8 @@ public class PurchaseAccountReconciliationController extends BaseController
@Autowired
private IPurchaseAccountReconciliationService purchaseAccountReconciliationService;
//excel数据量
private Integer excelSize = 27;
@RequiresPermissions("purchase:purchaseAccountReconciliation:view")
@GetMapping()
@ -159,6 +159,8 @@ public class PurchaseAccountReconciliationController extends BaseController
String supplierCodeNow = request.getParameter("supplierCode").trim();
String supplierNameNow = request.getParameter("supplierName").trim();
String beginWarehousingDateNow = request.getParameter("beginWarehousingDate").trim();
String endWarehousingDateNow = request.getParameter("endWarehousingDate").trim();
String[] idsStr = ids.split(",");
// 创建列合并工具类对象
ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
@ -175,14 +177,36 @@ public class PurchaseAccountReconciliationController extends BaseController
Object source = values.next();
PurchaseAccountReconciliationDto target = PurchaseAccountReconciliationDto.class.newInstance();
BeanUtils.copyProperties(source, target);
mergePrevColUtils.add(number+6,4,1);
number++;
// mergePrevColUtils.add(number+6,4,1);
// number++;
purchaseAccountReconciliationDtoList.add(target);
}
int size = purchaseAccountReconciliationDtoList.size();
if (purchaseAccountReconciliationDtoList.size()<excelSize) {
int excelMinus = excelSize-size;
for (int i =0;i<excelMinus;i++) {
PurchaseAccountReconciliationDto purchaseAccountReconciliationDto = new PurchaseAccountReconciliationDto();
purchaseAccountReconciliationDto.setWarehousingDate("");
purchaseAccountReconciliationDto.setPurchaseOrderNumber("");
purchaseAccountReconciliationDto.setRawSubsidiaryCode("");
purchaseAccountReconciliationDto.setRawSubsidiaryName("");
purchaseAccountReconciliationDto.setSpecificationModel("");
purchaseAccountReconciliationDto.setPurchasingUnit("");
purchaseAccountReconciliationDto.setPurchasePrice("");
purchaseAccountReconciliationDto.setWarehousingQuantity("");
purchaseAccountReconciliationDto.setCommonCurrency("");
purchaseAccountReconciliationDto.setAmountMoney("");
purchaseAccountReconciliationDto.setPurchaseExplain("");
purchaseAccountReconciliationDtoList.add(purchaseAccountReconciliationDto);
}
}
}catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e);
}
Map<Integer, Integer> colMap = new HashMap<>();
colMap.put(5, 6);
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("采购对账订单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
@ -190,9 +214,10 @@ public class PurchaseAccountReconciliationController extends BaseController
try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream(), PurchaseAccountReconciliationDto.class)
.withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils)
// .registerWriteHandler(mergePrevColUtils)
.registerWriteHandler(new CustomRowWriteCellHandler(colMap))
//样式注册
.registerWriteHandler(horizontalCellStyleStrategyBuilder())
// .registerWriteHandler(horizontalCellStyleStrategyBuilder())
.build()) {
WriteSheet writeSheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
@ -200,6 +225,8 @@ public class PurchaseAccountReconciliationController extends BaseController
Map<String, Object> map = MapUtils.newHashMap();
map.put("supplierCode", supplierCodeNow);
map.put("supplierName", supplierNameNow);
map.put("beginWarehousingDate", beginWarehousingDateNow);
map.put("endWarehousingDate", endWarehousingDateNow);
excelWriter.fill(map, writeSheet);
}
}

38
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java

@ -21,8 +21,7 @@ import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto;
import com.ruoyi.purchase.domain.exportDto.PurchaseOrderDto;
import com.ruoyi.purchase.service.IPurchaseMaterialService;
import com.ruoyi.purchase.service.IPurchaseOrderService;
import com.ruoyi.storehouse.utils.CustomRowWriteHandler;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import com.ruoyi.storehouse.utils.CustomRowWriteCellHandler;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
@ -33,11 +32,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log;
@ -188,7 +183,7 @@ public class PurchaseOrderController extends BaseController
purchaseMaterial.setSupplierName(purchaseOrder.getSupplierName());
// 创建列合并工具类对象
ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
// ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial);
List<PurchaseMaterialDto> purchaseMaterialDtoList = new ArrayList<>();
@ -205,32 +200,28 @@ public class PurchaseOrderController extends BaseController
target.setNumber(++number);
purchaseMaterialDtoList.add(target);
total = total + Double.parseDouble(target.getAmountMoney());
purchaseOrderDto.setTotal(total);
}
}catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e);
}
System.out.println(purchaseMaterialDtoList);
// Map<String, Integer> colMap = new HashMap<>();
//// colMap.put(8, 9);
// colMap.put("rowNum1", purchaseMaterialDtoList.size()+8);
// colMap.put("rowNum2", purchaseMaterialDtoList.size()+8);
// colMap.put("colNum1", 8);
// colMap.put("colNum2", 9);
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("采购订单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
Map<Integer, Integer> colMap = new HashMap<>();
colMap.put(2, 3);
colMap.put(11, 12);
// response.setCharacterEncoding("utf-8");
// String fileName = URLEncoder.encode("采购订单", "UTF-8").replaceAll("\\+", "%20");
// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
String templateFileName = "C:\\exportTemplates\\exportPurchaseOrder.xlsx";
try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream(), PurchaseMaterialDto.class)
.withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils)
// .registerWriteHandler(mergePrevColUtils)
//样式注册
// .registerWriteHandler(horizontalCellStyleStrategyBuilder())
.registerWriteHandler(new CustomRowWriteHandler(1))
.registerWriteHandler(new CustomRowWriteHandler(10))
// .registerWriteHandler(new CustomRowWriteCellsHandler(colMap))
// .registerWriteHandler(new CustomRowWriteHandler(1))
// .registerWriteHandler(new CustomRowWriteHandler(10))
.registerWriteHandler(new CustomRowWriteCellHandler(colMap))
.build()) {
WriteSheet writeSheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
@ -247,8 +238,9 @@ public class PurchaseOrderController extends BaseController
map.put("approveName", purchaseOrderDto.getApproveName());
map.put("auditName", purchaseOrderDto.getAuditName());
map.put("purchaseCommander", purchaseOrderDto.getPurchaseCommander());
map.put("total", purchaseOrderDto.getTotal());
map.put("total", total);
excelWriter.fill(map, writeSheet);
// excelWriter.close();
}
}

6
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.java

@ -1,8 +1,6 @@
package com.ruoyi.purchase.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -26,7 +24,7 @@ public class PurchaseMaterialDto extends BaseEntity
/** 订购单号 */
@ExcelProperty("订购单号")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String purchaseOrderNumber;
/** 供应商代码 */
@ -35,7 +33,7 @@ public class PurchaseMaterialDto extends BaseEntity
/** 供应商名称 */
@ExcelProperty("供应商名称")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
// @ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String supplierName;
/** 原辅料代码 */

6
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.java

@ -1,12 +1,11 @@
package com.ruoyi.purchase.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 采购订单对象 purchase_order
*
@ -146,7 +145,8 @@ public class PurchaseOrderDto extends BaseEntity
private String updateInfoTime;
@ExcelProperty(value = "金额总计")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
// @ContentStyle(horizontalAlignment = com.alibaba.excel.enums.poi.HorizontalAlignmentEnum.CENTER)
private Double total;
public Double getTotal() {

38
ruoyi-admin/src/main/java/com/ruoyi/storehouse/controller/WarehousingInInfoController.java

@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
@ -63,6 +64,7 @@ public class WarehousingInInfoController extends BaseController
private String prefixFinishProduct = "storehouse/warehousingInFinishProduct";
private String prefixRGFinishProduct = "storehouse/warehousingInRGFinishProduct";
private String prefixPDFinishProduct = "storehouse/warehousingInPDFinishProduct";
private String prefixPDBcp = "storehouse/warehousingInPDBcp";
@Autowired
private IWarehousingInInfoService warehousingInInfoService;
@ -121,6 +123,12 @@ public class WarehousingInInfoController extends BaseController
{
return prefixPDFinishProduct + "/warehousingInPDFinishProduct";
}
@RequiresPermissions("storehouse:warehousingInInfo:viewPDBcp")
@GetMapping("/viewPDBcp")
public String warehousingInPDBcp()
{
return prefixPDBcp + "/warehousingInPDBcp";
}
// @RequiresPermissions("storehouse:warehousingInInfo:list")
@ -181,6 +189,15 @@ public class WarehousingInInfoController extends BaseController
List<WarehousingInInfo> list = warehousingInInfoService.selectWarehousingInPDFinishProductByNumber(warehousingInInfo);
return getDataTable(list);
}
@RequiresPermissions("storehouse:warehousingInInfo:listPDBcp")
@PostMapping("/listPDBcp")
@ResponseBody
public TableDataInfo listPDBcp(WarehousingInInfo warehousingInInfo)
{
startPage();
List<WarehousingInInfo> list = warehousingInInfoService.selectWarehousingInPDBcpByNumber(warehousingInInfo);
return getDataTable(list);
}
/**
* 导出入库列表
@ -229,6 +246,11 @@ public class WarehousingInInfoController extends BaseController
{
return prefixPDFinishProduct + "/add";
}
@GetMapping("/addPDBcp")
public String addPDBcp()
{
return prefixPDBcp + "/add";
}
/**
* 新增保存入库
@ -280,6 +302,13 @@ public class WarehousingInInfoController extends BaseController
mmap.put("warehousingInInfo", warehousingInInfo);
return prefixPDFinishProduct + "/edit";
}
@GetMapping("/editPDBcp/{warehousingInfoId}")
public String editPDBcp(@PathVariable("warehousingInfoId") Long warehousingInfoId, ModelMap mmap)
{
WarehousingInInfo warehousingInInfo = warehousingInInfoService.selectWarehousingInInfoById(warehousingInfoId);
mmap.put("warehousingInInfo", warehousingInInfo);
return prefixPDBcp + "/edit";
}
/**
* 修改保存入库
@ -336,6 +365,11 @@ public class WarehousingInInfoController extends BaseController
public Result getPDFinishProductId() throws Exception {
return Result.getSuccessResult(warehousingInInfoService.getPDFinishProductId());
}
@PostMapping("/getPDBcpId")
@ResponseBody
public Result getPDBcpId() throws Exception {
return Result.getSuccessResult(warehousingInInfoService.getPDBcpId());
}
@RequiresPermissions("storehouse:warehousingInInfo:remove")
@Log(title = "入库", businessType = BusinessType.DELETE)
@ -528,7 +562,9 @@ public class WarehousingInInfoController extends BaseController
warehousingFinishProductNotice.setWorkOrderNumber(warehousingInInfo.getWorkOrderNumber());
List<WarehousingFinishProductNotice> warehousingFinishProductNoticeList = warehousingFinishProductNoticeService.selectWarehousingFinishProductNoticeList(warehousingFinishProductNotice);
target.setSalesOrderNumber(workOrderInfoList.get(0).getSalesOrderNumber());
target.setAcceptanceQuantity(String.valueOf(Float.valueOf(warehousingFinishProductNoticeList.get(0).getQualifiedQuantity())+Float.valueOf(warehousingFinishProductNoticeList.get(0).getUnqualifiedQuantity())));
BigDecimal qualifiedQuantity = new BigDecimal(warehousingFinishProductNoticeList.get(0).getQualifiedQuantity());
BigDecimal unQualifiedQuantity = new BigDecimal(warehousingFinishProductNoticeList.get(0).getUnqualifiedQuantity());
target.setAcceptanceQuantity(String.valueOf(qualifiedQuantity.add(unQualifiedQuantity)));
target.setRejectionQuantity(warehousingFinishProductNoticeList.get(0).getUnqualifiedQuantity());
target.setNumber(++number);
target.setInspectionStatus("OK");

14
ruoyi-admin/src/main/java/com/ruoyi/storehouse/domain/exportDto/WarehousingInspectionDetailDto.java

@ -80,10 +80,15 @@ public class WarehousingInspectionDetailDto extends BaseEntity
/** 厂商批号 */
@ExcelProperty("厂商批号")
private String manufacturerBatchNumber;
/** 生产单号 */
@Excel(name = "生产单号")
private String productionOrderNumber;
/** 加工工序 */
@Excel(name = "加工工序")
private String procedureName;
/** 备用一 */
private String standbyOne;
@ -269,6 +274,14 @@ public class WarehousingInspectionDetailDto extends BaseEntity
this.productionOrderNumber = productionOrderNumber;
}
public String getProcedureName() {
return procedureName;
}
public void setProcedureName(String procedureName) {
this.procedureName = procedureName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -290,6 +303,7 @@ public class WarehousingInspectionDetailDto extends BaseEntity
.append("receiptBatchNumber", getReceiptBatchNumber())
.append("manufacturerBatchNumber", getManufacturerBatchNumber())
.append("productionOrderNumber", getProductionOrderNumber())
.append("procedureName", getProcedureName())
.append("standbyOne", getStandbyOne())
.append("standbyTwo", getStandbyTwo())
.toString();

1
ruoyi-admin/src/main/java/com/ruoyi/storehouse/mapper/WarehousingInInfoMapper.java

@ -32,6 +32,7 @@ public interface WarehousingInInfoMapper
public List<WarehousingInInfo> selectWarehousingInFinishProductByNumber(WarehousingInInfo warehousingInInfo);
public List<WarehousingInInfo> selectWarehousingInRGFinishProductByNumber(WarehousingInInfo warehousingInInfo);
public List<WarehousingInInfo> selectWarehousingInPDFinishProductByNumber(WarehousingInInfo warehousingInInfo);
public List<WarehousingInInfo> selectWarehousingInPDBcpByNumber(WarehousingInInfo warehousingInInfo);
/**
* 新增入库

2
ruoyi-admin/src/main/java/com/ruoyi/storehouse/service/IWarehousingInInfoService.java

@ -32,6 +32,7 @@ public interface IWarehousingInInfoService
public List<WarehousingInInfo> selectWarehousingInFinishProductByNumber(WarehousingInInfo warehousingInInfo);
public List<WarehousingInInfo> selectWarehousingInRGFinishProductByNumber(WarehousingInInfo warehousingInInfo);
public List<WarehousingInInfo> selectWarehousingInPDFinishProductByNumber(WarehousingInInfo warehousingInInfo);
public List<WarehousingInInfo> selectWarehousingInPDBcpByNumber(WarehousingInInfo warehousingInInfo);
/**
* 新增入库
@ -70,4 +71,5 @@ public interface IWarehousingInInfoService
public String getFinishProductId();
public String getRGFinishProductId();
public String getPDFinishProductId();
public String getPDBcpId();
}

10
ruoyi-admin/src/main/java/com/ruoyi/storehouse/service/impl/WarehousingInInfoServiceImpl.java

@ -70,6 +70,11 @@ public class WarehousingInInfoServiceImpl implements IWarehousingInInfoService
{
return warehousingInInfoMapper.selectWarehousingInPDFinishProductByNumber(warehousingInInfo);
}
@Override
public List<WarehousingInInfo> selectWarehousingInPDBcpByNumber(WarehousingInInfo warehousingInInfo)
{
return warehousingInInfoMapper.selectWarehousingInPDBcpByNumber(warehousingInInfo);
}
/**
@ -145,4 +150,9 @@ public class WarehousingInInfoServiceImpl implements IWarehousingInInfoService
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "CPIN" + time;
}
@Override
public String getPDBcpId() {
String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(System.currentTimeMillis());
return "YLIN" + time;
}
}

6
ruoyi-admin/src/main/resources/mapper/manufacture/WorkOrderDetailMapper.xml

@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inventoryUnit" column="inventory_unit" />
<result property="materialType" column="material_type" />
<result property="materialConsumption" column="material_consumption" />
<result property="unitUsage" column="unit_usage" />
<result property="itemNumber" column="item_number" />
<result property="description" column="description" />
<result property="standbyOne" column="standby_one" />
@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWorkOrderDetailVo">
select work_order_detail_id, work_order_number, material_code, material_name, specification_model, inventory_unit, material_type, material_consumption, item_number, description, standby_one, standby_two from work_order_detail
select work_order_detail_id, work_order_number, material_code, material_name, specification_model, inventory_unit, material_type, material_consumption, unit_usage, item_number, description, standby_one, standby_two from work_order_detail
</sql>
<select id="selectWorkOrderDetailList" parameterType="WorkOrderDetail" resultMap="WorkOrderDetailResult">
@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryUnit != null">inventory_unit,</if>
<if test="materialType != null">material_type,</if>
<if test="materialConsumption != null">material_consumption,</if>
<if test="unitUsage != null">unit_usage,</if>
<if test="itemNumber != null">item_number,</if>
<if test="description != null">description,</if>
<if test="standbyOne != null">standby_one,</if>
@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialConsumption != null">#{materialConsumption},</if>
<if test="unitUsage != null">#{unitUsage},</if>
<if test="itemNumber != null">#{itemNumber},</if>
<if test="description != null">#{description},</if>
<if test="standbyOne != null">#{standbyOne},</if>
@ -80,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialConsumption != null">material_consumption = #{materialConsumption},</if>
<if test="unitUsage != null">unit_usage = #{unitUsage},</if>
<if test="itemNumber != null">item_number = #{itemNumber},</if>
<if test="description != null">description = #{description},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>

6
ruoyi-admin/src/main/resources/mapper/outsource/OutsourceOrderMaterialMapper.xml

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="OutsourceOrderMaterial" id="OutsourceOrderMaterialResult">
<result property="outsourceOrderMaterialId" column="outsource_order_material_id" />
<result property="outsourceOrderNumber" column="outsource_order_number" />
<result property="outsourceWorkNumber" column="outsource_work_number" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="specificationModel" column="specification_model" />
@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectOutsourceOrderMaterialVo">
select outsource_order_material_id, outsource_order_number, material_code, material_name, specification_model, material_type, inventory_unit, quantity, process_price, process_fee, delivery_date, description, standby_one, standby_two from outsource_order_material
select outsource_order_material_id, outsource_order_number, outsource_work_number, material_code, material_name, specification_model, material_type, inventory_unit, quantity, process_price, process_fee, delivery_date, description, standby_one, standby_two from outsource_order_material
</sql>
<select id="selectOutsourceOrderMaterialList" parameterType="OutsourceOrderMaterial" resultMap="OutsourceOrderMaterialResult">
@ -45,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into outsource_order_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outsourceOrderNumber != null">outsource_order_number,</if>
<if test="outsourceWorkNumber != null">outsource_work_number,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="specificationModel != null">specification_model,</if>
@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outsourceOrderNumber != null">#{outsourceOrderNumber},</if>
<if test="outsourceWorkNumber != null">#{outsourceWorkNumber},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="specificationModel != null">#{specificationModel},</if>
@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update outsource_order_material
<trim prefix="SET" suffixOverrides=",">
<if test="outsourceOrderNumber != null">outsource_order_number = #{outsourceOrderNumber},</if>
<if test="outsourceWorkNumber != null">outsource_work_number = #{outsourceWorkNumber},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="specificationModel != null">specification_model = #{specificationModel},</if>

4
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseAccountReconciliationMapper.xml

@ -84,8 +84,8 @@ WHERE
<if test="commonCurrency != null and commonCurrency != ''"> and pm.common_currency = #{commonCurrency}</if>
<if test="params.beginDeliveryTime != null and params.beginDeliveryTime != '' and params.endDeliveryTime != null and params.endDeliveryTime != ''"> and pm.delivery_time between #{params.beginDeliveryTime} and #{params.endDeliveryTime}</if>
<if test="accountReconciliationFlag != null and accountReconciliationFlag != ''"> and pm.account_reconciliation_flag = #{accountReconciliationFlag}</if>
<if test="warehousingNumber != null and warehousingNumber != ''"> and wii.warehousing_number like concat('%', #{warehousingNumber}, '%')</if>
<if test="params.beginWarehousingDate != null and params.beginWarehousingDate != '' and params.endWarehousingDate != null and params.endWarehousingDate != ''"> and wii.warehousing_date between #{params.beginWarehousingDate} and #{params.endWarehousingDate}</if>
<if test="warehousingNumber != null and warehousingNumber != ''"> and wi.warehousing_number like concat('%', #{warehousingNumber}, '%')</if>
<if test="params.beginWarehousingDate != null and params.beginWarehousingDate != '' and params.endWarehousingDate != null and params.endWarehousingDate != ''"> and wi.warehousing_date between #{params.beginWarehousingDate} and #{params.endWarehousingDate}</if>
</select>
<!-- -->
<select id="selectPurchaseAccountReconciliationById" parameterType="Long" resultMap="PurchaseAccountReconciliationResult">

12
ruoyi-admin/src/main/resources/mapper/storehouse/WarehousingInInfoMapper.xml

@ -119,6 +119,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="exportSales != null and exportSales != ''"> and export_sales = #{exportSales}</if>
</select>
<select id="selectWarehousingInPDBcpByNumber" parameterType="WarehousingInInfo" resultMap="WarehousingInInfoResult">
<include refid="selectWarehousingInInfoVo"/>
where warehousing_number like '%YLIN%' AND warehousing_category = 10
<if test="warehousingNumber != null and warehousingNumber != ''"> and warehousing_number like concat('%', #{warehousingNumber}, '%')</if>
<if test="inNoticeNumber != null and inNoticeNumber != ''"> and in_notice_number like concat('%', #{inNoticeNumber}, '%')</if>
<if test="warehousingCategory != null and warehousingCategory != ''"> and warehousing_category = #{warehousingCategory}</if>
<if test="purchaseOrderNumber != null and purchaseOrderNumber != ''"> and purchase_order_number like concat('%', #{purchaseOrderNumber}, '%')</if>
<if test="params.beginWarehousingDate != null and params.beginWarehousingDate != '' and params.endWarehousingDate != null and params.endWarehousingDate != ''"> and warehousing_date between #{params.beginWarehousingDate} and #{params.endWarehousingDate}</if>
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if>
<if test="exportSales != null and exportSales != ''"> and export_sales = #{exportSales}</if>
</select>
<insert id="insertWarehousingInInfo" parameterType="WarehousingInInfo" useGeneratedKeys="true" keyProperty="warehousingInfoId">
insert into warehousing_in_info
<trim prefix="(" suffix=")" suffixOverrides=",">

2
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionFL/add.html

@ -637,7 +637,7 @@
inventoryUnit: data[i].inventoryUnit,
planQuantity: data[i].materialConsumption,
description: '',
// unitUsage: '',
// unitUsage: data[i].unitUsage,
storageLocation: '',
materialType: data[i].materialType
}

20
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/add.html

@ -355,7 +355,7 @@
// $.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize());
// }
let getData=$('#addMaterialTable').bootstrapTable('getData', true)
console.log(JSON.stringify(getData))
// console.log(JSON.stringify(getData))
if(getData.length > 0){
//确认添加选中的物料数据
confirmMaterial();
@ -457,12 +457,12 @@
validate: function (value) {
}
},
formatter: (value, row, index) => {
let quantity = $("input[name='workOrderQuantity']").val();
row.planQuantity = quantity * row.unitUsage;
return quantity * row.unitUsage;
}
// formatter: (value, row, index) => {
// let quantity = $("input[name='workOrderQuantity']").val();
// row.planQuantity = quantity * row.unitUsage;
// return quantity * row.unitUsage;
// }
},
{
field: 'description',
@ -647,9 +647,9 @@
specificationModel: data[i].specificationModel,
itemNumber: data[i].itemNumber,
inventoryUnit: data[i].inventoryUnit,
planQuantity: '',
planQuantity: data[i].materialConsumption,
description: '',
unitUsage: data[i].materialConsumption,
unitUsage: data[i].unitUsage,
storageLocation: '',
materialType: data[i].materialType
}
@ -679,9 +679,9 @@
specificationModel: data[i].specificationModel,
itemNumber: data[i].itemNumber,
inventoryUnit: data[i].inventoryUnit,
planQuantity: '',
planQuantity: data[i].materialConsumption,
description: '',
unitUsage: data[i].materialConsumption,
unitUsage: data[i].unitUsage,
storageLocation: '',
materialType: data[i].materialType
}

8
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/edit.html

@ -455,11 +455,11 @@
validate: function (value) {
}
},
formatter: (value, row, index) => {
let quantity = $("input[name='workOrderQuantity']").val();
return quantity * row.unitUsage;
}
// formatter: (value, row, index) => {
// let quantity = $("input[name='workOrderQuantity']").val();
// return quantity * row.unitUsage;
// }
},
{
field: 'description',

1018
ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/add.html

File diff suppressed because it is too large

560
ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/edit.html

@ -322,6 +322,9 @@
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var raw_id_temp = [];
var subsidiary_id_temp = [];
var bcp_id_temp = [];
var getData = [[${workOrderInfo}]];
// console.log(getData)
// console.log(getData.workOrderNumber)
@ -572,6 +575,18 @@
}
}
},
{
field: 'unitUsage',
title: '单位用量',
editable: {
type: 'text',
title: '单位用量',
emptytext: '单位用量',
validate: function (value) {
}
}
},
{
field: 'itemNumber',
title: '料号',
@ -896,9 +911,9 @@
// console.log(index)
// console.log(row.finishProductCode)
// console.log($detail)
$detail.html('<table class="table-container" id="raw_table"></table>' +
'<table class="table-container" id="subsidiary_table"></table>'+
'<table class="table-container" id="bcp_table"></table>'
$detail.html('<table class="table-container" id="raw_table'+row.bomBcpId+'"></table>' +
'<table class="table-container" id="subsidiary_table'+row.bomBcpId+'"></table>'+
'<table class="table-container" id="bcp_table'+row.bomBcpId+'"></table>'
).find('table');
initRawDetail(index,row,$detail);
initSubsidiaryDetail(index,row,$detail);
@ -911,8 +926,10 @@
//初始化子表格(循环) 一阶--原料
initRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "raw_table"+row.bomBcpId;
raw_id_temp.push(tableId)
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#raw_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1005,8 +1022,10 @@
//初始化子表格(循环) 一阶--辅料
initSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "subsidiary_table"+row.bomBcpId;
subsidiary_id_temp.push(tableId)
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#subsidiary_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1099,8 +1118,10 @@
//初始化子表格(循环) 一阶--半成品
initBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_table"+row.bomBcpId;
bcp_id_temp.push(tableId)
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#bcp_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomBcp/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1134,6 +1155,11 @@
{
checkbox: true
},
{
field: 'bomBcpId',
title: 'bom半成品id',
visible: false
},
{
field: 'bcpCode',
title: '半成品代码(二阶)'
@ -1155,11 +1181,11 @@
title: '单位'
},
{
field: 'bcpConsumption',
field: 'bcpMaterialConsumption',
title: '用量'
},
{
field: 'bcpLoss',
field: 'bcpMaterialLoss',
title: '损耗%'
},
{
@ -1180,14 +1206,14 @@
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $bcpdetail) {
$bcpdetail.html('<table class="table-container" id="bcp_raw_table"></table>' +
'<table class="table-container" id="bcp_subsidiary_table"></table>' +
'<table class="table-container" id="bcp_bcp_table"></table>'
$bcpdetail.html('<table class="table-container" id="bcp_raw_table'+row.bomBcpId+'"></table>' +
'<table class="table-container" id="bcp_subsidiary_table'+row.bomBcpId+'"></table>'
// '<table class="table-container" id="bcp_bcp_table'+row.bomBcpId+'"></table>'
).find('table');
initBcpDetail(index, row, $bcpdetail);
initBcpRawDetail(index, row, $bcpdetail);
initBcpSubsidiaryDetail(index, row, $bcpdetail);
initBcpBcpDetail(index, row, $bcpdetail);
// initBcpBcpDetail(index, row, $bcpdetail);
}
})
@ -1195,9 +1221,11 @@
//初始化子表格(循环) 二阶--原料
initBcpRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_raw_table"+row.bomBcpId;
raw_id_temp.push(tableId)
// var bcpVersionNumber = row.bcpVersionNumber;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#bcp_raw_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1291,9 +1319,11 @@
//初始化子表格(循环) 二阶--辅料
initBcpSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_subsidiary_table"+row.bomBcpId;
subsidiary_id_temp.push(tableId)
// var bcpVersionNumber = row.bcpVersionNumber;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#bcp_subsidiary_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1384,6 +1414,297 @@
})
}
//初始化子表格(循环) 二阶--半成品
/* initBcpBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_bcp_table"+row.bomBcpId;
// var bcpVersionNumber = row.bcpVersionNumber;
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomBcp/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
detailView: true,
columns: [
{
checkbox: true
},
{
field: 'bomBcpId',
title: 'bom半成品id',
visible: false
},
{
field: 'bcpCode',
title: '半成品代码(三阶)'
},
{
field: 'bcpName',
title: '半成品名称'
},
{
field: 'bcpVersionNumber',
title: '版本号'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'bcpConsumption',
title: '用量'
},
{
field: 'bcpLoss',
title: '损耗%'
},
{
field: 'customerNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $bcpdetail) {
$bcpdetail.html('<table class="table-container" id="bcp_bcp_raw_table'+row.bomBcpId+'"></table>' +
'<table class="table-container" id="bcp_bcp_subsidiary_table'+row.bomBcpId+'"></table>'
).find('table');
initBcpBcpDetail(index, row, $bcpdetail);
initBcpBcpRawDetail(index, row, $bcpdetail);
initBcpBcpSubsidiaryDetail(index, row, $bcpdetail);
}
})
}*/
//初始化子表格(循环) 三阶--原料
/*initBcpBcpRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_bcp_raw_table"+row.bomBcpId;
// var bcpVersionNumber = row.bcpVersionNumber;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
field: 'rawMaterialId',
title: '原料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'rawMaterialCode',
title: '原料代码'
},
{
field: 'rawMaterialName',
title: '原料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'rawMaterialConsumption',
title: '用量'
},
{
field: 'rawMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpBcpRawDetail(index, row, $detail);
}
})
}*/
//初始化子表格(循环) 三阶--辅料
/*initBcpBcpSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_bcp_subsidiary_table"+row.bomBcpId;
// var bcpVersionNumber = row.bcpVersionNumber;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
field: 'subsidiaryMaterialId',
title: 'bom辅料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'subsidiaryMaterialCode',
title: '辅料代码'
},
{
field: 'subsidiaryMaterialName',
title: '辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'subsidiaryMaterialConsumption',
title: '用量'
},
{
field: 'subsidiaryMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpSubsidiaryDetail(index, row, $detail);
}
})
}*/
//关闭BOM信息
function closeBomDetailModal() {
@ -1392,22 +1713,33 @@
//添加BOM材料信息
function addBomDetailToTable() {
// console.log(raw_id_temp)
// console.log(subsidiary_id_temp)
// console.log(bcp_id_temp)
var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections");
var dataSubsidiary = $("#subsidiaryMaterialBomTable").bootstrapTable("getSelections");
var dataBcp = $("#bcpMaterialBomTable").bootstrapTable("getSelections");
var dataRawTable = $("#raw_table").bootstrapTable("getSelections");
var dataSubsidiaryTable = $("#subsidiary_table").bootstrapTable("getSelections");
var dataBcpTable = $("#bcp_table").bootstrapTable("getSelections");
var dataBcpRawTable = $("#bcp_raw_table").bootstrapTable("getSelections");
var dataBcpSubsidiaryTable = $("#bcp_subsidiary_table").bootstrapTable("getSelections");
// var dataRawTable = $("#raw_table").bootstrapTable("getSelections");
// var dataSubsidiaryTable = $("#subsidiary_table").bootstrapTable("getSelections");
// var dataBcpTable = $("#bcp_table").bootstrapTable("getSelections");
// var dataBcpRawTable = $("#bcp_raw_table").bootstrapTable("getSelections");
// var dataBcpSubsidiaryTable = $("#bcp_subsidiary_table").bootstrapTable("getSelections");
var count = $('#addBomMaterialTable').bootstrapTable('getData').length;
var workOrderNumber = $("input[name='workOrderNumber']").val();
var orderQuantity = $("input[name='orderQuantity']").val();
for (let i = 0; i < dataRaw.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataRaw[i].rawMaterialCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
var loss;
if (dataRaw[i].rawMaterialLoss !== null || dataRaw[i].rawMaterialLoss !== '') {
loss = dataRaw[i].rawMaterialLoss.substring(0,dataRaw[i].rawMaterialLoss.length-1)
} else {
loss = 0;
}
// console.log(loss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
@ -1417,7 +1749,8 @@
specificationModel: dataRaw[i].specificationModel,
inventoryUnit: dataRaw[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataRaw[i].rawMaterialConsumption,
materialConsumption: (Number(dataRaw[i].rawMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataRaw[i].rawMaterialConsumption,
itemNumber: dataRaw[i].supplierNumber,
description: dataRaw[i].remarks
}
@ -1429,6 +1762,13 @@
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
// var loss;
// if (dataSubsidiary[i].subsidiaryMaterialLoss !== null || dataSubsidiary[i].subsidiaryMaterialLoss !== '') {
// loss = dataSubsidiary[i].subsidiaryMaterialLoss.substring(0,dataSubsidiary[i].subsidiaryMaterialLoss.length-1)
// } else {
// loss = 0;
// }
// console.log(loss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
@ -1438,7 +1778,10 @@
specificationModel: dataSubsidiary[i].specificationModel,
inventoryUnit: dataSubsidiary[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataSubsidiary[i].subsidiaryMaterialConsumption,
// materialConsumption: (Number(dataSubsidiary[i].subsidiaryMaterialConsumption)+Number(loss/100))*orderQuantity,
materialConsumption: '',
// unitUsage: dataSubsidiary[i].subsidiaryMaterialConsumption,
unitUsage: '',
itemNumber: dataSubsidiary[i].supplierNumber,
description: dataSubsidiary[i].remarks
}
@ -1450,6 +1793,13 @@
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
var loss;
if (dataBcp[i].bcpMaterialLoss !== null || dataBcp[i].bcpMaterialLoss !== '') {
loss = dataBcp[i].bcpMaterialLoss.substring(0,dataBcp[i].bcpMaterialLoss.length-1)
} else {
loss = 0;
}
// console.log(loss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
@ -1459,125 +1809,123 @@
specificationModel: dataBcp[i].specificationModel,
inventoryUnit: dataBcp[i].inventoryUnit,
materialType: '半成品',
materialConsumption: dataBcp[i].bcpMaterialConsumption,
materialConsumption: (Number(dataBcp[i].bcpMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataBcp[i].bcpMaterialConsumption,
itemNumber: dataBcp[i].customerNumber,
description: dataBcp[i].remarks
}
});
}
for (let i = 0; i < dataRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
//原料
for (let i = 0; i < raw_id_temp.length; i++) {
var dataRawTable = $("#"+raw_id_temp[i]).bootstrapTable("getSelections");
// console.log(dataRawTable)
for (let j = 0; j < dataRawTable.length; j++) {
var loss;
if (dataRawTable[j].rawMaterialLoss !== null || dataRawTable[j].rawMaterialLoss !== '') {
loss = dataRawTable[j].rawMaterialLoss.substring(0,dataRawTable[j].rawMaterialLoss.length-1)
} else {
loss = 0;
}
// console.log(dataRawTable[j].rawMaterialConsumption)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
index: count + j,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataRawTable[i].rawMaterialCode,
materialName: dataRawTable[i].rawMaterialName,
specificationModel: dataRawTable[i].specificationModel,
inventoryUnit: dataRawTable[i].inventoryUnit,
materialCode: dataRawTable[j].rawMaterialCode,
materialName: dataRawTable[j].rawMaterialName,
specificationModel: dataRawTable[j].specificationModel,
inventoryUnit: dataRawTable[j].inventoryUnit,
materialType: '原料',
materialConsumption: dataRawTable[i].rawMaterialConsumption,
itemNumber: dataRawTable[i].supplierNumber,
materialConsumption: (Number(dataRawTable[j].rawMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataRawTable[j].rawMaterialConsumption,
itemNumber: dataRawTable[j].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataSubsidiaryTable[i].specificationModel,
inventoryUnit: dataSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataSubsidiaryTable[i].supplierNumber,
description: ''
}
});
//辅料
for (let i = 0; i < subsidiary_id_temp.length; i++) {
var dataSubsidiaryTable = $("#"+subsidiary_id_temp[i]).bootstrapTable("getSelections");
// console.log(dataSubsidiaryTable)
for (let j = 0; j < dataSubsidiaryTable.length; j++) {
var loss;
if (dataSubsidiaryTable[j].subsidiaryMaterialLoss !== null || dataSubsidiaryTable[j].subsidiaryMaterialLoss !== '') {
loss = dataSubsidiaryTable[j].subsidiaryMaterialLoss.substring(0,dataSubsidiaryTable[j].subsidiaryMaterialLoss.length-1)
} else {
loss = 0;
}
for (let i = 0; i < dataBcpTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
index: count + j,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpTable[i].bcpCode,
materialName: dataBcpTable[i].bcpName,
specificationModel: dataBcpTable[i].specificationModel,
inventoryUnit: dataBcpTable[i].inventoryUnit,
materialType: '半成品',
materialConsumption: dataBcpTable[i].bcpConsumption,
itemNumber: dataBcpTable[i].customerNumber,
materialCode: dataSubsidiaryTable[j].subsidiaryMaterialCode,
materialName: dataSubsidiaryTable[j].subsidiaryMaterialName,
specificationModel: dataSubsidiaryTable[j].specificationModel,
inventoryUnit: dataSubsidiaryTable[j].inventoryUnit,
materialType: '辅料',
// materialConsumption: (Number(dataSubsidiaryTable[j].subsidiaryMaterialConsumption)+Number(loss/100))*orderQuantity,
materialConsumption: '',
// unitUsage: dataSubsidiaryTable[j].subsidiaryMaterialConsumption,
unitUsage: '',
itemNumber: dataSubsidiaryTable[j].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpRawTable[i].rawMaterialCode,
materialName: dataBcpRawTable[i].rawMaterialName,
specificationModel: dataBcpRawTable[i].specificationModel,
inventoryUnit: dataBcpRawTable[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataBcpRawTable[i].rawMaterialConsumption,
itemNumber: dataBcpRawTable[i].supplierNumber,
description: ''
// $("#"+subsidiary_id_temp[i]).bootstrapTable("uncheckAll");
}
});
//半成品
for (let i = 0; i < bcp_id_temp.length; i++) {
var dataBcpTable = $("#"+bcp_id_temp[i]).bootstrapTable("getSelections");
// console.log(dataBcpTable)
for (let j = 0; j < dataBcpTable.length; j++) {
var loss;
if (dataBcpTable[j].bcpMaterialLoss !== null || dataBcpTable[j].bcpMaterialLoss !== '') {
loss = dataBcpTable[j].bcpMaterialLoss.substring(0,dataBcpTable[j].bcpMaterialLoss.length-1)
} else {
loss = 0;
}
for (let i = 0; i < dataBcpSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
console.log(dataBcpTable[j].bcpMaterialLoss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
index: count + j,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataBcpSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataBcpSubsidiaryTable[i].specificationModel,
inventoryUnit: dataBcpSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataBcpSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataBcpSubsidiaryTable[i].supplierNumber,
materialCode: dataBcpTable[j].bcpCode,
materialName: dataBcpTable[j].bcpName,
specificationModel: dataBcpTable[j].specificationModel,
inventoryUnit: dataBcpTable[j].inventoryUnit,
materialType: '半成品',
materialConsumption: (Number(dataBcp[j].bcpMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataBcp[j].bcpMaterialConsumption,
itemNumber: dataBcpTable[j].customerNumber,
description: ''
}
});
}
// $("#"+bcp_id_temp[i]).bootstrapTable("uncheckAll");
}
$("#rawMaterialBomTable").bootstrapTable("uncheckAll");
$("#subsidiaryMaterialBomTable").bootstrapTable("uncheckAll");
$("#bcpMaterialBomTable").bootstrapTable("uncheckAll");
$("#raw_table").bootstrapTable("uncheckAll");
$("#subsidiary_table").bootstrapTable("uncheckAll");
$("#bcp_table").bootstrapTable("uncheckAll");
$("#bcp_raw_table").bootstrapTable("uncheckAll");
$("#bcp_subsidiary_table").bootstrapTable("uncheckAll");
//原料
for (let i = 0; i < raw_id_temp.length; i++) {
$("#"+raw_id_temp[i]).bootstrapTable("uncheckAll");
}
//辅料
for (let i = 0; i < subsidiary_id_temp.length; i++) {
$("#"+subsidiary_id_temp[i]).bootstrapTable("uncheckAll");
}
//半成品
for (let i = 0; i < bcp_id_temp.length; i++) {
$("#"+bcp_id_temp[i]).bootstrapTable("uncheckAll");
}
// $("#raw_table").bootstrapTable("uncheckAll");
// $("#subsidiary_table").bootstrapTable("uncheckAll");
// $("#bcp_table").bootstrapTable("uncheckAll");
// $("#bcp_raw_table").bootstrapTable("uncheckAll");
// $("#bcp_subsidiary_table").bootstrapTable("uncheckAll");
closeBomDetailModal();
}

47
ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/workOrderInfo.html

@ -81,7 +81,7 @@
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manufacture:workOrderInfo:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="removeWorkOrder()" shiro:hasPermission="manufacture:workOrderInfo:remove">
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="manufacture:workOrderInfo:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="exportWorkOrder()" shiro:hasPermission="manufacture:workOrderInfo:export">
@ -346,43 +346,16 @@
});
//删除
function removeWorkOrder() {
var orderData = $("#bootstrap-table").bootstrapTable("getSelections");
if (orderData.length === 1) {
// console.log(orderData)
$.ajax({
url: ctx + 'manufacture/workOrderDetail/list',
type: 'post',
data: {
workOrderNumber: orderData[0].workOrderNumber
},
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
$.modal.confirm("该订单内含有"+ res.rows.length+ "条物料数据将一并删除,是否删除?", function () {
$.ajax({
url: prefix + '/removeSelectedOrder',
type: 'post',
data: {
orderData: JSON.stringify(orderData)
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
} else if (res.rows.length === 0) {
$.modal.confirm("确认删除该订单吗?", function () {
function removeSelected() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
// console.log(rows)
if (rows.length > 0) {
$.modal.confirm("是否删除选中的"+ rows.length +"条制工单?", function () {
$.ajax({
url: prefix + '/remove',
url: prefix + '/removeSelected',
type: 'post',
data: {
ids : orderData[0].workOrderId
ids : rows.join()
},
success: function (res) {
// console.log(res)
@ -394,10 +367,6 @@
}
})
})
}
}
})
} else {
$.modal.msgWarning("请选择一条数据")
}

2
ruoyi-admin/src/main/resources/templates/outsource/outsourceInspectionNotice/add.html

@ -461,7 +461,7 @@
materialQuantity: data[i].quantity,
qualifiedQuantity: data[i].quantity,
purchaseExplain: data[i].description,
productionOrderNumber: '',
productionOrderNumber: data[i].outsourceWorkNumber,
judgmentResults: ''
}
});

2
ruoyi-admin/src/main/resources/templates/outsource/outsourceInspectionNotice/edit.html

@ -449,7 +449,7 @@
materialQuantity: data[i].quantity,
qualifiedQuantity: data[i].quantity,
purchaseExplain: data[i].description,
productionOrderNumber: '',
productionOrderNumber: data[i].outsourceWorkNumber,
judgmentResults: ''
}
});

17
ruoyi-admin/src/main/resources/templates/outsource/outsourceOrderInfo/add.html

@ -471,6 +471,22 @@
return actions.join('');
}
},
{
field: 'outsourceOrderNumber',
title: '委外订单号',
visible: false
},
{
field: 'outsourceWorkNumber',
title: '工单号',
editable: {
type: 'text',
title: '工单号',
emptytext: '工单号',
validate: function (v) {
}
}
},
{
field: 'materialCode',
title: '物料代码'
@ -830,6 +846,7 @@
index: count + i,
row: {
outsourceOrderNumber: outsourceOrderNumber,
outsourceWorkNumber: '',
materialCode: data[i].materialCode,
materialName: data[i].materialName,
specificationModel: data[i].specificationModel,

17
ruoyi-admin/src/main/resources/templates/outsource/outsourceOrderInfo/edit.html

@ -425,6 +425,22 @@
{
checkbox: true
},
{
field: 'outsourceOrderNumber',
title: '委外订单号',
visible: false
},
{
field: 'outsourceWorkNumber',
title: '工单号',
editable: {
type: 'text',
title: '工单号',
emptytext: '工单号',
validate: function (v) {
}
}
},
{
field: 'materialCode',
title: '物料代码'
@ -784,6 +800,7 @@
index: count + i,
row: {
outsourceOrderNumber: outsourceOrderNumber,
outsourceWorkNumber: '',
materialCode: data[i].materialCode,
materialName: data[i].materialName,
specificationModel: data[i].specificationModel,

34
ruoyi-admin/src/main/resources/templates/purchase/purchaseAccountReconciliation/purchaseAccountReconciliation.html

@ -14,6 +14,18 @@
<form id="formId">
<div class="select-list">
<ul>
<li class="select-time">
<label>入库日期:</label>
<input type="text" class="time-input" id="beginWarehousingDate" placeholder="开始时间" name="params[beginWarehousingDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endWarehousingDate" placeholder="结束时间" name="params[endWarehousingDate]"/>
</li>
<li class="select-time">
<label>交期:</label>
<input type="text" class="time-input" id="beginDeliveryTime" placeholder="开始时间" name="params[beginDeliveryTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endDeliveryTime" placeholder="结束时间" name="params[endDeliveryTime]"/>
</li>
<li>
<label>订购单号:</label>
<input type="text" name="purchaseOrderNumber"/>
@ -55,12 +67,6 @@
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>交期:</label>
<input type="text" class="time-input" id="beginDeliveryTime" placeholder="开始时间" name="params[beginDeliveryTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endDeliveryTime" placeholder="结束时间" name="params[endDeliveryTime]"/>
</li>
<li>
<label>对账否:</label>
<select name="accountReconciliationFlag" th:with="type=${@dict.getType('sys_whether')}">
@ -72,12 +78,6 @@
<label>入库单号:</label>
<input type="text" name="warehousingNumber"/>
</li>
<li class="select-time">
<label>入库日期:</label>
<input type="text" class="time-input" id="beginWarehousingDate" placeholder="开始时间" name="params[beginWarehousingDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endWarehousingDate" placeholder="结束时间" name="params[endWarehousingDate]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -337,8 +337,12 @@
let supplierCode = $("#formId select[name='supplierCode']").val()
let supplierName = $("#formId input[name='supplierName']").val()
let beginWarehousingDate = $("#formId input[name='params[beginWarehousingDate]']").val()
let endWarehousingDate = $("#formId input[name='params[endWarehousingDate]']").val()
console.log(supplierCode)
console.log(supplierName)
console.log(beginWarehousingDate)
console.log(endWarehousingDate)
if (supplierCode == "" || supplierName == "") {
$.modal.alert("请先选择供应商代码!");
} else if (rows.length == 0) {
@ -355,13 +359,15 @@
}
// console.log(ids)
// console.log(ids.join())
$.modal.confirm("确认要导出采购单吗?", function (){
$.modal.confirm("确认要导出采购对账单吗?", function (){
axios({
url: prefix + '/exportSelected/'+ ids.join(),
method: 'POST',
params: {
supplierCode: supplierCode,
supplierName: supplierName
supplierName: supplierName,
beginWarehousingDate: beginWarehousingDate,
endWarehousingDate: endWarehousingDate
},
responseType: 'blob'
}).then(response => {

797
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDBcp/add.html

@ -0,0 +1,797 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增入库')" />
<th:block th:include="include :: datetimepicker-css" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
<th:block th:include="include :: bootstrap-editable-css"/>
<style>
.other-container {
width: 90%;
height: 200px;
margin: auto;
}
.other {
margin-top: 20px;
}
h4 {
display: inline-block;
margin-right: 20px;
}
.modal-body{
height: 550px;
}
iframe{
width: 100%;
height: 500px;
frameborder: 0;
border: 0;
display: inline-block;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-warehousingInPDBcp-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">入库单号:</label>
<div class="col-sm-8">
<input name="warehousingNumber" class="form-control" type="text" required readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库通知单号:</label>
<div class="col-sm-8">
<!-- <input name="notificationNumber" class="form-control" type="text">-->
<select name="notificationNumber" class="form-control m-b" readonly>
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工单号:</label>
<div class="col-sm-8">
<!-- <input name="workOrderNumber" class="form-control" type="text">-->
<select name="workOrderNumber" class="form-control m-b" type="text">
<option value="">请选择工单号</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库类型:</label>
<div class="col-sm-8">
<select name="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="warehousingDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">制单人员:</label>
<div class="col-sm-8">
<!-- <input name="documentPreparationPersonnel" class="form-control" type="text">-->
<select name="documentPreparationPersonnel" class="form-control m-b">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">仓库名称:</label>
<div class="col-sm-8">
<!-- <input name="stockName" class="form-control" type="text">-->
<select name="stockName" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库号:</label>
<div class="col-sm-8">
<input name="stockNumber" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库管理员:</label>
<div class="col-sm-8">
<input name="stockManager" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input name="contacts" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门名称:</label>
<div class="col-sm-8">
<!-- <input name="deptName" class="form-control" type="text">-->
<select name="deptName" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门编号:</label>
<div class="col-sm-8">
<input name="deptCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remarks" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<div class="other-container">
<div class="other">
<br><hr>
<h4>材料信息</h4>
<div class="btn-group-sm" id="toFinishProduct" role="group">
<a class="btn btn-primary" onclick="addBcp()">
<i class="fa fa-plus"></i> 添加半成品
</a>
<!-- <a class="btn btn-success" onclick="confirmsubsidiary()">-->
<!-- <i class="fa fa-plus"></i> 确认添加-->
<!-- </a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="addDetailTable" style="white-space:nowrap"></table>
</div>
</div>
</div>
<div class="modal inmodal" id="bcpModal"
role="dilog" aria-hidden="true">
<!-- 查询成品资料-->
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF">
<div class="modal-content" style="background-color: #FFFFFF">
<div class="modal-body">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="bcpFormId">
<div class="select-list">
<ul>
<li>
<label>成品代码:</label>
<input type="text" name="finishProductCode"/>
</li>
<li>
<label>成品名称:</label>
<input type="text" name="finishProductName"/>
</li>
<li>
<label>客户代码:</label>
<input type="text" name="enterpriseCode"/>
</li>
<li>
<label>客户名称:</label>
<input type="text" name="enterpriseName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('bcpFormId','bcpTable')"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('bcpFormId','bcpTable')"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bcpTable" style="white-space:nowrap"></table>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-warning btn-rounded" onclick="addBomBcp()">确认添加</a>
<a class="btn btn-primary btn-rounded" onclick="closeBomBcpModal()">关闭</a>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var prefix = ctx + "storehouse/warehousingInInfo"
var prefixDetail = ctx + "storehouse/warehousingInDetail"
var prefixfinishproduct = ctx + "system/finishproduct"
var prefixFinishProductNotice = ctx + "manufacture/warehousingFinishProductNotice"
var prefixWorkOrderInfo = ctx + "manufacture/workOrderInfo"
var prefixWorkOrderDetail = ctx + "manufacture/workOrderDetail"
var whetherStopDatas = [[${@dict.getType('sys_whether')}]];
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]];
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]];
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]];
$("#form-warehousingInPDBcp-add").validate({
focusCleanup: true
});
function submitHandler() {
let getData=$('#addDetailTable').bootstrapTable('getData', true)
if(getData.length > 0) {
//确认添加选中的物料数据
if ($.validate.form()) {
confirmDetailMaterial();
$.operate.save(prefix + "/add", $('#form-warehousingInPDBcp-add').serialize());
}
} else {
$.modal.alertWarning("未选择物料,请添加!")
}
}
$("input[name='warehousingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true,
todayBtn: true
});
$("input[name='warehousingDate']").datetimepicker('setDate', new Date())
$(function () {
$("#form-warehousingInPDBcp-add select[name='notificationNumber']").select2({
tags: true
});
$("#form-warehousingInPDBcp-add select[name='workOrderNumber']").select2({
tags: true
});
});
//默认入库类型为“成品入库”
$("#form-warehousingInPDBcp-add select[name='warehousingCategory']").val(10).trigger("change")
//获取单号
$.ajax({
url: prefix + "/getPDBcpId",
type: "post",
dateType: "json",
success: function (resp) {
if (resp.code === 0) {
$("input[name='warehousingNumber']").val(resp.data);
} else {
$.modal.msgError("失败啦");
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
//获取仓库信息
$.ajax({
url: ctx + "stock/stockInfo/list",
type: "post",
success: function (res) {
// console.log(res)
if (res.rows.length > 0) {
let stockData = res.rows;
for (let i in stockData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDBcp-add select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>");
}
$("#form-warehousingInPDBcp-add select[name='stockName']").change(function () {
var stockName = $(this).val();
for (let i=0;i<stockData.length;i++) {
if (stockData[i].stockname == stockName) {
$("#form-warehousingInPDBcp-add input[name='stockNumber']").val(stockData[i].stockNO);
$("#form-warehousingInPDBcp-add input[name='stockManager']").val(stockData[i].stockmanager);
}
}
})
}
}
})
//工单号
// $.ajax({
// url: prefixWorkOrderInfo + '/list',
// type: "post",
// success: function (res) {
// // console.log(res)
// if (res.rows.length > 0) {
// let orderData = res.rows;
// for (let i in orderData) {
// $("#form-warehousingInPDBcp-add select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>");
// // $("#form-warehousingInPDBcp-add select[name='workOrderNumber']").change(function () {
// // var workOrderNumber = $(this).val();
// // for (let i=0;i<orderData.length;i++) {
// // if (orderData[i].workOrderNumber == workOrderNumber) {
// // showDetailMaterial(workOrderNumber);
// // }
// // }
// // })
// }
// }
// }
// })
/*用户列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
// console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDBcp-add select[name='documentPreparationPersonnel']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
let userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-warehousingInPDBcp-add select[name='documentPreparationPersonnel']").val(userName).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
})
/*部门列表*/
$.ajax({
url: ctx + 'system/dept/list',
type: 'post',
success: function (res) {
console.log(res)
if (res.length > 0) {
var deptData = res;
//alert(JSON.stringify(data));
for (let i in deptData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDBcp-add select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>");
}
$("#form-warehousingInPDBcp-add select[name='deptName']").change(function () {
var deptName = $(this).val();
for (let i=0;i<deptData.length;i++) {
if (deptData[i].deptName == deptName) {
$("#form-warehousingInPDBcp-add input[name='deptCode']").val(deptData[i].deptNumber);
}
}
})
} else {
$.modal.msgError(res.msg);
}
}
})
//半成品
function addBcp() {
$("#bcpTable").bootstrapTable("destroy")
var options = {
id: 'bcpTable',
url: prefixfinishproduct + "/list",
pagination: true,
pageNumber: 1,
pageSize: 10,
showRefresh: false,
showToggle: false,
clickToSelect: true,
modalName: "产品资料",
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
// enterpriseCode: data[0].enterpriseCode
};
let json = $.extend(curParams, $.common.formToJSON("bcpFormId"));
return json;
},
columns: [{
checkbox: true
},
{
field: 'finishProductId',
title: '成品id',
visible: false
},
{
field: 'customerNumber',
title: '客户料号'
},
{
field: 'typeMachine',
title: '机种'
},
{
field: 'finishProductName',
title: '成品名称'
},
{
field: 'enterpriseCode',
title: '客户代码'
},
{
field: 'enterpriseName',
title: '客户名称'
},
{
field: 'inventoryUnit',
title: '库存单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryUnitDatas, value);
},
visible: false
},
{
field: 'versionNumber',
title: '版本号'
},
{
field: 'finishProductCode',
title: '成品代码'
},
{
field: 'safetyStock',
title: '安全库存',
visible: false
},
{
field: 'stockUnitWeight',
title: '单位重量',
visible: false
},
{
field: 'gpItemSelection',
title: 'GP项选择',
formatter: function(value, row, index) {
return $.table.selectDictLabel(gpItemSelectionDatas, value);
},
visible: false
},
{
field: 'inPlantCode',
title: '厂内编码'
},
{
field: 'whetherStop',
title: '料号是否停用',
formatter: function(value, row, index) {
return $.table.selectDictLabel(whetherStopDatas, value);
}
},
{
field: 'createrName',
title: '创建人',
visible: false
},
{
field: 'ordinalName',
title: '半成品对应完工工序名',
visible: false
},
{
field: 'originalNumber',
title: '原成品料号',
visible: false
},
{
field: 'customsName',
title: '海关名称',
visible: false
},
{
field: 'defaultWarehouse',
title: '默认仓库'
},
{
field: 'materialCategory',
title: '类别',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialCategoryDatas, value);
},
visible: false
},
{
field: 'productionCategory',
title: '生产类别',
formatter: function(value, row, index) {
return $.table.selectDictLabel(productionCategoryDatas, value);
}
},
{
field: 'finishProductCategory',
title: '所属类别',
formatter: function(value, row, index) {
return $.table.selectDictLabel(finishProductCategoryDatas, value);
}
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'customerEngineer',
title: '客户工程师'
},
{
field: 'productDescription',
title: '产品描述',
visible: false
},
{
field: 'maximumInventory',
title: '最高库存',
visible: false
},
{
field: 'productPrice',
title: '产品售价',
visible: false
},
{
field: 'componentName',
title: '组件名称',
visible: false
},
{
field: 'createrTime',
title: '创建日期',
visible: false
},
{
field: 'ordinalNumber',
title: '半成品对应完工工序号',
visible: false
},
{
field: 'defaultLocation',
title: '默认位置',
visible: false
},
{
field: 'hsNumber',
title: 'HS号',
visible: false
},
{
field: 'kesNumber',
title: '科恩仕料号'
}]
};
$.table.init(options);
$("#bcpModal").modal("show");
}
//初始化添加材料表
$('#addDetailTable').bootstrapTable({
pagination: true,
pageNumber: 1,
pageSize: 10,
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
clickToSelect: true,//点击行选中
contentType: "application/x-www-form-urlencoded",
paginationDetailHAlign: ' hiddenDetailInfo',
height: 250,
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
// enterpriseCode: data[0].enterpriseCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
columns: [
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeMaterialData(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
},
// {
// field: 'warehousingDetailId',
// title: '入库物料id',
// visible: false
// },
{
field: 'warehousingNumber',
title: '入库单号',
visible: false
},
{
field: 'materialCode',
title: '物料代码'
},
{
field: 'materialName',
title: '物料名称'
},
{
field: 'materialType',
title: '物料类别',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialTypeDatas, value);
},
visible: false
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'typeMachine',
title: '机种'
},
{
field: 'inventoryUnit',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryUnitDatas, value);
}
},
{
field: 'warehousingQuantity',
title: '合格数量',
editable: {
type: 'text',
title: '合格数量',
emptytext: '合格数量',
validate: function (v) {
}
}
},
{
field: 'description',
title: '说明',
editable: {
type: 'text',
title: '说明',
emptytext: '说明',
validate: function (v) {
}
}
},
{
field: 'batchNumber',
title: '批号',
editable: {
type: 'text',
title: '批号',
emptytext: '批号',
validate: function (v) {
}
}
},
{
field: 'storageLocation',
title: '存放地址',
editable: {
type: 'text',
title: '存放地址',
emptytext: '存放地址',
validate: function (v) {
}
}
}]
})
// 半成品添加
function addBomBcp() {
var data = $("#bcpTable").bootstrapTable("getSelections");
// console.log(data)
var count = $('#addDetailTable').bootstrapTable('getData').length;
for (i = 0; i < data.length; i++) {
// var finishProductCode = $("input[name='finishProductCode']").val()
// var versionNumber = $("input[name='versionNumber']").val()
var warehousingNumber = $("input[name='warehousingNumber']").val()
let bootstrapTable = $('#addDetailTable').bootstrapTable('getRowByUniqueId', data[i].finishProductCode);
if (bootstrapTable != null) {
$.modal.alert(bootstrapTable.bcpName + "已存在,不可重复添加!");
continue;
}
$("#addDetailTable").bootstrapTable('insertRow', {
index: count + i,
row: {
warehousingNumber: warehousingNumber,
materialCode: data[i].finishProductCode,
materialName: data[i].finishProductName,
specificationModel: data[i].specificationModel,
// materialType: '半成品',
typeMachine: data[i].typeMachine,
inventoryUnit: data[i].inventoryUnit,
warehousingQuantity: '',
description: '',
batchNumber: '',
storageLocation: ''
}
});
}
$("#bcpTable").bootstrapTable("uncheckAll");
closeBomBcpModal();
}
function closeBomBcpModal() {
$("#bcpModal").modal("hide");
}
//确认添加选中的物料数据
function confirmDetailMaterial() {
$("#addDetailTable").bootstrapTable('refresh');
let data = $('#addDetailTable').bootstrapTable('getData', true);
// let getData=$('#addProductTable').bootstrapTable('getData', true)
// console.log(data)
$.ajax({
url: prefixDetail + '/addEditSave',
type: "POST",
data: {
data: JSON.stringify(data)
},
dataType: "json",
success: function (resp) {
// console.log(data)
console.log(resp)
},
})
}
//添加表格内删除物料信息
function removeMaterialData(materialCode){
var ids = [];
ids.push(materialCode);
$('#addDetailTable').bootstrapTable("remove",{
field:'materialCode',
values:ids
})
$("#addDetailTable").bootstrapTable('refresh');
}
</script>
</body>
</html>

443
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDBcp/edit.html

@ -0,0 +1,443 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改入库')" />
<th:block th:include="include :: datetimepicker-css" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
<th:block th:include="include :: bootstrap-editable-css"/>
<style>
.other-container {
width: 90%;
height: 200px;
margin: auto;
}
.other {
margin-top: 20px;
}
h4 {
display: inline-block;
margin-right: 20px;
}
.modal-body{
height: 550px;
}
iframe{
width: 100%;
height: 500px;
frameborder: 0;
border: 0;
display: inline-block;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-warehousingInPDFinishProduct-edit" th:object="${warehousingInInfo}">
<input name="warehousingInfoId" th:field="*{warehousingInfoId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">入库单号:</label>
<div class="col-sm-8">
<input name="warehousingNumber" th:field="*{warehousingNumber}" class="form-control" type="text" required readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库通知单号:</label>
<div class="col-sm-8">
<!-- <input name="notificationNumber" class="form-control" type="text">-->
<select name="notificationNumber" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工单号:</label>
<div class="col-sm-8">
<input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库类型:</label>
<div class="col-sm-8">
<select name="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehousingCategory}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="warehousingDate" th:field="*{warehousingDate}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">制单人员:</label>
<div class="col-sm-8">
<!-- <input name="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" class="form-control" type="text">-->
<select name="documentPreparationPersonnel" class="form-control m-b">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库名称:</label>
<div class="col-sm-8">
<!-- <input name="stockName" th:field="*{stockName}" class="form-control" type="text">-->
<select name="stockName" class="form-control m-b" required>
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库号:</label>
<div class="col-sm-8">
<input name="stockNumber" th:field="*{stockNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库管理员:</label>
<div class="col-sm-8">
<input name="stockManager" th:field="*{stockManager}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">送货人:</label>
<div class="col-sm-8">
<input name="deliveryMan" th:field="*{deliveryMan}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户代码:</label>
<div class="col-sm-8">
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remarks" class="form-control">[[*{remarks}]]</textarea>
</div>
</div>
</form>
</div>
<div class="other-container">
<div class="other">
<br><hr>
<h4>材料信息</h4>
<div class="col-sm-12 select-table table-striped">
<table id="addDetailTable" style="white-space:nowrap"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var getData = [[${warehousingInInfo}]]
var prefix = ctx + "storehouse/warehousingInInfo"
var prefixDetail = ctx + "storehouse/warehousingInDetail"
var prefixFinishProductNotice = ctx + "manufacture/warehousingFinishProductNotice"
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]];
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]];
$("#form-warehousingInPDFinishProduct-edit").validate({
focusCleanup: true
});
function submitHandler() {
let getData=$('#addDetailTable').bootstrapTable('getData', true)
if(getData.length > 0) {
//确认添加选中的物料数据
if ($.validate.form()) {
confirmDetailMaterial();
$.operate.save(prefix + "/edit", $('#form-warehousingInPDFinishProduct-edit').serialize());
}
} else {
$.modal.alertWarning("未选择物料,请添加!")
}
}
$("input[name='warehousingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true,
todayBtn: true
});
//获取退货单号
$.ajax({
url: prefixFinishProductNotice + "/list",
type: "post",
dateType: "json",
success: function (res) {
if (res.rows.length > 0) {
var orderData = res.rows;
//alert(JSON.stringify(data));
for (let i in orderData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDFinishProduct-edit select[name='notificationNumber']").append("<option value='" + orderData[i].notificationNumber + "'>" + orderData[i].notificationNumber + "</option>");
}
$("#form-warehousingInPDFinishProduct-edit select[name='notificationNumber']").val(getData.notificationNumber).trigger("change")
$("#form-warehousingInPDFinishProduct-edit select[name='notificationNumber']").change(function () {
var notificationNumber = $(this).val();
for (let i=0;i<orderData.length;i++) {
if (orderData[i].notificationNumber == notificationNumber) {
$("#form-warehousingInPDFinishProduct-edit input[name='workOrderNumber']").val(orderData[i].workOrderNumber);
$("#form-warehousingInPDFinishProduct-edit input[name='enterpriseCode']").val(orderData[i].enterpriseCode);
$("#form-warehousingInPDFinishProduct-edit input[name='enterpriseName']").val(orderData[i].enterpriseName);
$("#form-warehousingInPDFinishProduct-edit input[name='deliveryMan']").val(orderData[i].deliveryMan);
$("#form-warehousingInPDFinishProduct-edit input[name='stockNumber']").val(orderData[i].stockNumber);
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").val(orderData[i].stockName).trigger("change");
$("#form-warehousingInPDFinishProduct-edit input[name='stockManager']").val(orderData[i].stockManager);
$("#form-warehousingInPDFinishProduct-edit textarea[name='remarks']").val(orderData[i].remarks);
showDetailMaterial();
}
}
})
} else {
$.modal.msgError(res.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
//获取仓库信息
$.ajax({
url: ctx + "stock/stockInfo/list",
type: "post",
success: function (res) {
// console.log(res)
if (res.rows.length > 0) {
let stockData = res.rows;
for (let i in stockData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>");
}
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").val(getData.stockName).trigger("change")
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").change(function () {
var stockName = $(this).val();
for (let i=0;i<stockData.length;i++) {
if (stockData[i].stockname == stockName) {
$("#form-warehousingInPDFinishProduct-edit input[name='stockNumber']").val(stockData[i].stockNO);
$("#form-warehousingInPDFinishProduct-edit input[name='stockManager']").val(stockData[i].stockmanager);
}
}
})
}
}
})
/*用户列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDFinishProduct-edit select[name='documentPreparationPersonnel']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-warehousingInPDFinishProduct-edit select[name='documentPreparationPersonnel']").val(getData.documentPreparationPersonnel).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
})
//初始化添加材料表
$('#addDetailTable').bootstrapTable({
url: prefixDetail + '/list',
method: "post",
pagination: true,
pageNumber: 1,
pageSize: 10,
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
clickToSelect: true,//点击行选中
contentType: "application/x-www-form-urlencoded",
paginationDetailHAlign: ' hiddenDetailInfo',
height: 250,
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
warehousingNumber: getData.warehousingNumber
// enterpriseCode: data[0].enterpriseCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
columns: [
{
field: 'warehousingDetailId',
title: '入库物料id',
visible: false
},
{
field: 'warehousingNumber',
title: '入库单号',
visible: false
},
{
field: 'materialCode',
title: '物料代码'
},
{
field: 'materialName',
title: '物料名称'
},
{
field: 'materialType',
title: '物料类别',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialTypeDatas, value);
}
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'typeMachine',
title: '机种'
},
{
field: 'inventoryUnit',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryUnitDatas, value);
}
},
{
field: 'warehousingQuantity',
title: '合格数量',
editable: {
type: 'text',
title: '合格数量',
emptytext: '合格数量',
validate: function (v) {
}
}
},
{
field: 'description',
title: '说明',
editable: {
type: 'text',
title: '说明',
emptytext: '说明',
validate: function (v) {
}
}
},
{
field: 'batchNumber',
title: '批号',
editable: {
type: 'text',
title: '批号',
emptytext: '批号',
validate: function (v) {
}
}
},
{
field: 'storageLocation',
title: '存放地址',
editable: {
type: 'text',
title: '存放地址',
emptytext: '存放地址',
validate: function (v) {
}
}
}]
})
//选择暂收单号显示表内订单信息
function showDetailMaterial() {
$('#addDetailTable').bootstrapTable("removeAll")
var notificationNumber = $("select[name='notificationNumber']").val();
$.ajax({
url: prefixFinishProductNotice + '/list',
type: 'post',
data: {
notificationNumber: notificationNumber
},
success: function (res) {
console.log(res)
var count = res.rows.length;
var data = res.rows;
var warehousingNumber = $("input[name='warehousingNumber']").val();
for (i = 0; i < res.rows.length; i++) {
$("#addDetailTable").bootstrapTable('insertRow', {
index: count + i,
row: {
warehousingNumber: warehousingNumber,
materialCode: data[i].finishProductCode,
materialName: data[i].finishProductName,
materialType: '成品',
specificationModel: data[i].specificationModel,
typeMachine: data[i].typeMachine,
inventoryUnit: data[i].inventoryUnit,
warehousingQuantity: data[i].qualifiedQuantity,
description: data[i].description,
batchNumber: data[i].batchNumber,
storageLocation: ''
}
});
}
}
})
}
//确认添加选中的物料数据
function confirmDetailMaterial() {
$("#addDetailTable").bootstrapTable('refresh');
let data = $('#addDetailTable').bootstrapTable('getData', true);
// let getData=$('#addProductTable').bootstrapTable('getData', true)
// console.log(data)
$.ajax({
url: prefixDetail + '/addEditSave',
type: "POST",
data: {
data: JSON.stringify(data)
},
dataType: "json",
success: function (resp) {
// console.log(data)
console.log(resp)
},
})
}
</script>
</body>
</html>

230
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDBcp/warehousingInPDBcp.html

@ -0,0 +1,230 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('入库列表')" />
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>入库单号:</label>
<input type="text" name="warehousingNumber"/>
</li>
<li class="select-time">
<label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li>
<li>
<label>仓库名称:</label>
<input type="text" name="stockName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="storehouse:warehousingInFinishProduct:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingInFinishProduct:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="exportSelectedFinishProduct()" shiro:hasPermission="storehouse:warehousingInFinishProduct:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('storehouse:warehousingInFinishProduct:edit')}]];
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingInFinishProduct:remove')}]];
var warehousingCategoryDatas = [[${@dict.getType('warehousing_category')}]];
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]];
var prefix = ctx + "storehouse/warehousingInInfo";
$(function() {
var options = {
url: prefix + "/listPDBcp",
createUrl: prefix + "/addPDBcp",
updateUrl: prefix + "/editPDBcp/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "入库",
columns: [{
checkbox: true
},
{
field: 'warehousingInfoId',
title: '入库id',
visible: false
},
{
field: 'warehousingNumber',
title: '入库单号'
},
{
field: 'notificationNumber',
title: '入库通知单号'
},
{
field: 'workOrderNumber',
title: '工单号'
},
{
field: 'warehousingCategory',
title: '入库类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(warehousingCategoryDatas, value);
}
},
{
field: 'warehousingDate',
title: '入库日期'
},
{
field: 'documentPreparationPersonnel',
title: '制单人员'
},
{
field: 'stockNumber',
title: '仓库号'
},
{
field: 'stockName',
title: '仓库名称'
},
{
field: 'stockManager',
title: '仓库管理员'
},
{
field: 'remarks',
title: '备注'
},
{
field: 'contacts',
title: '联系人'
},
{
field: 'deptName',
title: '部门名称'
},
{
field: 'deptCode',
title: '部门编号'
},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
}
}
}]
};
$.table.init(options);
});
//删除
function removeSelected() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
console.log(rows)
if (rows.length > 0) {
$.modal.confirm("是否删除选中的"+ rows.length +"条半成品入库数据?", function () {
$.ajax({
url: prefix + '/removeSelected',
type: 'post',
data: {
ids : rows.join()
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
} else {
$.modal.msgWarning("请选择一条数据")
}
}
//导出
// function exportSelectedFinishProduct() {
// var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
// var data = $("#bootstrap-table").bootstrapTable("getSelections")
// if (rows.length !== 1) {
// $.modal.alert("请选择一条记录");
// return;
// } else {
// $.modal.confirm("是否确认要导出所选的成品入库单?", function (){
// axios({
// url: prefix + '/exportSelectedFinishProduct/'+data[0].warehousingInfoId,
// method: 'POST',
// responseType: 'blob'
// }).then(response => {
// // console.log(response)
// const URL = window.URL.createObjectURL(response.data)
// // 创建隐藏<a>标签进行下载
// const tempLink = document.createElement('a')
// tempLink.style.display = 'none'
// tempLink.href = URL
// let time = new Date().toLocaleString()
// tempLink.setAttribute('download', time + "成品入库单.xlsx")
// if (typeof tempLink.download === 'undefined') {
// tempLink.setAttribute('target', '_blank')
// }
// document.body.appendChild(tempLink)
// tempLink.click()
// document.body.removeChild(tempLink)// 移除dom元素
// window.URL.revokeObjectURL(URL)//释放内存
// })
// });
//
//
// }
// }
</script>
</body>
</html>

5
ruoyi-admin/src/main/resources/templates/system/bom/bom.html

@ -787,6 +787,7 @@
initBcpBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
console.log(bcpCode)
var bcpVersionNumber = row.bcpVersionNumber;
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#bcp_bcp_table").bootstrapTable({
@ -842,11 +843,11 @@
title: '单位'
},
{
field: 'bcpConsumption',
field: 'bcpMaterialConsumption',
title: '用量'
},
{
field: 'bcpLoss',
field: 'bcpMaterialLoss',
title: '损耗%'
},
{

40
ruoyi-admin/src/main/resources/templates/system/bom/edit.html

@ -846,12 +846,12 @@
title: '用量',
editable: {
type: 'text',
title: '使用量',
emptytext: '使用量',
title: '用量',
emptytext: '用量',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
},
@ -863,9 +863,9 @@
title: '损耗%',
emptytext: '损耗%',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
@ -988,9 +988,9 @@
title: '使用量',
emptytext: '使用量',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
},
@ -1002,9 +1002,9 @@
title: '损耗%',
emptytext: '损耗%',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
@ -2132,9 +2132,9 @@
title: '使用量',
emptytext: '使用量',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
},
@ -2146,9 +2146,9 @@
title: '损耗%',
emptytext: '损耗%',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}

20
ruoyi-admin/src/main/resources/templates/system/procedure/add.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增生产加工工序明细')" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -16,8 +18,8 @@
<label class="col-sm-3 control-label is-required" >车间名称:</label>
<div class="col-sm-8">
<!-- <input name="workshopName" class="form-control" type="text"/>-->
<select name="workshopName" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value=""></option>
<select name="workshopName" class="form-control select-list js-example-tags" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
@ -50,8 +52,8 @@
<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value=""></option>
<select name="associatedItem" class="form-control select-list js-example-tags" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">请选择核算数量关联项</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
@ -65,6 +67,7 @@
</form>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/procedure";
$("#form-procedure-add").validate({
@ -77,6 +80,15 @@
}
}
$(document).ready(function(){
$('.js-example-tags').select2({
tags: true,
insertTag: function (data, tag) {
// Insert the tag at the end of the results
data.push(tag);
}
});
});
</script>
</body>

24
ruoyi-admin/src/main/resources/templates/system/procedure/edit.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改生产加工工序明细')" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -17,8 +19,8 @@
<label class="col-sm-3 control-label">车间名称:</label>
<div class="col-sm-8">
<!-- <input name="workshopName" th:field="*{workshopName}" class="form-control" type="text">-->
<select name="workshopName" class="form-control select-list" th:field="*{workshopName}" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value=""></option>
<select name="workshopName" class="form-control select-list js-example-tags" th:field="*{workshopName}" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
@ -50,8 +52,8 @@
<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list" th:field="*{associatedItem}" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value=""></option>
<select name="associatedItem" class="form-control select-list js-example-tags" th:field="*{associatedItem}" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">请选择核算数量关联项</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
<!-- <input name="associatedItem" th:field="*{associatedItem}" class="form-control" type="text">-->
@ -66,6 +68,7 @@
</form>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/procedure";
$("#form-procedure-edit").validate({
@ -77,6 +80,19 @@
$.operate.save(prefix + "/edit", $('#form-procedure-edit').serialize());
}
}
$(document).ready(function(){
$('.js-example-tags').select2({
tags: true,
insertTag: function (data, tag) {
// Insert the tag at the end of the results
data.push(tag);
}
});
});
</script>
</body>
</html>

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/WorkOrderInfoController.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/WorkOrderDetail.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/purchase/controller/PurchaseOrderController.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.class

Binary file not shown.

6
ruoyi-admin/target/classes/mapper/manufacture/WorkOrderDetailMapper.xml

@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inventoryUnit" column="inventory_unit" />
<result property="materialType" column="material_type" />
<result property="materialConsumption" column="material_consumption" />
<result property="unitUsage" column="unit_usage" />
<result property="itemNumber" column="item_number" />
<result property="description" column="description" />
<result property="standbyOne" column="standby_one" />
@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWorkOrderDetailVo">
select work_order_detail_id, work_order_number, material_code, material_name, specification_model, inventory_unit, material_type, material_consumption, item_number, description, standby_one, standby_two from work_order_detail
select work_order_detail_id, work_order_number, material_code, material_name, specification_model, inventory_unit, material_type, material_consumption, unit_usage, item_number, description, standby_one, standby_two from work_order_detail
</sql>
<select id="selectWorkOrderDetailList" parameterType="WorkOrderDetail" resultMap="WorkOrderDetailResult">
@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryUnit != null">inventory_unit,</if>
<if test="materialType != null">material_type,</if>
<if test="materialConsumption != null">material_consumption,</if>
<if test="unitUsage != null">unit_usage,</if>
<if test="itemNumber != null">item_number,</if>
<if test="description != null">description,</if>
<if test="standbyOne != null">standby_one,</if>
@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialConsumption != null">#{materialConsumption},</if>
<if test="unitUsage != null">#{unitUsage},</if>
<if test="itemNumber != null">#{itemNumber},</if>
<if test="description != null">#{description},</if>
<if test="standbyOne != null">#{standbyOne},</if>
@ -80,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialConsumption != null">material_consumption = #{materialConsumption},</if>
<if test="unitUsage != null">unit_usage = #{unitUsage},</if>
<if test="itemNumber != null">item_number = #{itemNumber},</if>
<if test="description != null">description = #{description},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>

1018
ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/add.html

File diff suppressed because it is too large

560
ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/edit.html

@ -322,6 +322,9 @@
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var raw_id_temp = [];
var subsidiary_id_temp = [];
var bcp_id_temp = [];
var getData = [[${workOrderInfo}]];
// console.log(getData)
// console.log(getData.workOrderNumber)
@ -572,6 +575,18 @@
}
}
},
{
field: 'unitUsage',
title: '单位用量',
editable: {
type: 'text',
title: '单位用量',
emptytext: '单位用量',
validate: function (value) {
}
}
},
{
field: 'itemNumber',
title: '料号',
@ -896,9 +911,9 @@
// console.log(index)
// console.log(row.finishProductCode)
// console.log($detail)
$detail.html('<table class="table-container" id="raw_table"></table>' +
'<table class="table-container" id="subsidiary_table"></table>'+
'<table class="table-container" id="bcp_table"></table>'
$detail.html('<table class="table-container" id="raw_table'+row.bomBcpId+'"></table>' +
'<table class="table-container" id="subsidiary_table'+row.bomBcpId+'"></table>'+
'<table class="table-container" id="bcp_table'+row.bomBcpId+'"></table>'
).find('table');
initRawDetail(index,row,$detail);
initSubsidiaryDetail(index,row,$detail);
@ -911,8 +926,10 @@
//初始化子表格(循环) 一阶--原料
initRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "raw_table"+row.bomBcpId;
raw_id_temp.push(tableId)
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#raw_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1005,8 +1022,10 @@
//初始化子表格(循环) 一阶--辅料
initSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "subsidiary_table"+row.bomBcpId;
subsidiary_id_temp.push(tableId)
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#subsidiary_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1099,8 +1118,10 @@
//初始化子表格(循环) 一阶--半成品
initBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_table"+row.bomBcpId;
bcp_id_temp.push(tableId)
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#bcp_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomBcp/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1134,6 +1155,11 @@
{
checkbox: true
},
{
field: 'bomBcpId',
title: 'bom半成品id',
visible: false
},
{
field: 'bcpCode',
title: '半成品代码(二阶)'
@ -1155,11 +1181,11 @@
title: '单位'
},
{
field: 'bcpConsumption',
field: 'bcpMaterialConsumption',
title: '用量'
},
{
field: 'bcpLoss',
field: 'bcpMaterialLoss',
title: '损耗%'
},
{
@ -1180,14 +1206,14 @@
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $bcpdetail) {
$bcpdetail.html('<table class="table-container" id="bcp_raw_table"></table>' +
'<table class="table-container" id="bcp_subsidiary_table"></table>' +
'<table class="table-container" id="bcp_bcp_table"></table>'
$bcpdetail.html('<table class="table-container" id="bcp_raw_table'+row.bomBcpId+'"></table>' +
'<table class="table-container" id="bcp_subsidiary_table'+row.bomBcpId+'"></table>'
// '<table class="table-container" id="bcp_bcp_table'+row.bomBcpId+'"></table>'
).find('table');
initBcpDetail(index, row, $bcpdetail);
initBcpRawDetail(index, row, $bcpdetail);
initBcpSubsidiaryDetail(index, row, $bcpdetail);
initBcpBcpDetail(index, row, $bcpdetail);
// initBcpBcpDetail(index, row, $bcpdetail);
}
})
@ -1195,9 +1221,11 @@
//初始化子表格(循环) 二阶--原料
initBcpRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_raw_table"+row.bomBcpId;
raw_id_temp.push(tableId)
// var bcpVersionNumber = row.bcpVersionNumber;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#bcp_raw_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1291,9 +1319,11 @@
//初始化子表格(循环) 二阶--辅料
initBcpSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_subsidiary_table"+row.bomBcpId;
subsidiary_id_temp.push(tableId)
// var bcpVersionNumber = row.bcpVersionNumber;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#bcp_subsidiary_table").bootstrapTable({
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
@ -1384,6 +1414,297 @@
})
}
//初始化子表格(循环) 二阶--半成品
/* initBcpBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_bcp_table"+row.bomBcpId;
// var bcpVersionNumber = row.bcpVersionNumber;
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomBcp/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
detailView: true,
columns: [
{
checkbox: true
},
{
field: 'bomBcpId',
title: 'bom半成品id',
visible: false
},
{
field: 'bcpCode',
title: '半成品代码(三阶)'
},
{
field: 'bcpName',
title: '半成品名称'
},
{
field: 'bcpVersionNumber',
title: '版本号'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'bcpConsumption',
title: '用量'
},
{
field: 'bcpLoss',
title: '损耗%'
},
{
field: 'customerNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $bcpdetail) {
$bcpdetail.html('<table class="table-container" id="bcp_bcp_raw_table'+row.bomBcpId+'"></table>' +
'<table class="table-container" id="bcp_bcp_subsidiary_table'+row.bomBcpId+'"></table>'
).find('table');
initBcpBcpDetail(index, row, $bcpdetail);
initBcpBcpRawDetail(index, row, $bcpdetail);
initBcpBcpSubsidiaryDetail(index, row, $bcpdetail);
}
})
}*/
//初始化子表格(循环) 三阶--原料
/*initBcpBcpRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_bcp_raw_table"+row.bomBcpId;
// var bcpVersionNumber = row.bcpVersionNumber;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
field: 'rawMaterialId',
title: '原料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'rawMaterialCode',
title: '原料代码'
},
{
field: 'rawMaterialName',
title: '原料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'rawMaterialConsumption',
title: '用量'
},
{
field: 'rawMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpBcpRawDetail(index, row, $detail);
}
})
}*/
//初始化子表格(循环) 三阶--辅料
/*initBcpBcpSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
var tableId = "bcp_bcp_subsidiary_table"+row.bomBcpId;
// var bcpVersionNumber = row.bcpVersionNumber;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#"+tableId).bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
field: 'subsidiaryMaterialId',
title: 'bom辅料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'subsidiaryMaterialCode',
title: '辅料代码'
},
{
field: 'subsidiaryMaterialName',
title: '辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'subsidiaryMaterialConsumption',
title: '用量'
},
{
field: 'subsidiaryMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpSubsidiaryDetail(index, row, $detail);
}
})
}*/
//关闭BOM信息
function closeBomDetailModal() {
@ -1392,22 +1713,33 @@
//添加BOM材料信息
function addBomDetailToTable() {
// console.log(raw_id_temp)
// console.log(subsidiary_id_temp)
// console.log(bcp_id_temp)
var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections");
var dataSubsidiary = $("#subsidiaryMaterialBomTable").bootstrapTable("getSelections");
var dataBcp = $("#bcpMaterialBomTable").bootstrapTable("getSelections");
var dataRawTable = $("#raw_table").bootstrapTable("getSelections");
var dataSubsidiaryTable = $("#subsidiary_table").bootstrapTable("getSelections");
var dataBcpTable = $("#bcp_table").bootstrapTable("getSelections");
var dataBcpRawTable = $("#bcp_raw_table").bootstrapTable("getSelections");
var dataBcpSubsidiaryTable = $("#bcp_subsidiary_table").bootstrapTable("getSelections");
// var dataRawTable = $("#raw_table").bootstrapTable("getSelections");
// var dataSubsidiaryTable = $("#subsidiary_table").bootstrapTable("getSelections");
// var dataBcpTable = $("#bcp_table").bootstrapTable("getSelections");
// var dataBcpRawTable = $("#bcp_raw_table").bootstrapTable("getSelections");
// var dataBcpSubsidiaryTable = $("#bcp_subsidiary_table").bootstrapTable("getSelections");
var count = $('#addBomMaterialTable').bootstrapTable('getData').length;
var workOrderNumber = $("input[name='workOrderNumber']").val();
var orderQuantity = $("input[name='orderQuantity']").val();
for (let i = 0; i < dataRaw.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataRaw[i].rawMaterialCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
var loss;
if (dataRaw[i].rawMaterialLoss !== null || dataRaw[i].rawMaterialLoss !== '') {
loss = dataRaw[i].rawMaterialLoss.substring(0,dataRaw[i].rawMaterialLoss.length-1)
} else {
loss = 0;
}
// console.log(loss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
@ -1417,7 +1749,8 @@
specificationModel: dataRaw[i].specificationModel,
inventoryUnit: dataRaw[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataRaw[i].rawMaterialConsumption,
materialConsumption: (Number(dataRaw[i].rawMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataRaw[i].rawMaterialConsumption,
itemNumber: dataRaw[i].supplierNumber,
description: dataRaw[i].remarks
}
@ -1429,6 +1762,13 @@
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
// var loss;
// if (dataSubsidiary[i].subsidiaryMaterialLoss !== null || dataSubsidiary[i].subsidiaryMaterialLoss !== '') {
// loss = dataSubsidiary[i].subsidiaryMaterialLoss.substring(0,dataSubsidiary[i].subsidiaryMaterialLoss.length-1)
// } else {
// loss = 0;
// }
// console.log(loss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
@ -1438,7 +1778,10 @@
specificationModel: dataSubsidiary[i].specificationModel,
inventoryUnit: dataSubsidiary[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataSubsidiary[i].subsidiaryMaterialConsumption,
// materialConsumption: (Number(dataSubsidiary[i].subsidiaryMaterialConsumption)+Number(loss/100))*orderQuantity,
materialConsumption: '',
// unitUsage: dataSubsidiary[i].subsidiaryMaterialConsumption,
unitUsage: '',
itemNumber: dataSubsidiary[i].supplierNumber,
description: dataSubsidiary[i].remarks
}
@ -1450,6 +1793,13 @@
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
var loss;
if (dataBcp[i].bcpMaterialLoss !== null || dataBcp[i].bcpMaterialLoss !== '') {
loss = dataBcp[i].bcpMaterialLoss.substring(0,dataBcp[i].bcpMaterialLoss.length-1)
} else {
loss = 0;
}
// console.log(loss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
@ -1459,125 +1809,123 @@
specificationModel: dataBcp[i].specificationModel,
inventoryUnit: dataBcp[i].inventoryUnit,
materialType: '半成品',
materialConsumption: dataBcp[i].bcpMaterialConsumption,
materialConsumption: (Number(dataBcp[i].bcpMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataBcp[i].bcpMaterialConsumption,
itemNumber: dataBcp[i].customerNumber,
description: dataBcp[i].remarks
}
});
}
for (let i = 0; i < dataRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
//原料
for (let i = 0; i < raw_id_temp.length; i++) {
var dataRawTable = $("#"+raw_id_temp[i]).bootstrapTable("getSelections");
// console.log(dataRawTable)
for (let j = 0; j < dataRawTable.length; j++) {
var loss;
if (dataRawTable[j].rawMaterialLoss !== null || dataRawTable[j].rawMaterialLoss !== '') {
loss = dataRawTable[j].rawMaterialLoss.substring(0,dataRawTable[j].rawMaterialLoss.length-1)
} else {
loss = 0;
}
// console.log(dataRawTable[j].rawMaterialConsumption)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
index: count + j,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataRawTable[i].rawMaterialCode,
materialName: dataRawTable[i].rawMaterialName,
specificationModel: dataRawTable[i].specificationModel,
inventoryUnit: dataRawTable[i].inventoryUnit,
materialCode: dataRawTable[j].rawMaterialCode,
materialName: dataRawTable[j].rawMaterialName,
specificationModel: dataRawTable[j].specificationModel,
inventoryUnit: dataRawTable[j].inventoryUnit,
materialType: '原料',
materialConsumption: dataRawTable[i].rawMaterialConsumption,
itemNumber: dataRawTable[i].supplierNumber,
materialConsumption: (Number(dataRawTable[j].rawMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataRawTable[j].rawMaterialConsumption,
itemNumber: dataRawTable[j].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataSubsidiaryTable[i].specificationModel,
inventoryUnit: dataSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataSubsidiaryTable[i].supplierNumber,
description: ''
}
});
//辅料
for (let i = 0; i < subsidiary_id_temp.length; i++) {
var dataSubsidiaryTable = $("#"+subsidiary_id_temp[i]).bootstrapTable("getSelections");
// console.log(dataSubsidiaryTable)
for (let j = 0; j < dataSubsidiaryTable.length; j++) {
var loss;
if (dataSubsidiaryTable[j].subsidiaryMaterialLoss !== null || dataSubsidiaryTable[j].subsidiaryMaterialLoss !== '') {
loss = dataSubsidiaryTable[j].subsidiaryMaterialLoss.substring(0,dataSubsidiaryTable[j].subsidiaryMaterialLoss.length-1)
} else {
loss = 0;
}
for (let i = 0; i < dataBcpTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
index: count + j,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpTable[i].bcpCode,
materialName: dataBcpTable[i].bcpName,
specificationModel: dataBcpTable[i].specificationModel,
inventoryUnit: dataBcpTable[i].inventoryUnit,
materialType: '半成品',
materialConsumption: dataBcpTable[i].bcpConsumption,
itemNumber: dataBcpTable[i].customerNumber,
materialCode: dataSubsidiaryTable[j].subsidiaryMaterialCode,
materialName: dataSubsidiaryTable[j].subsidiaryMaterialName,
specificationModel: dataSubsidiaryTable[j].specificationModel,
inventoryUnit: dataSubsidiaryTable[j].inventoryUnit,
materialType: '辅料',
// materialConsumption: (Number(dataSubsidiaryTable[j].subsidiaryMaterialConsumption)+Number(loss/100))*orderQuantity,
materialConsumption: '',
// unitUsage: dataSubsidiaryTable[j].subsidiaryMaterialConsumption,
unitUsage: '',
itemNumber: dataSubsidiaryTable[j].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpRawTable[i].rawMaterialCode,
materialName: dataBcpRawTable[i].rawMaterialName,
specificationModel: dataBcpRawTable[i].specificationModel,
inventoryUnit: dataBcpRawTable[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataBcpRawTable[i].rawMaterialConsumption,
itemNumber: dataBcpRawTable[i].supplierNumber,
description: ''
// $("#"+subsidiary_id_temp[i]).bootstrapTable("uncheckAll");
}
});
//半成品
for (let i = 0; i < bcp_id_temp.length; i++) {
var dataBcpTable = $("#"+bcp_id_temp[i]).bootstrapTable("getSelections");
// console.log(dataBcpTable)
for (let j = 0; j < dataBcpTable.length; j++) {
var loss;
if (dataBcpTable[j].bcpMaterialLoss !== null || dataBcpTable[j].bcpMaterialLoss !== '') {
loss = dataBcpTable[j].bcpMaterialLoss.substring(0,dataBcpTable[j].bcpMaterialLoss.length-1)
} else {
loss = 0;
}
for (let i = 0; i < dataBcpSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
console.log(dataBcpTable[j].bcpMaterialLoss)
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
index: count + j,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataBcpSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataBcpSubsidiaryTable[i].specificationModel,
inventoryUnit: dataBcpSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataBcpSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataBcpSubsidiaryTable[i].supplierNumber,
materialCode: dataBcpTable[j].bcpCode,
materialName: dataBcpTable[j].bcpName,
specificationModel: dataBcpTable[j].specificationModel,
inventoryUnit: dataBcpTable[j].inventoryUnit,
materialType: '半成品',
materialConsumption: (Number(dataBcp[j].bcpMaterialConsumption)+Number(loss/100))*orderQuantity,
unitUsage: dataBcp[j].bcpMaterialConsumption,
itemNumber: dataBcpTable[j].customerNumber,
description: ''
}
});
}
// $("#"+bcp_id_temp[i]).bootstrapTable("uncheckAll");
}
$("#rawMaterialBomTable").bootstrapTable("uncheckAll");
$("#subsidiaryMaterialBomTable").bootstrapTable("uncheckAll");
$("#bcpMaterialBomTable").bootstrapTable("uncheckAll");
$("#raw_table").bootstrapTable("uncheckAll");
$("#subsidiary_table").bootstrapTable("uncheckAll");
$("#bcp_table").bootstrapTable("uncheckAll");
$("#bcp_raw_table").bootstrapTable("uncheckAll");
$("#bcp_subsidiary_table").bootstrapTable("uncheckAll");
//原料
for (let i = 0; i < raw_id_temp.length; i++) {
$("#"+raw_id_temp[i]).bootstrapTable("uncheckAll");
}
//辅料
for (let i = 0; i < subsidiary_id_temp.length; i++) {
$("#"+subsidiary_id_temp[i]).bootstrapTable("uncheckAll");
}
//半成品
for (let i = 0; i < bcp_id_temp.length; i++) {
$("#"+bcp_id_temp[i]).bootstrapTable("uncheckAll");
}
// $("#raw_table").bootstrapTable("uncheckAll");
// $("#subsidiary_table").bootstrapTable("uncheckAll");
// $("#bcp_table").bootstrapTable("uncheckAll");
// $("#bcp_raw_table").bootstrapTable("uncheckAll");
// $("#bcp_subsidiary_table").bootstrapTable("uncheckAll");
closeBomDetailModal();
}

47
ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/workOrderInfo.html

@ -81,7 +81,7 @@
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manufacture:workOrderInfo:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="removeWorkOrder()" shiro:hasPermission="manufacture:workOrderInfo:remove">
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="manufacture:workOrderInfo:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="exportWorkOrder()" shiro:hasPermission="manufacture:workOrderInfo:export">
@ -346,43 +346,16 @@
});
//删除
function removeWorkOrder() {
var orderData = $("#bootstrap-table").bootstrapTable("getSelections");
if (orderData.length === 1) {
// console.log(orderData)
$.ajax({
url: ctx + 'manufacture/workOrderDetail/list',
type: 'post',
data: {
workOrderNumber: orderData[0].workOrderNumber
},
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
$.modal.confirm("该订单内含有"+ res.rows.length+ "条物料数据将一并删除,是否删除?", function () {
$.ajax({
url: prefix + '/removeSelectedOrder',
type: 'post',
data: {
orderData: JSON.stringify(orderData)
},
success: function (res) {
// console.log(res)
$("#bootstrap-table").bootstrapTable("refresh");
$.modal.msgSuccess("删除成功!")
},
error: function (res) {
$.modal.msgError(res.error())
}
})
})
} else if (res.rows.length === 0) {
$.modal.confirm("确认删除该订单吗?", function () {
function removeSelected() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
// console.log(rows)
if (rows.length > 0) {
$.modal.confirm("是否删除选中的"+ rows.length +"条制工单?", function () {
$.ajax({
url: prefix + '/remove',
url: prefix + '/removeSelected',
type: 'post',
data: {
ids : orderData[0].workOrderId
ids : rows.join()
},
success: function (res) {
// console.log(res)
@ -394,10 +367,6 @@
}
})
})
}
}
})
} else {
$.modal.msgWarning("请选择一条数据")
}

5
ruoyi-admin/target/classes/templates/system/bom/bom.html

@ -787,6 +787,7 @@
initBcpBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
console.log(bcpCode)
var bcpVersionNumber = row.bcpVersionNumber;
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#bcp_bcp_table").bootstrapTable({
@ -842,11 +843,11 @@
title: '单位'
},
{
field: 'bcpConsumption',
field: 'bcpMaterialConsumption',
title: '用量'
},
{
field: 'bcpLoss',
field: 'bcpMaterialLoss',
title: '损耗%'
},
{

40
ruoyi-admin/target/classes/templates/system/bom/edit.html

@ -846,12 +846,12 @@
title: '用量',
editable: {
type: 'text',
title: '使用量',
emptytext: '使用量',
title: '用量',
emptytext: '用量',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
},
@ -863,9 +863,9 @@
title: '损耗%',
emptytext: '损耗%',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
@ -988,9 +988,9 @@
title: '使用量',
emptytext: '使用量',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
},
@ -1002,9 +1002,9 @@
title: '损耗%',
emptytext: '损耗%',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
@ -2132,9 +2132,9 @@
title: '使用量',
emptytext: '使用量',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}
},
@ -2146,9 +2146,9 @@
title: '损耗%',
emptytext: '损耗%',
validate: function (value) {
if (isNaN(value)) return '使用量必须是数字';
var price = parseFloat(value);
if (price <= 0) return '使用量必须大于0';
// if (isNaN(value)) return '使用量必须是数字';
// var price = parseFloat(value);
// if (price <= 0) return '使用量必须大于0';
}
}

20
ruoyi-admin/target/classes/templates/system/procedure/add.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增生产加工工序明细')" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -16,8 +18,8 @@
<label class="col-sm-3 control-label is-required" >车间名称:</label>
<div class="col-sm-8">
<!-- <input name="workshopName" class="form-control" type="text"/>-->
<select name="workshopName" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value=""></option>
<select name="workshopName" class="form-control select-list js-example-tags" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
@ -50,8 +52,8 @@
<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value=""></option>
<select name="associatedItem" class="form-control select-list js-example-tags" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">请选择核算数量关联项</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
@ -65,6 +67,7 @@
</form>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/procedure";
$("#form-procedure-add").validate({
@ -77,6 +80,15 @@
}
}
$(document).ready(function(){
$('.js-example-tags').select2({
tags: true,
insertTag: function (data, tag) {
// Insert the tag at the end of the results
data.push(tag);
}
});
});
</script>
</body>

24
ruoyi-admin/target/classes/templates/system/procedure/edit.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改生产加工工序明细')" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -17,8 +19,8 @@
<label class="col-sm-3 control-label">车间名称:</label>
<div class="col-sm-8">
<!-- <input name="workshopName" th:field="*{workshopName}" class="form-control" type="text">-->
<select name="workshopName" class="form-control select-list" th:field="*{workshopName}" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value=""></option>
<select name="workshopName" class="form-control select-list js-example-tags" th:field="*{workshopName}" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">请选择车间名称</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</div>
@ -50,8 +52,8 @@
<div class="form-group">
<label class="col-sm-3 control-label">核算数量关联项:</label>
<div class="col-sm-8">
<select name="associatedItem" class="form-control select-list" th:field="*{associatedItem}" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value=""></option>
<select name="associatedItem" class="form-control select-list js-example-tags" th:field="*{associatedItem}" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">请选择核算数量关联项</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
<!-- <input name="associatedItem" th:field="*{associatedItem}" class="form-control" type="text">-->
@ -66,6 +68,7 @@
</form>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/procedure";
$("#form-procedure-edit").validate({
@ -77,6 +80,19 @@
$.operate.save(prefix + "/edit", $('#form-procedure-edit').serialize());
}
}
$(document).ready(function(){
$('.js-example-tags').select2({
tags: true,
insertTag: function (data, tag) {
// Insert the tag at the end of the results
data.push(tag);
}
});
});
</script>
</body>
</html>
Loading…
Cancel
Save