apply-clients 3.4.84 → 3.4.88

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.
@@ -0,0 +1,558 @@
1
+ <template>
2
+ <div>
3
+ <data-grid :model="onetomany" class="list_area table_sy">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">序号</th>
7
+ <th class="textNoLineBreak">材料名称</th>
8
+ <th class="textNoLineBreak">材料型号</th>
9
+ <th class="textNoLineBreak">材料单位</th>
10
+ <th class="textNoLineBreak">材料数量</th>
11
+ <th class="textNoLineBreak">应免数量</th>
12
+ <th class="textNoLineBreak">材料价格</th>
13
+ <th class="textNoLineBreak">材料状态</th>
14
+
15
+ <th class="textNoLineBreak">
16
+ <button v-if="$parent.$parent.mark === 0" class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
17
+ <button v-if="$parent.$parent.mark === 0 && $parent.$parent.selectdata.defname === '营业厅缴费' " class="button_new button_spacing" type="button" @click="$parent.$parent.chargeMaterial()">收费</button>
18
+ <!-- <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
19
+ @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
20
+ <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
21
+ href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>-->
22
+ </th>
23
+ </tr>
24
+ </template>
25
+ <template partial='body'>
26
+ <tr>
27
+ <td style="text-align: center;">
28
+ <nobr>{{$index+1}}</nobr>
29
+ </td>
30
+ <td style="text-align: center;">
31
+ <nobr>{{row.f_material_name}}</nobr>
32
+ </td>
33
+ <td style="text-align: center;">
34
+ <nobr>{{row.f_material_style}}</nobr>
35
+ </td>
36
+ <td style="text-align: center;">
37
+ <nobr>{{row.f_material_unit}}</nobr>
38
+ </td>
39
+ <td style="text-align: center;">
40
+ <nobr>{{row.f_material_number}}</nobr>
41
+ </td>
42
+ <td style="text-align: center;">
43
+ <nobr>{{row.f_quantity_payable}}</nobr>
44
+ </td>
45
+ <td style="text-align: center;">
46
+ <nobr>{{row.f_material_price}}</nobr>
47
+ </td>
48
+ <td style="text-align: center;">
49
+ <nobr>{{row.f_material_type}}</nobr>
50
+ </td>
51
+ <td style="text-align: center;">
52
+ <button type="button" class="button_search button_spacing" @click="$parent.$parent.updateMaterial($index,row)">修改</button>
53
+ <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除</button>
54
+ </td>
55
+ </tr>
56
+ </template>
57
+ </data-grid>
58
+ <span>合计:{{pricesum}}</span>
59
+ <!-- <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
60
+ <header slot="modal-header" class="modal-header">
61
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
62
+ <h4 class="modal-title">选择文件</h4>
63
+ </header>
64
+ <article slot="modal-body" class="modal-body">
65
+ <div class="form-group">
66
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
67
+ </div>
68
+ </article>
69
+ <footer slot="modal-footer" class="modal-footer"></footer>
70
+ </modal>-->
71
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
72
+ :backdrop="false" :title="title">
73
+ <header slot="modal-header" class="modal-header">
74
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
75
+ <h4 class="modal-title">{{title}}</h4>
76
+ </header>
77
+ <article slot="modal-body" class="modal-body clearfix">
78
+ <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
79
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
80
+ <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
81
+ <div class="col-sm-6 text-right"><button
82
+ class="button_delete button_spacing"
83
+ @click.prevent="deleteDevicesinfo(i)"
84
+ v-if="title === '新增'"
85
+ >删除</button></div>
86
+ </div>
87
+ <div class="form-group col-sm-6">
88
+ <label class="col-sm-4 control-label">选择材料:</label>
89
+ <div class="col-sm-8">
90
+ <input-select
91
+ class="select select_list"
92
+ :value.sync="item.material"
93
+ v-model="item.material"
94
+ :options="meterialOptions"
95
+ :disable="mark === 1"
96
+ @change="modifyOtherValue(i)"
97
+ :valueSingle="true"></input-select>
98
+ </div>
99
+ </div>
100
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
101
+ <label class="col-sm-4 control-label">材料名称:</label>
102
+ <div class="col-sm-8">
103
+ <input class="form-control input_view" style="" type="text"
104
+ placeholder="材料名称"
105
+ v-model="item.f_material_name"
106
+ :value="item.f_material_name"
107
+ />
108
+ </div>
109
+ </div>
110
+ <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']">
111
+ <label class="col-sm-4 control-label">材料型号:</label>
112
+ <div class="col-sm-8">
113
+ <input class="form-control input_view" style="" type="text"
114
+ placeholder="材料型号"
115
+ v-model="item.f_material_style"
116
+ :value="item.f_material_style"
117
+ />
118
+ </div>
119
+ </div>
120
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
121
+ <label class="col-sm-4 control-label">材料单位:</label>
122
+ <div class="col-sm-8">
123
+ <input class="form-control input_view" style="" type="text"
124
+ placeholder="材料单位"
125
+ v-model="item.f_material_unit"
126
+ :value="item.f_material_unit"
127
+ />
128
+ </div>
129
+ </div>
130
+ <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
131
+ <label class="col-sm-4 control-label">材料数量:</label>
132
+ <div class="col-sm-8">
133
+ <input class="form-control input_view" style="" type="number"
134
+ placeholder="设备数量"
135
+ v-model="item.f_material_number"
136
+ :value="item.f_material_number"
137
+ />
138
+ </div>
139
+ </div>
140
+ <div class="form-group col-sm-6" :class="[item.f_quantity_payable ? '' : 'has-error']">
141
+ <label class="col-sm-4 control-label">应免数量:</label>
142
+ <div class="col-sm-8">
143
+ <input class="form-control input_view" style="" type="number"
144
+ placeholder="应免数量"
145
+ v-model="item.f_quantity_payable"
146
+ :value="item.f_quantity_payable"
147
+ />
148
+ </div>
149
+ </div>
150
+ <div class="form-group col-sm-6">
151
+ <label class="col-sm-4 control-label">材料价格:</label>
152
+ <div class="col-sm-8">
153
+ <input class="form-control input_view" style="" type="text"
154
+ placeholder="材料价格"
155
+ v-model="item.f_material_price"
156
+ :value="item.f_material_price"
157
+ />
158
+ </div>
159
+ </div>
160
+ </div>
161
+
162
+ </article>
163
+ <footer slot="modal-footer" class="modal-footer">
164
+ <template v-if="mark !== 1">
165
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
166
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
167
+ <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
168
+ </template>
169
+ </footer>
170
+ </modal>
171
+ <modal v-if="showCharge" :show.sync="showCharge" v-ref:modal :backdrop="false" title="材料收费">
172
+ <header slot="modal-header" class="modal-header">
173
+ <button type="button" class="close" @click="closeModal"><span>&times;</span></button>
174
+ <h4 class="modal-title">材料收费</h4>
175
+ </header>
176
+ <article slot="modal-body" class="modal-body clearfix">
177
+ <div class="form-group col-sm-12">
178
+ <label class="col-sm-2 control-label">收费项目:</label>
179
+ <div class="col-sm-10">
180
+ <input type="text"
181
+ class="form-control input_view"
182
+ style="width: 100%"
183
+ readonly
184
+ v-model="charge.f_payment_term" />
185
+ </div>
186
+ </div>
187
+ <div class="form-group col-sm-12">
188
+ <label class="col-sm-2 control-label">收费金额:</label>
189
+ <div class="col-sm-10">
190
+ <input type="text"
191
+ class="form-control input_view"
192
+ style="width: 100%"
193
+ readonly
194
+ v-model="charge.f_charge_money" />
195
+ </div>
196
+ </div>
197
+ <div class="form-group col-sm-12">
198
+ <label class="col-sm-2 control-label">付款方式:</label>
199
+ <div class="col-sm-10">
200
+ <input-select
201
+ placeholder='请选择' width="100%"
202
+ v-model="charge.f_payment_method"
203
+ :value.sync="charge.f_payment_method"
204
+ :options='paymentMethod'
205
+ class="select select_list"
206
+ :value-single="true"
207
+ close-on-select ></input-select>
208
+ </div>
209
+ </div>
210
+ <div class="form-group col-sm-12">
211
+ <label class="col-sm-2 control-label">金额大写:</label>
212
+ <div class="col-sm-10">
213
+ <input type="text"
214
+ class="form-control input_view"
215
+ style="width: 100%"
216
+ :value="smalltoBIG(charge.f_charge_money)"
217
+ readonly
218
+ v-model="charge.f_amount_words" />
219
+ </div>
220
+ </div>
221
+ <div class="form-group col-sm-12">
222
+ <label class="col-sm-2 control-label">收费人员:</label>
223
+ <div class="col-sm-10">
224
+ <input type="text"
225
+ class="form-control input_view"
226
+ style="width: 100%"
227
+ readonly
228
+ v-model="charge.f_charge_collectors" />
229
+ </div>
230
+ </div>
231
+ </article>
232
+ <footer slot="modal-footer" class="modal-footer">
233
+ <button type="button" class="btn btn-primary" @click="invalidApplyCharge()">确认收费</button>
234
+ </footer>
235
+ </modal>
236
+ </div>
237
+ </template>
238
+
239
+ <script>
240
+ import {HttpResetClass} from 'vue-client'
241
+ import Vue from "vue";
242
+ import {toStandardTimeString} from '../../../components/Util'
243
+ export default {
244
+ name: '材料添加',
245
+ props: {
246
+ selectdata: {
247
+ type: Object
248
+ },
249
+ mark: {
250
+ type: Number,
251
+ default: 0
252
+ }
253
+ },
254
+ data () {
255
+ return {
256
+ showFile: false,
257
+ onetomany: {
258
+ rows: []
259
+ },
260
+ title:'新增',
261
+ showMaterialModal:false,
262
+ materials:[
263
+ {
264
+ material:'',
265
+ f_material_name:'',
266
+ f_material_style:'',
267
+ f_material_unit:'',
268
+ f_material_number:'',
269
+ f_material_price:'',
270
+ f_quantity_payable:0
271
+ }
272
+ ],
273
+ meterialOptions:[],
274
+ row:{},
275
+ pricesum:'',
276
+ showCharge:false,
277
+ charge:{
278
+ f_payment_term:'材料费',
279
+ f_charge_money:'',
280
+ f_payment_method:'',
281
+ f_amount_words:'',
282
+ f_charge_collectors:''
283
+ }
284
+ }
285
+ },
286
+ ready(){
287
+ this.$nextTick(() => {
288
+ this.getOnetoManyData()
289
+ })
290
+ },
291
+ methods: {
292
+ async getOnetoManyData () {
293
+ let data = {
294
+ tablename: `t_material_apply`,
295
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
296
+ }
297
+ let http = new HttpResetClass()
298
+ let res = await http.load('post',
299
+ 'rs/sql/apply_singleTable',
300
+ {data: data},
301
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
302
+ )
303
+ this.onetomany.rows = res.data
304
+ console.log('材料信息', this.onetomany.rows)
305
+ },
306
+ async openMaterialModal () {
307
+ this.getMateralNames()
308
+ this.title = '新增'
309
+ this.materials = [
310
+ {
311
+ material:'',
312
+ f_material_name:'',
313
+ f_material_style:'',
314
+ f_material_unit:'',
315
+ f_material_number:'',
316
+ f_material_price:'',
317
+ f_quantity_payable:0
318
+ }
319
+ ],
320
+ this.showMaterialModal = true
321
+ },
322
+ closeFile() {
323
+ this.showWork = false
324
+ this.showFile = false
325
+ // 将选的文件清空
326
+ this.$refs.file.$el.querySelector('input').value = ''
327
+ this.search()
328
+ },
329
+ deleteDevicesinfo (index) {
330
+ this.materials.splice(index, 1)
331
+ },
332
+ pushMaterial () {
333
+ this.materials.push({
334
+ material:'',
335
+ f_material_name:'',
336
+ f_material_style:'',
337
+ f_material_unit:'',
338
+ f_material_number:'',
339
+ f_material_price:'',
340
+ f_quantity_payable:0
341
+ })
342
+ },
343
+ // 获取模态框材料
344
+ async getMateralNames () {
345
+ let data = {
346
+ condition: `1=1`
347
+ }
348
+ let http = new HttpResetClass()
349
+ let res = await http.load(
350
+ 'POST',
351
+ `rs/sql/getStockMaterial`,
352
+ {data: data},
353
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
354
+ )
355
+
356
+ this.meterialOptions = res.data.map(item => {
357
+ return {
358
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}--${item.f_material_code}`,
359
+ 'value': item
360
+ }
361
+ })
362
+ },
363
+ modifyOtherValue (index){
364
+ console.log("进来了",index)
365
+ console.log("dddd",this.materials[index].material)
366
+ let material = this.materials[index].material
367
+ this.materials[index].f_material_name = material.f_material_name
368
+ this.materials[index].f_material_style = material.f_material_style
369
+ this.materials[index].f_material_unit = material.f_material_unit
370
+ this.materials[index].f_material_price = material.f_material_price
371
+ },
372
+ // 新增材料
373
+ async addMaterial () {
374
+ console.log("登录信息:",this.$login.f)
375
+ this.title = '新增'
376
+ let data = {
377
+ f_process_id : this.selectdata.f_process_id,
378
+ f_operator_id: this.$login.f.id,
379
+ f_operator: this.$login.f.name,
380
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
381
+ f_orgid: this.$login.f.orgid,
382
+ f_orgname: this.$login.f.orgs,
383
+ materials:this.materials
384
+ }
385
+ let res = await this.$resetpost(
386
+ `rs/logic/saveMaterials`,
387
+ data
388
+ )
389
+ this.closeMaterials()
390
+ },
391
+ async deleteMaterial (row) {
392
+ var show1 = window.confirm('您确定要删除这条记录吗?')
393
+ if(show1 != true){
394
+ this.closeMaterials()
395
+ }else{
396
+ debugger
397
+ let http = new HttpResetClass()
398
+ let res = await http.load(
399
+ 'POST',
400
+ `rs/logic/deleteMaterial`,
401
+ {data: row},
402
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
403
+ )
404
+ this.closeMaterials()
405
+ }
406
+
407
+ },
408
+ async updateMaterial (index,row) {
409
+ this.title = '修改'
410
+ this.row = row
411
+ this.getMateralNames()
412
+ this.materials = [
413
+ {
414
+ material:'',
415
+ f_material_name:row.f_material_name,
416
+ f_material_style:row.f_material_style,
417
+ f_material_unit:row.f_material_unit,
418
+ f_material_number:row.f_material_number,
419
+ f_material_price:row.f_material_price,
420
+ f_quantity_payable:row.f_quantity_payable
421
+ }
422
+ ]
423
+ this.showMaterialModal = true
424
+ },
425
+ async updateConfirm () {
426
+ let data = this.row
427
+ data.f_material_name = this.materials[0].f_material_name
428
+ data.f_material_style = this.materials[0].f_material_style
429
+ data.f_material_unit = this.materials[0].f_material_unit
430
+ data.f_material_number = this.materials[0].f_material_number
431
+ data.f_material_price = this.materials[0].f_material_price
432
+ data.f_quantity_payable = this.materials[0].f_quantity_payable
433
+ let res = await this.$resetpost(
434
+ `apply/rs/entity/t_material_apply`,
435
+ data
436
+ )
437
+ this.closeMaterials()
438
+ },
439
+ closeMaterials () {
440
+ this.getOnetoManyData()
441
+ this.showMaterialModal = false
442
+ },
443
+ // 金额转大写
444
+ smalltoBIG(n) {
445
+ let fraction = ['角', '分'];
446
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
447
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
448
+ let head = n < 0 ? '欠' : '';
449
+ n = Math.abs(n);
450
+
451
+ let s = '';
452
+
453
+ for (var i = 0; i < fraction.length; i++) {
454
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
455
+ }
456
+ s = s || '整';
457
+ n = Math.floor(n);
458
+
459
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
460
+ let p = '';
461
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
462
+ p = digit[n % 10] + unit[1][j] + p;
463
+ n = Math.floor(n / 10);
464
+ }
465
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
466
+ }
467
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
468
+ },
469
+ // 材料收费
470
+ chargeMaterial () {
471
+ this.showCharge = true
472
+ this.charge.f_charge_money = this.pricesum
473
+ this.charge.f_charge_collectors = this.$login.f.name
474
+ },
475
+ closeModal(){
476
+ this.showCharge = false
477
+ this.charge = {
478
+ f_payment_term:'材料费',
479
+ f_charge_money:'',
480
+ f_payment_method:'',
481
+ f_amount_words:'',
482
+ f_charge_collectors:''
483
+ }
484
+ },
485
+ invalidApplyCharge (){
486
+ this.$showMessage('确定是否收费?', ['confirm', 'cancel']).then(res=>{
487
+ if (res==='confirm'){
488
+ let http = new HttpResetClass()
489
+ this.charge.f_charge_status = '有效', // 缴费状态
490
+ this.charge.f_charge_date = toStandardTimeString(), // 缴费时间
491
+ this.charge.f_charge_collectors = this.$login.f.name, // 收费人员
492
+ this.charge.f_charge_collectors_id = this.$login.f.id, // 收费人员
493
+ this.charge.f_process_id = this.selectdata.f_process_id, // 报建流程id
494
+ this.charge.f_filiale = this.$login.f.orgs, // 分公司
495
+ this.charge.f_filialeid = this.$login.f.orgid, // 分公司id
496
+ this.charge.f_orgid = this.$login.f.orgid, // 组织id
497
+ this.charge.f_orgname = this.$login.f.orgs, // 组织
498
+ this.charge.f_depid = this.$login.f.depids, // 部门id
499
+ this.charge.f_depname = this.$login.f.f_department_name // 部门
500
+ http.load('post','apply/rs/entity/t_charge_record',this.charge,{rejectMsg:null,resolveMsg:'收费成功!!'}).then(res=>{
501
+ http.load('post','rs/logic/updatematerial',{data:{f_process_id: this.selectdata.f_process_id}},{rejectMsg:null,resolveMsg:null}).then(row=>{
502
+ if (row.data.code == '200'){
503
+ this.$dispatch('initializtionView')
504
+ }
505
+ })
506
+ })
507
+ }
508
+ })
509
+ }
510
+ },
511
+ events: {
512
+ 'beforeFileUpload' (file) {
513
+ this.showWork = true
514
+ },
515
+ async 'onFileUpload'(file, result) {
516
+ let data = {
517
+ selectdata: this.selectdata,
518
+ filepath: result.f_downloadpath,
519
+ user: this.$login.f
520
+ }
521
+ try {
522
+ let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
523
+ resolveMsg: null,
524
+ rejectMsg: '导入失败!!!',
525
+ silent: true
526
+ }, 0)
527
+ } catch (e) {
528
+ this.closeFile()
529
+ }
530
+ this.$dispatch('breakControl', this.selectdata)
531
+ }
532
+ },
533
+ watch: {
534
+ 'onetomany.rows'(){
535
+ let res = this.onetomany.rows
536
+ this.pricesum = 0
537
+ if (res.length>0){
538
+ for (let row of res){
539
+ let num = row.f_material_price * (row.f_material_number - row.f_quantity_payable )
540
+ this.pricesum += num
541
+ }
542
+ }else {
543
+ this.pricesum = 0
544
+ }
545
+ }
546
+ },
547
+ computed: {
548
+ paymentMethod() {
549
+ return this.$appdata.getParam("付款方式")
550
+ }
551
+ }
552
+ }
553
+
554
+ </script>
555
+
556
+ <style scoped>
557
+
558
+ </style>