address-client 3.2.93 → 3.2.95

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,320 +1,320 @@
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=='省市区'" class="row">
11
- <div class="col-sm-6 form-group "
12
- :class="[$v.f_province.required ? 'has-error' : 'has-success']">
13
- <label class="font_normal_body">省&emsp;&emsp;份</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 form-group "
19
- :class="[$v.f_city.required ? 'has-error' : 'has-success']">
20
- <label class="font_normal_body">城&emsp;&emsp;市</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 form-group "
26
- :class="[$v.f_district.required ? 'has-error' : 'has-success']">
27
- <label class="font_normal_body">区&ensp;&ensp;/&ensp;县</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 class="col-sm-6 form-group " v-if="config.hasnumber"
33
- :class="[$v.f_pcd_number.required ? 'has-error' : 'has-success']">
34
- <label class="font_normal_body">区域编码</label>
35
- <input type="number" v-model="pcdmodel.f_pcd_number"
36
- class="input_search" style="width:60%" placeholder="区/县"
37
- @change="numberyanzheng"
38
- v-validate:f_pcd_number='{required: true }'>
39
- </div>
40
- <div class="col-sm-12 form-group">
41
- <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
42
- <textarea class="input_textarea" rows="3" style="margin-top:25px;width:80%;height: auto;" v-model="pcdmodel.f_comments"></textarea>
43
- </div>
44
- </div>
45
- <!-- 街道-->
46
- <div v-if="areatype=='街道'" class="row">
47
- <div class="col-sm-6 form-group "
48
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
49
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
50
- <input type="text" v-show="false" v-model="streetmodel.f_pcd_id"
51
- v-validate:f_pcd_id='{required: true }'>
52
- <v-select
53
- :value.sync="streetmodel.f_pcd_id" :value-single="true"
54
- :options='pcdslist' placeholder='请选择'
55
- close-on-select search="true" @change="pcdChange">
56
- </v-select>
57
- </div>
58
- <div class="col-sm-6 form-group "
59
- :class="[$v.f_street.required ? 'has-error' : 'has-success']">
60
- <label class="font_normal_body">街道/乡镇</label>
61
- <input type="text" v-model="streetmodel.f_street"
62
- class="input_search" style="width:60%" placeholder="街道/乡镇"
63
- v-validate:f_street='{required: true }'>
64
- </div>
65
- <div class="col-sm-6 form-group " v-if="config.hasnumber"
66
- :class="[$v.f_street_number.required ? 'has-error' : 'has-success']">
67
- <label class="font_normal_body">街道编号</label>
68
- <input type="text" v-model="streetmodel.f_street_number"
69
- @change="streetyanzheng"
70
- class="input_search" style="width:60%" placeholder="街道编号"
71
- v-validate:f_street_number='{required: true }'>
72
- </div>
73
- <div class="col-sm-6 form-group "
74
- :class="[$v.f_iscity.required ? 'has-error' : 'has-success']">
75
- <label class="font_normal_body">地区类型</label>
76
- <input type="text" v-show="false" v-model="streetmodel.f_iscity"
77
- v-validate:f_iscity='{required: true }'>
78
- <v-select
79
- :value.sync="streetmodel.f_iscity" :value-single="true"
80
- :options='iscity' placeholder='请选择'
81
- close-on-select>
82
- </v-select>
83
- </div>
84
- <div class="col-sm-12 form-group">
85
- <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
86
- <textarea class="input_textarea" rows="3" style="margin-top:25px;width:80%;height: auto;" v-model="streetmodel.f_comments"></textarea>
87
- </div>
88
- </div>
89
-
90
- <div class="row">
91
- <div style="margin-top:40px;text-align:right;">
92
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
93
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
94
- </div>
95
- <div v-if="areatype=='省市区'" class="row" style="margin-top:40px;height: 580px;">
96
- <city-list v-ref:addpcd @select-changed="selected" :f_filialeids.sync="f_filialeids"></city-list>
97
- </div>
98
- </div>
99
- </div>
100
- </validator>
101
- </div>
102
- </template>
103
-
104
- <script>
105
- import {HttpResetClass} from 'vue-client'
106
-
107
- let getAreaConfig = async function (self) {
108
- // 获取气价里面的配置
109
- await self.$getConfig(self, 'UserPcd')
110
- console.log('原地址配置',self.config)
111
- console.log('获取地址配置',self.config)
112
- Object.assign(self.model, self.config)
113
- }
114
- export default {
115
- title: '区域地址添加',
116
- data () {
117
- return {
118
- //初始化省市区数据
119
- config:{
120
- hasnumber: false
121
- },
122
- pcdslist:[],
123
- iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'}],
124
- //省市区
125
- pcdmodel: {
126
- f_province:'',
127
- f_city:'',
128
- f_district:'',
129
- f_comments:'',
130
- f_pcd_number: ''
131
- },
132
- //街道
133
- streetmodel: {
134
- f_pcd_id:'',
135
- f_street_id:'',
136
- slice_area: null,
137
- f_slice_area: null,
138
- f_adjustable_id: null,
139
- f_street:'',
140
- f_comments:'',
141
- f_street_number:''
142
- }
143
- }
144
- },
145
- props: ['f_filialeids', 'areatype','row','operation'],
146
- ready(){
147
- this.initdata()
148
- getAreaConfig(this)
149
- },
150
- methods: {
151
- async streetyanzheng(){
152
- console.log(this.streetmodel.f_street_number.length)
153
- if (this.streetmodel.f_street_number.length != 2){
154
- this.$showAlert('请输入正确的位数', 'warning', 2000)
155
- this.streetmodel.f_street_number = ''
156
- }else{
157
- let res =await this.$resetpost('rs/sql/address_singleTableOrderBy', {
158
- data: {
159
- items: '*',
160
- tablename: 't_street',
161
- orderitem: 'id',
162
- condition: `f_street_number = '${this.streetmodel.f_street_number}' and f_orgid = '${this.$login.f.orgid}'`
163
- }
164
- }, {resolveMsg: null, rejectMsg: null})
165
- if (res.data.length>0){
166
- if (res.data[0].id != this.streetmodel.id) {
167
- this.$showAlert('当前编号已存在', 'warning', 2000)
168
- this.streetmodel.f_street_number = ''
169
- }
170
- }
171
- }
172
- },
173
- async numberyanzheng(){
174
- console.log(this.pcdmodel.f_pcd_number.length)
175
- if (this.pcdmodel.f_pcd_number.length != 3){
176
- this.$showAlert('请输入正确的位数', 'warning', 2000)
177
- this.pcdmodel.f_pcd_number = ''
178
- }else{
179
- let res =await this.$resetpost('rs/sql/address_singleTableOrderBy', {
180
- data: {
181
- items: '*',
182
- tablename: 't_pcd',
183
- orderitem: 'id',
184
- condition: `f_pcd_number = '${this.pcdmodel.f_pcd_number}' and f_orgid = '${this.$login.f.orgid}'`
185
- }
186
- }, {resolveMsg: null, rejectMsg: null})
187
- if (res.data.length>0){
188
- if (res.data[0].id != this.pcdmodel.id) {
189
- this.$showAlert('当前编号已存在', 'warning', 2000)
190
- this.pcdmodel.f_pcd_number = ''
191
- }
192
- }
193
- }
194
- },
195
- //初始化省市区,添加街道
196
- initpcds(pconditon){
197
- console.log("省市区准备")
198
- let HttpReset = new HttpResetClass()
199
- HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
200
- data: {
201
- items: '*',
202
- tablename: 't_pcd',
203
- orderitem: 'id',
204
- condition: pconditon
205
- }
206
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
207
- let redata = []
208
- req.data.forEach((row, n) => {
209
- redata[n] = {
210
- label: row.f_pcd,
211
- value: row.id,
212
- data:row,
213
- id:row.id
214
- }
215
- })
216
- this.pcdslist=redata
217
- })
218
- },
219
- //根据名字找数据
220
- findbyid(list,name){
221
- var result
222
- list.forEach((row, n) => {
223
- if(name==row.id){
224
- result= row.data
225
- }
226
- })
227
- return result
228
- },
229
- //初始化数据
230
- initdata(){
231
- if(this.areatype=='街道'){
232
- this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
233
- }
234
- if(this.areatype=='小区'){
235
- this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
236
- this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
237
- }
238
- },
239
- //省/市/区变化
240
- pcdChange(val){
241
- console.log("省/市/区变化",val)
242
- this.$resetValidation()
243
- },
244
- //保存
245
- async confirm(){
246
- if(this.areatype=='省市区'){
247
- await this.savepcd()
248
- }
249
- if(this.areatype=='街道'){
250
- await this.savestreet()
251
- }
252
- this.cleardara()
253
- this.$dispatch('confirm')
254
- },
255
- //保存省市区
256
- async savepcd(){
257
- this.pcdmodel.f_filialeid = this.f_filialeids
258
- this.pcdmodel.f_operator = this.$login.f.name
259
- this.pcdmodel.f_operatorid = this.$login.f.id
260
- this.pcdmodel.f_orgid = this.$login.f.orgid
261
- this.pcdmodel.f_orgname = this.$login.f.orgs
262
- this.pcdmodel.f_depid = this.$login.f.depids
263
- this.pcdmodel.f_depname = this.$login.f.deps
264
- this.pcdmodel.f_pcd = this.pcdmodel.f_province+this.pcdmodel.f_city+this.pcdmodel.f_district
265
- await this.$resetpost('rs/logic/address_updatepcd', this.pcdmodel)
266
- },
267
- //保存街道
268
- async savestreet(){
269
- this.streetmodel.f_filialeid = this.f_filialeids
270
- this.streetmodel.f_operator= this.$login.f.name
271
- this.streetmodel.f_operatorid = this.$login.f.id
272
- this.streetmodel.f_orgid = this.$login.f.orgid
273
- this.streetmodel.f_orgname = this.$login.f.orgs
274
- this.streetmodel.f_depid = this.$login.f.depids
275
- this.streetmodel.f_depname = this.$login.f.deps
276
- this.streetmodel.f_pcd=this.findbyid(this.pcdslist,this.streetmodel.f_pcd_id).f_pcd
277
- console.log('获取街道model', this.streetmodel)
278
- await this.$resetpost('rs/logic/address_updatestreet', this.streetmodel)
279
- },
280
- cancel(){
281
- this.cleardara()
282
- this.$dispatch('cancel')
283
- },
284
- cleardara () {
285
- this.pcdmodel = {
286
- f_province: '',
287
- f_city: '',
288
- f_district: '',
289
- f_comments:''
290
- }
291
- this.streetmodel = {
292
- f_pcd_id: '',
293
- f_slice_area: '',
294
- f_adjustable_id: '',
295
- f_street: '',
296
- f_comments:''
297
- }
298
- }
299
-
300
- },
301
- watch: {
302
- 'areatype'(){
303
- this.initdata()
304
- },
305
- 'f_filialeids'(){
306
- if (this.streetmodel.f_filialeid) {
307
- if (this.streetmodel.f_filialeid != this.f_filialeids) {
308
- this.$dispatch('cancel')
309
- }
310
- }
311
- if (this.pcdmodel.f_filialeid) {
312
- if (this.pcdmodel.f_filialeid != this.f_filialeids) {
313
- this.$dispatch('cancel')
314
- }
315
- }
316
- this.initdata()
317
- }
318
- }
319
- }
320
- </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=='省市区'" class="row">
11
+ <div class="col-sm-6 form-group "
12
+ :class="[$v.f_province.required ? 'has-error' : 'has-success']">
13
+ <label class="font_normal_body">省&emsp;&emsp;份</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 form-group "
19
+ :class="[$v.f_city.required ? 'has-error' : 'has-success']">
20
+ <label class="font_normal_body">城&emsp;&emsp;市</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 form-group "
26
+ :class="[$v.f_district.required ? 'has-error' : 'has-success']">
27
+ <label class="font_normal_body">区&ensp;&ensp;/&ensp;县</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 class="col-sm-6 form-group " v-if="config.hasnumber"
33
+ :class="[$v.f_pcd_number.required ? 'has-error' : 'has-success']">
34
+ <label class="font_normal_body">区域编码</label>
35
+ <input type="number" v-model="pcdmodel.f_pcd_number"
36
+ class="input_search" style="width:60%" placeholder="区/县"
37
+ @change="numberyanzheng"
38
+ v-validate:f_pcd_number='{required: true }'>
39
+ </div>
40
+ <div class="col-sm-12 form-group">
41
+ <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
42
+ <textarea class="input_textarea" rows="3" style="margin-top:25px;width:80%;height: auto;" v-model="pcdmodel.f_comments"></textarea>
43
+ </div>
44
+ </div>
45
+ <!-- 街道-->
46
+ <div v-if="areatype=='街道'" class="row">
47
+ <div class="col-sm-6 form-group "
48
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
49
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
50
+ <input type="text" v-show="false" v-model="streetmodel.f_pcd_id"
51
+ v-validate:f_pcd_id='{required: true }'>
52
+ <v-select
53
+ :value.sync="streetmodel.f_pcd_id" :value-single="true"
54
+ :options='pcdslist' placeholder='请选择'
55
+ close-on-select search="true" @change="pcdChange">
56
+ </v-select>
57
+ </div>
58
+ <div class="col-sm-6 form-group "
59
+ :class="[$v.f_street.required ? 'has-error' : 'has-success']">
60
+ <label class="font_normal_body">街道/乡镇</label>
61
+ <input type="text" v-model="streetmodel.f_street"
62
+ class="input_search" style="width:60%" placeholder="街道/乡镇"
63
+ v-validate:f_street='{required: true }'>
64
+ </div>
65
+ <div class="col-sm-6 form-group " v-if="config.hasnumber"
66
+ :class="[$v.f_street_number.required ? 'has-error' : 'has-success']">
67
+ <label class="font_normal_body">街道编号</label>
68
+ <input type="text" v-model="streetmodel.f_street_number"
69
+ @change="streetyanzheng"
70
+ class="input_search" style="width:60%" placeholder="街道编号"
71
+ v-validate:f_street_number='{required: true }'>
72
+ </div>
73
+ <div class="col-sm-6 form-group "
74
+ :class="[$v.f_iscity.required ? 'has-error' : 'has-success']">
75
+ <label class="font_normal_body">地区类型</label>
76
+ <input type="text" v-show="false" v-model="streetmodel.f_iscity"
77
+ v-validate:f_iscity='{required: true }'>
78
+ <v-select
79
+ :value.sync="streetmodel.f_iscity" :value-single="true"
80
+ :options='iscity' placeholder='请选择'
81
+ close-on-select>
82
+ </v-select>
83
+ </div>
84
+ <div class="col-sm-12 form-group">
85
+ <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
86
+ <textarea class="input_textarea" rows="3" style="margin-top:25px;width:80%;height: auto;" v-model="streetmodel.f_comments"></textarea>
87
+ </div>
88
+ </div>
89
+
90
+ <div class="row">
91
+ <div style="margin-top:40px;text-align:right;">
92
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
93
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
94
+ </div>
95
+ <div v-if="areatype=='省市区'" class="row" style="margin-top:40px;height: 580px;">
96
+ <city-list v-ref:addpcd @select-changed="selected" :f_filialeids.sync="f_filialeids"></city-list>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </validator>
101
+ </div>
102
+ </template>
103
+
104
+ <script>
105
+ import {HttpResetClass} from 'vue-client'
106
+
107
+ let getAreaConfig = async function (self) {
108
+ // 获取气价里面的配置
109
+ await self.$getConfig(self, 'UserPcd')
110
+ console.log('原地址配置',self.config)
111
+ console.log('获取地址配置',self.config)
112
+ Object.assign(self.model, self.config)
113
+ }
114
+ export default {
115
+ title: '区域地址添加',
116
+ data () {
117
+ return {
118
+ //初始化省市区数据
119
+ config:{
120
+ hasnumber: false
121
+ },
122
+ pcdslist:[],
123
+ iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'}],
124
+ //省市区
125
+ pcdmodel: {
126
+ f_province:'',
127
+ f_city:'',
128
+ f_district:'',
129
+ f_comments:'',
130
+ f_pcd_number: ''
131
+ },
132
+ //街道
133
+ streetmodel: {
134
+ f_pcd_id:'',
135
+ f_street_id:'',
136
+ slice_area: null,
137
+ f_slice_area: null,
138
+ f_adjustable_id: null,
139
+ f_street:'',
140
+ f_comments:'',
141
+ f_street_number:''
142
+ }
143
+ }
144
+ },
145
+ props: ['f_filialeids', 'areatype','row','operation'],
146
+ ready(){
147
+ this.initdata()
148
+ getAreaConfig(this)
149
+ },
150
+ methods: {
151
+ async streetyanzheng(){
152
+ console.log(this.streetmodel.f_street_number.length)
153
+ if (this.streetmodel.f_street_number.length != 2){
154
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
155
+ this.streetmodel.f_street_number = ''
156
+ }else{
157
+ let res =await this.$resetpost('rs/sql/address_singleTableOrderBy', {
158
+ data: {
159
+ items: '*',
160
+ tablename: 't_street',
161
+ orderitem: 'id',
162
+ condition: `f_street_number = '${this.streetmodel.f_street_number}' and f_orgid = '${this.$login.f.orgid}'`
163
+ }
164
+ }, {resolveMsg: null, rejectMsg: null})
165
+ if (res.data.length>0){
166
+ if (res.data[0].id != this.streetmodel.id) {
167
+ this.$showAlert('当前编号已存在', 'warning', 2000)
168
+ this.streetmodel.f_street_number = ''
169
+ }
170
+ }
171
+ }
172
+ },
173
+ async numberyanzheng(){
174
+ console.log(this.pcdmodel.f_pcd_number.length)
175
+ if (this.pcdmodel.f_pcd_number.length != 3){
176
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
177
+ this.pcdmodel.f_pcd_number = ''
178
+ }else{
179
+ let res =await this.$resetpost('rs/sql/address_singleTableOrderBy', {
180
+ data: {
181
+ items: '*',
182
+ tablename: 't_pcd',
183
+ orderitem: 'id',
184
+ condition: `f_pcd_number = '${this.pcdmodel.f_pcd_number}' and f_orgid = '${this.$login.f.orgid}'`
185
+ }
186
+ }, {resolveMsg: null, rejectMsg: null})
187
+ if (res.data.length>0){
188
+ if (res.data[0].id != this.pcdmodel.id) {
189
+ this.$showAlert('当前编号已存在', 'warning', 2000)
190
+ this.pcdmodel.f_pcd_number = ''
191
+ }
192
+ }
193
+ }
194
+ },
195
+ //初始化省市区,添加街道
196
+ initpcds(pconditon){
197
+ console.log("省市区准备")
198
+ let HttpReset = new HttpResetClass()
199
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
200
+ data: {
201
+ items: '*',
202
+ tablename: 't_pcd',
203
+ orderitem: 'id',
204
+ condition: pconditon
205
+ }
206
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
207
+ let redata = []
208
+ req.data.forEach((row, n) => {
209
+ redata[n] = {
210
+ label: row.f_pcd,
211
+ value: row.id,
212
+ data:row,
213
+ id:row.id
214
+ }
215
+ })
216
+ this.pcdslist=redata
217
+ })
218
+ },
219
+ //根据名字找数据
220
+ findbyid(list,name){
221
+ var result
222
+ list.forEach((row, n) => {
223
+ if(name==row.id){
224
+ result= row.data
225
+ }
226
+ })
227
+ return result
228
+ },
229
+ //初始化数据
230
+ initdata(){
231
+ if(this.areatype=='街道'){
232
+ this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
233
+ }
234
+ if(this.areatype=='小区'){
235
+ this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
236
+ this.initstreets(` f_filialeid = '${this.f_filialeids}'`)
237
+ }
238
+ },
239
+ //省/市/区变化
240
+ pcdChange(val){
241
+ console.log("省/市/区变化",val)
242
+ this.$resetValidation()
243
+ },
244
+ //保存
245
+ async confirm(){
246
+ if(this.areatype=='省市区'){
247
+ await this.savepcd()
248
+ }
249
+ if(this.areatype=='街道'){
250
+ await this.savestreet()
251
+ }
252
+ this.cleardara()
253
+ this.$dispatch('confirm')
254
+ },
255
+ //保存省市区
256
+ async savepcd(){
257
+ this.pcdmodel.f_filialeid = this.f_filialeids
258
+ this.pcdmodel.f_operator = this.$login.f.name
259
+ this.pcdmodel.f_operatorid = this.$login.f.id
260
+ this.pcdmodel.f_orgid = this.$login.f.orgid
261
+ this.pcdmodel.f_orgname = this.$login.f.orgs
262
+ this.pcdmodel.f_depid = this.$login.f.depids
263
+ this.pcdmodel.f_depname = this.$login.f.deps
264
+ this.pcdmodel.f_pcd = this.pcdmodel.f_province+this.pcdmodel.f_city+this.pcdmodel.f_district
265
+ await this.$resetpost('rs/logic/address_updatepcd', this.pcdmodel)
266
+ },
267
+ //保存街道
268
+ async savestreet(){
269
+ this.streetmodel.f_filialeid = this.f_filialeids
270
+ this.streetmodel.f_operator= this.$login.f.name
271
+ this.streetmodel.f_operatorid = this.$login.f.id
272
+ this.streetmodel.f_orgid = this.$login.f.orgid
273
+ this.streetmodel.f_orgname = this.$login.f.orgs
274
+ this.streetmodel.f_depid = this.$login.f.depids
275
+ this.streetmodel.f_depname = this.$login.f.deps
276
+ this.streetmodel.f_pcd=this.findbyid(this.pcdslist,this.streetmodel.f_pcd_id).f_pcd
277
+ console.log('获取街道model', this.streetmodel)
278
+ await this.$resetpost('rs/logic/address_updatestreet', this.streetmodel)
279
+ },
280
+ cancel(){
281
+ this.cleardara()
282
+ this.$dispatch('cancel')
283
+ },
284
+ cleardara () {
285
+ this.pcdmodel = {
286
+ f_province: '',
287
+ f_city: '',
288
+ f_district: '',
289
+ f_comments:''
290
+ }
291
+ this.streetmodel = {
292
+ f_pcd_id: '',
293
+ f_slice_area: '',
294
+ f_adjustable_id: '',
295
+ f_street: '',
296
+ f_comments:''
297
+ }
298
+ }
299
+
300
+ },
301
+ watch: {
302
+ 'areatype'(){
303
+ this.initdata()
304
+ },
305
+ 'f_filialeids'(){
306
+ if (this.streetmodel.f_filialeid) {
307
+ if (this.streetmodel.f_filialeid != this.f_filialeids) {
308
+ this.$dispatch('cancel')
309
+ }
310
+ }
311
+ if (this.pcdmodel.f_filialeid) {
312
+ if (this.pcdmodel.f_filialeid != this.f_filialeids) {
313
+ this.$dispatch('cancel')
314
+ }
315
+ }
316
+ this.initdata()
317
+ }
318
+ }
319
+ }
320
+ </script>