Commit cb8d766a authored by 张毅辰's avatar 张毅辰

工作流(审批提交)

parent 1cadaad8
...@@ -7,3 +7,11 @@ export function getDocumentDetails(businessId) { ...@@ -7,3 +7,11 @@ export function getDocumentDetails(businessId) {
method: 'get', method: 'get',
}) })
} }
export function submitFlowWork(params, api) {
return request({
url: `${api}`,
method: 'post',
params
})
}
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<uni-segmented-control :current="current" :values="approvalList" @clickItem="onClickItem" styleType="button" activeColor="#007AFF"></uni-segmented-control> <uni-segmented-control :current="current" :values="approvalList" @clickItem="onClickItem" styleType="button" activeColor="#007AFF"></uni-segmented-control>
<view class="content"> <view class="content">
<view v-show="current === 0" class="approval_content"> <view v-show="current === 0" class="approval_content">
<my-apply></my-apply> <my-apply :list="list"></my-apply>
</view> </view>
<view v-show="current === 1" class="approval_content"> <view v-show="current === 1" class="approval_content">
<my-approval></my-approval> <my-approval :list="list"></my-approval>
</view> </view>
</view> </view>
</view> </view>
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
data() { data() {
return { return {
current:1, // 0: 待办, 1: 已办 current:1, // 0: 待办, 1: 已办
approvalList:['待办','已办'] approvalList:['待办','已办'],
list: []
} }
}, },
created() { created() {
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
methods: { methods: {
getApprovalList() { getApprovalList() {
getApproveList(this.current).then(res => { getApproveList(this.current).then(res => {
this.list = res.rows
}) })
}, },
onClickItem(e) { onClickItem(e) {
......
<template> <template>
<view class="my_approval"> <view class="my_approval">
<uni-swipe-action> <uni-swipe-action>
<ul> <ul>
<li v-for="(item,index) in myApprovalList" :key="index" class="my_approval_li"> <li v-for="(item,index) in list" :key="index" class="my_approval_li">
<uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)"> <uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)">
<view class="my_approval_item" @click="toNav(item.businessId)"> <view class="my_approval_item" @click="toNav(item.instanceId, item.nodeId)">
<h3 class="my_approval_title"><text>[{{item.type}}]--{{item.name}}</text> <text class="approval_title_right">{{item.stateName}}</text></h3> <h3 class="my_approval_title">
<view class="my_approval_info"> <text>[{{item.businessTypeName}}]--{{item.createUserName}}</text>
<text>{{item.department}}</text> <text class="approval_title_right">{{item.status === '10' ? '待审批' :item.status === '2' ? '已审批':item.status === '5' ? '驳回' : ''}}</text>
<text class="approval_info_right">{{item.time}}</text> </h3>
</view>
</view> <view class="my_approval_info">
</uni-swipe-action-item> <text class="approval_info_right">{{item.createDate}}</text>
</li> </view>
</ul> </view>
</uni-swipe-action-item>
</li>
</ul>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
...@@ -21,6 +24,14 @@ ...@@ -21,6 +24,14 @@
<script> <script>
export default{ export default{
props: {
list: {
type: Array,
default: () => {
return []
}
}
},
data() { data() {
return { return {
myApprovalList:[{ myApprovalList:[{
...@@ -50,9 +61,10 @@ ...@@ -50,9 +61,10 @@
} }
}, },
methods:{ methods:{
toNav(id) { /** 详情页跳转*/
toNav(id, nodeId) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/classes/classesInfo?businessId=${id}`, url: `/pages/flow/work?businessId=${id}&nodeId=${nodeId}&type=edit`,
success:(res) =>{ success:(res) =>{
}, },
fail:(err) =>{ fail:(err) =>{
......
<template> <template>
<view class="my_approval"> <view class="my_approval">
<uni-swipe-action> <uni-swipe-action>
<ul> <ul>
<li v-for="(item,index) in myApprovalList" :key="index" class="my_approval_li"> <li v-for="(item,index) in list" :key="index" class="my_approval_li">
<uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)"> <uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)">
<view class="my_approval_item"> <view class="my_approval_item" @click="toNav(item.instanceId, item.nodeId)">
<h3 class="my_approval_title"><text>[{{item.type}}]--{{item.name}}</text> <text class="approval_title_right">{{item.stateName}}</text></h3> <h3 class="my_approval_title">
<view class="my_approval_info"> <text>[{{item.businessTypeName}}]--{{item.createUserName}}</text>
<text>{{item.department}}</text> <text class="approval_title_right">{{item.status === '10' ? '待审批' :item.status === '2' ? '已审批':item.status === '5' ? '驳回' : ''}}</text>
<text class="approval_info_right">{{item.time}}</text> </h3>
</view>
</view> <view class="my_approval_info">
</uni-swipe-action-item> <text class="approval_info_right">{{item.createDate}}</text>
</li> </view>
</ul> </view>
</uni-swipe-action-item>
</li>
</ul>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
...@@ -21,6 +24,14 @@ ...@@ -21,6 +24,14 @@
<script> <script>
export default{ export default{
props: {
list: {
type: Array,
default: () => {
return []
}
}
},
data() { data() {
return { return {
myApprovalList:[{ myApprovalList:[{
...@@ -58,6 +69,17 @@ ...@@ -58,6 +69,17 @@
} }
}, },
methods:{ methods:{
/** 详情页跳转*/
toNav(id, nodeId) {
uni.navigateTo({
url: `/pages/flow/work?businessId=${id}&nodeId=${nodeId}&type=see`,
success:(res) =>{
},
fail:(err) =>{
console.log(err)
}
});
},
bindClick(e,id) { bindClick(e,id) {
if(e.content.text === '驳回'){ if(e.content.text === '驳回'){
console.log('驳回') console.log('驳回')
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<ul> <ul>
<li v-for="(item,index) in myApprovalList" :key="index" class="my_approval_li"> <li v-for="(item,index) in myApprovalList" :key="index" class="my_approval_li">
<uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)"> <uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)">
<view class="my_approval_item" @click="toNav(item.businessId)"> <view class="my_approval_item" @click="toNav(item.businessId, item.nodeId)">
<h3 class="my_approval_title"> <h3 class="my_approval_title">
<text>[{{item.businessTypeName}}]--{{item.createUserName}}</text> <text>[{{item.businessTypeName}}]--{{item.createUserName}}</text>
<text class="approval_title_right">{{item.status === '10' ? '待审批' :item.status === '2' ? '已审批':item.status === '5' ? '驳回' : ''}}</text> <text class="approval_title_right">{{item.status === '10' ? '待审批' :item.status === '2' ? '已审批':item.status === '5' ? '驳回' : ''}}</text>
...@@ -90,9 +90,9 @@ export default{ ...@@ -90,9 +90,9 @@ export default{
}, },
methods:{ methods:{
/** 详情页跳转*/ /** 详情页跳转*/
toNav(id) { toNav(id, nodeId) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/flow/work?businessId=${id}&type=see`, url: `/pages/flow/work?businessId=${id}&nodeId=${nodeId}&type=see`,
success:(res) =>{ success:(res) =>{
}, },
fail:(err) =>{ fail:(err) =>{
......
<template> <template>
<view class="container my-flow-work"> <view class="container my-flow-work">
<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text="返回" :title="basicDataForm.processType" @clickLeft="goBack" /> <uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text="返回" :title="basicDataForm.processType" @clickLeft="goBack" />
<view> <view style="width:100%;position:fixed;top:60px;">
<ul> <ul>
<li class="my_approval_li"> <li class="my_approval_li">
<uni-swipe-action-item> <uni-swipe-action-item>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</li> </li>
</ul> </ul>
</view> </view>
<view> <view style="margin-top: 80px;">
<uni-segmented-control style-type="text" :current="current" :values="items" @clickItem="onClickItem" activeColor="#007aff"></uni-segmented-control> <uni-segmented-control style-type="text" :current="current" :values="items" @clickItem="onClickItem" activeColor="#007aff"></uni-segmented-control>
<view class="content"> <view class="content">
<view v-show="current === 0"> <view v-show="current === 0">
...@@ -36,12 +36,40 @@ ...@@ -36,12 +36,40 @@
</view> </view>
</view> </view>
</view> </view>
<view style="width:100%;position:fixed;bottom:0;padding: 4px" v-if="type !== 'see'">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">审 批</button>
</view>
<!-- 提示窗示例 -->
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog
cancelText="关闭"
confirmText="提交"
title="审批提交"
@close="close"
@confirm="confirm"
>
<view style="width: 100%;">
<uni-forms :modelValue="typeFormData" label-width="80">
<uni-forms-item label="备注" name="remark">
<uni-easyinput type="textarea" v-model="typeFormData.remark" placeholder="请输入备注" />
</uni-forms-item>
<uni-forms-item label="名称" name="type">
<uni-data-select
v-model="typeFormData.type"
:localdata="range"
></uni-data-select>
</uni-forms-item>
</uni-forms>
</view>
</uni-popup-dialog>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
import { getDocumentDetails } from '@/api/system/flowWork' import { getDocumentDetails, submitFlowWork } from '@/api/system/flowWork'
import { getDict } from '@/api/system/dict' import { getDict } from '@/api/system/dict'
import BasicData from './components/BasicData.vue' import BasicData from './components/BasicData.vue'
import BusinessDocument from './components/BusinessDocument.vue' import BusinessDocument from './components/BusinessDocument.vue'
...@@ -81,24 +109,75 @@ export default { ...@@ -81,24 +109,75 @@ export default {
// 审批流程数据 // 审批流程数据
flowChatNodeList: [], flowChatNodeList: [],
// 当前流程节点是否通过 // 当前流程节点是否通过
approveControl: '0', approveControl: '1',
// 当前流程节点 // 当前流程节点
approveControlActive: 1, approveControlActive: 1,
// 单据类型字典 // 单据类型字典
tableUserFrom: [], tableUserFrom: [],
typeFormData: {
type: 'CONSENT',
remark: ''
},
range: [
{ value: 'CONSENT', text: "同意" },
{ value: 'REJECT', text: "驳回" },
],
flowWorkApi: [
{
type: '1001',
api: '/wx/aeclassesinfo/flow'
}
]
} }
}, },
onLoad(option) { onLoad(option) {
const { businessId, type } = option const { businessId, type, nodeId } = option
this.businessId = businessId this.businessId = businessId
this.nodeId = nodeId
this.type = type this.type = type
console.log(type)
this.getFlowData() this.getFlowData()
}, },
created() { created() {
this.getDict() this.getDict()
}, },
methods: { methods: {
close() {
this.typeFormData = {
type: 'CONSENT',
remark: ''
}
this.$refs.alertDialog.close()
},
/**
* 点击确认按钮触发
* @param {Object} done
* @param {Object} value
*/
confirm() {
const params = {
instanceId: this.businessId,
approveId: this.nodeId,
approveControl: this.typeFormData.type,
remark: this.typeFormData.remark,
}
const api = this.flowWorkApi.find(item => item.type === this.basicDataForm.processType).api
uni.showLoading({
title: '数据提交中,请稍后'
})
submitFlowWork(params, api).then(res => {
uni.hideLoading()
// 关闭窗口后,恢复默认内容
this.$refs.alertDialog.close()
uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
delta: 1
})
})
this.$refs.alertDialog.close()
},
handleLogin() {
this.$refs.alertDialog.open()
},
onClickItem(e) { onClickItem(e) {
if (this.current != e.currentIndex) { if (this.current != e.currentIndex) {
this.current = e.currentIndex; this.current = e.currentIndex;
...@@ -118,7 +197,7 @@ export default { ...@@ -118,7 +197,7 @@ export default {
createDate: res.data.createDate, createDate: res.data.createDate,
createUserId: res.data.createUserId, createUserId: res.data.createUserId,
createUserName: res.data.createUserName, createUserName: res.data.createUserName,
approveUser: res.data.flowChatNodeList.find(item => item.currentNode === 1).approveUser approveUser: []
} }
// 业务单据 // 业务单据
this.newBusinessDocument = JSON.parse(res.data.newBusinessData.jsonData) this.newBusinessDocument = JSON.parse(res.data.newBusinessData.jsonData)
...@@ -126,8 +205,10 @@ export default { ...@@ -126,8 +205,10 @@ export default {
// 审核历史 // 审核历史
this.approveHistoryList = res.data.approveHistoryList this.approveHistoryList = res.data.approveHistoryList
// 审批流程 // 审批流程
this.approveControlActive = res.data.flowChatNodeList.length - 1
this.flowChatNodeList = res.data.flowChatNodeList.map((item, index) => { this.flowChatNodeList = res.data.flowChatNodeList.map((item, index) => {
if (item.currentNode === 1) { if (item.currentNode === 1) {
this.basicDataForm.approveUser = item.approveUser
this.approveControl = item.approveControl this.approveControl = item.approveControl
this.approveControlActive = index this.approveControlActive = index
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment