address-client 1.6.72 → 1.6.76

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "address-client",
3
- "version": "1.6.72",
3
+ "version": "1.6.76",
4
4
  "description": "地址管理前台组件",
5
5
  "author": "wanbochao",
6
6
  "license": "ISC",
@@ -47,6 +47,7 @@
47
47
  <label class="font_normal_body _zoom4">小区ID</label>
48
48
  <input type="text"
49
49
  style="width: 60%"
50
+ @blur="areaidCheck"
50
51
  v-model="areamodel.oldid" :disabled="operation=='modify'"
51
52
  class="form-control" placeholder="小区ID"
52
53
  v-validate:oldid='{required: true }'>
@@ -102,6 +103,18 @@
102
103
  close-on-select></v-select>
103
104
  </div>
104
105
  <div class="col-sm-6 form-group form-input-group "
106
+ >
107
+ <label class="font_normal_body _zoom4">预约开户</label>
108
+ <v-select
109
+ :value.sync="areamodel.f_is_order"
110
+ :value-single="true"
111
+ v-model="areamodel.f_is_order"
112
+ :options='is_order' placeholder='预约开户'
113
+ close-on-select>
114
+
115
+ </v-select>
116
+ </div>
117
+ <div class="col-sm-6 form-group form-input-group "
105
118
  >
106
119
  <label class="font_normal_body _zoom4">维修站点</label>
107
120
  <v-select
@@ -124,6 +137,7 @@
124
137
  <label class="font_normal_body _zoom4">单位ID</label>
125
138
  <input type="text"
126
139
  style="width: 60%"
140
+ @blur="areaidCheck"
127
141
  v-model="areamodel.oldid"
128
142
  class="form-control" placeholder="单位ID"
129
143
  v-validate:oldid='{required: true }'>
@@ -182,10 +196,10 @@
182
196
  </div>
183
197
  <div class="col-sm-6 form-group form-input-group "
184
198
  >
185
- <label v-if="areamodel.card_size>0" class="font_normal_body _zoom4" style="text-align: center">剩余<br/>卡号数量</label>
186
- <label v-if="areamodel.card_size<=0" class="font_normal_body _zoom4">卡号数量</label>
199
+ <label v-if="oldsize>0" class="font_normal_body _zoom4" style="text-align: center">剩余<br/>卡号数量</label>
200
+ <label v-if="oldsize<=0" class="font_normal_body _zoom4">卡号数量</label>
187
201
  <input type="number" v-model="areamodel.card_size"
188
- style="width: 60%" :readonly="areamodel.card_size>0"
202
+ style="width: 60%" :readonly="oldsize>0 && operation=='modify'"
189
203
  class="form-control" placeholder="卡号数量">
190
204
  </div>
191
205
  <div class="col-sm-6 form-group form-input-group "
@@ -505,6 +519,8 @@ export default {
505
519
  {label: '韦曲站', value: '韦曲站'}, {label: '郭杜站', value: '郭杜站'},
506
520
  {label: '沣东站', value: '沣东站'},
507
521
  {label: '中心站', value: '中心站'}],
522
+ is_order: [{label: '开户', value: '开户'},
523
+ {label: '未开户', value: '未开户'}],
508
524
  //初始化省市区数据
509
525
  pcdslist: [],
510
526
  //初始化街道数据
@@ -519,6 +535,7 @@ export default {
519
535
  default_devices: [],
520
536
  f_repair_point: '',
521
537
  f_pcd_id: '',
538
+ f_is_order: '',
522
539
  oldid: '',
523
540
  f_linkname: '',
524
541
  f_linkphone: '',
@@ -560,7 +577,7 @@ export default {
560
577
  },
561
578
  }
562
579
  },
563
- props: ['f_special', 'areatype', 'row', 'operation'],
580
+ props: ['f_special', 'areatype', 'row', 'operation', 'oldsize'],
564
581
  ready() {
565
582
  this.initdata()
566
583
  },
@@ -630,7 +647,7 @@ export default {
630
647
  },
631
648
  //初始化数据
632
649
  initdata() {
633
- console.log('areatype是....', this.areatype)
650
+ console.log('areatype是....', this.areatype, this.row)
634
651
  this.initpcds(` 1=1 `)
635
652
  this.initstreets(` 1=1 `)
636
653
  },
@@ -668,7 +685,7 @@ export default {
668
685
  },
669
686
  //获取当前小区档案中的最大卡号区间
