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.BasShuttleCharge; |
| | | import com.zy.asrs.service.BasShuttleChargeService; |
| | | 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 BasShuttleChargeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BasShuttleChargeService basShuttleChargeService; |
| | | |
| | | @RequestMapping(value = "/basShuttleCharge/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basShuttleChargeService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleCharge/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(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasShuttleCharge> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasShuttleCharge.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basShuttleChargeService.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 = "/basShuttleCharge/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasShuttleCharge basShuttleCharge) { |
| | | basShuttleChargeService.insert(basShuttleCharge); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleCharge/update/auth") |
| | | @ManagerAuth |
| | | public R update(BasShuttleCharge basShuttleCharge){ |
| | | if (Cools.isEmpty(basShuttleCharge) || null==basShuttleCharge.getId()){ |
| | | return R.error(); |
| | | } |
| | | basShuttleChargeService.updateById(basShuttleCharge); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleCharge/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | basShuttleChargeService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleCharge/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasShuttleCharge> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basShuttleCharge")); |
| | | convert(map, wrapper); |
| | | List<BasShuttleCharge> list = basShuttleChargeService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleChargeQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasShuttleCharge> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasShuttleCharge> page = basShuttleChargeService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasShuttleCharge basShuttleCharge : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basShuttleCharge.getId()); |
| | | map.put("value", basShuttleCharge.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basShuttleCharge/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasShuttleCharge> wrapper = new EntityWrapper<BasShuttleCharge>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basShuttleChargeService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasShuttleCharge.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.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("asr_bas_shuttle_charge") |
| | | public class BasShuttleCharge implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 充电桩编号 |
| | | */ |
| | | @ApiModelProperty(value= "充电桩编号") |
| | | @TableField("charge_id") |
| | | private Integer chargeId; |
| | | |
| | | /** |
| | | * 库位号 |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 待机位 |
| | | */ |
| | | @ApiModelProperty(value= "待机位") |
| | | @TableField("wait_loc_no") |
| | | private String waitLocNo; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value= "更新时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 状态 0: 禁用 1: 正常 |
| | | */ |
| | | @ApiModelProperty(value= "状态 0: 禁用 1: 正常 ") |
| | | private Integer status; |
| | | |
| | | public BasShuttleCharge() {} |
| | | |
| | | public BasShuttleCharge(Integer chargeId,String locNo,String waitLocNo,Date createTime,Date updateTime,Integer status) { |
| | | this.chargeId = chargeId; |
| | | this.locNo = locNo; |
| | | this.waitLocNo = waitLocNo; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | | this.status = status; |
| | | } |
| | | |
| | | // BasShuttleCharge basShuttleCharge = new BasShuttleCharge( |
| | | // null, // 充电桩编号 |
| | | // null, // 库位号 |
| | | // null, // 待机位 |
| | | // null, // 创建时间 |
| | | // null, // 更新时间 |
| | | // null // 状态 |
| | | // ); |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 0: |
| | | return "禁用"; |
| | | case 1: |
| | | return "正常"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasShuttleCharge; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasShuttleChargeMapper extends BaseMapper<BasShuttleCharge> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasShuttleCharge; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasShuttleChargeService extends IService<BasShuttleCharge> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasShuttleChargeMapper; |
| | | import com.zy.asrs.entity.BasShuttleCharge; |
| | | import com.zy.asrs.service.BasShuttleChargeService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basShuttleChargeService") |
| | | public class BasShuttleChargeServiceImpl extends ServiceImpl<BasShuttleChargeMapper, BasShuttleCharge> implements BasShuttleChargeService { |
| | | |
| | | } |
| | |
| | | private ForkLiftAction forkLiftAction; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | @Autowired |
| | | private BasShuttleChargeService basShuttleChargeService; |
| | | |
| | | /** |
| | | * 初始化实时地图 |
| | |
| | | */ |
| | | public synchronized void loopShuttleCharge() { |
| | | try { |
| | | |
| | | List<BasShuttleCharge> charges = basShuttleChargeService.selectList(new EntityWrapper<BasShuttleCharge>().orderBy("charge_id", true)); |
| | | if (charges.isEmpty()) { |
| | | return;//无充电桩 |
| | | } |
| | | |
| | | for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { |
| | | //获取四向穿梭车线程 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); |
| | |
| | | |
| | | //小车所在楼层 |
| | | int lev = Utils.getLev(shuttleProtocol.getCurrentLocNo()); |
| | | ShuttleChargeType shuttleCharge = null; |
| | | BasShuttleCharge shuttleCharge = null; |
| | | |
| | | //搜索小车所在楼层有没有充电桩 |
| | | for (ShuttleChargeType chargeType : ShuttleChargeType.values()) { |
| | | if (lev != Utils.getLev(chargeType.locNo)) { |
| | | for (BasShuttleCharge charge : charges) { |
| | | if (lev != Utils.getLev(charge.getLocNo())) { |
| | | continue;//小车和充电桩不在同一层 |
| | | } |
| | | |
| | | //小车和充电桩在同一层 |
| | | if (wrkMastService.selectChargeWorkingByChargeSta(chargeType.id) == null) { |
| | | shuttleCharge = chargeType; |
| | | if (wrkMastService.selectChargeWorkingByChargeSta(charge.getChargeId()) == null) { |
| | | shuttleCharge = charge; |
| | | break; |
| | | } |
| | | } |
| | |
| | | if (shuttleCharge == null) { |
| | | //同楼层没有找到充电桩,找可用充电桩 |
| | | //小车同楼层没有充电桩,只要充电桩可用就生成充电任务 |
| | | for (ShuttleChargeType chargeType : ShuttleChargeType.values()) { |
| | | if (wrkMastService.selectChargeWorkingByChargeSta(chargeType.id) == null) { |
| | | for (BasShuttleCharge charge : charges) { |
| | | if (wrkMastService.selectChargeWorkingByChargeSta(charge.getChargeId()) == null) { |
| | | //判断当前充电桩楼层是否有小车,如有小车,不分配该充电桩 |
| | | int chargeLev = Utils.getLev(chargeType.locNo);//充电桩楼层 |
| | | int chargeLev = Utils.getLev(charge.getLocNo());//充电桩楼层 |
| | | boolean checkLevHasShuttle = Utils.checkLevHasShuttle(chargeLev);//检测楼层是否有穿梭车 |
| | | if (checkLevHasShuttle) { |
| | | //当前充电桩楼层有穿梭车,不分配该充电桩 |
| | | continue; |
| | | } |
| | | |
| | | shuttleCharge = chargeType; |
| | | shuttleCharge = charge; |
| | | break; |
| | | } |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | String chargeLocNo = shuttleCharge.locNo; |
| | | String chargeLocNo = shuttleCharge.getLocNo(); |
| | | wrkMast = new WrkMast(); |
| | | wrkMast.setMk(String.valueOf(shuttleCharge.id)); |
| | | wrkMast.setMk(String.valueOf(shuttleCharge.getChargeId())); |
| | | wrkMast.setWrkNo(commonService.getWorkNo(WrkIoType.SHUTTLE_CHARGE.id)); |
| | | wrkMast.setWrkSts(WrkStsType.NEW_CHARGE.sts); |
| | | wrkMast.setIoType(WrkIoType.SHUTTLE_CHARGE.id);//300.充电 |
| | |
| | | return false; |
| | | } |
| | | |
| | | ShuttleChargeType chargeType = ShuttleChargeType.get(Integer.parseInt(wrkMast.getMk())); |
| | | if(chargeType == null) { |
| | | BasShuttleCharge basShuttleCharge = basShuttleChargeService.selectOne(new EntityWrapper<BasShuttleCharge>().eq("charge_id", wrkMast.getMk())); |
| | | if(basShuttleCharge == null) { |
| | | return false; |
| | | } |
| | | |
| | | //调度小车去待机位 |
| | | boolean dispatched = shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), chargeType.waitLocNo, wrkMast.getShuttleNo()); |
| | | boolean dispatched = shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), basShuttleCharge.getWaitLocNo(), wrkMast.getShuttleNo()); |
| | | if (!dispatched) { |
| | | return false; |
| | | } |
| | |
| | | generator.url="localhost:3306/shuttle_rcs"; |
| | | generator.username="root"; |
| | | generator.password="root"; |
| | | generator.table="asr_bas_map"; |
| | | generator.table="asr_bas_shuttle_charge"; |
| | | // sqlserver |
| | | // generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | // generator.url="127.0.0.1:1433;databasename=tzskasrs"; |
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.BasShuttleChargeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasShuttleCharge"> |
| | | <id column="id" property="id" /> |
| | | <result column="charge_id" property="chargeId" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="wait_loc_no" property="waitLocNo" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="status" property="status" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basShuttleCharge', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basShuttleCharge/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: 'chargeId', align: 'center',title: '充电桩编号'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'waitLocNo', align: 'center',title: '待机位'} |
| | | // ,{field: 'createTime$', align: 'center',title: '创建时间'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '更新时间'} |
| | | ,{field: 'status$', 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(basShuttleCharge)', 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(basShuttleCharge)', 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 = { |
| | | 'basShuttleCharge': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basShuttleCharge/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(basShuttleCharge)', 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) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basShuttleCharge/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | 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; |
| | | }); |
| | | $(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+"/basShuttleCharge/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 () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 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} |
| | | }); |
| | | } |
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"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" 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="basShuttleCharge" lay-filter="basShuttleCharge"></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/basShuttleCharge/basShuttleCharge.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">充电桩编号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="chargeId" placeholder="请输入充电桩编号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">库位号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNo" placeholder="请输入库位号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">待机位: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="waitLocNo" placeholder="请输入待机位"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="status"> |
| | | <option value="">请选择状态</option> |
| | | <option value="0">禁用</option> |
| | | <option value="1">正常</option> |
| | | </select> |
| | | </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> |
| | | |
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 id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form"> |
| | | <!-- |
| | | <div class="layui-inline" style="display: none"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>编 号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="id" class="layui-input" type="text" placeholder="编号"> |
| | | </div> |
| | | </div> |
| | | --> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="id" class="layui-input" type="text" onkeyup="check(this.id, 'basShuttleCharge')" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">充电桩编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="chargeId" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">库 位 号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="locNo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">待 机 位:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="waitLocNo" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">创建时间:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="createTime$" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">更新时间:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="updateTime$" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">状 态:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="status"> |
| | | <option value="" style="display: none"></option> |
| | | <option value="0">禁用</option> |
| | | <option value="1">正常</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | <div id="prompt"> |
| | | 温馨提示:请仔细填写相关信息,<span class="extrude"><span class="not-null">*</span> 为必填选项。</span> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </body> |
| | | <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/basShuttleCharge/basShuttleCharge.js" charset="utf-8"></script> |
| | | </html> |
| | | |