apply-clients 3.5.4-83 → 3.5.4-85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/build/dev-server.js +5 -9
  2. package/package.json +3 -3
  3. package/src/App.vue +25 -25
  4. package/src/applyAndroid.js +72 -72
  5. package/src/components/android/AppTakePic.vue +182 -181
  6. package/src/components/android/Process/Processes/AppChargeManagement.vue +635 -635
  7. package/src/components/android/Process/Processes/AppChargeManagementNew.vue +630 -635
  8. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1 -1
  9. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  10. package/src/components/product/Process/ExplorationSelect.vue +497 -497
  11. package/src/components/product/Process/Processes/InstallationDetails.vue +1 -1
  12. package/src/components/product/Process/Processes/chargeManagement.vue +656 -656
  13. package/src/filiale/baiyin/android/ByDeviceManagement.vue +916 -916
  14. package/src/filiale/fugou/android/AppAddMaterialScience.vue +448 -448
  15. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  16. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
  17. package/src/filiale/fugou/android/AppServiceControl.vue +1845 -1843
  18. package/src/filiale/fugou/android/AppZhihuanManagement.vue +197 -191
  19. package/src/filiale/fugou/android/printCharge.vue +162 -0
  20. package/src/filiale/fugou/android.js +16 -15
  21. package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
  22. package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1703
  23. package/src/filiale/fugou/pc/ServiceView.vue +941 -941
  24. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  25. package/src/filiale/fugou/pc/printChargepc.vue +148 -0
  26. package/src/filiale/fugou/pc.js +14 -13
  27. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  28. package/src/filiale/jinhuang/pc/ServiceControl.vue +1925 -1925
  29. package/src/filiale/jinhuang/pc/addressAndUserinfoManagement.vue +203 -203
  30. package/src/filiale/jinhuang/pc/chargeManagementNew.vue +589 -589
  31. package/src/filiale/jinhuang/pc.js +8 -8
  32. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  33. package/src/filiale/qianneng/android.js +15 -15
  34. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -0
  35. package/src/filiale/qianneng/pc/Applydetail.vue +378 -378
  36. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  37. package/src/filiale/qianneng/pc.js +29 -28
  38. package/src/filiale/siyangRH/android/AppAddMaterialScience.vue +466 -466
  39. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +527 -527
  40. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +639 -639
  41. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1681 -1681
  42. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +548 -548
  43. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2075 -2075
  44. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1059 -1059
  45. package/src/filiale/yongzhouch/pc/ApplyUpload.vue +327 -327
  46. package/src/filiale/yongzhouch/pc/ExplorationSelect.vue +490 -490
  47. package/src/filiale/yongzhouch/pc/InstallationDetails.vue +610 -610
  48. package/src/filiale/yongzhouch/pc/ServiceControl.vue +1943 -1943
  49. package/src/filiale/yongzhouch/pc/devicesManagement.vue +488 -488
  50. package/src/filiale/yongzhouch/pc.js +10 -10
  51. package/src/main.js +23 -23
