apply-clients 5.0.35-61 → 5.0.35-64

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