address-client 3.2.89 → 3.2.91

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