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,801 @@
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>备注</th>
16
+ <th >操作</th>
17
+ <th class="textNoLineBreak">
18
+ <button class="button_new button_spacing" type="button" @click="$parent.$parent.$parent.addDetailed()">添加
19
+ </button>
20
+ </th>
21
+ </tr>
22
+ </template>
23
+ <template partial='body'>
24
+ <td >{{$index+1}}</td>
25
+ <td >{{row.f_material_install}}</td>
26
+ <td>{{row.f_material_name}}</td>
27
+ <td >{{row.f_material_model}}</td>
28
+ <td >{{row.f_unit}}</td>
29
+ <td>{{row.f_amount}}</td>
30
+ <td>{{row.f_material_remarks}}</td>
31
+ <td class="" v-show="$parent.$parent.$parent.showprint">
32
+ <button type="button" name="button" class="btn btn-link" :disabled="row.f_effective_state == '无效'"
33
+ @click.stop="$parent.$parent.$parent.tovoid(row)">作废
34
+ </button>
35
+ <button type="button" name="button" class="btn btn-link"
36
+ @click.stop="$parent.$parent.$parent.modifyParam(row)">修改
37
+ </button>
38
+ </td>
39
+ </template>
40
+ </data-grid>
41
+ </partial-view>
42
+ </div>
43
+ </div>
44
+ <modal :show.sync="addshow" v-ref:modal backdrop="false">
45
+ <header slot="modal-header" class="modal-header">
46
+ <button type="button" class="close" @click="addclose"><span>&times;</span></button>
47
+ <h4 class="modal-title">添加材料</h4>
48
+ </header>
49
+ <article slot="modal-body" class="modal-body">
50
+ <div class="from-group">
51
+ <label>安装</label>
52
+ <input type="text" class="form-control" v-model="selectItem.f_material_install">
53
+ </div>
54
+ <div class="from-group">
55
+ <label>材料名称</label>
56
+ <input type="text" class="form-control" v-model="selectItem.f_material_name">
57
+ </div>
58
+ <div class="from-group">
59
+ <label>规格、型号</label>
60
+ <input type="text" class="form-control" v-model="selectItem.f_material_model">
61
+ </div>
62
+ <div class="from-group">
63
+ <label>单位</label>
64
+ <input type="text" class="form-control" v-model="selectItem.f_unit">
65
+ </div>
66
+ <div class="from-group">
67
+ <label>数量</label>
68
+ <input type="number" class="form-control" v-model="selectItem.f_amount">
69
+ </div>
70
+ <div class="from-group">
71
+ <label>备注</label>
72
+ <input type="text" class="form-control" v-model="selectItem.f_material_remarks">
73
+ </div>
74
+ </article>
75
+ <footer slot="modal-footer" class="modal-footer">
76
+ <div class="from-group" style="width: 100%;float: left">
77
+ <button v-show="addshow" type="button" class="btn btn-default" @click='close'>取消</button>
78
+ <button v-show="addshow" type="button" class="btn btn-success" @click='confirm'>确认</button>
79
+ </div>
80
+ </footer>
81
+ </modal>
82
+ <modal :show.sync="show" v-ref:modal backdrop="false">
83
+ <header slot="modal-header" class="modal-header">
84
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
85
+ <h4 class="modal-title">修改明细</h4>
86
+ </header>
87
+ <article slot="modal-body" class="modal-body">
88
+ <div class="from-group">
89
+ <label>材料名称</label>
90
+ <input type="text" class="form-control" v-model="selectItem.f_material_name" readonly>
91
+ </div>
92
+ <div class="from-group">
93
+ <label>规格、型号</label>
94
+ <input type="text" class="form-control" v-model="selectItem.f_material_model" readonly>
95
+ </div>
96
+ <div class="from-group">
97
+ <label>安装</label>
98
+ <input type="text" class="form-control" v-model="selectItem.f_material_install">
99
+ </div>
100
+ <div class="from-group">
101
+ <label>单位</label>
102
+ <input type="text" class="form-control" v-model="selectItem.f_unit">
103
+ </div>
104
+ <div class="from-group">
105
+ <label>材料数量</label>
106
+ <input type="number" class="form-control" v-model="selectItem.f_amount">
107
+ </div>
108
+ </article>
109
+ <footer slot="modal-footer" class="modal-footer">
110
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
111
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm'>确认</button>
112
+ </footer>
113
+ </modal>
114
+ </div>
115
+ </template>
116
+
117
+ <script>
118
+ import { PagedList } from 'vue-client'
119
+ import {HttpResetClass} from 'vue-client'
120
+ import Vue from 'vue'
121
+ import co from 'co'
122
+ let insert = async function (self) {
123
+ let param = {
124
+ processid: self.selectdata.f_process_id,
125
+ f_apply_num: self.selectdata.f_apply_num,
126
+ f_filiale: self.selectdata.f_filiale,
127
+ f_parentname: Vue.user.f_parentname,
128
+ f_material_operator: Vue.user.name,
129
+ f_effective_state: '有效',
130
+ f_picking_state: '未领完'
131
+ }
132
+ console.log('新增批次', param)
133
+ self.$resetpost('rs/entity/t_material_batch', param).then(() => {
134
+ // this.params.rows.splice(index, 1)
135
+ console.log('更新成功!')
136
+ self.getaaa()
137
+ })
138
+ }
139
+ let insertdetail = async function (self) {
140
+ let data = {
141
+ f_batch_name: self.model.f_batch_name[0],
142
+ f_batch_code: self.model.f_batch_code[0],
143
+ f_apply_num: self.selectdata.f_apply_num,
144
+ f_batch_id: self.batch_id,
145
+ }
146
+ console.log('判断数据:', data)
147
+ return await self.$resetpost('rs/logic/insertdetail', data, {resolveMsg: null, rejectMsg: null}).then((res) => {
148
+ // this.params.rows.splice(index, 1)
149
+ console.log('更新成功!', res)
150
+ if (res.data.batch.length > 0) {
151
+ self.$showMessage("已添加过此材料,请勿重复添加,若要修改数量请点击修改!")
152
+ return false
153
+ } else {
154
+ if (res.data.array.length > 0) {
155
+ let param = {
156
+ f_batch_id: self.batch_id,
157
+ f_apply_num: self.selectdata.f_apply_num,
158
+ f_filiale: self.selectdata.f_filiale,
159
+ f_parentname: Vue.user.f_parentname,
160
+ f_material_operator: Vue.user.name,
161
+ f_batch_name: self.model.f_batch_name[0],
162
+ f_budget_num: self.model.f_budget_num,
163
+ f_surplus_num: self.model.f_budget_num,
164
+ f_add_receive: 0,
165
+ f_receive_num: 0,
166
+ f_revenue_id: res.data.array[0].id,
167
+ f_batch_type: res.data.array[0].f_type,
168
+ f_batch_code: res.data.array[0].f_code,
169
+ f_batch_version: res.data.array[0].f_num,
170
+ f_batch_norms: res.data.array[0].f_format,
171
+ f_batch_company: res.data.array[0].f_unit,
172
+ f_batch_price: res.data.array[0].f_price
173
+ }
174
+ console.log('添加明细:', param)
175
+ self.$resetpost('rs/entity/t_material_list', param).then(() => {
176
+ // this.params.rows.splice(index, 1)
177
+ console.log('更新成功!')
178
+ self.showdetail(self.batch_id, '有效')
179
+ self.model.f_batch_name = []
180
+ self.model.f_batch_code = []
181
+ self.model.f_batch_version = []
182
+ self.model.f_batch_norms = []
183
+ self.model.f_budget_num = ''
184
+ self.addshow = false
185
+ })
186
+ } else {
187
+ self.$showMessage('此种材料系统中不存在!请检查材料名称')
188
+ }
189
+ }
190
+
191
+
192
+ })
193
+
194
+
195
+ }
196
+ let getInfo = async function (self, isbatchdetail, batchid, istoVoidBatch) {
197
+ if (!self.selectdata)
198
+ return
199
+
200
+ if (isbatchdetail == 1) {
201
+ let data = {
202
+ tablename: 't_materials_detailed',
203
+ condition: ` id ='${batchid}' `
204
+ }
205
+ let reset = new HttpResetClass()
206
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
207
+ .then((res) => {
208
+ console.log('查询完毕,返回res.data=>' + JSON.stringify(res.data))
209
+ self.batchmodel.rows = []
210
+ self.batchmodel.rows = res.data
211
+ if (istoVoidBatch) {
212
+ console.log('进入istovoidBatch')
213
+ let num = 0
214
+ for (var i = 0; i < self.batchmodel.rows.length; i++) {
215
+ num += self.batchmodel.rows[i].f_add_receive
216
+ console.log(i + 'f_add_receive' + self.batchmodel.rows[i].f_add_receive)
217
+ }
218
+ if (num > 0) {
219
+ self.$showMessage('累计领取数量大于0,不能作废!')
220
+ } else {
221
+ self.$showMessage('作废后不可恢复,确认作废吗?', ['confirm', 'cancel']).then((res) => {
222
+ if (res === 'confirm') {
223
+ self.$resetpost('rs/logic/tovoidbatch', {id: batchid}).then((res) => {
224
+ getInfo(self, 0, 0, false)
225
+ })
226
+ }
227
+ })
228
+ }
229
+ }
230
+ })
231
+
232
+ } else {
233
+ let data = {
234
+ tablename: 't_materials_detailed',
235
+ condition: `f_apply_num = '${self.selectdata.f_apply_num}' `
236
+ }
237
+ let reset = new HttpResetClass()
238
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
239
+ .then((res) => {
240
+ self.model.rows = []
241
+ self.model.rows = res.data
242
+ self.params = res.data
243
+ })
244
+ }
245
+ }
246
+ let gen = function* (self, val) {
247
+ let data = {
248
+ model: {
249
+ f_processid: self.selectdata.f_process_id,
250
+ },
251
+ loginUser: {
252
+ id: Vue.user.id,
253
+ name: Vue.user.name,
254
+ ename: Vue.user.ename
255
+ },
256
+ employeetemplate: self.employeetemplate,// 指派勘察人员
257
+ subdep: '提交'
258
+ }
259
+ console.log('提交前')
260
+ self.$resetpost(`rs/logic/grantnext`,
261
+ {data: data})
262
+ .then(() => {
263
+ self.reset()
264
+ })
265
+ }
266
+ export default {
267
+ title: '材料信息',
268
+ props: {
269
+ flag:{
270
+ type: String,
271
+ default: 'cl'
272
+ },
273
+ selectdata: {
274
+ type: Object
275
+ },
276
+ edit: {
277
+ type: Boolean,
278
+ default: true
279
+ },
280
+ state: {
281
+ type: Number
282
+ },
283
+ showprint: {
284
+ type: Boolean,
285
+ default: true
286
+ }
287
+ },
288
+ data() {
289
+ return {
290
+ scrollTop:0, // 添加材料模态框的高度
291
+ searchName:null,
292
+ addshowm:true,
293
+ menulist: null,
294
+ refreshed: true,
295
+ guigeoptions: [],
296
+ xinhaooptions: [],
297
+ materialItem: [],
298
+ codeOptions: [],
299
+ fmaterialtype: [],
300
+ fmaterialname: [],
301
+ fmaterialspec: [],
302
+ fmaterialprice: [],
303
+ params: null,
304
+ record: {},
305
+ selectItem: {},
306
+ isbuttonshow: true,
307
+ model: {
308
+ rows: []
309
+ },
310
+ f_effective_state: [
311
+ {label: '有效', value: '有效'},
312
+ {label: '无效', value: '无效'},
313
+ {label: '全部', value: ''}
314
+ ],
315
+ batchmodel: {
316
+ rows: []
317
+ },
318
+ show: false,
319
+ isShow: false,
320
+ isShowdetail: false,
321
+ isSelected: {
322
+ type:Boolean,
323
+ default:false
324
+ },
325
+ addshow: false,
326
+ batch_id: 0,
327
+ material: [],
328
+ optionsx: [],
329
+ f_user_name: [],
330
+ all: true,
331
+ modelval: [],
332
+ printshow: false,
333
+ fields: {},
334
+ thead: '',
335
+ tfoot: '22222',
336
+ printName: '材料',
337
+ headData: ["安装","材料名称","规格、型号","单位","数量","备注"],
338
+ bodyData: ["f_material_install", "f_material_name", "f_material_model","f_unit","f_amount","f_material_remarks"],
339
+ footinfo: ["主管领导","领料人"]
340
+ }
341
+ },
342
+ async ready() {
343
+ this.isShowdetail = false
344
+ getInfo(this, 0, 0, false)
345
+ },
346
+ watch: {
347
+ },
348
+ computed: {
349
+
350
+ },
351
+ methods: {
352
+ async searchByName(){
353
+ console.log('搜索材料名车')
354
+ let http = new HttpResetClass()
355
+ let data2 = {
356
+ columnname: `f_type`,
357
+ tablename: 't_material_class',
358
+ condition: ` f_name like '%${this.searchName}%'`
359
+ }
360
+ let resTypes = await http.load('POST', 'rs/sql/getdistinct', {data: data2}, {
361
+ resolveMsg: null,
362
+ rejectMsg: "获取f_material_name失败"
363
+ }, {silent: true})
364
+ let data = {
365
+ columnname: `f_name,f_type`,
366
+ tablename: 't_material_class',
367
+ condition: ` f_name like '%${this.searchName}%'`
368
+ }
369
+ let res = await this.$resetpost('rs/sql/getdistinct', {data: data}, {
370
+ resolveMsg: null,
371
+ rejectMsg: '搜索材料名称失败'
372
+ })
373
+ this.menulist = []
374
+ for(let i=0;i<resTypes.data.length;i++){
375
+ this.menulist.push({catename:resTypes.data[i].f_type,expanded: true,type:'材料类型'})
376
+ }
377
+ for(let i=0;i<this.menulist.length;i++){
378
+ let _child = []
379
+ for(let j=0;j<res.data.length;j++){
380
+ if(this.menulist[i].catename == res.data[j].f_type){
381
+ _child.push({catename:res.data[j].f_name,expanded: false,type:'材料名称'})
382
+ }
383
+ }
384
+ this.menulist[i]._child=_child
385
+ }
386
+ this.addshowm = false
387
+ this.$nextTick(()=> {
388
+ this.addshowm = true
389
+ })
390
+ console.log('menulist',this.menulist)
391
+ },
392
+ async deleteItem(row) {
393
+ let res = await this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel'])
394
+ if (res === 'confirm') {
395
+ let http = new HttpResetClass()
396
+ http.load('DELETE', `rs/entity/t_material_list/${row.id}`).then((res)=>{
397
+ for(let i=0;i<this.batchmodel.rows.length;i++){
398
+ if(this.batchmodel.rows[i].id == row.id){
399
+ this.batchmodel.rows.splice(i,1)
400
+ }
401
+ }
402
+ })
403
+ }
404
+ },
405
+ async xinhao() {
406
+ if (!this.model.f_batch_norms[0]) {
407
+ return
408
+ }
409
+ let temp = []
410
+ for (let row of this.optionsx) {
411
+ if (this.model.f_batch_norms[0] == row.f_format) {
412
+ temp.push({label: row.f_num, value: row.f_num})
413
+ }
414
+ }
415
+ this.xinhaooptions = temp
416
+ },
417
+ async bianma() {
418
+ let temp = []
419
+ for (let row of this.optionsx) {
420
+ 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) {
421
+ temp.push({label: row.f_code, value: row.f_code})
422
+ } else if (this.model.f_batch_norms[0] && this.model.f_batch_norms[0] == row.f_format) {
423
+ temp.push({label: row.f_code, value: row.f_code})
424
+ }
425
+ }
426
+ this.codeOptions = temp
427
+ },
428
+ async guige() {
429
+ // let http = new HttpResetClass()
430
+ let data = {
431
+ columnname: `f_type`,
432
+ tablename: 't_material_class',
433
+ condition: `1=1`
434
+ }
435
+ let http = new HttpResetClass()
436
+
437
+ let res = await http.load('POST','rs/sql/getdistinct', {data: data}, {
438
+ resolveMsg: null,
439
+ rejectMsg: '获取材料类型失败'
440
+ })
441
+ this.menulist = []
442
+ for(let i=0;i<res.data.length;i++){
443
+ this.menulist.push({catename:res.data[i].f_type,expanded: false,type:'材料类型'})
444
+ }
445
+ console.log('menulist',this.menulist)
446
+ },
447
+ addDetailed() {
448
+ this.addshow = true
449
+ },
450
+ addclose() {
451
+ this.addshow = false
452
+ },
453
+ async addconfirm() {
454
+ if (!this.model.f_batch_name) {
455
+ this.$showAlert("请输入材料名称", "warning", 1500)
456
+ return
457
+ }
458
+ if (!this.model.f_batch_code) {
459
+ this.$showAlert("请选择材料编码", "warning", 1500)
460
+ return
461
+ }
462
+ if (!this.model.f_budget_num) {
463
+ this.$showAlert("请输入材料数量", "warning", 1500)
464
+ return
465
+ }
466
+ return await insertdetail(this)
467
+
468
+ },
469
+ addmaterial() {
470
+ },
471
+ async load() {
472
+ let http = new HttpResetClass()
473
+ let data = {
474
+ columnname: 'f_material_name',
475
+ tablename: 't_materials_detailed',
476
+ condition: `1=1`
477
+ }
478
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
479
+ resolveMsg: null,
480
+ rejectMsg: null
481
+ }, {silent: true})
482
+ res.data.forEach((row) => {
483
+ let temp = {
484
+ label: row.f_material_name,
485
+ value: row.f_material_name
486
+ }
487
+ this.fmaterialtype.push(temp)
488
+ })
489
+ },
490
+
491
+ commit() {
492
+ console.log("edit>>>>>",)
493
+ var entryName = this.model.f_entry_name //项目名称
494
+ var ename = this.selectdata.f_entry_name
495
+ let http = new HttpResetClass()
496
+ http.load('POST', 'rs/sql/findProcessState', {data: {actid: this.selectdata.actid}}, {
497
+ resolveMsg: null,
498
+ rejectMsg: '提交错误!'
499
+ }).then((res) => {
500
+ if (res.data[0].state != '开始活动') {
501
+ this.$showMessage("该节点信息已在别处提交,请刷新!")
502
+ this.reset()
503
+ } else {
504
+ //通过数据校验再进行下一步判断
505
+ if (this.verification()) {
506
+ if (name == null) {
507
+ //项目名称唯一性判断
508
+ let http2 = new HttpResetClass()
509
+ http2.load('POST', 'rs/sql/findByEntryName', {data: {entryName: entryName}}, {
510
+ resolveMsg: null,
511
+ rejectMsg: '提交错误!'
512
+ }).then((res) => {
513
+ if (res.data.length > 0) {
514
+ console.log('length>0')
515
+ this.$showMessage("项目名称不能重复!")
516
+ } else {
517
+ console.log('length<=0')
518
+ let getGen = gen(this, this.model)
519
+ console.log('getgen')
520
+ co(getGen)
521
+ console.log('co(getgen)')
522
+ }
523
+ })
524
+ } else {
525
+ let getGen = gen(this, this.model)
526
+ co(getGen)
527
+ }
528
+ }
529
+ }
530
+ })
531
+ },
532
+ reset() {
533
+ this.$dispatch('close')
534
+ this.$dispatch('selfsearch')
535
+ },
536
+
537
+ //数据校验
538
+ verification() {
539
+ /* var isNum = /^(([+]?\d*$)|(^[+]?\d+(\.\d+)?$))/ //非负纯数字
540
+ var regex = /.*?[\u4e00-\u9fa5].*?[\u4e00-\u9fa5].*!/ //至少两个汉字
541
+ var phoneReg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/ //手机号码正则
542
+ var telReg = /0\d{2,3}-\d{7,8}/ //座机正则
543
+ if (!this.model.f_entry_name) {
544
+ this.$showMessage("项目名称不能为空!")
545
+ return false
546
+ }*/
547
+ return true
548
+ },
549
+ impexcel() {
550
+ this.isShow = true
551
+ },
552
+ closeFile() {
553
+ this.isShow = false
554
+ // 将选的文件清空
555
+ this.$refs.file.$el.querySelector('input').value = ''
556
+ },
557
+ tovoid(row) {
558
+ console.log('作废')
559
+ getInfo(this, 1, row.id, true)
560
+ },
561
+ async filterParams() {
562
+ this.isShowdetail = false
563
+ let data = {
564
+ tablename: 't_materials_detailed',
565
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
566
+ }
567
+ console.log('condition:', data.condition)
568
+ let reset = new HttpResetClass()
569
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
570
+ .then((res) => {
571
+ console.log('查询结果:', res)
572
+
573
+ this.model.rows = []
574
+ this.model.rows = res.data
575
+ this.params = res.data
576
+ })
577
+ },
578
+ add() {
579
+ this.show = true
580
+ },
581
+ // 修改按钮
582
+ modifyParam(row) {
583
+ this.$set('selectItem.id', row.id)
584
+
585
+ this.$set('selectItem.f_apply_num', row.f_apply_num)
586
+ this.$set('selectItem.f_process_id', row.f_process_id)
587
+
588
+ this.$set('selectItem.f_material_install', row.f_material_install)
589
+ this.$set('selectItem.f_material_name', row.f_material_name)
590
+ this.$set('selectItem.f_material_model', row.f_material_model)
591
+ this.$set('selectItem.f_unit', row.f_unit)
592
+ this.$set('selectItem.f_amount', row.f_amount)
593
+ this.$set('selectItem.f_material_remarks', row.f_material_remarks)
594
+
595
+ this.show = true
596
+ },
597
+ // 缴费情况修改
598
+ paychange(row) {
599
+ let http = new HttpResetClass()
600
+ row.f_pay = !row.f_pay
601
+ http.load('POST', 'rs/logic/saveentity', {data: {tablename: 't_material', parameters: row}}, {
602
+ resolveMsg: null,
603
+ rejectMsg: "缴费状态更新失败"
604
+ }, {silent: true})
605
+ },
606
+ confirm() {
607
+ /* this.selectItem.f_amount = this.selectItem.f_amount*/
608
+ this.selectItem.f_apply_num=this.selectdata.f_apply_num
609
+ this.selectItem.f_process_id=this.selectdata.f_process_id
610
+ let data = {
611
+ tablename: 't_materials_detailed',
612
+ parameters: this.selectItem
613
+ }
614
+ let this1 = this
615
+ this.$resetpost('rs/logic/saveentity', {data: data}).then((res) => {
616
+ this.show = false
617
+ // 如果没有id,需要在数组中添加
618
+ /* getInfo(this, 1, this.selectItem.f_batch_id, false)
619
+ this.selectItem = {}*/
620
+ this.addshow = false
621
+ getInfo(this, 0, 0, false)
622
+
623
+ })
624
+ },
625
+ print () {
626
+ this.$refs.print.PrintAsFile()
627
+ this.printshow = false
628
+ },
629
+ close () {
630
+ this.printshow = false
631
+ this.all = false
632
+ this.show = false
633
+ this.addshow = false
634
+ this.selectItem = {}
635
+ },
636
+ async getaaa() {
637
+ console.log('进来了')
638
+ let data = {
639
+ tablename: 't_material_batch',
640
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
641
+ }
642
+ let reset = new HttpResetClass()
643
+ await reset.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
644
+ .then((res) => {
645
+ this.model.rows = []
646
+ this.model.rows = res.data
647
+ this.params = res.data
648
+ })
649
+ }
650
+ }
651
+ ,
652
+ events: {
653
+ updateTree(){
654
+ this.scrollTop = document.getElementById("treemx").scrollTop
655
+ this.addshowm = false
656
+ this.$nextTick(()=> {
657
+ this.addshowm = true
658
+ })
659
+ },
660
+ async menulistSelected(item,root,parent){
661
+ this.scrollTop = document.getElementById("treemx").scrollTop
662
+ console.log("scrollTop",this.scrollTop)
663
+ if(item.type=='材料类型'){
664
+ console.log('选了材料类型')
665
+ let data = {
666
+ columnname: `f_name`,
667
+ tablename: 't_material_class',
668
+ condition: `f_type = '${item.catename}'`
669
+ }
670
+ let res = await this.$resetpost('rs/sql/getdistinct', {data: data}, {
671
+ resolveMsg: null,
672
+ rejectMsg: '获取材料名称失败'
673
+ })
674
+ // this.menulist = []
675
+ let _child = []
676
+ for(let i=0;i<res.data.length;i++){
677
+ _child.push({catename:res.data[i].f_name,expanded: false,type:'材料名称'})
678
+ }
679
+ for(let i=0;i<this.menulist.length;i++){
680
+ if(this.menulist[i].catename==item.catename){
681
+ this.menulist[i]._child= []
682
+ this.menulist[i].expanded = true
683
+ this.menulist[i]._child= _child
684
+ }
685
+ }
686
+ this.addshowm = false
687
+ this.$nextTick(()=> {
688
+ this.addshowm = true
689
+ })
690
+ console.log('menulist',this.menulist)
691
+ }else if(item.type=='材料名称'){
692
+ console.log('选了材料名称')
693
+ let data = {
694
+ columnname: `f_format,f_code`,
695
+ tablename: 't_material_class',
696
+ condition: ` f_name = '${item.catename}' and f_type = '${this.menulist[root].catename}'`
697
+ }
698
+ let res = await this.$resetpost('rs/sql/getdistinct', {data: data}, {
699
+ resolveMsg: null,
700
+ rejectMsg: '获取材料规格失败'
701
+ })
702
+ // this.menulist = []
703
+ let _child = []
704
+ for(let i=0;i<res.data.length;i++){
705
+ _child.push({catename:res.data[i].f_format,expanded: false,type:'材料规格',f_code:res.data[i].f_code})
706
+ }
707
+ for(let i=0;i<this.menulist.length;i++){
708
+ if(this.menulist[i].catename==this.menulist[root].catename){
709
+ for(let j=0;j<this.menulist[i]._child.length;j++){
710
+ if(this.menulist[i]._child[j].catename==item.catename){
711
+ this.$refs.tree2.menulist[i]._child[j]._child= []
712
+ this.$refs.tree2.menulist[i]._child[j].expanded = true
713
+ this.$refs.tree2.menulist[i]._child[j]._child= _child
714
+ break
715
+ }
716
+ }
717
+ }
718
+ }
719
+ this.addshowm = false
720
+ this.$nextTick(()=> {
721
+ this.addshowm = true
722
+ })
723
+ console.log('menulist',this.menulist)
724
+ }else if(item.type=='材料规格'){
725
+ console.log('选了材料规格')
726
+ this.model.f_batch_name = [this.menulist[root]._child[parent].catename]
727
+ this.model.f_batch_code = [item.f_code]
728
+ this.model.f_budget_num = item.count
729
+ let flag = await this.addconfirm()
730
+ if(flag == false){
731
+ for(let i =0;i<this.menulist[root]._child[parent]._child.length;i++){
732
+ if(this.menulist[root]._child[parent]._child[i].f_code = item.f_code){
733
+ this.menulist[root]._child[parent]._child[i].count = null
734
+ }
735
+ }
736
+ }
737
+ this.addshowm = false
738
+ this.$nextTick(()=> {
739
+ this.addshowm = true
740
+ })
741
+ console.log('menulist',this.menulist)
742
+ }
743
+ this.addshowm = false
744
+ this.$nextTick(()=> {
745
+ this.addshowm = true
746
+ })
747
+ },
748
+ onFileUpload: function (file, res) {
749
+ if (!this.selectdata.f_process_id) {
750
+ this.$showMessage("数据异常,导入失败")
751
+ return
752
+ }
753
+ let data = {
754
+ tablename: ' t_materials_detailed',
755
+ filepath: res.f_downloadpath,
756
+ processid: this.selectdata.f_process_id,
757
+ f_apply_num: this.selectdata.f_apply_num,
758
+ f_filiale: this.selectdata.f_filiale,
759
+ f_parentname: this.$login.f.f_parentname,
760
+ f_material_operator: this.$login.f.name
761
+ /* processid:this.selectdata.f_processid*/
762
+ }
763
+ this.$resetpost('rs/logic/materialImport', data, {resolveMsg: '导入成功', rejectMsg: '导入失败'}).then((res) => {
764
+ if(res.data){
765
+ this.iswork=false;
766
+ this.load();
767
+ this.closeFile();
768
+ getInfo(this, 0, 0, false)
769
+ let mm = '';
770
+ for(var i=0;i<res.data.msg.length;i++){
771
+ mm+= `${res.data.msg[i].msg}`
772
+ }
773
+ let msg = `共导入${res.data.alllength}条,失败${res.data.errorlen}条,失败信息:${mm}`
774
+ // this.$showMessage(msg)
775
+
776
+ }
777
+ })
778
+ }
779
+ }
780
+ }
781
+ </script>
782
+ <style scoped>
783
+ .recordTable table tr th {
784
+ font-weight: bold;
785
+ }
786
+
787
+ .recordTable table tr:hover {
788
+ background-color: rgb(230, 230, 230);
789
+ }
790
+
791
+ td {
792
+ text-align: center !important
793
+ }
794
+
795
+ .input-select {
796
+ width: 100%;
797
+ height: 34px;
798
+ align-content: center;
799
+ margin-top: 10px;
800
+ }
801
+ </style>