From 85a699187b5eea57f93c42c23893a504383a5e5a Mon Sep 17 00:00:00 2001
From: 18516761980 <4761516tqsxp>
Date: 星期三, 25 八月 2021 08:03:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/xgmasrs' into xgmasrs
---
src/main/webapp/views/waitMatin/waitMatin.html | 259 +++++++++++++++++++++++++++++++++++----------------
1 files changed, 178 insertions(+), 81 deletions(-)
diff --git a/src/main/webapp/views/waitMatin/waitMatin.html b/src/main/webapp/views/waitMatin/waitMatin.html
index c6ec045..c26506e 100644
--- a/src/main/webapp/views/waitMatin/waitMatin.html
+++ b/src/main/webapp/views/waitMatin/waitMatin.html
@@ -25,9 +25,9 @@
<div class="layui-form toolbar">
<div class="layui-form-item">
<div class="layui-inline">
- <label class="layui-form-label w-auto">璇剧▼鍚嶇О锛�</label>
+ <label class="layui-form-label w-auto">鍗曟嵁缂栧彿锛�</label>
<div class="layui-input-inline mr0">
- <input name="experimentTypeName" class="layui-input" type="text" placeholder="杈撳叆璇剧▼鍚嶇О"/>
+ <input name="experimentTypeName" class="layui-input" type="text" placeholder="杈撳叆鍗曟嵁缂栧彿"/>
</div>
</div>
<div class="layui-inline">
@@ -39,87 +39,132 @@
</div>
</div>
</div>
- <table id="eCourseTable" lay-filter="eCourseTable"></table>
+ <table id="waitMatin" lay-filter="waitMatin"></table>
</div>
</div>
</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="bill_no" placeholder="鍗曟嵁缂栧彿" autocomplete="off">
- </div>
- </div>
- <!-- 鏃ユ湡鑼冨洿 -->
- <div class="layui-inline" style="width: 300px">
- <div class="layui-input-inline">
- <input class="layui-input layui-laydate-range" id="modi_time" name="modi_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 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="waitMatin" lay-filter="waitMatin"></table>
-</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" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
- <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</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>
+ <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">淇敼</a>
+ <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+</script>
+<!-- 琛ㄦ牸鎿嶄綔鍒� -->
+<script type="text/html" id="tbLook">
+ <span class="layui-text">
+ <a href="javascript:;" lay-event="look">
+ <i class="layui-icon" style="font-size: 12px;"></i> 鏌ョ湅鍗曟嵁鏄庣粏
+ </a>
+ </span>
+</script>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+ <form id="editForm" lay-filter="editForm" class="layui-form model-form">
+ <input name="experimentTypeId" type="hidden"/>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鍗曟嵁缂栧彿锛�</label>
+ <div class="layui-input-block">
+ <input name="experimentTypeName" placeholder="杈撳叆鍗曟嵁缂栧彿" type="text" class="layui-input" maxlength="20" lay-verType="tips" lay-verify="required"/>
+ </div>
+ </div>
+ <div class="layui-form-item" style="position: relative;">
+ <label class="layui-form-label">鍗曟嵁鏄庣粏锛�</label>
+ <div class="layui-input-block">
+ <table id="formSSXMTable" lay-filter="formSSXMTable"></table>
+ </div>
+ <button class="layui-btn layui-btn-sm icon-btn" id="demoEDeCourseAddBtnComment"
+ style="position: absolute; left: 20px;top: 60px;padding: 0 5px;" type="button">
+ <i class="layui-icon"></i>娣诲姞鏄庣粏
+ </button>
+ </div>
+ <div class="layui-form-item text-right">
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+ <button class="layui-btn" lay-filter="eCourseEditSubmit" lay-submit>淇濆瓨</button>
+ </div>
+ </form>
+</script>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="eCourseCouEditDialog">
+ <form id="eCourseCouEditForm" lay-filter="eCourseCouEditForm" class="layui-form model-form">
+ <input name="experimentId" type="hidden"/>
+<!-- <div class="layui-form-item">-->
+<!-- <label class="layui-form-label">鐗╂枡缂栫爜锛�</label>-->
+<!-- <div class="layui-input-block">-->
+<!-- <input name="experimentName" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" type="text" class="layui-input" maxlength="20" lay-verType="tips" lay-verify="required"/>-->
+<!-- </div>-->
+<!-- </div>-->
+ <div class="layui-form-item">
+ <label class="layui-form-label">鐗╂枡</label>
+ <div class="layui-input-block">
+ <div id="mat" name="mat">
+ </div>
+ </div>
+ </div>
+ <div class="layui-form-item text-right">
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+ <button class="layui-btn" lay-filter="eCourseCouEditSubmit" lay-submit>淇濆瓨</button>
+ </div>
+ </form>
</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/waitMatin/waitMatin.js" charset="utf-8"></script>
+<!--<script type="text/javascript" src="../../static/js/waitMatin/waitMatin.js" charset="utf-8"></script>-->
<script>
- layui.use(['layer', 'form', 'table', 'util', 'admin'], function () {
+ var pageCurr;
+ layui.config({
+ base: baseUrl + "/static/layui/lay/modules/"
+ }).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect'], function () {
var $ = layui.jquery;
var layer = layui.layer;
var form = layui.form;
var table = layui.table;
var util = layui.util;
var admin = layui.admin;
+ var xmSelect = layui.xmSelect;
// 娓叉煋琛ㄦ牸
var insTb = table.render({
elem: '#waitMatin',
url: baseUrl+'/waitMatin/head/page/auth',
+ headers: {token: localStorage.getItem('token')},
page: true,
cellMinWidth: 100,
cols: [[
{type: 'numbers'},
{field: 'billNo', title: '鍗曟嵁缂栧彿', sort: true},
- {field: 'billType$', align: 'center', title: '绫诲瀷'},
+ {field: 'billType$', align: 'center', title: '绫诲瀷', minWidth: 140, width: 140},
// {align: 'center', title: '鏄熸湡', templet: '#eCourseTbWeek', minWidth: 350, width: 350},
- {align: 'center', title: '鏄庣粏', toolbar: '#eCourseTbLook', minWidth: 140, width: 140},
+ {align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 140, width: 140},
{
- field: 'createTime', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
+ field: 'appeTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
return util.toDateString(d.createTime);
}, width: 180
},
- {align: 'center', title: '鎿嶄綔', toolbar: '#eCourseTbBar', minWidth: 130, width: 130}
- ]]
+ {align: 'center', title: '鎿嶄綔', toolbar: '#operate', minWidth: 130, width: 130}
+ ]],
+ 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) {
+ if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ }
+ pageCurr=curr;
+ }
});
// 鎼滅储
@@ -133,14 +178,14 @@
});
// 宸ュ叿鏉$偣鍑讳簨浠�
- table.on('tool(eCourseTable)', function (obj) {
+ table.on('tool(waitMatin)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
- if (layEvent == 'edit') {
+ if (layEvent === 'edit') {
showEditModel(data);
- } else if (layEvent == 'del') {
+ } else if (layEvent === 'del') {
doDel(data.experimentTypeId);
- } else if (layEvent == 'look') {
+ } else if (layEvent === 'look') {
var $a = $(obj.tr).find('a[lay-event="look"]');
var offset = $a.offset();
var top = offset.top;
@@ -148,7 +193,7 @@
layer.open({
type: 1,
title: false,
- area: '530px',
+ area: '630px',
offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
shade: .01,
shadeClose: true,
@@ -157,18 +202,39 @@
success: function (layero) {
table.render({
elem: '#lookSSXMTable',
- url: '../../json/e-course-tb2.json?experimentTypeId=' + data.experimentTypeId,
+ headers: {token: localStorage.getItem('token')},
+ url: baseUrl+'/waitMatin/list/auth',
+ where: {
+ bill_no: data.billNo
+ },
page: true,
cellMinWidth: 100,
cols: [[
{type: 'numbers'},
- {field: 'experimentName', title: '椤圭洰鍚嶇О', sort: true},
+ {field: 'matNo', title: '鐗╂枡缂栫爜'},
+ {field: 'matName', title: '鐗╂枡鍚嶇О', width: 160},
+ {field: 'qty', title: '鏁伴噺'},
{
- field: 'createTime', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
+ field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
return util.toDateString(d.createTime);
- }
+ }, width: 180
}
]],
+ 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 () {
$(layero).find('.layui-table-view').css('margin', '0');
},
@@ -183,15 +249,15 @@
function showEditModel(expTpe) {
admin.open({
type: 1,
- title: (expTpe ? '淇敼' : '娣诲姞') + '瀹為獙璇剧▼',
- content: $('#eCourseEditDialog').html(),
+ title: (expTpe ? '淇敼' : '娣诲姞') + '鍗曟嵁',
+ content: $('#editDialog').html(),
area: '700px',
success: function (layero, dIndex) {
$(layero).children('.layui-layer-content').css('overflow', 'visible');
var url = expTpe ? '../../json/ok.json' : '../../json/ok.json';
var isExpAdd = expTpe ? false : true;
// 鍥炴樉鏁版嵁
- form.val('eCourseEditForm', expTpe);
+ form.val('editForm', expTpe);
// 琛ㄥ崟鎻愪氦浜嬩欢
form.on('submit(eCourseEditSubmit)', function (data) {
if (isExpAdd) {
@@ -208,7 +274,7 @@
layer.load(2);
$.get(url, data.field, function (res) {
layer.closeAll('loading');
- if (res.code == 200) {
+ if (res.code === 200) {
layer.close(dIndex);
insTb.reload({page: {curr: 1}});
layer.msg(res.msg, {icon: 1});
@@ -228,12 +294,9 @@
cellMinWidth: 100,
cols: [[
{type: 'numbers'},
- {field: 'experimentName', title: '椤圭洰鍚嶇О', sort: true},
- {
- field: 'createTime', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
- return util.toDateString(d.createTime);
- }
- },
+ {field: 'matNo', title: '鐗╂枡缂栫爜'},
+ {field: 'matName', title: '鐗╂枡鍚嶇О', width: 160},
+ {field: 'qty', title: '鏁伴噺'},
{align: 'center', title: '鎿嶄綔', toolbar: '#eCourseCouTbBar', minWidth: 120, width: 120}
]],
done: function () {
@@ -252,9 +315,9 @@
table.on('tool(formSSXMTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
- if (layEvent == 'edit') {
+ if (layEvent === 'edit') {
showEditModel2(data);
- } else if (layEvent == 'del') {
+ } else if (layEvent === 'del') {
layer.confirm('纭畾瑕佸垹闄ゅ悧锛�', {
shade: .1,
skin: 'layui-layer-admin'
@@ -262,7 +325,7 @@
layer.close(i);
if (isExpAdd) { // 鍓嶇澶勭悊鍒犻櫎
for (var j = 0; j < xxDataList.length; j++) {
- if (xxDataList[j].experimentId = data.experimentId) {
+ if (xxDataList[j].experimentId === data.experimentId) {
xxDataList.splice(j, 1);
}
}
@@ -273,7 +336,7 @@
experimentId: data.experimentId
}, function (res) {
layer.closeAll('loading');
- if (res.code == 200) {
+ if (res.code === 200) {
layer.msg(res.msg, {icon: 1});
insTb.reload({page: {curr: 1}});
insTbSSXM.reload({page: {curr: 1}});
@@ -290,12 +353,12 @@
showEditModel2();
});
- // 鏄剧ず琛ㄥ崟寮圭獥
+ // 鏄剧ず娣诲姞鏄庣粏琛ㄥ崟寮圭獥
function showEditModel2(exp) {
admin.open({
type: 1,
offset: '150px',
- title: (exp ? '淇敼' : '娣诲姞') + '椤圭洰',
+ title: (exp ? '淇敼' : '娣诲姞') + '鏄庣粏',
content: $('#eCourseCouEditDialog').html(),
success: function (layero, dIndex) {
$(layero).children('.layui-layer-content').css('overflow', 'visible');
@@ -307,21 +370,21 @@
if (isExpAdd) { // 鍓嶇澶勭悊娣诲姞銆佷慨鏀�
if (exp) { // 鍓嶇淇敼
for (var i = 0; i < xxDataList.length; i++) {
- if (xxDataList[i].experimentName == data.field.experimentName && xxDataList[i].experimentId != data.field.experimentId) {
+ if (xxDataList[i].experimentName === data.field.experimentName && xxDataList[i].experimentId !== data.field.experimentId) {
layer.msg('瀹為獙椤圭洰鍚嶇О宸插瓨鍦�', {icon: 2});
return false;
}
}
layer.close(dIndex);
for (var j = 0; j < xxDataList.length; j++) {
- if (xxDataList[j].experimentId == data.field.experimentId) {
+ if (xxDataList[j].experimentId === data.field.experimentId) {
xxDataList[j].experimentName = data.field.experimentName;
}
}
insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
} else { // 鍓嶇娣诲姞
for (var i = 0; i < xxDataList.length; i++) {
- if (xxDataList[i].experimentName == data.field.experimentName) {
+ if (xxDataList[i].experimentName === data.field.experimentName) {
layer.msg('瀹為獙椤圭洰鍚嶇О宸插瓨鍦�', {icon: 2});
return false;
}
@@ -338,7 +401,7 @@
}
$.get(url, {json: JSON.stringify(data.field)}, function (res) {
layer.closeAll('loading');
- if (res.code == 200) {
+ if (res.code === 200) {
layer.close(dIndex);
insTbSSXM.reload({page: {curr: 1}});
layer.msg(res.msg, {icon: 1});
@@ -349,6 +412,40 @@
}
return false;
});
+ // 娓叉煋鐗╂枡閫夋嫨
+ var matXmSelect = xmSelect.render({
+ el: '#mat',
+ radio: true,
+ autoRow: true,
+ toolbar: { show: true },
+ filterable: true,
+ remoteSearch: true,
+ remoteMethod: function(val, cb, show){
+ //杩欓噷濡傛灉val涓虹┖, 鍒欎笉瑙﹀彂鎼滅储
+ // if(!val){
+ // return cb([]);
+ // }
+ $.ajax({
+ url: baseUrl+"/mat/all/get/kv",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ condition: val
+ },
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ cb(res.data)
+ } else {
+ cb([]);
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ });
+ }
+ })
+ // 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯
+ $(layero).children('.layui-layer-content').css('overflow', 'visible');
+ layui.form.render('select');
}
});
}
@@ -369,7 +466,7 @@
experimentTypeId: experimentTypeId
}, function (res) {
layer.closeAll('loading');
- if (res.code == 200) {
+ if (res.code === 200) {
layer.msg(res.msg, {icon: 1});
insTb.reload({page: {curr: 1}});
} else {
--
Gitblit v1.9.1