parent
f17505fb7f
commit
1e1c670b55
|
@ -1,15 +1,16 @@
|
|||
package com.wangziyang.mes.basedata.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wangziyang.mes.technology.entity.SpFlow;
|
||||
import com.wangziyang.mes.basedata.entity.SpMaterile;
|
||||
import com.wangziyang.mes.basedata.entity.SpTableManager;
|
||||
import com.wangziyang.mes.technology.request.SpFlowReq;
|
||||
import com.wangziyang.mes.technology.service.ISpFlowService;
|
||||
import com.wangziyang.mes.basedata.request.spMaterileReq;
|
||||
import com.wangziyang.mes.basedata.service.ISpMaterileService;
|
||||
import com.wangziyang.mes.common.BaseController;
|
||||
import com.wangziyang.mes.common.Result;
|
||||
import com.wangziyang.mes.technology.entity.SpFlow;
|
||||
import com.wangziyang.mes.technology.service.ISpFlowService;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -17,7 +18,10 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -84,8 +88,17 @@ public class SpMaterileController extends BaseController {
|
|||
@ApiImplicitParams({@ApiImplicitParam(name = "req", value = "请求参数", defaultValue = "请求参数")})
|
||||
@PostMapping("/page")
|
||||
@ResponseBody
|
||||
public Result page(SpFlowReq req) {
|
||||
IPage result = iSpMaterileService.page(req);
|
||||
public Result page(spMaterileReq req) {
|
||||
QueryWrapper queryWrapper =new QueryWrapper();
|
||||
if (StringUtils.isNotEmpty(req.getMaterielLike()))
|
||||
{
|
||||
queryWrapper.like("materiel",req.getMaterielLike());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(req.getMaterielDescLike()))
|
||||
{
|
||||
queryWrapper.like("materiel_desc",req.getMaterielDescLike());
|
||||
}
|
||||
IPage result = iSpMaterileService.page(req,queryWrapper);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
|
@ -98,8 +111,8 @@ public class SpMaterileController extends BaseController {
|
|||
@ApiOperation("物料管理修改、新增")
|
||||
@PostMapping("/add-or-update")
|
||||
@ResponseBody
|
||||
public Result addOrUpdate( SpMaterile record) {
|
||||
SpFlow spflow = iSpFlowService.getById(record.getFlowId());
|
||||
public Result addOrUpdate(SpMaterile record) {
|
||||
SpFlow spflow = iSpFlowService.getById(record.getFlowId());
|
||||
record.setFlowDesc(spflow.getFlowDesc());
|
||||
iSpMaterileService.saveOrUpdate(record);
|
||||
return Result.success();
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package com.wangziyang.mes.basedata.request;
|
||||
|
||||
import com.wangziyang.mes.common.BasePageReq;
|
||||
/**
|
||||
* 物料分页对象
|
||||
* @author wangziyang
|
||||
* @since 2020/04/01
|
||||
*/
|
||||
public class spMaterileReq extends BasePageReq {
|
||||
/**
|
||||
*模糊查询物料编号
|
||||
*/
|
||||
private String materielLike;
|
||||
/**
|
||||
*模糊查询物料描述
|
||||
*/
|
||||
private String materielDescLike;
|
||||
|
||||
/**
|
||||
* 获取 模糊查询物料编号
|
||||
*
|
||||
* @return materielLike 模糊查询物料编号
|
||||
*/
|
||||
public String getMaterielLike() {
|
||||
return this.materielLike;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 模糊查询物料编号
|
||||
*
|
||||
* @param materielLike 模糊查询物料编号
|
||||
*/
|
||||
public void setMaterielLike(String materielLike) {
|
||||
this.materielLike = materielLike;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 模糊查询物料描述
|
||||
*
|
||||
* @return materielDescLike 模糊查询物料描述
|
||||
*/
|
||||
public String getMaterielDescLike() {
|
||||
return this.materielDescLike;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 模糊查询物料描述
|
||||
*
|
||||
* @param materielDescLike 模糊查询物料描述
|
||||
*/
|
||||
public void setMaterielDescLike(String materielDescLike) {
|
||||
this.materielDescLike = materielDescLike;
|
||||
}
|
||||
}
|
|
@ -45,6 +45,7 @@ layui.define(['layer'], function (exports) {
|
|||
//return false 开启该代码可禁止点击该按钮关闭
|
||||
},
|
||||
success: function(layero, index){
|
||||
$(':focus').blur();
|
||||
},
|
||||
full: function(layero){
|
||||
}
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<#include "${request.contextPath}/common/common.ftl">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="splayui-container">
|
||||
<div class="splayui-main">
|
||||
<!--查询参数-->
|
||||
<form id="js-search-form" class="layui-form" lay-filter="js-q-form-filter">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">物料编号</label>
|
||||
<div class="layui-input-inline" style="width: 120px;">
|
||||
<input type="text" name="materielLike" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">物料描述</label>
|
||||
<div class="layui-input-inline" style="width: 120px;">
|
||||
<input type="text" name="materielDescLike" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<a class="layui-btn" lay-submit lay-filter="js-search-filter"><i
|
||||
class="layui-icon layui-icon-search"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!--表格-->
|
||||
<table class="layui-hide" id="js-record-table" lay-filter="js-record-table-filter"></table>
|
||||
|
||||
<form class="layui-form splayui-form">
|
||||
<div class="layui-row">
|
||||
<div class="layui-form-item layui-hide">
|
||||
<div class="layui-input-block">
|
||||
<input id="js-id" name="id" value=""/>
|
||||
<button id="js-submit" type="button" class="layui-btn" lay-submit lay-filter="js-submit-filter">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'util', 'table', 'spTable'], function () {
|
||||
var form = layui.form,
|
||||
util = layui.util,
|
||||
table = layui.table,
|
||||
spTable = layui.spTable;
|
||||
|
||||
// 表格及数据初始化
|
||||
var tableIns = spTable.render({
|
||||
toolbar: '',
|
||||
url: '${request.contextPath}/basedata/materile/page',
|
||||
cols: [
|
||||
[{
|
||||
type: 'radio'
|
||||
}, {
|
||||
field: 'materiel', title: '物料编码'
|
||||
}, {
|
||||
field: 'materielDesc', title: '物料描述'
|
||||
}]
|
||||
],
|
||||
done: function (res, curr, count) {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索按钮事件
|
||||
*/
|
||||
form.on('submit(js-search-filter)', function (data) {
|
||||
tableIns.reload({
|
||||
where: data.field,
|
||||
page: {
|
||||
// 重新从第 1 页开始
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
|
||||
// 阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
||||
return false;
|
||||
});
|
||||
|
||||
// 监听提交
|
||||
form.on('submit(js-submit-filter)', function (data) {
|
||||
window.spChildFrameResult = {
|
||||
msg: '操作成功',
|
||||
code: 0,
|
||||
data: table.checkStatus('js-record-table').data,
|
||||
isAll: table.checkStatus('js-record-table').isAll
|
||||
};
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//监听行双击事件
|
||||
table.on('rowDouble(js-record-table-filter)', function (obj) {
|
||||
//选中radio样式
|
||||
obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
|
||||
$("#js-submit").click();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -34,7 +34,7 @@
|
|||
<button type="button" id="js-test-btn" class="layui-btn" style="height:37px "><i
|
||||
class="layui-icon layui-icon-search "></i>
|
||||
</button>
|
||||
<input id="js-test-input" name="materielCode" placeholder="搜索物料" autocomplete="off"
|
||||
<input id="js-test-input" name="materielCode" readonly="true" lay-verify="required" placeholder="搜索物料" autocomplete="off"
|
||||
value="${result.materielCode}"
|
||||
class="layui-input" style="width: 133PX">
|
||||
</div>
|
||||
|
@ -181,11 +181,10 @@
|
|||
|
||||
//监听提交
|
||||
form.on('submit(js-submit-filter)', function (data) {
|
||||
data.field.spOperVoList = requestParmaArr;
|
||||
spUtil.submitForm({
|
||||
contentType: 'application/json;charset=UTF-8',
|
||||
url: "${request.contextPath}/basedata/flow/process/add-or-update",
|
||||
data: JSON.stringify(data.field)
|
||||
data:data.field
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
@ -197,19 +196,19 @@
|
|||
type: 2,
|
||||
area: ['680px', '500px'],
|
||||
reload: false,
|
||||
content: '${request.contextPath}/admin/common/ui/spSearchPanel4SysUser',
|
||||
content: '${request.contextPath}/admin/common/ui/searchPanelMaterile',
|
||||
// 如果是搜索弹窗,需要添加回调函数来获取选中数据
|
||||
spCallback: function (result) {
|
||||
console.log(result)
|
||||
if (result.code === 0 && result.data.length > 0) {
|
||||
$('#js-test-input').val(result.data[0].name);
|
||||
$('#js-test-input').val(result.data[0].materiel);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//版本号
|
||||
function FN(btnType) {
|
||||
var versionNumber = $('#js-versionNumber')
|
||||
if (btnType == 'plus') {
|
||||
|
|
|
@ -102,7 +102,6 @@
|
|||
//监听提交
|
||||
form.on('submit(js-submit-filter)', function (data) {
|
||||
data.field.spOperVoList = requestParmaArr;
|
||||
console.log(data.field)
|
||||
spUtil.submitForm({
|
||||
contentType: 'application/json;charset=UTF-8',
|
||||
url: "${request.contextPath}/basedata/flow/process/add-or-update",
|
||||
|
|
Loading…
Reference in New Issue