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