apply-clients 3.1.37 → 3.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,203 +1,260 @@
1
- <template>
2
- <div>
3
- <div style="height: 20px; padding-left: 20px" v-if="print_dispatch && this.data.title == '派工单'">
4
- <button type="button" class="btn btn-info head-but" @click="printDispatch()" v-el:cx>打印派工单</button>
5
- </div>
6
- <service-view :data="data" v-if="showview" v-ref:serviceview></service-view>
7
-
8
- <!--派工单-->
9
- <dispatch-list :selectdata="selectdata" v-if="dispatchlist"></dispatch-list>
10
- <!-- 终止报建 -->
11
- <stop-install :selectdata="selectdata" v-if="showstop"></stop-install>
12
- <!-- 报建缴费 -->
13
- <apply-charge-management :selectdata="selectdata" v-if="applycharge"></apply-charge-management>
14
-
15
- <apply-record-cancel :selectdata="selectdata" v-if="showcancel"></apply-record-cancel>
16
- </div>
17
- </template>
18
- <script>
19
- import {HttpResetClass} from 'vue-client'
20
- import Vue from "vue";
21
- export default {
22
- title: '报建功能业务控制层',
23
- props: ['selectdata','funcdata'],
24
- data () {
25
- return {
26
- data: null,
27
- showview: false, // 控制通用页面
28
- showstop: false, // 控制终止
29
- showcancel: false, // 控制撤销
30
- dispatchlist: false,//派工单
31
- print_dispatch: true,
32
- applycharge: false // 报建缴费
33
- }
34
- },
35
- ready () {
36
- this.hasChange()
37
- },
38
- methods: {
39
- // json配置数据处理 比如下拉框的options
40
- async initializtion() {
41
- // selectdata 填充 data
42
- let temp = Object.assign({},this.data,this.selectdata)
43
- temp.fields.forEach(item => {
44
- if (this.selectdata[item.field]) {
45
- item.value = this.selectdata[item.field]
46
- } else {
47
- item.value = ''
48
- }
49
- // 如果配置类型为select,获取options
50
- if(item.type ==='select'){
51
- item.options = this.$appdata.getParam(item.label)
52
- }
53
- })
54
-
55
-
56
- // onetomany 数据获取
57
- if (this.data.onetomany) {
58
- for (let index = 0; index < this.data.onetomany.length; index++) {
59
- let http = new HttpResetClass()
60
- let data = {
61
- tablename: this.data.onetomany[index].tables[0],
62
- condition: `f_process_id='${this.selectdata.f_process_id}'`
63
- }
64
-
65
- let res = await http.load('POST', 'rs/sql/applysingleTable', {data: data}, {
66
- resolveMsg: null,
67
- rejectMsg: 'onetomany查询失败'
68
- })
69
-
70
- // 初始化 onetomany
71
- this.data.onetomany[index].rows = res.data
72
-
73
- // 初始化onetomany中的fields
74
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
75
- // 如果配置类型为select,优先从参数列表获取options
76
- if (this.data.onetomany[index].fields[j].type === 'select') {
77
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
78
- if (temp && temp.length > 0) {
79
- this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
80
- }
81
- }
82
- }
83
-
84
- }
85
- }
86
-
87
- this.data = JSON.parse(JSON.stringify(this.data))
88
-
89
- this.$nextTick(() => {
90
- this.showview = true
91
- })
92
- },
93
- // 功能组件显示控制
94
- hasChange(){
95
- if(this.funcdata.fields) {
96
- this.data = this.funcdata
97
- // 初始化要展示的数据结构
98
- this.initializtion()
99
- this.showview = true
100
- this.showstop = false
101
- this.showcancel = false
102
- }
103
- if (this.funcdata.title === '终止报建' && !this.funcdata.fields) {
104
- this.showview = false
105
- this.showstop = true
106
- this.showcancel = false
107
- }
108
- if (this.funcdata.title === '撤销' && !this.funcdata.fields) {
109
- this.showview = false
110
- this.showstop = false
111
- this.showcancel = true
112
- }
113
- if (this.funcdata.title === '派工单' && !this.funcdata.fields) {
114
- this.showview = false
115
- this.dispatchlist = true
116
- this.showcancel = false
117
- }
118
- if (this.funcdata.title === '报建缴费' && !this.funcdata.fields) {
119
- this.showview = false
120
- this.applycharge = true
121
- this.showcancel = false
122
- }
123
-
124
- },
125
- // 打印派工单
126
- async printDispatch() {
127
- this.print_dispatch = false
128
- this.showview = false
129
- this.dispatchlist = true
130
- }
131
- },
132
- events: {
133
- // 获取view层button事件
134
- async 'button' (model){
135
- model = Object.assign({}, this.selectdata, model)
136
- // 下发,提交,保存,退回都在后台处理
137
- let http = new HttpResetClass();
138
- http.load('POST','rs/entity/t_apply',model, {resolveMsg: null, rejectMsg: '数据保存失败'})
139
- .then(res => {
140
- this.$dispatch('query')
141
- })
142
- },
143
- // onetomany模态框默认监听监听事件
144
- async 'onetomanydelete'(i, j) {
145
- console.log('默认删除')
146
- let http = new HttpResetClass()
147
- let data = {
148
- table: this.data.onetomany[i].tables[0],
149
- row: this.data.onetomany[i].rows[j]
150
- }
151
- let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
152
- resolveMsg: null,
153
- rejectMsg: '删除失败'
154
- })
155
-
156
- if (res.data <= 0){
157
- this.$showMessage('删除失败')
158
- return
159
- }
160
-
161
- this.$dispatch('selfsearch')
162
- this.$refs.serviceview.data.onetomany[i].rows.splice(j, 1)
163
- },
164
- async 'onetomanyadd'(inedx) {
165
- let data = {
166
- f_process_id : this.selectdata.f_process_id,
167
- f_operator: this.$login.f.name,
168
- f_operation_date: new Date().Format("yyyy-MM-dd HH:mm:ss"),
169
- f_company: this.$login.f.orgs
170
- }
171
- this.data.onetomany[inedx].fields.forEach(item => {
172
- data[item.field] = item.value
173
- })
174
- let res = await this.$resetpost(
175
- `rs/entity/${this.data.onetomany[inedx].tables[0]}`,
176
- data
177
- )
178
- // this.data.onetomany[inedx].rows.push(data)
179
- this.$dispatch('selfsearch')
180
- this.$refs.serviceview.data.onetomany[inedx].rows.push(data)
181
- },
182
- async 'onetomanyupdate'(i, j) {
183
- let onetomany = this.data.onetomany[i]
184
- let data = onetomany.rows[j]
185
-
186
- onetomany.fields.forEach(item => {
187
- data[item.field] = item.value
188
- })
189
- let res = await this.$resetpost(
190
- `rs/entity/${this.data.onetomany[i].tables[0]}`,
191
- data
192
- )
193
- this.$dispatch('selfsearch')
194
- this.$refs.serviceview.data.onetomany[i].rows.splice(j,1,data)
195
- },
196
- // onetomany模态框监听事件
197
- async 'check_modal'(index) {},
198
- async 'oninput_modal'(index) {}
199
- },
200
- watch:{
201
- }
202
- }
203
- </script>
1
+ <template>
2
+ <div>
3
+ <div style="height: 20px; padding-left: 20px" v-if="print_dispatch && this.data.title == '派工单'">
4
+ <button type="button" class="btn btn-info head-but" @click="printDispatch()" v-el:cx>打印派工单</button>
5
+ </div>
6
+ <service-view :data="data" v-if="showview" v-ref:serviceview></service-view>
7
+
8
+ <!--派工单-->
9
+ <dispatch-list :selectdata="selectdata" v-if="dispatchlist"></dispatch-list>
10
+ <!-- 终止报建 -->
11
+ <stop-install :selectdata="selectdata" v-if="showstop"></stop-install>
12
+ <!-- 报建缴费 -->
13
+ <apply-charge-management :selectdata="selectdata" v-if="applycharge"></apply-charge-management>
14
+
15
+ <apply-record-cancel :selectdata="selectdata" v-if="showcancel"></apply-record-cancel>
16
+ </div>
17
+ </template>
18
+ <script>
19
+ import {HttpResetClass} from 'vue-client'
20
+ import Vue from "vue";
21
+ export default {
22
+ title: '报建功能业务控制层',
23
+ props: ['selectdata','funcdata'],
24
+ data () {
25
+ return {
26
+ data: null,
27
+ showview: false, // 控制通用页面
28
+ showstop: false, // 控制终止
29
+ showcancel: false, // 控制撤销
30
+ dispatchlist: false,//派工单
31
+ print_dispatch: true,
32
+ applycharge: false // 报建缴费
33
+ }
34
+ },
35
+ ready () {
36
+ this.hasChange()
37
+ },
38
+ methods: {
39
+ // json配置数据处理 比如下拉框的options
40
+ async initializtion() {
41
+ // selectdata 填充 data
42
+ let temp = Object.assign({},this.data,this.selectdata)
43
+ temp.fields.forEach(item => {
44
+ if (this.selectdata[item.field]) {
45
+ item.value = this.selectdata[item.field]
46
+ } else {
47
+ item.value = ''
48
+ }
49
+ // 如果配置类型为select,获取options
50
+ if(item.type ==='select'){
51
+ item.options = this.$appdata.getParam(item.label)
52
+ }
53
+ })
54
+
55
+
56
+ // onetomany 数据获取
57
+ if (this.data.onetomany) {
58
+ for (let index = 0; index < this.data.onetomany.length; index++) {
59
+ let http = new HttpResetClass()
60
+ let data = {
61
+ tablename: this.data.onetomany[index].tables[0],
62
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
63
+ }
64
+
65
+ let res = await http.load('POST', 'rs/sql/applysingleTable', {data: data}, {
66
+ resolveMsg: null,
67
+ rejectMsg: 'onetomany查询失败'
68
+ })
69
+
70
+ // 初始化 onetomany
71
+ this.data.onetomany[index].rows = res.data
72
+
73
+ // 初始化onetomany中的fields
74
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
75
+ // 如果配置类型为select,优先从参数列表获取options
76
+ if (this.data.onetomany[index].fields[j].type === 'select') {
77
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
78
+ if (temp && temp.length > 0) {
79
+ this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
80
+ }
81
+ }
82
+ }
83
+
84
+ }
85
+ }
86
+
87
+ this.data = JSON.parse(JSON.stringify(this.data))
88
+
89
+ this.$nextTick(() => {
90
+ this.showview = true
91
+ })
92
+ },
93
+ // 功能组件显示控制
94
+ hasChange(){
95
+ console.log("cs数据",this.selectdata)
96
+ if(this.funcdata.fields) {
97
+ this.data = this.funcdata
98
+ // 初始化要展示的数据结构
99
+ this.initializtion()
100
+ this.showview = true
101
+ this.showstop = false
102
+ this.showcancel = false
103
+ }
104
+ if (this.funcdata.title === '终止报建' && !this.funcdata.fields) {
105
+ this.showview = false
106
+ this.showstop = true
107
+ this.showcancel = false
108
+ }
109
+ if (this.funcdata.title === '撤销' && !this.funcdata.fields) {
110
+ this.showview = false
111
+ this.showstop = false
112
+ this.showcancel = true
113
+ }
114
+ if (this.funcdata.title === '派工单' && !this.funcdata.fields) {
115
+ this.showview = false
116
+ this.dispatchlist = true
117
+ this.showcancel = false
118
+ }
119
+ if (this.funcdata.title === '报建缴费' && !this.funcdata.fields) {
120
+ this.showview = false
121
+ this.applycharge = true
122
+ this.showcancel = false
123
+ }
124
+ if (this.selectdata.f_apply_type === '散户报建'){
125
+ this.showview = false
126
+ this.applycharge = true
127
+ this.showcancel = false
128
+ }
129
+ },
130
+ // 打印派工单
131
+ async printDispatch() {
132
+ this.print_dispatch = false
133
+ this.showview = false
134
+ this.dispatchlist = true
135
+ }
136
+ },
137
+ events: {
138
+ // 获取view层button事件
139
+ async 'button' (model){
140
+ model = Object.assign({}, this.selectdata, model)
141
+ // 下发,提交,保存,退回都在后台处理
142
+ let http = new HttpResetClass();
143
+ http.load('POST','rs/entity/t_apply',model, {resolveMsg: null, rejectMsg: '数据保存失败'})
144
+ .then(res => {
145
+ this.$dispatch('query')
146
+ })
147
+ },
148
+ // onetomany模态框默认监听监听事件
149
+ async 'onetomanydelete'(i, j) {
150
+ console.log('默认删除')
151
+ let http = new HttpResetClass()
152
+ let data = {
153
+ table: this.data.onetomany[i].tables[0],
154
+ row: this.data.onetomany[i].rows[j]
155
+ }
156
+ let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
157
+ resolveMsg: null,
158
+ rejectMsg: '删除失败'
159
+ })
160
+
161
+ if (res.data <= 0){
162
+ this.$showMessage('删除失败')
163
+ return
164
+ }
165
+
166
+ this.$dispatch('selfsearch')
167
+ this.$refs.serviceview.data.onetomany[i].rows.splice(j, 1)
168
+ },
169
+ async 'onetomanyadd'(inedx) {
170
+ let data = {
171
+ f_process_id : this.selectdata.f_process_id,
172
+ f_operator: this.$login.f.name,
173
+ f_operation_date: new Date().Format("yyyy-MM-dd HH:mm:ss"),
174
+ f_company: this.$login.f.orgs
175
+ }
176
+ this.data.onetomany[inedx].fields.forEach(item => {
177
+ data[item.field] = item.value
178
+ })
179
+ let res = await this.$resetpost(
180
+ `rs/entity/${this.data.onetomany[inedx].tables[0]}`,
181
+ data
182
+ )
183
+ // this.data.onetomany[inedx].rows.push(data)
184
+ this.$dispatch('selfsearch')
185
+ this.$refs.serviceview.data.onetomany[inedx].rows.push(data)
186
+ },
187
+ async 'onetomanyupdate'(i, j) {
188
+ let onetomany = this.data.onetomany[i]
189
+ let data = onetomany.rows[j]
190
+
191
+ onetomany.fields.forEach(item => {
192
+ data[item.field] = item.value
193
+ })
194
+ let res = await this.$resetpost(
195
+ `rs/entity/${this.data.onetomany[i].tables[0]}`,
196
+ data
197
+ )
198
+ this.$dispatch('selfsearch')
199
+ this.$refs.serviceview.data.onetomany[i].rows.splice(j,1,data)
200
+ },
201
+ async 'check'(index) {
202
+ // =====================================安康逸华特殊逻辑===========================================
203
+
204
+
205
+ // 合成地址
206
+ if (
207
+ this.$refs.serviceview.data.fields[index].label === '县/区' ||
208
+ this.$refs.serviceview.data.fields[index].label === '街道' ||
209
+ this.$refs.serviceview.data.fields[index].label === '小区' ||
210
+ this.$refs.serviceview.data.fields[index].label === '楼号' ||
211
+ this.$refs.serviceview.data.fields[index].label === '单元号' ||
212
+ this.$refs.serviceview.data.fields[index].label === '楼层' ||
213
+ this.$refs.serviceview.data.fields[index].label === '门牌号'
214
+ ) {
215
+ console.log('即将合成地址')
216
+ var address = ''
217
+ for (let i = 0; i < this.$refs.serviceview.data.fields.length; i++) {
218
+ // 控制设置级联
219
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
220
+ // xxx xx xxx
221
+ if (this.$refs.serviceview.data.fields[i].label === '县/区' && this.$refs.serviceview.data.fields[i].value) {
222
+ address += this.$refs.serviceview.data.fields[i].value
223
+ }
224
+ if (this.$refs.serviceview.data.fields[i].label === '街道' && this.$refs.serviceview.data.fields[i].value) {
225
+ address += this.$refs.serviceview.data.fields[i].value
226
+ }
227
+ if (this.$refs.serviceview.data.fields[i].label === '小区' && this.$refs.serviceview.data.fields[i].value) {
228
+ address += this.$refs.serviceview.data.fields[i].value
229
+ }
230
+ if (this.$refs.serviceview.data.fields[i].label === '楼号' && this.$refs.serviceview.data.fields[i].value) {
231
+ address += ' ' + this.$refs.serviceview.data.fields[i].value
232
+ }
233
+ if (this.$refs.serviceview.data.fields[i].label === '单元号' && this.$refs.serviceview.data.fields[i].value) {
234
+ address += '-' + this.$refs.serviceview.data.fields[i].value
235
+ }
236
+ if (this.$refs.serviceview.data.fields[i].label === '楼层' && this.$refs.serviceview.data.fields[i].value) {
237
+ address += '-' + this.$refs.serviceview.data.fields[i].value
238
+ }
239
+ if (this.$refs.serviceview.data.fields[i].label === '门牌号' && this.$refs.serviceview.data.fields[i].value) {
240
+ address += '-' + this.$refs.serviceview.data.fields[i].value
241
+ }
242
+ }
243
+ console.log('获取到的address=>' + address)
244
+ // 数据获取完毕时放入地址text
245
+ for (let i = 0; i < this.$refs.serviceview.data.fields.length; i++) {
246
+ if (this.$refs.serviceview.data.fields[i].label === '地址') {
247
+ this.$refs.serviceview.data.fields[i].value = address
248
+ console.log('修改fields[i].value后的值=>' + this.$refs.serviceview.data.fields[i].value)
249
+ }
250
+ }
251
+ }
252
+ },
253
+ // onetomany模态框监听事件
254
+ async 'check_modal'(index) {},
255
+ async 'oninput_modal'(index) {}
256
+ },
257
+ watch:{
258
+ }
259
+ }
260
+ </script>