czt
2024-07-13 bd01ba57ed8526a0ee94a50e1f52034251bb54f6
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain" parent="dtInoutRecord">
      <ClientEvent name="onDataChange">if(arg.property ==&quot;foodVariety&quot;){&#xD;
    var entity = arg.entity;&#xD;
    entity.reset(&quot;checkItems&quot;);&#xD;
}</ClientEvent>
      <PropertyDef name="userName">
        <Property name="label">承运人</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="userId">
        <Property name="label">身份证号</Property>
        <Property name="required">false</Property>
      </PropertyDef>
      <PropertyDef name="noticeId">
        <Property name="label">通知单号</Property>
      </PropertyDef>
      <PropertyDef name="price">
        <Property name="dataType">Double</Property>
        <Property name="label">粮食定价</Property>
        <Property name="required">false</Property>
      </PropertyDef>
      <PropertyDef name="foodType">
        <Property name="label">粮食性质</Property>
        <Property name="required">true</Property>
        <Property name="mapping">
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;FOOD_TYPE_&quot;)}</Property>
        </Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:5;regionPadding:5">
    <ClientEvent name="onReady">var TYPE = &quot;${request.getParameter('type')}&quot;;&#xD;
&#xD;
var PROGRESS = &quot;WEIGHT_TAG&quot;;&#xD;
&#xD;
/**&#xD;
 * 刷新页面&#xD;
 */&#xD;
flush = function(){&#xD;
    view.get(&quot;#btnSave&quot;).set(&quot;disabled&quot;,false);&#xD;
    view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,TYPE).flushAsync();&#xD;
};&#xD;
flush();&#xD;
&#xD;
/**&#xD;
 * 数据保存提交&#xD;
 */&#xD;
