const state = {
	// 公共
	allUnit: [], // 单位 - reqesut url - SysConfig/GetUnitAllProperty
	recondtion: [], // 收款条件 - request url - SysConfig/GetReccondition
	settletype: [], // 结算方式 - request url - SysConfig/GetSettletype
	dcurrency: [], // 本位币 - request url - SysConfig/GetDcurrency
	rateType: [], // 固定汇率 - request url - SysConfig/GetRateType
	taxRate: [], // 税率 - request url - SysConfig/GetTaxRate
	customer: [], // 客户 - request url - SysConfig/GetCustomer
	paymentTerm: [], // 付款条件 - request url - SysConfig/GetPaymentTerm
	supplierSelect: [], // 供应商 - request url - SysConfig/supplier/select
	warehouseAll: [], // 仓库 - request url - SysConfig/GetWarehouse
	deptAll: [], //所有部门
	examineStatus: {}, //审批状态
	staffAllList: [], //审批流人员接口
	// 销售订单
	enumType: {}, // 枚举 单据类型、状态 - request url - SalOrder/GetEnum
	dicSale: [], // 销售 自定义条件 - request url - Dictionary/sale
	// 销售退货
	statusType: {}, // 枚举 订单状态、退货类型 - request url - ReturnStockOrder/GetStatus
	dicRetrunOrder: [], // 销售退货 自定义条件 request url - Dictionary/RetrunOrder
	// 采购订单
	statusGetType: {}, // 枚举 订单状态、类型、关闭状态、是否211、是否赠品、供应链、数据来源 - request url - Purchase/status/get
	purOrderStatus: {}, // 私有 - request url - Purchase/status/get
	dicPurOrder: [], // 采购 自定义 - request url - Dictionary/purchase
	// 组织间
	dicOrgani: [], // 组织间 自定义 - request url - Dictionary/organization
	// 采购入库单
	inStockType: {}, // 枚举 单据类型、单据状态 - request url - PurchaseInstock/status/get
	dicPurInstock: [], // 采购入库 自定义 - request url - Dictionary/purchaseinstock
	// 采购退料单
	returnMatType: {}, // 枚举 单据类型、单据状态、退料方式、补料方式 - request url - PurchaseReturnMaterial/status/get
	dicPurReturn: [], // 退料 自定义 - request url - Dictionary/purchaserm
	// 生产委外
	infoStatus: {}, //生产基础信息数据
	infoStatusww: {}, // 委外基础信息数据
	infoStatusck: {}, // 销售出库基础信息数据
	infoNoticeStatus: {}, // 通知基础信息数据
	infockStatus: {}, // 出库基础信息数据
	customerlist: [], // 客户数据
	// 分步式调出单
	stktranStatus: {}, // 枚举 单据状态、调拨类型、订单类型 request url - StktransferOut/GetStatus
	dicStktrOut: [], // 调出 自定义 - request url - Dictionary/stktransferout
	// 分步式调入单
	stktransInst: {}, // 枚举 单据状态、调拨类型、订单类型 request url - StktransferInst/GetStatus
	dicStktrInst: [], // 调入 自定义 - request url - Dictionary/stktransferinst
	// 直接调拨单
	stkdirecttrStatus: {}, // 枚举 单据状态、调拨类型、订单类型 request url - Stkdirecttransfers/GetStatus
	dicStkdirFers: [], // 直接调拨 自定义 request url -Dictionary/stkdirecttransfers
	// BOM - 物料清单
	bomMaterilasObj: {}, // 枚举 数据状态、发料方式、物料承担方 request url - Materials/GetStatus
	// 列表 - 公共状态
	listGetStatus: {}, // 列表 公共状态 request url - SysConfig/GetStatus
	userlistall: [], // 获取用户表集合，有用到，领料人，跟单员，销售员，仓管员的
	getAllUserList: [], // 公共人员接口 request url - SysConfig/GetUserList
	lock: true,
};

const getters = {};

