197 lines
5.8 KiB
JavaScript
197 lines
5.8 KiB
JavaScript
import {
|
|
reqBillDetailList, reqContractList, reqDeviceAnalysis,
|
|
reqDeviceBillList, reqDeviceExpire, reqGetMachineRoom, reqGetSearchHeader,
|
|
reqProductList,
|
|
reqSaveDeviceData,
|
|
reqSearchDeviceApi, reqStoreNames
|
|
} from "@/api/operation/device";
|
|
|
|
const state = {
|
|
//设备列表页展示的数据存储
|
|
deviceList: [],
|
|
//table中勾选的所有对象组成的数组
|
|
deviceBuyCheckList: [],
|
|
productList: [],//存储产品列表
|
|
deviceBillList: [],//存储订单列表
|
|
deviceBillDetailList: [], //存储订单详情列表
|
|
deviceContractList: [],//存储合同列表
|
|
deviceRoomData: {},//存储机房设备信息
|
|
simpleRoomData: {},//单个设备信息
|
|
deviceExpireList: {},//设备快到期列表
|
|
storeNameList: {},//获取所有仓库名字列表
|
|
setContractState: false,//设置合同页面是否弹框的状态
|
|
stroeTimeArr: [],//存储开始结束时间
|
|
machineRoomList: {},//存储机房列表数据
|
|
buyBtnAble: false,//购买按钮
|
|
searchHeaderObj: {},//存储下拉搜索内容
|
|
limitTime: {},//购买时的时间限制存储的对象
|
|
pagintionIndex:1,//添加设备列表的分页器当前索引
|
|
MachineRoomNameGrid:''
|
|
}
|
|
const mutations = {
|
|
//存储分析当前机房查询名称
|
|
setMachineRoomNameGrid(state,MachineRoomNameGrid){
|
|
state.MachineRoomNameGrid=MachineRoomNameGrid
|
|
},
|
|
//分析当前机房查询名称置空
|
|
setMachineRoomNameGridFull(state,MachineRoomNameGrid){
|
|
state.MachineRoomNameGrid=''
|
|
},
|
|
setPagintionIndex(state,pagintionIndex){
|
|
state.pagintionIndex=pagintionIndex
|
|
}
|
|
,
|
|
//购买时的时间限制存储的对象
|
|
setLimitTime(state, limitTime) {
|
|
state.limitTime = limitTime
|
|
},
|
|
setBuyBtnAble(state, buyBtnAble) {
|
|
state.buyBtnAble = buyBtnAble
|
|
},
|
|
setStoreTimArr(state, stroeTimeArr) {
|
|
state.stroeTimeArr = stroeTimeArr
|
|
},
|
|
SETCONTRACTSTATE(state, setContractState) {
|
|
state.setContractState = setContractState
|
|
},
|
|
//设备列表页展示的数据存储
|
|
GETSEARCHDEVICELIST(state, deviceList) {
|
|
state.deviceList = deviceList
|
|
},
|
|
//将table中勾选的所有对象组成的数组置空
|
|
SETDEVICEBUYCHECKLISTFULL(state) {
|
|
state.deviceBuyCheckList = []
|
|
},
|
|
////将table中勾选的所有对象组成的数组赋值
|
|
SETDEVICEBUYCHECKLIST(state, deviceBuyCheckList) {
|
|
state.deviceBuyCheckList = deviceBuyCheckList
|
|
},
|
|
//存储产品列表
|
|
GETPRODUCTLIST(state, productList) {
|
|
state.productList = productList
|
|
},
|
|
//存储订单列表
|
|
GETDEVICEBILLLIST(state, deviceBillList) {
|
|
state.deviceBillList = deviceBillList
|
|
},
|
|
//存储订单详情列表
|
|
GETDEVICEDETAILLIST(state, deviceBillDetailList) {
|
|
state.deviceBillDetailList = deviceBillDetailList
|
|
},
|
|
//存储合同列表
|
|
GETDEVICECONTRACT(state, deviceContractList) {
|
|
state.deviceContractList = deviceContractList
|
|
},
|
|
//存储全部机房信息数据
|
|
GETDEVICEANALYSIS(state, deviceRoomData) {
|
|
state.deviceRoomData = deviceRoomData
|
|
},
|
|
//存储单个机房信息数据
|
|
GETSIMPLEDEVICEROOMDATA(state, simpleRoomData) {
|
|
state.simpleRoomData = simpleRoomData
|
|
},
|
|
//存储将要到期的设备类型和时间
|
|
GETDEVICEEXPIRELIST(state, deviceExpireList) {
|
|
state.deviceExpireList = deviceExpireList
|
|
},
|
|
//存储所有仓库名字列表
|
|
GETSTORENAMELIST(state, storeNameList) {
|
|
state.storeNameList = storeNameList
|
|
},
|
|
//存储全部机房列表
|
|
GETMACHINEROOMLIST(state, machineRoomList) {
|
|
state.machineRoomList = machineRoomList
|
|
},
|
|
//存储需搜索得下拉信息
|
|
GETSEARCHHEADERLIST(state, searchHeaderObj) {
|
|
state.searchHeaderObj = searchHeaderObj
|
|
}
|
|
}
|
|
|
|
|
|
const actions = {
|
|
//保存设备信息
|
|
async getSaveDeviceData({commit}, data) {
|
|
await reqSaveDeviceData(data)
|
|
},
|
|
//搜索设备信息
|
|
async getSearchDeviceList({commit}, data) {
|
|
let result = await reqSearchDeviceApi(data)
|
|
if (result.status) {
|
|
commit('GETSEARCHDEVICELIST', result.data)
|
|
}
|
|
},
|
|
//获取产品列表
|
|
async getProductList({commit}) {
|
|
let result = await reqProductList()
|
|
commit('GETPRODUCTLIST', result.data)
|
|
},
|
|
//存储设备订单信息
|
|
async getDeviceBillList({commit}, data) {
|
|
let result = await reqDeviceBillList(data)
|
|
if (result.status){
|
|
console.log("获取信息成功!",result.data)
|
|
commit('GETDEVICEBILLLIST', result.data)
|
|
}
|
|
|
|
},
|
|
//存储订单详情列表
|
|
async getDeviceBillDetailList({commit}, data) {
|
|
let result = await reqBillDetailList(data)
|
|
if (result.status) {
|
|
commit('GETDEVICEDETAILLIST', result.data)
|
|
// this.$message.success('请求成功!')
|
|
} else {
|
|
// this.$message.error('请求失败!')
|
|
}
|
|
},
|
|
//获取合同列表
|
|
async getDeviceContract({commit}, data) {
|
|
let result = await reqContractList(data)
|
|
if (result.status) {
|
|
commit('GETDEVICECONTRACT', result.data)
|
|
}
|
|
},
|
|
//获取设备机房
|
|
async getDeviceAnalysis({commit}, data) {
|
|
let result = await reqDeviceAnalysis(data)
|
|
commit('GETDEVICEANALYSIS', result.data)
|
|
},
|
|
//获取设备类型到期时间
|
|
async getDeviceExpireList({commit}) {
|
|
let result = await reqDeviceExpire()
|
|
if (result.status) {
|
|
commit('GETDEVICEEXPIRELIST', result.data)
|
|
}
|
|
},
|
|
//获取所有仓库名字列表
|
|
async getStoreNameList({commit}, data) {
|
|
let result = await reqStoreNames(data)
|
|
if (result.status) {
|
|
commit('GETSTORENAMELIST', result.data)
|
|
}
|
|
},
|
|
//获取机房列表
|
|
async getMachineRoomList({commit}, data) {
|
|
let result = await reqGetMachineRoom(data)
|
|
if (result.status) {
|
|
commit('GETMACHINEROOMLIST', result)
|
|
}
|
|
},
|
|
//获取search头下拉列表
|
|
async getSearchHeaderList({commit}, data) {
|
|
let result = await reqGetSearchHeader(data)
|
|
if (result.status) {
|
|
commit('GETSEARCHHEADERLIST', result)
|
|
}
|
|
}
|
|
}
|
|
const getters = {}
|
|
|
|
export default {
|
|
state,
|
|
mutations,
|
|
actions,
|
|
getters
|
|
}
|