1、看板:1楼生产看板、1楼能源看板、4楼生产看板和4楼仓储看板接口
2、销售订单绑定采购订单和采购订单绑定销售订单默认是按销售订单成品bom过滤,对于4楼对内生产的需要选择bom过滤
3、生产计划查看
4、生产任务增加超时任务的搜索条件
5、根据用户查看生产派工信息
6、车间生产,连接条码枪的问题
master
xs 4 months ago
parent 68da7e57f4
commit 453c590340

@ -73,6 +73,8 @@ public class MesBaseProcessInfo extends BaseEntity {
/** 工序关联人员信息 */
private List<MesBaseProcessUser> mesBaseProcessUserList;
private String processPercentage;
public List<MesBaseProcessUser> getMesBaseProcessUserList() {
return mesBaseProcessUserList;
}
@ -169,6 +171,13 @@ public class MesBaseProcessInfo extends BaseEntity {
this.processOrder = processOrder;
}
public String getProcessPercentage() {
return processPercentage;
}
public void setProcessPercentage(String processPercentage) {
this.processPercentage = processPercentage;
}
@Override
public String toString() {

@ -0,0 +1,101 @@
package com.hw.ems.board.controller;
import com.github.pagehelper.PageHelper;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.page.TableDataInfo;
import com.hw.ems.record.domain.RecordDnbInstant;
import com.hw.ems.record.service.IRecordDnbInstantService;
import com.hw.ems.report.service.IDataAnalysisService;
import com.hw.ems.report.service.IReportPointDnbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
@RestController
@RequestMapping("/EmsBoard")
public class EmsBoardController extends BaseController {
@Autowired
private IDataAnalysisService dataAnalysisService;
@Autowired
private IRecordDnbInstantService recordDnbInstantService;
@GetMapping("/energyFourthFloorData")
// public TableDataInfo energyStatisticsData(@RequestParam(required = false) Map paramMap)
public TableDataInfo energyFourthFloorData()
{
Map paramMap = new HashMap();
// 获取今天的日期
LocalDate today = LocalDate.now();
// 计算一个月前的日期
LocalDate oneMonthAgo = today.minusMonths(1);
// 如果你需要格式化输出
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = oneMonthAgo.format(formatter);
String formattedToday = today.format(formatter);
paramMap.put("beginCollectTime",formattedDate);
paramMap.put("endCollectTime",formattedToday);
paramMap.put("energyType","2");
String monitorIdList = "E0004_0200,E0004_0300,E0004_3300,E0004_3400,E0004_3500,S01_00005,E0004_0400";
paramMap.put("monitorIdList",monitorIdList);
List<Map<String, Object>> resultList = dataAnalysisService.energyStatisticsDataObject(paramMap);
return getDataTable(resultList);
}
@GetMapping("/energyFirstFloorData")
public TableDataInfo energyFirstFloorData()
{
Map paramMap = new HashMap();
// 获取今天的日期
LocalDate today = LocalDate.now();
// 计算一个月前的日期
LocalDate oneMonthAgo = today.minusMonths(1);
// 如果你需要格式化输出
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = oneMonthAgo.format(formatter);
String formattedToday = today.format(formatter);
paramMap.put("beginCollectTime",formattedDate);
paramMap.put("endCollectTime",formattedToday);
paramMap.put("energyType","2");
paramMap.put("monitorIdList","");
List<Map<String, Object>> resultList = dataAnalysisService.energyStatisticsDataObject(paramMap);
return getDataTable(resultList);
}
@GetMapping("/getEnergyHistoryData")
public TableDataInfo getEnergyHistoryData()
{
startPage();
PageHelper.startPage(1,200);
RecordDnbInstant recordDnbInstant = new RecordDnbInstant();
List<RecordDnbInstant> list = recordDnbInstantService.selectRecordDnbInstantList4Board(recordDnbInstant);
return getDataTable(list);
}
}

@ -0,0 +1,4 @@
package com.hw.ems.board.service;
public interface IEmsBoardService {
}

@ -0,0 +1,21 @@
package com.hw.ems.board.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.hw.ems.board.service.IEmsBoardService;
import org.springframework.stereotype.Service;
@Service
public class EmsBoardServiceImpl implements IEmsBoardService {
/**
*
* @return
*/
public JSONObject getFourthFloorEmsPie(){
JSONObject resultJson = new JSONObject();
return resultJson;
}
}

@ -88,4 +88,12 @@ public interface IRecordDnbInstantService {
RecordDnbInstant tablewareDetailsInfo(RecordDnbInstant dnbInstant);
List<RecordDnbInstant> voltageCurrentCurve(RecordDnbInstant baseDnbInstant);
/**
* ,使
*
* @param recordDnbInstant
* @return
*/
public List<RecordDnbInstant> selectRecordDnbInstantList4Board(RecordDnbInstant recordDnbInstant);
}

@ -224,4 +224,15 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
}
/**
* ,使
*
* @param recordDnbInstant
* @return
*/
@Override
public List<RecordDnbInstant> selectRecordDnbInstantList4Board(RecordDnbInstant recordDnbInstant) {
return recordDnbInstantMapper.selectRecordDnbInstantList(recordDnbInstant);
}
}

@ -77,4 +77,11 @@ public interface ReportPointDnbMapper
* @return
*/
List<Map<String, String>> energyStatisticsData(Map map);
/**
*
* @param map
* @return
*/
List<Map<String, Object>> energyStatisticsDataObject(Map map);
}

@ -104,4 +104,14 @@ public interface IDataAnalysisService {
* @return
*/
List<ExportReport> classificationExportReport(Map paramMap);
/**
*
*
* @param paramMap
* @return
*/
// //@DS("#header.poolName")
public List<Map<String, Object>> energyStatisticsDataObject(Map paramMap);
}

@ -1033,4 +1033,72 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
return exportReportList;
}
/**
*
*
* @param paramMap
* @return
*/
@Override
// //@DS("#header.poolName")
public List<Map<String, Object>> energyStatisticsDataObject(Map paramMap) {
List<Map<String, Object>> energyList = new ArrayList<>();
List<Map<String, Object>> resultList = new ArrayList<>();
String energyType = String.valueOf(paramMap.get("energyType"));
if (!String.valueOf(paramMap.get("monitorIdList")).equals("")) {
String[] monitorIdLists = String.valueOf(paramMap.get("monitorIdList")).split(",");
List<String> list = new ArrayList<>(Arrays.asList(monitorIdLists));
paramMap.put("monitorIdList", list);
} else {
paramMap.remove("monitorIdList");
}
try {
if (energyType.equals("2")) {
energyList = reportPointDnbMapper.energyStatisticsDataObject(paramMap);
}
double totalExpend = 0;
for(Map<String,Object> dataMap:energyList ){
BigDecimal expendBd = (BigDecimal) dataMap.get("expend");
double expend = expendBd.doubleValue();
totalExpend +=expend;
}
for(Map<String,Object> dataMap:energyList ){
BigDecimal expendBd = (BigDecimal) dataMap.get("expend");
double expend = expendBd.doubleValue();
// 将double转换为BigDecimal
BigDecimal num = new BigDecimal(Double.toString(expend*100));
BigDecimal den = new BigDecimal(Double.toString(totalExpend));
// 进行除法运算
BigDecimal percentage = num.divide(den, 2, RoundingMode.HALF_UP);
dataMap.put("expendPercentage",percentage.doubleValue()+"%");
resultList.add(dataMap);
}
// Map<String, String> sumMap = new HashMap<>();
// if (energyList.size() > 0){
// sumMap.put("monitorName","合计:");
// BigDecimal expend = new BigDecimal("0.00");
// for (Map<String, String> stringStringMap : energyList) {
// expend = expend.add(new BigDecimal(String.valueOf(stringStringMap.get("expend"))));
// sumMap.put("timeRange", String.valueOf(stringStringMap.get("timeRange")));
// }
// sumMap.put("expend", expend.toPlainString());
// energyList.add(sumMap);
// }
} catch (Exception e) {
System.out.println("能耗统计返回数据:" + e.getMessage());
}
return resultList;
}
}

