import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import login from '../views/login.vue'
import main from '../views/main.vue'
import {
	routesLXF
} from './routerLXF.js'
import {
	jxskRouter
} from './jxskRouter.js'

const routes = [{
		path: '/',
		name: 'login',
		component: login
	},
	{
		path: '/about',
		name: 'about',
		component: () => import('../views/AboutView.vue')
	},
	{
		path: '/main',
		name: 'main',
		component: main,
		redirect: '/main/working',
		children: [{
				path: 'equipment',
				name: '设备列表',
				component: () => import('../views/equipment/index.vue')
			},
			{
				path: 'working',
				name: '工作台',
				component: () => import('../views/working/index.vue'),
				meta: {
					keepAlive: true
				}
			},
			{
				path: 'home',
				name: '我的中心',
				component: () => import('../views/home/index.vue')
			},
			{
				path: 'changePassword',
				name: '修改密码',
				component: () => import('../views/home/changePassword.vue')
			},
			{
				path: 'feedback',
				name: '我的反馈',
				component: () => import('../views/home/feedback.vue')
			},
			{
				path: 'feedbackSubmit',
				name: '我的反馈提交',
				component: () => import('../views/home/feedbackSubmit.vue')
			},

			{
				path: 'feedbackDtl',
				name: '我的反馈详情',
				component: () => import('../views/home/feedbackDtl.vue')
			},
			{
				path: 'message',
				name: '消息通知',
				component: () => import('../views/message/index.vue')
			},
			{
				path: 'messageList',
				name: '消息列表',
				component: () => import('../views/message/messageList.vue')
			},
			{
				path: 'iframWinfaster',
				name: '官网',
				component: () => import('../views/working/iframWinfaster.vue')
			},
			//流程模块
			{
				path: 'processApproval',
				name: '流程办理',
				component: () => import('../views/processApproval/index.vue')
			},
			{
				path: 'processDtl',
				name: '流程办理-详情',
				component: () => import('../views/processApproval/processDtl.vue')
			},

			//公共模块
			{
				path: 'contractTemplateAdd',
				name: '销售合同模板新增',
				component: () => import('../views/commonModule/contractTemplate/add.vue')
			},
			{
				path: 'contractTemplate',
				name: '销售合同模板',
				component: () => import('../views/commonModule/contractTemplate/index.vue')
			},
			{
				path: 'multiCompanyConfig',
				name: '多公司配置',
				component: () => import('../views/commonModule/multiCompanyConfig/index.vue')
			},
			{
				path: 'multiCompanyConfigAdd',
				name: '多公司配置新增',
				component: () => import('../views/commonModule/multiCompanyConfig/add.vue')
			},
			//生产管理模块
			{
				path: 'bomAdd',
				name: 'BOM新增',
				component: () => import('../views/production/bom/add.vue')
			},
			{
				path: 'bom',
				name: 'BOM管理',
				component: () => import('../views/production/bom/index.vue')
			},
			{
				path: 'technology',
				name: '产线管理',
				component: () => import('../views/production/technology/index.vue')
			},
			{
				path: 'technologyadd',
				name: '产线管理详情',
				component: () => import('../views/production/technology/add.vue')
			},
			{
				path: 'workingProcedure',
				name: '工序管理',
				component: () => import('../views/production/workingProcedure/index.vue')
			},
			{
				path: 'workingProcedureAdd',
				name: '工序管理新增',
				component: () => import('../views/production/workingProcedure/add.vue')
			},
			{
				path: 'workshop',
				name: '车间配置',
				component: () => import('../views/production/workshop/index.vue')
			},
			{
				path: 'workshopAdd',
				name: '车间配置新增',
				component: () => import('../views/production/workshop/add.vue')
			},
			{
				path: 'factory',
				name: '产线配置',
				component: () => import('../views/production/factory/index.vue')
			},
			{
				path: 'factoryAdd',
				name: '产线配置新增',
				component: () => import('../views/production/factory/add.vue')
			},
			//系统管理
			{
				path: 'tenantDict',
				name: '租户字典',
				component: () => import('../views/system/dict/tenantDict.vue')
			},
			{
				path: 'tenantAdd',
				name: '租户字典新增',
				component: () => import('../views/system/dict/tenantAdd.vue')
			},
			{
				path: 'businessDict',
				name: '业务字典',
				component: () => import('../views/system/dict/businessDict.vue')
			},
			{
				path: 'businessAdd',
				name: '业务字典新增',
				component: () => import('../views/system/dict/businessAdd.vue')
			},
			{
				path: 'salesman',
				name: '业务员管理',
				component: () => import('../views/system/salesman/index.vue')
			},
			{
				path: 'salesmanAdd',
				name: '业务员修改',
				component: () => import('../views/system/salesman/add.vue')
			},
			{
				path: 'userAdd',
				name: '用户管理新增',
				component: () => import('../views/system/user/add.vue')
			},
			{
				path: 'dept',
				name: '组织架构',
				component: () => import('../views/system/dept/index.vue')
			},
			{
				path: 'deptAdd',
				name: '组织架构新增',
				component: () => import('../views/system/dept/add.vue')
			},

			{
				path: 'xiamenList',
				name: '发酵机列表',
				component: () => import('../views/equipment/xiamenList.vue')
			},
			{
				path: 'warpKnitting/:id',
				name: '经编机',
				component: () => import('../views/equipment/warpKnitting.vue')
			},

			{
				path: 'fermentator/:id',
				name: '发酵机',
				component: () => import('../views/equipment/fermentator.vue')
			},
			{
				path: 'dryer/:id',
				name: '干燥机',
				component: () => import('../views/equipment/dryer.vue')
			},
			{
				path: 'injectionMolding/:id',
				name: '注塑机',
				component: () => import('../views/equipment/injectionMolding.vue')
			},
			{
				path: 'assemble/:id',
				name: '组装机',
				component: () => import('../views/equipment/assemble.vue')
			},
			{
				path: 'packer/:id',
				name: '包装机',
				component: () => import('../views/equipment/packer.vue')
			},
			{
				path: 'process',
				name: '采购单',
				component: () => import('../views/process/index.vue')
			},
			{
				path: 'supplierConfig',
				name: '供应商',
				component: () => import('../views/procurementManagement/supplierConfig/index.vue')
			},
			{
				path: 'supplierConfigAdd',
				name: '供应商详情',
				component: () => import('../views/procurementManagement/supplierConfig/add.vue')
			},
			{
				path: 'priceConfig',
				name: '供应价格',
				component: () => import('../views/procurementManagement/priceConfig/index.vue')
			},
			{
				path: 'priceConfigAdd',
				name: '供应价格新增',
				component: () => import('../views/procurementManagement/priceConfig/add.vue')
			},
			{
				path: 'priceConfigEdit',
				name: '供应价格编辑',
				component: () => import('../views/procurementManagement/priceConfig/edit.vue')
			},
			{
				path: 'subscribe',
				name: '申购',
				component: () => import('../views/procurementManagement/subscribe/index.vue')
			},
			{
				path: 'subscribeAdd',
				name: '申购新增',
				component: () => import('../views/procurementManagement/subscribe/add.vue')
			},
			{
				path: 'procureList',
				name: '待采购',
				component: () => import('../views/procurementManagement/procureList/index.vue')
			},
			{
				path: 'procureListAdd',
				name: '采购提交',
				component: () => import('../views/procurementManagement/procureList/add.vue')
			},
			{
				path: 'purchased',
				name: '已采购',
				component: () => import('../views/procurementManagement/purchased/index.vue')
			},
			{
				path: 'purchasedOne',
				name: '采购合同',
				component: () => import('../views/procurementManagement/purchasedOne/index.vue')
			},
			{
				path: 'purchasedAdd',
				name: '已采购详情',
				component: () => import('../views/procurementManagement/purchased/add.vue')
			},


			//仓库模块
			{
				path: 'warehouseConfig',
				name: '仓库维护',
				component: () => import('../views/warehouse/warehouseConfig/index.vue')
			},
			{
				path: 'warehouseConfigAdd',
				name: '仓库新增',
				component: () => import('../views/warehouse/warehouseConfig/add.vue')
			},
			{
				path: 'manualOutbound',
				name: '手动出库',
				component: () => import('../views/purchase-sales/inbound-outbound/manualOutbound/index.vue')
			},
			{
				path: 'manualOutboundAdd',
				name: '手动出库新增',
				component: () => import('../views/purchase-sales/inbound-outbound/manualOutbound/add.vue')
			},
			{
				path: 'manualInbound',
				name: '手动入库',
				component: () => import('../views/purchase-sales/inbound-outbound/manualInbound/index.vue'),
				addPath: '/manualInboundAdd'
			},
			{
				path: 'manualInboundAdd',
				name: '手动入库新增',
				component: () => import('../views/purchase-sales/inbound-outbound/manualInbound/add.vue')
			},
			{
				path: 'waitInbound',
				name: '待入库',
				component: () => import('../views/purchase-sales/inbound-outbound/waitInbound/index.vue')
			},
			{
				path: 'waitInboundAdd',
				name: '待入库>入库',
				component: () => import('../views/purchase-sales/inbound-outbound/waitInbound/add.vue')
			},
			{
				path: 'waitOutbound',
				name: '待出库',
				component: () => import('../views/purchase-sales/inbound-outbound/waitOutbound/index.vue')
			},
			{
				path: 'waitOutboundAdd',
				name: '待出库>出库',
				component: () => import('../views/purchase-sales/inbound-outbound/waitOutbound/add.vue')
			},
			{
				path: 'transferWarehouse',
				name: '调仓',
				component: () => import('../views/purchase-sales/inbound-outbound/transferWarehouse/index.vue')
			},
			{
				path: 'sendTransferWarehouse',
				name: '发起调仓',
				component: () => import('../views/purchase-sales/inbound-outbound/transferWarehouse/add.vue')
			},
			{
				path: 'inventoryQuery',
				name: '库存查询',
				component: () => import('../views/purchase-sales/inventory-management/inventoryQuery/index.vue')
			},
			{
				path: 'outInList',
				name: '出入库流水',
				component: () => import('../views/purchase-sales/inventory-management/outInList/index.vue')
			},
			// ***********************  MES模块路由     ***********************
			{
				path: 'processes',
				name: '工序管理',
				component: () => import('../views/MES/processes/index.vue')
			},
			{
				path: 'processesAdd',
				name: '工序管理详情',
				component: () => import('../views/MES/processes/add.vue')
			},
			{
				path: 'workOrder',
				name: '工单管理',
				component: () => import('../views/MES/workOrder/index.vue')
			},
			{
				path: 'workOrderAdd',
				name: '工单管理新增',
				component: () => import('../views/MES/workOrder/add.vue')
			},
			{
				path: 'workOrderDtl',
				name: '工单管理详情',
				component: () => import('../views/MES/workOrder/details.vue')
			},
			{
				path: 'plan',
				name: '生产计划',
				component: () => import('../views/MES/produce/plan/index.vue')
			},
			{
				path: 'planAdd',
				name: '生产计划新增',
				component: () => import('../views/MES/produce/plan/add.vue')
			},
			{
				path: 'planDtl',
				name: '生产计划详情',
				component: () => import('../views/MES/produce/plan/details.vue')
			},
			{
				path: 'task',
				name: '生产任务',
				component: () => import('../views/MES/produce/task/index.vue')
			},
			{
				path: 'taskAdd',
				name: '生产任务新增',
				component: () => import('../views/MES/produce/task/add.vue')
			},
			{
				path: 'productionReport',
				name: '生产报工',
				component: () => import('../views/MES/productionReport/index.vue')
			},
			{
				path: 'productionReportAdd',
				name: '生产报工添加',
				component: () => import('../views/MES/productionReport/add.vue')
			},
			{
				path: 'reportDetail',
				name: '报工明细',
				component: () => import('../views/MES/reportDetail/index.vue')
			},

			// {
			// 	path: 'reportWorkAdd',
			// 	name: '生产报工新增',
			// 	component: () => import('../views/MES/produceManage/reportWork/add.vue')
			// },
			// {
			// 	path: 'reportWorkDtl',
			// 	name: '生产报工详情',
			// 	component: () => import('../views/MES/produceManage/reportWork/details.vue')
			// },
			{
				path: 'lineSide',
				name: '线边管理',
				component: () => import('../views/MES/produceManage/lineSide/index.vue')
			},
			{
				path: 'lineSideAdd',
				name: '线边管理新增',
				component: () => import('../views/MES/produceManage/lineSide/add.vue')
			},
			{
				path: 'lineSideEdit',
				name: '线边处理',
				component: () => import('../views/MES/produceManage/lineSide/edit.vue')
			},
			{
				path: 'completeProject',
				name: '完工入库',
				component: () => import('../views/MES/produceManage/completeProject/index.vue')
			},
			{
				path: 'completeProjectAdd',
				name: '完工入库新增',
				component: () => import('../views/MES/produceManage/completeProject/add.vue')
			},
			{
				path: 'completeProjectAdd1',
				name: 'form表单测试',
				component: () => import('../views/MES/produceManage/completeProject1/index.vue')
			},
			//邮箱模块
			{
				path: 'email',
				name: '邮箱',
				component: () => import('../views/email/index.vue')
			},
			{
				path: 'inbox',
				name: '收件箱',
				component: () => import('../views/email/inbox.vue')
			},
			{
				path: 'mailDtl',
				name: '邮件详情',
				component: () => import('../views/email/mailDtl.vue')
			},
			{
				path: 'write',
				name: '写邮件',
				component: () => import('../views/email/write.vue')
			},
			{
				path: 'announcement',
				name: '公告',
				component: () => import('../views/message/announcement.vue')
			},
			{
				path: "sacnTest",
				name: "扫码页面",
				component: () => import("../views/system/sacn/index.vue"),
			},
			{
				path: "productLibrary",
				name: "产品库",
				component: () => import("../views/product-material/companyProduct/index.vue"),
			},
			{
				path: "productLibraryAdd",
				name: "产品详情",
				component: () => import("../views/product-material/companyProduct/add.vue"),
			},
			// 尔泓公司产品库
			// {
			// 	path: "ehsdCompanyProduct",
			// 	name: "公司产品库",
			// 	component: () => import("../views/product-material/companyProduct/index.vue"),
			// },
			// {
			// 	path: "ehsdCompanyProductAdd",
			// 	name: "公司产品库详情",
			// 	component: () => import("../views/product-material/companyProduct/add.vue"),
			// },
			// 尔泓客户产品库
			{
				path: "ehsdCustomProduct",
				name: "客户产品库",
				component: () => import("../views/product-material/customProduct/index.vue"),
			},
			{
				path: "ehsdCustomProductAdd",
				name: "客户产品库详情",
				component: () => import("../views/product-material/customProduct/add.vue"),
			},
			{
				path: "historyMessage",
				name: "历史消息",
				component: () => import("../views/message/historyMessage.vue"),
			},
			{
				path: "coming",
				name: "开发中",
				component: () => import("../views/home/coming.vue"),
			},

		]
	},
]

routes[2].children = routes[2].children.concat(routesLXF()).concat(jxskRouter())

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router