const mutations = {
	// lock
	SET_LOCK: (state, lock) => {
		state.lock = lock;
	},
	// 单位
	SET_ALL_UNIT: (state, allUnit) => {
		state.allUnit = allUnit;
	},
	DELETE_UNIT: (state) => {
		state.allUnit = [];
	},
	// 收款条件
	SET_RECONDTION: (state, recondtion) => {
		state.recondtion = recondtion;
	},
	DELETE_RECONDTION: (state) => {
		state.recondtion = [];
	},
	// 结算方式
	SET_SETTLETYPE: (state, settletype) => {
		state.settletype = settletype;
	},
	DELETE_SETTLETYPE: (state) => {
		state.settletype = [];
	},

	// 本位币
	SET_DCURRENCY: (state, dcurrency) => {
		state.dcurrency = dcurrency;
	},
	DELETE_DCURRENCY: (state) => {
		state.dcurrency = [];
	},
	// 固定汇率
	SET_RATETYPE: (state, rateType) => {
		state.rateType = rateType;
	},
	DELETE_RATETYPE: (state) => {
		state.rateType = [];
	},
	// 税率
	SET_TAXRATE: (state, taxRate) => {
		state.taxRate = taxRate;
	},
	DELETE_TAXRATE: (state) => {
		state.taxRate = [];
	},
	// 客户
	SET_CUSTOMER: (state, customer) => {
		state.customer = customer;
	},
	DELETE_CUSTOMER: (state) => {
		state.customer = [];
	},
	// 付款条件
	SET_PAYMENTTERM: (state, paymentTerm) => {
		state.paymentTerm = paymentTerm;
	},
	DELETE_PAYMENTTERM: (state) => {
		state.paymentTerm = [];
	},
	// //审批流人员 staffAllList
	// SET_STAFFALLLIST: (state, data) => {
	// 	state.staffAllList = data || [];
	// },
	// DELETE_SET_STAFFALLLIST: (state) => {
	// 	state.staffAllList = [];
	// },
	//所有部门
	// SET_DEPTALL: (state, detpAllData) => {
	// 	state.deptAll = detpAllData || [];
	// },
	// DELETE_SET_DEPTALL: (state) => {
	// 	state.deptAll = [];
	// },
	// //审批状态
	// SET_EXAMINE: (state, data) => {
	// 	state.examineStatus = data || {};
	// },
	// DELETE_SET_EXAMINE: (state) => {
	// 	state.examineStatus = {};
	// },
	// 供应商
	SET_SUPPLIERSELECT: (state, supplierSelect) => {
		state.supplierSelect = supplierSelect;
	},
	DELETE_SUPPLIERSELECT: (state) => {
		state.supplierSelect = [];
	},
	// 销售订单
	SET_ENUMTYPE: (state, enumType) => {
		state.enumType = enumType;
	},
	DELETE_ENUMTYPE: (state) => {
		state.enumType = {};
	},
	SET_DICSALE: (state, dicSale) => {
		state.dicSale = dicSale;
	},
	DELETE_DICSALE: (state) => {
		state.dicSale = [];
	},
	// 销售退货
	SET_STATUSTYPE: (state, statusType) => {
		state.statusType = statusType;
	},
	DELETE_STATUSTYPE: (state) => {
		state.statusType = {};
	},
	SET_DICRETRUNORDER: (state, dicRetrunOrder) => {
		state.dicRetrunOrder = dicRetrunOrder;
	},
	DELETE_DICRETRUNORDER: (state) => {
		state.dicRetrunOrder = [];
	},
	// 采购订单
	SET_STATUSGETTYPE: (state, statusGetType) => {
		state.statusGetType = statusGetType;
	},
	DELETE_STATUSGETTYPE: (state) => {
		state.statusGetType = {};
	},
	SET_PURORDERSTATUS: (state, purOrderStatus) => {
		state.purOrderStatus = purOrderStatus;
	},
	DELETE_PURORDERSTATUS: (state) => {
		state.purOrderStatus = {};
	},
	SET_DICPURORDER: (state, dicPurOrder) => {
		state.dicPurOrder = dicPurOrder;
	},
	DELETE_DICPURORDER: (state) => {
		state.dicPurOrder = [];
	},
	// 组织间 - 自定义
	SET_DICORGANI: (state, dicOrgani) => {
		state.dicOrgani = dicOrgani;
	},
	DELETE_DICORGANI: (state) => {
		state.dicOrgani = [];
	},
	// 采购入库
	SET_INSTOCKTYPE: (state, inStockType) => {
		state.inStockType = inStockType;
	},
	DELETE_INSTOCKTYPE: (state) => {
		state.inStockType = {};
	},
	SET_DICPURINSTOCK: (state, dicPurInstock) => {
		state.dicPurInstock = dicPurInstock;
	},
	DELETE_DICPURINSTOCK: (state) => {
		state.dicPurInstock = [];
	},
	// 采购退料
	SET_RETURNMATTYPE: (state, returnMatType) => {
		state.returnMatType = returnMatType;
	},
	DELETE_RETURNMATTYPE: (state) => {
		state.returnMatType = {};
	},
	SET_DICPURRETURN: (state, dicPurReturn) => {
		state.dicPurReturn = dicPurReturn;
	},
	DELETE_DICPURRETURN: (state) => {
		state.dicPurReturn = [];
	},
	// 分步式调出
	SET_STKTRANSTATUS: (state, stktranStatus) => {
		state.stktranStatus = stktranStatus;
	},
	DELETE_STKTRANSTATUS: (state) => {
		state.stktranStatus = {};
	},
	SET_DICSTKTROUT: (state, dicStktrOut) => {
		state.dicStktrOut = dicStktrOut;
	},
	DELETE_DICSTKTROUT: (state) => {
		state.dicStktrOut = [];
	},
	// 分步式调入
	SET_STKTRANSINST: (state, stktransInst) => {
		state.stktransInst = stktransInst;
	},
	DELETE_STKTRANSINST: (state) => {
		state.stktransInst = {};
	},
	SET_DICSTKTRINST: (state, dicStktrInst) => {
		state.dicStktrInst = dicStktrInst;
	},
	DELETE_DICSTKTRINST: (state) => {
		state.dicStktrInst = [];
	},
	// 直接调拨单
	SET_STKDIRECTTRSTATUS: (state, stkdirecttrStatus) => {
		state.stkdirecttrStatus = stkdirecttrStatus;
	},
	DELETE_STKDIRECTTRSTATUS: (state) => {
		state.stkdirecttrStatus = {};
	},
	SET_DICSTKDIRFERS: (state, dicStkdirFers) => {
		state.dicStkdirFers = dicStkdirFers;
	},
	DELETE_DICSTKDIRFERS: (state) => {
		state.dicStkdirFers = [];
	},
	// 仓库
	SET_WAREHOUSEALL: (state, warehouseAll) => {
		state.warehouseAll = warehouseAll;
	},
	DELETE_WAREHOUSEALL: (state) => {
		state.warehouseAll = [];
	},
	// BOM清单
	SET_BOMMATERILASOBJ: (state, bomMaterilasObj) => {
		state.bomMaterilasObj = bomMaterilasObj;
	},
	DELETE_BOMMATERILASOBJ: (state) => {
		state.bomMaterilasObj = {};
	},
	// 列表 公共状态
	SET_LISTGETSTATUS: (state, listGetStatus) => {
		state.listGetStatus = listGetStatus;
	},
	DELETE_LISTGETSTATUS: (state) => {
		state.listGetStatus = {};
	},
	// 公共人员
	SET_GETALLUSERLIST: (state, getAllUserList) => {
		state.getAllUserList = getAllUserList;
	},
	DELETE_GETALLUSERLIST: (state) => {
		state.getAllUserList = [];
	},
};