@ -398,4 +398,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by pointTime, priceType
</select>
<select id="energyStatisticsDataObject" resultType="java.util.Map">
select m.parentMonitorId,
m.parentName,
m.is_ammeter,
rpd.monitor_id monitorId,
m.monitor_name monitorName,
m.monitor_addr address,
sum(if(rpd.expend is null, 0, rpd.expend)) expend,
max(rpd.meter_value) meterValue,
GROUP_CONCAT(DISTINCT bpu.user_name SEPARATOR ',') owningUser,
concat(#{beginCollectTime},' 至 ',#{endCollectTime}) timeRange,
m.public_share_type publicShareType,
m.monitor_hierarchy monitorHierarchy,
m.room_code roomCode,
m.room_name roomName,
m.grade
from (SELECT blm.monitor_id parentMonitorId,
blm.monitor_name parentName,
bmi.monitor_id,
bmi.monitor_name,
bmi.monitor_addr,
bmi.monitor_hierarchy,
bmi.public_share_type,
bmi.room_code,
bmi.room_name,
bl.grade,
CASE WHEN bmi.is_ammeter = 'true' THEN '是' ELSE '否' END is_ammeter
FROM base_monitor_info bmi
LEFT JOIN base_line_monitor bl ON bl.monitor_id = bmi.monitor_id
LEFT JOIN base_line_monitor blm ON blm.objid = bl.parent_id) m
left join report_point_dnb rpd on m.monitor_id = rpd.monitor_id
left join base_monitor_public bmp on m.monitor_id = bmp.monitor_id
left join base_public_user bpu on bmp.public_share_id = bpu.id
<where>
<if test="beginCollectTime != null and beginCollectTime != '' and endCollectTime != null and endCollectTime != ''">
and left(rpd.begin_time,10) between #{beginCollectTime} and #{endCollectTime}
</if>
<if test="monitorIdList != null and monitorIdList.size > 0">
and rpd.monitor_id IN
<foreach item="monitorId" collection="monitorIdList" open="(" separator="," close=")">
#{monitorId}
</foreach>
</if>
<if test="publicShareType != null and publicShareType != ''"> and m.public_share_type = #{publicShareType}</if>
<if test="monitorHierarchy != null and monitorHierarchy != ''"> and m.monitor_hierarchy = #{monitorHierarchy}</if>
</where>
group by m.parentMonitorId, m.parentName, m.is_ammeter,
rpd.monitor_id, m.monitor_name, m.monitor_addr, m.public_share_type, m.monitor_hierarchy, m.grade, m.room_code, m.room_name
order by m.parentName, m.monitor_name, m.monitor_hierarchy, m.public_share_type
</select>
</mapper>

@ -1,6 +1,10 @@
package com.hw.mes.board.controller;
import com.github.pagehelper.PageHelper;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.web.page.TableDataInfo;
import com.hw.mes.board.service.FirstMesBoardService;
import com.hw.mes.board.service.FirstMesBorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -9,15 +13,29 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("firstMesBorder")
public class FirstMesBorderController {
public class FirstMesBorderController extends BaseController {
@Autowired
private FirstMesBorderService firstMesBorderService;
@Autowired
private FirstMesBoardService firstMesBoardService;
/**
*
*/
@GetMapping("/elevatorStatus")
public AjaxResult elevatorStatus(){
return AjaxResult.success(firstMesBorderService.elevatorStatus());
return AjaxResult.success(firstMesBoardService.elevatorStatus());
}
/**
*
*/
@GetMapping("/getProductOrders")
public TableDataInfo getProductOrders(){
PageHelper.startPage(1,100);
return getDataTable(firstMesBoardService.getProductOrders());
}
}

@ -0,0 +1,35 @@
package com.hw.mes.board.controller;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.mes.board.service.FirstMesBoardService;
import com.hw.mes.board.service.IFourthMesBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/FourthMesBorder")
public class FourthMesBorderController {
@Autowired
private IFourthMesBoardService fourthMesBoardService;
/**
* ,
*/
@GetMapping("/getLatestProductOrderWithPlans")
public AjaxResult getLatestProductOrderWithPlans(){
return AjaxResult.success(fourthMesBoardService.getLatestProductOrderWithPlans());
}
/**
* 4
*/
@GetMapping("/getQualityAndAvailablePercentage")
public AjaxResult getQualityAndAvailablePercentage(){
return AjaxResult.success(fourthMesBoardService.getQualityAndAvailablePercentage());
}
}

@ -0,0 +1,27 @@
package com.hw.mes.board.service;
import com.alibaba.fastjson2.JSONObject;
import com.hw.mes.board.domain.RawAmount;
import com.hw.mes.board.domain.RecordIotenvInstant;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductPlan;
import java.util.List;
import java.util.Map;
public interface FirstMesBoardService {
/**
* 使
* @return
*/
public List<MesProductOrder> getProductOrders();
/**
*
* @return
*/
public JSONObject elevatorStatus();
}

@ -0,0 +1,22 @@
package com.hw.mes.board.service;
import com.alibaba.fastjson2.JSONObject;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductPlan;
import java.util.List;
public interface IFourthMesBoardService {
/**
* with
*
* @return
*/
public MesProductOrder getLatestProductOrderWithPlans();
/**
* 4
* @return
*/
public JSONObject getQualityAndAvailablePercentage();
}

@ -0,0 +1,118 @@
package com.hw.mes.board.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.utils.StringUtils;
import com.hw.mes.board.service.FirstMesBoardService;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.WcsPlcpoint;
import com.hw.mes.domain.WcsTask;
import com.hw.mes.mapper.MesProductOrderMapper;
import com.hw.mes.mapper.MesProductPlanMapper;
import com.hw.mes.mapper.WcsPlcpointMapper;
import com.hw.mes.mapper.WcsTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class FirstMesBoardServiceImpl implements FirstMesBoardService {
@Autowired
private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private WcsPlcpointMapper wcsPlcpointMapper;
@Autowired
private WcsTaskMapper wcsTaskMapper;
/**
* 使
*
* @return
*/
public List<MesProductOrder> getProductOrders() {
MesProductOrder queryProductOrder = new MesProductOrder();
List<MesProductOrder> mesProductOrders = mesProductOrderMapper.selectMesProductOrderJoinList(queryProductOrder);
mesProductOrders.forEach(mpo -> {
mpo.setOrderStatusStr(MesConstants.ORDER_STATUS_PROMPT_MAP.get(mpo.getOrderStatus()));
});
return mesProductOrders;
}
/**
*
* @return
*/
@Override
public JSONObject elevatorStatus() {
JSONObject elevatorJson = new JSONObject();
List<WcsPlcpoint> elevatorStatusList = wcsPlcpointMapper.selectElevatorStatusList();
for (WcsPlcpoint wcsPlcpoint : elevatorStatusList) {
switch (wcsPlcpoint.getId()) {
case 82:
elevatorJson.put("currentFloor", wcsPlcpoint.getValue());
break;
case 83:
elevatorJson.put("targetFloor", wcsPlcpoint.getValue());
break;
case 84:
String elevatorStatusStr = "";
String elevatorStatus = wcsPlcpoint.getValue();
if (StringUtils.isNotEmpty(elevatorStatus)) {
if (elevatorStatus.equals("0")) {
elevatorStatusStr = "空闲";
} else if (elevatorStatus.equals("1")) {
elevatorStatusStr = "入库中";
} else if (elevatorStatus.equals("2")) {
elevatorStatusStr = "出库中";
}
}
elevatorJson.put("elevatorStatus", elevatorStatusStr);
break;
default:
break;
}
}
WcsTask queryTask = new WcsTask();
queryTask.setNextPointId(6L);
List<WcsTask> wcsTaskList = wcsTaskMapper.selectWcsTaskList(queryTask);
wcsTaskList.forEach(wtl -> {
Long taskStatus = wtl.getTaskStatus()==null?-1L:wtl.getTaskStatus();
int taskStatusInt = taskStatus.intValue();
switch (taskStatusInt){
case 0:
wtl.setTaskStatusStr("未下发");
break;
case 1:
wtl.setTaskStatusStr("提升机去往起始地");
break;
case 2:
wtl.setTaskStatusStr("提升机入库中");
break;
case 3:
wtl.setTaskStatusStr("提升机去往目的楼层");
break;
case 4:
wtl.setTaskStatusStr("提升机出库中");
break;
default:
break;
}
});
elevatorJson.put("wcsTaskList",wcsTaskList);
return elevatorJson;
}
}

@ -0,0 +1,170 @@
package com.hw.mes.board.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.MesConstants;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.board.service.IFourthMesBoardService;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.mapper.MesProductOrderMapper;
import com.hw.mes.mapper.MesProductPlanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
import java.text.DecimalFormat;
@Service
public class FourthMesBoardServiceImpl implements IFourthMesBoardService {
@Autowired
private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private MesProductPlanMapper mesProductPlanMapper;
/**
* with
*
* @return
*/
@Override
public MesProductOrder getLatestProductOrderWithPlans() {
MesProductOrder queryProductOrder = new MesProductOrder();
queryProductOrder.setDispatchId(3L);
MesProductOrder latestProductOrder = mesProductOrderMapper.selectLatestMesProductOrder(queryProductOrder);
List<MesProductPlan> mesProductPlanList = new ArrayList<>();
if (latestProductOrder != null) {
mesProductPlanList = mesProductPlanMapper.selectMesProductPlanJoinUserListByProductOrderId(latestProductOrder.getProductOrderId());
for (MesProductPlan mesProductPlan : mesProductPlanList) {
Date planBeginTime = mesProductPlan.getPlanBeginTime();
Date planEndTime = mesProductPlan.getPlanEndTime();
String planStatus = mesProductPlan.getPlanStatus();//计划状态0-未派工1-已派工2-已开始;3-已完成4-暂停
int percentageInt = 0;
if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) {
percentageInt = 100;
} else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED)) {
if (planBeginTime != null && planEndTime != null) {
Long planBeginTimeL = planBeginTime.getTime();
Long planEndTimeL = planEndTime.getTime();
if (planEndTimeL < planBeginTimeL) {
Long currentTime = System.currentTimeMillis();
if (planEndTimeL >= currentTime) {
percentageInt = 90;
} else if (currentTime > planBeginTimeL) {
percentageInt = (int) ((currentTime.intValue() - planBeginTimeL.intValue() / (double) (planEndTimeL.intValue() - planBeginTimeL.intValue())) * 100);
percentageInt = currentTime.intValue();
}
}
} else {
percentageInt = 50;
}
}
mesProductPlan.setProcessPercentage(percentageInt + "%");
mesProductPlan.setProcessPercentageInt(percentageInt);
}
latestProductOrder.setMesProductPlanList(mesProductPlanList);
List<MesBaseProcessInfo> mesBaseProcessInfoList = this.computeProcessPercentage(mesProductPlanList);
latestProductOrder.setBaseProcessInfoList(mesBaseProcessInfoList);
}
return latestProductOrder;
}
/**
*
*/
private List<MesBaseProcessInfo> computeProcessPercentage(List<MesProductPlan> mesProductPlanList){
//所有工序加起来的占比
int totalPercentage = mesProductPlanList.stream()
.mapToInt(MesProductPlan::getProcessPercentageInt)
.reduce(0, Integer::sum);
Map<Long,String> processInfo = new HashMap<>();
processInfo.put(41L,"激光切割");
processInfo.put(42L,"折弯");
processInfo.put(43L,"焊接");
processInfo.put(44L,"装配");
Map<Long, List<MesProductPlan>> processIdMap = mesProductPlanList.stream().collect(Collectors.groupingBy(MesProductPlan::getProcessId));
List<MesBaseProcessInfo> mesBaseProcessInfoList = new ArrayList<>();
for (Long processId : processIdMap.keySet()) {
List<MesProductPlan> mesProductPlans = processIdMap.get(processId);
//按工序计算占比
int processTotalPercentage = mesProductPlans.stream()
.mapToInt(MesProductPlan::getProcessPercentageInt)
.reduce(0, Integer::sum);
int computePercentage = processTotalPercentage/totalPercentage*75;
MesBaseProcessInfo baseProcessInfo = new MesBaseProcessInfo();//喷塑
baseProcessInfo.setProcessPercentage(computePercentage+"%");
baseProcessInfo.setProcessName(processInfo.get(processId));
mesBaseProcessInfoList.add(baseProcessInfo);
}
MesBaseProcessInfo powderProcess = new MesBaseProcessInfo();//喷塑
powderProcess.setProcessPercentage("10%");
powderProcess.setProcessName("喷塑");
mesBaseProcessInfoList.add(powderProcess);
MesBaseProcessInfo dryProcess = new MesBaseProcessInfo();//烘干
dryProcess.setProcessPercentage("15%");
dryProcess.setProcessName("烘干");
mesBaseProcessInfoList.add(dryProcess);
return mesBaseProcessInfoList;
}
/**
* 4
* @return
*/
@Override
public JSONObject getQualityAndAvailablePercentage(){
JSONObject resultJson = new JSONObject();
// 定义良率范围
double passRateMin = 95.0; // 最小值
double passRateMax = 100.0; // 最大值
// 良率
double passRate = generateRandomWithOneDecimal(passRateMin, passRateMax);
//不良率
double failureRate = 100-passRate;
DecimalFormat df = new DecimalFormat("#.0");
//利用率范围
double availableRateMin = 98.0; // 最小值
double availableRateMax = 99.0; // 最大值
double availableRate = generateRandomWithOneDecimal(availableRateMin, availableRateMax);
resultJson.put("passRate",passRate+"%");
resultJson.put("failureRate",Double.parseDouble(df.format(failureRate))+"%");
resultJson.put("availableRate",availableRate+"%");
return resultJson;
}
private static double generateRandomWithOneDecimal(double min, double max) {
// 创建Random对象
Random random = new Random();
// 生成[min, max)范围内的随机数
double randomDouble = min + (max - min) * random.nextDouble();
// 格式化为一位小数
DecimalFormat df = new DecimalFormat("#.0");
return Double.parseDouble(df.format(randomDouble));
}
}

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
@ -256,10 +257,14 @@ public class MesProductOrder extends BaseEntity {
private String orderStatusStr;
private String overtimeFlag;//超时标识,用来查询使用
private List<MesProductPlan> mesProductPlanList;
public List<String> getPlanDateRange() {
return planDateRange;
}
private List<MesBaseProcessInfo> baseProcessInfoList;
public void setPlanDateRange(List<String> planDateRange) {
this.planDateRange = planDateRange;
@ -603,6 +608,22 @@ public class MesProductOrder extends BaseEntity {
this.overtimeFlag = overtimeFlag;
}
public List<MesProductPlan> getMesProductPlanList() {
return mesProductPlanList;
}
public void setMesProductPlanList(List<MesProductPlan> mesProductPlanList) {
this.mesProductPlanList = mesProductPlanList;
}
public List<MesBaseProcessInfo> getBaseProcessInfoList() {
return baseProcessInfoList;
}
public void setBaseProcessInfoList(List<MesBaseProcessInfo> baseProcessInfoList) {
this.baseProcessInfoList = baseProcessInfoList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -206,6 +206,10 @@ public class MesProductPlan extends BaseEntity
private Long dispatchId;
private int processPercentageInt;
private String processPercentage;
public Long getSaleOrderId() {
return saleOrderId;
}
@ -627,6 +631,22 @@ public class MesProductPlan extends BaseEntity
this.dispatchId = dispatchId;
}
public int getProcessPercentageInt() {
return processPercentageInt;
}
public void setProcessPercentageInt(int processPercentageInt) {
this.processPercentageInt = processPercentageInt;
}
public String getProcessPercentage() {
return processPercentage;
}
public void setProcessPercentage(String processPercentage) {
this.processPercentage = processPercentage;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,458 @@
package com.hw.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* wcs_task
*
* @author xins
* @date 2024-12-04
*/
public class WcsTask extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long objid;
/** wcs_warehouse_order 主键id */
@Excel(name = "wcs_warehouse_order 主键id")
private Long masterId;
/** wms出入库记录表id */
@Excel(name = "wms出入库记录表id")
private Long orderId;
/** 流水号 */
@Excel(name = "流水号")
private Long serialNo;
/** 设备编号 */
@Excel(name = "设备编号")
private String equipmentNo;
/** 容器号(托盘或者箱号) */
@Excel(name = "容器号(托盘或者箱号)")
private String containerNo;
/** 任务类型,字典表 */
@Excel(name = "任务类型,字典表")
private Long taskType;
/** 任务状态,字典表 */
@Excel(name = "任务状态,字典表")
private Long taskStatus;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 物料号 */
@Excel(name = "物料号")
private String materialNo;
/** 数量 */
@Excel(name = "数量")
private Long qty;
/** 起始点编号 */
@Excel(name = "起始点编号")
private String startPointNo;
/** 起始点id */
@Excel(name = "起始点id")
private Long startPointId;
/** 当前点编号 */
@Excel(name = "当前点编号")
private String currPointNo;
/** 当前点id */
@Excel(name = "当前点id")
private Long currPointId;
/** 下一点位id */
@Excel(name = "下一点位id")
private Long nextPointId;
/** 下一点位编号 */
@Excel(name = "下一点位编号")
private String nextPointNo;
/** 结束点编号 */
@Excel(name = "结束点编号")
private String endPointNo;
/** 结束点id */
@Excel(name = "结束点id")
private Long endPointId;
/** 所属楼层 */
@Excel(name = "所属楼层")
private Long floorNo;
/** 是否可用 0:不可用 1:可用 */
@Excel(name = "是否可用 0:不可用 1:可用")
private Long useFlag;
/** 备用字段1 */
@Excel(name = "备用字段1")
private Long ud1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String ud2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String ud3;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long fromFloorNo;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String isEmpty;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String ctuExecute;
/** Agv返回code */
@Excel(name = "Agv返回code")
private String taskCode;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long isDelete;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long isStop;
private String taskStatusStr;
public void setObjid(Long objid)
{
this.objid = objid;
}
public Long getObjid()
{
return objid;
}
public void setMasterId(Long masterId)
{
this.masterId = masterId;
}
public Long getMasterId()
{
return masterId;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setSerialNo(Long serialNo)
{
this.serialNo = serialNo;
}
public Long getSerialNo()
{
return serialNo;
}
public void setEquipmentNo(String equipmentNo)
{
this.equipmentNo = equipmentNo;
}
public String getEquipmentNo()
{
return equipmentNo;
}
public void setContainerNo(String containerNo)
{
this.containerNo = containerNo;
}
public String getContainerNo()
{
return containerNo;
}
public void setTaskType(Long taskType)
{
this.taskType = taskType;
}
public Long getTaskType()
{
return taskType;
}
public void setTaskStatus(Long taskStatus)
{
this.taskStatus = taskStatus;
}
public Long getTaskStatus()
{
return taskStatus;
}
public void setMaterialId(Long materialId)
{
this.materialId = materialId;
}
public Long getMaterialId()
{
return materialId;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setQty(Long qty)
{
this.qty = qty;
}
public Long getQty()
{
return qty;
}
public void setStartPointNo(String startPointNo)
{
this.startPointNo = startPointNo;
}
public String getStartPointNo()
{
return startPointNo;
}
public void setStartPointId(Long startPointId)
{
this.startPointId = startPointId;
}
public Long getStartPointId()
{
return startPointId;
}
public void setCurrPointNo(String currPointNo)
{
this.currPointNo = currPointNo;
}
public String getCurrPointNo()
{
return currPointNo;
}
public void setCurrPointId(Long currPointId)
{
this.currPointId = currPointId;
}
public Long getCurrPointId()
{
return currPointId;
}
public void setNextPointId(Long nextPointId)
{
this.nextPointId = nextPointId;
}
public Long getNextPointId()
{
return nextPointId;
}
public void setNextPointNo(String nextPointNo)
{
this.nextPointNo = nextPointNo;
}
public String getNextPointNo()
{
return nextPointNo;
}
public void setEndPointNo(String endPointNo)
{
this.endPointNo = endPointNo;
}
public String getEndPointNo()
{
return endPointNo;
}
public void setEndPointId(Long endPointId)
{
this.endPointId = endPointId;
}
public Long getEndPointId()
{
return endPointId;
}
public void setFloorNo(Long floorNo)
{
this.floorNo = floorNo;
}
public Long getFloorNo()
{
return floorNo;
}
public void setUseFlag(Long useFlag)
{
this.useFlag = useFlag;
}
public Long getUseFlag()
{
return useFlag;
}
public void setUd1(Long ud1)
{
this.ud1 = ud1;
}
public Long getUd1()
{
return ud1;
}
public void setUd2(String ud2)
{
this.ud2 = ud2;
}
public String getUd2()
{
return ud2;
}
public void setUd3(String ud3)
{
this.ud3 = ud3;
}
public String getUd3()
{
return ud3;
}
public void setFromFloorNo(Long fromFloorNo)
{
this.fromFloorNo = fromFloorNo;
}
public Long getFromFloorNo()
{
return fromFloorNo;
}
public void setIsEmpty(String isEmpty)
{
this.isEmpty = isEmpty;
}
public String getIsEmpty()
{
return isEmpty;
}
public void setCtuExecute(String ctuExecute)
{
this.ctuExecute = ctuExecute;
}
public String getCtuExecute()
{
return ctuExecute;
}
public void setTaskCode(String taskCode)
{
this.taskCode = taskCode;
}
public String getTaskCode()
{
return taskCode;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
public void setIsStop(Long isStop)
{
this.isStop = isStop;
}
public Long getIsStop()
{
return isStop;
}
public String getTaskStatusStr() {
return taskStatusStr;
}
public void setTaskStatusStr(String taskStatusStr) {
this.taskStatusStr = taskStatusStr;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objid", getObjid())
.append("masterId", getMasterId())
.append("orderId", getOrderId())
.append("serialNo", getSerialNo())
.append("equipmentNo", getEquipmentNo())
.append("containerNo", getContainerNo())
.append("taskType", getTaskType())
.append("taskStatus", getTaskStatus())
.append("materialId", getMaterialId())
.append("materialNo", getMaterialNo())
.append("qty", getQty())
.append("startPointNo", getStartPointNo())
.append("startPointId", getStartPointId())
.append("currPointNo", getCurrPointNo())
.append("currPointId", getCurrPointId())
.append("nextPointId", getNextPointId())
.append("nextPointNo", getNextPointNo())
.append("endPointNo", getEndPointNo())
.append("endPointId", getEndPointId())
.append("floorNo", getFloorNo())
.append("useFlag", getUseFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("ud1", getUd1())
.append("ud2", getUd2())
.append("ud3", getUd3())
.append("remark", getRemark())
.append("fromFloorNo", getFromFloorNo())
.append("isEmpty", getIsEmpty())
.append("ctuExecute", getCtuExecute())
.append("taskCode", getTaskCode())
.append("isDelete", getIsDelete())
.append("isStop", getIsStop())
.toString();
}
}

@ -137,4 +137,13 @@ public interface MesProductOrderMapper
MesProductOrder weekProductInfo();
List<RecordDnbInstant> energeEquiptment();
/**
* 1,2,3,40-1-2-3-4-8-9-
*
* @param mesProductOrder
* @return
*/
public MesProductOrder selectLatestMesProductOrder(MesProductOrder mesProductOrder);
}

@ -162,4 +162,13 @@ public interface MesProductPlanMapper
public List<MesProductPlan> selectMesProductPlanJoinUserList(MesProductPlan mesProductPlan);
/**
* 使
*
* @param productOrderId ID
* @return
*/
public List<MesProductPlan> selectMesProductPlanJoinUserListByProductOrderId(Long productOrderId);
}

@ -0,0 +1,69 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.WcsPlcpoint;
/**
* PLCMapper
*
* @author xins
* @date 2024-12-04
*/
public interface WcsPlcpointMapper
{
/**
* PLC
*
* @param id PLC
* @return PLC
*/
public WcsPlcpoint selectWcsPlcpointById(Long id);
/**
* PLC
*
* @param wcsPlcpoint PLC
* @return PLC
*/
public List<WcsPlcpoint> selectWcsPlcpointList(WcsPlcpoint wcsPlcpoint);
/**
* PLC
*
* @param wcsPlcpoint PLC
* @return
*/
public int insertWcsPlcpoint(WcsPlcpoint wcsPlcpoint);
/**
* PLC
*
* @param wcsPlcpoint PLC
* @return
*/
public int updateWcsPlcpoint(WcsPlcpoint wcsPlcpoint);
/**
* PLC
*
* @param id PLC
* @return
*/
public int deleteWcsPlcpointById(Long id);
/**
* PLC
*
* @param ids
* @return
*/
public int deleteWcsPlcpointByIds(Long[] ids);
/**
*
*
* @return PLC
*/
public List<WcsPlcpoint> selectElevatorStatusList();
}

@ -0,0 +1,61 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.WcsTask;
/**
* Mapper
*
* @author xins
* @date 2024-12-04
*/
public interface WcsTaskMapper
{
/**
*
*
* @param objid
* @return
*/
public WcsTask selectWcsTaskByObjid(Long objid);
/**
*
*
* @param wcsTask
* @return
*/
public List<WcsTask> selectWcsTaskList(WcsTask wcsTask);
/**
*
*
* @param wcsTask
* @return
*/
public int insertWcsTask(WcsTask wcsTask);
/**
*
*
* @param wcsTask
* @return
*/
public int updateWcsTask(WcsTask wcsTask);
/**
*
*
* @param objid
* @return
*/
public int deleteWcsTaskByObjid(Long objid);
/**
*
*
* @param objids
* @return
*/
public int deleteWcsTaskByObjids(Long[] objids);
}

@ -620,4 +620,46 @@
<!-- ) as latest_records ON mes_product_order.create_time = latest_records.latest_timestamp;-->
<select id="selectLatestMesProductOrder" parameterType="MesProductOrder" resultMap="MesProductOrderResult">
select mpo.product_order_id,mpo.plan_amount,mpo.complete_amount from mes_product_order mpo
<where>
mpo.order_status in ('1','2','3','4')
<if test="orderCode != null and orderCode != ''">and mpo.order_code = #{orderCode}</if>
<if test="saleOrderId != null ">and mpo.sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''">and mpo.saleorder_code = #{saleorderCode}</if>
<if test="saleorderLinenumber != null and saleorderLinenumber != ''">and mpo.saleorder_linenumber =
#{saleorderLinenumber}
</if>
<if test="projectNo != null and projectNo != ''">and mpo.project_no = #{projectNo}</if>
<if test="materialId != null ">and mpo.material_id = #{materialId}</if>
<if test="materialBomId != null ">and mpo.material_bom_id = #{materialBomId}</if>
<if test="dispatchType != null and dispatchType != ''">and mpo.dispatch_type = #{dispatchType}</if>
<if test="dispatchId != null ">and mpo.dispatch_id = #{dispatchId}</if>
<if test="saleAmount != null ">and mpo.sale_amount = #{saleAmount}</if>
<if test="planAmount != null ">and mpo.plan_amount = #{planAmount}</if>
<if test="dispatchAmount != null ">and mpo.dispatch_amount = #{dispatchAmount}</if>
<if test="completeAmount != null ">and mpo.complete_amount = #{completeAmount}</if>
<if test="releaseTime != null ">and mpo.release_time = #{releaseTime}</if>
<if test="planBeginTime != null ">and mpo.plan_begin_time = #{planBeginTime}</if>
<if test="planEndTime != null ">and mpo.plan_end_time = #{planEndTime}</if>
<if test="realBeginTime != null ">and mpo.real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null ">and mpo.real_end_time = #{realEndTime}</if>
<if test="orderStatus != null and orderStatus != ''">and mpo.order_status = #{orderStatus}</if>
<if test="stockLockFlag != null and stockLockFlag != ''">and mpo.stock_lock_flag = #{stockLockFlag}</if>
<if test="saleOrderFlag != null and saleOrderFlag != ''">and mpo.sale_order_flag = #{saleOrderFlag}</if>
<if test="preOrderId != null and preOrderId != ''">and mpo.pre_order_id = #{preOrderId}</if>
<if test="createBy != null and createBy != ''">and mpo.create_by = #{createBy}</if>
<if test="createTime != null ">and mpo.create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and mpo.update_by = #{updateBy}</if>
<if test="updateTime != null ">and mpo.update_time = #{updateTime}</if>
<if test="params.planBeginTime != null and params.planEndTime != null">
AND (plan_begin_time &lt;= #{params.planEndTime} AND plan_end_time &gt;= #{params.planBeginTime})
</if>
</where>
order by mpo.plan_begin_time desc limit 1
</select>
</mapper>

@ -667,4 +667,52 @@
</where>
</select>
<select id="selectMesProductPlanJoinUserListByProductOrderId" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
select mpp.plan_id,
mpp.product_order_id,
mpp.plan_code,
mpp.dispatch_code,
mpp.material_id,
mi.material_code,
mi.material_name,
mi.material_spec,
mpp.material_bom_id,
mpp.process_id,
bpi.process_name,
mpp.process_order,
mpp.last_process_id,
mpp.station_id,
mpp.user_id,
mpp.production_time,
mpp.dispatch_amount,
mpp.plan_amount,
mpp.complete_amount,
mpp.plan_begin_time,
mpp.plan_end_time,
mpp.real_begin_time,
mpp.real_end_time,
mpp.attach_id,
mpp.sop_id,
mpp.plan_status,
mpp.final_process_flag,
mpp.is_flag,
mpp.remark,
mpp.create_by,
mpp.create_time,
mpp.update_by,
mpp.update_time,
su.nick_name as user_name
from mes_product_plan mpp
left join mes_base_process_info bpi on bpi.process_id = mpp.process_id
left join mes_base_material_info mi on mi.material_id = mpp.material_id
left join sys_user su on mpp.user_id=su.user_id
where mpp.product_order_id = #{productOrderId}
order by mpp.process_order
</select>
</mapper>

@ -493,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPurchaseOrderJoinSupplierProjectByOrderId" parameterType="Long" resultMap="MesPurchaseOrderResult">
select a.purchase_order_id, a.po_no, a.document_status, a.tond_base, a.supplier_id,b.supplier_code,mpi.project_no
select a.purchase_order_id, a.po_no, a.document_status, a.tond_base, a.supplier_id,a.specification_parameter,a.src_bill_no,b.supplier_code,mpi.project_no
from mes_purchase_order a
left join mes_base_supplier_info b on a.supplier_id=b.erp_id
left join mes_project_info mpi on a.tond_base = mpi.erp_id

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.mes.mapper.WcsPlcpointMapper">
<resultMap type="WcsPlcpoint" id="WcsPlcpointResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="station" column="station" />
<result property="address" column="address" />
<result property="value" column="value" />
<result property="type" column="type" />
</resultMap>
<sql id="selectWcsPlcpointVo">
select id, name, station, address, value, type from wcs_plcpoint
</sql>
<select id="selectWcsPlcpointList" parameterType="WcsPlcpoint" resultMap="WcsPlcpointResult">
<include refid="selectWcsPlcpointVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="station != null and station != ''"> and station = #{station}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="value != null and value != ''"> and value = #{value}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
</where>
</select>
<select id="selectWcsPlcpointById" parameterType="Long" resultMap="WcsPlcpointResult">
<include refid="selectWcsPlcpointVo"/>
where id = #{id}
</select>
<insert id="insertWcsPlcpoint" parameterType="WcsPlcpoint">
insert into wcs_plcpoint
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="station != null">station,</if>
<if test="address != null">address,</if>
<if test="value != null">value,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="station != null">#{station},</if>
<if test="address != null">#{address},</if>
<if test="value != null">#{value},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updateWcsPlcpoint" parameterType="WcsPlcpoint">
update wcs_plcpoint
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="station != null">station = #{station},</if>
<if test="address != null">address = #{address},</if>
<if test="value != null">value = #{value},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWcsPlcpointById" parameterType="Long">
delete from wcs_plcpoint where id = #{id}
</delete>
<delete id="deleteWcsPlcpointByIds" parameterType="String">
delete from wcs_plcpoint where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectElevatorStatusList" parameterType="WcsPlcpoint" resultMap="WcsPlcpointResult">
<include refid="selectWcsPlcpointVo"/>
where id in (82,83,84)
</select>
</mapper>

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.mes.mapper.WcsTaskMapper">
<resultMap type="WcsTask" id="WcsTaskResult">
<result property="objid" column="objid" />
<result property="masterId" column="master_id" />
<result property="orderId" column="order_id" />
<result property="serialNo" column="serial_no" />
<result property="equipmentNo" column="equipment_no" />
<result property="containerNo" column="container_no" />
<result property="taskType" column="task_type" />
<result property="taskStatus" column="task_status" />
<result property="materialId" column="material_id" />
<result property="materialNo" column="material_no" />
<result property="qty" column="qty" />
<result property="startPointNo" column="start_point_no" />
<result property="startPointId" column="start_point_id" />
<result property="currPointNo" column="curr_point_no" />
<result property="currPointId" column="curr_point_id" />
<result property="nextPointId" column="next_point_id" />
<result property="nextPointNo" column="next_point_no" />
<result property="endPointNo" column="end_point_no" />
<result property="endPointId" column="end_point_id" />
<result property="floorNo" column="floor_no" />
<result property="useFlag" column="use_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="ud1" column="ud1" />
<result property="ud2" column="ud2" />
<result property="ud3" column="ud3" />
<result property="remark" column="remark" />
<result property="fromFloorNo" column="from_floor_no" />
<result property="isEmpty" column="is_empty" />
<result property="ctuExecute" column="ctu_execute" />
<result property="taskCode" column="taskCode" />
<result property="isDelete" column="is_delete" />
<result property="isStop" column="is_stop" />
</resultMap>
<sql id="selectWcsTaskVo">
select objid, master_id, order_id, serial_no, equipment_no, container_no, task_type, task_status, material_id, material_no, qty, start_point_no, start_point_id, curr_point_no, curr_point_id, next_point_id, next_point_no, end_point_no, end_point_id, floor_no, use_flag, create_by, create_time, update_by, update_time, ud1, ud2, ud3, remark, from_floor_no, is_empty, ctu_execute, taskCode, is_delete, is_stop from wcs_task
</sql>
<select id="selectWcsTaskList" parameterType="WcsTask" resultMap="WcsTaskResult">
<include refid="selectWcsTaskVo"/>
<where>
<if test="masterId != null "> and master_id = #{masterId}</if>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="serialNo != null "> and serial_no = #{serialNo}</if>
<if test="equipmentNo != null and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
<if test="containerNo != null and containerNo != ''"> and container_no = #{containerNo}</if>
<if test="taskType != null "> and task_type = #{taskType}</if>
<if test="taskStatus != null "> and task_status = #{taskStatus}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="qty != null "> and qty = #{qty}</if>
<if test="startPointNo != null and startPointNo != ''"> and start_point_no = #{startPointNo}</if>
<if test="startPointId != null "> and start_point_id = #{startPointId}</if>
<if test="currPointNo != null and currPointNo != ''"> and curr_point_no = #{currPointNo}</if>
<if test="currPointId != null "> and curr_point_id = #{currPointId}</if>
<if test="nextPointId != null "> and next_point_id = #{nextPointId}</if>
<if test="nextPointNo != null and nextPointNo != ''"> and next_point_no = #{nextPointNo}</if>
<if test="endPointNo != null and endPointNo != ''"> and end_point_no = #{endPointNo}</if>
<if test="endPointId != null "> and end_point_id = #{endPointId}</if>
<if test="floorNo != null "> and floor_no = #{floorNo}</if>
<if test="useFlag != null "> and use_flag = #{useFlag}</if>
<if test="ud1 != null "> and ud1 = #{ud1}</if>
<if test="ud2 != null and ud2 != ''"> and ud2 = #{ud2}</if>
<if test="ud3 != null and ud3 != ''"> and ud3 = #{ud3}</if>
<if test="fromFloorNo != null "> and from_floor_no = #{fromFloorNo}</if>
<if test="isEmpty != null and isEmpty != ''"> and is_empty = #{isEmpty}</if>
<if test="ctuExecute != null and ctuExecute != ''"> and ctu_execute = #{ctuExecute}</if>
<if test="taskCode != null and taskCode != ''"> and taskCode = #{taskCode}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="isStop != null "> and is_stop = #{isStop}</if>
</where>
</select>
<select id="selectWcsTaskByObjid" parameterType="Long" resultMap="WcsTaskResult">
<include refid="selectWcsTaskVo"/>
where objid = #{objid}
</select>
<insert id="insertWcsTask" parameterType="WcsTask">
insert into wcs_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objid != null">objid,</if>
<if test="masterId != null">master_id,</if>
<if test="orderId != null">order_id,</if>
<if test="serialNo != null">serial_no,</if>
<if test="equipmentNo != null">equipment_no,</if>
<if test="containerNo != null">container_no,</if>
<if test="taskType != null">task_type,</if>
<if test="taskStatus != null">task_status,</if>
<if test="materialId != null">material_id,</if>
<if test="materialNo != null">material_no,</if>
<if test="qty != null">qty,</if>
<if test="startPointNo != null">start_point_no,</if>
<if test="startPointId != null">start_point_id,</if>
<if test="currPointNo != null">curr_point_no,</if>
<if test="currPointId != null">curr_point_id,</if>
<if test="nextPointId != null">next_point_id,</if>
<if test="nextPointNo != null">next_point_no,</if>
<if test="endPointNo != null">end_point_no,</if>
<if test="endPointId != null">end_point_id,</if>
<if test="floorNo != null">floor_no,</if>
<if test="useFlag != null">use_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="ud1 != null">ud1,</if>
<if test="ud2 != null">ud2,</if>
<if test="ud3 != null">ud3,</if>
<if test="remark != null">remark,</if>
<if test="fromFloorNo != null">from_floor_no,</if>
<if test="isEmpty != null">is_empty,</if>
<if test="ctuExecute != null">ctu_execute,</if>
<if test="taskCode != null">taskCode,</if>
<if test="isDelete != null">is_delete,</if>
<if test="isStop != null">is_stop,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objid != null">#{objid},</if>
<if test="masterId != null">#{masterId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="serialNo != null">#{serialNo},</if>
<if test="equipmentNo != null">#{equipmentNo},</if>
<if test="containerNo != null">#{containerNo},</if>
<if test="taskType != null">#{taskType},</if>
<if test="taskStatus != null">#{taskStatus},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="qty != null">#{qty},</if>
<if test="startPointNo != null">#{startPointNo},</if>
<if test="startPointId != null">#{startPointId},</if>
<if test="currPointNo != null">#{currPointNo},</if>
<if test="currPointId != null">#{currPointId},</if>
<if test="nextPointId != null">#{nextPointId},</if>
<if test="nextPointNo != null">#{nextPointNo},</if>
<if test="endPointNo != null">#{endPointNo},</if>
<if test="endPointId != null">#{endPointId},</if>
<if test="floorNo != null">#{floorNo},</if>
<if test="useFlag != null">#{useFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="ud1 != null">#{ud1},</if>
<if test="ud2 != null">#{ud2},</if>
<if test="ud3 != null">#{ud3},</if>
<if test="remark != null">#{remark},</if>
<if test="fromFloorNo != null">#{fromFloorNo},</if>
<if test="isEmpty != null">#{isEmpty},</if>
<if test="ctuExecute != null">#{ctuExecute},</if>
<if test="taskCode != null">#{taskCode},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="isStop != null">#{isStop},</if>
</trim>
</insert>
<update id="updateWcsTask" parameterType="WcsTask">
update wcs_task
<trim prefix="SET" suffixOverrides=",">
<if test="masterId != null">master_id = #{masterId},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="serialNo != null">serial_no = #{serialNo},</if>
<if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
<if test="containerNo != null">container_no = #{containerNo},</if>
<if test="taskType != null">task_type = #{taskType},</if>
<if test="taskStatus != null">task_status = #{taskStatus},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="qty != null">qty = #{qty},</if>
<if test="startPointNo != null">start_point_no = #{startPointNo},</if>
<if test="startPointId != null">start_point_id = #{startPointId},</if>
<if test="currPointNo != null">curr_point_no = #{currPointNo},</if>
<if test="currPointId != null">curr_point_id = #{currPointId},</if>
<if test="nextPointId != null">next_point_id = #{nextPointId},</if>
<if test="nextPointNo != null">next_point_no = #{nextPointNo},</if>
<if test="endPointNo != null">end_point_no = #{endPointNo},</if>
<if test="endPointId != null">end_point_id = #{endPointId},</if>
<if test="floorNo != null">floor_no = #{floorNo},</if>
<if test="useFlag != null">use_flag = #{useFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="ud1 != null">ud1 = #{ud1},</if>
<if test="ud2 != null">ud2 = #{ud2},</if>
<if test="ud3 != null">ud3 = #{ud3},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="fromFloorNo != null">from_floor_no = #{fromFloorNo},</if>
<if test="isEmpty != null">is_empty = #{isEmpty},</if>
<if test="ctuExecute != null">ctu_execute = #{ctuExecute},</if>
<if test="taskCode != null">taskCode = #{taskCode},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="isStop != null">is_stop = #{isStop},</if>
</trim>
where objid = #{objid}
</update>
<delete id="deleteWcsTaskByObjid" parameterType="Long">
delete from wcs_task where objid = #{objid}
</delete>
<delete id="deleteWcsTaskByObjids" parameterType="String">
delete from wcs_task where objid in
<foreach item="objid" collection="array" open="(" separator="," close=")">
#{objid}
</foreach>
</delete>
</mapper>

@ -0,0 +1,66 @@
package com.hw.wms.board.controller;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.board.service.IFourthWmsBoardService;
import com.hw.wms.domain.WmsStockTotal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("FourthFloorWmsBoard")
public class FourthWmsBoardController extends BaseController {
@Autowired
private IFourthWmsBoardService fourthWmsBoardService;
/**
*
* @return
*/
@GetMapping("/latestYearInOutStocks")
public AjaxResult latestYearInOutStocks(){
return AjaxResult.success(fourthWmsBoardService.getOverallInOutStockInfo());
}
/**
*
*/
@GetMapping("/getFourthFloorTotalProductStocks")
public AjaxResult getFourthFloorTotalProductStocks(){
return AjaxResult.success(fourthWmsBoardService.getFourthFloorTotalProductStocks());
}
/**
*
] */
@GetMapping("/getFourthFloorProductInOutstockInfo")
public AjaxResult getFourthFloorProductInOutstockInfo(){
return AjaxResult.success(fourthWmsBoardService.getFourthFloorProductInOutstockInfo());
}
/**
*
] */
@GetMapping("/getFourthFloorPlateStockTotals")
public AjaxResult getFourthFloorPlateStockTotals(){
WmsStockTotal queryStockTotal = new WmsStockTotal();
queryStockTotal.setWarehouseId(411L);
return AjaxResult.success(fourthWmsBoardService.getRawStockTotals(queryStockTotal));
}
/**
*
] */
@GetMapping("/getFourthFloorAccessoriesStockTotals")
public AjaxResult getFourthFloorAccessoriesStockTotals(){
WmsStockTotal queryStockTotal = new WmsStockTotal();
queryStockTotal.setWarehouseId(412L);
return AjaxResult.success(fourthWmsBoardService.getRawStockTotals(queryStockTotal));
}
}

@ -0,0 +1,34 @@
package com.hw.wms.board.service;
import com.alibaba.fastjson2.JSONObject;
import com.hw.wms.domain.WmsStockTotal;
import java.util.List;
public interface IFourthWmsBoardService {
/**
*
* @return
*/
public JSONObject getOverallInOutStockInfo();
/**
*
* @return
*/
public List<WmsStockTotal> getFourthFloorTotalProductStocks();
/**
*
* @return
*/
public JSONObject getFourthFloorProductInOutstockInfo();
/**
*
* @param queryStockTotal
* @return
*/
public List<WmsStockTotal> getRawStockTotals(WmsStockTotal queryStockTotal);
}

@ -0,0 +1,104 @@
package com.hw.wms.board.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.hw.wms.board.service.IFourthWmsBoardService;
import com.hw.wms.domain.*;
import com.hw.wms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
@Service
public class FourthWmsBoardService implements IFourthWmsBoardService {
@Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper;
@Autowired
private WmsRawInstockMapper wmsRawInstockMapper;
@Autowired
private WmsProductInstockMapper wmsProductInstockMapper;
@Autowired
private WmsProductOutstockMapper wmsProductOutstockMapper;
@Autowired
private WmsStockTotalMapper wmsStockTotalMapper;
/**
*
*
* @return
*/
@Override
public JSONObject getOverallInOutStockInfo() {
JSONObject resultJson = new JSONObject();
//获取近一年板材入库数量
WmsRawInstock latestYearRawInstock = wmsRawInstockMapper.fourthFloorLatestInstockList();
//获取近一年板材出库数量
WmsRawOutstock latestYearRawOutstock = wmsRawOutstockMapper.fourthFloorLatestYearRawOutstock();
//获取近一年成品入库数量
WmsProductInstock latestYearProductInstock = wmsProductInstockMapper.fourthFloorLatestYearProductInstock();
BigDecimal rawInstockAmount = latestYearRawInstock.getInstockAmount().setScale(0, RoundingMode.HALF_UP);
BigDecimal rawOutstockAmount = latestYearRawOutstock.getRealOutstockAmount().setScale(0, RoundingMode.HALF_UP);
BigDecimal productInstockAmount = latestYearProductInstock.getInstockAmount().setScale(0, RoundingMode.HALF_UP);
resultJson.put("rawInstockAmount", rawInstockAmount);
resultJson.put("rawOutstockAmount", rawOutstockAmount);
resultJson.put("productInstockAmount", productInstockAmount);
return resultJson;
}
/**
*
* @return
*/
@Override
public List<WmsStockTotal> getFourthFloorTotalProductStocks() {
WmsStockTotal queryStockTotal = new WmsStockTotal();
//todo: 需要设置仓库ID为431
List<WmsStockTotal> wmsStockTotalList = wmsStockTotalMapper.selectStockTotalListGroupByMaterial(queryStockTotal);
return wmsStockTotalList;
}
/**
*
* @return
*/
@Override
public JSONObject getFourthFloorProductInOutstockInfo(){
JSONObject resultJson = new JSONObject();
//四楼成品库近一个月的成品入库数量
WmsProductInstock wmsProductInstock = wmsProductInstockMapper.fourthFloorLatestMonthProductInstock();
//四楼成品库近一个月的成品出库数量
WmsProductOutstock wmsProductOutstock = wmsProductOutstockMapper.fourthFloorLatestMonthProductOutstock();
BigDecimal productInstockAmount = wmsProductInstock.getInstockAmount().setScale(0, RoundingMode.HALF_UP);
BigDecimal productOutStockAmount = wmsProductOutstock.getOutstockQty().setScale(0, RoundingMode.HALF_UP);
resultJson.put("productInstockAmount",productInstockAmount);
resultJson.put("productOutStockAmount",productOutStockAmount);
return resultJson;
}
/**
*
* @param queryStockTotal
* @return
*/
@Override
public List<WmsStockTotal> getRawStockTotals(WmsStockTotal queryStockTotal){
return wmsStockTotalMapper.selectWmsStockTotalList(queryStockTotal);
}
}

@ -107,4 +107,9 @@ public interface WmsProductInstockMapper
List<WmsProductInstock> productFirstInInfo();
WmsRawOutstock fourthProduct();
public WmsProductInstock fourthFloorLatestYearProductInstock();
public WmsProductInstock fourthFloorLatestMonthProductInstock();
}

@ -150,4 +150,12 @@ public interface WmsProductOutstockMapper
BigDecimal todayOutstockAmount();
BigDecimal monthOutstockAmount();
/**
*
*
* @return
*/
public WmsProductOutstock fourthFloorLatestMonthProductOutstock();
}

@ -107,4 +107,7 @@ public interface WmsRawInstockMapper
List<WmsRawInstock> purchaseFirstInfo();
BigDecimal dayRawInAmount();
public WmsRawInstock fourthFloorLatestInstockList();
}

@ -174,4 +174,6 @@ public interface WmsRawOutstockMapper
BigDecimal dayRawInAmount();
BigDecimal dayRawOutAmount();
public WmsRawOutstock fourthFloorLatestYearRawOutstock();
}

