/**
	[OECRM] (C)2012~2099 OEdev.Net Inc.
	This is NOT a freeware, use is subject to license terms
	$Id: artbox.js 2014-05-04 OEdev $ 
*/

//弹出修改密码窗口
function artbox_editpassword(id, width, height) {
	if (typeof(width) == 'undefined') {width = 450;}
	if (typeof(height) == 'undefined') {height = 170;}
	var url = 'index.php?m=admin&c=admins&a=editpass&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '修改密码', width: width, height: height, drag: true});
}

//弹出部门设置窗口
function artbox_department(width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=departs&r='+get_rndnum(6);
	$.dialog.open(url, {title: '设置部门', width: width, height: height, drag: true});
}

//审批产品
function artbox_approvedgoods(id, width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=goods&a=approved&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '审批', width: width, height: height, drag: false});
}

//审批客户
function artbox_approvedcustomer(id, width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=customer&a=approved&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '审批', width: width, height: height, drag: false});
}

//管理联系人 弹窗选择客户args1-ID(tips) args2-NAME(tips) idcallback-是否调用父类doCallback()函数
function artbox_selContactCustomer(arg1, arg2, iscallback, width, height) {
	if (typeof(iscallback) == 'undefined') {iscallback = 0;}
	if (typeof(width) == 'undefined') {width = 700;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=customer&a=selforcontact&arg1='+arg1+'&arg2='+arg2+'&iscallback='+iscallback+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '选择客户', width: width, height: height, drag: true});
}

//审批联系人
function artbox_approvedcontact(id, width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 330;}
	var url = 'index.php?m=admin&c=contact&a=approved&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '审批', width: width, height: height, drag: false});
}

//转移客户
function artbox_transcontact(ids, width, height) {
	if (typeof(width) == 'undefined') {width = 450;}
	if (typeof(height) == 'undefined') {height = 170;}
	var url = 'index.php?m=admin&c=contact&a=trans&ids='+ids+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '转移客户', width: width, height: height, drag: true});
}

//分配客户
function artbox_allotcontact(ids, width, height) {
	if (typeof(width) == 'undefined') {width = 450;}
	if (typeof(height) == 'undefined') {height = 170;}
	var url = 'index.php?m=admin&c=pools&a=allot&ids='+ids+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '分配客户', width: width, height: height, drag: true});
}

//创建订单明细选择产品
function artbox_selordergoods(orders, width, height) {
	if (typeof(width) == 'undefined') {width = 780;}
	if (typeof(height) == 'undefined') {height = 380;}
	var url = 'index.php?m=admin&c=goods&a=selgoods&orders='+orders+'&type=orderlistitem&r='+get_rndnum(6);
	$.dialog.open(url, {title: '选择产品', width: width, height: height, drag: true});
}
//编辑订单明细选择产品
function artbox_selordergoods2(orders, width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=goods&a=selgoods&orders='+orders+'&type=orderitem&r='+get_rndnum(6);
	$.dialog.open(url, {title: '选择产品', width: width, height: height, drag: true});
}

//审批订单
function artbox_approvedorder(id, width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 330;}
	var url = 'index.php?m=admin&c=order&a=approved&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '审批', width: width, height: height, drag: false});
}

//转移订单
function artbox_transorder(ids, width, height) {
	if (typeof(width) == 'undefined') {width = 450;}
	if (typeof(height) == 'undefined') {height = 170;}
	var url = 'index.php?m=admin&c=order&a=trans&ids='+ids+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '转移订单', width: width, height: height, drag: true});
}

//编辑订单明细
function artbox_orderitemedit(orderid, id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=orderitem&a=edit&orderid='+orderid+'&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '编辑订单明细', width: width, height: height, drag: true});
}

//添加订单明细
function artbox_orderitemadd(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 850;}
	if (typeof(height) == 'undefined') {height = 450;}
	var url = 'index.php?m=admin&c=orderitem&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '添加订单明细', width: width, height: height, drag: true});
}

//查看订单明细
function artbox_orderitemview(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 850;}
	if (typeof(height) == 'undefined') {height = 350;}
	var url = 'index.php?m=admin&c=orderitem&sorderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '查看订单明细', width: width, height: height, drag: true});
}

//创建订单跟进记录
function artbox_orderlogadd(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=orderlog&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建跟进记录', width: width, height: height, drag: true});
}

//添加订单附件
function artbox_orderannexadd(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=orderannex&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '添加订单附件', width: width, height: height, drag: true});
}

//编辑订单附件
function artbox_orderannexedit(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=orderannex&a=edit&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '编辑订单附件', width: width, height: height, drag: true});
}

//更新订单状态
function artbox_orderstatus(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=order&a=status&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '更新订单状态', width: width, height: height, drag: true});
}

//创建应收款
function artbox_gatheradd(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 700;}
	if (typeof(height) == 'undefined') {height = 380;}
	var url = 'index.php?m=admin&c=gather&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建应收款', width: width, height: height, drag: true});
}

//创建收款单
function artbox_gatherlogadd(gatherid, width, height) {
	if (typeof(width) == 'undefined') {width = 750;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=gatherlog&a=add&gatherid='+gatherid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建收款单', width: width, height: height, drag: true});
}


