From cff0c053baeb229a6c7a7794c061c179111e0b7f Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 31 八月 2023 10:46:12 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/zycrm' into zycrm --- src/main/webapp/static/js/reimburseOnline/reimburseOnline.js | 120 ++++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 73 insertions(+), 47 deletions(-) diff --git a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js index 88ea097..42e40a7 100644 --- a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js +++ b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js @@ -298,7 +298,7 @@ }); break; case "edit": - showEditForm(data); + showEditModel(data); break; case "look": var $a = $(obj.tr).find('a[lay-event="look"]'); @@ -452,7 +452,7 @@ cellMinWidth: 100, cols: [[ {type: 'numbers', title: '#'}, - {field: 'occupation', title: '浜嬬敱', width: 100}, + {field: 'occupation', title: '浜嬬敱', width: 100, style: 'color: blue;font-weight: bold', templet: '#occupation'}, // {field: 'expenseType', title: '璐圭敤绫诲瀷', width: 100}, {field: 'expenseType$', title: '璐圭敤绫诲瀷', width: 100}, {field: 'taxRate', title: '绋庣巼', width: 60}, @@ -474,9 +474,31 @@ // {field: 'updateUserId', title: '鏇存柊浜哄憳ID', width: 160}, {field: 'updateUserName', title: '鏇存柊浜哄憳鍚嶅瓧'}, // {field: 'creationTime', title: '鍒涘缓鏃ユ湡', width: 160} + {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'} ]], - done: function (res) { + done: function (res, curr, count) { $(layero).find('.layui-table-view').css('margin', '0'); + var options = this; + + // 鑾峰彇褰撳墠琛屾暟鎹� + table.getRowData = function(elem){ + var index = $(elem).closest('tr').data('index'); + return table.cache[options.id][index] || {}; + }; + + $('.input-occupation').on('text', function(){ + var value = this.value; // 鑾峰彇閫変腑椤� value + var data = table.getRowData(this); + console.log(value); + console.log("value------==="); + xxDataList.forEach(res => { + if (data.id === res.id){ + console.log(res) + res.occupation = value; + } + }) + + }); }, size: '' }; @@ -559,6 +581,7 @@ // 琛ㄥ崟鎻愪氦浜嬩欢 form.on('submit(matEditSubmit)', function (data) { let selectList = matXmSelect.getValue(); + console.log(selectList) for (let i = 0; i<selectList.length; i++) { let item = selectList[i]; // 鏌ヨ鐗╂枡璇︽儏 @@ -570,13 +593,16 @@ success: function (res) { if (res.code === 200){ var bige=true; - for (var j = 0; j < xxDataList.length; j++) { - if (xxDataList[j].matnr === res.data.matnr && xxDataList[j].batch === res.data.batch) { - bige=false; - break; - } - } + // console.log("-------2.1-------") + // for (var j = 0; j < xxDataList.length; j++) { + // if (xxDataList[j].expenseType === res.data.expenseType && xxDataList[j].batch === res.data.batch) { + // bige=false; + // console.log("-------2.2-------") + // break; + // } + // } if (bige){ + // console.log("-------2.3-------") xxDataList.push(res.data); insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); } @@ -690,44 +716,44 @@ // }); // } - // 鏇存柊form - function showEditForm(mData) { - admin.open({ - type: 1, - area: '800px', - title: '鏍镐环淇℃伅缂栬緫', - content: $('#editStatus').html(), - success: function (layero, dIndex) { - form.val('editStatusDetail', mData); - form.render('select') - form.on('submit(editSubmit)', function (data) { - var loadIndex = layer.load(2); - $.ajax({ - url: baseUrl+"/reimburseOnline/updateForm/auth", - headers: {'token': localStorage.getItem('token')}, - data: data.field, - method: 'POST', - traditional:true, - success: function (res) { - if (res.code === 200){ - layer.closeAll(); - tableReload(false); - } else if (res.code === 403){ - top.location.href = baseUrl+"/"; - } else { - layer.msg(res.msg) - } - } - }) - layer.close(loadIndex); - layer.close(dIndex); - return false; - }); - $(layero).children('.layui-layer-content').css('overflow', 'visible'); - layui.form.render('select'); - } - }); - } + // // 鏇存柊form + // function showEditForm(mData) { + // admin.open({ + // type: 1, + // area: '800px', + // title: '鏍镐环淇℃伅缂栬緫', + // content: $('#editStatus').html(), + // success: function (layero, dIndex) { + // form.val('editStatusDetail', mData); + // form.render('select') + // form.on('submit(editSubmit)', function (data) { + // var loadIndex = layer.load(2); + // $.ajax({ + // url: baseUrl+"/reimburseOnline/updateForm/auth", + // headers: {'token': localStorage.getItem('token')}, + // data: data.field, + // method: 'POST', + // traditional:true, + // success: function (res) { + // if (res.code === 200){ + // layer.closeAll(); + // tableReload(false); + // } else if (res.code === 403){ + // top.location.href = baseUrl+"/"; + // } else { + // layer.msg(res.msg) + // } + // } + // }) + // layer.close(loadIndex); + // layer.close(dIndex); + // return false; + // }); + // $(layero).children('.layui-layer-content').css('overflow', 'visible'); + // layui.form.render('select'); + // } + // }); + // } }); -- Gitblit v1.9.1