审批处理样式处理

This commit is contained in:
ChenXinXin committed 2024-04-29 15:54:17 +08:00
1 parent e751661fc9
commit 5f7e5a038f
3 files changed
+262 -127

No files matched your search

+70 -53
View File
@@ -110,40 +110,45 @@
<!-- <<<<<<<<<<<<< 页面内容 -->
<!--编辑抽屉-->
<v-navigation-drawer v-model="isSubmitDrawerShown" v-click-outside="drawerClickOutside" fixed temporary right width="80%" class="elevation-24">
<v-form v-if="isSubmitDrawerShown" ref="updateForm" lazy-validation>
<!-- 抽屉标题 -->
<v-row no-gutters class="align-center justify-end">
<span class="text-h7 font-weight-bold pa-4">审核信息</span>
<v-spacer></v-spacer>
<!-- 抽屉操作按钮 -->
<div class="d-flex justify-end pr-4">
<v-btn :color="lineTypeItem.type === '拒绝' ? 'error' : 'success'" small class="ml-2" v-for="lineTypeItem in lineTypeList" v-if="lineTypeItem.type" @click="doUiAction('submitNode', lineTypeItem.type)">
{{ lineTypeItem.type }}
</v-btn>
</div>
</v-row>
<v-divider class="jh-divider"></v-divider>
<v-navigation-drawer v-if="isSubmitDrawerShown" v-model="isSubmitDrawerShown" fixed temporary right width="80%" class="elevation-24">
<!-- 抽屉标题 -->
<v-row no-gutters class="align-center justify-end">
<span class="text-h7 font-weight-bold pa-4">审核信息【{{updateItemId}}】</span>
<v-spacer></v-spacer>
</v-row>
<!--抽屉表单-->
<v-row class="mt-0 px-4" >
<v-col cols="12" sm="12" md="4" v-for="(formItem, index) in updateItem.taskFormInput.formList" :key="index">
<form-item :form-item="formItem" :readonly="updateItem.readonlyFormIdList"></form-item>
</v-col>
<v-divider class="jh-divider"></v-divider>
<v-row class="my-2 px-4">
<v-col cols="12" v-for="(formItem, index) in updateItem.taskFormInput" :key="index" class="px-2 py-1 ma-0">
<span class="jh-input-label">{{ index + 1 }}. {{ formItem.statement }}<span v-show="formItem.isRequire" class="red--text ml-1">*</span></span>
<form-component-list :form-item="formItem" :disabled='true' ></form-component-list>
</v-col>
</v-row>
<template v-if="workflowType == 'todo'">
<v-divider class="jh-divider"></v-divider>
<v-row class="mt-0 px-4">
<v-col cols="12" sm="12" md="12">
<span class="jh-input-label">备注</span>
<v-textarea
class="jh-v-input" no-resize dense single-line filled
v-model="updateItem.taskComment" :readonly="workflowType != 'todo'"></v-textarea>
<div class="text-subtitle-2 mb-1">审批意见</div>
<v-textarea class="jh-v-input" dense filled counter="250" v-model="updateItem.taskComment" :readonly="workflowType != 'todo'"></v-textarea>
</v-col>
</v-row>
</v-form>
<!-- 抽屉操作按钮 -->
<div class="d-flex justify-end mt-2 mr-4">
<v-btn :color="lineTypeItem.value === '拒绝' ? 'error' : 'success'" small class="ml-2" v-for="lineTypeItem in lineTypeList" v-if="lineTypeItem.value" @click="doUiAction('submitNode', lineTypeItem.value)">
{{ lineTypeItem.text }}
</v-btn>
</div>
</template>
<v-divider class="jh-divider"></v-divider>
<!-- 审核历史 -->
<v-row class="mt-8">
<v-col cols="12" sm="12" md="12">
<div class="text-subtitle-2 mb-2 mx-4">审核历史</div>
<task-history :task-id="updateItem.taskId" @line-type-list="setLineTypeList"></task-history>
<div class="text-subtitle-2 mb-2 mx-4 font-weight-bold">审批流程</div>
<task-history :workflow-config="updateItem.taskWorkflow" :task-id="updateItem.taskId" :task-config-id="updateItem.taskConfigId"></task-history>
</v-col>
</v-row>
@@ -186,7 +191,7 @@
{% block vueScript %}
<!-- 加载页面组件 >>>>>>>>>>>>> -->
{% include 'component/formItem.html' %}
{% include 'component/tpl/formComponentList.html' %}
{% include 'component/taskHistory.html' %}
{% include 'common/jianghuJs/fixedTableHeightV4.html' %}
<!-- <<<<<<<<<<<<< 加载页面组件 -->
@@ -213,17 +218,29 @@
tableData: [],
historyData: [],
headers: [
{ text: "审批项", value: "taskTitle" },
{ text: "操作者", value: "operationByUser", width: 120 },
{ text: "操作时间", value: "operationAt", width: 250 },
{ text: "审批ID", value: "taskId", width: 120 },
{ text: "分组", value: "taskTemplateGroup", width: 120 },
{ text: "审批项", value: "taskTitle", width: 200 },
{ text: "创建者", value: "taskInitUser", width: 120 },
{ text: "创建时间", value: "taskCreateAt", width: 150 },
{ text: "结束时间", value: "taskFinishAt", width: 150 },
{text: '操作', value: 'action', align: 'center', sortable: false, width: 80, class: 'fixed', cellClass: 'fixed'},
],
isSubmitDrawerShown: false,
updateItem: {},
workflowType: 'todo', // todo, history
lineTypeList: [],
userId: '<$ ctx.userInfo.userId $>'
lineTypeList: [{
text: "同意",
value: "同意",
},{
text: "拒绝",
value: "拒绝",
}],
userId: '<$ ctx.userInfo.userId $>',
updateItem: {},
updateItemId: null,
},
// 计算
computed: {
@@ -245,14 +262,12 @@
case 'getHistoryData':
await this.getHistoryData();
break;
case 'openDataPicker':
await this.openDataPicker(uiActionData);
break;
case 'startUpdateItem':
await this.prepareUpdateFormData(uiActionData);
await this.openUpdateDrawer();
break;
case 'submitNode':
await this.prepareSubmitValidate();
await this.confirmSubmitDialog();
await this.submitForReview(uiActionData);
await this.closeSubmitDrawer();
@@ -279,13 +294,10 @@
}
}
});
const rows = result.data.appData.resultData.rows;
rows.forEach(row => {
row.taskFormInput = JSON.parse(row.taskFormInput);
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
});
this.tableData = rows.filter(item => !item.taskEditedUserList || !item.taskEditedUserList.includes(this.userId));
this.isTableLoading = false;
},
async getHistoryData() {
@@ -296,8 +308,7 @@
pageId: 'todo',
actionId: 'selectHistoryList',
actionData: {},
where: { taskStatus: 'running' },
whereLike: { taskEditUserList: '<$ ctx.userInfo.userId $>', taskConfigId: 'userTask-' },
whereLike: { taskEditUserList: '<$ ctx.userInfo.userId $>', taskConfigId: 'approvalTask-' },
orderBy: [{ column: 'id', order: 'desc' }]
}
}
@@ -305,26 +316,31 @@
const rows = result.data.appData.resultData.rows;
rows.forEach(row => {
row.taskFormInput = JSON.parse(row.taskFormInput);
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
});
this.historyData = rows;
},
// ---------- 审核、查看 uiAction >>>>>>>>>>>> --------
async prepareUpdateFormData(funObj) {
this.updateItem = _.cloneDeep(funObj);
this.updateItem.workflowConfig = JSON.parse(funObj.workflowConfig);
this.updateItem.currentNode = this.updateItem.workflowConfig.nodeList.find(e => e.id === this.updateItem.taskConfigId);
this.updateItem.readonlyFormIdList = this.updateItem.taskFormInput.formList.map(form => form.id).filter(formId => (this.updateItem.currentNode.formIdEdit || '').indexOf(formId) === -1);
this.updateItem.taskHistoryList = []; // 审核历史
this.updateItemId = this.updateItem.taskId
this.updateItem.taskWorkflow = JSON.parse(funObj.taskWorkflow);
this.updateItem.taskFormInput = JSON.parse(funObj.taskFormInput);
this.updateItem.taskComment = ''; // 备注
this.lineTypeList = []; // 所有操作按钮
},
async openUpdateDrawer() {
this.isSubmitDrawerShown = true;
},
prepareSubmitValidate(){
if(this.updateItem.taskComment.length > 250){
window.vtoast.fail("审批意见不能超过250个字!")
throw new Error("审批意见不能超过250个字!")
}
},
async confirmSubmitDialog() {
if (await window.confirmDialog({ title: "审核", content: "确定提交审核吗?" }) === false) {
throw new Error("[confirmSubmitDialog] 否");
@@ -338,7 +354,10 @@
appData: {
pageId: 'todo',
actionId: 'submitNode',
actionData: { type: lineType, id: this.updateItem.id, taskId: this.updateItem.taskId, taskComment: this.updateItem.taskComment, taskFormInput: JSON.stringify(this.updateItem.taskFormInput) }
actionData: {
updateItem: this.updateItem,
type: lineType
}
}
}
})
@@ -347,9 +366,7 @@
async closeSubmitDrawer() {
this.isSubmitDrawerShown = false;
this.updateItem = {};
},
setLineTypeList(lineTypeList) {
this.lineTypeList = _.uniqBy((lineTypeList || '').split(",").map(lineType => ({ type: lineType, label: lineType })), 'type');
this.updateItemId = null;
},
// ---------- <<<<<<<<<<< 审核、查看 uiAction --------
}