address-client 3.0.17 → 3.0.19-wsd

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,217 +1,217 @@
1
- <template>
2
- <div class="span">
3
- <validator name='v'>
4
- <p class="bg-info text-center" style="padding: 8px;" v-if="operation=='add'">添加{{areatype}}</p>
5
- <p class="bg-info text-center" style="padding: 8px;" v-if="operation=='modify'&&areatype=='街道'">修改【{{streetmodel.f_street}}】街道</p>
6
- <p class="bg-info text-center" style="padding: 8px;" v-if="operation=='modify'&&areatype=='省市区'">修改【{{pcdmodel.f_pcd}}】</p>
7
- <div class="auto select-overspread form-horizontal">
8
- <div style="text-align:right;margin-top:6px;" class="col-sm-12">
9
- <!-- 省市区-->
10
- <div v-if="areatype=='省市区'">
11
- <div class="col-sm-6 "
12
- :class="[$v.f_province.required ? 'has-error' : 'has-success']">
13
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;省份&nbsp;&nbsp;&nbsp;</label>
14
- <input type="text" v-model="pcdmodel.f_province"
15
- class="input_search" style="width:60%" placeholder="省份"
16
- v-validate:f_province='{required: true }'>
17
- </div>
18
- <div class="col-sm-6 "
19
- :class="[$v.f_city.required ? 'has-error' : 'has-success']">
20
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;城市&nbsp;&nbsp;&nbsp;</label>
21
- <input type="text" v-model="pcdmodel.f_city"
22
- class="input_search" style="width:60%" placeholder="城市"
23
- v-validate:f_city='{required: true }'>
24
- </div>
25
- <div class="col-sm-6 "
26
- :class="[$v.f_district.required ? 'has-error' : 'has-success']">
27
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;区/县&nbsp;&nbsp;</label>
28
- <input type="text" v-model="pcdmodel.f_district"
29
- class="input_search" style="width:60%" placeholder="区/县"
30
- v-validate:f_district='{required: true }'>
31
- </div>
32
- </div>
33
- <!-- 街道-->
34
- <div v-if="areatype=='街道'">
35
- <div class="col-sm-6 "
36
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
37
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;省市区</label>
38
- <input type="text" v-show="false" v-model="streetmodel.f_pcd_id"
39
- v-validate:f_pcd_id='{required: true }'>
40
- <v-select
41
- :value.sync="streetmodel.f_pcd_id" :value-single="true"
42
- :options='pcdslist' placeholder='请选择'
43
- close-on-select search="true" @change="pcdChange">
44
- </v-select>
45
- </div>
46
- <div class="col-sm-6 "
47
- :class="[$v.f_street.required ? 'has-error' : 'has-success']">
48
- <label class="font_normal_body">街道名称</label>
49
- <input type="text" v-model="streetmodel.f_street"
50
- class="input_search" style="width:60%" placeholder="街道名称"
51
- v-validate:f_street='{required: true }'>
52
- </div>
53
- </div>
54
- <div class="row" style="text-align:right;">
55
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
56
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
57
- </div>
58
- </div>
59
- </div>
60
- </validator>
61
- </div>
62
- </template>
63
-
64
- <script>
65
- import {HttpResetClass} from 'vue-client'
66
- export default {
67
- title: '区域地址添加',
68
- data () {
69
- return {
70
- //初始化省市区数据
71
- pcdslist:[],
72
- //省市区
73
- pcdmodel: {
74
- f_province:'',
75
- f_city:'',
76
- f_district:'',
77
- },
78
- //街道
79
- streetmodel: {
80
- f_pcd_id:'',
81
- f_street_id:'',
82
- slice_area: null,
83
- f_slice_area: null,
84
- f_adjustable_id: null,
85
- f_street:'',
86
- }
87
- }
88
- },
89
- props: ['f_filialeids', 'areatype','row','operation'],
90
- ready(){
91
- this.initdata()
92
- },
93
- methods: {
94
- //初始化省市区,添加街道
95
- initpcds(pconditon){
96
- console.log("省市区准备")
97
- let HttpReset = new HttpResetClass()
98
- HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
99
- data: {
100
- items: '*',
101
- tablename: 't_pcd',
102
- orderitem: 'id',
103
- condition: pconditon
104
- }
105
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
106
- let redata = []
107
- req.data.forEach((row, n) => {
108
- redata[n] = {
109
- label: row.f_pcd,
110
- value: row.id,
111
- data:row,
112
- id:row.id
113
- }
114
- })
115
- this.pcdslist=redata
116
- })
117
- },
118
- //根据名字找数据
119
- findbyid(list,name){
120
- var result
121
- list.forEach((row, n) => {
122
- if(name==row.id){
123
- result= row.data
124
- }
125
- })
126
- return result
127
- },
128
- //初始化数据
129
- initdata(){
130
- if(this.areatype=='街道'){
131
- this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
132
- }
133
- if(this.areatype=='小区'){
134
- this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
135
- this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
136
- }
137
- },
138
- //省/市/区变化
139
- pcdChange(val){
140
- console.log("省/市/区变化",val)
141
- this.$resetValidation()
142
- },
143
- //保存
144
- async confirm(){
145
- if(this.areatype=='省市区'){
146
- await this.savepcd()
147
- }
148
- if(this.areatype=='街道'){
149
- await this.savestreet()
150
- }
151
- this.cleardara()
152
- this.$dispatch('confirm')
153
- },
154
- //保存省市区
155
- async savepcd(){
156
- this.pcdmodel.f_filialeid = this.f_filialeids
157
- this.pcdmodel.f_operator = this.$login.f.name
158
- this.pcdmodel.f_operatorid = this.$login.f.id
159
- this.pcdmodel.f_orgid = this.$login.f.orgid
160
- this.pcdmodel.f_orgname = this.$login.f.orgs
161
- this.pcdmodel.f_depid = this.$login.f.depids
162
- this.pcdmodel.f_depname = this.$login.f.deps
163
- this.pcdmodel.f_pcd = this.pcdmodel.f_province+this.pcdmodel.f_city+this.pcdmodel.f_district
164
- await this.$resetpost('rs/logic/address_updatepcd', this.pcdmodel)
165
- },
166
- //保存街道
167
- async savestreet(){
168
- this.streetmodel.f_filialeid = this.f_filialeids
169
- this.streetmodel.f_operator= this.$login.f.name
170
- this.streetmodel.f_operatorid = this.$login.f.id
171
- this.streetmodel.f_orgid = this.$login.f.orgid
172
- this.streetmodel.f_orgname = this.$login.f.orgs
173
- this.streetmodel.f_depid = this.$login.f.depids
174
- this.streetmodel.f_depname = this.$login.f.deps
175
- this.streetmodel.f_pcd=this.findbyid(this.pcdslist,this.streetmodel.f_pcd_id).f_pcd
176
- console.log('获取街道model', this.streetmodel)
177
- await this.$resetpost('rs/logic/address_updatestreet', this.streetmodel)
178
- },
179
- cancel(){
180
- this.cleardara()
181
- this.$dispatch('cancel')
182
- },
183
- cleardara () {
184
- this.pcdmodel = {
185
- f_province: '',
186
- f_city: '',
187
- f_district: ''
188
- }
189
- this.streetmodel = {
190
- f_pcd_id: '',
191
- f_slice_area: '',
192
- f_adjustable_id: '',
193
- f_street: ''
194
- }
195
- }
196
-
197
- },
198
- watch: {
199
- 'areatype'(){
200
- this.initdata()
201
- },
202
- 'f_filialeids'(){
203
- if (this.streetmodel.f_filialeid) {
204
- if (this.streetmodel.f_filialeid != this.f_filialeids) {
205
- this.$dispatch('cancel')
206
- }
207
- }
208
- if (this.pcdmodel.f_filialeid) {
209
- if (this.pcdmodel.f_filialeid != this.f_filialeids) {
210
- this.$dispatch('cancel')
211
- }
212
- }
213
- this.initdata()
214
- }
215
- }
216
- }
217
- </script>
1
+ <template>
2
+ <div class="span">
3
+ <validator name='v'>
4
+ <p class="bg-info text-center" style="padding: 8px;" v-if="operation=='add'">添加{{areatype}}</p>
5
+ <p class="bg-info text-center" style="padding: 8px;" v-if="operation=='modify'&&areatype=='街道'">修改【{{streetmodel.f_street}}】街道</p>
6
+ <p class="bg-info text-center" style="padding: 8px;" v-if="operation=='modify'&&areatype=='省市区'">修改【{{pcdmodel.f_pcd}}】</p>
7
+ <div class="auto select-overspread form-horizontal">
8
+ <div style="text-align:right;margin-top:6px;" class="col-sm-12">
9
+ <!-- 省市区-->
10
+ <div v-if="areatype=='省市区'">
11
+ <div class="col-sm-6 "
12
+ :class="[$v.f_province.required ? 'has-error' : 'has-success']">
13
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;省份&nbsp;&nbsp;&nbsp;</label>
14
+ <input type="text" v-model="pcdmodel.f_province"
15
+ class="input_search" style="width:60%" placeholder="省份"
16
+ v-validate:f_province='{required: true }'>
17
+ </div>
18
+ <div class="col-sm-6 "
19
+ :class="[$v.f_city.required ? 'has-error' : 'has-success']">
20
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;城市&nbsp;&nbsp;&nbsp;</label>
21
+ <input type="text" v-model="pcdmodel.f_city"
22
+ class="input_search" style="width:60%" placeholder="城市"
23
+ v-validate:f_city='{required: true }'>
24
+ </div>
25
+ <div class="col-sm-6 "
26
+ :class="[$v.f_district.required ? 'has-error' : 'has-success']">
27
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;区/县&nbsp;&nbsp;</label>
28
+ <input type="text" v-model="pcdmodel.f_district"
29
+ class="input_search" style="width:60%" placeholder="区/县"
30
+ v-validate:f_district='{required: true }'>
31
+ </div>
32
+ </div>
33
+ <!-- 街道-->
34
+ <div v-if="areatype=='街道'">
35
+ <div class="col-sm-6 "
36
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
37
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;省市区</label>
38
+ <input type="text" v-show="false" v-model="streetmodel.f_pcd_id"
39
+ v-validate:f_pcd_id='{required: true }'>
40
+ <v-select
41
+ :value.sync="streetmodel.f_pcd_id" :value-single="true"
42
+ :options='pcdslist' placeholder='请选择'
43
+ close-on-select search="true" @change="pcdChange">
44
+ </v-select>
45
+ </div>
46
+ <div class="col-sm-6 "
47
+ :class="[$v.f_street.required ? 'has-error' : 'has-success']">
48
+ <label class="font_normal_body">街道名称</label>
49
+ <input type="text" v-model="streetmodel.f_street"
50
+ class="input_search" style="width:60%" placeholder="街道名称"
51
+ v-validate:f_street='{required: true }'>
52
+ </div>
53
+ </div>
54
+ <div class="row" style="text-align:right;">
55
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
56
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </validator>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ import {HttpResetClass} from 'vue-client'
66
+ export default {
67
+ title: '区域地址添加',
68
+ data () {
69
+ return {
70
+ //初始化省市区数据
71
+ pcdslist:[],
72
+ //省市区
73
+ pcdmodel: {
74
+ f_province:'',
75
+ f_city:'',
76
+ f_district:'',
77
+ },
78
+ //街道
79
+ streetmodel: {
80
+ f_pcd_id:'',
81
+ f_street_id:'',
82
+ slice_area: null,
83
+ f_slice_area: null,
84
+ f_adjustable_id: null,
85
+ f_street:'',
86
+ }
87
+ }
88
+ },
89
+ props: ['f_filialeids', 'areatype','row','operation'],
90
+ ready(){
91
+ this.initdata()
92
+ },
93
+ methods: {
94
+ //初始化省市区,添加街道
95
+ initpcds(pconditon){
96
+ console.log("省市区准备")
97
+ let HttpReset = new HttpResetClass()
98
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
99
+ data: {
100
+ items: '*',
101
+ tablename: 't_pcd',
102
+ orderitem: 'id',
103
+ condition: pconditon
104
+ }
105
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
106
+ let redata = []
107
+ req.data.forEach((row, n) => {
108
+ redata[n] = {
109
+ label: row.f_pcd,
110
+ value: row.id,
111
+ data:row,
112
+ id:row.id
113
+ }
114
+ })
115
+ this.pcdslist=redata
116
+ })
117
+ },
118
+ //根据名字找数据
119
+ findbyid(list,name){
120
+ var result
121
+ list.forEach((row, n) => {
122
+ if(name==row.id){
123
+ result= row.data
124
+ }
125
+ })
126
+ return result
127
+ },
128
+ //初始化数据
129
+ initdata(){
130
+ if(this.areatype=='街道'){
131
+ this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
132
+ }
133
+ if(this.areatype=='小区'){
134
+ this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
135
+ this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
136
+ }
137
+ },
138
+ //省/市/区变化
139
+ pcdChange(val){
140
+ console.log("省/市/区变化",val)
141
+ this.$resetValidation()
142
+ },
143
+ //保存
144
+ async confirm(){
145
+ if(this.areatype=='省市区'){
146
+ await this.savepcd()
147
+ }
148
+ if(this.areatype=='街道'){
149
+ await this.savestreet()
150
+ }
151
+ this.cleardara()
152
+ this.$dispatch('confirm')
153
+ },
154
+ //保存省市区
155
+ async savepcd(){
156
+ this.pcdmodel.f_filialeid = this.f_filialeids
157
+ this.pcdmodel.f_operator = this.$login.f.name
158
+ this.pcdmodel.f_operatorid = this.$login.f.id
159
+ this.pcdmodel.f_orgid = this.$login.f.orgid
160
+ this.pcdmodel.f_orgname = this.$login.f.orgs
161
+ this.pcdmodel.f_depid = this.$login.f.depids
162
+ this.pcdmodel.f_depname = this.$login.f.deps
163
+ this.pcdmodel.f_pcd = this.pcdmodel.f_province+this.pcdmodel.f_city+this.pcdmodel.f_district
164
+ await this.$resetpost('rs/logic/address_updatepcd', this.pcdmodel)
165
+ },
166
+ //保存街道
167
+ async savestreet(){
168
+ this.streetmodel.f_filialeid = this.f_filialeids
169
+ this.streetmodel.f_operator= this.$login.f.name
170
+ this.streetmodel.f_operatorid = this.$login.f.id
171
+ this.streetmodel.f_orgid = this.$login.f.orgid
172
+ this.streetmodel.f_orgname = this.$login.f.orgs
173
+ this.streetmodel.f_depid = this.$login.f.depids
174
+ this.streetmodel.f_depname = this.$login.f.deps
175
+ this.streetmodel.f_pcd=this.findbyid(this.pcdslist,this.streetmodel.f_pcd_id).f_pcd
176
+ console.log('获取街道model', this.streetmodel)
177
+ await this.$resetpost('rs/logic/address_updatestreet', this.streetmodel)
178
+ },
179
+ cancel(){
180
+ this.cleardara()
181
+ this.$dispatch('cancel')
182
+ },
183
+ cleardara () {
184
+ this.pcdmodel = {
185
+ f_province: '',
186
+ f_city: '',
187
+ f_district: ''
188
+ }
189
+ this.streetmodel = {
190
+ f_pcd_id: '',
191
+ f_slice_area: '',
192
+ f_adjustable_id: '',
193
+ f_street: ''
194
+ }
195
+ }
196
+
197
+ },
198
+ watch: {
199
+ 'areatype'(){
200
+ this.initdata()
201
+ },
202
+ 'f_filialeids'(){
203
+ if (this.streetmodel.f_filialeid) {
204
+ if (this.streetmodel.f_filialeid != this.f_filialeids) {
205
+ this.$dispatch('cancel')
206
+ }
207
+ }
208
+ if (this.pcdmodel.f_filialeid) {
209
+ if (this.pcdmodel.f_filialeid != this.f_filialeids) {
210
+ this.$dispatch('cancel')
211
+ }
212
+ }
213
+ this.initdata()
214
+ }
215
+ }
216
+ }
217
+ </script>