const actions = {
	// //所有部门
	// setDeptAll(context, detpAllData) {
	// 	context.commit('SET_DEPTALL', detpAllData);
	// },
	// deleteAll(context) {
	// 	context.commit('DELETE_SET_DEPTALL');
	// },

	// //审批流人员
	// setStaffAllList(context, data) {
	// 	context.commit('SET_STAFFALLLIST', data);
	// },
	// deleteStaffAllList(context) {
	// 	context.commit('DELETE_SET_STAFFALLLIST');
	// },

	// //审批状态
	// setExamine(context, data) {
	// 	console.log('调用了吗？');
	// 	context.commit('SET_EXAMINE', data);
	// },
	// deleteExamine(context) {
	// 	context.commit('DELETE_SET_EXAMINE');
	// },
	// 单位
	setAllUnit(context, allUnit) {
		context.commit('SET_ALL_UNIT', allUnit);
	},
	deleteUnit(context) {
		context.commit('DELETE_UNIT');
	},

	// 收款条件
	setRecondtion(context, recondtion) {
		context.commit('SET_RECONDTION', recondtion);
	},
	deleteRecondtion(context) {
		context.commit('DELETE_RECONDTION');
	},
	// 结算方式
	setSettletype(context, settletype) {
		context.commit('SET_SETTLETYPE', settletype);
	},
	deleteSettletype(context) {
		context.commit('DELETE_SETTLETYPE');
	},
	// 本位币
	setDcurrency(context, dcurrency) {
		context.commit('SET_DCURRENCY', dcurrency);
	},
	deleteDcurrency(context) {
		context.commit('DELETE_DCURRENCY');
	},
	// 固定汇率
	setRateType(context, rateType) {
		context.commit('SET_RATETYPE', rateType);
	},
	deleteRateType(context) {
		context.commit('DELETE_RATETYPE');
	},
	// 税率
	setTaxRate(context, taxRate) {
		context.commit('SET_TAXRATE', taxRate);
	},
	deleteTaxRate(context) {
		context.commit('DELETE_TAXRATE');
	},
	// 客户
	setCustomer(context, customer) {
		context.commit('SET_CUSTOMER', customer);
	},
	deleteCustomer(context) {
		context.commit('DELETE_CUSTOMER');
	},
	// 付款条件
	setPaymentTerm(context, paymentTerm) {
		context.commit('SET_PAYMENTTERM', paymentTerm);
	},
	deletePaymentTerm(context) {
		context.commit('DELETE_PAYMENTTERM');
	},
	// 供应商
	setSupplierSelect(context, supplierSelect) {
		context.commit('SET_SUPPLIERSELECT', supplierSelect);
	},
	deleteSupplierSelect(context) {
		context.commit('DELETE_SUPPLIERSELECT');
	},
	// 销售订单 - 订单状态、类型
	setEnumType(context, enumType) {
		context.commit('SET_ENUMTYPE', enumType);
	},
	deleteEnumType(context) {
		context.commit('DELETE_ENUMTYPE');
	},
	setDicSale(context, dicSale) {
		context.commit('SET_DICSALE', dicSale);
	},
	deleteDicSale(context) {
		context.commit('DELETE_DICSALE');
	},
	// 销售退货 - 订单状态、退货类型
	setStatusType(context, statusType) {
		context.commit('SET_STATUSTYPE', statusType);
	},
	deleteStatusType(context) {
		context.commit('DELETE_STATUSTYPE');
	},
	setDicRetrunOrder(context, dicRetrunOrder) {
		context.commit('SET_DICRETRUNORDER', dicRetrunOrder);
	},
	deleteDicRetrunOrder(context) {
		context.commit('DELETE_DICRETRUNORDER');
	},
	// 采购订单 - 订单状态、退货类型
	setStatusGetType(context, statusGetType) {
		context.commit('SET_STATUSGETTYPE', statusGetType);
	},
	deleteStatusGetType(context) {
		context.commit('DELETE_STATUSGETTYPE');
	},
	setPurOrderStatus(context, purOrderStatus) {
		context.commit('SET_PURORDERSTATUS', purOrderStatus);
	},
	deletePurOrderStatus(context) {
		context.commit('DELETE_PURORDERSTATUS');
	},
	setDicPurOrder(context, dicPurOrder) {
		context.commit('SET_DICPURORDER', dicPurOrder);
	},
	deleteDicPurOrder(context) {
		context.commit('DELETE_DICPURORDER');
	},
	// 组织间 - 自定义
	setDicOrgani(context, dicOrgani) {
		context.commit('SET_DICORGANI', dicOrgani);
	},
	deleteDicOrgani(context) {
		context.commit('DELETE_DICORGANI');
	},
	// 采购入库单 - 单据类型、单据状态
	setInStockType(context, inStockType) {
		context.commit('SET_INSTOCKTYPE', inStockType);
	},
	deleteInStockType(context) {
		context.commit('DELETE_INSTOCKTYPE');
	},
	setDicPurInstock(context, dicPurInstock) {
		context.commit('SET_DICPURINSTOCK', dicPurInstock);
	},
	deleteDicPurInstock(context) {
		context.commit('DELETE_DICPURINSTOCK');
	},
	// 采购退料单 - 单据类型、单据状态、退料方式、补料方式
	setReturnMatType(context, returnMatType) {
		context.commit('SET_RETURNMATTYPE', returnMatType);
	},
	deleteReturnMatType(context) {
		context.commit('DELETE_RETURNMATTYPE');
	},
	setDicPurReturn(context, dicPurReturn) {
		context.commit('SET_DICPURRETURN', dicPurReturn);
	},
	deleteDicPurReturn(context) {
		context.commit('DELETE_DICPURRETURN');
	},
	// 分步式调出单 - 单据类型、单据状态、调拨类型
	setStktranStatus(context, stktranStatus) {
		context.commit('SET_STKTRANSTATUS', stktranStatus);
	},
	deleteStktranStatus(context) {
		context.commit('DELETE_STKTRANSTATUS');
	},
	setDicStktrOut(context, dicStktrOut) {
		context.commit('SET_DICSTKTROUT', dicStktrOut);
	},
	deleteDicStktrOut(context) {
		context.commit('DELETE_DICSTKTROUT');
	},
	// 分步式调入单 - 单据类型、状态、调拨类型
	setStktransInst(context, stktransInst) {
		context.commit('SET_STKTRANSINST', stktransInst);
	},
	deleteStktransInst(context) {
		context.commit('DELETE_STKTRANSINST');
	},
	setDicStktrInst(context, dicStktrInst) {
		context.commit('SET_DICSTKTRINST', dicStktrInst);
	},
	deleteDicStktrInst(context) {
		context.commit('DELETE_DICSTKTRINST');
	},
	// 直接调拨单 - 单据类型、状态、调拨类型
	setStkdirecttrStatus(context, stkdirecttrStatus) {
		context.commit('SET_STKDIRECTTRSTATUS', stkdirecttrStatus);
	},
	deleteStkdirecttrStatus(context) {
		context.commit('DELETE_STKDIRECTTRSTATUS');
	},
	setDicStkdirFers(context, dicStkdirFers) {
		context.commit('SET_DICSTKDIRFERS', dicStkdirFers);
	},
	deleteDicStkdirFers(context) {
		context.commit('DELETE_DICSTKDIRFERS');
	},
	// 仓库
	setWarehouseAll(context, warehouseAll) {
		context.commit('SET_WAREHOUSEALL', warehouseAll);
	},
	deleteWarehouseAll(context) {
		context.commit('DELETE_WAREHOUSEALL');
	},
	// BOM 物料清单
	setBomMaterilasObj(context, bomMaterilasObj) {
		context.commit('SET_BOMMATERILASOBJ', bomMaterilasObj);
	},
	deleteBomMaterilasObj(context) {
		context.commit('DELETE_BOMMATERILASOBJ');
	},
	// 列表 公共状态
	setListGetStatus(context, listGetStatus) {
		context.commit('SET_LISTGETSTATUS', listGetStatus);
	},
	deleteListGetStatus(context) {
		context.commit('DELETE_LISTGETSTATUS');
	},
	// 公共人员
	setGetAllUserList(context, getAllUserList) {
		context.commit('SET_GETALLUSERLIST', getAllUserList);
	},
	deleteGetAllUserList(context) {
		context.commit('DELETE_GETALLUSERLIST');
	},
	//lock
	setGetlock(context, lock) {
		context.commit('SET_LOCK', lock);
	},
};

export default {
	namespaced: true,
	state,
	getters,
	mutations,
	actions,
};
