apply-clients 3.4.50 → 3.4.52

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