新增合同名称
parent
a1fa6d6aed
commit
c13059f348
|
@ -122,6 +122,13 @@ public class ProjectController extends BaseController {
|
|||
Task currentTask = actUtil.getCurrentTask(project.getId());
|
||||
String actTaskName = currentTask == null ? "" : currentTask.getName();
|
||||
project.setActTaskName(actTaskName);
|
||||
|
||||
ProjectBudget projectBudget = projectBudgetRepository.findFirstByProjectId(project.getId());
|
||||
if (projectBudget == null || projectBudget.getContractBudget() == null || "".equals(projectBudget.getContractBudget())) {
|
||||
project.setIsContract(0);
|
||||
} else {
|
||||
project.setIsContract(1);
|
||||
}
|
||||
}
|
||||
|
||||
int offset = (pageNumber - 1) * pageSize;
|
||||
|
@ -966,6 +973,21 @@ public class ProjectController extends BaseController {
|
|||
webDataBinder.addCustomFormatter(new NumberStyleFormatter());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存合同名称
|
||||
*/
|
||||
@RequestMapping("/saveContract")
|
||||
@ResponseBody
|
||||
public ResponseMsg saveContract(@RequestParam String contractBudget,@RequestParam int id) {
|
||||
ProjectBudget projectBudget = projectBudgetRepository.findFirstByProjectId(id);
|
||||
if (projectBudget == null) {
|
||||
return ResponseMsg.buildFailedMsg("失败");
|
||||
}
|
||||
projectBudget.setContractBudget(contractBudget);
|
||||
projectBudgetRepository.save(projectBudget);
|
||||
return ResponseMsg.buildSuccessMsg("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存项目与用户的关系
|
||||
*/
|
||||
|
@ -1406,4 +1428,6 @@ public class ProjectController extends BaseController {
|
|||
public ResponseMsg stageRefreshSave(@RequestBody String json, @PathVariable int projectId) {
|
||||
return projectService.stageRefreshSave(json,projectId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -323,6 +323,9 @@ public class Project {
|
|||
@Transient
|
||||
private String remark;
|
||||
|
||||
@Transient
|
||||
private int isContract;
|
||||
|
||||
/**
|
||||
* 审批任务节点
|
||||
*/
|
||||
|
@ -1013,6 +1016,14 @@ public class Project {
|
|||
this.remark = remark;
|
||||
}
|
||||
|
||||
public int getIsContract() {
|
||||
return isContract;
|
||||
}
|
||||
|
||||
public void setIsContract(int isContract) {
|
||||
this.isContract = isContract;
|
||||
}
|
||||
|
||||
public Integer getStage() {
|
||||
return stage;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,11 @@ public class ProjectBudget {
|
|||
*/
|
||||
@Column(name = "name_budget")
|
||||
private String nameBudget;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@Column(name = "contract_budget")
|
||||
private String contractBudget;
|
||||
/**
|
||||
* 项目类型:1工程集成类、2设备集成类、3战略合作类
|
||||
*/
|
||||
|
@ -229,6 +234,14 @@ public class ProjectBudget {
|
|||
this.nameBudget = nameBudget;
|
||||
}
|
||||
|
||||
public String getContractBudget() {
|
||||
return contractBudget;
|
||||
}
|
||||
|
||||
public void setContractBudget(String contractBudget) {
|
||||
this.contractBudget = contractBudget;
|
||||
}
|
||||
|
||||
public int getTypeBudget() {
|
||||
return typeBudget;
|
||||
}
|
||||
|
|
|
@ -334,6 +334,15 @@
|
|||
name="nameBudget" placeholder="请输入项目名称(1000字符以内)" maxlength="1000" value="${projectBudget.nameBudget!}" />
|
||||
</td>
|
||||
</tr>
|
||||
<#if project.approveStatusBudget == 2>
|
||||
<tr class="am-text-nowrap">
|
||||
<th class="table-title" colspan="1" ><span style="color: red;">*</span><span style="font-size: 15px">合同名称:</span></th>
|
||||
<td class="table-title" colspan="5" >
|
||||
<input type="text" id="contractBudget" style="border-style:none;" data-validate-async data-validation-message="请输入合同名称(1000字符以内)"
|
||||
name="contractBudget" placeholder="请输入合同名称(1000字符以内)" maxlength="1000" value="${projectBudget.contractBudget!}" onkeyup="saveContract('${base}/project/saveContract')"/>
|
||||
</td>
|
||||
</tr>
|
||||
</#if>
|
||||
<tr class="am-text-nowrap">
|
||||
<th class="table-title" colspan="1" ><span style="color: red;">*</span><span style="font-size: 15px">项目类型:</span></th>
|
||||
<td class="table-title" colspan="1" >
|
||||
|
@ -1455,6 +1464,21 @@
|
|||
}
|
||||
};
|
||||
|
||||
function saveContract(url) {
|
||||
let contractBudget = $("#contractBudget").val();
|
||||
let id = $("#id").val();
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {contractBudget: contractBudget, id: id},
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
result = data.status;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ajaxUploadFile(id, url) {
|
||||
// if($('#modal')){
|
||||
// $('#modal').modal('open');
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
<input type="hidden" id="keywords" name="keywords" value='${keywords!""}'/>
|
||||
<input type="hidden" id="pageNumber" name="pageNumber" value='${pageNumber!}'/>
|
||||
<input type="hidden" id="orderTypeStr" name="orderTypeStr" value='${orderTypeStr!""}'/>
|
||||
<input type="hidden" id="pager" name="pager" value='${pager!}'/>
|
||||
<style>
|
||||
.flex-row {
|
||||
display: -webkit-box;
|
||||
|
@ -977,7 +976,7 @@
|
|||
<#if admin.getRoleLevel() == 6 && ((list.status==5 && list.approveStatusBudget=2) || (list.status=10 && list.approveStatusSettle=2)) >
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/settle/add?id=${list.id}'"><span
|
||||
onclick="checkContractName(${list.id}, ${list.isContract!0})"><span
|
||||
class="am-icon-pencil-square-o"></span>填写结算表
|
||||
</button>
|
||||
</#if>
|
||||
|
@ -986,7 +985,7 @@
|
|||
<#if admin.getRoleLevel() = 6 && list.status==10 && list.approveStatusSettle!=1>
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/settle/edit?id=${list.id}'"><span
|
||||
onclick="checkContractName2(${list.id}, ${list.isContract!0})"><span
|
||||
class="am-icon-pencil-square-o"></span>编辑结算表
|
||||
</button>
|
||||
</#if>
|
||||
|
@ -1309,6 +1308,21 @@
|
|||
}
|
||||
};
|
||||
|
||||
function checkContractName(id, isContract) {
|
||||
if (isContract === 1) {
|
||||
location.href = '${base}/project/settle/add?id=' + id;
|
||||
} else {
|
||||
layer.alert("请先填写预算表中的合同名称,再填写结算表");
|
||||
}
|
||||
}
|
||||
|
||||
function checkContractName2(id, isContract) {
|
||||
if (isContract === 1) {
|
||||
location.href = '${base}/project/settle/edit?id=' + id;
|
||||
} else {
|
||||
layer.alert("请先填写预算表中的合同名称,再填写结算表");
|
||||
}
|
||||
}
|
||||
|
||||
var approve = function (id) {
|
||||
var pageNumber = $("#pageNumber").val();
|
||||
|
|
Loading…
Reference in New Issue