86ee53bc by 蔡俊立

抢办

1 parent bb1c7f53
......@@ -162,3 +162,19 @@ export function selectOtherH (data) {
data
})
}
// 认领任务
export function claimTask (bsmSlsq,bestepid) {
return request({
url: SERVER.SERVERAPI + '/rest/business/workFlow/claimTask?bsmSlsq=' + bsmSlsq + '&bestepid=' + bestepid,
method: 'get',
})
}
// 取消认领任务
export function unClaimTask (bsmSlsq,bestepid) {
return request({
url: SERVER.SERVERAPI + '/rest/business/workFlow/unClaimTask?bsmSlsq=' + bsmSlsq + '&bestepid=' + bestepid,
method: 'get',
})
}
\ No newline at end of file
......
......@@ -81,7 +81,7 @@ import {
getStepFormInfo,
} from "@/api/fqsq.js";
import { mapGetters } from "vuex"
import { deleteFlow } from "@/api/ywbl.js";
import { deleteFlow,unClaimTask} from "@/api/ywbl.js";
import ProcessViewer from './components/processViewer.vue'
import { getWorkFlowImage } from "@/api/jsydsyqFlow.js";
import { getForm } from "./flowform.js";
......@@ -132,16 +132,36 @@ export default {
clxxIndex: "",
//材料信息选项卡对象
clxxTab: {},
//页面监听时间
_beforeUnload_time: "",
};
},
mounted () {
this.loadBdcdylist();
this.flowInitParam();
//添加页面监听事件
window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
window.addEventListener('unload', e => this.unloadHandler(e))
},
destroyed() {
window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
window.removeEventListener('unload', e => this.unloadHandler(e))
},
computed: {
...mapGetters(["oldDetail", "newDetail"])
},
methods: {
beforeunloadHandler() {
this._beforeUnload_time = new Date().getTime()
},
unloadHandler(e) {
this._gap_time = new Date().getTime() - this._beforeUnload_time
//判断是窗口关闭还是刷新
if (this._gap_time <= 5) {
//取消认领
unClaimTask(this.bsmSlsq,this.bestepid)
}
},
changeLoadIndex () {
this.loadIndex++
},
......@@ -367,6 +387,8 @@ export default {
break;
case "signout":
window.close();
//取消认领
unClaimTask(this.bsmSlsq,this.bestepid)
break;
case "B9":
var formdata = new FormData();
......
......@@ -70,7 +70,7 @@ import searchBox from '../components/search.vue'
import table from "@/utils/mixin/table"
import searchMin from "../components/mixin/index"
import { datas, sendThis } from "./dbxdata"
import { searchTaskToDo, deleteFlow } from "@/api/ywbl.js"
import { searchTaskToDo, deleteFlow ,claimTask} from "@/api/ywbl.js"
export default {
name: "dbx",
components: { searchBox },
......@@ -174,6 +174,9 @@ export default {
ywhClick (item) {
const { href } = this.$router.resolve('/workFrame?bsmSlsq=' + item.bsmSlsq + '&bestepid=' + item.bestepid + '&bsmBusiness=' + '&sqywbm=' + item.djywbm);
window.open(href, '_blank');
//从待办箱进入的调取任务领取接口
claimTask(item.bsmSlsq,item.bestepid)
}
}
}
......