save = function(){&#xD;
    var data = view.get(&quot;#dsMain.data&quot;);&#xD;
    if(data.validate() != 'ok'){&#xD;
        $alert(&quot;数据验证失败,请查看红色提醒!&quot;);&#xD;
        return;&#xD;
    }&#xD;
    var recordWeight = data.get(&quot;recordWeight&quot;);&#xD;
    if(recordWeight &lt;= 0){&#xD;
        $alert(&quot;数据验证失败,入库重量必须大于0!&quot;);&#xD;
        return;&#xD;
    }&#xD;
    view.get(&quot;#uaSave&quot;).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(&quot;保存失败:&quot;+result);&#xD;
        }else{&#xD;
            view.get(&quot;#btnSave&quot;).set(&quot;disabled&quot;,true);&#xD;
            $alert(&quot;保存成功,可以进行打印和重新提新表单!&quot;);&#xD;
            flush();&#xD;
&#xD;
        }&#xD;
    });&#xD;
}&#xD;
&#xD;
//删除附件&#xD;
delFile = function(){&#xD;
    var entity = view.get(&quot;#dgFiles&quot;).getCurrentItem();&#xD;
    view.get(&quot;#ajaxDelFile&quot;).set(&quot;parameter&quot;,{&#xD;
        fileName:entity.get(&quot;fileName&quot;),&#xD;
        createTime:entity.get(&quot;createTime&quot;)&#xD;
    }).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
        }else{&#xD;
            entity.remove();&#xD;
            $alert(&quot;删除成功!&quot;);&#xD;
        }&#xD;
    });&#xD;
}</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="javaScriptFile">./static/plugins/lodop/LodopFuncs.js</Property>
    <DataSet id="dsMain">
      <Property name="dataType">dtMain</Property>
      <Property name="dataProvider">inoutDataPR#initDataByHand</Property>
      <Property name="loadMode">manual</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="contentOverflow">hidden</Property>
      <Property name="height">55</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button id="btnSave" layoutConstraint="left">
        <ClientEvent name="onClick">save();</ClientEvent>
        <Property name="caption">数据提交</Property>
        <Property name="exClassName">btn-normal</Property>
        <Property name="iconClass">fa fa-plus</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">flush();</ClientEvent>
        <Property name="caption">刷新页面</Property>
        <Property name="exClassName">btn-warn</Property>
        <Property name="iconClass">fa fa-minus</Property>
      </Button>
    </Container>
    <TabControl id="tabControlMain" layoutConstraint="left ">
      <Property name="width">1300</Property>
      <ControlTab>
        <Property name="caption">基础信息</Property>
        <Property name="iconClass">fa fa-download</Property>
        <Property name="width">150</Property>
        <Property name="name">tabCommon</Property>
        <Container>
          <FieldSet layout="regionPadding:5" layoutConstraint="padding:10">
            <Property name="caption">基本信息</Property>
            <Buttons/>
            <Children>
              <AutoForm>
                <Property name="dataSet">dsMain</Property>
                <Property name="cols">*,*,*</Property>
                <Property name="labelAlign">right</Property>
                <Property name="labelSeparator">:</Property>
                <Property name="labelWidth">100</Property>
                <AutoFormElement>
                  <Property name="name">plateNum</Property>
                  <Property name="property">plateNum</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">userName</Property>
                  <Property name="property">userName</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">userContact</Property>
                  <Property name="property">userContact</Property>
                  <Property name="label">联系电话</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">completeTime</Property>
                  <Property name="property">completeTime</Property>
                  <Property name="label">登记时间</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="label">客户名称</Property>
                  <Property name="property">customerName</Property>
                  <Property name="editable">false</Property>
                  <Property name="trigger">ddNotice</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">transType</Property>
                  <Property name="property">transType</Property>
                  <Editor>
                    <RadioGroup>
                      <RadioButton>
                        <Property name="text">汽车</Property>
                        <Property name="value">1</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="text">火车</Property>
                        <Property name="value">2</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="text">轮船</Property>
                        <Property name="value">3</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="text">其他</Property>
                        <Property name="value">4</Property>
                      </RadioButton>
                    </RadioGroup>
                  </Editor>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">depotId</Property>
                  <Property name="property">depotId</Property>
                  <Property name="label">装卸仓库</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodVariety</Property>
                  <Property name="property">foodVariety</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodLevel</Property>
                  <Property name="property">foodLevel</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodYear</Property>
                  <Property name="property">foodYear</Property>
                  <Property name="trigger">yearDropDown</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">foodType</Property>
                  <Property name="property">foodType</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">checkStatus</Property>
                  <Property name="property">checkStatus</Property>
                  <Property name="label">化验结果</Property>
                  <Editor/>
                </AutoFormElement>
              </AutoForm>
            </Children>
          </FieldSet>
          <FieldSet layout="regionPadding:5" layoutConstraint="padding:10">
            <Property name="caption">称重信息(单位:KG)</Property>
            <Buttons/>
            <Children>
              <AutoForm>
                <Property name="dataSet">dsMain</Property>
                <Property name="cols">*,*,*</Property>
                <Property name="labelAlign">right</Property>
                <Property name="labelWidth">100</Property>
                <Property name="labelSeparator">:</Property>
                <AutoFormElement>
                  <Property name="name">jjlx</Property>
                  <Property name="property">jjlx</Property>
                  <Editor>
                    <RadioGroup>
                      <RadioButton>
                        <Property name="text">称重入库</Property>
                        <Property name="value">0</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="value">1</Property>
                        <Property name="text">标准包入库</Property>
                      </RadioButton>
                    </RadioGroup>
                  </Editor>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">bzw</Property>
                  <Property name="property">bzw</Property>
                  <Editor>
                    <RadioGroup>
                      <RadioButton>
                        <Property name="text">包</Property>
                        <Property name="value">1</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="text">桶</Property>
                        <Property name="value">2</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="text">箱</Property>
                        <Property name="value">3</Property>
                      </RadioButton>
                      <RadioButton>
                        <Property name="value">9</Property>
                        <Property name="text">其他</Property>
                      </RadioButton>
                    </RadioGroup>
                  </Editor>
                </AutoFormElement>
                <AutoFormElement>
                  <Property name="name">price</Property>
                  <Property name="property">price</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <ClientEvent name="onBlur">//id 规则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                  <Property name="name">dbz</Property>
                  <Property name="property">dbz</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <ClientEvent name="onBlur">//id 规则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                  <Property name="name">bzbjs</Property>
                  <Property name="property">bzbjs</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement layoutConstraint="colSpan:1">
                  <Property name="name">netWeight</Property>
                  <Property name="property">netWeight</Property>
                  <Property name="readOnly">true</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement>
                  <ClientEvent name="onBlur">//id 规则 d_prop&#xD;
