1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
| //import { search } from "modernizr";
|
| var DeliveryOutManager = {
| InTable: undefined,
|
| Server: function (URL, data, callback) {
| $.gitAjax({
| url: URL,
| data: data,
| type: "post",
| dataType: "json",
| success: function (result) {
| callback(result);
| }
| });
| },
|
| ToolBar: function () {
| DeliveryOutManager.PageClick(1, 50);
|
| var searchBar = $("div[data-condition='search']");
| searchBar.find("a[data-command='search']").click(function () {
| // 调用查询方法,绑定分页信息
| DeliveryOutManager.PageClick(1, 50);
| });
|
| var btnClick = $("div.toolbar");
| btnClick.find("a.btn").click(function () {
| var command = $(this).attr("data-command");
| switch (command) {
| case "Port":
| var search = DeliveryOutManager.GetSearch();
|
| $.gitAjax({
| url: "/Data/StorePalnoAjax/SetSeesion",
| data: { ajaxdata: JSON.stringify(search) },
| type: "post",
| dataType: "json",
| success: function (result) {
| window.location.href = "/Data/Store/ReportShow?type=A";
| }
| });
| break;
| }
| });
| },
|
| GetSearch: function () {
| var search = {};
|
| var searchBar = $("div[data-condition='search']");
| search["LingNo"] = searchBar.find("input[name='Ling_No']").val();
| search["PageNo"] = searchBar.find("input[name='Ye_No']").val();
| search["MatNo"] = searchBar.find("input[name='MatNo']").val();
| search["MatName"] = searchBar.find("input[name='MatName']").val();
| search["PickerUser"] = searchBar.find("input[name='Lever']").val();
| search["MatType"] = searchBar.find("select[name='MatType']").val();
| search["BeginTime"] = searchBar.find("input[name='BeginTime']").val(); // 单据时间段
| search["EndTime"] = searchBar.find("input[name='EndTime']").val();
| search["OrdNoType"] = searchBar.find("select[name='OrdNoType']").val();
| search["Certificate"] = searchBar.find("select[name='Certificate']").val();
|
| return search;
| },
|
| PageClick: function (PageIndex, PageSize) {
| var search = DeliveryOutManager.GetSearch();
| search["pageIndex"] = PageIndex;
| search["pageSize"] = PageSize;
|
| DeliveryOutManager.Server("/Data/DeliveryOutAjax/GetList", { aaa: JSON.stringify(search) },
| function (result) {
| if (result != null) {
| if (result.Code == 1) {
| // 查询成功,绑定Table
| DeliveryOutManager.SetTable(result);
| } else {
| $.jBox.tip(result.Message, "warn");
| }
| }
| });
| },
|
| SetTable: function (result) {
| var cols = [
| {
| title: '生产令号', name: 'LingNo', width: 120, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '图号', name: 'TuNo', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '序号', name: 'PageNo', width: 80, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '物料编码', name: 'MatNo', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
|
| return data;
| }
| },
| {
| title: '物料名称', name: 'MatName', width: 160, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '规格型号', name: 'PackFormat', width: 260, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '单数', name: 'PlanQuant', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '数量', name: 'CurQuant', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '单位', name: 'UnitName', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '合格证', name: 'Certificate', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '物料类型', name: 'TypeName', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '领料人', name: 'PickerUser', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '制单人', name: 'RealName', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '创建时间', name: 'CreateTime', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return git.JsonToDateTimeto(data);
| }
| },
| {/*hidden: 'true',*/
| title: '单据号', name: 'OrdNo', width: 150, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| //{
| // title: '库位地址', name: 'LocationCode', width: 120, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| // return data;
| // }
| //},
| //{
| // title: '托盘号', name: 'Palno', width: 120, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
| // return data;
| // }
| //},
| {
| title: '备注', name: 'Demo', width: 160, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| return data;
| }
| },
| {
| title: '操作', name: 'OrdnoType', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
| var html = "";
| if (item.OrdnoType == "入库单"){
| html += '<a class="edit dis" href="javascript:void(0)">编辑</a> ';/**/
| }
| return html;
| }
| }
| ];
|
| if (this.InTable == undefined) {
| var ht = masterUI.MMGridHeight();
| this.InTable = $("#tabList").mmGrid({
| cols: cols,
| fullWidthRows: true,
| multiSelect: false,
| items: result.Result.List,
| indexCol: true,
| nowrap: true,
| height: ht
| });
|
| DeliveryOutManager.BindEvent();
| }
| else {
| this.InTable.load(result.Result.List);
| }
|
| //绑定分页信息,切换分页调用查询方法
| var pageInfo = result.PageInfo;
| if (pageInfo != undefined) {
| $("#mypager").pager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DeliveryOutManager.PageClick });
| }
| },
|
| BindEvent: function () {
|
| this.InTable.on('loadSuccess', function (e, data) {
| LoadBtn.SetBtn();
| });
| this.InTable.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
| if ($(e.target).is("a.edit")) {
| if (item.OrdnoType == "入库单") {
| var ordNo = item.OrdNo;
| var matNo = item.MatNo;
|
| DeliveryOutManager.EditCertificate(ordNo, matNo);
| } else {
| $.jBox.tip("该订单不能编辑", "warn");
| }
| }
|
| });
| },
|
| EditCertificate: function (OrdNo, MatNo) {
| var submit = function (v, h, f) {
|
| if (v) {
| var Certificate = $('div.controls').find("#Certificate").val();
| var Demo = $('div.controls').find("#Demo").val();
| var entity = {};
| entity["OrdNo"] = OrdNo;
| entity["MatNo"] = MatNo;
| entity["Certificate"] = Certificate;
| entity["Demo"] = Demo;
|
| DeliveryOutManager.Server("/Data/DeliveryOutAjax/SetCertificates", { aaa: JSON.stringify(entity) },
| function (result) {
| if (result != null) {
| if (result.Code == 1) {
| DeliveryOutManager.PageClick(1, 50);
| } else {
| $.jBox.tip(result.Message, "warn");
| }
| }
| });
| }
| }
|
| var load = function (h) {
|
| }
|
| $.jBox.open("get:/Data/DeliveryOutDetail/EditCertificates?OrdNo=" + OrdNo + "&MatNo=" + MatNo,
| "补录合格证", 360, 200, {
| buttons: {
| "确定": true, "关闭": false
| }, submit: submit, loaded: load
| });
| },
| }
|
|