项目新增基本信息,下一步增加概算的保存
parent
d63264dd98
commit
db2007c4c7
|
@ -0,0 +1,47 @@
|
||||||
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
|
*/
|
||||||
|
public enum ApproveStatusEnum {
|
||||||
|
APPROVAL_PENDING(0,"待审核"),
|
||||||
|
APPROVAL_PASSED(1,"审核通过"),
|
||||||
|
APPROVAL_UNPASS(2,"审核不通过");
|
||||||
|
|
||||||
|
private int approveStatus;
|
||||||
|
private String approveStatusDesc;
|
||||||
|
|
||||||
|
private ApproveStatusEnum(int approveStatus, String approveStatusDesc) {
|
||||||
|
this.approveStatus = approveStatus;
|
||||||
|
this.approveStatusDesc = approveStatusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getApproveStatus() {
|
||||||
|
return approveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApproveStatus(int approveStatus) {
|
||||||
|
this.approveStatus = approveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApproveStatusDesc() {
|
||||||
|
return approveStatusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApproveStatusDesc(String approveStatusDesc) {
|
||||||
|
this.approveStatusDesc = approveStatusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApproveStatusEnum parseApproveStatus(int approveStatus){
|
||||||
|
if(approveStatus == 0){
|
||||||
|
return APPROVAL_PENDING;
|
||||||
|
}
|
||||||
|
if(approveStatus == 1){
|
||||||
|
return APPROVAL_PASSED;
|
||||||
|
}
|
||||||
|
if(approveStatus == 2){
|
||||||
|
return APPROVAL_UNPASS;
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unkown approveStatus:"+approveStatus);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,266 @@
|
||||||
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
|
*/
|
||||||
|
public class EstimateBean {
|
||||||
|
private BigDecimal incomeDeviceTaxInclude;
|
||||||
|
private BigDecimal incomeEngineerTaxInclude;
|
||||||
|
private BigDecimal incomeServiceTaxInclude;
|
||||||
|
private BigDecimal incomeTotalTaxInclude;
|
||||||
|
|
||||||
|
private BigDecimal incomeDeviceTaxExclude;
|
||||||
|
private BigDecimal incomeEngineerTaxExclude;
|
||||||
|
private BigDecimal incomeServiceTaxExclude;
|
||||||
|
private BigDecimal incomeTotalTaxExclude;
|
||||||
|
|
||||||
|
private BigDecimal costPurchaseDeviceTaxInclude;
|
||||||
|
private BigDecimal costPurchaseBuildTaxInclude;
|
||||||
|
private BigDecimal costPurchaseServiceTaxInclude;
|
||||||
|
private BigDecimal costProjectManageTaxInclude;
|
||||||
|
private BigDecimal costPurchaseOtherTaxInclude;
|
||||||
|
private BigDecimal costOtherOtherTaxInclude;
|
||||||
|
private BigDecimal costTotalTaxInclude;
|
||||||
|
|
||||||
|
private BigDecimal costPurchaseDeviceTaxExclude;
|
||||||
|
private BigDecimal costPurchaseBuildTaxExclude;
|
||||||
|
private BigDecimal costPurchaseServiceTaxExclude;
|
||||||
|
private BigDecimal costPurchaseOtherTaxExclude;
|
||||||
|
private BigDecimal costProjectManageTaxExclude;
|
||||||
|
private BigDecimal costOtherOtherTaxExclude;
|
||||||
|
private BigDecimal costTotalTaxExclude;
|
||||||
|
|
||||||
|
private BigDecimal costExpropriationTaxExclude;
|
||||||
|
private BigDecimal costCompanyManageTaxExclude;
|
||||||
|
|
||||||
|
private BigDecimal projectGrossProfit;
|
||||||
|
private BigDecimal projectGrossProfitRate;
|
||||||
|
private BigDecimal projectContributionProfit;
|
||||||
|
private BigDecimal projectContributionProfitRate;
|
||||||
|
|
||||||
|
public BigDecimal getIncomeDeviceTaxInclude() {
|
||||||
|
return incomeDeviceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeDeviceTaxInclude(BigDecimal incomeDeviceTaxInclude) {
|
||||||
|
this.incomeDeviceTaxInclude = incomeDeviceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeEngineerTaxInclude() {
|
||||||
|
return incomeEngineerTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeEngineerTaxInclude(BigDecimal incomeEngineerTaxInclude) {
|
||||||
|
this.incomeEngineerTaxInclude = incomeEngineerTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeServiceTaxInclude() {
|
||||||
|
return incomeServiceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeServiceTaxInclude(BigDecimal incomeServiceTaxInclude) {
|
||||||
|
this.incomeServiceTaxInclude = incomeServiceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeTotalTaxInclude() {
|
||||||
|
return incomeTotalTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeTotalTaxInclude(BigDecimal incomeTotalTaxInclude) {
|
||||||
|
this.incomeTotalTaxInclude = incomeTotalTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeDeviceTaxExclude() {
|
||||||
|
return incomeDeviceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeDeviceTaxExclude(BigDecimal incomeDeviceTaxExclude) {
|
||||||
|
this.incomeDeviceTaxExclude = incomeDeviceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeEngineerTaxExclude() {
|
||||||
|
return incomeEngineerTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeEngineerTaxExclude(BigDecimal incomeEngineerTaxExclude) {
|
||||||
|
this.incomeEngineerTaxExclude = incomeEngineerTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeServiceTaxExclude() {
|
||||||
|
return incomeServiceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeServiceTaxExclude(BigDecimal incomeServiceTaxExclude) {
|
||||||
|
this.incomeServiceTaxExclude = incomeServiceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIncomeTotalTaxExclude() {
|
||||||
|
return incomeTotalTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeTotalTaxExclude(BigDecimal incomeTotalTaxExclude) {
|
||||||
|
this.incomeTotalTaxExclude = incomeTotalTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseDeviceTaxInclude() {
|
||||||
|
return costPurchaseDeviceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseDeviceTaxInclude(BigDecimal costPurchaseDeviceTaxInclude) {
|
||||||
|
this.costPurchaseDeviceTaxInclude = costPurchaseDeviceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseBuildTaxInclude() {
|
||||||
|
return costPurchaseBuildTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseBuildTaxInclude(BigDecimal costPurchaseBuildTaxInclude) {
|
||||||
|
this.costPurchaseBuildTaxInclude = costPurchaseBuildTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseServiceTaxInclude() {
|
||||||
|
return costPurchaseServiceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseServiceTaxInclude(BigDecimal costPurchaseServiceTaxInclude) {
|
||||||
|
this.costPurchaseServiceTaxInclude = costPurchaseServiceTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostProjectManageTaxInclude() {
|
||||||
|
return costProjectManageTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostProjectManageTaxInclude(BigDecimal costProjectManageTaxInclude) {
|
||||||
|
this.costProjectManageTaxInclude = costProjectManageTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseOtherTaxInclude() {
|
||||||
|
return costPurchaseOtherTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseOtherTaxInclude(BigDecimal costPurchaseOtherTaxInclude) {
|
||||||
|
this.costPurchaseOtherTaxInclude = costPurchaseOtherTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostOtherOtherTaxInclude() {
|
||||||
|
return costOtherOtherTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostOtherOtherTaxInclude(BigDecimal costOtherOtherTaxInclude) {
|
||||||
|
this.costOtherOtherTaxInclude = costOtherOtherTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostTotalTaxInclude() {
|
||||||
|
return costTotalTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostTotalTaxInclude(BigDecimal costTotalTaxInclude) {
|
||||||
|
this.costTotalTaxInclude = costTotalTaxInclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseDeviceTaxExclude() {
|
||||||
|
return costPurchaseDeviceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseDeviceTaxExclude(BigDecimal costPurchaseDeviceTaxExclude) {
|
||||||
|
this.costPurchaseDeviceTaxExclude = costPurchaseDeviceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseBuildTaxExclude() {
|
||||||
|
return costPurchaseBuildTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseBuildTaxExclude(BigDecimal costPurchaseBuildTaxExclude) {
|
||||||
|
this.costPurchaseBuildTaxExclude = costPurchaseBuildTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseServiceTaxExclude() {
|
||||||
|
return costPurchaseServiceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseServiceTaxExclude(BigDecimal costPurchaseServiceTaxExclude) {
|
||||||
|
this.costPurchaseServiceTaxExclude = costPurchaseServiceTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostPurchaseOtherTaxExclude() {
|
||||||
|
return costPurchaseOtherTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostPurchaseOtherTaxExclude(BigDecimal costPurchaseOtherTaxExclude) {
|
||||||
|
this.costPurchaseOtherTaxExclude = costPurchaseOtherTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostProjectManageTaxExclude() {
|
||||||
|
return costProjectManageTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostProjectManageTaxExclude(BigDecimal costProjectManageTaxExclude) {
|
||||||
|
this.costProjectManageTaxExclude = costProjectManageTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostOtherOtherTaxExclude() {
|
||||||
|
return costOtherOtherTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostOtherOtherTaxExclude(BigDecimal costOtherOtherTaxExclude) {
|
||||||
|
this.costOtherOtherTaxExclude = costOtherOtherTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostTotalTaxExclude() {
|
||||||
|
return costTotalTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostTotalTaxExclude(BigDecimal costTotalTaxExclude) {
|
||||||
|
this.costTotalTaxExclude = costTotalTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostExpropriationTaxExclude() {
|
||||||
|
return costExpropriationTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostExpropriationTaxExclude(BigDecimal costExpropriationTaxExclude) {
|
||||||
|
this.costExpropriationTaxExclude = costExpropriationTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCostCompanyManageTaxExclude() {
|
||||||
|
return costCompanyManageTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostCompanyManageTaxExclude(BigDecimal costCompanyManageTaxExclude) {
|
||||||
|
this.costCompanyManageTaxExclude = costCompanyManageTaxExclude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProjectGrossProfit() {
|
||||||
|
return projectGrossProfit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectGrossProfit(BigDecimal projectGrossProfit) {
|
||||||
|
this.projectGrossProfit = projectGrossProfit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProjectGrossProfitRate() {
|
||||||
|
return projectGrossProfitRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectGrossProfitRate(BigDecimal projectGrossProfitRate) {
|
||||||
|
this.projectGrossProfitRate = projectGrossProfitRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProjectContributionProfit() {
|
||||||
|
return projectContributionProfit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectContributionProfit(BigDecimal projectContributionProfit) {
|
||||||
|
this.projectContributionProfit = projectContributionProfit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProjectContributionProfitRate() {
|
||||||
|
return projectContributionProfitRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectContributionProfitRate(BigDecimal projectContributionProfitRate) {
|
||||||
|
this.projectContributionProfitRate = projectContributionProfitRate;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
|
*/
|
||||||
|
public enum StatusEnum {
|
||||||
|
DRAFT(0,"草稿"),
|
||||||
|
CREATED(1,"项目创建"),
|
||||||
|
ESTIMATE_ACCOUNTS(5,"概算完成"),
|
||||||
|
BUDGET_ACCOUNTS(10,"预算完成"),
|
||||||
|
SETTLE_ACCOUNTS(15,"结算中"),
|
||||||
|
FINAL_ACCOUNTS(20,"决算完成");
|
||||||
|
|
||||||
|
private int status;
|
||||||
|
private String statusDesc;
|
||||||
|
|
||||||
|
private StatusEnum(int status, String statusDesc) {
|
||||||
|
this.status = status;
|
||||||
|
this.statusDesc = statusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatusDesc() {
|
||||||
|
return statusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatusDesc(String statusDesc) {
|
||||||
|
this.statusDesc = statusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StatusEnum parseStatus(int status){
|
||||||
|
if(status == 0){
|
||||||
|
return DRAFT;
|
||||||
|
}
|
||||||
|
if(status == 1){
|
||||||
|
return CREATED;
|
||||||
|
}
|
||||||
|
if(status == 5){
|
||||||
|
return ESTIMATE_ACCOUNTS;
|
||||||
|
}
|
||||||
|
if(status == 10){
|
||||||
|
return BUDGET_ACCOUNTS;
|
||||||
|
}
|
||||||
|
if(status == 15){
|
||||||
|
return SETTLE_ACCOUNTS;
|
||||||
|
}
|
||||||
|
if(status == 20){
|
||||||
|
return FINAL_ACCOUNTS;
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unkown status:"+status);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package cn.palmte.work.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
|
*/
|
||||||
|
public enum TypeEnum {
|
||||||
|
PROJECT_INTEGRATION(1,"工程集成类"),
|
||||||
|
DEVICE_INTEGRATION(2,"设备集成类"),
|
||||||
|
STRATEGIC_PARTNER(3,"战略合作类");
|
||||||
|
|
||||||
|
private int type;
|
||||||
|
private String typeDesc;
|
||||||
|
|
||||||
|
private TypeEnum(int type, String typeDesc) {
|
||||||
|
this.type = type;
|
||||||
|
this.typeDesc = typeDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeDesc() {
|
||||||
|
return typeDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypeDesc(String typeDesc) {
|
||||||
|
this.typeDesc = typeDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TypeEnum parseType(int type){
|
||||||
|
if(type == 1){
|
||||||
|
return PROJECT_INTEGRATION;
|
||||||
|
}
|
||||||
|
if(type == 2){
|
||||||
|
return DEVICE_INTEGRATION;
|
||||||
|
}
|
||||||
|
if(type == 3){
|
||||||
|
return STRATEGIC_PARTNER;
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unkown type:"+type);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,18 @@
|
||||||
package cn.palmte.work.controller.backend;
|
package cn.palmte.work.controller.backend;
|
||||||
|
|
||||||
|
import cn.palmte.work.bean.EstimateBean;
|
||||||
|
import cn.palmte.work.model.Dept;
|
||||||
import cn.palmte.work.model.DeptRepository;
|
import cn.palmte.work.model.DeptRepository;
|
||||||
|
import cn.palmte.work.model.Project;
|
||||||
import cn.palmte.work.service.ProjectService;
|
import cn.palmte.work.service.ProjectService;
|
||||||
|
import cn.palmte.work.utils.InterfaceUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.format.datetime.DateFormatter;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
@ -17,6 +26,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/project")
|
@RequestMapping("/project")
|
||||||
public class ProjectController extends BaseController{
|
public class ProjectController extends BaseController{
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ProjectController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectService projectService;
|
private ProjectService projectService;
|
||||||
|
@ -35,4 +45,33 @@ public class ProjectController extends BaseController{
|
||||||
model.put("pager",projectService.list(searchInfo,pageNumber,pageSize));
|
model.put("pager",projectService.list(searchInfo,pageNumber,pageSize));
|
||||||
return "admin/project_list";
|
return "admin/project_list";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增,至项目概算
|
||||||
|
*/
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public String add(Map<String, Object> model) {
|
||||||
|
|
||||||
|
//TODO 根据登录人的部门
|
||||||
|
Dept one = deptRepository.findOne(1);
|
||||||
|
model.put("dept",one);
|
||||||
|
|
||||||
|
return "admin/project_estimate_input";
|
||||||
|
}
|
||||||
|
@RequestMapping("/estimateSave")
|
||||||
|
public String estimateSave(Project project, EstimateBean estimateBean,
|
||||||
|
Map<String, Object> model) {
|
||||||
|
projectService.estimateSave(project, estimateBean, InterfaceUtil.getAdmin());
|
||||||
|
return "redirect:/project/list";
|
||||||
|
}
|
||||||
|
@RequestMapping("/estimateSaveAndApprove")
|
||||||
|
public String estimateSaveAndApprove(Map<String, Object> model) {
|
||||||
|
return "redirect:/project/list";
|
||||||
|
}
|
||||||
|
|
||||||
|
@InitBinder
|
||||||
|
public void initBinder(WebDataBinder webDataBinder){
|
||||||
|
webDataBinder.addCustomFormatter(new DateFormatter("yyyy-MM-dd"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class Project {
|
||||||
*/
|
*/
|
||||||
@Column(name = "approve_status")
|
@Column(name = "approve_status")
|
||||||
private int approveStatus;
|
private int approveStatus;
|
||||||
@Column(name = "approveStatus_desc")
|
@Column(name = "approve_status_desc")
|
||||||
private String approveStatusDesc;
|
private String approveStatusDesc;
|
||||||
/**
|
/**
|
||||||
* 审核人id
|
* 审核人id
|
||||||
|
@ -78,8 +78,6 @@ public class Project {
|
||||||
*/
|
*/
|
||||||
@Column(name = "underwritten_mode")
|
@Column(name = "underwritten_mode")
|
||||||
private int underwrittenMode;
|
private int underwrittenMode;
|
||||||
@Transient
|
|
||||||
private String underwrittenModeDesc;
|
|
||||||
/**
|
/**
|
||||||
* 客户名称
|
* 客户名称
|
||||||
*/
|
*/
|
||||||
|
@ -268,14 +266,6 @@ public class Project {
|
||||||
this.underwrittenMode = underwrittenMode;
|
this.underwrittenMode = underwrittenMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUnderwrittenModeDesc() {
|
|
||||||
return underwrittenModeDesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUnderwrittenModeDesc(String underwrittenModeDesc) {
|
|
||||||
this.underwrittenModeDesc = underwrittenModeDesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCustomer() {
|
public String getCustomer() {
|
||||||
return customer;
|
return customer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
package cn.palmte.work.service;
|
package cn.palmte.work.service;
|
||||||
|
|
||||||
|
import cn.palmte.work.bean.ApproveStatusEnum;
|
||||||
|
import cn.palmte.work.bean.EstimateBean;
|
||||||
|
import cn.palmte.work.bean.StatusEnum;
|
||||||
|
import cn.palmte.work.bean.TypeEnum;
|
||||||
|
import cn.palmte.work.model.Admin;
|
||||||
import cn.palmte.work.model.Project;
|
import cn.palmte.work.model.Project;
|
||||||
|
import cn.palmte.work.model.ProjectRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import top.jfunc.common.db.QueryHelper;
|
import top.jfunc.common.db.QueryHelper;
|
||||||
|
@ -8,6 +14,7 @@ import top.jfunc.common.db.bean.Page;
|
||||||
import top.jfunc.common.db.utils.Pagination;
|
import top.jfunc.common.db.utils.Pagination;
|
||||||
import top.jfunc.common.utils.StrUtil;
|
import top.jfunc.common.utils.StrUtil;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,6 +24,8 @@ import java.util.Map;
|
||||||
public class ProjectService {
|
public class ProjectService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private Pagination pagination;
|
private Pagination pagination;
|
||||||
|
@Autowired
|
||||||
|
private ProjectRepository projectRepository;
|
||||||
|
|
||||||
|
|
||||||
private QueryHelper getQueryHelper(Map<String, String> searchInfo, int pageNumber, int pageSize) {
|
private QueryHelper getQueryHelper(Map<String, String> searchInfo, int pageNumber, int pageSize) {
|
||||||
|
@ -43,20 +52,20 @@ public class ProjectService {
|
||||||
/**
|
/**
|
||||||
* 只选择了一个时间的情况,就项目时间包括这个时间的
|
* 只选择了一个时间的情况,就项目时间包括这个时间的
|
||||||
*/
|
*/
|
||||||
if(StrUtil.isNotEmpty(searchInfo.get("startTime")) && StrUtil.isEmpty(searchInfo.get("endTime"))){
|
if(StrUtil.isNotEmpty(searchInfo.get("startDate")) && StrUtil.isEmpty(searchInfo.get("endDate"))){
|
||||||
String time = searchInfo.get("startTime") + " 00:00:00";
|
String time = searchInfo.get("startDate") + " 00:00:00";
|
||||||
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
||||||
}
|
}
|
||||||
if(StrUtil.isNotEmpty(searchInfo.get("endTime")) && StrUtil.isEmpty(searchInfo.get("startTime"))){
|
if(StrUtil.isNotEmpty(searchInfo.get("endDate")) && StrUtil.isEmpty(searchInfo.get("startDate"))){
|
||||||
String time = searchInfo.get("endTime") + " 00:00:00";
|
String time = searchInfo.get("endDate") + " 00:00:00";
|
||||||
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
queryHelper.addCondition("p.start_date<=? AND p.end_date>=?", time, time);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 两个时间都选了,则包含项目时间
|
* 两个时间都选了,则包含项目时间
|
||||||
*/
|
*/
|
||||||
if(StrUtil.isNotEmpty(searchInfo.get("startTime")) && StrUtil.isNotEmpty(searchInfo.get("endTime"))){
|
if(StrUtil.isNotEmpty(searchInfo.get("startDate")) && StrUtil.isNotEmpty(searchInfo.get("endDate"))){
|
||||||
String startTime = searchInfo.get("startTime") + " 00:00:00";
|
String startTime = searchInfo.get("startDate") + " 00:00:00";
|
||||||
String endTime = searchInfo.get("endTime") + " 23:59:59";
|
String endTime = searchInfo.get("endDate") + " 23:59:59";
|
||||||
queryHelper.addCondition("p.start_date>=? AND p.end_date<=?", startTime, endTime);
|
queryHelper.addCondition("p.start_date>=? AND p.end_date<=?", startTime, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,4 +77,31 @@ public class ProjectService {
|
||||||
return pagination.paginate(queryHelper.getSql(), Project.class,pageNumber,pageSize);
|
return pagination.paginate(queryHelper.getSql(), Project.class,pageNumber,pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 概算保存项目
|
||||||
|
*/
|
||||||
|
public Project estimateSave(Project project, EstimateBean estimateBean, Admin admin) {
|
||||||
|
project.setTypeDesc(TypeEnum.parseType(project.getType()).getTypeDesc());
|
||||||
|
project.setStatusDesc(StatusEnum.parseStatus(project.getStatus()).getStatusDesc());
|
||||||
|
project.setApproveStatus(ApproveStatusEnum.APPROVAL_PENDING.getApproveStatus());
|
||||||
|
project.setApproveStatusDesc(ApproveStatusEnum.APPROVAL_PENDING.getApproveStatusDesc());
|
||||||
|
project.setCreatorId(admin.getId());
|
||||||
|
project.setCreatorName(admin.getUserName());
|
||||||
|
|
||||||
|
//TODO 审核人通过计算得到
|
||||||
|
project.setApproveId(0);
|
||||||
|
project.setApproveName("");
|
||||||
|
|
||||||
|
//TODO 获取登录人的部门信息
|
||||||
|
project.setDeptId(admin.getId());
|
||||||
|
project.setDeptName("");
|
||||||
|
|
||||||
|
project.setCreateTime(new Date());
|
||||||
|
|
||||||
|
project = projectRepository.saveAndFlush(project);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return project;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/fourcal?\
|
||||||
|
characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&rewriteBatchedStatements=true
|
||||||
|
spring.datasource.username=root
|
||||||
|
spring.datasource.password=123456
|
||||||
|
|
||||||
|
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
|
||||||
|
#spring.jpa.properties.hibernate.hbm2ddl.auto=update
|
||||||
|
spring.jpa.show-sql=true
|
||||||
|
|
||||||
|
admin.domain=https://dzgtest.palmte.cn
|
||||||
|
|
||||||
|
upload.path=/mnt/dzg/image
|
||||||
|
upload.prefix=https://dzgtest.palmte.cn/upload
|
|
@ -2,7 +2,7 @@ spring.application.name=fourcal
|
||||||
server.port=8282
|
server.port=8282
|
||||||
server.context-path=/fourcal
|
server.context-path=/fourcal
|
||||||
app.version=0.0.1
|
app.version=0.0.1
|
||||||
spring.profiles.active=dev
|
spring.profiles.active=local
|
||||||
|
|
||||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
|
|
@ -0,0 +1,543 @@
|
||||||
|
<#assign base=request.contextPath />
|
||||||
|
<#import "../common/defaultLayout.ftl" as defaultLayout>
|
||||||
|
<@defaultLayout.layout>
|
||||||
|
|
||||||
|
<div class="admin-content">
|
||||||
|
<div class="admin-content-body">
|
||||||
|
<div class="am-cf am-padding">
|
||||||
|
<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">项目概算表</strong> / <small></small></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form method="post" class="am-form" id="pmsForm" action="${base}/project/estimateSave">
|
||||||
|
<!--选项卡(tabs)begin-->
|
||||||
|
<div class="am-tabs am-margin" data-am-tabs>
|
||||||
|
<ul class="am-tabs-nav am-nav am-nav-tabs">
|
||||||
|
<li class="am-active"><a href="#tab1">项目基本信息</a></li>
|
||||||
|
<li><a href="#tab2">项目详细信息</a></li>
|
||||||
|
</ul>
|
||||||
|
<div class="am-tabs-bd">
|
||||||
|
<div class="am-tab-panel am-fade am-in am-active" id="tab1">
|
||||||
|
<#--<input name="permissionID" id="permissionID" type="hidden" value="${permissionID!}" />-->
|
||||||
|
<!--验证表单元素(validate) begin-->
|
||||||
|
|
||||||
|
<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">
|
||||||
|
<span>${dept.name}</span>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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-2 am-u-md-2">
|
||||||
|
<div class="am-form-group am-form-icon">
|
||||||
|
<i class="am-icon-calendar"></i>
|
||||||
|
<input type="text" class="am-form-field am-input-sm" id="startDate"
|
||||||
|
name="startDate" autocomplete="off"
|
||||||
|
value="" placeholder="项目计划开始时间"
|
||||||
|
data-am-datepicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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-2 am-u-md-2">
|
||||||
|
<div class="am-form-group am-form-icon">
|
||||||
|
<i class="am-icon-calendar"></i>
|
||||||
|
<input type="text" class="am-form-field am-input-sm" id="endDate"
|
||||||
|
name="endDate" autocomplete="off"
|
||||||
|
value="" placeholder="项目计划结束时间"
|
||||||
|
data-am-datepicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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" class="am-input" data-validate-async data-validation-message="请输入项目名称(20字符以内)"
|
||||||
|
name="name" placeholder="请输入项目名称(20字符以内)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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">
|
||||||
|
<select data-am-selected id="type" name="type">
|
||||||
|
<option value="1" >工程集成类</option>
|
||||||
|
<option value="2" >设备集成类</option>
|
||||||
|
<option value="3" >战略合作类</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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">
|
||||||
|
<select data-am-selected id="underwrittenMode" name="underwrittenMode">
|
||||||
|
<option value="1" >A类-不垫资(战略合作)</option>
|
||||||
|
<option value="2" >B类-不垫资(背靠背)</option>
|
||||||
|
<option value="3" >C类-垫资(账期覆盖)</option>
|
||||||
|
<option value="4" >D类-垫资(账期不覆盖)</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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" class="am-input" data-validate-async data-validation-message="请输入客户名称(20字符以内)"
|
||||||
|
name="customer" placeholder="请输入客户名称(20字符以内)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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" class="am-input" data-validate-async data-validation-message="请输入终端客户名称(20字符以内)"
|
||||||
|
name="terminalCustomer" placeholder="请输入终端客户名称(20字符以内)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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="number" class="am-input" data-validate-async data-validation-message="请输入垫资利息"
|
||||||
|
name="advanceInterestAmount" placeholder="单位(元)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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="number" class="am-input" data-validate-async data-validation-message="请输入垫资峰值"
|
||||||
|
name="advancePeakAmount" placeholder="单位(元)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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="number" class="am-input" data-validate-async data-validation-message="请输入合同金额"
|
||||||
|
name="contractAmount" placeholder="单位(元)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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" class="am-input" data-validate-async data-validation-message="请输入行业场景应用"
|
||||||
|
name="industryScenario" placeholder="请输入行业场景应用" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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="number" class="am-input" data-validate-async data-validation-message="华智产品金额"
|
||||||
|
name="huazhiProductAmount" placeholder="单位(元)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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="number" class="am-input" data-validate-async data-validation-message="请输入紫光其他产品金额"
|
||||||
|
name="ziguangOtherAmount" placeholder="单位(元)" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
<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" class="am-input" data-validate-async data-validation-message="请输入收款条款"
|
||||||
|
name="mainContractCollectionTerms" placeholder="请输入收款条款" maxlength="20"
|
||||||
|
value="" required />
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--验证表单元素(validate end-->
|
||||||
|
</div>
|
||||||
|
<div class="am-tabs-bd">
|
||||||
|
<div class="am-tab-panel am-fade am-in" id="tab2">
|
||||||
|
<span class="am-text-xl">收入</span>
|
||||||
|
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||||
|
<tbody>
|
||||||
|
<tr class="am-text-xl">
|
||||||
|
<td>类别</td>
|
||||||
|
<td>费用</td>
|
||||||
|
<td>含税金额(元)</td>
|
||||||
|
<td>不含税金额(元)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>收入</td>
|
||||||
|
<td>设备类</td>
|
||||||
|
<td><input name="incomeDeviceTaxInclude" required></td>
|
||||||
|
<td><input name="incomeDeviceTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>收入</td>
|
||||||
|
<td>工程类</td>
|
||||||
|
<td><input name="incomeEngineerTaxInclude" required></td>
|
||||||
|
<td><input name="incomeEngineerTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>收入</td>
|
||||||
|
<td>服务类</td>
|
||||||
|
<td><input name="incomeServiceTaxInclude" required></td>
|
||||||
|
<td><input name="incomeServiceTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>合计</td>
|
||||||
|
<td></td>
|
||||||
|
<td><input name="incomeTotalTaxInclude" readonly></td>
|
||||||
|
<td><input name="incomeTotalTaxExclude" readonly></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<span class="am-text-xl">成本</span>
|
||||||
|
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||||
|
<tbody>
|
||||||
|
<tr class="am-text-xl">
|
||||||
|
<td>类别</td>
|
||||||
|
<td>费用</td>
|
||||||
|
<td>费用项目</td>
|
||||||
|
<td>含税金额(元)</td>
|
||||||
|
<td>不含税金额(元)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>成本</td>
|
||||||
|
<td>采购成本</td>
|
||||||
|
<td>设备</td>
|
||||||
|
<td><input name="costPurchaseDeviceTaxInclude" required></td>
|
||||||
|
<td><input name="costPurchaseDeviceTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>成本</td>
|
||||||
|
<td>采购成本</td>
|
||||||
|
<td>施工</td>
|
||||||
|
<td><input name="costPurchaseBuildTaxInclude" required></td>
|
||||||
|
<td><input name="costPurchaseBuildTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>成本</td>
|
||||||
|
<td>采购成本</td>
|
||||||
|
<td>服务</td>
|
||||||
|
<td><input name="costPurchaseServiceTaxInclude" required></td>
|
||||||
|
<td><input name="costPurchaseServiceTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>成本</td>
|
||||||
|
<td>采购成本</td>
|
||||||
|
<td>其他</td>
|
||||||
|
<td><input name="costPurchaseOtherTaxInclude" required></td>
|
||||||
|
<td><input name="costPurchaseOtherTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>成本</td>
|
||||||
|
<td>项目管理成本</td>
|
||||||
|
<td>项目管理成本</td>
|
||||||
|
<td><input name="costProjectManageTaxInclude" required></td>
|
||||||
|
<td><input name="costProjectManageTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>成本</td>
|
||||||
|
<td>其他</td>
|
||||||
|
<td>其他</td>
|
||||||
|
<td><input name="costOtherOtherTaxInclude" required></td>
|
||||||
|
<td><input name="costOtherOtherTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>合计</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td><input name="costTotalTaxInclude" readonly></td>
|
||||||
|
<td><input name="costTotalTaxExclude" readonly></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<span class="am-text-xl">管理</span>
|
||||||
|
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||||
|
<tbody>
|
||||||
|
<tr class="am-text-xl">
|
||||||
|
<td>类别</td>
|
||||||
|
<td>费用项目</td>
|
||||||
|
<td>不含税金额(元)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>财务费用</td>
|
||||||
|
<td>资金占用成本</td>
|
||||||
|
<td><input name="costExpropriationTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>公司管理费用</td>
|
||||||
|
<td></td>
|
||||||
|
<td><input name="costCompanyManageTaxExclude" required></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<span class="am-text-xl">利润率计算</span>
|
||||||
|
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||||
|
<tbody>
|
||||||
|
<tr class="am-text-xl">
|
||||||
|
<td>类别</td>
|
||||||
|
<td>不含税金额(元)</td>
|
||||||
|
<td>利润率(%)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>项目毛利</td>
|
||||||
|
<td><input name="projectGrossProfit" readonly></td>
|
||||||
|
<td><input name="projectGrossProfitRate" readonly></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>项目贡献利润率</td>
|
||||||
|
<td><input name="projectContributionProfit" readonly></td>
|
||||||
|
<td><input name="projectContributionProfitRate" readonly></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--验证表单元素(validate end-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--选项卡(tabs)end-->
|
||||||
|
<div class="am-margin">
|
||||||
|
<button type="button" class="am-btn am-btn-warning am-btn-xs" onclick="javascript:history.go(-1);">返回上一级</button>
|
||||||
|
<button type="submit" class="am-btn am-btn-primary am-btn-xs" onclick="javascript:$("#pmsForm").attr('action')='${base}/project/estimateSave';">保存草稿</button>
|
||||||
|
<button type="submit" class="am-btn am-btn-primary am-btn-xs" onclick="javascript:$("#pmsForm").attr('action')='${base}/project/estimateSaveAndApprove'">提交审核</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$("input[name='incomeDeviceTaxInclude']").change(function () {
|
||||||
|
calIncomeInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='incomeEngineerTaxInclude']").change(function () {
|
||||||
|
calIncomeInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='incomeServiceTaxInclude']").change(function () {
|
||||||
|
calIncomeInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='incomeDeviceTaxExclude']").change(function () {
|
||||||
|
calIncomeExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='incomeEngineerTaxExclude']").change(function () {
|
||||||
|
calIncomeExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='incomeServiceTaxExclude']").change(function () {
|
||||||
|
calIncomeExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$("input[name='costPurchaseDeviceTaxInclude']").change(function () {
|
||||||
|
calCostInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costPurchaseBuildTaxInclude']").change(function () {
|
||||||
|
calCostInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costPurchaseServiceTaxInclude']").change(function () {
|
||||||
|
calCostInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costPurchaseOtherTaxInclude']").change(function () {
|
||||||
|
calCostInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costProjectManageTaxInclude']").change(function () {
|
||||||
|
calCostInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costOtherOtherTaxInclude']").change(function () {
|
||||||
|
calCostInclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("input[name='costPurchaseDeviceTaxExclude']").change(function () {
|
||||||
|
calCostExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costPurchaseBuildTaxExclude']").change(function () {
|
||||||
|
calCostExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costPurchaseServiceTaxExclude']").change(function () {
|
||||||
|
calCostExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costPurchaseOtherTaxExclude']").change(function () {
|
||||||
|
calCostExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costProjectManageTaxExclude']").change(function () {
|
||||||
|
calCostExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costOtherOtherTaxExclude']").change(function () {
|
||||||
|
calCostExclude();
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("input[name='costExpropriationTaxExclude']").change(function () {
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
$("input[name='costCompanyManageTaxExclude']").change(function () {
|
||||||
|
calIncomeCost();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计收入(含税),有一项没填就置空
|
||||||
|
*/
|
||||||
|
function calIncomeInclude() {
|
||||||
|
var incomeDeviceTaxInclude = $("input[name='incomeDeviceTaxInclude']").val();
|
||||||
|
var incomeEngineerTaxInclude = $("input[name='incomeEngineerTaxInclude']").val();
|
||||||
|
var incomeServiceTaxInclude = $("input[name='incomeServiceTaxInclude']").val();
|
||||||
|
|
||||||
|
var incomeTotalTaxInclude = $("input[name='incomeTotalTaxInclude']");
|
||||||
|
|
||||||
|
if(incomeDeviceTaxInclude && incomeEngineerTaxInclude && incomeServiceTaxInclude){
|
||||||
|
incomeTotalTaxInclude.val(parseFloat(incomeDeviceTaxInclude)+parseFloat(incomeEngineerTaxInclude)+parseFloat(incomeServiceTaxInclude));
|
||||||
|
}else {
|
||||||
|
incomeTotalTaxInclude.val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 统计收入(不含税),有一项没填就置空
|
||||||
|
*/
|
||||||
|
function calIncomeExclude() {
|
||||||
|
var incomeDeviceTaxExclude = $("input[name='incomeDeviceTaxExclude']").val();
|
||||||
|
var incomeEngineerTaxExclude = $("input[name='incomeEngineerTaxExclude']").val();
|
||||||
|
var incomeServiceTaxExclude = $("input[name='incomeServiceTaxExclude']").val();
|
||||||
|
|
||||||
|
var incomeTotalTaxExclude = $("input[name='incomeTotalTaxExclude']");
|
||||||
|
|
||||||
|
if(incomeDeviceTaxExclude && incomeEngineerTaxExclude && incomeServiceTaxExclude){
|
||||||
|
incomeTotalTaxExclude.val(parseFloat(incomeDeviceTaxExclude)+parseFloat(incomeEngineerTaxExclude)+parseFloat(incomeServiceTaxExclude));
|
||||||
|
}else {
|
||||||
|
incomeTotalTaxExclude.val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计成本(含税),有一项没填就置空
|
||||||
|
*/
|
||||||
|
function calCostInclude() {
|
||||||
|
var costPurchaseDeviceTaxInclude = $("input[name='costPurchaseDeviceTaxInclude']").val();
|
||||||
|
var costPurchaseBuildTaxInclude = $("input[name='costPurchaseBuildTaxInclude']").val();
|
||||||
|
var costPurchaseServiceTaxInclude = $("input[name='costPurchaseServiceTaxInclude']").val();
|
||||||
|
var costPurchaseOtherTaxInclude = $("input[name='costPurchaseOtherTaxInclude']").val();
|
||||||
|
var costProjectManageTaxInclude = $("input[name='costProjectManageTaxInclude']").val();
|
||||||
|
var costOtherOtherTaxInclude = $("input[name='costOtherOtherTaxInclude']").val();
|
||||||
|
|
||||||
|
|
||||||
|
var costTotalTaxInclude = $("input[name='costTotalTaxInclude']");
|
||||||
|
|
||||||
|
if(costPurchaseDeviceTaxInclude && costPurchaseBuildTaxInclude && costPurchaseServiceTaxInclude && costPurchaseOtherTaxInclude && costProjectManageTaxInclude && costOtherOtherTaxInclude){
|
||||||
|
costTotalTaxInclude.val(parseFloat(costPurchaseDeviceTaxInclude)+parseFloat(costPurchaseBuildTaxInclude)+parseFloat(costPurchaseServiceTaxInclude)+parseFloat(costPurchaseOtherTaxInclude)+parseFloat(costProjectManageTaxInclude)+parseFloat(costOtherOtherTaxInclude));
|
||||||
|
}else {
|
||||||
|
costTotalTaxInclude.val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 统计成本(不含税),有一项没填就置空
|
||||||
|
*/
|
||||||
|
function calCostExclude() {
|
||||||
|
var costPurchaseDeviceTaxExclude = $("input[name='costPurchaseDeviceTaxExclude']").val();
|
||||||
|
var costPurchaseBuildTaxExclude = $("input[name='costPurchaseBuildTaxExclude']").val();
|
||||||
|
var costPurchaseServiceTaxExclude = $("input[name='costPurchaseServiceTaxExclude']").val();
|
||||||
|
var costPurchaseOtherTaxExclude = $("input[name='costPurchaseOtherTaxExclude']").val();
|
||||||
|
var costProjectManageTaxExclude = $("input[name='costProjectManageTaxExclude']").val();
|
||||||
|
var costOtherOtherTaxExclude = $("input[name='costOtherOtherTaxExclude']").val();
|
||||||
|
|
||||||
|
|
||||||
|
var costTotalTaxExclude = $("input[name='costTotalTaxExclude']");
|
||||||
|
|
||||||
|
if(costPurchaseDeviceTaxExclude && costPurchaseBuildTaxExclude && costPurchaseServiceTaxExclude && costPurchaseOtherTaxExclude && costProjectManageTaxExclude && costOtherOtherTaxExclude){
|
||||||
|
costTotalTaxExclude.val(parseFloat(costPurchaseDeviceTaxExclude)+parseFloat(costPurchaseBuildTaxExclude)+parseFloat(costPurchaseServiceTaxExclude)+parseFloat(costPurchaseOtherTaxExclude)+parseFloat(costProjectManageTaxExclude)+parseFloat(costOtherOtherTaxExclude));
|
||||||
|
}else {
|
||||||
|
costTotalTaxExclude.val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算毛利、毛利率、贡献、贡献率
|
||||||
|
*/
|
||||||
|
function calIncomeCost() {
|
||||||
|
var incomeTotalTaxExclude = $("input[name='incomeTotalTaxExclude']").val();
|
||||||
|
var costTotalTaxExclude = $("input[name='costTotalTaxExclude']").val();
|
||||||
|
var costExpropriationTaxExclude = $("input[name='costExpropriationTaxExclude']").val();
|
||||||
|
var costCompanyManageTaxExclude = $("input[name='costCompanyManageTaxExclude']").val();
|
||||||
|
|
||||||
|
var projectGrossProfit = $("input[name='projectGrossProfit']");
|
||||||
|
var projectGrossProfitRate = $("input[name='projectGrossProfitRate']");
|
||||||
|
var projectContributionProfit = $("input[name='projectContributionProfit']");
|
||||||
|
var projectContributionProfitRate = $("input[name='projectContributionProfitRate']");
|
||||||
|
|
||||||
|
if(incomeTotalTaxExclude && costTotalTaxExclude && costExpropriationTaxExclude){
|
||||||
|
projectGrossProfit.val(parseFloat(incomeTotalTaxExclude)-parseFloat(costTotalTaxExclude)-parseFloat(costExpropriationTaxExclude));
|
||||||
|
projectGrossProfitRate.val(parseFloat(projectGrossProfit.val())*100/parseFloat(incomeTotalTaxExclude));
|
||||||
|
}else {
|
||||||
|
projectGrossProfit.val("");
|
||||||
|
projectGrossProfitRate.val("");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(projectGrossProfit.val() && costCompanyManageTaxExclude){
|
||||||
|
projectContributionProfit.val(parseFloat(projectGrossProfit.val())-parseFloat(costCompanyManageTaxExclude));
|
||||||
|
projectContributionProfitRate.val(parseFloat(projectContributionProfit.val())*100/parseFloat(incomeTotalTaxExclude))
|
||||||
|
}else {
|
||||||
|
projectContributionProfit.val("");
|
||||||
|
projectContributionProfitRate.val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</@defaultLayout.layout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -92,14 +92,14 @@
|
||||||
<div class="am-form am-form-inline">
|
<div class="am-form am-form-inline">
|
||||||
<div class="am-form-group am-form-icon">
|
<div class="am-form-group am-form-icon">
|
||||||
<i class="am-icon-calendar"></i>
|
<i class="am-icon-calendar"></i>
|
||||||
<input type="text" class="am-form-field am-input-sm" id="startTime"
|
<input type="text" class="am-form-field am-input-sm" id="startDate"
|
||||||
value="${startTime!}" placeholder="开始日期" data-am-datepicker>
|
value="${startDate!}" placeholder="开始日期" data-am-datepicker>
|
||||||
</div>
|
</div>
|
||||||
<div class="am-form-group">至</div>
|
<div class="am-form-group">至</div>
|
||||||
<div class="am-form-group am-form-icon">
|
<div class="am-form-group am-form-icon">
|
||||||
<i class="am-icon-calendar"></i>
|
<i class="am-icon-calendar"></i>
|
||||||
<input type="text" class="am-form-field am-input-sm" id="endTime"
|
<input type="text" class="am-form-field am-input-sm" id="endDate"
|
||||||
value="${endTime!}"
|
value="${endDate!}"
|
||||||
placeholder="结束日期" data-am-datepicker>
|
placeholder="结束日期" data-am-datepicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -220,10 +220,10 @@
|
||||||
keywordsObj.deptId = $("#deptId").val();
|
keywordsObj.deptId = $("#deptId").val();
|
||||||
if ($("#type").val())
|
if ($("#type").val())
|
||||||
keywordsObj.type = $("#type").val();
|
keywordsObj.type = $("#type").val();
|
||||||
if ($("#startTime").val())
|
if ($("#startDate").val())
|
||||||
keywordsObj.startTime = $("#startTime").val();
|
keywordsObj.startDate = $("#startDate").val();
|
||||||
if ($("#endTime").val())
|
if ($("#endDate").val())
|
||||||
keywordsObj.endTime = $("#endTime").val();
|
keywordsObj.endDate = $("#endDate").val();
|
||||||
var keywords = "";
|
var keywords = "";
|
||||||
if (!$.isEmptyObject(keywordsObj)) {
|
if (!$.isEmptyObject(keywordsObj)) {
|
||||||
keywords = JSON.stringify(keywordsObj);
|
keywords = JSON.stringify(keywordsObj);
|
||||||
|
|
Loading…
Reference in New Issue