Browse Source

小接口

master
张江玮 2 years ago
parent
commit
eee29b0583
  1. 7
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 8
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/DeviceController.java
  3. 73
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java
  4. 6
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/DeviceService.java
  5. 7
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java
  6. 16
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java
  7. 77
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java
  8. BIN
      wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls
  9. 28
      wms/hd/nladmin-system/src/main/resources/AcsToWms.xml
  10. 28
      wms/hd/nladmin-system/src/main/resources/WmsToAcs.xml
  11. 6
      wms/hd/nladmin-system/src/main/resources/config/application-dev.yml
  12. 3
      wms/hd/nladmin-system/src/main/resources/logback-spring.xml
  13. 8
      wms/qd/src/api/wms/pdm/device.js
  14. 10
      wms/qd/src/api/wms/pdm/producetask.js
  15. 44
      wms/qd/src/views/wms/pdm/device/index.vue
  16. 24
      wms/qd/src/views/wms/pdm/produceTask/index.vue
  17. 15
      wms/qd/src/views/wms/sch/task/index.vue
  18. 2
      wms/qd/src/views/wms/st/basedata/iOdisStruct/index.vue
  19. 2
      wms/qd/src/views/wms/st/basedata/structRelaMaterial/index.vue
  20. 2
      wms/qd/src/views/wms/st/basedata/structRelaVehicleType/index.vue
  21. 2
      wms/qd/src/views/wms/st/buss/emptyVehicleRecord/index.vue
  22. 2
      wms/qd/src/views/wms/st/ivt/index.vue

