apply-clients 3.0.10-21 → 3.0.10-210

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 (65) hide show
  1. package/.gradle/3.5/file-changes/last-build.bin +0 -0
  2. package/.gradle/3.5/taskHistory/taskHistory.lock +0 -0
  3. package/.gradle/5.2.1/executionHistory/executionHistory.bin +0 -0
  4. package/.gradle/5.2.1/executionHistory/executionHistory.lock +0 -0
  5. package/.gradle/5.2.1/fileChanges/last-build.bin +0 -0
  6. package/.gradle/5.2.1/fileHashes/fileHashes.bin +0 -0
  7. package/.gradle/5.2.1/fileHashes/fileHashes.lock +0 -0
  8. package/.gradle/5.2.1/gc.properties +0 -0
  9. package/.gradle/buildOutputCleanup/built.bin +0 -0
  10. package/.gradle/buildOutputCleanup/cache.properties +2 -0
  11. package/.gradle/buildOutputCleanup/cache.properties.lock +1 -0
  12. package/.gradle/vcs-1/gc.properties +0 -0
  13. package/doc//346/226/260/347/224/250/346/210/267/350/212/261/345/220/215/345/206/214/345/257/274/345/205/245/346/250/241/346/235/277.xls +0 -0
  14. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  15. package/gradle/wrapper/gradle-wrapper.properties +5 -0
  16. package/gradlew +0 -0
  17. package/gradlew.bat +84 -0
  18. package/package.json +5 -4
  19. package/src/apply.js +187 -146
  20. package/src/components/Util.js +26 -22
  21. package/src/components/app_apply/ApplyDownList.vue +21 -8
  22. package/src/components/app_apply/ApplyToDoList.vue +83 -59
  23. package/src/components/app_apply/ApplyUserInfo.vue +3 -3
  24. package/src/components/app_apply/PlaceControler.vue +255 -255
  25. package/src/components/app_apply/ServiceControl.vue +1387 -1387
  26. package/src/components/app_apply/ServiceView.vue +583 -361
  27. package/src/components/image/doc.jpg +0 -0
  28. package/src/components/image/excel.jpg +0 -0
  29. package/src/components/image/pdf.jpg +0 -0
  30. package/src/components/product/BatchFunction/BatchPay.vue +663 -0
  31. package/src/components/product/Function/InstallFunction.vue +9 -9
  32. package/src/components/product/Function/InstallInfoSelect.vue +230 -38
  33. package/src/components/product/Function/Service/FunctionServiceControl.vue +3 -1
  34. package/src/components/product/Function/functions/InstallFee.vue +58 -35
  35. package/src/components/product/Function/functions/StopInstall.vue +13 -1
  36. package/src/components/product/HiddenDangersInProjects/AddHiddenDangers.vue +957 -0
  37. package/src/components/product/HiddenDangersInProjects/HiddenProjectList.vue +425 -0
  38. package/src/components/product/HiddenDangersInProjects/HiddenProjectSchedule.vue +146 -0
  39. package/src/components/product/Process/ExplorationSelect.vue +302 -71
  40. package/src/components/product/Process/ExplorationUser.vue +18 -3
  41. package/src/components/product/Process/Processes/CustomerRecordMessage.vue +736 -201
  42. package/src/components/product/Process/Processes/Service/ApplyChargeSearch.vue +75 -69
  43. package/src/components/product/Process/Processes/Service/ServiceControl.vue +3172 -3053
  44. package/src/components/product/ProjectManagement/AddProjectSchedule.vue +863 -0
  45. package/src/components/product/ProjectManagement/ProjectList.vue +420 -0
  46. package/src/components/product/ProjectManagement/ProjectSchedule.vue +146 -0
  47. package/src/components/product/ReportForm/PaymentRecord.vue +801 -0
  48. package/src/components/product/ReportForm/PaymentRecordAdd.vue +105 -0
  49. package/src/components/product/ReportForm/PaymentRecordBad.vue +1273 -0
  50. package/src/components/product/ReportForm/PaymentRecordDetailed.vue +472 -0
  51. package/src/components/product/ReportForm/PaymentRecordTooBad.vue +60 -0
  52. package/src/components/product/ReportForm/PaymentReport.vue +532 -0
  53. package/src/components/product/ReportForm/ProjectReport.vue +447 -0
  54. package/src/components/product/ReportForm/SettlementReport.vue +336 -0
  55. package/src/components/product/ReportForm/SummaryReport.vue +451 -0
  56. package/src/components/product/ReportForm/UserReport.vue +402 -0
  57. package/src/components/product/ServiceView.vue +17 -9
  58. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +36 -2
  59. package/src/components/product/Supervisory/SupervisoryControl.vue +30 -6
  60. package/src/components/product/Supervisory/SupervisoryList.vue +249 -34
  61. package/src/components/product/VueUtils/ApplyUpload.vue +310 -0
  62. package/src/components/product/VueUtils/rightview/InstallCardList2.vue +0 -1
  63. package/src/main.js +4 -0
  64. package/success.rar +0 -0
  65. package/doc//350/212/261/345/220/215/345/206/214/345/257/274/345/205/245/346/250/241/346/235/277.xlsx +0 -0
