apply-clients 5.0.35-ezhou-16 → 5.0.35-ezhou-18

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