86ee53bc by 蔡俊立

抢办

1 parent bb1c7f53
...@@ -161,4 +161,20 @@ export function selectOtherH (data) { ...@@ -161,4 +161,20 @@ export function selectOtherH (data) {
161 method: 'post', 161 method: 'post',
162 data 162 data
163 }) 163 })
164 }
165
166 // 认领任务
167 export function claimTask (bsmSlsq,bestepid) {
168 return request({
169 url: SERVER.SERVERAPI + '/rest/business/workFlow/claimTask?bsmSlsq=' + bsmSlsq + '&bestepid=' + bestepid,
170 method: 'get',
171 })
172 }
173
174 // 取消认领任务
175 export function unClaimTask (bsmSlsq,bestepid) {
176 return request({
177 url: SERVER.SERVERAPI + '/rest/business/workFlow/unClaimTask?bsmSlsq=' + bsmSlsq + '&bestepid=' + bestepid,
178 method: 'get',
179 })
164 } 180 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -81,7 +81,7 @@ import { ...@@ -81,7 +81,7 @@ import {
81 getStepFormInfo, 81 getStepFormInfo,
82 } from "@/api/fqsq.js"; 82 } from "@/api/fqsq.js";
83 import { mapGetters } from "vuex" 83 import { mapGetters } from "vuex"
84 import { deleteFlow } from "@/api/ywbl.js"; 84 import { deleteFlow,unClaimTask} from "@/api/ywbl.js";
85 import ProcessViewer from './components/processViewer.vue' 85 import ProcessViewer from './components/processViewer.vue'
86 import { getWorkFlowImage } from "@/api/jsydsyqFlow.js"; 86 import { getWorkFlowImage } from "@/api/jsydsyqFlow.js";
87 import { getForm } from "./flowform.js"; 87 import { getForm } from "./flowform.js";
...@@ -132,16 +132,36 @@ export default { ...@@ -132,16 +132,36 @@ export default {
132 clxxIndex: "", 132 clxxIndex: "",
133 //材料信息选项卡对象 133 //材料信息选项卡对象
134 clxxTab: {}, 134 clxxTab: {},
135 //页面监听时间
136 _beforeUnload_time: "",
135 }; 137 };
136 }, 138 },
137 mounted () { 139 mounted () {
138 this.loadBdcdylist(); 140 this.loadBdcdylist();
139 this.flowInitParam(); 141 this.flowInitParam();
142 //添加页面监听事件
143 window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
144 window.addEventListener('unload', e => this.unloadHandler(e))
145 },
146 destroyed() {
147 window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
148 window.removeEventListener('unload', e => this.unloadHandler(e))
140 }, 149 },
141 computed: { 150 computed: {
142 ...mapGetters(["oldDetail", "newDetail"]) 151 ...mapGetters(["oldDetail", "newDetail"])
143 }, 152 },
144 methods: { 153 methods: {
154 beforeunloadHandler() {
155 this._beforeUnload_time = new Date().getTime()
156 },
157 unloadHandler(e) {
158 this._gap_time = new Date().getTime() - this._beforeUnload_time
159 //判断是窗口关闭还是刷新
160 if (this._gap_time <= 5) {
161 //取消认领
162 unClaimTask(this.bsmSlsq,this.bestepid)
163 }
164 },
145 changeLoadIndex () { 165 changeLoadIndex () {
146 this.loadIndex++ 166 this.loadIndex++
147 }, 167 },
...@@ -367,6 +387,8 @@ export default { ...@@ -367,6 +387,8 @@ export default {
367 break; 387 break;
368 case "signout": 388 case "signout":
369 window.close(); 389 window.close();
390 //取消认领
391 unClaimTask(this.bsmSlsq,this.bestepid)
370 break; 392 break;
371 case "B9": 393 case "B9":
372 var formdata = new FormData(); 394 var formdata = new FormData();
......
...@@ -70,7 +70,7 @@ import searchBox from '../components/search.vue' ...@@ -70,7 +70,7 @@ import searchBox from '../components/search.vue'
70 import table from "@/utils/mixin/table" 70 import table from "@/utils/mixin/table"
71 import searchMin from "../components/mixin/index" 71 import searchMin from "../components/mixin/index"
72 import { datas, sendThis } from "./dbxdata" 72 import { datas, sendThis } from "./dbxdata"
73 import { searchTaskToDo, deleteFlow } from "@/api/ywbl.js" 73 import { searchTaskToDo, deleteFlow ,claimTask} from "@/api/ywbl.js"
74 export default { 74 export default {
75 name: "dbx", 75 name: "dbx",
76 components: { searchBox }, 76 components: { searchBox },
...@@ -174,6 +174,9 @@ export default { ...@@ -174,6 +174,9 @@ export default {
174 ywhClick (item) { 174 ywhClick (item) {
175 const { href } = this.$router.resolve('/workFrame?bsmSlsq=' + item.bsmSlsq + '&bestepid=' + item.bestepid + '&bsmBusiness=' + '&sqywbm=' + item.djywbm); 175 const { href } = this.$router.resolve('/workFrame?bsmSlsq=' + item.bsmSlsq + '&bestepid=' + item.bestepid + '&bsmBusiness=' + '&sqywbm=' + item.djywbm);
176 window.open(href, '_blank'); 176 window.open(href, '_blank');
177
178 //从待办箱进入的调取任务领取接口
179 claimTask(item.bsmSlsq,item.bestepid)
177 } 180 }
178 } 181 }
179 } 182 }
......