| | |
| | | }); |
| | | |
| | | // 监听仓库选择,选择后自动调用仓库的粮品种和产地信息 |
| | | form.on('select(select_depotId)', function(obj) { |
| | | form.on('select(select_depotId)', function (obj) { |
| | | updateFoodVarietyByDepot(obj.value); |
| | | }); |
| | | }); |
| | |
| | | // 渲染往来单位列表 |
| | | table.render({ |
| | | elem: '#tableNotice', |
| | | url: '../../basic/inout/list-notice—out', |
| | | url: '../../basic/inout/list-notice-out', |
| | | page: false, |
| | | // skin : "nob", |
| | | // size : 'sm', |
| | |
| | | method: 'POST', |
| | | contentType: "application/json;charset=UTF-8", |
| | | cols: [[{ |
| | | field: 'customerName', |
| | | title: '收货单位' |
| | | field: 'name', |
| | | title: '通知单名称', |
| | | width: '15%' |
| | | }, { |
| | | field: 'depotName', |
| | | title: '仓库名称', |
| | | width: '20%' |
| | | field: 'customerName', |
| | | title: '发货单位' |
| | | }, { |
| | | field: 'foodVarietyName', |
| | | title: '粮食品种', |
| | | width: '20%' |
| | | width: '12%' |
| | | }, { |
| | | field: 'year', |
| | | title: '年份', |
| | | width: '15%' |
| | | width: '10%' |
| | | }, { |
| | | field: 'depotName', |
| | | title: "所涉仓库" |
| | | }, { |
| | | field: 'contractName', |
| | | title: '所属合同' |
| | | }]], |
| | | where: param, |
| | | parseData: function (res) { |
| | |
| | | layer.open({ |
| | | type: 1, |
| | | title: "出库通知单", |
| | | area: ['700px', '600px'], |
| | | area: ['850px', '600px'], |
| | | shade: 0, |
| | | content: $('#listNotice'), |
| | | btn: 0, |
| | |
| | | var index = layer.load(); |
| | | // 渲染往来单位列表 |
| | | table.render({ |
| | | elem : '#tableFoodLoaction', |
| | | url : '../../basic/common/page-food-location', |
| | | page : false, |
| | | toolbar : '#toolbarFoodLocaton', |
| | | even : true, |
| | | method : 'POST', |
| | | contentType : "application/json;charset=UTF-8", |
| | | cols : [ [ { |
| | | field : 'code', |
| | | title : '编码' |
| | | elem: '#tableFoodLoaction', |
| | | url: '../../basic/common/page-dicArea', |
| | | page: false, |
| | | toolbar: '#toolbarFoodLocaton', |
| | | even: true, |
| | | method: 'POST', |
| | | contentType: "application/json;charset=UTF-8", |
| | | cols: [[{ |
| | | field: 'code', |
| | | title: '编码' |
| | | }, { |
| | | field : 'simple', |
| | | title : '简拼' |
| | | field: 'simple', |
| | | title: '简拼' |
| | | }, { |
| | | field : 'name', |
| | | title : '名称', |
| | | width : '60%' |
| | | } ] ], |
| | | where : { |
| | | "page" : 1, |
| | | "limit" : 100 |
| | | field: 'name', |
| | | title: '名称', |
| | | width: '60%' |
| | | }]], |
| | | where: { |
| | | "page": 1, |
| | | "limit": 100 |
| | | }, |
| | | parseData : function(res) { |
| | | parseData: function (res) { |
| | | if ("0000" == res.code) { |
| | | return { |
| | | "code" : "0", |
| | | "msg" : res.msg, |
| | | "count" : res.data.total, |
| | | "data" : res.data.records |
| | | "code": "0", |
| | | "msg": res.msg, |
| | | "count": res.data.total, |
| | | "data": res.data.records |
| | | } |
| | | } else { |
| | | return { |
| | | "code" : "1", |
| | | "msg" : res.msg |
| | | "code": "1", |
| | | "msg": res.msg |
| | | } |
| | | } |
| | | }, |
| | | done : function(res) { |
| | | done: function (res) { |
| | | layer.close(index); |
| | | } |
| | | }); |
| | | |
| | | //双击显示选中数据 |
| | | table.on('rowDouble(tableFoodLoaction)', function(obj){ |
| | | table.on('rowDouble(tableFoodLoaction)', function (obj) { |
| | | var data = obj.data; |
| | | // 赋值 |
| | | form.val("form-data", { |
| | | foodLocation : data.name, |
| | | foodLocation: data.name, |
| | | }); |
| | | // 关闭 |
| | | layer.close(index2); |
| | |
| | | |
| | | // 弹出对话框 |
| | | var index2 = layer.open({ |
| | | type : 1, |
| | | title : "选择粮产地", |
| | | area : [ '600px', '600px' ], |
| | | shade : 0, |
| | | content : $('#listFoodLocation'), |
| | | btn : 0, |
| | | btn : [ '取消' ], |
| | | yes : function() { |
| | | type: 1, |
| | | title: "选择粮产地", |
| | | area: ['600px', '600px'], |
| | | shade: 0, |
| | | content: $('#listFoodLocation'), |
| | | btn: 0, |
| | | btn: ['取消'], |
| | | yes: function () { |
| | | // 关闭 |
| | | layer.close(index2); |
| | | }, |
| | | closeBtn : 0 |
| | | closeBtn: 0 |
| | | }); |
| | | |
| | | } |
| | |
| | | function flushFoodLocation() { |
| | | var key = $("#key2").val(); |
| | | table.reload('tableFoodLoaction', { |
| | | url : "../../basic/common/page-food-location", |
| | | where : { |
| | | key : key |
| | | url: "../../basic/common/page-dicArea", |
| | | where: { |
| | | key: key |
| | | }, |
| | | done : function(res) { |
| | | done: function (res) { |
| | | if (key) { |
| | | $("#key2").val(key); |
| | | } |