123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- {Template header}
- <body>
- <div class="warp">
- <div class="title winnone">变动信息 - 添加</div>
- <ul class="setting">
- <li class="length remark">
- <em>变更详情:</em>
- <textarea name="data"></textarea>
- </li>
- <li>
- <em>变更日期:</em>
- <input class="must" value="" name="time" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD'})">
- <i class="time fa fa-calendar fa-lg"></i>
- </li>
- <div style="clear:both;"></div>
- </ul>
- <div class="button"><font class="stafflistadd">提 交</font> <font class="fh">关 闭</font></div>
- </div>
- <input type="hidden" name="uid" value="{$_GET['uid']}" />
- <script>var addedit="/staff/listadd/";
- $(".stafflistadd").click(function() {
- $(".ts p").html("<i class='fa fa-2x fa-cog fa-spin'></i> 正在添加中,请稍后...");
- $(".ts").show();
- var f = "";
- var e = "";
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- var str = $(this).val().replace(/\+/g,"%2B");
- var str = str.replace(/&/g,"%26");
- f = f + $(this).attr("name") + "=" + str + "&";
- });
- $("input:password").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("textarea").each(function() {
- var str2 = $(this).val().replace(/\+/g,"%2B");
- var str2 = str2.replace(/&/g,"%26");
- f = f + $(this).attr("name") + "=" + str2 + "&";
- });
- if($(".scimg img").length > 0)
- {
- var a = '';
- for (var b = 0; b < $(".scimg .upimg img").length; b++)
- {
- a = a + $(".scimg .upimg img")[b].src + "|";
- }
- for (var b = 0; b < $(".scimg .upimg video").length; b++)
- {
- a = a + $('.scimg .upimg video')[b].src + "|";
- }
- var a = a.replace(/\+/g,"%2B");
- var a = a.replace(/&/g,"%26");
- f = f + "img=" + a + "&";
- }
- for(i=0;i<$(".checkbox").length;i++)
- {
- var checkid = ""; var checkname = "";
- $(".checkbox:eq("+i+") .ckrows input:checked").each(function(){
- checkname = $(this).attr("name");
- checkid = checkid + $(this).val()+",";
- });
- if(checkname == "")
- {
- $(".ts p").text($(".checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- f = f + checkname + "=" + checkid + "&";
-
- }
-
- for(i=0;i<$(".checkboxfbt").length;i++)
- {
- var checkid = ""; var checkname = "";
- $(".checkboxfbt:eq("+i+") .ckrows input:checked").each(function(){
- checkname = $(this).attr("name");
- checkid = checkid + $(this).val()+",";
- });
- if(checkname != "")
- {
- f = f + checkname + "=" + checkid + "&";
- }
-
- }
- var ab = 0;
- $(".must").each(function() {
- if ($.trim($(this).val()).length == 0) {
- $(this).css("border", "1px solid #F66");
- ab = ab + 1;
- }
- });
- if (ab > 0) {
- $(".ts p").text("红框为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- $.ajax({
- url: addedit,
- data: f,
- type: "POST",
- dataType: "json",
- success: function(a) {
- if (a && a.success) {
- $(".ts").hide();
- staffedit(a.id,a.data,a.time);
- var nm = $("input[name=page]",window.parent.parent.document).val();
- var id = $(this).data("id");
- window.parent.searchspanedit(nm,id);
- $(".fh").click();
-
- } else {
- $(".ts").hide();
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('$(".ts").fadeOut()', 800);
- }
- }
- });
- });
- </script>
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
- {Template footer}
|