apply-clients 3.5.5-21 → 3.5.5-22

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.
@@ -1,634 +1,628 @@
1
- <template>
2
- <div>
3
- <data-grid :model="onetomany" class="list_area table_sy">
4
- <template partial='head'>
5
- <tr>
6
- <th class="textNoLineBreak">序号</th>
7
- <th class="textNoLineBreak">材料名称</th>
8
- <th class="textNoLineBreak">材料型号</th>
9
- <th class="textNoLineBreak">材料单位</th>
10
- <th class="textNoLineBreak">材料数量</th>
11
- <th class="textNoLineBreak">材料编号</th>
12
- <th class="textNoLineBreak">材料标识</th>
13
- <th class="textNoLineBreak">用户编号</th>
14
- <th class="textNoLineBreak">
15
- <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加
16
- </button>
17
- </th>
18
- </tr>
19
- </template>
20
- <template partial='body'>
21
- <tr>
22
- <td style="text-align: center;">
23
- <nobr>{{$index+1}}</nobr>
24
- </td>
25
- <td style="text-align: center;">
26
- <nobr>{{row.f_material_name}}</nobr>
27
- </td>
28
- <td style="text-align: center;">
29
- <nobr>{{row.f_material_style}}</nobr>
30
- </td>
31
- <td style="text-align: center;">
32
- <nobr>{{row.f_material_unit}}</nobr>
33
- </td>
34
- <td style="text-align: center;">
35
- <nobr>{{row.f_material_number}}</nobr>
36
- </td>
37
- <td style="text-align: center;">
38
- <nobr>{{row.f_bjq_sid}}</nobr>
39
- </td>
40
- <td style="text-align: center;">
41
- <nobr>{{row.f_material_code}}</nobr>
42
- </td>
43
- <td style="text-align: center;">
44
- <nobr>{{row.f_userinfo_code}}</nobr>
45
- </td>
46
- <td style="text-align: center;">
47
- <!-- <button type="button" class="button_search button_spacing"-->
48
- <!-- @click="$parent.$parent.updateMaterial($index,row)">修改-->
49
- <!-- </button>-->
50
- <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除
51
- </button>
52
- </td>
53
- </tr>
54
- </template>
55
- </data-grid>
56
- <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
57
- :backdrop="false" :title="title">
58
- <header slot="modal-header" class="modal-header">
59
- <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
60
- <h4 class="modal-title">{{title}}</h4>
61
- </header>
62
- <article slot="modal-body" class="modal-body clearfix">
63
- <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
64
- <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
65
- <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
66
- <div class="col-sm-6 text-right">
67
- <button
68
- class="button_delete button_spacing"
69
- @click.prevent="deleteDevicesinfo(i)"
70
- v-if="title === '新增'"
71
- >删除
72
- </button>
73
- </div>
74
- </div>
75
- <div class="form-group col-sm-6">
76
- <label class="col-sm-4 control-label">选择材料:</label>
77
- <div class="col-sm-8">
78
- <input-select
79
- class="select select_list"
80
- :value.sync="item.material"
81
- v-model="item.material"
82
- :options="meterialOptions"
83
- :disable="mark === 1"
84
- @change="modifyOtherValue(i)"
85
- :valueSingle="true"></input-select>
86
- </div>
87
- </div>
88
- <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
89
- <label class="col-sm-4 control-label">材料名称:</label>
90
- <div class="col-sm-8">
91
- <input class="form-control input_view" style="" type="text"
92
- placeholder="材料名称"
93
- v-model="item.f_material_name"
94
- :value="item.f_material_name"
95
- />
96
- </div>
97
- </div>
98
- <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']">
99
- <label class="col-sm-4 control-label">材料型号:</label>
100
- <div class="col-sm-8">
101
- <input class="form-control input_view" style="" type="text"
102
- placeholder="材料型号"
103
- v-model="item.f_material_style"
104
- :value="item.f_material_style"
105
- />
106
- </div>
107
- </div>
108
- <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
109
- <label class="col-sm-4 control-label">材料单位:</label>
110
- <div class="col-sm-8">
111
- <input class="form-control input_view" style="" type="text"
112
- placeholder="材料单位"
113
- v-model="item.f_material_unit"
114
- :value="item.f_material_unit"
115
- />
116
- </div>
117
- </div>
118
- <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
119
- <label class="col-sm-4 control-label">材料数量:</label>
120
- <div class="col-sm-8">
121
- <input class="form-control input_view" style="" type="number"
122
- placeholder="设备数量"
123
- v-model="item.f_material_number"
124
- :value="item.f_material_number"
125
- />
126
- </div>
127
- </div>
128
- <div class="form-group col-sm-6">
129
- <label class="col-sm-4 control-label">材料编号:</label>
130
- <div class="col-sm-8">
131
- <input class="form-control input_view" style="" type="text"
132
- placeholder="材料编号"
133
- v-model="item.f_bjq_sid"
134
- :value="item.f_bjq_sid"
135
- />
136
- </div>
137
- </div>
138
- <div class="form-group col-sm-6">
139
- <label class="col-sm-4 control-label">材料标识:</label>
140
- <div class="col-sm-8">
141
- <input class="form-control input_view" style=""
142
- placeholder="材料标识"
143
- v-model="item.f_material_code"
144
- :value.sync="item.f_material_code"
145
- />
146
- </div>
147
- </div>
148
- <div class="form-group col-sm-6">
149
- <label class="col-sm-4 control-label">用户编号:</label>
150
- <div class="col-sm-8">
151
- <input class="form-control input_view" style=""
152
- placeholder="用户编号"
153
- v-model="item.f_userinfo_code"
154
- :value.sync="item.f_userinfo_code"
155
- />
156
- </div>
157
- </div>
158
- <div class="form-group col-sm-6">
159
- <label class="col-sm-4 control-label"></label>
160
- <div class="col-sm-8">
161
-
162
- </div>
163
- </div>
164
- <div class="form-group col-sm-6">
165
- <label class="col-sm-4 control-label"></label>
166
- <div class="col-sm-8">
167
-
168
- </div>
169
- </div>
170
- <div class="form-group col-sm-6">
171
- <label class="col-sm-4 control-label"></label>
172
- <div class="col-sm-8">
173
-
174
- </div>
175
- </div>
176
- <div class="form-group col-sm-6">
177
- <label class="col-sm-4 control-label"></label>
178
- <div class="col-sm-8">
179
-
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
-
186
- </div>
187
- </div>
188
- <div class="form-group col-sm-6">
189
- <label class="col-sm-4 control-label"></label>
190
- <div class="col-sm-8">
191
-
192
- </div>
193
- </div>
194
- <div class="form-group col-sm-6">
195
- <label class="col-sm-4 control-label"></label>
196
- <div class="col-sm-8">
197
-
198
- </div>
199
- </div>
200
- <div v-if=" (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建')">
201
- <app-qrcode-reader :istype = fmaterialname :index = i v-show="isShow[i]"></app-qrcode-reader>
202
- </div>
203
- </div>
204
- </article>
205
- <footer slot="modal-footer" class="modal-footer">
206
- <template v-if="mark !== 1">
207
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
208
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()"
209
- :disabled="!$v.valid">确认添加
210
- </button>
211
- <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()"
212
- :disabled="!$v.valid">确认修改
213
- </button>
214
- </template>
215
- </footer>
216
- </modal>
217
- </div>
218
- </template>
219
-
220
- <script>
221
- import Vue from 'vue'
222
- import {HttpResetClass} from 'vue-client'
223
-
224
- export default {
225
- name: 'addMaterialScience',
226
- props: {
227
- selectdata: {
228
- type: Object
229
- }
230
- },
231
- data() {
232
- return {
233
- onetomany: {
234
- rows: []
235
- },
236
- title: '新增',
237
- showMaterialModal: false,
238
- materials: [
239
- {
240
- f_material_price: '',
241
- material: '',
242
- f_material_name: '',
243
- f_material_style: '',
244
- f_material_unit: '',
245
- f_material_number: '',
246
- f_bjq_sid: '',
247
- f_material_code: '',
248
- f_userinfo_code:'',
249
- f_logotype:''
250
- }
251
- ],
252
- meterialOptions: [],
253
- row: {},
254
- bjqChecklag:[],
255
- fmaterialname:{},
256
- isShow:[false]
257
- }
258
- },
259
- ready() {
260
- this.getOnetoManyData()
261
- },
262
- methods: {
263
- async getOnetoManyData () {
264
- let http = new HttpResetClass()
265
- let data = {
266
- tablename: `t_material_apply`,
267
- condition: `f_process_id='${this.selectdata.f_process_id}'`
268
- }
269
- let res = await http.load(
270
- 'POST',
271
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable?aaa=123`,
272
- {data: data},
273
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
274
- )
275
- this.onetomany.rows = res.data
276
- },
277
- async openMaterialModal() {
278
- this.getMateralNames()
279
- this.title = '新增'
280
- this.materials = [
281
- {
282
- f_material_price: '',
283
- material: '',
284
- f_material_name: '',
285
- f_material_style: '',
286
- f_material_unit: '',
287
- f_material_number: '',
288
- f_bjq_sid: '',
289
- f_material_code: '',
290
- f_userinfo_code: '',
291
- f_logotype:''
292
- }
293
- ],
294
- this.showMaterialModal = true
295
- this.isShow = [false]
296
- },
297
- deleteDevicesinfo(index) {
298
- this.materials.splice(index, 1)
299
- this.isShow.splice(index, 1)
300
- },
301
- pushMaterial() {
302
- this.materials.push({
303
- f_material_price: '',
304
- material: '',
305
- f_material_name: '',
306
- f_material_style: '',
307
- f_material_unit: '',
308
- f_material_number: '',
309
- f_bjq_sid: '',
310
- f_material_code: '',
311
- f_userinfo_code: '',
312
- f_logotype:''
313
- })
314
- this.isShow.push(false)
315
- },
316
- async getMateralNames () {
317
- let http1 = new HttpResetClass()
318
- let res1 = await http1.load(
319
- 'POST',
320
- `rs/logic/yongyouLogin`,
321
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
322
- )
323
- if (res1.data=== 200){
324
- let http = new HttpResetClass()
325
- let res2 = await http.load(
326
- 'POST',
327
- `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouMaterial`,
328
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
329
- )
330
- this.meterialOptions = res2.data.map(item => {
331
- return {
332
- 'label': `${item.name}--${item.spec}--${item.smallnumname}`,
333
- 'value': item
334
- }
335
- })
336
- }
337
- },
338
- // 获取模态框材料
339
- // async getMateralNames() {
340
- // let data = {
341
- // condition: `1=1`
342
- // }
343
- // let http = new HttpResetClass()
344
- // let res = await http.load(
345
- // 'POST',
346
- // `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
347
- // {data: data},
348
- // {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
349
- // )
350
- //
351
- // this.meterialOptions = res.data.map(item => {
352
- // return {
353
- // 'label': `${item.f_material_name}--${item.f_material_style}`,
354
- // 'value': item
355
- // }
356
- // })
357
- // },
358
- modifyOtherValue(index) {
359
- console.log("进来了", index)
360
- console.log("dddd", this.materials[index].material)
361
- if(this.materials[index].material){
362
- let material = this.materials[index].material
363
- this.materials[index].f_material_price=0
364
- this.materials[index].f_material_name = material.name
365
- this.materials[index].f_material_style = material.spec
366
- this.materials[index].f_material_unit = material.smallnumname
367
- this.materials[index].f_material_number = material.f_material_number
368
- this.materials[index].f_material_code = material.code
369
- this.materials[index].f_bjq_sid=material.pk
370
- this.materials[index].f_userinfo_code = material.f_userinfo_code
371
- if (material.f_material_name === "报警器-汉威") {
372
- this.isShow[index] = true
373
- } else {
374
- this.isShow[index] = false
375
- }
376
- this.isShow.splice(0, 1, this.isShow[0])
377
- }else{
378
- this.materials[index].f_material_price =''
379
- this.materials[index].f_material_name = ''
380
- this.materials[index].f_material_style = ''
381
- this.materials[index].f_material_unit =''
382
- this.materials[index].f_material_number = ''
383
- this.materials[index].f_material_code =''
384
- this.materials[index].f_bjq_sid=''
385
- this.materials[index].f_userinfo_code =''
386
- }
387
- },
388
- // 新增材料
389
- async addMaterial() {
390
- //调用用友保存材料接口
391
- for (let i = 0; i < this.materials.length; i++) {
392
- let obj={
393
- "pk_group": "H", // 集团【集团】
394
- "pk_org": "30", // 销售组织【组织_业务单元_销售组织】
395
- "pk_org_v": "30", // 销售组织【组织_业务单元_销售组织】
396
- "carorgid": "30", // 应收组织最新版本【财务组织】
397
- "carorgvid": "30", // 应收组织【财务组织版本】
398
- "csendstockorgid": "30", // 发货库存组织最新版本【库存组织】
399
- "csendstockorgvid": "30", // 发货库存组织【库存组织版本】
400
- "csettleorgid": "30", // 结算财务组织最新版本【财务组织】
401
- "csettleorgvid": "30", // 结算财务组织【财务组织版本】
402
- "creceivecustid": "11099", // 收货客户【客户档案】
403
- "ctaxcountryid": "0001Z010000000079UJJ", // 报税国家 / 地区【国家地区】
404
- "crececountryid": "0001Z010000000079UJJ", // 收货国家 / 地区【国家地区】
405
- "csendcountryid": "0001Z010000000079UJJ", // 发货国家 / 地区【国家地区】
406
- "cmaterialid": this.materials[i].f_material_code, // 物料最新版本【物料】
407
- "cmaterialvid": this.materials[i].f_material_code, // 物料编码【物料(多版本)】
408
- "cqtunitid":this.materials[i].f_material_unit==='米'?"MTR":"EA", // 报价单位【计量单位】
409
- "cunitid": this.materials[i].f_material_unit==='米'?"MTR":"EA", // 主单位【计量单位】MTR=米 EA=个
410
- "castunitid": this.materials[i].f_material_unit==='米'?"MTR":"EA", // 单位【计量单位】MTR=米 EA=个
411
- "vqtunitrate": "1.00/1.00", // 报价换算率【】数量转主数量的换算比例
412
- "vchangerate": "1.00/1.00", // 换算率【】数量转主数量的换算比例
413
- "nvolume": "0", // 体积【】
414
- "nweight": "0", // 重量【】
415
- "nastnum": this.materials[i].f_material_number, // 数量【】pk_group, pk_org, ,
416
- "nnum": this.materials[i].f_material_number, // 主数量【】
417
- "nqtunitnum": this.materials[i].f_material_number, // 报价单位数量【】
418
- "ndiscountrate": "100.00", // 整单折扣【】
419
- "nitemdiscountrate": "100.00", // 单品折扣【】
420
- "norigdiscount": "0.00", // 折扣额【】
421
- "nexchangerate": 1.00, // 折本汇率【】
422
- "ccurrencyid": "CNY", // 本位币【币种档案】
423
- "nqtprice": "1.000000", // 本币无税单价【】
424
- "nqtorigprice": "1.000000", // 无税单价【】
425
- "norigprice": "1.000000", // 主无税单价【】
426
- "nprice": "1.000000", // 主本币无税单价【】
427
- "nqtorigtaxprice": "1.130000", // 含税单价【】
428
- "nqttaxprice": "1.130000", // 本币含税单价【】
429
- "norigtaxprice": "1.130000", // 主含税单价【】
430
- "ctaxcodeid": "1001Z01000000003W0WZ", // 税码【】
431
- "ntaxrate": "13.00", // 税率【】
432
- "ntax": "14.56", // 税额【】
433
- "nqtorignetprice": "1.000000", // 无税净价【】
434
- "norignetprice": "1.000000", // 主无税净价【】
435
- "nnetprice": "1.000000", // 主本币无税净价【】
436
- "nqtnetprice": "1.000000", // 本币无税净价【】
437
- "nqtorigtaxnetprc": "1.130000", // 含税净价【】
438
- "norigtaxnetprice": "1.130000", // 主含税净价【】
439
- "nqttaxnetprice": "1.130000", // 本币含税净价【】
440
- "ntaxnetprice": "1.130000", // 主本币含税净价【】
441
- "norigmny": "112.00", // 无税金额【】
442
- "ncaltaxmny": "112.00", // 计税金额【】
443
- "nmny": "126.56", // 本币价税合计【】
444
- "norigtaxmny": "126.56", // 价税合计【】
445
- "ntaxmny": "126.56", // 本币价税合计【】
446
- "dplandate": "2025-04-24 00:00:00", // 到货日期【】
447
- "dreceivedate": "2025-04-24 00:00:00", // 到货日期【】
448
- "dsenddate": "2025-04-24 00:00:00", // 发货日期【】
449
- "vbatchcode": "", // 批次号【】
450
- "blargessflag": "N", // 赠品【】
451
- "vrownote": "11月", // 行备注【】
452
- //"cprojectid": "", // 项目【项目】
453
- "csendstordocid": "02", // 发货仓库【仓库】 02=客服仓
454
- "barrangedflag": "N", // 是否货源安排完毕【】
455
- "bbarsettleflag": "N", // 收入结算关闭【】
456
- "bbcostsettleflag": "N", // 成本结算关闭【】
457
- "bbindflag": "N", // 捆绑存货【】
458
- "bbinvoicendflag": "N", // 开票关闭【】
459
- "bboutendflag": "N", // 出库关闭【】
460
- "bbsendendflag": "N", // 发货关闭【】
461
- "bbsettleendflag": "N", // 结算关闭【】
462
- "bdiscountflag": "N", // 折扣类【】
463
- "bjczxsflag": "N", // 借出转销售【】
464
- "blaborflag": "N", // 服务类【】
465
- "blrgcashflag": "N", // 赠品兑付【】
466
- "bprerowcloseflag": "N", // 预订单行关闭【】
467
- "btriatradeflag": "N", // 三角贸易【】
468
- "fbuysellflag": "1", // 购销类型【1 = 国内销售,2 = 国内采购,3 = 出口,4 = 进口,5 = 不区分】
469
- "flargesstypeflag": "1", // 赠品价格分摊方式【1 = 未分摊,2 = 被分摊物料,3 = 分摊赠品】
470
- "fretexchange": "0", // 退换货标记【0 = 非退换货,1 = 退货,2 = 换货】
471
- "frowstatus": "1", // 行状态【1 = 自由,2 = 审批通过,3 = 冻结,4 = 关闭,7 = 审批中,8 = 审批不通过,5 = 失效】
472
- "ftaxtypeflag": "1", // 扣税类别【1 = 应税外加,0 = 应税内含】
473
- "ndiscount": "1" // 本币折扣额【】
474
- }
475
- this.requestBody.so_saleorder_b.push(obj)
476
- }
477
- let http2 = new HttpResetClass()
478
- let res2 = await http2.load(
479
- 'POST',
480
- `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouSaveMaterial`,
481
- {data: {
482
- body:this.requestBody
483
- }
484
- },
485
- {resolveMsg: null, rejectMsg: '材料推送失败!!!'}
486
- )
487
- if (res2.data.status == 200) {
488
- let pk=res2.data.pk
489
- for (let i = 0; i < this.materials.length; i++) {
490
- this.materials[i].f_logotype=pk
491
- }
492
- }
493
- this.title = '新增'
494
- let data = {
495
- f_process_id: this.selectdata.f_process_id,
496
- f_operator_id: Vue.user.id,
497
- f_operator: Vue.user.name,
498
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
499
- f_orgid: Vue.user.orgid,
500
- f_orgname: Vue.user.orgs,
501
- materials: this.materials
502
- }
503
-
504
- //报警器流程 设备编号检验
505
- await this.bjqCheck()
506
- if (this.bjqChecklag.length > 0) {
507
- return
508
- }
509
-
510
- let http = new HttpResetClass()
511
- let res = await http.load(
512
- 'POST',
513
- `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterials`,
514
- data
515
- )
516
-
517
- this.closeMaterials()
518
- },
519
- async deleteMaterial(row) {
520
- var show1 = window.confirm('您确定要删除这条记录吗?')
521
- if(show1 != true){
522
- this.closeMaterials()
523
- }else{
524
- let http = new HttpResetClass()
525
- let sql = `delete from t_material_apply where f_logotype='${row.f_logotype}'`
526
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/runSQL`, {data: {sql: sql}}, {
527
- resolveMsg: null,
528
- rejectMsg: '作废失败!!!'
529
- })
530
- let http2 = new HttpResetClass()
531
- let res2 = await http2.load(
532
- 'POST',
533
- `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouDelMaterial`,
534
- {data: {
535
- body:{
536
- pk:row.f_logotype
537
- }
538
- }
539
- },
540
- {resolveMsg: null, rejectMsg: '材料推送失败!!!'}
541
- )
542
- this.closeMaterials()
543
- }
544
- }
545
- ,
546
- async updateMaterial(index, row) {
547
- this.title = '修改'
548
- this.row = row
549
- this.getMateralNames()
550
- this.materials = [
551
- {
552
- material: '',
553
- f_material_price: row.f_material_price,
554
- f_material_name: row.f_material_name,
555
- f_material_style: row.f_material_style,
556
- f_material_unit: row.f_material_unit,
557
- f_material_number: row.f_material_number,
558
- f_material_code: row.f_material_code,
559
- f_bjq_sid: row.f_bjq_sid,
560
- f_userinfo_code: row.f_userinfo_code
561
- }
562
- ]
563
- this.showMaterialModal = true
564
- },
565
- async updateConfirm() {
566
- let data = this.row
567
- data.f_material_price = this.materials[0].f_material_price
568
- data.f_material_name = this.materials[0].f_material_name
569
- data.f_material_style = this.materials[0].f_material_style
570
- data.f_material_unit = this.materials[0].f_material_unit
571
- data.f_material_number = this.materials[0].f_material_number
572
- data.f_material_code = this.materials[0].f_material_code
573
- data.f_bjq_sid = this.materials[0].f_bjq_sid
574
- data.f_userinfo_code=this.materials[0].f_userinfo_code
575
-
576
- //报警器流程 设备编号检验
577
- await this.bjqCheck()
578
- if (this.bjqChecklag.length > 0){
579
- return
580
- }
581
-
582
- let http = new HttpResetClass()
583
- let res = await http.load(
584
- 'POST',
585
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_apply`,
586
- data
587
- )
588
- this.closeMaterials()
589
- },
590
- sycronizedCode(index,val){
591
- console.log("看看:",index,val)
592
- this.materials[index].f_material_code = val
593
- },
594
- closeMaterials() {
595
- this.getOnetoManyData()
596
- this.showMaterialModal = false
597
- },
598
- async bjqCheck(){
599
- //报警器设备型号校验
600
- this.bjqChecklag = [] //初始化
601
- if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
602
- let bjqinfo = {
603
- f_material_name : "",
604
- f_bjq_sid: ""
605
- }
606
- for (const bjqinfoElement of this.materials) {
607
- bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
608
- bjqinfo.f_material_name = bjqinfoElement.f_material_name
609
- if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
610
- let http = new HttpResetClass()
611
- let res = await http.load(
612
- 'POST',
613
- // `/rs/logic/bjqcheck`,
614
- `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqcheck`,
615
- bjqinfo
616
- )
617
- if (res.data.code != 200){
618
- this.bjqChecklag.push(res.data.code)
619
- //this.$showMessage(res.data.msg)
620
- Vue.showAlert(res.data.msg, 'danger', 6000)
621
- return
622
- }
623
- }
624
- }
625
- }
626
- }
627
- }
628
- }
629
-
630
- </script>
631
-
632
- <style scoped>
633
-
634
- </style>
1
+ <template>
2
+ <div>
3
+ <data-grid :model="onetomany" class="list_area table_sy">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">序号</th>
7
+ <th class="textNoLineBreak">材料名称</th>
8
+ <th class="textNoLineBreak">材料型号</th>
9
+ <th class="textNoLineBreak">材料单位</th>
10
+ <th class="textNoLineBreak">材料数量</th>
11
+ <th class="textNoLineBreak">材料编号</th>
12
+ <th class="textNoLineBreak">材料标识</th>
13
+ <th class="textNoLineBreak">用户编号</th>
14
+ <th class="textNoLineBreak">
15
+ <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加
16
+ </button>
17
+ </th>
18
+ </tr>
19
+ </template>
20
+ <template partial='body'>
21
+ <tr>
22
+ <td style="text-align: center;">
23
+ <nobr>{{$index+1}}</nobr>
24
+ </td>
25
+ <td style="text-align: center;">
26
+ <nobr>{{row.f_material_name}}</nobr>
27
+ </td>
28
+ <td style="text-align: center;">
29
+ <nobr>{{row.f_material_style}}</nobr>
30
+ </td>
31
+ <td style="text-align: center;">
32
+ <nobr>{{row.f_material_unit}}</nobr>
33
+ </td>
34
+ <td style="text-align: center;">
35
+ <nobr>{{row.f_material_number}}</nobr>
36
+ </td>
37
+ <td style="text-align: center;">
38
+ <nobr>{{row.f_bjq_sid}}</nobr>
39
+ </td>
40
+ <td style="text-align: center;">
41
+ <nobr>{{row.f_material_code}}</nobr>
42
+ </td>
43
+ <td style="text-align: center;">
44
+ <nobr>{{row.f_userinfo_code}}</nobr>
45
+ </td>
46
+ <td style="text-align: center;">
47
+ <!-- <button type="button" class="button_search button_spacing"-->
48
+ <!-- @click="$parent.$parent.updateMaterial($index,row)">修改-->
49
+ <!-- </button>-->
50
+ <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除
51
+ </button>
52
+ </td>
53
+ </tr>
54
+ </template>
55
+ </data-grid>
56
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
57
+ :backdrop="false" :title="title">
58
+ <header slot="modal-header" class="modal-header">
59
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
60
+ <h4 class="modal-title">{{title}}</h4>
61
+ </header>
62
+ <article slot="modal-body" class="modal-body clearfix">
63
+ <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
64
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
65
+ <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
66
+ <div class="col-sm-6 text-right">
67
+ <button
68
+ class="button_delete button_spacing"
69
+ @click.prevent="deleteDevicesinfo(i)"
70
+ v-if="title === '新增'"
71
+ >删除
72
+ </button>
73
+ </div>
74
+ </div>
75
+ <div class="form-group col-sm-6">
76
+ <label class="col-sm-4 control-label">选择材料:</label>
77
+ <div class="col-sm-8">
78
+ <v-select
79
+ class="select select_list"
80
+ :value.sync="item.material"
81
+ v-model="item.material"
82
+ align="right"
83
+ width="100%"
84
+ :options="meterialOptions"
85
+ :disable="mark === 1"
86
+ @change="modifyOtherValue(i)"
87
+ close-on-select
88
+ :valueSingle="true"></v-select>
89
+ </div>
90
+ </div>
91
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
92
+ <label class="col-sm-4 control-label">材料名称:</label>
93
+ <div class="col-sm-8">
94
+ <input class="form-control input_view" style="" type="text"
95
+ placeholder="材料名称"
96
+ v-model="item.f_material_name"
97
+ :value="item.f_material_name"
98
+ />
99
+ </div>
100
+ </div>
101
+ <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']">
102
+ <label class="col-sm-4 control-label">材料型号:</label>
103
+ <div class="col-sm-8">
104
+ <input class="form-control input_view" style="" type="text"
105
+ placeholder="材料型号"
106
+ v-model="item.f_material_style"
107
+ :value="item.f_material_style"
108
+ />
109
+ </div>
110
+ </div>
111
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
112
+ <label class="col-sm-4 control-label">材料单位:</label>
113
+ <div class="col-sm-8">
114
+ <input class="form-control input_view" style="" type="text"
115
+ placeholder="材料单位"
116
+ v-model="item.f_material_unit"
117
+ :value="item.f_material_unit"
118
+ />
119
+ </div>
120
+ </div>
121
+ <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
122
+ <label class="col-sm-4 control-label">材料数量:</label>
123
+ <div class="col-sm-8">
124
+ <input class="form-control input_view" style="" type="number"
125
+ placeholder="设备数量"
126
+ v-model="item.f_material_number"
127
+ :value="item.f_material_number"
128
+ />
129
+ </div>
130
+ </div>
131
+ <div class="form-group col-sm-6">
132
+ <label class="col-sm-4 control-label">材料编号:</label>
133
+ <div class="col-sm-8">
134
+ <input class="form-control input_view" style="" type="text"
135
+ placeholder="材料编号"
136
+ v-model="item.f_bjq_sid"
137
+ :value="item.f_bjq_sid"
138
+ />
139
+ </div>
140
+ </div>
141
+ <div class="form-group col-sm-6">
142
+ <label class="col-sm-4 control-label">材料标识:</label>
143
+ <div class="col-sm-8">
144
+ <input class="form-control input_view" style=""
145
+ placeholder="材料标识"
146
+ v-model="item.f_material_code"
147
+ :value.sync="item.f_material_code"
148
+ />
149
+ </div>
150
+ </div>
151
+ <div class="form-group col-sm-6">
152
+ <label class="col-sm-4 control-label">用户编号:</label>
153
+ <div class="col-sm-8">
154
+ <input class="form-control input_view" style=""
155
+ placeholder="用户编号"
156
+ v-model="item.f_userinfo_code"
157
+ :value.sync="item.f_userinfo_code"
158
+ />
159
+ </div>
160
+ </div>
161
+ <div v-if=" (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建')">
162
+ <app-qrcode-reader :istype = fmaterialname :index = i v-show="isShow[i]"></app-qrcode-reader>
163
+ </div>
164
+ </div>
165
+ </article>
166
+ <footer slot="modal-footer" class="modal-footer">
167
+ <template v-if="mark !== 1">
168
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
169
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()"
170
+ :disabled="!$v.valid">确认添加
171
+ </button>
172
+ <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()"
173
+ :disabled="!$v.valid">确认修改
174
+ </button>
175
+ </template>
176
+ </footer>
177
+ </modal>
178
+ </div>
179
+ </template>
180
+
181
+ <script>
182
+ import Vue from 'vue'
183
+ import {HttpResetClass} from 'vue-client'
184
+
185
+ export default {
186
+ name: 'addMaterialScience',
187
+ props: {
188
+ selectdata: {
189
+ type: Object
190
+ }
191
+ },
192
+ data() {
193
+ return {
194
+ onetomany: {
195
+ rows: []
196
+ },
197
+ title: '新增',
198
+ showMaterialModal: false,
199
+ materials: [
200
+ {
201
+ f_material_price: '',
202
+ material: '',
203
+ f_material_name: '',
204
+ f_material_style: '',
205
+ f_material_unit: '',
206
+ f_material_number: '',
207
+ f_bjq_sid: '',
208
+ f_material_code: '',
209
+ f_userinfo_code:'',
210
+ f_logotype:''
211
+ }
212
+ ],
213
+ meterialOptions: [],
214
+ row: {},
215
+ bjqChecklag:[],
216
+ fmaterialname:{},
217
+ isShow:[false],
218
+ requestBody: {
219
+ so_saleorder: {
220
+ "pk_group": "H", // 集团【集团】
221
+ "pk_org": "30", // 销售组织【组织_业务单元_销售组织】
222
+ "pk_org_v": "30", // 销售组织版本【组织_业务单元_销售组织版本信息】
223
+ "vtrantypecode": "30-0xx-002", // 订单类型编码【】
224
+ "ctrantypeid": "1001E11000000001KYUT", // 订单类型【单据类型】
225
+ "cdeptid": "07", // 部门最新版本【部门】
226
+ "cdeptvid": "07", // 部门【部门版本】
227
+ "cemployeeid": "0152", // 业务员【人员】
228
+ "cinvoicecustid": "11099", // 开票客户【客户档案】
229
+ "chreceivecustid": "11099", // 收货客户【客户档案】
230
+ "ccustomerid": "11099", // 客户【客户档案】
231
+ "ndiscountrate": "100.00", // 整单折扣【】
232
+ "dbilldate": "2025-04-24 00:00:00", // 单据日期【】
233
+ "dmakedate": "2025-04-24 00:00:00", // 制单日期【】
234
+ "corigcurrencyid": "CNY", // 原币【币种档案】
235
+ "fpfstatusflag": "1", // 审批流状态【】
236
+ "fstatusflag": "1", // 单据状态【1 = 自由,2 = 审批通过,3 = 冻结,4 = 关闭,7 = 审批中,8 = 审批不通过,5 = 失效】
237
+ "iversion": "0", // 修订版本号【】
238
+ "ntotalmny": 254.14, // 冲抵前金额【】
239
+ "ntotalnum": 224.9, // 总数量【】
240
+ "ntotalorigmny": 254.14, // 价税合计【】
241
+ "cbiztypeid": "1001E11000000001KZDF", // 业务流程【业务流程】
242
+ "badvfeeflag": "N", // 代垫运费【】
243
+ "barsettleflag": "N", // 收入结算关闭【】
244
+ "bcooptopoflag": "N", // 已协同生成采购订单【】
245
+ "bcostsettleflag": "N", // 成本结算关闭【】
246
+ "bfreecustflag": "N", // 是否散户【】
247
+ "binvoicendflag": "N", // 开票关闭【】
248
+ "boffsetflag": "N", // 是否冲抵【】
249
+ "boutendflag": "N", // 出库关闭【】
250
+ "bpocooptomeflag": "N", // 由采购订单协同生成【】
251
+ "bpreceiveflag": "N", // 收款限额控制预收【】
252
+ "bsendendflag": "N", // 发货关闭【】
253
+ "vnote": "接口测试订单!!!" // 备注【】
254
+ },
255
+ so_saleorder_b: []
256
+ }
257
+ }
258
+ },
259
+ ready() {
260
+ this.getOnetoManyData()
261
+ },
262
+ methods: {
263
+ async getOnetoManyData () {
264
+ let http = new HttpResetClass()
265
+ let data = {
266
+ tablename: `t_material_apply`,
267
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
268
+ }
269
+ let res = await http.load(
270
+ 'POST',
271
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable?aaa=123`,
272
+ {data: data},
273
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
274
+ )
275
+ this.onetomany.rows = res.data
276
+ },
277
+ async openMaterialModal() {
278
+ this.getMateralNames()
279
+ this.title = '新增'
280
+ this.materials = [
281
+ {
282
+ f_material_price: '',
283
+ material: '',
284
+ f_material_name: '',
285
+ f_material_style: '',
286
+ f_material_unit: '',
287
+ f_material_number: '',
288
+ f_bjq_sid: '',
289
+ f_material_code: '',
290
+ f_userinfo_code: '',
291
+ f_logotype:''
292
+ }
293
+ ],
294
+ this.showMaterialModal = true
295
+ this.isShow = [false]
296
+ },
297
+ deleteDevicesinfo(index) {
298
+ this.materials.splice(index, 1)
299
+ this.isShow.splice(index, 1)
300
+ },
301
+ pushMaterial() {
302
+ this.materials.push({
303
+ f_material_price: '',
304
+ material: '',
305
+ f_material_name: '',
306
+ f_material_style: '',
307
+ f_material_unit: '',
308
+ f_material_number: '',
309
+ f_bjq_sid: '',
310
+ f_material_code: '',
311
+ f_userinfo_code: '',
312
+ f_logotype:''
313
+ })
314
+ this.isShow.push(false)
315
+ },
316
+ async getMateralNames () {
317
+ let http1 = new HttpResetClass()
318
+ let res1 = await http1.load(
319
+ 'POST',
320
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouLogin`,
321
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
322
+ )
323
+ if (res1.data=== 200){
324
+ let http = new HttpResetClass()
325
+ let res2 = await http.load(
326
+ 'POST',
327
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouMaterial`,
328
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
329
+ )
330
+ this.meterialOptions = res2.data.map(item => {
331
+ return {
332
+ 'label': `${item.name}--${item.spec}--${item.smallnumname}`,
333
+ 'value': item
334
+ }
335
+ })
336
+ }
337
+ },
338
+ // 获取模态框材料
339
+ // async getMateralNames() {
340
+ // let data = {
341
+ // condition: `1=1`
342
+ // }
343
+ // let http = new HttpResetClass()
344
+ // let res = await http.load(
345
+ // 'POST',
346
+ // `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
347
+ // {data: data},
348
+ // {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
349
+ // )
350
+ //
351
+ // this.meterialOptions = res.data.map(item => {
352
+ // return {
353
+ // 'label': `${item.f_material_name}--${item.f_material_style}`,
354
+ // 'value': item
355
+ // }
356
+ // })
357
+ // },
358
+ modifyOtherValue (index){
359
+ console.log("进来了",index)
360
+ console.log("dddd",this.materials[index].material)
361
+ if(this.materials[index].material){
362
+ let material = this.materials[index].material
363
+ this.materials[index].f_material_price=0
364
+ this.materials[index].f_material_name = material.name
365
+ this.materials[index].f_material_style = material.spec
366
+ this.materials[index].f_material_unit = material.smallnumname
367
+ this.materials[index].f_material_number = material.f_material_number
368
+ this.materials[index].f_material_code = material.code
369
+ this.materials[index].f_bjq_sid=material.pk
370
+ this.materials[index].f_userinfo_code = material.f_userinfo_code
371
+ }else {
372
+ this.materials[index].f_material_price=''
373
+ this.materials[index].f_material_name =''
374
+ this.materials[index].f_material_style =''
375
+ this.materials[index].f_material_unit =''
376
+ this.materials[index].f_material_number = ''
377
+ this.materials[index].f_material_code =''
378
+ this.materials[index].f_bjq_sid=''
379
+ this.materials[index].f_userinfo_code = ''
380
+ }
381
+ },
382
+ // 新增材料
383
+ async addMaterial() {
384
+ //调用用友保存材料接口
385
+ for (let i = 0; i < this.materials.length; i++) {
386
+ let obj={
387
+ "pk_group": "H", // 集团【集团】
388
+ "pk_org": "30", // 销售组织【组织_业务单元_销售组织】
389
+ "pk_org_v": "30", // 销售组织【组织_业务单元_销售组织】
390
+ "carorgid": "30", // 应收组织最新版本【财务组织】
391
+ "carorgvid": "30", // 应收组织【财务组织版本】
392
+ "csendstockorgid": "30", // 发货库存组织最新版本【库存组织】
393
+ "csendstockorgvid": "30", // 发货库存组织【库存组织版本】
394
+ "csettleorgid": "30", // 结算财务组织最新版本【财务组织】
395
+ "csettleorgvid": "30", // 结算财务组织【财务组织版本】
396
+ "creceivecustid": "11099", // 收货客户【客户档案】
397
+ "ctaxcountryid": "0001Z010000000079UJJ", // 报税国家 / 地区【国家地区】
398
+ "crececountryid": "0001Z010000000079UJJ", // 收货国家 / 地区【国家地区】
399
+ "csendcountryid": "0001Z010000000079UJJ", // 发货国家 / 地区【国家地区】
400
+ "cmaterialid": this.materials[i].f_material_code, // 物料最新版本【物料】
401
+ "cmaterialvid": this.materials[i].f_material_code, // 物料编码【物料(多版本)】
402
+ "cqtunitid":this.materials[i].f_material_unit==='米'?"MTR":"EA", // 报价单位【计量单位】
403
+ "cunitid": this.materials[i].f_material_unit==='米'?"MTR":"EA", // 主单位【计量单位】MTR=米 EA=个
404
+ "castunitid": this.materials[i].f_material_unit==='米'?"MTR":"EA", // 单位【计量单位】MTR=米 EA=个
405
+ "vqtunitrate": "1.00/1.00", // 报价换算率【】数量转主数量的换算比例
406
+ "vchangerate": "1.00/1.00", // 换算率【】数量转主数量的换算比例
407
+ "nvolume": "0", // 体积【】
408
+ "nweight": "0", // 重量【】
409
+ "nastnum": this.materials[i].f_material_number, // 数量【】pk_group, pk_org, ,
410
+ "nnum": this.materials[i].f_material_number, // 主数量【】
411
+ "nqtunitnum": this.materials[i].f_material_number, // 报价单位数量【】
412
+ "ndiscountrate": "100.00", // 整单折扣【】
413
+ "nitemdiscountrate": "100.00", // 单品折扣【】
414
+ "norigdiscount": "0.00", // 折扣额【】
415
+ "nexchangerate": 1.00, // 折本汇率【】
416
+ "ccurrencyid": "CNY", // 本位币【币种档案】
417
+ "nqtprice": "1.000000", // 本币无税单价【】
418
+ "nqtorigprice": "1.000000", // 无税单价【】
419
+ "norigprice": "1.000000", // 主无税单价【】
420
+ "nprice": "1.000000", // 主本币无税单价【】
421
+ "nqtorigtaxprice": "1.130000", // 含税单价【】
422
+ "nqttaxprice": "1.130000", // 本币含税单价【】
423
+ "norigtaxprice": "1.130000", // 主含税单价【】
424
+ "ctaxcodeid": "1001Z01000000003W0WZ", // 税码【】
425
+ "ntaxrate": "13.00", // 税率【】
426
+ "ntax": "14.56", // 税额【】
427
+ "nqtorignetprice": "1.000000", // 无税净价【】
428
+ "norignetprice": "1.000000", // 主无税净价【】
429
+ "nnetprice": "1.000000", // 主本币无税净价【】
430
+ "nqtnetprice": "1.000000", // 本币无税净价【】
431
+ "nqtorigtaxnetprc": "1.130000", // 含税净价【】
432
+ "norigtaxnetprice": "1.130000", // 主含税净价【】
433
+ "nqttaxnetprice": "1.130000", // 本币含税净价【】
434
+ "ntaxnetprice": "1.130000", // 主本币含税净价【】
435
+ "norigmny": "112.00", // 无税金额【】
436
+ "ncaltaxmny": "112.00", // 计税金额【】
437
+ "nmny": "126.56", // 本币价税合计【】
438
+ "norigtaxmny": "126.56", // 价税合计【】
439
+ "ntaxmny": "126.56", // 本币价税合计【】
440
+ "dplandate": "2025-04-24 00:00:00", // 到货日期【】
441
+ "dreceivedate": "2025-04-24 00:00:00", // 到货日期【】
442
+ "dsenddate": "2025-04-24 00:00:00", // 发货日期【】
443
+ "vbatchcode": "", // 批次号【】
444
+ "blargessflag": "N", // 赠品【】
445
+ "vrownote": "11月", // 行备注【】
446
+ //"cprojectid": "", // 项目【项目】
447
+ "csendstordocid": "02", // 发货仓库【仓库】 02=客服仓
448
+ "barrangedflag": "N", // 是否货源安排完毕【】
449
+ "bbarsettleflag": "N", // 收入结算关闭【】
450
+ "bbcostsettleflag": "N", // 成本结算关闭【】
451
+ "bbindflag": "N", // 捆绑存货【】
452
+ "bbinvoicendflag": "N", // 开票关闭【】
453
+ "bboutendflag": "N", // 出库关闭【】
454
+ "bbsendendflag": "N", // 发货关闭【】
455
+ "bbsettleendflag": "N", // 结算关闭【】
456
+ "bdiscountflag": "N", // 折扣类【】
457
+ "bjczxsflag": "N", // 借出转销售【】
458
+ "blaborflag": "N", // 服务类【】
459
+ "blrgcashflag": "N", // 赠品兑付【】
460
+ "bprerowcloseflag": "N", // 预订单行关闭【】
461
+ "btriatradeflag": "N", // 三角贸易【】
462
+ "fbuysellflag": "1", // 购销类型【1 = 国内销售,2 = 国内采购,3 = 出口,4 = 进口,5 = 不区分】
463
+ "flargesstypeflag": "1", // 赠品价格分摊方式【1 = 未分摊,2 = 被分摊物料,3 = 分摊赠品】
464
+ "fretexchange": "0", // 退换货标记【0 = 非退换货,1 = 退货,2 = 换货】
465
+ "frowstatus": "1", // 行状态【1 = 自由,2 = 审批通过,3 = 冻结,4 = 关闭,7 = 审批中,8 = 审批不通过,5 = 失效】
466
+ "ftaxtypeflag": "1", // 扣税类别【1 = 应税外加,0 = 应税内含】
467
+ "ndiscount": "1" // 本币折扣额【】
468
+ }
469
+ this.requestBody.so_saleorder_b.push(obj)
470
+ }
471
+ let http2 = new HttpResetClass()
472
+ let res2 = await http2.load(
473
+ 'POST',
474
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouSaveMaterial`,
475
+ {data: {
476
+ body:this.requestBody
477
+ }
478
+ },
479
+ {resolveMsg: null, rejectMsg: '材料推送失败!!!'}
480
+ )
481
+ if (res2.data.status == 200) {
482
+ let pk=res2.data.pk
483
+ for (let i = 0; i < this.materials.length; i++) {
484
+ this.materials[i].f_logotype=pk
485
+ }
486
+ }
487
+ this.title = '新增'
488
+ let data = {
489
+ f_process_id: this.selectdata.f_process_id,
490
+ f_operator_id: Vue.user.id,
491
+ f_operator: Vue.user.name,
492
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
493
+ f_orgid: Vue.user.orgid,
494
+ f_orgname: Vue.user.orgs,
495
+ materials: this.materials
496
+ }
497
+
498
+ //报警器流程 设备编号检验
499
+ await this.bjqCheck()
500
+ if (this.bjqChecklag.length > 0) {
501
+ return
502
+ }
503
+
504
+ let http = new HttpResetClass()
505
+ let res = await http.load(
506
+ 'POST',
507
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterials`,
508
+ data
509
+ )
510
+
511
+ this.closeMaterials()
512
+ },
513
+ async deleteMaterial(row) {
514
+ var show1 = window.confirm('您确定要删除这条记录吗?')
515
+ if(show1 != true){
516
+ this.closeMaterials()
517
+ }else{
518
+ let http = new HttpResetClass()
519
+ let sql = `delete from t_material_apply where f_logotype='${row.f_logotype}'`
520
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/runSQL`, {data: {sql: sql}}, {
521
+ resolveMsg: null,
522
+ rejectMsg: '作废失败!!!'
523
+ })
524
+ let http2 = new HttpResetClass()
525
+ let res2 = await http2.load(
526
+ 'POST',
527
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/yongyouDelMaterial`,
528
+ {data: {
529
+ body:{
530
+ pk:row.f_logotype
531
+ }
532
+ }
533
+ },
534
+ {resolveMsg: null, rejectMsg: '材料推送失败!!!'}
535
+ )
536
+ this.closeMaterials()
537
+ }
538
+ }
539
+ ,
540
+ async updateMaterial(index, row) {
541
+ this.title = '修改'
542
+ this.row = row
543
+ this.getMateralNames()
544
+ this.materials = [
545
+ {
546
+ material: '',
547
+ f_material_price: row.f_material_price,
548
+ f_material_name: row.f_material_name,
549
+ f_material_style: row.f_material_style,
550
+ f_material_unit: row.f_material_unit,
551
+ f_material_number: row.f_material_number,
552
+ f_material_code: row.f_material_code,
553
+ f_bjq_sid: row.f_bjq_sid,
554
+ f_userinfo_code: row.f_userinfo_code
555
+ }
556
+ ]
557
+ this.showMaterialModal = true
558
+ },
559
+ async updateConfirm() {
560
+ let data = this.row
561
+ data.f_material_price = this.materials[0].f_material_price
562
+ data.f_material_name = this.materials[0].f_material_name
563
+ data.f_material_style = this.materials[0].f_material_style
564
+ data.f_material_unit = this.materials[0].f_material_unit
565
+ data.f_material_number = this.materials[0].f_material_number
566
+ data.f_material_code = this.materials[0].f_material_code
567
+ data.f_bjq_sid = this.materials[0].f_bjq_sid
568
+ data.f_userinfo_code=this.materials[0].f_userinfo_code
569
+
570
+ //报警器流程 设备编号检验
571
+ await this.bjqCheck()
572
+ if (this.bjqChecklag.length > 0){
573
+ return
574
+ }
575
+
576
+ let http = new HttpResetClass()
577
+ let res = await http.load(
578
+ 'POST',
579
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_apply`,
580
+ data
581
+ )
582
+ this.closeMaterials()
583
+ },
584
+ sycronizedCode(index,val){
585
+ console.log("看看:",index,val)
586
+ this.materials[index].f_material_code = val
587
+ },
588
+ closeMaterials() {
589
+ this.getOnetoManyData()
590
+ this.showMaterialModal = false
591
+ },
592
+ async bjqCheck(){
593
+ //报警器设备型号校验
594
+ this.bjqChecklag = [] //初始化
595
+ if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
596
+ let bjqinfo = {
597
+ f_material_name : "",
598
+ f_bjq_sid: ""
599
+ }
600
+ for (const bjqinfoElement of this.materials) {
601
+ bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
602
+ bjqinfo.f_material_name = bjqinfoElement.f_material_name
603
+ if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
604
+ let http = new HttpResetClass()
605
+ let res = await http.load(
606
+ 'POST',
607
+ // `/rs/logic/bjqcheck`,
608
+ `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqcheck`,
609
+ bjqinfo
610
+ )
611
+ if (res.data.code != 200){
612
+ this.bjqChecklag.push(res.data.code)
613
+ //this.$showMessage(res.data.msg)
614
+ Vue.showAlert(res.data.msg, 'danger', 6000)
615
+ return
616
+ }
617
+ }
618
+ }
619
+ }
620
+ }
621
+ }
622
+ }
623
+
624
+ </script>
625
+
626
+ <style scoped>
627
+
628
+ </style>