New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.service.CommandInfoService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class CommandInfoController extends BaseController { |
| | | |
| | | @Autowired |
| | | private CommandInfoService commandInfoService; |
| | | |
| | | @RequestMapping(value = "/commandInfo/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(commandInfoService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfo/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<CommandInfo> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(commandInfoService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfo/add/auth") |
| | | @ManagerAuth |
| | | public R add(CommandInfo commandInfo) { |
| | | commandInfoService.insert(commandInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfo/update/auth") |
| | | @ManagerAuth |
| | | public R update(CommandInfo commandInfo){ |
| | | if (Cools.isEmpty(commandInfo) || null==commandInfo.getId()){ |
| | | return R.error(); |
| | | } |
| | | commandInfoService.updateById(commandInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfo/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | commandInfoService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfo/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<CommandInfo> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("commandInfo")); |
| | | convert(map, wrapper); |
| | | List<CommandInfo> list = commandInfoService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfoQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<CommandInfo> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<CommandInfo> page = commandInfoService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (CommandInfo commandInfo : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", commandInfo.getId()); |
| | | map.put("value", commandInfo.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/commandInfo/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<CommandInfo> wrapper = new EntityWrapper<CommandInfo>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != commandInfoService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(CommandInfo.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("wcs_command_info") |
| | | public class CommandInfo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | /** |
| | | * 指令类型{1:创建,2:执行,3:完成} |
| | | */ |
| | | @ApiModelProperty(value= "指令状态") |
| | | @TableField("command_status") |
| | | private Integer commandStatus; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @ApiModelProperty(value= "开始时间") |
| | | @TableField("start_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @ApiModelProperty(value= "结束时间") |
| | | @TableField("end_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 指令类型 |
| | | */ |
| | | @ApiModelProperty(value= "指令类型") |
| | | @TableField("command_type") |
| | | private Integer commandType; |
| | | |
| | | /** |
| | | * 设备 |
| | | */ |
| | | @ApiModelProperty(value= "设备") |
| | | private String device; |
| | | |
| | | /** |
| | | * 设备执行信息 |
| | | */ |
| | | @ApiModelProperty(value= "设备执行信息") |
| | | @TableField("device_log") |
| | | private String deviceLog; |
| | | |
| | | /** |
| | | * 命令描述 |
| | | */ |
| | | @ApiModelProperty(value= "命令描述") |
| | | @TableField("command_desc") |
| | | private String commandDesc; |
| | | |
| | | /** |
| | | * 命令JSON |
| | | */ |
| | | @ApiModelProperty(value= "命令JSON") |
| | | @TableField("command") |
| | | private String command; |
| | | |
| | | public CommandInfo() {} |
| | | |
| | | public CommandInfo(Integer wrkNo,Integer commandStatus,Date startTime,Date endTime,Integer commandType,String device,String deviceLog,String commandDesc) { |
| | | this.wrkNo = wrkNo; |
| | | this.commandStatus = commandStatus; |
| | | this.startTime = startTime; |
| | | this.endTime = endTime; |
| | | this.commandType = commandType; |
| | | this.device = device; |
| | | this.deviceLog = deviceLog; |
| | | this.commandDesc = commandDesc; |
| | | } |
| | | |
| | | // CommandInfo commandInfo = new CommandInfo( |
| | | // null, // 任务号 |
| | | // null, // 起点位置 |
| | | // null, // 终点位置 |
| | | // null, // 指令状态 |
| | | // null, // 开始时间 |
| | | // null, // 结束时间 |
| | | // null, // 指令类型 |
| | | // null, // 设备 |
| | | // null, // 设备执行信息 |
| | | // null // 命令描述 |
| | | // ); |
| | | |
| | | public String getStartTime$(){ |
| | | if (Cools.isEmpty(this.startTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.startTime); |
| | | } |
| | | |
| | | public String getEndTime$(){ |
| | | if (Cools.isEmpty(this.endTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.endTime); |
| | | } |
| | | |
| | | /** |
| | | * 获取持续时间 |
| | | */ |
| | | public String getDurationTime() { |
| | | if (Cools.isEmpty(this.startTime)) { |
| | | return ""; |
| | | } |
| | | |
| | | Date endDate = new Date(); |
| | | if (!Cools.isEmpty(this.endTime)) { |
| | | endDate = this.endTime; |
| | | } |
| | | |
| | | //用来获取两个时间相差的毫秒数 |
| | | long l = this.startTime.getTime() - endDate.getTime(); |
| | | |
| | | //分别计算相差的天、小时、分、秒 |
| | | long day = l / (24 * 60 * 60 * 1000); |
| | | long hour = (l / (60 * 60 * 1000) - day * 24); |
| | | long min = ((l / (60 * 1000)) - day * 24 * 60 - hour * 60); |
| | | long s = (l / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60); |
| | | |
| | | return Math.abs(day) + "天" + Math.abs(hour) + "小时" + Math.abs(min) + "分" + Math.abs(s) + "秒"; |
| | | } |
| | | |
| | | public String getCommandStatus$() { |
| | | if (Cools.isEmpty(this.commandStatus)) { |
| | | return ""; |
| | | } |
| | | |
| | | switch (this.commandStatus) { |
| | | case 1: |
| | | return "创建"; |
| | | case 2: |
| | | return "执行"; |
| | | case 3: |
| | | return "完成"; |
| | | default: |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface CommandInfoMapper extends BaseMapper<CommandInfo> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface CommandInfoService extends IService<CommandInfo> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.CommandInfoMapper; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.service.CommandInfoService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("commandInfoService") |
| | | public class CommandInfoServiceImpl extends ServiceImpl<CommandInfoMapper, CommandInfo> implements CommandInfoService { |
| | | |
| | | } |
| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasCrnOpt; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.service.BasCrnOptService; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.CommandInfoService; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | |
| | | this.connect(); |
| | | while (true) { |
| | | try { |
| | | int step = 1; |
| | | int step = 3; |
| | | Task task = MessageQueue.poll(SlaveType.Crn, slave.getId()); |
| | | if (task != null) { |
| | | step = task.getStep(); |
| | |
| | | if (command.getTaskNo() == 0 && command.getAckFinish() == 0) { |
| | | command.setTaskNo((short) 9999); |
| | | } |
| | | |
| | | CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); |
| | | CommandInfo commandInfo = new CommandInfo(); |
| | | commandInfo.setWrkNo(command.getTaskNo().intValue()); |
| | | commandInfo.setCommandStatus(1); |
| | | commandInfo.setStartTime(new Date()); |
| | | commandInfo.setDevice("crn"); |
| | | commandInfo.setCommand(JSON.toJSONString(command)); |
| | | commandInfoService.insert(commandInfo); |
| | | |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[9]; |
| | | if (command.getAckFinish() == 0) { |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.CommandInfoService; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | |
| | | array[1] = staProtocol.getStaNo(); |
| | | // OperateResult write = siemensS7Net.Write("DB100." + index*4, array); |
| | | |
| | | CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class); |
| | | CommandInfo commandInfo = new CommandInfo(); |
| | | commandInfo.setWrkNo(staProtocol.getWorkNo().intValue()); |
| | | commandInfo.setCommandStatus(1); |
| | | commandInfo.setStartTime(new Date()); |
| | | commandInfo.setDevice("devp"); |
| | | commandInfo.setCommand(JSON.toJSONString(staProtocol)); |
| | | commandInfoService.insert(commandInfo); |
| | | |
| | | OperateResult writeResult; |
| | | //任务下发次数 |
| | | int writeCount = 0; |
New file |
| | |
| | | <?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.zy.asrs.mapper.CommandInfoMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.CommandInfo"> |
| | | <id column="id" property="id" /> |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="command_status" property="commandStatus" /> |
| | | <result column="start_time" property="startTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="command_type" property="commandType" /> |
| | | <result column="device" property="device" /> |
| | | <result column="device_log" property="deviceLog" /> |
| | | <result column="command_desc" property="commandDesc" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | @media only screen and (max-width: 800px) { |
| | | |
| | | } |
| | | |
| | | /** |
| | | 下拉菜单文字居中 |
| | | */ |
| | | .dropdown-menu-nav li{ |
| | | text-align: center; |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | var wrkNo; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | $("#wrkNo").val(parent.wrkNo) |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#commandManage', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/commandInfo/list/auth', |
| | | where: {wrk_no: parent.wrkNo}, |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'id', align: 'center',title: '指令编号',event: 'wrkNo', sort: true} |
| | | ,{field: 'wrkNo', align: 'center',title: '工作号',event: 'wrkNo', sort: true} |
| | | ,{field: 'commandStatus$', align: 'center',title: '指令状态'} |
| | | ,{field: 'durationTime', align: 'center',title: '持续时长', width: 160} |
| | | ,{field: 'commandType', align: 'center',title: '指令类型'} |
| | | ,{field: 'device', align: 'center',title: '设备'} |
| | | ,{field: 'deviceLog', align: 'center',title: '设备执行信息'} |
| | | ,{field: 'commandDesc', align: 'center',title: '命令描述'} |
| | | ,{field: 'startTime$', align: 'center',title: '开始时间'} |
| | | ,{field: 'endTime$', align: 'center',title: '结束时间'} |
| | | ,{field: 'command', align: 'center',title: '命令报文'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(commandManage)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(commandManage)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(commandManage)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 任务信息展示 |
| | | case 'wrkMastShow': |
| | | wrkNo = data.wrkNo; |
| | | layer.open({ |
| | | type: 2, |
| | | title: 'WMS任务', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../wrkMast/wrkMast.html', |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | method("add"); |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | method("update") |
| | | }); |
| | | |
| | | function method(name){ |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | // id: $('#id').val(), |
| | | id: $('#id').val(), |
| | | wrkNo: $('#wrkNo').val(), |
| | | invWh: $('#invWh').val(), |
| | | ymd: top.strToDate($('#ymd\\$').val()), |
| | | mk: $('#mk').val(), |
| | | whsType: $('#whsType').val(), |
| | | wrkSts: $('#wrkSts').val(), |
| | | ioType: $('#ioType').val(), |
| | | crnNo: $('#crnNo').val(), |
| | | sheetNo: $('#sheetNo').val(), |
| | | ioPri: $('#ioPri').val(), |
| | | wrkDate: top.strToDate($('#wrkDate\\$').val()), |
| | | locNo: $('#locNo').val(), |
| | | staNo: $('#staNo').val(), |
| | | sourceStaNo: $('#sourceStaNo').val(), |
| | | sourceLocNo: $('#sourceLocNo').val(), |
| | | locSts: $('#locSts').val(), |
| | | picking: $('#picking').val(), |
| | | linkMis: $('#linkMis').val(), |
| | | onlineYn: $('#onlineYn').val(), |
| | | updMk: $('#updMk').val(), |
| | | exitMk: $('#exitMk').val(), |
| | | pltType: $('#pltType').val(), |
| | | emptyMk: $('#emptyMk').val(), |
| | | ioTime: top.strToDate($('#ioTime\\$').val()), |
| | | ctnType: $('#ctnType').val(), |
| | | packed: $('#packed').val(), |
| | | oveMk: $('#oveMk').val(), |
| | | mtnType: $('#mtnType').val(), |
| | | userNo: $('#userNo').val(), |
| | | crnStrTime: top.strToDate($('#crnStrTime\\$').val()), |
| | | crnEndTime: top.strToDate($('#crnEndTime\\$').val()), |
| | | plcStrTime: top.strToDate($('#plcStrTime\\$').val()), |
| | | crnPosTime: top.strToDate($('#crnPosTime\\$').val()), |
| | | loadTime: $('#loadTime').val(), |
| | | expTime: $('#expTime').val(), |
| | | refWrkno: $('#refWrkno').val(), |
| | | refIotime: top.strToDate($('#refIotime\\$').val()), |
| | | modiUser: $('#modiUser').val(), |
| | | modiTime: top.strToDate($('#modiTime\\$').val()), |
| | | appeUser: $('#appeUser').val(), |
| | | appeTime: top.strToDate($('#appeTime\\$').val()), |
| | | pauseMk: $('#pauseMk').val(), |
| | | errorTime: top.strToDate($('#errorTime\\$').val()), |
| | | errorMemo: $('#errorMemo').val(), |
| | | ctnKind: $('#ctnKind').val(), |
| | | manuType: $('#manuType').val(), |
| | | memoM: $('#memoM').val(), |
| | | scWeight: $('#scWeight').val(), |
| | | logMk: $('#logMk').val(), |
| | | logErrTime: top.strToDate($('#logErrTime\\$').val()), |
| | | logErrMemo: $('#logErrMemo').val(), |
| | | barcode: $('#barcode').val(), |
| | | PdcType: $('#PdcType').val(), |
| | | ctnNo: $('#ctnNo').val(), |
| | | fullPlt: $('#fullPlt').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastLog/"+name+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | parent.$(".layui-laypage-btn")[0].click(); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 复选框事件 |
| | | form.on('checkbox(detailCheckbox)', function (data) { |
| | | var el = data.elem; |
| | | if (el.checked) { |
| | | $(el).val('Y'); |
| | | } else { |
| | | $(el).val('N'); |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#ymd\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#wrkDate\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnStrTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnEndTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#plcStrTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnPosTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#refIotime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#errorTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#logErrTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | if (find[0]!=null){ |
| | | if (find[0].type === 'checkbox'){ |
| | | if (data[val]==='Y'){ |
| | | find.attr("checked","checked"); |
| | | find.val('Y'); |
| | | } else { |
| | | find.remove("checked"); |
| | | find.val('N'); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.8); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | $('#wrkNo').val(parent.wrkNo); |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#wrkMast', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/wrkMast/list/auth', |
| | | where: {wrk_no: parent.wrkNo}, |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | |
| | | , style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' //设置额外样式 |
| | | }); |
| | | break; |
| | | case 'commandShow'://查看指令 |
| | | wrkNo = data.wrkNo; |
| | | layer.open({ |
| | | type: 2, |
| | | title: 'WMS任务指令', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../commandManage/commandManage.html', |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/wms/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/wms/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/wms/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="指令编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="wrk_no" id="wrkNo" placeholder="工作号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="commandManage" lay-filter="commandManage"></table> |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-xs btn-detlShow" lay-event="wrkMastShow">任务</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/wms/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/wms/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/wms/js/commandManage/commandManage.js" charset="utf-8"></script> |
| | | |
| | | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> |
| | | |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="wrk_no" placeholder="工作号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="wrk_no" id="wrkNo" placeholder="工作号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | {{#if (d.takeNone === 'Y' && d.wrkSts === 12) { }} |
| | | <li><a lay-event="takeNone">空操作</a></li> |
| | | {{# } }} |
| | | <li><a lay-event="detlShow">明细</a></li> |
| | | <li><a lay-event="detlShow">查看明细</a></li> |
| | | <li><a lay-event="commandShow">查看指令</a></li> |
| | | <li><a lay-event="complete">完成</a></li> |
| | | <li><a lay-event="cancel">取消</a></li> |
| | | {{#if (d.ioType === 103) { }} |