@@ -1,466 +1,466 @@
1
- <template>
2
- <div>
3
- <data-grid :model="onetomany" class="list_area table_sy">
4
- <template partial='head'>
5
- <tr>
6
- <th class="textNoLineBreak">名称</th>
7
- <th class="textNoLineBreak">单价</th>
8
- <th class="textNoLineBreak">计划数量</th>
9
- <th class="textNoLineBreak">领用数量</th>
10
- <th class="textNoLineBreak">使用数量</th>
11
- <th class="textNoLineBreak">
12
- <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加
13
- </button>
14
- </th>
15
- </tr>
16
- </template>
17
- <template partial='body'>
18
- <tr>
19
- <td style="text-align: center;">
20
- <nobr>{{row.f_material_name}}-{{row.f_material_style}}</nobr>
21
- </td>
22
- <td style="text-align: center;">
23
- <nobr>{{row.f_material_price}}</nobr>
24
- </td>
25
-
26
- <td style="text-align: center;">
27
- <nobr>{{row.f_material_number}}</nobr>
28
- </td>
29
- <td style="text-align: center;">
30
- <nobr>{{row.f_ly_material_number}}</nobr>
31
- </td>
32
- <td style="text-align: center;">
33
- <nobr>{{row.f_use_material_number}}</nobr>
34
- </td>
35
- <td style="text-align: center;">
36
- <button type="button" class="button_search button_spacing"
37
- @click="$parent.$parent.updateMaterial($index,row)">修改
38
- </button>
39
- <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除
40
- </button>
41
- </td>
42
- </tr>
43
- </template>
44
- </data-grid>
45
- <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
46
- :backdrop="false" :title="title">
47
- <header slot="modal-header" class="modal-header">
48
- <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
49
- <h4 class="modal-title">{{title}}</h4>
50
- </header>
51
- <article slot="modal-body" class="modal-body clearfix">
52
- <div v-for="(i, item) in materials" class="form-group col-sm-12 panel panel-info">
53
- <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff; margin-bottom: 10px">
54
- <div class="col-sm-6 text-left">材料{{$index + 1}}信息</div>
55
- <div class="col-sm-6 text-right">
56
- <button
57
- class="button_delete button_spacing"
58
- @click.prevent="deleteDevicesinfo(i)"
59
- v-if="title === '新增'"
60
- >删除
61
- </button>
62
- </div>
63
- </div>
64
- <div class="row">
65
- <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']" >
66
- <label class="col-sm-4 control-label">选择材料:</label>
67
- <div class="col-sm-8">
68
- <input-select
69
- class="select select_list"
70
- :value.sync="item.material"
71
- v-model="item.material"
72
- :options="meterialOptions"
73
- :disable="mark == 1"
74
- @change="modifyOtherValue(i)"
75
- :valueSingle="true"
76
- ></input-select>
77
- </div>
78
- </div>
79
- <div class="form-group col-sm-6" :class="[item.f_material_price ? '' : 'has-error']" >
80
- <label class="col-sm-4 control-label">材料单价:</label>
81
- <div class="col-sm-8">
82
- <input class="form-control input_view" type="text"
83
- placeholder="材料单价"
84
- v-model="item.f_material_price"
85
- :value="item.f_material_price"
86
- disabled="true"
87
- />
88
- </div>
89
- </div>
90
- <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']" v-if="false">
91
- <div class="col-sm-8">
92
- <input class="form-control input_view" type="text"
93
- placeholder="材料名称"
94
- v-model="item.f_material_name"
95
- :value="item.f_material_name"
96
- />
97
- </div>
98
- </div>
99
- </div>
100
- <div class="row">
101
- <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']" v-if="false">
102
- <div class="col-sm-8">
103
- <input class="form-control input_view" type="text"
104
- placeholder="材料型号"
105
- v-model="item.f_material_style"
106
- :value="item.f_material_style"
107
- />
108
- </div>
109
- </div>
110
- <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']" v-if="false">
111
- <div class="col-sm-8">
112
- <input class="form-control input_view" type="text"
113
- placeholder="材料单位"
114
- v-model="item.f_material_unit"
115
- :value="item.f_material_unit"
116
- />
117
- </div>
118
- </div>
119
- </div>
120
- <div class="row">
121
- <div class="form-group col-sm-6" >
122
- <label class="col-sm-4 control-label">计划数量:</label>
123
- <div class="col-sm-8">
124
- <input class="form-control input_view" type="number"
125
- placeholder="计划材料数量"
126
- v-model="item.f_material_number"
127
- :value="item.f_material_number"
128
- />
129
- </div>
130
- </div>
131
- <div class="form-group col-sm-6">
132
- <label class="col-sm-4 control-label">领用数量:</label>
133
- <div class="col-sm-8">
134
- <input class="form-control input_view" type="number"
135
- placeholder="领用材料数量"
136
- v-model="item.f_ly_material_number"
137
- :value="item.f_ly_material_number"
138
- />
139
- </div>
140
- </div>
141
- </div>
142
- <div class="row">
143
- <div class="form-group col-sm-6">
144
- <label class="col-sm-4 control-label">使用数量:</label>
145
- <div class="col-sm-8">
146
- <input class="form-control input_view" type="number"
147
- placeholder="使用材料数量"
148
- v-model="item.f_use_material_number"
149
- :value="item.f_use_material_number"
150
- />
151
- </div>
152
- </div>
153
- <div class="form-group col-sm-6" v-if=" (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建')">
154
- <app-qrcode-reader :istype="fmaterialname" :index="i" v-show="isShow[i]"></app-qrcode-reader>
155
- </div>
156
- </div>
157
- </div>
158
- </article>
159
- <footer slot="modal-footer" class="modal-footer">
160
- <template v-if="mark !== 1">
161
- <button type="button" class="btn btn-primary" v-if="title === '新增'" @click="pushMaterial()">添加材料</button>
162
- <button type="button" class="btn btn-primary" v-if="title === '新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
163
- <button type="button" class="btn btn-primary" v-if="title === '修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
164
- </template>
165
- </footer>
166
- </modal>
167
- </div>
168
- </template>
169
-
170
- <script>
171
- import Vue from 'vue'
172
- import {HttpResetClass} from 'vue-client'
173
- export default {
174
- name: 'addMaterialScience',
175
- props: {
176
- selectdata: {
177
- type: Object
178
- }
179
- },
180
- data() {
181
- return {
182
- onetomany: {
183
- rows: []
184
- },
185
- title: '新增',
186
- showMaterialModal: false,
187
- materials: [
188
- {
189
- material: '',
190
- f_material_name: '',
191
- f_material_style: '',
192
- f_material_unit: '',
193
- f_material_number:'',
194
- f_bjq_sid: '',
195
- f_material_code: '',
196
- f_userinfo_code:'',
197
- f_ly_material_number:'',
198
- f_use_material_number:'',
199
- f_material_price:''
200
- }
201
- ],
202
- meterialOptions: [],
203
- row: {},
204
- bjqChecklag:[],
205
- fmaterialname:{},
206
- isShow:[false]
207
- }
208
- },
209
- ready() {
210
- this.getOnetoManyData()
211
- },
212
- methods: {
213
- async getOnetoManyData () {
214
- let http = new HttpResetClass()
215
- let data = {
216
- tablename: `t_material_apply`,
217
- condition: `f_process_id='${this.selectdata.f_process_id}'`
218
- }
219
- let res = await http.load(
220
- 'POST',
221
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable?aaa=123`,
222
- {data: data},
223
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
224
- )
225
- this.onetomany.rows = res.data
226
- },
227
- async openMaterialModal() {
228
- this.getMateralNames()
229
- this.title = '新增'
230
- this.materials = [
231
- {
232
- material: '',
233
- f_material_name: '',
234
- f_material_style: '',
235
- f_material_unit: '',
236
- f_material_number:'',
237
- f_bjq_sid: '',
238
- f_material_code: '',
239
- f_userinfo_code: '',
240
- f_ly_material_number:'',
241
- f_use_material_number:'',
242
- f_material_price:''
243
- }
244
- ],
245
- this.showMaterialModal = true
246
- this.isShow = [false]
247
- },
248
- deleteDevicesinfo(index) {
249
- this.materials.splice(index, 1)
250
- this.isShow.splice(index, 1)
251
- },
252
- pushMaterial() {
253
- this.materials.push({
254
- material: '',
255
- f_material_name: '',
256
- f_material_style: '',
257
- f_material_unit: '',
258
- f_material_number:'',
259
- f_bjq_sid: '',
260
- f_material_code: '',
261
- f_userinfo_code: '',
262
- f_ly_material_number:'',
263
- f_use_material_number:'',
264
- f_material_price:''
265
- })
266
- this.isShow.push(false)
267
- },
268
- // 获取模态框材料
269
- async getMateralNames() {
270
- let data = {
271
- condition: `1=1`
272
- }
273
- let http = new HttpResetClass()
274
- let res = await http.load(
275
- 'POST',
276
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
277
- {data: data},
278
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
279
- )
280
-
281
- this.meterialOptions = res.data.map(item => {
282
- return {
283
- 'label': `${item.f_material_name}--${item.f_material_style}`,
284
- 'value': item
285
- }
286
- })
287
- },
288
- modifyOtherValue(index) {
289
- console.log("进来了", index)
290
- console.log("dddd", this.materials[index].material)
291
- let material = this.materials[index].material
292
- this.materials[index].f_material_name = material.f_material_name
293
- this.materials[index].f_material_style = material.f_material_style
294
- this.materials[index].f_material_unit = material.f_material_unit
295
- this.materials[index].f_material_number = material.f_material_number
296
- this.materials[index].f_ly_material_number= material.f_ly_material_number
297
- this.materials[index].f_use_material_number= material.f_use_material_number
298
- this.materials[index].f_material_price = material.f_material_price
299
- this.materials[index].f_material_code = material.f_material_code
300
- this.materials[index].f_userinfo_code = material.f_userinfo_code
301
- if (material.f_material_name === "报警器-汉威") {
302
- this.isShow[index] = true
303
- } else {
304
- this.isShow[index] = false
305
- }
306
- this.isShow.splice(0, 1, this.isShow[0])
307
- },
308
- // 新增材料
309
- async addMaterial() {
310
- this.title = '新增'
311
- //遍历this.materials
312
- for (let i = 0; i < this.materials.length; i++) {
313
- if (this.materials[i].material === '') {
314
- this.$showMessage('请选择材料!!!')
315
- return
316
- }
317
- if(this.materials[i].f_use_material_number==''){
318
- this.materials[i].f_use_material_number=0
319
- }
320
- if(this.materials[i].f_ly_material_number==''){
321
- this.materials[i].f_ly_material_number=0
322
- }
323
- if(this.materials[i].f_material_number==''){
324
- this.materials[i].f_material_number=0
325
- }
326
- }
327
- let data = {
328
- f_process_id: this.selectdata.f_process_id,
329
- f_operator_id: Vue.user.id,
330
- f_operator: Vue.user.name,
331
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
332
- f_orgid: Vue.user.orgid,
333
- f_orgname: Vue.user.orgs,
334
- materials: this.materials
335
- }
336
-
337
- //报警器流程 设备编号检验
338
- await this.bjqCheck()
339
- if (this.bjqChecklag.length > 0) {
340
- return
341
- }
342
-
343
- let http = new HttpResetClass()
344
- let res = await http.load(
345
- 'POST',
346
- `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterials`,
347
- data
348
- )
349
- this.closeMaterials()
350
- },
351
- async deleteMaterial(row) {
352
- var show1 = window.confirm('您确定要删除这条记录吗?')
353
- if(show1 != true){
354
- this.closeMaterials()
355
- }else{
356
- let http = new HttpResetClass()
357
- let res = await http.load(
358
- 'POST',
359
- `${this.$androidUtil.getProxyUrl()}/rs/logic/deleteMaterial`,
360
- {data: row},
361
- {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
362
- )
363
- this.closeMaterials()
364
- }
365
- }
366
- ,
367
- async updateMaterial(index, row) {
368
- this.title = '修改'
369
- this.row = row
370
- this.getMateralNames()
371
- this.materials = [
372
- {
373
- material: "",
374
- f_material_name: row.f_material_name,
375
- f_material_style: row.f_material_style,
376
- f_material_unit: row.f_material_unit,
377
- f_material_number: row.f_material_number,
378
- f_ly_material_number:row.f_ly_material_number,
379
- f_use_material_number:row.f_use_material_number,
380
- f_material_price:row.f_material_price,
381
- f_material_code: row.f_material_code,
382
- f_bjq_sid: row.f_bjq_sid,
383
- f_userinfo_code: row.f_userinfo_code
384
- }
385
- ]
386
- this.showMaterialModal = true
387
- },
388
- async updateConfirm() {
389
- let data = this.row
390
- data.f_material_name = this.materials[0].f_material_name
391
- data.f_material_style = this.materials[0].f_material_style
392
- data.f_material_unit = this.materials[0].f_material_unit
393
- data.f_material_number = this.materials[0].f_material_number
394
- data.f_ly_material_number = this.materials[0].f_ly_material_number
395
- data.f_use_material_number= this.materials[0].f_use_material_number
396
- data.f_material_price = this.materials[0].f_material_price
397
- data.f_material_code = this.materials[0].f_material_code
398
- data.f_bjq_sid = this.materials[0].f_bjq_sid
399
- data.f_userinfo_code=this.materials[0].f_userinfo_code
400
- if(Number(data.f_ly_material_number)>Number(data.f_material_number)){
401
- this.$showMessage('领料数量不能大于计划数量!!!')
402
- return '领料数量不能大于计划数量'
403
- }
404
- if(Number(data.f_use_material_number)>Number(data.f_ly_material_number)){
405
- this.$showMessage('使用量不能大于领料数量!!!')
406
- return '使用量数量不能大于领料数量'
407
- }
408
- //报警器流程 设备编号检验
409
- await this.bjqCheck()
410
- if (this.bjqChecklag.length > 0){
411
- return
412
- }
413
-
414
- let http = new HttpResetClass()
415
- let res = await http.load(
416
- 'POST',
417
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_apply`,
418
- data
419
- )
420
- this.closeMaterials()
421
- },
422
- sycronizedCode(index,val){
423
- console.log("看看:",index,val)
424
- this.materials[index].f_material_code = val
425
- },
426
- closeMaterials() {
427
- this.getOnetoManyData()
428
- this.showMaterialModal = false
429
- },
430
- async bjqCheck(){
431
- //报警器设备型号校验
432
- this.bjqChecklag = [] //初始化
433
- if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
434
- let bjqinfo = {
435
- f_material_name : "",
436
- f_bjq_sid: ""
437
- }
438
- for (const bjqinfoElement of this.materials) {
439
- bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
440
- bjqinfo.f_material_name = bjqinfoElement.f_material_name
441
- if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
442
- let http = new HttpResetClass()
443
- let res = await http.load(
444
- 'POST',
445
- // `/rs/logic/bjqcheck`,
446
- `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqcheck`,
447
- bjqinfo
448
- )
449
- if (res.data.code != 200){
450
- this.bjqChecklag.push(res.data.code)
451
- //this.$showMessage(res.data.msg)
452
- Vue.showAlert(res.data.msg, 'danger', 6000)
453
- return
454
- }
455
- }
456
- }
457
- }
458
- }
459
- }
460
- }
461
-
462
- </script>
463
-
464
- <style scoped>
465
-
466
- </style>
1
+ <template>
2
+ <div>
3
+ <data-grid :model="onetomany" class="list_area table_sy">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">名称</th>
7
+ <th class="textNoLineBreak">单价</th>
8
+ <th class="textNoLineBreak">计划数量</th>
9
+ <th class="textNoLineBreak">领用数量</th>
10
+ <th class="textNoLineBreak">使用数量</th>
11
+ <th class="textNoLineBreak">
12
+ <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加
13
+ </button>
14
+ </th>
15
+ </tr>
16
+ </template>
17
+ <template partial='body'>
18
+ <tr>
19
+ <td style="text-align: center;">
20
+ <nobr>{{row.f_material_name}}-{{row.f_material_style}}</nobr>
21
+ </td>
22
+ <td style="text-align: center;">
23
+ <nobr>{{row.f_material_price}}</nobr>
24
+ </td>
25
+
26
+ <td style="text-align: center;">
27
+ <nobr>{{row.f_material_number}}</nobr>
28
+ </td>
29
+ <td style="text-align: center;">
30
+ <nobr>{{row.f_ly_material_number}}</nobr>
31
+ </td>
32
+ <td style="text-align: center;">
33
+ <nobr>{{row.f_use_material_number}}</nobr>
34
+ </td>
35
+ <td style="text-align: center;">
36
+ <button type="button" class="button_search button_spacing"
37
+ @click="$parent.$parent.updateMaterial($index,row)">修改
38
+ </button>
39
+ <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除
40
+ </button>
41
+ </td>
42
+ </tr>
43
+ </template>
44
+ </data-grid>
45
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
46
+ :backdrop="false" :title="title">
47
+ <header slot="modal-header" class="modal-header">
48
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
49
+ <h4 class="modal-title">{{title}}</h4>
50
+ </header>
51
+ <article slot="modal-body" class="modal-body clearfix">
52
+ <div v-for="(i, item) in materials" class="form-group col-sm-12 panel panel-info">
53
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff; margin-bottom: 10px">
54
+ <div class="col-sm-6 text-left">材料{{$index + 1}}信息</div>
55
+ <div class="col-sm-6 text-right">
56
+ <button
57
+ class="button_delete button_spacing"
58
+ @click.prevent="deleteDevicesinfo(i)"
59
+ v-if="title === '新增'"
60
+ >删除
61
+ </button>
62
+ </div>
63
+ </div>
64
+ <div class="row">
65
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']" >
66
+ <label class="col-sm-4 control-label">选择材料:</label>
67
+ <div class="col-sm-8">
68
+ <input-select
69
+ class="select select_list"
70
+ :value.sync="item.material"
71
+ v-model="item.material"
72
+ :options="meterialOptions"
73
+ :disable="mark == 1"
74
+ @change="modifyOtherValue(i)"
75
+ :valueSingle="true"
76
+ ></input-select>
77
+ </div>
78
+ </div>
79
+ <div class="form-group col-sm-6" :class="[item.f_material_price ? '' : 'has-error']" >
80
+ <label class="col-sm-4 control-label">材料单价:</label>
81
+ <div class="col-sm-8">
82
+ <input class="form-control input_view" type="text"
83
+ placeholder="材料单价"
84
+ v-model="item.f_material_price"
85
+ :value="item.f_material_price"
86
+ disabled="true"
87
+ />
88
+ </div>
89
+ </div>
90
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']" v-if="false">
91
+ <div class="col-sm-8">
92
+ <input class="form-control input_view" type="text"
93
+ placeholder="材料名称"
94
+ v-model="item.f_material_name"
95
+ :value="item.f_material_name"
96
+ />
97
+ </div>
98
+ </div>
99
+ </div>
100
+ <div class="row">
101
+ <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']" v-if="false">
102
+ <div class="col-sm-8">
103
+ <input class="form-control input_view" type="text"
104
+ placeholder="材料型号"
105
+ v-model="item.f_material_style"
106
+ :value="item.f_material_style"
107
+ />
108
+ </div>
109
+ </div>
110
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']" v-if="false">
111
+ <div class="col-sm-8">
112
+ <input class="form-control input_view" type="text"
113
+ placeholder="材料单位"
114
+ v-model="item.f_material_unit"
115
+ :value="item.f_material_unit"
116
+ />
117
+ </div>
118
+ </div>
119
+ </div>
120
+ <div class="row">
121
+ <div class="form-group col-sm-6" >
122
+ <label class="col-sm-4 control-label">计划数量:</label>
123
+ <div class="col-sm-8">
124
+ <input class="form-control input_view" type="number"
125
+ placeholder="计划材料数量"
126
+ v-model="item.f_material_number"
127
+ :value="item.f_material_number"
128
+ />
129
+ </div>
130
+ </div>
131
+ <div class="form-group col-sm-6">
132
+ <label class="col-sm-4 control-label">领用数量:</label>
133
+ <div class="col-sm-8">
134
+ <input class="form-control input_view" type="number"
135
+ placeholder="领用材料数量"
136
+ v-model="item.f_ly_material_number"
137
+ :value="item.f_ly_material_number"
138
+ />
139
+ </div>
140
+ </div>
141
+ </div>
142
+ <div class="row">
143
+ <div class="form-group col-sm-6">
144
+ <label class="col-sm-4 control-label">使用数量:</label>
145
+ <div class="col-sm-8">
146
+ <input class="form-control input_view" type="number"
147
+ placeholder="使用材料数量"
148
+ v-model="item.f_use_material_number"
149
+ :value="item.f_use_material_number"
150
+ />
151
+ </div>
152
+ </div>
153
+ <div class="form-group col-sm-6" v-if=" (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建')">
154
+ <app-qrcode-reader :istype="fmaterialname" :index="i" v-show="isShow[i]"></app-qrcode-reader>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ </article>
159
+ <footer slot="modal-footer" class="modal-footer">
160
+ <template v-if="mark !== 1">
161
+ <button type="button" class="btn btn-primary" v-if="title === '新增'" @click="pushMaterial()">添加材料</button>
162
+ <button type="button" class="btn btn-primary" v-if="title === '新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
163
+ <button type="button" class="btn btn-primary" v-if="title === '修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
164
+ </template>
165
+ </footer>
166
+ </modal>
167
+ </div>
168
+ </template>
169
+
170
+ <script>
171
+ import Vue from 'vue'
172
+ import {HttpResetClass} from 'vue-client'
173
+ export default {
174
+ name: 'addMaterialScience',
175
+ props: {
176
+ selectdata: {
177
+ type: Object
178
+ }
179
+ },
180
+ data() {
181
+ return {
182
+ onetomany: {
183
+ rows: []
184
+ },
185
+ title: '新增',
186
+ showMaterialModal: false,
187
+ materials: [
188
+ {
189
+ material: '',
190
+ f_material_name: '',
191
+ f_material_style: '',
192
+ f_material_unit: '',
193
+ f_material_number:'',
194
+ f_bjq_sid: '',
195
+ f_material_code: '',
196
+ f_userinfo_code:'',
197
+ f_ly_material_number:'',
198
+ f_use_material_number:'',
199
+ f_material_price:''
200
+ }
201
+ ],
202
+ meterialOptions: [],
203
+ row: {},
204
+ bjqChecklag:[],
205
+ fmaterialname:{},
206
+ isShow:[false]
207
+ }
208
+ },
209
+ ready() {
210
+ this.getOnetoManyData()
211
+ },
212
+ methods: {
213
+ async getOnetoManyData () {
214
+ let http = new HttpResetClass()
215
+ let data = {
216
+ tablename: `t_material_apply`,
217
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
218
+ }
219
+ let res = await http.load(
220
+ 'POST',
221
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable?aaa=123`,
222
+ {data: data},
223
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
224
+ )
225
+ this.onetomany.rows = res.data
226
+ },
227
+ async openMaterialModal() {
228
+ this.getMateralNames()
229
+ this.title = '新增'
230
+ this.materials = [
231
+ {
232
+ material: '',
233
+ f_material_name: '',
234
+ f_material_style: '',
235
+ f_material_unit: '',
236
+ f_material_number:'',
237
+ f_bjq_sid: '',
238
+ f_material_code: '',
239
+ f_userinfo_code: '',
240
+ f_ly_material_number:'',
241
+ f_use_material_number:'',
242
+ f_material_price:''
243
+ }
244
+ ],
245
+ this.showMaterialModal = true
246
+ this.isShow = [false]
247
+ },
248
+ deleteDevicesinfo(index) {
249
+ this.materials.splice(index, 1)
250
+ this.isShow.splice(index, 1)
251
+ },
252
+ pushMaterial() {
253
+ this.materials.push({
254
+ material: '',
255
+ f_material_name: '',
256
+ f_material_style: '',
257
+ f_material_unit: '',
258
+ f_material_number:'',
259
+ f_bjq_sid: '',
260
+ f_material_code: '',
261
+ f_userinfo_code: '',
262
+ f_ly_material_number:'',
263
+ f_use_material_number:'',
264
+ f_material_price:''
265
+ })
266
+ this.isShow.push(false)
267
+ },
268
+ // 获取模态框材料
269
+ async getMateralNames() {
270
+ let data = {
271
+ condition: `1=1`
272
+ }
273
+ let http = new HttpResetClass()
274
+ let res = await http.load(
275
+ 'POST',
276
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
277
+ {data: data},
278
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
279
+ )
280
+
281
+ this.meterialOptions = res.data.map(item => {
282
+ return {
283
+ 'label': `${item.f_material_name}--${item.f_material_style}`,
284
+ 'value': item
285
+ }
286
+ })
287
+ },
288
+ modifyOtherValue(index) {
289
+ console.log("进来了", index)
290
+ console.log("dddd", this.materials[index].material)
291
+ let material = this.materials[index].material
292
+ this.materials[index].f_material_name = material.f_material_name
293
+ this.materials[index].f_material_style = material.f_material_style
294
+ this.materials[index].f_material_unit = material.f_material_unit
295
+ this.materials[index].f_material_number = material.f_material_number
296
+ this.materials[index].f_ly_material_number= material.f_ly_material_number
297
+ this.materials[index].f_use_material_number= material.f_use_material_number
298
+ this.materials[index].f_material_price = material.f_material_price
299
+ this.materials[index].f_material_code = material.f_material_code
300
+ this.materials[index].f_userinfo_code = material.f_userinfo_code
301
+ if (material.f_material_name === "报警器-汉威") {
302
+ this.isShow[index] = true
303
+ } else {
304
+ this.isShow[index] = false
305
+ }
306
+ this.isShow.splice(0, 1, this.isShow[0])
307
+ },
308
+ // 新增材料
309
+ async addMaterial() {
310
+ this.title = '新增'
311
+ //遍历this.materials
312
+ for (let i = 0; i < this.materials.length; i++) {
313
+ if (this.materials[i].material === '') {
314
+ this.$showMessage('请选择材料!!!')
315
+ return
316
+ }
317
+ if(this.materials[i].f_use_material_number==''){
318
+ this.materials[i].f_use_material_number=0
319
+ }
320
+ if(this.materials[i].f_ly_material_number==''){
321
+ this.materials[i].f_ly_material_number=0
322
+ }
323
+ if(this.materials[i].f_material_number==''){
324
+ this.materials[i].f_material_number=0
325
+ }
326
+ }
327
+ let data = {
328
+ f_process_id: this.selectdata.f_process_id,
329
+ f_operator_id: Vue.user.id,
330
+ f_operator: Vue.user.name,
331
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
332
+ f_orgid: Vue.user.orgid,
333
+ f_orgname: Vue.user.orgs,
334
+ materials: this.materials
335
+ }
336
+
337
+ //报警器流程 设备编号检验
338
+ await this.bjqCheck()
339
+ if (this.bjqChecklag.length > 0) {
340
+ return
341
+ }
342
+
343
+ let http = new HttpResetClass()
344
+ let res = await http.load(
345
+ 'POST',
346
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterials`,
347
+ data
348
+ )
349
+ this.closeMaterials()
350
+ },
351
+ async deleteMaterial(row) {
352
+ var show1 = window.confirm('您确定要删除这条记录吗?')
353
+ if(show1 != true){
354
+ this.closeMaterials()
355
+ }else{
356
+ let http = new HttpResetClass()
357
+ let res = await http.load(
358
+ 'POST',
359
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/deleteMaterial`,
360
+ {data: row},
361
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
362
+ )
363
+ this.closeMaterials()
364
+ }
365
+ }
366
+ ,
367
+ async updateMaterial(index, row) {
368
+ this.title = '修改'
369
+ this.row = row
370
+ this.getMateralNames()
371
+ this.materials = [
372
+ {
373
+ material: "",
374
+ f_material_name: row.f_material_name,
375
+ f_material_style: row.f_material_style,
376
+ f_material_unit: row.f_material_unit,
377
+ f_material_number: row.f_material_number,
378
+ f_ly_material_number:row.f_ly_material_number,
379
+ f_use_material_number:row.f_use_material_number,
380
+ f_material_price:row.f_material_price,
381
+ f_material_code: row.f_material_code,
382
+ f_bjq_sid: row.f_bjq_sid,
383
+ f_userinfo_code: row.f_userinfo_code
384
+ }
385
+ ]
386
+ this.showMaterialModal = true
387
+ },
388
+ async updateConfirm() {
389
+ let data = this.row
390
+ data.f_material_name = this.materials[0].f_material_name
391
+ data.f_material_style = this.materials[0].f_material_style
392
+ data.f_material_unit = this.materials[0].f_material_unit
393
+ data.f_material_number = this.materials[0].f_material_number
394
+ data.f_ly_material_number = this.materials[0].f_ly_material_number
395
+ data.f_use_material_number= this.materials[0].f_use_material_number
396
+ data.f_material_price = this.materials[0].f_material_price
397
+ data.f_material_code = this.materials[0].f_material_code
398
+ data.f_bjq_sid = this.materials[0].f_bjq_sid
399
+ data.f_userinfo_code=this.materials[0].f_userinfo_code
400
+ if(Number(data.f_ly_material_number)>Number(data.f_material_number)){
401
+ this.$showMessage('领料数量不能大于计划数量!!!')
402
+ return '领料数量不能大于计划数量'
403
+ }
404
+ if(Number(data.f_use_material_number)>Number(data.f_ly_material_number)){
405
+ this.$showMessage('使用量不能大于领料数量!!!')
406
+ return '使用量数量不能大于领料数量'
407
+ }
408
+ //报警器流程 设备编号检验
409
+ await this.bjqCheck()
410
+ if (this.bjqChecklag.length > 0){
411
+ return
412
+ }
413
+
414
+ let http = new HttpResetClass()
415
+ let res = await http.load(
416
+ 'POST',
417
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_apply`,
418
+ data
419
+ )
420
+ this.closeMaterials()
421
+ },
422
+ sycronizedCode(index,val){
423
+ console.log("看看:",index,val)
424
+ this.materials[index].f_material_code = val
425
+ },
426
+ closeMaterials() {
427
+ this.getOnetoManyData()
428
+ this.showMaterialModal = false
429
+ },
430
+ async bjqCheck(){
431
+ //报警器设备型号校验
432
+ this.bjqChecklag = [] //初始化
433
+ if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
434
+ let bjqinfo = {
435
+ f_material_name : "",
436
+ f_bjq_sid: ""
437
+ }
438
+ for (const bjqinfoElement of this.materials) {
439
+ bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
440
+ bjqinfo.f_material_name = bjqinfoElement.f_material_name
441
+ if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
442
+ let http = new HttpResetClass()
443
+ let res = await http.load(
444
+ 'POST',
445
+ // `/rs/logic/bjqcheck`,
446
+ `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqcheck`,
447
+ bjqinfo
448
+ )
449
+ if (res.data.code != 200){
450
+ this.bjqChecklag.push(res.data.code)
451
+ //this.$showMessage(res.data.msg)
452
+ Vue.showAlert(res.data.msg, 'danger', 6000)
453
+ return
454
+ }
455
+ }
456
+ }
457
+ }
458
+ }
459
+ }
460
+ }
461
+
462
+ </script>
463
+
464
+ <style scoped>
465
+
466
+ </style>