//创建应付款
function artbox_chargeadd(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 750;}
	if (typeof(height) == 'undefined') {height = 410;}
	var url = 'index.php?m=admin&c=charge&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建退款计划', width: width, height: height, drag: true});
}

//创建付款单
function artbox_chargelogadd(chargeid, width, height) {
	if (typeof(width) == 'undefined') {width = 750;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=chargelog&a=add&chargeid='+chargeid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建付款单', width: width, height: height, drag: true});
}

//申请开票
function artbox_appbilling(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 800;}
	if (typeof(height) == 'undefined') {height = 450;}
	var url = 'index.php?m=admin&c=billing&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '申请开票', width: width, height: height, drag: true});
}

//审批开票单
function artbox_approvedbilling(id, width, height) {
	if (typeof(width) == 'undefined') {width = 650;}
	if (typeof(height) == 'undefined') {height = 330;}
	var url = 'index.php?m=admin&c=billing&a=approved&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '审批', width: width, height: height, drag: false});

}

//执行开票
function artbox_dobilling(id, width, height) {
	if (typeof(width) == 'undefined') {width = 800;}
	if (typeof(height) == 'undefined') {height = 450;}
	var url = 'index.php?m=admin&c=billing&a=bill&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '执行开票', width: width, height: height, drag: true});
}

//创建项目单
function artbox_createproject(orderid, width, height) {
	if (typeof(width) == 'undefined') {width = 800;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=project&a=add&orderid='+orderid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建项目单', width: width, height: height, drag: true});
}

//添加项目附件
function artbox_projectannexadd(proid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=projectannex&a=add&proid='+proid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '添加项目附件', width: width, height: height, drag: true});
}

//编辑项目附件
function artbox_projectannexedit(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 300;}
	var url = 'index.php?m=admin&c=projectannex&a=edit&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '编辑项目附件', width: width, height: height, drag: true});
}

//冻结项目
function artbox_projectfrozen(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 310;}
	var url = 'index.php?m=admin&c=project&a=frozenproject&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '冻结项目单', width: width, height: height, drag: true});
}

//解冻项目
function artbox_projectfree(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 310;}
	var url = 'index.php?m=admin&c=project&a=freeproject&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '解除冻结项目单', width: width, height: height, drag: true});
}

//作废项目
function artbox_projectcancel(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 310;}
	var url = 'index.php?m=admin&c=project&a=cancelproject&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '作废项目单', width: width, height: height, drag: true});
}

//更新项目完成状态
function artbox_projectfinish(id, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 270;}
	var url = 'index.php?m=admin&c=project&a=finish&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '项目完成', width: width, height: height, drag: true});
}


//项目经理-创建任务单
function artbox_createtask(proid, width, height) {
	if (typeof(width) == 'undefined') {width = 820;}
	if (typeof(height) == 'undefined') {height = 410;}
	var url = 'index.php?m=admin&c=project&a=createtask&proid='+proid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '分配任务', width: width, height: height, drag: true});
}

//项目经理-编辑任务单
function artbox_edittask(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 820;}
	if (typeof(height) == 'undefined') {height = 410;}
	var url = 'index.php?m=admin&c=project&a=edittask&id='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '编辑任务单', width: width, height: height, drag: true});
}

//项目经理-审批任务进度申请
function artbox_taskapproved(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 800;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=project&a=approvedtask&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '审批任务进度', width: width, height: height, drag: true});
}

//项目经理-冻结任务单
function artbox_taskfrozen(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 310;}
	var url = 'index.php?m=admin&c=project&a=frozentask&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '冻结任务单', width: width, height: height, drag: true});
}

//项目经理-取消冻结
function artbox_taskfree(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 310;}
	var url = 'index.php?m=admin&c=project&a=freetask&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '取消冻结任务单', width: width, height: height, drag: true});
}

//项目经理-作废任务单
function artbox_taskcancel(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 310;}
	var url = 'index.php?m=admin&c=project&a=canceltask&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '作废任务单', width: width, height: height, drag: true});
}


//项目经理-查看任务日志
function artbox_viewtasklog(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 800;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=project&a=viewtasklog&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '查看任务单日志', width: width, height: height, drag: true});
}


//任务管理 开始实施
function artbox_starttask(id, width, height) {
	if (typeof(width) == 'undefined') {width = 700;}
	if (typeof(height) == 'undefined') {height = 320;}
	var url = 'index.php?m=admin&c=task&a=start&id='+id+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '实施任务', width: width, height: height, drag: true});
}

//创建任务进度日志
function artbox_tasklogadd(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 600;}
	if (typeof(height) == 'undefined') {height = 320;}
	var url = 'index.php?m=admin&c=tasklog&a=add&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '创建任务进度日志', width: width, height: height, drag: true});
}

//任务管理 提交完成任务申请
function artbox_taskappfinish(taskid, width, height) {
	if (typeof(width) == 'undefined') {width = 800;}
	if (typeof(height) == 'undefined') {height = 400;}
	var url = 'index.php?m=admin&c=taskapproved&a=add&taskid='+taskid+'&r='+get_rndnum(6);
	$.dialog.open(url, {title: '提交任务进度申请', width: width, height: height, drag: true});
}

