system-phone
Version:
手机模块 前端组件
64 lines (58 loc) • 2.1 kB
JavaScript
import Vue from 'vue'
import {HttpResetClass} from 'vue-client'
let GetAppDataService = {
install(Vue, options) {
// 给vue增添对话框显示方法
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
},
// 开启卡监听
async load () {
let result = await new HttpResetClass().load('POST',`${Vue.androidUtil.getProxyUrl()}/rs/logic/getInitData`, {data: {f_filialeids: Vue.user.orgid}}, {resolveMsg: null, rejectMsg: null})
console.log('system加载参数')
console.log(JSON.stringify(result))
result.data.singleValues.forEach((item) => {
this.singleValues[item.name] = item.value
})
result.data.params.forEach((item) => {
let value = []
item.f_paramvalues.forEach((item, index) => {
value[index] = {}
value[index].label = item.name
value[index].value = item.name
})
this.params[item.name] = value
})
let getParams = await new HttpResetClass().load('post',`${Vue.androidUtil.getProxyUrl()}/rs/logic/getSaleInitData`, {data: {f_orgid: Vue.user.orgid}}, {resolveMsg: null, rejectMsg: null})
console.log('获取营收参数')
console.log(JSON.stringify(getParams))
if (getParams.data) {
getParams.data.gasbrands.forEach((item, index) => {
this.saleParams.gasbrands[index] = {}
this.saleParams.gasbrands[index].label = item.f_meter_brand
this.saleParams.gasbrands[index].value = item.f_meter_brand
let gasmodel = []
item.gasmodel.forEach((item, index) => {
gasmodel[index] = {}
gasmodel[index].label = item.f_meter_style
gasmodel[index].value = item.f_meter_style
})
this.params[item.f_meter_brand] = gasmodel
})
}
},
params: {},
singleValues: {},
// 营收模块参数
saleParams: {
gasbrands:[]
},
// 安检模块参数
safeCheckParams: {},
getParam(key) {
return this.params[key]
},
getSingleValue(key) {
return this.singleValues[key]
}
}
export default GetAppDataService