257 lines
9.2 KiB
HTML
257 lines
9.2 KiB
HTML
{% extends 'template/jhTemplateV3.html'%}
|
|
|
|
{% block vue_template %}
|
|
|
|
<jh-layout-v3>
|
|
|
|
<!-- 页面主要内容 -->
|
|
<v-card :class="{'px-2': isMobile}">
|
|
<v-stepper v-model="step" class="mb-4 elevation-0 pa-0 ma-0 pt-4" :class="{'px-10': !isMobile, 'px-3': isMobile}">
|
|
<v-stepper-header class="elevation-0 pa-0 ma-0">
|
|
<template v-for="(item, index) in taskStepperList">
|
|
<v-divider v-if="index > 0" class="mx-1"></v-divider>
|
|
<v-stepper-step :complete="step > item.value" :step="item.value" class="pa-4" color="success">
|
|
{{ item.text }}
|
|
</v-stepper-step>
|
|
</template>
|
|
</v-stepper-header>
|
|
</v-stepper>
|
|
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}"><v-subheader>表单信息</v-subheader></v-row>
|
|
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}">
|
|
<v-col :cols="taskTpl.prev ? 6 : 12" v-for="(key, i) in ['prev', 'input']" :key="i"
|
|
v-if="isAccess && taskTpl[key]">
|
|
<v-row>
|
|
<v-col cols="12" class=" pb-3" v-for="(formItem, index) in taskTpl.formList" :key="index"
|
|
v-if="taskTpl[key] && !(currentNode.formIdHidden || []).includes(formItem.id)">
|
|
<!-- <v-subheader inset > {{ key === 'prev' ? '历史表单' : '当前' }} </v-subheader> -->
|
|
<template v-if="formItem.component.type === 'singleSelect'">
|
|
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, key) }}
|
|
</v-list-item-title>
|
|
<v-radio-group v-model="taskTpl[key][formItem.id]">
|
|
<v-radio hide-details v-for="(option, optionIndex) in formItem.component.property.selectOptionList"
|
|
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
|
|
:key="optionIndex"
|
|
:label="option.value"></v-radio>
|
|
</v-radio-group>
|
|
</template>
|
|
|
|
<template v-if="formItem.component.type === 'multipleSelect'">
|
|
<v-list-item-title class="formItem-title">{{ formTitlePrefix(formItem.component.outline, key) }}
|
|
</v-list-item-title>
|
|
<div v-for="(option, optionIndex) in formItem.component.property.selectOptionList" :key="optionIndex">
|
|
<v-checkbox style="margin-top: 0px;"
|
|
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
|
|
:label="option.value" :value="option.value"
|
|
v-model="taskTpl[key][formItem.id]" hide-details
|
|
color="red"></v-checkbox>
|
|
</div>
|
|
</template>
|
|
|
|
<template v-if="formItem.component.type === 'textarea'">
|
|
<v-textarea hide-details dense outlined placeholder="请输入"
|
|
:label="formTitlePrefix(formItem.component.outline, key)"
|
|
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
|
|
v-model="taskTpl[key][formItem.id]" :rows="4"/>
|
|
</template>
|
|
|
|
<template v-if="formItem.component.type === 'input'">
|
|
<v-text-field class="cus-v-input" placeholder="请输入" dense outlined
|
|
:label="formTitlePrefix(formItem.component.outline, key)"
|
|
:disabled="key === 'prev' || !(currentNode.formId || []).includes(formItem.id)"
|
|
v-model="taskTpl[key][formItem.id]"></v-text-field>
|
|
</template>
|
|
</v-col>
|
|
</v-row>
|
|
</v-col>
|
|
</v-row>
|
|
<v-row class="pa-0 ma-0" :class="{'px-10': !isMobile, 'px-3': isMobile}" v-if="isAccess">
|
|
<v-col cols="12">
|
|
<v-textarea dense outlined placeholder="请输入备注信息" hide-details v-model="editItem.taskComment" color="success"
|
|
:disabled="currentNode && currentNode.id && currentNode.id.includes('end-')" :rows="4"/>
|
|
</v-col>
|
|
<v-col cols="12" style="text-align: center;" class="mb-3">
|
|
<v-btn color="success" class="mx-4" v-for="item in nextLineList" @click="doUiAction('submitNode', item.type)">
|
|
{{ item.type }}-{{ item.label }}
|
|
</v-btn>
|
|
</v-col>
|
|
</v-row>
|
|
<v-list three-line subheader class="pb-10" :class="{'px-10': !isMobile, 'px-3': isMobile, 'pb-7': isMobile}">
|
|
<v-subheader>任务流转历史</v-subheader>
|
|
<v-divider></v-divider>
|
|
<div class="pa-2">
|
|
<v-simple-table dense>
|
|
<template v-slot:default>
|
|
<thead>
|
|
<tr>
|
|
<th class="text-left">
|
|
节点
|
|
</th>
|
|
<th class="text-left">
|
|
流转
|
|
</th>
|
|
<th class="text-left">
|
|
处理人
|
|
</th>
|
|
<th class="text-left">
|
|
时长
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="item in taskHistoryList" :key="item.name">
|
|
<td>{{ item.taskExplain }}</td>
|
|
<td>{{ item.taskLineLabel }}</td>
|
|
<td>{{ item.operationByUser }}</td>
|
|
<td>{{ item.taskCostDuration }}秒</td>
|
|
</tr>
|
|
</tbody>
|
|
</template>
|
|
</v-simple-table>
|
|
</div>
|
|
</v-list>
|
|
</v-card>
|
|
</jh-layout-v3>
|
|
|
|
{% endblock %}
|
|
|
|
{% block vue_body %}
|
|
|
|
<script type="module">
|
|
new Vue({
|
|
el: '#app',
|
|
template: '#app-template',
|
|
vuetify: new Vuetify(),
|
|
data: () => ({
|
|
isMobile: window.innerWidth < 600,
|
|
step: 1,
|
|
// 表格相关数据
|
|
isFormValid: true,
|
|
requireRules: [
|
|
v => !!v || 'This is required',
|
|
],
|
|
constantCollection: {
|
|
categoryList: [],
|
|
|
|
},
|
|
|
|
serverSearchInput: {
|
|
processName: null
|
|
},
|
|
isEditDrawerShow: false,
|
|
searchInput: null,
|
|
isTableLoading: true,
|
|
headers: [
|
|
{text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed'},
|
|
|
|
{text: "任务ID", value: "taskId", width: 120},
|
|
{text: "流程节点版本ID", value: "processVersionId", width: 120},
|
|
{text: "任务名称", value: "taskTitle", width: 120},
|
|
{text: "任务状态:running 执行中;deny 拒绝;end 结束", value: "taskStatus", width: 120},
|
|
{text: "当前执行中节点", value: "taskCurrentNode", width: 120},
|
|
{text: "申请人", value: "taskApplier", width: 120},
|
|
{text: "当前执行的处理人员,用逗号分隔", value: "taskProcessorList", width: 120},
|
|
{text: "所有相关人员,用逗号分隔", value: "taskRelatedPersonList", width: 120},
|
|
{text: "催单次数", value: "taskUrgeCount", width: 120},
|
|
{text: "最后催单时间", value: "taskUrgeLastTime", width: 120},
|
|
{text: "操作者", value: "operationByUser", width: 120},
|
|
{text: "操作时间", value: "operationAt", width: 250},
|
|
{text: '操作', value: 'action', align: 'center', sortable: false, width: 200, class: 'fixed', cellClass: 'fixed'},
|
|
],
|
|
|
|
currentClickButton: {title: '新增', action: 'add'},
|
|
editItem: {},
|
|
tableButtonList: [
|
|
{text: '修改', buttonType: 'edit', color: 'success', action: 'startUpdateItem'},
|
|
{text: '删除', buttonType: 'delete', color: 'error', action: 'deleteItem'},
|
|
],
|
|
dialogSaveInfoAction: '',
|
|
taskId: '',
|
|
isAccess: [],
|
|
nextLineList: [],
|
|
taskHistoryList: [],
|
|
taskTpl: [],
|
|
taskStepperList: [],
|
|
currentNode: {}
|
|
}),
|
|
watch: {},
|
|
async created() {
|
|
const searchParams = new URLSearchParams(location.search.substring(1));
|
|
this.taskId = searchParams.get('taskId');
|
|
await this.getTaskHistoryList()
|
|
},
|
|
mounted() {
|
|
},
|
|
methods: {
|
|
async doUiAction(uiActionId, uiActionData) {
|
|
switch (uiActionId) {
|
|
case 'submitNode':
|
|
await this.submitNode(uiActionData);
|
|
await this.getTaskHistoryList(uiActionData);
|
|
break;
|
|
default:
|
|
console.error("[doUiAction] uiActionId not find", { uiActionId });
|
|
break;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 获取表格数据
|
|
*/
|
|
async getTaskHistoryList() {
|
|
const {
|
|
taskHistoryList,
|
|
taskStepperList,
|
|
taskTpl,
|
|
isAccess,
|
|
nextLineList,
|
|
step,
|
|
currentNode
|
|
} = (await window.jianghuAxios({
|
|
data: {
|
|
appData: {
|
|
pageId: 'taskHistoryManagement',
|
|
actionId: 'getTaskHistoryInfo',
|
|
actionData: {taskId: this.taskId},
|
|
}
|
|
}
|
|
})).data.appData.resultData;
|
|
this.taskHistoryList = taskHistoryList;
|
|
this.taskTpl = taskTpl;
|
|
this.taskStepperList = taskStepperList;
|
|
this.currentNode = currentNode;
|
|
this.isAccess = isAccess;
|
|
this.nextLineList = nextLineList;
|
|
this.step = step;
|
|
},
|
|
|
|
/**
|
|
* 新增数据
|
|
*/
|
|
async submitNode(type) {
|
|
await window.vtoast.loading("提交数据");
|
|
await window.jianghuAxios({
|
|
data: {
|
|
appData: {
|
|
pageId: 'taskHistoryManagement',
|
|
actionId: 'submitNode',
|
|
actionData: {type, taskId: this.taskId, taskComment: this.editItem.taskComment, taskTpl: this.taskTpl}
|
|
}
|
|
}
|
|
})
|
|
await window.vtoast.success("提交数据成功");
|
|
},
|
|
|
|
formTitlePrefix(title, type) {
|
|
if (type === 'prev') {
|
|
return '历史-' + title;
|
|
}
|
|
return title;
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
</style>
|
|
{% endblock %}
|