system-clients 3.1.74-xianyang → 3.1.79-xianyang

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,68 +1,150 @@
1
- <template>
2
- <div class="flex-row">
3
- <div :class="{'basic-main':!isChange,'binary-left':isChange}">
4
- <pos-list :row="row" @select-changed="selected" style="width:auto;" :f_filialeid.sync="f_filialeids"
5
- v-ref:list></pos-list>
6
- </div>
7
- <div class="binary-right" style="margin-left: 10px; width: 50%;" v-if="isChange">
8
- <pos-add :data="row" :f_filialeids.sync="f_filialeids" v-ref:addbox></pos-add>
9
- </div>
10
- </div>
11
- </template>
12
- <script>
13
-
14
- import PosList from './PosList'
15
- import PosAdd from './PosAdd'
16
-
17
- export default {
18
- title: 'POS终端管理',
19
- components: {
20
- PosList, PosAdd
21
- },
22
- data() {
23
- return {
24
- isChange: false,
25
- row: null,
26
-
27
- f_filialeids: ''
28
- }
29
- },
30
- methods: {
31
- selected(obj) {
32
- this.isChange = true
33
- this.row = obj.val
34
- }
35
- },
36
- events: {
37
- 'search'() {
38
- this.isChange = false
39
- this.row = null
40
- this.$refs.list.$refs.paged.$refs.cri.search()
41
- },
42
- 'research'() {
43
- console.log('重新查询')
44
- this.isChange = false
45
- this.row = null
46
- },
47
- 'refresh'() {
48
- this.isChange = false
49
- this.row = null
50
- this.$refs.list.search()
51
- },
52
- 'error'(name, row, res) {
53
- this.isChange = false
54
- this.row = null
55
- },
56
- 'close'() {
57
- this.isChange = false
58
- this.row = null
59
- this.$refs.list.search()
60
- },
61
- 'add'() {
62
- this.row = null
63
- this.isChange = true
64
- this.$refs.list.$refs.paged.$refs.grid.selectStore.selected = null
65
- }
66
- }
67
- }
68
- </script>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div :class="{'basic-main':!isChange,'binary-left':isChange}">
4
+ <pos-list :row="row" @dblclick="selected" style="width:auto;" :f_filialeid.sync="f_filialeids" :isshowless="isChange" v-ref:list ></pos-list>
5
+ </div>
6
+ <div class="binary-right" style="margin-left: 10px; width: 40%;" v-if="isChange">
7
+ <pos-add :data="row" :info="infoadd" :f_filialeids.sync="f_filialeids" v-ref:addbox></pos-add>
8
+ </div>
9
+
10
+ <modal v-if="batchPos" :show.sync="batchPos" backdrop="false" >
11
+ <header slot="modal-header" class="modal-header">
12
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
13
+ <h4 class="modal-title">批量操作</h4>
14
+ </header>
15
+ <article slot="modal-body" class="modal-body">
16
+ <form class="form-horizontal">
17
+ <div class="row">
18
+ <div>
19
+ <h4>注意事项</h4>
20
+ <p>1.如果需要对POS设备进行升级,批量选择的POS设备包含非正常状态,则只会对状态为正常的设备进行升级。</p>
21
+ <p>2.如果POS设备处于停用状态,则可以进行启用操作。如果设备处于启用状态,则可以进行停用和升级操作。</p>
22
+ <p>3.批量操作可能耗时较长,请刷新列表查看结果。</p>
23
+ </div>
24
+ </div>
25
+ </form>
26
+ </article>
27
+ <footer slot="modal-footer" class="modal-footer">
28
+ <button type="button" class="button_search button_spacing" @click="batchRoot('2')">批量升级</button>
29
+ <button type="button" class="button_search button_spacing" @click="batchRoot('1')">批量启用</button>
30
+ <button type="button" class="button_search button_spacing" @click="batchRoot('0')">批量停用</button>
31
+ <button type="button" class="button_clear button_spacing" @click='close'>退出</button>
32
+ </footer>
33
+ </modal>
34
+ </div>
35
+ </template>
36
+ <script>
37
+
38
+ import PosList from './PosList'
39
+ import PosAdd from './PosAdd'
40
+
41
+ export default {
42
+ title: 'POS终端管理',
43
+ components: {
44
+ PosList, PosAdd
45
+ },
46
+ data () {
47
+ return {
48
+ isChange: false,
49
+ row: null,
50
+ infoadd: true, // 判断是否显示 升级 等按钮(true/false)
51
+ batchPos: false,
52
+ f_filialeids: ''
53
+ }
54
+ },
55
+ methods: {
56
+ // 批量操作
57
+ async batchRoot(val){
58
+ let arrs = []
59
+ let alertMessage=''
60
+ let selPos = this.$refs.list.selPos
61
+ if (val==='0'){
62
+ alertMessage='停用'
63
+ for (const tmp of selPos) {
64
+ if (tmp.f_state==='正常') arrs.push(tmp)
65
+ }
66
+ } else if (val==='1'){
67
+ alertMessage='启用'
68
+ for (const tmp of selPos) {
69
+ if (tmp.f_state==='停用') arrs.push(tmp)
70
+ }
71
+ } else if(val==='2'){
72
+ alertMessage='升级'
73
+ for (const tmp of selPos) {
74
+ if (tmp.f_state==='正常') arrs.push(tmp)
75
+ }
76
+ } else {
77
+ this.showAlert('出现异常,请重新进操作')
78
+ return
79
+ }
80
+
81
+ await this.$resetpost('rs/logic/batchPos',{data: {tasks: arrs, taskState: val}}, {rejectMsg: null, resolveMsg: null})
82
+
83
+ // 需要提示
84
+ this.$showAlert(`已经开始批量${alertMessage},选择${selPos.length},其中${arrs.length}台可以正常${alertMessage},具体请留意设备情况,并刷新列表查看执行结果!`)
85
+ this.isChange = false
86
+ this.close()
87
+ },
88
+ close(){
89
+ this.batchPos = false
90
+ },
91
+ selected (obj, idx) {
92
+ console.log(obj)
93
+ if (!(obj instanceof MouseEvent)) {
94
+ if (this.$refs.list.selPos.length > 0){
95
+ this.$showMessage(`系统检测到您进行了多选,是否进行批量操作?`, ['confirm', 'cancel']).then((res) => {
96
+ if (res==='confirm'){
97
+ this.batchPos = true
98
+ } else {
99
+ this.isChange = true
100
+ this.infoadd = true
101
+ this.row = obj
102
+ }
103
+ })
104
+
105
+ }else {
106
+ this.isChange = true
107
+ this.infoadd = true
108
+ this.row = obj
109
+ }
110
+ } else {
111
+ this.$showAlert('如需新增,请点击增加按钮!', 'info', 1000)
112
+ }
113
+ }
114
+ },
115
+ events: {
116
+ 'search' () {
117
+ this.infoadd=true
118
+ this.isChange = false
119
+ this.row = null
120
+ this.$refs.list.$refs.paged.$refs.cri.search()
121
+ },
122
+ 'research' () {
123
+ console.log('重新查询')
124
+ this.isChange = false
125
+ this.row = null
126
+ },
127
+ 'refresh' () {
128
+ this.isChange = false
129
+ this.row = null
130
+ this.$refs.list.search()
131
+ },
132
+ 'error' (name, row, res) {
133
+ this.isChange = false
134
+ this.row = null
135
+ },
136
+ 'close' () {
137
+ this.isChange = false
138
+ this.row = null
139
+ // this.$refs.list.search()
140
+ },
141
+ 'add' (val) {
142
+ this.f_filialeids = val
143
+ this.infoadd=false
144
+ this.row = null
145
+ this.isChange = true
146
+ this.$refs.list.$refs.paged.$refs.grid.selectStore.selected = null
147
+ }
148
+ }
149
+ }
150
+ </script>
@@ -1,150 +1,154 @@
1
- <template>
2
- <v-select :options='resoptions' placeholder='请选择'
3
- :value.sync="selectres"
4
- :multiple="isMul"
5
- search="true"
6
- :close-on-select="!isMul"
7
- @change="resChange"
8
- >
9
- </v-select>
10
- </template>
11
- <script>
12
- import {HttpResetClass} from 'vue-client'
13
-
14
- export default {
15
- title: '资源选择',
16
- props: {
17
-
18
- //资源类型
19
- restype:'',
20
- //资源数据
21
- resObj:{},
22
- isMul: {
23
- type: Boolean,
24
- default: true
25
- },
26
- //资源初始化数据
27
- initresid: {
28
- type: Array,
29
- default() { return [] },
30
- },
31
- //父层id
32
- parentresid: {
33
- type: Array,
34
- default() { return [] },
35
- },
36
- },
37
- data () {
38
- return {
39
- //资源数据
40
- resObj:{},
41
- //资源数据列表
42
- resoptions:[],
43
- //选中资源数据
44
- selectres: [],
45
- }
46
- },
47
- ready () {
48
- //获取资源列表
49
- this.getResList()
50
- },
51
- methods:{
52
- //树形结构变成list
53
- findById(val) {
54
- if(val){
55
- if(this.checkidres(val)){
56
- this.treetoList(val,'')
57
- }else if(val.children.length>0){
58
- for (let value of val.children) {
59
- this.findById(value)
60
- }
61
- }
62
- }
63
- },
64
- //树形结构变成list
65
- treetoList(val,parentname) {
66
- for (let value of val.children) {
67
- this.ergodicList(value,parentname)
68
- }
69
- },
70
- //找到跟节点
71
- ergodicList (val,parentname) {
72
- if(val.children.length > 0 ){
73
- parentname=parentname+val.name
74
- this.treetoList(val,parentname)
75
- }else {
76
- //截取组织机构【组织机构】
77
- if(this.restype=='organization'){
78
- parentname=parentname.replace("组织机构","")
79
- this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
80
- }else{
81
- this.resoptions.push({label: val.name, value: val.id})
82
- }
83
- }
84
- },
85
- //检查id是否存在
86
- checkidres(val){
87
- let flag=false
88
- //如果没传值得话 不过滤
89
- if(this.parentresid.length==0&&this.restype=='organization'){
90
- flag=true
91
- }
92
- this.parentresid.forEach((item) => {
93
- if(item==val.id){
94
- flag=true
95
- }
96
- })
97
- return flag;
98
- },
99
- //资源改变
100
- resChange(val){
101
- let orgnames=[]
102
- Object.keys(this.resoptions).forEach((key) => {
103
- if(this.selectres.includes(this.resoptions[key].value))
104
- orgnames.push(this.resoptions[key].label)
105
- })
106
- console.log('资源改变。。', val, orgnames)
107
- this.$dispatch('res-select', this.selectres, orgnames)
108
- },
109
- //获取资源数据
110
- async getResList() {
111
-
112
- let http = new HttpResetClass()
113
-
114
- let req = await http.load('POST', '/rs/search', {data: {
115
- source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
116
- userid: this.$login.f.id
117
- }}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
118
- this.resObj=req.data[0]
119
- this.dealdata()
120
- },
121
- dealdata(){
122
- this.resoptions=[]
123
- this.findById(this.resObj);
124
- //赋值资源数据
125
- let arryselect=[]
126
- this.resoptions.forEach((item) => {
127
- if(this.initresid.length>0){
128
- this.initresid.forEach((init) => {
129
- if(item.value==init){
130
- arryselect.push(item.value)
131
- }
132
- })
133
- }
134
- })
135
- //赋值资源选中初始值
136
- this.selectres=arryselect
137
- }
138
- },
139
- watch: {
140
- //监听初始化资源id
141
- 'initresid.length'(){
142
- this.dealdata()
143
- },
144
- //监听初始化资源id
145
- 'parentresid'(){
146
- this.dealdata()
147
- },
148
- },
149
- }
150
- </script>
1
+ <template>
2
+ <v-select :options='resoptions' placeholder='请选择'
3
+ :value.sync="selectres"
4
+ :multiple="isMul"
5
+ :search="search"
6
+ :close-on-select="!isMul"
7
+ @change="resChange"
8
+ >
9
+ </v-select>
10
+ </template>
11
+ <script>
12
+ import {HttpResetClass} from 'vue-client'
13
+
14
+ export default {
15
+ title: '资源选择',
16
+ props: {
17
+
18
+ //资源类型
19
+ restype:'',
20
+ //资源数据
21
+ resObj:{},
22
+ isMul: {
23
+ type: Boolean,
24
+ default: true
25
+ },
26
+ search:{
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ //资源初始化数据
31
+ initresid: {
32
+ type: Array,
33
+ default() { return [] },
34
+ },
35
+ //父层id
36
+ parentresid: {
37
+ type: Array,
38
+ default() { return [] },
39
+ },
40
+ },
41
+ data () {
42
+ return {
43
+ //资源数据
44
+ resObj:{},
45
+ //资源数据列表
46
+ resoptions:[],
47
+ //选中资源数据
48
+ selectres: [],
49
+ }
50
+ },
51
+ ready () {
52
+ //获取资源列表
53
+ this.getResList()
54
+ },
55
+ methods:{
56
+ //树形结构变成list
57
+ findById(val) {
58
+ if(val){
59
+ if(this.checkidres(val)){
60
+ this.treetoList(val,'')
61
+ }else if(val.children.length>0){
62
+ for (let value of val.children) {
63
+ this.findById(value)
64
+ }
65
+ }
66
+ }
67
+ },
68
+ //树形结构变成list
69
+ treetoList(val,parentname) {
70
+ for (let value of val.children) {
71
+ this.ergodicList(value,parentname)
72
+ }
73
+ },
74
+ //找到跟节点
75
+ ergodicList (val,parentname) {
76
+ if(val.children.length > 0 ){
77
+ parentname=parentname+val.name
78
+ this.treetoList(val,parentname)
79
+ }else {
80
+ //截取组织机构【组织机构】
81
+ if(this.restype=='organization'){
82
+ parentname=parentname.replace("组织机构","")
83
+ this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
84
+ }else{
85
+ this.resoptions.push({label: val.name, value: val.id})
86
+ }
87
+ }
88
+ },
89
+ //检查id是否存在
90
+ checkidres(val){
91
+ let flag=false
92
+ //如果没传值得话 不过滤
93
+ if(this.parentresid.length==0&&this.restype=='organization'){
94
+ flag=true
95
+ }
96
+ this.parentresid.forEach((item) => {
97
+ if(item==val.id){
98
+ flag=true
99
+ }
100
+ })
101
+ return flag;
102
+ },
103
+ //资源改变
104
+ resChange(val){
105
+ let orgnames=[]
106
+ Object.keys(this.resoptions).forEach((key) => {
107
+ if(this.selectres.includes(this.resoptions[key].value))
108
+ orgnames.push(this.resoptions[key].label)
109
+ })
110
+ console.log('资源改变。。', val, orgnames)
111
+ this.$dispatch('res-select', this.selectres, orgnames)
112
+ },
113
+ //获取资源数据
114
+ async getResList() {
115
+
116
+ let http = new HttpResetClass()
117
+
118
+ let req = await http.load('POST', '/rs/search', {data: {
119
+ source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
120
+ userid: this.$login.f.id
121
+ }}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
122
+ this.resObj=req.data[0]
123
+ this.dealdata()
124
+ },
125
+ dealdata(){
126
+ this.resoptions=[]
127
+ this.findById(this.resObj);
128
+ //赋值资源数据
129
+ let arryselect=[]
130
+ this.resoptions.forEach((item) => {
131
+ if(this.initresid.length>0){
132
+ this.initresid.forEach((init) => {
133
+ if(item.value==init){
134
+ arryselect.push(item.value)
135
+ }
136
+ })
137
+ }
138
+ })
139
+ //赋值资源选中初始值
140
+ this.selectres=arryselect
141
+ }
142
+ },
143
+ watch: {
144
+ //监听初始化资源id
145
+ 'initresid.length'(){
146
+ this.dealdata()
147
+ },
148
+ //监听初始化资源id
149
+ 'parentresid'(){
150
+ this.dealdata()
151
+ },
152
+ },
153
+ }
154
+ </script>