|
|
|
|
@ -0,0 +1,375 @@
|
|
|
|
|
<!-- 待办流程 -->
|
|
|
|
|
<template>
|
|
|
|
|
<el-card class="box-card" shadow="hover" id="tohandle-card">
|
|
|
|
|
<div slot="header" class="clearfix">
|
|
|
|
|
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="notice"></SvgIcon>
|
|
|
|
|
<span style="padding-left: 15px"
|
|
|
|
|
>待办流程</span
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-more" style="margin-left: auto; font-size: 20px"></i>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="position: relative;height: 100%;width: 100%;">
|
|
|
|
|
<div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
|
|
|
|
|
<Table
|
|
|
|
|
:show-header="false"
|
|
|
|
|
:height="tableHeight"
|
|
|
|
|
:loading="loading"
|
|
|
|
|
size="small"
|
|
|
|
|
:data="/^\/system/.test(this.$route.path) ? example : list"
|
|
|
|
|
:columns="table"
|
|
|
|
|
></Table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import SvgIcon from "@/components/SvgIcon/index.vue";
|
|
|
|
|
import { httpCurl } from "@/api/out";
|
|
|
|
|
import { getNotice2, readNotice } from "@/api/dashboard/notice";
|
|
|
|
|
import ElementResize from "element-resize-detector";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
SvgIcon
|
|
|
|
|
},
|
|
|
|
|
name: "card9",
|
|
|
|
|
layout: {
|
|
|
|
|
x: 4,
|
|
|
|
|
y: 0,
|
|
|
|
|
w: 6,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: "10",
|
|
|
|
|
name: "待办流程",
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
timer: null,
|
|
|
|
|
window: {
|
|
|
|
|
width: 0,
|
|
|
|
|
height: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
},
|
|
|
|
|
example: [
|
|
|
|
|
{
|
|
|
|
|
type: 1,
|
|
|
|
|
content: "示例1",
|
|
|
|
|
created_at: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
read_count: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 2,
|
|
|
|
|
content: "示例2",
|
|
|
|
|
created_at: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
read_count: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
select: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
},
|
|
|
|
|
tableHeight: 120,
|
|
|
|
|
loading: false,
|
|
|
|
|
list: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
table: [
|
|
|
|
|
{
|
|
|
|
|
title: "工作名称",
|
|
|
|
|
align: "left",
|
|
|
|
|
minWidth: 160,
|
|
|
|
|
render: (h, { row }) => {
|
|
|
|
|
return h('div',{
|
|
|
|
|
style: {
|
|
|
|
|
cursor: 'pointer'
|
|
|
|
|
}
|
|
|
|
|
},[
|
|
|
|
|
h('span',{
|
|
|
|
|
style: {
|
|
|
|
|
color: '#ccc'
|
|
|
|
|
}
|
|
|
|
|
},`[${row.id}] `),
|
|
|
|
|
h('span',`[${row.title}]`),
|
|
|
|
|
h('br'),
|
|
|
|
|
h('span',{
|
|
|
|
|
style: {
|
|
|
|
|
color: '#000'
|
|
|
|
|
}
|
|
|
|
|
},'发起人:'),
|
|
|
|
|
h('span', row.creator?.name),
|
|
|
|
|
h('br'),
|
|
|
|
|
h('span',{
|
|
|
|
|
style: {
|
|
|
|
|
color: '#000'
|
|
|
|
|
}
|
|
|
|
|
},'承办人:'),
|
|
|
|
|
h('span', row.last_log?.user?.name),
|
|
|
|
|
h('br'),
|
|
|
|
|
h('span',{
|
|
|
|
|
style: {
|
|
|
|
|
color: '#000'
|
|
|
|
|
}
|
|
|
|
|
},'当前节点:'),
|
|
|
|
|
h('span', row.current_node?.name),
|
|
|
|
|
h('br'),
|
|
|
|
|
h('span', row.created_at)
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "详情",
|
|
|
|
|
align: "left",
|
|
|
|
|
minWidth: 200,
|
|
|
|
|
render: (h, { row }) => {
|
|
|
|
|
function fieldBuilder(field, data) {
|
|
|
|
|
if(!field) return ""
|
|
|
|
|
switch (field.type) {
|
|
|
|
|
case "text":
|
|
|
|
|
case "textarea":
|
|
|
|
|
case "date":
|
|
|
|
|
case "datetime":
|
|
|
|
|
case "radio":
|
|
|
|
|
return h('div',{
|
|
|
|
|
style: {
|
|
|
|
|
'max-height': '140px',
|
|
|
|
|
'overflow-y': 'scroll'
|
|
|
|
|
}
|
|
|
|
|
},[
|
|
|
|
|
h('span',{
|
|
|
|
|
style: {
|
|
|
|
|
'font-weight': '600',
|
|
|
|
|
color: '#000'
|
|
|
|
|
}
|
|
|
|
|
},field.label + ':'),
|
|
|
|
|
h('span', data)
|
|
|
|
|
])
|
|
|
|
|
default:
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let fields = row.custom_model.fields
|
|
|
|
|
let data = Object.entries(row.data).filter(function (i) {
|
|
|
|
|
return i[1] !== undefined && i[1] !== null && i[1] !== "" && i[1] !== "null" && i[1] !== "undefined"
|
|
|
|
|
})
|
|
|
|
|
return h('div', {
|
|
|
|
|
},data.map(i => fieldBuilder(fields.find((j) => {
|
|
|
|
|
return j.name === i[0]
|
|
|
|
|
}),i[1])))
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "操作",
|
|
|
|
|
key: "show",
|
|
|
|
|
width: 180,
|
|
|
|
|
render: (h, { row }) => {
|
|
|
|
|
return h('div',[
|
|
|
|
|
h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: {
|
|
|
|
|
type: "default",
|
|
|
|
|
size: "small",
|
|
|
|
|
},
|
|
|
|
|
style: {
|
|
|
|
|
background: "#f0f3fa",
|
|
|
|
|
color: "#333",
|
|
|
|
|
border: "1px solid #dae1f0",
|
|
|
|
|
fontSize: "13px"
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
["click"]: (_) => {
|
|
|
|
|
window.open(
|
|
|
|
|
`${process.env.VUE_APP_OUT_OLD}/flow/view/${row.id}?auth_token=${this.$store.getters.oa_token}`,
|
|
|
|
|
"",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"查看"
|
|
|
|
|
),
|
|
|
|
|
h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: {
|
|
|
|
|
type: "primary",
|
|
|
|
|
size: "small",
|
|
|
|
|
},
|
|
|
|
|
style: {
|
|
|
|
|
"margin-left": "6px",
|
|
|
|
|
fontSize: "13px"
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
["click"]: async (_) => {
|
|
|
|
|
try {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
await httpCurl({
|
|
|
|
|
...row.data,
|
|
|
|
|
current_node_id: row.current_node_id,
|
|
|
|
|
auth_token: this.$store.getters.oa_token,
|
|
|
|
|
id: row.id
|
|
|
|
|
}, true,"","POST",`${process.env.VUE_APP_OUT_URL}/flow/deal/${row.id}`);
|
|
|
|
|
const res1 = await httpCurl({
|
|
|
|
|
auth_token: this.$store.getters.oa_token,
|
|
|
|
|
id: row.id,
|
|
|
|
|
ajax: 1
|
|
|
|
|
}, true,"","GET",`${process.env.VUE_APP_OUT_URL}/flow/assign/${row.id}`);
|
|
|
|
|
delete res1['json']
|
|
|
|
|
if (!res1.status) {
|
|
|
|
|
this.$message.warning(res1.msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (res1.data.currentNode?.nextNodes?.length === 1) {
|
|
|
|
|
const res2 = await httpCurl({
|
|
|
|
|
auth_token: this.$store.getters.oa_token,
|
|
|
|
|
flow_id: row.id,
|
|
|
|
|
next_node_id: res1.data.currentNode?.nextNodes[0]?.id
|
|
|
|
|
}, true,"","GET",`${process.env.VUE_APP_OUT_URL}/flow/get-next-node-users`);
|
|
|
|
|
delete res2['json']
|
|
|
|
|
if (Object.keys(res2).length === 1) {
|
|
|
|
|
if (Object.values(res2)[0].length === 1) {
|
|
|
|
|
const res3 = await httpCurl({
|
|
|
|
|
auth_token: this.$store.getters.oa_token,
|
|
|
|
|
'next_node_id[0]': res1.data.currentNode.nextNodes[0].id,
|
|
|
|
|
[res1.data.currentNode.nextNodes[0].is_jointly_sign ? 'user_id[]' : 'user_id']: Object.values(res2)[0][0].id
|
|
|
|
|
}, true,"","POST",`${process.env.VUE_APP_OUT_URL}/flow/assign/${row.id}`);
|
|
|
|
|
if (!res1.status) {
|
|
|
|
|
this.$message.warning(res1.msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.$message.success("办理成功!")
|
|
|
|
|
await this.getNotices()
|
|
|
|
|
} else {
|
|
|
|
|
window.open(
|
|
|
|
|
`${process.env.VUE_APP_OUT_OLD}/flow/assign/${row.id}?auth_token=${this.$store.getters.oa_token}`,
|
|
|
|
|
"",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
window.open(
|
|
|
|
|
`${process.env.VUE_APP_OUT_OLD}/flow/assign/${row.id}?auth_token=${this.$store.getters.oa_token}`,
|
|
|
|
|
"",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
window.open(
|
|
|
|
|
`${process.env.VUE_APP_OUT_OLD}/flow/assign/${row.id}?auth_token=${this.$store.getters.oa_token}`,
|
|
|
|
|
"",
|
|
|
|
|
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
this.loading = false;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"办理"
|
|
|
|
|
),
|
|
|
|
|
h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: {
|
|
|
|
|
type: "error",
|
|
|
|
|
size: "small",
|
|
|
|
|
},
|
|
|
|
|
style: {
|
|
|
|
|
display: row.get_can_rollback ? '' : 'none',
|
|
|
|
|
"margin-left": "6px",
|
|
|
|
|
fontSize: "13px"
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
["click"]: async (_) => {
|
|
|
|
|
try {
|
|
|
|
|
await this.$confirm('确认要退回?','提示')
|
|
|
|
|
await httpCurl({
|
|
|
|
|
auth_token: this.$store.getters.oa_token,
|
|
|
|
|
id: row.id
|
|
|
|
|
}, true,"","GET",`${process.env.VUE_APP_OUT_URL}/flow/rollback`);
|
|
|
|
|
await this.getNotices()
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"退回"
|
|
|
|
|
)
|
|
|
|
|
]);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getNotices() {
|
|
|
|
|
if (/^\/system/.test(this.$route.path)) return;
|
|
|
|
|
try {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const res = await httpCurl({
|
|
|
|
|
page_size: 999,
|
|
|
|
|
auth_token: this.$store.getters.oa_token,
|
|
|
|
|
ajax: 1
|
|
|
|
|
}, true,"","GET",`${process.env.VUE_APP_OUT_URL}/flow/list/todo`);
|
|
|
|
|
if (res.status) {
|
|
|
|
|
this.list = res.msg.data.data;
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(res.data)
|
|
|
|
|
}
|
|
|
|
|
this.loading = false;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
init() {
|
|
|
|
|
let cardDom = document.getElementById("tohandle-card");
|
|
|
|
|
let cardTitleH = 58;
|
|
|
|
|
const elementResize = ElementResize({
|
|
|
|
|
strategy: "scroll",
|
|
|
|
|
});
|
|
|
|
|
elementResize.listenTo(cardDom, (ele) => {
|
|
|
|
|
this.tableHeight =
|
|
|
|
|
cardDom.getBoundingClientRect().height -
|
|
|
|
|
40 -
|
|
|
|
|
cardTitleH
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.window.width = screen.availWidth * 0.95;
|
|
|
|
|
this.window.height = screen.availHeight * 0.95;
|
|
|
|
|
this.window.top = (window.screen.height - 30 - this.window.height) / 2;
|
|
|
|
|
this.window.left = (window.screen.width - 10 - this.window.width) / 2;
|
|
|
|
|
this.getNotices();
|
|
|
|
|
this.timer = setInterval(this.getNotices, 30 * 1000)
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.init();
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
clearInterval(this.timer)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
::v-deep .el-card__body {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: calc(100% - 58px);
|
|
|
|
|
}
|
|
|
|
|
::v-deep .ivu-table th,::v-deep .ivu-table td {
|
|
|
|
|
border-bottom-style: dashed;
|
|
|
|
|
}
|
|
|
|
|
.clearfix {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|