apply-clients 5.0.35-92 → 5.0.35-93

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