| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // ---------------------------粮食产地-开始 -------------------// |
| | | function showFoodLocation() { |
| | | var index = layer.load(); |
| | | table.render({ |
| | | elem: '#tableFoodLoaction', |
| | | url: '/basic/inout/page-dicArea', |
| | | page: true, |
| | | toolbar: '#toolbarFoodLocaton', |
| | | even: true, |
| | | method: 'POST', |
| | | contentType: "application/json;charset=UTF-8", |
| | | cols: [[{ |
| | | field: 'code', |
| | | title: '编码', |
| | | }, { |
| | | field: 'simple', |
| | | title: '简拼', |
| | | }, { |
| | | field: 'name', |
| | | title: '名称', |
| | | width: '60%' |
| | | }]], |
| | | where: { |
| | | "page": 1, |
| | | "limit": 8 |
| | | }, |
| | | parseData: function (res) { |
| | | if ("0000" == res.code) { |
| | | return { |
| | | "code": "0", |
| | | "msg": res.msg, |
| | | "count": res.data.total, |
| | | "data": res.data.records |
| | | } |
| | | } else { |
| | | return { |
| | | "code": "1", |
| | | "msg": res.msg |
| | | } |
| | | } |
| | | }, |
| | | done: function (res) { |
| | | layer.close(index); |
| | | } |
| | | }); |
| | | |
| | | //双击显示选中数据 |
| | | table.on('rowDouble(tableFoodLoaction)', function (obj) { |
| | | var data = obj.data; |
| | | // 赋值 |
| | | form.val("form-data", { |
| | | foodLocation: data.name, |
| | | foodLocationId: data.code |
| | | }); |
| | | // 关闭 |
| | | $("#listFoodLocation").css("display", "none"); |
| | | layer.close(index3); |
| | | }); |
| | | |
| | | // 弹出对话框 |
| | | var index3 = layer.open({ |
| | | type: 1, |
| | | title: "选择粮产地", |
| | | offset: ['240px', '100px'], |
| | | area: ['600px', '530px'], |
| | | cancel: function (index, layero) { |
| | | $("#listFoodLocation").css("display", "none"); |
| | | }, |
| | | shade: 0, |
| | | scrollbar: 0, |
| | | content: $('#listFoodLocation'), |
| | | closeBtn: 1 |
| | | }); |
| | | } |
| | | |
| | | // 刷新 |
| | | function flushFoodLocation() { |
| | | var key = $("#key2").val(); |
| | | table.reload('tableFoodLoaction', { |
| | | url: "/basic/inout/page-dicArea", |
| | | where: { |
| | | key: key |
| | | }, |
| | | done: function (res) { |
| | | if (key) { |
| | | $("#key2").val(key); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // ---------------------------通知单-开始 -------------------// |
| | | // 弹出往来单位下拉框 |
| | | function showNotice() { |
| | | var titleCustomer = "送货单位"; |
| | | var url = "/basic/inout/list-notice-in"; |
| | | if ("OUT" == type) { |
| | | titleCustomer = "收货单位"; |
| | | url = "/basic/inout/list-notice-out" |
| | | } |
| | | var index = layer.load(); |
| | | var param = { |
| | | type: type |
| | | }; |
| | | |
| | | console.log(url); |
| | | |
| | | table.render({ |
| | | elem: '#tableNotice', |
| | | url: url, |
| | | page: false, |
| | | even: true, |
| | | method: 'POST', |
| | | contentType: "application/json;charset=UTF-8", |
| | | cols: [[{ |
| | | field: 'name', |
| | | title: '通知单名称', |
| | | width: '15%' |
| | | }, { |
| | | field: 'customerName', |
| | | title: titleCustomer |
| | | }, { |
| | | field: 'foodVarietyName', |
| | | title: '粮食品种', |
| | | width: '10%' |
| | | }, { |
| | | field: 'year', |
| | | title: '年份', |
| | | width: '8%' |
| | | }, { |
| | | field: 'contract', |
| | | title: '关联合同' |
| | | }]], |
| | | where: param, |
| | | parseData: function (res) { |
| | | if ("0000" == res.code) { |
| | | return { |
| | | "code": "0", |
| | | "msg": res.msg, |
| | | "data": res.data |
| | | } |
| | | } else { |
| | | return { |
| | | "code": "1", |
| | | "msg": res.msg |
| | | } |
| | | } |
| | | }, |
| | | done: function (res) { |
| | | layer.close(index); |
| | | } |
| | | }); |
| | | //双击显示选中数据 |
| | | table.on('rowDouble(tableNotice)', function (obj) { |
| | | var data = obj.data; |
| | | console.log(data) |
| | | form.val("form-data", { |
| | | customerName: data.customerName, |
| | | noticeId: data.id, |
| | | foodYear: data.year, |
| | | depotId: data.depotId, |
| | | foodVariety: data.foodVariety |
| | | }); |
| | | layer.close(index2); |
| | | // 关闭 |
| | | $("#listNotice").css("display", "none"); |
| | | }); |
| | | // 弹出对话框 |
| | | var index2 =layer.open({ |
| | | type: 1, |
| | | offset: ['100px', '250px'], |
| | | title: "通知单列表(双击选中)", |
| | | area: ['900px', '600px'], |
| | | cancel: function (index, layero) { |
| | | $("#listNotice").css("display", "none"); |
| | | }, |
| | | shade: 0, |
| | | scrollbar: 0, |
| | | content: $('#listNotice'), |
| | | closeBtn: 1 |
| | | }); |
| | | } |
| | | |
| | | //错误提醒 |
| | | function alertError(msg) { |
| | | layer.alert(msg, { |
| | |
| | | } else { |
| | | $("#resultType").text("出库-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } |
| | | $("#resultIntelCard").text(data.intelCard); |
| | | layer.open({ |
| | | type: 1, |
| | | offset: ['150px', '200px'], |