| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.common.service.erp.ErpService; |
| | | import com.zy.common.service.erp.entity.CPICMO; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | public class ERPrelevantController extends BaseController { |
| | | @Autowired |
| | | private ErpService erpService; |
| | | |
| | | @RequestMapping(value = "/erp/cpicmo/query") |
| | | @ManagerAuth |
| | | public R add(String fbillNo, String fsourceBillNo) { |
| | | List<CPICMO> erpCPICMOlist = erpService.queryErpCPICMO(fbillNo, fsourceBillNo); |
| | | return R.ok().add(erpCPICMOlist); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public boolean updateFnumber(Integer itemId, String FNumber){ |
| | | String sql = "update InStockbillEntry set Fnumber = ''{0}'' where FItemID = {1,number,#}"; |
| | | sql = MessageFormat.format(sql, FNumber, itemId); |
| | |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | public List<CPICMO> queryErpCPICMO(String fbillNo, String fsourceBillNo) { |
| | | String sql = "select * from CPICMO"; |
| | | if (!Cools.isEmpty(fbillNo) && Cools.isEmpty(fsourceBillNo)) { |
| | | sql = "select * from CPICMO where FBillNo = ''{0}''"; |
| | | sql = MessageFormat.format(sql, fbillNo); |
| | | } else if (Cools.isEmpty(fbillNo) && !Cools.isEmpty(fsourceBillNo)) { |
| | | sql = "select * from CPICMO where FSourceBillNo = ''{0}''"; |
| | | sql = MessageFormat.format(sql, fsourceBillNo); |
| | | } else if (!Cools.isEmpty(fbillNo) && !Cools.isEmpty(fsourceBillNo)) { |
| | | sql = "select * from CPICMO where FBillNo = ''{0}'' and FSourceBillNo = ''{1}''"; |
| | | sql = MessageFormat.format(sql, fbillNo, fsourceBillNo); |
| | | } |
| | | return erpSqlServer.select(sql, CPICMO.class); |
| | | } |
| | | } |
| New file |
| | |
| | | function getCol() { |
| | | var cols = []; |
| | | cols.push( |
| | | {field: 'fbillNo', align: 'center', title: '通知单号'} |
| | | , {field: 'fsourceBillNo', align: 'center', title: '生产单号'} |
| | | , {field: 'fnumber', align: 'center', title: '物料编码'} |
| | | , {field: 'fname', align: 'center', title: '物料名称'} |
| | | , {field: 'fmodel', align: 'center', title: '规格'} |
| | | ); |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var upload = layui.upload; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#salesOrder', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/erp/cpicmo/query', |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'data': res.data |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | tableReload(false); |
| | | }); |
| | | |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | , style: 'width: 150px' |
| | | , range: true |
| | | }); |
| | | }); |
| | | |
| | | /* 表格数据重载 */ |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 监听回车事件 */ |
| | | $('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"> |
| | | <link rel="stylesheet" href="../../static/css/print.css" media="all"> |
| | | </head> |
| | | <style> |
| | | #search-box { |
| | | padding: 30px 30px 10px 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*line-height: 46px;*/ |
| | | } |
| | | |
| | | #layui-laydate1 { |
| | | width: 300px; |
| | | } |
| | | </style> |
| | | <body> |
| | | |
| | | <div> |
| | | <!-- 搜索栏 --> |
| | | <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="fbillNo" placeholder="通知单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="fsourceBillNo" placeholder="生产单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | | <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> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="salesOrder" lay-filter="salesOrder"></table> |
| | | </div> |
| | | |
| | | </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/handlebars/handlebars-v4.5.3.js"></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/salesOrder/erpOrder.js"></script> |
| | | |
| | | </body> |
| | | </html> |
| | | |