address-client 1.3.55 → 1.3.57-2

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,211 +1,226 @@
1
- <template>
2
- <div class="flex">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:cri>
5
- <div novalidate class="form-inline auto" partial>
6
- <div class="form-group form-input-group">
7
- <right-tree
8
- :userid.sync='$parent.$parent.userid'
9
- :source.sync='$parent.$parent.source'
10
- @re-res="$parent.$parent.getRes"></right-tree>
11
- </div>
12
- <div class="form-group form-input-group">
13
- <input type="text" class="form-control" v-model="model.f_residential_arearea"
14
- condition="f_residential_area like '%{}%'" placeholder="小区"
15
- :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
16
- </div>
17
- <div class="form-group form-input-group" >
18
- <input type="text" class="form-control" v-model="model.f_building"
19
- condition="f_building like '%{}%'" placeholder="楼号"
20
- :size="model.f_building ? model.f_building.length*2 : 4"/>
21
- </div>
22
- <div class="form-group form-input-group">
23
- <input type="text" class="form-control" v-model="model.f_unit"
24
- condition="f_unit like '%{}%'" placeholder="单元"
25
- :size="model.f_unit ? model.f_unit.length*2 : 4"/>
26
- </div>
27
- <div class="form-group form-input-group">
28
- <input type="text" class="form-control" v-model="model.f_floor"
29
- condition="f_floor like '%{}%'" placeholder="楼层"
30
- :size="model.f_floor ? model.f_floor.length*2 : 4"/>
31
- </div>
32
- <div class="form-group form-input-group">
33
- <input type="text" class="form-control" v-model="model.f_room"
34
- condition="f_room like '%{}%'" placeholder="门牌号"
35
- :size="model.f_room ? model.f_room.length*2 : 4"/>
36
- </div>
37
- <div class="form-group form-input-group" >
38
- <input type="text" class="form-control" v-model="model.f_address"
39
- condition="f_address like '%{}%'" placeholder="详细地址"
40
- :size="model.f_address ? model.f_address.length*2 : 8"/>
41
- </div>
42
- <div class="form-group form-input-group" >
43
- <input type="text" class="form-control" v-model="model.id"
44
- condition="id = '{}'" placeholder="地址ID"
45
- :size="model.f_address ? model.f_address.length*2 : 4"/>
46
- </div>
47
- <div class="form-group form-input-group">
48
- <button class="btn btn-success width-80" @click="search()" >查询</button>
49
- <button class="btn btn-success width-80" @click="$parent.$parent.add('民用')">添加民用</button>
50
- <button class="btn btn-success width-80" @click="$parent.$parent.add('非民用')">添加特殊地址</button>
51
- <button class="btn btn-success width-80" @click="$parent.$parent.clear()">清空</button>
52
- <button class="btn btn-success width-80" @click="$parent.$parent.importAddress">导入地址</button>
53
- <!--
54
- <button class="btn btn-success width-80" :datasrc="../../static/地址导入模板.xls">下载模板</button>
55
- -->
56
- </div>
57
- </div>
58
- </criteria>
59
- <data-grid :model="model" partial='list' v-ref:grid>
60
- <template partial='head'>
61
- <tr>
62
- <th><nobr>地址ID</nobr></th>
63
- <th><nobr>区/县</nobr></th>
64
- <th><nobr>片区</nobr></th>
65
- <th><nobr>街道</nobr></th>
66
- <th><nobr>小区(单位)</nobr></th>
67
- <th><nobr>楼号</nobr></th>
68
- <th><nobr>单元</nobr></th>
69
- <th><nobr>楼层</nobr></th>
70
- <th><nobr>门牌号</nobr></th>
71
- <th><nobr>详细地址</nobr></th>
72
- <th><nobr>时间</nobr></th>
73
- <th><nobr>操作</nobr></th>
74
- </tr>
75
- </template>
76
- <template partial='body'>
77
- <tr>
78
- <td style="text-align:center"><nobr>{{row.id}}</nobr></td>
79
- <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
80
- <td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
81
- <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
82
- <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
83
- <td style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
84
- <td style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
85
- <td style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
86
- <td style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
87
- <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
88
- <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
89
- <td style="text-align:center">
90
- <!-- <button type="button" name="button" class="btn btn-link"
91
- @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
92
- <button type="button" name="button" class="btn btn-link"
93
- @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
94
- </td>
95
- </tr>
96
- </template>
97
- <template partial='foot'></template>
98
- </data-grid>
99
- </criteria-paged>
100
- </div>
101
- <modal :show.sync="showFile" v-ref:modal backdrop="true">
102
- <header slot="modal-header" class="modal-header">
103
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
104
- <h4 class="modal-title">选择文件</h4>
105
- </header>
106
- <article slot="modal-body" class="modal-body">
107
- <div class="form-group">
108
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
109
- </div>
110
- </article>
111
- <footer slot="modal-footer" class="modal-footer"></footer>
112
- </modal>
113
- </template>
114
-
115
- <script>
116
- import { PagedList } from 'vue-client'
117
-
118
- export default {
119
- data () {
120
- return {
121
- model: new PagedList('rs/sql/address_singleTableOrderBy',20,{tablename: `'t_user_address'`,items: `'*'`,orderitem: `'id desc'`}),
122
- userid: this.$login.f.id,
123
- source:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
124
- addflag: false,
125
- addtitle:'',
126
- //文件上传弹框
127
- showFile: false
128
- }
129
- },
130
- title: '地址列表',
131
- props:{
132
- f_filialeids:{
133
- type: String
134
- }
135
- },
136
- ready(){
137
-
138
- },
139
- methods: {
140
- //添加方法
141
- add(val){
142
- this.$refs.paged.$refs.grid.selectStore.selected = null
143
- this.$dispatch('add',val)
144
- },
145
- importAddress(){
146
- this.showFile = true
147
- },
148
- // 关闭文件上传对话框
149
- closeFile() {
150
- this.showFile = false
151
- // 将选的文件清空
152
- this.$refs.file.$el.querySelector('input').value = ''
153
- },
154
- //修改
155
- modify(val){
156
- this.$refs.paged.$refs.grid.selectStore.selected = null
157
- this.$dispatch('modify',val)
158
- },
159
- async delete(row){
160
- if(row.id){
161
- var id = row.id
162
- let service = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_addressid',tablename: 't_service',condition: `f_addressid='${id}'`}},{resolveMsg: null, rejectMsg: null})
163
- let userfiles = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_useraddress_id',tablename: 't_userfiles',condition: `f_useraddress_id='${id}' and f_table_state = '正常'`}},{resolveMsg: null, rejectMsg: null})
164
- if(service.data.length || userfiles.data.length){
165
- this.$showAlert('该地址下已有工单或档案,无法删除!','warning',1000)
166
- }else{
167
- this.$resetdelete('rs/entity/t_user_address', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
168
- this.$dispatch('cancel')
169
- })
170
- }
171
- }
172
- },
173
- search (args) {
174
- args.condition = `${args.condition} and f_filialeids = '${this.f_filialeids}'`
175
- this.model.search(args.condition, args.model)
176
- },
177
- //清空
178
- clear(){
179
- this.$refs.paged.$refs.cri.model = {}
180
- },
181
- getRes (obj) {
182
- console.log(obj,'选择到公司')
183
- this.f_filialeids = obj.resids
184
- },
185
- },
186
- watch:{
187
-
188
- },
189
- events: {
190
- onFileUpload: async function (file, res) {
191
- console.log("上传完毕"+JSON.stringify(res))
192
- let data = {
193
- filepath: res.f_downloadpath,
194
- user:this.$login.f
195
- }
196
- console.log("filepath="+JSON.stringify(data))
197
- await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
198
- this.$showAlert("成功导入"+res.data+'条地址', 'success', 2000)
199
- //关闭上传框
200
- this.closeFile()
201
- //重新查询
202
- this.init()
203
- })
204
- },
205
- 'onFileError'(error) {
206
- this.$showAlert(error, 'warning', 2000)
207
- }
208
- }
209
-
210
- }
211
- </script>
1
+ <template>
2
+ <div class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:cri>
5
+ <div novalidate class="form-inline auto" partial>
6
+ <div class="form-group form-input-group">
7
+ <right-tree
8
+ :userid.sync='$parent.$parent.userid'
9
+ :source.sync='$parent.$parent.source'
10
+ @re-res="$parent.$parent.getRes"></right-tree>
11
+ </div>
12
+ <div class="form-group form-input-group">
13
+ <input type="text" class="form-control" v-model="model.f_residential_arearea"
14
+ condition="f_residential_area like '%{}%'" placeholder="小区"
15
+ :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
16
+ </div>
17
+ <div class="form-group form-input-group" >
18
+ <input type="text" class="form-control" v-model="model.f_building"
19
+ condition="f_building like '%{}%'" placeholder="楼号"
20
+ :size="model.f_building ? model.f_building.length*2 : 4"/>
21
+ </div>
22
+ <div class="form-group form-input-group">
23
+ <input type="text" class="form-control" v-model="model.f_unit"
24
+ condition="f_unit like '%{}%'" placeholder="单元"
25
+ :size="model.f_unit ? model.f_unit.length*2 : 4"/>
26
+ </div>
27
+ <div class="form-group form-input-group">
28
+ <input type="text" class="form-control" v-model="model.f_floor"
29
+ condition="f_floor like '%{}%'" placeholder="楼层"
30
+ :size="model.f_floor ? model.f_floor.length*2 : 4"/>
31
+ </div>
32
+ <div class="form-group form-input-group">
33
+ <input type="text" class="form-control" v-model="model.f_room"
34
+ condition="f_room like '%{}%'" placeholder="门牌号"
35
+ :size="model.f_room ? model.f_room.length*2 : 4"/>
36
+ </div>
37
+ <div class="form-group form-input-group" >
38
+ <input type="text" class="form-control" v-model="model.f_address"
39
+ condition="f_address like '%{}%'" placeholder="详细地址"
40
+ :size="model.f_address ? model.f_address.length*2 : 8"/>
41
+ </div>
42
+ <div class="form-group form-input-group" >
43
+ <input type="text" class="form-control" v-model="model.id"
44
+ condition="id = '{}'" placeholder="地址ID"
45
+ :size="model.f_address ? model.f_address.length*2 : 4"/>
46
+ </div>
47
+ <div class="form-group form-input-group">
48
+ <button class="btn btn-success width-80" @click="search()" >查询</button>
49
+ <button class="btn btn-success width-80" @click="$parent.$parent.add('民用')">添加民用</button>
50
+ <button class="btn btn-success width-80" @click="$parent.$parent.add('非民用')">添加特殊地址</button>
51
+ <button class="btn btn-success width-80" @click="$parent.$parent.clear()">清空</button>
52
+ <button v-if="!$parent.$parent.$parent.ishujiao" class="btn btn-success width-80" @click="$parent.$parent.importAddress">导入地址</button>
53
+ <button v-if="$parent.$parent.$parent.ishujiao" class="btn btn-danger width-80" @click="$parent.$parent.addressSelect()">确定</button>
54
+ <!--
55
+ <button class="btn btn-success width-80" :datasrc="../../static/地址导入模板.xls">下载模板</button>
56
+ -->
57
+ </div>
58
+ </div>
59
+ </criteria>
60
+ <data-grid :model="model" partial='list' v-ref:grid>
61
+ <template partial='head'>
62
+ <tr>
63
+ <th><nobr>地址ID</nobr></th>
64
+ <!--<th><nobr>区/县</nobr></th>-->
65
+ <th><nobr>省市区</nobr></th>
66
+ <th><nobr>街道</nobr></th>
67
+ <th><nobr>小区(单位)</nobr></th>
68
+ <th><nobr>楼号</nobr></th>
69
+ <th><nobr>单元</nobr></th>
70
+ <th><nobr>楼层</nobr></th>
71
+ <th><nobr>门牌号</nobr></th>
72
+ <th><nobr>详细地址</nobr></th>
73
+ <th><nobr>时间</nobr></th>
74
+ <th><nobr>创建人</nobr></th>
75
+ <th><nobr>操作</nobr></th>
76
+ </tr>
77
+ </template>
78
+ <template partial='body'>
79
+ <tr>
80
+ <td style="text-align:center"><nobr>{{row.id}}</nobr></td>
81
+ <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
82
+ <!--<td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>-->
83
+ <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
84
+ <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
85
+ <td style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
86
+ <td style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
87
+ <td style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
88
+ <td style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
89
+ <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
90
+ <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
91
+ <td style="text-align:center"><nobr>{{row.f_create_person}}</nobr></td>
92
+ <td style="text-align:center">
93
+ <!-- <button type="button" name="button" class="btn btn-link"
94
+ @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
95
+ <button type="button" name="button" class="btn btn-link"
96
+ @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
97
+ </td>
98
+ </tr>
99
+ </template>
100
+ <template partial='foot'></template>
101
+ </data-grid>
102
+ </criteria-paged>
103
+ </div>
104
+ <modal :show.sync="showFile" v-ref:modal backdrop="true">
105
+ <header slot="modal-header" class="modal-header">
106
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
107
+ <h4 class="modal-title">选择文件</h4>
108
+ </header>
109
+ <article slot="modal-body" class="modal-body">
110
+ <div class="form-group">
111
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
112
+ </div>
113
+ </article>
114
+ <footer slot="modal-footer" class="modal-footer"></footer>
115
+ </modal>
116
+ </template>
117
+
118
+ <script>
119
+ import { PagedList } from 'vue-client'
120
+
121
+ export default {
122
+ data () {
123
+ return {
124
+ model: new PagedList('rs/sql/address_singleTableOrderBy',20,{tablename: `'t_user_address'`,items: `'*'`,orderitem: `'id desc'`}),
125
+ userid: this.$login.f.id,
126
+ source:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
127
+ addflag: false,
128
+ addtitle:'',
129
+ //文件上传弹框
130
+ showFile: false
131
+ }
132
+ },
133
+ title: '地址列表',
134
+ props:{
135
+ f_filialeids:{
136
+ type: String
137
+ }
138
+ },
139
+ ready(){
140
+ this.init().then(()=>{
141
+ this.$emit('ready')
142
+ }).catch((error) => {
143
+ this.$emit('error', error)
144
+ })
145
+ },
146
+ methods: {
147
+ //添加方法
148
+ add(val){
149
+ this.$refs.paged.$refs.grid.selectStore.selected = null
150
+ this.$dispatch('add',val)
151
+ },
152
+ async init(){
153
+ await this.$refs.paged.$refs.cri.search()
154
+ },
155
+ importAddress(){
156
+ this.showFile = true
157
+ },
158
+ addressSelect(){
159
+ this.$dispatch('address_select')
160
+ },
161
+ // 关闭文件上传对话框
162
+ closeFile() {
163
+ this.showFile = false
164
+ // 将选的文件清空
165
+ this.$refs.file.$el.querySelector('input').value = ''
166
+ },
167
+ //修改
168
+ modify(val){
169
+ this.$refs.paged.$refs.grid.selectStore.selected = null
170
+ this.$dispatch('modify',val)
171
+ },
172
+ async delete(row){
173
+ if(row.id){
174
+ var id = row.id
175
+ let service = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_addressid',tablename: 't_service',condition: `f_addressid='${id}'`}},{resolveMsg: null, rejectMsg: null})
176
+ let userinfo = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_useraddress_id',tablename: 't_userinfo',condition: `f_useraddress_id='${id}'`}},{resolveMsg: null, rejectMsg: null})
177
+ if(service.data.length || userinfo.data.length){
178
+ this.$showAlert('该地址下已有工单或档案,无法删除!','warning',900)
179
+ }else{
180
+ this.$resetdelete('rs/entity/t_user_address', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
181
+ this.$dispatch('refresh')
182
+ })
183
+ }
184
+ }
185
+ },
186
+ search (args) {
187
+ args.condition = `${args.condition} and f_filialeids = '${this.f_filialeids}'`
188
+ this.model.search(args.condition, args.model)
189
+ },
190
+ //清空
191
+ clear(){
192
+ this.$refs.paged.$refs.cri.model = {}
193
+ },
194
+ getRes (obj) {
195
+ console.log(obj,'选择到公司')
196
+ this.f_filialeids = obj.resids
197
+ },
198
+ },
199
+ watch:{
200
+ 'f_filialeids'(){
201
+ this.init()
202
+ }
203
+ },
204
+ events: {
205
+ onFileUpload: async function (file, res) {
206
+ console.log("上传完毕"+JSON.stringify(res))
207
+ let data = {
208
+ filepath: res.f_downloadpath,
209
+ user:this.$login.f
210
+ }
211
+ console.log("filepath="+JSON.stringify(data))
212
+ await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
213
+ this.$showAlert("成功导入"+res.data+'条地址', 'success', 2000)
214
+ //关闭上传框
215
+ this.closeFile()
216
+ //重新查询
217
+ this.init()
218
+ })
219
+ },
220
+ 'onFileError'(error) {
221
+ this.$showAlert(error, 'warning', 2000)
222
+ }
223
+ }
224
+
225
+ }
226
+ </script>