BpmButton.vue将提交审批信息移动到提交对话框中
This commit is contained in:
@@ -301,6 +301,11 @@ public class ${ClassName}Controller extends BaseController {
|
|||||||
@RequestMapping(value = "delete")
|
@RequestMapping(value = "delete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String delete(${ClassName} ${className}) {
|
public String delete(${ClassName} ${className}) {
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
if (!${ClassName}.STATUS_DRAFT.equals(${className}.getStatus())){
|
||||||
|
return renderResult(Global.FALSE, text("只能删除草稿状态的数据!"));
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
${className}Service.delete(${className});
|
${className}Service.delete(${className});
|
||||||
return renderResult(Global.TRUE, text("删除${functionNameSimple}成功!"));
|
return renderResult(Global.TRUE, text("删除${functionNameSimple}成功!"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,10 @@
|
|||||||
bpmEntityKey="id"
|
bpmEntityKey="id"
|
||||||
formKey="${table.optionMap['bpmFormKey']}"
|
formKey="${table.optionMap['bpmFormKey']}"
|
||||||
completeText="提交"
|
completeText="提交"
|
||||||
|
:completeModal="true"
|
||||||
:loading="loadingRef"
|
:loading="loadingRef"
|
||||||
:auth="'${permissionPrefix}:edit'"
|
:auth="'${permissionPrefix}:edit'"
|
||||||
|
@validate="handleValidate"
|
||||||
@complete="handleSubmit"
|
@complete="handleSubmit"
|
||||||
@success="handleSuccess"
|
@success="handleSuccess"
|
||||||
@close="closeDrawer"
|
@close="closeDrawer"
|
||||||
@@ -340,7 +342,7 @@ for (c in table.columnList){
|
|||||||
},
|
},
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
if(toBoolean(table.optionMap['isBpmForm'])){
|
if(false && toBoolean(table.optionMap['isBpmForm'])){
|
||||||
%>
|
%>
|
||||||
{
|
{
|
||||||
label: t('审批意见'),
|
label: t('审批意见'),
|
||||||
@@ -618,14 +620,30 @@ for (c in table.columnList){
|
|||||||
<% } %>
|
<% } %>
|
||||||
setDrawerProps({ loading: false });
|
setDrawerProps({ loading: false });
|
||||||
});
|
});
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleValidate(_event: any, formData: any) {
|
||||||
try {
|
try {
|
||||||
const data = await validate();
|
const data = await validate();
|
||||||
|
formData(true, data); // 将表单数据传递给 BpmButton
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error && error.errorFields) {
|
||||||
|
showMessage(t('common.validateError'));
|
||||||
|
}
|
||||||
|
console.log('error', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
async function handleSubmit(<% if(toBoolean(table.optionMap['isBpmForm'])){ %>event: any<% } %>) {
|
||||||
|
try {
|
||||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
const data = event.formData; // 接受 BpmButton 传递过来的表单数据
|
||||||
data.bpm = Object.assign(data.bpm || {}, record.value.bpm); // 流程信息
|
data.bpm = Object.assign(data.bpm || {}, record.value.bpm); // 流程信息
|
||||||
data.status = record.value.status; // 提交状态
|
data.status = record.value.status; // 提交状态
|
||||||
loadingRef.value = true;
|
loadingRef.value = true;
|
||||||
|
<% } else { %>
|
||||||
|
const data = await validate();
|
||||||
<% } %>
|
<% } %>
|
||||||
setDrawerProps({ confirmLoading: true });
|
setDrawerProps({ confirmLoading: true });
|
||||||
const params: any = {
|
const params: any = {
|
||||||
|
|||||||
Reference in New Issue
Block a user