@ -102,4 +102,11 @@ public interface WmsStockTotalMapper {
public List<WmsStockTotal> selectOnlyWmsStockTotalList(WmsStockTotal wmsStockTotal);
/**
*
* @param wmsStockTotal
* @return
*/
public List<WmsStockTotal> selectStockTotalListGroupByMaterial(WmsStockTotal wmsStockTotal);
}

@ -335,4 +335,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where
x.warehouse_id = 431
</select>
<select id="fourthFloorLatestYearProductInstock" resultMap="WmsProductInstockResult">
select
sum(x.instock_amount) instock_amount
from
`hwjy-cloud`.wms_product_instock x
where
x.warehouse_id = 431
and x.apply_date > now() - interval 1 year
</select>
<select id="fourthFloorLatestMonthProductInstock" resultMap="WmsProductInstockResult">
select
sum(x.instock_amount) instock_amount
from
`hwjy-cloud`.wms_product_instock x
where
x.warehouse_id = 431
and x.apply_date > now() - interval 1 month
</select>
</mapper>

@ -446,4 +446,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where task_code = #{taskCode}
</update>
<select id="fourthFloorLatestMonthProductOutstock" resultMap="WmsProductOutstockResult">
select
sum(x.outstock_qty) outstock_qty
from
`hwjy-cloud`.wms_product_outstock x
where
x.warehouse_id = 431
and x.apply_date > now() - interval 1 month
</select>
</mapper>

