apply-clients 3.5.4-2 → 3.5.4-21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/build/dev-server.js +137 -133
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/components/android/Process/AppServiceControl.vue +5 -0
  5. package/src/components/android/Process/Processes/AppAddMaterialScience.vue +493 -493
  6. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1 -3
  7. package/src/components/image/dxf.png +0 -0
  8. package/src/components/product/Process/ExplorationUser.vue +1 -0
  9. package/src/components/product/Process/Processes/addMaterialScience.vue +471 -471
  10. package/src/filiale/baiyin/android/AppServiceControl.vue +1762 -0
  11. package/src/filiale/baiyin/android/ByAddMaterialScience.vue +801 -0
  12. package/src/filiale/baiyin/android/ByDeviceManagement.vue +917 -0
  13. package/src/filiale/baiyin/android.js +8 -0
  14. package/src/filiale/fugou/android/AppChargeManagement.vue +132 -1
  15. package/src/filiale/fugou/pc/ServiceControl.vue +27 -6
  16. package/src/filiale/qianneng/android/AppExplorationUser.vue +38 -0
  17. package/src/filiale/qianneng/android/AppInstallationDetails.vue +20 -11
  18. package/src/filiale/qianneng/pc/ApplyUpload.vue +292 -291
  19. package/src/filiale/qianneng/pc/Applybatchdispatch.vue +11 -6
  20. package/src/filiale/qianneng/pc/InstallationDetails.vue +614 -586
  21. package/src/filiale/qianneng/pc/ServiceControl.vue +1 -0
  22. package/src/filiale/qianneng/pc/printactivatecard.vue +6 -6
  23. package/src/filiale/ruihua/pc/InstallationDetails.vue +610 -0
  24. package/src/filiale/ruihua/pc/ServiceControl.vue +20 -0
  25. package/src/filiale/ruihua/pc/printVentilation.vue +21 -6
  26. package/src/filiale/ruihua/pc.js +1 -0
  27. package/src/filiale/shexian/android/AppServiceControl.vue +1758 -1753
  28. package/src/filiale/shexian/android/AppTakePic.vue +94 -140
  29. package/src/filiale/siyangRH/pc/chargeManagement.vue +810 -0
  30. package/src/filiale/siyangRH/pc.js +1 -0
  31. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +4 -0
  32. package/src/filiale/yangchunboneng/android/AppExplorationUser.vue +12 -0
  33. package/src/filiale/yangchunboneng/android/AppInstallationMaterial.vue +7 -3
  34. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +17 -1
  35. package/src/filiale/yangchunboneng/android/AppSuperServiceControl.vue +1 -1
  36. package/src/filiale/yangchunboneng/android/AppUpload.vue +50 -8
  37. package/src/filiale/yangchunboneng/pc/ApplyUpload.vue +230 -219
  38. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +53 -13
  39. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +183 -2
  40. package/src/filiale/yangchunboneng/pc/SupervisoryControlNew.vue +140 -0
  41. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +54 -13
  42. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +613 -0
  43. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControl.vue +902 -0
  44. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControlNew.vue +901 -0
  45. package/src/filiale/yangchunboneng/pc/SupervisoryServiceView.vue +1117 -0
  46. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +99 -12
  47. package/src/filiale/yangchunboneng/pc.js +6 -1
  48. package/src/main.js +23 -23
