| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>员工服装领用初始登记</title>
- <style>
- .ui-button {
- display: inline-block;
- padding: 2px 2px;
- margin-bottom: 0;
- font-size: 8px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- }
- </style>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#tt').tabs({
- onSelect:function(title){
- var height =window.top.document.body.offsetHeight;
- height = height -181.3 - 36 - 100 -4;//去掉底部输入框table高度、title高度、弹出框小于后台页面高度、文本格式高度
- $('#tt .panel-body').css('width','auto').css('height',height+'px');
- }
- });
- $(".tabs-wrap").css('width','100%');
-
- });
- function btn_ok(){
- var trList = $("#add_clothingUserDetail_table").children("tr");
- if(trList.length == 0){
- layer.alert("请至少输入一条货品详细信息");
- return;
- }
- $("#btnsub").click();
- }
- function btn_back(){
- window.closeCurrentDialog();
- }
- function callback(data){
- if(data.success){
- layer.alert(data.msg, function(index){
- frameElement.api.opener.refresh();
- window.closeCurrentDialog();
- });
- }
- else{
- layer.alert(data.msg);
- }
- }
- //初始化下标
- function resetTrNum(tableId) {
- $tbody = $("#"+tableId+"");
- $tbody.find('>tr').each(function(i){
- $(':input, select,button,a', this).each(function(){
- var $this = $(this), name = $this.attr('name'),id=$this.attr('id'),onclick_str=$this.attr('onclick'), val = $this.val();
- if(name!=null){
- if (name.indexOf("#index#") >= 0){
- $this.attr("name",name.replace('#index#',i));
- }else{
- var s = name.indexOf("[");
- var e = name.indexOf("]");
- var new_name = name.substring(s+1,e);
- $this.attr("name",name.replace(new_name,i));
- }
- }
- //add_clothingUserDetail_table
- var warehouseid = $("#warehouseid").val();
- var departid = $("#departid").val();
- //给明细添加弹出框
- name = $this.attr('name');
-
- if(id!=null){
- if (id.indexOf("#index#") >= 0){
- $this.attr("id",id.replace('#index#',i));
- }else{
- var s = id.indexOf("[");
- var e = id.indexOf("]");
- var new_id = id.substring(s+1,e);
- $this.attr("id",id.replace(new_id,i));
- }
- }
-
- if(onclick_str!=null){
- if (onclick_str.indexOf("#index#") >= 0){
- $this.attr("onclick",onclick_str.replace(/#index#/g,i));
- }else{
- }
- }
- });
- $(this).find('div[name=\'xh\']').html(i+1);
- });
- }
- function beforeSave(){
- $tbody = $("#add_clothingUserDetail_table");
- var ret = true;
- var lineNo = 0;
- $tbody.find('>tr').each(function(i){
- var quantity = $("[name='clothingUserDetailList["+i+"].quantity']").val();
- if(quantity > 0 && (!$("[name='clothingUserDetailList["+i+"].startdate']").val() || $("[name='clothingUserDetailList["+i+"].startdate']").val() == '')){
- ret = false;
- lineNo = i+1;
- }
- });
- if(!ret)
- tip('第'+lineNo+'行领用日期不能为空,请录入日期再提交');
- else
- $tbody.find('>tr').each(function(i){
- $(':input, select,button,a', this).each(function(){
- $("#add_clothingUserDetail_table").find("tr").eq(i).find("select").eq(0).removeAttr("disabled");
- });
- });
- return ret;
- }
- </script>
- </head>
- <body style="overflow-x: hidden;">
- <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" tiptype="1" action="clothingUserController.do?doInitAdd" beforeSubmit="beforeSave">
- <input id="userid" name="userid" type="hidden" value="${userid}"/>
- <input id="departid" name="departid" type="hidden" value="${departid}"/>
- <input id="postid" name="postid" type="hidden" value="${postid}"/>
- <t:tabs id="tt" iframe="false" tabPosition="top" fit="false" >
- <t:tab href="clothingUserController.do?initDetail&userid=${userid}&postid=${postid}&departid=${departid}" icon="icon-search" title="服装领用登记明细" id="clothingUserDetail" heigth="1000px">
- </t:tab>
- </t:tabs>
- <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;bottom:0px;">
- <tr>
- <td height="50px" align="center" colspan="8">
- <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
- <a style="margin-left:80px" href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">提交</a>
- <a href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
-
- </td>
- </tr>
- </table>
- </t:formvalid>
- </body>
-
|