apply-clients 4.1.5 → 4.1.7-weinan

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 (39) hide show
  1. package/index.html +30 -30
  2. package/package.json +7 -5
  3. package/src/apply.js +15 -1
  4. package/src/applyAndroid.js +41 -39
  5. package/src/components/app_apply/AppChargeManagement.vue +584 -0
  6. package/src/components/app_apply/ApplyInfo.vue +56 -56
  7. package/src/components/app_apply/ApplyToDoList.vue +148 -165
  8. package/src/components/app_apply/PlaceControler.vue +258 -258
  9. package/src/components/app_apply/ServiceControl.vue +292 -267
  10. package/src/components/app_apply/ServiceView.vue +361 -355
  11. package/src/components/product/ApplyCharge/ApplyChargeList.vue +4 -4
  12. package/src/components/product/Function/InstallInfoSelect.vue +40 -27
  13. package/src/components/product/Function/StopApplyCrrdList.vue +1 -1
  14. package/src/components/product/Function/functions/StopInstall.vue +7 -1
  15. package/src/components/product/Process/ExplorationSelect.vue +56 -38
  16. package/src/components/product/Process/Processes/InstallationDetails.vue +276 -246
  17. package/src/components/product/Process/Processes/UserFireInfo.vue +409 -0
  18. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +1555 -222
  19. package/src/components/product/Process/Processes/addressAndUserinfoManagementPro.vue +1221 -0
  20. package/src/components/product/Process/Processes/chargeManagement.vue +47 -53
  21. package/src/components/product/Process/Processes/devicesDetails.vue +834 -0
  22. package/src/components/product/Process/Processes/materialshoufei.vue +182 -0
  23. package/src/components/product/Process/Processes/printCharge.vue +4 -4
  24. package/src/components/product/Process/Processes/recordcancel.vue +50 -50
  25. package/src/components/product/Process/Processes/selectUserinfo.vue +199 -0
  26. package/src/components/product/Process/Processes/splitMaterial.vue +358 -0
  27. package/src/components/product/Process/Service/ServiceControl.vue +978 -587
  28. package/src/components/product/Process/ShowBackReason.vue +1 -0
  29. package/src/components/product/ServiceView.vue +802 -779
  30. package/src/components/product/Stop/StopApply.vue +101 -0
  31. package/src/components/product/Stop/StopApplyList.vue +257 -0
  32. package/src/components/product/Supervisory/SupervisoryControl.vue +7 -4
  33. package/src/components/product/Supervisory/SupervisoryList.vue +40 -27
  34. package/src/components/product/Supervisory/SupervisoryhCart.vue +0 -7
  35. package/src/components/product/Test.vue +8 -4
  36. package/src/components/product/VueUtils/ApplyUpload.vue +4 -4
  37. package/src/main.js +25 -23
  38. package/static/images/lefticon//347/237/251/345/275/2421183.png +0 -0
  39. package/dist.rar +0 -0
@@ -1,483 +1,695 @@
1
1
  <template>
2
2
 
3
3
  <div class="auto clearfix">
4
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ <show-back-reason :selectdata="selectdata"></show-back-reason>
5
+ <stop-install :data="show_data" v-if="stope_view"></stop-install>
5
6
  </div>
6
7
 
7
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
+ <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
9
 
9
10
  </template>
10
11
  <script>
11
- import Vue from 'vue'
12
- import {HttpResetClass} from 'vue-client'
13
- import {getNowDate,isEmpty} from '../../../Util'
14
- // Date格式化
15
- Date.prototype.Format = function (fmt) {
16
- var o = {
17
- "M+": this.getMonth() + 1, //月份
18
- "d+": this.getDate(), //日
19
- "H+": this.getHours(), //小时
20
- "m+": this.getMinutes(), //分
21
- "s+": this.getSeconds(), //秒
22
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
- "S": this.getMilliseconds() //毫秒
24
- };
25
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
- for (var k in o)
27
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
- return fmt;
29
- }
12
+ import Vue from 'vue'
13
+ import {HttpResetClass} from 'vue-client'
14
+ import {getNowDate,isEmpty} from '../../../Util'
15
+ // Date格式化
16
+ Date.prototype.Format = function (fmt) {
17
+ var o = {
18
+ "M+": this.getMonth() + 1, //月份
19
+ "d+": this.getDate(), //日
20
+ "H+": this.getHours(), //小时
21
+ "m+": this.getMinutes(), //分
22
+ "s+": this.getSeconds(), //秒
23
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
24
+ "S": this.getMilliseconds() //毫秒
25
+ };
26
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
27
+ for (var k in o)
28
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
29
+ return fmt;
30
+ }
30
31
 
