| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- <html>
- <head>
- <style type="text/css">
- .left-div, .right-div {
- float: left;
- /*width: 48%;*/
- height: 94%;
- box-sizing: border-box;
- position: relative;
- }
- .left-div {
- width: 37%;
- }
- .right-div {
- width: 62.7%;
- }
- table.list {
- margin-left: 0px !important;
- }
- table.list th{
- /* width: 158px;*/
- }
- table.list td{
- /* width: 158px;*/
- }
- .list-div tr {
- border-bottom: 1px solid #e4e4e4;
- background-color: #f0f0f0;
- }
- .list-div tr:hover {
- border-bottom: 1px solid #e4e4e4;
- background-color: #c7e3fc;
- }
- .list tr:nth-child(even):hover {
- background-color:#c7e3fc;
- }
- .list-div td {
- /*max-width: 140px !important;*/
- padding: 0px 12px 0px 12px !important;
- }
- .list-div th {
- padding: 0px 12px 0px 12px !important;
- }
- .left-button {
- width: 100%;
- float: left;
- text-align: center;
- position: absolute;
- bottom: 0;
- }
- .left-div {
- margin-right: 1px;
- }
- .times {
- width: 80px !important;
- }
- .form-text {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .cjfs {
- width: 60px !important;
- }
- .list tr td {
- padding-right: 28px;
- }
- input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- }
- input[type="text"] {
- -moz-appearance: textfield;
- width: 65px;
- text-align: right;
- }
- .content-div {
- padding-right:15px!important;
- }
- .xylist {
- display: block;
- height: 630px;
- overflow-y: auto;
- }
- .list tr{
- display: table;
- width: 100%;
- table-layout: fixed;
- }
- .list-highlight {
- color: #2b368f!important;
- font-size: 14px!important;
- }
- </style>
- <script type="text/javascript">
- console.log("start!!!");
- /* 再去掉,在 grxcdjl_excelZxxzAdd.ss.jsp 里选择 日程ID -- 改为 个人巡查点记录 了。Lin
- window.onload = function () { // 加载数据服务,统一为 ByA。Lin
- loadXsCj();
- }
- */
- function loadXsCj(e){
- console.log("loadXsCj");
- var rcid = '${rcid}';
- $.ajax({
- url : "<serv.ss name='grxcdjl_excelInitAddByZxxz'/>",
- type : 'post',
- async : false,
- dataType: "json", // 增加。Lin
- data : {
- 'rcid' : rcid
- },
- success : function(result) {
- /* 改。Lin
- * 增加 dataType: "json", 了
- * 只有一组数据
- var data = eval("(" + result + ")");
- //学员信息
- var stuData = data.stulist;
- */ var stuData = result;
- // var stuStr = ""; // 去掉,没用到。Lin
- var jlztmBoolean=true;
- for (var i in stuData) {
- console.log(stuData[i]);
- var stu = stuData[i];
- var str = "";
- if(stu.jlztm && stu.jlztm == 51){//加灰色样式
- str += "<tr class='filter'>";
- }else{//不加
- str += "<tr>";
- }
- str += "<input type='hidden' value='" + stu.xcdid + "' name='xcdid' />";
- str += "<input type='hidden' value='";
- if ("xcdjlid" in stu)
- str += stu.xcdjlid;
- else
- str += "null";
- str += "' name='xcdjlid' />"; // + stu.ryid + "' name='xyid' />"。Lin
- str += "<td style='width:85px;' class='list-highlight'>" + stu.xcdmc + "</td>"; // + stu.xm +。Lin
- var jyfs="";
- if(stu.jlztm==51){
- jyfs=" readonly='true' ";
- }
- // 情况描述。Lin
- str += "<td style='width:120px;text-align: right;'>" +
- "<input "+ jyfs +" type='text' value='"+ stu.qkms +"' name='qkms' tab='tabField'"+
- " onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/>" +
- "</td>";
- // 处理描述。Lin
- str += "<td style='width:120px;text-align: right;'>" +
- "<input "+ jyfs +" type='text' value='"+ stu.clms +"' name='clms' tab='tabField'"+
- " onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/>" +
- "</td>";
- // 责任人。Lin
- str += "<td style='width:50px;text-align: right;'>" +
- "<input "+ jyfs +" type='text' value='"+ stu.zrr +"' name='zrr' tab='tabField'"+
- " onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/>" +
- "</td>";
- str += "</tr>";
- $('.xylist').append($(str));
- if(stu.jlztm==1||!stu.jlztm)
- jlztmBoolean=false;
- }
- //if (stuData[0].jlztm && stuData[0].jlztm != 1) {
- if(jlztmBoolean){
- $('.xylist input').attr("disabled", "disabled");
- $('input[name="save"]').attr('disabled', 'disabled');
- $('input[name="subm"]').attr('disabled', 'disabled');
- $('input[name="save"]').css("color", "#aaa");
- $('input[name="subm"]').css("color", "#aaa");
- } else {
- $('input[name="save"]').attr('disabled', false);
- $('input[name="subm"]').attr('disabled', false);
- $('input[name="save"]').css("color", "");
- $('input[name="subm"]').css("color", "");
- }
- }
- });
- }
- function afterSelectPlan(event) {
- /*if(isJlTriggerEvent){
- wd.edit.objectPicker.instance.xqm.onchange();
- return;
- }*/
- //选中值
- var val; //安排id
- var cjlbval; //成绩类别类型
- var type;
- var isAllow = true; //允许发出请求
- if (event == 1) {
- type = 1;
- val = $('input[name="jxapid"]').val();
- //赋值到 aptype 以及 apid
- $('input[name="aptype"]').val(1);
- $('input[name="apid"]').val(val);
- } else {
- console.log("-==33" + val);
- if ($('input[name="jxapid"]').val() != '') {
- type = 1;
- val = $('input[name="jxapid"]').val();
- } else {
- isAllow = false;
- console.log('没选择安排');
- }
- }
- cjlbval = $('input[name="cjlb"]').val();
- if (cjlbval == null || cjlbval == "") {
- isAllow = false;
- }
- var qz = $("input[name='cjlb'][class='content-onButton']").attr("qz");
- if (undefined == qz || null == qz || "" == qz) {
- qz = 0;
- }
- if (isAllow && val != "") {
- //查找选中值的相关属性。
- if(cjlbval.indexOf(",")!=-1){
- cjlbval = null;
- }
- $.ajax({
- url : '@service{name:"m_xy_gl_djcj_cx"}@', //查找数据的请求
- type : 'post',
- async : false,
- data : {
- 'apid' : val,
- 'type' : type,
- 'cjlb' : cjlbval,
- 'searchType' : "${searchType}",
- 'xyid' : "${xyid}"
- },
- success : function(result) {
- var data = eval("(" + result + ")");
- //填入值
- //分别填入安排信息和学员信息
- //安排信息
- var infoData = data.info[0];
- $("#td3").html(infoData.rxnd + "(" + (infoData.mm == "09" ? "秋季" : "春季") + ")");
- wd.edit.objectPicker.instance.bjid.initValue(infoData.bjid);
- wd.edit.objectPicker.instance.kcid.initValue(infoData.kcid);
- wd.edit.objectPicker.instance.xqm.initValue(infoData.xqm);
- //$("#td1").html(infoData.bjmc);
- //$("#td2").html(infoData.kcmc);
- //$("#td4").html(infoData.xqmc);
- //成绩信息
- /*if (data.cjinfo.length != 0) {
- $('input[name="save"]').css("display", "");
- $('input[name="subm"]').css("display", "");
- var cjInfoData = data.cjinfo[0];
- if ("qdrq" in cjInfoData)
- $('input[name="qdrq"]').val(formatDate(cjInfoData.qdrq));
- else
- $('input[name="qdrq"]').val("");
- if ("gbkssj" in cjInfoData)
- $('input[name="gbkssj"]').val(formatDate(cjInfoData.gbkssj));
- else
- $('input[name="gbkssj"]').val("");
- if ("gbjssj" in cjInfoData)
- $('input[name="gbjssj"]').val(formatDate(cjInfoData.gbjssj));
- else
- $('input[name="gbjssj"]').val("");
- } else {
- $('input[name="qdrq"]').val("");
- $('input[name="gbkssj"]').val("");
- $('input[name="gbjssj"]').val("");
- }
- $('.xylist').empty();
- //学员信息
- var stuData = data.stulist;
- var stuStr = "";
- for (var i in stuData) {
- console.log(stuData[i]);
- var stu = stuData[i];
- var str = "";
- str += "<tr>";
- str += "<input type='hidden' value='" + stu.ryid + "' name='xyid' />";
- str += "<input type='hidden' value='";
- if ("cjid" in stu)
- str += stu.cjid;
- else
- str += "null";
- str += "' name='cjid' />";
- str += "<td style='width: 205px;'>" + (stu.xyh ? stu.xyh : "") + "</td>";
- str += "<td>" + stu.xm + "</td>";
- str += "<td style='width: 275px;'>";
- var tempName = stu.ryid + 'cjly';
- str += '<input id="' + tempName + '_onoffbutton_list" type="radio" value="" wdname="' + tempName + '" nullable="false" onclass="content-onButton" offclass="content-offButton" style="display: none;"/>';
- str += '<input id=qk_' + stu.ryid + ' name="' + tempName + '" type="button" value="缺考" wdvalue="11" ryid="' + stu.ryid + '" style="margin-right:10px;" class="content-offButton"/>';
- str += '<input id=wj_' + stu.ryid + ' name="' + tempName + '" type="button" value="违纪" wdvalue="31" ryid="' + stu.ryid + '" style="margin-right:10px;" class="content-offButton"/>';
- str += '<input id=bk_' + stu.ryid + ' name="' + tempName + '" type="button" value="补考" wdvalue="51" ryid="' + stu.ryid + '" style="margin-right:10px; class="content-offButton" />';
- str += '<input id=mk_' + stu.ryid + ' name="' + tempName + '" type="button" value="免考" wdvalue="61" ryid="' + stu.ryid + '" class="content-offButton" />';
- str += '<script>(function(){wd.edit.onoffInit("radio","' + tempName + '","",true,"content-onButton","content-offButton",callbackFunction,"edit");'
- + 'wd.edit.onoffEdit("' + tempName + '",' + stu.cjlym + ');'
- + '})();';
- str += "<" + "/" + "script>";
- str += "</td>";
- var zpcj = stu.zpcj;
- zpcj = zpcj == 0 ? "" : zpcj.toFixed(1);
- var zpcjs = zpcj;
- if ("fs" in stu) {
- //判断是否有平时成绩总评
- if(1==stu.cjlbm&&1==stu.sfpscjzp&&stu.pscj&&stu.fs){
- var val = ((parseFloat(stu.pscj)+parseFloat(stu.fs))/2)*parseFloat(qz);
- zpcj = (parseFloat(zpcj)-(parseFloat(stu.pscj)*parseFloat(qz)))+parseFloat(val);
- }
- str += "<td><input type='text' value='" + stu.fs + "' id='fs" + stu.ryid + "' zpcj='" + zpcjs + "' pscj='" + stu.pscj + "' pscjcs='" + stu.pscjcs + "' pscjs='" + stu.pscjs + "' qzcj='" + stu.qzcj + "' qmcj='" + stu.qmcj + "' name='cjfs' onkeyup='clearNoNum(this)' onblur='hscj(this)' onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/></td>";
- str += "<td id='hscj'>" + zpcj + "</td>";
- } else { //为空时
- str += "<td><input type='text' value='' zpcj='" + zpcjs + "' pscj='" + stu.pscj + "' pscjcs='" + stu.pscjcs + "' pscjs='" + stu.pscjs + "' qzcj='" + stu.qzcj + "' qmcj='" + stu.qmcj + "' name='cjfs' id='fs" + stu.ryid + "' onkeyup='clearNoNum(this)' onblur='hscj(this)' onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/></td>";
- str += "<td id='hscj'>" + zpcj + "</td>";
- }
- str += "</tr>";
- $('.xylist').append($(str));
- }
- if(stuData.length>0){
- if (stuData[0].jlztm && stuData[0].jlztm != 1) {
- if (stuData[0].qdrq)
- $('input[name="qdrq"]').val(stuData[0].qdrq);
- if (stuData[0].gbkssj)
- $('input[name="gbkssj"]').val(stuData[0].gbkssj);
- if (stuData[0].gbjssj)
- $('input[name="gbjssj"]').val(stuData[0].gbjssj);
- $('.xylist input').attr("disabled", "disabled");
- $('input[name="save"]').attr('disabled', 'disabled');
- $('input[name="subm"]').attr('disabled', 'disabled');
- $('input[name="save"]').css("color", "#aaa");
- $('input[name="subm"]').css("color", "#aaa");
- } else {
- $('input[name="save"]').attr('disabled', false);
- $('input[name="subm"]').attr('disabled', false);
- $('input[name="save"]').css("color", "");
- $('input[name="subm"]').css("color", "");
- }
- }else{
- $('input[name="save"]').attr('disabled', false);
- $('input[name="subm"]').attr('disabled', false);
- $('input[name="save"]').css("color", "");
- $('input[name="subm"]').css("color", "");
- } */
- }
- });
- } else {
- var nowDate = new Date();
- var year = nowDate.getFullYear();
- var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
- var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
- var dateStr = year + "-" + month + "-" + day;
- $('input[name="qdrq"]').val(dateStr);
- $('input[name="gbkssj"]').val("");
- $('input[name="gbjssj"]').val("");
- $('.xylist').empty();
- }
- }
- </script>
- </head>
- <body>
- <div class="form-container">
- <div class="content-box fit-height-content"><%-- vue样式要套上这两套DIV Ben(20260414) --%>
- <!-- 查询 -->
- <form action="" name="cjform" method="post">
- <input type="hidden" name="xxx" value="${dataType}" />
- <%-- 改,在这选择。改为一级对象 grxcdjl(个人巡查点记录) 了。Lin
- <@input type="hidden" name="rcid" value="${rcid}" /> --%>
- <objp.ss name="rcid" cb="adminNoAddRcByZxxz"/>
- <div class="list-div list-search-div right-div content-div "
- style="height: 90% overflow-x:hidden; min-height:80%;">
- <table class="list aa" style=" float:right;width:100%!important;">
- <thead style="width: 100%">
- <tr style="border:none;">
- <th style="padding: 0 0 0 12px;width: 140px;">巡查点</th>
- <th style="width:85px;">情况描述</th>
- <th style="width: 275px;">处理描述</th>
- <th style="width:120px;">责任人</th>
- </tr>
- </thead>
- <tbody ssOddClazz="list-odd" ssEvenClazz="list-even" ssHovClazz="list-hover" class="xylist scrollbar" ssFith="{list:true,rowHeight:35}" >
- <rpt.ss name="ssList" id="item">
- <tr class="list-dim" >
- <td style='width: 205px;'></td>
- <td></td>
- <td style='width: 275px;'>
- <onoff.ss name="qxfs" val="1,2" mode="play" />
- </td>
- <td></td>
- <td></td>
- </tr>
- </rpt.ss>
- </tbody>
- </table>
- </div>
- <div class="bottom-div">
- <equal.ss val='${dataType=="play"}' val2="false">
- <div class="bottom-down-div">
- <%-- 改,二级对象的保存就是提交,新的提交只是放到二级对象草稿箱(不需要确认)。Lin
- <in@put type="button" name="save" value="保存" class="bottom-button"
- onclick="submitForm(1);" style="display: inline-block !important;">
- 再改,解决点击 保存 按钮后不能关闭弹出窗口的问题 -- <form action= 里增加 dest=
- 直接用标准的 <form 的提交。直接写到 <form action= 里
- <in@put type="button" name="save" value="保存" class="bottom-button"
- onclick="submitForm();" style="display: inline-block !important;"> --%>
- <input type="submit" value="保存" class="bottom-button"/>
- <%-- 去掉,界面上(业务上),二级对象没有提交 -- 二级对象的保存就是提交。Lin
- <in@put type="button" name="subm" value="提交" class="bottom-button"
- onclick="tjConfirm();" style="display: inline-block !important;">
- --%>
- <input type="button" value="取消" class="bottom-button"
- onclick="wd.display.closeDialog();">
- </div>
- </equal.ss>
- </div>
- </form>
- </div>
- </div>
- </body>
- <script type="text/javascript">
- function tjConfirm(){
- wd.display.confirm(" ","请确认成绩已全部录完,提交后不能在此页面修改!",function(){submitForm(2)},function(){return;});
- }
- function submitForm(type) {
- /* 去掉。Lin
- var qdsj = $("input[name='qdrq']").val();
- if (!qdsj || qdsj == undefined || qdsj == null) {
- wd.display.alert("请输入取得时间");
- return;
- }
- var gbkssj = $("input[name='gbkssj']").val();
- if (!(!gbkssj || gbkssj == undefined || gbkssj == null)&&new Date(gbkssj).getTime()<new Date(qdsj).getTime()) {
- wd.display.alert("公布开始时间需大于取得时间");
- return;
- }
- var gbjssj = $("input[name='gbjssj']").val();
- if (!(!gbjssj || gbjssj == undefined || gbjssj == null)&&new Date(gbjssj).getTime()<new Date(gbkssj).getTime()) {
- wd.display.alert("公布开始时间需大小于等于公布结束时间");
- return;
- }
- var cjlbval = $('input[name="cjlb"]').val();
- if (!cjlbval) {
- wd.display.alert("请选择成绩类别");
- return;
- }
- */
- //若是 保存更新,就不提交表单
- var f = $('form[name="cjform"]');
- if (type == 1) {
- /* 再改,改为 <form 提交 -- 点击 保存 按钮,关闭窗口。Lin
- $.ajax({
- url : "<serv.ss name='grxcdjl_excelSaveAddByZxxz'/>", // :"m_xy_gl_djcj_bc"。Lin
- type : "post",
- data : f.serialize(),
- beforeSend : function(result) {
- //将 保存 提交按钮改为 不可用
- $('input[name="save"]').attr('disabled', 'disabled');
- $('input[name="subm"]').attr('disabled', 'disabled');
- $('input[name="save"]').css("color", "#aaa");
- $('input[name="subm"]').css("color", "#aaa");
- },
- success : function(result) {
- var data = eval("(" + result + ")");
- if (data.result)
- //eval('@service{dest:"sys_info",show:"wdDialog",param:{"msg":"保存成功"}}@');
- wd.display.alert("保存成功");
- else
- //eval('@service{dest:"sys_info",show:"wdDialog",param:{"msg":"保存失败"}}@');
- wd.display.alert("保存失败");
- },
- error : function(result) {
- //eval('@service{dest:"sys_info",show:"wdDialog",param:{"msg":"保存失败"}}@');
- wd.display.alert("保存失败");
- },
- complete : function(result) {
- afterSelectPlan(1);
- /// *。Lin
- // $('input[name="save"]').attr('disabled', false);
- // $('input[name="subm"]').attr('disabled', false);
- // $('input[name="save"]').css("color", "#015a31");
- // $('input[name="subm"]').css("color", "#015a31");
- /// *
- }
- });
- */
- f.attr('action', "<serv.ss name='grxcdjl_excelSaveAddByZxxz' dest='info'/>"); // :"m_xy_gl_djcj_bc"。Lin
- f.submit();
- }
- if (type == 2) {
- f.attr('action', "<serv.ss name='grxcdjl_excelSubmAddByZxxz' dest='info'/>"); // :"m_xy_gl_djcj_tj",。Lin
- f.submit();
- }
- }
- // 回车下一个获取焦点
- function focusNextInput(thisInput) {
- var inputs = $("input[tab='tabField']"); // = $("input[name='cjfs']")。Lin
- for (var i = 0; i < inputs.length; i++) {
- // 如果是最后一个,则焦点回到第一个
- if (i == (inputs.length - 1)) {
- inputs[0].focus(); break;
- } else if (thisInput == inputs[i]) {
- inputs[i + 1].focus(); break;
- }
- }
- }
- // 上一个获取焦点
- function focusUpInput(thisInput) {
- // console.log(11111);
- var inputs = $("input[tab='tabField']"); // = $("input[name='cjfs']")。Lin
- for (var i = 0; i < inputs.length; i++) {
- // 如果是第一个,则焦点回到最后一个
- if (thisInput == inputs[i]) {
- inputs[i - 1].focus(); break;
- } else if (thisInput == inputs[0]) {
- inputs[inputs.length - 1].focus(); break;
- }
- }
- }
- function keydown_to_tab($input) { //聚焦
- // console.log($input)
- $($input).bind("keydown", function(e) {
- // var n = $('.cjfs').length; // 去掉,没用到。Lin
- // console.log(n,e.keyCode)
- if (e.keyCode == 40) { //键盘按下
- focusNextInput($input)
- } else if (e.keyCode == 38) { //键盘按上
- focusUpInput($input)
- }
- });
- }
- </script>
- </html>
|