apply-clients 7.1.34 → 7.1.35

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,249 +1,261 @@
1
- <template>
2
- <div class="col-sm-12" style="margin: 20px 0px;">
3
- <data-grid :model="model" v-ref:grid class="list_area table_sy" style="padding: 0px">
4
- <template partial='head'>
5
- <tr>
6
- <th class="textNoLineBreak">序号</th>
7
- <th class="textNoLineBreak">区/县</th>
8
- <th class="textNoLineBreak">片区</th>
9
- <th class="textNoLineBreak">街道</th>
10
- <th class="textNoLineBreak">小区</th>
11
- <th class="textNoLineBreak">详细地址</th>
12
- <th class="textNoLineBreak">用户状态</th>
13
- <th class="textNoLineBreak">客户编号</th>
14
- <th class="textNoLineBreak">用户姓名</th>
15
- <th class="textNoLineBreak">电话</th>
16
- <th class="textNoLineBreak">证件类型</th>
17
- <th class="textNoLineBreak">证件号码</th>
18
- <th class="textNoLineBreak">时间</th>
19
- <th class="textNoLineBreak">
20
- <button type="button" class="btn btn-info head-but"
21
- @click="$parent.$parent.showFileModal()">导入</button>
22
- <a type="button" class="btn btn-info head-but"
23
- href="/applyinstall/Excel/v3报装地址批量导入.xlsx" download>模板下载</a>
24
- </th>
25
- </tr>
26
- </template>
27
- <template partial='body'>
28
- <tr>
29
- <td style="text-align: center;">
30
- <nobr>{{$index+1}}</nobr>
31
- </td>
32
- <td style="text-align: center;">
33
- <nobr>{{row.f_area}}</nobr>
34
- </td>
35
- <td style="text-align: center;">
36
- <nobr>{{row.f_slice_area}}</nobr>
37
- </td>
38
- <td style="text-align: center;">
39
- <nobr>{{row.f_street}}</nobr>
40
- </td>
41
- <td style="text-align: center;">
42
- <nobr>{{row.f_residential_area}}</nobr>
43
- </td>
44
- <td style="text-align: center;">
45
- <nobr>{{row.f_address}}</nobr>
46
- </td>
47
- <td style="text-align: center;">
48
- <nobr>{{row.f_user_state}}</nobr>
49
- </td>
50
- <td style="text-align: center;">
51
- <nobr>{{row.f_userinfo_code}}</nobr>
52
- </td>
53
- <td style="text-align: center;">
54
- <nobr>{{row.f_user_name}}</nobr>
55
- </td>
56
- <td style="text-align: center;">
57
- <nobr>{{row.f_user_phone}}</nobr>
58
- </td>
59
- <td style="text-align: center;">
60
- <nobr>{{row.f_credentials}}</nobr>
61
- </td>
62
- <td style="text-align: center;">
63
- <nobr>{{row.f_idnumber}}</nobr>
64
- </td>
65
- <td style="text-align: center;">
66
- <nobr>{{row.f_createfile_date}}</nobr>
67
- </td>
68
- <td style="text-align: center;">
69
- <nobr>
70
- <button
71
- type="button"
72
- name="button"
73
- class="btn btn-link"
74
- @click="$parent.$parent.updateState(row.f_userinfo_id,0)"
75
- >操作</button>
76
- <button
77
- type="button"
78
- name="button"
79
- class="btn btn-link"
80
- @click="$parent.$parent.updateState(row.f_userinfo_id,1)"
81
- >撤销</button>
82
- </nobr>
83
- </td>
84
- </tr>
85
- </template>
86
- </data-grid>
87
- </div>
88
- <modal :show.sync="showFile" v-ref:modal backdrop="true" title="选择文件">
89
- <header slot="modal-header" class="modal-header">
90
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
91
- <h4 class="modal-title">选择文件</h4>
92
- </header>
93
- <article slot="modal-body" class="modal-body">
94
- <div class="form-group">
95
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
96
- </div>
97
- </article>
98
- <footer slot="modal-footer" class="modal-footer"></footer>
99
- </modal>
100
-
101
- </template>
102
- <script>
103
- import {PagedList} from 'vue-client'
104
- import {HttpResetClass} from 'vue-client'
105
-
106
- export default {
107
- title: '地址管理',
108
- props: {
109
- selectdata: {
110
- type: Object
111
- },
112
- mark: {
113
- type: Number,
114
- default: 0 // 0:正常 1:禁用 2:追加用户
115
- }
116
- },
117
- data () {
118
- return {
119
- showFile: false,
120
- model: {
121
- data: null
122
- }
123
- }
124
- },
125
- ready () {
126
- this.search()
127
- },
128
- methods: {
129
- showFileModal() {
130
- for (let i = 0; i < this.selectdata.fields.length; i++) {
131
- let item = this.selectdata.fields[i]
132
- if (item.label === '街道' && !item.value) {
133
- this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
134
- return
135
- }
136
- // if (item.label === '小区' && !item.value) {
137
- // this.$showAlert('小区不能为空!!!', 'warning', 3000)
138
- // return
139
- // }
140
- }
141
- this.showFile = !this.showFile
142
- },
143
- async search () {
144
- let http = new HttpResetClass()
145
- let data = {
146
- condition: " 1=1",
147
- f_filialeid: this.$login.f.f_orgids,
148
- f_process_id: this.selectdata.f_process_id
149
- }
150
- let res = await http.load('POST', 'rs/sql/getAddressAanUserinfo', {data:data}, {
151
- resolveMsg: null,
152
- rejectMsg: null
153
- })
154
- this.model.data = res.data
155
- for (let i = 0; i < this.selectdata.fields.length; i++) {
156
- if (this.selectdata.fields[i].label === '户数') {
157
- this.selectdata.fields[i].value = res.data.length
158
- }
159
- }
160
- },
161
- // 关闭文件上传对话框
162
- closeFile() {
163
- this.showFile = false
164
- // 将选的文件清空
165
- this.$refs.file.$el.querySelector('input').value = ''
166
- this.search()
167
- },
168
- updateState(f_userinfo_id,num) {
169
- let http = new HttpResetClass()
170
- let data = {
171
- f_userinfo_id: f_userinfo_id,
172
- num: num
173
- }
174
- if (num == 0) {
175
- this.$showMessage('确定要修改用户状态为不符合吗!!!', ['confirm']).then(async (res) => {
176
- if (res === 'confirm') {
177
- let res = await http.load('POST', 'rs/logic/updateUserinfoState', {data:data}, {
178
- resolveMsg: null,
179
- rejectMsg: null
180
- })
181
-
182
- this.$showMessage("修改成功!")
183
- this.search()
184
-
185
- }
186
- })
187
- }else {
188
- this.$showMessage('确定要撤销用户状态为正常吗!!!', ['confirm']).then(async (res) => {
189
- if (res === 'confirm') {
190
- let res = await http.load('POST', 'rs/logic/updateUserinfoState', {data:data}, {
191
- resolveMsg: null,
192
- rejectMsg: null
193
- })
194
-
195
- this.$showMessage("修改成功!")
196
- this.search()
197
-
198
- }
199
- })
200
- }
201
-
202
-
203
- }
204
- },
205
- events: {
206
- async 'onFileUpload'(file, result) {
207
- let data = {
208
- selectdata: this.selectdata,
209
- filepath: result.f_downloadpath,
210
- user: this.$login.f,
211
- mark: this.mark
212
- }
213
- let res = await this.$resetpost(`rs/logic/importAddressAndUserinfo`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0)
214
-
215
- if(res.data){
216
- let mm = '';
217
- for(var i=0;i<res.data.msg.length;i++){
218
- mm+=`${res.data.msg[i].msg}` + " "
219
- }
220
- let msg = `共导入${res.data.alllength}条,失败${res.data.errorlen}条,失败信息:${mm}`
221
- this.$showMessage(msg)
222
- }else {
223
- this.$showAlert('导入出错,请检查导入文件模板格式!','danger',2000);
224
- }
225
- if (this.mark !== 0) {
226
- this.$dispatch('breakControl', this.selectdata)
227
- }
228
- this.closeFile()
229
- }
230
- },
231
- computed: {
232
- },
233
- watch: {
234
- }
235
- }
236
- </script>
237
- <style scoped>
238
- .textNoLineBreak {
239
- white-space: nowrap;
240
- }
241
- .head-but{
242
- margin-left: 5px;
243
- height: 34px;
244
- /*background-color: #6aa6e2;*/
245
- border-radius: 4px;
246
- font-family: PingFang;
247
- color: #ffffff;
248
- }
249
- </style>
1
+ <template>
2
+ <div class="col-sm-12" style="margin: 20px 0px;">
3
+ <data-grid :model="model" v-ref:grid class="list_area table_sy" style="padding: 0px">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">序号</th>
7
+ <th class="textNoLineBreak">区/县</th>
8
+ <th class="textNoLineBreak">片区</th>
9
+ <th class="textNoLineBreak">街道</th>
10
+ <th class="textNoLineBreak">小区</th>
11
+ <th class="textNoLineBreak">详细地址</th>
12
+ <th class="textNoLineBreak">用户状态</th>
13
+ <th class="textNoLineBreak">客户编号</th>
14
+ <th class="textNoLineBreak">用户姓名</th>
15
+ <th class="textNoLineBreak">电话</th>
16
+ <th class="textNoLineBreak">证件类型</th>
17
+ <th class="textNoLineBreak">证件号码</th>
18
+ <th class="textNoLineBreak">时间</th>
19
+ <th class="textNoLineBreak">
20
+ <button type="button" class="btn btn-info head-but"
21
+ @click="$parent.$parent.showFileModal()">导入</button>
22
+ <a type="button" class="btn btn-info head-but"
23
+ href="/applyinstall/Excel/v3报装地址批量导入.xlsx" download>模板下载</a>
24
+ </th>
25
+ </tr>
26
+ </template>
27
+ <template partial='body'>
28
+ <tr>
29
+ <td style="text-align: center;">
30
+ <nobr>{{$index+1}}</nobr>
31
+ </td>
32
+ <td style="text-align: center;">
33
+ <nobr>{{row.f_area}}</nobr>
34
+ </td>
35
+ <td style="text-align: center;">
36
+ <nobr>{{row.f_slice_area}}</nobr>
37
+ </td>
38
+ <td style="text-align: center;">
39
+ <nobr>{{row.f_street}}</nobr>
40
+ </td>
41
+ <td style="text-align: center;">
42
+ <nobr>{{row.f_residential_area}}</nobr>
43
+ </td>
44
+ <td style="text-align: center;">
45
+ <nobr>{{row.f_address}}</nobr>
46
+ </td>
47
+ <td style="text-align: center;">
48
+ <nobr>{{row.f_user_state}}</nobr>
49
+ </td>
50
+ <td style="text-align: center;">
51
+ <nobr>{{row.f_userinfo_code}}</nobr>
52
+ </td>
53
+ <td style="text-align: center;">
54
+ <nobr>{{row.f_user_name}}</nobr>
55
+ </td>
56
+ <td style="text-align: center;">
57
+ <nobr>{{row.f_user_phone}}</nobr>
58
+ </td>
59
+ <td style="text-align: center;">
60
+ <nobr>{{row.f_credentials}}</nobr>
61
+ </td>
62
+ <td style="text-align: center;">
63
+ <nobr>{{row.f_idnumber}}</nobr>
64
+ </td>
65
+ <td style="text-align: center;">
66
+ <nobr>{{row.f_createfile_date}}</nobr>
67
+ </td>
68
+ <td style="text-align: center;">
69
+ <nobr>
70
+ <button
71
+ type="button"
72
+ name="button"
73
+ class="btn btn-link"
74
+ @click="$parent.$parent.updateState(row.f_userinfo_id,0)"
75
+ >操作</button>
76
+ <button
77
+ type="button"
78
+ name="button"
79
+ class="btn btn-link"
80
+ @click="$parent.$parent.updateState(row.f_userinfo_id,1)"
81
+ >撤销</button>
82
+ </nobr>
83
+ </td>
84
+ </tr>
85
+ </template>
86
+ </data-grid>
87
+ </div>
88
+ <modal :show.sync="showFile" v-ref:modal backdrop="true" title="选择文件">
89
+ <header slot="modal-header" class="modal-header">
90
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
91
+ <h4 class="modal-title">选择文件</h4>
92
+ </header>
93
+ <article slot="modal-body" class="modal-body">
94
+ <div class="form-group">
95
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
96
+ </div>
97
+ </article>
98
+ <footer slot="modal-footer" class="modal-footer"></footer>
99
+ </modal>
100
+
101
+ </template>
102
+ <script>
103
+ import {PagedList} from 'vue-client'
104
+ import {HttpResetClass} from 'vue-client'
105
+
106
+ export default {
107
+ title: '地址管理',
108
+ props: {
109
+ selectdata: {
110
+ type: Object
111
+ },
112
+ mark: {
113
+ type: Number,
114
+ default: 0 // 0:正常 1:禁用 2:追加用户
115
+ }
116
+ },
117
+ data () {
118
+ return {
119
+ showFile: false,
120
+ model: {
121
+ data: null
122
+ }
123
+ }
124
+ },
125
+ ready () {
126
+ this.search()
127
+ },
128
+ methods: {
129
+ async queryUserPrice() {
130
+ let http = new HttpResetClass()
131
+ let data = {
132
+ condition: "f_process_id = '" + this.selectdata.f_process_id + "'",
133
+ tablename: "t_one_price"
134
+ }
135
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data:data}, {
136
+ resolveMsg: null,
137
+ rejectMsg: null
138
+ })
139
+ this.model.data = res.data
140
+ },
141
+ showFileModal() {
142
+ for (let i = 0; i < this.selectdata.fields.length; i++) {
143
+ let item = this.selectdata.fields[i]
144
+ if (item.label === '街道' && !item.value) {
145
+ this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
146
+ return
147
+ }
148
+ // if (item.label === '小区' && !item.value) {
149
+ // this.$showAlert('小区不能为空!!!', 'warning', 3000)
150
+ // return
151
+ // }
152
+ }
153
+ this.showFile = !this.showFile
154
+ },
155
+ async search () {
156
+ let http = new HttpResetClass()
157
+ let data = {
158
+ condition: " 1=1",
159
+ f_filialeid: this.$login.f.f_orgids,
160
+ f_process_id: this.selectdata.f_process_id
161
+ }
162
+ let res = await http.load('POST', 'rs/sql/getAddressAanUserinfo', {data:data}, {
163
+ resolveMsg: null,
164
+ rejectMsg: null
165
+ })
166
+ this.model.data = res.data
167
+ for (let i = 0; i < this.selectdata.fields.length; i++) {
168
+ if (this.selectdata.fields[i].label === '户数') {
169
+ this.selectdata.fields[i].value = res.data.length
170
+ }
171
+ }
172
+ },
173
+ // 关闭文件上传对话框
174
+ closeFile() {
175
+ this.showFile = false
176
+ // 将选的文件清空
177
+ this.$refs.file.$el.querySelector('input').value = ''
178
+ this.search()
179
+ },
180
+ updateState(f_userinfo_id,num) {
181
+ let http = new HttpResetClass()
182
+ let data = {
183
+ f_userinfo_id: f_userinfo_id,
184
+ num: num
185
+ }
186
+ if (num == 0) {
187
+ this.$showMessage('确定要修改用户状态为不符合吗!!!', ['confirm']).then(async (res) => {
188
+ if (res === 'confirm') {
189
+ let res = await http.load('POST', 'rs/logic/updateUserinfoState', {data:data}, {
190
+ resolveMsg: null,
191
+ rejectMsg: null
192
+ })
193
+
194
+ this.$showMessage("修改成功!")
195
+ this.search()
196
+
197
+ }
198
+ })
199
+ }else {
200
+ this.$showMessage('确定要撤销用户状态为正常吗!!!', ['confirm']).then(async (res) => {
201
+ if (res === 'confirm') {
202
+ let res = await http.load('POST', 'rs/logic/updateUserinfoState', {data:data}, {
203
+ resolveMsg: null,
204
+ rejectMsg: null
205
+ })
206
+
207
+ this.$showMessage("修改成功!")
208
+ this.search()
209
+
210
+ }
211
+ })
212
+ }
213
+
214
+
215
+ }
216
+ },
217
+ events: {
218
+ async 'onFileUpload'(file, result) {
219
+ let data = {
220
+ selectdata: this.selectdata,
221
+ filepath: result.f_downloadpath,
222
+ user: this.$login.f,
223
+ mark: this.mark
224
+ }
225
+ let res = await this.$resetpost(`rs/logic/importAddressAndUserinfo`, {data:data}, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0)
226
+
227
+ if(res.data){
228
+ let mm = '';
229
+ for(var i=0;i<res.data.msg.length;i++){
230
+ mm+=`${res.data.msg[i].msg}` + " "
231
+ }
232
+ let msg = `共导入${res.data.alllength}条,失败${res.data.errorlen}条,失败信息:${mm}`
233
+ this.$showMessage(msg)
234
+ }else {
235
+ this.$showAlert('导入出错,请检查导入文件模板格式!','danger',2000);
236
+ }
237
+ if (this.mark !== 0) {
238
+ this.$dispatch('breakControl', this.selectdata)
239
+ }
240
+ this.closeFile()
241
+ }
242
+ },
243
+ computed: {
244
+ },
245
+ watch: {
246
+ }
247
+ }
248
+ </script>
249
+ <style scoped>
250
+ .textNoLineBreak {
251
+ white-space: nowrap;
252
+ }
253
+ .head-but{
254
+ margin-left: 5px;
255
+ height: 34px;
256
+ /*background-color: #6aa6e2;*/
257
+ border-radius: 4px;
258
+ font-family: PingFang;
259
+ color: #ffffff;
260
+ }
261
+ </style>