完成物料添加修改功能
parent
c267b1e645
commit
e38bdf2fc7
|
@ -0,0 +1,52 @@
|
|||
package com.wangziyang.mes.basedata.common.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wangziyang.mes.basedata.common.entity.SpSysDict;
|
||||
import com.wangziyang.mes.basedata.common.service.ISpSysDictService;
|
||||
import com.wangziyang.mes.common.BaseController;
|
||||
import com.wangziyang.mes.common.Result;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统字典表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/basedata/dict")
|
||||
public class SpSysDictController extends BaseController {
|
||||
/**
|
||||
* 字典表服务
|
||||
*/
|
||||
@Autowired
|
||||
public ISpSysDictService iSpSysDictService;
|
||||
|
||||
/**
|
||||
* 查询字典表数据
|
||||
*
|
||||
* @param type 字典表 数据类型
|
||||
* @return 字典数据结果集合
|
||||
*/
|
||||
@GetMapping("/list/{type}")
|
||||
@ApiOperation("根据表类型,字典表集合查询")
|
||||
@ResponseBody
|
||||
public Result queryDictList(@PathVariable String type) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("type", type);
|
||||
List<SpSysDict> list = iSpSysDictService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.common.dto;
|
||||
|
||||
import com.wangziyang.mes.basedata.common.entity.SpSysDict;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统字典表
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-23
|
||||
*/
|
||||
public class SpSysDictDto extends SpSysDict {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
package com.wangziyang.mes.basedata.common.entity;
|
||||
|
||||
import com.wangziyang.mes.common.BaseEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统字典表
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-23
|
||||
*/
|
||||
public class SpSysDict extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标签名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数据值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String descr;
|
||||
|
||||
/**
|
||||
* 排序(升序)
|
||||
*/
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 逻辑删除:1 表示删除,0 表示未删除,2 表示禁用
|
||||
*/
|
||||
private String isDeleted;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
public String getDescr() {
|
||||
return descr;
|
||||
}
|
||||
|
||||
public void setDescr(String descr) {
|
||||
this.descr = descr;
|
||||
}
|
||||
public Integer getSortNum() {
|
||||
return sortNum;
|
||||
}
|
||||
|
||||
public void setSortNum(Integer sortNum) {
|
||||
this.sortNum = sortNum;
|
||||
}
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
public String getIsDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
public void setIsDeleted(String isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SpSysDict{" +
|
||||
"name=" + name +
|
||||
", value=" + value +
|
||||
", type=" + type +
|
||||
", descr=" + descr +
|
||||
", sortNum=" + sortNum +
|
||||
", parentId=" + parentId +
|
||||
", isDeleted=" + isDeleted +
|
||||
"}";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wangziyang.mes.basedata.common.entity.SpSysDict;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统字典表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-23
|
||||
*/
|
||||
public interface SpSysDictMapper extends BaseMapper<SpSysDict> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.common.service;
|
||||
|
||||
import com.wangziyang.mes.basedata.common.entity.SpSysDict;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统字典表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-23
|
||||
*/
|
||||
public interface ISpSysDictService extends IService<SpSysDict> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.wangziyang.mes.basedata.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wangziyang.mes.basedata.common.entity.SpSysDict;
|
||||
import com.wangziyang.mes.basedata.common.mapper.SpSysDictMapper;
|
||||
import com.wangziyang.mes.basedata.common.service.ISpSysDictService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统字典表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author WangZiYang
|
||||
* @since 2020-03-23
|
||||
*/
|
||||
@Service
|
||||
public class SpSysDictServiceImpl extends ServiceImpl<SpSysDictMapper, SpSysDict> implements ISpSysDictService {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?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.wangziyang.mes.basedata.mapper.SpSysDictMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,41 @@
|
|||
.paoma{background: #111111;}
|
||||
.text-effect{
|
||||
color: #fff;
|
||||
font-family: 'Monoton', cursive;
|
||||
text-transform: uppercase;
|
||||
display: block;
|
||||
}
|
||||
.text-effect span{ animation: animate linear 1000ms infinite; }
|
||||
.text-effect span:nth-child(1n){ animation-delay: 0s; }
|
||||
.text-effect span:nth-child(2n){ animation-delay: 100ms; }
|
||||
.text-effect span:nth-child(3n){ animation-delay: 200ms; }
|
||||
.text-effect span:nth-child(4n){ animation-delay: 300ms; }
|
||||
.text-effect span:nth-child(5n){ animation-delay: 400ms; }
|
||||
.text-effect span:nth-child(6n){ animation-delay: 500ms; }
|
||||
.text-effect span:nth-child(7n){ animation-delay: 600ms; }
|
||||
.text-effect span:nth-child(8n){ animation-delay: 700ms; }
|
||||
.text-effect span:nth-child(9n){ animation-delay: 800ms; }
|
||||
.text-effect span:nth-child(10n){ animation-delay: 900ms; }
|
||||
.text-effect span:nth-child(11n){ animation-delay: 1000ms; }
|
||||
.text-effect span:nth-child(12n){ animation-delay: 1100ms; }
|
||||
.text-effect span:nth-child(13n){ animation-delay: 1200ms; }
|
||||
.text-effect span:nth-child(14n){ animation-delay: 1300ms; }
|
||||
@keyframes animate{
|
||||
0%{ opacity: 0.3; }
|
||||
100%{
|
||||
opacity:1;
|
||||
text-shadow:0 0 6px DarkRed ,0 0 30px red,0 0 80px black;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 990px){
|
||||
.text-effect{ font-size: 65px; }
|
||||
}
|
||||
@media only screen and (max-width: 767px){
|
||||
.text-effect{ font-size: 50px; }
|
||||
}
|
||||
@media only screen and (max-width: 479px){
|
||||
.text-effect{ font-size: 36px; }
|
||||
}
|
||||
@media only screen and (max-width: 359px){
|
||||
.text-effect{ font-size: 27px; }
|
||||
}
|
|
@ -8,13 +8,14 @@
|
|||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<#include "${request.contextPath}/common/common.ftl">
|
||||
<link href="${request.contextPath}/css/effect.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="splayui-container">
|
||||
<div class="splayui-main">
|
||||
<form class="layui-form splayui-form" lay-filter="formTest">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
|
||||
<div class="layui-col-xs6 layui-col-sm6 layui-col-md10">
|
||||
<div class="layui-form-item">
|
||||
<label for="js-materiel" class="layui-form-label sp-required">物料编号
|
||||
</label>
|
||||
|
@ -61,27 +62,30 @@
|
|||
<label for="js-matType" class="layui-form-label sp-required">物料类型
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="js-matType" name="matType" lay-verify="required" autocomplete="off"
|
||||
class="layui-input" value="${result.matType}">
|
||||
<select id="js-matType" name="matType" lay-filter="matType-filter" lay-verify="required">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="js-size" class="layui-form-label sp-required">尺寸
|
||||
<label for="js-size" class="layui-form-label ">尺寸
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="js-size" name="size" lay-verify="required" autocomplete="off"
|
||||
<input type="text" id="js-size" name="size" autocomplete="off"
|
||||
class="layui-input" value="${result.size}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="width: 1000px;">
|
||||
<label for="js-flowId" class="layui-form-label sp-required">工艺流程
|
||||
<div class="layui-form-item" style="width: 1200px">
|
||||
<label for="js-flowId" class="layui-form-label ">工艺流程
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="js-flowId" name="flowId" lay-filter="flow-filter" lay-verify="required">
|
||||
<select id="js-flowId" name="flowId" lay-filter="flow-filter">
|
||||
</select>
|
||||
</div>
|
||||
<p id="js-flowProcess" style="font-size:23px"></p>
|
||||
<div class=" text-effect " id="js-flowProcess" name="flowDesc"
|
||||
style="font-size:30px ;font-size: 30px;margin-left: 310PX;background: black;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="js-is-deleted" class="layui-form-label sp-required">状态
|
||||
</label>
|
||||
|
@ -114,6 +118,32 @@
|
|||
var flowRows = [];
|
||||
//流程添加下拉框
|
||||
getFlowData();
|
||||
//物料类型
|
||||
getMatTypeData();
|
||||
|
||||
/**
|
||||
* 初始化物料类型数据
|
||||
*/
|
||||
function getMatTypeData() {
|
||||
spUtil.ajax({
|
||||
url: '${request.contextPath}/basedata/dict/list/material_type',
|
||||
async: false,
|
||||
type: 'GET',
|
||||
// 是否显示 loading
|
||||
// showLoading: true,
|
||||
// 是否序列化参数
|
||||
serializable: false,
|
||||
// 参数
|
||||
data: {},
|
||||
success: function (data) {
|
||||
$.each(data.data, function (index, item) {
|
||||
$('#js-matType').append(new Option(item.name, item.value));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化流程数据
|
||||
|
@ -140,7 +170,6 @@
|
|||
//编辑时候根据回显的ID 绘制流程
|
||||
flowProssbyId("${result.flowId}")
|
||||
}
|
||||
//初始化 物料类型
|
||||
|
||||
//下拉框选择 绘制流程时序图
|
||||
form.on('select(flow-filter)', function (data) {
|
||||
|
@ -153,27 +182,34 @@
|
|||
return obj.id == flowId;
|
||||
});
|
||||
if (newArr.length > 0) {
|
||||
var lb_p = document.getElementById("js-flowProcess");
|
||||
lb_p.innerHTML = newArr[0].process;
|
||||
}
|
||||
procssArr = newArr[0].process.split("->")
|
||||
$("#js-flowProcess").empty();
|
||||
$.each(procssArr, function (i, val) {
|
||||
|
||||
if (i == procssArr.length - 1) {
|
||||
$("#js-flowProcess").append("<span >" + val + "</span>");
|
||||
} else {
|
||||
$("#js-flowProcess").append("<span >" + val + '->' + "</span>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//给表单赋值
|
||||
form.val("formTest", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
||||
"flowId": "${result.flowId}"
|
||||
"flowId": "${result.flowId}",
|
||||
"matType": "${result.matType}"
|
||||
});
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(js-submit-filter)', function (data) {
|
||||
spUtil.submitForm({
|
||||
url: "${request.contextPath}/basedata/materile/add-or-update",
|
||||
data: data.field
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue