apply-clients 5.0.35-58 → 5.0.35-60

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