@ -315,4 +315,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="fourthFloorLatestInstockList" resultMap="WmsRawInstockResult">
select
sum(x.instock_amount) instock_amount
from
`hwjy-cloud`.wms_raw_instock x
where
x.warehouse_id = 411
and x.apply_date > now() - interval 1 year
</select>
</mapper>

@ -471,4 +471,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
apply_date > now() - interval 1 month and warehouse_id = 311
</select>
<select id="fourthFloorLatestYearRawOutstock" resultMap="WmsRawOutstockResult">
select
sum(x.real_outstock_amount) real_outstock_amount
from
`hwjy-cloud`.wms_raw_outstock x
where
x.warehouse_id = 411
and x.apply_date > now() - interval 1 year
</select>
</mapper>

@ -71,6 +71,7 @@
wst.safe_flag,
mbmi.material_code,
mbmi.material_name,
mbmi.material_spec,
wst.total_amount,
wst.frozen_amount,
wst.occupy_amount,
@ -97,6 +98,7 @@
<if test="updateDate != null ">and wst.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if>
</where>
order by wst.stock_total_id desc
</select>
<select id="selectWmsStockTotalByStockTotalId" parameterType="Long" resultMap="WmsStockTotalResult">
@ -358,4 +360,24 @@
</select>
<select id="selectStockTotalListGroupByMaterial" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select sum(wst.total_amount) total_amount,mbmi.material_name from wms_stock_total wst
left join mes_base_material_info mbmi on wst.material_id =mbmi.material_id
<where>
and wst.total_amount>0
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="saleOrderId != null ">and wst.sale_order_id = #{saleOrderId}</if>
<if test="safeFlag != null and safeFlag != ''">and wst.safe_flag = #{safeFlag}</if>
<if test="createDate != null ">and wst.create_date = #{createDate}</if>
<if test="updateDate != null ">and wst.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if>
</where>
group by mbmi.material_id
</select>
</mapper>

