//表单提交加载等待界面
function openLoadWindow(){
	var diag = new Dialog();
	diag.ID = 'loading';
	diag.Width = 200;
	diag.Height = 100;
	diag.Drag = false;
	diag.ShowCloseButton=false;
	diag.Title = "信息提交中，请稍候...";
	diag.URL = "/loading.html";
	diag.show();
}

//权限判断
function　openOP(){
	Dialog.alert(" 提示：对不起！你没权限！",function(){history.go(-1)});
}

//更改个人密码
function changeOwerPassword(){
	var diag = new Dialog();
	diag.Width = 250;
	diag.Height = 164;
	diag.Title = "密码修改";
	diag.URL = "/system/sysChangePassword.php";
	diag.show();		
}

//添加员工信息
function openAddPersonnel(){
	var diag = new Dialog();
	diag.Width = 420;
	diag.Height = 246;
	diag.Title = "员工信息录入";
	diag.URL = "/system/sysAddPersonnel.php";
	diag.show();	
}

//查看员工详细信息
function openShowPersonnel(id){
	var diag = new Dialog();
	diag.Width = 420;
	diag.Height = 205;
	diag.Title = "员工详细资料";
	diag.URL = "/system/sysShowPersonnel.php?id="+id;
	diag.show();	
}

//查看员工详细信息
function openUpdatePersonnel(id){
	var diag = new Dialog();
	diag.Width = 420;
	diag.Height = 246;
	diag.Title = "员工信息修改";
	diag.URL = "/system/sysAddPersonnel.php?id="+id;
	diag.show();	
}

//删除员工信息
function openDelPersonnel(name,id){
	Dialog.confirm('警告：您确认要'+name+'吗？',function(){
		sysDelPersionnel(id);									
	});
}

//添加操作员
function openAddUser(){
	var diag = new Dialog();
	diag.Width = 420;
	diag.Height = 164;
	diag.Title = "添加操作员";
	diag.URL = "/system/sysAddUser.php";
	diag.show();	
}

//修改操作员信息
function openUpdateUser(id){
	var diag = new Dialog();
	diag.Width = 420;
	diag.Height = 164;
	diag.Title = "修改操作员信息";
	diag.URL = "/system/sysAddUser.php?id="+id;
	diag.show();	
}

//删除操作员信息
function openDelUser(username,id){
	Dialog.confirm('警告：您确认要'+username+'吗？',function(){
		sysDelUser(id);									
	});
}

//添加分店
function openAddShop(){
	var diag = new Dialog();
	diag.Width = 250;
	diag.Height = 123;
	diag.Title = "添加分店";
	diag.URL = "/system/sysAddShop.php";
	diag.show();	
}

//修改分店信息
function openUpdateShop(id){
	var diag = new Dialog();
	diag.Width = 250;
	diag.Height = 123;
	diag.Title = "修改分店信息";
	diag.URL = "/system/sysAddShop.php?id="+id;
	diag.show();	
}

//删除分店信息
function openDelShop(username,id){
	Dialog.confirm('警告：您确认要'+username+'吗？',function(){
		sysDelShop(id);									
	});
}

//增加会员
function openAddMemberUser(){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 287;
	diag.Title = "增加会员";
	diag.URL = "/member/memberAddUser.php";
	diag.show();	
}

//修改会员
function openUpdateMemberUser(mid){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 287;
	diag.Title = "修改会员资料";
	diag.URL = "/member/memberAddUser.php?mid="+mid;
	diag.show();	
}

//会员详细信息
function openMemberUserInfo(mid){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 276;
	diag.Title = "会员详细信息";
	diag.URL = "/member/memberShowUser.php?mid="+mid;
	diag.show();	
}

//积分兑换弹窗
function openChangeIntegral(name,mid){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 205;
	diag.Title = name+"会员积分兑换";
	diag.URL = "/member/memberIntegralRecord.php?mid="+mid;
	diag.show();
}

