| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545 |
- <%@ 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>
- <!-- 项目岗位明细表 -->
- <style>
- .seachdiv{
- padding : 15px 30px;
- background-color: #ffffff;
- box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05);
- border: solid 1px #dcdcdc;
- margin: 10px 10px 0px 10px;
- margin-bottom:1px;
- }
- </style>
- <input name="pid" id="pid" type="hidden" value="${pid}" />
- <input name="rowIndex" id="rowIndex" type="hidden" value="" />
- <input name="ptjPostGeneralid" id="ptjPostGeneralid" type="hidden" value="${ptjPostGeneralid}" />
- <div class="easyui-layout" fit="true" >
- <div region="center" style="padding:0px;border:0px">
-
- <t:datagrid name="projectPostDetailList" checkbox="false" fitColumns="true" nowrap="false" title="${departname}-项目岗位列表" actionUrl="projectPostDetailController.do?datagrid&pid=${pid}" idField="id" fit="true" pagination="false" queryMode="group">
- <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="项目岗位名称" field="ptjPostName" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="岗位类型" field="postid" queryMode="single" dictionary="t_bus_post,id,post_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
- <t:dgCol title="项目岗位总揽表ID" field="ptjPostGeneralid" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="所需人数" field="needNumber" style="text-align: right;" 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" 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" 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="deleteFlag" hidden="true" queryMode="single" dictionary="del_flag" width="120"></t:dgCol>
- <%-- <t:dgCol title="操作" field="opt"></t:dgCol>
- <t:dgDelOpt title="删除" url="projectPostDetailController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>
- <t:dgToolBar title="录入" icon="icon-add" operationCode="add" url="projectPostDetailController.do?goAdd" funname="add"></t:dgToolBar>
- <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="projectPostDetailController.do?goUpdate" funname="update"></t:dgToolBar>
- <t:dgToolBar title="批量删除" icon="icon-remove" operationCode="remove" url="projectPostDetailController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
- <t:dgToolBar title="查看" icon="icon-search" url="projectPostDetailController.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:dgToolBar title="删除" icon="icon-remove" operationCode="remove" funname="logicDel"></t:dgToolBar>
- </t:datagrid>
- <script>
- $(function() {
- var datagrid = $("#projectPostDetailListtb");
- datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
- $("#pinjie1").html('');
- /* datagrid.children("span:first").after($("#hengxian1 div[name='hengxian2']").html());
- $("#hengxian1").html(''); */
- /* datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
- $("#pinjiechaxun1").html(''); */
- //datagrid.children(".datagrid-toolbar").children("span:first").before($("#hengxian1 div[name='hengxian2']").html());
- // $("#hengxian1").html('');
- datagrid.children(".datagrid-toolbar").children("span:first").before($("#pinjie2 div[name='pinjie21']").html());
- $("#pinjie2").html('');
- });
-
-
- </script>
- <div id="pinjie1">
- <div name="pinjie2" style="padding:3px; height: auto" >
- <div title="新建数据" name="editPanel" id="editPanel" fit="true" class="seachdiv">
- <t:formvalid formid="formobj" dialog="false" tipSweep="true" layout="table" action="" tiptype="1" callback="callback">
- <input name="id" id="id" type="hidden" value="" />
- <table id="myTable" >
- <tbody>
- <tr>
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span>项目岗位名称:
- </label>
- </td>
- <td class="value">
- <input id="ptjPostName" name="ptjPostName" type="text" style="width: 240px" class="inputxt" maxlength="20" datatype="*1-20" errormsg="项目岗位名称最多20文字" placeholder="请输入项目岗位名称(1-20字符)" ignore="ignore"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">项目岗位名称</label>
-
- </td>
-
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span>岗位类型:
- </label>
- </td>
- <td class="value">
- <%--update-start--Author:jg_renjie Date:20160320 for:#942 【组件封装】所属部门弹出模式,目前是列表,得改造成树方式--%>
- <input id="postName" name="postName" type="text" readonly="readonly" class="inputxt" datatype="*" value="${postName}" placeholder="请选择岗位" onclick="openDepartmentSelect()" ignore="ignore">
- <input id="postid" name="postid" type="hidden" value="${postid}">
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a>
- <%--update-end--Author:jg_renjie Date:20160320 for:#942 【组件封装】所属部门弹出模式,目前是列表,得改造成树方式--%>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">岗位类型</label>
- </td>
- </tr>
- <tr >
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span>所需人数:
- </label>
- </td>
- <td class="value">
- <!-- <input id="needNumber" name="needNumber" type="text" style="width: 240px" class="inputxt" maxlength="3" datatype="/^\d{1,3}$/" errormsg="所需人数数最多3位数字" placeholder="请输入所需人数" ignore="ignore"/> -->
- <input id="needNumber" name="needNumber" type="text" style="width: 240px" class="inputxt" maxlength="3" placeholder="请输入所需人数" ignore="ignore"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">所需人数</label>
- </td>
- <td align="right">
- <label class="Validform_label">
- 备注:
- </label>
- </td>
- <td class="value">
- <input id="remark" name="remark" type="text" style="width: 340px" class="inputxt" maxlength="50" datatype="*0-50" errormsg="备注最多50文字" placeholder="请输入项目岗位备注" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">备注</label>
- </td>
- <td>
- <div style="margin-left: 60px;">
- <a href="#" style="float: right;" class="easyui-linkbutton l-btn l-btn-plain" plain="true" icon="icon-clean" onclick="clearData()">清空</a>
- <a href="#" style="float: right;" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-save" plain="true" onclick="btn_ok()">保存</a>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
- </t:formvalid>
- </div>
- <!-- <div title="" style="height:35px" name="editPanel2" id="editPanel2" fit="true">
- <a href="#" style="float: right;" class="easyui-linkbutton l-btn l-btn-plain" plain="true" icon="icon-clean" onclick="clearData()">清空</a>
- <a href="#" style="float: right;" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-save" plain="true" onclick="btn_ok()">保存</a>
-
- </div> -->
- </div>
- </div>
-
-
- <!-- <script>
- $(function() {
- var datagrid = $(".datagrid-view");
- datagrid.after($("#tempSavePostInfo div[name='SavePostInfo1']").html());
- $("#tempSavePostInfo").html('');
-
-
- });
- </script>
- <div id="tempSavePostInfo" style="display: none;">
- <div name="SavePostInfo1">
- <div name="SavePostInfo" style="text-align: center;" class="datagrid-toolbar">
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-return" id="departRedo" onclick="callbackPostGeneralList()">返回</a>
- </div>
- </div>
- </div> -->
-
- <div id="pinjie2" style="display: none;">
- <div name="pinjie21">
- <span style="float:left;margin-bottom:4px;">
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-return" id="departRedo" onclick="callbackPostGeneralList()">返回</a>
- </span>
- </div>
- </div>
-
- </div>
- </div>
- <script src = "webpage/cn/com/lzt/projectpostdetail/projectPostDetailList.js"></script>
- <script type="text/javascript">
-
- //导入
- function ImportXls() {
- openuploadwin('Excel导入', 'projectPostDetailController.do?upload', "projectPostDetailList");
- }
- //导出
- function ExportXls() {
- JeecgExcelExport("projectPostDetailController.do?exportXls","projectPostDetailList");
- }
- //模板下载
- function ExportXlsByT() {
- JeecgExcelExport("projectPostDetailController.do?exportXlsByT","projectPostDetailList");
- }
- //新增
- function add(title,url,id){
- window.location.href=url;
- }
- //修改
- function update(title,url, id){
- updateNotCreateWin("修改",url, "projectPostDetailList",false);
- }
- //查看
- function view(title,url, id){
- viewNotCreateWin("查看",url, "projectPostDetailList",false);
- }
-
- /* $(document).ready(function(){
- //datagrid 隐藏行号
- $('#projectPostDetailList').datagrid({rownumbers:false});
- }); */
-
-
-
- //正则验证只能输入最多3位数
- //datatype="/^\d{1,6}(?:\.\d{0,2}$|$)/"
- function regx(str){
- var regx = /^\d{1,3}$/;
- if(regx.test(str)){
- return true;
- }else{
- return false;
- }
- }
-
-
- //自定义保存按钮
- function btn_ok(){
- var flag = $("#formobj").Validform().check(true);
- if(flag!=true){
- $("#btnsub").click();
- return false;
- }
-
- var id=$('#id').val();
- var ptjPostName=$('#ptjPostName').val();
- var ptjPostGeneralid=$('#ptjPostGeneralid').val();
- var pid=$('#pid').val();
- var postid=$('#postid').val();
- var needNumber=$('#needNumber').val();
- var remark=$('#remark').val();
-
- if(ptjPostName.length==0){
- layer.alert("请输入项目岗位名称");
- return false;
- }
-
- if(ptjPostName!=null&&ptjPostName.length>0){
- if(ptjPostName.indexOf(",")!=-1){
- layer.alert("项目岗位名称不允许有逗号");
- return false;
- }
- }
-
- if(postid.length==0){
- layer.alert("请选择岗位类型");
- return false;
- }
-
- if(needNumber.length==0){
- layer.alert("请输入所需人数");
- return false;
- }
-
- if(isNaN(needNumber)==true||parseInt(needNumber)<=0){
- layer.alert("所需人数请输入合法格式的数字");
- return false;
- }
-
-
- //check项目岗位名称
- $.ajax({
- url : "projectPostGeneralController.do?ajaxCheckPtjPostName",
- type : 'post',
- data : {
- id : id,
- ptjPostName : ptjPostName,
- pid : pid
- },
- cache : false,
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- if(d.success==false){
- layer.alert(d.msg);
- return false;
- }else{
- var overallSituation="";
- //获得所有行数据
- var rowsAll = $("#projectPostDetailList").datagrid('getData').rows;
- if(rowsAll.length>0){
- for(var i=0;i<rowsAll.length;i++){
- if(id!=null&&id.length>0){
- if(rowsAll[i].id!=id){
- if(overallSituation.length==0){
- overallSituation=rowsAll[i].ptjPostName+"-"+rowsAll[i].needNumber;
- }else{
- overallSituation+=","+rowsAll[i].ptjPostName+"-"+rowsAll[i].needNumber;
- }
- }
- }else{
- if(overallSituation.length==0){
- overallSituation=rowsAll[i].ptjPostName+"-"+rowsAll[i].needNumber;
- }else{
- overallSituation+=","+rowsAll[i].ptjPostName+"-"+rowsAll[i].needNumber;
- }
- }
- }
- }
- if(overallSituation.length==0){
- overallSituation=ptjPostName+"-"+needNumber;
- }else{
- overallSituation+=","+ptjPostName+"-"+needNumber;
- }
-
- $.ajax({
- url : "projectPostGeneralController.do?saveRows",
- type : 'post',
- data : {
- id : id,
- ptjPostName : ptjPostName,
- ptjPostGeneralid : ptjPostGeneralid,
- pid : pid,
- postid : postid,
- needNumber : needNumber,
- remark : remark,
- overallSituation : overallSituation
- },
- cache : false,
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- if(d.attributes.ptjPostGeneralid!=null&&d.attributes.ptjPostGeneralid.length>0){
- $('#ptjPostGeneralid').val(d.attributes.ptjPostGeneralid);
-
- }
- callback(d);
- }
- });
- }
- }
- });
-
-
- }
-
- //check项目岗位名称
- /* function ptjPostNameCheck(id,ptjPostName,pid){
- $.ajax({
- url : "projectPostGeneralController.do?ajaxCheckPtjPostName",
- type : 'post',
- data : {
- id : id,
- ptjPostName : ptjPostName,
- pid : pid
- },
- cache : false,
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- if(d.success==false){
- layer.alert(d.msg);
- return false;
- }
- }
- });
- } */
-
-
-
- //保存数据后刷新当前页面数据
- function callback(data){
- //debugger;
- if(data.success){
- // var ptjPostGeneralid=$('#ptjPostGeneralid').val();
- clearData();
- // var myFormUrl="projectPostDetailController.do?datagrid&ptjPostGeneralid="+ptjPostGeneralid;
- // $("#projectPostDetailListtb").attr("actionUrl",myFormUrl);
- $("#projectPostDetailList").datagrid('reload');
- top.tip(data.msg);
- }else{
- layer.alert(data.msg);
- }
- }
-
- //清空数据
- function clearData(){
- var rowData = {};
- fillData(rowData);
- $("#projectPostDetailList").datagrid('clearChecked');
- $("#projectPostDetailList").datagrid('unselectAll');
- //清空编辑时定义的rowIndex
- // $("#rowIndex").val("");
- }
-
- function fillData(rowData){
- //清空表单
- $("#formobj").form('clear');
- //填充数据
- for(var d in rowData){
- $("#"+d).val(rowData[d]);
- }
- }
-
- /* $(document).ready(function(){
- //动态添加form表单actionUrl数据
- function getmyptjPostGeneralid(){
- var ptjPostGeneralid=$('#ptjPostGeneralid').val();
- return ptjPostGeneralid;
- }
- }); */
- //选择按钮
- function openDepartmentSelect() {
- //$.dialog.setting.zIndex = getzIndex();
- var orgIds = $("#postid").val();
- $.dialog({content: 'url:projectPostDetailController.do?postZTree&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(var i=0;i<nodes.length;i++){
- var node = nodes[i];
- ids += node.id+',';
- names += node.name+',';
- }
- // setCookie(ids);
- if(names.length!=0){
- $('#postName').val(names.substring(0,names.length-1));
- }
-
-
- $('#postName').blur();
- $('#postid').val(ids);
- }else{
- layer.alert("请选择岗位类型");
- return false;
- }
- }
-
- function callbackClean(){
- $('#postName').val('');
- $('#postid').val('');
- }
-
- //编辑数据输入框复现
- $(function(){
- $("#projectPostDetailList").datagrid({
- onClickRow: function(rowIndex, rowData){
- $('#rowIndex').val(rowIndex);
- $('#id').val(rowData.id);
- $('#ptjPostName').val(rowData.ptjPostName);
- $('#postid').val(rowData.postid+',');
- $('#needNumber').val(rowData.needNumber);
- $('#remark').val(rowData.remark);
- $.ajax({
- url : "projectPostDetailController.do?getPName",
- type : 'post',
- data : {
- id : rowData.postid
- },
- cache : false,
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- $('#postName').val(d.msg);
- }
- });
- }
- });
- });
-
- //逻辑删除
- function logicDel(){
- var rows = $("#projectPostDetailList").datagrid('getSelections');
- if (rows.length > 0) {
- $.messager.confirm("确认", "确定要删除这条数据?", function (r) {
- if (r) {
- var id="";
- for ( var i = 0; i < rows.length; i++) {
- id=rows[0].id;
- }
-
- var ptjPostGeneralid=$('#ptjPostGeneralid').val();
- var pid=$('#pid').val();
-
- var overallSituation="";
- //获得所有行数据
- var rowsAll = $("#projectPostDetailList").datagrid('getData').rows;
- if(rowsAll.length>0){
- for(var i=0;i<rowsAll.length;i++){
- if(rowsAll[i].id!=id){
- if(overallSituation.length==0){
- overallSituation=rowsAll[i].ptjPostName+"-"+rowsAll[i].needNumber;
- }else{
- overallSituation+=","+rowsAll[i].ptjPostName+"-"+rowsAll[i].needNumber;
- }
- }
- }
- }
-
- $.ajax({
- url : "projectPostGeneralController.do?logicDelProjectPostDetailUpdateProjectPostGeneral",
- type : 'post',
- data : {
- id : id,
- ptjPostGeneralid : ptjPostGeneralid,
- pid : pid,
- overallSituation : overallSituation
- },
- cache : false,
- success : function(data) {
- var d = data; // ------ $.parseJSON(data);
- if (d.success) {
- tip(d.msg);
- $("#projectPostDetailList").datagrid('reload');
- clearData();
- id='';
- }else{
- layer.alert(d.msg);
- }
- }
- });
- }
- });
- } else {
- layer.alert("请选择需要删除的数据");
- }
- }
-
- //取消
- function callbackPostGeneralList(){
- window.location.href="projectPostGeneralController.do?list";
- }
-
- //保存
- function savePostGeneral(){
- window.location.href="projectPostGeneralController.do?list";
- }
-
-
-
- </script>
|