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.EmptyBarrelIn; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.service.EmptyBarrelInService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.service.MatService; |
| | | 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 EmptyBarrelInController extends BaseController { |
| | | |
| | | @Autowired |
| | | private EmptyBarrelInService emptyBarrelInService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @RequestMapping(value = "/emptyBarrelIn/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(emptyBarrelInService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/emptyBarrelIn/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<EmptyBarrelIn> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(emptyBarrelInService.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 = "/emptyBarrelIn/add/auth") |
| | | @ManagerAuth |
| | | public R add(@RequestBody EmptyBarrelIn emptyBarrelIn) { |
| | | int i = emptyBarrelInService.selectCount(new EntityWrapper<>()); |
| | | if (i>0){ |
| | | return R.error("已存在正在入库的数据,请修改或删除"); |
| | | } |
| | | Mat mat = new Mat(); |
| | | if (!Cools.isEmpty(emptyBarrelIn.getMatnr())){ |
| | | mat = matService.selectByMatnr(emptyBarrelIn.getMatnr()); |
| | | } |
| | | if (!Cools.isEmpty(mat)){ |
| | | emptyBarrelIn.setMatnr(mat.getMatnr()); |
| | | emptyBarrelIn.setMaktx(mat.getMaktx()); |
| | | } |
| | | emptyBarrelInService.insert(emptyBarrelIn); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/emptyBarrelIn/update/auth") |
| | | @ManagerAuth |
| | | public R update(@RequestBody EmptyBarrelIn emptyBarrelIn){ |
| | | if (Cools.isEmpty(emptyBarrelIn) || null==emptyBarrelIn.getId()){ |
| | | return R.error(); |
| | | } |
| | | Mat mat = new Mat(); |
| | | if (!Cools.isEmpty(emptyBarrelIn.getMatnr())){ |
| | | mat = matService.selectByMatnr(emptyBarrelIn.getMatnr()); |
| | | } |
| | | if (!Cools.isEmpty(mat)){ |
| | | emptyBarrelIn.setMatnr(mat.getMatnr()); |
| | | emptyBarrelIn.setMaktx(mat.getMaktx()); |
| | | } |
| | | emptyBarrelInService.updateById(emptyBarrelIn); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/emptyBarrelIn/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") int[] ids){ |
| | | for (int id : ids){ |
| | | emptyBarrelInService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/emptyBarrelIn/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<EmptyBarrelIn> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("emptyBarrelIn")); |
| | | convert(map, wrapper); |
| | | List<EmptyBarrelIn> list = emptyBarrelInService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/emptyBarrelInQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<EmptyBarrelIn> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<EmptyBarrelIn> page = emptyBarrelInService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (EmptyBarrelIn emptyBarrelIn : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", emptyBarrelIn.getId()); |
| | | map.put("value", emptyBarrelIn.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/emptyBarrelIn/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<EmptyBarrelIn> wrapper = new EntityWrapper<EmptyBarrelIn>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != emptyBarrelInService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(EmptyBarrelIn.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | if (entry.getKey().equals("loc_no")) { |
| | | if (entry.getKey().equals("loc_no") || entry.getKey().equals("locNo")) { |
| | | wrapper.eq("loc_no", String.valueOf(entry.getValue())); |
| | | locNo=String.valueOf(entry.getValue()); |
| | | } else { |
| | |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/emptyBucketsList/auth") |
| | | @ManagerAuth |
| | | public R emptyBucketsList(@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){ |
| | | |
| | | int tagId = 46; |
| | | |
| | | return R.ok(matService.getPage(new Page<>(curr, limit) |
| | | , String.valueOf(tagId) |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | ); |
| | | |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | |
| | | @ManagerAuth() |
| | | public R availablePutSite(){ |
| | | return R.ok().add(basDevpService.getAvailableInSite()); |
| | | } |
| | | |
| | | @RequestMapping("/available/put/site5") |
| | | @ManagerAuth() |
| | | public R availablePutSite5(){ |
| | | return R.ok().add(basDevpService.getAvailableInSite5()); |
| | | } |
| | | |
| | | @RequestMapping("/available/empty/put/site") |
| | |
| | | } |
| | | |
| | | @RequestMapping("/full/store/put/start") |
| | | @ManagerAuth(memo = "全板入库") |
| | | // @ManagerAuth(memo = "全板入库") |
| | | public R fullStorePutStart(@RequestBody FullStoreParam fullStoreParam) { |
| | | return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,getUserId())); |
| | | |
| | | return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,9527L)); |
| | | |
| | | // return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,getUserId())); |
| | | } |
| | | |
| | | @RequestMapping("/plate/out/start") |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_emptyBarrel_in") |
| | | public class EmptyBarrelIn implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | // @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("matnr") |
| | | private String matnr; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("batch") |
| | | private String batch; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("maktx") |
| | | private String maktx; |
| | | |
| | | public EmptyBarrelIn() {} |
| | | |
| | | public EmptyBarrelIn(String matnr,String batch,String maktx) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.maktx = maktx; |
| | | } |
| | | |
| | | // EmptyBarrelIn emptyBarrelIn = new EmptyBarrelIn( |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | |
| | | } |
| | |
| | | public interface BasDevpMapper extends BaseMapper<BasDevp> { |
| | | |
| | | List<Integer> getAvailableInSite(@Param("typeNo") Integer typeNo); |
| | | List<Integer> getAvailableInSite5(@Param("typeNo") Integer typeNo); |
| | | |
| | | List<Integer> getAvailableOutSite(@Param("typeNo") Integer typeNo); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.EmptyBarrelIn; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface EmptyBarrelInMapper extends BaseMapper<EmptyBarrelIn> { |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<Integer> getAvailableInSite(); |
| | | List<Integer> getAvailableInSite5(); |
| | | |
| | | /** |
| | | * 空板入库站 |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.EmptyBarrelIn; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface EmptyBarrelInService extends IService<EmptyBarrelIn> { |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> getAvailableInSite5() { |
| | | return this.baseMapper.getAvailableInSite5(1); |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> getAvailableEmptyInSite() { |
| | | return this.baseMapper.getAvailableInSite(10); |
| | | } |
| | |
| | | if(station.getLoading()==null || !station.getLoading().equals("Y")) { |
| | | throw new CoolException(devpNo+"站点无物"); |
| | | } |
| | | if(station.getWrkNo()!=null && station.getWrkNo()>0 && station.getWrkNo() < 9990) { |
| | | throw new CoolException(devpNo+"站点已有工作号"); |
| | | } |
| | | // if(station.getWrkNo()!=null && station.getWrkNo()>0 && station.getWrkNo() < 9990) { |
| | | // throw new CoolException(devpNo+"站点已有工作号"); |
| | | // } |
| | | // if(!station.getInEnable().equals("Y")) { |
| | | // throw new CoolException(devpNo+"站点不是可入状态"); |
| | | // } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.EmptyBarrelInMapper; |
| | | import com.zy.asrs.entity.EmptyBarrelIn; |
| | | import com.zy.asrs.service.EmptyBarrelInService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("emptyBarrelInService") |
| | | public class EmptyBarrelInServiceImpl extends ServiceImpl<EmptyBarrelInMapper, EmptyBarrelIn> implements EmptyBarrelInService { |
| | | |
| | | } |
| | |
| | | // 检索库位 |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | List<String> matnrs = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatnr).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(1, 1, null, null,null,null,0, locTypeDto,0); |
| | | StartupDto dto = commonService.getLocNo(2, 1, param.getDevpNo(), null,null,null,0, locTypeDto,0); |
| | | // 生成工作号 |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | |
| | | public static final List<Integer> SECOND_GROUP_ROW_LIST2 = new ArrayList<Integer>() {{ |
| | | add(7);add(8); |
| | | }}; |
| | | public static final List<Integer> FIRST_GROUP_ROW_LIST3 = new ArrayList<Integer>() {{ |
| | | add(9); |
| | | }}; |
| | | public static final List<Integer> SECOND_GROUP_ROW_LIST3 = new ArrayList<Integer>() {{ |
| | | add(10); |
| | | }}; |
| | | public static List<String> getGroupLocNo(String locNo, Boolean pakIn) { |
| | | int row = getRow(locNo); |
| | | List<String> result = new ArrayList<>(); |
| | |
| | | for (Integer integer : clone) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } |
| | | }else if (FIRST_GROUP_ROW_LIST3.contains(row)) { |
| | | for (Integer groupRow : FIRST_GROUP_ROW_LIST3) { |
| | | result.add(zerofill(String.valueOf(groupRow), 2) + locNo.substring(2)); |
| | | } |
| | | } else if (SECOND_GROUP_ROW_LIST3.contains(row)) { |
| | | List<Integer> clone = Arrays.asList(new Integer[SECOND_GROUP_ROW_LIST3.size()]); |
| | | Collections.copy(clone, SECOND_GROUP_ROW_LIST3); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } |
| | | } |
| | | |
| | | if (!pakIn) { |
| | |
| | | // generator.table="sys_host"; |
| | | // sqlserver |
| | | generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | generator.url="192.168.4.15:1433;databasename=mdqdasrs"; |
| | | generator.url="127.0.0.1:1433;databasename=mdqdasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="man_loc_check_trim"; |
| | | generator.table="man_emptyBarrel_in"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.build(); |
| | | } |
New file |
| | |
| | | -- save emptyBarrelIn record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'emptyBarrelIn/emptyBarrelIn.html', 'emptyBarrelIn管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'emptyBarrelIn#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'emptyBarrelIn#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'emptyBarrelIn#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'emptyBarrelIn#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'emptyBarrelIn#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'emptyBarrelIn/emptyBarrelIn.html', N'emptyBarrelIn管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'emptyBarrelIn#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'emptyBarrelIn#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'emptyBarrelIn#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'emptyBarrelIn#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'emptyBarrelIn#btn-export', N'导出', '', '3', '4', '1'); |
| | |
| | | # url: jdbc:sqlserver://10.10.10.100:1433;databasename=mdqdasrs |
| | | # username: sa |
| | | # password: Dtzhcy101+ |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=mdqdasrs |
| | | url: jdbc:sqlserver://10.10.10.212:1433;databasename=mdqdasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | password: "a.222222" |
| | | lcid: 2052 |
| | | # 保持true |
| | | enable: true |
| | | enable: false |
| | |
| | | group by abd.dev_no |
| | | </select> |
| | | |
| | | <select id="getAvailableInSite5" resultType="java.lang.Integer"> |
| | | select |
| | | abd.dev_no |
| | | from asr_bas_devp abd |
| | | left join asr_sta_desc asd on abd.dev_no = asd.stn_no |
| | | where 1=1 |
| | | and asd.type_no = #{typeNo} |
| | | and asd.crn_no = 5 |
| | | -- and abd.in_enable = 'Y' |
| | | group by abd.dev_no |
| | | </select> |
| | | |
| | | <select id="getAvailableOutSite" resultType="java.lang.Integer"> |
| | | select |
| | | abd.dev_no |
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.EmptyBarrelInMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.EmptyBarrelIn"> |
| | | <id column="id" property="id" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="maktx" property="maktx" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin','xmSelect'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var xmSelect = layui.xmSelect; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#emptyBarrelIn', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/emptyBarrelIn/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', align: 'center',title: ''} |
| | | ,{field: 'matnr', align: 'center',title: '空桶编码'} |
| | | ,{field: 'maktx', align: 'center',title: '空桶名称'} |
| | | ,{field: 'batch', 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(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(emptyBarrelIn)', 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} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(emptyBarrelIn)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'emptyBarrelIn': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/emptyBarrelIn/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(emptyBarrelIn)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | |
| | | form.on('submit(editSubmit)', function (data) { |
| | | let selectList = matXmSelect.getValue() |
| | | console.log(data.field) |
| | | if (selectList.size != 0){ |
| | | data.field.matnr = selectList[0].value; |
| | | } |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/emptyBarrelIn/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(data.field) , |
| | | method: 'POST', |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | |
| | | // 渲染物料选择 |
| | | var matXmSelect = xmSelect.render({ |
| | | el: '#mat', |
| | | style: { |
| | | width: '340px', |
| | | }, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | radio: true, |
| | | remoteMethod: function(val, cb, show){ |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/all/get/kv", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | condition: val |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | cb(res.data) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/emptyBarrelIn/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(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; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| | |
| | | var matCodeLayerIdx; |
| | | var initCountVal = 0; |
| | | var initCountVal = 8; |
| | | var matCodeData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | |
| | | // 获取可用入库站点 |
| | | function getInBound() { |
| | | $.ajax({ |
| | | url: baseUrl + "/available/put/site", |
| | | url: baseUrl + "/available/put/site5", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
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/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <!-- <div class="layui-form toolbar" id="search-box">--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">编号:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline"> --> |
| | | <!-- <button class="layui-btn icon-btn" lay-filter="search" lay-submit>--> |
| | | <!-- <i class="layui-icon"></i>搜索--> |
| | | <!-- </button>--> |
| | | <!-- <button class="layui-btn icon-btn" lay-filter="reset" lay-submit>--> |
| | | <!-- <i class="layui-icon"></i>重置--> |
| | | <!-- </button>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <table class="layui-hide" id="emptyBarrelIn" lay-filter="emptyBarrelIn"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <!-- <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button>--> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/emptyBarrelIn/emptyBarrelIn.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">ID: </label> |
| | | <div class="layui-input-block"> |
| | | <input disabled class="layui-input" name="id" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">空桶编码: </label> |
| | | <div class="layui-input-block"> |
| | | <div id="mat" name="mat"> |
| | | </div> |
| | | <!-- <input class="layui-input" name="matnr" placeholder="请输入">--> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">空桶名称: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="maktx" placeholder="请输入">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">批次: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="batch" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |
| | |
| | | matQueryTable = table.render({ |
| | | elem: '#mat', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/mat/list/auth', |
| | | url: baseUrl + '/mat/emptyBucketsList/auth', |
| | | page: true, |
| | | limit: 7, |
| | | limits: [7, 10, 30,50,100], |