待我审核 功能
parent
7c2e202e10
commit
dc0159b4eb
|
@ -27,7 +27,9 @@ import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.TypedQuery;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import cn.palmte.work.model.Admin;
|
import cn.palmte.work.model.Admin;
|
||||||
import cn.palmte.work.model.DeptRepository;
|
import cn.palmte.work.model.DeptRepository;
|
||||||
|
@ -36,6 +38,8 @@ import cn.palmte.work.model.ProjectBudgetIncomeDetail;
|
||||||
import cn.palmte.work.model.ProjectRepository;
|
import cn.palmte.work.model.ProjectRepository;
|
||||||
import cn.palmte.work.model.enums.CooperationType;
|
import cn.palmte.work.model.enums.CooperationType;
|
||||||
import cn.palmte.work.model.enums.Enumerable;
|
import cn.palmte.work.model.enums.Enumerable;
|
||||||
|
import cn.palmte.work.model.enums.ProcessStatus;
|
||||||
|
import cn.palmte.work.model.enums.ProcessType;
|
||||||
import cn.palmte.work.model.enums.ProjectType;
|
import cn.palmte.work.model.enums.ProjectType;
|
||||||
import cn.palmte.work.model.enums.SealType;
|
import cn.palmte.work.model.enums.SealType;
|
||||||
import cn.palmte.work.model.process.SaleContractProcess;
|
import cn.palmte.work.model.process.SaleContractProcess;
|
||||||
|
@ -45,6 +49,7 @@ import cn.palmte.work.model.process.form.SaleContractProcessForm;
|
||||||
import cn.palmte.work.service.ProjectBudgetService;
|
import cn.palmte.work.service.ProjectBudgetService;
|
||||||
import cn.palmte.work.utils.InterfaceUtil;
|
import cn.palmte.work.utils.InterfaceUtil;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@ -107,7 +112,8 @@ public class ProcessController {
|
||||||
* 待我审核
|
* 待我审核
|
||||||
*/
|
*/
|
||||||
@GetMapping("/review")
|
@GetMapping("/review")
|
||||||
public String review() {
|
public String review(Model model) {
|
||||||
|
model.addAttribute("processTypes", ProcessType.values());
|
||||||
return "/admin/business/process-review";
|
return "/admin/business/process-review";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,4 +218,45 @@ public class ProcessController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
static class ProcessQueryForm {
|
||||||
|
|
||||||
|
private String projectNo;
|
||||||
|
private String projectTitle;
|
||||||
|
private String projectCreator;
|
||||||
|
|
||||||
|
private ProcessType processType;
|
||||||
|
private ProcessStatus processStatus;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/query")
|
||||||
|
public List<SaleContractProcess> list(@RequestBody ProcessQueryForm form) {
|
||||||
|
TypedQuery<SaleContractProcess> query = entityManager.createQuery(
|
||||||
|
"from SaleContractProcess ", SaleContractProcess.class);
|
||||||
|
|
||||||
|
// query.setMaxResults();
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核
|
||||||
|
@Data
|
||||||
|
static class AuditForm {
|
||||||
|
|
||||||
|
private Integer processId;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String auditOpinion;
|
||||||
|
|
||||||
|
private ProcessStatus processStatus;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/audit")
|
||||||
|
public void audit(@RequestBody @Valid AuditForm form) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
package cn.palmte.work.model.enums;
|
package cn.palmte.work.model.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*
|
||||||
* @author <a href="https://github.com/TAKETODAY">Harry Yang</a>
|
* @author <a href="https://github.com/TAKETODAY">Harry Yang</a>
|
||||||
* @since 2.0 2022/12/13 16:12
|
* @since 2.0 2022/12/13 16:12
|
||||||
*/
|
*/
|
||||||
public enum ProcessStatus implements Enumerable<String> {
|
public enum ProcessStatus implements Enumerable<String> {
|
||||||
|
|
||||||
draft("草稿"),
|
draft("草稿"),
|
||||||
|
to_be_audit("待审核"),
|
||||||
|
audit_passed("审核通过"),
|
||||||
|
audit_not_passed("审核不通过"),
|
||||||
completed("完成");
|
completed("完成");
|
||||||
|
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package cn.palmte.work.model.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="https://github.com/TAKETODAY">Harry Yang</a>
|
||||||
|
* @since 2.0 2022/12/19 16:47
|
||||||
|
*/
|
||||||
|
public enum ProcessType implements Enumerable<String> {
|
||||||
|
sale_contract("销售合同流程"),
|
||||||
|
business_procurement("业务采购流程");
|
||||||
|
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
ProcessType(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,44 +1,252 @@
|
||||||
<#assign base=request.contextPath />
|
<#assign base=request.contextPath />
|
||||||
<#import "../../common/defaultLayout.ftl" as defaultLayout>
|
<#import "../../common/defaultLayout.ftl" as defaultLayout>
|
||||||
<@defaultLayout.layout>
|
<@defaultLayout.layout>
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
#businessPurchaseDetailsModal {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#businessPurchaseDetailsModal > table {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#newBusinessProcurementContractProcess {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload__input {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea .el-input__count {
|
||||||
|
line-height: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-content-body {
|
||||||
|
margin-bottom: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__empty-block {
|
||||||
|
height: 60px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app">{{ message }}</div>
|
<div class="admin-content" id="app">
|
||||||
|
<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>
|
||||||
|
|
||||||
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
<div class="am-g">
|
||||||
|
<div class="am-u-sm-12 am-u-md-12">
|
||||||
|
<el-form :inline="true" ref="queryForm" :model="queryForm" label-position="right" label-width="100px">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<el-form-item label="标题">
|
||||||
|
<el-input placeholder="请输入标题" v-model="queryForm.projectTitle"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="项目编号">
|
||||||
|
<el-input placeholder="请输入项目编号" v-model="queryForm.projectNo"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="流程类型">
|
||||||
|
<el-select v-model="queryForm.processType" placeholder="请选择">
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<#list processTypes as processType>
|
||||||
|
<el-option label="${processType.description}"
|
||||||
|
value="${processType.name()}"></el-option>
|
||||||
|
</#list>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="项目创建者">
|
||||||
|
<el-input placeholder="请输入项目创建者" v-model="queryForm.projectCreator"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="queryTable">查询</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table border :data="tableData">
|
||||||
|
<el-table-column type="index" :index="1" label="序号" fixed></el-table-column>
|
||||||
|
<el-table-column prop="name" label="项目编号" fixed></el-table-column>
|
||||||
|
<el-table-column prop="type" label="标题"></el-table-column>
|
||||||
|
<el-table-column prop="spec" label="流程类型"></el-table-column>
|
||||||
|
<el-table-column prop="param" label="项目创建者"></el-table-column>
|
||||||
|
<el-table-column prop="unit" label="审核状态"></el-table-column>
|
||||||
|
<el-table-column prop="amount" label="当前审核人"></el-table-column>
|
||||||
|
<el-table-column prop="price" label="最后更新时间"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" fixed="right" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" @click="showDetail(scope.row, scope)">查看详情</el-button>
|
||||||
|
<el-button type="text" @click="auditProcess(scope.row, scope)">审核</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog title="审核" :visible.sync="auditFormVisible">
|
||||||
|
<el-form :model="auditForm">
|
||||||
|
|
||||||
|
<el-form-item label="审核">
|
||||||
|
<el-radio-group v-model="auditForm.processStatus">
|
||||||
|
<el-radio label="audit_passed">审核通过</el-radio>
|
||||||
|
<el-radio label="audit_not_passed">审核不通过</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="审核意见">
|
||||||
|
<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 10}"
|
||||||
|
maxlength="5000" v-model="auditForm.auditOpinion"
|
||||||
|
placeholder="请输入审核意见" cols="90"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitAudit">提交</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
|
||||||
|
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const {createApp} = Vue
|
|
||||||
|
|
||||||
createApp({
|
const isEmpty = (obj) => {
|
||||||
data() {
|
return !obj || (obj.length && obj.length === 0)
|
||||||
return {
|
}
|
||||||
message: 'Hello Vue!'
|
|
||||||
}
|
const isNotEmpty = (obj) => {
|
||||||
|
return !isEmpty(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
const isBlank = (obj) => {
|
||||||
|
return isEmpty(obj) || (obj.trim && isEmpty(obj.trim()))
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasText = (obj) => {
|
||||||
|
return !isBlank(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = () => {
|
||||||
|
return {
|
||||||
|
auditForm: {
|
||||||
|
processStatus: null
|
||||||
|
},
|
||||||
|
auditFormVisible: false,
|
||||||
|
tableData: [],
|
||||||
|
queryForm: {},
|
||||||
|
projectSelected: false,
|
||||||
|
fileList: [],
|
||||||
|
// 销售合同收入明细
|
||||||
|
incomeDetails: [],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const methods = {
|
||||||
|
showDetail(row, scope) {
|
||||||
|
console.log(row)
|
||||||
|
console.log(scope)
|
||||||
|
|
||||||
|
},
|
||||||
|
auditProcess(row, scope) {
|
||||||
|
console.log(row)
|
||||||
|
console.log(scope)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
submitAudit() {
|
||||||
|
|
||||||
|
console.log("submitAudit");
|
||||||
|
},
|
||||||
|
|
||||||
|
render(obj) {
|
||||||
|
console.log(obj)
|
||||||
|
},
|
||||||
|
|
||||||
|
queryTable() {
|
||||||
|
const form = {
|
||||||
|
...this.queryForm,
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch("${base}/process/query", {
|
||||||
|
method: 'POST', // or 'PUT'
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify(form),
|
||||||
|
}).then(res => res.json())
|
||||||
|
.then(data => {
|
||||||
|
this.tableData = data
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$message.error('项目搜索失败');
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data,
|
||||||
|
computed: {
|
||||||
|
projectTitle() {
|
||||||
|
const { projectNo, projectName, applyPersonName, applyDate } = this.processForm
|
||||||
|
if (projectNo && projectName) {
|
||||||
|
return projectNo.trim() + "-" + projectName.trim() + "-" + applyPersonName + "-" + applyDate
|
||||||
}
|
}
|
||||||
}).mount('#app')
|
return ""
|
||||||
|
},
|
||||||
|
isButtonMode() {
|
||||||
|
return this.mode === BUTTON
|
||||||
|
},
|
||||||
|
isBusinessProcurementContractProcessMode() {
|
||||||
|
return this.mode === newBusinessProcurementContractProcess
|
||||||
|
},
|
||||||
|
isSalesContractProcessMode() {
|
||||||
|
return this.mode === saleContractProcess
|
||||||
|
},
|
||||||
|
isSaleContractDetailMode() {
|
||||||
|
return this.mode === saleContractDetail
|
||||||
|
},
|
||||||
|
subTitle() {
|
||||||
|
switch (this.mode) {
|
||||||
|
case BUTTON:
|
||||||
|
return "新增流程"
|
||||||
|
case saleContractProcess:
|
||||||
|
return "新增销售合同流程"
|
||||||
|
case saleContractDetail:
|
||||||
|
return "销售合同清单明细"
|
||||||
|
case newBusinessProcurementContractProcess:
|
||||||
|
return "新增业务采购合同流程"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods,
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.queryTable()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function () {
|
|
||||||
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
</@defaultLayout.layout>
|
</@defaultLayout.layout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue