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. 19
      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. 73
      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 @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void receiveTaskFromAcs(Map jsonObject) { public void receiveTaskFromAcs(Map jsonObject) {
log.debug("WCS的请求参数为:" + jsonObject); log.info("ACS的请求参数为:" + jsonObject);
String device_code = (String) jsonObject.get("device_code"); String device_code = (String) jsonObject.get("device_code");
String type = (String) jsonObject.get("type"); String type = (String) jsonObject.get("type");
JSONObject produceInfoByCode = new JSONObject(); JSONObject produceInfoByCode = new JSONObject();
@ -168,7 +168,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String material_id = (String) produceInfoByCode.get("material_id"); String material_id = (String) produceInfoByCode.get("material_id");
String cust_id = (String) produceInfoByCode.get("cust_id"); String cust_id = (String) produceInfoByCode.get("cust_id");
String producetask_id = (String) produceInfoByCode.get("producetask_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(); JSONObject groubObj = new JSONObject();
groubObj.put("group_id", IdUtil.getSnowflake(1, 1).nextId()); groubObj.put("group_id", IdUtil.getSnowflake(1, 1).nextId());
groubObj.put("vehicle_code", vehicle_code); 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); 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") @GetMapping("/getDevice")
@Log("点位下拉获取设备信息") @Log("点位下拉获取设备信息")
@ApiOperation("点位下拉获取设备信息") @ApiOperation("点位下拉获取设备信息")

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

@ -2,22 +2,24 @@
package org.nl.wms.pdm.rest; package org.nl.wms.pdm.rest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; 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.ProducetaskService;
import org.nl.wms.pdm.service.dto.ProducetaskDto; import org.nl.wms.pdm.service.dto.ProducetaskDto;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.nl.annotation.Log;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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 org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/** /**
* @author geng by * @author geng by
@ -167,4 +169,11 @@ public class ProducetaskController {
return new ResponseEntity<>(HttpStatus.OK); 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 * @param json
*/ */
void changeActive(JSONObject 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 * @param param
*/ */
void issued(JSONObject 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); 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);
}
} }