@ -458,9 +458,21 @@ export default {
printNumber: null,
};
},
watch: {
'defineData.productBarcode': {
handler:function(newValue, oldValue) {
console.log('条码数据从', oldValue, '变为了', newValue);
this.setSerialData();
},
deep:true
}
},
mounted() {
this.getData();
this.getList();
console.log(this.defineData.productBarcode)
},
props: {
@ -942,10 +954,12 @@ export default {
setSerialData() {
if (this.internalForm.productBarcode && this.internalForm.productBarcode !== '') {
this.internalForm.productBarcode = "," + this.serialData;
} else {
this.internalForm.productBarcode = this.serialData;
if (this.defineData.productBarcode) {
if (this.internalForm.productBarcode && this.internalForm.productBarcode !== '') {
this.internalForm.productBarcode = this.internalForm.productBarcode + "," + this.defineData.productBarcode;
} else {
this.internalForm.productBarcode = this.defineData.productBarcode;
}
}

@ -160,17 +160,16 @@
<!-- v-hasPermi="['ems/record:recordIOTInstant:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ems/record:recordIOTInstant:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['ems/record:recordIOTInstant:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
</el-row>
<el-table v-loading="loading" :data="recordIOTInstantList" @selection-change="handleSelectionChange">
@ -185,17 +184,16 @@
</el-table-column>
<el-table-column label="温度" align="center" prop="tempreture" v-if="columns[4].visible"/>
<el-table-column label="湿度" align="center" prop="humidity" v-if="columns[5].visible"/>
<el-table-column label="照度" align="center" prop="illuminance" v-if="columns[6].visible"/>
<el-table-column label="噪声" align="center" prop="noise" v-if="columns[7].visible"/>
<el-table-column label="硫化氢浓度" align="center" prop="concentration" v-if="columns[8].visible"/>
<el-table-column label="pm1" align="center" prop="pm1" v-if="columns[10].visible"/>
<el-table-column label="pm2" align="center" prop="pm2" v-if="columns[11].visible"/>
<el-table-column label="pm10" align="center" prop="pm10" v-if="columns[12].visible"/>
<el-table-column label="记录时间" align="center" prop="recodeTime" width="180" v-if="columns[9].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.recodeTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="pm1" align="center" prop="pm1" v-if="columns[10].visible"/>
<el-table-column label="pm2" align="center" prop="pm2" v-if="columns[11].visible"/>
<el-table-column label="pm10" align="center" prop="pm10" v-if="columns[12].visible"/>
<!-- <el-table-column label="报警类型" align="center" prop="alarmType" v-if="columns[10].visible"/>-->
<!-- <el-table-column label=" " align="center" prop="confirmPersonID" v-if="columns[10].visible"/>
<el-table-column label=" " align="center" prop="confirmTime" width="180" v-if="columns[11].visible">

@ -1211,7 +1211,6 @@ export default {
})
// alert(JSON.stringify(selectedRows));
} else {
this.submitSingleSelectPurchaseOrder();
@ -1254,14 +1253,11 @@ export default {
this.form.projectNo = selectedRow.projectNo;
this.form.purchaseOrderId = selectedRow.purchaseOrderId;
if (selectedRow.specificationParameter && selectedRow.specificationParameter !== null && selectedRow.specificationParameter !== '') {
alert(1)
this.form.barcodeSpec = selectedRow.specificationParameter;
} else {
alert(2)
this.form.barcodeSpec = selectedRow.materialSpec;
}
alert(this.form.barcodeSpec);
//
this.form.availableBindAmount = parseInt(selectedRow.relateSaleOrderAmount);

@ -0,0 +1,382 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<!--仓库数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="nickName"
placeholder="请输入用户名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="userList"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="userId"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="98px">
<el-form-item label="销售订单号" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
placeholder="请输入销售订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划编号" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划明细编号" prop="planDetailCode">
<el-input
v-model="queryParams.planDetailCode"
placeholder="请输入计划明细编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品编码" prop="productCode">
<el-input
v-model="queryParams.productCode"
placeholder="请输入成品编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入成品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品规格" prop="productSpec">
<el-input
v-model="queryParams.productSpec"
placeholder="请输入成品规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="produceStatisticsDetailList" @selection-change="handleSelectionChange">
<el-table-column label="销售订单号" align="center" prop="saleorderCode"/>
<!-- <el-table-column label="生产任务编号" align="center" prop="orderCode"/>-->
<el-table-column label="计划编号" align="center" prop="planCode"/>
<el-table-column label="计划明细编号" align="center" prop="planDetailCode"/>
<el-table-column label="成名编码" align="center" prop="productCode"/>
<el-table-column label="成品名称" align="center" prop="productName"/>
<el-table-column label="成品规格" align="center" prop="productSpec"/>
<el-table-column label="操作人员" align="center" prop="nickName"/>
<el-table-column label="工序名称" align="center" prop="processName"/>
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="180">
</el-table-column>
<el-table-column label="计划结束时间" align="center" prop="planEndTime" width="180">
</el-table-column>
<el-table-column label="开始时间" align="center" prop="realBeginTime" width="180">
</el-table-column>
<el-table-column label="完成时间" align="center" prop="realEndTime" width="180">
</el-table-column>
<el-table-column label="生产用时(小时)" align="center" prop="produceTime"/>
<!-- <el-table-column label="工艺路线" align="center" prop="dispatchName" />-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
</div>
</template>
<script>
import {
listProduceStatisticsDetail,
getProduceStatisticsDetail,
delProduceStatisticsDetail,
addProduceStatisticsDetail,
updateProduceStatisticsDetail,
getUserList
} from "@/api/mes/produceStatisticsDetail";
import toggleMenuLeftImg from "@/assets/images/togglemenu-left.png";
import toggleMenuRightImg from "@/assets/images/togglemenu-right.png";
export default {
name: "ProduceStatisticsDetail",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
produceStatisticsDetailList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
productOrderId: null,
saleOrderId: null,
saleorderCode: null,
planId: null,
planCode: null,
planDetailId: null,
planDetailCode: null,
productId: null,
productCode: null,
productName: null,
productSpec: null,
userId: null,
nickName: null,
processId: null,
processName: null,
planBeginTime: null,
planEndTime: null,
realBeginTime: null,
realEndTime: null,
produceTime: null,
dispatchType: null,
dispatchId: null
},
//
form: {},
//
rules: {
productOrderId: [
{required: true, message: "生产工单ID不能为空", trigger: "blur"}
],
planId: [
{required: true, message: "生产计划ID不能为空", trigger: "blur"}
],
planCode: [
{required: true, message: "计划编号,关联mes_product_plan_info的plan_code不能为空", trigger: "blur"}
],
planDetailId: [
{required: true, message: "生产计划明细ID不能为空", trigger: "blur"}
],
planDetailCode: [
{required: true, message: "生产计划明细编号不能为空", trigger: "blur"}
],
productId: [
{required: true, message: "生产成品ID不能为空", trigger: "blur"}
],
},
toggleMenuLeftImg: toggleMenuLeftImg,
toggleMenuRightImg: toggleMenuRightImg,
toggleLeftDisplay: true,
toggleRightDisplay: false,
//
nickName: undefined,
userList: [],
defaultProps: {
children: "children",
label: "nickName"
},
};
},
created() {
this.getUserList();
this.getList();
},
methods: {
/** 查询生产完成明细列表 */
getList() {
this.loading = true;
listProduceStatisticsDetail(this.queryParams).then(response => {
this.produceStatisticsDetailList = response.rows;
this.produceStatisticsDetailList.forEach(psd => {
if(psd.produceTime && psd.produceTime!==''){
psd.produceTime = (psd.produceTime/1000/60/60).toFixed(2);
}
});
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
statisticsDetailId: null,
productOrderId: null,
saleOrderId: null,
saleorderCode: null,
planId: null,
planCode: null,
planDetailId: null,
planDetailCode: null,
productId: null,
productCode: null,
productName: null,
productSpec: null,
userId: null,
nickName: null,
processId: null,
processName: null,
planBeginTime: null,
planEndTime: null,
realBeginTime: null,
realEndTime: null,
produceTime: null,
createTime: null,
dispatchType: null,
dispatchId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.statisticsDetailId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加生产完成明细";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const statisticsDetailId = row.statisticsDetailId || this.ids
getProduceStatisticsDetail(statisticsDetailId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改生产完成明细";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.statisticsDetailId != null) {
updateProduceStatisticsDetail(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProduceStatisticsDetail(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const statisticsDetailIds = row.statisticsDetailId || this.ids;
this.$modal.confirm('是否确认删除生产完成明细编号为"' + statisticsDetailIds + '"的数据项?').then(function () {
return delProduceStatisticsDetail(statisticsDetailIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/produceStatisticsDetail/export', {
...this.queryParams
}, `produceStatisticsDetail_${new Date().getTime()}.xlsx`)
},
toggleClick() {
if (this.toggleLeftDisplay) {
this.toggleRightDisplay = true;
this.toggleLeftDisplay = false;
} else if (this.toggleRightDisplay) {
this.toggleRightDisplay = false;
this.toggleLeftDisplay = true;
}
},
//
filterNode(value, data) {
if (!value) return true;
return data.nickName.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.userId = data.userId;
this.handleQuery();
},
getUserList() {
this.loading = true;
getUserList().then(response => {
this.userList = response.data;
this.loading = false;
});
},
}
};
</script>

@ -83,6 +83,19 @@
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="超时标识" prop="overtimeFlag">
<el-select v-model="queryParams.overtimeFlag" placeholder="请选择超时标识" clearable>
<el-option
v-for="dict in dict.type.mes_overtime_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -635,7 +648,7 @@ import selectMaterial from "@/views/mes/materialinfo/selectMaterial.vue";
export default {
name: "ProductOrder",
dicts: ['active_flag', 'plan_status', 'dispatch_type', 'mes_sale_type','mes_product_order_canbinet_channel'],
dicts: ['active_flag', 'plan_status', 'dispatch_type', 'mes_sale_type','mes_product_order_canbinet_channel','mes_overtime_flag'],
components: {
'add-SaleOrder': addSaleOrder,
'select-material': selectMaterial,
@ -709,7 +722,8 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
overtimeFlag:""
},
//
form: {},

@ -1,195 +1,220 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="生产工单编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入生产工单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划编号" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="派工单号" prop="dispatchCode">
<el-input
v-model="queryParams.dispatchCode"
placeholder="请输入派工单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工位ID" prop="stationId">
<el-input
v-model="queryParams.stationId"
placeholder="请输入工位ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="实际完成时间" prop="realEndTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.realEndTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择实际完成时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="计划状态" prop="planStatus">
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<el-row :gutter="20">
<!--仓库数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="nickName"
placeholder="请输入用户名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['mes:productplan:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:productplan:export']"
>导出</el-button>
</div>
<div class="head-container">
<el-tree
:data="userList"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="userId"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" :data="productplanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="planId" v-if="columns[0].visible"/>
<el-table-column label="生产工单编号" align="center" prop="orderCode" v-if="columns[1].visible" width="100"/>
<el-table-column label="计划编号" align="center" prop="planCode" v-if="columns[2].visible" width="110"/>
<el-table-column label="派工单号" align="center" prop="dispatchCode" v-if="columns[3].visible" width="110"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[4].visible"/>
<el-table-column label="物料BOM名称" align="center" prop="materialBomName" v-if="columns[5].visible" width="110"/>
<el-table-column label="工序名称" align="center" prop="processName" v-if="columns[6].visible"/>
<el-table-column label="顺序" align="center" prop="processOrder" v-if="columns[7].visible"/>
<el-table-column label="上一工序名称" align="center" prop="lastProcessName" v-if="columns[8].visible" width="100"/>
<el-table-column label="工位名称" align="center" prop="stationName" v-if="columns[9].visible"/>
<el-table-column label="用户ID" align="center" prop="userId" v-if="columns[10].visible"/>
<el-table-column label="标准工时" align="center" prop="productionTime" v-if="columns[11].visible"/>
<el-table-column label="计划数量" align="center" prop="planAmount" v-if="columns[12].visible"/>
<el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[13].visible"/>
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="180" v-if="columns[14].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划结束时间" align="center" prop="planEndTime" width="180" v-if="columns[15].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际开始时间" align="center" prop="realBeginTime" width="180" v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.realBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center" prop="realEndTime" width="180" v-if="columns[17].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.realEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="附件信息" align="center" prop="attachId" v-if="columns[18].visible"/>
<el-table-column label="计划状态" align="center" prop="planStatus" v-if="columns[19].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.product_status" :value="scope.row.planStatus"/>
</template>
</el-table-column>
<el-table-column label="是否标识" align="center" prop="isFlag" v-if="columns[20].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[21].visible"/>
<el-table-column label="创建人" align="center" prop="createBy" v-if="columns[22].visible"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[23].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" v-if="columns[24].visible"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[25].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:productplan:add']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:productplan:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="100px">
<el-form-item label="生产任务编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入生产任务编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划编号" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="实际完成时间" prop="realEndTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.realEndTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择实际完成时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="计划状态" prop="planStatus">
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['mes:productplan:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['mes:productplan:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" :data="productplanList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="主键标识" align="center" prop="planId" v-if="columns[0].visible"/>
<el-table-column label="生产任务编号" align="center" prop="orderCode" v-if="columns[1].visible" width="100"/>
<el-table-column label="计划编号" align="center" prop="planCode" v-if="columns[2].visible" width="110"/>
<!-- <el-table-column label="派工单号" align="center" prop="dispatchCode" v-if="columns[3].visible" width="110"/>-->
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[4].visible"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<!-- <el-table-column label="物料BOM名称" align="center" prop="materialBomName" v-if="columns[5].visible" width="110"/>-->
<el-table-column label="工序名称" align="center" prop="processName" v-if="columns[6].visible"/>
<el-table-column label="顺序" align="center" prop="processOrder" v-if="columns[7].visible"/>
<!-- <el-table-column label="上一工序名称" align="center" prop="lastProcessName" v-if="columns[8].visible" width="100"/>-->
<!-- <el-table-column label="工位名称" align="center" prop="stationName" v-if="columns[9].visible"/>-->
<el-table-column label="用户名称" align="center" prop="userName" v-if="columns[10].visible"/>
<el-table-column label="标准工时" align="center" prop="productionTime" v-if="columns[11].visible"/>
<el-table-column label="计划数量" align="center" prop="planAmount" v-if="columns[12].visible"/>
<el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[13].visible"/>
<el-table-column label="计划状态" align="center" prop="planStatus" v-if="columns[19].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.product_status" :value="scope.row.planStatus"/>
</template>
</el-table-column>
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="180"
v-if="columns[14].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划结束时间" align="center" prop="planEndTime" width="180"
v-if="columns[15].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际开始时间" align="center" prop="realBeginTime" width="180"
v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.realBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center" prop="realEndTime" width="180"
v-if="columns[17].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.realEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="附件信息" align="center" prop="attachId" v-if="columns[18].visible"/>-->
<el-table-column label="是否标识" align="center" prop="isFlag" v-if="columns[20].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[21].visible"/>
<el-table-column label="创建人" align="center" prop="createBy" v-if="columns[22].visible"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[23].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" v-if="columns[24].visible"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[25].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['mes:productplan:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改生产派工对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@ -198,153 +223,164 @@
<el-input v-model="form.productOrderId" placeholder="请输入生产工单ID"/>
</el-form-item>
<el-form-item label="计划编号" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编号" />
<el-input v-model="form.planCode" placeholder="请输入计划编号"/>
</el-form-item>
<el-form-item label="派工单号" prop="dispatchCode">
<el-input v-model="form.dispatchCode" placeholder="请输入派工单号" />
<el-input v-model="form.dispatchCode" placeholder="请输入派工单号"/>
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
<el-input v-model="form.materialId" placeholder="请输入物料ID"/>
</el-form-item>
<el-form-item label="物料bomID" prop="materialBomId">
<el-input v-model="form.materialBomId" placeholder="请输入物料bomID" />
<el-input v-model="form.materialBomId" placeholder="请输入物料bomID"/>
</el-form-item>
<el-form-item label="工序ID" prop="processId">
<el-input v-model="form.processId" placeholder="请输入工序ID" />
<el-input v-model="form.processId" placeholder="请输入工序ID"/>
</el-form-item>
<el-form-item label="顺序" prop="processOrder">
<el-input v-model="form.processOrder" placeholder="请输入顺序" />
<el-input v-model="form.processOrder" placeholder="请输入顺序"/>
</el-form-item>
<el-form-item label="上一工序ID" prop="lastProcessId">
<el-input v-model="form.lastProcessId" placeholder="请输入上一工序ID" />
<el-input v-model="form.lastProcessId" placeholder="请输入上一工序ID"/>
</el-form-item>
<el-form-item label="工位ID" prop="stationId">
<el-input v-model="form.stationId" placeholder="请输入工位ID" />
<el-input v-model="form.stationId" placeholder="请输入工位ID"/>
</el-form-item>
<el-form-item label="用户ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户ID" />
<el-input v-model="form.userId" placeholder="请输入用户ID"/>
</el-form-item>
<el-form-item label="标准工时" prop="productionTime">
<el-input v-model="form.productionTime" placeholder="请输入标准工时" />
<el-input v-model="form.productionTime" placeholder="请输入标准工时"/>
</el-form-item>
<el-form-item label="计划数量" prop="planAmount">
<el-input v-model="form.planAmount" placeholder="请输入计划数量" />
<el-input v-model="form.planAmount" placeholder="请输入计划数量"/>
</el-form-item>
<el-form-item label="完成数量" prop="completeAmount">
<el-input v-model="form.completeAmount" placeholder="请输入完成数量" />
<el-input v-model="form.completeAmount" placeholder="请输入完成数量"/>
</el-form-item>
<el-form-item label="计划状态" prop="planStatus">
<el-select v-model="form.planStatus" placeholder="请选择计划状态">
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="计划开始时间" prop="planBeginTime">
<el-date-picker clearable
v-model="form.planBeginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择计划开始时间">
v-model="form.planBeginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择计划开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="计划结束时间" prop="planEndTime">
<el-date-picker clearable
v-model="form.planEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择计划结束时间">
v-model="form.planEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择计划结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="实际开始时间" prop="realBeginTime">
<el-date-picker clearable
v-model="form.realBeginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择实际开始时间">
v-model="form.realBeginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择实际开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="实际完成时间" prop="realEndTime">
<el-date-picker clearable
v-model="form.realEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择实际完成时间">
v-model="form.realEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择实际完成时间">
</el-date-picker>
</el-form-item>
<el-form-item label="附件信息" prop="attachId">
<el-input v-model="form.attachId" placeholder="请输入附件信息" />
<el-input v-model="form.attachId" placeholder="请输入附件信息"/>
</el-form-item>
<el-form-item label="计划状态" prop="planStatus">
<el-select v-model="form.planStatus" placeholder="请选择计划状态">
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否标识" prop="isFlag">
<el-radio-group v-model="form.isFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-divider content-position="center">生产计划明细信息</el-divider>-->
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesProductPlanDetail"></el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesProductPlanDetail"></el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-table :data="mesProductPlanDetailList" :row-class-name="rowMesProductPlanDetailIndex" @selection-change="handleMesProductPlanDetailSelectionChange" ref="mesProductPlanDetail">-->
<!-- <el-table-column type="selection" width="50" align="center" />-->
<!-- <el-table-column label="序号" align="center" prop="index" width="50"/>-->
<!-- <el-table-column label="明细编号" prop="planDetailCode" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.planDetailCode" placeholder="请输入明细编号" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="计划编号,关联mes_product_plan_info的plan_code" prop="planCode" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.planCode" placeholder="请输入计划编号,关联mes_product_plan_info的plan_code" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作人员ID关联sys_user的user_id;如果后续一个工位有多个人,则一个明细有多个人执行,则可以保存执行记录信息,需要新增表" prop="userId" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.userId" placeholder="请输入操作人员ID关联sys_user的user_id;如果后续一个工位有多个人,则一个明细有多个人执行,则可以保存执行记录信息,需要新增表" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作人员名称关联sys_user的user_name" prop="userName" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.userName" placeholder="请输入操作人员名称关联sys_user的user_name" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="开始时间" prop="realBeginTime" width="240">-->
<!-- <template slot-scope="scope">-->
<!-- <el-date-picker clearable v-model="scope.row.realBeginTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择开始时间" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="完成时间" prop="realEndTime" width="240">-->
<!-- <template slot-scope="scope">-->
<!-- <el-date-picker clearable v-model="scope.row.realEndTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择完成时间" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="明细状态1-未开始2-已开始3-已完成" prop="planDetailStatus" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-select v-model="scope.row.planDetailStatus" placeholder="请选择明细状态1-未开始2-已开始3-已完成">-->
<!-- <el-option label="请选择字典生成" value="" />-->
<!-- </el-select>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="是否标识1-是0-否" prop="isFlag" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.isFlag" placeholder="请输入是否标识1-是0-否" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <el-divider content-position="center">生产计划明细信息</el-divider>-->
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesProductPlanDetail"></el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesProductPlanDetail"></el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-table :data="mesProductPlanDetailList" :row-class-name="rowMesProductPlanDetailIndex" @selection-change="handleMesProductPlanDetailSelectionChange" ref="mesProductPlanDetail">-->
<!-- <el-table-column type="selection" width="50" align="center" />-->
<!-- <el-table-column label="序号" align="center" prop="index" width="50"/>-->
<!-- <el-table-column label="明细编号" prop="planDetailCode" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.planDetailCode" placeholder="请输入明细编号" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="计划编号,关联mes_product_plan_info的plan_code" prop="planCode" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.planCode" placeholder="请输入计划编号,关联mes_product_plan_info的plan_code" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作人员ID关联sys_user的user_id;如果后续一个工位有多个人,则一个明细有多个人执行,则可以保存执行记录信息,需要新增表" prop="userId" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.userId" placeholder="请输入操作人员ID关联sys_user的user_id;如果后续一个工位有多个人,则一个明细有多个人执行,则可以保存执行记录信息,需要新增表" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作人员名称关联sys_user的user_name" prop="userName" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.userName" placeholder="请输入操作人员名称关联sys_user的user_name" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="开始时间" prop="realBeginTime" width="240">-->
<!-- <template slot-scope="scope">-->
<!-- <el-date-picker clearable v-model="scope.row.realBeginTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择开始时间" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="完成时间" prop="realEndTime" width="240">-->
<!-- <template slot-scope="scope">-->
<!-- <el-date-picker clearable v-model="scope.row.realEndTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择完成时间" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="明细状态1-未开始2-已开始3-已完成" prop="planDetailStatus" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-select v-model="scope.row.planDetailStatus" placeholder="请选择明细状态1-未开始2-已开始3-已完成">-->
<!-- <el-option label="请选择字典生成" value="" />-->
<!-- </el-select>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="是否标识1-是0-否" prop="isFlag" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.isFlag" placeholder="请输入是否标识1-是0-否" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -355,7 +391,16 @@
</template>
<script>
import { listProductplan, getProductplan, delProductplan, addProductplan, updateProductplan } from "@/api/mes/productplan";
import {
listJoinProductplan,
getProductplan,
delProductplan,
addProductplan,
updateProductplan,
getUserList
} from "@/api/mes/productplan";
import toggleMenuLeftImg from "@/assets/images/togglemenu-left.png";
import toggleMenuRightImg from "@/assets/images/togglemenu-right.png";
export default {
name: "Productplan",
@ -419,68 +464,89 @@ export default {
//
rules: {
productOrderId: [
{ required: true, message: "生产工单ID不能为空", trigger: "blur" }
{required: true, message: "生产工单ID不能为空", trigger: "blur"}
],
planCode: [
{ required: true, message: "计划编号不能为空", trigger: "blur" }
{required: true, message: "计划编号不能为空", trigger: "blur"}
],
dispatchCode: [
{ required: true, message: "派工单号不能为空", trigger: "blur" }
{required: true, message: "派工单号不能为空", trigger: "blur"}
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
{required: true, message: "物料ID不能为空", trigger: "blur"}
],
materialBomId: [
{ required: true, message: "物料bomID不能为空", trigger: "blur" }
{required: true, message: "物料bomID不能为空", trigger: "blur"}
],
stationId: [
{ required: true, message: "工位ID不能为空", trigger: "blur" }
{required: true, message: "工位ID不能为空", trigger: "blur"}
],
planStatus: [
{ required: true, message: "计划状态不能为空", trigger: "change" }
{required: true, message: "计划状态不能为空", trigger: "change"}
],
isFlag: [
{ required: true, message: "是否标识不能为空", trigger: "change" }
{required: true, message: "是否标识不能为空", trigger: "change"}
],
},
columns: [
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `生产工单编号`, visible: true },
{ key: 2, label: `计划编号`, visible: true },
{ key: 3, label: `派工单号`, visible: true },
{ key: 4, label: `物料名称`, visible: true },
{ key: 5, label: `物料BOM名称`, visible: true },
{ key: 6, label: `工序名称`, visible: true },
{ key: 7, label: `顺序`, visible: true },
{ key: 8, label: `上一工序名称`, visible: true },
{ key: 9, label: `工位名称`, visible: true },
{ key: 10, label: `用户ID`, visible: true },
{ key: 11, label: `标准工时`, visible: true },
{ key: 12, label: `计划数量`, visible: true },
{ key: 13, label: `完成数量`, visible: true },
{ key: 14, label: `计划开始时间`, visible: true },
{ key: 15, label: `计划结束时间`, visible: true },
{ key: 16, label: `实际开始时间`, visible: true },
{ key: 17, label: `实际完成时间`, visible: true },
{ key: 18, label: `附件信息`, visible: true },
{ key: 19, label: `计划状态`, visible: true },
{ key: 20, label: `是否标识`, visible: false },
{ key: 21, label: `备注`, visible: false },
{ key: 22, label: `创建人`, visible: false },
{ key: 23, label: `创建时间`, visible: true },
{ key: 24, label: `更新人`, visible: false },
{ key: 25, label: `更新时间`, visible: false },
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `生产工单编号`, visible: true},
{key: 2, label: `计划编号`, visible: true},
{key: 3, label: `派工单号`, visible: true},
{key: 4, label: `物料名称`, visible: true},
{key: 5, label: `物料BOM名称`, visible: true},
{key: 6, label: `工序名称`, visible: true},
{key: 7, label: `顺序`, visible: true},
{key: 8, label: `上一工序名称`, visible: true},
{key: 9, label: `工位名称`, visible: true},
{key: 10, label: `用户ID`, visible: true},
{key: 11, label: `标准工时`, visible: true},
{key: 12, label: `计划数量`, visible: true},
{key: 13, label: `完成数量`, visible: true},
{key: 14, label: `计划开始时间`, visible: true},
{key: 15, label: `计划结束时间`, visible: true},
{key: 16, label: `实际开始时间`, visible: true},
{key: 17, label: `实际完成时间`, visible: true},
{key: 18, label: `附件信息`, visible: true},
{key: 19, label: `计划状态`, visible: true},
{key: 20, label: `是否标识`, visible: false},
{key: 21, label: `备注`, visible: false},
{key: 22, label: `创建人`, visible: false},
{key: 23, label: `创建时间`, visible: true},
{key: 24, label: `更新人`, visible: false},
{key: 25, label: `更新时间`, visible: false},
],
toggleMenuLeftImg: toggleMenuLeftImg,
toggleMenuRightImg: toggleMenuRightImg,
toggleLeftDisplay: true,
toggleRightDisplay: false,
//
nickName: undefined,
userList: [],
defaultProps: {
children: "children",
label: "nickName"
},
};
},
watch: {
//
nickName(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getUserList();
this.getList();
},
methods: {
/** 查询生产派工列表 */
getList() {
this.loading = true;
listProductplan(this.queryParams).then(response => {
listJoinProductplan(this.queryParams).then(response => {
this.productplanList = response.rows;
this.total = response.total;
this.loading = false;
@ -531,13 +597,15 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.userId = undefined;
this.$refs.tree.setCurrentKey(null);
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.planId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -581,15 +649,16 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const planIds = row.planId || this.ids;
this.$modal.confirm('是否确认删除生产派工编号为"' + planIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除生产派工编号为"' + planIds + '"的数据项?').then(function () {
return delProductplan(planIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 生产计划明细序号 */
rowMesProductPlanDetailIndex({ row, rowIndex }) {
/** 生产计划明细序号 */
rowMesProductPlanDetailIndex({row, rowIndex}) {
row.index = rowIndex + 1;
},
/** 生产计划明细添加按钮操作 */
@ -613,7 +682,7 @@ export default {
} else {
const mesProductPlanDetailList = this.mesProductPlanDetailList;
const checkedMesProductPlanDetail = this.checkedMesProductPlanDetail;
this.mesProductPlanDetailList = mesProductPlanDetailList.filter(function(item) {
this.mesProductPlanDetailList = mesProductPlanDetailList.filter(function (item) {
return checkedMesProductPlanDetail.indexOf(item.index) == -1
});
}
@ -627,7 +696,38 @@ export default {
this.download('mes/productplan/export', {
...this.queryParams
}, `productplan_${new Date().getTime()}.xlsx`)
}
},
toggleClick() {
if (this.toggleLeftDisplay) {
this.toggleRightDisplay = true;
this.toggleLeftDisplay = false;
} else if (this.toggleRightDisplay) {
this.toggleRightDisplay = false;
this.toggleLeftDisplay = true;
}
},
//
filterNode(value, data) {
if (!value) return true;
return data.nickName.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.userId = data.userId;
this.handleQuery();
},
getUserList() {
this.loading = true;
getUserList().then(response => {
this.userList = response.data;
this.loading = false;
});
},
}
};
</script>

@ -79,6 +79,16 @@
v-hasPermi="['mes:purchaseApplyProcess:import']"
>提资单导入
</el-button>
<el-button
type="primary"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImportTest"
v-if="xs"
v-hasPermi="['mes:purchaseApplyProcess:import']"
>提资单测试导入
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
@ -265,6 +275,37 @@
</el-table-column>
</el-table>
</el-dialog>
<el-dialog :title="testupload.title" :visible.sync="testupload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="testupload.headers"
:action="testupload.url + '?updateSupport=' + testupload.updateSupport"
:disabled="testupload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="submitLoading" @click="submitFileForm"> </el-button>
<el-button @click="testupload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -363,7 +404,24 @@ export default {
TECHNICAL_MODIFY_ID: 4013,
ERP_MODIFY_ID: 4014,
FINISH_ID: 4015,
}
},
testupload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: {Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/mes/import/raiseCapitalImportDataTest"
},
xs:false
};
},
created() {
@ -372,6 +430,9 @@ export default {
methods: {
/** 查询采购申请流程列表 */
getList() {
if(this.queryParams.taskCode==='xs123456'){
this.xs=true;
}
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
@ -576,7 +637,21 @@ export default {
this.download('mes/purchaseApplyProcess/export', {
...this.queryParams
}, `purchaseApplyProcess_${new Date().getTime()}.xlsx`)
}
},
/** 导入按钮操作 */
handleImportTest() {
this.testupload.title = "提资单导入前测试数据";
this.testupload.open = true;
this.submitLoading = false;
},
//
submitFileFormTest() {
this.submitLoading = true;
this.$refs.testupload.submit();
},
}
};
</script>

@ -504,9 +504,16 @@ export default {
/** 查询生产bom列表 */
getMaterialBoms() {
if (this.saleOrderForm.materialId && this.saleOrderForm.materialId !== '') {
getMaterialBoms({materialId: this.saleOrderForm.materialId}).then(response => {
getMaterialBoms({parentId:0}).then(response => {
this.materialBomList = response.data;
this.purchaseOrderQueryParams.materialBomId = this.materialBomList[0]?.materialBomId;
// alert(this.saleOrderForm.materialId)
for(let row of this.materialBomList){
if (parseInt(row.materialId) === parseInt(this.saleOrderForm.materialId)) {
this.purchaseOrderQueryParams.materialBomId = row.materialBomId;
break;
}
}
if (this.purchaseOrderQueryParams.materialBomId && this.purchaseOrderQueryParams.materialBomId !== '') {
this.getUnbindPurchaseOrderList();
}else{

Loading…
Cancel
Save