apply-clients 3.5.4-99 → 3.5.5-10

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