apply-clients 3.4.39 → 3.4.51

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