@@ -1,1387 +1,1387 @@
1
- <template>
2
- <service-view-app v-ref:service_show :data="show_data" v-if="showview"></service-view-app>
3
- </template>
4
- <script>
5
- import co from 'co'
6
- import Vue from 'vue'
7
- import {HttpResetClass} from 'vue-client'
8
- export default {
9
- title: '报建流程业务控制层',
10
- props: ['selectdata'],
11
- data () {
12
- return {
13
- data:null, // 数据库数据,json配置文件数据的数据集合
14
- json_datas:null, // Json配置文件集合
15
- showview:false, // 控制显示service-view组件
16
- show_data:null, // 给view层显示的数据
17
- department_search:null // 当前部门下所有人
18
- }
19
- },
20
- methods: {
21
- // 特殊化处理
22
- async special(model){
23
- console.log('进入async special方法')
24
- if(this.data.distribute_async && model.button.button_name==='下发'){
25
- // 流程异步处理
26
- let http = new HttpResetClass();
27
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
28
- console.log("流程的异步处理:",JSON.stringify(res.data))
29
- }
30
- if(this.data.distribute_async && model.button.button_name==='完成'){
31
- // 强制结束
32
- let http = new HttpResetClass();
33
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
34
- console.log("流程的异步处理:",JSON.stringify(res.data))
35
- }
36
- },
37
- // 组件初始化操作
38
- refurbish(){
39
- if(!this.$workflow_vue){
40
- this.$showMessage('流程配置文件不存在,请反馈系统管理员')
41
- return
42
- }
43
- console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
44
- this.json_datas=this.$workflow_vue
45
- let sum = 0
46
- let jsonData ={}
47
- for(let i=0;i<this.json_datas.activitys.length;i++){
48
- if(this.selectdata.defname==this.json_datas.activitys[i].title){
49
- jsonData = this.json_datas.activitys[i]
50
- sum++
51
- }
52
- }
53
- console.log('sum=>' + sum)
54
- if(sum==1){
55
- this.data =null
56
- this.data = jsonData
57
- console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
58
- this.initializtion()
59
-
60
- } else if(sum==0) {
61
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
62
- } else {
63
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
64
- }
65
- },
66
- // json配置数据处理 比如下拉框的options
67
- async initializtion() {
68
-
69
- console.log('进入initializtion()方法')
70
- console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
71
- console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
72
- // 下发人 options 处理,options初始化
73
- if(this.selectdata.actorexpression){
74
- //截取actorexpression
75
-
76
- let http = new HttpResetClass()
77
- var url = this.$androidUtil.getProxyUrl() + '/rs/search'
78
- console.log('即将请求后台获取下发人员,url=>' + url)
79
- // R(安装员报装)
80
-
81
- let actorexpression=this.selectdata.actorexpression
82
- //let actorexpression="R(安装员报装)"
83
- let actor=actorexpression.substring(actorexpression.indexOf('(')+1,actorexpression.indexOf(')'))
84
- console.log("看看角色"+JSON.stringify(actor))
85
- let res = await http.load('POST', url, {source:`tool.getChildrenOfResName($${actor}$)`,userid:Vue.user.id}, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
86
- console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
87
- let jsonString = JSON.stringify(res.data)
88
- let jsonArray = []
89
- if(jsonString.startsWith("{")){
90
- jsonArray.push(res.data)
91
- res.data = jsonArray
92
- }
93
- this.department_search = res.data
94
- }
95
-
96
- // data 填充 selectdata
97
- console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
98
- this.data = Object.assign({},this.data, this.selectdata)
99
- console.log('this.data的值=>' + JSON.stringify(this.data))
100
-
101
- // 初始化 fields
102
- console.log('this.data.fields.length=>' + this.data.fields.length)
103
- for(let i=0;i<this.data.fields.length;i++){
104
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
105
- if(this.selectdata[this.data.fields[i].field]){
106
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
107
- }
108
- // 如果配置类型为select,优先从参数列表获取options
109
- if(this.data.fields[i].type == 'select'){
110
- console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
111
- console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
112
- var param = this.$appdata.getParam(this.data.fields[i].label)
113
- console.log(param)
114
- if (param){
115
- this.data.fields[i].options = param
116
- }
117
-
118
- }
119
- }
120
- // 初始化 buttons_fields
121
- for(let i=0;i<this.data.buttons.length;i++){
122
- if(this.data.buttons[i].button_fields){
123
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
124
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
125
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
126
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
127
- }
128
- // 如果配置类型为select,优先从参数列表获取options
129
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
130
- console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
131
- console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
132
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
133
- }
134
- // 下发特殊配置
135
- if(this.data.buttons[i].button_name==='下发'){
136
- if(this.data.buttons[i].button_fields.length===1){
137
- // value初始化
138
- // if(this.department_search){
139
- console.log("看看111department_search"+JSON.stringify(this.department_search))
140
-
141
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
142
-
143
- for(let k=0;k<this.department_search.length;k++){
144
- // 将id转换为name
145
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
146
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
147
- }
148
- }
149
- }
150
-
151
- if(this.department_search){
152
- let array = []
153
- console.log("看看department_search"+JSON.stringify(this.department_search))
154
- this.department_search.forEach((paper)=>{
155
- array.push({label:paper.name,value:paper.name})
156
- })
157
- this.data.buttons[i].button_fields[0].options = array
158
- }
159
- }else {
160
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
161
- }
162
- }
163
- }
164
- }
165
- }
166
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
167
- let temp = JSON.parse(JSON.stringify(this.data))
168
- // 退回原因展示
169
- if(this.selectdata.f_back_reason){
170
- temp['back_reason'] = this.selectdata.f_back_reason
171
- }
172
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
173
- this.show_data = temp
174
- console.log('initializtion()方法结束,showview')
175
- this.showview = true
176
- },
177
- deleteLocalApply(model){
178
- console.log(`前台上传完成,开始删除本地报建工单`)
179
- this.$androidUtil.bzLogic('deleteApply', {data:model})
180
- }
181
- },
182
- events: {
183
- // 任意select选中时触发事件
184
- async 'select_cascade'(index) {
185
- // this.$refs.service_show.data // 子业务显示组件
186
- // 级联操作示例:
187
- /*
188
- if(this.$refs.service_show.data.fields[index].label==='报建类型'){
189
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
190
- // 控制设置级联
191
- // 源select所选的值 this.$refs.service_show.data.fields[index].value
192
- if(this.$refs.service_show.data.fields[i].label==='级联测试2'){
193
- this.$refs.service_show.data.fields[i].options=[
194
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
195
- ]
196
- }
197
- }
198
- }
199
- */
200
- /*
201
- {
202
- "label": "用水性质",
203
- "type": "select",
204
- "bootstraped": "col-sm-4",
205
- "field": "f_gasproperties",
206
- "readonly": true,
207
- "disabled": false,
208
- "required": false,
209
- "hidden": true,
210
- "options": []
211
- },
212
- {
213
- "label": "水价类型",
214
- "type": "select",
215
- "bootstraped": "col-sm-4",
216
- "field": "f_price_type",
217
- "readonly": true,
218
- "disabled": false,
219
- "required": false,
220
- "hidden": true,
221
- "options": []
222
- },
223
- {
224
- "label": "水价名称",
225
- "type": "select",
226
- "bootstraped": "col-sm-4",
227
- "field": "f_price_name",
228
- "readonly": true,
229
- "disabled": false,
230
- "required": false,
231
- "hidden": true,
232
- "options": []
233
- },
234
- {
235
- "label": "水价id",
236
- "type": "number",
237
- "bootstraped": "col-sm-4",
238
- "field": "f_price_id",
239
- "readonly": true,
240
- "disabled": false,
241
- "required": false,
242
- "hidden": true
243
- },
244
- */
245
- if(this.$refs.service_show.data.fields[index].label === '是否装新表'){
246
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
247
- if(this.$refs.service_show.data.fields[index].value == '是'){
248
- if(this.$refs.service_show.data.fields[i].label=='用水性质'||
249
- this.$refs.service_show.data.fields[i].label=='水价类型'||
250
- this.$refs.service_show.data.fields[i].label=='水价名称'
251
- ){
252
- this.$refs.service_show.data.fields[i].required=true,
253
- this.$refs.service_show.data.fields[i].hidden=false
254
- }
255
- }else{
256
- if(this.$refs.service_show.data.fields[i].label=='用水性质'||
257
- this.$refs.service_show.data.fields[i].label=='水价类型'||
258
- this.$refs.service_show.data.fields[i].label=='水价名称'){
259
- this.$refs.service_show.data.fields[i].required=false,
260
- this.$refs.service_show.data.fields[i].hidden=true
261
- }
262
- }
263
- }
264
- }
265
- if(this.$refs.service_show.data.fields[index].label === '是否装新表'&&this.$refs.service_show.data.fields[index].value=='是'){
266
- let usertype = ''
267
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
268
- if(this.$refs.service_show.data.fields[i].label=='用户类型'){
269
- usertype = this.$refs.service_show.data.fields[i].value
270
- }
271
- if(this.$refs.service_show.data.fields[i].label=='用水性质'&&this.$refs.service_show.data.fields[index].value){
272
- this.$refs.service_show.data.fields[i].options=[]
273
- this.$refs.service_show.data.fields[i].value = ''
274
- this.$refs.service_show.data.fields[i].options= this.$appdata.getParam(usertype)
275
- }
276
- }
277
- }
278
-
279
- if (this.$refs.service_show.data.fields[index].label === '用户类型') { //用水性质
280
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
281
- if(this.$refs.service_show.data.fields[i].label=='用水性质'&&this.$refs.service_show.data.fields[index].value){
282
- this.$refs.service_show.data.fields[i].options=[]
283
- this.$refs.service_show.data.fields[i].value = ''
284
- this.$refs.service_show.data.fields[i].options= this.$appdata.getParam(this.$refs.service_show.data.fields[index].value.trim())
285
- }
286
- }
287
- }
288
-
289
- if (this.$refs.service_show.data.fields[index].label === '技术人员') { //水价类型
290
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
291
- if(this.$refs.service_show.data.fields[i].label=='技术人员id'&&this.$refs.service_show.data.fields[index].value){
292
- if(typeof this.$refs.service_show.data.fields[index].value=='object'){
293
- this.$refs.service_show.data.fields[i].value=this.$refs.service_show.data.fields[index].value.id
294
- }
295
- }
296
- }
297
- }
298
-
299
-
300
- if (this.$refs.service_show.data.fields[index].label === '用水性质') { //水价类型
301
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
302
- if(this.$refs.service_show.data.fields[i].label=='水价类型'&&this.$refs.service_show.data.fields[index].value){
303
- this.$refs.service_show.data.fields[i].options=[]
304
- this.$refs.service_show.data.fields[i].value = ''
305
- this.$refs.service_show.data.fields[i].options= this.$appdata.getParam(this.$refs.service_show.data.fields[i].label)
306
- }
307
- }
308
- }
309
-
310
- if (this.$refs.service_show.data.fields[index].label === '水价类型') {
311
- let gasproperties = ''
312
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
313
- if(this.$refs.service_show.data.fields[i].label=='用水性质'){
314
- gasproperties= this.$refs.service_show.data.fields[i].value
315
- }
316
- if(this.$refs.service_show.data.fields[i].label=='水价名称'){
317
- this.$refs.service_show.data.fields[i].value=''
318
- }
319
-
320
- }
321
-
322
- let pricetype=this.$refs.service_show.data.fields[index].value
323
- let http = new HttpResetClass()
324
- let condition =`f_user_type = '${this.selectdata.f_user_type}' and f_filiale = '${Vue.user.f_fengongsi}'
325
- and f_gasproperties = '${gasproperties}' and f_price_type = '${this.$refs.service_show.data.fields[index].value}'`
326
- let res = await http.load('POST', 'rs/logic/getRecordItem', {condition}, {resolveMsg: null, rejectMsg: null})
327
- console.log('获取的水价类型,',res)
328
- let house2 = []
329
- if (res.data.pricename) {
330
- for (let row of res.data.pricename){
331
- house2.push({label: row.f_price_name,value: {id:row.f_price_id,name:row.f_price_name}})
332
- }
333
- }
334
-
335
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
336
- if (this.$refs.service_show.data.fields[i].label === '水价名称') {
337
- this.$refs.service_show.data.fields[i].options= house2
338
- }
339
- }
340
- }
341
-
342
- if (this.$refs.service_show.data.fields[index].label === '水价名称') { //用水性质
343
- if(this.$refs.service_show.data.fields[index].value&&typeof this.$refs.service_show.data.fields[index].value =='object'){
344
- for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
345
- if(this.$refs.service_show.data.fields[i].label=='水价id'){
346
- this.$refs.service_show.data.fields[i].value= Number(this.$refs.service_show.data.fields[index].value.id)
347
- }
348
- }
349
- this.$refs.service_show.data.fields[index].value= this.$refs.service_show.data.fields[index].value.name
350
- }
351
- }
352
-
353
- if (this.$refs.service_show.data.fields[index].label === '报建类型') {
354
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
355
- if (this.$refs.service_show.data.fields[i].label == '用户类型') {
356
- if (this.$refs.service_show.data.fields[index].value.includes('民用')) {
357
- this.$refs.service_show.data.fields[i].value = '民用'
358
- } else {
359
- this.$refs.service_show.data.fields[i].value = '非民用'
360
- }
361
- this.$refs.service_show.update()
362
- return
363
- }
364
- }
365
- }
366
-
367
- if (this.$refs.service_show.data.fields[index].label === '表号') {
368
- if(this.$refs.service_show.data.fields[index].value){
369
- let http = new HttpResetClass()
370
- let data = {
371
- columnname: ` uf.f_meternumber `,
372
- tablename: ' t_userfiles uf LEFT JOIN t_userinfo ui on ui.f_userinfo_id = uf.f_userinfo_id ',
373
- condition: `(f_user_state = '正常' or f_user_state = '报装') and uf.f_meternumber = '${this.$refs.service_show.data.fields[index].value}' and ui.f_process_id != '${this.selectdata.f_process_id}'`
374
- }
375
- let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
376
- resolveMsg: null,
377
- rejectMsg: "表号查询失败"
378
- })
379
- if(res.data.length>0){
380
- this.$showMessage("警告:表号已被使用!请查证")
381
- }
382
- }
383
- }
384
-
385
- if (this.$refs.service_show.data.fields[index].label === '安装表数'&&this.$refs.service_show.data.fields[index].value==1) {
386
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++){
387
- if (this.$refs.service_show.data.fields[i].label === '用户类型'){
388
- // =this.$refs.service_show.data.fields[i].value
389
- }
390
- }
391
- }
392
-
393
- if (this.data.f_install_num == 1 && this.$refs.service_show.data.fields[index].label === '是否有表') {
394
- if (this.$refs.service_show.data.fields[index].value == "是") {
395
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
396
- if (this.$refs.service_show.data.fields[i].label === '水表品牌'
397
- || this.$refs.service_show.data.fields[i].label === '水表型号'
398
- || this.$refs.service_show.data.fields[i].label === '左右表'
399
- || this.$refs.service_show.data.fields[i].label === '表号'
400
- || this.$refs.service_show.data.fields[i].label === '水表厂家') {
401
- this.$refs.service_show.data.fields[i].hidden = false
402
- this.$refs.service_show.data.fields[i].required = true
403
- } else if (this.selectdata.defname == '通水' && this.$refs.service_show.data.fields[i].label === '通水表号') {
404
- this.$refs.service_show.data.fields[i].hidden = false
405
- this.$refs.service_show.data.fields[i].required = true
406
- }
407
- }
408
- } else {
409
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
410
- if (this.$refs.service_show.data.fields[i].label === '水表品牌'
411
- || this.$refs.service_show.data.fields[i].label === '水表型号'
412
- || this.$refs.service_show.data.fields[i].label === '表号'
413
- || this.$refs.service_show.data.fields[i].label === '左右表'
414
- || this.$refs.service_show.data.fields[i].label === '水表厂家') {
415
- this.$refs.service_show.data.fields[i].hidden = true
416
- this.$refs.service_show.data.fields[i].required = false
417
- } else if (this.selectdata.defname == '通水' && this.$refs.service_show.data.fields[i].label === '通水表号') {
418
- this.$refs.service_show.data.fields[i].hidden = true
419
- this.$refs.service_show.data.fields[i].required = false
420
- }
421
- }
422
- }
423
- }
424
- if (this.$refs.service_show.data.fields[index].label === '水表品牌') {
425
- // console.log("水表品牌>>>>>"+JSON.stringify(this.$refs.service_show.data.fields[index].value))
426
- let id = null
427
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
428
- if (this.$refs.service_show.data.fields[i].label == '水表型号') {
429
- this.$refs.service_show.data.fields[i].value = ''
430
- let temp = {}
431
- // console.log("this.$refs.service_show.data.fields[index].value",this.$refs.service_show.data.fields[index].value)
432
- if(typeof this.$refs.service_show.data.fields[index].value =='string'){
433
- for (let x = 0; x < Vue.ApplyGetSaleParam.gasbrands.length; x++) {
434
- if (Vue.ApplyGetSaleParam.gasbrands[x].label == this.$refs.service_show.data.fields[index].value) {
435
- temp = Vue.ApplyGetSaleParam.gasbrands[x].value.gasmodel
436
- id = Vue.ApplyGetSaleParam.gasbrands[x].value.id
437
- }
438
- }
439
- // let temp = this.$refs.service_show.data.fields[index].value.gasmodel
440
- this.$refs.service_show.data.fields[i].options = temp
441
- this.$refs.service_show.data.fields[index].value = typeof this.$refs.service_show.data.fields[index].value == 'string' ? this.$refs.service_show.data.fields[index].value : this.$refs.service_show.data.fields[index].value.f_meter_brand
442
- }else{
443
- id= Number(this.$refs.service_show.data.fields[index].value.id)
444
- let http = new HttpResetClass()
445
- let data = {
446
- columnname: 'f_meter_style,id',
447
- tablename: 't_gasmodel ',
448
- condition: ` f_gasbrand_id = ${this.$refs.service_show.data.fields[index].value.id} `
449
- }
450
- let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {resolveMsg: null, rejectMsg: '获取水表型号失败'})
451
- this.$refs.service_show.data.fields[i].options=[]
452
- for(let x=0;x<res.data.length;x++){
453
- this.$refs.service_show.data.fields[i].options.push({label:res.data[x].f_meter_style,value:{id:res.data[x].id,name:res.data[x].f_meter_style}})
454
- }
455
- console.log("水表型号",this.$refs.service_show.data.fields[i].options)
456
- // for (let x = 0; x < Vue.ApplyGetSaleParam.gasbrands.length; x++) {
457
- // if (Vue.ApplyGetSaleParam.gasbrands[x].label == this.$refs.service_show.data.fields[index].value.f_meter_brand) {
458
- // temp = Vue.ApplyGetSaleParam.gasbrands[x].value.gasmodel
459
- // id = Vue.ApplyGetSaleParam.gasbrands[x].value.id
460
- // }
461
- // }
462
- // // let temp = this.$refs.service_show.data.fields[index].value.gasmodel
463
- // this.$refs.service_show.data.fields[i].options = temp
464
- // this.$refs.service_show.data.fields[index].value = typeof this.$refs.service_show.data.fields[index].value == 'string' ? this.$refs.service_show.data.fields[index].value : this.$refs.service_show.data.fields[index].value.f_meter_brand
465
- }
466
-
467
-
468
- // this.$refs.service_show.update()
469
- } else if (this.$refs.service_show.data.fields[i].label == '水表品牌id') {
470
- this.$refs.service_show.data.fields[i].value = id
471
- }
472
- }
473
- for(let i = 0; i < this.$refs.service_show.data.fields.length; i++){
474
- if (this.$refs.service_show.data.fields[i].label == '水表品牌id') {
475
- this.$refs.service_show.data.fields[i].value = id
476
- }
477
- }
478
- this.$refs.service_show.update()
479
- }
480
- if (this.$refs.service_show.data.fields[index].label === '水表型号') {
481
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
482
- if (this.$refs.service_show.data.fields[i].label == '水表型号id') {
483
- this.$refs.service_show.data.fields[i].value = Number(this.$refs.service_show.data.fields[index].value.id)
484
- // console.log("水表型号id:",this.$refs.service_show.data.fields[i].value)
485
- }else if(this.$refs.service_show.data.fields[i].label == '水表品牌'&&typeof this.$refs.service_show.data.fields[i].value =='object'){
486
- this.$refs.service_show.data.fields[i].value = this.$refs.service_show.data.fields[i].value.name
487
- }
488
- }
489
- this.$refs.service_show.data.fields[index].value = this.$refs.service_show.data.fields[index].value.name
490
- this.$refs.service_show.update()
491
- return
492
- }
493
-
494
-
495
- if (this.$refs.service_show.data.fields[index].label == '电话号码') {
496
- let phone = this.$refs.service_show.data.fields[index].value
497
- // 电话号码效验
498
- if (!(/^1[3456789]\d{9}$/.test(phone))) {
499
- this.$refs.service_show.data.fields[index].value = ""
500
- this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
501
- }
502
- }
503
-
504
- if (this.$refs.service_show.data.fields[index].label == '施工单位' ||
505
- this.$refs.service_show.data.fields[index].label == '检测单位' ||
506
- this.$refs.service_show.data.fields[index].label == '监理单位' ||
507
- this.$refs.service_show.data.fields[index].label == '土建单位' ||
508
- this.$refs.service_show.data.fields[index].label == '设计单位') {
509
- console.log(this.$refs.service_show.data.fields[index].label,this.$refs.service_show.data.fields[index].value)
510
- this.$refs.service_show.update()
511
- return
512
- }
513
-
514
- if (
515
- this.$refs.service_show.data.fields[index].label === '最终核算成本金额' ||
516
- this.$refs.service_show.data.fields[index].label === '合同总金额' ||
517
- this.$refs.service_show.data.fields[index].label === '工程盈利'
518
- ) {
519
-
520
- var a = 0
521
- var b = 0
522
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
523
- // 控制设置级联
524
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
525
- // xxx xx xxx
526
- if (this.$refs.service_show.data.fields[i].label === '最终核算成本金额') {
527
- this.$refs.service_show.data.fields[i].value = (this.number + this.cost + this.anzhuangsum + this.tujiansum)
528
- a = this.$refs.service_show.data.fields[i].value
529
- }
530
-
531
- if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
532
- b = this.$refs.service_show.data.fields[i].value
533
- }
534
- }
535
- var c = b - a
536
- // 数据计算完毕得到工程结余
537
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
538
- if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
539
- this.$refs.service_show.data.fields[i].value = c
540
- }
541
- }
542
- }
543
-
544
- if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields[index].label === '收费金额') {
545
- let chargeMoney = this.$refs.service_show.showadd_fields[index].value
546
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
547
- if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
548
- let cumulativeMoney = this.$refs.service_show.data.fields[i].value
549
- if (Number(chargeMoney) > Number(cumulativeMoney)) {
550
- this.$showMessage("收费金额不得大于未结总金额!")
551
- this.$refs.service_show.showadd_fields[index].value = null
552
- return
553
- } else {
554
-
555
- }
556
- }
557
- }
558
- }
559
-
560
- //根据合同预算金额和累计缴费金额计算未结金额
561
- if (this.$refs.service_show.data.fields[index] && this.$refs.service_show.data.fields[index].label === '累计缴费金额') {
562
- let cumulativeMoney = this.$refs.service_show.data.fields[index].value
563
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
564
- if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
565
- this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_money) - Number(cumulativeMoney)
566
- }
567
- }
568
- }
569
- //根据合同预算金额和累计开票金额计算未开票金额
570
- if (this.$refs.service_show.data.fields[index].label === '累计开票金额') {
571
- let residualInvoicing = this.$refs.service_show.data.fields[index].value
572
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
573
- if (this.$refs.service_show.data.fields[i].label === '未开票金额') {
574
- this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_total_money) - Number(residualInvoicing)
575
- }
576
- }
577
- }
578
- //如果资料验收是否通过和工程验收是否通过为否的时候弹出原因填写框
579
- if (this.$refs.service_show.data.fields[index].label === '资料验收是否通过') {
580
- let res = this.$refs.service_show.data.fields[index].value
581
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
582
- if (this.$refs.service_show.data.fields[i].label === '资料验收不通过原因') {
583
- if (res === '否') {
584
- this.$refs.service_show.data.fields[i].hidden = false
585
- this.$refs.service_show.data.fields[i].required = true
586
- } else {
587
- this.$refs.service_show.data.fields[i].hidden = true
588
- this.$refs.service_show.data.fields[i].required = false
589
- }
590
- }
591
- }
592
- }
593
- //洪雅预算审核获取当前操作人
594
- // console.log("lable:"+this.$refs.service_show.data.fields[index].label)
595
- // console.log("field:"+this.$refs.service_show.data.fields[index].field)
596
- // if (this.$refs.service_show.data.fields[index].label === "审核人" && this.$refs.service_show.data.fields[index].field === "f_nstall_checker_gc" ){
597
- // console.log("name:"+JSON.stringify(Vue.$login.f.name))
598
- // this.$refs.service_show.data.fields[index].field = Vue.$login.f.name
599
- // }
600
-
601
- if (this.$refs.service_show.data.fields[index].label === '工程验收是否通过') {
602
- let res = this.$refs.service_show.data.fields[index].value
603
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
604
- if (this.$refs.service_show.data.fields[i].label === '工程验收不通过原因') {
605
- if (res === '否') {
606
- this.$refs.service_show.data.fields[i].hidden = false
607
- this.$refs.service_show.data.fields[i].required = true
608
- } else {
609
- this.$refs.service_show.data.fields[i].hidden = true
610
- this.$refs.service_show.data.fields[i].required = false
611
- }
612
- }
613
- }
614
- }
615
- //根据总户数和实际安装表数计算未安装表数
616
- // if (this.$refs.service_show.data.fields[index].label === '实际安装表数') {
617
- // let value = this.$refs.service_show.data.fields[index].value
618
- // for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
619
- // if (this.$refs.service_show.data.fields[i].label === '未安装表数') {
620
- // this.$refs.service_show.data.fields[i].label === '未安装表数'
621
- // this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_install_num) - Number(value)
622
- // }
623
- // }
624
- // }
625
-
626
- //金额小写得到大写
627
- if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields.fields[index].label === '收费金额') {
628
- if (this.$refs.service_show.showadd_fields[index].value || this.$refs.service_show.showadd_fields.fields[index].value) {
629
- var re = /^[0-9]+.?[0-9]*/
630
- let temp = this.$refs.service_show.showadd_fields[index].value
631
- if (temp == "" || isNaN(temp)) {
632
- this.$showMessage("请输入纯数字")
633
- this.$refs.service_show.showadd_fields[index].value = 0
634
- }
635
- }
636
- let temp = this.$refs.service_show.showadd_fields[index]
637
- let value = temp.value
638
- // let chargeMoney = this.$refs.service_show.showadd_fields[index].value
639
- for (let i = 0; i < this.$refs.service_show.showadd_fields.fields.length; i++) {
640
- if (this.$refs.service_show.showadd_fields.fields[i].label === '金额大写') {
641
- let te = {
642
- value: this.smalltoBIG(value)
643
- }
644
- this.$refs.service_show.showadd_fields[i] = te
645
- }
646
- }
647
- }
648
-
649
- // console.log(JSON.stringify(Vue.user))
650
- if (this.$refs.service_show.data.fields[index].label === '县/区') {
651
- let temp = this.$refs.service_show.data.fields[index].value
652
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
653
- // 控制设置级联
654
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
655
- if (this.$refs.service_show.data.fields[i].label === '片区') {
656
- this.$refs.service_show.data.fields[i].value = ''
657
- this.$refs.service_show.data.fields[i].options = []
658
- let rs = []
659
- console.log('小区片区。。。', temp)
660
- for (let j = 0; j < Vue.user.f_allArea.length; j++) {
661
- if (Vue.user.f_allArea[j].label === temp) {
662
- rs = Vue.user.f_allArea[j].value
663
- }
664
- }
665
- console.log('获取小区片区=>' + JSON.stringify(rs))
666
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
667
- this.$refs.service_show.update()
668
- }
669
- }
670
- }
671
- //控制尾款
672
- if (
673
- this.$refs.service_show.data.fields[index].label === '合同金额' ||
674
- this.$refs.service_show.data.fields[index].label === '首付' ||
675
- this.$refs.service_show.data.fields[index].label === '进度款' ||
676
- this.$refs.service_show.data.fields[index].label === '尾款'
677
- ) {
678
- console.log('即将计算合同金额')
679
- var cash = 0
680
- var downpayments = 0
681
- var tailmoney = 0
682
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
683
- // 控制设置级联
684
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
685
- // xxx xx xxx
686
- if (this.$refs.service_show.data.fields[i].label === '合同金额' && this.$refs.service_show.data.fields[i].value) {
687
- cash = this.$refs.service_show.data.fields[i].value
688
- }
689
- if (this.$refs.service_show.data.fields[i].label === '首付' && this.$refs.service_show.data.fields[i].value) {
690
- downpayments = this.$refs.service_show.data.fields[i].value
691
- }
692
- if (this.$refs.service_show.data.fields[i].label === '进度款' && this.$refs.service_show.data.fields[i].value) {
693
- tailmoney = this.$refs.service_show.data.fields[i].value
694
- }
695
- }
696
- var a = cash - downpayments
697
- a= a.toFixed(2)
698
- // 数据计算完毕得到尾款
699
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
700
- if (this.$refs.service_show.data.fields[i].label === '尾款') {
701
- if (cash === downpayments) {
702
- this.$refs.service_show.data.fields[i].value = 0
703
- } else {
704
- this.$refs.service_show.data.fields[i].value = (cash - downpayments - tailmoney)
705
- this.$refs.service_show.data.fields[i].value=this.$refs.service_show.data.fields[i].value.toFixed(2)
706
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
707
- }
708
- }
709
- if (this.$refs.service_show.data.fields[i].label === '首付') {
710
- if (a < 0) {
711
- this.$showMessage("首付款数额过大")
712
- downpayments = 0
713
- this.$refs.service_show.data.fields[i].value = 0
714
- }
715
- }
716
-
717
- if (this.$refs.service_show.data.fields[i].label === '进度款') {
718
-
719
- if (cash === downpayments) {
720
- tailmoney = 0
721
- this.$refs.service_show.data.fields[i].value = 0
722
- this.$refs.service_show.data.fields[i].readonly = true
723
- } else {
724
- this.$refs.service_show.data.fields[i].readonly = false
725
- tailmoney = this.$refs.service_show.data.fields[i].value
726
- }
727
- if (tailmoney > a) {
728
- this.$showMessage("进度款数额过大")
729
- tailmoney = 0
730
- this.$refs.service_show.data.fields[i].value = 0
731
- }
732
- }
733
- }
734
- }
735
- let temp = 0
736
- let then = 0
737
- let install = 0
738
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
739
- //未交金额计算
740
- if (this.selectdata.defname === "报建缴费") {
741
- if (this.$refs.service_show.data.fields[i].label === '超长费') {
742
- then = this.$refs.service_show.data.fields[i].value
743
- }
744
- if (this.$refs.service_show.data.fields[i].label === '安装费') {
745
- install = this.$refs.service_show.data.fields[i].value
746
- }
747
- if (this.$refs.service_show.data.fields[i].label === '应收金额') {
748
- this.$refs.service_show.data.fields[i].value = parseFloat(then) + parseFloat(install)
749
- temp = this.$refs.service_show.data.fields[i].value
750
- }
751
- if (this.$refs.service_show.data.fields[i].label === '实收金额') {
752
- temp = temp - this.$refs.service_show.data.fields[i].value
753
- this.nowcost = this.$refs.service_show.data.fields[i].value
754
- }
755
- if (this.$refs.service_show.data.fields[i].label === '金额大写') {
756
- this.$refs.service_show.data.fields[i].value = this.smalltoBIG(Number(this.nowcost))
757
- }
758
- for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
759
- if (this.$refs.service_show.data.fields[j].label === '欠费金额'){
760
- this.$refs.service_show.data.fields[j].value = temp
761
- }
762
- }
763
- if (temp < 0) {
764
- this.$showMessage("欠费金额不能为负数")
765
- return
766
- }
767
- }
768
- // if (this.selectdata.defname === "现场踏勘") {
769
- // if (this.$refs.service_show.data.fields[i].label === '收款金额') {
770
- // temp = this.$refs.service_show.data.fields[i].value
771
- // }
772
- // if (this.$refs.service_show.data.fields[i].label === '已交金额') {
773
- // temp = temp - this.$refs.service_show.data.fields[i].value
774
- // this.nowcost = this.$refs.service_show.data.fields[i].value
775
- // }
776
- // if (this.$refs.service_show.data.fields[i].label === '金额大写') {
777
- // this.$refs.service_show.data.fields[i].value = this.smalltoBIG(Number(this.nowcost))
778
- // }
779
- // for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
780
- // if (this.$refs.service_show.data.fields[j].label === '未交金额'){
781
- // this.$refs.service_show.data.fields[j].value = temp
782
- // }
783
- // }
784
- // if (temp < 0) {
785
- // this.$showMessage("欠费金额不能为负数")
786
- // return
787
- // }
788
- // }
789
-
790
- //任何是否的选择框只要是否都不能提交
791
- // if (this.selectdata.defname != '寻找市场' && this.selectdata.defname != '用户申请') {
792
- // if (this.$refs.service_show.data.fields[i].value === '否') {
793
- // this.$refs.service_show.disable_button = false
794
- // console.log(this.$refs.service_show.data)
795
- // this.$refs.service_show.data.buttons[1].button_name = '保存'
796
- // this.$showMessage("当审核/确认为否时,无法提交")
797
- // return
798
- // }else {
799
- // this.$refs.service_show.data.buttons[1].button_name = '提交'
800
- // }
801
- // }
802
- //获取抄表员
803
- if (this.$refs.service_show.data.fields[i].label === '安装员'){
804
- let person = []
805
- let array = []
806
- person = Vue.user.f_installman.map(item => {
807
- return item.name;
808
- })
809
- console.log("安装员获取" + JSON.stringify(person))
810
- for (let q = 0; q < person.length; q++) {
811
- let arraydata = {
812
- 'label': person[q],
813
- 'value': person[q]
814
- }
815
- if (array.length != 0) {
816
- for (let w = 0; w < array.length; w++) {
817
- if (array[w].label == person[q]) {
818
- break
819
- }
820
- while (w == array.length - 1) {
821
- array.push(arraydata)
822
- break
823
- }
824
- }
825
- } else {
826
- array.push(arraydata)
827
- }
828
- }
829
- this.$refs.service_show.data.fields[i].options = array
830
- }
831
- //气价名称、气价类型
832
- if (
833
- this.$refs.service_show.data.fields[i].label === '气价名称' ||
834
- this.$refs.service_show.data.fields[i].label === '气价类型' ||
835
- this.$refs.service_show.data.fields[i].label === '价格' ||
836
- this.$refs.service_show.data.fields[i].label === '客户类型' ||
837
- this.$refs.service_show.data.fields[i].label === '用气性质'
838
- ) {
839
- let http = new HttpResetClass()
840
- let condition = "f_orgid = '" + Vue.user.orgid + "'"
841
- let res = await http.load('POST','rs/sql/singleTable',{data:{tablename:'t_stairprice',condition:condition}}, {resolveMsg: null, rejectMsg: null})
842
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
843
- if (this.$refs.service_show.data.fields[i].label == '气价名称') {
844
- let data = []
845
- let array = []
846
- data = res.data.map(item => {
847
- return item.f_price_name;
848
- })
849
- for (let q = 0; q < data.length; q++) {
850
- let arraydata = {
851
- 'label': data[q],
852
- 'value': data[q]
853
- }
854
- if (array.length != 0) {
855
- for (let w = 0; w < array.length; w++) {
856
- if (array[w].label == data[q]) {
857
- break
858
- }
859
- while (w == array.length - 1) {
860
- array.push(arraydata)
861
- break
862
- }
863
- }
864
- } else {
865
- array.push(arraydata)
866
- }
867
- }
868
- this.$refs.service_show.data.fields[i].options = array
869
- console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
870
- console.log("有没有数据长度:" + this.$refs.service_show.data.fields[i].value.length)
871
- }
872
-
873
- if (this.$refs.service_show.data.fields[i].label == '气价名称' && this.$refs.service_show.data.fields[i].value.length != 0) {
874
- let http2 = new HttpResetClass()
875
- let condition2 = "s.f_orgid = '" + Vue.user.orgid + "'" + " and s.f_price_name = '" + this.$refs.service_show.data.fields[i].value + "'"
876
- let res2 = await http2.load('POST','rs/sql/searchGasPrice',{data:{condition:condition2}}, {resolveMsg: null, rejectMsg: null})
877
- console.log("气价数据:" + JSON.stringify(res2.data))
878
- for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
879
- if (this.$refs.service_show.data.fields[j].label == '气价类型') {
880
- console.log("气价类型:" + res2.data[0])
881
- console.log("气价类型1:" + res2.data[0].f_price_type)
882
- this.$refs.service_show.data.fields[j].value = res2.data[0].f_price_type
883
- console.log("气价类型2:" + this.$refs.service_show.data.fields[j].value)
884
- }
885
- //气价拼接
886
- if (this.$refs.service_show.data.fields[j].label == '价格') {
887
- let p = 1
888
- let resultPrice = ''
889
- for(let l = 0; l < res2.data.length; l++){
890
- resultPrice = resultPrice + res2.data[l].price + ' |'
891
- if (p == 3) {
892
- break
893
- }
894
- p++
895
- }
896
- console.log("拼接的价格:" + resultPrice)
897
- this.$refs.service_show.data.fields[j].value = resultPrice
898
- }
899
- if (this.$refs.service_show.data.fields[j].label == '用气性质') {
900
- this.$refs.service_show.data.fields[j].value = res2.data[0].f_gasproperties
901
- }
902
- if (this.$refs.service_show.data.fields[j].label == '客户类型') {
903
- this.$refs.service_show.data.fields[j].value = res2.data[0].f_user_type
904
- }
905
- }
906
-
907
- }
908
-
909
- }
910
-
911
-
912
-
913
- }
914
-
915
- }
916
-
917
-
918
-
919
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
920
- //所属公司
921
- if (this.selectdata.defname == '用户建档') {
922
- if (this.$refs.service_show.data.fields[i].label === '所属公司') {
923
- this.$refs.service_show.data.fields[i].value = Vue.user.orgs
924
- }
925
- }
926
- // 气表品牌
927
- if (
928
- this.$refs.service_show.data.fields[i].label === '气表品牌' ||
929
- this.$refs.service_show.data.fields[i].label === '气表型号'
930
- ) {
931
- if (this.$refs.service_show.data.fields[i].label == '气表品牌') {
932
- let http = new HttpResetClass()
933
- let condition = "f_orgid = '" + Vue.user.orgid + "'"
934
- let res = await http.load('POST','rs/sql/applysingleTable',{data:{tablename:'t_gasbrand',condition:condition}}, {resolveMsg: null, rejectMsg: null})
935
- for (let p = 0; p < this.$refs.service_show.data.fields.length; p++) {
936
- if (this.$refs.service_show.data.fields[p].label == '气表品牌') {
937
- let data = []
938
- let array = []
939
- data = res.data.map(item => {
940
- return item.f_meter_brand;
941
- })
942
- for (let q = 0; q < data.length; q++) {
943
- let arraydata = {
944
- 'label': data[q],
945
- 'value': data[q]
946
- }
947
- if (array.length != 0) {
948
- for (let w = 0; w < array.length; w++) {
949
- if (array[w].label == data[q]) {
950
- break
951
- }
952
- while (w == array.length - 1) {
953
- array.push(arraydata)
954
- break
955
- }
956
- }
957
- } else {
958
- array.push(arraydata)
959
- }
960
- }
961
- this.$refs.service_show.data.fields[i].options = array
962
- console.log("气表品牌选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
963
- }
964
- }
965
- }
966
-
967
-
968
- if (this.$refs.service_show.data.fields[i].label == '气表品牌' && this.$refs.service_show.data.fields[i].value.length != 0) {
969
- let style = this.$refs.service_show.data.fields[i].value
970
- for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
971
-
972
- if (this.$refs.service_show.data.fields[j].label == '气表型号') {
973
- let http2 = new HttpResetClass()
974
- let res2 = await http2.load('POST','rs/sql/queryGasType',{data:{f_orgid:Vue.user.orgid,f_meter_brand:style}}, {resolveMsg: null, rejectMsg: null})
975
- console.log("气表型号查询数据" + JSON.stringify(res2.data))
976
- let data = []
977
- let data2 = []
978
- let array = []
979
- data = res2.data.map(item => {
980
- return item.f_meter_style;
981
- })
982
- data2 = res2.data.map(item => {
983
- return item.f_type;
984
- })
985
- console.log("是不是来过这儿1")
986
- for (let q = 0; q < data.length; q++) {
987
- let arraydata = {
988
- 'label': data[q] + data2[q],
989
- 'value': data[q] + data2[q]
990
- }
991
- let then = data[q] + data2[q]
992
- if (array.length != 0) {
993
- for (let w = 0; w < array.length; w++) {
994
- if (array[w].label == then) {
995
- break
996
- }
997
- while (w == array.length - 1) {
998
- array.push(arraydata)
999
- break
1000
- }
1001
- }
1002
- } else {
1003
- array.push(arraydata)
1004
- }
1005
- }
1006
- this.$refs.service_show.data.fields[j].options = array
1007
- console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[j].options))
1008
- }
1009
- }
1010
-
1011
- }
1012
- }
1013
- //调压箱获取
1014
- if (
1015
- this.selectdata.defname == '气表安装'
1016
- ) {
1017
- let http = new HttpResetClass()
1018
- let condition = "f_filialeid = '" + Vue.user.orgid + "'"
1019
- let res = await http.load('POST','rs/sql/singleTable',{data:{tablename:'t_adjustablebox',condition:condition}}, {resolveMsg: null, rejectMsg: null})
1020
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1021
- if (this.$refs.service_show.data.fields[i].label === '调压箱') {
1022
- let data = []
1023
- let array = []
1024
- data = res.data.map(item => {
1025
- return item.f_adjustable_name;
1026
- })
1027
- for (let q = 0; q < data.length; q++) {
1028
- let arraydata = {
1029
- 'label': data[q],
1030
- 'value': data[q]
1031
- }
1032
- if (array.length != 0) {
1033
- for (let w = 0; w < array.length; w++) {
1034
- if (array[w].label == data[q]) {
1035
- break
1036
- }
1037
- while (w == array.length - 1) {
1038
- array.push(arraydata)
1039
- break
1040
- }
1041
- }
1042
- } else {
1043
- array.push(arraydata)
1044
- }
1045
- }
1046
- this.$refs.service_show.data.fields[i].options = array
1047
- console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1048
- }
1049
-
1050
- }
1051
-
1052
-
1053
- }
1054
- }
1055
- // console.log("this.selectdata:" + JSON.stringify(this.selectdata))
1056
- // 合成地址
1057
- if (
1058
- this.$refs.service_show.data.fields[index].label === '区域' ||
1059
- // this.$refs.service_show.data.fields[index].label === '片区' ||
1060
- // this.$refs.service_show.data.fields[index].label === '街道名称' ||
1061
- this.$refs.service_show.data.fields[index].label === '街道' ||
1062
- // this.$refs.service_show.data.fields[index].label === '小区/单位' ||
1063
- this.$refs.service_show.data.fields[index].label === '小区' ||
1064
- this.$refs.service_show.data.fields[index].label === '楼号' ||
1065
- this.$refs.service_show.data.fields[index].label === '单元号' ||
1066
- this.$refs.service_show.data.fields[index].label === '楼层' ||
1067
- this.$refs.service_show.data.fields[index].label === '门牌号'
1068
- ) {
1069
- console.log('即将合成地址')
1070
- var address = ''
1071
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1072
- // 控制设置级联
1073
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1074
- // xxx xx xxx
1075
- if (this.$refs.service_show.data.fields[i].label === '区域' && this.$refs.service_show.data.fields[i].value) {
1076
- // let f_area = res.data.f_area
1077
- // this.$refs.service_show.data.fields[i].value = f_area
1078
- address += this.$refs.service_show.data.fields[i].value
1079
- }
1080
- // if (this.$refs.service_show.data.fields[i].label === '片区' && this.$refs.service_show.data.fields[i].value) {
1081
- // address += this.$refs.service_show.data.fields[i].value
1082
- // }
1083
- // if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
1084
- // address += this.$refs.service_show.data.fields[i].value
1085
- // }
1086
- if (this.$refs.service_show.data.fields[i].label === '街道' && this.$refs.service_show.data.fields[i].value) {
1087
- // let f_street = res.data.f_street
1088
- // this.$refs.service_show.data.fields[i].value = f_street
1089
- address += this.$refs.service_show.data.fields[i].value
1090
- }
1091
- // if (this.$refs.service_show.data.fields[i].label === '小区/单位' && this.$refs.service_show.data.fields[i].value) {
1092
- // address += this.$refs.service_show.data.fields[i].value
1093
- // }
1094
- if (this.$refs.service_show.data.fields[i].label === '小区' && this.$refs.service_show.data.fields[i].value) {
1095
- // let f_residential_area = res.data.f_residential_area
1096
- // this.$refs.service_show.data.fields[i].value = f_residential_area
1097
- address += this.$refs.service_show.data.fields[i].value
1098
- }
1099
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1100
- // let f_building = res.data.f_building
1101
- // this.$refs.service_show.data.fields[i].value = f_building
1102
- address += ' ' + this.$refs.service_show.data.fields[i].value
1103
- }
1104
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1105
- // let f_unit = res.data.f_unit
1106
- // this.$refs.service_show.data.fields[i].value = f_unit
1107
- address += '-' + this.$refs.service_show.data.fields[i].value
1108
- }
1109
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1110
- // let f_floor = res.data.f_floor
1111
- // this.$refs.service_show.data.fields[i].value = f_floor
1112
- address += '-' + this.$refs.service_show.data.fields[i].value
1113
- }
1114
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1115
- // let f_room = res.data.f_room
1116
- // this.$refs.service_show.data.fields[i].value = f_room
1117
- address += '-' + this.$refs.service_show.data.fields[i].value
1118
- }
1119
-
1120
- }
1121
- console.log('获取到的address=>' + address)
1122
- // 数据获取完毕时放入地址text
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 = address
1126
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1127
- }
1128
- }
1129
- }
1130
- //开户费+材料费+人工费+设备安装费=合计
1131
- if (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
- let fee = 0
1136
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1137
- if (this.$refs.service_show.data.fields[index].label === '开户费' ||
1138
- this.$refs.service_show.data.fields[index].label === '材料费' ||
1139
- this.$refs.service_show.data.fields[index].label === '人工费' ||
1140
- this.$refs.service_show.data.fields[index].label === '设备安装费') {
1141
- fee += Number(this.$refs.service_show.data.fields[index].value)
1142
- }
1143
- if (this.$refs.service_show.data.fields[index].label === '合计') {
1144
- this.$refs.service_show.data.fields[index].value = fee
1145
- }
1146
- }
1147
-
1148
- }
1149
- if (this.selectdata.defname != '完工') {
1150
- this.selectdata.f_sub_state = '正在进行'
1151
- }
1152
- if (this.selectdata.defname == '送气') {
1153
- this.selectdata.f_sub_state = '完工'
1154
- }
1155
- if (this.selectdata.defname === '用户受理') {
1156
- let http = new HttpResetClass()
1157
- let condition = "f_filialeid = " + Vue.user.orgid
1158
- let res = await http.load('POST','rs/sql/singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
1159
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1160
- if (this.$refs.service_show.data.fields[i].label == '区域') {
1161
- let data = []
1162
- let array = []
1163
- data = res.data.map(item => {
1164
- return item.f_pcd;
1165
- })
1166
- for (let q = 0; q < data.length; q++) {
1167
- let arraydata = {
1168
- 'label': data[q],
1169
- 'value': data[q]
1170
- }
1171
- if (array.length != 0) {
1172
- for (let w = 0; w < array.length; w++) {
1173
- if (array[w].label == data[q]) {
1174
- break
1175
- }
1176
- while (w == array.length - 1) {
1177
- array.push(arraydata)
1178
- break
1179
- }
1180
- }
1181
- } else {
1182
- array.push(arraydata)
1183
- }
1184
- }
1185
- this.$refs.service_show.data.fields[i].options = array
1186
- console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1187
- }
1188
- if (this.$refs.service_show.data.fields[i].label == '街道') {
1189
- let data = []
1190
- let array = []
1191
- data = res.data.map(item => {
1192
- return item.f_street;
1193
- })
1194
- for (let q = 0; q < data.length; q++) {
1195
- let arraydata = {
1196
- 'label': data[q],
1197
- 'value': data[q]
1198
- }
1199
- if (array.length != 0) {
1200
- for (let w = 0; w < array.length; w++) {
1201
- if (array[w].label == data[q]) {
1202
- break
1203
- }
1204
- while (w == array.length - 1) {
1205
- array.push(arraydata)
1206
- break
1207
- }
1208
- }
1209
- } else {
1210
- array.push(arraydata)
1211
- }
1212
- }
1213
- this.$refs.service_show.data.fields[i].options = array
1214
- console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1215
- }
1216
- if (this.$refs.service_show.data.fields[i].label == '小区') {
1217
- let data = []
1218
- let array = []
1219
- data = res.data.map(item => {
1220
- return item.f_residential_area;
1221
- })
1222
- for (let q = 0; q < data.length; q++) {
1223
- let arraydata = {
1224
- 'label': data[q],
1225
- 'value': data[q]
1226
- }
1227
- if (array.length != 0) {
1228
- for (let w = 0; w < array.length; w++) {
1229
- if (array[w].label == data[q]) {
1230
- break
1231
- }
1232
- while (w == array.length - 1) {
1233
- array.push(arraydata)
1234
- break
1235
- }
1236
- }
1237
- } else {
1238
- array.push(arraydata)
1239
- }
1240
- }
1241
- this.$refs.service_show.data.fields[i].options = array
1242
- console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1243
- }
1244
- }
1245
- }
1246
- //报建类型
1247
- // if (this.selectdata.defname === '用户申请' || this.selectdata.defname === '寻找市场') {
1248
- // for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1249
- // if (this.$refs.service_show.data.fields[i].label == '报建类型') {
1250
- // this.$refs.service_show.data.fields[i].value = this.selectdata.f_applyinstall_type
1251
- // }
1252
- // }
1253
- // }
1254
-
1255
- // 维修费+服务费+工时费+其他费用=预算
1256
- // console.log("即将进行预算------")
1257
- // console.log("fields:"+JSON.stringify(this.$refs.service_show.data.fields))
1258
- // if (this.$refs.service_show.data.fields[index].label === '维修费' ||
1259
- // this.$refs.service_show.data.fields[index].label === '服务费' ||
1260
- // this.$refs.service_show.data.fields[index].label === '工时费' ||
1261
- // this.$refs.service_show.data.fields[index].label === '其他费用' ||
1262
- // this.$refs.service_show.data.fields[index].label === '预算') {
1263
- // let fee = 0
1264
- // console.log("即将预算算法------")
1265
- // for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1266
- // if (this.$refs.service_show.data.fields[i].label === '维修费' ||
1267
- // this.$refs.service_show.data.fields[i].label === '服务费' ||
1268
- // this.$refs.service_show.data.fields[i].label === '工时费' ||
1269
- // this.$refs.service_show.data.fields[i].label === '其他费用') {
1270
- // console.log("开始计算------")
1271
- // console.log('费用' + Number(this.$refs.service_show.data.fields[i].value))
1272
- // fee += Number(this.$refs.service_show.data.fields[i].value)
1273
- // console.log("fee:"+fee)
1274
- //
1275
- // }
1276
- // // console.log("i:"+i)
1277
- // // console.log("fields:"+this.$refs.service_show.data.fields[index].label)
1278
- // // if (this.$refs.service_show.data.fields[index].label === '维修费') {
1279
- // // console.log("维修费"+this.$refs.service_show.data.fields[index].value)
1280
- // // fee += Number(this.$refs.service_show.data.fields[index].value)
1281
- // // console.log("维修费的预算:" + fee)
1282
- // // }
1283
- // // if (this.$refs.service_show.data.fields[index].label === '服务费' && this.$refs.service_show.data.fields[index].value) {
1284
- // // fee += Number(this.$refs.service_show.data.fields[index].value)
1285
- // // }
1286
- // // if (this.$refs.service_show.data.fields[index].label === '工时费' && this.$refs.service_show.data.fields[index].value) {
1287
- // // fee += Number(this.$refs.service_show.data.fields[index].value)
1288
- // // }
1289
- // // if (this.$refs.service_show.data.fields[index].label === '其他费用' && this.$refs.service_show.data.fields[index].value) {
1290
- // // fee += Number(this.$refs.service_show.data.fields[index].value)
1291
- // // }
1292
- // if (this.$refs.service_show.data.fields[index].label === '预算') {
1293
- // console.log("合成的预算:" + fee)
1294
- // console.log("this",this.show_data)
1295
- // this.$refs.service_show.data.fields[index].value = fee
1296
- // }
1297
- // }
1298
- //
1299
- // }
1300
- },
1301
- // 获取view层button事件
1302
- async 'button'(model){
1303
- console.log('进入async button事件方法')
1304
- var delteLocal = true
1305
- // 点击保存与重置按钮不需要修改本地工单状态
1306
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
1307
- delteLocal = false
1308
- }
1309
- // 点击重置按钮就重置数据
1310
- if(model.button.button_name==='重置'){
1311
- this.initializtion()
1312
- return
1313
- }
1314
- if(model.button.button_name==='下发'){
1315
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
1316
- for(let i=0;i<this.department_search.length;i++){
1317
- // 找到人名为person_name 的人,然后把人名换成id
1318
- if(this.department_search[i].name === person_name){
1319
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
1320
- }
1321
- }
1322
- }
1323
- console.log("button事件接收参数model=>" + JSON.stringify(model))
1324
- model=Object.assign({},this.selectdata,model)
1325
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
1326
- let http = new HttpResetClass()
1327
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
1328
- // let res = await http.load('POST',url,{data:{tables:this.data.tables,start_activity:this.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
1329
- // // 先判断是否包含code,如果服务端异常,可能不存在code
1330
- // console.log("service处理完成返回数据=>" + res)
1331
- // if(!res.code){
1332
- // console.log("service处理完成返回数据=>" + res)
1333
- // this.$showMessage('操作异常,原因:' + res)
1334
- // }else{
1335
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
1336
- // if(res.code = 200){
1337
- // this.showview = false
1338
- // // 特殊处理
1339
- // this.special(model)
1340
- // this.$dispatch('close')
1341
- // this.initializtion()
1342
- // this.$showMessage('操作成功')
1343
- // }else{
1344
- // this.$showMessage('操作失败,原因:' + res.data.msg)
1345
- // }
1346
- // }
1347
- let btn = btn_operate(this, url, http, model, delteLocal)
1348
- co(btn)
1349
- }
1350
- },
1351
- watch:{
1352
- // 监听selectdata的变化
1353
- 'selectdata'() {
1354
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
1355
- this.refurbish()
1356
- },
1357
- deep:true
1358
- }
1359
- }
1360
-
1361
- let btn_operate = function * (self, url, http, model, delteLocal) {
1362
- // 下发,提交,保存,退回都在后台处理
1363
- console.log('即将请求后台url=>' + url)
1364
- model.employeetemplate=''
1365
- http.load('POST',url,{data:{employeetemplate:'',tables:self.data.tables,start_activity:self.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
1366
- .then((res) => {
1367
- console.log(JSON.stringify(res))
1368
- if(res.code = 200){
1369
- self.showview = false
1370
- // 如果需要删除本地记录则去删除
1371
- if(delteLocal){
1372
- self.deleteLocalApply(model)
1373
- }
1374
- // 特殊处理
1375
- self.special(model)
1376
- self.$dispatch('close')
1377
- self.initializtion()
1378
- self.$showMessage('操作成功')
1379
- }else{
1380
- self.$showMessage('操作失败,原因:' + res.data.msg)
1381
- }
1382
- })
1383
- .catch((ret) => {
1384
- self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
1385
- })
1386
- }
1387
- </script>
1
+ <template>
2
+ <service-view-app v-ref:service_show :data="show_data" v-if="showview"></service-view-app>
3
+ </template>
4
+ <script>
5
+ import co from 'co'
6
+ import Vue from 'vue'
7
+ import {HttpResetClass} from 'vue-client'
8
+ export default {
9
+ title: '报建流程业务控制层',
10
+ props: ['selectdata'],
11
+ data () {
12
+ return {
13
+ data:null, // 数据库数据,json配置文件数据的数据集合
14
+ json_datas:null, // Json配置文件集合
15
+ showview:false, // 控制显示service-view组件
16
+ show_data:null, // 给view层显示的数据
17
+ department_search:null // 当前部门下所有人
18
+ }
19
+ },
20
+ methods: {
21
+ // 特殊化处理
22
+ async special(model){
23
+ console.log('进入async special方法')
24
+ if(this.data.distribute_async && model.button.button_name==='下发'){
25
+ // 流程异步处理
26
+ let http = new HttpResetClass();
27
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
28
+ console.log("流程的异步处理:",JSON.stringify(res.data))
29
+ }
30
+ if(this.data.distribute_async && model.button.button_name==='完成'){
31
+ // 强制结束
32
+ let http = new HttpResetClass();
33
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
34
+ console.log("流程的异步处理:",JSON.stringify(res.data))
35
+ }
36
+ },
37
+ // 组件初始化操作
38
+ refurbish(){
39
+ if(!this.$workflow_vue){
40
+ this.$showMessage('流程配置文件不存在,请反馈系统管理员')
41
+ return
42
+ }
43
+ console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
44
+ this.json_datas=this.$workflow_vue
45
+ let sum = 0
46
+ let jsonData ={}
47
+ for(let i=0;i<this.json_datas.activitys.length;i++){
48
+ if(this.selectdata.defname==this.json_datas.activitys[i].title){
49
+ jsonData = this.json_datas.activitys[i]
50
+ sum++
51
+ }
52
+ }
53
+ console.log('sum=>' + sum)
54
+ if(sum==1){
55
+ this.data =null
56
+ this.data = jsonData
57
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
58
+ this.initializtion()
59
+
60
+ } else if(sum==0) {
61
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
62
+ } else {
63
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
64
+ }
65
+ },
66
+ // json配置数据处理 比如下拉框的options
67
+ async initializtion() {
68
+
69
+ console.log('进入initializtion()方法')
70
+ console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
71
+ console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
72
+ // 下发人 options 处理,options初始化
73
+ if(this.selectdata.actorexpression){
74
+ //截取actorexpression
75
+
76
+ let http = new HttpResetClass()
77
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
78
+ console.log('即将请求后台获取下发人员,url=>' + url)
79
+ let res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
80
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
81
+ let jsonString = JSON.stringify(res.data)
82
+ let jsonArray = []
83
+ if(jsonString.startsWith("{")){
84
+ jsonArray.push(res.data)
85
+ res.data = jsonArray
86
+ }
87
+ this.department_search = res.data
88
+ }
89
+
90
+ // data 填充 selectdata
91
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
92
+ this.data = Object.assign({},this.data, this.selectdata)
93
+ console.log('this.data的值=>' + JSON.stringify(this.data))
94
+
95
+ // 初始化 fields
96
+ console.log('this.data.fields.length=>' + this.data.fields.length)
97
+ for(let i=0;i<this.data.fields.length;i++){
98
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
99
+ if(this.selectdata[this.data.fields[i].field]){
100
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
101
+ }
102
+ // 如果配置类型为select,优先从参数列表获取options
103
+ if(this.data.fields[i].type == 'select'){
104
+ console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
105
+ console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
106
+ var param = this.$appdata.getParam(this.data.fields[i].label)
107
+ console.log(param)
108
+ if (param){
109
+ this.data.fields[i].options = param
110
+ }
111
+
112
+ }
113
+ }
114
+ // 初始化 buttons_fields
115
+ for(let i=0;i<this.data.buttons.length;i++){
116
+ if(this.data.buttons[i].button_fields){
117
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
118
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
119
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
120
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
121
+ }
122
+ // 如果配置类型为select,优先从参数列表获取options
123
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
124
+ console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
125
+ console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
126
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
127
+ }
128
+ // 下发特殊配置
129
+ if(this.data.buttons[i].button_name==='下发'){
130
+ if(this.data.buttons[i].button_fields.length===1){
131
+ // value初始化
132
+ // if(this.department_search){
133
+ console.log("看看111department_search"+JSON.stringify(this.department_search))
134
+
135
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
136
+
137
+ for(let k=0;k<this.department_search.length;k++){
138
+ // 将id转换为name
139
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
140
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
141
+ }
142
+ }
143
+ }
144
+
145
+ if(this.department_search){
146
+ let array = []
147
+ console.log("看看department_search"+JSON.stringify(this.department_search))
148
+ this.department_search.forEach((paper)=>{
149
+ array.push({label:paper.name,value:paper.name})
150
+ })
151
+ this.data.buttons[i].button_fields[0].options = array
152
+ }
153
+ }else {
154
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
161
+ let temp = JSON.parse(JSON.stringify(this.data))
162
+ // 退回原因展示
163
+ if(this.selectdata.f_back_reason){
164
+ temp['back_reason'] = this.selectdata.f_back_reason
165
+ }
166
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
167
+ this.show_data = temp
168
+ console.log('initializtion()方法结束,showview')
169
+ this.showview = true
170
+ },
171
+ deleteLocalApply(model){
172
+ console.log(`前台上传完成,开始删除本地报建工单`)
173
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
174
+ }
175
+ },
176
+ events: {
177
+ // 任意select选中时触发事件
178
+ async 'select_cascade'(index) {
179
+ // this.$refs.service_show.data // 子业务显示组件
180
+ // 级联操作示例:
181
+ /*
182
+ if(this.$refs.service_show.data.fields[index].label==='报建类型'){
183
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
184
+ // 控制设置级联
185
+ // 源select所选的值 this.$refs.service_show.data.fields[index].value
186
+ if(this.$refs.service_show.data.fields[i].label==='级联测试2'){
187
+ this.$refs.service_show.data.fields[i].options=[
188
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
189
+ ]
190
+ }
191
+ }
192
+ }
193
+ */
194
+ /*
195
+ {
196
+ "label": "用水性质",
197
+ "type": "select",
198
+ "bootstraped": "col-sm-4",
199
+ "field": "f_gasproperties",
200
+ "readonly": true,
201
+ "disabled": false,
202
+ "required": false,
203
+ "hidden": true,
204
+ "options": []
205
+ },
206
+ {
207
+ "label": "水价类型",
208
+ "type": "select",
209
+ "bootstraped": "col-sm-4",
210
+ "field": "f_price_type",
211
+ "readonly": true,
212
+ "disabled": false,
213
+ "required": false,
214
+ "hidden": true,
215
+ "options": []
216
+ },
217
+ {
218
+ "label": "水价名称",
219
+ "type": "select",
220
+ "bootstraped": "col-sm-4",
221
+ "field": "f_price_name",
222
+ "readonly": true,
223
+ "disabled": false,
224
+ "required": false,
225
+ "hidden": true,
226
+ "options": []
227
+ },
228
+ {
229
+ "label": "水价id",
230
+ "type": "number",
231
+ "bootstraped": "col-sm-4",
232
+ "field": "f_price_id",
233
+ "readonly": true,
234
+ "disabled": false,
235
+ "required": false,
236
+ "hidden": true
237
+ },
238
+ */
239
+ if(this.$refs.service_show.data.fields[index].label === '是否装新表'){
240
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
241
+ if(this.$refs.service_show.data.fields[index].value == '是'){
242
+ if(this.$refs.service_show.data.fields[i].label=='用水性质'||
243
+ this.$refs.service_show.data.fields[i].label=='水价类型'||
244
+ this.$refs.service_show.data.fields[i].label=='水价名称'
245
+ ){
246
+ this.$refs.service_show.data.fields[i].required=true,
247
+ this.$refs.service_show.data.fields[i].hidden=false
248
+ }
249
+ }else{
250
+ if(this.$refs.service_show.data.fields[i].label=='用水性质'||
251
+ this.$refs.service_show.data.fields[i].label=='水价类型'||
252
+ this.$refs.service_show.data.fields[i].label=='水价名称'){
253
+ this.$refs.service_show.data.fields[i].required=false,
254
+ this.$refs.service_show.data.fields[i].hidden=true
255
+ }
256
+ }
257
+ }
258
+ }
259
+ if(this.$refs.service_show.data.fields[index].label === '是否装新表'&&this.$refs.service_show.data.fields[index].value=='是'){
260
+ let usertype = ''
261
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
262
+ if(this.$refs.service_show.data.fields[i].label=='用户类型'){
263
+ usertype = this.$refs.service_show.data.fields[i].value
264
+ }
265
+ if(this.$refs.service_show.data.fields[i].label=='用水性质'&&this.$refs.service_show.data.fields[index].value){
266
+ this.$refs.service_show.data.fields[i].options=[]
267
+ this.$refs.service_show.data.fields[i].value = ''
268
+ this.$refs.service_show.data.fields[i].options= this.$appdata.getParam(usertype)
269
+ }
270
+ }
271
+ }
272
+
273
+ if (this.$refs.service_show.data.fields[index].label === '用户类型') { //用水性质
274
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
275
+ if(this.$refs.service_show.data.fields[i].label=='用水性质'&&this.$refs.service_show.data.fields[index].value){
276
+ this.$refs.service_show.data.fields[i].options=[]
277
+ this.$refs.service_show.data.fields[i].value = ''
278
+ this.$refs.service_show.data.fields[i].options= this.$appdata.getParam(this.$refs.service_show.data.fields[index].value.trim())
279
+ }
280
+ }
281
+ }
282
+
283
+ if (this.$refs.service_show.data.fields[index].label === '技术人员') { //水价类型
284
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
285
+ if(this.$refs.service_show.data.fields[i].label=='技术人员id'&&this.$refs.service_show.data.fields[index].value){
286
+ if(typeof this.$refs.service_show.data.fields[index].value=='object'){
287
+ this.$refs.service_show.data.fields[i].value=this.$refs.service_show.data.fields[index].value.id
288
+ }
289
+ }
290
+ }
291
+ }
292
+
293
+
294
+ if (this.$refs.service_show.data.fields[index].label === '用水性质') { //水价类型
295
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
296
+ if(this.$refs.service_show.data.fields[i].label=='水价类型'&&this.$refs.service_show.data.fields[index].value){
297
+ this.$refs.service_show.data.fields[i].options=[]
298
+ this.$refs.service_show.data.fields[i].value = ''
299
+ this.$refs.service_show.data.fields[i].options= this.$appdata.getParam(this.$refs.service_show.data.fields[i].label)
300
+ }
301
+ }
302
+ }
303
+
304
+ if (this.$refs.service_show.data.fields[index].label === '水价类型') {
305
+ let gasproperties = ''
306
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
307
+ if(this.$refs.service_show.data.fields[i].label=='用水性质'){
308
+ gasproperties= this.$refs.service_show.data.fields[i].value
309
+ }
310
+ if(this.$refs.service_show.data.fields[i].label=='水价名称'){
311
+ this.$refs.service_show.data.fields[i].value=''
312
+ }
313
+
314
+ }
315
+
316
+ let pricetype=this.$refs.service_show.data.fields[index].value
317
+ let http = new HttpResetClass()
318
+ let condition =`f_user_type = '${this.selectdata.f_user_type}' and f_filiale = '${Vue.user.f_fengongsi}'
319
+ and f_gasproperties = '${gasproperties}' and f_price_type = '${this.$refs.service_show.data.fields[index].value}'`
320
+ let res = await http.load('POST', 'rs/logic/getRecordItem', {condition}, {resolveMsg: null, rejectMsg: null})
321
+ console.log('获取的水价类型,',res)
322
+ let house2 = []
323
+ if (res.data.pricename) {
324
+ for (let row of res.data.pricename){
325
+ house2.push({label: row.f_price_name,value: {id:row.f_price_id,name:row.f_price_name}})
326
+ }
327
+ }
328
+
329
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
330
+ if (this.$refs.service_show.data.fields[i].label === '水价名称') {
331
+ this.$refs.service_show.data.fields[i].options= house2
332
+ }
333
+ }
334
+ }
335
+
336
+ if (this.$refs.service_show.data.fields[index].label === '水价名称') { //用水性质
337
+ if(this.$refs.service_show.data.fields[index].value&&typeof this.$refs.service_show.data.fields[index].value =='object'){
338
+ for(let i=0;i<this.$refs.service_show.data.fields.length;i++){
339
+ if(this.$refs.service_show.data.fields[i].label=='水价id'){
340
+ this.$refs.service_show.data.fields[i].value= Number(this.$refs.service_show.data.fields[index].value.id)
341
+ }
342
+ }
343
+ this.$refs.service_show.data.fields[index].value= this.$refs.service_show.data.fields[index].value.name
344
+ }
345
+ }
346
+
347
+ if (this.$refs.service_show.data.fields[index].label === '报建类型') {
348
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
349
+ if (this.$refs.service_show.data.fields[i].label == '用户类型') {
350
+ if (this.$refs.service_show.data.fields[index].value.includes('民用')) {
351
+ this.$refs.service_show.data.fields[i].value = '民用'
352
+ } else {
353
+ this.$refs.service_show.data.fields[i].value = '非民用'
354
+ }
355
+ this.$refs.service_show.update()
356
+ return
357
+ }
358
+ }
359
+ }
360
+
361
+ if (this.$refs.service_show.data.fields[index].label === '表号') {
362
+ if(this.$refs.service_show.data.fields[index].value){
363
+ let http = new HttpResetClass()
364
+ let data = {
365
+ columnname: ` uf.f_meternumber `,
366
+ tablename: ' t_userfiles uf LEFT JOIN t_userinfo ui on ui.f_userinfo_id = uf.f_userinfo_id ',
367
+ condition: `(f_user_state = '正常' or f_user_state = '报装') and uf.f_meternumber = '${this.$refs.service_show.data.fields[index].value}' and ui.f_process_id != '${this.selectdata.f_process_id}'`
368
+ }
369
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {
370
+ resolveMsg: null,
371
+ rejectMsg: "表号查询失败"
372
+ })
373
+ if(res.data.length>0){
374
+ this.$showMessage("警告:表号已被使用!请查证")
375
+ }
376
+ }
377
+ }
378
+
379
+ if (this.$refs.service_show.data.fields[index].label === '安装表数'&&this.$refs.service_show.data.fields[index].value==1) {
380
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++){
381
+ if (this.$refs.service_show.data.fields[i].label === '用户类型'){
382
+ // =this.$refs.service_show.data.fields[i].value
383
+ }
384
+ }
385
+ }
386
+
387
+ if (this.data.f_install_num == 1 && this.$refs.service_show.data.fields[index].label === '是否有表') {
388
+ if (this.$refs.service_show.data.fields[index].value == "是") {
389
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
390
+ if (this.$refs.service_show.data.fields[i].label === '水表品牌'
391
+ || this.$refs.service_show.data.fields[i].label === '水表型号'
392
+ || this.$refs.service_show.data.fields[i].label === '左右表'
393
+ || this.$refs.service_show.data.fields[i].label === '表号'
394
+ || this.$refs.service_show.data.fields[i].label === '水表厂家') {
395
+ this.$refs.service_show.data.fields[i].hidden = false
396
+ this.$refs.service_show.data.fields[i].required = true
397
+ } else if (this.selectdata.defname == '通水' && this.$refs.service_show.data.fields[i].label === '通水表号') {
398
+ this.$refs.service_show.data.fields[i].hidden = false
399
+ this.$refs.service_show.data.fields[i].required = true
400
+ }
401
+ }
402
+ } else {
403
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
404
+ if (this.$refs.service_show.data.fields[i].label === '水表品牌'
405
+ || this.$refs.service_show.data.fields[i].label === '水表型号'
406
+ || this.$refs.service_show.data.fields[i].label === '表号'
407
+ || this.$refs.service_show.data.fields[i].label === '左右表'
408
+ || this.$refs.service_show.data.fields[i].label === '水表厂家') {
409
+ this.$refs.service_show.data.fields[i].hidden = true
410
+ this.$refs.service_show.data.fields[i].required = false
411
+ } else if (this.selectdata.defname == '通水' && this.$refs.service_show.data.fields[i].label === '通水表号') {
412
+ this.$refs.service_show.data.fields[i].hidden = true
413
+ this.$refs.service_show.data.fields[i].required = false
414
+ }
415
+ }
416
+ }
417
+ }
418
+ if (this.$refs.service_show.data.fields[index].label === '水表品牌') {
419
+ // console.log("水表品牌>>>>>"+JSON.stringify(this.$refs.service_show.data.fields[index].value))
420
+ let id = null
421
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
422
+ if (this.$refs.service_show.data.fields[i].label == '水表型号') {
423
+ this.$refs.service_show.data.fields[i].value = ''
424
+ let temp = {}
425
+ // console.log("this.$refs.service_show.data.fields[index].value",this.$refs.service_show.data.fields[index].value)
426
+ if(typeof this.$refs.service_show.data.fields[index].value =='string'){
427
+ for (let x = 0; x < Vue.ApplyGetSaleParam.gasbrands.length; x++) {
428
+ if (Vue.ApplyGetSaleParam.gasbrands[x].label == this.$refs.service_show.data.fields[index].value) {
429
+ temp = Vue.ApplyGetSaleParam.gasbrands[x].value.gasmodel
430
+ id = Vue.ApplyGetSaleParam.gasbrands[x].value.id
431
+ }
432
+ }
433
+ // let temp = this.$refs.service_show.data.fields[index].value.gasmodel
434
+ this.$refs.service_show.data.fields[i].options = temp
435
+ this.$refs.service_show.data.fields[index].value = typeof this.$refs.service_show.data.fields[index].value == 'string' ? this.$refs.service_show.data.fields[index].value : this.$refs.service_show.data.fields[index].value.f_meter_brand
436
+ }else{
437
+ id= Number(this.$refs.service_show.data.fields[index].value.id)
438
+ let http = new HttpResetClass()
439
+ let data = {
440
+ columnname: 'f_meter_style,id',
441
+ tablename: 't_gasmodel ',
442
+ condition: ` f_gasbrand_id = ${this.$refs.service_show.data.fields[index].value.id} `
443
+ }
444
+ let res = await http.load('POST', 'rs/sql/getdistinct', {data: data}, {resolveMsg: null, rejectMsg: '获取水表型号失败'})
445
+ this.$refs.service_show.data.fields[i].options=[]
446
+ for(let x=0;x<res.data.length;x++){
447
+ this.$refs.service_show.data.fields[i].options.push({label:res.data[x].f_meter_style,value:{id:res.data[x].id,name:res.data[x].f_meter_style}})
448
+ }
449
+ console.log("水表型号",this.$refs.service_show.data.fields[i].options)
450
+ // for (let x = 0; x < Vue.ApplyGetSaleParam.gasbrands.length; x++) {
451
+ // if (Vue.ApplyGetSaleParam.gasbrands[x].label == this.$refs.service_show.data.fields[index].value.f_meter_brand) {
452
+ // temp = Vue.ApplyGetSaleParam.gasbrands[x].value.gasmodel
453
+ // id = Vue.ApplyGetSaleParam.gasbrands[x].value.id
454
+ // }
455
+ // }
456
+ // // let temp = this.$refs.service_show.data.fields[index].value.gasmodel
457
+ // this.$refs.service_show.data.fields[i].options = temp
458
+ // this.$refs.service_show.data.fields[index].value = typeof this.$refs.service_show.data.fields[index].value == 'string' ? this.$refs.service_show.data.fields[index].value : this.$refs.service_show.data.fields[index].value.f_meter_brand
459
+ }
460
+
461
+
462
+ // this.$refs.service_show.update()
463
+ } else if (this.$refs.service_show.data.fields[i].label == '水表品牌id') {
464
+ this.$refs.service_show.data.fields[i].value = id
465
+ }
466
+ }
467
+ for(let i = 0; i < this.$refs.service_show.data.fields.length; i++){
468
+ if (this.$refs.service_show.data.fields[i].label == '水表品牌id') {
469
+ this.$refs.service_show.data.fields[i].value = id
470
+ }
471
+ }
472
+ this.$refs.service_show.update()
473
+ }
474
+ if (this.$refs.service_show.data.fields[index].label === '水表型号') {
475
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
476
+ if (this.$refs.service_show.data.fields[i].label == '水表型号id') {
477
+ this.$refs.service_show.data.fields[i].value = Number(this.$refs.service_show.data.fields[index].value.id)
478
+ // console.log("水表型号id:",this.$refs.service_show.data.fields[i].value)
479
+ }else if(this.$refs.service_show.data.fields[i].label == '水表品牌'&&typeof this.$refs.service_show.data.fields[i].value =='object'){
480
+ this.$refs.service_show.data.fields[i].value = this.$refs.service_show.data.fields[i].value.name
481
+ }
482
+ }
483
+ this.$refs.service_show.data.fields[index].value = this.$refs.service_show.data.fields[index].value.name
484
+ this.$refs.service_show.update()
485
+ return
486
+ }
487
+
488
+
489
+ if (this.$refs.service_show.data.fields[index].label == '电话号码') {
490
+ let phone = this.$refs.service_show.data.fields[index].value
491
+ // 电话号码效验
492
+ if (!(/^1[3456789]\d{9}$/.test(phone))) {
493
+ this.$refs.service_show.data.fields[index].value = ""
494
+ this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
495
+ }
496
+ }
497
+
498
+ if (this.$refs.service_show.data.fields[index].label == '施工单位' ||
499
+ this.$refs.service_show.data.fields[index].label == '检测单位' ||
500
+ this.$refs.service_show.data.fields[index].label == '监理单位' ||
501
+ this.$refs.service_show.data.fields[index].label == '土建单位' ||
502
+ this.$refs.service_show.data.fields[index].label == '设计单位') {
503
+ console.log(this.$refs.service_show.data.fields[index].label,this.$refs.service_show.data.fields[index].value)
504
+ this.$refs.service_show.update()
505
+ return
506
+ }
507
+
508
+ if (
509
+ this.$refs.service_show.data.fields[index].label === '最终核算成本金额' ||
510
+ this.$refs.service_show.data.fields[index].label === '合同总金额' ||
511
+ this.$refs.service_show.data.fields[index].label === '工程盈利'
512
+ ) {
513
+
514
+ var a = 0
515
+ var b = 0
516
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
517
+ // 控制设置级联
518
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
519
+ // xxx xx xxx
520
+ if (this.$refs.service_show.data.fields[i].label === '最终核算成本金额') {
521
+ this.$refs.service_show.data.fields[i].value = (this.number + this.cost + this.anzhuangsum + this.tujiansum)
522
+ a = this.$refs.service_show.data.fields[i].value
523
+ }
524
+
525
+ if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
526
+ b = this.$refs.service_show.data.fields[i].value
527
+ }
528
+ }
529
+ var c = b - a
530
+ // 数据计算完毕得到工程结余
531
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
532
+ if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
533
+ this.$refs.service_show.data.fields[i].value = c
534
+ }
535
+ }
536
+ }
537
+
538
+ if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields[index].label === '收费金额') {
539
+ let chargeMoney = this.$refs.service_show.showadd_fields[index].value
540
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
541
+ if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
542
+ let cumulativeMoney = this.$refs.service_show.data.fields[i].value
543
+ if (Number(chargeMoney) > Number(cumulativeMoney)) {
544
+ this.$showMessage("收费金额不得大于未结总金额!")
545
+ this.$refs.service_show.showadd_fields[index].value = null
546
+ return
547
+ } else {
548
+
549
+ }
550
+ }
551
+ }
552
+ }
553
+
554
+ //根据合同预算金额和累计缴费金额计算未结金额
555
+ if (this.$refs.service_show.data.fields[index] && this.$refs.service_show.data.fields[index].label === '累计缴费金额') {
556
+ let cumulativeMoney = this.$refs.service_show.data.fields[index].value
557
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
558
+ if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
559
+ this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_money) - Number(cumulativeMoney)
560
+ }
561
+ }
562
+ }
563
+ //根据合同预算金额和累计开票金额计算未开票金额
564
+ if (this.$refs.service_show.data.fields[index].label === '累计开票金额') {
565
+ let residualInvoicing = this.$refs.service_show.data.fields[index].value
566
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
567
+ if (this.$refs.service_show.data.fields[i].label === '未开票金额') {
568
+ this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_total_money) - Number(residualInvoicing)
569
+ }
570
+ }
571
+ }
572
+ //如果资料验收是否通过和工程验收是否通过为否的时候弹出原因填写框
573
+ if (this.$refs.service_show.data.fields[index].label === '资料验收是否通过') {
574
+ let res = this.$refs.service_show.data.fields[index].value
575
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
576
+ if (this.$refs.service_show.data.fields[i].label === '资料验收不通过原因') {
577
+ if (res === '否') {
578
+ this.$refs.service_show.data.fields[i].hidden = false
579
+ this.$refs.service_show.data.fields[i].required = true
580
+ } else {
581
+ this.$refs.service_show.data.fields[i].hidden = true
582
+ this.$refs.service_show.data.fields[i].required = false
583
+ }
584
+ }
585
+ }
586
+ }
587
+ //洪雅预算审核获取当前操作人
588
+ // console.log("lable:"+this.$refs.service_show.data.fields[index].label)
589
+ // console.log("field:"+this.$refs.service_show.data.fields[index].field)
590
+ // if (this.$refs.service_show.data.fields[index].label === "审核人" && this.$refs.service_show.data.fields[index].field === "f_nstall_checker_gc" ){
591
+ // console.log("name:"+JSON.stringify(Vue.$login.f.name))
592
+ // this.$refs.service_show.data.fields[index].field = Vue.$login.f.name
593
+ // }
594
+
595
+ if (this.$refs.service_show.data.fields[index].label === '工程验收是否通过') {
596
+ let res = this.$refs.service_show.data.fields[index].value
597
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
598
+ if (this.$refs.service_show.data.fields[i].label === '工程验收不通过原因') {
599
+ if (res === '否') {
600
+ this.$refs.service_show.data.fields[i].hidden = false
601
+ this.$refs.service_show.data.fields[i].required = true
602
+ } else {
603
+ this.$refs.service_show.data.fields[i].hidden = true
604
+ this.$refs.service_show.data.fields[i].required = false
605
+ }
606
+ }
607
+ }
608
+ }
609
+ //根据总户数和实际安装表数计算未安装表数
610
+ // if (this.$refs.service_show.data.fields[index].label === '实际安装表数') {
611
+ // let value = this.$refs.service_show.data.fields[index].value
612
+ // for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
613
+ // if (this.$refs.service_show.data.fields[i].label === '未安装表数') {
614
+ // this.$refs.service_show.data.fields[i].label === '未安装表数'
615
+ // this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_install_num) - Number(value)
616
+ // }
617
+ // }
618
+ // }
619
+
620
+ //金额小写得到大写
621
+ if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields.fields[index].label === '收费金额') {
622
+ if (this.$refs.service_show.showadd_fields[index].value || this.$refs.service_show.showadd_fields.fields[index].value) {
623
+ var re = /^[0-9]+.?[0-9]*/
624
+ let temp = this.$refs.service_show.showadd_fields[index].value
625
+ if (temp == "" || isNaN(temp)) {
626
+ this.$showMessage("请输入纯数字")
627
+ this.$refs.service_show.showadd_fields[index].value = 0
628
+ }
629
+ }
630
+ let temp = this.$refs.service_show.showadd_fields[index]
631
+ let value = temp.value
632
+ // let chargeMoney = this.$refs.service_show.showadd_fields[index].value
633
+ for (let i = 0; i < this.$refs.service_show.showadd_fields.fields.length; i++) {
634
+ if (this.$refs.service_show.showadd_fields.fields[i].label === '金额大写') {
635
+ let te = {
636
+ value: this.smalltoBIG(value)
637
+ }
638
+ this.$refs.service_show.showadd_fields[i] = te
639
+ }
640
+ }
641
+ }
642
+
643
+ // console.log(JSON.stringify(Vue.user))
644
+ if (this.$refs.service_show.data.fields[index].label === '县/区') {
645
+ let temp = this.$refs.service_show.data.fields[index].value
646
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
647
+ // 控制设置级联
648
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
649
+ if (this.$refs.service_show.data.fields[i].label === '片区') {
650
+ this.$refs.service_show.data.fields[i].value = ''
651
+ this.$refs.service_show.data.fields[i].options = []
652
+ let rs = []
653
+ console.log('小区片区。。。', temp)
654
+ for (let j = 0; j < Vue.user.f_allArea.length; j++) {
655
+ if (Vue.user.f_allArea[j].label === temp) {
656
+ rs = Vue.user.f_allArea[j].value
657
+ }
658
+ }
659
+ console.log('获取小区片区=>' + JSON.stringify(rs))
660
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
661
+ this.$refs.service_show.update()
662
+ }
663
+ }
664
+ }
665
+ //控制尾款
666
+ if (
667
+ this.$refs.service_show.data.fields[index].label === '合同金额' ||
668
+ this.$refs.service_show.data.fields[index].label === '首付' ||
669
+ this.$refs.service_show.data.fields[index].label === '进度款' ||
670
+ this.$refs.service_show.data.fields[index].label === '尾款'
671
+ ) {
672
+ console.log('即将计算合同金额')
673
+ var cash = 0
674
+ var downpayments = 0
675
+ var tailmoney = 0
676
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
677
+ // 控制设置级联
678
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
679
+ // xxx xx xxx
680
+ if (this.$refs.service_show.data.fields[i].label === '合同金额' && this.$refs.service_show.data.fields[i].value) {
681
+ cash = this.$refs.service_show.data.fields[i].value
682
+ }
683
+ if (this.$refs.service_show.data.fields[i].label === '首付' && this.$refs.service_show.data.fields[i].value) {
684
+ downpayments = this.$refs.service_show.data.fields[i].value
685
+ }
686
+ if (this.$refs.service_show.data.fields[i].label === '进度款' && this.$refs.service_show.data.fields[i].value) {
687
+ tailmoney = this.$refs.service_show.data.fields[i].value
688
+ }
689
+ }
690
+ var a = cash - downpayments
691
+ a= a.toFixed(2)
692
+ // 数据计算完毕得到尾款
693
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
694
+ if (this.$refs.service_show.data.fields[i].label === '尾款') {
695
+ if (cash === downpayments) {
696
+ this.$refs.service_show.data.fields[i].value = 0
697
+ } else {
698
+ this.$refs.service_show.data.fields[i].value = (cash - downpayments - tailmoney)
699
+ this.$refs.service_show.data.fields[i].value=this.$refs.service_show.data.fields[i].value.toFixed(2)
700
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
701
+ }
702
+ }
703
+ if (this.$refs.service_show.data.fields[i].label === '首付') {
704
+ if (a < 0) {
705
+ this.$showMessage("首付款数额过大")
706
+ downpayments = 0
707
+ this.$refs.service_show.data.fields[i].value = 0
708
+ }
709
+ }
710
+
711
+ if (this.$refs.service_show.data.fields[i].label === '进度款') {
712
+
713
+ if (cash === downpayments) {
714
+ tailmoney = 0
715
+ this.$refs.service_show.data.fields[i].value = 0
716
+ this.$refs.service_show.data.fields[i].readonly = true
717
+ } else {
718
+ this.$refs.service_show.data.fields[i].readonly = false
719
+ tailmoney = this.$refs.service_show.data.fields[i].value
720
+ }
721
+ if (tailmoney > a) {
722
+ this.$showMessage("进度款数额过大")
723
+ tailmoney = 0
724
+ this.$refs.service_show.data.fields[i].value = 0
725
+ }
726
+ }
727
+ }
728
+ }
729
+ let temp = 0
730
+ let then = 0
731
+ let install = 0
732
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
733
+ //未交金额计算
734
+ if (this.selectdata.defname === "报建缴费") {
735
+ if (this.$refs.service_show.data.fields[i].label === '超长费') {
736
+ then = this.$refs.service_show.data.fields[i].value
737
+ }
738
+ if (this.$refs.service_show.data.fields[i].label === '安装费') {
739
+ install = this.$refs.service_show.data.fields[i].value
740
+ }
741
+ if (this.$refs.service_show.data.fields[i].label === '应收金额') {
742
+ this.$refs.service_show.data.fields[i].value = parseFloat(then) + parseFloat(install)
743
+ temp = this.$refs.service_show.data.fields[i].value
744
+ }
745
+ if (this.$refs.service_show.data.fields[i].label === '实收金额') {
746
+ temp = temp - this.$refs.service_show.data.fields[i].value
747
+ this.nowcost = this.$refs.service_show.data.fields[i].value
748
+ }
749
+ if (this.$refs.service_show.data.fields[i].label === '金额大写') {
750
+ this.$refs.service_show.data.fields[i].value = this.smalltoBIG(Number(this.nowcost))
751
+ }
752
+ for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
753
+ if (this.$refs.service_show.data.fields[j].label === '欠费金额'){
754
+ this.$refs.service_show.data.fields[j].value = temp
755
+ }
756
+ }
757
+ if (temp < 0) {
758
+ this.$showMessage("欠费金额不能为负数")
759
+ return
760
+ }
761
+ }
762
+ // if (this.selectdata.defname === "现场踏勘") {
763
+ // if (this.$refs.service_show.data.fields[i].label === '收款金额') {
764
+ // temp = this.$refs.service_show.data.fields[i].value
765
+ // }
766
+ // if (this.$refs.service_show.data.fields[i].label === '已交金额') {
767
+ // temp = temp - this.$refs.service_show.data.fields[i].value
768
+ // this.nowcost = this.$refs.service_show.data.fields[i].value
769
+ // }
770
+ // if (this.$refs.service_show.data.fields[i].label === '金额大写') {
771
+ // this.$refs.service_show.data.fields[i].value = this.smalltoBIG(Number(this.nowcost))
772
+ // }
773
+ // for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
774
+ // if (this.$refs.service_show.data.fields[j].label === '未交金额'){
775
+ // this.$refs.service_show.data.fields[j].value = temp
776
+ // }
777
+ // }
778
+ // if (temp < 0) {
779
+ // this.$showMessage("欠费金额不能为负数")
780
+ // return
781
+ // }
782
+ // }
783
+
784
+ //任何是否的选择框只要是否都不能提交
785
+ // if (this.selectdata.defname != '寻找市场' && this.selectdata.defname != '用户申请') {
786
+ // if (this.$refs.service_show.data.fields[i].value === '否') {
787
+ // this.$refs.service_show.disable_button = false
788
+ // console.log(this.$refs.service_show.data)
789
+ // this.$refs.service_show.data.buttons[1].button_name = '保存'
790
+ // this.$showMessage("当审核/确认为否时,无法提交")
791
+ // return
792
+ // }else {
793
+ // this.$refs.service_show.data.buttons[1].button_name = '提交'
794
+ // }
795
+ // }
796
+ //获取抄表员
797
+ if (this.$refs.service_show.data.fields[i].label === '安装员'){
798
+ let person = []
799
+ let array = []
800
+ person = Vue.user.f_installman.map(item => {
801
+ return item.name;
802
+ })
803
+ console.log("安装员获取" + JSON.stringify(person))
804
+ for (let q = 0; q < person.length; q++) {
805
+ let arraydata = {
806
+ 'label': person[q],
807
+ 'value': person[q]
808
+ }
809
+ if (array.length != 0) {
810
+ for (let w = 0; w < array.length; w++) {
811
+ if (array[w].label == person[q]) {
812
+ break
813
+ }
814
+ while (w == array.length - 1) {
815
+ array.push(arraydata)
816
+ break
817
+ }
818
+ }
819
+ } else {
820
+ array.push(arraydata)
821
+ }
822
+ }
823
+ this.$refs.service_show.data.fields[i].options = array
824
+ }
825
+ //气价名称、气价类型
826
+ if (
827
+ this.$refs.service_show.data.fields[i].label === '气价名称' ||
828
+ this.$refs.service_show.data.fields[i].label === '气价类型' ||
829
+ this.$refs.service_show.data.fields[i].label === '价格' ||
830
+ this.$refs.service_show.data.fields[i].label === '客户类型' ||
831
+ this.$refs.service_show.data.fields[i].label === '用气性质'
832
+ ) {
833
+ let http = new HttpResetClass()
834
+ let condition = "f_orgid = '" + Vue.user.orgid + "'"
835
+ let res = await http.load('POST','rs/sql/singleTable',{data:{tablename:'t_stairprice',condition:condition}}, {resolveMsg: null, rejectMsg: null})
836
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
837
+ if (this.$refs.service_show.data.fields[i].label == '气价名称') {
838
+ let data = []
839
+ let array = []
840
+ data = res.data.map(item => {
841
+ return item.f_price_name;
842
+ })
843
+ for (let q = 0; q < data.length; q++) {
844
+ let arraydata = {
845
+ 'label': data[q],
846
+ 'value': data[q]
847
+ }
848
+ if (array.length != 0) {
849
+ for (let w = 0; w < array.length; w++) {
850
+ if (array[w].label == data[q]) {
851
+ break
852
+ }
853
+ while (w == array.length - 1) {
854
+ array.push(arraydata)
855
+ break
856
+ }
857
+ }
858
+ } else {
859
+ array.push(arraydata)
860
+ }
861
+ }
862
+ this.$refs.service_show.data.fields[i].options = array
863
+ console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
864
+ console.log("有没有数据长度:" + this.$refs.service_show.data.fields[i].value.length)
865
+ }
866
+
867
+ if (this.$refs.service_show.data.fields[i].label == '气价名称' && this.$refs.service_show.data.fields[i].value.length != 0) {
868
+ let http2 = new HttpResetClass()
869
+ let condition2 = "s.f_orgid = '" + Vue.user.orgid + "'" + " and s.f_price_name = '" + this.$refs.service_show.data.fields[i].value + "'"
870
+ let res2 = await http2.load('POST','rs/sql/searchGasPrice',{data:{condition:condition2}}, {resolveMsg: null, rejectMsg: null})
871
+ console.log("气价数据:" + JSON.stringify(res2.data))
872
+ for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
873
+ if (this.$refs.service_show.data.fields[j].label == '气价类型') {
874
+ console.log("气价类型:" + res2.data[0])
875
+ console.log("气价类型1:" + res2.data[0].f_price_type)
876
+ this.$refs.service_show.data.fields[j].value = res2.data[0].f_price_type
877
+ console.log("气价类型2:" + this.$refs.service_show.data.fields[j].value)
878
+ }
879
+ //气价拼接
880
+ if (this.$refs.service_show.data.fields[j].label == '价格') {
881
+ let p = 1
882
+ let resultPrice = ''
883
+ for(let l = 0; l < res2.data.length; l++){
884
+ resultPrice = resultPrice + res2.data[l].price + ' |'
885
+ if (p == 3) {
886
+ break
887
+ }
888
+ p++
889
+ }
890
+ console.log("拼接的价格:" + resultPrice)
891
+ this.$refs.service_show.data.fields[j].value = resultPrice
892
+ }
893
+ if (this.$refs.service_show.data.fields[j].label == '用气性质') {
894
+ this.$refs.service_show.data.fields[j].value = res2.data[0].f_gasproperties
895
+ }
896
+ if (this.$refs.service_show.data.fields[j].label == '客户类型') {
897
+ this.$refs.service_show.data.fields[j].value = res2.data[0].f_user_type
898
+ }
899
+ }
900
+
901
+ }
902
+
903
+ }
904
+
905
+
906
+
907
+ }
908
+
909
+ }
910
+
911
+
912
+
913
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
914
+ //所属公司
915
+ if (this.selectdata.defname == '用户建档') {
916
+ if (this.$refs.service_show.data.fields[i].label === '所属公司') {
917
+ this.$refs.service_show.data.fields[i].value = Vue.user.orgs
918
+ }
919
+ }
920
+ // 气表品牌
921
+ if (
922
+ this.$refs.service_show.data.fields[i].label === '气表品牌' ||
923
+ this.$refs.service_show.data.fields[i].label === '气表型号'
924
+ ) {
925
+ if (this.$refs.service_show.data.fields[i].label == '气表品牌') {
926
+ let http = new HttpResetClass()
927
+ let condition = "f_orgid = '" + Vue.user.orgid + "'"
928
+ let res = await http.load('POST','rs/sql/applysingleTable',{data:{tablename:'t_gasbrand',condition:condition}}, {resolveMsg: null, rejectMsg: null})
929
+ for (let p = 0; p < this.$refs.service_show.data.fields.length; p++) {
930
+ if (this.$refs.service_show.data.fields[p].label == '气表品牌') {
931
+ let data = []
932
+ let array = []
933
+ data = res.data.map(item => {
934
+ return item.f_meter_brand;
935
+ })
936
+ for (let q = 0; q < data.length; q++) {
937
+ let arraydata = {
938
+ 'label': data[q],
939
+ 'value': data[q]
940
+ }
941
+ if (array.length != 0) {
942
+ for (let w = 0; w < array.length; w++) {
943
+ if (array[w].label == data[q]) {
944
+ break
945
+ }
946
+ while (w == array.length - 1) {
947
+ array.push(arraydata)
948
+ break
949
+ }
950
+ }
951
+ } else {
952
+ array.push(arraydata)
953
+ }
954
+ }
955
+ this.$refs.service_show.data.fields[i].options = array
956
+ console.log("气表品牌选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
957
+ }
958
+ }
959
+ }
960
+
961
+
962
+ if (this.$refs.service_show.data.fields[i].label == '气表品牌' && this.$refs.service_show.data.fields[i].value.length != 0) {
963
+ let style = this.$refs.service_show.data.fields[i].value
964
+ for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
965
+
966
+ if (this.$refs.service_show.data.fields[j].label == '气表型号') {
967
+ let http2 = new HttpResetClass()
968
+ let res2 = await http2.load('POST','rs/sql/queryGasType',{data:{f_orgid:Vue.user.orgid,f_meter_brand:style}}, {resolveMsg: null, rejectMsg: null})
969
+ console.log("气表型号查询数据" + JSON.stringify(res2.data))
970
+ let data = []
971
+ let data2 = []
972
+ let array = []
973
+ data = res2.data.map(item => {
974
+ return item.f_meter_style;
975
+ })
976
+ data2 = res2.data.map(item => {
977
+ return item.f_type;
978
+ })
979
+ console.log("是不是来过这儿1")
980
+ for (let q = 0; q < data.length; q++) {
981
+ let arraydata = {
982
+ 'label': data[q] + data2[q],
983
+ 'value': data[q] + data2[q]
984
+ }
985
+ let then = data[q] + data2[q]
986
+ if (array.length != 0) {
987
+ for (let w = 0; w < array.length; w++) {
988
+ if (array[w].label == then) {
989
+ break
990
+ }
991
+ while (w == array.length - 1) {
992
+ array.push(arraydata)
993
+ break
994
+ }
995
+ }
996
+ } else {
997
+ array.push(arraydata)
998
+ }
999
+ }
1000
+ this.$refs.service_show.data.fields[j].options = array
1001
+ console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[j].options))
1002
+ }
1003
+ }
1004
+
1005
+ }
1006
+ }
1007
+ //调压箱获取
1008
+ if (
1009
+ this.selectdata.defname == '气表安装'
1010
+ ) {
1011
+ let http = new HttpResetClass()
1012
+ let condition = "f_filialeid = '" + Vue.user.orgid + "'"
1013
+ let res = await http.load('POST','rs/sql/singleTable',{data:{tablename:'t_adjustablebox',condition:condition}}, {resolveMsg: null, rejectMsg: null})
1014
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1015
+ if (this.$refs.service_show.data.fields[i].label === '调压箱') {
1016
+ let data = []
1017
+ let array = []
1018
+ data = res.data.map(item => {
1019
+ return item.f_adjustable_name;
1020
+ })
1021
+ for (let q = 0; q < data.length; q++) {
1022
+ let arraydata = {
1023
+ 'label': data[q],
1024
+ 'value': data[q]
1025
+ }
1026
+ if (array.length != 0) {
1027
+ for (let w = 0; w < array.length; w++) {
1028
+ if (array[w].label == data[q]) {
1029
+ break
1030
+ }
1031
+ while (w == array.length - 1) {
1032
+ array.push(arraydata)
1033
+ break
1034
+ }
1035
+ }
1036
+ } else {
1037
+ array.push(arraydata)
1038
+ }
1039
+ }
1040
+ this.$refs.service_show.data.fields[i].options = array
1041
+ console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1042
+ }
1043
+
1044
+ }
1045
+
1046
+
1047
+ }
1048
+ }
1049
+ // console.log("this.selectdata:" + JSON.stringify(this.selectdata))
1050
+ // 合成地址
1051
+ if (
1052
+ this.$refs.service_show.data.fields[index].label === '区域' ||
1053
+ // this.$refs.service_show.data.fields[index].label === '片区' ||
1054
+ // this.$refs.service_show.data.fields[index].label === '街道名称' ||
1055
+ this.$refs.service_show.data.fields[index].label === '街道' ||
1056
+ // this.$refs.service_show.data.fields[index].label === '小区/单位' ||
1057
+ this.$refs.service_show.data.fields[index].label === '小区' ||
1058
+ this.$refs.service_show.data.fields[index].label === '楼号' ||
1059
+ this.$refs.service_show.data.fields[index].label === '单元号' ||
1060
+ this.$refs.service_show.data.fields[index].label === '楼层' ||
1061
+ this.$refs.service_show.data.fields[index].label === '门牌号'
1062
+ ) {
1063
+ console.log('即将合成地址')
1064
+ var address = ''
1065
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1066
+ // 控制设置级联
1067
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1068
+ // xxx xx xxx
1069
+ if (this.$refs.service_show.data.fields[i].label === '区域' && this.$refs.service_show.data.fields[i].value) {
1070
+ // let f_area = res.data.f_area
1071
+ // this.$refs.service_show.data.fields[i].value = f_area
1072
+ address += this.$refs.service_show.data.fields[i].value
1073
+ }
1074
+ // if (this.$refs.service_show.data.fields[i].label === '片区' && this.$refs.service_show.data.fields[i].value) {
1075
+ // address += this.$refs.service_show.data.fields[i].value
1076
+ // }
1077
+ // if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
1078
+ // address += this.$refs.service_show.data.fields[i].value
1079
+ // }
1080
+ if (this.$refs.service_show.data.fields[i].label === '街道' && this.$refs.service_show.data.fields[i].value) {
1081
+ // let f_street = res.data.f_street
1082
+ // this.$refs.service_show.data.fields[i].value = f_street
1083
+ address += this.$refs.service_show.data.fields[i].value
1084
+ }
1085
+ // if (this.$refs.service_show.data.fields[i].label === '小区/单位' && this.$refs.service_show.data.fields[i].value) {
1086
+ // address += this.$refs.service_show.data.fields[i].value
1087
+ // }
1088
+ if (this.$refs.service_show.data.fields[i].label === '小区' && this.$refs.service_show.data.fields[i].value) {
1089
+ // let f_residential_area = res.data.f_residential_area
1090
+ // this.$refs.service_show.data.fields[i].value = f_residential_area
1091
+ address += this.$refs.service_show.data.fields[i].value
1092
+ }
1093
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1094
+ // let f_building = res.data.f_building
1095
+ // this.$refs.service_show.data.fields[i].value = f_building
1096
+ address += ' ' + this.$refs.service_show.data.fields[i].value
1097
+ }
1098
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1099
+ // let f_unit = res.data.f_unit
1100
+ // this.$refs.service_show.data.fields[i].value = f_unit
1101
+ address += '-' + this.$refs.service_show.data.fields[i].value
1102
+ }
1103
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1104
+ // let f_floor = res.data.f_floor
1105
+ // this.$refs.service_show.data.fields[i].value = f_floor
1106
+ address += '-' + this.$refs.service_show.data.fields[i].value
1107
+ }
1108
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1109
+ // let f_room = res.data.f_room
1110
+ // this.$refs.service_show.data.fields[i].value = f_room
1111
+ address += '-' + this.$refs.service_show.data.fields[i].value
1112
+ }
1113
+
1114
+ }
1115
+ console.log('获取到的address=>' + address)
1116
+ // 数据获取完毕时放入地址text
1117
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1118
+ if (this.$refs.service_show.data.fields[i].label === '地址') {
1119
+ this.$refs.service_show.data.fields[i].value = address
1120
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1121
+ }
1122
+ }
1123
+ }
1124
+ //开户费+材料费+人工费+设备安装费=合计
1125
+ if (this.$refs.service_show.data.fields[index].label === '开户费' ||
1126
+ this.$refs.service_show.data.fields[index].label === '材料费' ||
1127
+ this.$refs.service_show.data.fields[index].label === '人工费' ||
1128
+ this.$refs.service_show.data.fields[index].label === '设备安装费') {
1129
+ let fee = 0
1130
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1131
+ if (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
+ fee += Number(this.$refs.service_show.data.fields[index].value)
1136
+ }
1137
+ if (this.$refs.service_show.data.fields[index].label === '合计') {
1138
+ this.$refs.service_show.data.fields[index].value = fee
1139
+ }
1140
+ }
1141
+
1142
+ }
1143
+ if (this.selectdata.defname != '完工') {
1144
+ this.selectdata.f_sub_state = '正在进行'
1145
+ }
1146
+ if (this.selectdata.defname == '送气') {
1147
+ this.selectdata.f_sub_state = '完工'
1148
+ }
1149
+ if (this.selectdata.defname === '用户受理') {
1150
+ let http = new HttpResetClass()
1151
+ let condition = "f_filialeid = " + Vue.user.orgid
1152
+ let res = await http.load('POST','rs/sql/singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
1153
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1154
+ if (this.$refs.service_show.data.fields[i].label == '区域') {
1155
+ let data = []
1156
+ let array = []
1157
+ data = res.data.map(item => {
1158
+ return item.f_pcd;
1159
+ })
1160
+ for (let q = 0; q < data.length; q++) {
1161
+ let arraydata = {
1162
+ 'label': data[q],
1163
+ 'value': data[q]
1164
+ }
1165
+ if (array.length != 0) {
1166
+ for (let w = 0; w < array.length; w++) {
1167
+ if (array[w].label == data[q]) {
1168
+ break
1169
+ }
1170
+ while (w == array.length - 1) {
1171
+ array.push(arraydata)
1172
+ break
1173
+ }
1174
+ }
1175
+ } else {
1176
+ array.push(arraydata)
1177
+ }
1178
+ }
1179
+ this.$refs.service_show.data.fields[i].options = array
1180
+ console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1181
+ }
1182
+ if (this.$refs.service_show.data.fields[i].label == '街道') {
1183
+ let data = []
1184
+ let array = []
1185
+ data = res.data.map(item => {
1186
+ return item.f_street;
1187
+ })
1188
+ for (let q = 0; q < data.length; q++) {
1189
+ let arraydata = {
1190
+ 'label': data[q],
1191
+ 'value': data[q]
1192
+ }
1193
+ if (array.length != 0) {
1194
+ for (let w = 0; w < array.length; w++) {
1195
+ if (array[w].label == data[q]) {
1196
+ break
1197
+ }
1198
+ while (w == array.length - 1) {
1199
+ array.push(arraydata)
1200
+ break
1201
+ }
1202
+ }
1203
+ } else {
1204
+ array.push(arraydata)
1205
+ }
1206
+ }
1207
+ this.$refs.service_show.data.fields[i].options = array
1208
+ console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1209
+ }
1210
+ if (this.$refs.service_show.data.fields[i].label == '小区') {
1211
+ let data = []
1212
+ let array = []
1213
+ data = res.data.map(item => {
1214
+ return item.f_residential_area;
1215
+ })
1216
+ for (let q = 0; q < data.length; q++) {
1217
+ let arraydata = {
1218
+ 'label': data[q],
1219
+ 'value': data[q]
1220
+ }
1221
+ if (array.length != 0) {
1222
+ for (let w = 0; w < array.length; w++) {
1223
+ if (array[w].label == data[q]) {
1224
+ break
1225
+ }
1226
+ while (w == array.length - 1) {
1227
+ array.push(arraydata)
1228
+ break
1229
+ }
1230
+ }
1231
+ } else {
1232
+ array.push(arraydata)
1233
+ }
1234
+ }
1235
+ this.$refs.service_show.data.fields[i].options = array
1236
+ console.log("选择框数据:" + JSON.stringify(this.$refs.service_show.data.fields[i].options))
1237
+ }
1238
+ }
1239
+ }
1240
+ //报建类型
1241
+ // if (this.selectdata.defname === '用户申请' || this.selectdata.defname === '寻找市场') {
1242
+ // for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1243
+ // if (this.$refs.service_show.data.fields[i].label == '报建类型') {
1244
+ // this.$refs.service_show.data.fields[i].value = this.selectdata.f_applyinstall_type
1245
+ // }
1246
+ // }
1247
+ // }
1248
+
1249
+ // 维修费+服务费+工时费+其他费用=预算
1250
+ // console.log("即将进行预算------")
1251
+ // console.log("fields:"+JSON.stringify(this.$refs.service_show.data.fields))
1252
+ // if (this.$refs.service_show.data.fields[index].label === '维修费' ||
1253
+ // this.$refs.service_show.data.fields[index].label === '服务费' ||
1254
+ // this.$refs.service_show.data.fields[index].label === '工时费' ||
1255
+ // this.$refs.service_show.data.fields[index].label === '其他费用' ||
1256
+ // this.$refs.service_show.data.fields[index].label === '预算') {
1257
+ // let fee = 0
1258
+ // console.log("即将预算算法------")
1259
+ // for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1260
+ // if (this.$refs.service_show.data.fields[i].label === '维修费' ||
1261
+ // this.$refs.service_show.data.fields[i].label === '服务费' ||
1262
+ // this.$refs.service_show.data.fields[i].label === '工时费' ||
1263
+ // this.$refs.service_show.data.fields[i].label === '其他费用') {
1264
+ // console.log("开始计算------")
1265
+ // console.log('费用' + Number(this.$refs.service_show.data.fields[i].value))
1266
+ // fee += Number(this.$refs.service_show.data.fields[i].value)
1267
+ // console.log("fee:"+fee)
1268
+ //
1269
+ // }
1270
+ // // console.log("i:"+i)
1271
+ // // console.log("fields:"+this.$refs.service_show.data.fields[index].label)
1272
+ // // if (this.$refs.service_show.data.fields[index].label === '维修费') {
1273
+ // // console.log("维修费"+this.$refs.service_show.data.fields[index].value)
1274
+ // // fee += Number(this.$refs.service_show.data.fields[index].value)
1275
+ // // console.log("维修费的预算:" + fee)
1276
+ // // }
1277
+ // // if (this.$refs.service_show.data.fields[index].label === '服务费' && this.$refs.service_show.data.fields[index].value) {
1278
+ // // fee += Number(this.$refs.service_show.data.fields[index].value)
1279
+ // // }
1280
+ // // if (this.$refs.service_show.data.fields[index].label === '工时费' && this.$refs.service_show.data.fields[index].value) {
1281
+ // // fee += Number(this.$refs.service_show.data.fields[index].value)
1282
+ // // }
1283
+ // // if (this.$refs.service_show.data.fields[index].label === '其他费用' && this.$refs.service_show.data.fields[index].value) {
1284
+ // // fee += Number(this.$refs.service_show.data.fields[index].value)
1285
+ // // }
1286
+ // if (this.$refs.service_show.data.fields[index].label === '预算') {
1287
+ // console.log("合成的预算:" + fee)
1288
+ // console.log("this",this.show_data)
1289
+ // this.$refs.service_show.data.fields[index].value = fee
1290
+ // }
1291
+ // }
1292
+ //
1293
+ // }
1294
+ },
1295
+ // 获取view层button事件
1296
+ async 'button'(model){
1297
+ console.log('进入async button事件方法')
1298
+ var delteLocal = true
1299
+ // 点击保存与重置按钮不需要修改本地工单状态
1300
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
1301
+ delteLocal = false
1302
+ }
1303
+ // 点击重置按钮就重置数据
1304
+ if(model.button.button_name==='重置'){
1305
+ this.initializtion()
1306
+ return
1307
+ }
1308
+ if(model.button.button_name==='下发'){
1309
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
1310
+ for(let i=0;i<this.department_search.length;i++){
1311
+ // 找到人名为person_name 的人,然后把人名换成id
1312
+ if(this.department_search[i].name === person_name){
1313
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
1314
+ }
1315
+ }
1316
+ }
1317
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
1318
+ model=Object.assign({},this.selectdata,model)
1319
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
1320
+ let http = new HttpResetClass()
1321
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
1322
+ // let res = await http.load('POST',url,{data:{tables:this.data.tables,start_activity:this.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
1323
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
1324
+ // console.log("service处理完成返回数据=>" + res)
1325
+ // if(!res.code){
1326
+ // console.log("service处理完成返回数据=>" + res)
1327
+ // this.$showMessage('操作异常,原因:' + res)
1328
+ // }else{
1329
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
1330
+ // if(res.code = 200){
1331
+ // this.showview = false
1332
+ // // 特殊处理
1333
+ // this.special(model)
1334
+ // this.$dispatch('close')
1335
+ // this.initializtion()
1336
+ // this.$showMessage('操作成功')
1337
+ // }else{
1338
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
1339
+ // }
1340
+ // }
1341
+ let btn = btn_operate(this, url, http, model, delteLocal)
1342
+ co(btn)
1343
+ }
1344
+ },
1345
+ watch:{
1346
+ // 监听selectdata的变化
1347
+ 'selectdata'() {
1348
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
1349
+ this.refurbish()
1350
+ },
1351
+ deep:true
1352
+ }
1353
+ }
1354
+
1355
+ let btn_operate = function * (self, url, http, model, delteLocal) {
1356
+ // 下发,提交,保存,退回都在后台处理
1357
+ console.log('即将请求后台url=>' + url)
1358
+ for (const selfKey in model) {
1359
+ if(model[selfKey]=="null"){
1360
+ delete model[selfKey]
1361
+ }
1362
+
1363
+ }
1364
+ model.employeetemplate=''
1365
+ http.load('POST',url,{data:{employeetemplate:'',tables:self.data.tables,start_activity:self.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
1366
+ .then((res) => {
1367
+ console.log(JSON.stringify(res))
1368
+ if(res.code = 200){
1369
+ self.showview = false
1370
+ // 如果需要删除本地记录则去删除
1371
+ if(delteLocal){
1372
+ self.deleteLocalApply(model)
1373
+ }
1374
+ // 特殊处理
1375
+ self.special(model)
1376
+ self.$dispatch('confirm')
1377
+ self.initializtion()
1378
+ self.$showMessage('操作成功')
1379
+ }else{
1380
+ self.$showMessage('操作失败,原因:' + res.data.msg)
1381
+ }
1382
+ })
1383
+ .catch((ret) => {
1384
+ self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
1385
+ })
1386
+ }
1387
+ </script>