apply-clients 5.0.35-ezhou-10 → 5.0.35-ezhou-11

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.
@@ -1,2282 +1,2282 @@
1
- <template>
2
- <show-back-reason v-if="selectdata.f_back_reason && selectdata.f_back_reason!=''"
3
- :data="show_data"></show-back-reason>
4
- <!--<gas-stop v-if="selectdata.defname == '停气碰口'"></gas-stop>-->
5
- <material-message v-if="selectdata.defname=='材料导入'" v-ref:material
6
- :selectdata="selectdata"
7
- :state="2"
8
- :edit="true"></material-message>
9
- <material-message v-if="selectdata.defname=='材料审核'" v-ref:material
10
- :selectdata="selectdata"
11
- :state="1"
12
- :edit="true"></material-message>
13
- <receive-batch v-if="selectdata.defname == '派工单'" :selectdata="selectdata" v-ref:receivebatch></receive-batch>
14
- <project-settlement v-if="selectdata.defname == '工程结算'" :selectdata="selectdata"></project-settlement>
15
- <!-- <installfee :infee="selectdata" :showfee='true' v-if="selectdata.defname == '通气条件确认'"></installfee>-->
16
- <buyer-message v-ref:buyermessagev :selectdata="selectdata" :state="1" v-if="selectdata.defname == '收费'" ></buyer-message>
17
- <!-- <installfee :infee="selectdata" v-if="selectdata.defname == '收费'"></installfee>-->
18
- <service-view v-ref:service_show :data="show_data" v-if="showview" :is_show_datacheck="datacheck"></service-view>
19
-
20
- <modal :show.sync="showbuyerinfo" v-ref:modal backdrop="false">
21
- <header slot="modal-header" class="modal-header">
22
- <button type="button" class="close" @click="closebuyerinfo"><span>&times;</span></button>
23
- <h4 class="modal-title">打印电子发票,请请选择购货方信息</h4>
24
- </header>
25
- <article slot="modal-body" class="modal-body">
26
- <div v-if="showbuyerinfo">
27
- <div class="col-sm-12 span recordTable" style="margin-top: 10px;min-height: 350px">
28
- <partial-view v-ref:single-load>
29
- <data-grid :model="buyerinfo" v-ref:grid>
30
- <template partial='head'>
31
- <tr>
32
- <th>序号</th>
33
- <th>购货方名称</th>
34
- <th>购货方纳税人识别号</th>
35
- <th>购货方地址、电话</th>
36
- <th>购货方开户行及账号</th>
37
- <th>购货方电子邮箱</th>
38
- <th>操作</th>
39
- </tr>
40
- </template>
41
- <template partial='body'>
42
- <td style="text-align: center">{{$index+1}}</td>
43
- <td style="text-align: center">{{row.f_buyer_name}}</td>
44
- <td style="text-align: center">{{row.f_buyer_identify}}</td>
45
- <td style="text-align: center">{{row.f_buyer_addphone}}</td>
46
- <td style="text-align: center">{{row.f_buyer_bank}}</td>
47
- <td style="text-align: center">{{row.f_buyer_email}}</td>
48
- <td style="text-align: center">
49
- <button type="button" class="btn btn-success"
50
- @click='$parent.$parent.$parent.$parent.confirmbuyerinfo(row)'>选择
51
- </button>
52
- </td>
53
- </template>
54
- </data-grid>
55
- </partial-view>
56
- </div>
57
- </div>
58
- </article>
59
- <footer slot="modal-footer" class="modal-footer">
60
- <button v-show="showbuyerinfo" type="button" class="btn btn-default" @click='closebuyerinfo'>取消</button>
61
- </footer>
62
- </modal>
63
-
64
- <apply-accept-bill :show="acceptprint" :bill-url='acceptUrl' v-on:toggle="close" :data='row' :billdata="printData" v-ref:acceptbill @closeaccept="closeAccept"></apply-accept-bill>
65
- <!--打印报表html-->
66
- <!-- <div v-show="false">-->
67
- <!-- <div class="row" style="display: flex;justify-content: center;" id='bill-fee'>-->
68
- <!-- {{{bill}}}-->
69
- <!-- </div>-->
70
- <!-- <report-print id='bill-fee' top='15mm' left='5mm' width='90%' height='70%' :showbtn="false" preview="true"-->
71
- <!-- v-ref:reportprint></report-print>-->
72
- <!-- </div>-->
73
- <modal :show.sync="stop_show" v-ref:modal stop_show="false">
74
- <header slot="modal-header" class="modal-header">
75
- <button type="button" class="close" @click="closeback"><span>&times;</span></button>
76
- <h4 class="modal-title">终止备注</h4>
77
- </header>
78
- <article slot="modal-body" class="modal-body">
79
- <div class="from-group">
80
- <input type="text" class="form-control" v-model="models.f_stop_remarks"/>
81
- </div>
82
- </article>
83
- <footer slot="modal-footer" class="modal-footer">
84
- <button v-show="stop_show" type="button" class="btn btn-default" @click='stopapplys'>确认</button>
85
- </footer>
86
- </modal>
87
- <modal :show.sync="apply_show" v-ref:modal apply_show="false" >
88
- <header slot="modal-header" class="modal-header">
89
- <button type="button" class="close" @click="closeapply"><span>&times;</span></button>
90
- <h4 class="modal-title">转单报建</h4>
91
- </header>
92
- <article slot="modal-body" class="modal-body">
93
- <div class="from-group">
94
- <v-select style="min-width: 80%;"
95
- placeholder='请选择'
96
- :options="applytypes"
97
- :search="false"
98
- v-model="apply_type"
99
- :value.sync="apply_type"
100
- close-on-select>
101
- </v-select>
102
- </div>
103
- </article>
104
- <footer slot="modal-footer" class="modal-footer">
105
- <button v-show="apply_show" type="button" class="btn btn-default" @click='addactive()'>确认</button>
106
- </footer>
107
- </modal>
108
- <!--小区工程移交概况表-->
109
- <modal :show.sync="overviewprint" v-ref:modal :large="true" :backdrop="false" title="打印预览">
110
- <header slot="modal-header" class="modal-header">
111
- <button type="button" class="close" @click="overviewprint = !overviewprint"><span>&times;</span></button>
112
- <h4 class="modal-title">打印预览</h4>
113
- </header>
114
- <article slot="modal-body" class="modal-body clearfix">
115
- <overview :report="show_data" :overviewname="overviewname" v-ref:print></overview>
116
- </article>
117
- <footer slot="modal-footer" class="modal-footer">
118
- <button type="button" class="btn btn-primary" @click="print()">打印</button>
119
- </footer>
120
- </modal>
121
- </template>
122
- <script>
123
- import Vue from 'vue'
124
- import {HttpResetClass} from 'vue-client'
125
- import * as Util from '../../../../Util'
126
- // import AppData from 'stores/AppData'
127
- // Date格式化
128
- Date.prototype.Format = function (fmt) {
129
- var o = {
130
- "M+": this.getMonth() + 1, //月份
131
- "d+": this.getDate(), //日
132
- "H+": this.getHours(), //小时
133
- "m+": this.getMinutes(), //分
134
- "s+": this.getSeconds(), //秒
135
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
136
- "S": this.getMilliseconds() //毫秒
137
- };
138
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
139
- for (var k in o)
140
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
141
- return fmt;
142
- }
143
-
144
- export default {
145
- title: '报建流程业务控制层',
146
- props: ['selectdata'],
147
- data() {
148
- return {
149
- acceptprint: false,
150
- acceptUrl: 'rs/report/printReceiptbill',
151
- printData:{
152
- f_user_name: '',
153
- f_address: '',
154
- f_user_phone:'',
155
- f_work_type: '新报装',
156
- f_news:'身份证'
157
- },
158
- data: null, // 数据库数据,json配置文件数据的数据集合
159
- json_datas: null, // Json配置文件集合
160
- showview: false, // 控制显示service-view组件
161
- show_data: null, // 给view层显示的数据
162
- department_search: [], // 当前部门下所有人
163
- contract: null, // 单值表合同编号记录
164
- technologist: [], // 技术人员 角色下的人
165
- price: 0,
166
- xiangmu:'',
167
- xia:'',
168
- cost: 0,
169
- number: 0,
170
- pgd: '',
171
- showbuyerinfo: false, // 新增购货方信息模态框开关
172
- selectsellid: null, //需要打票收费id
173
- buyerinfo: {
174
- id: '',
175
- f_buyer_name: '',
176
- f_buyer_identify: '',
177
- f_buyer_addphone: '',
178
- f_buyer_bank: '',
179
- f_buyer_email: '',
180
- rows: [] // 购货方信息
181
- },
182
- bill: '',
183
- areaall:[],
184
- stop_show:false, // 终止备注开关
185
- apply_show:false, // 转单报建开关
186
- apply_type:'',
187
- applytypes:[{label:"散户报装",value:"报装申请"},{label:"集体报装",value:"集体报装申请"}],// 报建类型
188
- models: {
189
- f_date: Util.toStandardTimeString(),
190
- f_department: this.$login.f.f_parentname,
191
- f_operator: this.$login.f.name,
192
- f_filiale: this.$login.f.f_fengongsi
193
- },
194
- models2:{},
195
- selectShow: false,
196
- overviewprint:false,
197
- overviewname:''
198
- }
199
- },
200
- methods: {
201
- /*
202
- ============================================收费临时使用
203
- */
204
- // 转到报建
205
- async addactive(){
206
- let http = new HttpResetClass()
207
- let model = this.models2
208
- let url = 'rs/logic/ApplyProductService'
209
- let requestData = {
210
- tables: this.data.tables, model: model
211
- }
212
- requestData.start_activity = '踏勘'
213
- requestData.loginUser = this.$login.f
214
- requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
215
- let res1 = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
216
- this.selectdata.applyid = this.selectdata.id
217
- // this.$resetpost('rs/logic/stopapply', {data: this.selectdata})
218
- console.log(this.apply_type[0])
219
- this.$workflow_vue.start_activity = this.apply_type[0]
220
- let res = await http.load('POST','rs/logic/ApplyGetProcessID',{data:{filename:this.$workflow_vue.workflow_xmlfilename,start_activity:this.$workflow_vue.start_activity}}, {resolveMsg: null, rejectMsg: '获取流程ID失败,请联系开发人员'})
221
- let data = {
222
- defname: this.$workflow_vue.start_activity,
223
- f_process_id: res.data.f_process_id,
224
- f_apply_date: Util.toStandardTimeString(),
225
- f_product_id: res.data.f_product_id,
226
- start_activity:this.$workflow_vue.start_activity,
227
- f_user_type:this.models2.f_user_type,
228
- f_user_name:this.models2.f_user_name,
229
- f_phone:this.models2.f_phone,
230
- f_area:this.models2.f_area,
231
- f_street:this.models2.f_street,
232
- f_residential_area:this.models2.f_residential_area,
233
- f_building:this.models2.f_building,
234
- f_unit:this.models2.f_unit,
235
- f_floor:this.models2.f_floor,
236
- f_room:this.models2.f_room,
237
- f_address:this.models2.f_address,
238
- f_idnumber:this.models2.f_social_credit_code,
239
- f_apply_source:this.models2.f_apply_source,
240
- f_sub_state:'未完工',
241
- f_project_number : res1.data.f_apply_num,
242
- user:{
243
- id: this.$login.f.id,
244
- name: this.$login.f.name,
245
- ename: this.$login.f.ename
246
- }
247
- }
248
- await http.load('POST','rs/logic/newaddApplyproduct',{data:data}, {resolveMsg: null, rejectMsg: '转发失败,请联系开发人员'})
249
- var flag = false
250
- if (this.data.defname == '合同审核') {
251
- flag = true
252
- let http = new HttpResetClass()
253
- let data = {
254
- tablename: 't_singlevalue',
255
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
256
- }
257
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
258
- resolveMsg: null,
259
- rejectMsg: "获取合同编号失败"
260
- })
261
- if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
262
- this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
263
- return
264
- }
265
- }
266
- if (res1.data.code == 200) {
267
- // flag 为合同编号更新标志
268
- if (flag) {
269
- let http = new HttpResetClass()
270
- let data = {
271
- tablename: 't_singlevalue',
272
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
273
- value: (Number(this.contract) + 1) + ''
274
- }
275
- await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
276
- resolveMsg: null,
277
- rejectMsg: "获取合同编号更新失败"
278
- })
279
- }
280
- this.showview = false
281
- // 特殊处理
282
- this.special(model)
283
- this.$dispatch('close')
284
- this.initializtion()
285
- } else {
286
- if (res1.data.msg) {
287
- this.$showMessage(res1.data.msg)
288
- }
289
- }
290
- this.apply_show = false
291
- },
292
- // 终止报建
293
- async stopapplys () {
294
- this.models = Object.assign({}, this.selectdata, this.models)
295
- this.models.id = null
296
- this.models.applyid = this.selectdata.id
297
- this.models.f_operat_type = '终止报建'
298
- this.models.f_state = '有效'
299
- this.models.f_describe = this.selectdata.f_user_name + '已终止报建'
300
- let data ={
301
- tablename:'t_project_stop',
302
- parameters:this.models
303
- }
304
- let http = new HttpResetClass()
305
- await http.load('POST','rs/logic/stopapply', {data:this.models},{resolveMsg: null, rejectMsg: "终止失败"})
306
- await http.load('POST','rs/logic/save', {data:data},{resolveMsg: null, rejectMsg: "添加失败"})
307
- this.closeback()
308
- this.$dispatch('close')
309
- },
310
- // 关闭终止备注弹框
311
- closeback() {
312
- this.stop_show = false
313
- },
314
- // 关闭报建弹框
315
- closeapply() {
316
- this.apply_show = false
317
- },
318
- closeAccept () {
319
- this.acceptprint = false
320
- },
321
- close () {
322
- this.acceptprint = false
323
- },
324
- printok () {
325
- this.$dispatch('success')
326
- },
327
- validateBill (val) {
328
- this.validateOk = !val.isOk
329
- this.billData.bill = val.bill
330
- },
331
- async printReceipt(model) {
332
- console.log('打印回单了11111111111111111model', model)
333
- this.acceptprint = true
334
- this.acceptUrl = 'rs/report/printReceiptbill'
335
- this.printData.f_work_type = `'${model.f_work_type}'`
336
- this.printData.f_news = `'${model.f_news}'`
337
- this.printData.f_user_name = `'${model.f_user_name}'`
338
- this.printData.f_address = `'${model.f_address}'`
339
- this.printData.f_user_phone = `'${model.f_phone}'`
340
- },
341
- print () {
342
- this.$refs.print.$refs.print.PrintTable()
343
- },
344
- printoverview(name){
345
- this.overviewprint = true
346
- this.overviewname = name
347
- },
348
-
349
- async printbill(sellid) {
350
- let result = await this.$resetpost('rs/report/applyCharge_bill', {data: {condition: `c.id = ${sellid}`}}, {
351
- resolveMsg: null,
352
- rejectMsg: "提取数据出错,请重试!"
353
- })
354
- this.bill = result.data
355
- console.log('this.bill', this.bill)
356
- this.$nextTick(() => {
357
- this.$refs.reportprint.print()
358
- })
359
- },
360
- confirmbuyerinfo(args) {
361
- let drawbilldata = {
362
- sellid: this.selectsellid,
363
- buyerid: args.id,
364
- operator: this.$login.f.name
365
- }
366
- this.closebuyerinfo()
367
- this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
368
- .then((res) => {
369
- if (res.data.status === 200) {
370
- this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
371
- /*let n = 0
372
- var id = setInterval(async ()=>{
373
- if(n>=3){
374
- this.$showMessage('电子票延迟,请稍后查看!')
375
- clearInterval(id)
376
- }
377
- if (this.seeeticket(res.data) === 'success'){
378
- clearInterval(id)
379
- this.load()
380
- }
381
- n++
382
- this.$showAlert('电子发票开票中,请稍后...', 'info',3000)
383
- },3000)*/
384
- } else {
385
- this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
386
- }
387
- })
388
- },
389
- // 金额转大写
390
- smalltoBIG(n) {
391
- let fraction = ['角', '分'];
392
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
393
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
394
- let head = n < 0 ? '欠' : '';
395
- n = Math.abs(n);
396
-
397
- let s = '';
398
-
399
- for (var i = 0; i < fraction.length; i++) {
400
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
401
- }
402
- s = s || '整';
403
- n = Math.floor(n);
404
-
405
- for (var i = 0; i < unit[0].length && n > 0; i++) {
406
- let p = '';
407
- for (var j = 0; j < unit[1].length && n > 0; j++) {
408
- p = digit[n % 10] + unit[1][j] + p;
409
- n = Math.floor(n / 10);
410
- }
411
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
412
- }
413
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
414
- },
415
- // 关闭模态框
416
- closebuyerinfo() {
417
- this.showbuyerinfo = false
418
- this.selectsellid = null
419
- },
420
- //根据票据流水号查看票据
421
- async seeeticket(val) {
422
- console.log('该票据流水号为:', val.f_fpqqlsh)
423
- var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
424
- data: {
425
- items: 'f_bill_url,f_url_code',
426
- tablename: 't_eticket',
427
- condition: `f_serial_number=${val.f_fpqqlsh}`
428
- }
429
- }, {resolveMsg: null, rejectMsg: null})
430
- console.log('eticketData:', eticketData)
431
- var data = eticketData.data[0]
432
- if (data.f_bill_url && data.f_bill_url != '') {
433
- console.log(data)
434
- var auth = data.f_bill_url.split("/")
435
- console.log("截取", auth)
436
- var authCode = auth[auth.length - 1]
437
- var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
438
- this.$showAlert('开票成功!', 'success', 500)
439
- window.open(url)
440
- return 'success'
441
- }
442
- return 'fail'
443
- },
444
- async loadbuyer() {
445
- //获取购货方信息
446
- let querybuyerdata = {
447
- tablename: 't_buyer_info',
448
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_apply_num = '${this.selectdata.f_apply_num}'`
449
- }
450
- let buyerinfos = await this.$resetpost('rs/sql/singleTable', {data: querybuyerdata}, {
451
- resolveMsg: null,
452
- rejectMsg: '获取购货方信息失败'
453
- })
454
- this.buyerinfo.rows = buyerinfos.data
455
- },
456
- /*
457
- ============================================收费临时使用结束
458
- */
459
- // AOP后续特殊化处理
460
- async special(model) {
461
- if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步处理') {
462
- // 分支流程异步处理
463
- let http = new HttpResetClass();
464
- let res = await http.load('POST', 'rs/logic/branchsyncprocess', {
465
- data: {
466
- model: model,
467
- loginUser: this.$login.f
468
- }
469
- }, {resolveMsg: null, rejectMsg: '分支流程异步处理保存失败'})
470
- console.log("分支流程异步处理:", JSON.stringify(res.data))
471
- }
472
-
473
- if (this.data.distribute_async && model.button.button_name === '下发') {
474
- // 同流程节点异步处理
475
- let http = new HttpResetClass();
476
- let res = await http.load('POST', 'rs/logic/syncprocess', {
477
- data: {
478
- model: model,
479
- loginUser: this.$login.f
480
- }
481
- }, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
482
- console.log("流程的异步处理:", JSON.stringify(res.data))
483
- }
484
- if (this.data.distribute_async && model.button.button_name === '完成') {
485
- // 强制结束
486
- let http = new HttpResetClass();
487
- let res = await http.load('POST', 'rs/logic/stoprocess', {
488
- data: {
489
- model: model,
490
- loginUser: this.$login.f
491
- }
492
- }, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
493
- console.log("流程的异步处理:", JSON.stringify(res.data))
494
- }
495
- },
496
- // 组件初始化操作
497
- refurbish(val) {
498
- this.selectdata = val
499
- this.json_datas = this.$workflow_vue
500
- console.log("初始化jsonDataS==", this.json_datas)
501
- let sum = 0
502
- let jsonData = {}
503
- if(!this.json_datas||!this.json_datas.activitys||this.json_datas.activitys.length==0){
504
- this.$showMessage("网络故障,请刷新页面")
505
- return
506
- }
507
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
508
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
509
- jsonData = this.json_datas.activitys[i]
510
- sum++
511
- }
512
- }
513
- for (let j = 0; j < jsonData.fields.length; j++) {
514
- jsonData.fields[j].value = ''
515
- console.log("是否有default属性jsonData.fields[j]", jsonData.fields[j])
516
- if (jsonData.fields[j].default) {
517
- jsonData.fields[j].value = jsonData.fields[j].default
518
- }
519
- }
520
- if (sum == 1) {
521
- console.log("jsonData==", jsonData)
522
- this.data = null
523
- this.data = jsonData
524
- this.initializtion()
525
- } else if (sum == 0) {
526
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
527
- } else {
528
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
529
- }
530
- },
531
- //生成派工单号
532
- createpgd() {
533
- this.pgd = "BJ"
534
- var d = new Date()
535
- this.pgd+=d.getFullYear()
536
- if(d.getMonth() + 1<10){
537
- this.pgd+='0'+(d.getMonth() + 1)
538
- }
539
- else{
540
- this.pgd+=(d.getMonth() + 1)
541
- }
542
- if(d.getDate() <10){
543
- this.pgd+='0'+d.getDate()
544
- }
545
- else{
546
- this.pgd+=d.getDate()
547
- }
548
- if(d.getHours() <10){
549
- this.pgd+='0'+d.getHours()
550
- }
551
- else{
552
- this.pgd+=d.getHours()
553
- }
554
- if(d.getMinutes() <10){
555
- this.pgd+='0'+d.getMinutes()
556
- }
557
- else{
558
- this.pgd+=d.getMinutes()
559
- }
560
- if(d.getSeconds() <10){
561
- this.pgd+='0'+d.getSeconds()
562
- }
563
- else{
564
- this.pgd+=d.getSeconds()
565
- }
566
- },
567
-
568
-
569
-
570
- // AOP:进入vue组件前初始化内容
571
- // json配置数据处理 比如下拉框的options
572
- async initializtion() {
573
- console.log("this.data.table", this.data.tables)
574
- this.showview = false
575
- // 有合同号不给合同表里插入数据
576
- for(let i=0;i<this.data.tables.length;i++){
577
- if('t_contract'==this.data.tables[i]&&this.selectdata.f_contract_number){
578
- this.data.tables.splice(i,1)
579
- }
580
- }
581
- // 下发人 options 处理,options初始化
582
- if (this.selectdata.defname.indexOf('派单')>=0&&this.selectdata.actorexpression) {
583
- let http = new HttpResetClass()
584
- http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程部门$).getChildByName($工程部门负责人$).getChildren()","userid":"${this.$login.f.id}"}`, {
585
- resolveMsg: null,
586
- rejectMsg: null
587
- }).then((res)=>{
588
-
589
-
590
- let jsonString = JSON.stringify(res.data)
591
- let jsonArray = []
592
- if (jsonString.startsWith("{")) {
593
- jsonArray.push(res.data)
594
- res.data = jsonArray
595
- }
596
- this.department_search = res.data
597
- if (this.department_search&&this.showview) {
598
- let array = []
599
- for (let k = 0; k < this.department_search.length; k++) {
600
- array.push({
601
- label: this.department_search[k].name,
602
- value: {id: this.department_search[k].id, name: this.department_search[k].name}
603
- })
604
- }
605
- for(let x=0;x<this.data.buttons.length;x++){
606
- if(this.data&&this.data.buttons[x].button_name=="下发"){
607
- this.data.buttons[x].button_fields[0].options = array
608
- }
609
- if(this.show_data &&this.show_data.buttons[x].button_name=="下发"){
610
- this.show_data.buttons[x].button_fields[0].options = array
611
- }
612
- }
613
- }
614
- })
615
- }
616
-
617
- //debugger
618
-
619
- // selectdata 填充 data
620
- this.data = Object.assign({}, this.data, this.selectdata)
621
- // onetomany 数据获取
622
- if (this.data.onetomany) {
623
- console.log('判断是onetomany,this.data.onetomany的数据为=>' + JSON.stringify(this.data.onetomany))
624
- for (let index = 0; index < this.data.onetomany.length; index++) {
625
- let http = new HttpResetClass()
626
- let data = {}
627
- if (this.data.onetomany[index].tables[0] == 't_charge_record') {
628
- data = {
629
- tablename: this.data.onetomany[index].tables[0],
630
- condition: `f_apply_num = '${this.selectdata.f_apply_num}' and f_process_id='${this.selectdata.f_process_id}' and f_charging_status != '作废'`
631
- }
632
- } else {
633
- data = {
634
- tablename: this.data.onetomany[index].tables[0],
635
- condition: `f_process_id='${this.selectdata.f_process_id}'`
636
- }
637
- }
638
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
639
- resolveMsg: null,
640
- rejectMsg: 'onetomany查询失败'
641
- })
642
- // 初始化 onetomany
643
- let rows = []
644
- console.log('查询返回结果res.data=>' + JSON.stringify(res.data))
645
- this.data.onetomany[index].rows = res.data
646
- // console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
647
-
648
- // 初始化onetomany中的fields
649
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
650
- // 如果配置类型为select,优先从参数列表获取options
651
- if (this.data.onetomany[index].fields[j].type === 'select') {
652
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
653
- if (temp && temp.length > 0) {
654
- this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
655
- }
656
- }
657
- }
658
- }
659
- }
660
- // 初始化 fields
661
- for (let i = 0; i < this.data.fields.length; i++) {
662
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
663
- if (this.selectdata[this.data.fields[i].field]) {
664
- if (String(this.selectdata[this.data.fields[i].field]).startsWith("{")) {
665
- this.data.fields[i].value = JSON.parse(this.selectdata[this.data.fields[i].field])
666
- } else {
667
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
668
- }
669
-
670
- }
671
- // 如果配置类型为select,优先从参数列表获取options
672
- if (this.data.fields[i].type === 'select') {
673
- let temp = Vue.$appdata.getParam(this.data.fields[i].label)
674
- if (temp && temp.length > 0) {
675
- this.data.fields[i].options = Vue.$appdata.getParam(this.data.fields[i].label)
676
- }
677
- }
678
-
679
- if (this.data.defname === '工程结算') {
680
- var a = 0
681
- var b = 0
682
- var c = 0
683
- for (let i = 0; i < this.data.fields.length; i++) {
684
- if (this.data.fields[i].label === '最终核算成本金额') {
685
- this.data.fields[i].value = (this.cost + this.number)
686
- a = this.data.fields[i].value
687
- }
688
- if (this.data.fields[i].label === '合同总金额') {
689
- b = this.data.fields[i].value
690
- }
691
- if (this.data.fields[i].label === '材料成本金额') {
692
- this.data.fields[i].value = this.number
693
- }
694
- if (this.data.fields[i].label === '其他成本金额') {
695
- this.data.fields[i].value = this.cost
696
- }
697
- }
698
- c = b - a
699
- for (let i = 0; i < this.data.fields.length; i++) {
700
- if (this.data.fields[i].label === '工程盈利') {
701
- this.data.fields[i].value = c
702
- }
703
- }
704
- }
705
- if (this.selectdata.defname.indexOf('派单')>=0) {
706
- let money=0
707
-
708
- for (let i = 0; i < this.data.fields.length; i++) {
709
- if (this.data.fields[i].label === '派工单号') {
710
- console.log("给派工单号赋值")
711
- this.createpgd()
712
- console.log(this.pgd)
713
- this.data.fields[i].value = this.pgd
714
- }
715
- if (this.data.fields[i].label === '合同总金额') {
716
- console.log('合同总金额===>'+this.data.fields[i].value )
717
- money=this.data.fields[i].value
718
- }
719
- let dealmoney=0;
720
- if (this.data.fields[i].label == '累计缴费金额') {
721
- dealmoney=this.data.fields[i].value
722
- console.log('累计缴费金额===>'+dealmoney )
723
- }
724
-
725
- if (this.data.fields[i ].label == '未结总金额') {
726
- /// if(money=="" || dealmoney==""){
727
- /// money=0;
728
- /// dealmoney=0;
729
- /// }
730
- /// if(money==null || dealmoney==null){
731
- /// money=0;
732
- /// dealmoney=0;
733
- /// }
734
- ///
735
- let othermoney = money-dealmoney;
736
- console.log('jine'+othermoney)
737
- this.data.fields[i].value=money-dealmoney
738
- console.log('未结总金额'+this.data.fields[i].value )
739
- }
740
- }
741
- }
742
- if(this.data.defname=="派单"){
743
- for (let i = 0; i < this.data.fields.length; i++) {
744
- if (this.data.fields[i].label === '未结总金额') {
745
- this.data.fields[i].value=0
746
- console.log("派单"+this.data.fields[i].value)
747
- }
748
- }
749
- }
750
-
751
-
752
- if (this.selectdata.defname ==='报价审核') {
753
- let unaccount=0
754
- for (let i = 0; i < this.data.fields.length; i++) {
755
- if (this.data.fields[i].label === '费用合计') {
756
- console.log("算一下未结算金额")
757
- unaccount=this.data.fields[i].value
758
- }
759
- if (this.data.fields[i].label === '未结总金额') {
760
- this.data.fields[i].value=unaccount
761
- }
762
-
763
- }
764
- }
765
-
766
-
767
- if (this.data.defname === '收费') {
768
- let account_money=0
769
- let total_money=0
770
- let bill_money=0
771
- for (let i = 0; i < this.data.fields.length; i++) {
772
- if (this.data.fields[i].label === '合同金额') {
773
- total_money=this.data.fields[i].value
774
- }
775
- if (this.data.fields[i].label === '累计缴费金额') {
776
- account_money=this.data.fields[i].value
777
- }
778
- if (this.data.fields[i].label === '未结总金额') {
779
- this.data.fields[i].value=total_money-account_money
780
- }
781
- if (this.data.fields[i].label === '累计开票金额') {
782
- bill_money=this.data.fields[i].value
783
- }
784
- if (this.data.fields[i].label === '未开票金额') {
785
- this.data.fields[i].value=total_money-bill_money
786
-
787
- }
788
- }
789
- }
790
- // 特殊处理
791
- //施工环节 如果是个人报建需要提交表具信息
792
- if (this.data.defname === '施工') {
793
- for (let i = 0; i < this.data.fields.length; i++) {
794
- if (this.data.fields[i].label === '气表品牌'
795
- || this.data.fields[i].label === '气表型号'
796
- || this.data.fields[i].label === '气表厂家') {
797
- if (this.data.f_apply_type === '个人报建') {
798
- this.data.fields[i].hidden = false
799
- this.data.fields[i].required = true
800
- }
801
- }
802
- }
803
- }
804
-
805
- // 特殊处理
806
- //施工环节 如果是个人报建需要提交表具信息
807
- if (this.data.defname === '安装通气') {
808
- for (let i = 0; i < this.data.fields.length; i++) {
809
- if (this.data.fields[i].label === '气表品牌'
810
- || this.data.fields[i].label === '气表型号'
811
- || this.data.fields[i].label === '气表厂家') {
812
- this.data.fields[i].required = true
813
- this.data.fields[i].hidden = false
814
- if(this.data.f_work_type=='改管'){
815
- this.data.fields[i].required = false
816
- }
817
-
818
- }
819
- if(this.data.fields[i].label === '验收结果'){
820
- this.data.fields[i].required = true
821
- }
822
-
823
- }
824
- }
825
- if (this.data.defname === '设计报价') {
826
- for (let i = 0; i < this.data.fields.length; i++) {
827
- if (this.data.fields[i].label === '气表品牌'
828
- || this.data.fields[i].label === '气表型号') {
829
- this.data.fields[i].required = true
830
- this.data.fields[i].hidden = false
831
- if(this.data.f_work_type=='改管'){
832
- this.data.fields[i].required = false
833
- }
834
-
835
- }
836
-
837
- }
838
- }
839
- if (this.data.defname === '现场勘查定价') {
840
- for (let i = 0; i < this.data.fields.length; i++) {
841
- if (this.data.fields[i].label === '勘查结果') {
842
- this.data.fields[i].required = true
843
- }
844
- }
845
- }
846
- //通气环节可以调出施工环节的表信息来修改
847
- if (this.data.defname === '通气') {
848
- for (let i = 0; i < this.data.fields.length; i++) {
849
- if (this.data.fields[i].label === '气表品牌'
850
- || this.data.fields[i].label === '气表型号'
851
- || this.data.fields[i].label === '气表厂家') {
852
- if (this.data.fields[i].value != null && this.data.fields[i].value != '') {
853
- this.data.fields[i].hidden = false
854
- this.data.fields[i].required = true
855
- }
856
- }
857
- }
858
- }
859
- let array = this.$login.f.rolesnames.split(',')
860
- if ((this.data.fields[i].label === '技术人员' || array.includes("工程技术部负责人"))&&(this.selectdata.defname=='勘察初设'||this.selectdata.defname=='任务分配'||this.selectdata.defname=='合同信息')) { //{"source":"this.getParentByType($organization$).getChildByName($技术人员$).getChildren()","userid":"296851"}
861
- let http = new HttpResetClass()
862
- let res = await http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程技术部门$).getChildByName($技术人员$).getChildren()","userid":"${this.$login.f.id}"}`, {
863
- resolveMsg: null,
864
- rejectMsg:null // 'search查询技术人员失败,请联系管理员配置技术人员角色'
865
- })
866
- // console.log("search查询部门下所有人:", JSON.stringify(res.data))
867
- this.technologist = res.data
868
- if (this.technologist) {
869
- let array = []
870
- for (let k = 0; k < this.technologist.length; k++) {
871
- array.push({
872
- label: this.technologist[k].name,
873
- value: {name: this.technologist[k].name, id: this.technologist[k].id}
874
- })
875
- }
876
- if (!array.includes("工程技术部负责人")&&this.data.fields[i].label === '技术人员') {
877
- this.data.fields[i].options = array
878
- }
879
-
880
- }
881
- }
882
- if (this.data.fields[i].label == '县/区') {
883
- let area = await this.$resetpost('rs/sql/singleTable', {
884
- data: {
885
- // items: 'f_bill_url,f_url_code',
886
- tablename: 't_pcd',
887
- condition: `f_filialeids = '${this.$login.f.f_orgids}'`
888
- }
889
- }, {resolveMsg: null, rejectMsg: null})
890
- let rs = []
891
- for (let i = 0; i < area.data.length; i++) {
892
- let temp = {
893
- label: area.data[i].f_pcd,
894
- value: area.data[i].f_pcd
895
- }
896
- rs.push(temp)
897
- }
898
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
899
- }
900
- if (this.data.defname=='通气'&&this.data.fields[i].label == '小区名称') {
901
- let res = await this.$resetpost('rs/sql/singleTable', {
902
- data: {
903
- tablename: 't_area',
904
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${this.data.f_street}'`
905
- }
906
- }, {resolveMsg: null, rejectMsg: null})
907
- let cs = []
908
- for (let i = 0; i < res.data.length; i++) {
909
- let temp = {
910
- label: res.data[i].f_residential_area,
911
- value: res.data[i].f_residential_area
912
- }
913
- cs.push(temp)
914
- }
915
- this.data.fields[i].options = [{label: '全部', value: ''}, ...cs]
916
- }
917
- let gasbrand_id=''
918
- if (this.data.fields[i].label == '气表品牌'||this.data.fields[i].label == '表具') {
919
- let meterbrand = await this.$resetpost('rs/sql/singleTable', {
920
- data: {
921
- items: 'f_meter_brand',
922
- tablename: 't_gasbrand',
923
- condition: `f_filialeids = '${this.$login.f.f_orgids}'`
924
- }
925
- }, {resolveMsg: null, rejectMsg: null})
926
- let rs = []
927
- for (let i = 0; i < meterbrand.data.length; i++) {
928
- let temp = {
929
- label: meterbrand.data[i].f_meter_brand,
930
- value: meterbrand.data[i].f_meter_brand
931
- }
932
- rs.push(temp)
933
- }
934
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
935
- }
936
- if (this.data.fields[i].label == '气表型号') {
937
- this.data.fields[i].options = [];
938
- }
939
- if (this.data.fields[i].label == '气价名称') {
940
- let meterbrand = await this.$resetpost('rs/sql/singleTable', {
941
- data: {
942
- items: 'f_price_name',
943
- tablename: 't_stairprice',
944
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_state= '有效' and getdate()>=f_perform_date and getdate()<=f_end_date `
945
- }
946
- }, {resolveMsg: null, rejectMsg: null})
947
- let rs = []
948
- for (let i = 0; i < meterbrand.data.length; i++) {
949
- let temp = {
950
- label: meterbrand.data[i].f_price_name,
951
- value: meterbrand.data[i].f_price_name
952
- }
953
- rs.push(temp)
954
- }
955
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
956
- }
957
- if (this.data.fields[i].label == '合同类型') {
958
- this.data.fields[i].value = '主合同'
959
- }
960
- if (this.data.fields[i].label == '合同业务办理人') {
961
- if (this.selectdata.f_apply_kefu_employee) {
962
- if (this.selectdata.f_apply_kefu_employee.startsWith("{") && this.selectdata.f_apply_kefu_employee.endsWith("}")) {
963
- let temp = JSON.parse(this.selectdata.f_apply_kefu_employee)
964
- this.data.fields[i].value = temp.name
965
- } else {
966
- this.data.fields[i].value = this.selectdata.f_apply_kefu_employee
967
- }
968
- } else {
969
- if (this.selectdata.f_survey_name) {
970
- if (this.selectdata.f_survey_name.startsWith("{") && this.selectdata.f_survey_name.endsWith("}")) {
971
- let temp = JSON.parse(this.selectdata.f_survey_name)
972
- this.data.fields[i].value = temp.name
973
- } else {
974
- this.data.fields[i].value = this.selectdata.f_survey_name
975
- }
976
- }
977
- }
978
- }
979
- if (this.data.fields[i].label == '合同编号' && !this.selectdata[this.data.fields[i].field] && this.selectdata.defname == '合同审核') {
980
- if (!this.$appdata.getSingleValue('所属公司编码')) {
981
- this.$showMessage(`请先去参数管理设置: 所属公司编码`)
982
- }
983
- if (!this.$appdata.getSingleValue(this.data.fields[i].label)) {
984
- this.$showMessage(`请先去参数管理设置: ${this.data.fields[i].label}`)
985
- } else {
986
- let http = new HttpResetClass()
987
- //获取购货方信息
988
- let data = {
989
- tablename: 't_singlevalue',
990
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
991
- }
992
- let res = await http.load('POST','rs/sql/singleTable', {data: data}, {
993
- resolveMsg: null,
994
- rejectMsg: '获取合同编号失败'
995
- }).then((res)=>{
996
- let temp = res.data[0].value
997
- this.contract = temp
998
- while (temp.length < 4) {
999
- temp = '0' + temp
1000
- }
1001
- let dt = new Date()
1002
- this.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
1003
- if(this.showview){
1004
- this.$refs.service_show.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
1005
- this.$refs.service_show.update()
1006
- }
1007
-
1008
- })
1009
- // this.$refs.service_show.update()
1010
- }
1011
- }
1012
- if(this.data.defname=='通气'){
1013
- if (this.data.f_user_type == '非民用' && this.data.fields[i].label == '小区名称'){
1014
- this.data.fields[i].hidden = true
1015
- this.data.fields[i].required = false
1016
- this.data.fields[i+1].hidden = true
1017
- this.data.fields[i+1].required = false
1018
- this.data.fields[i+2].hidden = true
1019
- this.data.fields[i+2].required = false
1020
- }
1021
- if (this.data.f_work_type == '改管' && this.data.fields[i].label == '阀门井'){
1022
- this.data.fields[i].hidden = true
1023
- this.data.fields[i].required = false
1024
- this.data.fields[i+1].hidden = true
1025
- this.data.fields[i+1].required = false
1026
- this.data.fields[i+2].hidden = true
1027
- this.data.fields[i+2].required = false
1028
- }
1029
- if (this.data.f_work_type == '改管' && this.data.fields[i].label == '表具'){
1030
- this.data.fields[i].hidden = true
1031
- this.data.fields[i].required = false
1032
- this.data.fields[i+1].hidden = true
1033
- this.data.fields[i+1].required = false
1034
- this.data.fields[i+2].hidden = true
1035
- this.data.fields[i+2].required = false
1036
- }
1037
- }
1038
- }
1039
- // 初始化 buttons_fields
1040
- //debugger
1041
- for (let i = 0; i < this.data.buttons.length; i++) {
1042
- if (this.data.buttons[i].button_fields) {
1043
- for (let j = 0; j < this.data.buttons[i].button_fields.length; j++) {
1044
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
1045
- if (this.selectdata[this.data.buttons[i].button_fields[j].field]) {
1046
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
1047
- }
1048
- // 如果配置类型为select,优先从参数列表获取options
1049
- if (this.data.buttons[i].button_fields[j].type === 'select' && this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)) {
1050
- this.data.buttons[i].button_fields[j].options = this.$appdata.getParam(this.data.buttons[i].button_fields[j].label).trim()
1051
- }
1052
- // 下发特殊配置
1053
- if (this.data.buttons[i].button_name === '下发') {
1054
- if (this.data.buttons[i].button_fields.length === 1) {
1055
- // value初始化
1056
- // if(this.department_search){
1057
- if (this.selectdata[this.data.buttons[i].button_fields[0].field]) {
1058
- for (let k = 0; k < this.department_search.length; k++) {
1059
- // 将id转换为name
1060
- if (Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])) {
1061
- this.data.buttons[i].button_fields[0].value = {
1062
- id: this.department_search[k].id,
1063
- name: this.department_search[k].name
1064
- }
1065
- }
1066
- }
1067
- }
1068
-
1069
- if (this.department_search) {
1070
- let array = []
1071
- for (let k = 0; k < this.department_search.length; k++) {
1072
- array.push({
1073
- label: this.department_search[k].name,
1074
- value: {id: this.department_search[k].id, name: this.department_search[k].name}
1075
- })
1076
- }
1077
- this.data.buttons[i].button_fields[0].options = array
1078
- }
1079
- let array = this.$login.f.rolesnames.split(',')
1080
- if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1081
- let array = []
1082
- for (let k = 0; k < this.technologist.length; k++) {
1083
- array.push({
1084
- label: this.technologist[k].name,
1085
- value: {id: this.technologist[k].id, name: this.technologist[k].name}
1086
- })
1087
- }
1088
- this.data.buttons[i].button_fields[0].options = array
1089
- }
1090
- } else {
1091
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
1092
- }
1093
- }
1094
- }
1095
- }
1096
-
1097
- }
1098
- var count =0;
1099
- let money=0;
1100
- let dealmoney=0;
1101
- for (count = 0; count < this.data.fields.length; count++) {
1102
- if (this.selectdata.defname.indexOf('派单')>=0) {
1103
- if (this.data.fields[count].label === '合同总金额') {
1104
- console.log('合同总金额===>'+this.data.fields[count].value )
1105
- money=this.data.fields[count].value
1106
- }
1107
-
1108
- if (this.data.fields[count].label == '累计缴费金额') {
1109
- dealmoney=this.data.fields[count].value
1110
- console.log('累计缴费金额===>'+dealmoney )
1111
- }
1112
-
1113
- if (this.data.fields[count].label == '未结总金额') {
1114
- let othermoney = money-dealmoney;
1115
- console.log('jine'+othermoney)
1116
- this.data.fields[count].value=money-dealmoney
1117
- console.log('未结总金额'+this.data.fields[count].value )
1118
- }
1119
- }
1120
- }
1121
- //debugger
1122
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
1123
- let temp = JSON.parse(JSON.stringify(this.data))
1124
- // let temp = this.data
1125
- // 退回原因展示
1126
- if (this.selectdata.f_back_reason) {
1127
- temp['back_reason'] = this.selectdata.f_back_reason
1128
- }
1129
- this.show_data = temp
1130
- console.log("====="+this.show_data)
1131
- /**
1132
- * 新增需求: 个人报建非民用流程中小区名称需选填
1133
- */
1134
- let j=0;
1135
- if(this.show_data.defname=="现场勘查人员分配" && this.show_data.f_apply_type=="个人报建"){
1136
-
1137
- for (j = 0; j < this.show_data.fields.length; j++) {
1138
- if (this.show_data.fields[j].label == '小区名称') {
1139
- this.show_data.fields[j].required=false
1140
- }
1141
- }
1142
- }
1143
- if (this.show_data.defname === '施工') {
1144
- let http = new HttpResetClass()
1145
- let data = {
1146
- f_process_id: this.show_data.f_process_id,
1147
- defname: this.show_data.defname
1148
- }
1149
- let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1150
- {resolveMsg: null, rejectMsg: null})
1151
-
1152
- // for (let i = 0; i < res.length; i++){
1153
- // this.data.f_project_material += res.data.fusetype + ','
1154
- // }
1155
- res.data.forEach(item =>{
1156
- this.show_data.f_project_material += item.fusetype + ','
1157
- })
1158
- }
1159
- // if (this.show_data.defname === '施工验收') {
1160
- // let http = new HttpResetClass()
1161
- // let data = {
1162
- // f_process_id: this.show_data.f_process_id,
1163
- // defname: this.show_data.defname
1164
- // }
1165
- // let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1166
- // {resolveMsg: null, rejectMsg: null})
1167
- // this.show_data.f_iscomplete_information = ''
1168
- // res.data.forEach(item =>{
1169
- // this.show_data.f_iscomplete_information += item.fusetype + ','
1170
- // })
1171
- // for (j = 0; j < this.show_data.fields.length; j++) {
1172
- // if (this.show_data.fields[j].label === '验收已上传文件') {
1173
- // this.show_data.fields[j].value = this.show_data.f_iscomplete_information
1174
- // }
1175
- // }
1176
- // }
1177
- // 显示组件
1178
- // this.showview = false
1179
- // debugger
1180
- this.$nextTick(()=>{
1181
- this.showview = true
1182
- })
1183
- }
1184
- }
1185
- ,
1186
- events: {
1187
- 'get-cost'(val) {
1188
- this.cost = val
1189
-
1190
- this.initializtion()
1191
- },
1192
- 'checkboxSelectControl'(index,index2){
1193
- console.log("chufa事件control");
1194
- console.log('this.$refs.service_show.data.fields[index]==>:'+JSON.stringify(this.$refs.service_show.data.fields[index]));
1195
- if(this.$refs.service_show.data.fields[index].label=="提交资料"){
1196
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1197
-
1198
- if(this.$refs.service_show.data.fields[i].label=="用户提交资料"){
1199
- //if(this.$refs.service_show.data.fields[index].value == ""){
1200
- console.log("this.$refs.service_show.data.fields[index].items[index2].value==>"+JSON.stringify(this.$refs.service_show.data.fields[index].items[index2]))
1201
- //增加和删除框中的内容
1202
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1203
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1204
- this.$refs.service_show.data.fields[index].items[index2].value=true;
1205
- }else{
1206
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1207
- let values =this.$refs.service_show.data.fields[i].value;
1208
- let result = values.split(" ").filter((item)=>{
1209
- return item!=deleteValue;
1210
- }).join(" ")
1211
- console.log(result);
1212
- this.$refs.service_show.data.fields[i].value =result;
1213
- this.$refs.service_show.data.fields[index].items[index2].value=false;
1214
- }
1215
- //}
1216
- }
1217
- }
1218
- }
1219
- if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
1220
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1221
-
1222
- if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
1223
- //增加和删除框中的内容
1224
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1225
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1226
- this.$refs.service_show.data.fields[index].items[index2].value=true;
1227
- }else{
1228
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1229
- let values =this.$refs.service_show.data.fields[i].value;
1230
- let result = values.split(" ").filter((item)=>{
1231
- return item!=deleteValue;
1232
- }).join(" ")
1233
- this.$refs.service_show.data.fields[i].value =result;
1234
- this.$refs.service_show.data.fields[index].items[index2].value=false;
1235
- }
1236
- //}
1237
- }
1238
- }
1239
- }
1240
- if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
1241
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1242
-
1243
- if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
1244
- //增加和删除框中的内容
1245
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1246
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1247
- this.$refs.service_show.data.fields[index].items[index2].value=true;
1248
- }else{
1249
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1250
- let values =this.$refs.service_show.data.fields[i].value;
1251
- let result = values.split(" ").filter((item)=>{
1252
- return item!=deleteValue;
1253
- }).join(" ")
1254
- this.$refs.service_show.data.fields[i].value =result;
1255
- this.$refs.service_show.data.fields[index].items[index2].value=false;
1256
- }
1257
- //}
1258
- }
1259
- }
1260
- }
1261
- },
1262
- 'get-number'(val) {
1263
- this.number = val
1264
-
1265
- this.initializtion()
1266
- }
1267
- ,
1268
- 'get-pgd'(val) {
1269
- this.pgd = val
1270
- this.initializtion()
1271
- }
1272
- ,
1273
- // 任意select选中时触发事件,关联性操作
1274
- async 'select_cascade'(index) {
1275
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1276
- if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1277
- this.$refs.service_show.data.fields[i].value = c
1278
- }
1279
- }
1280
-
1281
-
1282
- if (this.$refs.service_show.data.fields[index].label == '施工单位' ||
1283
- this.$refs.service_show.data.fields[index].label == '检测单位' ||
1284
- this.$refs.service_show.data.fields[index].label == '监理单位' ||
1285
- this.$refs.service_show.data.fields[index].label == '土建单位' ||
1286
- this.$refs.service_show.data.fields[index].label == '设计单位') {
1287
- this.$refs.service_show.update()
1288
- return
1289
- }
1290
- if (
1291
- this.$refs.service_show.data.fields[index].label === '最终核算成本金额' ||
1292
- this.$refs.service_show.data.fields[index].label === '合同总金额' ||
1293
- this.$refs.service_show.data.fields[index].label === '工程盈利'
1294
- ) {
1295
-
1296
- var a = 0
1297
- var b = 0
1298
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1299
- // 控制设置级联
1300
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1301
- // xxx xx xxx
1302
- if (this.$refs.service_show.data.fields[i].label === '最终核算成本金额') {
1303
- this.$refs.service_show.data.fields[i].value = (this.number + this.cost)
1304
- a = this.$refs.service_show.data.fields[i].value
1305
- }
1306
-
1307
- if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1308
- b = this.$refs.service_show.data.fields[i].value
1309
- }
1310
- }
1311
- var c = b - a
1312
- // 数据计算完毕得到工程结余
1313
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1314
- if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1315
- this.$refs.service_show.data.fields[i].value = c
1316
- }
1317
- }
1318
- }
1319
- //根据合同预算金额和累计缴费金额计算未结金额
1320
- if (
1321
- this.$refs.service_show.data.fields[index].label === '累计缴费金额' ||
1322
- this.$refs.service_show.data.fields[index].label === '合同总金额') {
1323
- let cumulativeMoney = 0
1324
- let unaccountMoney = 0
1325
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1326
-
1327
- if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1328
- cumulativeMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1329
- }
1330
- if (this.$refs.service_show.data.fields[i].label === '累计缴费金额' && this.$refs.service_show.data.fields[i].value) {
1331
- unaccountMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1332
- }
1333
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1334
- // if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
1335
- // //this.$refs.service_show.data.fields[i].value = cumulativeMoney - unaccountMoney
1336
- // this.$refs.service_show.data.fields[i].value =0;
1337
- //
1338
- // }
1339
- }
1340
- }
1341
- }
1342
-
1343
-
1344
- //根据合同预算金额和累计开票金额计算未开票金额
1345
-
1346
-
1347
- if (this.$refs.service_show.data.fields[index].label === '累计开票金额') {
1348
- let residualInvoicing = this.$refs.service_show.data.fields[index].value
1349
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1350
- if (this.$refs.service_show.data.fields[i].label === '未开票金额') {
1351
- this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_total_money) - Number(residualInvoicing)
1352
- }
1353
- }
1354
- }
1355
- //如果资料验收是否通过和工程验收是否通过为否的时候弹出原因填写框
1356
- if (this.$refs.service_show.data.fields[index].label === '资料验收是否通过') {
1357
- let res = this.$refs.service_show.data.fields[index].value
1358
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1359
- if (this.$refs.service_show.data.fields[i].label === '资料验收不通过原因') {
1360
- if (res === '否') {
1361
- this.$refs.service_show.data.fields[i].hidden = false
1362
- this.$refs.service_show.data.fields[i].required = true
1363
- } else {
1364
- this.$refs.service_show.data.fields[i].hidden = true
1365
- this.$refs.service_show.data.fields[i].required = false
1366
- }
1367
- }
1368
- }
1369
- }
1370
- if (this.$refs.service_show.data.fields[index].label === '工程验收是否通过') {
1371
- let res = this.$refs.service_show.data.fields[index].value
1372
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1373
- if (this.$refs.service_show.data.fields[i].label === '工程验收不通过原因') {
1374
- if (res === '否') {
1375
- this.$refs.service_show.data.fields[i].hidden = false
1376
- this.$refs.service_show.data.fields[i].required = true
1377
- } else {
1378
- this.$refs.service_show.data.fields[i].hidden = true
1379
- this.$refs.service_show.data.fields[i].required = false
1380
- }
1381
- }
1382
- }
1383
- }
1384
- // }
1385
-
1386
- //金额小写得到大写
1387
- if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields.fields[index].label === '收费金额') {
1388
- if (this.$refs.service_show.showadd_fields[index].value || this.$refs.service_show.showadd_fields.fields[index].value) {
1389
- var re = /^[0-9]+.?[0-9]*/
1390
- let temp = this.$refs.service_show.showadd_fields[index].value
1391
- if (temp == "" || isNaN(temp)) {
1392
- this.$showMessage("请输入纯数字")
1393
- this.$refs.service_show.showadd_fields[index].value = 0
1394
- }
1395
- }
1396
- let temp = this.$refs.service_show.showadd_fields[index]
1397
- let value = temp.value
1398
- // let chargeMoney = this.$refs.service_show.showadd_fields[index].value
1399
- for (let i = 0; i < this.$refs.service_show.showadd_fields.fields.length; i++) {
1400
- if (this.$refs.service_show.showadd_fields.fields[i].label === '金额大写') {
1401
- let te = {
1402
- value: this.smalltoBIG(value)
1403
- }
1404
- this.$refs.service_show.showadd_fields[i] = te
1405
- }
1406
- }
1407
- }
1408
-
1409
-
1410
-
1411
- if (this.$refs.service_show.data.fields[index].label === '县/区') {
1412
- let temp = this.$refs.service_show.data.fields[index].value
1413
- console.log('==============================县/区:' + temp)
1414
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1415
- // 控制设置级联
1416
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1417
- if (this.$refs.service_show.data.fields[i].label === '街道名称') {
1418
- if (!this.selectShow){
1419
- this.$refs.service_show.data.fields[i].value = ''
1420
- }
1421
- let street = await this.$resetpost('rs/sql/singleTable', {
1422
- data: {
1423
- tablename: 't_street',
1424
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_pcd='${temp}'`
1425
- }
1426
- }, {resolveMsg: null, rejectMsg: null})
1427
- let streetrs = []
1428
- for (let i = 0; i < street.data.length; i++) {
1429
- let temp = {
1430
- label: street.data[i].f_street,
1431
- value: street.data[i].f_street
1432
- }
1433
- streetrs.push(temp)
1434
- }
1435
-
1436
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1437
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1438
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1439
-
1440
- this.$refs.service_show.update()
1441
- }
1442
- }
1443
- }
1444
- if (this.$refs.service_show.data.fields[index].label === '气表品牌') {
1445
- let temp = this.$refs.service_show.data.fields[index].value
1446
- let meterbrand = await this.$resetpost('rs/sql/singleTable', {
1447
- data: {
1448
- //items: 'f_bill_url,f_url_code',
1449
- tablename: 't_gasbrand',
1450
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${temp}'`
1451
- }
1452
- }, {resolveMsg: null, rejectMsg: null})
1453
- console.log(meterbrand)
1454
- console.log(meterbrand.data)
1455
- let idstring = '('
1456
- idstring += meterbrand.data[0].id
1457
- console.log("idstring第一个" + idstring)
1458
- if (meterbrand.data.length > 1) {
1459
- for (let i = 1; i < meterbrand.data.length; i++) {
1460
- idstring += ',' + meterbrand.data[i].id
1461
- }
1462
- }
1463
- idstring += ')'
1464
- console.log("idstring" + idstring)
1465
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1466
-
1467
- if (this.$refs.service_show.data.fields[i].label === '气表型号') {
1468
- this.$refs.service_show.data.fields[i].value = ''
1469
-
1470
-
1471
- let gasbrand = await this.$resetpost('rs/sql/singleTable', {
1472
- data: {
1473
- tablename: 't_gasmodel',
1474
- condition: ` f_gasbrand_id in ${idstring}`
1475
- }
1476
- }, {resolveMsg: null, rejectMsg: null})
1477
- let brandstr = []
1478
- for (let i = 0; i < gasbrand.data.length; i++) {
1479
- let brand = {
1480
- label: gasbrand.data[i].f_meter_style,
1481
- value: gasbrand.data[i].f_meter_style
1482
- }
1483
- brandstr.push(brand)
1484
- }
1485
-
1486
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...brandstr]
1487
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1488
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1489
-
1490
- this.$refs.service_show.update()
1491
- }
1492
- }
1493
- }
1494
-
1495
-
1496
- if (this.$refs.service_show.data.fields[index].label === '气表型号') {
1497
- let meterstyle= this.$refs.service_show.data.fields[index].value
1498
- let meterbrand = ''
1499
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1500
- if (this.$refs.service_show.data.fields[i].label === '气表品牌') {
1501
- meterbrand = this.$refs.service_show.data.fields[i].value
1502
- }}
1503
-
1504
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1505
-
1506
- if (this.$refs.service_show.data.fields[i].label === '别名') {
1507
- console.log("获取别名")
1508
- this.$refs.service_show.data.fields[i].value = ''
1509
-
1510
- let meterbrandalias = await this.$resetpost('rs/sql/getMeterBrand', {
1511
- data: {
1512
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${meterbrand}' and f_meter_style='${meterstyle}'`
1513
- }
1514
- }, {resolveMsg: null, rejectMsg: null})
1515
-
1516
- let alias = []
1517
- for (let i = 0; i < meterbrandalias.data.length; i++) {
1518
- let brand = {
1519
- label: meterbrandalias.data[i].f_alias,
1520
- value: meterbrandalias.data[i].f_alias
1521
- }
1522
- alias.push(brand)
1523
- }
1524
-
1525
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...alias]
1526
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1527
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1528
-
1529
- this.$refs.service_show.update()
1530
-
1531
- }
1532
- }
1533
-
1534
- }
1535
-
1536
-
1537
- if (this.$refs.service_show.data.fields[index].label === '证件类型') {
1538
- let temp = this.$refs.service_show.data.fields[index].value
1539
- console.log('==============================证件类型:' + temp)
1540
- if (temp === '身份证') {
1541
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1542
- if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1543
- this.$refs.service_show.data.fields[i].required = true
1544
- }
1545
- }
1546
- } else {
1547
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1548
- if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1549
- this.$refs.service_show.data.fields[i].required = false
1550
- }
1551
- }
1552
- }
1553
- }
1554
-
1555
- if (this.$refs.service_show.data.fields[index].label === '是否设计出图') {
1556
- let temp = this.$refs.service_show.data.fields[index].value
1557
-
1558
- if (temp === '是') {
1559
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1560
- if (this.$refs.service_show.data.fields[i].label === '设计派工日期' ||
1561
- this.$refs.service_show.data.fields[i].label === '设计人员'
1562
- ) {
1563
- this.$refs.service_show.data.fields[i].required = true
1564
- }
1565
- }
1566
- } else {
1567
- console.log("不设计出图,进入else")
1568
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1569
- if (this.$refs.service_show.data.fields[i].label === '设计派工日期' || this.$refs.service_show.data.fields[i].label === '设计人员') {
1570
-
1571
- this.$refs.service_show.data.fields[i].required = false
1572
- }
1573
- }
1574
- }
1575
- }
1576
-
1577
- if (this.$refs.service_show.data.fields[index].label === '派工单号') {
1578
- this.$refs.service_show.data.fields[index].value = this.pgd
1579
- }
1580
-
1581
-
1582
- if (this.$refs.service_show.data.fields[index].label === '街道名称') {
1583
- let temp = this.$refs.service_show.data.fields[index].value
1584
- console.log('=============================街道:' + temp)
1585
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1586
- // 控制设置级联
1587
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1588
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1589
- if (!this.selectShow){
1590
- this.$refs.service_show.data.fields[i].value = ''
1591
- }
1592
- let area = await this.$resetpost('rs/sql/singleTable', {
1593
- data: {
1594
- tablename: 't_area',
1595
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${temp}'`
1596
- }
1597
- }, {resolveMsg: null, rejectMsg: null})
1598
- let arears = []
1599
- this.areaall=area.data;
1600
- for (let i = 0; i < area.data.length; i++) {
1601
- let temp = {
1602
- label: area.data[i].f_residential_area,
1603
- value: area.data[i].f_residential_area
1604
- }
1605
- arears.push(temp)
1606
- }
1607
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
1608
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1609
- console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
1610
-
1611
- this.$refs.service_show.update()
1612
-
1613
- }
1614
- }
1615
- }
1616
-
1617
- if(this.$refs.service_show.data.fields[index].label === '小区名称'){
1618
- for (let i = 0; i < this.areaall.length; i++) {
1619
- console.log("aaaaaaaaaaaa")
1620
- if(this.areaall[i].f_residential_area== this.$refs.service_show.data.fields[index].value){
1621
- console.log("abbbbbbbbb")
1622
- for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
1623
- if(this.$refs.service_show.data.fields[j].label === '小区地址'){
1624
- console.log(this.areaall[i].f_area_address)
1625
- this.$refs.service_show.data.fields[j].value=this.areaall[i].f_area_address
1626
- }
1627
- }
1628
- }
1629
- }
1630
- }
1631
- //控制尾款
1632
- if (
1633
- this.$refs.service_show.data.fields[index].label === '合同金额' ||
1634
- this.$refs.service_show.data.fields[index].label === '首付' ||
1635
- this.$refs.service_show.data.fields[index].label === '进度款' ||
1636
- this.$refs.service_show.data.fields[index].label === '尾款'
1637
- ) {
1638
- console.log('即将计算合同金额')
1639
- var cash = 0
1640
- var downpayments = 0
1641
- var tailmoney = 0
1642
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1643
- // 控制设置级联
1644
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1645
- // xxx xx xxx
1646
- if (this.$refs.service_show.data.fields[i].label === '合同金额' && this.$refs.service_show.data.fields[i].value) {
1647
- cash = this.$refs.service_show.data.fields[i].value
1648
- }
1649
- if (this.$refs.service_show.data.fields[i].label === '首付' && this.$refs.service_show.data.fields[i].value) {
1650
- downpayments = this.$refs.service_show.data.fields[i].value
1651
- }
1652
- if (this.$refs.service_show.data.fields[i].label === '进度款' && this.$refs.service_show.data.fields[i].value) {
1653
- tailmoney = this.$refs.service_show.data.fields[i].value
1654
- }
1655
- }
1656
- var a = cash - downpayments
1657
- // 数据计算完毕得到尾款
1658
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1659
- if (this.$refs.service_show.data.fields[i].label === '尾款') {
1660
- if (cash === downpayments) {
1661
- this.$refs.service_show.data.fields[i].value = 0
1662
- } else {
1663
- this.$refs.service_show.data.fields[i].value = (cash - downpayments - tailmoney)
1664
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1665
- }
1666
- }
1667
- if (this.$refs.service_show.data.fields[i].label === '首付') {
1668
- if (a < 0) {
1669
- this.$showMessage("首付款数额过大")
1670
- downpayments = 0
1671
- this.$refs.service_show.data.fields[i].value = 0
1672
- }
1673
- }
1674
-
1675
- if (this.$refs.service_show.data.fields[i].label === '进度款') {
1676
-
1677
- if (cash === downpayments) {
1678
- tailmoney = 0
1679
- this.$refs.service_show.data.fields[i].value = 0
1680
- this.$refs.service_show.data.fields[i].readonly = true
1681
- } else {
1682
- this.$refs.service_show.data.fields[i].readonly = false
1683
- tailmoney = this.$refs.service_show.data.fields[i].value
1684
- }
1685
- if (tailmoney > a) {
1686
- this.$showMessage("进度款数额过大")
1687
- tailmoney = 0
1688
- this.$refs.service_show.data.fields[i].value = 0
1689
- }
1690
- }
1691
- }
1692
- }
1693
-
1694
-
1695
- // 合成地址
1696
- if (
1697
- this.$refs.service_show.data.fields[index].label === '县/区' ||
1698
- this.$refs.service_show.data.fields[index].label === '街道名称' ||
1699
- this.$refs.service_show.data.fields[index].label === '小区名称' ||
1700
- this.$refs.service_show.data.fields[index].label === '楼号' ||
1701
- this.$refs.service_show.data.fields[index].label === '单元号' ||
1702
- this.$refs.service_show.data.fields[index].label === '楼层' ||
1703
- this.$refs.service_show.data.fields[index].label === '门牌号'
1704
- ) {
1705
- console.log('即将合成地址')
1706
- var address = ''
1707
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1708
- // 控制设置级联
1709
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1710
- // xxx xx xxx
1711
- if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
1712
- address += this.$refs.service_show.data.fields[i].value
1713
- if (address.indexOf('湖北省')!=-1){
1714
- address = address.replace('湖北省','')
1715
- }
1716
- }
1717
- if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
1718
- address += this.$refs.service_show.data.fields[i].value
1719
- }
1720
- if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
1721
- address += this.$refs.service_show.data.fields[i].value
1722
- }
1723
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1724
- address += this.$refs.service_show.data.fields[i].value
1725
- }
1726
- /* if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1727
- address += '栋'
1728
- } */
1729
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1730
- address += '-' +this.$refs.service_show.data.fields[i].value
1731
- }
1732
- /* if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1733
- address += '单元'
1734
- } */
1735
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1736
- address += '-' +this.$refs.service_show.data.fields[i].value
1737
- }
1738
- /* if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1739
- address += '层'
1740
- } */
1741
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1742
- address += '-' +this.$refs.service_show.data.fields[i].value
1743
- }
1744
- /* if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1745
- address += '室'
1746
- } */
1747
-
1748
- }
1749
- console.log('获取到的address=>' + address)
1750
- // 数据获取完毕时放入地址text
1751
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1752
- if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
1753
- this.$refs.service_show.data.fields[i].value = address
1754
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1755
- }
1756
- }
1757
- }
1758
- // 开户费+材料费+人工费+设备安装费=合计
1759
- if (
1760
- this.$refs.service_show.data.fields[index].label === '工程安装费' ||
1761
- this.$refs.service_show.data.fields[index].label === '材料费' ||
1762
- this.$refs.service_show.data.fields[index].label === '人工费'
1763
- ) {
1764
- console.log('即将合成价格')
1765
- let a1 = 0
1766
- let b1 = 0
1767
- let c1 = 0
1768
- let fee = 0
1769
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1770
- // 控制设置级联
1771
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1772
- // xxx xx xxx
1773
- if (this.$refs.service_show.data.fields[i].label === '工程安装费' && this.$refs.service_show.data.fields[i].value) {
1774
- a1 = this.$refs.service_show.data.fields[i].value
1775
- }
1776
- if (this.$refs.service_show.data.fields[i].label === '材料费' && this.$refs.service_show.data.fields[i].value) {
1777
- b1= this.$refs.service_show.data.fields[i].value
1778
- }
1779
- if (this.$refs.service_show.data.fields[i].label === '人工费' && this.$refs.service_show.data.fields[i].value) {
1780
- c1 = this.$refs.service_show.data.fields[i].value
1781
- }
1782
- fee=parseFloat(parseFloat(a1) + parseFloat(b1)+parseFloat(c1)).toFixed(2)
1783
- // 数据获取完毕时放入地址text
1784
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1785
- if (this.$refs.service_show.data.fields[i].label === '费用合计'||this.$refs.service_show.data.fields[i].label === '未结总金额') {
1786
- this.$refs.service_show.data.fields[i].value =fee
1787
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1788
- }
1789
- }
1790
- }
1791
- }
1792
- if (this.$refs.service_show.data.fields[index].label == '用户类型'){
1793
- if(this.$refs.service_show.data.fields[index].value == '非民用'){
1794
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1795
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1796
- this.$refs.service_show.data.fields[i].required=false;
1797
- }
1798
- if (this.$refs.service_show.data.fields[i].label === '地址') {
1799
- this.$refs.service_show.data.fields[i].readonly=false;
1800
- this.$refs.service_show.data.fields[i].disabled=false;
1801
- }
1802
- }
1803
- }else{
1804
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1805
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1806
- this.$refs.service_show.data.fields[i].required=true;
1807
- }
1808
- }
1809
- }
1810
- }
1811
-
1812
- if (this.$refs.service_show.data.fields[index].label === '施工是否完成') {
1813
- let temp = this.$refs.service_show.data.fields[index].value
1814
- console.log('==============================施工是否完成:' + temp)
1815
- if (temp === '是') {
1816
- let f_project_material = ''
1817
- if (this.$refs.service_show.data.defname === '施工') {
1818
- let http = new HttpResetClass()
1819
- let data = {
1820
- f_process_id: this.$refs.service_show.data.f_process_id,
1821
- defname: this.$refs.service_show.data.defname
1822
- }
1823
- let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1824
- {resolveMsg: null, rejectMsg: null})
1825
- res.data.forEach(item =>{
1826
- f_project_material += item.fusetype + ','
1827
- })
1828
- }
1829
-
1830
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1831
- if (this.$refs.service_show.data.fields[i].label === '施工已上传文件') {
1832
- this.$refs.service_show.data.fields[i].value = f_project_material
1833
- }
1834
- }
1835
- }
1836
- }
1837
-
1838
- if (this.$refs.service_show.data.fields[index].label === '验收是否完成') {
1839
- let temp = this.$refs.service_show.data.fields[index].value
1840
- console.log('==============================验收是否完成:' + temp)
1841
- if (temp === '是') {
1842
- let f_iscomplete_information = ''
1843
- if (this.$refs.service_show.data.defname === '施工验收') {
1844
- let http = new HttpResetClass()
1845
- let data = {
1846
- f_process_id: this.$refs.service_show.data.f_process_id,
1847
- defname: this.$refs.service_show.data.defname
1848
- }
1849
- let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1850
- {resolveMsg: null, rejectMsg: null})
1851
- res.data.forEach(item =>{
1852
- f_iscomplete_information += item.fusetype + ','
1853
- })
1854
- }
1855
-
1856
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1857
- if (this.$refs.service_show.data.fields[i].label === '验收已上传文件') {
1858
- this.$refs.service_show.data.fields[i].value = f_iscomplete_information
1859
- }
1860
- }
1861
- }
1862
- }
1863
- if (this.$refs.service_show.data.fields[index].label === '业务类型'){
1864
- if(this.$refs.service_show.data.fields[index].value === '改管'){
1865
- for (let i = 0; i < this.$refs.service_show.data.components.length; i++){
1866
- if (this.$refs.service_show.data.components[i].name === 'select-userinfo'){
1867
- this.$refs.service_show.data.components[i].device = 'pc'
1868
- }
1869
- }
1870
- }else{
1871
- for (let i = 0; i < this.$refs.service_show.data.components.length; i++){
1872
- if (this.$refs.service_show.data.components[i].name === 'select-userinfo'){
1873
- this.$refs.service_show.data.components[i].device = 'hidden'
1874
- }
1875
- }
1876
- }
1877
- }
1878
-
1879
- },
1880
- // onetomany模态框监听事件
1881
- async 'select_cascade_modal'(i,j){
1882
- if(this.data.onetomany[i].tables[0]=='t_apply_construct_balance'){
1883
- if(this.data.onetomany[i].fields[j].label == '第三施工方'){
1884
- for(let k =0;k<this.data.onetomany[i].fields.length;k++){
1885
-
1886
- if(this.data.onetomany[i].fields[k].label.includes('当前累计结算比例')){
1887
- let sum = 0
1888
- for(let p =0;p<this.$refs.service_show.model.rows[i].length;p++){
1889
- if(this.$refs.service_show.model.rows[i][p].f_construct_company == this.$refs.service_show.showadd_fields.fields[j].value){
1890
- sum+=Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1891
- sum+=Number(this.$refs.service_show.model.rows[i][p].f_balance_scale)
1892
- }
1893
- }
1894
- if(this.$refs.service_show.model.rows[i].length==0){
1895
- sum = Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1896
- }
1897
- this.$refs.service_show.update_showadd_fields_value(k,sum)
1898
- }
1899
- }
1900
- }
1901
- }
1902
- },
1903
- async 'onetomanyevent'(datas) {
1904
- // console.log(`onetomany=======>${JSON.stringify(datas)}`)
1905
-
1906
- for (let i = 0; i < datas.rows.length; i++) {
1907
- datas.rows[i]['f_process_id'] = this.selectdata.f_process_id
1908
- datas.rows[i]['f_apply_num'] = this.selectdata.f_apply_num
1909
- datas.rows[i]['f_filiale'] = this.$login.f.f_fengongsi
1910
- datas.rows[i]['f_parentname'] = this.$login.f.f_parentname
1911
- datas.rows[i]['f_operator'] = this.$login.f.name
1912
- }
1913
- let http = new HttpResetClass()
1914
- await http.load('POST', 'rs/logic/saveentity', datas, {resolveMsg: null, rejectMsg: 'search查询部门下所有人失败'})
1915
- }
1916
- ,
1917
- // 获取view层button事件/
1918
- async 'button'(model) {
1919
- console.log("button事件接收参数:", model)
1920
- if (this.data.defname==='踏勘'||this.data.defname==='施工'||this.data.defname==='施工验收'){
1921
- if (model.button.button_name === '终止'){
1922
- this.stop_show=true
1923
- return
1924
- }
1925
- }
1926
- /* if (this.data.defname === '通气转单'){
1927
- if (model.button.button_name === '散户报装'){
1928
- this.addactive('报装申请')
1929
- }
1930
- if (model.button.button_name === '集体报装'){
1931
- this.addactive('集体报装申请')
1932
- }
1933
- setTimeout(() => {
1934
-
1935
- }, 200)
1936
- }*/
1937
-
1938
- // 点击重置按钮就重置数据
1939
- if (model.button.button_name === '重置') {
1940
- this.refurbish()
1941
- return
1942
- }
1943
- if (model.button.button_name === '打印表1' || model.button.button_name === '打印表2') {
1944
- this.printoverview(model.button.button_name)
1945
- return
1946
- }
1947
- if (model.button.button_name === '打印回单') {
1948
- this.printReceipt(model)
1949
- return
1950
- }
1951
- var operate = ''
1952
- // 判断当前按钮是否为特殊业务,即子流程提交或者分发
1953
- if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '子流程提交') {
1954
- operate = '子流程提交'
1955
- }
1956
- if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '合同信息') {
1957
- model.f_budget_money = model.f_contract_money
1958
- //未结算总金额=合计
1959
- model.f_unaccounts_money = model.f_total_cost
1960
- model.f_cumulative_money = 0
1961
- model.f_cumulative_invoicing = 0
1962
- model.f_additional_payment = 0
1963
- model.f_residual_invoicing = model.f_contract_money
1964
- }
1965
- if (model.button.button_name === '下发') {
1966
- if (model.button && model.button.button_event === '分发') {
1967
- operate = '分发'
1968
- }
1969
- let array = this.$login.f.rolesnames.split(',')
1970
- if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1971
- model.f_survey_name = model.button.button_fields.f_apply_kefu_employee
1972
- }
1973
- }
1974
-
1975
- if (model.button.button_name == '提交' && model.button.button_person && model.button.button_person.button_event === '获取之前被下发人' && model.button.button_person.button_person_field) {
1976
- model.button.button_name = '下发'
1977
- model.button.button_fields = {}
1978
- console.log(model.button.button_person.button_person_field)
1979
- console.log(this.selectdata[model.button.button_person.button_person_field])
1980
- console.log(this.selectdata)
1981
- if(this.selectdata[model.button.button_person.button_person_field].startsWith('{')){
1982
- let temp= JSON.parse(this.selectdata[model.button.button_person.button_person_field])
1983
- model.button.button_fields[model.button.button_person.button_person_field] = temp.id
1984
- }else{
1985
- model.button.button_fields[model.button.button_person.button_person_field] = this.selectdata[model.button.button_person.button_person_field]
1986
- }
1987
-
1988
- }
1989
- if (model.button.button_name === '提交') {
1990
- // for (let i = 0; i < this.show_data.fields.length; i++) {
1991
- // if (this.show_data.fields[i].label === '收费项目') {
1992
- // let yuanXiang = this.show_data.fields[i].value
1993
- // if (yuanXiang != '' && yuanXiang != null) {
1994
- // for (let i = 0; i < yuanXiang.length; i++) {
1995
- // this.xia += yuanXiang[i] + '-'
1996
- // }
1997
- // let idx = this.xia.lastIndexOf("-");
1998
- // this.xiangmu = this.xia.substring(0,idx)
1999
- // }
2000
- // model.f_charge_items = this.xiangmu
2001
- // }
2002
- // }
2003
- var flag = false
2004
- if (this.data.defname == '合同审核') {
2005
- flag = true
2006
- let http = new HttpResetClass()
2007
- let data = {
2008
- tablename: 't_singlevalue',
2009
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
2010
- }
2011
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
2012
- resolveMsg: null,
2013
- rejectMsg: "获取合同编号失败"
2014
- })
2015
- if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
2016
- this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
2017
- return
2018
- }
2019
- }
2020
-
2021
- }
2022
- console.log('本次点击button执行的操作是=>' + operate)
2023
- model = Object.assign({}, this.selectdata, model)
2024
- model.f_sub_state = '未完工'
2025
- if (this.data.defname === '通气转单' && model.button.button_name === '提交'){
2026
- model.f_sub_state = '完工'
2027
- }
2028
- let http = new HttpResetClass()
2029
- var url
2030
- var requestData = {
2031
- tables: this.data.tables,
2032
- start_activity: this.$workflow_vue.start_activity,
2033
- model: model,
2034
- loginUser: this.$login.f
2035
- }
2036
- if (operate != '') {
2037
- // 特殊操作走特殊logic业务处理
2038
- url = 'rs/logic/SubprocessService'
2039
- requestData = {
2040
- tables: this.data.tables, model: model
2041
- }
2042
- } else if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步合并处理') {
2043
- url = 'rs/logic/branchsyncprocess'
2044
- requestData = {
2045
- tables: this.data.tables, model: model
2046
- }
2047
- } else {
2048
- if(requestData.model.f_stair_price_name === ''|| requestData.model.f_stair_price_name === null|| requestData.model.f_stair_price_name === undefined){
2049
- requestData.model.f_stair_price_name = this.selectdata.f_stair_price_name
2050
- }
2051
- console.log("流程下一步",requestData.model.f_stair_price_name)
2052
- // 下发,提交,保存,退回通用业务后台处理logic
2053
- url = 'rs/logic/ApplyProductService'
2054
- requestData = {
2055
- tables: this.data.tables, model: model
2056
- }
2057
- }
2058
- if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
2059
- this.apply_show=true
2060
- this.models2 = model
2061
- return
2062
- }
2063
-
2064
- requestData.start_activity = this.$workflow_vue.start_activity
2065
- requestData.loginUser = this.$login.f
2066
- requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
2067
-
2068
- console.log('即将发送请求url=>' + url + ',参数=>' + JSON.stringify(requestData))
2069
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
2070
- console.log("service处理完成返回数据:", JSON.stringify(res.data))
2071
- if(res.data.msg=="地址重复,请修改后重新提交"){
2072
- this.$showMessage(res.data.msg)
2073
- }
2074
- if (res.data.code == 200) {
2075
- // flag 为合同编号更新标志
2076
- if (flag) {
2077
- let http = new HttpResetClass()
2078
- let data = {
2079
- tablename: 't_singlevalue',
2080
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
2081
- value: (Number(this.contract) + 1) + ''
2082
- }
2083
- await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
2084
- resolveMsg: null,
2085
- rejectMsg: "获取合同编号更新失败"
2086
- })
2087
- }
2088
- this.showview = false
2089
- // 特殊处理
2090
- this.special(model)
2091
- this.$dispatch('close')
2092
- this.initializtion()
2093
- } else {
2094
- if (res.data.msg) {
2095
- this.$showMessage(res.data.msg)
2096
- }
2097
- }
2098
- /*
2099
- if(this.selectdata.defname =='报装申请'|| this.selectdata.defname =='现场勘查'|| this.selectdata.defname =='验收'||this.selectdata.defname =='集体报装申请'||this.selectdata.defname =='现场勘查人员分配'||this.selectdata.defname =='安装通气' ){
2100
- console.log("defname======================================",this.selectdata.defname)
2101
- let http1 = new HttpResetClass();
2102
- let sendtime = null;
2103
- let finishtime = null;
2104
- let f_department = null;
2105
- let f_process_id = null;
2106
- let data1 = {
2107
- f_process_id: this.selectdata.f_process_id,
2108
- defname : this.selectdata.defname
2109
- }
2110
- console.log("res1=======================================",data1)
2111
- await http1.load('POST', 'rs/logic/getTime', {data:data1}).then((res) => {
2112
- console.log("objk===>",res.data)
2113
- sendtime=res.data.getUserid[0].sendtime;
2114
- finishtime=res.data.getUserid[0].finishtime;
2115
- f_department=res.data.resdata[0].name;
2116
- console.log("objk===>")
2117
- })
2118
-
2119
- let data2 = {
2120
- department:f_department,
2121
- resourceCatalog:this.selectdata.defname,
2122
- sqzt:model.f_user_name,
2123
- code:model.f_idnumber,
2124
- sqsj:sendtime,
2125
- slsj:sendtime,
2126
- bjsj:finishtime,
2127
- blcb:0,
2128
- sqclsl:0,
2129
- sqclmc:'',
2130
- gdlsh:'',
2131
- sbdz:model.f_address,
2132
- sldw:'鄂州市安泰天然气有限责任公司',
2133
- sfyj:'',
2134
- gxzq:'',
2135
- type:this.selectdata.defname
2136
- }
2137
- console.log("====================================",data2)
2138
- await http1.load('POST', 'rs/logic/getPost', {data:data2})
2139
- }
2140
- */
2141
- }
2142
- ,
2143
- async 'onetomanydelete'(i, j) {
2144
- let http = new HttpResetClass()
2145
- let data = {
2146
- tables: this.show_data.onetomany[i].tables,
2147
- row: this.$refs.service_show.model.rows[i][j]
2148
- }
2149
- await http.load('POST', 'rs/logic/applyDeleteValue', {data: data}, {
2150
- resolveMsg: null,
2151
- rejectMsg: 'onetomanydelete失败'
2152
- }).then(() => {
2153
- this.$dispatch('selfsearch')
2154
- this.$refs.service_show.model.rows[i].splice(j, 1)
2155
- })
2156
- }
2157
- ,
2158
- //获取view层confirm事件
2159
- async 'confirm'(tables, row, showadd_index, j) {
2160
- var _this = this
2161
- for (let i = 0; i < tables.length; i++) {
2162
- let datas = {
2163
- tables: tables,
2164
- row: row
2165
- }
2166
- console.log("看看datas")
2167
- console.log(datas)
2168
- console.log("看看showadd_index")
2169
- console.log(showadd_index)
2170
- datas.row['f_process_id'] = this.selectdata.f_process_id
2171
- datas.row['f_apply_num'] = this.selectdata.f_apply_num
2172
- datas.row['f_filiale'] = this.selectdata.f_filiale
2173
- let http = new HttpResetClass()
2174
- let sellid = ''
2175
- let billtype = datas.row['f_bill_style']
2176
- if (tables[i] == 't_charge_record') {
2177
- await this.loadbuyer()
2178
- if (this.buyerinfo.rows.length < 1 && billtype === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
2179
- this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
2180
- this.$refs.service_show.model.rows[showadd_index].splice(j, 1)
2181
- this.$refs.service_show.initializtion()
2182
- return
2183
- }
2184
- datas.row.f_charging_status = '有效'
2185
- datas.row.f_is_correct = '否'
2186
- datas.row.f_charge_collectors = this.$login.f.name
2187
- datas.row.f_amount_words=this.smalltoBIG(datas.row.f_charge_money)
2188
- await http.load('POST', 'rs/logic/applycharge', datas, {
2189
- resolveMsg: null,
2190
- rejectMsg: '收费保存失败'
2191
- }).then((res) => {
2192
- sellid = JSON.parse(res.data.sellid).id
2193
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2194
- //
2195
- // if (this.$refs.service_show.data.fields[i].label == '累计缴费金额') {
2196
- // this.$refs.service_show.data.fields[i].value = res.data.f_cumulative_money
2197
- // }
2198
- //
2199
- // if (this.$refs.service_show.data.fields[i].label == '未结总金额') {
2200
- // this.$refs.service_show.data.fields[i].value = res.data.f_unaccounts_money
2201
- // }
2202
-
2203
- }
2204
- let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2205
- temp.id = sellid
2206
- _this.$refs.service_show.model.rows[showadd_index][j] = temp
2207
- })
2208
- if (this.$appdata.getSingleValue('默认打印票据') && this.$appdata.getSingleValue('默认打印票据') === '是') {
2209
- this.$showMessage('是否打票据', ['confirm', 'cancel']).then((res) => {
2210
- if (res === 'confirm') {
2211
- console.log('打印票据')
2212
- if (billtype === '增值税电子发票') {
2213
- this.selectsellid = sellid
2214
- this.showbuyerinfo = true
2215
- } else {
2216
- this.printbill(sellid)
2217
- }
2218
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2219
- if (this.$refs.service_show.data.fields[i].label == '累计开票金额') {
2220
- console.log("计算累计开票金额")
2221
- this.$refs.service_show.data.fields[i].value = parseInt(this.$refs.service_show.data.fields[i].value) + this.datas.row.f_cumulative_invoicing
2222
- }
2223
- }
2224
- }
2225
- })
2226
- }
2227
- // 刷新列表数据
2228
- console.log("刷新一下")
2229
- this.$dispatch('selfsearch')
2230
- console.log("刷新完成")
2231
- } else {
2232
- await http.load('POST', 'rs/logic/saveentity', datas, {
2233
- resolveMsg: null,
2234
- rejectMsg: 'onetomany保存失败'
2235
- }).then((res) => {
2236
- // 刷新列表数据
2237
- this.$dispatch('selfsearch')
2238
- let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2239
- temp.id = res.data.id
2240
- _this.$refs.service_show.model.rows[showadd_index][j] = temp
2241
- })
2242
- }
2243
- }
2244
- },
2245
- 'selectUserinfo' (row) {
2246
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2247
- if (this.$refs.service_show.data.fields[i].label === '联系人') {
2248
- this.$refs.service_show.data.fields[i].value = row.f_user_name
2249
- }else if(this.$refs.service_show.data.fields[i].label === '电话号码'){
2250
- this.$refs.service_show.data.fields[i].value = row.f_user_phone
2251
- }else if(this.$refs.service_show.data.fields[i].label === '用户类型'){
2252
- this.$refs.service_show.data.fields[i].value = row.f_user_type
2253
- }else if(this.$refs.service_show.data.fields[i].label === '县/区'){
2254
- this.$refs.service_show.data.fields[i].value = row.f_area
2255
- }else if(this.$refs.service_show.data.fields[i].label === '街道名称'){
2256
- this.$refs.service_show.data.fields[i].value = row.f_street
2257
- }else if(this.$refs.service_show.data.fields[i].label === '小区名称'){
2258
- this.$refs.service_show.data.fields[i].value = row.f_residential_area
2259
- }else if(this.$refs.service_show.data.fields[i].label === '楼号'){
2260
- this.$refs.service_show.data.fields[i].value = row.f_building
2261
- }else if(this.$refs.service_show.data.fields[i].label === '单元号'){
2262
- this.$refs.service_show.data.fields[i].value = row.f_unit
2263
- }else if(this.$refs.service_show.data.fields[i].label === '楼层'){
2264
- this.$refs.service_show.data.fields[i].value = row.f_floor
2265
- }else if(this.$refs.service_show.data.fields[i].label === '门牌号'){
2266
- this.$refs.service_show.data.fields[i].value = row.f_room
2267
- }else if(this.$refs.service_show.data.fields[i].label === '气表品牌'){
2268
- this.$refs.service_show.data.fields[i].value = row.f_meter_brand
2269
- }else if(this.$refs.service_show.data.fields[i].label === '气表型号'){
2270
- this.$refs.service_show.data.fields[i].value = row.f_meter_style
2271
- }else if(this.$refs.service_show.data.fields[i].label === '表号'){
2272
- this.$refs.service_show.data.fields[i].value = row.f_meternumber
2273
- }else if(this.$refs.service_show.data.fields[i].label === '左右表'){
2274
- this.$refs.service_show.data.fields[i].value = row.f_aroundmeter
2275
- }
2276
- }
2277
- this.selectShow = true
2278
- console.log("当前数据",JSON.stringify(this.$refs.service_show.data))
2279
- }
2280
- }
2281
- }
2282
- </script>
1
+ <template>
2
+ <show-back-reason v-if="selectdata.f_back_reason && selectdata.f_back_reason!=''"
3
+ :data="show_data"></show-back-reason>
4
+ <!--<gas-stop v-if="selectdata.defname == '停气碰口'"></gas-stop>-->
5
+ <material-message v-if="selectdata.defname=='材料导入'" v-ref:material
6
+ :selectdata="selectdata"
7
+ :state="2"
8
+ :edit="true"></material-message>
9
+ <material-message v-if="selectdata.defname=='材料审核'" v-ref:material
10
+ :selectdata="selectdata"
11
+ :state="1"
12
+ :edit="true"></material-message>
13
+ <receive-batch v-if="selectdata.defname == '派工单'" :selectdata="selectdata" v-ref:receivebatch></receive-batch>
14
+ <project-settlement v-if="selectdata.defname == '工程结算'" :selectdata="selectdata"></project-settlement>
15
+ <!-- <installfee :infee="selectdata" :showfee='true' v-if="selectdata.defname == '通气条件确认'"></installfee>-->
16
+ <buyer-message v-ref:buyermessagev :selectdata="selectdata" :state="1" v-if="selectdata.defname == '收费'" ></buyer-message>
17
+ <!-- <installfee :infee="selectdata" v-if="selectdata.defname == '收费'"></installfee>-->
18
+ <service-view v-ref:service_show :data="show_data" v-if="showview" :is_show_datacheck="datacheck"></service-view>
19
+
20
+ <modal :show.sync="showbuyerinfo" v-ref:modal backdrop="false">
21
+ <header slot="modal-header" class="modal-header">
22
+ <button type="button" class="close" @click="closebuyerinfo"><span>&times;</span></button>
23
+ <h4 class="modal-title">打印电子发票,请请选择购货方信息</h4>
24
+ </header>
25
+ <article slot="modal-body" class="modal-body">
26
+ <div v-if="showbuyerinfo">
27
+ <div class="col-sm-12 span recordTable" style="margin-top: 10px;min-height: 350px">
28
+ <partial-view v-ref:single-load>
29
+ <data-grid :model="buyerinfo" v-ref:grid>
30
+ <template partial='head'>
31
+ <tr>
32
+ <th>序号</th>
33
+ <th>购货方名称</th>
34
+ <th>购货方纳税人识别号</th>
35
+ <th>购货方地址、电话</th>
36
+ <th>购货方开户行及账号</th>
37
+ <th>购货方电子邮箱</th>
38
+ <th>操作</th>
39
+ </tr>
40
+ </template>
41
+ <template partial='body'>
42
+ <td style="text-align: center">{{$index+1}}</td>
43
+ <td style="text-align: center">{{row.f_buyer_name}}</td>
44
+ <td style="text-align: center">{{row.f_buyer_identify}}</td>
45
+ <td style="text-align: center">{{row.f_buyer_addphone}}</td>
46
+ <td style="text-align: center">{{row.f_buyer_bank}}</td>
47
+ <td style="text-align: center">{{row.f_buyer_email}}</td>
48
+ <td style="text-align: center">
49
+ <button type="button" class="btn btn-success"
50
+ @click='$parent.$parent.$parent.$parent.confirmbuyerinfo(row)'>选择
51
+ </button>
52
+ </td>
53
+ </template>
54
+ </data-grid>
55
+ </partial-view>
56
+ </div>
57
+ </div>
58
+ </article>
59
+ <footer slot="modal-footer" class="modal-footer">
60
+ <button v-show="showbuyerinfo" type="button" class="btn btn-default" @click='closebuyerinfo'>取消</button>
61
+ </footer>
62
+ </modal>
63
+
64
+ <apply-accept-bill :show="acceptprint" :bill-url='acceptUrl' v-on:toggle="close" :data='row' :billdata="printData" v-ref:acceptbill @closeaccept="closeAccept"></apply-accept-bill>
65
+ <!--打印报表html-->
66
+ <!-- <div v-show="false">-->
67
+ <!-- <div class="row" style="display: flex;justify-content: center;" id='bill-fee'>-->
68
+ <!-- {{{bill}}}-->
69
+ <!-- </div>-->
70
+ <!-- <report-print id='bill-fee' top='15mm' left='5mm' width='90%' height='70%' :showbtn="false" preview="true"-->
71
+ <!-- v-ref:reportprint></report-print>-->
72
+ <!-- </div>-->
73
+ <modal :show.sync="stop_show" v-ref:modal stop_show="false">
74
+ <header slot="modal-header" class="modal-header">
75
+ <button type="button" class="close" @click="closeback"><span>&times;</span></button>
76
+ <h4 class="modal-title">终止备注</h4>
77
+ </header>
78
+ <article slot="modal-body" class="modal-body">
79
+ <div class="from-group">
80
+ <input type="text" class="form-control" v-model="models.f_stop_remarks"/>
81
+ </div>
82
+ </article>
83
+ <footer slot="modal-footer" class="modal-footer">
84
+ <button v-show="stop_show" type="button" class="btn btn-default" @click='stopapplys'>确认</button>
85
+ </footer>
86
+ </modal>
87
+ <modal :show.sync="apply_show" v-ref:modal apply_show="false" >
88
+ <header slot="modal-header" class="modal-header">
89
+ <button type="button" class="close" @click="closeapply"><span>&times;</span></button>
90
+ <h4 class="modal-title">转单报建</h4>
91
+ </header>
92
+ <article slot="modal-body" class="modal-body">
93
+ <div class="from-group">
94
+ <v-select style="min-width: 80%;"
95
+ placeholder='请选择'
96
+ :options="applytypes"
97
+ :search="false"
98
+ v-model="apply_type"
99
+ :value.sync="apply_type"
100
+ close-on-select>
101
+ </v-select>
102
+ </div>
103
+ </article>
104
+ <footer slot="modal-footer" class="modal-footer">
105
+ <button v-show="apply_show" type="button" class="btn btn-default" @click='addactive()'>确认</button>
106
+ </footer>
107
+ </modal>
108
+ <!--小区工程移交概况表-->
109
+ <modal :show.sync="overviewprint" v-ref:modal :large="true" :backdrop="false" title="打印预览">
110
+ <header slot="modal-header" class="modal-header">
111
+ <button type="button" class="close" @click="overviewprint = !overviewprint"><span>&times;</span></button>
112
+ <h4 class="modal-title">打印预览</h4>
113
+ </header>
114
+ <article slot="modal-body" class="modal-body clearfix">
115
+ <overview :report="show_data" :overviewname="overviewname" v-ref:print></overview>
116
+ </article>
117
+ <footer slot="modal-footer" class="modal-footer">
118
+ <button type="button" class="btn btn-primary" @click="print()">打印</button>
119
+ </footer>
120
+ </modal>
121
+ </template>
122
+ <script>
123
+ import Vue from 'vue'
124
+ import {HttpResetClass} from 'vue-client'
125
+ import * as Util from '../../../../Util'
126
+ // import AppData from 'stores/AppData'
127
+ // Date格式化
128
+ Date.prototype.Format = function (fmt) {
129
+ var o = {
130
+ "M+": this.getMonth() + 1, //月份
131
+ "d+": this.getDate(), //日
132
+ "H+": this.getHours(), //小时
133
+ "m+": this.getMinutes(), //分
134
+ "s+": this.getSeconds(), //秒
135
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
136
+ "S": this.getMilliseconds() //毫秒
137
+ };
138
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
139
+ for (var k in o)
140
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
141
+ return fmt;
142
+ }
143
+
144
+ export default {
145
+ title: '报建流程业务控制层',
146
+ props: ['selectdata'],
147
+ data() {
148
+ return {
149
+ acceptprint: false,
150
+ acceptUrl: 'rs/report/printReceiptbill',
151
+ printData:{
152
+ f_user_name: '',
153
+ f_address: '',
154
+ f_user_phone:'',
155
+ f_work_type: '新报装',
156
+ f_news:'身份证'
157
+ },
158
+ data: null, // 数据库数据,json配置文件数据的数据集合
159
+ json_datas: null, // Json配置文件集合
160
+ showview: false, // 控制显示service-view组件
161
+ show_data: null, // 给view层显示的数据
162
+ department_search: [], // 当前部门下所有人
163
+ contract: null, // 单值表合同编号记录
164
+ technologist: [], // 技术人员 角色下的人
165
+ price: 0,
166
+ xiangmu:'',
167
+ xia:'',
168
+ cost: 0,
169
+ number: 0,
170
+ pgd: '',
171
+ showbuyerinfo: false, // 新增购货方信息模态框开关
172
+ selectsellid: null, //需要打票收费id
173
+ buyerinfo: {
174
+ id: '',
175
+ f_buyer_name: '',
176
+ f_buyer_identify: '',
177
+ f_buyer_addphone: '',
178
+ f_buyer_bank: '',
179
+ f_buyer_email: '',
180
+ rows: [] // 购货方信息
181
+ },
182
+ bill: '',
183
+ areaall:[],
184
+ stop_show:false, // 终止备注开关
185
+ apply_show:false, // 转单报建开关
186
+ apply_type:'',
187
+ applytypes:[{label:"散户报装",value:"报装申请"},{label:"集体报装",value:"集体报装申请"}],// 报建类型
188
+ models: {
189
+ f_date: Util.toStandardTimeString(),
190
+ f_department: this.$login.f.f_parentname,
191
+ f_operator: this.$login.f.name,
192
+ f_filiale: this.$login.f.f_fengongsi
193
+ },
194
+ models2:{},
195
+ selectShow: false,
196
+ overviewprint:false,
197
+ overviewname:''
198
+ }
199
+ },
200
+ methods: {
201
+ /*
202
+ ============================================收费临时使用
203
+ */
204
+ // 转到报建
205
+ async addactive(){
206
+ let http = new HttpResetClass()
207
+ let model = this.models2
208
+ let url = 'rs/logic/ApplyProductService'
209
+ let requestData = {
210
+ tables: this.data.tables, model: model
211
+ }
212
+ requestData.start_activity = '踏勘'
213
+ requestData.loginUser = this.$login.f
214
+ requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
215
+ let res1 = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
216
+ this.selectdata.applyid = this.selectdata.id
217
+ // this.$resetpost('rs/logic/stopapply', {data: this.selectdata})
218
+ console.log(this.apply_type[0])
219
+ this.$workflow_vue.start_activity = this.apply_type[0]
220
+ let res = await http.load('POST','rs/logic/ApplyGetProcessID',{data:{filename:this.$workflow_vue.workflow_xmlfilename,start_activity:this.$workflow_vue.start_activity}}, {resolveMsg: null, rejectMsg: '获取流程ID失败,请联系开发人员'})
221
+ let data = {
222
+ defname: this.$workflow_vue.start_activity,
223
+ f_process_id: res.data.f_process_id,
224
+ f_apply_date: Util.toStandardTimeString(),
225
+ f_product_id: res.data.f_product_id,
226
+ start_activity:this.$workflow_vue.start_activity,
227
+ f_user_type:this.models2.f_user_type,
228
+ f_user_name:this.models2.f_user_name,
229
+ f_phone:this.models2.f_phone,
230
+ f_area:this.models2.f_area,
231
+ f_street:this.models2.f_street,
232
+ f_residential_area:this.models2.f_residential_area,
233
+ f_building:this.models2.f_building,
234
+ f_unit:this.models2.f_unit,
235
+ f_floor:this.models2.f_floor,
236
+ f_room:this.models2.f_room,
237
+ f_address:this.models2.f_address,
238
+ f_idnumber:this.models2.f_social_credit_code,
239
+ f_apply_source:this.models2.f_apply_source,
240
+ f_sub_state:'未完工',
241
+ f_project_number : res1.data.f_apply_num,
242
+ user:{
243
+ id: this.$login.f.id,
244
+ name: this.$login.f.name,
245
+ ename: this.$login.f.ename
246
+ }
247
+ }
248
+ await http.load('POST','rs/logic/newaddApplyproduct',{data:data}, {resolveMsg: null, rejectMsg: '转发失败,请联系开发人员'})
249
+ var flag = false
250
+ if (this.data.defname == '合同审核') {
251
+ flag = true
252
+ let http = new HttpResetClass()
253
+ let data = {
254
+ tablename: 't_singlevalue',
255
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
256
+ }
257
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
258
+ resolveMsg: null,
259
+ rejectMsg: "获取合同编号失败"
260
+ })
261
+ if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
262
+ this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
263
+ return
264
+ }
265
+ }
266
+ if (res1.data.code == 200) {
267
+ // flag 为合同编号更新标志
268
+ if (flag) {
269
+ let http = new HttpResetClass()
270
+ let data = {
271
+ tablename: 't_singlevalue',
272
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
273
+ value: (Number(this.contract) + 1) + ''
274
+ }
275
+ await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
276
+ resolveMsg: null,
277
+ rejectMsg: "获取合同编号更新失败"
278
+ })
279
+ }
280
+ this.showview = false
281
+ // 特殊处理
282
+ this.special(model)
283
+ this.$dispatch('close')
284
+ this.initializtion()
285
+ } else {
286
+ if (res1.data.msg) {
287
+ this.$showMessage(res1.data.msg)
288
+ }
289
+ }
290
+ this.apply_show = false
291
+ },
292
+ // 终止报建
293
+ async stopapplys () {
294
+ this.models = Object.assign({}, this.selectdata, this.models)
295
+ this.models.id = null
296
+ this.models.applyid = this.selectdata.id
297
+ this.models.f_operat_type = '终止报建'
298
+ this.models.f_state = '有效'
299
+ this.models.f_describe = this.selectdata.f_user_name + '已终止报建'
300
+ let data ={
301
+ tablename:'t_project_stop',
302
+ parameters:this.models
303
+ }
304
+ let http = new HttpResetClass()
305
+ await http.load('POST','rs/logic/stopapply', {data:this.models},{resolveMsg: null, rejectMsg: "终止失败"})
306
+ await http.load('POST','rs/logic/save', {data:data},{resolveMsg: null, rejectMsg: "添加失败"})
307
+ this.closeback()
308
+ this.$dispatch('close')
309
+ },
310
+ // 关闭终止备注弹框
311
+ closeback() {
312
+ this.stop_show = false
313
+ },
314
+ // 关闭报建弹框
315
+ closeapply() {
316
+ this.apply_show = false
317
+ },
318
+ closeAccept () {
319
+ this.acceptprint = false
320
+ },
321
+ close () {
322
+ this.acceptprint = false
323
+ },
324
+ printok () {
325
+ this.$dispatch('success')
326
+ },
327
+ validateBill (val) {
328
+ this.validateOk = !val.isOk
329
+ this.billData.bill = val.bill
330
+ },
331
+ async printReceipt(model) {
332
+ console.log('打印回单了11111111111111111model', model)
333
+ this.acceptprint = true
334
+ this.acceptUrl = 'rs/report/printReceiptbill'
335
+ this.printData.f_work_type = `'${model.f_work_type}'`
336
+ this.printData.f_news = `'${model.f_news}'`
337
+ this.printData.f_user_name = `'${model.f_user_name}'`
338
+ this.printData.f_address = `'${model.f_address}'`
339
+ this.printData.f_user_phone = `'${model.f_phone}'`
340
+ },
341
+ print () {
342
+ this.$refs.print.$refs.print.PrintTable()
343
+ },
344
+ printoverview(name){
345
+ this.overviewprint = true
346
+ this.overviewname = name
347
+ },
348
+
349
+ async printbill(sellid) {
350
+ let result = await this.$resetpost('rs/report/applyCharge_bill', {data: {condition: `c.id = ${sellid}`}}, {
351
+ resolveMsg: null,
352
+ rejectMsg: "提取数据出错,请重试!"
353
+ })
354
+ this.bill = result.data
355
+ console.log('this.bill', this.bill)
356
+ this.$nextTick(() => {
357
+ this.$refs.reportprint.print()
358
+ })
359
+ },
360
+ confirmbuyerinfo(args) {
361
+ let drawbilldata = {
362
+ sellid: this.selectsellid,
363
+ buyerid: args.id,
364
+ operator: this.$login.f.name
365
+ }
366
+ this.closebuyerinfo()
367
+ this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
368
+ .then((res) => {
369
+ if (res.data.status === 200) {
370
+ this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
371
+ /*let n = 0
372
+ var id = setInterval(async ()=>{
373
+ if(n>=3){
374
+ this.$showMessage('电子票延迟,请稍后查看!')
375
+ clearInterval(id)
376
+ }
377
+ if (this.seeeticket(res.data) === 'success'){
378
+ clearInterval(id)
379
+ this.load()
380
+ }
381
+ n++
382
+ this.$showAlert('电子发票开票中,请稍后...', 'info',3000)
383
+ },3000)*/
384
+ } else {
385
+ this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
386
+ }
387
+ })
388
+ },
389
+ // 金额转大写
390
+ smalltoBIG(n) {
391
+ let fraction = ['角', '分'];
392
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
393
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
394
+ let head = n < 0 ? '欠' : '';
395
+ n = Math.abs(n);
396
+
397
+ let s = '';
398
+
399
+ for (var i = 0; i < fraction.length; i++) {
400
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
401
+ }
402
+ s = s || '整';
403
+ n = Math.floor(n);
404
+
405
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
406
+ let p = '';
407
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
408
+ p = digit[n % 10] + unit[1][j] + p;
409
+ n = Math.floor(n / 10);
410
+ }
411
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
412
+ }
413
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
414
+ },
415
+ // 关闭模态框
416
+ closebuyerinfo() {
417
+ this.showbuyerinfo = false
418
+ this.selectsellid = null
419
+ },
420
+ //根据票据流水号查看票据
421
+ async seeeticket(val) {
422
+ console.log('该票据流水号为:', val.f_fpqqlsh)
423
+ var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
424
+ data: {
425
+ items: 'f_bill_url,f_url_code',
426
+ tablename: 't_eticket',
427
+ condition: `f_serial_number=${val.f_fpqqlsh}`
428
+ }
429
+ }, {resolveMsg: null, rejectMsg: null})
430
+ console.log('eticketData:', eticketData)
431
+ var data = eticketData.data[0]
432
+ if (data.f_bill_url && data.f_bill_url != '') {
433
+ console.log(data)
434
+ var auth = data.f_bill_url.split("/")
435
+ console.log("截取", auth)
436
+ var authCode = auth[auth.length - 1]
437
+ var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
438
+ this.$showAlert('开票成功!', 'success', 500)
439
+ window.open(url)
440
+ return 'success'
441
+ }
442
+ return 'fail'
443
+ },
444
+ async loadbuyer() {
445
+ //获取购货方信息
446
+ let querybuyerdata = {
447
+ tablename: 't_buyer_info',
448
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_apply_num = '${this.selectdata.f_apply_num}'`
449
+ }
450
+ let buyerinfos = await this.$resetpost('rs/sql/singleTable', {data: querybuyerdata}, {
451
+ resolveMsg: null,
452
+ rejectMsg: '获取购货方信息失败'
453
+ })
454
+ this.buyerinfo.rows = buyerinfos.data
455
+ },
456
+ /*
457
+ ============================================收费临时使用结束
458
+ */
459
+ // AOP后续特殊化处理
460
+ async special(model) {
461
+ if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步处理') {
462
+ // 分支流程异步处理
463
+ let http = new HttpResetClass();
464
+ let res = await http.load('POST', 'rs/logic/branchsyncprocess', {
465
+ data: {
466
+ model: model,
467
+ loginUser: this.$login.f
468
+ }
469
+ }, {resolveMsg: null, rejectMsg: '分支流程异步处理保存失败'})
470
+ console.log("分支流程异步处理:", JSON.stringify(res.data))
471
+ }
472
+
473
+ if (this.data.distribute_async && model.button.button_name === '下发') {
474
+ // 同流程节点异步处理
475
+ let http = new HttpResetClass();
476
+ let res = await http.load('POST', 'rs/logic/syncprocess', {
477
+ data: {
478
+ model: model,
479
+ loginUser: this.$login.f
480
+ }
481
+ }, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
482
+ console.log("流程的异步处理:", JSON.stringify(res.data))
483
+ }
484
+ if (this.data.distribute_async && model.button.button_name === '完成') {
485
+ // 强制结束
486
+ let http = new HttpResetClass();
487
+ let res = await http.load('POST', 'rs/logic/stoprocess', {
488
+ data: {
489
+ model: model,
490
+ loginUser: this.$login.f
491
+ }
492
+ }, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
493
+ console.log("流程的异步处理:", JSON.stringify(res.data))
494
+ }
495
+ },
496
+ // 组件初始化操作
497
+ refurbish(val) {
498
+ this.selectdata = val
499
+ this.json_datas = this.$workflow_vue
500
+ console.log("初始化jsonDataS==", this.json_datas)
501
+ let sum = 0
502
+ let jsonData = {}
503
+ if(!this.json_datas||!this.json_datas.activitys||this.json_datas.activitys.length==0){
504
+ this.$showMessage("网络故障,请刷新页面")
505
+ return
506
+ }
507
+ for (let i = 0; i < this.json_datas.activitys.length; i++) {
508
+ if (this.selectdata.defname == this.json_datas.activitys[i].title) {
509
+ jsonData = this.json_datas.activitys[i]
510
+ sum++
511
+ }
512
+ }
513
+ for (let j = 0; j < jsonData.fields.length; j++) {
514
+ jsonData.fields[j].value = ''
515
+ console.log("是否有default属性jsonData.fields[j]", jsonData.fields[j])
516
+ if (jsonData.fields[j].default) {
517
+ jsonData.fields[j].value = jsonData.fields[j].default
518
+ }
519
+ }
520
+ if (sum == 1) {
521
+ console.log("jsonData==", jsonData)
522
+ this.data = null
523
+ this.data = jsonData
524
+ this.initializtion()
525
+ } else if (sum == 0) {
526
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
527
+ } else {
528
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
529
+ }
530
+ },
531
+ //生成派工单号
532
+ createpgd() {
533
+ this.pgd = "BJ"
534
+ var d = new Date()
535
+ this.pgd+=d.getFullYear()
536
+ if(d.getMonth() + 1<10){
537
+ this.pgd+='0'+(d.getMonth() + 1)
538
+ }
539
+ else{
540
+ this.pgd+=(d.getMonth() + 1)
541
+ }
542
+ if(d.getDate() <10){
543
+ this.pgd+='0'+d.getDate()
544
+ }
545
+ else{
546
+ this.pgd+=d.getDate()
547
+ }
548
+ if(d.getHours() <10){
549
+ this.pgd+='0'+d.getHours()
550
+ }
551
+ else{
552
+ this.pgd+=d.getHours()
553
+ }
554
+ if(d.getMinutes() <10){
555
+ this.pgd+='0'+d.getMinutes()
556
+ }
557
+ else{
558
+ this.pgd+=d.getMinutes()
559
+ }
560
+ if(d.getSeconds() <10){
561
+ this.pgd+='0'+d.getSeconds()
562
+ }
563
+ else{
564
+ this.pgd+=d.getSeconds()
565
+ }
566
+ },
567
+
568
+
569
+
570
+ // AOP:进入vue组件前初始化内容
571
+ // json配置数据处理 比如下拉框的options
572
+ async initializtion() {
573
+ console.log("this.data.table", this.data.tables)
574
+ this.showview = false
575
+ // 有合同号不给合同表里插入数据
576
+ for(let i=0;i<this.data.tables.length;i++){
577
+ if('t_contract'==this.data.tables[i]&&this.selectdata.f_contract_number){
578
+ this.data.tables.splice(i,1)
579
+ }
580
+ }
581
+ // 下发人 options 处理,options初始化
582
+ if (this.selectdata.defname.indexOf('派单')>=0&&this.selectdata.actorexpression) {
583
+ let http = new HttpResetClass()
584
+ http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程部门$).getChildByName($工程部门负责人$).getChildren()","userid":"${this.$login.f.id}"}`, {
585
+ resolveMsg: null,
586
+ rejectMsg: null
587
+ }).then((res)=>{
588
+
589
+
590
+ let jsonString = JSON.stringify(res.data)
591
+ let jsonArray = []
592
+ if (jsonString.startsWith("{")) {
593
+ jsonArray.push(res.data)
594
+ res.data = jsonArray
595
+ }
596
+ this.department_search = res.data
597
+ if (this.department_search&&this.showview) {
598
+ let array = []
599
+ for (let k = 0; k < this.department_search.length; k++) {
600
+ array.push({
601
+ label: this.department_search[k].name,
602
+ value: {id: this.department_search[k].id, name: this.department_search[k].name}
603
+ })
604
+ }
605
+ for(let x=0;x<this.data.buttons.length;x++){
606
+ if(this.data&&this.data.buttons[x].button_name=="下发"){
607
+ this.data.buttons[x].button_fields[0].options = array
608
+ }
609
+ if(this.show_data &&this.show_data.buttons[x].button_name=="下发"){
610
+ this.show_data.buttons[x].button_fields[0].options = array
611
+ }
612
+ }
613
+ }
614
+ })
615
+ }
616
+
617
+ //debugger
618
+
619
+ // selectdata 填充 data
620
+ this.data = Object.assign({}, this.data, this.selectdata)
621
+ // onetomany 数据获取
622
+ if (this.data.onetomany) {
623
+ console.log('判断是onetomany,this.data.onetomany的数据为=>' + JSON.stringify(this.data.onetomany))
624
+ for (let index = 0; index < this.data.onetomany.length; index++) {
625
+ let http = new HttpResetClass()
626
+ let data = {}
627
+ if (this.data.onetomany[index].tables[0] == 't_charge_record') {
628
+ data = {
629
+ tablename: this.data.onetomany[index].tables[0],
630
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' and f_process_id='${this.selectdata.f_process_id}' and f_charging_status != '作废'`
631
+ }
632
+ } else {
633
+ data = {
634
+ tablename: this.data.onetomany[index].tables[0],
635
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
636
+ }
637
+ }
638
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
639
+ resolveMsg: null,
640
+ rejectMsg: 'onetomany查询失败'
641
+ })
642
+ // 初始化 onetomany
643
+ let rows = []
644
+ console.log('查询返回结果res.data=>' + JSON.stringify(res.data))
645
+ this.data.onetomany[index].rows = res.data
646
+ // console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
647
+
648
+ // 初始化onetomany中的fields
649
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
650
+ // 如果配置类型为select,优先从参数列表获取options
651
+ if (this.data.onetomany[index].fields[j].type === 'select') {
652
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
653
+ if (temp && temp.length > 0) {
654
+ this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
655
+ }
656
+ }
657
+ }
658
+ }
659
+ }
660
+ // 初始化 fields
661
+ for (let i = 0; i < this.data.fields.length; i++) {
662
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
663
+ if (this.selectdata[this.data.fields[i].field]) {
664
+ if (String(this.selectdata[this.data.fields[i].field]).startsWith("{")) {
665
+ this.data.fields[i].value = JSON.parse(this.selectdata[this.data.fields[i].field])
666
+ } else {
667
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
668
+ }
669
+
670
+ }
671
+ // 如果配置类型为select,优先从参数列表获取options
672
+ if (this.data.fields[i].type === 'select') {
673
+ let temp = Vue.$appdata.getParam(this.data.fields[i].label)
674
+ if (temp && temp.length > 0) {
675
+ this.data.fields[i].options = Vue.$appdata.getParam(this.data.fields[i].label)
676
+ }
677
+ }
678
+
679
+ if (this.data.defname === '工程结算') {
680
+ var a = 0
681
+ var b = 0
682
+ var c = 0
683
+ for (let i = 0; i < this.data.fields.length; i++) {
684
+ if (this.data.fields[i].label === '最终核算成本金额') {
685
+ this.data.fields[i].value = (this.cost + this.number)
686
+ a = this.data.fields[i].value
687
+ }
688
+ if (this.data.fields[i].label === '合同总金额') {
689
+ b = this.data.fields[i].value
690
+ }
691
+ if (this.data.fields[i].label === '材料成本金额') {
692
+ this.data.fields[i].value = this.number
693
+ }
694
+ if (this.data.fields[i].label === '其他成本金额') {
695
+ this.data.fields[i].value = this.cost
696
+ }
697
+ }
698
+ c = b - a
699
+ for (let i = 0; i < this.data.fields.length; i++) {
700
+ if (this.data.fields[i].label === '工程盈利') {
701
+ this.data.fields[i].value = c
702
+ }
703
+ }
704
+ }
705
+ if (this.selectdata.defname.indexOf('派单')>=0) {
706
+ let money=0
707
+
708
+ for (let i = 0; i < this.data.fields.length; i++) {
709
+ if (this.data.fields[i].label === '派工单号') {
710
+ console.log("给派工单号赋值")
711
+ this.createpgd()
712
+ console.log(this.pgd)
713
+ this.data.fields[i].value = this.pgd
714
+ }
715
+ if (this.data.fields[i].label === '合同总金额') {
716
+ console.log('合同总金额===>'+this.data.fields[i].value )
717
+ money=this.data.fields[i].value
718
+ }
719
+ let dealmoney=0;
720
+ if (this.data.fields[i].label == '累计缴费金额') {
721
+ dealmoney=this.data.fields[i].value
722
+ console.log('累计缴费金额===>'+dealmoney )
723
+ }
724
+
725
+ if (this.data.fields[i ].label == '未结总金额') {
726
+ /// if(money=="" || dealmoney==""){
727
+ /// money=0;
728
+ /// dealmoney=0;
729
+ /// }
730
+ /// if(money==null || dealmoney==null){
731
+ /// money=0;
732
+ /// dealmoney=0;
733
+ /// }
734
+ ///
735
+ let othermoney = money-dealmoney;
736
+ console.log('jine'+othermoney)
737
+ this.data.fields[i].value=money-dealmoney
738
+ console.log('未结总金额'+this.data.fields[i].value )
739
+ }
740
+ }
741
+ }
742
+ if(this.data.defname=="派单"){
743
+ for (let i = 0; i < this.data.fields.length; i++) {
744
+ if (this.data.fields[i].label === '未结总金额') {
745
+ this.data.fields[i].value=0
746
+ console.log("派单"+this.data.fields[i].value)
747
+ }
748
+ }
749
+ }
750
+
751
+
752
+ if (this.selectdata.defname ==='报价审核') {
753
+ let unaccount=0
754
+ for (let i = 0; i < this.data.fields.length; i++) {
755
+ if (this.data.fields[i].label === '费用合计') {
756
+ console.log("算一下未结算金额")
757
+ unaccount=this.data.fields[i].value
758
+ }
759
+ if (this.data.fields[i].label === '未结总金额') {
760
+ this.data.fields[i].value=unaccount
761
+ }
762
+
763
+ }
764
+ }
765
+
766
+
767
+ if (this.data.defname === '收费') {
768
+ let account_money=0
769
+ let total_money=0
770
+ let bill_money=0
771
+ for (let i = 0; i < this.data.fields.length; i++) {
772
+ if (this.data.fields[i].label === '合同金额') {
773
+ total_money=this.data.fields[i].value
774
+ }
775
+ if (this.data.fields[i].label === '累计缴费金额') {
776
+ account_money=this.data.fields[i].value
777
+ }
778
+ if (this.data.fields[i].label === '未结总金额') {
779
+ this.data.fields[i].value=total_money-account_money
780
+ }
781
+ if (this.data.fields[i].label === '累计开票金额') {
782
+ bill_money=this.data.fields[i].value
783
+ }
784
+ if (this.data.fields[i].label === '未开票金额') {
785
+ this.data.fields[i].value=total_money-bill_money
786
+
787
+ }
788
+ }
789
+ }
790
+ // 特殊处理
791
+ //施工环节 如果是个人报建需要提交表具信息
792
+ if (this.data.defname === '施工') {
793
+ for (let i = 0; i < this.data.fields.length; i++) {
794
+ if (this.data.fields[i].label === '气表品牌'
795
+ || this.data.fields[i].label === '气表型号'
796
+ || this.data.fields[i].label === '气表厂家') {
797
+ if (this.data.f_apply_type === '个人报建') {
798
+ this.data.fields[i].hidden = false
799
+ this.data.fields[i].required = true
800
+ }
801
+ }
802
+ }
803
+ }
804
+
805
+ // 特殊处理
806
+ //施工环节 如果是个人报建需要提交表具信息
807
+ if (this.data.defname === '安装通气') {
808
+ for (let i = 0; i < this.data.fields.length; i++) {
809
+ if (this.data.fields[i].label === '气表品牌'
810
+ || this.data.fields[i].label === '气表型号'
811
+ || this.data.fields[i].label === '气表厂家') {
812
+ this.data.fields[i].required = true
813
+ this.data.fields[i].hidden = false
814
+ if(this.data.f_work_type=='改管'){
815
+ this.data.fields[i].required = false
816
+ }
817
+
818
+ }
819
+ if(this.data.fields[i].label === '验收结果'){
820
+ this.data.fields[i].required = true
821
+ }
822
+
823
+ }
824
+ }
825
+ if (this.data.defname === '设计报价') {
826
+ for (let i = 0; i < this.data.fields.length; i++) {
827
+ if (this.data.fields[i].label === '气表品牌'
828
+ || this.data.fields[i].label === '气表型号') {
829
+ this.data.fields[i].required = true
830
+ this.data.fields[i].hidden = false
831
+ if(this.data.f_work_type=='改管'){
832
+ this.data.fields[i].required = false
833
+ }
834
+
835
+ }
836
+
837
+ }
838
+ }
839
+ if (this.data.defname === '现场勘查定价') {
840
+ for (let i = 0; i < this.data.fields.length; i++) {
841
+ if (this.data.fields[i].label === '勘查结果') {
842
+ this.data.fields[i].required = true
843
+ }
844
+ }
845
+ }
846
+ //通气环节可以调出施工环节的表信息来修改
847
+ if (this.data.defname === '通气') {
848
+ for (let i = 0; i < this.data.fields.length; i++) {
849
+ if (this.data.fields[i].label === '气表品牌'
850
+ || this.data.fields[i].label === '气表型号'
851
+ || this.data.fields[i].label === '气表厂家') {
852
+ if (this.data.fields[i].value != null && this.data.fields[i].value != '') {
853
+ this.data.fields[i].hidden = false
854
+ this.data.fields[i].required = true
855
+ }
856
+ }
857
+ }
858
+ }
859
+ let array = this.$login.f.rolesnames.split(',')
860
+ if ((this.data.fields[i].label === '技术人员' || array.includes("工程技术部负责人"))&&(this.selectdata.defname=='勘察初设'||this.selectdata.defname=='任务分配'||this.selectdata.defname=='合同信息')) { //{"source":"this.getParentByType($organization$).getChildByName($技术人员$).getChildren()","userid":"296851"}
861
+ let http = new HttpResetClass()
862
+ let res = await http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程技术部门$).getChildByName($技术人员$).getChildren()","userid":"${this.$login.f.id}"}`, {
863
+ resolveMsg: null,
864
+ rejectMsg:null // 'search查询技术人员失败,请联系管理员配置技术人员角色'
865
+ })
866
+ // console.log("search查询部门下所有人:", JSON.stringify(res.data))
867
+ this.technologist = res.data
868
+ if (this.technologist) {
869
+ let array = []
870
+ for (let k = 0; k < this.technologist.length; k++) {
871
+ array.push({
872
+ label: this.technologist[k].name,
873
+ value: {name: this.technologist[k].name, id: this.technologist[k].id}
874
+ })
875
+ }
876
+ if (!array.includes("工程技术部负责人")&&this.data.fields[i].label === '技术人员') {
877
+ this.data.fields[i].options = array
878
+ }
879
+
880
+ }
881
+ }
882
+ if (this.data.fields[i].label == '县/区') {
883
+ let area = await this.$resetpost('rs/sql/singleTable', {
884
+ data: {
885
+ // items: 'f_bill_url,f_url_code',
886
+ tablename: 't_pcd',
887
+ condition: `f_filialeids = '${this.$login.f.f_orgids}'`
888
+ }
889
+ }, {resolveMsg: null, rejectMsg: null})
890
+ let rs = []
891
+ for (let i = 0; i < area.data.length; i++) {
892
+ let temp = {
893
+ label: area.data[i].f_pcd,
894
+ value: area.data[i].f_pcd
895
+ }
896
+ rs.push(temp)
897
+ }
898
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
899
+ }
900
+ if (this.data.defname=='通气'&&this.data.fields[i].label == '小区名称') {
901
+ let res = await this.$resetpost('rs/sql/singleTable', {
902
+ data: {
903
+ tablename: 't_area',
904
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${this.data.f_street}'`
905
+ }
906
+ }, {resolveMsg: null, rejectMsg: null})
907
+ let cs = []
908
+ for (let i = 0; i < res.data.length; i++) {
909
+ let temp = {
910
+ label: res.data[i].f_residential_area,
911
+ value: res.data[i].f_residential_area
912
+ }
913
+ cs.push(temp)
914
+ }
915
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...cs]
916
+ }
917
+ let gasbrand_id=''
918
+ if (this.data.fields[i].label == '气表品牌'||this.data.fields[i].label == '表具') {
919
+ let meterbrand = await this.$resetpost('rs/sql/singleTable', {
920
+ data: {
921
+ items: 'f_meter_brand',
922
+ tablename: 't_gasbrand',
923
+ condition: `f_filialeids = '${this.$login.f.f_orgids}'`
924
+ }
925
+ }, {resolveMsg: null, rejectMsg: null})
926
+ let rs = []
927
+ for (let i = 0; i < meterbrand.data.length; i++) {
928
+ let temp = {
929
+ label: meterbrand.data[i].f_meter_brand,
930
+ value: meterbrand.data[i].f_meter_brand
931
+ }
932
+ rs.push(temp)
933
+ }
934
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
935
+ }
936
+ if (this.data.fields[i].label == '气表型号') {
937
+ this.data.fields[i].options = [];
938
+ }
939
+ if (this.data.fields[i].label == '气价名称') {
940
+ let meterbrand = await this.$resetpost('rs/sql/singleTable', {
941
+ data: {
942
+ items: 'f_price_name',
943
+ tablename: 't_stairprice',
944
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_state= '有效' and getdate()>=f_perform_date and getdate()<=f_end_date `
945
+ }
946
+ }, {resolveMsg: null, rejectMsg: null})
947
+ let rs = []
948
+ for (let i = 0; i < meterbrand.data.length; i++) {
949
+ let temp = {
950
+ label: meterbrand.data[i].f_price_name,
951
+ value: meterbrand.data[i].f_price_name
952
+ }
953
+ rs.push(temp)
954
+ }
955
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
956
+ }
957
+ if (this.data.fields[i].label == '合同类型') {
958
+ this.data.fields[i].value = '主合同'
959
+ }
960
+ if (this.data.fields[i].label == '合同业务办理人') {
961
+ if (this.selectdata.f_apply_kefu_employee) {
962
+ if (this.selectdata.f_apply_kefu_employee.startsWith("{") && this.selectdata.f_apply_kefu_employee.endsWith("}")) {
963
+ let temp = JSON.parse(this.selectdata.f_apply_kefu_employee)
964
+ this.data.fields[i].value = temp.name
965
+ } else {
966
+ this.data.fields[i].value = this.selectdata.f_apply_kefu_employee
967
+ }
968
+ } else {
969
+ if (this.selectdata.f_survey_name) {
970
+ if (this.selectdata.f_survey_name.startsWith("{") && this.selectdata.f_survey_name.endsWith("}")) {
971
+ let temp = JSON.parse(this.selectdata.f_survey_name)
972
+ this.data.fields[i].value = temp.name
973
+ } else {
974
+ this.data.fields[i].value = this.selectdata.f_survey_name
975
+ }
976
+ }
977
+ }
978
+ }
979
+ if (this.data.fields[i].label == '合同编号' && !this.selectdata[this.data.fields[i].field] && this.selectdata.defname == '合同审核') {
980
+ if (!this.$appdata.getSingleValue('所属公司编码')) {
981
+ this.$showMessage(`请先去参数管理设置: 所属公司编码`)
982
+ }
983
+ if (!this.$appdata.getSingleValue(this.data.fields[i].label)) {
984
+ this.$showMessage(`请先去参数管理设置: ${this.data.fields[i].label}`)
985
+ } else {
986
+ let http = new HttpResetClass()
987
+ //获取购货方信息
988
+ let data = {
989
+ tablename: 't_singlevalue',
990
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
991
+ }
992
+ let res = await http.load('POST','rs/sql/singleTable', {data: data}, {
993
+ resolveMsg: null,
994
+ rejectMsg: '获取合同编号失败'
995
+ }).then((res)=>{
996
+ let temp = res.data[0].value
997
+ this.contract = temp
998
+ while (temp.length < 4) {
999
+ temp = '0' + temp
1000
+ }
1001
+ let dt = new Date()
1002
+ this.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
1003
+ if(this.showview){
1004
+ this.$refs.service_show.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
1005
+ this.$refs.service_show.update()
1006
+ }
1007
+
1008
+ })
1009
+ // this.$refs.service_show.update()
1010
+ }
1011
+ }
1012
+ if(this.data.defname=='通气'){
1013
+ if (this.data.f_user_type == '非民用' && this.data.fields[i].label == '小区名称'){
1014
+ this.data.fields[i].hidden = true
1015
+ this.data.fields[i].required = false
1016
+ this.data.fields[i+1].hidden = true
1017
+ this.data.fields[i+1].required = false
1018
+ this.data.fields[i+2].hidden = true
1019
+ this.data.fields[i+2].required = false
1020
+ }
1021
+ if (this.data.f_work_type == '改管' && this.data.fields[i].label == '阀门井'){
1022
+ this.data.fields[i].hidden = true
1023
+ this.data.fields[i].required = false
1024
+ this.data.fields[i+1].hidden = true
1025
+ this.data.fields[i+1].required = false
1026
+ this.data.fields[i+2].hidden = true
1027
+ this.data.fields[i+2].required = false
1028
+ }
1029
+ if (this.data.f_work_type == '改管' && this.data.fields[i].label == '表具'){
1030
+ this.data.fields[i].hidden = true
1031
+ this.data.fields[i].required = false
1032
+ this.data.fields[i+1].hidden = true
1033
+ this.data.fields[i+1].required = false
1034
+ this.data.fields[i+2].hidden = true
1035
+ this.data.fields[i+2].required = false
1036
+ }
1037
+ }
1038
+ }
1039
+ // 初始化 buttons_fields
1040
+ //debugger
1041
+ for (let i = 0; i < this.data.buttons.length; i++) {
1042
+ if (this.data.buttons[i].button_fields) {
1043
+ for (let j = 0; j < this.data.buttons[i].button_fields.length; j++) {
1044
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
1045
+ if (this.selectdata[this.data.buttons[i].button_fields[j].field]) {
1046
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
1047
+ }
1048
+ // 如果配置类型为select,优先从参数列表获取options
1049
+ if (this.data.buttons[i].button_fields[j].type === 'select' && this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)) {
1050
+ this.data.buttons[i].button_fields[j].options = this.$appdata.getParam(this.data.buttons[i].button_fields[j].label).trim()
1051
+ }
1052
+ // 下发特殊配置
1053
+ if (this.data.buttons[i].button_name === '下发') {
1054
+ if (this.data.buttons[i].button_fields.length === 1) {
1055
+ // value初始化
1056
+ // if(this.department_search){
1057
+ if (this.selectdata[this.data.buttons[i].button_fields[0].field]) {
1058
+ for (let k = 0; k < this.department_search.length; k++) {
1059
+ // 将id转换为name
1060
+ if (Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])) {
1061
+ this.data.buttons[i].button_fields[0].value = {
1062
+ id: this.department_search[k].id,
1063
+ name: this.department_search[k].name
1064
+ }
1065
+ }
1066
+ }
1067
+ }
1068
+
1069
+ if (this.department_search) {
1070
+ let array = []
1071
+ for (let k = 0; k < this.department_search.length; k++) {
1072
+ array.push({
1073
+ label: this.department_search[k].name,
1074
+ value: {id: this.department_search[k].id, name: this.department_search[k].name}
1075
+ })
1076
+ }
1077
+ this.data.buttons[i].button_fields[0].options = array
1078
+ }
1079
+ let array = this.$login.f.rolesnames.split(',')
1080
+ if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1081
+ let array = []
1082
+ for (let k = 0; k < this.technologist.length; k++) {
1083
+ array.push({
1084
+ label: this.technologist[k].name,
1085
+ value: {id: this.technologist[k].id, name: this.technologist[k].name}
1086
+ })
1087
+ }
1088
+ this.data.buttons[i].button_fields[0].options = array
1089
+ }
1090
+ } else {
1091
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
1092
+ }
1093
+ }
1094
+ }
1095
+ }
1096
+
1097
+ }
1098
+ var count =0;
1099
+ let money=0;
1100
+ let dealmoney=0;
1101
+ for (count = 0; count < this.data.fields.length; count++) {
1102
+ if (this.selectdata.defname.indexOf('派单')>=0) {
1103
+ if (this.data.fields[count].label === '合同总金额') {
1104
+ console.log('合同总金额===>'+this.data.fields[count].value )
1105
+ money=this.data.fields[count].value
1106
+ }
1107
+
1108
+ if (this.data.fields[count].label == '累计缴费金额') {
1109
+ dealmoney=this.data.fields[count].value
1110
+ console.log('累计缴费金额===>'+dealmoney )
1111
+ }
1112
+
1113
+ if (this.data.fields[count].label == '未结总金额') {
1114
+ let othermoney = money-dealmoney;
1115
+ console.log('jine'+othermoney)
1116
+ this.data.fields[count].value=money-dealmoney
1117
+ console.log('未结总金额'+this.data.fields[count].value )
1118
+ }
1119
+ }
1120
+ }
1121
+ //debugger
1122
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
1123
+ let temp = JSON.parse(JSON.stringify(this.data))
1124
+ // let temp = this.data
1125
+ // 退回原因展示
1126
+ if (this.selectdata.f_back_reason) {
1127
+ temp['back_reason'] = this.selectdata.f_back_reason
1128
+ }
1129
+ this.show_data = temp
1130
+ console.log("====="+this.show_data)
1131
+ /**
1132
+ * 新增需求: 个人报建非民用流程中小区名称需选填
1133
+ */
1134
+ let j=0;
1135
+ if(this.show_data.defname=="现场勘查人员分配" && this.show_data.f_apply_type=="个人报建"){
1136
+
1137
+ for (j = 0; j < this.show_data.fields.length; j++) {
1138
+ if (this.show_data.fields[j].label == '小区名称') {
1139
+ this.show_data.fields[j].required=false
1140
+ }
1141
+ }
1142
+ }
1143
+ if (this.show_data.defname === '施工') {
1144
+ let http = new HttpResetClass()
1145
+ let data = {
1146
+ f_process_id: this.show_data.f_process_id,
1147
+ defname: this.show_data.defname
1148
+ }
1149
+ let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1150
+ {resolveMsg: null, rejectMsg: null})
1151
+
1152
+ // for (let i = 0; i < res.length; i++){
1153
+ // this.data.f_project_material += res.data.fusetype + ','
1154
+ // }
1155
+ res.data.forEach(item =>{
1156
+ this.show_data.f_project_material += item.fusetype + ','
1157
+ })
1158
+ }
1159
+ // if (this.show_data.defname === '施工验收') {
1160
+ // let http = new HttpResetClass()
1161
+ // let data = {
1162
+ // f_process_id: this.show_data.f_process_id,
1163
+ // defname: this.show_data.defname
1164
+ // }
1165
+ // let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1166
+ // {resolveMsg: null, rejectMsg: null})
1167
+ // this.show_data.f_iscomplete_information = ''
1168
+ // res.data.forEach(item =>{
1169
+ // this.show_data.f_iscomplete_information += item.fusetype + ','
1170
+ // })
1171
+ // for (j = 0; j < this.show_data.fields.length; j++) {
1172
+ // if (this.show_data.fields[j].label === '验收已上传文件') {
1173
+ // this.show_data.fields[j].value = this.show_data.f_iscomplete_information
1174
+ // }
1175
+ // }
1176
+ // }
1177
+ // 显示组件
1178
+ // this.showview = false
1179
+ // debugger
1180
+ this.$nextTick(()=>{
1181
+ this.showview = true
1182
+ })
1183
+ }
1184
+ }
1185
+ ,
1186
+ events: {
1187
+ 'get-cost'(val) {
1188
+ this.cost = val
1189
+
1190
+ this.initializtion()
1191
+ },
1192
+ 'checkboxSelectControl'(index,index2){
1193
+ console.log("chufa事件control");
1194
+ console.log('this.$refs.service_show.data.fields[index]==>:'+JSON.stringify(this.$refs.service_show.data.fields[index]));
1195
+ if(this.$refs.service_show.data.fields[index].label=="提交资料"){
1196
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1197
+
1198
+ if(this.$refs.service_show.data.fields[i].label=="用户提交资料"){
1199
+ //if(this.$refs.service_show.data.fields[index].value == ""){
1200
+ console.log("this.$refs.service_show.data.fields[index].items[index2].value==>"+JSON.stringify(this.$refs.service_show.data.fields[index].items[index2]))
1201
+ //增加和删除框中的内容
1202
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1203
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1204
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
1205
+ }else{
1206
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1207
+ let values =this.$refs.service_show.data.fields[i].value;
1208
+ let result = values.split(" ").filter((item)=>{
1209
+ return item!=deleteValue;
1210
+ }).join(" ")
1211
+ console.log(result);
1212
+ this.$refs.service_show.data.fields[i].value =result;
1213
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
1214
+ }
1215
+ //}
1216
+ }
1217
+ }
1218
+ }
1219
+ if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
1220
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1221
+
1222
+ if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
1223
+ //增加和删除框中的内容
1224
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1225
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1226
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
1227
+ }else{
1228
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1229
+ let values =this.$refs.service_show.data.fields[i].value;
1230
+ let result = values.split(" ").filter((item)=>{
1231
+ return item!=deleteValue;
1232
+ }).join(" ")
1233
+ this.$refs.service_show.data.fields[i].value =result;
1234
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
1235
+ }
1236
+ //}
1237
+ }
1238
+ }
1239
+ }
1240
+ if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
1241
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1242
+
1243
+ if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
1244
+ //增加和删除框中的内容
1245
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1246
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1247
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
1248
+ }else{
1249
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1250
+ let values =this.$refs.service_show.data.fields[i].value;
1251
+ let result = values.split(" ").filter((item)=>{
1252
+ return item!=deleteValue;
1253
+ }).join(" ")
1254
+ this.$refs.service_show.data.fields[i].value =result;
1255
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
1256
+ }
1257
+ //}
1258
+ }
1259
+ }
1260
+ }
1261
+ },
1262
+ 'get-number'(val) {
1263
+ this.number = val
1264
+
1265
+ this.initializtion()
1266
+ }
1267
+ ,
1268
+ 'get-pgd'(val) {
1269
+ this.pgd = val
1270
+ this.initializtion()
1271
+ }
1272
+ ,
1273
+ // 任意select选中时触发事件,关联性操作
1274
+ async 'select_cascade'(index) {
1275
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1276
+ if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1277
+ this.$refs.service_show.data.fields[i].value = c
1278
+ }
1279
+ }
1280
+
1281
+
1282
+ if (this.$refs.service_show.data.fields[index].label == '施工单位' ||
1283
+ this.$refs.service_show.data.fields[index].label == '检测单位' ||
1284
+ this.$refs.service_show.data.fields[index].label == '监理单位' ||
1285
+ this.$refs.service_show.data.fields[index].label == '土建单位' ||
1286
+ this.$refs.service_show.data.fields[index].label == '设计单位') {
1287
+ this.$refs.service_show.update()
1288
+ return
1289
+ }
1290
+ if (
1291
+ this.$refs.service_show.data.fields[index].label === '最终核算成本金额' ||
1292
+ this.$refs.service_show.data.fields[index].label === '合同总金额' ||
1293
+ this.$refs.service_show.data.fields[index].label === '工程盈利'
1294
+ ) {
1295
+
1296
+ var a = 0
1297
+ var b = 0
1298
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1299
+ // 控制设置级联
1300
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1301
+ // xxx xx xxx
1302
+ if (this.$refs.service_show.data.fields[i].label === '最终核算成本金额') {
1303
+ this.$refs.service_show.data.fields[i].value = (this.number + this.cost)
1304
+ a = this.$refs.service_show.data.fields[i].value
1305
+ }
1306
+
1307
+ if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1308
+ b = this.$refs.service_show.data.fields[i].value
1309
+ }
1310
+ }
1311
+ var c = b - a
1312
+ // 数据计算完毕得到工程结余
1313
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1314
+ if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1315
+ this.$refs.service_show.data.fields[i].value = c
1316
+ }
1317
+ }
1318
+ }
1319
+ //根据合同预算金额和累计缴费金额计算未结金额
1320
+ if (
1321
+ this.$refs.service_show.data.fields[index].label === '累计缴费金额' ||
1322
+ this.$refs.service_show.data.fields[index].label === '合同总金额') {
1323
+ let cumulativeMoney = 0
1324
+ let unaccountMoney = 0
1325
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1326
+
1327
+ if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1328
+ cumulativeMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1329
+ }
1330
+ if (this.$refs.service_show.data.fields[i].label === '累计缴费金额' && this.$refs.service_show.data.fields[i].value) {
1331
+ unaccountMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1332
+ }
1333
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1334
+ // if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
1335
+ // //this.$refs.service_show.data.fields[i].value = cumulativeMoney - unaccountMoney
1336
+ // this.$refs.service_show.data.fields[i].value =0;
1337
+ //
1338
+ // }
1339
+ }
1340
+ }
1341
+ }
1342
+
1343
+
1344
+ //根据合同预算金额和累计开票金额计算未开票金额
1345
+
1346
+
1347
+ if (this.$refs.service_show.data.fields[index].label === '累计开票金额') {
1348
+ let residualInvoicing = this.$refs.service_show.data.fields[index].value
1349
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1350
+ if (this.$refs.service_show.data.fields[i].label === '未开票金额') {
1351
+ this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_total_money) - Number(residualInvoicing)
1352
+ }
1353
+ }
1354
+ }
1355
+ //如果资料验收是否通过和工程验收是否通过为否的时候弹出原因填写框
1356
+ if (this.$refs.service_show.data.fields[index].label === '资料验收是否通过') {
1357
+ let res = this.$refs.service_show.data.fields[index].value
1358
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1359
+ if (this.$refs.service_show.data.fields[i].label === '资料验收不通过原因') {
1360
+ if (res === '否') {
1361
+ this.$refs.service_show.data.fields[i].hidden = false
1362
+ this.$refs.service_show.data.fields[i].required = true
1363
+ } else {
1364
+ this.$refs.service_show.data.fields[i].hidden = true
1365
+ this.$refs.service_show.data.fields[i].required = false
1366
+ }
1367
+ }
1368
+ }
1369
+ }
1370
+ if (this.$refs.service_show.data.fields[index].label === '工程验收是否通过') {
1371
+ let res = this.$refs.service_show.data.fields[index].value
1372
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1373
+ if (this.$refs.service_show.data.fields[i].label === '工程验收不通过原因') {
1374
+ if (res === '否') {
1375
+ this.$refs.service_show.data.fields[i].hidden = false
1376
+ this.$refs.service_show.data.fields[i].required = true
1377
+ } else {
1378
+ this.$refs.service_show.data.fields[i].hidden = true
1379
+ this.$refs.service_show.data.fields[i].required = false
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ // }
1385
+
1386
+ //金额小写得到大写
1387
+ if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields.fields[index].label === '收费金额') {
1388
+ if (this.$refs.service_show.showadd_fields[index].value || this.$refs.service_show.showadd_fields.fields[index].value) {
1389
+ var re = /^[0-9]+.?[0-9]*/
1390
+ let temp = this.$refs.service_show.showadd_fields[index].value
1391
+ if (temp == "" || isNaN(temp)) {
1392
+ this.$showMessage("请输入纯数字")
1393
+ this.$refs.service_show.showadd_fields[index].value = 0
1394
+ }
1395
+ }
1396
+ let temp = this.$refs.service_show.showadd_fields[index]
1397
+ let value = temp.value
1398
+ // let chargeMoney = this.$refs.service_show.showadd_fields[index].value
1399
+ for (let i = 0; i < this.$refs.service_show.showadd_fields.fields.length; i++) {
1400
+ if (this.$refs.service_show.showadd_fields.fields[i].label === '金额大写') {
1401
+ let te = {
1402
+ value: this.smalltoBIG(value)
1403
+ }
1404
+ this.$refs.service_show.showadd_fields[i] = te
1405
+ }
1406
+ }
1407
+ }
1408
+
1409
+
1410
+
1411
+ if (this.$refs.service_show.data.fields[index].label === '县/区') {
1412
+ let temp = this.$refs.service_show.data.fields[index].value
1413
+ console.log('==============================县/区:' + temp)
1414
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1415
+ // 控制设置级联
1416
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1417
+ if (this.$refs.service_show.data.fields[i].label === '街道名称') {
1418
+ if (!this.selectShow){
1419
+ this.$refs.service_show.data.fields[i].value = ''
1420
+ }
1421
+ let street = await this.$resetpost('rs/sql/singleTable', {
1422
+ data: {
1423
+ tablename: 't_street',
1424
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_pcd='${temp}'`
1425
+ }
1426
+ }, {resolveMsg: null, rejectMsg: null})
1427
+ let streetrs = []
1428
+ for (let i = 0; i < street.data.length; i++) {
1429
+ let temp = {
1430
+ label: street.data[i].f_street,
1431
+ value: street.data[i].f_street
1432
+ }
1433
+ streetrs.push(temp)
1434
+ }
1435
+
1436
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1437
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1438
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1439
+
1440
+ this.$refs.service_show.update()
1441
+ }
1442
+ }
1443
+ }
1444
+ if (this.$refs.service_show.data.fields[index].label === '气表品牌') {
1445
+ let temp = this.$refs.service_show.data.fields[index].value
1446
+ let meterbrand = await this.$resetpost('rs/sql/singleTable', {
1447
+ data: {
1448
+ //items: 'f_bill_url,f_url_code',
1449
+ tablename: 't_gasbrand',
1450
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${temp}'`
1451
+ }
1452
+ }, {resolveMsg: null, rejectMsg: null})
1453
+ console.log(meterbrand)
1454
+ console.log(meterbrand.data)
1455
+ let idstring = '('
1456
+ idstring += meterbrand.data[0].id
1457
+ console.log("idstring第一个" + idstring)
1458
+ if (meterbrand.data.length > 1) {
1459
+ for (let i = 1; i < meterbrand.data.length; i++) {
1460
+ idstring += ',' + meterbrand.data[i].id
1461
+ }
1462
+ }
1463
+ idstring += ')'
1464
+ console.log("idstring" + idstring)
1465
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1466
+
1467
+ if (this.$refs.service_show.data.fields[i].label === '气表型号') {
1468
+ this.$refs.service_show.data.fields[i].value = ''
1469
+
1470
+
1471
+ let gasbrand = await this.$resetpost('rs/sql/singleTable', {
1472
+ data: {
1473
+ tablename: 't_gasmodel',
1474
+ condition: ` f_gasbrand_id in ${idstring}`
1475
+ }
1476
+ }, {resolveMsg: null, rejectMsg: null})
1477
+ let brandstr = []
1478
+ for (let i = 0; i < gasbrand.data.length; i++) {
1479
+ let brand = {
1480
+ label: gasbrand.data[i].f_meter_style,
1481
+ value: gasbrand.data[i].f_meter_style
1482
+ }
1483
+ brandstr.push(brand)
1484
+ }
1485
+
1486
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...brandstr]
1487
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1488
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1489
+
1490
+ this.$refs.service_show.update()
1491
+ }
1492
+ }
1493
+ }
1494
+
1495
+
1496
+ if (this.$refs.service_show.data.fields[index].label === '气表型号') {
1497
+ let meterstyle= this.$refs.service_show.data.fields[index].value
1498
+ let meterbrand = ''
1499
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1500
+ if (this.$refs.service_show.data.fields[i].label === '气表品牌') {
1501
+ meterbrand = this.$refs.service_show.data.fields[i].value
1502
+ }}
1503
+
1504
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1505
+
1506
+ if (this.$refs.service_show.data.fields[i].label === '别名') {
1507
+ console.log("获取别名")
1508
+ this.$refs.service_show.data.fields[i].value = ''
1509
+
1510
+ let meterbrandalias = await this.$resetpost('rs/sql/getMeterBrand', {
1511
+ data: {
1512
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${meterbrand}' and f_meter_style='${meterstyle}'`
1513
+ }
1514
+ }, {resolveMsg: null, rejectMsg: null})
1515
+
1516
+ let alias = []
1517
+ for (let i = 0; i < meterbrandalias.data.length; i++) {
1518
+ let brand = {
1519
+ label: meterbrandalias.data[i].f_alias,
1520
+ value: meterbrandalias.data[i].f_alias
1521
+ }
1522
+ alias.push(brand)
1523
+ }
1524
+
1525
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...alias]
1526
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1527
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1528
+
1529
+ this.$refs.service_show.update()
1530
+
1531
+ }
1532
+ }
1533
+
1534
+ }
1535
+
1536
+
1537
+ if (this.$refs.service_show.data.fields[index].label === '证件类型') {
1538
+ let temp = this.$refs.service_show.data.fields[index].value
1539
+ console.log('==============================证件类型:' + temp)
1540
+ if (temp === '身份证') {
1541
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1542
+ if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1543
+ this.$refs.service_show.data.fields[i].required = true
1544
+ }
1545
+ }
1546
+ } else {
1547
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1548
+ if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1549
+ this.$refs.service_show.data.fields[i].required = false
1550
+ }
1551
+ }
1552
+ }
1553
+ }
1554
+
1555
+ if (this.$refs.service_show.data.fields[index].label === '是否设计出图') {
1556
+ let temp = this.$refs.service_show.data.fields[index].value
1557
+
1558
+ if (temp === '是') {
1559
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1560
+ if (this.$refs.service_show.data.fields[i].label === '设计派工日期' ||
1561
+ this.$refs.service_show.data.fields[i].label === '设计人员'
1562
+ ) {
1563
+ this.$refs.service_show.data.fields[i].required = true
1564
+ }
1565
+ }
1566
+ } else {
1567
+ console.log("不设计出图,进入else")
1568
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1569
+ if (this.$refs.service_show.data.fields[i].label === '设计派工日期' || this.$refs.service_show.data.fields[i].label === '设计人员') {
1570
+
1571
+ this.$refs.service_show.data.fields[i].required = false
1572
+ }
1573
+ }
1574
+ }
1575
+ }
1576
+
1577
+ if (this.$refs.service_show.data.fields[index].label === '派工单号') {
1578
+ this.$refs.service_show.data.fields[index].value = this.pgd
1579
+ }
1580
+
1581
+
1582
+ if (this.$refs.service_show.data.fields[index].label === '街道名称') {
1583
+ let temp = this.$refs.service_show.data.fields[index].value
1584
+ console.log('=============================街道:' + temp)
1585
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1586
+ // 控制设置级联
1587
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1588
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1589
+ if (!this.selectShow){
1590
+ this.$refs.service_show.data.fields[i].value = ''
1591
+ }
1592
+ let area = await this.$resetpost('rs/sql/singleTable', {
1593
+ data: {
1594
+ tablename: 't_area',
1595
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${temp}'`
1596
+ }
1597
+ }, {resolveMsg: null, rejectMsg: null})
1598
+ let arears = []
1599
+ this.areaall=area.data;
1600
+ for (let i = 0; i < area.data.length; i++) {
1601
+ let temp = {
1602
+ label: area.data[i].f_residential_area,
1603
+ value: area.data[i].f_residential_area
1604
+ }
1605
+ arears.push(temp)
1606
+ }
1607
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
1608
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1609
+ console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
1610
+
1611
+ this.$refs.service_show.update()
1612
+
1613
+ }
1614
+ }
1615
+ }
1616
+
1617
+ if(this.$refs.service_show.data.fields[index].label === '小区名称'){
1618
+ for (let i = 0; i < this.areaall.length; i++) {
1619
+ console.log("aaaaaaaaaaaa")
1620
+ if(this.areaall[i].f_residential_area== this.$refs.service_show.data.fields[index].value){
1621
+ console.log("abbbbbbbbb")
1622
+ for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
1623
+ if(this.$refs.service_show.data.fields[j].label === '小区地址'){
1624
+ console.log(this.areaall[i].f_area_address)
1625
+ this.$refs.service_show.data.fields[j].value=this.areaall[i].f_area_address
1626
+ }
1627
+ }
1628
+ }
1629
+ }
1630
+ }
1631
+ //控制尾款
1632
+ if (
1633
+ this.$refs.service_show.data.fields[index].label === '合同金额' ||
1634
+ this.$refs.service_show.data.fields[index].label === '首付' ||
1635
+ this.$refs.service_show.data.fields[index].label === '进度款' ||
1636
+ this.$refs.service_show.data.fields[index].label === '尾款'
1637
+ ) {
1638
+ console.log('即将计算合同金额')
1639
+ var cash = 0
1640
+ var downpayments = 0
1641
+ var tailmoney = 0
1642
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1643
+ // 控制设置级联
1644
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1645
+ // xxx xx xxx
1646
+ if (this.$refs.service_show.data.fields[i].label === '合同金额' && this.$refs.service_show.data.fields[i].value) {
1647
+ cash = this.$refs.service_show.data.fields[i].value
1648
+ }
1649
+ if (this.$refs.service_show.data.fields[i].label === '首付' && this.$refs.service_show.data.fields[i].value) {
1650
+ downpayments = this.$refs.service_show.data.fields[i].value
1651
+ }
1652
+ if (this.$refs.service_show.data.fields[i].label === '进度款' && this.$refs.service_show.data.fields[i].value) {
1653
+ tailmoney = this.$refs.service_show.data.fields[i].value
1654
+ }
1655
+ }
1656
+ var a = cash - downpayments
1657
+ // 数据计算完毕得到尾款
1658
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1659
+ if (this.$refs.service_show.data.fields[i].label === '尾款') {
1660
+ if (cash === downpayments) {
1661
+ this.$refs.service_show.data.fields[i].value = 0
1662
+ } else {
1663
+ this.$refs.service_show.data.fields[i].value = (cash - downpayments - tailmoney)
1664
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1665
+ }
1666
+ }
1667
+ if (this.$refs.service_show.data.fields[i].label === '首付') {
1668
+ if (a < 0) {
1669
+ this.$showMessage("首付款数额过大")
1670
+ downpayments = 0
1671
+ this.$refs.service_show.data.fields[i].value = 0
1672
+ }
1673
+ }
1674
+
1675
+ if (this.$refs.service_show.data.fields[i].label === '进度款') {
1676
+
1677
+ if (cash === downpayments) {
1678
+ tailmoney = 0
1679
+ this.$refs.service_show.data.fields[i].value = 0
1680
+ this.$refs.service_show.data.fields[i].readonly = true
1681
+ } else {
1682
+ this.$refs.service_show.data.fields[i].readonly = false
1683
+ tailmoney = this.$refs.service_show.data.fields[i].value
1684
+ }
1685
+ if (tailmoney > a) {
1686
+ this.$showMessage("进度款数额过大")
1687
+ tailmoney = 0
1688
+ this.$refs.service_show.data.fields[i].value = 0
1689
+ }
1690
+ }
1691
+ }
1692
+ }
1693
+
1694
+
1695
+ // 合成地址
1696
+ if (
1697
+ this.$refs.service_show.data.fields[index].label === '县/区' ||
1698
+ this.$refs.service_show.data.fields[index].label === '街道名称' ||
1699
+ this.$refs.service_show.data.fields[index].label === '小区名称' ||
1700
+ this.$refs.service_show.data.fields[index].label === '楼号' ||
1701
+ this.$refs.service_show.data.fields[index].label === '单元号' ||
1702
+ this.$refs.service_show.data.fields[index].label === '楼层' ||
1703
+ this.$refs.service_show.data.fields[index].label === '门牌号'
1704
+ ) {
1705
+ console.log('即将合成地址')
1706
+ var address = ''
1707
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1708
+ // 控制设置级联
1709
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1710
+ // xxx xx xxx
1711
+ if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
1712
+ address += this.$refs.service_show.data.fields[i].value
1713
+ if (address.indexOf('湖北省')!=-1){
1714
+ address = address.replace('湖北省','')
1715
+ }
1716
+ }
1717
+ if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
1718
+ address += this.$refs.service_show.data.fields[i].value
1719
+ }
1720
+ if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
1721
+ address += this.$refs.service_show.data.fields[i].value
1722
+ }
1723
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1724
+ address += this.$refs.service_show.data.fields[i].value
1725
+ }
1726
+ /* if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1727
+ address += '栋'
1728
+ } */
1729
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1730
+ address += '-' +this.$refs.service_show.data.fields[i].value
1731
+ }
1732
+ /* if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1733
+ address += '单元'
1734
+ } */
1735
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1736
+ address += '-' +this.$refs.service_show.data.fields[i].value
1737
+ }
1738
+ /* if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1739
+ address += '层'
1740
+ } */
1741
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1742
+ address += '-' +this.$refs.service_show.data.fields[i].value
1743
+ }
1744
+ /* if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1745
+ address += '室'
1746
+ } */
1747
+
1748
+ }
1749
+ console.log('获取到的address=>' + address)
1750
+ // 数据获取完毕时放入地址text
1751
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1752
+ if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
1753
+ this.$refs.service_show.data.fields[i].value = address
1754
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1755
+ }
1756
+ }
1757
+ }
1758
+ // 开户费+材料费+人工费+设备安装费=合计
1759
+ if (
1760
+ this.$refs.service_show.data.fields[index].label === '工程安装费' ||
1761
+ this.$refs.service_show.data.fields[index].label === '材料费' ||
1762
+ this.$refs.service_show.data.fields[index].label === '人工费'
1763
+ ) {
1764
+ console.log('即将合成价格')
1765
+ let a1 = 0
1766
+ let b1 = 0
1767
+ let c1 = 0
1768
+ let fee = 0
1769
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1770
+ // 控制设置级联
1771
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1772
+ // xxx xx xxx
1773
+ if (this.$refs.service_show.data.fields[i].label === '工程安装费' && this.$refs.service_show.data.fields[i].value) {
1774
+ a1 = this.$refs.service_show.data.fields[i].value
1775
+ }
1776
+ if (this.$refs.service_show.data.fields[i].label === '材料费' && this.$refs.service_show.data.fields[i].value) {
1777
+ b1= this.$refs.service_show.data.fields[i].value
1778
+ }
1779
+ if (this.$refs.service_show.data.fields[i].label === '人工费' && this.$refs.service_show.data.fields[i].value) {
1780
+ c1 = this.$refs.service_show.data.fields[i].value
1781
+ }
1782
+ fee=parseFloat(parseFloat(a1) + parseFloat(b1)+parseFloat(c1)).toFixed(2)
1783
+ // 数据获取完毕时放入地址text
1784
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1785
+ if (this.$refs.service_show.data.fields[i].label === '费用合计'||this.$refs.service_show.data.fields[i].label === '未结总金额') {
1786
+ this.$refs.service_show.data.fields[i].value =fee
1787
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1788
+ }
1789
+ }
1790
+ }
1791
+ }
1792
+ if (this.$refs.service_show.data.fields[index].label == '用户类型'){
1793
+ if(this.$refs.service_show.data.fields[index].value == '非民用'){
1794
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1795
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1796
+ this.$refs.service_show.data.fields[i].required=false;
1797
+ }
1798
+ if (this.$refs.service_show.data.fields[i].label === '地址') {
1799
+ this.$refs.service_show.data.fields[i].readonly=false;
1800
+ this.$refs.service_show.data.fields[i].disabled=false;
1801
+ }
1802
+ }
1803
+ }else{
1804
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1805
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1806
+ this.$refs.service_show.data.fields[i].required=true;
1807
+ }
1808
+ }
1809
+ }
1810
+ }
1811
+
1812
+ if (this.$refs.service_show.data.fields[index].label === '施工是否完成') {
1813
+ let temp = this.$refs.service_show.data.fields[index].value
1814
+ console.log('==============================施工是否完成:' + temp)
1815
+ if (temp === '是') {
1816
+ let f_project_material = ''
1817
+ if (this.$refs.service_show.data.defname === '施工') {
1818
+ let http = new HttpResetClass()
1819
+ let data = {
1820
+ f_process_id: this.$refs.service_show.data.f_process_id,
1821
+ defname: this.$refs.service_show.data.defname
1822
+ }
1823
+ let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1824
+ {resolveMsg: null, rejectMsg: null})
1825
+ res.data.forEach(item =>{
1826
+ f_project_material += item.fusetype + ','
1827
+ })
1828
+ }
1829
+
1830
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1831
+ if (this.$refs.service_show.data.fields[i].label === '施工已上传文件') {
1832
+ this.$refs.service_show.data.fields[i].value = f_project_material
1833
+ }
1834
+ }
1835
+ }
1836
+ }
1837
+
1838
+ if (this.$refs.service_show.data.fields[index].label === '验收是否完成') {
1839
+ let temp = this.$refs.service_show.data.fields[index].value
1840
+ console.log('==============================验收是否完成:' + temp)
1841
+ if (temp === '是') {
1842
+ let f_iscomplete_information = ''
1843
+ if (this.$refs.service_show.data.defname === '施工验收') {
1844
+ let http = new HttpResetClass()
1845
+ let data = {
1846
+ f_process_id: this.$refs.service_show.data.f_process_id,
1847
+ defname: this.$refs.service_show.data.defname
1848
+ }
1849
+ let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1850
+ {resolveMsg: null, rejectMsg: null})
1851
+ res.data.forEach(item =>{
1852
+ f_iscomplete_information += item.fusetype + ','
1853
+ })
1854
+ }
1855
+
1856
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1857
+ if (this.$refs.service_show.data.fields[i].label === '验收已上传文件') {
1858
+ this.$refs.service_show.data.fields[i].value = f_iscomplete_information
1859
+ }
1860
+ }
1861
+ }
1862
+ }
1863
+ if (this.$refs.service_show.data.fields[index].label === '业务类型'){
1864
+ if(this.$refs.service_show.data.fields[index].value === '改管'){
1865
+ for (let i = 0; i < this.$refs.service_show.data.components.length; i++){
1866
+ if (this.$refs.service_show.data.components[i].name === 'select-userinfo'){
1867
+ this.$refs.service_show.data.components[i].device = 'pc'
1868
+ }
1869
+ }
1870
+ }else{
1871
+ for (let i = 0; i < this.$refs.service_show.data.components.length; i++){
1872
+ if (this.$refs.service_show.data.components[i].name === 'select-userinfo'){
1873
+ this.$refs.service_show.data.components[i].device = 'hidden'
1874
+ }
1875
+ }
1876
+ }
1877
+ }
1878
+
1879
+ },
1880
+ // onetomany模态框监听事件
1881
+ async 'select_cascade_modal'(i,j){
1882
+ if(this.data.onetomany[i].tables[0]=='t_apply_construct_balance'){
1883
+ if(this.data.onetomany[i].fields[j].label == '第三施工方'){
1884
+ for(let k =0;k<this.data.onetomany[i].fields.length;k++){
1885
+
1886
+ if(this.data.onetomany[i].fields[k].label.includes('当前累计结算比例')){
1887
+ let sum = 0
1888
+ for(let p =0;p<this.$refs.service_show.model.rows[i].length;p++){
1889
+ if(this.$refs.service_show.model.rows[i][p].f_construct_company == this.$refs.service_show.showadd_fields.fields[j].value){
1890
+ sum+=Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1891
+ sum+=Number(this.$refs.service_show.model.rows[i][p].f_balance_scale)
1892
+ }
1893
+ }
1894
+ if(this.$refs.service_show.model.rows[i].length==0){
1895
+ sum = Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1896
+ }
1897
+ this.$refs.service_show.update_showadd_fields_value(k,sum)
1898
+ }
1899
+ }
1900
+ }
1901
+ }
1902
+ },
1903
+ async 'onetomanyevent'(datas) {
1904
+ // console.log(`onetomany=======>${JSON.stringify(datas)}`)
1905
+
1906
+ for (let i = 0; i < datas.rows.length; i++) {
1907
+ datas.rows[i]['f_process_id'] = this.selectdata.f_process_id
1908
+ datas.rows[i]['f_apply_num'] = this.selectdata.f_apply_num
1909
+ datas.rows[i]['f_filiale'] = this.$login.f.f_fengongsi
1910
+ datas.rows[i]['f_parentname'] = this.$login.f.f_parentname
1911
+ datas.rows[i]['f_operator'] = this.$login.f.name
1912
+ }
1913
+ let http = new HttpResetClass()
1914
+ await http.load('POST', 'rs/logic/saveentity', datas, {resolveMsg: null, rejectMsg: 'search查询部门下所有人失败'})
1915
+ }
1916
+ ,
1917
+ // 获取view层button事件/
1918
+ async 'button'(model) {
1919
+ console.log("button事件接收参数:", model)
1920
+ if (this.data.defname==='踏勘'||this.data.defname==='施工'||this.data.defname==='施工验收'){
1921
+ if (model.button.button_name === '终止'){
1922
+ this.stop_show=true
1923
+ return
1924
+ }
1925
+ }
1926
+ /* if (this.data.defname === '通气转单'){
1927
+ if (model.button.button_name === '散户报装'){
1928
+ this.addactive('报装申请')
1929
+ }
1930
+ if (model.button.button_name === '集体报装'){
1931
+ this.addactive('集体报装申请')
1932
+ }
1933
+ setTimeout(() => {
1934
+
1935
+ }, 200)
1936
+ }*/
1937
+
1938
+ // 点击重置按钮就重置数据
1939
+ if (model.button.button_name === '重置') {
1940
+ this.refurbish()
1941
+ return
1942
+ }
1943
+ if (model.button.button_name === '打印表1' || model.button.button_name === '打印表2') {
1944
+ this.printoverview(model.button.button_name)
1945
+ return
1946
+ }
1947
+ if (model.button.button_name === '打印回单') {
1948
+ this.printReceipt(model)
1949
+ return
1950
+ }
1951
+ var operate = ''
1952
+ // 判断当前按钮是否为特殊业务,即子流程提交或者分发
1953
+ if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '子流程提交') {
1954
+ operate = '子流程提交'
1955
+ }
1956
+ if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '合同信息') {
1957
+ model.f_budget_money = model.f_contract_money
1958
+ //未结算总金额=合计
1959
+ model.f_unaccounts_money = model.f_total_cost
1960
+ model.f_cumulative_money = 0
1961
+ model.f_cumulative_invoicing = 0
1962
+ model.f_additional_payment = 0
1963
+ model.f_residual_invoicing = model.f_contract_money
1964
+ }
1965
+ if (model.button.button_name === '下发') {
1966
+ if (model.button && model.button.button_event === '分发') {
1967
+ operate = '分发'
1968
+ }
1969
+ let array = this.$login.f.rolesnames.split(',')
1970
+ if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1971
+ model.f_survey_name = model.button.button_fields.f_apply_kefu_employee
1972
+ }
1973
+ }
1974
+
1975
+ if (model.button.button_name == '提交' && model.button.button_person && model.button.button_person.button_event === '获取之前被下发人' && model.button.button_person.button_person_field) {
1976
+ model.button.button_name = '下发'
1977
+ model.button.button_fields = {}
1978
+ console.log(model.button.button_person.button_person_field)
1979
+ console.log(this.selectdata[model.button.button_person.button_person_field])
1980
+ console.log(this.selectdata)
1981
+ if(this.selectdata[model.button.button_person.button_person_field].startsWith('{')){
1982
+ let temp= JSON.parse(this.selectdata[model.button.button_person.button_person_field])
1983
+ model.button.button_fields[model.button.button_person.button_person_field] = temp.id
1984
+ }else{
1985
+ model.button.button_fields[model.button.button_person.button_person_field] = this.selectdata[model.button.button_person.button_person_field]
1986
+ }
1987
+
1988
+ }
1989
+ if (model.button.button_name === '提交') {
1990
+ // for (let i = 0; i < this.show_data.fields.length; i++) {
1991
+ // if (this.show_data.fields[i].label === '收费项目') {
1992
+ // let yuanXiang = this.show_data.fields[i].value
1993
+ // if (yuanXiang != '' && yuanXiang != null) {
1994
+ // for (let i = 0; i < yuanXiang.length; i++) {
1995
+ // this.xia += yuanXiang[i] + '-'
1996
+ // }
1997
+ // let idx = this.xia.lastIndexOf("-");
1998
+ // this.xiangmu = this.xia.substring(0,idx)
1999
+ // }
2000
+ // model.f_charge_items = this.xiangmu
2001
+ // }
2002
+ // }
2003
+ var flag = false
2004
+ if (this.data.defname == '合同审核') {
2005
+ flag = true
2006
+ let http = new HttpResetClass()
2007
+ let data = {
2008
+ tablename: 't_singlevalue',
2009
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
2010
+ }
2011
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
2012
+ resolveMsg: null,
2013
+ rejectMsg: "获取合同编号失败"
2014
+ })
2015
+ if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
2016
+ this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
2017
+ return
2018
+ }
2019
+ }
2020
+
2021
+ }
2022
+ console.log('本次点击button执行的操作是=>' + operate)
2023
+ model = Object.assign({}, this.selectdata, model)
2024
+ model.f_sub_state = '未完工'
2025
+ if (this.data.defname === '通气转单' && model.button.button_name === '提交'){
2026
+ model.f_sub_state = '完工'
2027
+ }
2028
+ let http = new HttpResetClass()
2029
+ var url
2030
+ var requestData = {
2031
+ tables: this.data.tables,
2032
+ start_activity: this.$workflow_vue.start_activity,
2033
+ model: model,
2034
+ loginUser: this.$login.f
2035
+ }
2036
+ if (operate != '') {
2037
+ // 特殊操作走特殊logic业务处理
2038
+ url = 'rs/logic/SubprocessService'
2039
+ requestData = {
2040
+ tables: this.data.tables, model: model
2041
+ }
2042
+ } else if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步合并处理') {
2043
+ url = 'rs/logic/branchsyncprocess'
2044
+ requestData = {
2045
+ tables: this.data.tables, model: model
2046
+ }
2047
+ } else {
2048
+ if(requestData.model.f_stair_price_name === ''|| requestData.model.f_stair_price_name === null|| requestData.model.f_stair_price_name === undefined){
2049
+ requestData.model.f_stair_price_name = this.selectdata.f_stair_price_name
2050
+ }
2051
+ console.log("流程下一步",requestData.model.f_stair_price_name)
2052
+ // 下发,提交,保存,退回通用业务后台处理logic
2053
+ url = 'rs/logic/ApplyProductService'
2054
+ requestData = {
2055
+ tables: this.data.tables, model: model
2056
+ }
2057
+ }
2058
+ if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
2059
+ this.apply_show=true
2060
+ this.models2 = model
2061
+ return
2062
+ }
2063
+
2064
+ requestData.start_activity = this.$workflow_vue.start_activity
2065
+ requestData.loginUser = this.$login.f
2066
+ requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
2067
+
2068
+ console.log('即将发送请求url=>' + url + ',参数=>' + JSON.stringify(requestData))
2069
+ let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
2070
+ console.log("service处理完成返回数据:", JSON.stringify(res.data))
2071
+ if(res.data.msg=="地址重复,请修改后重新提交"){
2072
+ this.$showMessage(res.data.msg)
2073
+ }
2074
+ if (res.data.code == 200) {
2075
+ // flag 为合同编号更新标志
2076
+ if (flag) {
2077
+ let http = new HttpResetClass()
2078
+ let data = {
2079
+ tablename: 't_singlevalue',
2080
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
2081
+ value: (Number(this.contract) + 1) + ''
2082
+ }
2083
+ await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
2084
+ resolveMsg: null,
2085
+ rejectMsg: "获取合同编号更新失败"
2086
+ })
2087
+ }
2088
+ this.showview = false
2089
+ // 特殊处理
2090
+ this.special(model)
2091
+ this.$dispatch('close')
2092
+ this.initializtion()
2093
+ } else {
2094
+ if (res.data.msg) {
2095
+ this.$showMessage(res.data.msg)
2096
+ }
2097
+ }
2098
+ /*
2099
+ if(this.selectdata.defname =='报装申请'|| this.selectdata.defname =='现场勘查'|| this.selectdata.defname =='验收'||this.selectdata.defname =='集体报装申请'||this.selectdata.defname =='现场勘查人员分配'||this.selectdata.defname =='安装通气' ){
2100
+ console.log("defname======================================",this.selectdata.defname)
2101
+ let http1 = new HttpResetClass();
2102
+ let sendtime = null;
2103
+ let finishtime = null;
2104
+ let f_department = null;
2105
+ let f_process_id = null;
2106
+ let data1 = {
2107
+ f_process_id: this.selectdata.f_process_id,
2108
+ defname : this.selectdata.defname
2109
+ }
2110
+ console.log("res1=======================================",data1)
2111
+ await http1.load('POST', 'rs/logic/getTime', {data:data1}).then((res) => {
2112
+ console.log("objk===>",res.data)
2113
+ sendtime=res.data.getUserid[0].sendtime;
2114
+ finishtime=res.data.getUserid[0].finishtime;
2115
+ f_department=res.data.resdata[0].name;
2116
+ console.log("objk===>")
2117
+ })
2118
+
2119
+ let data2 = {
2120
+ department:f_department,
2121
+ resourceCatalog:this.selectdata.defname,
2122
+ sqzt:model.f_user_name,
2123
+ code:model.f_idnumber,
2124
+ sqsj:sendtime,
2125
+ slsj:sendtime,
2126
+ bjsj:finishtime,
2127
+ blcb:0,
2128
+ sqclsl:0,
2129
+ sqclmc:'',
2130
+ gdlsh:'',
2131
+ sbdz:model.f_address,
2132
+ sldw:'鄂州市安泰天然气有限责任公司',
2133
+ sfyj:'',
2134
+ gxzq:'',
2135
+ type:this.selectdata.defname
2136
+ }
2137
+ console.log("====================================",data2)
2138
+ await http1.load('POST', 'rs/logic/getPost', {data:data2})
2139
+ }
2140
+ */
2141
+ }
2142
+ ,
2143
+ async 'onetomanydelete'(i, j) {
2144
+ let http = new HttpResetClass()
2145
+ let data = {
2146
+ tables: this.show_data.onetomany[i].tables,
2147
+ row: this.$refs.service_show.model.rows[i][j]
2148
+ }
2149
+ await http.load('POST', 'rs/logic/applyDeleteValue', {data: data}, {
2150
+ resolveMsg: null,
2151
+ rejectMsg: 'onetomanydelete失败'
2152
+ }).then(() => {
2153
+ this.$dispatch('selfsearch')
2154
+ this.$refs.service_show.model.rows[i].splice(j, 1)
2155
+ })
2156
+ }
2157
+ ,
2158
+ //获取view层confirm事件
2159
+ async 'confirm'(tables, row, showadd_index, j) {
2160
+ var _this = this
2161
+ for (let i = 0; i < tables.length; i++) {
2162
+ let datas = {
2163
+ tables: tables,
2164
+ row: row
2165
+ }
2166
+ console.log("看看datas")
2167
+ console.log(datas)
2168
+ console.log("看看showadd_index")
2169
+ console.log(showadd_index)
2170
+ datas.row['f_process_id'] = this.selectdata.f_process_id
2171
+ datas.row['f_apply_num'] = this.selectdata.f_apply_num
2172
+ datas.row['f_filiale'] = this.selectdata.f_filiale
2173
+ let http = new HttpResetClass()
2174
+ let sellid = ''
2175
+ let billtype = datas.row['f_bill_style']
2176
+ if (tables[i] == 't_charge_record') {
2177
+ await this.loadbuyer()
2178
+ if (this.buyerinfo.rows.length < 1 && billtype === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
2179
+ this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
2180
+ this.$refs.service_show.model.rows[showadd_index].splice(j, 1)
2181
+ this.$refs.service_show.initializtion()
2182
+ return
2183
+ }
2184
+ datas.row.f_charging_status = '有效'
2185
+ datas.row.f_is_correct = '否'
2186
+ datas.row.f_charge_collectors = this.$login.f.name
2187
+ datas.row.f_amount_words=this.smalltoBIG(datas.row.f_charge_money)
2188
+ await http.load('POST', 'rs/logic/applycharge', datas, {
2189
+ resolveMsg: null,
2190
+ rejectMsg: '收费保存失败'
2191
+ }).then((res) => {
2192
+ sellid = JSON.parse(res.data.sellid).id
2193
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2194
+ //
2195
+ // if (this.$refs.service_show.data.fields[i].label == '累计缴费金额') {
2196
+ // this.$refs.service_show.data.fields[i].value = res.data.f_cumulative_money
2197
+ // }
2198
+ //
2199
+ // if (this.$refs.service_show.data.fields[i].label == '未结总金额') {
2200
+ // this.$refs.service_show.data.fields[i].value = res.data.f_unaccounts_money
2201
+ // }
2202
+
2203
+ }
2204
+ let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2205
+ temp.id = sellid
2206
+ _this.$refs.service_show.model.rows[showadd_index][j] = temp
2207
+ })
2208
+ if (this.$appdata.getSingleValue('默认打印票据') && this.$appdata.getSingleValue('默认打印票据') === '是') {
2209
+ this.$showMessage('是否打票据', ['confirm', 'cancel']).then((res) => {
2210
+ if (res === 'confirm') {
2211
+ console.log('打印票据')
2212
+ if (billtype === '增值税电子发票') {
2213
+ this.selectsellid = sellid
2214
+ this.showbuyerinfo = true
2215
+ } else {
2216
+ this.printbill(sellid)
2217
+ }
2218
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2219
+ if (this.$refs.service_show.data.fields[i].label == '累计开票金额') {
2220
+ console.log("计算累计开票金额")
2221
+ this.$refs.service_show.data.fields[i].value = parseInt(this.$refs.service_show.data.fields[i].value) + this.datas.row.f_cumulative_invoicing
2222
+ }
2223
+ }
2224
+ }
2225
+ })
2226
+ }
2227
+ // 刷新列表数据
2228
+ console.log("刷新一下")
2229
+ this.$dispatch('selfsearch')
2230
+ console.log("刷新完成")
2231
+ } else {
2232
+ await http.load('POST', 'rs/logic/saveentity', datas, {
2233
+ resolveMsg: null,
2234
+ rejectMsg: 'onetomany保存失败'
2235
+ }).then((res) => {
2236
+ // 刷新列表数据
2237
+ this.$dispatch('selfsearch')
2238
+ let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2239
+ temp.id = res.data.id
2240
+ _this.$refs.service_show.model.rows[showadd_index][j] = temp
2241
+ })
2242
+ }
2243
+ }
2244
+ },
2245
+ 'selectUserinfo' (row) {
2246
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2247
+ if (this.$refs.service_show.data.fields[i].label === '联系人') {
2248
+ this.$refs.service_show.data.fields[i].value = row.f_user_name
2249
+ }else if(this.$refs.service_show.data.fields[i].label === '电话号码'){
2250
+ this.$refs.service_show.data.fields[i].value = row.f_user_phone
2251
+ }else if(this.$refs.service_show.data.fields[i].label === '用户类型'){
2252
+ this.$refs.service_show.data.fields[i].value = row.f_user_type
2253
+ }else if(this.$refs.service_show.data.fields[i].label === '县/区'){
2254
+ this.$refs.service_show.data.fields[i].value = row.f_area
2255
+ }else if(this.$refs.service_show.data.fields[i].label === '街道名称'){
2256
+ this.$refs.service_show.data.fields[i].value = row.f_street
2257
+ }else if(this.$refs.service_show.data.fields[i].label === '小区名称'){
2258
+ this.$refs.service_show.data.fields[i].value = row.f_residential_area
2259
+ }else if(this.$refs.service_show.data.fields[i].label === '楼号'){
2260
+ this.$refs.service_show.data.fields[i].value = row.f_building
2261
+ }else if(this.$refs.service_show.data.fields[i].label === '单元号'){
2262
+ this.$refs.service_show.data.fields[i].value = row.f_unit
2263
+ }else if(this.$refs.service_show.data.fields[i].label === '楼层'){
2264
+ this.$refs.service_show.data.fields[i].value = row.f_floor
2265
+ }else if(this.$refs.service_show.data.fields[i].label === '门牌号'){
2266
+ this.$refs.service_show.data.fields[i].value = row.f_room
2267
+ }else if(this.$refs.service_show.data.fields[i].label === '气表品牌'){
2268
+ this.$refs.service_show.data.fields[i].value = row.f_meter_brand
2269
+ }else if(this.$refs.service_show.data.fields[i].label === '气表型号'){
2270
+ this.$refs.service_show.data.fields[i].value = row.f_meter_style
2271
+ }else if(this.$refs.service_show.data.fields[i].label === '表号'){
2272
+ this.$refs.service_show.data.fields[i].value = row.f_meternumber
2273
+ }else if(this.$refs.service_show.data.fields[i].label === '左右表'){
2274
+ this.$refs.service_show.data.fields[i].value = row.f_aroundmeter
2275
+ }
2276
+ }
2277
+ this.selectShow = true
2278
+ console.log("当前数据",JSON.stringify(this.$refs.service_show.data))
2279
+ }
2280
+ }
2281
+ }
2282
+ </script>