var id = self.getDom().id;&#xD;
var prop = id.substring(2,id.length);&#xD;
deAutoByWeight(prop);</ClientEvent>
                  <Property name="name">dePackage</Property>
                  <Property name="property">dePackage</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement layoutConstraint="colSpan:1">
                  <Property name="name">settleWeight</Property>
                  <Property name="property">settleWeight</Property>
                  <Property name="readOnly">true</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement layoutConstraint="colSpan:1">
                  <Property name="name">recordWeight</Property>
                  <Property name="property">recordWeight</Property>
                  <Property name="readOnly">true</Property>
                  <Editor/>
                </AutoFormElement>
                <AutoFormElement layoutConstraint="colSpan:3">
                  <Property name="name">remarks</Property>
                  <Property name="property">remarks</Property>
                  <Editor/>
                </AutoFormElement>
              </AutoForm>
            </Children>
          </FieldSet>
        </Container>
      </ControlTab>
    </TabControl>
    <YearDropDown id="yearDropDown"/>
    <UpdateAction id="uaSave">
      <Property name="dataResolver">inoutDataPR#saveInoutData</Property>
      <Property name="confirmMessage">确定要提交么?</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
        <Property name="validateData">false</Property>
      </UpdateItem>
    </UpdateAction>
    <CustomDropDown id="ddDicArea">
      <Property name="minHeight">500</Property>
      <Property name="minWidth">500</Property>
      <Property name="assignmentMap">foodLocation=name,foodLocationId=code</Property>
      <Container layout="regionPadding:5">
        <DataSet id="dsDicArea">
          <Property name="dataProvider">dicAreaPR#pageList</Property>
          <Property name="parameter"></Property>
          <Property name="dataType">[dtArea]</Property>
          <Property name="pageSize">1000</Property>
        </DataSet>
        <Container layout="hbox regionPadding:5">
          <TextEditor id="key2">
            <Property name="blankText"> -名称或简拼,北京市  bjs -</Property>
            <Property name="width">200</Property>
          </TextEditor>
          <Button>
            <ClientEvent name="onClick">var key = view.get(&quot;#key2.value&quot;);&#xD;
view.get(&quot;#dsDicArea&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();</ClientEvent>
            <Property name="caption">查询</Property>
            <Property name="iconClass">fa fa-search</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">var data = view.get(&quot;#dsDicArea.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddDicArea&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
            <Property name="iconClass">fa fa-check</Property>
            <Property name="caption">确定</Property>
          </Button>
        </Container>
        <DataGrid>
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsDicArea.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddDicArea&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
          <Property name="dataSet">dsDicArea</Property>
          <Property name="readOnly">true</Property>
          <DataColumn name="name">
            <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
            <Property name="property">name</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="code">
            <Property name="property">code</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="simple">
            <Property name="property">simple</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
        </DataGrid>
        <DataPilot layoutConstraint="bottom">
          <Property name="dataSet">dsDicArea</Property>
        </DataPilot>
      </Container>
    </CustomDropDown>
    <CustomDropDown id="ddNotice">
      <Property name="minHeight">400</Property>
      <Property name="assignmentMap">noticeId=id,customerName=customerName</Property>
      <Property name="minWidth">1000</Property>
      <Property name="autoOpen">true</Property>
      <Container layout="regionPadding:5">
        <DataSet id="dsNotice">
          <Property name="dataProvider">inoutNoticePR#queryNoticeByKey</Property>
          <Property name="parameter">
            <Entity>
              <Property name="type">${request.getParameter('type')}</Property>
            </Entity>
          </Property>
          <Property name="dataType">[dtNoticeDto]</Property>
        </DataSet>
        <Container layout="hbox regionPadding:5">
          <TextEditor id="key3">
            <Property name="blankText"> -- 客户名称或编码 --</Property>
            <Property name="width">200</Property>
          </TextEditor>
          <Button>
            <ClientEvent name="onClick">var key = view.get(&quot;#key3.value&quot;);&#xD;
var type = &quot;${request.getParameter('type')}&quot;;&#xD;
view.get(&quot;#dsNotice&quot;).set(&quot;parameter&quot;,{key: key,type: type}).flushAsync();</ClientEvent>
            <Property name="caption">查询</Property>
            <Property name="iconClass">fa fa-search</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">var data = view.get(&quot;#dsNotice.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddNotice&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
            <Property name="iconClass">fa fa-check</Property>
            <Property name="caption">确定</Property>
          </Button>
        </Container>
        <DataGrid>
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsNotice.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#ddNotice&quot;).close(data.toJSON());&#xD;
}</ClientEvent>
          <Property name="dataSet">dsNotice</Property>
          <Property name="readOnly">true</Property>
          <DataColumn name="name">
            <Property name="property">name</Property>
            <Property name="align">center</Property>
            <Property name="width">100</Property>
          </DataColumn>
          <DataColumn>
            <Property name="property">customerName</Property>
            <Property name="align">center</Property>
            <Property name="name">customerName</Property>
            <Property name="width">240</Property>
          </DataColumn>
          <DataColumn name="foodVariety">
            <Property name="property">foodVariety</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="year">
            <Property name="property">year</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="depotId">
            <Property name="property">depotId</Property>
            <Property name="align">center</Property>
            <Property name="width">180</Property>
          </DataColumn>
          <DataColumn name="contractName">
            <Property name="property">contractName</Property>
            <Property name="align">center</Property>
            <Property name="width">300</Property>
          </DataColumn>
        </DataGrid>
      </Container>
    </CustomDropDown>
  </View>
</ViewConfig>