From 3574eefe0536930171d7b6967f99582b158ada3a Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期五, 28 三月 2025 16:27:52 +0800 Subject: [PATCH] 采购订单添加下查,采购订单销售订单编辑添加物料下拉列表,采购调价单添加字段,工程项目编辑页位置迁移 --- WebTM/layuiadmin/modules/tableSelect.js | 40 +++++++++++++++++++++++++++++++++++++--- 1 files changed, 37 insertions(+), 3 deletions(-) diff --git a/WebTM/layuiadmin/modules/tableSelect.js b/WebTM/layuiadmin/modules/tableSelect.js index 17c16bb..04b4964 100644 --- a/WebTM/layuiadmin/modules/tableSelect.js +++ b/WebTM/layuiadmin/modules/tableSelect.js @@ -25,7 +25,7 @@ opt.table.height = opt.table.height || 290; elem.off('keyup').on('keyup', function(e) { e.stopPropagation(); - if ($('div.tableSelect').length >= 1 || elem.val().length<=2) { + if ($('div.tableSelect').length >= 1 || elem.val().length <= 2 || event.key == "F7" || event.key == "F8" || event.key == "F6") { return false; } @@ -67,7 +67,12 @@ //} var tableSelect_table = table.render(opt.table); - + //璁╀竴娆″姞杞芥樉绀烘暟鎹� + let executed = false; + if (elem.val().length == 3 && !executed) { + executed = true; + search(); + } //jump鍒嗛〉瑙﹀彂鍑芥暟 //function jump(obj, first) { // table.reload(tableName); @@ -176,7 +181,35 @@ timeout = setTimeout(() => func.apply(context, args), wait); }; } - + //鎼滅储鍑芥暟 + function search() { + var searchKeyList = opt.searchKey.split(',');//鑾峰彇鏌ユ壘鐨勫叧閿瓧鎼滅储妗� + //鎷兼帴sql瀛楃涓� + var sWhereStr = " and (" + searchKeyList.forEach(function (value, index) { + if (index == 0) { + sWhereStr += (value + " like '%" + elem.val() + "%' ") + } else { + sWhereStr += ("or " + value + " like '%" + elem.val() + "%' ") + } + }) + sWhereStr += ")" + //鍚庣鍒嗛〉鎼滅储 + if (opt.table.where != undefined) { + opt.table.where['sWhere'] = opt.sWhere + sWhereStr; + tableSelect_table.reload({ + where: opt.table.where, + page: { + curr: 1 + } + }); + } else { + var sWhere = opt.sWhere + sWhereStr; + tableSelect_table.reload({ + data: opt.ajaxSelect(sWhere) + }); + } + } //杈撳叆妗嗚緭鍏ユ墽琛� elem.off('input').on('input', debounce( @@ -261,6 +294,7 @@ opt.done(elem, checkStatus); tableBox.remove(); delete table.cache[tableName]; + $(opt.elem).blur(); } //鐐瑰嚮鍏朵粬鍖哄煙鍏抽棴 -- Gitblit v1.9.1