670
687
  getCard() {
671
- if (this.areamodel.card_size > 0) {
688
+ if (this.oldsize > 0 && this.operation == 'modify') {
672
689
  this.$showAlert('剩余卡号大于0,不能获取,避免浪费卡号', 'warning', 2000)
673
690
  return
674
691
  }
@@ -687,13 +704,13 @@ export default {
687
704
  //前面不够 补0
688
705
  this.areamodel.card_start = this.pad(card + "", 10)
689
706
  this.areamodel.card_now = this.areamodel.card_start
690
- this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size)) + "", 10)
707
+ this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size) - 1) + "", 10)
691
708
  } else {
692
709
  //默认卡号为03980000001
693
710
  let card = Number(this.$appdata.getSingleValue('启始卡号')) + 1
694
711
  this.areamodel.card_start = this.pad(card + "", 10)
695
712
  this.areamodel.card_now = this.areamodel.card_start
696
- this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size)) + "", 10)
713
+ this.areamodel.card_end = this.pad((Number(card) + Number(this.areamodel.card_size) - 1) + "", 10)
697
714
  }
698
715
  })
699
716
  } catch (error) {
@@ -718,6 +735,7 @@ export default {
718
735
  this.areamodel.op_id = this.$login.f.op_id
719
736
  this.areamodel.op_spot = this.$login.f.op_spot
720
737
  this.areamodel.f_orgstr = this.$login.f.orgpathstr
738
+ this.areamodel.f_is_order = this.areamodel.f_is_order === '开户' ? this.areamodel.f_is_order : null
721
739
  this.areamodel.f_pcd = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd
722
740
  if (this.areamodel.f_street_id) {
723
741
  this.areamodel.f_street = this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
@@ -771,6 +789,22 @@ export default {
771
789
  card_size: null,
772
790
  }
773
791
  },
792
+ areaidCheck(){
793
+ let HttpReset = new HttpResetClass()
794
+ HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
795
+ data: {
796
+ items: 'id',
797
+ tablename: 't_area',
798
+ orderitem: 'id desc',
799
+ condition: ` oldid = '${this.areamodel.oldid}' `
800
+ }
801
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'}).then((req) => {
802
+ if (req.data.length > 0) {
803
+ this.areamodel.oldid = ''
804
+ this.$showAlert('ID重复,请检查ID是否正确!','warning',1000)
805
+ }
806
+ })
807
+ },
774
808
  cancel() {
775
809
  this.cleardara()
776
810
  this.$dispatch('cancel')
@@ -1,71 +1,73 @@
1
1
  <template>
2
2
  <div id="unit" class="flex-row">
3
3
  <div class="flex" style="flex: 1; width:60%">
4
- <area-list @select-changed="selected" v-ref:arealist ></area-list>
4
+ <area-list @select-changed="selected" v-ref:arealist></area-list>
5
5
  </div>
6
6
  <div v-show="areaShow" class="datapanel" style="margin-left: 10px;width: 40%">
7
7
  <div class="flex">
8
8
  <add-area-msg v-ref:addareamsg :areatype="areatype" :operation="operation"
9
- :row="arearow"></add-area-msg>
9
+ :row="arearow"></add-area-msg>
10
10
  </div>
11
11
  </div>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script>
16
- export default {
17
- title: '小区管理',
18
- components:{
19
- },
20
- data () {
21
- return {
22
- //分公司id串
23
- areaShow:false,
24
- areatype:'小区',
25
- arearow:{},
16
+ export default {
17
+ title: '小区管理',
18
+ components: {},
19
+ data() {
20
+ return {
21
+ //分公司id串
22
+ areaShow: false,
23
+ areatype: '小区',
24
+ arearow: {},
25
+ }
26
+ },
27
+ ready() {
28
+ },
29
+ props: {},
30
+ methods: {
31
+ selected(obj) {
32
+ if (obj.val && obj.val.id) {
33
+ this.areaShow = true
34
+ this.$refs.addareamsg.cleardara()
35
+ this.$refs.addareamsg.operation = 'modify'
36
+ this.$refs.addareamsg.areatype = '小区'
37
+ try {
38
+ obj.val.default_devices = obj.val.default_devices ? JSON.parse(obj.val.default_devices) : []
39
+ }catch (e){
40
+ console.log("设备赋值错误")
41
+ } this.$refs.addareamsg.areamodel = Object.assign({}, obj.val)
42
+ this.$refs.addareamsg.oldsize = obj.val.card_size
43
+ this.$refs.addareamsg.initdata()
26
44
  }
45
+ }
46
+ },
47
+ events: {
48
+ 'add'() {
49
+ this.areaShow = true
50
+ this.$refs.addareamsg.cleardara()
51
+ this.$refs.addareamsg.operation = 'add'
52
+ this.$refs.addareamsg.areatype = '小区'
53
+ this.$refs.addareamsg.oldsize = 0
54
+ this.$refs.addareamsg.initdata()
27
55
  },
28
- ready(){
29
- },
30
- props:{
56
+ 'modify'(area) {
31
57
 
32
58
  },
33
- methods:{
34
- selected(obj){
35
- if(obj.val&&obj.val.id){
36
- this.areaShow=true
37
- this.$refs.addareamsg.cleardara()
38
- this.$refs.addareamsg.operation='modify'
39
- this.$refs.addareamsg.areatype='小区'
40
- obj.val.default_devices=obj.val.default_devices?obj.val.default_devices:[]
41
- this.$refs.addareamsg.areamodel=Object.assign({},obj.val)
42
- this.$refs.addareamsg.initdata()
43
- }
44
- }
59
+ 'confirm'() {
60
+ this.$refs.arealist.$refs.paged.$refs.cri.search()
61
+ this.areaShow = false
62
+ },
63
+ 'cancel'() {
64
+ this.$refs.arealist.$refs.paged.$refs.cri.search()
65
+ this.areaShow = false
66
+ },
67
+ 'search'() {
68
+ this.areaShow = false
45
69
  },
46
- events:{
47
- 'add'(){
48
- this.areaShow=true
49
- this.$refs.addareamsg.cleardara()
50
- this.$refs.addareamsg.operation='add'
51
- this.$refs.addareamsg.areatype='小区'
52
- this.$refs.addareamsg.initdata()
53
- },
54
- 'modify'(area){
55
-
56
- },
57
- 'confirm' () {
58
- this.$refs.arealist.$refs.paged.$refs.cri.search()
59
- this.areaShow = false
60
- },
61
- 'cancel' () {
62
- this.$refs.arealist.$refs.paged.$refs.cri.search()
63
- this.areaShow = false
64
- },
65
- 'search' () {
66
- this.areaShow = false
67
- },
68
- }
69
70
  }
71
+ }
70
72
  </script>
71
73
 
@@ -1,110 +1,110 @@
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
- <button class="btn btn-success width-80" @click="search()" >查询</button>
8
- <button class="btn btn-success width-80" @click="$parent.$parent.add('民用')">添加用气区域</button>
9
- <button class="btn btn-success width-80" @click="$parent.$parent.clear()">清空</button>
10
- </div>
11
- </div>
12
- </criteria>
13
- <data-grid :model="model" partial='list' v-ref:grid>
14
- <template partial='head'>
15
- <tr>
16
- <th><nobr>id</nobr></th>
17
- <th><nobr>区/县</nobr></th>
18
- <th><nobr>片区</nobr></th>
19
- <th><nobr>街道</nobr></th>
20
- <th><nobr>用气区域</nobr></th>
21
- <th><nobr>时间</nobr></th>
22
- <th><nobr>操作人</nobr></th>
23
- <th><nobr>操作</nobr></th>
24
- </tr>
25
- </template>
26
- <template partial='body'>
27
- <tr>
28
- <td style="text-align:center"><nobr>{{row.id}}</nobr></td>
29
- <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
30
- <td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
31
- <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
32
- <td style="text-align:center"><nobr>{{row.f_usegas_area}}</nobr></td>
33
- <td style="text-align:center"><nobr>{{row.f_operator}}</nobr></td>
34
- <td style="text-align:center"><nobr>{{row.f_operate_date}}</nobr></td>
35
- <td style="text-align:center">
36
- <!-- <button type="button" name="button" class="btn btn-link"
37
- @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
38
- <button type="button" name="button" class="btn btn-link"
39
- @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
40
- </td>
41
- </tr>
42
- </template>
43
- <template partial='foot'></template>
44
- </data-grid>
45
- </criteria-paged>
46
- </div>
47
- </template>
48
-
49
- <script>
50
- import { PagedList } from 'vue-client'
51
-
52
- export default {
53
- data () {
54
- return {
55
- model: new PagedList('rs/sql/address_getusegasarealist',20), userid: this.$login.f.id,
56
- source:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
57
- }
58
- },
59
- title: '用气区域列表',
60
- props:{
61
- },
62
- ready(){
63
-
64
- },
65
- methods: {
66
- //添加方法
67
- add(val){
68
- this.$refs.paged.$refs.grid.selectStore.selected = null
69
- this.$dispatch('add',val)
70
- },
71
- //修改
72
- modify(val){
73
- this.$refs.paged.$refs.grid.selectStore.selected = null
74
- this.$dispatch('modify',val)
75
- },
76
- async delete(row){
77
- if(row.id){
78
- var id = row.id
79
- let useraredss = await this.$resetpost('rs/sql/address_singleTable',
80
- {data: {
81
- items: 'f_usegas_area_id',
82
- tablename: 't_user_address',
83
- condition: `f_usegas_area_id='${id}'`}
84
- },
85
- {resolveMsg: null, rejectMsg: null})
86
- if(useraredss.data.length>0){
87
- this.$showAlert('该用气区域下已有地址信息,无法删除!','warning',1000)
88
- }else{
89
- this.$resetdelete('rs/entity/t_usegas_area', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
90
- this.$dispatch('cancel')
91
- })
92
- }
93
- }
94
- },
95
- search (args) {
96
- this.model.search(args.condition, args.model)
97
- },
98
- //清空
99
- clear(){
100
- this.$refs.paged.$refs.cri.model = {}
101
- },
102
- },
103
- watch:{
104
-
105
- },
106
- events: {
107
- }
108
-
109
- }
110
- </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
+ <button class="btn btn-success width-80" @click="search()" >查询</button>
8
+ <button class="btn btn-success width-80" @click="$parent.$parent.add('民用')">添加用气区域</button>
9
+ <button class="btn btn-success width-80" @click="$parent.$parent.clear()">清空</button>
10
+ </div>
11
+ </div>
12
+ </criteria>
13
+ <data-grid :model="model" partial='list' v-ref:grid>
14
+ <template partial='head'>
15
+ <tr>
16
+ <th><nobr>id</nobr></th>
17
+ <th><nobr>区/县</nobr></th>
18
+ <th><nobr>片区</nobr></th>
19
+ <th><nobr>街道</nobr></th>
20
+ <th><nobr>用气区域</nobr></th>
21
+ <th><nobr>时间</nobr></th>
22
+ <th><nobr>操作人</nobr></th>
23
+ <th><nobr>操作</nobr></th>
24
+ </tr>
25
+ </template>
26
+ <template partial='body'>
27
+ <tr>
28
+ <td style="text-align:center"><nobr>{{row.id}}</nobr></td>
29
+ <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
30
+ <td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
31
+ <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
32
+ <td style="text-align:center"><nobr>{{row.f_usegas_area}}</nobr></td>
33
+ <td style="text-align:center"><nobr>{{row.f_operator}}</nobr></td>
34
+ <td style="text-align:center"><nobr>{{row.f_operate_date}}</nobr></td>
35
+ <td style="text-align:center">
36
+ <!-- <button type="button" name="button" class="btn btn-link"
37
+ @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
38
+ <button type="button" name="button" class="btn btn-link"
39
+ @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
40
+ </td>
41
+ </tr>
42
+ </template>
43
+ <template partial='foot'></template>
44
+ </data-grid>
45
+ </criteria-paged>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ import { PagedList } from 'vue-client'
51
+
52
+ export default {
53
+ data () {
54
+ return {
55
+ model: new PagedList('rs/sql/address_getusegasarealist',20), userid: this.$login.f.id,
56
+ source:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
57
+ }
58
+ },
59
+ title: '用气区域列表',
60
+ props:{
61
+ },
62
+ ready(){
63
+
64
+ },
65
+ methods: {
66
+ //添加方法
67
+ add(val){
68
+ this.$refs.paged.$refs.grid.selectStore.selected = null
69
+ this.$dispatch('add',val)
70
+ },
71
+ //修改
72
+ modify(val){
73
+ this.$refs.paged.$refs.grid.selectStore.selected = null
74
+ this.$dispatch('modify',val)
75
+ },
76
+ async delete(row){
77
+ if(row.id){
78
+ var id = row.id
79
+ let useraredss = await this.$resetpost('rs/sql/address_singleTable',
80
+ {data: {
81
+ items: 'f_usegas_area_id',
82
+ tablename: 't_user_address',
83
+ condition: `f_usegas_area_id='${id}'`}
84
+ },
85
+ {resolveMsg: null, rejectMsg: null})
86
+ if(useraredss.data.length>0){
87
+ ` this.$showAlert('该用气区域下已有地址信息,无法删除!','warning',1000)
88
+ ` }else{
89
+ this.$resetdelete('rs/entity/t_usegas_area', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
90
+ this.$dispatch('cancel')
91
+ })
92
+ }
93
+ }
94
+ },
95
+ search (args) {
96
+ this.model.search(args.condition, args.model)
97
+ },
98
+ //清空
99
+ clear(){
100
+ this.$refs.paged.$refs.cri.model = {}
101
+ },
102
+ },
103
+ watch:{
104
+
105
+ },
106
+ events: {
107
+ }
108
+
109
+ }
110
+ </script>