| | |
| | | |
| | | </body> |
| | | <script> |
| | | var initCountVal = 1; |
| | | var matCodeData = []; |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/matCode/list/auth', |
| | | page: true, |
| | | limit: 10, |
| | | limits: [10, 30,50,100], |
| | | limit: 7, |
| | | limits: [7, 10, 30,50,100], |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | setMatCodeData(res.data); |
| | | $('td[data-field=count] div').html("1"); |
| | | setMatCodeData(res.data); |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | }) |
| | | |
| | | function setMatCodeData(data, matNo, count) { |
| | | function setMatCodeData(data) { |
| | | matCodeData = data; |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | matCodeData[i]["count"] = initCountVal; |
| | | } |
| | | } |
| | | |
| | | function updateMatCodeData(matNo, count) { |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (matCodeData[i][matNo] === matNo){ |
| | | matCodeData[i][count] = count; |
| | | if (matCodeData[i]["matNo"] === matNo){ |
| | | matCodeData[i]["count"] = count; |
| | | } |
| | | } |
| | | console.log(matCodeData); |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | setMatCodeData(res.data); |
| | | $('td[data-field=count] div').html("1"); |
| | | setMatCodeData(res.data); |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |