apply-clients 3.5.4-87 → 3.5.4-89

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 (62) hide show
  1. package/app/src/main/java/com/example/phonechatbot/MainActivity.java +50 -0
  2. package/build/dev-server.js +9 -5
  3. package/package.json +3 -3
  4. package/src/App.vue +3 -3
  5. package/src/components/android/AppTakePic.vue +182 -182
  6. package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
  7. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  8. package/src/components/product/MaterialsManage/MaterialsBase.vue +181 -181
  9. package/src/components/product/MaterialsManage/MaterialsManage.vue +60 -60
  10. package/src/components/product/ServiceView.vue +1026 -1026
  11. package/src/components/product/Supervisory/SupervisoryList.vue +452 -452
  12. package/src/filiale/baiyin/android/ByAddMaterialScience.vue +824 -824
  13. package/src/filiale/dingcheng/pc/SupervisoryList.vue +441 -441
  14. package/src/filiale/fugou/android/AppAddMaterialScience.vue +440 -440
  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 +1845 -1845
  18. package/src/filiale/fugou/android/AppZhihuanManagement.vue +197 -197
  19. package/src/filiale/fugou/android/printCharge.vue +162 -162
  20. package/src/filiale/fugou/android.js +16 -16
  21. package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
  22. package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1705
  23. package/src/filiale/fugou/pc/ServiceView.vue +941 -941
  24. package/src/filiale/fugou/pc/chargeReport.vue +143 -0
  25. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  26. package/src/filiale/fugou/pc/printChargepc.vue +148 -148
  27. package/src/filiale/fugou/pc.js +15 -14
  28. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  29. package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -214
  30. package/src/filiale/gongyi/android/AppInstallationDetails.vue +500 -500
  31. package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -309
  32. package/src/filiale/gongyi/android/AppSign.vue +170 -170
  33. package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -298
  34. package/src/filiale/gongyi/android.js +18 -18
  35. package/src/filiale/gongyi/pc/ApplyUpload.vue +371 -371
  36. package/src/filiale/gongyi/pc/PcAddLogs.vue +221 -221
  37. package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -218
  38. package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -309
  39. package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +894 -894
  40. package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -1005
  41. package/src/filiale/gongyi/pc/addMaterialScience.vue +575 -575
  42. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -765
  43. package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -277
  44. package/src/filiale/gongyi/pc.js +24 -24
  45. package/src/filiale/hongda/pc/SupervisoryList.vue +422 -422
  46. package/src/filiale/jingyang/pc/SupervisoryList.vue +459 -459
  47. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  48. package/src/filiale/qianneng/android.js +15 -15
  49. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
  50. package/src/filiale/qianneng/pc/Applydetail.vue +378 -378
  51. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  52. package/src/filiale/qianneng/pc.js +29 -29
  53. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +527 -527
  54. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +639 -639
  55. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1681 -1681
  56. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +548 -548
  57. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2075 -2075
  58. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +590 -590
  59. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +628 -628
  60. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1059 -1059
  61. package/src/main.js +3 -3
  62. package/~/chatbot/main.py +57 -0
@@ -1,824 +1,824 @@
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-select
57
- :value.sync="selectItem.f_material_name"
58
- v-model="selectItem.f_material_name"
59
- :options="materialNname"
60
- @change="materialNameChange"
61
- ></input-select>
62
- </div>
63
- <div class="from-group">
64
- <label>规格、型号</label>
65
- <input-select
66
- :value.sync="selectItem.f_material_model"
67
- v-model="selectItem.f_material_model"
68
- :options="materialModel"
69
- ></input-select>
70
- </div>
71
- <div class="from-group">
72
- <label>单位</label>
73
- <input type="text" class="form-control" v-model="selectItem.f_unit">
74
- </div>
75
- <div class="from-group">
76
- <label>数量</label>
77
- <input type="number" class="form-control" v-model="selectItem.f_amount">
78
- </div>
79
- <div class="from-group">
80
- <label>备注</label>
81
- <input type="text" class="form-control" v-model="selectItem.f_material_remarks">
82
- </div>
83
- </article>
84
- <footer slot="modal-footer" class="modal-footer">
85
- <div class="from-group" style="width: 100%;float: left">
86
- <button v-show="addshow" type="button" class="btn btn-default" @click='close'>取消</button>
87
- <button v-show="addshow" type="button" class="btn btn-success" @click='confirm'>确认</button>
88
- </div>
89
- </footer>
90
- </modal>
91
- <modal :show.sync="show" v-ref:modal backdrop="false">
92
- <header slot="modal-header" class="modal-header">
93
- <button type="button" class="close" @click="close"><span>&times;</span></button>
94
- <h4 class="modal-title">修改明细</h4>
95
- </header>
96
- <article slot="modal-body" class="modal-body">
97
- <div class="from-group">
98
- <label>材料名称</label>
99
- <input-select
100
- :value.sync="selectItem.f_material_name"
101
- v-model="selectItem.f_material_name"
102
- :options="materialNname"
103
- @change="materialNameChange"
104
- ></input-select>
105
- </div>
106
- <div class="from-group">
107
- <label>规格、型号</label>
108
- <input-select
109
- v-model="selectItem.f_material_model"
110
- :options="materialModel"
111
- ></input-select>
112
- </div>
113
- <div class="from-group">
114
- <label>安装</label>
115
- <input type="text" class="form-control" v-model="selectItem.f_material_install">
116
- </div>
117
- <div class="from-group">
118
- <label>单位</label>
119
- <input type="text" class="form-control" 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
- isbuttonshow: true,
324
- model: {
325
- rows: []
326
- },
327
- f_effective_state: [
328
- {label: '有效', value: '有效'},
329
- {label: '无效', value: '无效'},
330
- {label: '全部', value: ''}
331
- ],
332
- batchmodel: {
333
- rows: []
334
- },
335
- show: false,
336
- isShow: false,
337
- isShowdetail: false,
338
- isSelected: {
339
- type:Boolean,
340
- default:false
341
- },
342
- addshow: false,
343
- batch_id: 0,
344
- material: [],
345
- optionsx: [],
346
- f_user_name: [],
347
- all: true,
348
- modelval: [],
349
- printshow: false,
350
- fields: {},
351
- thead: '',
352
- tfoot: '22222',
353
- printName: '材料',
354
- headData: ["安装","材料名称","规格、型号","单位","数量","备注"],
355
- bodyData: ["f_material_install", "f_material_name", "f_material_model","f_unit","f_amount","f_material_remarks"],
356
- footinfo: ["主管领导","领料人"],
357
- materialNname:this.$appdata.getParam('报建材料'),
358
- materialModel:[]
359
- }
360
- },
361
- async ready() {
362
- this.isShowdetail = false
363
- getInfo(this, 0, 0, false)
364
- },
365
- watch: {
366
- },
367
- computed: {
368
-
369
- },
370
- methods: {
371
- materialNameChange(){
372
- this.materialModel = []
373
- this.materialModel=this.$appdata.getParam(`${this.selectItem.f_material_name}规格型号`)
374
- },
375
- async searchByName(){
376
- console.log('搜索材料名车')
377
- let http = new HttpResetClass()
378
- let data2 = {
379
- columnname: `f_type`,
380
- tablename: 't_material_class',
381
- condition: ` f_name like '%${this.searchName}%'`
382
- }
383
- let resTypes = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data2}, {
384
- resolveMsg: null,
385
- rejectMsg: "获取f_material_name失败"
386
- }, {silent: true})
387
- let data = {
388
- columnname: `f_name,f_type`,
389
- tablename: 't_material_class',
390
- condition: ` f_name like '%${this.searchName}%'`
391
- }
392
- let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
393
- resolveMsg: null,
394
- rejectMsg: '搜索材料名称失败'
395
- })
396
- this.menulist = []
397
- for(let i=0;i<resTypes.data.length;i++){
398
- this.menulist.push({catename:resTypes.data[i].f_type,expanded: true,type:'材料类型'})
399
- }
400
- for(let i=0;i<this.menulist.length;i++){
401
- let _child = []
402
- for(let j=0;j<res.data.length;j++){
403
- if(this.menulist[i].catename == res.data[j].f_type){
404
- _child.push({catename:res.data[j].f_name,expanded: false,type:'材料名称'})
405
- }
406
- }
407
- this.menulist[i]._child=_child
408
- }
409
- this.addshowm = false
410
- this.$nextTick(()=> {
411
- this.addshowm = true
412
- })
413
- console.log('menulist',this.menulist)
414
- },
415
- async deleteItem(row) {
416
- let res = await this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel'])
417
- if (res === 'confirm') {
418
- let http = new HttpResetClass()
419
- http.load('DELETE', `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_list/${row.id}`).then((res)=>{
420
- for(let i=0;i<this.batchmodel.rows.length;i++){
421
- if(this.batchmodel.rows[i].id == row.id){
422
- this.batchmodel.rows.splice(i,1)
423
- }
424
- }
425
- })
426
- }
427
- },
428
- async xinhao() {
429
- if (!this.model.f_batch_norms[0]) {
430
- return
431
- }
432
- let temp = []
433
- for (let row of this.optionsx) {
434
- if (this.model.f_batch_norms[0] == row.f_format) {
435
- temp.push({label: row.f_num, value: row.f_num})
436
- }
437
- }
438
- this.xinhaooptions = temp
439
- },
440
- async bianma() {
441
- let temp = []
442
- for (let row of this.optionsx) {
443
- 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) {
444
- temp.push({label: row.f_code, value: row.f_code})
445
- } else if (this.model.f_batch_norms[0] && this.model.f_batch_norms[0] == row.f_format) {
446
- temp.push({label: row.f_code, value: row.f_code})
447
- }
448
- }
449
- this.codeOptions = temp
450
- },
451
- async guige() {
452
- // let http = new HttpResetClass()
453
- let data = {
454
- columnname: `f_type`,
455
- tablename: 't_material_class',
456
- condition: `1=1`
457
- }
458
- let http = new HttpResetClass()
459
-
460
- let res = await http.load('POST',$`{this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
461
- resolveMsg: null,
462
- rejectMsg: '获取材料类型失败'
463
- })
464
- this.menulist = []
465
- for(let i=0;i<res.data.length;i++){
466
- this.menulist.push({catename:res.data[i].f_type,expanded: false,type:'材料类型'})
467
- }
468
- console.log('menulist',this.menulist)
469
- },
470
- addDetailed() {
471
- this.addshow = true
472
- },
473
- addclose() {
474
- this.addshow = false
475
- },
476
- async addconfirm() {
477
- if (!this.model.f_batch_name) {
478
- this.$showAlert("请输入材料名称", "warning", 1500)
479
- return
480
- }
481
- if (!this.model.f_batch_code) {
482
- this.$showAlert("请选择材料编码", "warning", 1500)
483
- return
484
- }
485
- if (!this.model.f_budget_num) {
486
- this.$showAlert("请输入材料数量", "warning", 1500)
487
- return
488
- }
489
- return await insertdetail(this)
490
-
491
- },
492
- addmaterial() {
493
- },
494
- async load() {
495
- let http = new HttpResetClass()
496
- let data = {
497
- columnname: 'f_material_name',
498
- tablename: 't_materials_detailed',
499
- condition: `1=1`
500
- }
501
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
502
- resolveMsg: null,
503
- rejectMsg: null
504
- }, {silent: true})
505
- res.data.forEach((row) => {
506
- let temp = {
507
- label: row.f_material_name,
508
- value: row.f_material_name
509
- }
510
- this.fmaterialtype.push(temp)
511
- })
512
- },
513
-
514
- commit() {
515
- console.log("edit>>>>>",)
516
- var entryName = this.model.f_entry_name //项目名称
517
- var ename = this.selectdata.f_entry_name
518
- let http = new HttpResetClass()
519
- http.load('POST',` ${this.$androidUtil.getProxyUrl()}/rs/sql/findProcessState`, {data: {actid: this.selectdata.actid}}, {
520
- resolveMsg: null,
521
- rejectMsg: '提交错误!'
522
- }).then((res) => {
523
- if (res.data[0].state != '开始活动') {
524
- this.$showMessage("该节点信息已在别处提交,请刷新!")
525
- this.reset()
526
- } else {
527
- //通过数据校验再进行下一步判断
528
- if (this.verification()) {
529
- if (name == null) {
530
- //项目名称唯一性判断
531
- let http2 = new HttpResetClass()
532
- http2.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/findByEntryName`, {data: {entryName: entryName}}, {
533
- resolveMsg: null,
534
- rejectMsg: '提交错误!'
535
- }).then((res) => {
536
- if (res.data.length > 0) {
537
- console.log('length>0')
538
- this.$showMessage("项目名称不能重复!")
539
- } else {
540
- console.log('length<=0')
541
- let getGen = gen(this, this.model)
542
- console.log('getgen')
543
- co(getGen)
544
- console.log('co(getgen)')
545
- }
546
- })
547
- } else {
548
- let getGen = gen(this, this.model)
549
- co(getGen)
550
- }
551
- }
552
- }
553
- })
554
- },
555
- reset() {
556
- this.$dispatch('close')
557
- this.$dispatch('selfsearch')
558
- },
559
-
560
- //数据校验
561
- verification() {
562
- /* var isNum = /^(([+]?\d*$)|(^[+]?\d+(\.\d+)?$))/ //非负纯数字
563
- var regex = /.*?[\u4e00-\u9fa5].*?[\u4e00-\u9fa5].*!/ //至少两个汉字
564
- var phoneReg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/ //手机号码正则
565
- var telReg = /0\d{2,3}-\d{7,8}/ //座机正则
566
- if (!this.model.f_entry_name) {
567
- this.$showMessage("项目名称不能为空!")
568
- return false
569
- }*/
570
- return true
571
- },
572
- impexcel() {
573
- this.isShow = true
574
- },
575
- closeFile() {
576
- this.isShow = false
577
- // 将选的文件清空
578
- this.$refs.file.$el.querySelector('input').value = ''
579
- },
580
- tovoid(row) {
581
- console.log('作废')
582
- getInfo(this, 1, row.id, true)
583
- },
584
- async filterParams() {
585
- this.isShowdetail = false
586
- let data = {
587
- tablename: 't_materials_detailed',
588
- condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
589
- }
590
- console.log('condition:', data.condition)
591
- let reset = new HttpResetClass()
592
- await reset.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
593
- .then((res) => {
594
- console.log('查询结果:', res)
595
-
596
- this.model.rows = []
597
- this.model.rows = res.data
598
- this.params = res.data
599
- })
600
- },
601
- add() {
602
- this.show = true
603
- },
604
- // 修改按钮
605
- modifyParam(row) {
606
- this.$set('selectItem.id', row.id)
607
-
608
- this.$set('selectItem.f_apply_num', row.f_apply_num)
609
- this.$set('selectItem.f_process_id', row.f_process_id)
610
-
611
- this.$set('selectItem.f_material_install', row.f_material_install)
612
- this.$set('selectItem.f_material_name', row.f_material_name)
613
- this.$set('selectItem.f_material_model', row.f_material_model)
614
- this.$set('selectItem.f_unit', row.f_unit)
615
- this.$set('selectItem.f_amount', row.f_amount)
616
- this.$set('selectItem.f_material_remarks', row.f_material_remarks)
617
-
618
- this.show = true
619
- },
620
- // 缴费情况修改
621
- paychange(row) {
622
- let http = new HttpResetClass()
623
- row.f_pay = !row.f_pay
624
- http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/saveentity`, {data: {tablename: 't_material', parameters: row}}, {
625
- resolveMsg: null,
626
- rejectMsg: "缴费状态更新失败"
627
- }, {silent: true})
628
- },
629
- confirm() {
630
- /* this.selectItem.f_amount = this.selectItem.f_amount*/
631
- this.selectItem.f_apply_num=this.selectdata.f_apply_num
632
- this.selectItem.f_process_id=this.selectdata.f_process_id
633
- let data = {
634
- tablename: 't_materials_detailed',
635
- parameters: this.selectItem
636
- }
637
- let this1 = this
638
- this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/saveentity`, {data: data}).then((res) => {
639
- this.show = false
640
- // 如果没有id,需要在数组中添加
641
- /* getInfo(this, 1, this.selectItem.f_batch_id, false)
642
- this.selectItem = {}*/
643
- this.addshow = false
644
- getInfo(this, 0, 0, false)
645
-
646
- })
647
- },
648
- print () {
649
- this.$refs.print.PrintAsFile()
650
- this.printshow = false
651
- },
652
- close () {
653
- this.printshow = false
654
- this.all = false
655
- this.show = false
656
- this.addshow = false
657
- this.selectItem = {}
658
- },
659
- async getaaa() {
660
- console.log('进来了')
661
- let data = {
662
- tablename: 't_material_batch',
663
- condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
664
- }
665
- let reset = new HttpResetClass()
666
- await reset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/saveentityrs/sql/singleTable`, {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
667
- .then((res) => {
668
- this.model.rows = []
669
- this.model.rows = res.data
670
- this.params = res.data
671
- })
672
- }
673
- }
674
- ,
675
- events: {
676
- updateTree(){
677
- this.scrollTop = document.getElementById("treemx").scrollTop
678
- this.addshowm = false
679
- this.$nextTick(()=> {
680
- this.addshowm = true
681
- })
682
- },
683
- async menulistSelected(item,root,parent){
684
- this.scrollTop = document.getElementById("treemx").scrollTop
685
- console.log("scrollTop",this.scrollTop)
686
- if(item.type=='材料类型'){
687
- console.log('选了材料类型')
688
- let data = {
689
- columnname: `f_name`,
690
- tablename: 't_material_class',
691
- condition: `f_type = '${item.catename}'`
692
- }
693
- let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
694
- resolveMsg: null,
695
- rejectMsg: '获取材料名称失败'
696
- })
697
- // this.menulist = []
698
- let _child = []
699
- for(let i=0;i<res.data.length;i++){
700
- _child.push({catename:res.data[i].f_name,expanded: false,type:'材料名称'})
701
- }
702
- for(let i=0;i<this.menulist.length;i++){
703
- if(this.menulist[i].catename==item.catename){
704
- this.menulist[i]._child= []
705
- this.menulist[i].expanded = true
706
- this.menulist[i]._child= _child
707
- }
708
- }
709
- this.addshowm = false
710
- this.$nextTick(()=> {
711
- this.addshowm = true
712
- })
713
- console.log('menulist',this.menulist)
714
- }else if(item.type=='材料名称'){
715
- console.log('选了材料名称')
716
- let data = {
717
- columnname: `f_format,f_code`,
718
- tablename: 't_material_class',
719
- condition: ` f_name = '${item.catename}' and f_type = '${this.menulist[root].catename}'`
720
- }
721
- let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
722
- resolveMsg: null,
723
- rejectMsg: '获取材料规格失败'
724
- })
725
- // this.menulist = []
726
- let _child = []
727
- for(let i=0;i<res.data.length;i++){
728
- _child.push({catename:res.data[i].f_format,expanded: false,type:'材料规格',f_code:res.data[i].f_code})
729
- }
730
- for(let i=0;i<this.menulist.length;i++){
731
- if(this.menulist[i].catename==this.menulist[root].catename){
732
- for(let j=0;j<this.menulist[i]._child.length;j++){
733
- if(this.menulist[i]._child[j].catename==item.catename){
734
- this.$refs.tree2.menulist[i]._child[j]._child= []
735
- this.$refs.tree2.menulist[i]._child[j].expanded = true
736
- this.$refs.tree2.menulist[i]._child[j]._child= _child
737
- break
738
- }
739
- }
740
- }
741
- }
742
- this.addshowm = false
743
- this.$nextTick(()=> {
744
- this.addshowm = true
745
- })
746
- console.log('menulist',this.menulist)
747
- }else if(item.type=='材料规格'){
748
- console.log('选了材料规格')
749
- this.model.f_batch_name = [this.menulist[root]._child[parent].catename]
750
- this.model.f_batch_code = [item.f_code]
751
- this.model.f_budget_num = item.count
752
- let flag = await this.addconfirm()
753
- if(flag == false){
754
- for(let i =0;i<this.menulist[root]._child[parent]._child.length;i++){
755
- if(this.menulist[root]._child[parent]._child[i].f_code = item.f_code){
756
- this.menulist[root]._child[parent]._child[i].count = null
757
- }
758
- }
759
- }
760
- this.addshowm = false
761
- this.$nextTick(()=> {
762
- this.addshowm = true
763
- })
764
- console.log('menulist',this.menulist)
765
- }
766
- this.addshowm = false
767
- this.$nextTick(()=> {
768
- this.addshowm = true
769
- })
770
- },
771
- onFileUpload: function (file, res) {
772
- if (!this.selectdata.f_process_id) {
773
- this.$showMessage("数据异常,导入失败")
774
- return
775
- }
776
- let data = {
777
- tablename: ' t_materials_detailed',
778
- filepath: res.f_downloadpath,
779
- processid: this.selectdata.f_process_id,
780
- f_apply_num: this.selectdata.f_apply_num,
781
- f_filiale: this.selectdata.f_filiale,
782
- f_parentname: this.$login.f.f_parentname,
783
- f_material_operator: this.$login.f.name
784
- /* processid:this.selectdata.f_processid*/
785
- }
786
- this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/materialImport`, data, {resolveMsg: '导入成功', rejectMsg: '导入失败'}).then((res) => {
787
- if(res.data){
788
- this.iswork=false;
789
- this.load();
790
- this.closeFile();
791
- getInfo(this, 0, 0, false)
792
- let mm = '';
793
- for(var i=0;i<res.data.msg.length;i++){
794
- mm+= `${res.data.msg[i].msg}`
795
- }
796
- let msg = `共导入${res.data.alllength}条,失败${res.data.errorlen}条,失败信息:${mm}`
797
- // this.$showMessage(msg)
798
-
799
- }
800
- })
801
- }
802
- }
803
- }
804
- </script>
805
- <style scoped>
806
- .recordTable table tr th {
807
- font-weight: bold;
808
- }
809
-
810
- .recordTable table tr:hover {
811
- background-color: rgb(230, 230, 230);
812
- }
813
-
814
- td {
815
- text-align: center !important
816
- }
817
-
818
- .input-select {
819
- width: 100%;
820
- height: 34px;
821
- align-content: center;
822
- margin-top: 10px;
823
- }
824
- </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 >操作</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-select
57
+ :value.sync="selectItem.f_material_name"
58
+ v-model="selectItem.f_material_name"
59
+ :options="materialNname"
60
+ @change="materialNameChange"
61
+ ></input-select>
62
+ </div>
63
+ <div class="from-group">
64
+ <label>规格、型号</label>
65
+ <input-select
66
+ :value.sync="selectItem.f_material_model"
67
+ v-model="selectItem.f_material_model"
68
+ :options="materialModel"
69
+ ></input-select>
70
+ </div>
71
+ <div class="from-group">
72
+ <label>单位</label>
73
+ <input type="text" class="form-control" v-model="selectItem.f_unit">
74
+ </div>
75
+ <div class="from-group">
76
+ <label>数量</label>
77
+ <input type="number" class="form-control" v-model="selectItem.f_amount">
78
+ </div>
79
+ <div class="from-group">
80
+ <label>备注</label>
81
+ <input type="text" class="form-control" v-model="selectItem.f_material_remarks">
82
+ </div>
83
+ </article>
84
+ <footer slot="modal-footer" class="modal-footer">
85
+ <div class="from-group" style="width: 100%;float: left">
86
+ <button v-show="addshow" type="button" class="btn btn-default" @click='close'>取消</button>
87
+ <button v-show="addshow" type="button" class="btn btn-success" @click='confirm'>确认</button>
88
+ </div>
89
+ </footer>
90
+ </modal>
91
+ <modal :show.sync="show" v-ref:modal backdrop="false">
92
+ <header slot="modal-header" class="modal-header">
93
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
94
+ <h4 class="modal-title">修改明细</h4>
95
+ </header>
96
+ <article slot="modal-body" class="modal-body">
97
+ <div class="from-group">
98
+ <label>材料名称</label>
99
+ <input-select
100
+ :value.sync="selectItem.f_material_name"
101
+ v-model="selectItem.f_material_name"
102
+ :options="materialNname"
103
+ @change="materialNameChange"
104
+ ></input-select>
105
+ </div>
106
+ <div class="from-group">
107
+ <label>规格、型号</label>
108
+ <input-select
109
+ v-model="selectItem.f_material_model"
110
+ :options="materialModel"
111
+ ></input-select>
112
+ </div>
113
+ <div class="from-group">
114
+ <label>安装</label>
115
+ <input type="text" class="form-control" v-model="selectItem.f_material_install">
116
+ </div>
117
+ <div class="from-group">
118
+ <label>单位</label>
119
+ <input type="text" class="form-control" 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
+ isbuttonshow: true,
324
+ model: {
325
+ rows: []
326
+ },
327
+ f_effective_state: [
328
+ {label: '有效', value: '有效'},
329
+ {label: '无效', value: '无效'},
330
+ {label: '全部', value: ''}
331
+ ],
332
+ batchmodel: {
333
+ rows: []
334
+ },
335
+ show: false,
336
+ isShow: false,
337
+ isShowdetail: false,
338
+ isSelected: {
339
+ type:Boolean,
340
+ default:false
341
+ },
342
+ addshow: false,
343
+ batch_id: 0,
344
+ material: [],
345
+ optionsx: [],
346
+ f_user_name: [],
347
+ all: true,
348
+ modelval: [],
349
+ printshow: false,
350
+ fields: {},
351
+ thead: '',
352
+ tfoot: '22222',
353
+ printName: '材料',
354
+ headData: ["安装","材料名称","规格、型号","单位","数量","备注"],
355
+ bodyData: ["f_material_install", "f_material_name", "f_material_model","f_unit","f_amount","f_material_remarks"],
356
+ footinfo: ["主管领导","领料人"],
357
+ materialNname:this.$appdata.getParam('报建材料'),
358
+ materialModel:[]
359
+ }
360
+ },
361
+ async ready() {
362
+ this.isShowdetail = false
363
+ getInfo(this, 0, 0, false)
364
+ },
365
+ watch: {
366
+ },
367
+ computed: {
368
+
369
+ },
370
+ methods: {
371
+ materialNameChange(){
372
+ this.materialModel = []
373
+ this.materialModel=this.$appdata.getParam(`${this.selectItem.f_material_name}规格型号`)
374
+ },
375
+ async searchByName(){
376
+ console.log('搜索材料名车')
377
+ let http = new HttpResetClass()
378
+ let data2 = {
379
+ columnname: `f_type`,
380
+ tablename: 't_material_class',
381
+ condition: ` f_name like '%${this.searchName}%'`
382
+ }
383
+ let resTypes = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data2}, {
384
+ resolveMsg: null,
385
+ rejectMsg: "获取f_material_name失败"
386
+ }, {silent: true})
387
+ let data = {
388
+ columnname: `f_name,f_type`,
389
+ tablename: 't_material_class',
390
+ condition: ` f_name like '%${this.searchName}%'`
391
+ }
392
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
393
+ resolveMsg: null,
394
+ rejectMsg: '搜索材料名称失败'
395
+ })
396
+ this.menulist = []
397
+ for(let i=0;i<resTypes.data.length;i++){
398
+ this.menulist.push({catename:resTypes.data[i].f_type,expanded: true,type:'材料类型'})
399
+ }
400
+ for(let i=0;i<this.menulist.length;i++){
401
+ let _child = []
402
+ for(let j=0;j<res.data.length;j++){
403
+ if(this.menulist[i].catename == res.data[j].f_type){
404
+ _child.push({catename:res.data[j].f_name,expanded: false,type:'材料名称'})
405
+ }
406
+ }
407
+ this.menulist[i]._child=_child
408
+ }
409
+ this.addshowm = false
410
+ this.$nextTick(()=> {
411
+ this.addshowm = true
412
+ })
413
+ console.log('menulist',this.menulist)
414
+ },
415
+ async deleteItem(row) {
416
+ let res = await this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel'])
417
+ if (res === 'confirm') {
418
+ let http = new HttpResetClass()
419
+ http.load('DELETE', `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_list/${row.id}`).then((res)=>{
420
+ for(let i=0;i<this.batchmodel.rows.length;i++){
421
+ if(this.batchmodel.rows[i].id == row.id){
422
+ this.batchmodel.rows.splice(i,1)
423
+ }
424
+ }
425
+ })
426
+ }
427
+ },
428
+ async xinhao() {
429
+ if (!this.model.f_batch_norms[0]) {
430
+ return
431
+ }
432
+ let temp = []
433
+ for (let row of this.optionsx) {
434
+ if (this.model.f_batch_norms[0] == row.f_format) {
435
+ temp.push({label: row.f_num, value: row.f_num})
436
+ }
437
+ }
438
+ this.xinhaooptions = temp
439
+ },
440
+ async bianma() {
441
+ let temp = []
442
+ for (let row of this.optionsx) {
443
+ 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) {
444
+ temp.push({label: row.f_code, value: row.f_code})
445
+ } else if (this.model.f_batch_norms[0] && this.model.f_batch_norms[0] == row.f_format) {
446
+ temp.push({label: row.f_code, value: row.f_code})
447
+ }
448
+ }
449
+ this.codeOptions = temp
450
+ },
451
+ async guige() {
452
+ // let http = new HttpResetClass()
453
+ let data = {
454
+ columnname: `f_type`,
455
+ tablename: 't_material_class',
456
+ condition: `1=1`
457
+ }
458
+ let http = new HttpResetClass()
459
+
460
+ let res = await http.load('POST',$`{this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
461
+ resolveMsg: null,
462
+ rejectMsg: '获取材料类型失败'
463
+ })
464
+ this.menulist = []
465
+ for(let i=0;i<res.data.length;i++){
466
+ this.menulist.push({catename:res.data[i].f_type,expanded: false,type:'材料类型'})
467
+ }
468
+ console.log('menulist',this.menulist)
469
+ },
470
+ addDetailed() {
471
+ this.addshow = true
472
+ },
473
+ addclose() {
474
+ this.addshow = false
475
+ },
476
+ async addconfirm() {
477
+ if (!this.model.f_batch_name) {
478
+ this.$showAlert("请输入材料名称", "warning", 1500)
479
+ return
480
+ }
481
+ if (!this.model.f_batch_code) {
482
+ this.$showAlert("请选择材料编码", "warning", 1500)
483
+ return
484
+ }
485
+ if (!this.model.f_budget_num) {
486
+ this.$showAlert("请输入材料数量", "warning", 1500)
487
+ return
488
+ }
489
+ return await insertdetail(this)
490
+
491
+ },
492
+ addmaterial() {
493
+ },
494
+ async load() {
495
+ let http = new HttpResetClass()
496
+ let data = {
497
+ columnname: 'f_material_name',
498
+ tablename: 't_materials_detailed',
499
+ condition: `1=1`
500
+ }
501
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
502
+ resolveMsg: null,
503
+ rejectMsg: null
504
+ }, {silent: true})
505
+ res.data.forEach((row) => {
506
+ let temp = {
507
+ label: row.f_material_name,
508
+ value: row.f_material_name
509
+ }
510
+ this.fmaterialtype.push(temp)
511
+ })
512
+ },
513
+
514
+ commit() {
515
+ console.log("edit>>>>>",)
516
+ var entryName = this.model.f_entry_name //项目名称
517
+ var ename = this.selectdata.f_entry_name
518
+ let http = new HttpResetClass()
519
+ http.load('POST',` ${this.$androidUtil.getProxyUrl()}/rs/sql/findProcessState`, {data: {actid: this.selectdata.actid}}, {
520
+ resolveMsg: null,
521
+ rejectMsg: '提交错误!'
522
+ }).then((res) => {
523
+ if (res.data[0].state != '开始活动') {
524
+ this.$showMessage("该节点信息已在别处提交,请刷新!")
525
+ this.reset()
526
+ } else {
527
+ //通过数据校验再进行下一步判断
528
+ if (this.verification()) {
529
+ if (name == null) {
530
+ //项目名称唯一性判断
531
+ let http2 = new HttpResetClass()
532
+ http2.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/findByEntryName`, {data: {entryName: entryName}}, {
533
+ resolveMsg: null,
534
+ rejectMsg: '提交错误!'
535
+ }).then((res) => {
536
+ if (res.data.length > 0) {
537
+ console.log('length>0')
538
+ this.$showMessage("项目名称不能重复!")
539
+ } else {
540
+ console.log('length<=0')
541
+ let getGen = gen(this, this.model)
542
+ console.log('getgen')
543
+ co(getGen)
544
+ console.log('co(getgen)')
545
+ }
546
+ })
547
+ } else {
548
+ let getGen = gen(this, this.model)
549
+ co(getGen)
550
+ }
551
+ }
552
+ }
553
+ })
554
+ },
555
+ reset() {
556
+ this.$dispatch('close')
557
+ this.$dispatch('selfsearch')
558
+ },
559
+
560
+ //数据校验
561
+ verification() {
562
+ /* var isNum = /^(([+]?\d*$)|(^[+]?\d+(\.\d+)?$))/ //非负纯数字
563
+ var regex = /.*?[\u4e00-\u9fa5].*?[\u4e00-\u9fa5].*!/ //至少两个汉字
564
+ var phoneReg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/ //手机号码正则
565
+ var telReg = /0\d{2,3}-\d{7,8}/ //座机正则
566
+ if (!this.model.f_entry_name) {
567
+ this.$showMessage("项目名称不能为空!")
568
+ return false
569
+ }*/
570
+ return true
571
+ },
572
+ impexcel() {
573
+ this.isShow = true
574
+ },
575
+ closeFile() {
576
+ this.isShow = false
577
+ // 将选的文件清空
578
+ this.$refs.file.$el.querySelector('input').value = ''
579
+ },
580
+ tovoid(row) {
581
+ console.log('作废')
582
+ getInfo(this, 1, row.id, true)
583
+ },
584
+ async filterParams() {
585
+ this.isShowdetail = false
586
+ let data = {
587
+ tablename: 't_materials_detailed',
588
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
589
+ }
590
+ console.log('condition:', data.condition)
591
+ let reset = new HttpResetClass()
592
+ await reset.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
593
+ .then((res) => {
594
+ console.log('查询结果:', res)
595
+
596
+ this.model.rows = []
597
+ this.model.rows = res.data
598
+ this.params = res.data
599
+ })
600
+ },
601
+ add() {
602
+ this.show = true
603
+ },
604
+ // 修改按钮
605
+ modifyParam(row) {
606
+ this.$set('selectItem.id', row.id)
607
+
608
+ this.$set('selectItem.f_apply_num', row.f_apply_num)
609
+ this.$set('selectItem.f_process_id', row.f_process_id)
610
+
611
+ this.$set('selectItem.f_material_install', row.f_material_install)
612
+ this.$set('selectItem.f_material_name', row.f_material_name)
613
+ this.$set('selectItem.f_material_model', row.f_material_model)
614
+ this.$set('selectItem.f_unit', row.f_unit)
615
+ this.$set('selectItem.f_amount', row.f_amount)
616
+ this.$set('selectItem.f_material_remarks', row.f_material_remarks)
617
+
618
+ this.show = true
619
+ },
620
+ // 缴费情况修改
621
+ paychange(row) {
622
+ let http = new HttpResetClass()
623
+ row.f_pay = !row.f_pay
624
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/saveentity`, {data: {tablename: 't_material', parameters: row}}, {
625
+ resolveMsg: null,
626
+ rejectMsg: "缴费状态更新失败"
627
+ }, {silent: true})
628
+ },
629
+ confirm() {
630
+ /* this.selectItem.f_amount = this.selectItem.f_amount*/
631
+ this.selectItem.f_apply_num=this.selectdata.f_apply_num
632
+ this.selectItem.f_process_id=this.selectdata.f_process_id
633
+ let data = {
634
+ tablename: 't_materials_detailed',
635
+ parameters: this.selectItem
636
+ }
637
+ let this1 = this
638
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/saveentity`, {data: data}).then((res) => {
639
+ this.show = false
640
+ // 如果没有id,需要在数组中添加
641
+ /* getInfo(this, 1, this.selectItem.f_batch_id, false)
642
+ this.selectItem = {}*/
643
+ this.addshow = false
644
+ getInfo(this, 0, 0, false)
645
+
646
+ })
647
+ },
648
+ print () {
649
+ this.$refs.print.PrintAsFile()
650
+ this.printshow = false
651
+ },
652
+ close () {
653
+ this.printshow = false
654
+ this.all = false
655
+ this.show = false
656
+ this.addshow = false
657
+ this.selectItem = {}
658
+ },
659
+ async getaaa() {
660
+ console.log('进来了')
661
+ let data = {
662
+ tablename: 't_material_batch',
663
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' `
664
+ }
665
+ let reset = new HttpResetClass()
666
+ await reset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/saveentityrs/sql/singleTable`, {data: data}, {resolveMsg: null, rejectMsg: '获取材料信息失败'})
667
+ .then((res) => {
668
+ this.model.rows = []
669
+ this.model.rows = res.data
670
+ this.params = res.data
671
+ })
672
+ }
673
+ }
674
+ ,
675
+ events: {
676
+ updateTree(){
677
+ this.scrollTop = document.getElementById("treemx").scrollTop
678
+ this.addshowm = false
679
+ this.$nextTick(()=> {
680
+ this.addshowm = true
681
+ })
682
+ },
683
+ async menulistSelected(item,root,parent){
684
+ this.scrollTop = document.getElementById("treemx").scrollTop
685
+ console.log("scrollTop",this.scrollTop)
686
+ if(item.type=='材料类型'){
687
+ console.log('选了材料类型')
688
+ let data = {
689
+ columnname: `f_name`,
690
+ tablename: 't_material_class',
691
+ condition: `f_type = '${item.catename}'`
692
+ }
693
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
694
+ resolveMsg: null,
695
+ rejectMsg: '获取材料名称失败'
696
+ })
697
+ // this.menulist = []
698
+ let _child = []
699
+ for(let i=0;i<res.data.length;i++){
700
+ _child.push({catename:res.data[i].f_name,expanded: false,type:'材料名称'})
701
+ }
702
+ for(let i=0;i<this.menulist.length;i++){
703
+ if(this.menulist[i].catename==item.catename){
704
+ this.menulist[i]._child= []
705
+ this.menulist[i].expanded = true
706
+ this.menulist[i]._child= _child
707
+ }
708
+ }
709
+ this.addshowm = false
710
+ this.$nextTick(()=> {
711
+ this.addshowm = true
712
+ })
713
+ console.log('menulist',this.menulist)
714
+ }else if(item.type=='材料名称'){
715
+ console.log('选了材料名称')
716
+ let data = {
717
+ columnname: `f_format,f_code`,
718
+ tablename: 't_material_class',
719
+ condition: ` f_name = '${item.catename}' and f_type = '${this.menulist[root].catename}'`
720
+ }
721
+ let res = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/getdistinct`, {data: data}, {
722
+ resolveMsg: null,
723
+ rejectMsg: '获取材料规格失败'
724
+ })
725
+ // this.menulist = []
726
+ let _child = []
727
+ for(let i=0;i<res.data.length;i++){
728
+ _child.push({catename:res.data[i].f_format,expanded: false,type:'材料规格',f_code:res.data[i].f_code})
729
+ }
730
+ for(let i=0;i<this.menulist.length;i++){
731
+ if(this.menulist[i].catename==this.menulist[root].catename){
732
+ for(let j=0;j<this.menulist[i]._child.length;j++){
733
+ if(this.menulist[i]._child[j].catename==item.catename){
734
+ this.$refs.tree2.menulist[i]._child[j]._child= []
735
+ this.$refs.tree2.menulist[i]._child[j].expanded = true
736
+ this.$refs.tree2.menulist[i]._child[j]._child= _child
737
+ break
738
+ }
739
+ }
740
+ }
741
+ }
742
+ this.addshowm = false
743
+ this.$nextTick(()=> {
744
+ this.addshowm = true
745
+ })
746
+ console.log('menulist',this.menulist)
747
+ }else if(item.type=='材料规格'){
748
+ console.log('选了材料规格')
749
+ this.model.f_batch_name = [this.menulist[root]._child[parent].catename]
750
+ this.model.f_batch_code = [item.f_code]
751
+ this.model.f_budget_num = item.count
752
+ let flag = await this.addconfirm()
753
+ if(flag == false){
754
+ for(let i =0;i<this.menulist[root]._child[parent]._child.length;i++){
755
+ if(this.menulist[root]._child[parent]._child[i].f_code = item.f_code){
756
+ this.menulist[root]._child[parent]._child[i].count = null
757
+ }
758
+ }
759
+ }
760
+ this.addshowm = false
761
+ this.$nextTick(()=> {
762
+ this.addshowm = true
763
+ })
764
+ console.log('menulist',this.menulist)
765
+ }
766
+ this.addshowm = false
767
+ this.$nextTick(()=> {
768
+ this.addshowm = true
769
+ })
770
+ },
771
+ onFileUpload: function (file, res) {
772
+ if (!this.selectdata.f_process_id) {
773
+ this.$showMessage("数据异常,导入失败")
774
+ return
775
+ }
776
+ let data = {
777
+ tablename: ' t_materials_detailed',
778
+ filepath: res.f_downloadpath,
779
+ processid: this.selectdata.f_process_id,
780
+ f_apply_num: this.selectdata.f_apply_num,
781
+ f_filiale: this.selectdata.f_filiale,
782
+ f_parentname: this.$login.f.f_parentname,
783
+ f_material_operator: this.$login.f.name
784
+ /* processid:this.selectdata.f_processid*/
785
+ }
786
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/materialImport`, data, {resolveMsg: '导入成功', rejectMsg: '导入失败'}).then((res) => {
787
+ if(res.data){
788
+ this.iswork=false;
789
+ this.load();
790
+ this.closeFile();
791
+ getInfo(this, 0, 0, false)
792
+ let mm = '';
793
+ for(var i=0;i<res.data.msg.length;i++){
794
+ mm+= `${res.data.msg[i].msg}`
795
+ }
796
+ let msg = `共导入${res.data.alllength}条,失败${res.data.errorlen}条,失败信息:${mm}`
797
+ // this.$showMessage(msg)
798
+
799
+ }
800
+ })
801
+ }
802
+ }
803
+ }
804
+ </script>
805
+ <style scoped>
806
+ .recordTable table tr th {
807
+ font-weight: bold;
808
+ }
809
+
810
+ .recordTable table tr:hover {
811
+ background-color: rgb(230, 230, 230);
812
+ }
813
+
814
+ td {
815
+ text-align: center !important
816
+ }
817
+
818
+ .input-select {
819
+ width: 100%;
820
+ height: 34px;
821
+ align-content: center;
822
+ margin-top: 10px;
823
+ }
824
+ </style>