123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <!DOCTYPE html>
- <html>
- <head>
- <!--#include file="common/_header.html"-->
- <title>项目详情页</title>
- </head>
- <body>
- <article class="page-container">
- <form class="form form-horizontal" id="form1">
- <input type="hidden" class="input-text" id="projectId" name="projectId">
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3">履约时间:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input id="timeNode1" name="timeNode1" class="input-text" style="width:180px;" onfocus="WdatePicker({dateFmt:'yyyy-MM',readOnly:true})" />
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3">开工时间:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input id="timeNode2" name="timeNode2" class="input-text" style="width:180px;" onfocus="WdatePicker({dateFmt:'yyyy-MM',readOnly:true})" />
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3">投产时间:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input id="timeNode3" name="timeNode3" class="input-text" style="width:180px;" onfocus="WdatePicker({dateFmt:'yyyy-MM',readOnly:true})" />
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3">实际履约时间:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input id="fulfillTime" name="fulfillTime" class="input-text" style="width:180px;" onfocus="WdatePicker({dateFmt:'yyyy-MM',readOnly:true})" />
- </div>
- </div>
- </form>
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
- <input class="btn btn-primary radius" type="button" id="subForm" value=" 提交 ">
- </div>
- </div>
- </article>
- <!--_footer 作为公共模版分离出去-->
- <!--#include file="common/_footer.html"-->
- <!--/_footer 作为公共模版分离出去-->
- <!--请在下方写此页面业务相关的脚本-->
- <script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
- <script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
- <script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
- <script type="text/javascript" src="scripts/global.js"></script>
- <!--引入webuploader-->
- <link rel="stylesheet" type="text/css" href="lib/webuploader/0.1.5/webuploader.css">
- <script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.js"></script>
- <!-- select2 start-->
- <link rel="stylesheet" type="text/css" href="lib/select2/select2.min.css" />
- <script src="lib/select2/select2.full.js" type="text/javascript"></script>
- <script src="lib/select2/select2.zh-CN.js" type="text/javascript"></script>
- <!-- select2 end -->
- <script type="text/javascript">
- var path = global_backend_url;
- $(document).ready(function(){
- //获取url中传参
- var id = getQueryString("id");
- var needLoad = false;
-
- var remoteUrl = path + "/project/add";
-
- if(id!=null && id.length>0){
- remoteUrl = path + "/project/update";
- needLoad = true;
- }
-
- $("#form1").validate({
- onkeyup:false,
- focusCleanup:true,
- success:"valid",
- submitHandler:function(form){
- var loadingIndex = layer.load(1, {shade: [0.1,'#fff']});
- $(form).ajaxSubmit({
- type: 'post',
- url: remoteUrl,
- success: function(data){
- layer.close(loadingIndex);
- if(data.result){
- layer.msg('修改成功!',{icon:1,time:1000});
-
- var index = parent.layer.getFrameIndex(window.name);
-
- if(index>=0){
- parent.reloadList();
- parent.layer.close(index);
- }
- }
- else{
- layer.msg(data.message,{icon:1,time:1000});
- }
- },
- error: function(XmlHttpRequest, textStatus, errorThrown){
- layer.msg('error!',{icon:1,time:1000});
- }
- });
- }
- });
-
- if(needLoad){
- var loadingIndex = layer.load(1, {shade: [0.1,'#fff']});
-
- $.get(path + "/project/detail/" + id,null, function(json){
- layer.close(loadingIndex);
-
- if(json.result){
- json2Form(json.data,"form1");
- // if(json.data.procInstId != null ){
- // $("#projectAdminId").attr("disabled", true);
- // }
- loadFile(json.data.pfList);
- }
- else{
- layer.msg(json.message);
- }
- },"json");
- }
-
- $("#subForm").click(function(){
- $("#form1").submit();
- });
- });
-
- function getSelect(id,value){
- if(value != null){
- var Html = "<option value='"+value.id+"' selected>" + value.realName + "</option>";
- $('#' + id).append(Html);
- //$('#' + id).select2();
- }
-
- $("#" + id).select2({
- language: "zh-CN",
- placeholder:"请输入用户姓名",//文本框的提示信息
- minimumInputLength:0, //至少输入n个字符,才去加载数据
- allowClear: true, //是否允许用户清除文本信息
- ajax:{
- url:path + "/jpAdmin/selectUser", //地址
- type: "POST",
- dataType:'json', //接收的数据类型
- delay:250,
- cache: true,
- processResults: function (data) {
- var results = data.map(function(item){
- return {
- id : item.userId,
- text : item.realName,
- userName: item.userName,
- orgName : item.orgName
- }
- });
- return {
- results: results
- }
- }
- },
- language: "zh-CN",
- templateResult: function (state) {
- var html = "<div>";
- html += "<strong>姓名:" + state.text + "</strong>(" + state.userName + ")<br/>";
- html += "单位:" + state.orgName;
- html += "</div>";
- return $(html);
- }
- });
- }
- function getSelectMany(id,userId,userName){
- $("#" + id).select2({
- language: "zh-CN",
- placeholder:"请输入用户姓名",//文本框的提示信息
- minimumInputLength:0, //至少输入n个字符,才去加载数据
- allowClear: false, //是否允许用户清除文本信息
- multiple:true,
- ajax:{
- url:path + "/jpAdmin/selectUser", //地址
- type: "POST",
- dataType:'json', //接收的数据类型
- delay:250,
- cache: true,
- processResults: function (data) {
- var results = data.map(function(item){
- return {
- id : item.userId,
- text : item.realName,
- userName: item.userName,
- orgName : item.orgName
- }
- });
- return {
- results: results
- }
- }
- },
- language: "zh-CN",
- templateResult: function (state) {
- var html = "<div>";
- html += "<strong>姓名:" + state.text + "</strong>(" + state.userName + ")<br/>";
- html += "单位:" + state.orgName;
- html += "</div>";
- return $(html);
- }
- });
-
- $("#" + id).on("select2-clearing",function(e){
- //alert(true);
- });
-
- if(userId!=null && userId.length>0){
- var ids = userId.split(",");
- var names = userName.split(",");
-
- $('option', $("#" + id)).remove();
- for(var i=0;i<ids.length;i++){
- if(ids[i] != ""){
- $("#" + id).append(new Option(names[i],ids[i], false, false));//第一个参数时id,第二个参数是text
- }
- }
- $($("#" + id)).val(ids).trigger('change');
- }
- else{
- $('option', $("#" + id)).remove();
- $($("#" + id)).val(null).trigger('change');
- }
- }
-
- function getParkList(parkId){
- $.post(path + "/park/allList",function(json){
- if(json.result){
- $.each(json.data,function(index,obj){
- if(parkId!=""){
- if(obj.parkId==parkId){
- $("#parkId").append("<option value='"+obj.parkId+"' selected>"+obj.title+"</option>")
- }else{
- $("#parkId").append("<option value='"+obj.parkId+"'>"+obj.title+"</option>")
- }
- }
- else{
- $("#parkId").append("<option value='"+obj.parkId+"'>"+obj.title+"</option>")
-
- }
- })
- }
- else{
- layer.msg(json.message);
- }
- },"json")
- }
-
- function loadFile(fileList){
- if(fileList.length > 0){
- $("#thelist").append('<h4 class="info">已上传附件</h4>');
- for(var i=0;i<fileList.length;i++){
- $("#thelist").append( '<div id="' + fileList[i].fileId + '" class="item">' +
- '<h6 class="info"><a href="' + fileList[i].realAddress + '" download = "' + fileList[i].fileName + "." + fileList[i].fileType.toLowerCase() + '" target="_blank">' + fileList[i].fileName + "." + fileList[i].fileType.toLowerCase() + '</a>' +
- '<a href="javacript:void(0);" onclick=delFile("' + fileList[i].fileId + '")>删除</a>' +
- '</h6>' +
- '</div>' );
- }
- }
- }
-
- function delFile(fileId){
- layer.confirm("是否删除?",{
- btns:["是","否"]
- },function(){
- $.post(path + "/projectFile/deleteReturnFile/" + fileId,null,function(json){
- if(json.result){
- layer.msg("删除成功!",{icon:1,time:2000});
- var fileList = json.data.fileList;
- $("#thelist").empty();
- if(fileList.length > 0){
- $("#thelist").append('<h4 class="info">已上传附件</h4>');
- for(var i=0;i<fileList.length;i++){
- $("#thelist").append( '<div id="' + fileList[i].fileId + '" class="item">' +
- '<h6 class="info"><a href="' + fileList[i].realAddress + '" download = "' + fileList[i].fileName + "." + fileList[i].fileType.toLowerCase() + '" target="_blank">' + fileList[i].fileName + "." + fileList[i].fileType.toLowerCase() + '</a>' +
- '<a href="javacript:void(0);" onclick=delFile("' + fileList[i].fileId + '")>删除</a>' +
- '</h6>' +
- '</div>' );
- }
- }
- }
- else{
- layer.msg("删除失败!" + json.message);
- }
- });
- });
- }
- </script>
- <!--/请在上方写此页面业务相关的脚本-->
- </body>
- </html>
|