| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <div class="easyui-layout" fit="true">
- <input id="tempTime" name="tempTime" type="hidden" value=""/>
- <input id="strDate" name="strDate" type="hidden" value=""/>
- <div region="center" style="padding:0px;border:0px;overflow: auto;">
- <t:datagrid name="projarrangeDetailList" checkbox="false" fitColumns="false" title="项目排班详细表" actionUrl="projarrangeDetailController.do?datagrid" idField="id" fit="true" queryMode="group">
- <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="项目排班总揽表ID" field="projarrangeGeneralid" hidden="true" formatter="yyyy-MM-dd" query="false" queryMode="single" dictionary="t_bus_projarrange_general,id,arrange_duty_month" width="120"></t:dgCol>
- <t:dgCol title="岗位" field="postid" query="false" queryMode="single" dictionary="t_bus_post,id,post_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
- <t:dgCol title="员工姓名" field="userid" queryMode="single" dictionary="t_s_base_user,id,realname" width="120"></t:dgCol>
- <t:dgCol title="上班天数(小时)" field="workingDays" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="超时加班(小时)" field="timeoutOvertimeHours" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="国定加班(小时)" field="countryOvertimeHours" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="值班天数(小时)" field="ondutyDays" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="备注" field="remark" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd hh:mm:ss" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd hh:mm:ss" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="所属部门" field="sysOrgCode" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="所属公司" field="sysCompanyCode" hidden="true" queryMode="single" width="120"></t:dgCol>
- <%-- <t:dgCol title="操作" field="opt"></t:dgCol> --%>
- <%-- <t:dgDelOpt title="删除" url="projarrangeDetailController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>
- <t:dgToolBar title="录入" icon="icon-add" operationCode="add" url="projarrangeDetailController.do?goAdd" funname="add"></t:dgToolBar>
- <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="projarrangeDetailController.do?goUpdate" funname="update"></t:dgToolBar>
- <t:dgToolBar title="批量删除" icon="icon-remove" operationCode="remove" url="projarrangeDetailController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
- <t:dgToolBar title="查看" icon="icon-search" url="projarrangeDetailController.do?goUpdate" funname="detail"></t:dgToolBar>
- <t:dgToolBar title="导入" icon="icon-putout" operationCode="put" funname="ImportXls"></t:dgToolBar>
- <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
- <t:dgToolBar title="模板下载" icon="icon-putout" operationCode="putout" funname="ExportXlsByT"></t:dgToolBar> --%>
- </t:datagrid>
- </div>
-
- <script>
- $(function() {
- var datagrid = $("#projarrangeDetailListtb");
- datagrid.prepend($("#arrangeDutyMonth1 div[name='arrangeDutyMonth2']").html());
- $("#arrangeDutyMonth1").html('');
- });
- </script>
- <div id="arrangeDutyMonth1" style="display: none;">
- <div name="arrangeDutyMonth2">
- <div name="arrangeDutyMonth">
- <table>
- <tr>
- <td>
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span>排班月度:
- </label>
- <input id="arrangeDutyMonth" name="arrangeDutyMonth" type="text" style="width: 150px" placeholder="请选择排班月度" class="Wdate" datatype="*" onclick="WdatePicker({onpicked:arrangeDutyMonthChange(),dateFmt:'yyyy-MM'})" readonly="readonly" value=""/>
- </td>
- <td>
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span>项目名称:
- </label>
- <input readonly="true" type="text" id="departname" name="departname" style="width: 150px" placeholder="请选择项目名称" onclick="openDepartmentSelect()">
- <input id="pid" name=pid type="hidden" value="">
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="departSearch" onclick="openDepartmentSelect()">选择</a>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-redo" id="departRedo" onclick="callbackClean()">清空</a>
- </td>
- <td style="width: 500px;text-align: right;">
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" operationCode="add" id="" onclick="">自动排班</a>
- </td>
- </tr>
- <tr>
- <td></td><td></td>
- <td style="width: 500px;text-align: right;">
- <a href="#" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-search" plain="true" onclick="">刷新</a>
- <a href="#" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-save" plain="true" onclick="btn_ok()">保存</a>
- <a href="#" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-putout" plain="true" onclick="">上报</a>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- <script src = "webpage/cn/com/lzt/projarrangedetail/projarrangeDetailList.js"></script>
- <script type="text/javascript">
-
-
- //导入
- function ImportXls() {
- openuploadwin('Excel导入', 'projarrangeDetailController.do?upload', "projarrangeDetailList");
- }
- //导出
- function ExportXls() {
- JeecgExcelExport("projarrangeDetailController.do?exportXls","projarrangeDetailList");
- }
- //模板下载
- function ExportXlsByT() {
- JeecgExcelExport("projarrangeDetailController.do?exportXlsByT","projarrangeDetailList");
- }
- //新增
- function add(title,url,id){
- window.location.href=url
- }
- //修改
- function update(title,url, id){
- updateNotCreateWin("修改",url, "projarrangeDetailList",false);
- }
- //查看
- function view(title,url, id){
- viewNotCreateWin("查看",url, "projarrangeDetailList",false)
- }
-
- $(function(){
- var arrangeDutyMonth=getYearMonth();
- $("#arrangeDutyMonth").val(arrangeDutyMonth);
- $("#tempTime").val(arrangeDutyMonth);
- getData(arrangeDutyMonth);
- })
-
- //异步获取表单数据
- function getData(arrangeDutyMonth){
- var pid="";
-
- pid=$("#pid").val();
- var arr = arrangeDutyMonth.split("-");
- //获取当前年
- var year=arr[0];
- //获取当前月
- var month=arr[1];
- var htmlCode="";
- $.ajax({
- url : "projarrangeDetailController.do?getCalendar",
- type : 'post',
- data : {
- year : year,
- month : month
- },
- cache : false,
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- //console.log(d.attributes[0]);
- var strDate="";
- for(var i=d.attributes[0].length-1;i>=0;i--){
- if(htmlCode.length!=0){
- htmlCode+="<td width='120' field='"+d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day+"' >"+
- "<div class='datagrid-cell' style='width: 104px;'><span>"+
- d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
- "</span><span class='datagrid-sort-icon'> </span></div></td>";
- }else{
- htmlCode="<td width='120' field='"+d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day+"' >"+
- "<div class='datagrid-cell' style='width: 104px;'><span>"+
- d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
- "</span><span class='datagrid-sort-icon'> </span></div></td>";
- }
-
- if(strDate.length!=0){
- strDate+=","+d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day;
- }else{
- strDate=d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day;
- }
- }
- /* for(var i=d.attributes[0].length-1;i>=0;i--){
- if(htmlCode.length!=0){
- htmlCode+="<td field='a"+i+"a' >"+
- "<div class='datagrid-cell' style='width: 104px;'><span>"+
- d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
- "</span><span class='datagrid-sort-icon'> </span></div></td>";
- }else{
- htmlCode="<td field='a"+i+"a' >"+
- "<div class='datagrid-cell' style='width: 104px;'><span>"+
- d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
- "</span><span class='datagrid-sort-icon'> </span></div></td>";
- }
-
- if(strDate.length!=0){
- strDate+=","+"a"+i+"a";
- }else{
- strDate=+"a"+i+"a";
- }
- } */
- var myTable=$(".datagrid-view2").children("div").children("div").children("table").children("tbody").children("tr:first");
- myTable.children("td:first").next().next().next().after(htmlCode);
- $("#strDate").val(strDate);
-
-
- //var myTable1=$(".datagrid-view2").parent("div").next("div").children("table").children("tbody").children("tr:first").children("td");;
- //console.log(myTable1.length);
- /* var strDate=$("#strDate").val();
- var strDateArr=strDate.split(",");
- var htmlCode1="<tr>";
-
- for(var i=0;i<strDateArr.length;i++){
- htmlCode1 += "<td>"+ i+1+"</td>";
- }
- htmlCode1+="</tr>";
- // console.log(htmlCode1);
- $(".datagrid-view2").children("div").next("div").children("table").children("tbody").append(htmlCode);; */
-
- $('#projarrangeDetailList').datagrid('insertRow',{
- //index: rowIndex, // 索引从0开始
- row: {
- postid: "1",
- userid: "1",
- timeoutOvertimeHours: "1",
- workingDays: "1"
-
- }
- });
-
- }
- });
- }
-
- function getYearMonth(){
- var myDate = new Date();
- //获取当前年
- var year=myDate.getFullYear();
- //获取当前月
- var month=myDate.getMonth()+1;
- //获取当前日
- //var date=myDate.getDate();
- return year+"-"+month;
- }
-
- //选择排班月度
- function arrangeDutyMonthChange(){
- //debugger;
- var arrangeDutyMonth="",tempTime="",strDate="";
- arrangeDutyMonth=$("#arrangeDutyMonth").val();
- tempTime=$("#tempTime").val();
- strDate=$("#strDate").val();
- var strDateArr=strDate.split(",");
- var xxx="";
- if(tempTime!=arrangeDutyMonth){
- $("#tempTime").val(arrangeDutyMonth);
- var myTable=$(".datagrid-view2").children("div").children("div").children("table").children("tbody").children("tr:first");
- for(var i=0;i<strDateArr.length;i++){
- //myTable.find('"td#' + strDateArr[i]+'"').remove();
- //$('"#' + strDateArr[i]+'"').remove();
- myTable.children("td[field='"+strDateArr[i]+"']").remove();
- if(xxx.length!=0){
- xxx+=","+strDateArr[i]+":'"+i+"'";
- }else{
- xxx=strDateArr[i]+":'"+i+"'";
- }
- }
- // console.log(xxx);
- getData(arrangeDutyMonth);
- }
- }
-
-
- //部门选择==========
- function openDepartmentSelect() {
- //$.dialog.setting.zIndex = getzIndex();
- var orgIds = $("#pid").val();
- $.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: getzIndex(), title: '所属部门列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
- {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
- {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
- ]}).zindex();
- }
-
- function callbackDepartmentSelect() {
- var iframe = this.iframe.contentWindow;
- var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
- var nodes = treeObj.getCheckedNodes(true);
- if(nodes.length>0){
- var ids='',names='';
- for(i=0;i<nodes.length;i++){
- var node = nodes[i];
- ids += node.id+',';
- names += node.name+',';
- }
- $('#departname').val(names);
- $('#departname').blur();
- $('#pid').val(ids);
- }
- }
- function callbackClean(){
- $('#departname').val('');
- $('#pid').val('');
- }
- //部门选择==========
- </script>
|