apply-clients 3.4.25 → 3.4.26

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