73
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.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SpringContextHolder; 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.AcsToWmsService;
import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pdm.service.ProducetaskService; import org.nl.wms.pdm.service.ProducetaskService;
@ -28,6 +29,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
@ -106,6 +108,12 @@ public class ProducetaskServiceImpl implements ProducetaskService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void create(ProducetaskDto dto) { 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(); String producetask_code = dto.getProducetask_code();
@ -185,9 +193,10 @@ public class ProducetaskServiceImpl implements ProducetaskService {
@Override @Override
public JSONArray getDevice1() { public JSONArray getDevice1() {
WQLObject wo = WQLObject.getWQLObject("pdm_base_device"); return WQLObject
JSONArray arr = wo.query(" is_delete = '0'", "device_code").getResultJSONArray(0); .getWQLObject("pdm_base_device")
return arr; .query(" is_delete = '0' AND is_work_device = '1'", "device_code")
.getResultJSONArray(0);
} }
@Override @Override
@ -410,4 +419,62 @@ public class ProducetaskServiceImpl implements ProducetaskService {
return m.matches(); 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: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy 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} username: ${DB_USER:root}
#password: ${DB_PWD:P@ssw0rd} #password: ${DB_PWD:P@ssw0rd}
password: ${DB_PWD:Root.123456} # password: ${DB_PWD:Root.123456}
password: ${DB_PWD:zjw123}
# 初始连接数 # 初始连接数
initial-size: 5 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"/> <springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/> <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"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <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() { export function getDevice() {
return request({ return request({
url: 'api/device/getDevice', 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" /> <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-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-form-item label="设备编码" prop="device_code">
<el-input v-model="form.device_code" style="width: 370px;" /> <el-input v-model="form.device_code" style="width: 370px;" />
</el-form-item> </el-form-item>
@ -45,6 +45,10 @@
/> />
</el-select> </el-select>
</el-form-item> </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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button> <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="create_time" label="创建时间" width="150px" />
<el-table-column prop="update_optname" label="修改人" /> <el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150px" /> <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"> <el-table-column v-permission="['admin','device:edit','device:del']" label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
@ -97,15 +111,15 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation' import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' 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' 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 { export default {
name: 'Device', name: 'Device',
components: { pagination, crudOperation, rrOperation, udOperation }, components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['is_used', 'pdm_device_type'], dicts: ['is_used', 'pdm_device_type', 'is_work_device'],
cruds() { 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 }}) 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) { format_is_used(is_used) {
return is_used === '1' return is_used === '1'
}, },
format_is_work_device(is_work_device) {
return is_work_device === '1'
},
changeEnabled(data, val) { changeEnabled(data, val) {
let msg = '此操作将停用,是否继续!' let msg = '此操作将停用,是否继续!'
if (val !== '1') { if (val !== '1') {
@ -170,6 +187,25 @@ export default {
}) })
}).catch(() => { }).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="app-container">
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
@ -133,7 +133,7 @@
<el-input v-model="form.material_name" style="width: 200px;" @focus="getMater" /> <el-input v-model="form.material_name" style="width: 200px;" @focus="getMater" />
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="device_id"> <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 <el-option
v-for="item in deviceList1" v-for="item in deviceList1"
:key="item.device_id" :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" 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-input-number v-model="form.seq_no" :precision="0" :step="10" :min="0" style="width: 200px;" />-->
</el-form-item> </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-input v-model="form.stewing_time" :rows="3" style="width: 200px;" />
</el-form-item> </el-form-item>
<el-form-item label="型号" prop="model"> <el-form-item label="型号" prop="model">
@ -204,7 +204,7 @@
clearable clearable
> >
<el-option <el-option
v-for="item in dict.MD_EVEHICLE_TYPE" v-for="item in vehicleTypeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@ -308,7 +308,7 @@ import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog'
import SortDialog from '@/views/wms/pdm/produceTask/SortDialog' import SortDialog from '@/views/wms/pdm/produceTask/SortDialog'
import MaterDialog from './MaterDialog.vue' 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 { export default {
name: 'Producetask', name: 'Producetask',
dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'], dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'],
@ -338,6 +338,8 @@ export default {
currentRow: null, currentRow: null,
materDialog: false, materDialog: false,
materType: '', materType: '',
vehicleTypeList: [],
isHLJ: false,
rules: { rules: {
device_id: [ device_id: [
{ required: true, message: '设备标识不能为空', trigger: 'blur' } { required: true, message: '设备标识不能为空', trigger: 'blur' }
@ -375,6 +377,7 @@ export default {
this.getMaterial() this.getMaterial()
this.getWorkprocedure() this.getWorkprocedure()
this.getDevice1() this.getDevice1()
this.getVehicleType()
}, },
methods: { methods: {
// false // false
@ -505,6 +508,17 @@ export default {
console.log(row) console.log(row)
this.form.material_id = row.material_id this.form.material_id = row.material_id
this.form.material_name = row.material_name 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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="start_area_name" label="起始区域" width="95" show-overflow-tooltip /> <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_code" label="起点编码" width="120px" />
<el-table-column prop="start_point_name" label="起点名称" width="105px" show-overflow-tooltip /> <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_area_name" label="下一区域" width="95" show-overflow-tooltip />
<el-table-column prop="next_point_code" label="终点编码" width="110px" /> <el-table-column prop="next_point_code" label="终点编码" width="120px" />
<el-table-column prop="next_point_name" label="终点名称" width="105px" show-overflow-tooltip /> <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 prop="vehicle_code" label="载具编码" width="80px" />
<el-table-column v-if="false" prop="finished_type" label="任务完成类型" width="120px"> <el-table-column v-if="false" prop="finished_type" label="任务完成类型" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
@ -159,6 +159,11 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" width="120" /> <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_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" width="150px" /> <el-table-column prop="create_time" label="创建时间" width="150px" />
<el-table-column prop="update_optname" label="修改人" /> <el-table-column prop="update_optname" label="修改人" />
@ -239,7 +244,7 @@ const defaultForm = {
} }
export default { export default {
name: 'Task', 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 }, components: { pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { 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 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 type="selection" width="55" />
<el-table-column prop="struct_code" label="仓位编码" /> <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="sect_name" label="库区" width="120" />
<el-table-column prop="stor_name" label="仓库" /> <el-table-column prop="stor_name" label="仓库" />
<el-table-column v-if="false" prop="disrule_type" label="分配规则类型" width="100"> <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 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_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="sect_name" width="100" label="所属库区" />
<el-table-column :show-overflow-tooltip="true" prop="stor_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"> <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 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 type="selection" width="55" />
<el-table-column prop="struct_code" label="仓位编码" /> <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"> <el-table-column prop="vehicle_type" label="载具类型" width="270">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.is_edit=='0'">{{ scope.row.vehicle_type_name }}</span> <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] }} {{ dict.label.st_bill_status[scope.row.bill_status] }}
</template> </template>
</el-table-column> </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="next_point_name" label="下一点位" width="130" />
<el-table-column prop="start_area" label="起始区域"> <el-table-column prop="start_area" label="起始区域">
<template slot-scope="scope"> <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 v-if="false" prop="struct_id" label="仓位标识" />
<el-table-column prop="sect_name" label="所属库区" width="120" /> <el-table-column prop="sect_name" label="所属库区" width="120" />
<el-table-column prop="struct_code" label="仓位编码" /> <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 prop="vehicle_code" label="载具号" />
<el-table-column v-if="false" prop="material_id" label="物料标识" /> <el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="material_code" label="物料编码" /> <el-table-column prop="material_code" label="物料编码" />

Loading…
Cancel
Save