31
- export default {
32
- title: '报建流程业务控制层',
33
- props: ['selectdata'],
34
- data() {
35
- return {
36
- data: null, // 数据库数据,json配置文件数据的数据集合
37
- json_datas: null, // Json配置文件集合
38
- showview: false, // 控制显示service-view组件
39
- show_data: null // 给view层显示的数据
40
- }
41
- },
42
- created () {
43
- this.refurbish()
44
- },
45
- methods: {
46
- // 组件初始化操作
47
- refurbish() {
48
- this.json_datas = this.$workflow_vue
49
- let sum = 0
50
- let jsonData = {}
51
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
52
- this.$showMessage("网络故障,请刷新页面")
53
- return
54
- }
55
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
56
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
57
- jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
58
- sum++ // 节点名一样的个数
59
- }
60
- }
61
- if (sum == 1) {
62
- this.data = null
63
- this.data = jsonData
64
- // selectdata 填充 data
65
- this.data = Object.assign({}, this.data, this.selectdata)
66
- this.initializeJSON()
67
- } else if (sum == 0) {
68
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
69
- } else {
70
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
71
- }
72
- },
73
- // json配置数据处理
74
- async initializeJSON() {
75
- // 有默认值,value就给默认值,没有就是null
76
- this.data.fields.forEach(item => {
77
- if (!item.value) {
78
- if (item.value === 0) {
79
- item.value = 0
80
- } else {
81
- item.value = null
82
- }
32
+ export default {
33
+ title: '报建流程业务控制层',
34
+ props: ['selectdata'],
35
+ data() {
36
+ return {
37
+ data: null, // 数据库数据,json配置文件数据的数据集合
38
+ json_datas: null, // Json配置文件集合
39
+ showview: false, // 控制显示service-view组件
40
+ show_data: null, // 给view层显示的数据
41
+ stope_view: false
42
+ }
43
+
44
+ },
45
+ created () {
46
+ this.refurbish()
47
+ },
48
+ ready(){
49
+ },
50
+ methods: {
51
+ // 组件初始化操作
52
+ refurbish() {
53
+ this.json_datas = this.$workflow_vue
54
+ let sum = 0
55
+ let jsonData = {}
56
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
57
+ this.$showMessage("网络故障,请刷新页面")
58
+ return
59
+ }
60
+ for (let i = 0; i < this.json_datas.activitys.length; i++) {
61
+ if (this.selectdata.defname == this.json_datas.activitys[i].title) {
62
+ jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
63
+ sum++ // 节点名一样的个数
64
+ }
65
+ }
66
+ if (sum == 1) {
67
+ this.data = null
68
+ this.data = jsonData
69
+ // selectdata 填充 data
70
+ this.data = Object.assign({}, this.data, this.selectdata)
71
+ this.initializeJSON()
72
+ } else if (sum == 0) {
73
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
74
+ } else {
75
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
76
+ }
77
+ },
78
+ // json配置数据处理
79
+ async initializeJSON() {
80
+ // 有默认值,value就给默认值,没有就是null
81
+ this.data.fields.forEach(item => {
82
+ if (!item.value) {
83
+ if (item.value === 0) {
84
+ item.value = 0
85
+ } else {
86
+ item.value = null
83
87
  }
84
- if (item.default || item.default == 0) {
88
+ }
89
+ if (item.default || item.default == 0) {
90
+ if(item.type === 'datepicker'){
91
+ item.value = ''
92
+ }else {
85
93
  item.value = item.default
86
94
  }
87
- if (this.selectdata[item.field]) {
88
- // 将json字符串格式化赋值给value
89
- if (String(this.selectdata[item.field]).startsWith("{")) {
90
- item.value = JSON.parse(this.selectdata[item.field])
91
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
92
- } else {
93
- item.value = this.selectdata[item.field]
94
- }
95
+ }
96
+ if (this.selectdata[item.field]) {
97
+ // 将json字符串格式化赋值给value
98
+ if (String(this.selectdata[item.field]).startsWith("{")) {
99
+ item.value = JSON.parse(this.selectdata[item.field])
100
+ this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
95
101
  } else {
96
- if (this.selectdata[item.field] === 0) {
97
- item.value = 0
98
- }
102
+ item.value = this.selectdata[item.field]
99
103
  }
100
-
101
- // datepicker 没有值给当时值
102
- if (item.type === 'datepicker' && !item.value && item.default) {
103
- item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
104
+ } else {
105
+ if (this.selectdata[item.field] === 0) {
106
+ item.value = 0
104
107
  }
108
+ }
105
109
 
106
- // 如果配置类型为select,优先从参数列表获取options
107
- if (item.type === 'select') {
108
- let temp = null
110
+ // datepicker 没有值给当时值
111
+ if (item.type === 'datepicker' && !item.value && item.default) {
112
+ item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
113
+ }
109
114
 
110
- temp = this.$appdata.getParam(item.label)
115
+ // 如果配置类型为select,优先从参数列表获取options
116
+ if (item.type === 'select') {
117
+ let temp = null
111
118
 
112
- if (temp && temp.length > 0 && item.label) {
113
- item.options = temp
114
- } else {
115
- if (item.paramLabel) {
116
- temp = this.$appdata.getParam(item.paramLabel)
117
- if (temp && temp.length > 0) {
118
- item.options = temp
119
- }
119
+ temp = this.$appdata.getParam(item.label)
120
+
121
+ if (temp && temp.length > 0 && item.label) {
122
+ item.options = temp
123
+ } else {
124
+ if (item.paramLabel) {
125
+ temp = this.$appdata.getParam(item.paramLabel)
126
+ if (temp && temp.length > 0) {
127
+ item.options = temp
120
128
  }
121
129
  }
122
130
  }
123
- })
131
+ }
132
+ })
124
133
 
125
- // 控制组件
126
- if (this.data.components) {
127
- this.data.components.forEach(item => {
134
+ // 控制组件
135
+ if (this.data.components) {
136
+ this.data.components.forEach(item => {
137
+ if (!item.mark) {
128
138
  item.mark = 0
129
- })
130
- }
139
+ }
140
+ })
141
+ }
131
142
 
132
- // 初始化 fields 可对数据进行特殊处理
133
- this.initializeFields()
134
-
135
- // 初始化 buttons_fields
136
- for (let i = 0; i < this.data.buttons.length; i++) {
137
- // 下发按钮相关配置
138
- if (this.data.buttons[i].button_name === '下发') {
139
- if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
140
- if (this.data.buttons[i].source){
141
- let http = new HttpResetClass()
142
- let res = await http.load('POST', 'rs/search', {
143
- source: this.data.buttons[i].source,
144
- userid: this.$login.f.id
145
- }, {resolveMsg: null, rejectMsg: null})
146
-
147
- let options = []
148
- for (let i = 0; i < res.data.length; i++) {
149
- options.push(
150
- {
151
- "label": res.data[i].name,
152
- "value": res.data[i].id
153
- }
154
- )
155
- }
156
- this.data.buttons[i].button_fields[0]['options'] = options
157
- } else {
158
- this.$showMessage("请配置获取人员表达式")
143
+ // 初始化 fields 可对数据进行特殊处理
144
+ this.initializeFields()
145
+
146
+ // 初始化 buttons_fields
147
+ for (let i = 0; i < this.data.buttons.length; i++) {
148
+ // 下发按钮相关配置
149
+ if (this.data.buttons[i].button_name === '下发') {
150
+ if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
151
+ if (this.data.buttons[i].source){
152
+ let http = new HttpResetClass()
153
+ let res = await http.load('POST', 'rs/search', {
154
+ source: this.data.buttons[i].source,
155
+ userid: this.$login.f.id
156
+ }, {resolveMsg: null, rejectMsg: null})
157
+
158
+ let options = []
159
+ for (let i = 0; i < res.data.length; i++) {
160
+ options.push(
161
+ {
162
+ "label": res.data[i].name,
163
+ "value": res.data[i].id
164
+ }
165
+ )
159
166
  }
167
+ this.data.buttons[i].button_fields[0]['options'] = options
160
168
  } else {
161
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
169
+ this.$showMessage("请配置获取人员表达式")
162
170
  }
163
- }
164
- if (this.data.buttons[i].button_fields) {
165
- this.data.buttons[i].button_fields.forEach(x => {
166
- // 如果配置类型为select,优先从参数列表获取options
167
- if (x.type === 'select' && this.$appdata.getParam(x.label)) {
168
- x.options = this.$appdata.getParam(x.label).trim()
169
- }
170
- })
171
+ } else {
172
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
171
173
  }
172
174
  }
175
+ if (this.data.buttons[i].button_fields) {
176
+ this.data.buttons[i].button_fields.forEach(x => {
177
+ // 如果配置类型为select,优先从参数列表获取options
178
+ if (x.type === 'select' && this.$appdata.getParam(x.label)) {
179
+ x.options = this.$appdata.getParam(x.label).trim()
180
+ }
181
+ })
182
+ }
183
+ }
173
184
 
174
- // onetomany 数据获取
175
- if (this.data.onetomany) {
176
- for (let index = 0; index < this.data.onetomany.length; index++) {
177
- let res = null
178
- if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
179
- let http = new HttpResetClass()
180
- let data = {
181
- tablename: this.data.onetomany[index].tables[0],
182
- condition: `f_process_id='${this.selectdata.f_process_id}'`
183
- }
184
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
185
- resolveMsg: null,
186
- rejectMsg: 'onetomany查询失败'
187
- })
188
- } else {
189
- res = this[this.data.onetomany[index].queryEvent]()
185
+ // onetomany 数据获取
186
+ if (this.data.onetomany) {
187
+ for (let index = 0; index < this.data.onetomany.length; index++) {
188
+ let res = null
189
+ if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
190
+ let http = new HttpResetClass()
191
+ let data = {
192
+ tablename: this.data.onetomany[index].tables[0],
193
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
190
194
  }
195
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
196
+ resolveMsg: null,
197
+ rejectMsg: 'onetomany查询失败'
198
+ })
199
+ } else {
200
+ res = this[this.data.onetomany[index].queryEvent]()
201
+ }
191
202
 
192
- // 初始化 onetomany
193
- this.data.onetomany[index].rows = res.data
203
+ // 初始化 onetomany
204
+ this.data.onetomany[index].rows = res.data
194
205
 
195
- // 初始化onetomany中的fields
196
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
197
- if (!this.data.onetomany[index].fields[j].value) {
198
- if (this.data.onetomany[index].fields[j].value === 0) {
199
- this.data.onetomany[index].fields[j].value = 0
200
- } else {
201
- this.data.onetomany[index].fields[j].value = null
202
- }
203
- }
204
- if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
205
- this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
206
+ // 初始化onetomany中的fields
207
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
208
+ if (!this.data.onetomany[index].fields[j].value) {
209
+ if (this.data.onetomany[index].fields[j].value === 0) {
210
+ this.data.onetomany[index].fields[j].value = 0
211
+ } else {
212
+ this.data.onetomany[index].fields[j].value = null
206
213
  }
207
- // 如果配置类型为select,优先从参数列表获取options
208
- if (this.data.onetomany[index].fields[j].type === 'select') {
209
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
210
- if (temp && temp.length > 0) {
211
- this.data.onetomany[index].fields[j].options = temp
212
- }
214
+ }
215
+ if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
216
+ this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
217
+ }
218
+ // 如果配置类型为select,优先从参数列表获取options
219
+ if (this.data.onetomany[index].fields[j].type === 'select') {
220
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
221
+ if (temp && temp.length > 0) {
222
+ this.data.onetomany[index].fields[j].options = temp
213
223
  }
214
224
  }
215
225
  }
216
226
  }
227
+ }
217
228
 
218
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
219
- let temp = JSON.parse(JSON.stringify(this.data))
229
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
230
+ let temp = JSON.parse(JSON.stringify(this.data))
220
231
 
221
- this.show_data = temp
222
- this.$nextTick(() => {
223
- this.showview = true
224
- })
225
- // 初始化加载
226
- // ========================= 中盛 =================================
227
- if (this.selectdata.defname === '报建登记') {
228
- let http = new HttpResetClass()
229
- let condition = "f_filialeid = " + this.$login.f.orgid
230
- let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
231
- for (let i = 0; i < this.show_data.fields.length; i++) {
232
-
233
- if (this.show_data.fields[i].label == '街道') {
234
- let data = []
235
- let array = []
236
- data = res.data.map(item => {
237
- return item.f_street;
238
- })
239
- for (let q = 0; q < data.length; q++) {
240
- let arraydata = {
241
- 'label': data[q],
242
- 'value': data[q]
243
- }
244
- if (array.length != 0) {
245
- for (let w = 0; w < array.length; w++) {
246
- if (array[w].label == data[q]) {
247
- break
248
- }
249
- while (w == array.length - 1) {
250
- array.push(arraydata)
251
- break
252
- }
232
+ this.show_data = temp
233
+ this.$nextTick(() => {
234
+ this.showview = true
235
+ })
236
+ // 初始化加载
237
+ // ========================= 中盛 =================================
238
+
239
+ if (this.selectdata.defname === '报建登记') {
240
+ let http = new HttpResetClass()
241
+ let condition = "f_filialeid = " + this.$login.f.orgid
242
+ let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
243
+ for (let i = 0; i < this.show_data.fields.length; i++) {
244
+
245
+ if (this.show_data.fields[i].label == '街道') {
246
+ let data = []
247
+ let array = []
248
+ data = res.data.map(item => {
249
+ return item.f_street;
250
+ })
251
+ for (let q = 0; q < data.length; q++) {
252
+ let arraydata = {
253
+ 'label': data[q],
254
+ 'value': data[q]
255
+ }
256
+ if (array.length != 0) {
257
+ for (let w = 0; w < array.length; w++) {
258
+ if (array[w].label == data[q]) {
259
+ break
260
+ }
261
+ while (w == array.length - 1) {
262
+ array.push(arraydata)
263
+ break
253
264
  }
254
- } else {
255
- array.push(arraydata)
256
265
  }
266
+ } else {
267
+ array.push(arraydata)
257
268
  }
258
- this.show_data.fields[i].options = array
259
- console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
260
269
  }
261
- if (this.show_data.fields[i].label == '小区') {
262
- let data = []
263
- let array = []
264
- data = res.data.map(item => {
265
- return item.f_residential_area;
266
- })
267
- for (let q = 0; q < data.length; q++) {
268
- let arraydata = {
269
- 'label': data[q],
270
- 'value': data[q]
271
- }
272
- if (array.length != 0) {
273
- for (let w = 0; w < array.length; w++) {
274
- if (array[w].label == data[q]) {
275
- break
276
- }
277
- while (w == array.length - 1) {
278
- array.push(arraydata)
279
- break
280
- }
270
+ this.show_data.fields[i].options = array
271
+ console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
272
+ }
273
+ if (this.show_data.fields[i].label == '小区') {
274
+ let data = []
275
+ let array = []
276
+ data = res.data.map(item => {
277
+ return item.f_residential_area;
278
+ })
279
+ for (let q = 0; q < data.length; q++) {
280
+ let arraydata = {
281
+ 'label': data[q],
282
+ 'value': data[q]
283
+ }
284
+ if (array.length != 0) {
285
+ for (let w = 0; w < array.length; w++) {
286
+ if (array[w].label == data[q]) {
287
+ break
288
+ }
289
+ while (w == array.length - 1) {
290
+ array.push(arraydata)
291
+ break
281
292
  }
282
- } else {
283
- array.push(arraydata)
284
293
  }
294
+ } else {
295
+ array.push(arraydata)
285
296
  }
286
- this.show_data.fields[i].options = array
287
- console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
288
297
  }
298
+ this.show_data.fields[i].options = array
299
+ console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
289
300
  }
290
301
  }
291
- // if (this.selectdata.defname === '收费') {
292
- // let money_one = 0
293
- // let money_two = 0
294
- // for (let i = 0; i < this.show_data.fields.length; i++) {
295
- // if (this.show_data.fields[i].label === '合同金额') {
296
- // money_one = this.show_data.fields[i].value
297
- // }
298
- // if (this.show_data.fields[i].label === '应交总金额') {
299
- // this.show_data.fields[i].value = money_one
300
- // this.selectdata.f_due_money = money_one
301
- // }
302
- // if (this.show_data.fields[i].label === '累计缴费总金额') {
303
- // money_two = this.show_data.fields[i].value
304
- // this.selectdata.f_cumulative_payment_money = this.show_data.fields[i].value
305
- // }
306
- // if (this.show_data.fields[i].label === '未结总金额') {
307
- // this.show_data.fields[i].value = money_one - money_two
308
- // this.selectdata.f_surplus_money = this.show_data.fields[i].value
309
- // }
302
+ }
303
+ if (this.selectdata.defname === '施工') {
304
+ // for (let i = 0; i < this.show_data.fields.length; i++) {
305
+ // if (this.show_data.fields[i].label == '工程状态') {
306
+ // this.show_data.fields[i].value = ''
310
307
  // }
311
308
  // }
312
- },
313
- // 初始化fields值
314
- initializeFields() {
315
-
316
- },
317
- // 金额转大写
318
- smalltoBIG(n) {
319
- let fraction = ['角', '分'];
320
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
321
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
322
- let head = n < 0 ? '欠' : '';
323
- n = Math.abs(n);
324
-
325
- let s = '';
326
-
327
- for (var i = 0; i < fraction.length; i++) {
328
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
329
- }
330
- s = s || '整';
331
- n = Math.floor(n);
332
-
333
- for (var i = 0; i < unit[0].length && n > 0; i++) {
334
- let p = '';
335
- for (var j = 0; j < unit[1].length && n > 0; j++) {
336
- p = digit[n % 10] + unit[1][j] + p;
337
- n = Math.floor(n / 10);
338
- }
339
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
340
- }
341
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
342
- },
343
- getLableValue(label) {
344
309
  for (const item of this.show_data.fields) {
345
- if (item.label === label && item.type !== 'number') {
346
- return item.value || ''
347
- }
348
- if (item.label === label && item.type === 'number') {
349
- return item.value || 0
310
+ if (item.label === '工程状态' && !item.value) {
311
+ return item.value = '未开工'
350
312
  }
351
313
  }
352
- },
353
- setLabelValue(label, value) {
354
- for (const item of this.show_data.fields) {
355
- if (item.label === label) {
356
- item.value = value
357
- }
314
+ }
315
+
316
+ },
317
+ // 初始化fields值
318
+ initializeFields() {
319
+
320
+ },
321
+ // 金额转大写
322
+ smalltoBIG(n) {
323
+ let fraction = ['角', '分'];
324
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
325
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
326
+ let head = n < 0 ? '欠' : '';
327
+ n = Math.abs(n);
328
+
329
+ let s = '';
330
+
331
+ for (var i = 0; i < fraction.length; i++) {
332
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
333
+ }
334
+ s = s || '整';
335
+ n = Math.floor(n);
336
+
337
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
338
+ let p = '';
339
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
340
+ p = digit[n % 10] + unit[1][j] + p;
341
+ n = Math.floor(n / 10);
358
342
  }
359
- },
360
- async buttonBefore(model) {
361
- if (
362
- model.button.button_name === '提交' &&
363
- model.defname === '收费' &&
364
- (
365
- model.f_apply_type === '散户报建' ||
366
- model.f_apply_type === '工业户报建' ||
367
- model.f_apply_type === '商业户报建'
368
- ) &&
369
- model.f_surplus_money > 0
370
- ) {
371
- throw '未结金额大于0,无法提交!!!'
343
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
344
+ }
345
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
346
+ },
347
+ getLableValue(label) {
348
+ for (const item of this.show_data.fields) {
349
+ if (item.label === label && item.type !== 'number') {
350
+ return item.value || ''
372
351
  }
373
- if (model.defname === '施工' && model.button.button_name === '提交') {
374
- let http = new HttpResetClass()
375
- let data = {
376
- f_process_id: model.f_process_id
377
- }
378
- let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
379
- if (res.data[0].num > 0) {
380
- throw `还有${res.data[0].num}户未安装,无法提交`
381
- }
352
+ if (item.label === label && item.type === 'number') {
353
+ return item.value || 0
382
354
  }
383
- return model
384
- },
385
- // ========================= 武安 =================================
386
- // 地址类型变化
387
- addressType() {
388
- for (const item of this.show_data.fields) {
389
- if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
355
+ }
356
+ },
357
+ setLabelValue(label, value) {
358
+ for (const item of this.show_data.fields) {
359
+ if (item.label === label) {
360
+ item.value = value
361
+ }
362
+ }
363
+ },
364
+ setLabelOptions(label, options) {
365
+ for (const item of this.show_data.fields) {
366
+ if (item.label === label) {
367
+ item.options = options
368
+ }
369
+ }
370
+ },
371
+ showLabels(...labels) {
372
+ for (const item of this.show_data.fields) {
373
+ if (labels.includes(item.label)) {
374
+ item.hidden = false
375
+ }
376
+ }
377
+ },
378
+ hideLabels(...labels) {
379
+ for (const item of this.show_data.fields) {
380
+ if (labels.includes(item.label)) {
381
+ item.hidden = true
382
+ }
383
+ }
384
+ },
385
+ requiredLabels(...labels) {
386
+ for (const item of this.show_data.fields) {
387
+ if (labels.includes(item.label)) {
388
+ item.required = true
389
+ }
390
+ }
391
+ },
392
+ electiveLabels(...labels) {
393
+ for (const item of this.show_data.fields) {
394
+ if (labels.includes(item.label)) {
395
+ item.required = false
396
+ }
397
+ }
398
+ },
399
+ readonlyLabels(...labels) {
400
+ for (const item of this.show_data.fields) {
401
+ if (labels.includes(item.label)) {
402
+ item.readonly = true
403
+ item.disabled = true
404
+ }
405
+ }
406
+ },
407
+ readwriteLabels(...labels) {
408
+ for (const item of this.show_data.fields) {
409
+ if (labels.includes(item.label)) {
410
+ item.readonly = false
411
+ item.disabled = false
412
+ }
413
+ }
414
+ },
415
+ showButtons(...buttons) {
416
+ for (const item of this.show_data.buttons) {
417
+ if (buttons.includes(item.button_name)) {
418
+ item.hidden = false
419
+ }
420
+ }
421
+ },
422
+ hideButtons(...buttons) {
423
+ for (const item of this.show_data.buttons) {
424
+ if (buttons.includes(item.button_name)) {
425
+ item.hidden = true
426
+ }
427
+ }
428
+ },
429
+ // 获取区县
430
+ async getPcd() {
431
+ let data = {
432
+ tablename: 't_pcd',
433
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
434
+ }
435
+ let http = new HttpResetClass()
436
+ let res = await http.load(
437
+ 'POST',
438
+ `rs/sql/singleTable`,
439
+ {data: data},
440
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
441
+ )
442
+
443
+ let pcd = res.data.map(item => {
444
+ return {
445
+ label: item.f_pcd,
446
+ value: item.f_pcd
447
+ }
448
+ })
449
+ this.setLabelOptions('区域',pcd)
450
+ },
451
+ // 地址关联
452
+ addressInitialization() {
453
+ this.$getConfig(this, 'UserAddress')
454
+
455
+ let f_address_type = this.show_data.f_address_type
456
+
457
+ for (const item of this.show_data.fields) {
458
+ if (f_address_type === '民用地址') {
459
+ if (item.label === '区域' || item.label === '街道' || item.label === '小区' || item.label === '门牌号') {
460
+ item.hidden = false
390
461
  item.required = true
391
462
  }
392
- if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
463
+ if (item.label === '楼号' || item.label === '单元' || item.label === '楼层') {
464
+ item.hidden = false
393
465
  item.required = false
394
466
  }
395
- if (
396
- (
397
- item.label === '楼号' ||
398
- item.label === '单元' ||
399
- item.label === '楼层' ||
400
- item.label === '门牌号'
401
- ) && this.show_data.f_address_type === '民用地址'
402
- ) {
403
- item.required = true
467
+ if (item.label === '地址') {
468
+ item.readonly = true
469
+ }
470
+ }
471
+ if (f_address_type === '特殊地址') {
472
+ if (item.label === '区域' || item.label === '街道') {
404
473
  item.hidden = false
405
- item.value = null
474
+ item.required = true
406
475
  }
407
- if (
408
- (
409
- item.label === '楼号' ||
410
- item.label === '单元' ||
411
- item.label === '楼层' ||
412
- item.label === '门牌号'
413
- ) && this.show_data.f_address_type === '特殊地址'
414
- ) {
476
+ if (item.label === '小区') {
477
+ item.hidden = true
415
478
  item.required = false
479
+ }
480
+ if (item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
416
481
  item.hidden = true
417
- item.value = null
482
+ item.required = false
483
+ }
484
+ if (item.label === '地址') {
485
+ item.readonly = false
418
486
  }
419
487
  }
488
+
489
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
490
+ item.hidden = true
491
+ }
420
492
  }
421
- // ========================= 武安 =================================
422
493
  },
423
- events: {
424
- // ========================= 武安 =================================
425
- // ========================= 武安 =================================
426
- 'openAddModel'(index) {
427
- // ========================= 武安 =================================
428
- // ========================= 武安 =================================
429
- },
430
- // 获取view层button事件/
431
- async 'button'(model) {
432
- // 修改提交数据
433
- model = Object.assign({}, this.selectdata, model)
434
- // 点击重置按钮就重置数据
435
- if (model.button.button_name === '重置') {
436
- this.$dispatch('breakControl', this.data)
437
- return
438
- }
439
-
440
- // 提交前置
441
- try {
442
- model = await this.buttonBefore(model)
443
- } catch (e) {
444
- this.$showAlert(e, 'warning', 3000)
445
- return
494
+ async streetChange() {
495
+ if (isEmpty(this.show_data.f_street)) {
496
+ return
497
+ }
498
+
499
+ let data = {
500
+ tablename: 't_area',
501
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
502
+ }
503
+ let http = new HttpResetClass()
504
+ let res = await http.load(
505
+ 'POST',
506
+ `rs/sql/singleTable`,
507
+ {data: data},
508
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
509
+ )
510
+
511
+ this.setLabelOptions('小区', res.data.map(item => {
512
+ return {
513
+ label: item.f_residential_area,
514
+ value: item.f_residential_area
515
+ }
516
+ }))
517
+ },
518
+ async pcdChange() {
519
+ if (isEmpty(this.show_data.f_pcd)) {
520
+ return
521
+ }
522
+
523
+ let data = {
524
+ tablename: 't_street',
525
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
526
+ }
527
+ let f_address_type = this.getLableValue('地址类型')
528
+
529
+ if (f_address_type === '民用地址') {
530
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
531
+ }
532
+
533
+ let http = new HttpResetClass()
534
+ let res = await http.load(
535
+ 'POST',
536
+ `rs/sql/singleTable`,
537
+ {data: data},
538
+ {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
539
+ )
540
+
541
+ this.setLabelOptions('街道', res.data.map(item => {
542
+ return {
543
+ label: item.f_street,
544
+ value: item.f_street
446
545
  }
546
+ }))
547
+ },
548
+ async buttonBefore(model) {
549
+ if (model.defname === '报建登记' && model.button.button_name === '提交') {
447
550
 
551
+ if (model.f_is_user === '是') {
552
+ if (isEmpty(model.f_user_name) || isEmpty(model.f_phone) || isEmpty(model.f_address)) {
553
+ throw '用户信息未填写完整,无法提交!!!'
554
+ }
555
+ }
556
+ }
557
+ if (
558
+ model.button.button_name === '提交' &&
559
+ model.defname === '通气点火' &&
560
+ (
561
+ model.f_apply_type === '散户报建' ||
562
+ model.f_apply_type === '工商户报建'
563
+ ) &&
564
+ model.f_surplus_money > 0
565
+ ) {
566
+ throw '未结金额大于0,无法提交!!!'
567
+ }
568
+ if (model.defname === '验收是否合格' && model.button.button_name === '提交') {
448
569
  let http = new HttpResetClass()
449
- let requestData = {
450
- tables: this.data.tables,
451
- start_activity: this.$workflow_vue.start_activity,
452
- model: model,
453
- loginUser: this.$login.f,
454
- workflow_xmlfilename: this.$workflow_vue.workflow_xmlfilename
455
- }
456
- // 下发,提交,保存,退回通用业务后台处理logic
457
- let url = 'rs/logic/ApplyProductService'
458
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
459
-
460
- if (res.data.code == 200) {
461
- this.$dispatch('search')
462
- } else {
463
- if (res.data.msg) {
464
- this.$showMessage(res.data.msg)
465
- }
466
- }
467
- },
468
- async 'initializtionView'() {
469
- // ========================= 武安 =================================
470
- this.addressType()
471
- // ========================= 武安 =================================
472
- },
473
- // 失去焦点出触发事件
474
- async 'onchange'(index) {
475
- console.log('失去焦点')
476
- // ========================= 武安 =================================
477
- if (this.show_data.defname === '报建登记'){
478
- if (this.show_data.fields[index].label === '地址类型'){
479
- this.addressType()
570
+ let data = {
571
+ f_process_id: model.f_process_id
572
+ }
573
+ let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
574
+ if (res.data[0].num > 0) {
575
+ throw `还有${res.data[0].num}户未安装,无法提交`
576
+ }
577
+ }
578
+ return model
579
+ },
580
+ // ========================= 武安 =================================
581
+ // 地址类型变化
582
+ addressType() {
583
+ for (const item of this.show_data.fields) {
584
+ if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
585
+ item.hidden = false
586
+ item.required = true
587
+ }
588
+ if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
589
+ item.required = false
590
+ }
591
+ if (
592
+ (
593
+ item.label === '门牌号'
594
+ ) && this.show_data.f_address_type === '民用地址'
595
+ ) {
596
+ item.required = true
597
+ item.hidden = false
598
+ item.value = null
599
+ }
600
+ if (
601
+ (
602
+ item.label === '楼号' ||
603
+ item.label === '单元' ||
604
+ item.label === '楼层'
605
+ ) && this.show_data.f_address_type === '民用地址'
606
+ ) {
607
+ item.required = false
608
+ item.hidden = false
609
+ item.value = null
610
+ }
611
+ if (
612
+ (
613
+ item.label === '楼号' ||
614
+ item.label === '单元' ||
615
+ item.label === '楼层' ||
616
+ item.label === '门牌号'
617
+ ) && this.show_data.f_address_type === '特殊地址'
618
+ ) {
619
+ item.required = false
620
+ item.hidden = true
621
+ item.value = null
622
+ }
623
+ }
624
+ this.getPcd()
625
+ }
626
+ // ========================= 武安 =================================
627
+ },
628
+ events: {
629
+ // ========================= 武安 =================================
630
+ // ========================= 武安 =================================
631
+ 'openAddModel'(index) {
632
+ // ========================= 武安 =================================
633
+ // ========================= 武安 =================================
634
+ },
635
+ // 获取view层button事件/
636
+ async 'button'(model) {
637
+ // 修改提交数据
638
+ model = Object.assign({}, this.selectdata, model)
639
+ // 点击重置按钮就重置数据
640
+ if (model.button.button_name === '重置') {
641
+ this.$dispatch('breakControl', this.data)
642
+ return
643
+ }
644
+ // 提交前置
645
+ try {
646
+ model = await this.buttonBefore(model)
647
+ } catch (e) {
648
+ this.$showAlert(e, 'warning', 3000)
649
+ return
650
+ }
651
+ let http = new HttpResetClass()
652
+ let requestData = {
653
+ tables: this.data.tables,
654
+ start_activity: this.$workflow_vue.start_activity,
655
+ model: model,
656
+ loginUser: this.$login.f,
657
+ workflow_gxmlfilename: this.$workflow_vue.workflow_xmlfilename
658
+ }
659
+ console.log("gwfwe",this.selectdata)
660
+ // 下发,提交,保存,退回通用业务后台处理logic
661
+ let url = 'rs/logic/ApplyProductService'
662
+ let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
663
+ if (res.data.code === 200) {
664
+ this.$dispatch('search')
665
+ } else {
666
+ if (res.data.msg) {
667
+ this.$showMessage(res.data.msg)
668
+ }
669
+ }
670
+ },
671
+ async 'initializtionView'() {
672
+ // ========================= 武安 =================================
673
+ this.addressType()
674
+ // ========================= 武安 =================================
675
+ },
676
+ // 失去焦点出触发事件
677
+ async 'onchange'(index) {
678
+ console.log('失去焦点')
679
+ // ========================= 武安 =================================
680
+ if (this.show_data.defname === '报建登记' || this.show_data.defname === '业务申请'){
681
+ if (this.show_data.fields[index].label === '是否具备安装条件') {
682
+ for (const button of this.show_data.buttons) {
683
+ if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
684
+ button.hidden = false
685
+ }else {
686
+ button.hidden = true
687
+ }
480
688
  }
689
+ }
690
+ if (this.show_data.fields[index].label === '地址类型'){
691
+ this.addressType()
692
+ }
481
693
  // if (this.show_data.fields[index].label === '街道'){
482
694
  // console.log('-----------添加街道-----------')
483
695
  // if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
@@ -604,6 +816,7 @@
604
816
  // }
605
817
  // 地址拼接
606
818
  if (
819
+ this.show_data.fields[index].label === '区域' ||
607
820
  this.show_data.fields[index].label === '街道' ||
608
821
  this.show_data.fields[index].label === '小区' ||
609
822
  this.show_data.fields[index].label === '楼号' ||
@@ -629,217 +842,395 @@
629
842
  this.setLabelValue('地址', f_address)
630
843
  }
631
844
  }
845
+
632
846
  if (this.show_data.defname === '竣工验收') {
633
- if (this.show_data.fields[index].label === '验收是否合格'){
634
- for (const button of this.show_data.buttons) {
635
- if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
636
- button.hidden = false
637
- } else {
638
- button.hidden = true
639
- }
847
+ if (this.show_data.fields[index].label === '验收是否合格'){
848
+ for (const button of this.show_data.buttons) {
849
+ if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
850
+ button.hidden = false
851
+ } else {
852
+ button.hidden = true
640
853
  }
641
854
  }
642
855
  }
643
- if(this.show_data.defname === '现场勘查') {
644
- if (this.show_data.fields[index].label === '是否具备安装条件') {
645
- for (const button of this.show_data.buttons) {
646
- if (this.show_data.fields[index].value === '否') {
647
- button.hidden = false
648
- }
649
- }
650
- }
651
- // let http = new HttpResetClass()
652
- // let data = {
653
- // condition: `u.id = ${servicedata.id}`,
654
- // data: {
655
- // id: this.$login.f.id,
656
- // orgid: this.$login.f.orgid
657
- // }
658
- // }
659
- // let res = await http.load('POST', 'rs/sql/checkuser', {data: data}, {
660
- // resolveMsg: null,
661
- // rejectMsg: '数据更新失败,请手查询更新!!!'
662
- // })
663
- // this.selectdata = res.data[0]
664
- }
665
-
666
- if (this.show_data.defname === '合同签订') {
667
- if (this.show_data.fields[index].label === '合同编号') {
668
- if (!isEmpty(this.show_data.fields[index].value)) {
669
- let http = new HttpResetClass()
670
- let data = {
671
- tablename: 't_apply',
672
- condition: `f_contract_number='${this.show_data.fields[index].value}'`
673
- }
674
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
675
- resolveMsg: null,
676
- rejectMsg: '合同编号查重失败'
677
- })
678
- if (res.data.length > 0) {
679
- this.show_data.fields[index].value = null
680
- this.$showAlert('合同编号已存在!!!', 'warning', 3000)
681
- }
856
+ }
857
+ if (this.show_data.defname === '报建登记'&&this.show_data.f_apply_type==='工商户报建') {
858
+
859
+ console.log("13f", this.selectdata.onetomany)
860
+ for (const button of this.show_data.buttons) {
861
+ if (this.selectdata.onetomany&& button.button_name === '提交') {
862
+ console.log("1f")
863
+ button.disable = true
864
+ }
865
+ else {
866
+ button.disable = false
867
+ console.log("2f")
868
+ }
869
+ }
870
+ }
871
+ // if (this.show_data.defname === '营业厅建档'){
872
+ // let http = new HttpResetClass()
873
+ // let data = {
874
+ // tablename: 't_userinfo',
875
+ // condition: `f_process_id='${this.selectdata.f_process_id}'`
876
+ //
877
+ // }
878
+ // let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
879
+ //
880
+ // if (this.show_data.fields[index].label === '是否已建档') {
881
+ // if (res.data[0].f_user_state === '预备') {
882
+ // this.show_data.fields[index].value = '否'
883
+ // button.hidden = false
884
+ // }else{
885
+ // this.show_data.fields[index].value = '是'
886
+ // button.hidden = true
887
+ // }
888
+ // }
889
+ // }
890
+ if(this.show_data.defname === '现场勘察') {
891
+ console.log("this.shdata",this.show_data)
892
+ if (this.show_data.fields[index].label === '是否具备安装条件') {
893
+ for (const button of this.show_data.buttons) {
894
+ if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
895
+ button.hidden = false
896
+ }else {
897
+ button.hidden = true
682
898
  }
683
899
  }
684
- if (this.show_data.fields[index].label === '单价(户)') {
900
+ }
901
+ }
902
+ // if (this.show_data.defname === '通气点火'){
903
+ // let http = new HttpResetClass()
904
+ // let data = {
905
+ // tablename: 't_firemessage',
906
+ // condition: `f_process_id='${this.selectdata.f_process_id}'`
907
+ //
908
+ // }
909
+ // let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
910
+ // console.log("res")
911
+ // console.log(res.data)
912
+ // if (this.show_data.fields[index].label === '是否已通气') {
913
+ // if (res.data.length==0) {
914
+ // this.show_data.fields[index].value = '否'
915
+ // button.hidden = false
916
+ // }else{
917
+ // this.show_data.fields[index].value = '是'
918
+ // button.hidden = true
919
+ // }
920
+ // }
921
+ // }
922
+ if (this.show_data.defname === '合同签订') {
923
+ if (this.show_data.fields[index].label === '合同编号') {
924
+ if (!isEmpty(this.show_data.fields[index].value)) {
685
925
  let http = new HttpResetClass()
686
926
  let data = {
687
- num1: this.getLableValue(this.show_data.fields[index].label),
688
- num2: this.getLableValue('户数'),
689
- operator: '*'
927
+ tablename: 't_apply',
928
+ condition: `f_contract_number='${this.show_data.fields[index].value}'`
690
929
  }
691
- try {
692
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
693
- resolveMsg: null,
694
- rejectMsg: null
695
- })
696
- data = {
697
- num1: res.data,
698
- num2: this.getLableValue('其他费用'),
699
- operator: '+'
700
- }
701
- res = await http.load('POST', 'rs/logic/compute', {data: data}, {
702
- resolveMsg: null,
703
- rejectMsg: null
704
- })
705
- this.setLabelValue('合同金额',res.data)
706
- } catch (e) {
707
- this.$showAlert(e.data.msg, 'warning', 3000)
930
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
931
+ resolveMsg: null,
932
+ rejectMsg: '合同编号查重失败'
933
+ })
934
+ if (res.data.length > 0) {
935
+ this.show_data.fields[index].value = null
936
+ this.$showAlert('合同编号已存在!!!', 'warning', 3000)
708
937
  }
938
+ //拼写合同编号
939
+ // if (this.selectdata.f_apply_type == '工商户报建') {
940
+ // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value
941
+ // // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
942
+ // }else {
943
+ // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value
944
+ // // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
945
+ // }
709
946
  }
710
- if (this.show_data.fields[index].label === '其他费用') {
711
- let http = new HttpResetClass()
712
- let data = {
713
- num1: this.getLableValue(this.show_data.fields[index].label),
714
- num2: this.getLableValue('合同金额'),
947
+ }
948
+ if (this.show_data.fields[index].label === '单价') {
949
+ let http = new HttpResetClass()
950
+ let data = {
951
+ num1: this.getLableValue(this.show_data.fields[index].label),
952
+ num2: this.getLableValue('户数'),
953
+ operator: '*'
954
+ }
955
+ try {
956
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
957
+ resolveMsg: null,
958
+ rejectMsg: null
959
+ })
960
+ data = {
961
+ num1: res.data,
962
+ num2: this.getLableValue('其他费用'),
715
963
  operator: '+'
716
964
  }
717
- try {
718
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
719
- resolveMsg: null,
720
- rejectMsg: null
721
- })
722
- this.setLabelValue('合同金额',res.data)
723
- } catch (e) {
724
- this.$showAlert(e.data.msg, 'warning', 3000)
965
+ res = await http.load('POST', 'rs/logic/compute', {data: data}, {
966
+ resolveMsg: null,
967
+ rejectMsg: null
968
+ })
969
+ this.setLabelValue('合同金额',res.data)
970
+ if(this.show_data.f_apply_type === '居民报建'){
971
+ this.show_data.f_contract_money = res.data
972
+ this.show_data.f_due_money = res.data
973
+ this.show_data.f_surplus_money = res.data
974
+ this.setLabelValue('应交总金额',res.data)
975
+ this.setLabelValue('未结总金额',res.data)
725
976
  }
977
+ } catch (e) {
978
+ this.$showAlert(e.data.msg, 'warning', 3000)
726
979
  }
727
980
  }
728
- // ========================= 武安 =================================
729
- // 号码检测
730
- if (this.show_data.fields[index].label === '电话号码') {
731
- let phone = this.show_data.fields[index].value
732
- // 电话号码效验
733
- if (!(/^1[3456789]\d{9}$/.test(phone))) {
734
- this.show_data.fields[index].value = ""
735
- this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
736
- }
737
- }
738
- //时间提醒
739
- if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
740
- let setTime = this.show_data.fields[index].value
741
- let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
742
- if (nowTime >= setTime) {
743
- this.$showMessage("请注意,当前节点时间/工期已过期!")
744
- }
745
- }
746
- },
747
- // input值发生变化
748
- async 'oninput'(index) {
749
-
750
- },
751
- // 错误事件
752
- error_check(index) {
753
- // 时间格式检测
754
- if (this.show_data.fields[index].type == 'datepicker') {
755
- let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
756
- let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
757
- if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
758
- this.show_data.fields[index].error.flag = false
759
- } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
760
- this.show_data.fields[index].error.flag = false
761
- } else {
762
- if (this.show_data.fields[index].fullsize) {
763
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
764
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
765
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
766
- this.show_data.fields[index].error.flag = true
767
- this.show_data.fields[index].value = ''
768
- } else {
769
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
770
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
771
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
772
- this.show_data.fields[index].error.flag = true
773
- this.show_data.fields[index].value = ''
981
+ if (this.show_data.fields[index].label === '其他费用') {
982
+ let http = new HttpResetClass()
983
+ let data = {
984
+ num1: this.getLableValue(this.show_data.fields[index].label),
985
+ num2: this.getLableValue('合同金额'),
986
+ operator: '+'
987
+ }
988
+ try {
989
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
990
+ resolveMsg: null,
991
+ rejectMsg: null
992
+ })
993
+ this.setLabelValue('合同金额',res.data)
994
+ if(this.show_data.f_apply_type === '居民报建'){
995
+ this.show_data.f_contract_money = res.data
996
+ this.show_data.f_due_money = res.data
997
+ this.show_data.f_surplus_money = res.data
998
+ this.setLabelValue('应交总金额',res.data)
999
+ this.setLabelValue('未结总金额',res.data)
774
1000
  }
775
-
1001
+ } catch (e) {
1002
+ this.$showAlert(e.data.msg, 'warning', 3000)
776
1003
  }
777
1004
  }
778
- },
779
- // onetomany模态框默认监听监听事件
780
- async 'onetomanydelete'(i, j) {
781
- console.log('默认删除')
782
- let http = new HttpResetClass()
783
- let data = {
784
- table: this.show_data.onetomany[i].tables[0],
785
- row: this.show_data.onetomany[i].rows[j]
1005
+ }
1006
+ // ========================= 武安 =================================
1007
+ // 号码检测
1008
+ if (this.show_data.fields[index].label === '电话号码') {
1009
+ let phone = this.show_data.fields[index].value
1010
+ // 电话号码效验
1011
+ if (!(/^1[3456789]\d{9}$/.test(phone))) {
1012
+ this.show_data.fields[index].value = ""
1013
+ this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
786
1014
  }
787
- let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
788
- resolveMsg: null,
789
- rejectMsg: '删除失败'
790
- })
1015
+ }
1016
+ //时间提醒
1017
+ if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
1018
+ let setTime = this.show_data.fields[index].value
1019
+ let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
1020
+ if (nowTime >= setTime) {
1021
+ this.$showMessage("请注意,当前节点时间/工期已过期!")
1022
+ }
1023
+ }
1024
+ },
1025
+ // input值发生变化
1026
+ async 'oninput'(index) {
1027
+
1028
+ },
1029
+ // 错误事件
1030
+ error_check(index) {
1031
+ // 时间格式检测
1032
+ if (this.show_data.fields[index].type == 'datepicker') {
1033
+ let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
1034
+ let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
1035
+ if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
1036
+ this.show_data.fields[index].error.flag = false
1037
+ } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
1038
+ this.show_data.fields[index].error.flag = false
1039
+ } else {
1040
+ if (this.show_data.fields[index].fullsize) {
1041
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1042
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
1043
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1044
+ this.show_data.fields[index].error.flag = true
1045
+ this.show_data.fields[index].value = ''
1046
+ } else {
1047
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1048
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
1049
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1050
+ this.show_data.fields[index].error.flag = true
1051
+ this.show_data.fields[index].value = ''
1052
+ }
791
1053
 
792
- if (res.data <= 0){
793
- this.$showMessage('删除失败')
794
- return
795
1054
  }
1055
+ }
1056
+ },
1057
+ // onetomany模态框默认监听监听事件
1058
+ async 'onetomanydelete'(i, j) {
1059
+ console.log('默认删除')
1060
+ let http = new HttpResetClass()
1061
+ let data = {
1062
+ table: this.show_data.onetomany[i].tables[0],
1063
+ row: this.show_data.onetomany[i].rows[j]
1064
+ }
1065
+ let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
1066
+ resolveMsg: null,
1067
+ rejectMsg: '删除失败'
1068
+ })
796
1069
 
797
- this.$dispatch('breakControl', this.show_data)
798
- },
799
- async 'onetomanyadd'(index) {
1070
+ if (res.data <= 0){
1071
+ this.$showMessage('删除失败')
1072
+ return
1073
+ }
800
1074
 
801
- let data = {
802
- f_process_id : this.show_data.f_process_id
1075
+ this.$dispatch('breakControl', this.show_data)
1076
+ },
1077
+ async 'onetomanyadd'(index) {
1078
+
1079
+ let data = {
1080
+ f_process_id : this.show_data.f_process_id
1081
+ }
1082
+ this.show_data.onetomany[index].fields.forEach(item => {
1083
+ data[item.field] = item.value
1084
+ })
1085
+ let res = await this.$resetpost(
1086
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1087
+ data
1088
+ )
1089
+ this.$dispatch('breakControl', this.show_data)
1090
+ },
1091
+ async 'onetomanyupdate'(i, j) {
1092
+ let onetomany = this.show_data.onetomany[i]
1093
+ let data = onetomany.rows[j]
1094
+
1095
+ onetomany.fields.forEach(item => {
1096
+ data[item.field] = item.value
1097
+ })
1098
+ let res = await this.$resetpost(
1099
+ `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
1100
+ data
1101
+ )
1102
+
1103
+ this.$dispatch('breakControl', this.show_data)
1104
+ },
1105
+ // 选择用户档案信息
1106
+ 'selectUserinfo'(row) {
1107
+ console.log("当前选择数据",row)
1108
+ if (this.selectdata.f_apply_type === '拆改装报建'){
1109
+ this.showLabels('用户编号')
1110
+ this.hideLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1111
+ this.electiveLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1112
+ this.show_data.f_address_type = '民用地址'
1113
+ this.show_data.f_pcd = row.f_pcd
1114
+ this.show_data.f_street = row.f_street
1115
+ this.show_data.f_residential_area = row.f_residential_area
1116
+ this.show_data.f_building = row.f_building
1117
+ this.show_data.f_unit = row.f_unit
1118
+ this.show_data.f_floor = row.f_floor
1119
+ this.show_data.f_room = row.f_room
1120
+ this.selectdata.flag = '旧用户'
1121
+ }
1122
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1123
+ this.setLabelValue('用户名称', row.f_user_name)
1124
+ this.setLabelValue('用户电话', row.f_user_phone)
1125
+ this.setLabelValue('证件类型', row.f_credentials)
1126
+ this.setLabelValue('证件号码', row.f_idnumber)
1127
+ this.setLabelValue('地址', row.f_address)
1128
+
1129
+ this.selectdata.f_userinfo_id = row.f_userinfo_id
1130
+ this.selectdata.f_userinfo_code = row.f_userinfo_code
1131
+ console.log("当前选择数据",this.show_data)
1132
+ },
1133
+ async 'streetChange'(index) {
1134
+ if (isEmpty(this.show_data.f_street)) {
1135
+ return
1136
+ }
1137
+
1138
+ this.setLabelValue('小区', null)
1139
+
1140
+ let data = {
1141
+ tablename: 't_area',
1142
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1143
+ }
1144
+ let http = new HttpResetClass()
1145
+ let res = await http.load(
1146
+ 'POST',
1147
+ `rs/sql/singleTable`,
1148
+ {data: data},
1149
+ {resolveMsg: null, rejectMsg: '小区!!!'}
1150
+ )
1151
+
1152
+ this.setLabelOptions('小区', res.data.map(item => {
1153
+ return {
1154
+ label: item.f_residential_area,
1155
+ value: item.f_residential_area
803
1156
  }
804
- this.show_data.onetomany[index].fields.forEach(item => {
805
- data[item.field] = item.value
806
- })
807
- let res = await this.$resetpost(
808
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
809
- data
810
- )
811
- this.$dispatch('breakControl', this.show_data)
812
- },
813
- async 'onetomanyupdate'(i, j) {
814
- let onetomany = this.show_data.onetomany[i]
815
- let data = onetomany.rows[j]
816
-
817
- onetomany.fields.forEach(item => {
818
- data[item.field] = item.value
819
- })
820
- let res = await this.$resetpost(
821
- `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
822
- data
823
- )
1157
+ }))
1158
+ },
1159
+ // 区县失去焦点
1160
+ async 'pcdChange'(index) {
1161
+ if (isEmpty(this.show_data.f_pcd)) {
1162
+ return
1163
+ }
1164
+
1165
+ this.setLabelValue('街道', null)
1166
+ this.setLabelValue('小区', null)
1167
+
1168
+
1169
+ let data = {
1170
+ tablename: 't_street',
1171
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1172
+ }
1173
+ let f_address_type = this.getLableValue('地址类型')
1174
+
1175
+ if (f_address_type === '民用地址') {
1176
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1177
+ }
824
1178
 
825
- this.$dispatch('breakControl', this.show_data)
826
- },
827
- // onetomany模态框监听事件
828
- async 'onchange_modal'(index, i) {
829
- },
830
- async 'oninput_modal'(index, i) {
1179
+ let http = new HttpResetClass()
1180
+ let res = await http.load(
1181
+ 'POST',
1182
+ `rs/sql/singleTable`,
1183
+ {data: data},
1184
+ {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
1185
+ )
1186
+
1187
+ this.setLabelOptions('街道', res.data.map(item => {
1188
+ return {
1189
+ label: item.f_street,
1190
+ value: item.f_street
1191
+ }
1192
+ }))
1193
+ },
1194
+ 'buttonChange' (index) {
1195
+ if (this.show_data.fields[index].value === '否') {
1196
+ console.log("测试")
1197
+ this.hideButtons('下发','提交')
1198
+ this.showButtons('退回','终止')
1199
+ } else {
1200
+ this.hideButtons('退回','终止')
1201
+ this.showButtons('下发','提交')
831
1202
  }
832
1203
  },
833
- watch: {
1204
+ async 'stopApply'() {
1205
+ this.stope_view = true
1206
+ this.showview = false
1207
+ },
1208
+ async 'signUserInfo' (index) {
1209
+ if (this.show_data.fields[index].value === '是') {
1210
+ console.log("测试")
1211
+ this.showLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1212
+ this.requiredLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '门牌号', '地址')
1213
+ } else {
1214
+ this.hideLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1215
+ this.electiveLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1216
+ }
1217
+ },
1218
+ // onetomany模态框监听事件
1219
+ async 'onchange_modal'(index, i) {
1220
+ },
1221
+ async 'oninput_modal'(index, i) {
834
1222
  }
1223
+ },
1224
+ watch: {
835
1225
  }
1226
+ }
836
1227
  </script>
837
1228
  <style scoped>
838
- /*清除model中的浮动*/
839
- .clearfix:after,.clearfix:before{
840
- display: table;
841
- }
842
- .clearfix:after{
843
- clear: both;
844
- }
1229
+ /*清除model中的浮动*/
1230
+ .clearfix:after,.clearfix:before{
1231
+ display: table;
1232
+ }
1233
+ .clearfix:after{
1234
+ clear: both;
1235
+ }
845
1236
  </style>