Merge remote-tracking branch 'origin/master'
commit
1c695fa50d
|
@ -13,7 +13,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
import org.activiti.engine.HistoryService;
|
import org.activiti.engine.HistoryService;
|
||||||
import org.activiti.engine.history.HistoricProcessInstance;
|
import org.activiti.engine.history.HistoricProcessInstance;
|
||||||
import org.activiti.engine.task.Task;
|
import org.activiti.engine.task.Task;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -28,9 +27,7 @@ import top.jfunc.common.utils.CollectionUtil;
|
||||||
|
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -100,6 +97,14 @@ public class ProjectController extends BaseController {
|
||||||
Page<Project> page = projectService.list(searchInfo, pageNumber, pageSize);
|
Page<Project> page = projectService.list(searchInfo, pageNumber, pageSize);
|
||||||
List<Project> list = page.getList();
|
List<Project> list = page.getList();
|
||||||
if(CollectionUtil.isNotEmpty(list)){
|
if(CollectionUtil.isNotEmpty(list)){
|
||||||
|
|
||||||
|
//查询项目当前审批任务节点
|
||||||
|
for (Project project : list) {
|
||||||
|
Task currentTask = actUtil.getCurrentTask(project.getId());
|
||||||
|
String actTaskName = currentTask == null ? "" : currentTask.getName();
|
||||||
|
project.setActTaskName(actTaskName);
|
||||||
|
}
|
||||||
|
|
||||||
int offset = (pageNumber - 1) * pageSize;
|
int offset = (pageNumber - 1) * pageSize;
|
||||||
for (int i = 0 , size = list.size(); i < size; i++) {
|
for (int i = 0 , size = list.size(); i < size; i++) {
|
||||||
list.get(i).setTempId(i+1 + offset);
|
list.get(i).setTempId(i+1 + offset);
|
||||||
|
@ -583,9 +588,6 @@ public class ProjectController extends BaseController {
|
||||||
model.put("taskRecords", list);
|
model.put("taskRecords", list);
|
||||||
}
|
}
|
||||||
model.put("huiQianFile", huiQianFile);
|
model.put("huiQianFile", huiQianFile);
|
||||||
//当前审批任务
|
|
||||||
Task currentTask = actUtil.getCurrentTask(project.getId());
|
|
||||||
model.put("currentTaskName", currentTask==null ? "" : currentTask.getName());
|
|
||||||
|
|
||||||
return "admin/project_approve";
|
return "admin/project_approve";
|
||||||
}
|
}
|
||||||
|
@ -604,9 +606,9 @@ public class ProjectController extends BaseController {
|
||||||
* 预算审批 跳到执行董事审批任务
|
* 预算审批 跳到执行董事审批任务
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/skipTask/{projectId}/{approvetype}")
|
@RequestMapping("/skipTask/{projectId}")
|
||||||
public ResponseMsg skipTask(@PathVariable int projectId, @PathVariable int approvetype, @RequestBody String json) {
|
public ResponseMsg skipTask(@PathVariable int projectId, @RequestBody String json) {
|
||||||
return projectService.skipTask(projectId, json, approvetype);
|
return projectService.skipTask(projectId, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -273,6 +273,12 @@ public class Project {
|
||||||
@Transient
|
@Transient
|
||||||
private String advancePeakAmountRound;
|
private String advancePeakAmountRound;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批任务节点
|
||||||
|
*/
|
||||||
|
@Transient
|
||||||
|
private String actTaskName;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -833,4 +839,12 @@ public class Project {
|
||||||
public void setAdvancePeakAmountRound(String advancePeakAmountRound) {
|
public void setAdvancePeakAmountRound(String advancePeakAmountRound) {
|
||||||
this.advancePeakAmountRound = advancePeakAmountRound;
|
this.advancePeakAmountRound = advancePeakAmountRound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getActTaskName() {
|
||||||
|
return actTaskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActTaskName(String actTaskName) {
|
||||||
|
this.actTaskName = actTaskName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class ActTaskDefService {
|
||||||
* 预算跳过剩下审批任务直接到执行董事节点
|
* 预算跳过剩下审批任务直接到执行董事节点
|
||||||
* @param procInsId
|
* @param procInsId
|
||||||
*/
|
*/
|
||||||
public ResponseMsg skipTaskByProcInsId(String procInsId, String fileUrl, int approvetype) {
|
public ResponseMsg skipTaskByProcInsId(String procInsId, String fileUrl, String comment) {
|
||||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult();
|
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult();
|
||||||
if (!ActConstant.PROCESS_DEFKEY_BUDGET.equals(processInstance.getProcessDefinitionKey())) {
|
if (!ActConstant.PROCESS_DEFKEY_BUDGET.equals(processInstance.getProcessDefinitionKey())) {
|
||||||
return ResponseMsg.buildFailedMsg("只有预算审批流程才能执行会签");
|
return ResponseMsg.buildFailedMsg("只有预算审批流程才能执行会签");
|
||||||
|
@ -112,7 +112,7 @@ public class ActTaskDefService {
|
||||||
if ("执行董事".equals(task.getName())) {
|
if ("执行董事".equals(task.getName())) {
|
||||||
return ResponseMsg.buildFailedMsg("当前状态不能用会签功能,请使用审批功能。");
|
return ResponseMsg.buildFailedMsg("当前状态不能用会签功能,请使用审批功能。");
|
||||||
}
|
}
|
||||||
completeTask(task.getId(), procInsId, "申请会签", ApproveStatusEnum.APPROVAL_PASSED.getApproveStatus(), fileUrl);
|
completeTask(task.getId(), procInsId, comment, ApproveStatusEnum.APPROVAL_PASSED.getApproveStatus(), fileUrl);
|
||||||
|
|
||||||
//非执行董事节点自动跳过
|
//非执行董事节点自动跳过
|
||||||
task = taskService.createTaskQuery().processInstanceId(procInsId).singleResult();
|
task = taskService.createTaskQuery().processInstanceId(procInsId).singleResult();
|
||||||
|
@ -121,7 +121,7 @@ public class ActTaskDefService {
|
||||||
task = taskService.createTaskQuery().processInstanceId(procInsId).singleResult();
|
task = taskService.createTaskQuery().processInstanceId(procInsId).singleResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("会签成功", approvetype);
|
return ResponseMsg.buildSuccessMsg("会签成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -336,10 +336,9 @@ public class ProjectService {
|
||||||
*
|
*
|
||||||
* @param projectId
|
* @param projectId
|
||||||
* @param json
|
* @param json
|
||||||
* @param approvetype
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ResponseMsg skipTask(int projectId, String json, int approvetype) {
|
public ResponseMsg skipTask(int projectId, String json) {
|
||||||
List<ProjectInstanceRelation> relationList = projectInstanceRelationRepository.findByProjectIdOrderByCreateTimeDesc(projectId);
|
List<ProjectInstanceRelation> relationList = projectInstanceRelationRepository.findByProjectIdOrderByCreateTimeDesc(projectId);
|
||||||
if (relationList == null || relationList.isEmpty()) {
|
if (relationList == null || relationList.isEmpty()) {
|
||||||
return ResponseMsg.buildFailedMsg("会签失败");
|
return ResponseMsg.buildFailedMsg("会签失败");
|
||||||
|
@ -347,9 +346,10 @@ public class ProjectService {
|
||||||
|
|
||||||
JSONObject obj = JSON.parseObject(json);
|
JSONObject obj = JSON.parseObject(json);
|
||||||
String fileUrl = obj.getString("fileUrl");
|
String fileUrl = obj.getString("fileUrl");
|
||||||
|
String message = obj.getString("message");
|
||||||
|
|
||||||
ProjectInstanceRelation projectInstanceRelation = relationList.get(0);
|
ProjectInstanceRelation projectInstanceRelation = relationList.get(0);
|
||||||
return actTaskDefService.skipTaskByProcInsId(projectInstanceRelation.getProcessInsId(), fileUrl, approvetype);
|
return actTaskDefService.skipTaskByProcInsId(projectInstanceRelation.getProcessInsId(), fileUrl, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2655,59 +2655,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<#--会签弹窗-->
|
|
||||||
<div class="am-modal am-modal-prompt" style="width: 1000px;max-height:600px;overflow-y:auto;"
|
|
||||||
tabindex="-1" id="my-approve2">
|
|
||||||
<div class="am-modal-dialog">
|
|
||||||
<div style="word-wrap:break-word; word-break:break-all; " class="am-modal-hd">会签—${project.name}</div>
|
|
||||||
<div class="am-modal-bd" style="border-bottom: none">
|
|
||||||
<form method="post" class="am-form" id="tmpForm" action="${base}/procurement/type/save">
|
|
||||||
<div class="am-tabs am-margin" data-am-tabs>
|
|
||||||
<div class="am-g am-form-group am-margin-top">
|
|
||||||
|
|
||||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>会签单</div>
|
|
||||||
|
|
||||||
<div class="am-u-sm-6 am-u-md-6">
|
|
||||||
<input type="text" id="icon" name="icon" maxlength="500"
|
|
||||||
value="" required
|
|
||||||
placeholder="请上传会签单( *.gif,*.jpg,*.jpeg,*.png,*.pdf )"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="am-form-file am-text-xs">
|
|
||||||
<button type="button" class="am-btn am-btn-primary am-btn-sm">
|
|
||||||
<i class="am-icon-cloud-upload"></i> 上传
|
|
||||||
</button>
|
|
||||||
<input id="fileupload_button_icon" type="file" name="files[]" multiple>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- The global progress bar -->
|
|
||||||
<div id="progress-area-icon" class="am-margin-top-sm am-hide">
|
|
||||||
<div id="progress-text-icon" class="am-text-xs am-text-right"></div>
|
|
||||||
<div id="progress" class="am-progress am-progress-xs">
|
|
||||||
<div class="am-progress-bar" style="width: 0%"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="am-modal-footer">
|
|
||||||
<button type="button"
|
|
||||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
|
||||||
onclick="$('#my-approve2').modal('close')">
|
|
||||||
取消
|
|
||||||
</button>
|
|
||||||
<span style="margin-left: 100px"></span>
|
|
||||||
<button type="button"
|
|
||||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
|
||||||
onclick="completeHuiQianTask('${project.id}')">
|
|
||||||
确定
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--选项卡(tabs)end-->
|
<!--选项卡(tabs)end-->
|
||||||
<div class="am-margin">
|
<div class="am-margin">
|
||||||
<button type="button" class="am-btn am-btn-warning am-btn-xs" onclick="javascript:history.go(-1);">
|
<button type="button" class="am-btn am-btn-warning am-btn-xs" onclick="javascript:history.go(-1);">
|
||||||
|
@ -2737,11 +2684,7 @@
|
||||||
<script src="${base}/assets/js/project_budget_plan.js"></script>
|
<script src="${base}/assets/js/project_budget_plan.js"></script>
|
||||||
<script src="${base}/layui/layui.js"></script>
|
<script src="${base}/layui/layui.js"></script>
|
||||||
|
|
||||||
<script src="${base}/common/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
|
|
||||||
<script type="text/javascript" src="${base}/common/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
|
|
||||||
<script type="text/javascript" src="${base}/common/jQuery-File-Upload/js/jquery.fileupload.js"></script>
|
|
||||||
<script src="${base}/common/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
|
|
||||||
<script src="${base}/common/jQuery-File-Upload/js/jquery.fileupload-validate.js"></script>
|
|
||||||
|
|
||||||
</@defaultLayout.layout>
|
</@defaultLayout.layout>
|
||||||
|
|
||||||
|
@ -2763,92 +2706,14 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#huiQian").click(function () {
|
|
||||||
$('#my-approve2').modal({
|
|
||||||
relatedTarget: this,
|
|
||||||
onConfirm: function (e) {
|
|
||||||
},
|
|
||||||
onCancel: function (e) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#incomeAddBtn").click(function () {
|
$("#incomeAddBtn").click(function () {
|
||||||
appendTrIncome();
|
appendTrIncome();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//上传会签单
|
|
||||||
generateFileupload('icon');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//上传会签单
|
|
||||||
var generateFileupload = function (name) {
|
|
||||||
var progressArea = $("#progress-area-" + name);//div
|
|
||||||
var progressText = $("#progress-text-" + name);//进度条提示
|
|
||||||
var progressBar = $(".am-progress-bar");//进度条
|
|
||||||
|
|
||||||
console.info(name);
|
|
||||||
|
|
||||||
$("#fileupload_button_" + name).fileupload({
|
|
||||||
url: base + "/file/upload",
|
|
||||||
dataType: 'json',
|
|
||||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|pdf)$/i,
|
|
||||||
maxFileSize: 20 * 1024 * 1024,
|
|
||||||
maxNumberOfFiles: 1,
|
|
||||||
messages: {
|
|
||||||
maxFileSize: '最大允许上传的图片大小为20M',
|
|
||||||
acceptFileTypes: '文件格式不正确,请上传gif、jpg、jpeg、png、pdf类型的图片文件'
|
|
||||||
},
|
|
||||||
start: function (e) {
|
|
||||||
progressArea.removeClass("am-hide");
|
|
||||||
progressText.removeClass("am-text-danger");
|
|
||||||
progressText.html("");
|
|
||||||
progressBar.css("width", "0%");
|
|
||||||
},
|
|
||||||
done: function (e, data) {
|
|
||||||
console.log("--data-->"+ JSON.stringify(data.result.data));
|
|
||||||
//设置服务器返回的url
|
|
||||||
$("#" + name).val(data.result.data.url);
|
|
||||||
setTimeout(function () {
|
|
||||||
progressArea.addClass("am-hide");
|
|
||||||
}, 1500);
|
|
||||||
},
|
|
||||||
progressall: function (e, data) {
|
|
||||||
var progress = parseInt(data.loaded / data.total * 100, 10);
|
|
||||||
console.log(progress);
|
|
||||||
progressBar.css("width", progress + "%");
|
|
||||||
progressText.html(progress + "%");
|
|
||||||
},
|
|
||||||
error: function (jqXHR2, textStatus, errorThrown) {
|
|
||||||
progressArea.removeClass("am-hide");
|
|
||||||
progressText.addClass("am-text-danger");
|
|
||||||
progressText.html("imageupload error!");
|
|
||||||
progressBar.css("width", "0%");
|
|
||||||
setTimeout(function () {
|
|
||||||
progressArea.addClass("am-hide");
|
|
||||||
}, 2000);
|
|
||||||
},
|
|
||||||
fail: function (jqXHR2, textStatus) {
|
|
||||||
progressArea.removeClass("am-hide");
|
|
||||||
progressText.addClass("am-text-danger");
|
|
||||||
progressText.html("imageupload fail!");
|
|
||||||
progressBar.css("width", "0%");
|
|
||||||
setTimeout(function () {
|
|
||||||
progressArea.addClass("am-hide");
|
|
||||||
}, 2000);
|
|
||||||
},
|
|
||||||
processfail: function (e, data) {
|
|
||||||
var currentFile = data.files[data.index];
|
|
||||||
if (data.files.error && currentFile.error) {
|
|
||||||
parent.layer.msg(currentFile.error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var completeTask = function (projectId) {
|
var completeTask = function (projectId) {
|
||||||
var message = $("#doc-vld-ta-2").val();
|
var message = $("#doc-vld-ta-2").val();
|
||||||
var approvetype = $("#type").val();
|
var approvetype = $("#type").val();
|
||||||
|
@ -2888,43 +2753,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//会签
|
|
||||||
var completeHuiQianTask = function (projectId) {
|
|
||||||
var approvetype = $("#type").val();
|
|
||||||
var fileUrl = $("#icon").val();
|
|
||||||
if (fileUrl == '') {
|
|
||||||
alert("请上传会签单");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var params = {
|
|
||||||
message: "",
|
|
||||||
fileUrl: fileUrl
|
|
||||||
};
|
|
||||||
$.ajax({
|
|
||||||
url: '${base}/project/skipTask/' + projectId + "/" + approvetype,
|
|
||||||
data: JSON.stringify(params),
|
|
||||||
dataType: "json",
|
|
||||||
contentType: "application/json",
|
|
||||||
type: 'post',
|
|
||||||
async: false,
|
|
||||||
success: function (data) {
|
|
||||||
if (data.status == 0) {
|
|
||||||
alert(data.msg);
|
|
||||||
refreshMyApproveMsg();
|
|
||||||
var urlType = data.data;
|
|
||||||
if(urlType == 1){
|
|
||||||
location.href = "${base}/project/list";
|
|
||||||
}else {
|
|
||||||
location.href = "${base}/project/listApprove";
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (data.status == 1) {
|
|
||||||
alert(data.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
layui.use('laydate', function(){
|
layui.use('laydate', function(){
|
||||||
var laydate = layui.laydate;
|
var laydate = layui.laydate;
|
||||||
|
|
||||||
|
|
|
@ -461,6 +461,14 @@
|
||||||
</button>
|
</button>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
<#--预算状态 待审核状态 -->
|
||||||
|
<#if list.status==5 && list.approveStatusBudget==1 && list.actTaskName! != "执行董事" >
|
||||||
|
<button type="button"
|
||||||
|
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||||
|
onclick="openHuiqianModal(${list.id}, '${list.name}')"><span class="am-icon-pencil-square-o"></span>会签
|
||||||
|
</button>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
|
||||||
<#if list.approveStatusEstimate != 0 >
|
<#if list.approveStatusEstimate != 0 >
|
||||||
<button type="button"
|
<button type="button"
|
||||||
|
@ -538,10 +546,78 @@
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal -->
|
<!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
|
<#--会签弹窗-->
|
||||||
|
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
|
||||||
|
<h4 class="modal-title" id="myModalLabel">您正在进行项目会签,请确认该操作</h4>
|
||||||
|
<h5 class="modal-title" id="myModalLabel">项目名称:<span id="hqProjectName" style="color: red"></span></h5>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="hqProjectId" name="hqProjectId" value=''/>
|
||||||
|
|
||||||
|
<div class="am-g am-form-group am-margin-top" style="display: flex;">
|
||||||
|
<div class="am-u-sm-4 am-u-md-4 am-text-right">
|
||||||
|
<span style="color: red;">*</span>请输入会签意见</div>
|
||||||
|
<div class="am-u-sm-6 am-u-md-6">
|
||||||
|
<textarea id="doc-vld-ta-2" minlength="10" maxlength="100"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-2 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="am-g am-form-group am-margin-top">
|
||||||
|
<div class="am-u-sm-4 am-u-md-4 am-text-right"><span style="color: red;">*</span>请上传会签单</div>
|
||||||
|
<div class="am-u-sm-6 am-u-md-6">
|
||||||
|
<input type="text" id="icon" name="icon" maxlength="500"
|
||||||
|
value="" required
|
||||||
|
placeholder="格式:gif|jpg|jpeg|png|pdf"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="am-form-file am-text-xs">
|
||||||
|
<button type="button" class="am-btn am-btn-primary am-btn-sm">
|
||||||
|
<i class="am-icon-cloud-upload"></i> 上传
|
||||||
|
</button>
|
||||||
|
<input id="fileupload_button_icon" type="file" name="files[]" multiple>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- The global progress bar -->
|
||||||
|
<div id="progress-area-icon" class="am-margin-top-sm am-hide">
|
||||||
|
<div id="progress-text-icon" class="am-text-xs am-text-right"></div>
|
||||||
|
<div id="progress" class="am-progress am-progress-xs">
|
||||||
|
<div class="am-progress-bar" style="width: 0%"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal" data-am-modal-cancel>关闭</button>
|
||||||
|
<button type="button" class="btn btn-primary" data-am-modal-confirm onclick="huiQian()">提交</button>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
<!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
</@defaultLayout.layout>
|
</@defaultLayout.layout>
|
||||||
<script type="text/javascript" src="../modal/js/modal.js"></script>
|
<script type="text/javascript" src="../modal/js/modal.js"></script>
|
||||||
<script src="../assets/js/amazeui.switch.js"></script>
|
<script src="../assets/js/amazeui.switch.js"></script>
|
||||||
<script src="${base}/assets/js/project_common.js"></script>
|
<script src="${base}/assets/js/project_common.js"></script>
|
||||||
|
|
||||||
|
<script src="${base}/common/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
|
||||||
|
<script type="text/javascript" src="${base}/common/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
|
||||||
|
<script type="text/javascript" src="${base}/common/jQuery-File-Upload/js/jquery.fileupload.js"></script>
|
||||||
|
<script src="${base}/common/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
|
||||||
|
<script src="${base}/common/jQuery-File-Upload/js/jquery.fileupload-validate.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var approveProject = function (id) {
|
var approveProject = function (id) {
|
||||||
if (window.confirm('确定要提交审核吗?')) {
|
if (window.confirm('确定要提交审核吗?')) {
|
||||||
|
@ -633,9 +709,113 @@
|
||||||
$("#keywords").val(keywords);
|
$("#keywords").val(keywords);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateFileupload("icon");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//会签
|
||||||
|
var huiQian = function () {
|
||||||
|
var projectId = $("#hqProjectId").val();
|
||||||
|
var fileUrl = $("#icon").val();
|
||||||
|
if (fileUrl == '') {
|
||||||
|
alert("请上传会签单");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var message = $("#doc-vld-ta-2").val();
|
||||||
|
if (message == '') {
|
||||||
|
alert("请填写会签意见");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var params = {
|
||||||
|
message: message,
|
||||||
|
fileUrl: fileUrl
|
||||||
|
};
|
||||||
|
$.ajax({
|
||||||
|
url: '${base}/project/skipTask/' + projectId,
|
||||||
|
data: JSON.stringify(params),
|
||||||
|
dataType: "json",
|
||||||
|
contentType: "application/json",
|
||||||
|
type: 'post',
|
||||||
|
async: false,
|
||||||
|
success: function (data) {
|
||||||
|
if (data.status == 0) {
|
||||||
|
alert(data.msg);
|
||||||
|
window.location.href=window.location.href;
|
||||||
|
} else if (data.status == 1) {
|
||||||
|
alert(data.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//上传会签单
|
||||||
|
var generateFileupload = function (name) {
|
||||||
|
var progressArea = $("#progress-area-" + name);//div
|
||||||
|
var progressText = $("#progress-text-" + name);//进度条提示
|
||||||
|
var progressBar = $(".am-progress-bar");//进度条
|
||||||
|
|
||||||
|
console.info(name);
|
||||||
|
|
||||||
|
$("#fileupload_button_" + name).fileupload({
|
||||||
|
url: "${base}/file/upload",
|
||||||
|
dataType: 'json',
|
||||||
|
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|pdf)$/i,
|
||||||
|
maxFileSize: 20 * 1024 * 1024,
|
||||||
|
maxNumberOfFiles: 1,
|
||||||
|
messages: {
|
||||||
|
maxFileSize: '最大允许上传的图片大小为20M',
|
||||||
|
acceptFileTypes: '文件格式不正确,请上传gif、jpg、jpeg、png、pdf类型的图片文件'
|
||||||
|
},
|
||||||
|
start: function (e) {
|
||||||
|
progressArea.removeClass("am-hide");
|
||||||
|
progressText.removeClass("am-text-danger");
|
||||||
|
progressText.html("");
|
||||||
|
progressBar.css("width", "0%");
|
||||||
|
},
|
||||||
|
done: function (e, data) {
|
||||||
|
console.log("--data-->"+ JSON.stringify(data.result.data));
|
||||||
|
//设置服务器返回的url
|
||||||
|
$("#" + name).val(data.result.data.url);
|
||||||
|
setTimeout(function () {
|
||||||
|
progressArea.addClass("am-hide");
|
||||||
|
}, 1500);
|
||||||
|
},
|
||||||
|
progressall: function (e, data) {
|
||||||
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||||
|
console.log(progress);
|
||||||
|
progressBar.css("width", progress + "%");
|
||||||
|
progressText.html(progress + "%");
|
||||||
|
},
|
||||||
|
error: function (jqXHR2, textStatus, errorThrown) {
|
||||||
|
progressArea.removeClass("am-hide");
|
||||||
|
progressText.addClass("am-text-danger");
|
||||||
|
progressText.html("imageupload error!");
|
||||||
|
progressBar.css("width", "0%");
|
||||||
|
setTimeout(function () {
|
||||||
|
progressArea.addClass("am-hide");
|
||||||
|
}, 2000);
|
||||||
|
},
|
||||||
|
fail: function (jqXHR2, textStatus) {
|
||||||
|
progressArea.removeClass("am-hide");
|
||||||
|
progressText.addClass("am-text-danger");
|
||||||
|
progressText.html("imageupload fail!");
|
||||||
|
progressBar.css("width", "0%");
|
||||||
|
setTimeout(function () {
|
||||||
|
progressArea.addClass("am-hide");
|
||||||
|
}, 2000);
|
||||||
|
},
|
||||||
|
processfail: function (e, data) {
|
||||||
|
var currentFile = data.files[data.index];
|
||||||
|
if (data.files.error && currentFile.error) {
|
||||||
|
parent.layer.msg(currentFile.error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
var deleteProject = function (id) {
|
var deleteProject = function (id) {
|
||||||
if (window.confirm('确定要删除此项目吗?')) {
|
if (window.confirm('确定要删除此项目吗?')) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -670,6 +850,24 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var openHuiqianModal = function(id, name) {
|
||||||
|
console.log("~~~~~~~~~~~~~"+id);
|
||||||
|
$("#hqProjectId").val(id);
|
||||||
|
$("#hqProjectName").html(name);
|
||||||
|
|
||||||
|
$('#myModal2').modal({
|
||||||
|
relatedElement: this,
|
||||||
|
onConfirm: function(id) {
|
||||||
|
console.log("提交");
|
||||||
|
projectNoCheck(id);
|
||||||
|
},
|
||||||
|
onCancel: function() {
|
||||||
|
console.log("取消");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var projectNoCheck = function () {
|
var projectNoCheck = function () {
|
||||||
var newProjectNo = $("#newProjectNo").val();
|
var newProjectNo = $("#newProjectNo").val();
|
||||||
var id = $("#modelId").val();
|
var id = $("#modelId").val();
|
||||||
|
|
Loading…
Reference in New Issue