Merge branch 'master' of gitee.com:ZhangYunTianXia/fourcal

master
White 2022-12-12 18:22:08 +08:00
commit a19307dd0e
5 changed files with 89 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -37,6 +37,11 @@ public class ProjectBudget {
*/
@Column(name = "name_budget")
private String nameBudget;
/**
*
*/
@Column(name = "contract_budget")
private String contractBudget;
/**
* 123
*/
@ -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;
}

View File

@ -338,6 +338,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" >
@ -1459,6 +1468,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');

View File

@ -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;
@ -992,7 +991,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>
@ -1001,7 +1000,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>
@ -1324,6 +1323,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();