| 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.annotations.ManagerAuth; | 
|---|
|  |  |  | import com.core.common.BaseRes; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.DateUtils; | 
|---|
|  |  |  | import com.core.common.R; | 
|---|
|  |  |  | import com.zy.asrs.entity.LocMast; | 
|---|
|  |  |  | import com.zy.asrs.service.LocDetlService; | 
|---|
|  |  |  | import com.zy.asrs.service.LocMastService; | 
|---|
|  |  |  | import com.zy.asrs.service.WrkMastService; | 
|---|
|  |  |  | import com.zy.common.entity.Parameter; | 
|---|
|  |  |  | 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 LocMastController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private LocMastService locMastService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/group/empty/stock") | 
|---|
|  |  |  | @ManagerAuth(memo = "获取同组货架的空库位") | 
|---|
|  |  |  | public R getGroupEmptyStock(@RequestParam(required = false) String sourceLocNo) { | 
|---|
|  |  |  | return R.ok().add(locMastService.queryGroupEmptyStock(sourceLocNo)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMast/{id}/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R get(@PathVariable("id") String id) { | 
|---|
|  |  |  | return R.ok(locMastService.selectById(String.valueOf(id))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMast/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){ | 
|---|
|  |  |  | excludeTrash(param); | 
|---|
|  |  |  | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | convert(param, wrapper); | 
|---|
|  |  |  | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} | 
|---|
|  |  |  | return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper.eq("status",0))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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 = "/locMast/add/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "库位添加") | 
|---|
|  |  |  | public R add(LocMast locMast) { | 
|---|
|  |  |  | locMast.setModiUser(getUserId()); | 
|---|
|  |  |  | locMast.setModiTime(new Date()); | 
|---|
|  |  |  | locMast.setAppeUser(getUserId()); | 
|---|
|  |  |  | locMast.setAppeTime(new Date()); | 
|---|
|  |  |  | locMastService.insert(locMast); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMast/delete/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "库位删除") | 
|---|
|  |  |  | public R delete(@RequestParam String param){ | 
|---|
|  |  |  | List<LocMast> list = JSONArray.parseArray(param, LocMast.class); | 
|---|
|  |  |  | if (Cools.isEmpty(list)){ | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (LocMast entity : list){ | 
|---|
|  |  |  | locMastService.delete(new EntityWrapper<>(entity)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMast/export/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "库位导出") | 
|---|
|  |  |  | public R export(@RequestBody JSONObject param){ | 
|---|
|  |  |  | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); | 
|---|
|  |  |  | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | Map<String, Object> map = excludeTrash(param.getJSONObject("locMast")); | 
|---|
|  |  |  | convert(map, wrapper); | 
|---|
|  |  |  | List<LocMast> list = locMastService.selectList(wrapper); | 
|---|
|  |  |  | return R.ok(exportSupport(list, fields)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMastQuery/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R query(String condition) { | 
|---|
|  |  |  | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | wrapper.like("loc_no", condition); | 
|---|
|  |  |  | Page<LocMast> page = locMastService.selectPage(new Page<>(0, 10), wrapper); | 
|---|
|  |  |  | List<Map<String, Object>> result = new ArrayList<>(); | 
|---|
|  |  |  | for (LocMast locMast : page.getRecords()){ | 
|---|
|  |  |  | Map<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("id", locMast.getLocNo()); | 
|---|
|  |  |  | map.put("value", locMast.getLocNo()); | 
|---|
|  |  |  | result.add(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(result); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locMast/check/column/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R query(@RequestBody JSONObject param) { | 
|---|
|  |  |  | Wrapper<LocMast> wrapper = new EntityWrapper<LocMast>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); | 
|---|
|  |  |  | if (null != locMastService.selectOne(wrapper)){ | 
|---|
|  |  |  | return R.parse(BaseRes.REPEAT).add(getComment(LocMast.class, String.valueOf(param.get("key")))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.entity; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotations.TableField; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotations.TableId; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotations.TableName; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.enums.IdType; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.SpringUtils; | 
|---|
|  |  |  | import com.zy.system.entity.User; | 
|---|
|  |  |  | import com.zy.system.service.UserService; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModelProperty; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.Serializable; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @TableName("asr_bas_loc_sts") | 
|---|
|  |  |  | public class BasLocSts implements Serializable { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private static final long serialVersionUID = 1L; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 库位状态代号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "库位状态代号") | 
|---|
|  |  |  | @TableId(value = "loc_sts", type = IdType.INPUT) | 
|---|
|  |  |  | @TableField("loc_sts") | 
|---|
|  |  |  | private String locSts; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 库位状态描述 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "库位状态描述") | 
|---|
|  |  |  | @TableField("loc_desc") | 
|---|
|  |  |  | private String locDesc; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 修改人员 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "修改人员") | 
|---|
|  |  |  | @TableField("modi_user") | 
|---|
|  |  |  | private Long modiUser; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 修改时间 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "修改时间") | 
|---|
|  |  |  | @TableField("modi_time") | 
|---|
|  |  |  | private Date modiTime; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 创建者 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "创建者") | 
|---|
|  |  |  | @TableField("appe_user") | 
|---|
|  |  |  | private Long appeUser; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加时间 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value= "添加时间") | 
|---|
|  |  |  | @TableField("appe_time") | 
|---|
|  |  |  | private Date appeTime; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public BasLocSts() {} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public BasLocSts(String locDesc, Long modiUser, Date modiTime, Long appeUser, Date appeTime) { | 
|---|
|  |  |  | this.locDesc = locDesc; | 
|---|
|  |  |  | this.modiUser = modiUser; | 
|---|
|  |  |  | this.modiTime = modiTime; | 
|---|
|  |  |  | this.appeUser = appeUser; | 
|---|
|  |  |  | this.appeTime = appeTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    BasLocSts basLocSts = new BasLocSts( | 
|---|
|  |  |  | //            null,    // 库位状态描述 | 
|---|
|  |  |  | //            null,    // 修改人员 | 
|---|
|  |  |  | //            null,    // 修改时间 | 
|---|
|  |  |  | //            null,    // 创建者 | 
|---|
|  |  |  | //            null    // 添加时间 | 
|---|
|  |  |  | //    ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getLocSts() { | 
|---|
|  |  |  | return locSts; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setLocSts(String locSts) { | 
|---|
|  |  |  | this.locSts = locSts; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getLocDesc() { | 
|---|
|  |  |  | return locDesc; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setLocDesc(String locDesc) { | 
|---|
|  |  |  | this.locDesc = locDesc; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Long getModiUser() { | 
|---|
|  |  |  | return modiUser; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getModiUser$(){ | 
|---|
|  |  |  | UserService service = SpringUtils.getBean(UserService.class); | 
|---|
|  |  |  | User user = service.selectById(this.modiUser); | 
|---|
|  |  |  | if (!Cools.isEmpty(user)){ | 
|---|
|  |  |  | return String.valueOf(user.getUsername()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setModiUser(Long modiUser) { | 
|---|
|  |  |  | this.modiUser = modiUser; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Date getModiTime() { | 
|---|
|  |  |  | return modiTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getModiTime$(){ | 
|---|
|  |  |  | if (Cools.isEmpty(this.modiTime)){ | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setModiTime(Date modiTime) { | 
|---|
|  |  |  | this.modiTime = modiTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Long getAppeUser() { | 
|---|
|  |  |  | return appeUser; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getAppeUser$(){ | 
|---|
|  |  |  | UserService service = SpringUtils.getBean(UserService.class); | 
|---|
|  |  |  | User user = service.selectById(this.appeUser); | 
|---|
|  |  |  | if (!Cools.isEmpty(user)){ | 
|---|
|  |  |  | return String.valueOf(user.getUsername()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setAppeUser(Long appeUser) { | 
|---|
|  |  |  | this.appeUser = appeUser; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Date getAppeTime() { | 
|---|
|  |  |  | return appeTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getAppeTime$(){ | 
|---|
|  |  |  | if (Cools.isEmpty(this.appeTime)){ | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setAppeTime(Date appeTime) { | 
|---|
|  |  |  | this.appeTime = appeTime; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.enums.IdType; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.SpringUtils; | 
|---|
|  |  |  | import com.zy.asrs.service.BasLocStsService; | 
|---|
|  |  |  | import com.zy.system.entity.User; | 
|---|
|  |  |  | import com.zy.system.service.UserService; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModelProperty; | 
|---|
|  |  |  | 
|---|
|  |  |  | @TableField("ctn_no") | 
|---|
|  |  |  | private String ctnNo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value= "") | 
|---|
|  |  |  | private String status; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getIoTime$(){ | 
|---|
|  |  |  | if (Cools.isEmpty(this.ioTime)){ | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | 
|---|
|  |  |  | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.errorTime); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getLocSts$(){ | 
|---|
|  |  |  | BasLocStsService service = SpringUtils.getBean(BasLocStsService.class); | 
|---|
|  |  |  | BasLocSts basLocSts = service.selectById(this.locSts); | 
|---|
|  |  |  | if (!Cools.isEmpty(basLocSts)){ | 
|---|
|  |  |  | return String.valueOf(basLocSts.getLocDesc()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.mapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.BaseMapper; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasLocSts; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Mapper; | 
|---|
|  |  |  | import org.springframework.stereotype.Repository; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Mapper | 
|---|
|  |  |  | @Repository | 
|---|
|  |  |  | public interface BasLocStsMapper extends BaseMapper<BasLocSts> { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.service.IService; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasLocSts; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public interface BasLocStsService extends IService<BasLocSts> { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasLocSts; | 
|---|
|  |  |  | import com.zy.asrs.mapper.BasLocStsMapper; | 
|---|
|  |  |  | import com.zy.asrs.service.BasLocStsService; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("basLocStsService") | 
|---|
|  |  |  | public class BasLocStsServiceImpl extends ServiceImpl<BasLocStsMapper, BasLocSts> implements BasLocStsService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| 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.BasLocStsMapper"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 通用查询映射结果 --> | 
|---|
|  |  |  | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasLocSts"> | 
|---|
|  |  |  | <id column="loc_sts" property="locSts" /> | 
|---|
|  |  |  | <result column="loc_desc" property="locDesc" /> | 
|---|
|  |  |  | <result column="modi_user" property="modiUser" /> | 
|---|
|  |  |  | <result column="modi_time" property="modiTime" /> | 
|---|
|  |  |  | <result column="appe_user" property="appeUser" /> | 
|---|
|  |  |  | <result column="appe_time" property="appeTime" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result column="mk" property="mk" /> | 
|---|
|  |  |  | <result column="barcode" property="barcode" /> | 
|---|
|  |  |  | <result column="ctn_no" property="ctnNo" /> | 
|---|
|  |  |  | <result column="status" property="status" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | /* 统一处理 */ | 
|---|
|  |  |  | *, *::before, *::after { | 
|---|
|  |  |  | -webkit-box-sizing: border-box; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | margin: 0; | 
|---|
|  |  |  | padding: 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | html { | 
|---|
|  |  |  | line-height: 1.5; | 
|---|
|  |  |  | font-size: 15px; | 
|---|
|  |  |  | font-family: sans-serif; | 
|---|
|  |  |  | height: 100%; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /**, *::before, *::after {*/ | 
|---|
|  |  |  | /*    -webkit-box-sizing: border-box;*/ | 
|---|
|  |  |  | /*    box-sizing: border-box;*/ | 
|---|
|  |  |  | /*    margin: 0;*/ | 
|---|
|  |  |  | /*    padding: 0;*/ | 
|---|
|  |  |  | /*}*/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | body { | 
|---|
|  |  |  | height: 100%; | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | iframe { | 
|---|
|  |  |  | border-width: 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 布局 */ | 
|---|
|  |  |  | .row::after, .row::before { | 
|---|
|  |  |  | content: ""; | 
|---|
|  |  |  | display: table; | 
|---|
|  |  |  | clear: both; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .col-md3:empty { | 
|---|
|  |  |  | background:rgba(0,0,0,0.04); | 
|---|
|  |  |  | border: 1px solid rgba(0,0,0,.3); | 
|---|
|  |  |  | min-height:32px; | 
|---|
|  |  |  | height: inherit; | 
|---|
|  |  |  | z-index:1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .col-md1,.col-md10,.col-md11,.col-md12,.col-md2,.col-md3,.col-md4,.col-md5,.col-md6,.col-md7,.col-md8,.col-md9{ | 
|---|
|  |  |  | float:left; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .col-md1{width:8.33333333%} | 
|---|
|  |  |  | .col-md2{width:16.66666667%} | 
|---|
|  |  |  | .col-md3{width:25%} | 
|---|
|  |  |  | .col-md4{width:33.33333333%} | 
|---|
|  |  |  | .col-md5{width:41.66666667%} | 
|---|
|  |  |  | .col-md6{width:50%} | 
|---|
|  |  |  | .col-md7{width:58.33333333%} | 
|---|
|  |  |  | .col-md8{width:66.66666667%} | 
|---|
|  |  |  | .col-md9{width:75%} | 
|---|
|  |  |  | .col-md10{width:83.33333333%} | 
|---|
|  |  |  | .col-md11{width:91.66666667%} | 
|---|
|  |  |  | .col-md12{width:100%} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | input::placeholder { | 
|---|
|  |  |  | color: #b4b4b4; | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | var pageCurr; | 
|---|
|  |  |  | var locNo; | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | layDate.render({ | 
|---|
|  |  |  | elem: '.layui-laydate-range' | 
|---|
|  |  |  | ,type: 'datetime' | 
|---|
|  |  |  | ,range: true | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 数据渲染 | 
|---|
|  |  |  | tableIns = table.render({ | 
|---|
|  |  |  | elem: '#stoQue', | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | url: baseUrl+'/locMast/list/auth', | 
|---|
|  |  |  | page: true, | 
|---|
|  |  |  | limit: 20, | 
|---|
|  |  |  | limits: [20, 30, 50, 100, 200, 500], | 
|---|
|  |  |  | even: true, | 
|---|
|  |  |  | toolbar: '#toolbar', | 
|---|
|  |  |  | cellMinWidth: 50, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'} | 
|---|
|  |  |  | ,{field: 'locNo', align: 'center',title: '库位号'} | 
|---|
|  |  |  | ,{field: 'locSts$', align: 'center',title: '库位状态', width: 180, style: 'color: #8E2323'} | 
|---|
|  |  |  | // ,{field: 'whsType$', align: 'center',title: '库位类型'} | 
|---|
|  |  |  | ,{field: 'crnNo', align: 'center',title: '堆垛机号'} | 
|---|
|  |  |  | ,{field: 'row1', align: 'center',title: '排'} | 
|---|
|  |  |  | ,{field: 'bay1', align: 'center',title: '列'} | 
|---|
|  |  |  | ,{field: 'lev1', align: 'center',title: '层'} | 
|---|
|  |  |  | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ | 
|---|
|  |  |  | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; | 
|---|
|  |  |  | if(row.fullPlt === 'Y'){html += " checked ";} | 
|---|
|  |  |  | html += "disabled='disabled' >"; | 
|---|
|  |  |  | return html; | 
|---|
|  |  |  | },width:80} | 
|---|
|  |  |  | ,{field: 'modiUser$', align: 'center',title: '修改人员'} | 
|---|
|  |  |  | ,{field: 'modiTime$', align: 'center',title: '修改时间', width: 180} | 
|---|
|  |  |  | ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate'} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | 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'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (count === 1){ | 
|---|
|  |  |  | // locDetl(res.data[0][locNo]); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听排序事件 | 
|---|
|  |  |  | table.on('sort(stoQue)', 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(stoQue)', function (obj) { | 
|---|
|  |  |  | var checkStatus = table.checkStatus(obj.config.id); | 
|---|
|  |  |  | switch(obj.event) { | 
|---|
|  |  |  | // 更新库存 | 
|---|
|  |  |  | case 'refreshSto': // todo:luxiaotao | 
|---|
|  |  |  | alert("还没做"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'exportData': | 
|---|
|  |  |  | layer.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 = { | 
|---|
|  |  |  | 'wrkLastno': exportData, | 
|---|
|  |  |  | 'fields': fields | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/wrkLastno/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) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 监听行工具事件 | 
|---|
|  |  |  | table.on('tool(stoQue)', function(obj) { | 
|---|
|  |  |  | var data = obj.data; | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | // 查看明细 | 
|---|
|  |  |  | case 'locDetl': | 
|---|
|  |  |  | // locDetl(data.locNo); | 
|---|
|  |  |  | if (data.locSts.trim() === '' | 
|---|
|  |  |  | || data.locSts.trim() === 'S' | 
|---|
|  |  |  | || data.locSts.trim() === 'D' | 
|---|
|  |  |  | || data.locSts.trim() === 'O')  { | 
|---|
|  |  |  | layer.msg("此库位的状态不存在物料"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | locDetlToLayer(data.locNo); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // iframe物料详情 | 
|---|
|  |  |  | function locDetlToLayer(val) { | 
|---|
|  |  |  | locNo = val; | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '库存明细', | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | area: [top.detailWidth, top.detailHeight], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: '../report/locDetl.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // div物料详情 | 
|---|
|  |  |  | var pageCur; | 
|---|
|  |  |  | function locDetl(locNo){ | 
|---|
|  |  |  | $('#detlTable').css("display", 'block'); | 
|---|
|  |  |  | // 数据渲染 | 
|---|
|  |  |  | tableIns1 = table.render({ | 
|---|
|  |  |  | elem: '#locDetlByMap', | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | url: baseUrl+'/locDetl/list/auth', | 
|---|
|  |  |  | page: true, | 
|---|
|  |  |  | limit: 5, | 
|---|
|  |  |  | skin: 'line', | 
|---|
|  |  |  | where: {loc_no: locNo}, | 
|---|
|  |  |  | even: true, | 
|---|
|  |  |  | cellMinWidth: 50, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | // {type: 'checkbox'} | 
|---|
|  |  |  | {field: 'locNo$', align: 'center',title: '库位号'} | 
|---|
|  |  |  | ,{field: 'matnr', align: 'center',title: '物料'} | 
|---|
|  |  |  | ,{field: 'lgnum', align: 'center',title: '仓库号'} | 
|---|
|  |  |  | ,{field: 'tbnum', align: 'center',title: '转储请求编号'} | 
|---|
|  |  |  | // ,{field: 'tbpos', align: 'center',title: '行项目'} | 
|---|
|  |  |  | ,{field: 'zmatid', align: 'center',title: '物料标签ID'} | 
|---|
|  |  |  | ,{field: 'maktx', align: 'center',title: '物料描述'} | 
|---|
|  |  |  | ,{field: 'werks', align: 'center',title: '工厂'} | 
|---|
|  |  |  | ,{field: 'anfme', align: 'center',title: '数量'} | 
|---|
|  |  |  | ,{field: 'altme', align: 'center',title: '单位'} | 
|---|
|  |  |  | ,{field: 'zpallet', align: 'center',title: '托盘条码'} | 
|---|
|  |  |  | ,{field: 'bname', align: 'center',title: '用户ID'} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | 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+"/"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | pageCur=curr; | 
|---|
|  |  |  | 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'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 搜索栏重置事件 | 
|---|
|  |  |  | form.on('submit(reset)', function (data) { | 
|---|
|  |  |  | pageCurr = 1; | 
|---|
|  |  |  | clearFormVal($('#search-box')); | 
|---|
|  |  |  | $('#detlTable').css("display", 'none'); | 
|---|
|  |  |  | tableReload(false); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 搜索栏搜索事件 | 
|---|
|  |  |  | form.on('submit(search)', function (data) { | 
|---|
|  |  |  | pageCurr = 1; | 
|---|
|  |  |  | $('#detlTable').css("display", 'none'); | 
|---|
|  |  |  | tableReload(false); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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 (count === 1){ | 
|---|
|  |  |  | // locDetl(res.data[0][locNo]); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (res.data.length === 0 && count !== 0) { | 
|---|
|  |  |  | tableIns.reload({ | 
|---|
|  |  |  | where: searchData, | 
|---|
|  |  |  | page: { | 
|---|
|  |  |  | curr: pageCurr-1 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | pageCurr -= 1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | limit(child); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭动作 | 
|---|
|  |  |  | $(document).on('click','#data-detail-close', function () { | 
|---|
|  |  |  | parent.layer.closeAll(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function setFormVal(el, data, showImg) { | 
|---|
|  |  |  | for (var val in data) { | 
|---|
|  |  |  | var find = el.find(":input[id='" + val + "']"); | 
|---|
|  |  |  | 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.9); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | layer.style(index, { | 
|---|
|  |  |  | top: (($(window).height()-height)/3)+"px", | 
|---|
|  |  |  | height: height+'px' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $(".layui-layer-shade").remove(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $('body').keydown(function () { | 
|---|
|  |  |  | if (event.keyCode === 13) { | 
|---|
|  |  |  | $("#search").click(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
| 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/cool.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/common.css" media="all"> | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | #btn-export { | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #refresh-sto { | 
|---|
|  |  |  | display: none; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .loc-detl { | 
|---|
|  |  |  | display: none; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #detlTable { | 
|---|
|  |  |  | margin-top: 20px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </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="loc_no" placeholder="库位号" autocomplete="off"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input class="layui-input" type="text" name="loc_sts" placeholder="库位状态" autocomplete="off"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input class="layui-input" type="text" name="barcode" 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="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- 待添加 --> | 
|---|
|  |  |  | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <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">导出</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格 --> | 
|---|
|  |  |  | <table class="layui-hide" id="stoQue" lay-filter="stoQue"></table> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/html" id="operate"> | 
|---|
|  |  |  | <a class="layui-btn layui-btn-xs loc-detl" lay-event="locDetl">查看明细</a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--明细表--> | 
|---|
|  |  |  | <div id="detlTable" style="display: none"> | 
|---|
|  |  |  | <div class="layui-inline"  style="width:90%;margin-top: 10px;margin-left: 20px"> | 
|---|
|  |  |  | <span style=" color: indianred">以下为当前库位的物料明细</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <table class="layui-hide" id="locDetlByMap" lay-filter="locDetlByMap"></table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <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/stoMan/stoQue.js" charset="utf-8"></script> | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | </html> | 
|---|
|  |  |  |  | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | pre { | 
|---|
|  |  |  | font-family: 'DejaVu Sans Mono','Courier New',monospace; | 
|---|
|  |  |  | padding: 15px 10px; | 
|---|
|  |  |  | line-height: 17px; | 
|---|
|  |  |  | margin: 5px; | 
|---|
|  |  |  | word-wrap: break-word; | 
|---|
|  |  |  | border: solid 1px #9e9e9e; | 
|---|
|  |  |  | border-radius: 3px; | 
|---|
|  |  |  | color: #729fcf; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .string { color: #4e9a06; } | 
|---|
|  |  |  | .number { color: #ad7fa8; } | 
|---|
|  |  |  | .boolean { color: #c4a000; } | 
|---|
|  |  |  | .null { color: #babdb6; } | 
|---|
|  |  |  | .key { color: #204a87; } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style="padding: 25px 25px 15px 25px;" id="callbackDialog"> | 
|---|
|  |  |  | <fieldset class="layui-elem-field layui-field-title"> | 
|---|
|  |  |  | <legend>基础信息</legend> | 
|---|
|  |  |  | </fieldset> | 
|---|
|  |  |  | <div class="layui-text" style="margin-bottom: 5px;"> | 
|---|
|  |  |  | 事件编号:{{d.request}}<br /> | 
|---|
|  |  |  | 设备编号:{{d.response.sensorId$}}<br /> | 
|---|
|  |  |  | 设备类型:{{d.response.sensorType$}}<br /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;"> | 
|---|
|  |  |  | <legend>报警信息</legend> | 
|---|
|  |  |  | </fieldset> | 
|---|
|  |  |  | <div class="layui-text" style="margin-bottom: 5px;"> | 
|---|
|  |  |  | 发送时间:{{d.response.createTime$}}<br /> | 
|---|
|  |  |  | 故障描述:{{d.response.desc}}<br /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="text-center" style="padding-top: 15px;text-align: right"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal" ew-event="closeDialog">关闭</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- js部分 --> | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | layui.config({ | 
|---|
|  |  |  | base: baseUrl + "/static/layui/lay/modules/" | 
|---|
|  |  |  | }).use(['layer', 'admin'], function () { | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var admin = layui.admin; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var layerData = admin.getLayerData('#callbackDialog'); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <div class="layui-card-header">本地便签</div> | 
|---|
|  |  |  | <div class="note-wrapper"></div> | 
|---|
|  |  |  | <div class="note-empty"> | 
|---|
|  |  |  | <i class="layui-icon layui-icon-face-surprised"></i> | 
|---|
|  |  |  | <p>没有便签</p> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="btn-circle" id="noteAddBtn" title="添加便签" style="position: absolute;"> | 
|---|
|  |  |  | <i class="layui-icon layui-icon-add-1"></i> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | layui.use(['layer', 'form', 'util', 'admin'], function () { | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var layer = layui.layer; | 
|---|
|  |  |  | var util = layui.util; | 
|---|
|  |  |  | var admin = layui.admin; | 
|---|
|  |  |  | var dataList = [];  // 便签列表 | 
|---|
|  |  |  | var $noteWrapper = $('.note-wrapper'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 渲染列表 */ | 
|---|
|  |  |  | function renderList() { | 
|---|
|  |  |  | $noteWrapper.empty(); | 
|---|
|  |  |  | dataList = layui.data(admin.setter.tableName).notes; | 
|---|
|  |  |  | if (dataList === undefined) dataList = []; | 
|---|
|  |  |  | for (var i = 0; i < dataList.length; i++) { | 
|---|
|  |  |  | var item = dataList[i]; | 
|---|
|  |  |  | $noteWrapper.prepend([ | 
|---|
|  |  |  | '<div class="note-item" data-id="', item.id, '">', | 
|---|
|  |  |  | '   <div class="note-item-content">', util.escape(item.content), '</div>', | 
|---|
|  |  |  | '   <div class="note-item-time">', item.time, '</div>', | 
|---|
|  |  |  | '   <i class="layui-icon layui-icon-close-fill note-item-del"></i>', | 
|---|
|  |  |  | '</div>' | 
|---|
|  |  |  | ].join('')); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | $('.note-empty').css('display', dataList.length === 0 ? 'block' : 'none'); | 
|---|
|  |  |  | // 点击修改 | 
|---|
|  |  |  | $('.note-item').click(function () { | 
|---|
|  |  |  | var index = parseInt($(this).attr('data-id')); | 
|---|
|  |  |  | showNote(dataList[index]); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 点击删除 | 
|---|
|  |  |  | $('.note-item-del').click(function (e) { | 
|---|
|  |  |  | var id = parseInt($(this).parent().attr('data-id')); | 
|---|
|  |  |  | layer.confirm('确认删除吗?', { | 
|---|
|  |  |  | skin: 'layui-layer-admin', | 
|---|
|  |  |  | shade: .1, | 
|---|
|  |  |  | shadeClose: true | 
|---|
|  |  |  | }, function (index) { | 
|---|
|  |  |  | layer.close(index); | 
|---|
|  |  |  | dataList.splice(id, 1); | 
|---|
|  |  |  | for (var i = 0; i < dataList.length; i++) dataList[i].id = i; | 
|---|
|  |  |  | putDataList(); | 
|---|
|  |  |  | renderList(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | e.stopPropagation(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | renderList(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 添加 */ | 
|---|
|  |  |  | $('#noteAddBtn').click(function () { | 
|---|
|  |  |  | showNote(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 显示编辑弹窗 | 
|---|
|  |  |  | function showNote(data) { | 
|---|
|  |  |  | var id = data ? data.id : undefined, content = data ? data.content : ''; | 
|---|
|  |  |  | admin.open({ | 
|---|
|  |  |  | id: 'layer-note-edit', | 
|---|
|  |  |  | title: '便签', | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | area: 'auto', | 
|---|
|  |  |  | offset: '50px', | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: '<textarea id="noteEditText" placeholder="请输入内容" style="width: 280px;height: 150px;border: none;color: #666666;word-wrap: break-word;padding: 10px 20px;resize: vertical;">' + content + '</textarea>', | 
|---|
|  |  |  | success: function () { | 
|---|
|  |  |  | $('#noteEditText').change(function () { | 
|---|
|  |  |  | content = $(this).val(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | end: function () { | 
|---|
|  |  |  | if (id !== undefined) { | 
|---|
|  |  |  | if (!content) { | 
|---|
|  |  |  | dataList.splice(id, 1); | 
|---|
|  |  |  | for (var i = 0; i < dataList.length; i++) dataList[i].id = i; | 
|---|
|  |  |  | } else if (content !== dataList[id].content) { | 
|---|
|  |  |  | dataList[id].content = content; | 
|---|
|  |  |  | dataList[id].time = util.toDateString(new Date(), 'yyyy-MM-dd HH:mm'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (content) { | 
|---|
|  |  |  | dataList.push({ | 
|---|
|  |  |  | id: dataList.length, content: content, | 
|---|
|  |  |  | time: util.toDateString(new Date(), 'yyyy-MM-dd HH:mm') | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | putDataList(); | 
|---|
|  |  |  | renderList(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 更新本地缓存 */ | 
|---|
|  |  |  | function putDataList() { | 
|---|
|  |  |  | layui.data(admin.setter.tableName, {key: 'notes', value: dataList}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | .note-wrapper { | 
|---|
|  |  |  | padding: 15px 0 15px 15px; | 
|---|
|  |  |  | background-color: #fbfbfb; | 
|---|
|  |  |  | position: absolute; | 
|---|
|  |  |  | top: 43px; | 
|---|
|  |  |  | left: 0; | 
|---|
|  |  |  | right: 0; | 
|---|
|  |  |  | bottom: 0; | 
|---|
|  |  |  | overflow-y: auto; | 
|---|
|  |  |  | -webkit-overflow-scrolling: touch; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-wrapper .note-item { | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | width: 110px; | 
|---|
|  |  |  | padding: 12px; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | position: relative; | 
|---|
|  |  |  | border-radius: 8px; | 
|---|
|  |  |  | margin: 0 15px 15px 0; | 
|---|
|  |  |  | border: 1px solid #eeeeee; | 
|---|
|  |  |  | background-color: #ffffff; | 
|---|
|  |  |  | -webkit-user-select: none; | 
|---|
|  |  |  | -moz-user-select: none; | 
|---|
|  |  |  | -ms-user-select: none; | 
|---|
|  |  |  | user-select: none; | 
|---|
|  |  |  | -webkit-transition: all .3s ease; | 
|---|
|  |  |  | -moz-transition: all .3s ease; | 
|---|
|  |  |  | -ms-transition: all .3s ease; | 
|---|
|  |  |  | -o-transition: all .3s ease; | 
|---|
|  |  |  | transition: all .3s ease; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-wrapper .note-item:hover { | 
|---|
|  |  |  | box-shadow: 0 0 8px rgba(0, 0, 0, .05); | 
|---|
|  |  |  | -webkit-transform: scale(1.02); | 
|---|
|  |  |  | -moz-transform: scale(1.02); | 
|---|
|  |  |  | -ms-transform: scale(1.02); | 
|---|
|  |  |  | -o-transform: scale(1.02); | 
|---|
|  |  |  | transform: scale(1.02); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-wrapper .note-item .note-item-content { | 
|---|
|  |  |  | color: #666; | 
|---|
|  |  |  | height: 80px; | 
|---|
|  |  |  | font-size: 14px; | 
|---|
|  |  |  | overflow: hidden; | 
|---|
|  |  |  | word-break: break-all; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-wrapper .note-item .note-item-time { | 
|---|
|  |  |  | color: #999; | 
|---|
|  |  |  | font-size: 12px; | 
|---|
|  |  |  | margin-top: 8px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-wrapper .note-item .note-item-del { | 
|---|
|  |  |  | position: absolute; | 
|---|
|  |  |  | top: 2px; | 
|---|
|  |  |  | right: 2px; | 
|---|
|  |  |  | color: #FF5722; | 
|---|
|  |  |  | font-size: 24px; | 
|---|
|  |  |  | height: 24px; | 
|---|
|  |  |  | width: 24px; | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | border-radius: 50%; | 
|---|
|  |  |  | visibility: hidden; | 
|---|
|  |  |  | -webkit-transition: all .3s ease; | 
|---|
|  |  |  | -moz-transition: all .3s ease; | 
|---|
|  |  |  | -ms-transition: all .3s ease; | 
|---|
|  |  |  | -o-transition: all .3s ease; | 
|---|
|  |  |  | transition: all .3s ease; | 
|---|
|  |  |  | opacity: 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-wrapper .note-item:hover .note-item-del { | 
|---|
|  |  |  | visibility: visible; | 
|---|
|  |  |  | opacity: 1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-empty { | 
|---|
|  |  |  | color: #999; | 
|---|
|  |  |  | padding: 80px 0; | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | display: none; | 
|---|
|  |  |  | position: relative; | 
|---|
|  |  |  | z-index: 1 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .note-empty .layui-icon { | 
|---|
|  |  |  | font-size: 60px; | 
|---|
|  |  |  | margin-bottom: 10px; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <div class="layui-card-header">主题设置</div> | 
|---|
|  |  |  | <div class="more-theme-list"> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-normal"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-admin.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-cyan"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-cyan.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-white"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-white.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-pink"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-pink.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item active" data-theme="theme-colorful"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-colorful.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-blue"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-blue.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-green"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-green.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-purple"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-purple.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--    <div class="more-theme-item" data-theme="theme-red">--> | 
|---|
|  |  |  | <!--        <img src="tpl/theme/img/theme-red.png"/>--> | 
|---|
|  |  |  | <!--    </div>--> | 
|---|
|  |  |  | <div class="more-theme-item" data-theme="theme-my"> | 
|---|
|  |  |  | <img src="tpl/theme/img/theme-my.png"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- 导航 --> | 
|---|
|  |  |  | <div class="more-menu-list"> | 
|---|
|  |  |  | <!--    <a class="more-menu-item" href="https://easyweb.vip/doc/" target="_blank">--> | 
|---|
|  |  |  | <!--        <i class="layui-icon layui-icon-read" style="font-size: 19px;"></i> 开发文档--> | 
|---|
|  |  |  | <!--    </a>--> | 
|---|
|  |  |  | <!--    <a class="more-menu-item" href="https://demo.easyweb.vip/spa" target="_blank">--> | 
|---|
|  |  |  | <!--        <i class="layui-icon layui-icon-tabs" style="font-size: 16px;"></i>  spa版本--> | 
|---|
|  |  |  | <!--    </a>--> | 
|---|
|  |  |  | <!--    <a class="more-menu-item" href="https://demo.easyweb.vip/theme" target="_blank">--> | 
|---|
|  |  |  | <!--        <i class="layui-icon layui-icon-theme"></i> 主题生成器--> | 
|---|
|  |  |  | <!--    </a>--> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- 控制开关 --> | 
|---|
|  |  |  | <div class="layui-form" style="margin: 25px 0;" lay-filter="more-set-form"> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <label class="set-item-label">页 脚:</label> | 
|---|
|  |  |  | <div class="set-item-ctrl"> | 
|---|
|  |  |  | <input id="setFooter" lay-filter="setFooter" type="checkbox" lay-skin="switch" lay-text="开启|关闭"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <label class="set-item-label"> Tab 记忆:</label> | 
|---|
|  |  |  | <div class="set-item-ctrl"> | 
|---|
|  |  |  | <input id="setTab" lay-filter="setTab" type="checkbox" lay-skin="switch" lay-text="开启|关闭"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <label class="set-item-label">多标签:</label> | 
|---|
|  |  |  | <div class="set-item-ctrl"> | 
|---|
|  |  |  | <input id="setMoreTab" lay-filter="setMoreTab" type="checkbox" lay-skin="switch" lay-text="开启|关闭"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <label class="set-item-label">切换刷新:</label> | 
|---|
|  |  |  | <div class="set-item-ctrl"> | 
|---|
|  |  |  | <input id="setRefresh" lay-filter="setRefresh" type="checkbox" lay-skin="switch" lay-text="开启|关闭"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <label class="set-item-label">导航箭头:</label> | 
|---|
|  |  |  | <div class="set-item-ctrl"> | 
|---|
|  |  |  | <input lay-filter="navArrow" type="radio" value="" title="默认" name="navArrow"> | 
|---|
|  |  |  | <input lay-filter="navArrow" type="radio" value="arrow2" title="箭头" name="navArrow"> | 
|---|
|  |  |  | <input lay-filter="navArrow" type="radio" value="arrow3" title="加号" name="navArrow"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | layui.use(['form', 'admin'], function () { | 
|---|
|  |  |  | var $ = layui.jquery; | 
|---|
|  |  |  | var form = layui.form; | 
|---|
|  |  |  | var admin = layui.admin; | 
|---|
|  |  |  | var setter = admin.setter; | 
|---|
|  |  |  | var $body = $('body'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 切换主题 | 
|---|
|  |  |  | var $themItem = $('.more-theme-item'); | 
|---|
|  |  |  | $themItem.click(function () { | 
|---|
|  |  |  | $themItem.removeClass('active'); | 
|---|
|  |  |  | $(this).addClass('active'); | 
|---|
|  |  |  | admin.changeTheme($(this).data('theme')); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | var theme = $body.data('theme'); | 
|---|
|  |  |  | if (theme) { | 
|---|
|  |  |  | $themItem.removeClass('active'); | 
|---|
|  |  |  | $themItem.filter('[data-theme="' + theme + '"]').addClass('active'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭/开启页脚 | 
|---|
|  |  |  | form.on('switch(setFooter)', function (data) { | 
|---|
|  |  |  | var checked = data.elem.checked; | 
|---|
|  |  |  | admin.putSetting('closeFooter', !checked); | 
|---|
|  |  |  | checked ? $body.removeClass('close-footer') : $body.addClass('close-footer'); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $('#setFooter').prop('checked', !$body.hasClass('close-footer')); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭/开启Tab记忆功能 | 
|---|
|  |  |  | form.on('switch(setTab)', function (data) { | 
|---|
|  |  |  | layui.index.setTabCache(data.elem.checked); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $('#setTab').prop('checked', setter.cacheTab); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭/开启多标签 | 
|---|
|  |  |  | form.on('switch(setMoreTab)', function (data) { | 
|---|
|  |  |  | var checked = data.elem.checked; | 
|---|
|  |  |  | admin.putSetting('pageTabs', checked); | 
|---|
|  |  |  | admin.putTempData('indexTabs', undefined); | 
|---|
|  |  |  | location.reload(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $('#setMoreTab').prop('checked', setter.pageTabs); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 切换Tab自动刷新 | 
|---|
|  |  |  | var $mainTab = $('.layui-body>.layui-tab[lay-filter="admin-pagetabs"]'); | 
|---|
|  |  |  | form.on('switch(setRefresh)', function (data) { | 
|---|
|  |  |  | var checked = data.elem.checked; | 
|---|
|  |  |  | admin.putSetting('tabAutoRefresh', checked); | 
|---|
|  |  |  | checked ? $mainTab.attr('lay-autoRefresh', 'true') : $mainTab.removeAttr('lay-autoRefresh'); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | $('#setRefresh').prop('checked', setter.tabAutoRefresh === true); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 导航小三角 | 
|---|
|  |  |  | var $leftNav = $('.layui-layout-admin>.layui-side>.layui-side-scroll>.layui-nav'); | 
|---|
|  |  |  | form.on('radio(navArrow)', function (data) { | 
|---|
|  |  |  | $leftNav.removeClass('arrow2 arrow3'); | 
|---|
|  |  |  | data.value && $leftNav.addClass(data.value); | 
|---|
|  |  |  | admin.putSetting('navArrow', data.value); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | var navArrow = $leftNav.hasClass('arrow2') ? 'arrow2' : $leftNav.hasClass('arrow3') ? 'arrow3' : ''; | 
|---|
|  |  |  | $('[name="navArrow"][value="' + navArrow + '"]').prop('checked', true); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.render('radio', 'more-set-form'); | 
|---|
|  |  |  | form.render('checkbox', 'more-set-form'); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | /* theme */ | 
|---|
|  |  |  | .more-theme-list { | 
|---|
|  |  |  | padding-left: 15px; | 
|---|
|  |  |  | padding-top: 20px; | 
|---|
|  |  |  | margin-bottom: 10px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-theme-item { | 
|---|
|  |  |  | padding: 4px; | 
|---|
|  |  |  | margin: 0 6px 15px 0; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | border: 1px solid transparent; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-theme-item img { | 
|---|
|  |  |  | width: 80px; | 
|---|
|  |  |  | height: 50px; | 
|---|
|  |  |  | background: #f5f7f9; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | border: 1px solid #f5f7f9; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-theme-item:hover, .more-theme-item.active { | 
|---|
|  |  |  | border-color: #5FB878; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-menu-item { | 
|---|
|  |  |  | color: #595959; | 
|---|
|  |  |  | height: 50px; | 
|---|
|  |  |  | line-height: 50px; | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | padding: 0 25px; | 
|---|
|  |  |  | border-bottom: 1px solid #e8e8e8; | 
|---|
|  |  |  | font-style: normal; | 
|---|
|  |  |  | display: block; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* menu */ | 
|---|
|  |  |  | .more-menu-item:first-child { | 
|---|
|  |  |  | border-top: 1px solid #e8e8e8; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-menu-item:hover { | 
|---|
|  |  |  | color: #595959; | 
|---|
|  |  |  | background: #f6f6f6; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-menu-item .layui-icon { | 
|---|
|  |  |  | font-size: 18px; | 
|---|
|  |  |  | padding-right: 10px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-menu-item:after { | 
|---|
|  |  |  | color: #8c8c8c; | 
|---|
|  |  |  | right: 16px; | 
|---|
|  |  |  | content: "\e602"; | 
|---|
|  |  |  | position: absolute; | 
|---|
|  |  |  | font-family: layui-icon !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .more-menu-item.no-icon:after { | 
|---|
|  |  |  | display: none; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* setting from */ | 
|---|
|  |  |  | .set-item-label { | 
|---|
|  |  |  | height: 38px; | 
|---|
|  |  |  | line-height: 38px; | 
|---|
|  |  |  | padding-left: 20px; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .set-item-ctrl { | 
|---|
|  |  |  | height: 38px; | 
|---|
|  |  |  | line-height: 38px; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .set-item-ctrl > * { | 
|---|
|  |  |  | margin: 0 !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|