📄 dev.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jb-aptech毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/UserService.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Pager.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/SalChanceService.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/custservice.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/DAOSALService.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/js/saledev.js'></script>
<script type="text/javascript" src='<%=request.getContextPath()%>/js/s1.js'></script>
<!-- 自定义分页控件的客户端js -->
<script type='text/javascript' src='<%=request.getContextPath()%>/js/SalePageCtl.js'></script>
<script type="text/javascript">
var tab1 = new TablePage('tab1','TBody1', 'pgCtl', 'empviewkey2');
//以下是可选的
tab1.dateformat="yyyy年MM月dd日"; //如果包含日期列,这里可以定义日期的显示格式
tab1.sqlFilter=" order by chc_status"; //查询条件
tab1.pagesize=10; //每页多少行
tab1.wait='waitCtl'; //等待的提示
tab1.default_callback=function over() //显示完成以后的回调函数
{
waitCtl.style.display = 'none';
};
function searchCust(){
tab1.sqlFilter="";
if("" != $('chcCustName2').value){
tab1.sqlFilter +=" and chc_cust_name like '%"+$('chcCustName2').value+"%'";
}
if("" != $('chcTitle2').value){
tab1.sqlFilter +=" and chc_title like '%"+$('chcTitle2').value+"%'";
}
if("" != $('chcLinkman2').value){
tab1.sqlFilter +=" and chc_linkman like '%"+$('chcLinkman2').value+"%'";
}
tab1.sqlFilter += " order by chc_status";
tab1.go(1);
}
function establish(id){ //制定
var ssid = $('template:chc_status'+id).innerHTML;
if(ssid == '终止开发' || ssid == '开发成功'){
select(id);
}else{
if($('status').value == '2' || $('status').value == '3'){
//window.location.href='dev_plan.jsp?id='+id;
window.location.href='dev_plan.jsp?pa='+tab1.pageno+'&id='+id;
}else{
alert('对不起,您没有制定计划的权限!');
}
}
}
function establish2(id){
if($('status').value != '2' && $('status').value != '3'){
}else{
var ssid = $('template:chc_status'+id).innerHTML;
if(ssid == '终止开发' || ssid == '开发成功'){
select(id);
}else{
if($('status').value == '2' || $('status').value == '3'){
window.location.href='dev_plan.jsp?pa='+tab1.pageno+'&id='+id;
}else{
alert('对不起,您没有制定计划的权限!');
}
}
}
}
function transact(id){ //执行
if($('status').value == '2')
//window.location.href='dev_execute.jsp?id='+id;
window.location.href='dev_execute.jsp?pa='+tab1.pageno+'&id='+id;
else
alert('对不起,您没有执行计划的权限!');
}
function select(id){ //查看
if($('status').value == '2' || $('status').value == '3'){
//window.location.href='dev_detail.jsp?id='+id;
window.location.href='dev_detail.jsp?pa='+tab1.pageno+'&id='+id;
}else{
alert('对不起,您没有查看的权限!');
}
}
function succeed(id){
ss(id);
}
function ss(id){
SalChanceService.searchId(id, function(data)
{
//alert(DWRUtil.toDescriptiveString(data,'chcId'));
dwr.util.setValues(data);
id = 3;
updateSalChance(id);
}
);
}
function updateSalChance(id){
if($('status').value == '2'){
var rowobj = {
chcId:null,
chcSource:null,
chcCustName:null,
chcTitle:null,
chcRate:null,
chcLinkman:null,
chcTel:null,
chcDesc:null,
chcCreateId:{usrId:null},
chcCreateBy:null,
chcDueId:null,
chcDueTo:null
};
//alert(document.getElementById('chcId').value);
rowobj.chcStatus = id;
dwr.util.getValues(rowobj);
var da = document.getElementById('chcCreateString').value;
var da1 = document.getElementById('chcDueDateString').value;
//alert(DWRUtil.toDescriptiveString(rowobj, 'chcId'));
//编辑
SalChanceService.updateSalChance(rowobj,da,da1, function(data)
{
if(3 == id){
if(data ==true){
var now=new Date();
var now=new Date();
var year=now.getYear()+'';
year = year.substring(2,4);
var month=now.getMonth()+1;
if(month<10){
month = "0"+month;
}
var date = now.getDate();
if(date < 10){
date = "0"+date;
}
var timeString = "KH"+year+month+date;
custservice.findList(function(tomer){
if(tomer.custNo.substring(6,8)== date){
if('00'==(tomer.custNo.substring(8,10))){
var num = parseInt(tomer.custNo.substring(10))+1+'';
if(num != '10')
timeString = timeString+'00'+num;
else
timeString = timeString+'0'+num;
}else if('0'==(tomer.custNo.substring(8,9))){
var num = parseInt(tomer.custNo.substring(9))+1+'';
if(num != '100')
timeString = timeString+'0'+num;
else
timeString = num;
}else{
var num = parseInt(tomer.custNo.substring(8))+1+'';
timeString = timeString+num;
}
}else{
timeString = timeString+'001';
}
var ro = {
custNo:null,
custName:null,
custLevel:0,
custLevelLabel:"未指定",
custSatisfy:0,
custCredit:0,
sysUser:{usrId:null},
custManagerName:null,
custStatus:1
}
ro.custNo = timeString;
ro.custName = document.getElementById('chcCustName').value;
dwr.util.setValues(ro);
ro.sysUser.usrId = document.getElementById('chcDueId').value;
ro.custManagerName = document.getElementById('chcDueTo').value;
//alert(DWRUtil.toDescriptiveString(ro, 'custNo'));
custservice.insertCstCustomer(ro,function(data1){
if(data1 == true){
alert("用户开发成功,已添加新客户记录。");
//window.location.href='dev.jsp';
window.location.href='dev.jsp?pa='+tab1.pageno+'&id='+id;
}
});
});
}else{
alert("保存失败!");
}
}else{
if(data ==true){
alert("开发失败,已归档。");
//window.location.href='dev.jsp';
window.location.href='dev.jsp?pa='+tab1.pageno+'&id='+id;
}else{
alert("保存失败!");
}
}
});
}else{
alert('对不起,您没有开发成功的权限!');
}
}
function onl(){
if($('pa0').value.length ==0){
tab1.go(1);
smanPromptList('chcCustName2');
}else{
tab1.go($('pa0').value);
smanPromptList('chcCustName2');
}
}
function shose(id)
{
$('qq1'+id).style.background='#6ec2fd';
$('qq2'+id).style.background='#6ec2fd';
$('qq3'+id).style.background='#6ec2fd';
$('qq4'+id).style.background='#6ec2fd';
$('qq5'+id).style.background='#6ec2fd';
$('qq6'+id).style.background='#6ec2fd';
$('qq7'+id).style.background='#6ec2fd';
$('qq8'+id).style.background='#6ec2fd';
}
function go(id)
{
$('qq1'+id).style.background='eeeeff';
$('qq2'+id).style.background='eeeeff';
$('qq3'+id).style.background='eeeeff';
$('qq4'+id).style.background='eeeeff';
$('qq5'+id).style.background='eeeeff';
$('qq6'+id).style.background='eeeeff';
$('qq7'+id).style.background='eeeeff';
$('qq8'+id).style.background='eeeeff';
}
</script>
</head>
<body onload="onl()">
<input id="pa0" type="hidden" value="${param.pa}"/>
<input type="hidden" id="status" value="${sessionScope.usrFlagIndex}">
<input type="hidden" id="userFlag" value="${sessionScope.usrIdIndex}">
<div class="page_title">客户开发计划</div>
<div class="button_bar">
<button class="common_button" onclick="helpq2();">帮助</button>
<button class="common_button" onclick="searchCust()">查询</button>
</div>
<table class="query_form_table">
<tr>
<th>客户名称</th>
<td><input id="chcCustName2"/></td>
<th>概要</th>
<td><input id="chcTitle2"/></td>
<th>联系人</th>
<td><input id="chcLinkman2" size="20" /></td>
</tr>
</table>
<br />
<input type="hidden" id="chcId"/>
<input type="hidden" id="chcSource"/>
<input type="hidden" id="chcCustName"/>
<input type="hidden" id="chcRate"/>
<input type="hidden" id="chcTitle"/>
<input type="hidden" id="chcLinkman"/>
<input type="hidden" id="chcTel"/>
<input type="hidden" id="chcDesc"/>
<input type="hidden" id="chcCreateBy"/>
<input type="hidden" id="chcCreateString"/>
<input type="hidden" id="chcDueTo"/>
<input type="hidden" id="chcDueDateString"/>
<input type="hidden" id="chcCreateId.usrId" value="${usrIdIndex}"/>
<input type="hidden" id="chcDueId"/>
<input type="hidden" id="chcDueTo"/>
<!-- 表格的主体部分 -->
<table class="data_list_table">
<!-- 表头 -->
<tr>
<th>编号</th>
<th>客户名称</th>
<th>概要</th>
<th>联系人</th>
<th>联系人电话</th>
<th>创建时间</th>
<th>状态</th>
<th>操作</th>
</tr>
<!-- 表主体 -->
<tbody id="TBody1">
<tr id="template" style="display:none" ondblclick="establish2(this.id.substring(8))" onmouseenter="shose(this.id.substring(8))" onmouseleave="go(this.id.substring(8))">
<td class="list_data_number" id="qq1"+template.id.substring(8)><span id="template:chc_id"/></td><!-- 列的命名规则采用template:列属性 -->
<td class="list_data_text" id="qq2"+template.id.substring(8)><span id="template:chc_cust_name"/></td>
<td class="list_data_ltext" id="qq3"+template.id.substring(8)><span id="template:chc_title"/></td>
<td class="list_data_text" id="qq4"+template.id.substring(8)><span id="template:chc_linkman"/></td>
<td class="list_data_text" id="qq5"+template.id.substring(8)><span id="template:chc_tel"/></td>
<td class="list_data_text" id="qq6"+template.id.substring(8)><span id="template:chc_create_date"/></td>
<td class="list_data_text" id="qq7"+template.id.substring(8)><span id="template:chc_status"/></td>
<td class="list_data_op" id="qq8"+template.id.substring(8)>
<img onclick="establish(this.id.substring(9))" id="establish" title="制定计划" src="../../images/bt_plan.gif" class="op_button" />
<img onclick="transact(this.id.substring(8))" id="transact" title="执行计划" src="../../images/bt_feedback.gif" class="op_button" />
<img onclick="succeed(this.id.substring(7))" id="succeed" title="开发成功" src="../../images/bt_yes.gif" class="op_button" />
<img onclick="select(this.id.substring(6));" id="select" title="查看" src="../../images/bt_detail.gif" class="op_button" />
</td>
</tr>
</tbody>
<!-- 表格的分页控制部分 -->
<tr id="reveal" style="display:none"><td align="center" colspan="8">没有找到你所需要的数据</td></tr>
<tr>
<th colspan="100" class="pager">
<div align="left" id="waitCtl">正在加载...</div>
<div id="pgCtl" class="pager">
</th>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -