apply-clients 3.5.4-65 → 3.5.4-67

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 (49) hide show
  1. package/build/dev-server.js +9 -5
  2. package/package.json +1 -1
  3. package/src/App.vue +5 -5
  4. package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
  5. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  6. package/src/components/product/MaterialsManage/MaterialsBase.vue +181 -181
  7. package/src/components/product/MaterialsManage/MaterialsManage.vue +60 -60
  8. package/src/components/product/Process/Processes/chargeManagement.vue +656 -656
  9. package/src/components/product/ServiceView.vue +1026 -1025
  10. package/src/filiale/fugou/android/AppAddMaterialScience.vue +442 -442
  11. package/src/filiale/fugou/android/AppChargeManagement.vue +739 -739
  12. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  13. package/src/filiale/fugou/android.js +14 -14
  14. package/src/filiale/fugou/pc/ExplorationSelect.vue +515 -515
  15. package/src/filiale/fugou/pc/InstallationDetails.vue +647 -647
  16. package/src/filiale/fugou/pc/ServiceControl.vue +1702 -1702
  17. package/src/filiale/fugou/pc/addMaterialScience.vue +482 -482
  18. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  19. package/src/filiale/fugou/pc.js +10 -10
  20. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  21. package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -214
  22. package/src/filiale/gongyi/android/AppInstallationDetails.vue +500 -500
  23. package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -309
  24. package/src/filiale/gongyi/android/AppSign.vue +170 -157
  25. package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -298
  26. package/src/filiale/gongyi/android.js +18 -18
  27. package/src/filiale/gongyi/pc/ApplyUpload.vue +371 -378
  28. package/src/filiale/gongyi/pc/PcAddLogs.vue +221 -217
  29. package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -218
  30. package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -314
  31. package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +894 -894
  32. package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -1005
  33. package/src/filiale/gongyi/pc/addMaterialScience.vue +575 -564
  34. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -763
  35. package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -277
  36. package/src/filiale/gongyi/pc.js +24 -24
  37. package/src/filiale/hongda/pc/SupervisoryList.vue +422 -422
  38. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  39. package/src/filiale/qianneng/android.js +15 -15
  40. package/src/filiale/qianneng/pc/Applydetail.vue +378 -378
  41. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  42. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +526 -526
  43. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +639 -639
  44. package/src/filiale/yangchunboneng/android/AppInstallationMaterial.vue +2 -0
  45. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1681 -1681
  46. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +548 -548
  47. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2075 -2075
  48. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1058 -1058
  49. package/src/main.js +3 -3
