mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
feat:工作流 - 前端100%
This commit is contained in:
parent
09f48c32c7
commit
d0951041eb
@ -47,28 +47,6 @@ class WorkflowController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/workflow/user/department 02. 获取当前用户部门
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
* @apiGroup workflow
|
||||
* @apiName user__department
|
||||
*
|
||||
* @apiQuery {Number} id 流程ID
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
* @apiSuccess {Object} data 返回数据
|
||||
*/
|
||||
public function user__department()
|
||||
{
|
||||
// User::auth();
|
||||
// $data['id'] = intval(Request::input('id'));
|
||||
// $workflow = $this->getProcessById($data['id']);
|
||||
// return Base::retSuccess('success', $workflow);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} api/workflow/procdef/all 02. 查询流程定义
|
||||
*
|
||||
@ -181,7 +159,7 @@ class WorkflowController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
return Base::retSuccess('success', $process);
|
||||
return Base::retSuccess('创建成功', $process);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,7 +235,7 @@ class WorkflowController extends AbstractController
|
||||
$this->workflowMsg('workflow_notifier', $dialog, $botUser, $process, $process);
|
||||
}
|
||||
}
|
||||
return Base::retSuccess('success', $task);
|
||||
return Base::retSuccess( $pass == 'pass' ? '已通过' : '已拒绝', $task);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -302,7 +280,7 @@ class WorkflowController extends AbstractController
|
||||
//发送撤回提醒
|
||||
$this->workflowMsg('workflow_reviewer', $dialog, $botUser, $val, $process, 'withdraw');
|
||||
}
|
||||
return Base::retSuccess('success', Base::arrayKeyToUnderline($task['data']));
|
||||
return Base::retSuccess('已撤回', Base::arrayKeyToUnderline($task['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -77,6 +77,9 @@ export default {
|
||||
{icon: '', name: 'addTask', label: '添加任务'},
|
||||
{icon: '', name: 'createMeeting', label: '新会议'},
|
||||
{icon: '', name: 'joinMeeting', label: '加入会议'},
|
||||
],
|
||||
[
|
||||
{icon: '', name: 'review', label: '审批中心'},
|
||||
]
|
||||
],
|
||||
|
||||
|
||||
@ -251,8 +251,12 @@ export default {
|
||||
comment: desc,
|
||||
}
|
||||
}).then(({msg}) => {
|
||||
this.getInfo()
|
||||
this.$emit('approve')
|
||||
$A.messageSuccess(msg);
|
||||
if(this.$route.name=='manage-review-details'){
|
||||
this.getInfo()
|
||||
}else{
|
||||
this.$emit('approve')
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
});
|
||||
@ -274,9 +278,13 @@ export default {
|
||||
proc_inst_id: this.datas.id,
|
||||
}
|
||||
}).then(({msg}) => {
|
||||
$A.messageSuccess(msg);
|
||||
resolve();
|
||||
this.getInfo()
|
||||
this.$emit('revocation')
|
||||
if(this.$route.name=='manage-review-details'){
|
||||
this.getInfo()
|
||||
}else{
|
||||
this.$emit('revocation')
|
||||
}
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg);
|
||||
resolve();
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
</DrawerOverlay>
|
||||
|
||||
<!--发起-->
|
||||
<Modal v-model="addShow" :title="$L(addTitle)" :mask-closable="false">
|
||||
<Modal v-model="addShow" :title="$L(addTitle)" :mask-closable="false" class="page-review-initiate">
|
||||
<Form ref="initiateRef" :model="addData" :rules="addRule" label-width="auto" @submit.native.prevent>
|
||||
<FormItem v-if="departmentList.length>1" prop="department_id" :label="$L('选择部门')">
|
||||
<Select v-model="addData.department_id" :placeholder="$L('请选择部门')">
|
||||
@ -127,20 +127,40 @@
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem prop="startTime" :label="$L('开始时间')">
|
||||
<DatePicker type="datetime" format="yyyy-MM-dd HH:mm"
|
||||
v-model="addData.startTime"
|
||||
:value="addData.startTime"
|
||||
@on-change="(e)=>{ addData.startTime = e }"
|
||||
:placeholder="$L('请选择开始时间')" style="width: 100%"
|
||||
></DatePicker>
|
||||
<div style="display: flex;gap: 3px;">
|
||||
<DatePicker type="date" format="yyyy-MM-dd"
|
||||
v-model="addData.startTime"
|
||||
:editable="false"
|
||||
@on-change="(e)=>{ addData.startTime = e }"
|
||||
:placeholder="$L('请选择开始时间')"
|
||||
style="flex: 1;min-width: 122px;"
|
||||
></DatePicker>
|
||||
<Select v-model="addData.startTimeHour" style="max-width: 100px;">
|
||||
<Option v-for="(item,index) in 24" :value="item-1 < 10 ? '0'+(item-1) : item-1 " :key="index">{{item-1 < 10 ? '0' : ''}}{{item-1}}</Option>
|
||||
</Select>
|
||||
<Select v-model="addData.startTimeMinute" style="max-width: 100px;">
|
||||
<Option value="00">00</Option>
|
||||
<Option value="30">30</Option>
|
||||
</Select>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem prop="endTime" :label="$L('结束时间')">
|
||||
<DatePicker type="datetime" format="yyyy-MM-dd HH:mm"
|
||||
v-model="addData.endTime"
|
||||
@on-change="(e)=>{ addData.endTime = e }"
|
||||
:placeholder="$L('请选择结束时间')"
|
||||
style="width: 100%"
|
||||
></DatePicker>
|
||||
<div style="display: flex;gap: 3px;">
|
||||
<DatePicker type="date" format="yyyy-MM-dd"
|
||||
v-model="addData.endTime"
|
||||
:editable="false"
|
||||
@on-change="(e)=>{ addData.endTime = e }"
|
||||
:placeholder="$L('请选择结束时间')"
|
||||
style="flex: 1;min-width: 122px;"
|
||||
></DatePicker>
|
||||
<Select v-model="addData.endTimeHour" style="max-width: 100px;">
|
||||
<Option v-for="(item,index) in 24" :value="item-1 < 10 ? '0'+(item-1) : ((item-1)+'') " :key="index">{{item-1 < 10 ? '0' : ''}}{{item-1}}</Option>
|
||||
</Select>
|
||||
<Select v-model="addData.endTimeMinute" style="max-width: 100px;">
|
||||
<Option value="00">00</Option>
|
||||
<Option value="30">30</Option>
|
||||
</Select>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem prop="description" :label="$L('事由')">
|
||||
<Input type="textarea" v-model="addData.description"></Input>
|
||||
@ -160,18 +180,22 @@ import list from "./list.vue";
|
||||
import listDetails from "./details.vue";
|
||||
import DrawerOverlay from "../../../components/DrawerOverlay";
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components:{list,listDetails,DrawerOverlay},
|
||||
name: "review",
|
||||
data(){
|
||||
return{
|
||||
minDate: new Date(2020, 0, 1),
|
||||
maxDate: new Date(2025, 10, 1),
|
||||
currentDate: new Date(2021, 0, 17),
|
||||
|
||||
procdefList: [],
|
||||
page: 1,
|
||||
pageSize: 250,
|
||||
total: 0,
|
||||
noText: '',
|
||||
loadIng:false,
|
||||
|
||||
|
||||
tabsValue:"",
|
||||
//
|
||||
@ -201,20 +225,30 @@ export default {
|
||||
//
|
||||
addTitle:'',
|
||||
addShow:false,
|
||||
startTimeOpen:false,
|
||||
endTimeOpen:false,
|
||||
addData: {
|
||||
department_id:0,
|
||||
type: '',
|
||||
startTime:"",
|
||||
endTime:"",
|
||||
startTime:"2023-04-20",
|
||||
startTimeHour:"09",
|
||||
startTimeMinute:"00",
|
||||
endTime: "2023-04-20",
|
||||
endTimeHour:"18",
|
||||
endTimeMinute:"00",
|
||||
|
||||
},
|
||||
addRule: {
|
||||
department_id:{ type: 'number',required: true, message: this.$L('请选择部门!'), trigger: 'change' },
|
||||
type: { type: 'string',required: true, message: this.$L('请选择假期类型!'), trigger: 'change' },
|
||||
startTime: { type: 'string',required: true, message: this.$L('请选择开始时间!'), trigger: 'change' },
|
||||
endTime:{ type: 'string',required: true, message: this.$L('请选择结束时间!'), trigger: 'change' },
|
||||
description:{ type: 'string',required: true, message: this.$L('请选择结束时间!'), trigger: 'change' },
|
||||
description:{ type: 'string',required: true, message: this.$L('请输入事由!'), trigger: 'change' },
|
||||
},
|
||||
selectTypes:["年假","事假","病假","调休","产假","陪产假","婚假","丧假","哺乳假"],
|
||||
|
||||
//
|
||||
showDateTime:false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -252,28 +286,44 @@ export default {
|
||||
this.addData.department_id = this.userInfo.department[0] || 0;
|
||||
},
|
||||
methods:{
|
||||
formatter(type, val) {
|
||||
if (type === 'year') {
|
||||
return `${val}月`;
|
||||
}else if (type === 'month') {
|
||||
return `${val}月`;
|
||||
} else if (type === 'day') {
|
||||
return `${val}日`;
|
||||
} else if (type === 'hour') {
|
||||
return `${val}时`;
|
||||
}else if (type === 'minute') {
|
||||
return `${val}分`;
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
// tab切换事件
|
||||
tabsClick(val){
|
||||
this.__tabsClick && clearTimeout(this.__tabsClick)
|
||||
this.__tabsClick = setTimeout(() => {
|
||||
this.tabsValue = val || this.tabsValue
|
||||
if(val!=""){
|
||||
this.approvalType = this.searchState = "all"
|
||||
}
|
||||
if(this.tabsValue == 'backlog'){
|
||||
this.getBacklogList();
|
||||
}
|
||||
if(this.tabsValue == 'done'){
|
||||
this.getDoneList();
|
||||
}
|
||||
if(this.tabsValue == 'notify'){
|
||||
this.getNotifyList();
|
||||
}
|
||||
if(this.tabsValue == 'initiated'){
|
||||
this.getInitiatedList();
|
||||
}
|
||||
}, 200)
|
||||
if(!val && this.__tabsClick){
|
||||
return;
|
||||
}
|
||||
this.__tabsClick = setTimeout(() => { this.__tabsClick =null; },1000)
|
||||
|
||||
this.tabsValue = val || this.tabsValue
|
||||
if(val!=""){
|
||||
this.approvalType = this.searchState = "all"
|
||||
}
|
||||
if(this.tabsValue == 'backlog'){
|
||||
this.getBacklogList();
|
||||
}
|
||||
if(this.tabsValue == 'done'){
|
||||
this.getDoneList();
|
||||
}
|
||||
if(this.tabsValue == 'notify'){
|
||||
this.getNotifyList();
|
||||
}
|
||||
if(this.tabsValue == 'initiated'){
|
||||
this.getInitiatedList();
|
||||
}
|
||||
},
|
||||
|
||||
// 列表点击事件
|
||||
@ -434,12 +484,17 @@ export default {
|
||||
this.$refs.initiateRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loadIng++;
|
||||
var obj = JSON.parse(JSON.stringify(this.addData))
|
||||
// if((addTitle || '').indexOf('班') == -1){
|
||||
obj.startTime = obj.startTime +" "+ obj.startTimeHour + ":" + obj.startTimeMinute;
|
||||
obj.endTime = obj.endTime +" "+ obj.endTimeHour + ":" + obj.endTimeMinute;
|
||||
// }
|
||||
this.$store.dispatch("call", {
|
||||
url: 'workflow/process/start',
|
||||
data: {
|
||||
proc_name:this.addTitle,
|
||||
department_id:this.addData.department_id,
|
||||
var: JSON.stringify(this.addData)
|
||||
department_id: obj.department_id,
|
||||
var: JSON.stringify(obj)
|
||||
},
|
||||
method: 'post',
|
||||
}).then(({data, msg}) => {
|
||||
@ -465,7 +520,6 @@ export default {
|
||||
.page-review .review-details{
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.page-review .ivu-tabs-nav {
|
||||
display: flex;
|
||||
width: 350px;
|
||||
@ -478,4 +532,7 @@ export default {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.page-review-initiate .ivu-modal-body{
|
||||
padding: 16px 22px 2px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</Col> -->
|
||||
<Col v-for="(item, key) in list" :xxl="{ span: 6 }" :xl="{ span: 8 }" :lg="{ span: 12 }" :sm="{ span: 24 }" :xs="{ span: 24 }" >
|
||||
<div class="approve-col-box approve-col-for" @click="edit(item)">
|
||||
<p>{{$L('流程名称:')}}<span style="font-weight: 500;">{{$L(item.name)}}</span></p>
|
||||
<p>{{$L('流程名称:')}}<span style="font-weight: 500;color: #135de6;">{{$L(item.name)}}</span></p>
|
||||
<Divider style="margin: 12px 0;"/>
|
||||
<div class="approve-button-box" @click.stop="edit(item)">
|
||||
<p>{{$L('是否发布')}}: </p>
|
||||
|
||||
4
resources/assets/sass/pages/page-review.scss
vendored
4
resources/assets/sass/pages/page-review.scss
vendored
@ -213,12 +213,14 @@
|
||||
}
|
||||
.review-operation{
|
||||
flex: 0 0 auto;
|
||||
height: 55px;
|
||||
padding: 0 24px;
|
||||
border-top: 1px solid #F4F4F5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
button{
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.comment{
|
||||
|
||||
@ -139,7 +139,16 @@
|
||||
<span>开始时间:{{$data->start_time}}</span>
|
||||
<span>结束时间:{{$data->end_time}}</span>
|
||||
</div><div class="btn-raw">
|
||||
<Button type="button" class="ivu-btn ivu-btn-primary ivu-btn-small" style="flex: 1;">查看详情</Button>
|
||||
@if ($action === 'pass')
|
||||
<Button type="button" class="ivu-btn ivu-btn-small" style="flex: 1;">已同意</Button>
|
||||
@elseif ($action === 'refuse')
|
||||
<Button type="button" class="ivu-btn ivu-btn-small" style="flex: 1;">已拒绝</Button>
|
||||
@elseif ($action === 'withdraw')
|
||||
<Button type="button" class="ivu-btn ivu-btn-small" style="flex: 1;">已撤销</Button>
|
||||
@else
|
||||
<Button type="button" class="ivu-btn ivu-btn-primary ivu-btn-small" style="flex: 1;">同意</Button>
|
||||
<Button type="button" class="ivu-btn ivu-btn-error ivu-btn-small" style="flex: 1;">拒绝</Button>
|
||||
@endif
|
||||
</div></span>
|
||||
@elseif ($type === 'workflow_submitter')
|
||||
<span class="open-review-details" data-id="{{$data->id}}"><b> @if ($action === 'pass')您发起的「{{$data->proc_def_name}}」已通过 @else您发起的「{{$data->proc_def_name}}」被{{$data->nickname}}拒绝 @endif</b>
|
||||
@ -151,7 +160,16 @@
|
||||
<span>开始时间:{{$data->start_time}}</span>
|
||||
<span>结束时间:{{$data->end_time}}</span>
|
||||
</div><div class="btn-raw">
|
||||
<Button type="button" class="ivu-btn ivu-btn-primary ivu-btn-small" style="flex: 1;">查看详情</Button>
|
||||
@if ($action === 'pass')
|
||||
<Button type="button" class="ivu-btn ivu-btn-small" style="flex: 1;">已同意</Button>
|
||||
@elseif ($action === 'refuse')
|
||||
<Button type="button" class="ivu-btn ivu-btn-small" style="flex: 1;">已拒绝</Button>
|
||||
@elseif ($action === 'withdraw')
|
||||
<Button type="button" class="ivu-btn ivu-btn-small" style="flex: 1;">已撤销</Button>
|
||||
@else
|
||||
<Button type="button" class="ivu-btn ivu-btn-primary ivu-btn-small" style="flex: 1;">同意</Button>
|
||||
<Button type="button" class="ivu-btn ivu-btn-error ivu-btn-small" style="flex: 1;">拒绝</Button>
|
||||
@endif
|
||||
</div></span>
|
||||
@else
|
||||
你好,我是你的机器人助理,你可以发送 <span style="color:#84c56a">/help</span> 查看帮助菜单。
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user