From 46607139e955ca266e24bd8561bca1f93a650178 Mon Sep 17 00:00:00 2001
From: wang..123 <brook_w@163.com>
Date: 星期二, 22 三月 2022 18:23:39 +0800
Subject: [PATCH] Merge branch 'master' of http://47.97.1.152:5880/r/wms_saas
---
src/main/webapp/static/js/pickout/pickout.js | 373 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 210 insertions(+), 163 deletions(-)
diff --git a/src/main/webapp/static/js/pickout/pickout.js b/src/main/webapp/static/js/pickout/pickout.js
index 6503c88..316ce54 100644
--- a/src/main/webapp/static/js/pickout/pickout.js
+++ b/src/main/webapp/static/js/pickout/pickout.js
@@ -9,134 +9,56 @@
var form = layui.form;
var admin = layui.admin;
- // 鏁版嵁娓叉煋
- tableIns = table.render({
- elem: '#pickout',
- headers: {token: localStorage.getItem('token')},
- url: baseUrl+'/pickout/list/auth',
- page: true,
- limit: 16,
- limits: [16, 30, 50, 100, 200, 500],
- toolbar: '#toolbar',
- cellMinWidth: 50,
- cols: [[
- {type: 'checkbox'}
- ,{field: 'id', align: 'center',title: '鍞竴ID'}
- ,{field: 'hostId', align: 'center',title: '鍟嗘埛ID'}
- ,{field: 'userId', align: 'center',title: '鐢ㄦ埛ID'}
- ,{field: 'wrkNo', align: 'center',title: '宸ヤ綔鍙�'}
- ,{field: 'wrkSts', align: 'center',title: '宸ヤ綔鐘舵��'}
- ,{field: 'zpallet', align: 'center',title: '鏉″舰鐮�'}
- ,{field: 'createTime$', align: 'center',title: ''}
- ,{field: 'createBy', align: 'center',title: ''}
- ,{field: 'updateTime$', align: 'center',title: ''}
- ,{field: 'updateBy', align: 'center',title: ''}
- ,{field: 'memo', align: 'center',title: ''}
- ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
- ]],
+ /****************************************** 宸﹁竟琛� *************************************************/
+ var leftTB = table.render({
+ elem: '#leftTable',
+ url: baseUrl + '/pickout/list/auth',
+ height: 'full-100',
+ headers: {token: localStorage.getItem('token')},
request: {
pageName: 'curr',
pageSize: 'limit'
},
- parseData: function (res) {
- return {
- 'code': res.code,
- 'msg': res.msg,
- 'count': res.data.total,
- 'data': res.data.records
- }
+ 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();
+ defaultToolbar: [],
+ cols:[[
+ // {type: 'checkbox'}
+ {field: 'wrkNo', align: 'center',title: '浠诲姟鍙�',width: 180}
+ ,{field: 'id', align: 'center',title: '鍞竴ID',hide: true}
+ ,{field: 'hostId', align: 'center',title: '鍟嗘埛ID', hide: true}
+ ,{field: 'userId', align: 'center',title: '鐢ㄦ埛ID', hide: true}
+
+ ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��' ,templet: '#wrkStsTpl' , width: 100}
+ ,{field: 'zpallet', align: 'center',title: '鏉″舰鐮�' , hide:true}
+ ,{field: 'createTime$', align: 'center',title: '', hide:true}
+ ,{field: 'createBy', align: 'center',title: '', hide:true}
+ ,{field: 'updateTime$', align: 'center',title: '', hide:true}
+ ,{field: 'updateBy', align: 'center',title: '', hide:true}
+ ,{field: 'memo', align: 'center',title: '', hide:true}
+
+ ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate'}
+ ]],
+ done: function (res,curr,count){
+ $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
}
});
-
- // 鐩戝惉鎺掑簭浜嬩欢
- table.on('sort(pickout)', 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}
- });
- });
-
- // 鐩戝惉澶村伐鍏锋爮浜嬩欢
- table.on('toolbar(pickout)', function (obj) {
- var checkStatus = table.checkStatus(obj.config.id).data;
- switch(obj.event) {
- case 'addData':
- showEditModel();
- break;
- case 'deleteData':
- if (checkStatus.length === 0) {
- layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
- return;
- }
- var ids = checkStatus.map(function (d) {
- return d.id;
- });
- del(ids);
- 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 = {
- 'pickout': exportData,
- 'fields': fields
- };
- $.ajax({
- url: baseUrl+"/pickout/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, {icon: 2})
- }
- }
- });
- });
- break;
- }
- });
-
// 鐩戝惉琛屽伐鍏蜂簨浠�
- table.on('tool(pickout)', function(obj){
+ table.on('tool(leftTable)', function(obj){
var data = obj.data;
switch (obj.event) {
- case 'edit':
- showEditModel(data);
+ case 'complete':
+ complete(data);
break;
case "del":
var ids = [data.id];
@@ -144,48 +66,17 @@
break;
}
});
-
- /* 寮圭獥 - 鏂板銆佷慨鏀� */
- function showEditModel(mData) {
- admin.open({
- type: 1,
- area: '600px',
- title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
- content: $('#editDialog').html(),
- success: function (layero, dIndex) {
- layDateRender();
- form.val('detail', mData);
- form.on('submit(editSubmit)', function (data) {
- var loadIndex = layer.load(2);
- $.ajax({
- url: baseUrl+"/pickout/"+(mData?'update':'add')+"/auth",
- headers: {'token': localStorage.getItem('token')},
- data: data.field,
- method: 'POST',
- success: function (res) {
- layer.close(loadIndex);
- if (res.code === 200){
- layer.close(dIndex);
- layer.msg(res.msg, {icon: 1});
- tableReload();
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
- layer.msg(res.msg, {icon: 2});
- }
- }
- })
- return false;
- });
- $(layero).children('.layui-layer-content').css('overflow', 'visible');
- layui.form.render('select');
- }
- });
- }
+ /* 鐩戝惉琛屽崟鍑讳簨浠� */
+ var selObj;
+ table.on('row(leftTable)', function (obj) {
+ selObj = obj;
+ obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
+ tableIns.reload({where: {head_id: obj.data.id}, page: {curr: 1}});
+ });
/* 鍒犻櫎 */
function del(ids) {
- layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
+ layer.confirm('纭畾瑕佹挙閿�閫変腑鏁版嵁鍚楋紵', {
skin: 'layui-layer-admin',
shade: .1
}, function (i) {
@@ -210,20 +101,176 @@
})
});
}
+ form.on('submit(leftResearch)', function (data) {
- // 鎼滅储
- form.on('submit(search)', function (data) {
- pageCurr = 1;
- tableReload(false);
+ leftTB.reload({where: {wrk_no: data.field.docName}});
+ return false;
});
- // 閲嶇疆
- form.on('submit(reset)', function (data) {
- pageCurr = 1;
- clearFormVal($('#search-box'));
- tableReload(false);
- });
+
+ /****************************************** 鍙宠竟琛� *************************************************/
+ // 鏁版嵁娓叉煋
+ tableIns = table.render({
+ elem: '#pickout',
+ headers: {token: localStorage.getItem('token')},
+ url: baseUrl+'/pickoutDetl/list/auth',
+ page: true,
+ limit: 16,
+ limits: [16, 30, 50, 100, 200, 500],
+ toolbar: '#toolbar',
+ cellMinWidth: 50,
+ cols: [[
+ // {type: 'checkbox'}
+ {field: 'id', align: 'center',title: '鍞竴ID', hide:true}
+ ,{field: 'headId', align: 'center',title: '琛ㄥごID', hide:true}
+ ,{field: 'nodeId', align: 'center',title: '搴撲綅ID', hide:true}
+ ,{field: 'nodeName', align: 'center',title: '搴撲綅鍚嶇О'}
+ ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
+ ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栫爜'}
+ ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'}
+ ,{field: 'name', align: 'center',title: '鍚嶇О', hide:true}
+ ,{field: 'specs', align: 'center',title: '瑙勬牸', hide:true}
+ ,{field: 'model', align: 'center',title: '鍨嬪彿', hide:true}
+ ,{field: 'batch', align: 'center',title: '鎵瑰彿', hide:true}
+ ,{field: 'unit', align: 'center',title: '鍗曚綅', hide:true}
+ ,{field: 'barcode', align: 'center',title: '鎵樼洏鐮�', hide:true}
+ ,{field: 'docType', align: 'center',title: '鍗曟嵁绫诲瀷', hide:true}
+ ,{field: 'docId', align: 'center',title: '鍗曟嵁缂栧彿', hide:true}
+ ,{field: 'price', align: 'center',title: '浠锋牸', hide:true}
+ ,{field: 'weight', align: 'center',title: '閲嶉噺', hide:true}
+ ,{field: 'status', align: 'center',title: '鐘舵��' , hide:true}
+ ,{field: 'pickStaff', align: 'center',title: '鎷h揣鍛業D'}
+ ,{field: 'pickStart$', align: 'center',title: '鎷h揣寮�濮嬫椂闂�'}
+ ,{field: 'pickEnd$', align: 'center',title: '鎷h揣缁撴潫鏃堕棿'}
+ ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿', hide:true}
+ ,{field: 'createBy', align: 'center',title: '鍒涘缓浜哄憳ID', hide:true}
+ ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿', hide:true}
+ ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳ID', hide:true}
+ ,{field: 'memo', align: 'center',title: '澶囨敞', hide:true}
+
+ ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150, hide:true}
+ ]],
+ 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();
+ }
+ });
+ /* 琛ㄦ牸2鎼滅储 */
+ form.on('submit(rightSearch)', function (data) {
+
+ tableIns.reload({where: data.field , page: {curr: 1}});
+ return false;
+ });
+ // // 鐩戝惉鎺掑簭浜嬩欢
+ // table.on('sort(pickout)', 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}
+ // });
+ // });
+ //
+ // // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+ // table.on('toolbar(pickout)', function (obj) {
+ // var checkStatus = table.checkStatus(obj.config.id).data;
+ // switch(obj.event) {
+ // case 'addData':
+ // showEditModel();
+ // break;
+ // case 'deleteData':
+ // if (checkStatus.length === 0) {
+ // layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+ // return;
+ // }
+ // var ids = checkStatus.map(function (d) {
+ // return d.id;
+ // });
+ // del(ids);
+ // 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 = {
+ // 'pickout': exportData,
+ // 'fields': fields
+ // };
+ // $.ajax({
+ // url: baseUrl+"/pickout/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, {icon: 2})
+ // }
+ // }
+ // });
+ // });
+ // break;
+ // }
+ // });
+ // /* 琛ㄦ牸鎼滅储 */
+ // form.on('submit(leftResearch)', function (data) {
+ // insTb.reload({where: {doc_name: data.field.docName,doc_class:2}});
+ // return false;
+ // });
+ //
+ //
+ // // 鎼滅储
+ // form.on('submit(search)', function (data) {
+ // pageCurr = 1;
+ // tableReload(false);
+ // });
+ //
+ // // 閲嶇疆
+ // form.on('submit(reset)', function (data) {
+ // pageCurr = 1;
+ // clearFormVal($('#search-box'));
+ // tableReload(false);
+ // });
+ //
// 鏃堕棿閫夋嫨鍣�
function layDateRender() {
layDate.render({
--
Gitblit v1.9.1