manage-client 3.2.135 → 3.2.136

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,156 +1,156 @@
1
- import Vue from 'vue'
2
-
3
- let MagGetSaleParam = {
4
- install (Vue, options) {
5
- // 给vue增添对话框显示方法
6
- Vue.MagGetSaleParam = Vue.prototype.$MagGetSaleParam = MagGetSaleParam
7
- },
8
- gasbrands: [],
9
- prices: [],
10
- adjustables: [],
11
- inputtors : [],
12
- smallareas:[],
13
- async initinputtor(){
14
- let res = await Vue.resetpost('rs/sql/getAlluserRes', {data:{
15
- condition:" 1=1"
16
- }}, {resolveMsg: null, rejectMsg: '获取用户出错!!!'})
17
- if(res.data){
18
- MagGetSaleParam.inputtors = res.data;
19
- }
20
- },
21
- async getsmallarea(filiale){
22
- let smallareas=[]
23
- let condition=`f_small_area is not null and f_small_area <>'' group by f_small_area`
24
- if(filiale){
25
- condition=`f_filialeid='${filiale}' and f_small_area is not null and f_small_area <>'' group by f_small_area`
26
- }
27
- let res = await Vue.resetpost('rs/sql/manage_singleTable', {data:{
28
- items: 'f_small_area', tablename: 't_user_address', orderitem: 'f_small_area DESC',condition:condition
29
- }}, {resolveMsg: null, rejectMsg: '获取区域出错!!!'})
30
- if(res.data){
31
- res.data.forEach((item) => {
32
- var param={
33
- label:item.f_small_area,
34
- value:item.f_small_area
35
- }
36
- smallareas.push(param)
37
- })
38
- }
39
- return smallareas
40
- },
41
- getresinputtor(orgid){
42
- let inputtors = []
43
- if(MagGetSaleParam.inputtors.length>0){
44
- let arr = MagGetSaleParam.inputtors.filter((res) => {
45
- if(res.rolestr != null && res.rolestr!='' ){
46
- return res.rolestr.indexOf("抄表员")>-1 && res.f_orgid == orgid
47
- }
48
- })
49
-
50
- arr.forEach((res) => {
51
- inputtors.push({label: res.name, value: res.name})
52
- })
53
- }
54
- return inputtors;
55
- },
56
- // 开启卡监听
57
- organizeData (fromSystem) {
58
- if(Vue.android){
59
- console.log('接受System中返回的参数进行组织', fromSystem)
60
- fromSystem.gasbrands.forEach((item, index) => {
61
- MagGetSaleParam.gasbrands[index] = {}
62
- MagGetSaleParam.gasbrands[index].label = item.f_meter_brand
63
- let gasmodel = []
64
- item.gasmodel.forEach((item, index) => {
65
- gasmodel[index] = {}
66
- gasmodel[index].label = item.f_meter_style + item.f_type
67
- gasmodel[index].value = item
68
- })
69
- item.gasmodel = gasmodel
70
- MagGetSaleParam.gasbrands[index].value = item
71
- })
72
- fromSystem.adjustable.forEach((item, index) => {
73
- MagGetSaleParam.adjustables[index] = {}
74
- MagGetSaleParam.adjustables[index].label = item.f_adjustable_name
75
- MagGetSaleParam.adjustables[index].value = item
76
- })
77
- MagGetSaleParam.prices = [...MagGetSaleParam.prices, ...fromSystem.price]
78
- console.log('参数组织完毕', MagGetSaleParam)
79
- }
80
- },
81
- getAdjustable (val) {
82
- // 数组去重
83
- let arr = []
84
- console.log("调压箱调压箱调压箱调压箱调压箱调压箱调压箱调压箱调压箱")
85
- console.log(Vue.$appdata.saleParams)
86
- console.log(MagGetSaleParam.adjustables)
87
- if (val) {
88
- MagGetSaleParam.adjustables.forEach((item, next) => {
89
- if (item.value.f_orgid === val) {
90
- arr.push(item)
91
- }
92
- })
93
- } else {
94
- MagGetSaleParam.adjustables.forEach((item, next) => {
95
- arr.push(item)
96
- })
97
- }
98
- let hash = {}
99
- let result = arr.reduce((item, next) => {
100
- hash[next.label] ? '' : hash[next.label] = true && item.push(next)
101
- return item
102
- }, [])
103
- return Array.from(new Set(result))
104
- },
105
- getGasbrand () {
106
- if (MagGetSaleParam.gasbrands.length === 0) {
107
- MagGetSaleParam.organizeData(Vue.$appdata.saleParams)
108
- }
109
- return MagGetSaleParam.gasbrands
110
- },
111
- getPrices() {
112
- return MagGetSaleParam.prices
113
- },
114
- getPrice (object) {
115
- if (MagGetSaleParam.prices.length === 0) {
116
- MagGetSaleParam.organizeData(Vue.$appdata.saleParams)
117
- }
118
- let result = []
119
- console.log('获取价格。。。', MagGetSaleParam.prices)
120
- if (object){
121
- // 做筛选
122
- MagGetSaleParam.prices.forEach((item) => {
123
- if (item.f_state === '有效' &&
124
- item.f_price_type === object.f_price_type &&
125
- item.f_filialeid === object.filter) {
126
- let value = {
127
- label: item.f_price_name,
128
- value: item
129
- }
130
- result.push(value)
131
- }
132
- })
133
- }else{
134
- // 做筛选
135
- MagGetSaleParam.prices.forEach((item) => {
136
- if (item.f_state === '有效' &&
137
- item.f_price_type === object.f_price_type) {
138
- let value = {
139
- label: item.f_price_name,
140
- value: item
141
- }
142
- result.push(value)
143
- }
144
- })
145
- }
146
- // 数组去重
147
- let hash = {}
148
- result = result.reduce((item, next) => {
149
- hash[next.label] ? '' : hash[next.label] = true && item.push(next)
150
- return item
151
- }, [])
152
- return Array.from(new Set(result))
153
- }
154
- }
155
-
156
- export default MagGetSaleParam
1
+ import Vue from 'vue'
2
+
3
+ let MagGetSaleParam = {
4
+ install (Vue, options) {
5
+ // 给vue增添对话框显示方法
6
+ Vue.MagGetSaleParam = Vue.prototype.$MagGetSaleParam = MagGetSaleParam
7
+ },
8
+ gasbrands: [],
9
+ prices: [],
10
+ adjustables: [],
11
+ inputtors : [],
12
+ smallareas:[],
13
+ async initinputtor(){
14
+ let res = await Vue.resetpost('rs/sql/getAlluserRes', {data:{
15
+ condition:" 1=1"
16
+ }}, {resolveMsg: null, rejectMsg: '获取用户出错!!!'})
17
+ if(res.data){
18
+ MagGetSaleParam.inputtors = res.data;
19
+ }
20
+ },
21
+ async getsmallarea(filiale){
22
+ let smallareas=[]
23
+ let condition=`f_small_area is not null and f_small_area <>'' group by f_small_area`
24
+ if(filiale){
25
+ condition=`f_filialeid='${filiale}' and f_small_area is not null and f_small_area <>'' group by f_small_area`
26
+ }
27
+ let res = await Vue.resetpost('rs/sql/manage_singleTable', {data:{
28
+ items: 'f_small_area', tablename: 't_user_address', orderitem: 'f_small_area DESC',condition:condition
29
+ }}, {resolveMsg: null, rejectMsg: '获取区域出错!!!'})
30
+ if(res.data){
31
+ res.data.forEach((item) => {
32
+ var param={
33
+ label:item.f_small_area,
34
+ value:item.f_small_area
35
+ }
36
+ smallareas.push(param)
37
+ })
38
+ }
39
+ return smallareas
40
+ },
41
+ getresinputtor(orgid){
42
+ let inputtors = []
43
+ if(MagGetSaleParam.inputtors.length>0){
44
+ let arr = MagGetSaleParam.inputtors.filter((res) => {
45
+ if(res.rolestr != null && res.rolestr!='' ){
46
+ return res.rolestr.indexOf("抄表员")>-1 && res.f_orgid == orgid
47
+ }
48
+ })
49
+
50
+ arr.forEach((res) => {
51
+ inputtors.push({label: res.name, value: res.name})
52
+ })
53
+ }
54
+ return inputtors;
55
+ },
56
+ // 开启卡监听
57
+ organizeData (fromSystem) {
58
+ if(Vue.android){
59
+ console.log('接受System中返回的参数进行组织', fromSystem)
60
+ fromSystem.gasbrands.forEach((item, index) => {
61
+ MagGetSaleParam.gasbrands[index] = {}
62
+ MagGetSaleParam.gasbrands[index].label = item.f_meter_brand
63
+ let gasmodel = []
64
+ item.gasmodel.forEach((item, index) => {
65
+ gasmodel[index] = {}
66
+ gasmodel[index].label = item.f_meter_style + item.f_type
67
+ gasmodel[index].value = item
68
+ })
69
+ item.gasmodel = gasmodel
70
+ MagGetSaleParam.gasbrands[index].value = item
71
+ })
72
+ fromSystem.adjustable.forEach((item, index) => {
73
+ MagGetSaleParam.adjustables[index] = {}
74
+ MagGetSaleParam.adjustables[index].label = item.f_adjustable_name
75
+ MagGetSaleParam.adjustables[index].value = item
76
+ })
77
+ MagGetSaleParam.prices = [...MagGetSaleParam.prices, ...fromSystem.price]
78
+ console.log('参数组织完毕', MagGetSaleParam)
79
+ }
80
+ },
81
+ getAdjustable (val) {
82
+ // 数组去重
83
+ let arr = []
84
+ console.log("调压箱调压箱调压箱调压箱调压箱调压箱调压箱调压箱调压箱")
85
+ console.log(Vue.$appdata.saleParams)
86
+ console.log(MagGetSaleParam.adjustables)
87
+ if (val) {
88
+ MagGetSaleParam.adjustables.forEach((item, next) => {
89
+ if (item.value.f_orgid === val) {
90
+ arr.push(item)
91
+ }
92
+ })
93
+ } else {
94
+ MagGetSaleParam.adjustables.forEach((item, next) => {
95
+ arr.push(item)
96
+ })
97
+ }
98
+ let hash = {}
99
+ let result = arr.reduce((item, next) => {
100
+ hash[next.label] ? '' : hash[next.label] = true && item.push(next)
101
+ return item
102
+ }, [])
103
+ return Array.from(new Set(result))
104
+ },
105
+ getGasbrand () {
106
+ if (MagGetSaleParam.gasbrands.length === 0) {
107
+ MagGetSaleParam.organizeData(Vue.$appdata.saleParams)
108
+ }
109
+ return MagGetSaleParam.gasbrands
110
+ },
111
+ getPrices() {
112
+ return MagGetSaleParam.prices
113
+ },
114
+ getPrice (object) {
115
+ if (MagGetSaleParam.prices.length === 0) {
116
+ MagGetSaleParam.organizeData(Vue.$appdata.saleParams)
117
+ }
118
+ let result = []
119
+ console.log('获取价格。。。', MagGetSaleParam.prices)
120
+ if (object){
121
+ // 做筛选
122
+ MagGetSaleParam.prices.forEach((item) => {
123
+ if (item.f_state === '有效' &&
124
+ item.f_price_type === object.f_price_type &&
125
+ item.f_filialeid === object.filter) {
126
+ let value = {
127
+ label: item.f_price_name,
128
+ value: item
129
+ }
130
+ result.push(value)
131
+ }
132
+ })
133
+ }else{
134
+ // 做筛选
135
+ MagGetSaleParam.prices.forEach((item) => {
136
+ if (item.f_state === '有效' &&
137
+ item.f_price_type === object.f_price_type) {
138
+ let value = {
139
+ label: item.f_price_name,
140
+ value: item
141
+ }
142
+ result.push(value)
143
+ }
144
+ })
145
+ }
146
+ // 数组去重
147
+ let hash = {}
148
+ result = result.reduce((item, next) => {
149
+ hash[next.label] ? '' : hash[next.label] = true && item.push(next)
150
+ return item
151
+ }, [])
152
+ return Array.from(new Set(result))
153
+ }
154
+ }
155
+
156
+ export default MagGetSaleParam
@@ -1,63 +1,63 @@
1
- import Vue from 'vue'
2
- import {HttpResetClass} from 'vue-client'
3
- import GetSaleParam from './MagGetSaleParams'
4
-
5
- let loadParamGen = async function (f_filialeid) {
6
-
7
- let http = new HttpResetClass()
8
-
9
- if (GetSaleParam.gasbrands.length === 0 && GetSaleParam.prices.length === 0 && GetSaleParam.adjustables.length === 0 ) {
10
- let getParams = await http.load('POST','rs/logic/getSaleInitData', {data: {f_orgid: f_filialeid?f_filialeid: Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
11
- if (getParams.data) {
12
- MagLoadParams.organizeData(getParams.data)
13
- }
14
- } else {
15
- GetSaleParam.gasbrands = []
16
- GetSaleParam.prices = []
17
- GetSaleParam.adjustables = []
18
- let getParams = await http.load('POST','rs/logic/getSaleInitData', {data: {f_orgid: f_filialeid ? f_filialeid : Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
19
- if (getParams.data) {
20
- MagLoadParams.organizeData(getParams.data)
21
- }
22
- }
23
- }
24
-
25
- let MagLoadParams = {
26
-
27
- install (Vue, options) {
28
- // 给vue增添对话框显示方法
29
- Vue.MagLoadParams = Vue.prototype.$MagLoadParams = MagLoadParams
30
- },
31
-
32
- async loadParam (f_filialeid) {
33
- await loadParamGen(f_filialeid)
34
- },
35
-
36
- // 开启卡监听
37
- organizeData (fromSystem) {
38
- fromSystem.gasbrands.forEach((item, index) => {
39
- GetSaleParam.gasbrands[index] = {}
40
- GetSaleParam.gasbrands[index].label = item.f_meter_brand
41
- let gasmodel = []
42
- item.gasmodel.forEach((item, index) => {
43
- gasmodel[index] = {}
44
- gasmodel[index].label = item.f_meter_style + item.f_type
45
- gasmodel[index].value = item
46
- })
47
- item.gasmodel = gasmodel
48
- GetSaleParam.gasbrands[index].value = item
49
- })
50
-
51
- fromSystem.adjustable.forEach((item, index) => {
52
- GetSaleParam.adjustables[index] = {}
53
- GetSaleParam.adjustables[index].label = item.f_adjustable_name
54
- GetSaleParam.adjustables[index].value = item
55
- })
56
- GetSaleParam.prices = [...GetSaleParam.prices, ...fromSystem.price]
57
- console.log('参数组织完毕', GetSaleParam)
58
- },
59
-
60
-
61
- }
62
-
63
- export default MagLoadParams
1
+ import Vue from 'vue'
2
+ import {HttpResetClass} from 'vue-client'
3
+ import GetSaleParam from './MagGetSaleParams'
4
+
5
+ let loadParamGen = async function (f_filialeid) {
6
+
7
+ let http = new HttpResetClass()
8
+
9
+ if (GetSaleParam.gasbrands.length === 0 && GetSaleParam.prices.length === 0 && GetSaleParam.adjustables.length === 0 ) {
10
+ let getParams = await http.load('POST','rs/logic/getSaleInitData', {data: {f_orgid: f_filialeid?f_filialeid: Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
11
+ if (getParams.data) {
12
+ MagLoadParams.organizeData(getParams.data)
13
+ }
14
+ } else {
15
+ GetSaleParam.gasbrands = []
16
+ GetSaleParam.prices = []
17
+ GetSaleParam.adjustables = []
18
+ let getParams = await http.load('POST','rs/logic/getSaleInitData', {data: {f_orgid: f_filialeid ? f_filialeid : Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
19
+ if (getParams.data) {
20
+ MagLoadParams.organizeData(getParams.data)
21
+ }
22
+ }
23
+ }
24
+
25
+ let MagLoadParams = {
26
+
27
+ install (Vue, options) {
28
+ // 给vue增添对话框显示方法
29
+ Vue.MagLoadParams = Vue.prototype.$MagLoadParams = MagLoadParams
30
+ },
31
+
32
+ async loadParam (f_filialeid) {
33
+ await loadParamGen(f_filialeid)
34
+ },
35
+
36
+ // 开启卡监听
37
+ organizeData (fromSystem) {
38
+ fromSystem.gasbrands.forEach((item, index) => {
39
+ GetSaleParam.gasbrands[index] = {}
40
+ GetSaleParam.gasbrands[index].label = item.f_meter_brand
41
+ let gasmodel = []
42
+ item.gasmodel.forEach((item, index) => {
43
+ gasmodel[index] = {}
44
+ gasmodel[index].label = item.f_meter_style + item.f_type
45
+ gasmodel[index].value = item
46
+ })
47
+ item.gasmodel = gasmodel
48
+ GetSaleParam.gasbrands[index].value = item
49
+ })
50
+
51
+ fromSystem.adjustable.forEach((item, index) => {
52
+ GetSaleParam.adjustables[index] = {}
53
+ GetSaleParam.adjustables[index].label = item.f_adjustable_name
54
+ GetSaleParam.adjustables[index].value = item
55
+ })
56
+ GetSaleParam.prices = [...GetSaleParam.prices, ...fromSystem.price]
57
+ console.log('参数组织完毕', GetSaleParam)
58
+ },
59
+
60
+
61
+ }
62
+
63
+ export default MagLoadParams
File without changes