//增加会员分类弹窗
function openMType(){
	var diag = new Dialog();
	diag.Width = 220;
	diag.Height = 123;
	diag.Title = "添加会员分类";
	diag.URL = "/member/memberAddType.php";
	diag.show();
}

//修改会员分类弹窗
function openMType(id){
	var diag = new Dialog();
	diag.Width = 220;
	diag.Height = 123;
	diag.Title = "修改会员分类";
	diag.URL = "/member/memberAddType.php?id="+id;
	diag.show();
}

//添加客户弹窗
function openCustomers(){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 246;
	diag.Title = "添加客户信息";
	diag.URL = "/member/memberAddCustomers.php";
	diag.show();
}

//修改客户弹窗
function openEditCustomers(id){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 246;
	diag.Title = "修改客户信息";
	diag.URL = "/member/memberAddCustomers.php?id="+id;
	diag.show();
}

//客户详细信息弹窗
function openCustomersInfo(id){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 246;
	diag.Title = "客户详细信息";
	diag.URL = "/member/memberShwoCustomers.php?id="+id;
	diag.show();
}

//添加商品分类弹窗
function openGType(){
	var diag = new Dialog();
	diag.Width = 220;
	diag.Height = 82;
	diag.Title = "添加客户信息";
	diag.URL = "/products/productsAddType.php";
	diag.show();
}

//修改商品分类弹窗
function openEditGType(id){
	var diag = new Dialog();
	diag.Width = 220;
	diag.Height = 82;
	diag.Title = "添加客户信息";
	diag.URL = "/products/productsAddType.php?id="+id;
	diag.show();
}

//添加商品弹窗
function openAddGoods(){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 205;
	diag.Title = "添加商品信息";
	diag.URL = "/products/productsAddGoods.php";
	diag.show();
}

//修改商品弹窗
function openUpdateGoods(id){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 205;
	diag.Title = "修改商品信息";
	diag.URL = "/products/productsAddGoods.php?id="+id;
	diag.show();
}

//添加特价商品弹窗
function openAddSale(barcode,name){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 123;
	diag.Title = "添加特价商品";
	diag.URL = "/products/productsAddSale.php?barcode="+barcode+"&name="+name;
	diag.show();
}

//修改特价商品弹窗
function openUpdateSale(barcode,name){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 123;
	diag.Title = "修改特价商品";
	diag.URL = "/products/productsAddSale.php?id=1&barcode="+barcode+"&name="+name;
	diag.show();
}

//删除特价商品
function openDelSale(id,name){
	Dialog.confirm('警告：您确认要删除 '+name+' 特价商品吗？',function(){
		productsDelSale(id,name);									
	});
}

//增加库存弹窗
function openAddStock(){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 287;
	diag.Title = "增加库存";
	diag.URL = "/inventory/inventoryAddStock.php";
	diag.show();
}

//减少库存弹窗
function openSubStock(){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 287;
	diag.Title = "减少库存";
	diag.URL = "/inventory/inventorySubStock.php";
	diag.show();
}

//库存调拨弹窗
function openInventoryAllocation(){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 246;
	diag.Title = "库存调拨";
	diag.URL = "/inventory/inventoryAllocation.php";
	diag.show();
}

//编辑库存调拨弹窗
function openInventoryUpdateAllocation(id){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 246;
	diag.Title = "库存调拨";
	diag.URL = "/inventory/inventoryAllocation.php?id="+id;
	diag.show();
}

//调拨入库
function openInsertAllocation(id){
	Dialog.confirm('警告：您确认要调拨入库吗？',function(){
		inventoryInsertAllocation(id);									
	});
}

//调拨入库
function openDeleteAllocation(id){
	Dialog.confirm('警告：您确认要删除库存调拨吗？',function(){
		inventoryDeleteAllocation(id);									
	});
}

//客户收款
function sellPayment(id){
	var diag = new Dialog();
	diag.Width = 450;
	diag.Height = 205;
	diag.Title = "客户收款";
	diag.URL = "/sell/sellPayment.php?id="+id;
	diag.show();
}
