|
@@ -51,10 +51,18 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- var idArr = $("#workBaseDataList tr:visible .clientId").length;
|
|
|
|
- if(idArr == 0){
|
|
|
|
- layer.msg('请添加一条依据性文件', {icon: 5});
|
|
|
|
- return false;
|
|
|
|
|
|
+ var length = document.getElementById("workBaseDataList");
|
|
|
|
+ var rows = length.rows.length;
|
|
|
|
+ var idList = [];
|
|
|
|
+ for (var i=0;i<rows;i++){
|
|
|
|
+ var chooseCondition = $("#workBaseDataList"+i+"_chooseCondition").val();
|
|
|
|
+ if(chooseCondition==1){
|
|
|
|
+ var fileUrl = $("#workBaseDataList"+i+"_fileUrl").val();
|
|
|
|
+ if(fileUrl == null || fileUrl == ''){
|
|
|
|
+ layer.msg('请上传依据性资料必填文件', {icon: 5});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
beforeSubmit();
|
|
beforeSubmit();
|
|
$("#inputForm").submit();
|
|
$("#inputForm").submit();
|
|
@@ -187,7 +195,35 @@
|
|
|
|
|
|
function changeContentDetail(obj) {
|
|
function changeContentDetail(obj) {
|
|
$("#contentDetail").empty();
|
|
$("#contentDetail").empty();
|
|
- var val = "410";
|
|
|
|
|
|
+ var val = "43";
|
|
|
|
+
|
|
|
|
+ var modify = $("#modify").val();
|
|
|
|
+ if("modify" != modify){
|
|
|
|
+ $("#workBaseDataList").empty();
|
|
|
|
+ $.ajax({
|
|
|
|
+ type:'post',
|
|
|
|
+ url:'${ctx}/project/projectImplementEarly/projectBasedDataList',
|
|
|
|
+ data:{
|
|
|
|
+ "typeId":val
|
|
|
|
+ },
|
|
|
|
+ success:function(data){
|
|
|
|
+ console.log(data);
|
|
|
|
+ if(data.projectBasedDataList.length > 0){
|
|
|
|
+ var data = data.projectBasedDataList;
|
|
|
|
+ for(var i=0;i<data.length;i++){
|
|
|
|
+ var idArr = $("#workBaseDataList tr:visible .clientId");
|
|
|
|
+ if(data[i].id!=''&&!hasInArr(data[i].id,idArr)){
|
|
|
|
+ addRowBaseData("#workBaseDataList",workBaseDataRowIdx,workBaseDataTplFirst,data[i]);
|
|
|
|
+ workBaseDataRowIdx=workBaseDataRowIdx+1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
contentDetailTypeShow(val);
|
|
contentDetailTypeShow(val);
|
|
$("#contentDetailTypeDiv").show();
|
|
$("#contentDetailTypeDiv").show();
|
|
$("#projectContentDataSign").val(val);
|
|
$("#projectContentDataSign").val(val);
|
|
@@ -414,6 +450,30 @@
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //依据性文件点击事件
|
|
|
|
+ function accordingBtn(obj, prefix,userId){
|
|
|
|
+ $(prefix+"_file").click();
|
|
|
|
+ }
|
|
|
|
+ //依据性文件上传文件方法
|
|
|
|
+ function insertAccording(tValue,idx,prefix) {
|
|
|
|
+ var files = $(prefix+"_file")[0].files;
|
|
|
|
+ for(var i=0;i<files.length;i++) {
|
|
|
|
+ var file = files[i];
|
|
|
|
+ var attachmentId = "";
|
|
|
|
+ var attachmentFlag = "132";
|
|
|
|
+ console.log(file);
|
|
|
|
+ var timestamp = new Date().getTime();
|
|
|
|
+
|
|
|
|
+ var storeAs = "attachment-file/basedData/" + timestamp + "/" + file['name'];
|
|
|
|
+ var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
|
|
|
|
+ /*将这段字符串存到数据库即可*/
|
|
|
|
+ var divId = "_attachment";
|
|
|
|
+ multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, "0",1,idx,prefix);
|
|
|
|
+ }
|
|
|
|
+ $(prefix+"_file").val(123)
|
|
|
|
+ //var idx1 = $("#workBaseDataList tr").length +1;
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
@@ -488,7 +548,19 @@
|
|
<c:forEach items="${concealProjectInfo.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
|
|
<c:forEach items="${concealProjectInfo.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
|
|
<tr>
|
|
<tr>
|
|
<td class="hide">
|
|
<td class="hide">
|
|
- <input type="hidden" id="workBaseDataList${idx.index}_id" value="${projectBasedData.id}" class="clientId">
|
|
|
|
|
|
+ <input id="workBaseDataList${idx.index}_id" name="projectReportData.projectBasedDataList[${idx.index}].id" type="hidden" value="${projectBasedData.id}" class="clientId">
|
|
|
|
+ <input id="workBaseDataList${idx.index}_file" type="file" name="projectReportData.projectBasedDataList[${idx.index}].file" multiple="multiple" style="display: none;" onChange="if(this.value)insertAccording(this.value,${idx.index},'#workBaseDataList${idx.index}');"/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_number" name="projectReportData.projectBasedDataList[${idx.index}].number" type="hidden" value="${projectBasedData.number}"/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_name" name="projectReportData.projectBasedDataList[${idx.index}].name" type="hidden" value="${projectBasedData.name}"/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_type" name="projectReportData.projectBasedDataList[${idx.index}].type" type="hidden" value="${projectBasedData.type}"/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_flag" name="projectReportData.projectBasedDataList[${idx.index}].flag" type="hidden" value="132"/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_chooseCondition" name="projectReportData.projectBasedDataList[${idx.index}].chooseCondition" type="hidden" value="${projectBasedData.chooseCondition}"/>
|
|
|
|
+
|
|
|
|
+ <input id="workBaseDataList${idx.index}_fileType" name="projectReportData.projectBasedDataList[${idx.index}].fileType" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_fileName" name="projectReportData.projectBasedDataList[${idx.index}].fileName" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_fileUrl" name="projectReportData.projectBasedDataList[${idx.index}].fileUrl" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_fileAttachmentFlag" name="projectReportData.projectBasedDataList[${idx.index}].fileAttachmentFlag" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList${idx.index}_fileAttachmentId" name="projectReportData.projectBasedDataList[${idx.index}].fileAttachmentId" type="hidden" value=""/>
|
|
</td>
|
|
</td>
|
|
<td style="text-align:center;">
|
|
<td style="text-align:center;">
|
|
${projectBasedData.number}
|
|
${projectBasedData.number}
|
|
@@ -515,6 +587,50 @@
|
|
</table>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <script type="text/template" id="workBaseDataTplFirst">//<!--
|
|
|
|
+ <tr id="budgetList{{idx}}">
|
|
|
|
+ <td class="hide">
|
|
|
|
+ <input id="workBaseDataList{{idx}}_file" type="file" name="projectContentData.projectBasedDataList[{{idx}}].file" multiple="multiple" style="display: none;" onChange="if(this.value)insertAccording(this.value,{{idx}},'#workBaseDataList{{idx}}');"/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_flag" name="projectContentData.projectBasedDataList[{{idx}}].flag" type="hidden" value="132"/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_chooseCondition" name="projectContentData.projectBasedDataList[{{idx}}].chooseCondition" type="hidden" value="{{row.chooseCondition}}"/>
|
|
|
|
+
|
|
|
|
+ <input id="workBaseDataList{{idx}}_id" name="projectContentData.projectBasedDataList[{{idx}}].id" type="hidden" value="{{row.id}}" class="clientId"/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_number" name="projectContentData.projectBasedDataList[{{idx}}].number" type="hidden" value="{{row.number}}"/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_name" name="projectContentData.projectBasedDataList[{{idx}}].name" type="hidden" value="{{row.name}}"/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_type" name="projectContentData.projectBasedDataList[{{idx}}].type" type="hidden" value="{{row.type}}"/>
|
|
|
|
+
|
|
|
|
+ <input id="workBaseDataList{{idx}}_fileType" name="projectContentData.projectBasedDataList[{{idx}}].fileType" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_fileName" name="projectContentData.projectBasedDataList[{{idx}}].fileName" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_fileUrl" name="projectContentData.projectBasedDataList[{{idx}}].fileUrl" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}_fileAttachmentFlag" name="projectContentData.projectBasedDataList[{{idx}}].fileAttachmentFlag" type="hidden" value=""/>
|
|
|
|
+ <input id="workBaseDataList{{idx}}}_fileAttachmentId" name="projectContentData.projectBasedDataList[{{idx}}].fileAttachmentId" type="hidden" value=""/>
|
|
|
|
+ </td>
|
|
|
|
+ <%--<td style="text-align:center;">
|
|
|
|
+ {{row.number}}
|
|
|
|
+ </td>--%>
|
|
|
|
+ <td style="text-align:center;">
|
|
|
|
+ {{row.name}}
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align:center;">
|
|
|
|
+ {{row.typeLabel}}
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align:center;">
|
|
|
|
+ <div id="workBaseDataList{{idx}}_fileTypeDiv">
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align:center;">
|
|
|
|
+ {{row.uploadUser.name}}
|
|
|
|
+ </td>
|
|
|
|
+ <td style="text-align:center;">
|
|
|
|
+ {{row.uploadDate}}
|
|
|
|
+ </td>
|
|
|
|
+ <td class="text-center op-td">
|
|
|
|
+ <div id="workBaseDataList{{idx}}_operation">
|
|
|
|
+ <a href=javascript:void(0); onclick="accordingBtn(this, '#workBaseDataList{{idx}}','{{row.uploadUser.id}}')" class="op-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i> 添加附件</a>
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>//-->
|
|
|
|
+ </script>
|
|
<script type="text/template" id="workBaseDataTpl">//<!--
|
|
<script type="text/template" id="workBaseDataTpl">//<!--
|
|
<tr id="budgetList{{idx}}">
|
|
<tr id="budgetList{{idx}}">
|
|
<td class="hide">
|
|
<td class="hide">
|
|
@@ -545,15 +661,12 @@
|
|
</script>
|
|
</script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
|
+ var workBaseDataTplFirst = $("#workBaseDataTplFirst").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
var workBaseDataRowIdx = ${fn:length(concealProjectInfo.projectReportData.projectBasedDataList)};
|
|
var workBaseDataRowIdx = ${fn:length(concealProjectInfo.projectReportData.projectBasedDataList)};
|
|
function setValuee(obj){
|
|
function setValuee(obj){
|
|
for(var i=0;i<obj.length;i++){
|
|
for(var i=0;i<obj.length;i++){
|
|
var idArr = $("#workBaseDataList tr:visible .clientId");
|
|
var idArr = $("#workBaseDataList tr:visible .clientId");
|
|
if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
|
|
if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
|
|
- if(idArr.length == 1){
|
|
|
|
- layer.msg('只能选择或新增一条依据性资料', {icon: 5});
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
addRowBaseData("#workBaseDataList",workBaseDataRowIdx,workBaseDataTpl,obj[i]);
|
|
addRowBaseData("#workBaseDataList",workBaseDataRowIdx,workBaseDataTpl,obj[i]);
|
|
workBaseDataRowIdx=workBaseDataRowIdx+1;
|
|
workBaseDataRowIdx=workBaseDataRowIdx+1;
|
|
}
|
|
}
|