@@ -0,0 +1,917 @@
1
+ <template>
2
+ <div class="auto">
3
+ <div class="form-inline auto" style="margin-bottom: 5px;width: 100%">
4
+ <div class="col-sm-12 span recordTable" style="margin-top: 10px;height:auto;">
5
+ <partial-view v-ref:single-load>
6
+ <data-grid :model="model" v-ref:grid>
7
+ <template partial='head'>
8
+ <tr>
9
+ <th>序号</th>
10
+ <th>设备类型</th>
11
+ <th>设备编码</th>
12
+ <th>设备品牌</th>
13
+ <th>设备数量</th>
14
+ <th>操作</th>
15
+ <th class="textNoLineBreak">
16
+ <button class="button_new button_spacing" type="button" @click="$parent.$parent.$parent.addDetailed()">添加
17
+ </button>
18
+ </th>
19
+ </tr>
20
+ </template>
21
+ <template partial='body'>
22
+ <td >{{$index+1}}</td>
23
+ <td >{{row.f_devices_type}}</td>
24
+ <td >{{row.f_devices_no}}</td>
25
+ <td >{{row.f_brand}}</td>
26
+ <td >{{row.f_devices_model}}</td>
27
+ <td class="" v-show="$parent.$parent.$parent.showprint">
28
+ <button type="button" name="button" class="btn btn-link" :disabled="row.f_effective_state == '无效'"
29
+ @click.stop="$parent.$parent.$parent.tovoid(row)">作废
30
+ </button>
31
+ <button type="button" name="button" class="btn btn-link"
32
+ @click.stop="$parent.$parent.$parent.modifyParam(row)">修改
33
+ </button>
34
+ </td>
35
+ </template>
36
+ </data-grid>
37
+
38
+ </partial-view>
39
+ </div>
40
+ </div>
41
+ <modal :show.sync="addshow" v-ref:modal backdrop="false">
42
+ <header slot="modal-header" class="modal-header">
43
+ <button type="button" class="close" @click="addclose"><span>&times;</span></button>
44
+ <h4 class="modal-title">添加设备</h4>
45
+ </header>
46
+ <article slot="modal-body" class="modal-body">
47
+ <div class="from-group">
48
+ <label>设备类型</label>
49
+ <select class="form-control" v-model="selectItem.f_devices_type" >
50
+ <option value='热水器'>热水器</option>
51
+ <option value='家用灶具'>家用灶具</option>
52
+ <option value='壁挂炉'>壁挂炉</option>
53
+ <option value='其他'>其他</option>
54
+ </select>
55
+ </div>
56
+ <div class="from-group">
57
+ <label>设备编码</label>
58
+ <input type="text" class="form-control" v-model="selectItem.f_devices_no">
59
+ </div>
60
+ <div class="from-group">
61
+ <label>设备品牌</label>
62
+ <input type="text" class="form-control" v-model="selectItem.f_brand">
63
+ </div>
64
+ <div class="from-group">
65
+ <label>设备数量</label>
66
+ <input type="number" class="form-control" v-model="selectItem.f_devices_model">
67
+ </div>
68
+ </article>
69
+ <footer slot="modal-footer" class="modal-footer">
70
+ <div class="from-group" style="width: 100%;height: 50px" >
71
+ <button v-show="addshow" type="button" class="btn btn-default" @click='close'>取消</button>
72
+ <button v-show="addshow" type="button" class="btn btn-success" @click='confirm'>确认</button>
73
+ </div>
74
+ </footer>
75
+ </modal>
76
+ <modal :show.sync="show" v-ref:modal backdrop="false">
77
+ <header slot="modal-header" class="modal-header">
78
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
79
+ <h4 class="modal-title">修改明细</h4>
80
+ </header>
81
+ <article slot="modal-body" class="modal-body">
82
+ <div class="from-group">
83
+ <label>设备类型</label>
84
+ <input type="select" class="form-control" v-model="selectItem.f_devices_type" readonly>
85
+ </div>
86
+ <div class="from-group">
87
+ <label>设备品牌</label>
88
+ <input type="text" class="form-control" v-model="selectItem.f_devices_no" readonly>
89
+ </div>
90
+ <div class="from-group">
91
+ <label>设备品牌</label>
92
+ <input type="text" class="form-control" v-model="selectItem.f_brand" readonly>
93
+ </div>
94
+ <div class="from-group">
95
+ <label>设备数量</label>
96
+ <input type="number" class="form-control" v-model="selectItem.f_devices_model">
97
+ </div>
98
+ </article>
99
+ <footer slot="modal-footer" class="modal-footer">
100
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
101
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm'>确认</button>
102
+ </footer>
103
+ </modal>
104
+ </div>
105
+ </template>
106
+
107
+ <script>
108
+ import { PagedList } from 'vue-client'
109
+ import {HttpResetClass} from 'vue-client'
110
+ import co from 'co'
111
+ import Vue from 'vue'
112
+ let insert = async function (self) {
113
+ let param = {
114
+ processid: self.selectdata.f_process_id,
115
+ f_apply_num: self.selectdata.f_apply_num,
116
+ f_filiale: self.selectdata.f_filiale,
117
+ f_parentname: Vue.user.f_parentname,
118
+ f_input_person: Vue.user.name,
119
+ f_user_id:Vue.user.f_user_id,
120
+ f_state: '有效'
121
+ }
122
+ console.log('新增批次', param)
123
+ self.$resetpost('rs/entity/t_devices', param).then(() => {
124
+ // this.params.rows.splice(index, 1)
125
+ console.log('更新成功!')
126
+ self.getaaa()
127
+ })
128
+ }
129
+ let insertdetail = async function (self) {
130
+ let data = {
131
+ f_batch_name: self.model.f_batch_name[0],
132
+ f_batch_code: self.model.f_batch_code[0],
133
+ f_apply_num: self.selectdata.f_apply_num,
134
+ f_batch_id: self.batch_id,
135
+ }
136
+ console.log('判断数据:', data)
137
+ return await self.$resetpost('rs/logic/insertdetail', data, {resolveMsg: null, rejectMsg: null}).then((res) => {
138
+ // this.params.rows.splice(index, 1)
139
+ console.log('更新成功!', res)
140
+ if (res.data.batch.length > 0) {
141
+ self.$showMessage("已添加过此设备,请勿重复添加,若要修改数量请点击修改!")
142
+ return false
143
+ } else {
144
+ if (res.data.array.length > 0) {
145
+ let param = {
146
+ f_batch_id: self.batch_id,
147
+ f_apply_num: self.selectdata.f_apply_num,
148
+ f_filiale: self.selectdata.f_filiale,
149
+ f_parentname: Vue.user.f_parentname,
150
+ f_material_operator: Vue.user.name,
151
+ f_batch_name: self.model.f_batch_name[0],
152
+ f_budget_num: self.model.f_budget_num,
153
+ f_surplus_num: self.model.f_budget_num,
154
+ f_add_receive: 0,
155
+ f_receive_num: 0,
156
+ f_revenue_id: res.data.array[0].id,
157
+ f_batch_type: res.data.array[0].f_type,
158
+ f_batch_code: res.data.array[0].f_code,
159
+ f_batch_version: res.data.array[0].f_num,
160
+ f_batch_norms: res.data.array[0].f_format,
161
+ f_batch_company: res.data.array[0].f_unit,
162
+ f_batch_price: res.data.array[0].f_price
163
+ }
164
+ console.log('添加明细:', param)
165
+ self.$resetpost('rs/entity/t_material_list', param).then(() => {
166
+ // this.params.rows.splice(index, 1)
167
+ console.log('更新成功!')
168
+ self.showdetail(self.batch_id, '有效')
169
+ self.model.f_batch_name = []
170
+ self.model.f_batch_code = []
171
+ self.model.f_batch_version = []
172
+ self.model.f_batch_norms = []
173
+ self.model.f_budget_num = ''
174
+ self.addshow = false
175
+ })
176
+ } else {
177
+ self.$showMessage('此种材料系统中不存在!请检查材料名称')
178
+ }
179
+ }
180
+ })
181
+ }
182
+ let getInfo = async function (self, isbatchdetail, batchid, istoVoidBatch) {
183
+ if (!self.selectdata)
184
+ return
185
+
186
+ if (isbatchdetail == 1) {
187
+ let data = {
188
+ tablename: 't_devices',
189
+ condition: ` id ='${batchid}' `
190
+ }
191
+ let reset = new HttpResetClass()
192
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
193
+ .then((res) => {
194
+ console.log('查询完毕,返回res.data=>' + JSON.stringify(res.data))
195
+ self.batchmodel.rows = []
196
+ self.batchmodel.rows = res.data
197
+ // 备份用于查询
198
+ /* self.params = res.data*/
199
+ if (istoVoidBatch) {
200
+ console.log('进入istovoidBatch')
201
+ let num = 0
202
+ for (var i = 0; i < self.batchmodel.rows.length; i++) {
203
+ num += self.batchmodel.rows[i].f_add_receive
204
+ console.log(i + 'f_add_receive' + self.batchmodel.rows[i].f_add_receive)
205
+ }
206
+ if (num > 0) {
207
+ self.$showMessage('累计领取数量大于0,不能作废!')
208
+ } else {
209
+ self.$showMessage('作废后不可恢复,确认作废吗?', ['confirm', 'cancel']).then((res) => {
210
+ if (res === 'confirm') {
211
+ self.$resetpost('rs/logic/todevices', {id: batchid}).then((res) => {
212
+ getInfo(self, 0, 0, false)
213
+ })
214
+ }
215
+ })
216
+ }
217
+ // this.istoVoidBatch=false
218
+ }
219
+
220
+ })
221
+
222
+ } else {
223
+
224
+ let data = {
225
+ tablename: 't_devices',
226
+ condition: `f_process_id = '${self.selectdata.f_process_id}' `
227
+ }
228
+ let reset = new HttpResetClass()
229
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取设备信息失败'})
230
+ .then((res) => {
231
+ self.model.rows = []
232
+ self.model.rows = res.data
233
+ self.params = res.data
234
+ })
235
+ }
236
+ }
237
+
238
+
239
+ let gen = function* (self, val) {
240
+ let data = {
241
+ model: {
242
+ f_processid: self.selectdata.f_process_id,
243
+ },
244
+ loginUser: {
245
+ id: Vue.user.id,
246
+ name: Vue.user.name,
247
+ ename: Vue.user.ename
248
+ },
249
+ employeetemplate: self.employeetemplate,// 指派勘察人员
250
+ subdep: '提交'
251
+ }
252
+ console.log('提交前')
253
+ self.$resetpost(`rs/logic/grantnext`,
254
+ {data: data})
255
+ .then(() => {
256
+ self.reset()
257
+ })
258
+ }
259
+ export default {
260
+ title: '材料信息',
261
+ props: {
262
+ flag:{
263
+ type: String,
264
+ default: 'cl'
265
+ },
266
+ selectdata: {
267
+ type: Object
268
+ },
269
+ edit: {
270
+ type: Boolean,
271
+ default: true
272
+ },
273
+ state: {
274
+ type: Number
275
+ },
276
+ showprint: {
277
+ type: Boolean,
278
+ default: true
279
+ }
280
+ },
281
+ data() {
282
+ return {
283
+ scrollTop:0, // 添加材料模态框的高度
284
+ searchName:null,
285
+ addshowm:true,
286
+ menulist: null,
287
+ refreshed: true,
288
+ guigeoptions: [],
289
+ xinhaooptions: [],
290
+ materialItem: [],
291
+ codeOptions: [],
292
+ fmaterialtype: [],
293
+ fmaterialname: [],
294
+ fmaterialspec: [],
295
+ fmaterialprice: [],
296
+ params: null,
297
+ record: {},
298
+ selectItem: {},
299
+ isbuttonshow: true,
300
+ model: {
301
+ rows: []
302
+ },
303
+ f_effective_state: [
304
+ {label: '有效', value: '有效'},
305
+ {label: '无效', value: '无效'},
306
+ {label: '全部', value: ''}
307
+ ],
308
+
309
+
310
+ batchmodel: {
311
+ rows: []
312
+ },
313
+ show: false,
314
+ isShow: false,
315
+ isShowdetail: false,
316
+ addshow: false,
317
+ batch_id: 0,
318
+ material: [],
319
+ optionsx: [],
320
+ f_user_name: []
321
+ }
322
+ },
323
+ async ready() {
324
+ this.isShowdetail = false
325
+ getInfo(this, 0, 0, false)
326
+ },
327
+ watch: {
328
+ 'state'() {
329
+ this.f_material_operator = ''
330
+ this.f_picking_stated = ''
331
+ this.f_effective_stated = ''
332
+ },
333
+ deep: true
334
+ },
335
+ computed: {
336
+ async fprice() {
337
+ if (this.selectItem.f_material_type && this.selectItem.f_material_name && this.selectItem.f_material_spec) {
338
+ this.fmaterialprice = []
339
+ let http = new HttpResetClass()
340
+ let data = {
341
+ columnname: 'f_price',
342
+ tablename: 't_material',
343
+ condition: `f_material_type = '${this.selectItem.f_material_type}' and f_material_name = '${this.selectItem.f_material_name}' and f_material_spec = '${this.selectItem.f_material_spec}' ORDER BY f_price desc`
344
+ }
345
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
346
+ resolveMsg: null,
347
+ rejectMsg: "获取f_material_type失败"
348
+ }, {silent: true})
349
+ res.data.forEach((row) => {
350
+ let temp = {
351
+ label: row.f_price,
352
+ value: row.f_price
353
+ }
354
+ this.fmaterialprice.push(temp)
355
+ })
356
+ }
357
+ },
358
+ async fmaterialnames() {
359
+ if (this.selectItem.f_material_type) {
360
+ this.fmaterialname = []
361
+ let f_material_type = this.selectItem.f_material_type
362
+ let http = new HttpResetClass()
363
+ let data = {
364
+ columnname: 'f_material_name',
365
+ tablename: 't_material',
366
+ condition: `f_material_type = '${f_material_type}'`
367
+ }
368
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
369
+ resolveMsg: null,
370
+ rejectMsg: "获取f_material_name失败"
371
+ }, {silent: true})
372
+ res.data.forEach((row) => {
373
+ let temp = {
374
+ label: row.f_material_name,
375
+ value: row.f_material_name
376
+ }
377
+ this.fmaterialname.push(temp)
378
+ })
379
+ }
380
+ },
381
+ async fmaterialspecs() {
382
+ if (this.selectItem.f_material_name) {
383
+ this.fmaterialspec = []
384
+ let f_material_name = this.selectItem.f_material_name
385
+ let http = new HttpResetClass()
386
+ let data = {
387
+ columnname: 'f_material_spec',
388
+ tablename: 't_material',
389
+ condition: `f_material_name = '${f_material_name}'`
390
+ }
391
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
392
+ resolveMsg: null,
393
+ rejectMsg: "获取f_material_spec失败"
394
+ }, {silent: true})
395
+ res.data.forEach((row) => {
396
+ let temp = {
397
+ label: row.f_material_spec,
398
+ value: row.f_material_spec
399
+ }
400
+ this.fmaterialspec.push(temp)
401
+ })
402
+ }
403
+ }
404
+ },
405
+ methods: {
406
+ //使用a标签下载--推荐使用
407
+ commDownload(url) {
408
+ // url += "?";
409
+ // for(let key in params) {
410
+ // url += key + "=" + params[key] + "&";
411
+ // }
412
+ // url = url.substr(0, url.length - 1);
413
+ $("<a href=" + url + " />")[0].click();
414
+ },
415
+ async searchByName(){
416
+
417
+ console.log('搜索材料名车')
418
+ let http = new HttpResetClass()
419
+ let data2 = {
420
+ columnname: `f_type`,
421
+ tablename: 't_material_class',
422
+ condition: ` f_name like '%${this.searchName}%'`
423
+ }
424
+ let resTypes = await http.load('POST', 'rs/sql/getdistinct', {data: data2}, {
425
+ resolveMsg: null,
426
+ rejectMsg: "获取f_material_name失败"
427
+ }, {silent: true})
428
+
429
+
430
+ let data = {
431
+ columnname: `f_name,f_type`,
432
+ tablename: 't_material_class',
433
+ condition: ` f_name like '%${this.searchName}%'`
434
+ }
435
+ let res = await this.$resetpost('rs/sql/getdistinct', {data: data}, {
436
+ resolveMsg: null,
437
+ rejectMsg: '搜索材料名称失败'
438
+ })
439
+ this.menulist = []
440
+ for(let i=0;i<resTypes.data.length;i++){
441
+ this.menulist.push({catename:resTypes.data[i].f_type,expanded: true,type:'材料类型'})
442
+ }
443
+ for(let i=0;i<this.menulist.length;i++){
444
+ let _child = []
445
+ for(let j=0;j<res.data.length;j++){
446
+ if(this.menulist[i].catename == res.data[j].f_type){
447
+ _child.push({catename:res.data[j].f_name,expanded: false,type:'材料名称'})
448
+ }
449
+ }
450
+ this.menulist[i]._child=_child
451
+ }
452
+ this.addshowm = false
453
+ this.$nextTick(()=> {
454
+ this.addshowm = true
455
+ })
456
+ console.log('menulist',this.menulist)
457
+ },
458
+ async export(row) {
459
+ console.log("导出",row)
460
+ let exportdata = {
461
+ body:{
462
+ data:{
463
+ condition:`f_apply_num = '${this.selectdata.f_apply_num}' `, // 查询条件and id ='${row.id}'
464
+ items:"f_material_install,f_material_name,f_material_model,f_unit,f_amount"
465
+ },
466
+ field:["f_material_install:安装","f_material_name:材料名称","f_material_model:规格、型号","f_unit:单位","f_amount:数量"],
467
+ sqlName:"materialExport",
468
+ templateName:"材料导出"
469
+ }
470
+ }
471
+ let httpExport = new HttpResetClass()
472
+ let res = await httpExport.load('POST', 'rs/logic/exportfile', {data: exportdata}, {
473
+ resolveMsg: null,
474
+ rejectMsg: "材料导出失败"
475
+ }, {silent: true})
476
+ //res :[{"filename":"/D:/服务文件/apache-5002/webapps/manage/excel/流程监控全部导出.xlsx"}]
477
+ let downloadPath = res.data[0].filename
478
+ let downloadURL = "http://" + location.host + "/excel" + downloadPath.split('excel')[1]
479
+ // js 下载
480
+ let aTag = document.createElement('a')
481
+ aTag.download = "材料导出.xlsx"
482
+ aTag.href = downloadURL
483
+ aTag.click()
484
+ URL.revokeObjectURL(aTag.href)
485
+ // $("<a href=" + downloadURL + " />")[0].click()
486
+ },
487
+ async deleteItem(row) {
488
+ let res = await this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel'])
489
+ if (res === 'confirm') {
490
+ let http = new HttpResetClass()
491
+ http.load('DELETE', `rs/entity/t_material_list/${row.id}`).then((res)=>{
492
+ for(let i=0;i<this.batchmodel.rows.length;i++){
493
+ if(this.batchmodel.rows[i].id == row.id){
494
+ this.batchmodel.rows.splice(i,1)
495
+ }
496
+ }
497
+ })
498
+ }
499
+
500
+ },
501
+ async xinhao() {
502
+ if (!this.model.f_batch_norms[0]) {
503
+ return
504
+ }
505
+ let temp = []
506
+ for (let row of this.optionsx) {
507
+ if (this.model.f_batch_norms[0] == row.f_format) {
508
+ temp.push({label: row.f_num, value: row.f_num})
509
+ }
510
+ }
511
+ this.xinhaooptions = temp
512
+ },
513
+ async bianma() {
514
+ let temp = []
515
+ for (let row of this.optionsx) {
516
+ if (this.model.f_batch_norms[0] && this.model.f_batch_norms[0] == row.f_format && this.model.f_batch_version[0] && this.model.f_batch_version[0] == row.f_num) {
517
+ temp.push({label: row.f_code, value: row.f_code})
518
+ } else if (this.model.f_batch_norms[0] && this.model.f_batch_norms[0] == row.f_format) {
519
+ temp.push({label: row.f_code, value: row.f_code})
520
+ }
521
+ }
522
+ this.codeOptions = temp
523
+ },
524
+ async guige() {
525
+ // let http = new HttpResetClass()
526
+ let data = {
527
+ columnname: `f_type`,
528
+ tablename: 't_material_class',
529
+ condition: `1=1`
530
+ }
531
+ let http = new HttpResetClass()
532
+
533
+ let res = await http.load('POST','rs/sql/getdistinct', {data: data}, {
534
+ resolveMsg: null,
535
+ rejectMsg: '获取材料类型失败'
536
+ })
537
+ this.menulist = []
538
+ for(let i=0;i<res.data.length;i++){
539
+ this.menulist.push({catename:res.data[i].f_type,expanded: false,type:'材料类型'})
540
+ }
541
+ console.log('menulist',this.menulist)
542
+ },
543
+ /* async getname() {
544
+ let http = new HttpResetClass()
545
+ let data = await http.load('POST', 'rs/logic/getMaterialAddItem', {data: {condition: `f_apply_num = '${this.selectdata.f_apply_num}' `}}, {
546
+ resolveMsg: null,
547
+ rejectMsg: null
548
+ })
549
+ console.log('查询到的选项', data)
550
+ let house = []
551
+ let codeOptionstemp = []
552
+ for (let row of data.data.f_name) {
553
+ // codeOptionstemp.push({label: row.f_code,value: row.f_code})
554
+ house.push({label: row.f_name, value: row.f_name})
555
+ }
556
+ // this.codeOptions = codeOptionstemp
557
+ this.material = []
558
+ this.material = house
559
+ let house2 = [{label: '全部', value: ''}]
560
+ for (let row of data.data.f_user_name) {
561
+ house2.push({label: row.f_material_operator, value: row.f_material_operator})
562
+ }
563
+ this.f_user_name = []
564
+ this.f_user_name = house2
565
+ },*/
566
+ addDetailed() {
567
+ this.addshow = true
568
+ /* this.show = true*/
569
+ },
570
+ addclose() {
571
+ this.addshow = false
572
+ // this.model = {}
573
+ },
574
+ // async addconfirm() {
575
+ // if (!this.model.f_batch_name) {
576
+ // this.$showAlert("请输入材料名称", "warning", 1500)
577
+ // return
578
+ // }
579
+ // if (!this.model.f_batch_code) {
580
+ // this.$showAlert("请选择材料编码", "warning", 1500)
581
+ // return
582
+ // }
583
+ // if (!this.model.f_budget_num) {
584
+ // this.$showAlert("请输入材料数量", "warning", 1500)
585
+ // return
586
+ // }
587
+ // return await insertdetail(this)
588
+ //
589
+ // },
590
+ // 父组件更新子组件属性
591
+ updateData(val) {
592
+ this.headers.blodid = val.f_process_id
593
+ this.selectdata = val
594
+ },
595
+ addmaterial() {
596
+ // this.$showMessage(`是否确认添加批次`, ['confirm', 'cancel']).then((res) => {
597
+ // if (res === 'confirm') {
598
+ // insert(this)
599
+ // }
600
+ // })
601
+
602
+
603
+ },
604
+ /*async load() {
605
+ let http = new HttpResetClass()
606
+ let data = {
607
+ columnname: 'f_material_name',
608
+ tablename: 't_materials_detailed',
609
+ condition: `1=1`
610
+ }
611
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
612
+ resolveMsg: null,
613
+ rejectMsg: null
614
+ }, {silent: true})
615
+ res.data.forEach((row) => {
616
+ let temp = {
617
+ label: row.f_material_name,
618
+ value: row.f_material_name
619
+ }
620
+ this.fmaterialtype.push(temp)
621
+ })
622
+ },*/
623
+
624
+ commit() {
625
+ console.log("edit>>>>>",)
626
+ //判断当前节点的状态(开始活动/完工)
627
+ var entryName = this.model.f_entry_name //项目名称
628
+ var ename = this.selectdata.f_entry_name
629
+ let http = new HttpResetClass()
630
+ http.load('POST', 'rs/sql/findProcessState', {data: {actid: this.selectdata.actid}}, {
631
+ resolveMsg: null,
632
+ rejectMsg: '提交错误!'
633
+ }).then((res) => {
634
+ if (res.data[0].state != '开始活动') {
635
+ this.$showMessage("该节点信息已在别处提交,请刷新!")
636
+ this.reset()
637
+ } else {
638
+ //通过数据校验再进行下一步判断
639
+ if (this.verification()) {
640
+ if (name == null) {
641
+ //项目名称唯一性判断
642
+ let http2 = new HttpResetClass()
643
+ http2.load('POST', 'rs/sql/findByEntryName', {data: {entryName: entryName}}, {
644
+ resolveMsg: null,
645
+ rejectMsg: '提交错误!'
646
+ }).then((res) => {
647
+ if (res.data.length > 0) {
648
+ console.log('length>0')
649
+ this.$showMessage("项目名称不能重复!")
650
+ } else {
651
+ console.log('length<=0')
652
+ let getGen = gen(this, this.model)
653
+ console.log('getgen')
654
+ co(getGen)
655
+ console.log('co(getgen)')
656
+ }
657
+ })
658
+ } else {
659
+ let getGen = gen(this, this.model)
660
+ co(getGen)
661
+ }
662
+ }
663
+ }
664
+ })
665
+ },
666
+ reset() {
667
+ this.$dispatch('close')
668
+ this.$dispatch('selfsearch')
669
+ },
670
+
671
+ //数据校验
672
+ verification() {
673
+ /* var isNum = /^(([+]?\d*$)|(^[+]?\d+(\.\d+)?$))/ //非负纯数字
674
+ var regex = /.*?[\u4e00-\u9fa5].*?[\u4e00-\u9fa5].*!/ //至少两个汉字
675
+ var phoneReg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/ //手机号码正则
676
+ var telReg = /0\d{2,3}-\d{7,8}/ //座机正则
677
+ if (!this.model.f_entry_name) {
678
+ this.$showMessage("项目名称不能为空!")
679
+ return false
680
+ }*/
681
+ return true
682
+ },
683
+ impexcel() {
684
+ this.isShow = true
685
+ },
686
+ closeFile() {
687
+ this.isShow = false
688
+ // 将选的文件清空
689
+ this.$refs.file.$el.querySelector('input').value = ''
690
+ },
691
+ tovoid(row) {
692
+ console.log('作废')
693
+ getInfo(this, 1, row.id, true)
694
+ },
695
+ async filterParams() {
696
+ this.isShowdetail = false
697
+ let data = {
698
+ tablename: 't_devices',
699
+ condition: `f_process_id = '${this.selectdata.f_process_id}' `
700
+ }
701
+ console.log('condition:', data.condition)
702
+ let reset = new HttpResetClass()
703
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
704
+ .then((res) => {
705
+ console.log('查询结果:', res)
706
+
707
+ this.model.rows = []
708
+ this.model.rows = res.data
709
+ this.params = res.data
710
+ })
711
+ },
712
+ add() {
713
+ this.show = true
714
+ },
715
+ // 修改按钮
716
+ modifyParam(row) {
717
+ this.$set('selectItem.id', row.id)
718
+ this.$set('selectItem.f_devices_type', row.f_devices_type)
719
+ this.$set('selectItem.f_devices_no', row.f_devices_no)
720
+ this.$set('selectItem.f_brand', row.f_brand)
721
+ this.$set('selectItem.f_devices_model', row.f_devices_model)
722
+ this.show = true
723
+ },
724
+ confirm() {
725
+ debugger
726
+ this.selectItem.f_devices_model=this.selectItem.f_devices_model
727
+ this.selectItem.f_apply_num=this.selectdata.f_apply_num
728
+ this.selectItem.f_process_id=this.selectdata.f_process_id
729
+ this.selectItem.f_input_person=Vue.user.name
730
+ this.selectItem.f_devices_state='有效'
731
+ this.selectItem.f_input_date=this.$login.toStandardTimeString()
732
+ let data = {
733
+ tablename: 't_devices',
734
+ parameters: this.selectItem,
735
+ selectdata: this.selectdata,
736
+ }
737
+ let this1 = this
738
+ this.$resetpost('rs/logic/saveentity', {data: data}).then((res) => {
739
+ this.show = false
740
+ this.addshow = false
741
+ getInfo(this, 0, 0, false)
742
+ })
743
+ },
744
+
745
+ // 关闭模态框
746
+ close() {
747
+ this.addshow = false
748
+ this.show = false
749
+ this.selectItem = {}
750
+ },
751
+
752
+ async getaaa() {
753
+ console.log('进来了')
754
+ let data = {
755
+ tablename: 't_material_batch',
756
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
757
+ }
758
+ let reset = new HttpResetClass()
759
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
760
+ .then((res) => {
761
+ this.model.rows = []
762
+ this.model.rows = res.data
763
+ this.params = res.data
764
+ })
765
+ }
766
+ }
767
+ ,
768
+ events: {
769
+ updateTree(){
770
+ this.scrollTop = document.getElementById("treemx").scrollTop
771
+ this.addshowm = false
772
+ this.$nextTick(()=> {
773
+ this.addshowm = true
774
+ })
775
+ },
776
+ async menulistSelected(item,root,parent){
777
+ this.scrollTop = document.getElementById("treemx").scrollTop
778
+ console.log("scrollTop",this.scrollTop)
779
+ if(item.type=='材料类型'){
780
+ console.log('选了材料类型')
781
+ let data = {
782
+ columnname: `f_name`,
783
+ tablename: 't_material_class',
784
+ condition: `f_type = '${item.catename}'`
785
+ }
786
+ let res = await this.$resetpost('rs/sql/getdistinct', {data: data}, {
787
+ resolveMsg: null,
788
+ rejectMsg: '获取材料名称失败'
789
+ })
790
+ // this.menulist = []
791
+ let _child = []
792
+ for(let i=0;i<res.data.length;i++){
793
+ _child.push({catename:res.data[i].f_name,expanded: false,type:'材料名称'})
794
+ }
795
+ for(let i=0;i<this.menulist.length;i++){
796
+ if(this.menulist[i].catename==item.catename){
797
+ this.menulist[i]._child= []
798
+ this.menulist[i].expanded = true
799
+ this.menulist[i]._child= _child
800
+ }
801
+ }
802
+ this.addshowm = false
803
+ this.$nextTick(()=> {
804
+ this.addshowm = true
805
+ })
806
+ console.log('menulist',this.menulist)
807
+ }else if(item.type=='材料名称'){
808
+ console.log('选了材料名称')
809
+ let data = {
810
+ columnname: `f_format,f_code`,
811
+ tablename: 't_material_class',
812
+ condition: ` f_name = '${item.catename}' and f_type = '${this.menulist[root].catename}'`
813
+ }
814
+ let res = await this.$resetpost('rs/sql/getdistinct', {data: data}, {
815
+ resolveMsg: null,
816
+ rejectMsg: '获取材料规格失败'
817
+ })
818
+ // this.menulist = []
819
+ let _child = []
820
+ for(let i=0;i<res.data.length;i++){
821
+ _child.push({catename:res.data[i].f_format,expanded: false,type:'材料规格',f_code:res.data[i].f_code})
822
+ }
823
+ for(let i=0;i<this.menulist.length;i++){
824
+ if(this.menulist[i].catename==this.menulist[root].catename){
825
+ for(let j=0;j<this.menulist[i]._child.length;j++){
826
+ if(this.menulist[i]._child[j].catename==item.catename){
827
+ this.$refs.tree2.menulist[i]._child[j]._child= []
828
+ this.$refs.tree2.menulist[i]._child[j].expanded = true
829
+ this.$refs.tree2.menulist[i]._child[j]._child= _child
830
+ break
831
+ }
832
+ }
833
+ }
834
+ }
835
+ this.addshowm = false
836
+ this.$nextTick(()=> {
837
+ this.addshowm = true
838
+ })
839
+ console.log('menulist',this.menulist)
840
+ }else if(item.type=='材料规格'){
841
+ console.log('选了材料规格')
842
+ this.model.f_batch_name = [this.menulist[root]._child[parent].catename]
843
+ this.model.f_batch_code = [item.f_code]
844
+ this.model.f_budget_num = item.count
845
+ let flag = await this.addconfirm()
846
+ if(flag == false){
847
+ for(let i =0;i<this.menulist[root]._child[parent]._child.length;i++){
848
+ if(this.menulist[root]._child[parent]._child[i].f_code = item.f_code){
849
+ this.menulist[root]._child[parent]._child[i].count = null
850
+ }
851
+ }
852
+ }
853
+ this.addshowm = false
854
+ this.$nextTick(()=> {
855
+ this.addshowm = true
856
+ })
857
+ console.log('menulist',this.menulist)
858
+ }
859
+ this.addshowm = false
860
+ this.$nextTick(()=> {
861
+ this.addshowm = true
862
+ })
863
+ },
864
+ onFileUpload: function (file, res) {
865
+ if (!this.selectdata.f_process_id) {
866
+ this.$showMessage("数据异常,导入失败")
867
+ return
868
+ }
869
+ let data = {
870
+ tablename: ' t_materials_detailed',
871
+ filepath: res.f_downloadpath,
872
+ processid: this.selectdata.f_process_id,
873
+ f_apply_num: this.selectdata.f_apply_num,
874
+ f_filiale: this.selectdata.f_filiale,
875
+ f_parentname: Vue.user.f_parentname,
876
+ f_material_operator: Vue.user.name
877
+ /* processid:this.selectdata.f_processid*/
878
+ }
879
+ this.$resetpost('rs/logic/materialImport', data, {resolveMsg: '导入成功', rejectMsg: '导入失败'}).then((res) => {
880
+ if(res.data){
881
+ this.iswork=false;
882
+ this.load();
883
+ this.closeFile();
884
+ this.getInfo(self, 0, 0, false);
885
+ let mm = '';
886
+ for(var i=0;i<res.data.msg.length;i++){
887
+ mm+= `${res.data.msg[i].msg}`
888
+ }
889
+ let msg = `共导入${res.data.alllength}条,失败${res.data.errorlen}条,失败信息:${mm}`
890
+ // this.$showMessage(msg)
891
+
892
+ }
893
+ })
894
+ }
895
+ }
896
+ }
897
+ </script>
898
+ <style scoped>
899
+ .recordTable table tr th {
900
+ font-weight: bold;
901
+ }
902
+
903
+ .recordTable table tr:hover {
904
+ background-color: rgb(230, 230, 230);
905
+ }
906
+
907
+ td {
908
+ text-align: center !important
909
+ }
910
+
911
+ .input-select {
912
+ width: 100%;
913
+ height: 34px;
914
+ align-content: center;
915
+ margin-top: 10px;
916
+ }
917
+ </style>