Browse Source

我的申请添加撤销&重新申请

dufeng 1 year ago
parent
commit
f118c1aa6a

+ 36 - 2
pages/workflowTask/approveCenter/approveList.js

@@ -1,16 +1,50 @@
 import list from '@/mixins/list'
+import {dibootApi} from '@/utils/dibootApi'
 export default {
 	mixins: [list],
 	created() {
 		this.activeIndex = -100
-		this.getList(true)
+        this.getList(true)
 	},
+    
 	methods: {
 		handle2ProcessTask(id, instId, category, definitionId, allowDeal) {
 			uni.navigateTo({
 				url:`/pages/workflowTask/webviewPages/dealTask?id=${id}&definitionId=${definitionId}&instId=${instId}&category=${category}&allowDeal=${allowDeal}`
 			})
-		}
+		},
+        // 撤销
+        handle2Click(processInstanceId, taskOperate) {
+            uni.showModal({
+            title: '',
+            content: `确认撤销?`,
+            showCancel: true,
+            confirmText: '确定',
+            success: async (res) => {
+                if (res.confirm) {
+                    const res = await dibootApi.put('/workflow/task/taskOperate', {
+                        processInstanceId,
+                        taskOperate,
+                        validTask: false
+                    })
+                    if (res.code === 0) {
+                        uni.showToast({
+                            title: '撤销成功',
+                            icon: 'none'
+                        })
+                        this.page.pageIndex = 1
+                        this.getList(true)
+                    }
+                }
+            }
+        })
+        },
+        // 重新发起
+        handle2RestartWorkflow(item){
+            uni.navigateTo({
+                url: `/pages/workflowTask/webviewPages/startFlow?id=${item.procDefId}&processInstanceId=${item.id}&defaultTitle=${item.name}&name=${item.processDefinitionName}&restart=true`
+            })
+        }
 	},
 	watch: {
 	  searchKeyWord: {

+ 15 - 3
pages/workflowTask/approveCenter/launchList.vue

@@ -15,14 +15,23 @@
 					<di-descriptions-item label="开始时间" :value="item.startTime" :ellipsis="true"/>
 					<di-descriptions-item label="结束时间" :value="item.endTime" :ellipsis="true"/>
 					<di-descriptions-item label="流程耗时" :value="item.durationLabel" :ellipsis="true"/>
-				</di-descriptions>
-			</u-swipe-action>
+                    <u-row style="justify-content: flex-end;">
+                        <u-col :span="2" v-if="item.endTime == null">
+                          <u-button type="primary" plain size="mini"  @click="handle2Click(item.id, 'cancel')">撤销</u-button>
+                         </u-col>
+                         <u-col :span="2.5" v-if="['已撤销', '不通过'].indexOf(item.statusLabel) > -1">
+                          <u-button type="primary" plain size="mini"  @click="handle2RestartWorkflow(item)">重新发起</u-button>
+                         </u-col>
+                    </u-row>
+                </di-descriptions>
+            </u-swipe-action>
 		</view>
 		<u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
 	</scroll-view>
 </template>
 
 <script>
+   
 	import approveList from './approveList'
 	export default {
 		mixins: [approveList],
@@ -37,7 +46,10 @@
 				  '不通过': 'error'
 				}
 			}
-		}
+		},
+        methods: {
+         
+        }
 	}
 </script>
 

+ 4 - 2
pages/workflowTask/webviewPages/startFlow.vue

@@ -1,6 +1,6 @@
 <template>
 	<web-view
-		:src="`${webviewServer}/mobile/startFlow?id=${id}&name=${name}&processInstanceId=${processInstanceId}&defaultTitle=${defaultTitle}&authtoken=${authtoken}&longitude=${longitude}&latitude=${latitude}&scanResult=${scanResult}&fromMobile=true`">
+		:src="`${webviewServer}/mobile/startFlow?id=${id}&name=${name}&processInstanceId=${processInstanceId}&defaultTitle=${defaultTitle}&authtoken=${authtoken}&longitude=${longitude}&latitude=${latitude}&scanResult=${scanResult}&fromMobile=true&restart=${restart}`">
 	</web-view>
 </template>
 
@@ -16,7 +16,8 @@
 				name: '',
 				longitude: '',
 				latitude: '',
-				scanResult: ''
+				scanResult: '',
+                restart:false
 			};
 		},
 		onLoad(options) {
@@ -24,6 +25,7 @@
 			this.defaultTitle = options.defaultTitle
 			this.id = options.id
 			this.name = options.name
+            this.restart = options.restart
 			this.getLocation()
 			if (options.scanCode) this.scanCode()
             // console.log('diboot带入的token是',this.authtoken)

+ 1 - 1
pages/workflowTask/webviewPages/webview.js

@@ -1,6 +1,6 @@
 let server_url = window.location.host
 if(process.env.NODE_ENV === 'development'){
-    server_url = '192.168.31.115:9529'//'tq.5000v.com:8025'
+    server_url = 'tq.5000v.com:8025'//'tq.5000v.com:8025'
 }
 export default {
 	data() {