7
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -46,7 +46,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
@Transactional(rollbackFor = Exception.class)
public void receiveTaskFromAcs(Map jsonObject) {
log.debug("WCS的请求参数为:" + jsonObject);
log.info("ACS的请求参数为:" + jsonObject);
String device_code = (String) jsonObject.get("device_code");
String type = (String) jsonObject.get("type");
JSONObject produceInfoByCode = new JSONObject();
@ -168,7 +168,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String material_id = (String) produceInfoByCode.get("material_id");
String cust_id = (String) produceInfoByCode.get("cust_id");
String producetask_id = (String) produceInfoByCode.get("producetask_id");
JSONObject materialObj = WQLObject.getWQLObject("MD_ME_Material").query("material_id='" + material_id + "'").uniqueResult(0);
JSONObject materialObj = WQLObject
.getWQLObject("MD_ME_Material")
.query("material_id='" + material_id + "'")
.uniqueResult(0);
JSONObject groubObj = new JSONObject();
groubObj.put("group_id", IdUtil.getSnowflake(1, 1).nextId());
groubObj.put("vehicle_code", vehicle_code);

8
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/DeviceController.java

@ -83,6 +83,14 @@ public class DeviceController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PutMapping("/changeIsWorkDevice")
@Log("修改是否生产设备")
@ApiOperation("修改是否生产设备")
public ResponseEntity<Object> changeIsWorkDevice(@RequestBody JSONObject json) {
deviceService.changeIsWorkDevice(json);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@GetMapping("/getDevice")
@Log("点位下拉获取设备信息")
@ApiOperation("点位下拉获取设备信息")

73
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java

@ -2,27 +2,29 @@
package org.nl.wms.pdm.rest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.annotation.Log;
import org.nl.wms.pdm.service.ProducetaskService;
import org.nl.wms.pdm.service.dto.ProducetaskDto;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.nl.annotation.Log;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* @author geng by
* @date 2022-04-26
**/
* @author geng by
* @date 2022-04-26
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "生产任务管理")
@ -36,15 +38,15 @@ public class ProducetaskController {
@Log("查询生产任务")
@ApiOperation("查询生产任务")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(producetaskService.queryAll(whereJson,page),HttpStatus.OK);
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(producetaskService.queryAll(whereJson, page), HttpStatus.OK);
}
@PostMapping
@Log("新增生产任务")
@ApiOperation("新增生产任务")
//@PreAuthorize("@el.check('producetask:add')")
public ResponseEntity<Object> create(@Validated @RequestBody ProducetaskDto dto){
public ResponseEntity<Object> create(@Validated @RequestBody ProducetaskDto dto) {
producetaskService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@ -53,7 +55,7 @@ public class ProducetaskController {
@Log("修改生产任务")
@ApiOperation("修改生产任务")
//@PreAuthorize("@el.check('producetask:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody ProducetaskDto dto){
public ResponseEntity<Object> update(@Validated @RequestBody ProducetaskDto dto) {
producetaskService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@ -71,55 +73,55 @@ public class ProducetaskController {
@Log("查询物料")
@ApiOperation("查询物料")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getMaterial(){
return new ResponseEntity<>(producetaskService.getMaterial(),HttpStatus.OK);
public ResponseEntity<Object> getMaterial() {
return new ResponseEntity<>(producetaskService.getMaterial(), HttpStatus.OK);
}
@PostMapping("/getDevice")
@Log("查询设备")
@ApiOperation("查询设备")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getDevice(@RequestBody JSONObject param){
return new ResponseEntity<>(producetaskService.getDevice(param),HttpStatus.OK);
public ResponseEntity<Object> getDevice(@RequestBody JSONObject param) {
return new ResponseEntity<>(producetaskService.getDevice(param), HttpStatus.OK);
}
@GetMapping("/getDevice1")
@Log("查询设备")
@ApiOperation("查询设备")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getDevice1(){
return new ResponseEntity<>(producetaskService.getDevice1(),HttpStatus.OK);
public ResponseEntity<Object> getDevice1() {
return new ResponseEntity<>(producetaskService.getDevice1(), HttpStatus.OK);
}
@GetMapping("/getProduceline")
@Log("查询生产产线")
@ApiOperation("查询生产产线")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getProduceline(){
return new ResponseEntity<>(producetaskService.getProduceline(),HttpStatus.OK);
public ResponseEntity<Object> getProduceline() {
return new ResponseEntity<>(producetaskService.getProduceline(), HttpStatus.OK);
}
@GetMapping("/getCust")
@Log("查询客户")
@ApiOperation("查询客户")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getCust(){
return new ResponseEntity<>(producetaskService.getCust(),HttpStatus.OK);
public ResponseEntity<Object> getCust() {
return new ResponseEntity<>(producetaskService.getCust(), HttpStatus.OK);
}
@GetMapping("/getWorkprocedure")
@Log("查询工序")
@ApiOperation("查询工序")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getWorkprocedure(){
return new ResponseEntity<>(producetaskService.getWorkprocedure(),HttpStatus.OK);
public ResponseEntity<Object> getWorkprocedure() {
return new ResponseEntity<>(producetaskService.getWorkprocedure(), HttpStatus.OK);
}
@PostMapping("/excelImport")
@Log("excel导入")
@ApiOperation("excel导入")
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request){
producetaskService.excelImport(file,request);
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
producetaskService.excelImport(file, request);
return new ResponseEntity<>(HttpStatus.OK);
}
@ -127,7 +129,7 @@ public class ProducetaskController {
@Log("复制新增")
@ApiOperation("复制新增")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> copyAdd(@RequestBody JSONObject param){
public ResponseEntity<Object> copyAdd(@RequestBody JSONObject param) {
producetaskService.copyAdd(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@ -136,15 +138,15 @@ public class ProducetaskController {
@Log("根据设备查询任务")
@ApiOperation("根据设备查询任务")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> getTaskByDeviceId(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(producetaskService.getTaskByDeviceId(whereJson,page),HttpStatus.OK);
public ResponseEntity<Object> getTaskByDeviceId(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(producetaskService.getTaskByDeviceId(whereJson, page), HttpStatus.OK);
}
@PutMapping("/sortUpdate")
@Log("排序")
@ApiOperation("排序")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> sortUpdate(@RequestBody JSONObject param){
public ResponseEntity<Object> sortUpdate(@RequestBody JSONObject param) {
producetaskService.sortUpdate(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@ -153,7 +155,7 @@ public class ProducetaskController {
@Log("强制完成")
@ApiOperation("强制完成")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> mandFinish(@RequestBody JSONObject param){
public ResponseEntity<Object> mandFinish(@RequestBody JSONObject param) {
producetaskService.mandFinish(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@ -162,9 +164,16 @@ public class ProducetaskController {
@Log("下发")
@ApiOperation("下发")
//@PreAuthorize("@el.check('producetask:list')")
public ResponseEntity<Object> issued(@RequestBody JSONObject param){
public ResponseEntity<Object> issued(@RequestBody JSONObject param) {
producetaskService.issued(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/getVehicleType")
@Log("通过设备查询可用载具类型")
@ApiOperation("通过设备查询可用载具类型")
public ResponseEntity<JSONObject> getVehicleTypeByDeviceId(@RequestBody JSONObject device) {
return new ResponseEntity<>(producetaskService.getVehicleTypeByDeviceId(device.getLong("device_id")), HttpStatus.OK);
}
}

6
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/DeviceService.java

@ -77,4 +77,10 @@ public interface DeviceService {
* @param json
*/
void changeActive(JSONObject json);
/**
* 改变是否工作设备
* @param json
*/
void changeIsWorkDevice(JSONObject json);
}

7
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java

@ -142,4 +142,11 @@ public interface ProducetaskService {
* @param param
*/
void issued(JSONObject param);
/**
* 通过设备查询可用载具类型
* @param deviceId 设备id
* @return 字典表数组
*/
JSONObject getVehicleTypeByDeviceId(Long deviceId);
}

16
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java

@ -178,4 +178,20 @@ public class DeviceServiceImpl implements DeviceService {
WQLObject.getWQLObject("pdm_base_device").update(json);
}
@Override
public void changeIsWorkDevice(JSONObject json) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getNickName();
String now = DateUtil.now();
String is_work_device = "1";
if (StrUtil.equals("1", json.getString("is_work_device"))) {
is_work_device = "0";
}
json.put("is_work_device", is_work_device);
json.put("update_optid", currentUserId);
json.put("update_optname", nickName);
json.put("update_time", now);
WQLObject.getWQLObject("pdm_base_device").update(json);
}
}

77
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java

@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor;
import org.nl.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SpringContextHolder;
import org.nl.wms.WorkProcedureEnum;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pdm.service.ProducetaskService;
@ -28,6 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@ -106,6 +108,12 @@ public class ProducetaskServiceImpl implements ProducetaskService {
@Override
@Transactional(rollbackFor = Exception.class)
public void create(ProducetaskDto dto) {
Long device_id = dto.getDevice_id();
if (ObjectUtil.isNotEmpty(device_id)
&& device_id.equals(1518136519804719104L)
&& ObjectUtil.isEmpty(dto.getCust_id())) {
throw new BadRequestException("新增分拣拆垛机械手的生产任务, 客户不能为空!");
}
//编码唯一性校验
String producetask_code = dto.getProducetask_code();
@ -185,9 +193,10 @@ public class ProducetaskServiceImpl implements ProducetaskService {
@Override
public JSONArray getDevice1() {
WQLObject wo = WQLObject.getWQLObject("pdm_base_device");
JSONArray arr = wo.query(" is_delete = '0'", "device_code").getResultJSONArray(0);
return arr;
return WQLObject
.getWQLObject("pdm_base_device")
.query(" is_delete = '0' AND is_work_device = '1'", "device_code")
.getResultJSONArray(0);
}
@Override
@ -275,8 +284,8 @@ public class ProducetaskServiceImpl implements ProducetaskService {
String now = DateUtil.now();
String producetask_id = param.getString("producetask_id");
WQLObject wo = WQLObject.getWQLObject("pdm_mg_producetask");
JSONObject taskObj= WQL.getWO("PDM_ProduceTask_01").addParam("flag", "3").addParam("producetask_id", producetask_id).process().uniqueResult(0);
taskObj.put("product_code","wms");
JSONObject taskObj = WQL.getWO("PDM_ProduceTask_01").addParam("flag", "3").addParam("producetask_id", producetask_id).process().uniqueResult(0);
taskObj.put("product_code", "wms");
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
JSONArray arr = new JSONArray();
arr.add(taskObj);
@ -410,4 +419,62 @@ public class ProducetaskServiceImpl implements ProducetaskService {
return m.matches();
}
@Override
public JSONObject getVehicleTypeByDeviceId(Long deviceId) {
WQLObject dict = WQLObject.getWQLObject("sys_dict_detail");
JSONObject result = new JSONObject();
result.put("isHLJ", false);
if (ObjectUtil.isEmpty(deviceId)) {
// 如果请求参数为空返回所有
result.put("vehicleTypeList", dict.query("dict_id = 25").getResultJSONArray(0));
return result;
}
// 根据设备id查询设备
JSONObject device = WQLObject
.getWQLObject("pdm_base_device")
.query("device_id = '" + deviceId + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("设备不存在!");
}
// 根据设备工序id获取工序枚举对象
WorkProcedureEnum workProcedure = WorkProcedureEnum.get(device.getString("workprocedure_id"));
if (ObjectUtil.isEmpty(workProcedure)) {
throw new BadRequestException("此设备工序不存在!");
}
// 根据工序区分不同的设备
assert workProcedure != null;
switch (workProcedure) {
case HNGX:
result.put("isHLJ", true);
// 混料机只能使用料盅
result.put("vehicleTypeList",
dict
.query("dict_id = 25 AND (value = '01' OR value = '09')")
.getResultJSONArray(0));
break;
case YZGX:
// 压制机只能使用钢托
result.put("vehicleTypeList",
dict
.query("dict_id = 25 AND value = '02'")
.getResultJSONArray(0));
break;
case FJGX:
// 分拣机只能使用木托盘
result.put("vehicleTypeList",
dict
.query("dict_id = 25 AND value IN ('03', '04', '05', '06', '07', '08')")
.getResultJSONArray(0));
break;
default:
// 其它返回所有
result.put("vehicleTypeList", dict.query("dict_id = 25").getResultJSONArray(0));
}
return result;
}
}

BIN
wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

28
wms/hd/nladmin-system/src/main/resources/AcsToWms.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<included>
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/>
<!-- 按照每天生成日志文件 -->
<appender name="FILE5" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/acstowms/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>200MB</maxFileSize>
<!--所有日志最多占多大容量-->
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl" level="INFO" additivity="true">
<appender-ref ref="FILE5"/>
</logger>
<!-- 打印sql -->
</included>

28
wms/hd/nladmin-system/src/main/resources/WmsToAcs.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<included>
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/>
<!-- 按照每天生成日志文件 -->
<appender name="FILE5" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/wmstoacs/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>200MB</maxFileSize>
<!--所有日志最多占多大容量-->
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl" level="INFO" additivity="true">
<appender-ref ref="FILE5"/>
</logger>
<!-- 打印sql -->
</included>

6
wms/hd/nladmin-system/src/main/resources/config/application-dev.yml

@ -8,10 +8,12 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root}
#password: ${DB_PWD:P@ssw0rd}
password: ${DB_PWD:Root.123456}
# password: ${DB_PWD:Root.123456}
password: ${DB_PWD:zjw123}
# 初始连接数
initial-size: 5
# 最小连接数

3
wms/hd/nladmin-system/src/main/resources/logback-spring.xml

@ -16,7 +16,8 @@ https://juejin.cn/post/6844903775631572999
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/>
<!--引入默认的一些设置-->
<!-- <include resource="log/AutoCreateInst.xml"/>-->
<include resource="AcsToWms.xml"/>
<include resource="WmsToAcs.xml"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>

8
wms/qd/src/api/wms/pdm/device.js

@ -32,6 +32,14 @@ export function changeActive(data) {
})
}
export function changeIsWorkDevice(data) {
return request({
url: 'api/device/changeIsWorkDevice',
method: 'put',
data
})
}
export function getDevice() {
return request({
url: 'api/device/getDevice',

10
wms/qd/src/api/wms/pdm/producetask.js

@ -107,4 +107,12 @@ export function issued(data) {
})
}
export default { add, edit, del, getMaterial, getDevice, getProduceline, getCust, getWorkprocedure, excelImport, getDevice1, copyAdd, sortUpdate, mandFinish, issued }
export function getVehicleType(data) {
return request({
url: 'api/producetask/getVehicleType',
method: 'post',
data
})
}
export default { add, edit, del, getMaterial, getDevice, getProduceline, getCust, getWorkprocedure, excelImport, getDevice1, copyAdd, sortUpdate, mandFinish, issued, getVehicleType }

44
wms/qd/src/views/wms/pdm/device/index.vue

@ -23,7 +23,7 @@
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="设备编码" prop="device_code">
<el-input v-model="form.device_code" style="width: 370px;" />
</el-form-item>
@ -45,6 +45,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="是否工单设备">
<el-radio v-model="form.is_work_device" label="0"></el-radio>
<el-radio v-model="form.is_work_device" label="1"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
@ -76,6 +80,16 @@
<el-table-column prop="create_time" label="创建时间" width="150px" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150px" />
<el-table-column prop="is_work_device" label="是否工单设备" width="100px">
<template slot-scope="scope">
<el-switch
:value="format_is_work_device(scope.row.is_work_device)"
active-color="#409EFF"
inactive-color="#F56C6C"
@change="changeIsWorkDevice(scope.row, scope.row.is_work_device)"
/>
</template>
</el-table-column>
<el-table-column v-permission="['admin','device:edit','device:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<udOperation
@ -97,15 +111,15 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudDevice, { changeActive } from '@/api/wms/pdm/device'
import crudDevice, { changeActive, changeIsWorkDevice } from '@/api/wms/pdm/device'
import crudWorkprocedure from '@/api/wms/pdm/workprocedure'
const defaultForm = { device_id: null, device_code: null, device_name: null, device_type: null, workprocedure_id: null, is_used: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, ext_id: null }
const defaultForm = { device_id: null, device_code: null, device_name: null, device_type: null, workprocedure_id: null, is_used: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, ext_id: null, is_work_device: '0' }
export default {
name: 'Device',
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['is_used', 'pdm_device_type'],
dicts: ['is_used', 'pdm_device_type', 'is_work_device'],
cruds() {
return CRUD({ title: '生产设备信息', url: 'api/device', idField: 'device_id', sort: 'device_id,desc', optShow: { add: true, edit: true, del: true, download: false, reset: true }, crudMethod: { ...crudDevice }})
},
@ -152,6 +166,9 @@ export default {
format_is_used(is_used) {
return is_used === '1'
},
format_is_work_device(is_work_device) {
return is_work_device === '1'
},
changeEnabled(data, val) {
let msg = '此操作将停用,是否继续!'
if (val !== '1') {
@ -170,6 +187,25 @@ export default {
})
}).catch(() => {
})
},
changeIsWorkDevice(data, val) {
let msg = '此操作将停用,是否继续!'
if (val !== '1') {
msg = '此操作将启用,是否继续!'
}
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
changeIsWorkDevice(data).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
data.is_work_device = !data.is_work_device
})
}).catch(() => {
})
}
}
}

24
wms/qd/src/views/wms/pdm/produceTask/index.vue

@ -1,4 +1,4 @@
<template>
`````<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
@ -133,7 +133,7 @@
<el-input v-model="form.material_name" style="width: 200px;" @focus="getMater" />
</el-form-item>
<el-form-item label="设备名称" prop="device_id">
<el-select v-model="form.device_id" filterable clearable style="width: 200px" placeholder="请选择设备">
<el-select v-model="form.device_id" filterable clearable style="width: 200px" placeholder="请选择设备" @change="getVehicleType()">
<el-option
v-for="item in deviceList1"
:key="item.device_id"
@ -166,7 +166,7 @@
<el-input-number v-model="form.seq_no" controls-position="right" style="width: 200px;text-align: left" :min="1" />
<!-- <el-input-number v-model="form.seq_no" :precision="0" :step="10" :min="0" style="width: 200px;" />-->
</el-form-item>
<el-form-item label="静置时间" prop="stewing_time">
<el-form-item label="静置时间" prop="stewing_time" :rules="isHLJ ? [{ required: true, message: '混料机的静置时间不能为空', trigger: 'blur' }] : [{ required: false }]">
<el-input v-model="form.stewing_time" :rows="3" style="width: 200px;" />
</el-form-item>
<el-form-item label="型号" prop="model">
@ -204,7 +204,7 @@
clearable
>
<el-option
v-for="item in dict.MD_EVEHICLE_TYPE"
v-for="item in vehicleTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
@ -308,7 +308,7 @@ import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog'
import SortDialog from '@/views/wms/pdm/produceTask/SortDialog'
import MaterDialog from './MaterDialog.vue'
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, is_package: '0' }
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, stewing_time: null, is_package: '0' }
export default {
name: 'Producetask',
dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'],
@ -338,6 +338,8 @@ export default {
currentRow: null,
materDialog: false,
materType: '',
vehicleTypeList: [],
isHLJ: false,
rules: {
device_id: [
{ required: true, message: '设备标识不能为空', trigger: 'blur' }
@ -375,6 +377,7 @@ export default {
this.getMaterial()
this.getWorkprocedure()
this.getDevice1()
this.getVehicleType()
},
methods: {
// false
@ -505,6 +508,17 @@ export default {
console.log(row)
this.form.material_id = row.material_id
this.form.material_name = row.material_name
},
getVehicleType() {
if (this.form.vehicle_type) {
this.form.vehicle_type = null
}
const data = { device_id: this.form.device_id }
crudProducetask.getVehicleType(data).then(res => {
console.log(res)
this.vehicleTypeList = res.vehicleTypeList
this.isHLJ = res.isHLJ
})
}
}
}

15
wms/qd/src/views/wms/sch/task/index.vue

@ -147,11 +147,11 @@
</template>
</el-table-column>
<el-table-column prop="start_area_name" label="起始区域" width="95" show-overflow-tooltip />
<el-table-column prop="start_point_code" label="起点编码" width="110px" />
<el-table-column prop="start_point_name" label="起点名称" width="105px" show-overflow-tooltip />
<el-table-column prop="start_point_code" label="起点编码" width="120px" />
<el-table-column prop="start_point_name" label="起点名称" width="135px" show-overflow-tooltip />
<el-table-column prop="next_area_name" label="下一区域" width="95" show-overflow-tooltip />
<el-table-column prop="next_point_code" label="终点编码" width="110px" />
<el-table-column prop="next_point_name" label="终点名称" width="105px" show-overflow-tooltip />
<el-table-column prop="next_point_code" label="终点编码" width="120px" />
<el-table-column prop="next_point_name" label="终点名称" width="135px" show-overflow-tooltip />
<el-table-column prop="vehicle_code" label="载具编码" width="80px" />
<el-table-column v-if="false" prop="finished_type" label="任务完成类型" width="120px">
<template slot-scope="scope">
@ -159,6 +159,11 @@
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="120" />
<el-table-column prop="is_auto_issue" label="是否自动下发" width="120">
<template slot-scope="scope">
{{ dict.label.is_auto_issue[scope.row.is_auto_issue] }}
</template>
</el-table-column>
<el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" width="150px" />
<el-table-column prop="update_optname" label="修改人" />
@ -239,7 +244,7 @@ const defaultForm = {
}
export default {
name: 'Task',
dicts: ['task_status', 'sch_acs_task_type', 'sch_task_type', 'task_finished_type'],
dicts: ['task_status', 'sch_acs_task_type', 'sch_task_type', 'task_finished_type', 'is_auto_issue'],
components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {

2
wms/qd/src/views/wms/st/basedata/iOdisStruct/index.vue

@ -84,7 +84,7 @@
<el-table ref="table" v-loading="crud.loading" :cell-style="{'text-align':'center'}" :header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="仓位编码" />
<el-table-column prop="struct_name" label="仓位名称" width="100" />
<el-table-column prop="struct_name" label="仓位名称" width="120" />
<el-table-column prop="sect_name" label="库区" width="120" />
<el-table-column prop="stor_name" label="仓库" />
<el-table-column v-if="false" prop="disrule_type" label="分配规则类型" width="100">

2
wms/qd/src/views/wms/st/basedata/structRelaMaterial/index.vue

@ -25,7 +25,7 @@
>
<el-table-column type="selection" width="45" />
<el-table-column :show-overflow-tooltip="true" prop="struct_code" width="95" label="仓位编码" />
<el-table-column :show-overflow-tooltip="true" prop="struct_name" width="100" label="仓位名称" />
<el-table-column :show-overflow-tooltip="true" prop="struct_name" width="120" label="仓位名称" />
<el-table-column :show-overflow-tooltip="true" prop="sect_name" width="100" label="所属库区" />
<el-table-column :show-overflow-tooltip="true" prop="stor_name" width="100" label="所属仓库" />
<el-table-column v-permission="['admin','dict:edit','dict:del']" label="操作" width="130px" align="center" fixed="right">

2
wms/qd/src/views/wms/st/basedata/structRelaVehicleType/index.vue

@ -51,7 +51,7 @@
<el-table ref="table" v-loading="crud.loading" :header-cell-style="{'text-align':'center'}" :cell-style="{'text-align':'center'}" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="仓位编码" />
<el-table-column prop="struct_name" label="仓位名称" width="110" />
<el-table-column prop="struct_name" label="仓位名称" width="120" />
<el-table-column prop="vehicle_type" label="载具类型" width="270">
<template slot-scope="scope">
<span v-if="scope.row.is_edit=='0'">{{ scope.row.vehicle_type_name }}</span>

2
wms/qd/src/views/wms/st/buss/emptyVehicleRecord/index.vue

@ -54,7 +54,7 @@
{{ dict.label.st_bill_status[scope.row.bill_status] }}
</template>
</el-table-column>
<el-table-column prop="start_point_name" label="起始点位" width="120" />
<el-table-column prop="start_point_name" label="起始点位" width="130" />
<el-table-column prop="next_point_name" label="下一点位" width="130" />
<el-table-column prop="start_area" label="起始区域">
<template slot-scope="scope">

2
wms/qd/src/views/wms/st/ivt/index.vue

@ -73,7 +73,7 @@
<el-table-column v-if="false" prop="struct_id" label="仓位标识" />
<el-table-column prop="sect_name" label="所属库区" width="120" />
<el-table-column prop="struct_code" label="仓位编码" />
<el-table-column prop="struct_name" label="仓位名称" />
<el-table-column prop="struct_name" label="仓位名称" width="120" />
<el-table-column prop="vehicle_code" label="载具号" />
<el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="material_code" label="物料编码" />

Loading…
Cancel
Save