apply-clients 3.5.5-6 → 3.5.5-7

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 (63) hide show
  1. package/build/dev-server.js +9 -5
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/apply.js +141 -141
  5. package/src/components/android/AppTakePic.vue +182 -182
  6. package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
  7. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  8. package/src/components/product/MaterialsManage/MaterialsBase.vue +181 -181
  9. package/src/components/product/MaterialsManage/MaterialsManage.vue +60 -60
  10. package/src/components/product/Process/Processes/contractModel.vue +454 -458
  11. package/src/components/product/ServiceView.vue +1028 -1028
  12. package/src/components/product/Supervisory/SupervisoryList.vue +452 -452
  13. package/src/filiale/dingcheng/pc/SupervisoryList.vue +441 -441
  14. package/src/filiale/fugou/android/AppAddMaterialScience.vue +440 -440
  15. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  16. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
  17. package/src/filiale/fugou/android/AppServiceControl.vue +1836 -1836
  18. package/src/filiale/fugou/android/printCharge.vue +162 -162
  19. package/src/filiale/fugou/android.js +16 -16
  20. package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
  21. package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1705
  22. package/src/filiale/fugou/pc/ServiceView.vue +941 -941
  23. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  24. package/src/filiale/fugou/pc/printChargepc.vue +148 -148
  25. package/src/filiale/fugou/pc.js +16 -17
  26. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  27. package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -214
  28. package/src/filiale/gongyi/android/AppInstallationDetails.vue +500 -500
  29. package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -309
  30. package/src/filiale/gongyi/android/AppSign.vue +170 -170
  31. package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -298
  32. package/src/filiale/gongyi/android.js +18 -18
  33. package/src/filiale/gongyi/pc/ApplyUpload.vue +371 -371
  34. package/src/filiale/gongyi/pc/PcAddLogs.vue +221 -221
  35. package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -218
  36. package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -309
  37. package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +894 -894
  38. package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -1005
  39. package/src/filiale/gongyi/pc/addMaterialScience.vue +575 -575
  40. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -765
  41. package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -277
  42. package/src/filiale/gongyi/pc.js +24 -24
  43. package/src/filiale/hongda/pc/SupervisoryList.vue +422 -422
  44. package/src/filiale/jingyang/pc/SupervisoryList.vue +459 -459
  45. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  46. package/src/filiale/qianneng/android.js +15 -15
  47. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
  48. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  49. package/src/filiale/qianneng/pc.js +29 -29
  50. package/src/filiale/ruihua/pc/ServiceControl.vue +1966 -1966
  51. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +520 -520
  52. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +645 -645
  53. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1703 -1703
  54. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +547 -547
  55. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2112 -2112
  56. package/src/filiale/yangchunboneng/pc/ServiceView.vue +1007 -1007
  57. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +605 -605
  58. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +683 -683
  59. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1053 -1053
  60. package/src/filiale/yangchunboneng/pc/devicesManagement.vue +574 -574
  61. package/src/main.js +3 -3
  62. package/~/chatbot/main.py +57 -0
  63. package/src/filiale/fugou/pc/SupervisoryServiceControl.vue +0 -881
@@ -1,575 +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
- :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>
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>