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
| //控制流程环节显示
| function showProgress() {
| if (!inoutProgress) {
| return;
| }
| if (inoutProgress.indexOf("REGISTER") == -1) {
| $("#progress-register").css("display", "none");
| }
| if (inoutProgress.indexOf("CHECK") == -1) {
| $("#progress-check").css("display", "none");
| }
| if (inoutProgress.indexOf("WEIGHT_FULL") == -1) {
| $("#progress-fullWeight").css("display", "none");
| }
| if (inoutProgress.indexOf("HANDLE") == -1) {
| $("#progress-hand").css("display", "none");
| }
| if (inoutProgress.indexOf("WEIGHT_EMPTY") == -1) {
| $("#progress-emptyWeight").css("display", "none");
| }
| if (inoutProgress.indexOf("CARD_BACK") == -1) {
| $("#progress-cardBack").css("display", "none");
| }
| }
|
|
| // ---------------------------粮食产地-开始 -------------------//
| 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, {
| icon: 5,
| offset: ['300px', '300px']
| });
| }
|
| function alertSuccess(msg) {
| layer.alert(msg, {
| icon: 1,
| offset: ['300px', '300px']
| });
| }
|
| /**
| * 弹出提醒框
| * @param msg 提醒信息
| * @param data 数据信息,可能为空
| */
| function notifyProgress(msg, data) {
| if (data) {
| //赋值
| $("#resultMsg").text(msg);
| $("#resultUserName").text(data.userName);
| $("#resultPlateNum").text(data.plateNum);
| if ("IN" == data.type) {
| $("#resultType").text("入库-" + INOUT_PROGRESS_MSG(data.progress));
| } else {
| $("#resultType").text("出库-" + INOUT_PROGRESS_MSG(data.progress));
| }
| layer.open({
| type: 1,
| offset: ['150px', '200px'],
| area: '450px;',
| shade: 0.8,
| id: 'dialog_notify_info',
| btn: ['确定'],
| content: $('#dialog-from-notify'),
| yes: function (index) {
| layer.closeAll();
| }
| });
| } else {
| alertError(msg);
| }
| }
|
|