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,482 +1,482 @@
1
- <template>
2
- <div>
3
- <data-grid :model="onetomany" class="list_area table_sy">
4
- <template partial='head'>
5
- <tr>
6
- <th class="textNoLineBreak">序号</th>
7
- <th class="textNoLineBreak">材料名称</th>
8
- <th class="textNoLineBreak">材料单位</th>
9
- <th class="textNoLineBreak">材料单价</th>
10
- <th class="textNoLineBreak">材料数量</th>
11
- <th class="textNoLineBreak">材料金额</th>
12
- <th class="textNoLineBreak">材料备注</th>
13
- <th class="textNoLineBreak">材料总金额:{{$parent.$parent.summoney}}</th>
14
- <th class="textNoLineBreak" v-if="$parent.$parent.selectdata.defname=='通气点火'">点火材料金额:{{$parent.$parent.twomoney}}</th>
15
- <th class="textNoLineBreak">
16
- <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
17
- <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
18
- @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
19
- <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
20
- href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>
21
- </th>
22
- </tr>
23
- </template>
24
- <template partial='body'>
25
- <tr>
26
- <td style="text-align: center;">
27
- <nobr>{{$index+1}}</nobr>
28
- </td>
29
- <td style="text-align: center;">
30
- <nobr>{{row.f_material_name}}</nobr>
31
- </td>
32
- <td style="text-align: center;">
33
- <nobr>{{row.f_material_unit}}</nobr>
34
- </td>
35
- <td style="text-align: center;">
36
- <nobr>{{row.f_material_price}}</nobr>
37
- </td>
38
- <td style="text-align: center;">
39
- <nobr>{{row.f_material_number}}</nobr>
40
- </td>
41
- <td style="text-align: center;">
42
- <nobr>{{row.f_material_money}}</nobr>
43
- </td>
44
- <td style="text-align: center;">
45
- <nobr>{{row.f_operator}}</nobr>
46
- </td>
47
- <td style="text-align: center;">
48
- <!-- <button type="button" class="button_search button_spacing" :disabled="row.f_operator==this.$login.f.name ? false : true" @click="$parent.$parent.updateMaterial($index,row)">修改</button>-->
49
- <button type="button" class="button_delete button_spacing":disabled="row.f_operator==this.$login.f.name ? false : true" @click="$parent.$parent.deleteMaterial(row)">删除</button>
50
- </td>
51
- </tr>
52
- </template>
53
- </data-grid>
54
- <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
55
- <header slot="modal-header" class="modal-header">
56
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
57
- <h4 class="modal-title">选择文件</h4>
58
- </header>
59
- <article slot="modal-body" class="modal-body">
60
- <div class="form-group">
61
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
62
- </div>
63
- </article>
64
- <footer slot="modal-footer" class="modal-footer"></footer>
65
- </modal>
66
- <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
67
- :backdrop="false" :title="title">
68
- <header slot="modal-header" class="modal-header">
69
- <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
70
- <h4 class="modal-title">{{title}}</h4>
71
- </header>
72
- <article slot="modal-body" class="modal-body clearfix">
73
- <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
74
- <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
75
- <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
76
- <div class="col-sm-6 text-right"><button
77
- class="button_delete button_spacing"
78
- @click.prevent="deleteDevicesinfo(i)"
79
- v-if="title === '新增'"
80
- >删除</button></div>
81
- </div>
82
- <div class="form-group col-sm-6">
83
- <label class="col-sm-4 control-label">选择材料:</label>
84
- <div class="col-sm-8">
85
- <input-select
86
- class="select select_list"
87
- :value.sync="item.material"
88
- v-model="item.material"
89
- :options="meterialOptions"
90
- :disable="mark === 1"
91
- @change="modifyOtherValue(i)"
92
- :valueSingle="true"></input-select>
93
- </div>
94
- </div>
95
- <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
96
- <label class="col-sm-4 control-label">材料名称:</label>
97
- <div class="col-sm-8">
98
- <input class="form-control input_view" style="" type="text"
99
- placeholder="材料名称"
100
- v-model="item.f_material_name"
101
- :value="item.f_material_name"
102
- />
103
- </div>
104
- </div>
105
- <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : '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_unit"
111
- :value="item.f_material_unit"
112
- />
113
- </div>
114
- </div>
115
- <div class="form-group col-sm-6" :class="[item.f_material_price ? '' : '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_price"
121
- :value="item.f_material_price"
122
- />
123
- </div>
124
- </div>
125
- <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : '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="number"
129
- placeholder="设备数量"
130
- v-model="item.f_material_number"
131
- :value="item.f_material_number"
132
- @change="sumMaterialmoney(i)"
133
- />
134
- </div>
135
- </div>
136
- <div class="form-group col-sm-6">
137
- <label class="col-sm-4 control-label">材料金额:</label>
138
- <div class="col-sm-8">
139
- <input class="form-control input_view" style="" type="text"
140
- placeholder="材料金额"
141
- v-model="item.f_material_money"
142
- :value="item.f_material_money"
143
- />
144
- </div>
145
- </div>
146
- <div class="form-group col-sm-6">
147
- <label class="col-sm-4 control-label">材料备注:</label>
148
- <div class="col-sm-8">
149
- <input class="form-control input_view" style=""
150
- placeholder="材料备注"
151
- v-model="item.f_material_remarks"
152
- :value.sync="item.f_material_remarks"
153
- />
154
- </div>
155
- </div>
156
- </div>
157
-
158
- </article>
159
- <footer slot="modal-footer" class="modal-footer">
160
- <template v-if="mark !== 1">
161
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
162
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
163
- <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
164
- </template>
165
- </footer>
166
- </modal>
167
- <apply-eticke-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></apply-eticke-print>
168
-
169
- </div>
170
- </template>
171
-
172
- <script>
173
- import {HttpResetClass} from 'vue-client'
174
- import Vue from "vue";
175
- export default {
176
- name: 'addMaterialScience',
177
- props: {
178
- selectdata: {
179
- type: Object
180
- },
181
- mark: {
182
- type: Number,
183
- default: 0
184
- }
185
- },
186
- data () {
187
- return {
188
- showFile: false,
189
- onetomany: {
190
- rows: []
191
- },
192
- title:'新增',
193
- summoney:0,
194
- showMaterialModal:false,
195
- eticket_show:false,
196
- twomoney:0,
197
- materials:[
198
- {
199
- material:'',
200
- f_material_name:'',
201
- f_material_unit:'',
202
- f_material_price:'',
203
- f_material_number:'',
204
- f_material_money:'',
205
- f_material_remarks:''
206
- }
207
- ],
208
- meterialOptions:[],
209
- row:{},
210
- bjqChecklag:[]
211
- }
212
- },
213
- ready(){
214
- this.getOnetoManyData()
215
- console.log('打印登陆人',this.$login.f.name)
216
- },
217
- methods: {
218
- sumMaterialzong(materials){
219
- debugger
220
- this.summoney=0
221
- for(var i=0;i<materials.length; i++){
222
- this.summoney =parseFloat(parseFloat(materials[i].f_material_money)+ parseFloat(this.summoney)).toFixed(2)
223
- }
224
- this.twomoney= parseFloat(parseFloat(this.summoney)- parseFloat(this.selectdata.f_sumtwo_money)).toFixed(2)
225
- console.log('打印材料总金额',this.summoney)
226
- if(this.selectdata.defname=='工程施工'){
227
- this.selectdata.f_sumtwo_money = this.summoney
228
- console.log('打印首次材料金额',this.selectdata.f_sumtwo_money)
229
- }
230
- },
231
- sumMaterialmoney(index){
232
- debugger
233
- this.materials[index].f_material_money = this.materials[index].f_material_price * this.materials[index].f_material_number
234
- console.log('打印',this.materials[index].f_material_money)
235
- },
236
- async getOnetoManyData () {
237
- let data = {
238
- tablename: `t_material_detail`,
239
- condition: `f_process_id='${this.selectdata.f_process_id}'`
240
- }
241
- let res = await this.$resetpost(
242
- 'rs/sql/singleTable',
243
- {data: data},
244
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
245
- )
246
- this.onetomany.rows = res.data
247
- this.sumMaterialzong(this.onetomany.rows)
248
- },
249
- async openMaterialModal () {
250
- this.getMateralNames()
251
- this.title = '新增'
252
- this.materials = [
253
- {
254
- material:'',
255
- f_material_name:'',
256
- f_material_unit:'',
257
- f_material_price:'',
258
- f_material_number:'',
259
- f_material_money:'',
260
- f_material_remarks:''
261
- }
262
- ],
263
- this.showMaterialModal = true
264
- },
265
- closeFile() {
266
- this.showWork = false
267
- this.showFile = false
268
- // 将选的文件清空
269
- this.$refs.file.$el.querySelector('input').value = ''
270
- this.search()
271
- },
272
- deleteDevicesinfo (index) {
273
- this.materials.splice(index, 1)
274
- },
275
- pushMaterial () {
276
- this.materials.push({
277
- material:'',
278
- f_material_name:'',
279
- f_material_unit:'',
280
- f_material_price:'',
281
- f_material_number:'',
282
- f_material_money:'',
283
- f_material_remarks:''
284
- })
285
- },
286
- // 获取模态框材料
287
- async getMateralNames () {
288
- let data = {
289
- condition: `1=1`
290
- }
291
- let http = new HttpResetClass()
292
- let res = await http.load(
293
- 'POST',
294
- `rs/sql/getStockMaterial`,
295
- {data: data},
296
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
297
- )
298
-
299
- this.meterialOptions = res.data.map(item => {
300
- return {
301
- 'label': `${item.f_material_name}`,
302
- 'value': item
303
- }
304
- })
305
- },
306
- modifyOtherValue (index){
307
- console.log("进来了",index)
308
- console.log("dddd",this.materials[index].material)
309
- let material = this.materials[index].material
310
- this.materials[index].f_material_name = material.f_material_name
311
- this.materials[index].f_material_unit = material.f_material_unit
312
- this.materials[index].f_material_price = material.f_material_price
313
- this.materials[index].f_material_number = material.f_material_number
314
- this.materials[index].f_material_money = material.f_material_money
315
- },
316
- // 新增材料
317
- async addMaterial () {
318
- console.log("登录信息:",this.$login.f)
319
- this.title = '新增'
320
- let data = {
321
- selectdata:this.selectdata,
322
- f_process_id : this.selectdata.f_process_id,
323
- f_operator_id: this.$login.f.id,
324
- f_operator: this.$login.f.name,
325
- f_department_name:this.$login.f.f_department_name,
326
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
327
- f_orgid: this.$login.f.orgid,
328
- f_orgname: this.$login.f.orgs,
329
- materials:this.materials
330
- }
331
- //报警器流程 设备编号检验
332
- await this.bjqCheck()
333
- console.log("这是bjqChecklag数据:",this.bjqChecklag)
334
- if (this.bjqChecklag.length > 0){
335
- return
336
- }
337
- let res = await this.$resetpost(
338
- `rs/logic/saveMaterials`,
339
- data
340
- )
341
- debugger
342
- // if(res.data == 200){
343
- //
344
- // // let contractbu={
345
- // // f_contract_money:money,
346
- // // f_contract_type:'材料合同'
347
- // // }
348
- // // let data ={
349
- // // contract:contractbu,
350
- // // selectdata: this.selectdata,
351
- // // user: this.$login.f,
352
- // // }
353
- // // let http1 = new HttpResetClass()
354
- // // let res = await http1.load(
355
- // // 'POST',
356
- // // `rs/logic/saveReplenishContract`,
357
- // // {data: data},
358
- // // {resolveMsg: null, rejectMsg: '补充协议成功!!!'}
359
- // // )
360
- // }
361
- this.closeMaterials()
362
- },
363
- async deleteMaterial (row) {
364
- var show1 = window.confirm('您确定要删除这条记录吗?')
365
- if(show1 != true){
366
- this.closeMaterials()
367
- }else{
368
- debugger
369
- let http = new HttpResetClass()
370
- let res = await http.load(
371
- 'POST',
372
- `rs/logic/deleteMaterial`,
373
- {data: row},
374
- {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
375
- )
376
- this.closeMaterials()
377
- }
378
-
379
- },
380
- async updateMaterial (index,row) {
381
- this.title = '修改'
382
- this.row = row
383
- this.getMateralNames()
384
- this.materials = [
385
- {
386
- material:'',
387
- f_material_name:row.f_material_name,
388
- f_material_unit:row.f_material_unit,
389
- f_material_price:row.f_material_price,
390
- f_material_number:row.f_material_number,
391
- f_material_money:row.f_material_money,
392
- f_material_remarks: row.f_material_remarks
393
- }
394
- ]
395
- this.showMaterialModal = true
396
- },
397
- async updateConfirm () {
398
- let data = this.row
399
- data.f_material_name = this.materials[0].f_material_name
400
- data.f_material_unit = this.materials[0].f_material_unit
401
- data.f_material_price = this.materials[0].f_material_price
402
- data.f_material_number = this.materials[0].f_material_number
403
- data.f_material_money = this.materials[0].f_material_money
404
- data.f_material_remarks = this.materials[0].f_material_remarks
405
- //报警器流程 设备编号检验
406
- await this.bjqCheck()
407
- if (this.bjqChecklag.length > 0){
408
- return
409
- }
410
- let res = await this.$resetpost(
411
- `rs/entity/t_material_detail`,
412
- data
413
- )
414
- this.closeMaterials()
415
- },
416
- sycronizedCode(index,val){
417
- console.log("看看:",index,val)
418
- this.materials[index].f_material_code = val
419
- },
420
- closeMaterials () {
421
- this.getOnetoManyData()
422
- this.showMaterialModal = false
423
- },
424
- async bjqCheck(){
425
- //报警器设备型号校验
426
- this.bjqChecklag = [] //初始化
427
- if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
428
- let bjqinfo = {
429
- f_material_name : "",
430
- f_bjq_sid: ""
431
- }
432
- for (const bjqinfoElement of this.materials) {
433
- bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
434
- bjqinfo.f_material_name = bjqinfoElement.f_material_name
435
- if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
436
- let http = new HttpResetClass()
437
- let res = await http.load(
438
- 'POST',
439
- // `/rs/logic/bjqcheck`,
440
- `ncc/rs/logic/bjqcheck`,
441
- bjqinfo
442
- )
443
- if (res.data.code != 200){
444
- this.bjqChecklag.push(res.data.code)
445
- // this.$showMessage(res.data.msg)
446
- Vue.showAlert(res.data.msg, 'danger', 6000)
447
- return
448
- }
449
- }
450
- }
451
- }
452
- }
453
- },
454
- events: {
455
- 'beforeFileUpload' (file) {
456
- this.showWork = true
457
- },
458
- async 'onFileUpload'(file, result) {
459
- let data = {
460
- selectdata: this.selectdata,
461
- filepath: result.f_downloadpath,
462
- user: this.$login.f
463
- }
464
- try {
465
- let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
466
- resolveMsg: null,
467
- rejectMsg: '导入失败!!!',
468
- silent: true
469
- }, 0)
470
- } catch (e) {
471
- this.closeFile()
472
- }
473
- this.$dispatch('breakControl', this.selectdata)
474
- }
475
- },
476
- }
477
-
478
- </script>
479
-
480
- <style scoped>
481
-
482
- </style>
1
+ <template>
2
+ <div>
3
+ <data-grid :model="onetomany" class="list_area table_sy">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">序号</th>
7
+ <th class="textNoLineBreak">材料名称</th>
8
+ <th class="textNoLineBreak">材料单位</th>
9
+ <th class="textNoLineBreak">材料单价</th>
10
+ <th class="textNoLineBreak">材料数量</th>
11
+ <th class="textNoLineBreak">材料金额</th>
12
+ <th class="textNoLineBreak">材料备注</th>
13
+ <th class="textNoLineBreak">材料总金额:{{$parent.$parent.summoney}}</th>
14
+ <th class="textNoLineBreak" v-if="$parent.$parent.selectdata.defname=='通气点火'">点火材料金额:{{$parent.$parent.twomoney}}</th>
15
+ <th class="textNoLineBreak">
16
+ <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
17
+ <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
18
+ @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
19
+ <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
20
+ href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>
21
+ </th>
22
+ </tr>
23
+ </template>
24
+ <template partial='body'>
25
+ <tr>
26
+ <td style="text-align: center;">
27
+ <nobr>{{$index+1}}</nobr>
28
+ </td>
29
+ <td style="text-align: center;">
30
+ <nobr>{{row.f_material_name}}</nobr>
31
+ </td>
32
+ <td style="text-align: center;">
33
+ <nobr>{{row.f_material_unit}}</nobr>
34
+ </td>
35
+ <td style="text-align: center;">
36
+ <nobr>{{row.f_material_price}}</nobr>
37
+ </td>
38
+ <td style="text-align: center;">
39
+ <nobr>{{row.f_material_number}}</nobr>
40
+ </td>
41
+ <td style="text-align: center;">
42
+ <nobr>{{row.f_material_money}}</nobr>
43
+ </td>
44
+ <td style="text-align: center;">
45
+ <nobr>{{row.f_operator}}</nobr>
46
+ </td>
47
+ <td style="text-align: center;">
48
+ <!-- <button type="button" class="button_search button_spacing" :disabled="row.f_operator==this.$login.f.name ? false : true" @click="$parent.$parent.updateMaterial($index,row)">修改</button>-->
49
+ <button type="button" class="button_delete button_spacing":disabled="row.f_operator==this.$login.f.name ? false : true" @click="$parent.$parent.deleteMaterial(row)">删除</button>
50
+ </td>
51
+ </tr>
52
+ </template>
53
+ </data-grid>
54
+ <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
55
+ <header slot="modal-header" class="modal-header">
56
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
57
+ <h4 class="modal-title">选择文件</h4>
58
+ </header>
59
+ <article slot="modal-body" class="modal-body">
60
+ <div class="form-group">
61
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
62
+ </div>
63
+ </article>
64
+ <footer slot="modal-footer" class="modal-footer"></footer>
65
+ </modal>
66
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
67
+ :backdrop="false" :title="title">
68
+ <header slot="modal-header" class="modal-header">
69
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
70
+ <h4 class="modal-title">{{title}}</h4>
71
+ </header>
72
+ <article slot="modal-body" class="modal-body clearfix">
73
+ <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
74
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
75
+ <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
76
+ <div class="col-sm-6 text-right"><button
77
+ class="button_delete button_spacing"
78
+ @click.prevent="deleteDevicesinfo(i)"
79
+ v-if="title === '新增'"
80
+ >删除</button></div>
81
+ </div>
82
+ <div class="form-group col-sm-6">
83
+ <label class="col-sm-4 control-label">选择材料:</label>
84
+ <div class="col-sm-8">
85
+ <input-select
86
+ class="select select_list"
87
+ :value.sync="item.material"
88
+ v-model="item.material"
89
+ :options="meterialOptions"
90
+ :disable="mark === 1"
91
+ @change="modifyOtherValue(i)"
92
+ :valueSingle="true"></input-select>
93
+ </div>
94
+ </div>
95
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
96
+ <label class="col-sm-4 control-label">材料名称:</label>
97
+ <div class="col-sm-8">
98
+ <input class="form-control input_view" style="" type="text"
99
+ placeholder="材料名称"
100
+ v-model="item.f_material_name"
101
+ :value="item.f_material_name"
102
+ />
103
+ </div>
104
+ </div>
105
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : '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_unit"
111
+ :value="item.f_material_unit"
112
+ />
113
+ </div>
114
+ </div>
115
+ <div class="form-group col-sm-6" :class="[item.f_material_price ? '' : '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_price"
121
+ :value="item.f_material_price"
122
+ />
123
+ </div>
124
+ </div>
125
+ <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : '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="number"
129
+ placeholder="设备数量"
130
+ v-model="item.f_material_number"
131
+ :value="item.f_material_number"
132
+ @change="sumMaterialmoney(i)"
133
+ />
134
+ </div>
135
+ </div>
136
+ <div class="form-group col-sm-6">
137
+ <label class="col-sm-4 control-label">材料金额:</label>
138
+ <div class="col-sm-8">
139
+ <input class="form-control input_view" style="" type="text"
140
+ placeholder="材料金额"
141
+ v-model="item.f_material_money"
142
+ :value="item.f_material_money"
143
+ />
144
+ </div>
145
+ </div>
146
+ <div class="form-group col-sm-6">
147
+ <label class="col-sm-4 control-label">材料备注:</label>
148
+ <div class="col-sm-8">
149
+ <input class="form-control input_view" style=""
150
+ placeholder="材料备注"
151
+ v-model="item.f_material_remarks"
152
+ :value.sync="item.f_material_remarks"
153
+ />
154
+ </div>
155
+ </div>
156
+ </div>
157
+
158
+ </article>
159
+ <footer slot="modal-footer" class="modal-footer">
160
+ <template v-if="mark !== 1">
161
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
162
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
163
+ <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
164
+ </template>
165
+ </footer>
166
+ </modal>
167
+ <apply-eticke-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></apply-eticke-print>
168
+
169
+ </div>
170
+ </template>
171
+
172
+ <script>
173
+ import {HttpResetClass} from 'vue-client'
174
+ import Vue from "vue";
175
+ export default {
176
+ name: 'addMaterialScience',
177
+ props: {
178
+ selectdata: {
179
+ type: Object
180
+ },
181
+ mark: {
182
+ type: Number,
183
+ default: 0
184
+ }
185
+ },
186
+ data () {
187
+ return {
188
+ showFile: false,
189
+ onetomany: {
190
+ rows: []
191
+ },
192
+ title:'新增',
193
+ summoney:0,
194
+ showMaterialModal:false,
195
+ eticket_show:false,
196
+ twomoney:0,
197
+ materials:[
198
+ {
199
+ material:'',
200
+ f_material_name:'',
201
+ f_material_unit:'',
202
+ f_material_price:'',
203
+ f_material_number:'',
204
+ f_material_money:'',
205
+ f_material_remarks:''
206
+ }
207
+ ],
208
+ meterialOptions:[],
209
+ row:{},
210
+ bjqChecklag:[]
211
+ }
212
+ },
213
+ ready(){
214
+ this.getOnetoManyData()
215
+ console.log('打印登陆人',this.$login.f.name)
216
+ },
217
+ methods: {
218
+ sumMaterialzong(materials){
219
+ debugger
220
+ this.summoney=0
221
+ for(var i=0;i<materials.length; i++){
222
+ this.summoney =parseFloat(parseFloat(materials[i].f_material_money)+ parseFloat(this.summoney)).toFixed(2)
223
+ }
224
+ this.twomoney= parseFloat(parseFloat(this.summoney)- parseFloat(this.selectdata.f_sumtwo_money)).toFixed(2)
225
+ console.log('打印材料总金额',this.summoney)
226
+ if(this.selectdata.defname=='工程施工'){
227
+ this.selectdata.f_sumtwo_money = this.summoney
228
+ console.log('打印首次材料金额',this.selectdata.f_sumtwo_money)
229
+ }
230
+ },
231
+ sumMaterialmoney(index){
232
+ debugger
233
+ this.materials[index].f_material_money = this.materials[index].f_material_price * this.materials[index].f_material_number
234
+ console.log('打印',this.materials[index].f_material_money)
235
+ },
236
+ async getOnetoManyData () {
237
+ let data = {
238
+ tablename: `t_material_detail`,
239
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
240
+ }
241
+ let res = await this.$resetpost(
242
+ 'rs/sql/singleTable',
243
+ {data: data},
244
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
245
+ )
246
+ this.onetomany.rows = res.data
247
+ this.sumMaterialzong(this.onetomany.rows)
248
+ },
249
+ async openMaterialModal () {
250
+ this.getMateralNames()
251
+ this.title = '新增'
252
+ this.materials = [
253
+ {
254
+ material:'',
255
+ f_material_name:'',
256
+ f_material_unit:'',
257
+ f_material_price:'',
258
+ f_material_number:'',
259
+ f_material_money:'',
260
+ f_material_remarks:''
261
+ }
262
+ ],
263
+ this.showMaterialModal = true
264
+ },
265
+ closeFile() {
266
+ this.showWork = false
267
+ this.showFile = false
268
+ // 将选的文件清空
269
+ this.$refs.file.$el.querySelector('input').value = ''
270
+ this.search()
271
+ },
272
+ deleteDevicesinfo (index) {
273
+ this.materials.splice(index, 1)
274
+ },
275
+ pushMaterial () {
276
+ this.materials.push({
277
+ material:'',
278
+ f_material_name:'',
279
+ f_material_unit:'',
280
+ f_material_price:'',
281
+ f_material_number:'',
282
+ f_material_money:'',
283
+ f_material_remarks:''
284
+ })
285
+ },
286
+ // 获取模态框材料
287
+ async getMateralNames () {
288
+ let data = {
289
+ condition: `1=1`
290
+ }
291
+ let http = new HttpResetClass()
292
+ let res = await http.load(
293
+ 'POST',
294
+ `rs/sql/getStockMaterial`,
295
+ {data: data},
296
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
297
+ )
298
+
299
+ this.meterialOptions = res.data.map(item => {
300
+ return {
301
+ 'label': `${item.f_material_name}`,
302
+ 'value': item
303
+ }
304
+ })
305
+ },
306
+ modifyOtherValue (index){
307
+ console.log("进来了",index)
308
+ console.log("dddd",this.materials[index].material)
309
+ let material = this.materials[index].material
310
+ this.materials[index].f_material_name = material.f_material_name
311
+ this.materials[index].f_material_unit = material.f_material_unit
312
+ this.materials[index].f_material_price = material.f_material_price
313
+ this.materials[index].f_material_number = material.f_material_number
314
+ this.materials[index].f_material_money = material.f_material_money
315
+ },
316
+ // 新增材料
317
+ async addMaterial () {
318
+ console.log("登录信息:",this.$login.f)
319
+ this.title = '新增'
320
+ let data = {
321
+ selectdata:this.selectdata,
322
+ f_process_id : this.selectdata.f_process_id,
323
+ f_operator_id: this.$login.f.id,
324
+ f_operator: this.$login.f.name,
325
+ f_department_name:this.$login.f.f_department_name,
326
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
327
+ f_orgid: this.$login.f.orgid,
328
+ f_orgname: this.$login.f.orgs,
329
+ materials:this.materials
330
+ }
331
+ //报警器流程 设备编号检验
332
+ await this.bjqCheck()
333
+ console.log("这是bjqChecklag数据:",this.bjqChecklag)
334
+ if (this.bjqChecklag.length > 0){
335
+ return
336
+ }
337
+ let res = await this.$resetpost(
338
+ `rs/logic/saveMaterials`,
339
+ data
340
+ )
341
+ debugger
342
+ // if(res.data == 200){
343
+ //
344
+ // // let contractbu={
345
+ // // f_contract_money:money,
346
+ // // f_contract_type:'材料合同'
347
+ // // }
348
+ // // let data ={
349
+ // // contract:contractbu,
350
+ // // selectdata: this.selectdata,
351
+ // // user: this.$login.f,
352
+ // // }
353
+ // // let http1 = new HttpResetClass()
354
+ // // let res = await http1.load(
355
+ // // 'POST',
356
+ // // `rs/logic/saveReplenishContract`,
357
+ // // {data: data},
358
+ // // {resolveMsg: null, rejectMsg: '补充协议成功!!!'}
359
+ // // )
360
+ // }
361
+ this.closeMaterials()
362
+ },
363
+ async deleteMaterial (row) {
364
+ var show1 = window.confirm('您确定要删除这条记录吗?')
365
+ if(show1 != true){
366
+ this.closeMaterials()
367
+ }else{
368
+ debugger
369
+ let http = new HttpResetClass()
370
+ let res = await http.load(
371
+ 'POST',
372
+ `rs/logic/deleteMaterial`,
373
+ {data: row},
374
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
375
+ )
376
+ this.closeMaterials()
377
+ }
378
+
379
+ },
380
+ async updateMaterial (index,row) {
381
+ this.title = '修改'
382
+ this.row = row
383
+ this.getMateralNames()
384
+ this.materials = [
385
+ {
386
+ material:'',
387
+ f_material_name:row.f_material_name,
388
+ f_material_unit:row.f_material_unit,
389
+ f_material_price:row.f_material_price,
390
+ f_material_number:row.f_material_number,
391
+ f_material_money:row.f_material_money,
392
+ f_material_remarks: row.f_material_remarks
393
+ }
394
+ ]
395
+ this.showMaterialModal = true
396
+ },
397
+ async updateConfirm () {
398
+ let data = this.row
399
+ data.f_material_name = this.materials[0].f_material_name
400
+ data.f_material_unit = this.materials[0].f_material_unit
401
+ data.f_material_price = this.materials[0].f_material_price
402
+ data.f_material_number = this.materials[0].f_material_number
403
+ data.f_material_money = this.materials[0].f_material_money
404
+ data.f_material_remarks = this.materials[0].f_material_remarks
405
+ //报警器流程 设备编号检验
406
+ await this.bjqCheck()
407
+ if (this.bjqChecklag.length > 0){
408
+ return
409
+ }
410
+ let res = await this.$resetpost(
411
+ `rs/entity/t_material_detail`,
412
+ data
413
+ )
414
+ this.closeMaterials()
415
+ },
416
+ sycronizedCode(index,val){
417
+ console.log("看看:",index,val)
418
+ this.materials[index].f_material_code = val
419
+ },
420
+ closeMaterials () {
421
+ this.getOnetoManyData()
422
+ this.showMaterialModal = false
423
+ },
424
+ async bjqCheck(){
425
+ //报警器设备型号校验
426
+ this.bjqChecklag = [] //初始化
427
+ if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
428
+ let bjqinfo = {
429
+ f_material_name : "",
430
+ f_bjq_sid: ""
431
+ }
432
+ for (const bjqinfoElement of this.materials) {
433
+ bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
434
+ bjqinfo.f_material_name = bjqinfoElement.f_material_name
435
+ if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
436
+ let http = new HttpResetClass()
437
+ let res = await http.load(
438
+ 'POST',
439
+ // `/rs/logic/bjqcheck`,
440
+ `ncc/rs/logic/bjqcheck`,
441
+ bjqinfo
442
+ )
443
+ if (res.data.code != 200){
444
+ this.bjqChecklag.push(res.data.code)
445
+ // this.$showMessage(res.data.msg)
446
+ Vue.showAlert(res.data.msg, 'danger', 6000)
447
+ return
448
+ }
449
+ }
450
+ }
451
+ }
452
+ }
453
+ },
454
+ events: {
455
+ 'beforeFileUpload' (file) {
456
+ this.showWork = true
457
+ },
458
+ async 'onFileUpload'(file, result) {
459
+ let data = {
460
+ selectdata: this.selectdata,
461
+ filepath: result.f_downloadpath,
462
+ user: this.$login.f
463
+ }
464
+ try {
465
+ let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
466
+ resolveMsg: null,
467
+ rejectMsg: '导入失败!!!',
468
+ silent: true
469
+ }, 0)
470
+ } catch (e) {
471
+ this.closeFile()
472
+ }
473
+ this.$dispatch('breakControl', this.selectdata)
474
+ }
475
+ },
476
+ }
477
+
478
+ </script>
479
+
480
+ <style scoped>
481
+
482
+ </style>