@@ -1,564 +1,575 @@
1
- <template>
2
- <div >
3
- <export-excel :data="getConditions"
4
- :field="getfields"
5
- sqlurl="rs/logic/applyExportfile"
6
- sql-name="applyGetMaterial"
7
- template-name='材料信息导出'
8
- :choose-col="true"></export-excel>
9
- </div>
10
- <div>
11
- <data-grid :model="onetomany" class="list_area table_sy">
12
- <template partial='head'>
13
- <tr>
14
- <th class="textNoLineBreak">序号</th>
15
- <th class="textNoLineBreak">材料名称</th>
16
- <th class="textNoLineBreak">材料型号</th>
17
- <th class="textNoLineBreak">材料编码</th>
18
- <th class="textNoLineBreak">材料单位</th>
19
- <th class="textNoLineBreak">材料数量</th>
20
- <th class="textNoLineBreak">使用数量</th>
21
- <th class="textNoLineBreak">退库数量</th>
22
- <th class="textNoLineBreak">
23
- <button v-if="$parent.$parent.mark === 0" class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
24
- <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
25
- @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
26
- <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
27
- href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>
28
- </th>
29
- </tr>
30
- </template>
31
- <template partial='body'>
32
- <tr>
33
- <td style="text-align: center;">
34
- <nobr>{{$index+1}}</nobr>
35
- </td>
36
- <td style="text-align: center;">
37
- <nobr>{{row.f_material_name}}</nobr>
38
- </td>
39
- <td style="text-align: center;">
40
- <nobr>{{row.f_material_style}}</nobr>
41
- </td>
42
- <td style="text-align: center;">
43
- <nobr>{{row.f_material_code}}</nobr>
44
- </td>
45
- <td style="text-align: center;">
46
- <nobr>{{row.f_material_unit}}</nobr>
47
- </td>
48
- <td style="text-align: center;">
49
- <nobr>{{row.f_material_number}}</nobr>
50
- </td>
51
- <td style="text-align: center;">
52
- <nobr>{{row. f_use_number}}</nobr>
53
- </td>
54
- <td style="text-align: center;">
55
- <nobr>{{row. f_back_number}}</nobr>
56
- </td>
57
- <td style="text-align: center;">
58
- <button v-if="$parent.$parent.mark === 0" type="button" class="button_search button_spacing" @click="$parent.$parent.updateMaterial($index,row)">修改</button>
59
- <button v-if="$parent.$parent.mark === 0" type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除</button>
60
- </td>
61
- </tr>
62
- </template>
63
- </data-grid>
64
- <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
65
- <header slot="modal-header" class="modal-header">
66
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
67
- <h4 class="modal-title">选择文件</h4>
68
- </header>
69
- <article slot="modal-body" class="modal-body">
70
- <div class="form-group">
71
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
72
- </div>
73
- </article>
74
- <footer slot="modal-footer" class="modal-footer"></footer>
75
- </modal>
76
- <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
77
- :backdrop="false" :title="title">
78
- <header slot="modal-header" class="modal-header">
79
- <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
80
- <h4 class="modal-title">{{title}}</h4>
81
- </header>
82
- <article slot="modal-body" class="modal-body clearfix">
83
- <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
84
- <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
85
- <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
86
- <div class="col-sm-6 text-right"><button
87
- class="button_delete button_spacing"
88
- @click.prevent="deleteDevicesinfo(i)"
89
- v-if="title === '新增'"
90
- >删除</button></div>
91
- </div>
92
- <div class="form-group col-sm-6">
93
- <label class="col-sm-4 control-label">选择材料:</label>
94
- <div class="col-sm-8">
95
- <input-select
96
- class="select select_list"
97
- :value.sync="item.material"
98
- v-model="item.material"
99
- :options="meterialOptions"
100
- :disable="mark === 1"
101
- @change="modifyOtherValue(i)"
102
- :valueSingle="true"></input-select>
103
- </div>
104
- </div>
105
- <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
106
- <label class="col-sm-4 control-label">材料名称:</label>
107
- <div class="col-sm-8">
108
- <input class="form-control input_view" style="" type="text"
109
- placeholder="材料名称"
110
- v-model="item.f_material_name"
111
- :value="item.f_material_name"
112
- />
113
- </div>
114
- </div>
115
- <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']">
116
- <label class="col-sm-4 control-label">材料型号:</label>
117
- <div class="col-sm-8">
118
- <input class="form-control input_view" style="" type="text"
119
- placeholder="材料型号"
120
- v-model="item.f_material_style"
121
- :value="item.f_material_style"
122
- />
123
- </div>
124
- </div>
125
- <div class="form-group col-sm-6" :class="[item.f_material_code ? '' : 'has-error']">
126
- <label class="col-sm-4 control-label">材料编码:</label>
127
- <div class="col-sm-8">
128
- <input class="form-control input_view" style="" type="text"
129
- placeholder="材料编码"
130
- v-model="item.f_material_code"
131
- :value="item.f_material_code"
132
- />
133
- </div>
134
- </div>
135
- <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
136
- <label class="col-sm-4 control-label">材料单位:</label>
137
- <div class="col-sm-8">
138
- <input class="form-control input_view" style="" type="text"
139
- placeholder="材料单位"
140
- v-model="item.f_material_unit"
141
- :value="item.f_material_unit"
142
- />
143
- </div>
144
- </div>
145
- <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
146
- <label class="col-sm-4 control-label">材料数量:</label>
147
- <div class="col-sm-8">
148
- <input class="form-control input_view" style="" type="number"
149
- placeholder="材料数量"
150
- v-model="item.f_material_number"
151
- :value="item.f_material_number"
152
- />
153
- </div>
154
- </div>
155
- <div class="form-group col-sm-6">
156
- <label class="col-sm-4 control-label">使用数量:</label>
157
- <div class="col-sm-8">
158
- <input class="form-control input_view" style="" type="number"
159
- placeholder="使用数量"
160
- v-model="item.f_use_number"
161
- :value="item.f_use_number"
162
- />
163
- </div>
164
- </div>
165
-
166
- <div class="form-group col-sm-6">
167
- <label class="col-sm-4 control-label">退库数量:</label>
168
- <div class="col-sm-8">
169
- <input class="form-control input_view" style="" type="number"
170
- placeholder="退库数量"
171
- v-model="item.f_back_number"
172
- :value.sync="item.f_back_number"
173
- />
174
- </div>
175
- </div>
176
- <div class="form-group col-sm-6">
177
- <label class="col-sm-4 control-label">材料标识:</label>
178
- <div class="col-sm-8">
179
- <input class="form-control input_view" style=""
180
- placeholder="材料标识"
181
- v-model="item.f_material_code"
182
- :value.sync="item.f_material_code"
183
- />
184
- </div>
185
- </div>
186
- </div>
187
-
188
- </article>
189
- <footer slot="modal-footer" class="modal-footer">
190
- <template v-if="mark !== 1">
191
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
192
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
193
- <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
194
- </template>
195
- </footer>
196
- </modal>
197
- </div>
198
- </template>
199
-
200
- <script>
201
- import {HttpResetClass} from 'vue-client'
202
- import Vue from "vue";
203
- export default {
204
- name: 'addMaterialScience',
205
- props: {
206
- selectdata: {
207
- type: Object
208
- },
209
- mark: {
210
- type: Number,
211
- default: 0
212
- }
213
- },
214
- data () {
215
- return {
216
- showMaterial: false,
217
- showFile: false,
218
- Rematerials:[
219
- {
220
- f_return_number:"",
221
- material:'',
222
- f_material_name:'',
223
- f_material_style:'',
224
- f_material_unit:'',
225
- f_material_number:'',
226
- f_bjq_sid:'',
227
- f_material_code:'',
228
- f_userinfo_code:''
229
- }
230
- ],
231
- getfields:{
232
- 'id':'序号',
233
- 'f_material_name':'材料名称',
234
- 'f_material_style':'材料型号',
235
- 'f_material_number':'材料数量',
236
- 'f_use_number':'使用数量',
237
- 'f_back_number':'退库数量'
238
- },
239
- onetomany: {
240
- rows: []
241
- },
242
- title:'新增',
243
- showMaterialModal:false,
244
- materials:[
245
- {
246
- material:'',
247
- f_use_number:'',
248
- f_back_number:'',
249
- f_material_name:'',
250
- f_material_style:'',
251
- f_material_unit:'',
252
- f_material_number:'',
253
- f_bjq_sid:'',
254
- f_material_code:'',
255
- f_userinfo_code:''
256
- }
257
- ],
258
- meterialOptions:[],
259
- row:{},
260
- bjqChecklag:[]
261
- }
262
- },
263
- ready(){
264
- this.getOnetoManyData()
265
- },
266
- methods: {
267
- ReturnInventory(row) {
268
- this.title = '退库'
269
- this.Rematerials = [
270
- {
271
- id:row.id,
272
- f_material_name:row.f_material_name,
273
- f_material_style:row.f_material_style,
274
- f_material_number:row.f_material_number,
275
- }
276
- ]
277
- this.showMaterial= true
278
- },
279
- async returnConfirm() {
280
- if (this.Rematerials[0].f_return_number == undefined || this.Rematerials[0].f_return_number == '') {
281
- this.$showMessage('请输入退库数量')
282
- return
283
- }
284
- if ( Number(this.Rematerials[0].f_return_number) > Number(this.Rematerials[0].f_material_number) ) {
285
- this.$showMessage('退库数量不能大于库存数量')
286
- return
287
- }
288
- let http = new HttpResetClass()
289
- let res = await http.load(
290
- 'POST',
291
- `rs/logic/returnInventory`,
292
- {data: this.Rematerials[0]},
293
- {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
294
- )
295
- if (res.data== 200){
296
- this.$showMessage('退库成功')
297
- this.showMaterial=false
298
- await this.getOnetoManyData()
299
-
300
- }else{
301
- this.$showMessage('退库失败')
302
- }
303
- },
304
- async getOnetoManyData () {
305
- let data = {
306
- tablename: `t_material_apply`,
307
- condition: `f_process_id='${this.selectdata.f_process_id}' and f_status is null `
308
- }
309
- let res = await this.$resetpost(
310
- 'rs/sql/apply_singleTable',
311
- {data: data},
312
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
313
- )
314
- this.onetomany.rows = res.data
315
- },
316
- async openMaterialModal () {
317
- this.getMateralNames()
318
- this.title = '新增'
319
- this.materials = [
320
- {
321
- material:'',
322
- f_use_number:'',
323
- f_back_number:'',
324
- f_material_name:'',
325
- f_material_style:'',
326
- f_material_unit:'',
327
- f_material_number:'',
328
- f_bjq_sid:'',
329
- f_material_code:'',
330
- f_userinfo_code:''
331
- }
332
- ],
333
- this.showMaterialModal = true
334
- },
335
- closeFile() {
336
- this.showWork = false
337
- this.showFile = false
338
- // 将选的文件清空
339
- this.$refs.file.$el.querySelector('input').value = ''
340
- this.search()
341
- },
342
- deleteDevicesinfo (index) {
343
- this.materials.splice(index, 1)
344
- },
345
- pushMaterial () {
346
- this.materials.push({
347
- material:'',
348
- f_use_number:'',
349
- f_back_number:'',
350
- f_material_name:'',
351
- f_material_style:'',
352
- f_material_unit:'',
353
- f_material_number:'',
354
- f_bjq_sid:'',
355
- f_material_code:'',
356
- f_userinfo_code:''
357
- })
358
- },
359
- // 获取模态框材料
360
- async getMateralNames () {
361
- let data = {
362
- condition: `1=1`
363
- }
364
- let http = new HttpResetClass()
365
- let res = await http.load(
366
- 'POST',
367
- `rs/sql/getStockMaterial`,
368
- {data: data},
369
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
370
- )
371
-
372
- this.meterialOptions = res.data.map(item => {
373
- return {
374
- 'label': `${item.parname}-${item.f_material_name}-${item.f_material_style}`,
375
- 'value': item
376
- }
377
- })
378
- },
379
- modifyOtherValue (index){
380
- console.log("进来了",index)
381
- console.log("dddd",this.materials[index].material)
382
- let material = this.materials[index].material
383
- this.materials[index].f_use_number = material.f_use_number
384
- this.materials[index].f_back_number = material.f_back_number
385
- this.materials[index].f_material_name = material.f_material_name
386
- this.materials[index].f_material_style = material.f_material_style
387
- this.materials[index].f_material_unit = material.f_material_unit
388
- this.materials[index].f_material_number = material.f_material_number
389
- this.materials[index].f_material_code = material.f_material_code
390
- this.materials[index].f_userinfo_code = material.f_userinfo_code
391
- },
392
- // 新增材料
393
- async addMaterial () {
394
- console.log("登录信息:",this.$login.f)
395
- this.title = '新增'
396
- //自动计算退库数量
397
- for (let i = 0; i < this.materials.length; i++) {
398
- if(this.materials[i].f_material_number===''||this.materials[i].f_material_number==null){
399
- this.$showAlert(`${this.materials[i].f_material_name}未填写数量`, 'warning', 3000)
400
- return
401
- }
402
- if(this.materials[i].f_use_number===''||this.materials[i].f_use_number==null){
403
- this.materials[i].f_use_number=0
404
- }
405
- this.materials[i].f_back_number =Number(this.materials[i].f_material_number)-Number(this.materials[i].f_use_number)
406
- }
407
- let data = {
408
- f_process_id : this.selectdata.f_process_id,
409
- f_operator_id: this.$login.f.id,
410
- f_operator: this.$login.f.name,
411
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
412
- f_orgid: this.$login.f.orgid,
413
- f_orgname: this.$login.f.orgs,
414
- materials:this.materials
415
- }
416
- //报警器流程 设备编号检验
417
- await this.bjqCheck()
418
- console.log("这是bjqChecklag数据:",this.bjqChecklag)
419
- if (this.bjqChecklag.length > 0){
420
- return
421
- }
422
- let res = await this.$resetpost(
423
- `rs/logic/saveMaterials`,
424
- data
425
- )
426
- this.closeMaterials()
427
- },
428
- async deleteMaterial (row) {
429
- var show1 = window.confirm('您确定要删除这条记录吗?')
430
- if(show1 != true){
431
- this.closeMaterials()
432
- }else{
433
- let http = new HttpResetClass()
434
- let res = await http.load(
435
- 'POST',
436
- `rs/logic/deleteMaterial`,
437
- {data: row},
438
- {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
439
- )
440
- this.closeMaterials()
441
- }
442
-
443
- },
444
- async updateMaterial (index,row) {
445
- this.title = '修改'
446
- this.row = row
447
- this.getMateralNames()
448
- this.materials = [
449
- {
450
- material:'',
451
- f_back_number:row.f_back_number,
452
- f_use_number:row.f_use_number,
453
- f_material_name:row.f_material_name,
454
- f_material_style:row.f_material_style,
455
- f_material_unit:row.f_material_unit,
456
- f_material_number:row.f_material_number,
457
- f_material_code:row.f_material_code,
458
- f_userinfo_code:row.f_userinfo_code,
459
- f_bjq_sid: row.f_bjq_sid
460
- }
461
- ]
462
- this.showMaterialModal = true
463
- },
464
- async updateConfirm () {
465
- let data = this.row
466
- data.f_use_number = this.materials[0].f_use_number==''?0:this.materials[0].f_use_number
467
- data.f_back_number = Number(data.f_material_number)-Number(data.f_use_number)
468
- data.f_material_name = this.materials[0].f_material_name
469
- data.f_material_style = this.materials[0].f_material_style
470
- data.f_material_unit = this.materials[0].f_material_unit
471
- data.f_material_number = this.materials[0].f_material_number
472
- data.f_material_code = this.materials[0].f_material_code
473
- data.f_bjq_sid = this.materials[0].f_bjq_sid
474
- data.f_userinfo_code = this.materials[0].f_userinfo_code
475
- //报警器流程 设备编号检验
476
- await this.bjqCheck()
477
- if (this.bjqChecklag.length > 0){
478
- return
479
- }
480
- let res = await this.$resetpost(
481
- `rs/entity/t_material_apply`,
482
- data
483
- )
484
- this.closeMaterials()
485
- },
486
- sycronizedCode(index,val){
487
- console.log("看看:",index,val)
488
- this.materials[index].f_material_code = val
489
- },
490
- closeMaterials () {
491
- this.getOnetoManyData()
492
- this.showMaterialModal = false
493
- this.showMaterial = false
494
- },
495
- async bjqCheck(){
496
- //报警器设备型号校验
497
- this.bjqChecklag = [] //初始化
498
- if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
499
- let bjqinfo = {
500
- f_material_name : "",
501
- f_bjq_sid: ""
502
- }
503
- for (const bjqinfoElement of this.materials) {
504
- bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
505
- bjqinfo.f_material_name = bjqinfoElement.f_material_name
506
- if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
507
- let http = new HttpResetClass()
508
- let res = await http.load(
509
- 'POST',
510
- // `/rs/logic/bjqcheck`,
511
- `ncc/rs/logic/bjqcheck`,
512
- bjqinfo
513
- )
514
- if (res.data.code != 200){
515
- this.bjqChecklag.push(res.data.code)
516
- // this.$showMessage(res.data.msg)
517
- Vue.showAlert(res.data.msg, 'danger', 6000)
518
- return
519
- }
520
- }
521
- }
522
- }
523
- }
524
- },
525
- events: {
526
- 'beforeFileUpload' (file) {
527
- this.showWork = true
528
- },
529
- async 'onFileUpload'(file, result) {
530
- let data = {
531
- selectdata: this.selectdata,
532
- filepath: result.f_downloadpath,
533
- user: this.$login.f
534
- }
535
- try {
536
- let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
537
- resolveMsg: null,
538
- rejectMsg: '导入失败!!!',
539
- silent: true
540
- }, 0)
541
- } catch (e) {
542
- this.closeFile()
543
- }
544
- this.$dispatch('breakControl', this.selectdata)
545
- }
546
- },
547
- computed: {
548
- getConditions () {
549
- return {
550
- condition: `ma.f_process_id='${this.selectdata.f_process_id}' and f_status is null`,
551
- data: {
552
- userid: this.$login.f.id,
553
- f_filiale: this.$login.f.orgs
554
- }
555
- }
556
- },
557
- }
558
- }
559
-
560
- </script>
561
-
562
- <style scoped>
563
-
564
- </style>
1
+ <template>
2
+ <div >
3
+ <export-excel :data="getConditions"
4
+ :field="getfields"
5
+ sqlurl="rs/logic/applyExportfile"
6
+ sql-name="applyGetMaterial"
7
+ template-name='材料信息导出'
8
+ :choose-col="true"></export-excel>
9
+ </div>
10
+ <div>
11
+ <data-grid :model="onetomany" class="list_area table_sy">
12
+ <template partial='head'>
13
+ <tr>
14
+ <th class="textNoLineBreak">序号</th>
15
+ <th class="textNoLineBreak">材料名称</th>
16
+ <th class="textNoLineBreak">材料型号</th>
17
+ <th class="textNoLineBreak">材料编码</th>
18
+ <th class="textNoLineBreak">材料单位</th>
19
+ <th class="textNoLineBreak">材料数量</th>
20
+ <th class="textNoLineBreak">使用数量</th>
21
+ <th class="textNoLineBreak">退库数量</th>
22
+ <th class="textNoLineBreak">
23
+ <button v-if="$parent.$parent.mark === 0" class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
24
+ <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
25
+ @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
26
+ <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
27
+ href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>
28
+ </th>
29
+ </tr>
30
+ </template>
31
+ <template partial='body'>
32
+ <tr>
33
+ <td style="text-align: center;">
34
+ <nobr>{{$index+1}}</nobr>
35
+ </td>
36
+ <td style="text-align: center;">
37
+ <nobr>{{row.f_material_name}}</nobr>
38
+ </td>
39
+ <td style="text-align: center;">
40
+ <nobr>{{row.f_material_style}}</nobr>
41
+ </td>
42
+ <td style="text-align: center;">
43
+ <nobr>{{row.f_material_code}}</nobr>
44
+ </td>
45
+ <td style="text-align: center;">
46
+ <nobr>{{row.f_material_unit}}</nobr>
47
+ </td>
48
+ <td style="text-align: center;">
49
+ <nobr>{{row.f_material_number}}</nobr>
50
+ </td>
51
+ <td style="text-align: center;">
52
+ <nobr>{{row. f_use_number}}</nobr>
53
+ </td>
54
+ <td style="text-align: center;">
55
+ <nobr>{{row. f_back_number}}</nobr>
56
+ </td>
57
+ <td style="text-align: center;">
58
+ <button v-if="$parent.$parent.mark === 0" type="button" class="button_search button_spacing" @click="$parent.$parent.updateMaterial($index,row)">修改</button>
59
+ <button v-if="$parent.$parent.mark === 0" type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除</button>
60
+ </td>
61
+ </tr>
62
+ </template>
63
+ </data-grid>
64
+ <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
65
+ <header slot="modal-header" class="modal-header">
66
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
67
+ <h4 class="modal-title">选择文件</h4>
68
+ </header>
69
+ <article slot="modal-body" class="modal-body">
70
+ <div class="form-group">
71
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
72
+ </div>
73
+ </article>
74
+ <footer slot="modal-footer" class="modal-footer"></footer>
75
+ </modal>
76
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
77
+ :backdrop="false" :title="title">
78
+ <header slot="modal-header" class="modal-header">
79
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
80
+ <h4 class="modal-title">{{title}}</h4>
81
+ </header>
82
+ <article slot="modal-body" class="modal-body clearfix">
83
+ <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
84
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
85
+ <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
86
+ <div class="col-sm-6 text-right"><button
87
+ class="button_delete button_spacing"
88
+ @click.prevent="deleteDevicesinfo(i)"
89
+ v-if="title === '新增'"
90
+ >删除</button></div>
91
+ </div>
92
+ <div class="form-group col-sm-6">
93
+ <label class="col-sm-4 control-label">选择材料:</label>
94
+ <div class="col-sm-8">
95
+ <input-select
96
+ class="select select_list"
97
+ :value.sync="item.material"
98
+ v-model="item.material"
99
+ :options="meterialOptions"
100
+ :disable="mark===1"
101
+ @change="modifyOtherValue(i)"
102
+ :valueSingle="true"></input-select>
103
+ </div>
104
+ </div>
105
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
106
+ <label class="col-sm-4 control-label">材料名称:</label>
107
+ <div class="col-sm-8">
108
+ <input class="form-control input_view" style="" type="text"
109
+ placeholder="材料名称"
110
+ :readonly="enable"
111
+ v-model="item.f_material_name"
112
+ :value="item.f_material_name"
113
+ />
114
+ </div>
115
+ </div>
116
+ <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : '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="text"
120
+ placeholder="材料型号"
121
+ :readonly="enable"
122
+ v-model="item.f_material_style"
123
+ :value="item.f_material_style"
124
+ />
125
+ </div>
126
+ </div>
127
+ <div class="form-group col-sm-6" :class="[item.f_material_code ? '' : '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="text"
131
+ placeholder="材料编码"
132
+ :readonly="enable"
133
+ v-model="item.f_material_code"
134
+ :value="item.f_material_code"
135
+ />
136
+ </div>
137
+ </div>
138
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
139
+ <label class="col-sm-4 control-label">材料单位:</label>
140
+ <div class="col-sm-8">
141
+ <input class="form-control input_view" style="" type="text"
142
+ placeholder="材料单位"
143
+ :readonly="enable"
144
+ v-model="item.f_material_unit"
145
+ :value="item.f_material_unit"
146
+ />
147
+ </div>
148
+ </div>
149
+ <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
150
+ <label class="col-sm-4 control-label">材料数量:</label>
151
+ <div class="col-sm-8">
152
+ <input class="form-control input_view" style="" type="number"
153
+ placeholder="材料数量"
154
+ v-model="item.f_material_number"
155
+ :value="item.f_material_number"
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
+ <input class="form-control input_view" style="" type="number"
163
+ placeholder="使用数量"
164
+ :readonly="enable"
165
+ v-model="item.f_use_number"
166
+ :value="item.f_use_number"
167
+ />
168
+ </div>
169
+ </div>
170
+
171
+ <div class="form-group col-sm-6">
172
+ <label class="col-sm-4 control-label">退库数量:</label>
173
+ <div class="col-sm-8">
174
+ <input class="form-control input_view" style="" type="number"
175
+ placeholder="退库数量"
176
+ v-model="item.f_back_number"
177
+ :readonly="enable"
178
+ :value.sync="item.f_back_number"
179
+ />
180
+ </div>
181
+ </div>
182
+ <div class="form-group col-sm-6">
183
+ <label class="col-sm-4 control-label">材料标识:</label>
184
+ <div class="col-sm-8">
185
+ <input class="form-control input_view" style=""
186
+ placeholder="材料标识"
187
+ v-model="item.f_material_code"
188
+ :readonly="enable"
189
+ :value.sync="item.f_material_code"
190
+ />
191
+ </div>
192
+ </div>
193
+ </div>
194
+
195
+ </article>
196
+ <footer slot="modal-footer" class="modal-footer">
197
+ <template v-if="mark !== 1">
198
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
199
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
200
+ <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
201
+ </template>
202
+ </footer>
203
+ </modal>
204
+ </div>
205
+ </template>
206
+
207
+ <script>
208
+ import {HttpResetClass} from 'vue-client'
209
+ import Vue from "vue";
210
+ export default {
211
+ name: 'addMaterialScience',
212
+ props: {
213
+ selectdata: {
214
+ type: Object
215
+ },
216
+ mark: {
217
+ type: Number,
218
+ default: 0
219
+ }
220
+ },
221
+ data () {
222
+ return {
223
+ enable:false,
224
+ showMaterial: false,
225
+ showFile: false,
226
+ Rematerials:[
227
+ {
228
+ f_return_number:"",
229
+ material:'',
230
+ f_material_name:'',
231
+ f_material_style:'',
232
+ f_material_unit:'',
233
+ f_material_number:'',
234
+ f_bjq_sid:'',
235
+ f_material_code:'',
236
+ f_userinfo_code:''
237
+ }
238
+ ],
239
+ getfields:{
240
+ 'id':'序号',
241
+ 'f_material_name':'材料名称',
242
+ 'f_material_style':'材料型号',
243
+ 'f_material_number':'材料数量',
244
+ 'f_use_number':'使用数量',
245
+ 'f_back_number':'退库数量'
246
+ },
247
+ onetomany: {
248
+ rows: []
249
+ },
250
+ title:'新增',
251
+ showMaterialModal:false,
252
+ materials:[
253
+ {
254
+ material:'',
255
+ f_use_number:'',
256
+ f_back_number:'',
257
+ f_material_name:'',
258
+ f_material_style:'',
259
+ f_material_unit:'',
260
+ f_material_number:'',
261
+ f_bjq_sid:'',
262
+ f_material_code:'',
263
+ f_userinfo_code:''
264
+ }
265
+ ],
266
+ meterialOptions:[],
267
+ row:{},
268
+ bjqChecklag:[]
269
+ }
270
+ },
271
+ ready(){
272
+ this.getOnetoManyData()
273
+ if(this.selectdata.defname==="材料用量审核"){
274
+ this.enable = true
275
+ }
276
+ },
277
+ methods: {
278
+ ReturnInventory(row) {
279
+ this.title = '退库'
280
+ this.Rematerials = [
281
+ {
282
+ id:row.id,
283
+ f_material_name:row.f_material_name,
284
+ f_material_style:row.f_material_style,
285
+ f_material_number:row.f_material_number,
286
+ }
287
+ ]
288
+ this.showMaterial= true
289
+ },
290
+ async returnConfirm() {
291
+ if (this.Rematerials[0].f_return_number == undefined || this.Rematerials[0].f_return_number == '') {
292
+ this.$showMessage('请输入退库数量')
293
+ return
294
+ }
295
+ if ( Number(this.Rematerials[0].f_return_number) > Number(this.Rematerials[0].f_material_number) ) {
296
+ this.$showMessage('退库数量不能大于库存数量')
297
+ return
298
+ }
299
+ let http = new HttpResetClass()
300
+ let res = await http.load(
301
+ 'POST',
302
+ `rs/logic/returnInventory`,
303
+ {data: this.Rematerials[0]},
304
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
305
+ )
306
+ if (res.data== 200){
307
+ this.$showMessage('退库成功')
308
+ this.showMaterial=false
309
+ await this.getOnetoManyData()
310
+
311
+ }else{
312
+ this.$showMessage('退库失败')
313
+ }
314
+ },
315
+ async getOnetoManyData () {
316
+ let data = {
317
+ tablename: `t_material_apply`,
318
+ condition: `f_process_id='${this.selectdata.f_process_id}' and f_status is null `
319
+ }
320
+ let res = await this.$resetpost(
321
+ 'rs/sql/apply_singleTable',
322
+ {data: data},
323
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
324
+ )
325
+ this.onetomany.rows = res.data
326
+ },
327
+ async openMaterialModal () {
328
+ this.getMateralNames()
329
+ this.title = '新增'
330
+ this.materials = [
331
+ {
332
+ material:'',
333
+ f_use_number:'',
334
+ f_back_number:'',
335
+ f_material_name:'',
336
+ f_material_style:'',
337
+ f_material_unit:'',
338
+ f_material_number:'',
339
+ f_bjq_sid:'',
340
+ f_material_code:'',
341
+ f_userinfo_code:''
342
+ }
343
+ ],
344
+ this.showMaterialModal = true
345
+ },
346
+ closeFile() {
347
+ this.showWork = false
348
+ this.showFile = false
349
+ // 将选的文件清空
350
+ this.$refs.file.$el.querySelector('input').value = ''
351
+ this.search()
352
+ },
353
+ deleteDevicesinfo (index) {
354
+ this.materials.splice(index, 1)
355
+ },
356
+ pushMaterial () {
357
+ this.materials.push({
358
+ material:'',
359
+ f_use_number:'',
360
+ f_back_number:'',
361
+ f_material_name:'',
362
+ f_material_style:'',
363
+ f_material_unit:'',
364
+ f_material_number:'',
365
+ f_bjq_sid:'',
366
+ f_material_code:'',
367
+ f_userinfo_code:''
368
+ })
369
+ },
370
+ // 获取模态框材料
371
+ async getMateralNames () {
372
+ let data = {
373
+ condition: `1=1`
374
+ }
375
+ let http = new HttpResetClass()
376
+ let res = await http.load(
377
+ 'POST',
378
+ `rs/sql/getStockMaterial`,
379
+ {data: data},
380
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
381
+ )
382
+
383
+ this.meterialOptions = res.data.map(item => {
384
+ return {
385
+ 'label': `${item.parname}-${item.f_material_name}-${item.f_material_style}`,
386
+ 'value': item
387
+ }
388
+ })
389
+ },
390
+ modifyOtherValue (index){
391
+ console.log("进来了",index)
392
+ console.log("dddd",this.materials[index].material)
393
+ let material = this.materials[index].material
394
+ this.materials[index].f_use_number = material.f_use_number
395
+ this.materials[index].f_back_number = material.f_back_number
396
+ this.materials[index].f_material_name = material.f_material_name
397
+ this.materials[index].f_material_style = material.f_material_style
398
+ this.materials[index].f_material_unit = material.f_material_unit
399
+ this.materials[index].f_material_number = material.f_material_number
400
+ this.materials[index].f_material_code = material.f_material_code
401
+ this.materials[index].f_userinfo_code = material.f_userinfo_code
402
+ },
403
+ // 新增材料
404
+ async addMaterial () {
405
+ console.log("登录信息:",this.$login.f)
406
+ this.title = '新增'
407
+ //自动计算退库数量
408
+ for (let i = 0; i < this.materials.length; i++) {
409
+ if(this.materials[i].f_material_number===''||this.materials[i].f_material_number==null){
410
+ this.$showAlert(`${this.materials[i].f_material_name}未填写数量`, 'warning', 3000)
411
+ return
412
+ }
413
+ if(this.materials[i].f_use_number===''||this.materials[i].f_use_number==null){
414
+ this.materials[i].f_use_number=0
415
+ }
416
+ this.materials[i].f_back_number =Number(this.materials[i].f_material_number)-Number(this.materials[i].f_use_number)
417
+ }
418
+ let data = {
419
+ f_process_id : this.selectdata.f_process_id,
420
+ f_operator_id: this.$login.f.id,
421
+ f_operator: this.$login.f.name,
422
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
423
+ f_orgid: this.$login.f.orgid,
424
+ f_orgname: this.$login.f.orgs,
425
+ materials:this.materials
426
+ }
427
+ //报警器流程 设备编号检验
428
+ await this.bjqCheck()
429
+ console.log("这是bjqChecklag数据:",this.bjqChecklag)
430
+ if (this.bjqChecklag.length > 0){
431
+ return
432
+ }
433
+ let res = await this.$resetpost(
434
+ `rs/logic/saveMaterials`,
435
+ data
436
+ )
437
+ this.closeMaterials()
438
+ },
439
+ async deleteMaterial (row) {
440
+ var show1 = window.confirm('您确定要删除这条记录吗?')
441
+ if(show1 != true){
442
+ this.closeMaterials()
443
+ }else{
444
+ let http = new HttpResetClass()
445
+ let res = await http.load(
446
+ 'POST',
447
+ `rs/logic/deleteMaterial`,
448
+ {data: row},
449
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
450
+ )
451
+ this.closeMaterials()
452
+ }
453
+
454
+ },
455
+ async updateMaterial (index,row) {
456
+ this.title = '修改'
457
+ this.row = row
458
+ this.getMateralNames()
459
+ this.materials = [
460
+ {
461
+ material:'',
462
+ f_back_number:row.f_back_number,
463
+ f_use_number:row.f_use_number,
464
+ f_material_name:row.f_material_name,
465
+ f_material_style:row.f_material_style,
466
+ f_material_unit:row.f_material_unit,
467
+ f_material_number:row.f_material_number,
468
+ f_material_code:row.f_material_code,
469
+ f_userinfo_code:row.f_userinfo_code,
470
+ f_bjq_sid: row.f_bjq_sid
471
+ }
472
+ ]
473
+ this.showMaterialModal = true
474
+ },
475
+ async updateConfirm () {
476
+ let data = this.row
477
+ data.f_use_number = this.materials[0].f_use_number==''?0:this.materials[0].f_use_number
478
+ data.f_back_number = Number(data.f_material_number)-Number(data.f_use_number)
479
+ data.f_material_name = this.materials[0].f_material_name
480
+ data.f_material_style = this.materials[0].f_material_style
481
+ data.f_material_unit = this.materials[0].f_material_unit
482
+ data.f_material_number = this.materials[0].f_material_number
483
+ data.f_material_code = this.materials[0].f_material_code
484
+ data.f_bjq_sid = this.materials[0].f_bjq_sid
485
+ data.f_userinfo_code = this.materials[0].f_userinfo_code
486
+ //报警器流程 设备编号检验
487
+ await this.bjqCheck()
488
+ if (this.bjqChecklag.length > 0){
489
+ return
490
+ }
491
+ let res = await this.$resetpost(
492
+ `rs/entity/t_material_apply`,
493
+ data
494
+ )
495
+ this.closeMaterials()
496
+ },
497
+ sycronizedCode(index,val){
498
+ console.log("看看:",index,val)
499
+ this.materials[index].f_material_code = val
500
+ },
501
+ closeMaterials () {
502
+ this.getOnetoManyData()
503
+ this.showMaterialModal = false
504
+ this.showMaterial = false
505
+ },
506
+ async bjqCheck(){
507
+ //报警器设备型号校验
508
+ this.bjqChecklag = [] //初始化
509
+ if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
510
+ let bjqinfo = {
511
+ f_material_name : "",
512
+ f_bjq_sid: ""
513
+ }
514
+ for (const bjqinfoElement of this.materials) {
515
+ bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
516
+ bjqinfo.f_material_name = bjqinfoElement.f_material_name
517
+ if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
518
+ let http = new HttpResetClass()
519
+ let res = await http.load(
520
+ 'POST',
521
+ // `/rs/logic/bjqcheck`,
522
+ `ncc/rs/logic/bjqcheck`,
523
+ bjqinfo
524
+ )
525
+ if (res.data.code != 200){
526
+ this.bjqChecklag.push(res.data.code)
527
+ // this.$showMessage(res.data.msg)
528
+ Vue.showAlert(res.data.msg, 'danger', 6000)
529
+ return
530
+ }
531
+ }
532
+ }
533
+ }
534
+ }
535
+ },
536
+ events: {
537
+ 'beforeFileUpload' (file) {
538
+ this.showWork = true
539
+ },
540
+ async 'onFileUpload'(file, result) {
541
+ let data = {
542
+ selectdata: this.selectdata,
543
+ filepath: result.f_downloadpath,
544
+ user: this.$login.f
545
+ }
546
+ try {
547
+ let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
548
+ resolveMsg: null,
549
+ rejectMsg: '导入失败!!!',
550
+ silent: true
551
+ }, 0)
552
+ } catch (e) {
553
+ this.closeFile()
554
+ }
555
+ this.$dispatch('breakControl', this.selectdata)
556
+ }
557
+ },
558
+ computed: {
559
+ getConditions () {
560
+ return {
561
+ condition: `ma.f_process_id='${this.selectdata.f_process_id}' and f_status is null`,
562
+ data: {
563
+ userid: this.$login.f.id,
564
+ f_filiale: this.$login.f.orgs
565
+ }
566
+ }
567
+ },
568
+ }
569
+ }
570
+
571
+ </script>
572
+
573
+ <style scoped>
574
+
575
+ </style>