| | |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin', 'dropdown'], function() { |
| | | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown'], function() { |
| | | var dropdown = layui.dropdown; |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 渲染物料选择 |
| | | var matXmSelect = xmSelect.render({ |
| | | el: '#mat', |
| | | style: { |
| | | width: '270px', |
| | | }, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function(val, cb, show){ |
| | | $.ajax({ |
| | | url: baseUrl+"/pla/batch/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}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | // 复选框事件 |
| | | table.on('checkbox(plaDetl)', function(obj){ |
| | |
| | | if(customValue !== undefined){ |
| | | searchData['type'] = customValue |
| | | } |
| | | if(searchData.select){ |
| | | searchData.batch = searchData.select; |
| | | searchData.select = null; |
| | | } |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |