apply-clients 3.5.5-21 → 3.5.5-23

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