From 349e0becd32e76c42cb7a3cd92ec09895c048043 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 20 Sep 2024 18:08:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E8=BD=AC=EF=BC=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/flow/index.js | 54 ++++++++++- src/router/index.js | 8 +- src/utils/formBuilder.js | 23 +++-- src/views/flow/components/assign.vue | 25 ++++-- src/views/flow/components/forward.vue | 116 ++++++++++++++++++++++++ src/views/flow/components/rollback.vue | 118 +++++++++++++++++++++++++ src/views/flow/components/share.vue | 108 ++++++++++++++++++++++ src/views/flow/create.vue | 107 +++++++++++++++++++--- src/views/flow/list.vue | 30 +++++-- 9 files changed, 544 insertions(+), 45 deletions(-) create mode 100644 src/views/flow/components/forward.vue create mode 100644 src/views/flow/components/rollback.vue create mode 100644 src/views/flow/components/share.vue diff --git a/src/api/flow/index.js b/src/api/flow/index.js index 86dc43f..b175c27 100644 --- a/src/api/flow/index.js +++ b/src/api/flow/index.js @@ -8,7 +8,7 @@ export function flow(isLoading=false) { isLoading }) } - +//创建配置 export function preConfig(custom_model_id,isLoading=false) { return request({ method: 'get', @@ -16,7 +16,7 @@ export function preConfig(custom_model_id,isLoading=false) { isLoading }) } - +//获取表单字段(主要子表单) export function fieldConfig(custom_model_id,isLoading=false) { return request({ method: 'get', @@ -36,7 +36,7 @@ export function create(custom_model_id, data) { // }, }) } - +//处理 export function preDeal(flow_id,params,isLoading=false) { return request({ method: 'get', @@ -45,7 +45,6 @@ export function preDeal(flow_id,params,isLoading=false) { isLoading }) } - export function deal(flow_id,data) { return request({ method: 'post', @@ -99,6 +98,7 @@ export function view(flow_id) { }) } +//抄送 export function preShare(flow_id, params,isLoading = true) { return request({ method: 'get', @@ -107,6 +107,14 @@ export function preShare(flow_id, params,isLoading = true) { isLoading }) } +export function share(flow_id, data, isLoading = true) { + return request({ + method: 'post', + url: `/api/oa/flow/share/${flow_id}`, + data, + isLoading + }) +} //收藏 export function toggleFav(data,isLoading=true) { @@ -139,3 +147,41 @@ export async function destroy(data,isLoading=true) { isLoading }) } + +//转办 +export function preForward(params,isLoading=true) { + return request({ + method: 'get', + url: '/api/oa/flow/forward-pre', + params, + isLoading + }) +} +export async function forward(data,isLoading=true) { + await MessageBox.confirm("确认转办?","提示") + return request({ + method: 'post', + url: '/api/oa/flow/forward', + data, + isLoading + }) +} + +//退回节点 +export async function rollback(data,isLoading=true) { + await MessageBox.confirm("确认退回?","提示") + return request({ + method: 'post', + url: '/api/oa/flow/rollback', + data, + isLoading + }) +} +export function flowLogs(params,isLoading=false) { + return request({ + method: 'get', + url: '/api/oa/flow/flow-logs', + params, + isLoading + }) +} diff --git a/src/router/index.js b/src/router/index.js index f15b501..1d3cdc4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -72,19 +72,19 @@ export const constantRoutes = [ component: () => import('@/views/flow/list.vue'), },{ path: 'list/created-by-me', - name: 'flowList', + name: 'created-by-me', meta: { title: '流程监管', icon: 'table' } },{ path: 'list/fav', - name: 'flowList', + name: 'fav', meta: { title: '我收藏的', icon: 'fav' } },{ path: 'list/todo', - name: 'flowList', + name: 'todo', meta: { title: '待办流程', icon: 'todo' } },{ path: 'list/handled', - name: 'flowList', + name: 'handled', meta: { title: '办理过的', icon: 'flow-through-me' } },{ path: 'create', diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js index 755d89b..1e608bf 100644 --- a/src/utils/formBuilder.js +++ b/src/utils/formBuilder.js @@ -774,7 +774,9 @@ export default function formBuilder(device, info, h, row, pWrite = false) { }, on: { input: (e) => { - this.$set(this.form, info.name, e); + row + ? this.$set(row, info.name, e) + : this.$set(this.form, info.name, e); }, }, }); @@ -794,7 +796,9 @@ export default function formBuilder(device, info, h, row, pWrite = false) { }, on: { input: (e) => { - this.$set(this.form, info.name, e); + row + ? this.$set(row, info.name, e) + : this.$set(this.form, info.name, e); }, }, }); @@ -872,17 +876,18 @@ export default function formBuilder(device, info, h, row, pWrite = false) { "div", this.form[info.name].map((sForm, sIndex) => h( - "van-cell", + "van-cell-group", { props: { - "arrow-direction": "down", - title: info.label + "-" + (sIndex + 1), - "title-style": { - "margin-left": "10px", - }, - }, + inset: false + } }, [ + h("van-cell", { + props: { + title: info.label + "-" + (sIndex + 1) + } + }), h( "van-form", { diff --git a/src/views/flow/components/assign.vue b/src/views/flow/components/assign.vue index 2f28373..d7ee3ff 100644 --- a/src/views/flow/components/assign.vue +++ b/src/views/flow/components/assign.vue @@ -1,13 +1,15 @@ + + diff --git a/src/views/flow/components/rollback.vue b/src/views/flow/components/rollback.vue new file mode 100644 index 0000000..40d6214 --- /dev/null +++ b/src/views/flow/components/rollback.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/views/flow/components/share.vue b/src/views/flow/components/share.vue new file mode 100644 index 0000000..070c959 --- /dev/null +++ b/src/views/flow/components/share.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index 95ed110..b037ea1 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -1,6 +1,12 @@ @@ -160,6 +195,8 @@ import DesktopForm from "./DesktopForm.vue"; import MobileForm from "./MobileForm.vue"; import assign from "./components/assign.vue"; +import forward from "./components/forward.vue"; +import rollback from "./components/rollback.vue"; import { create, deal, fieldConfig, preConfig, preDeal, view } from "@/api/flow"; import { deepCopy } from "@/utils"; @@ -168,13 +205,29 @@ export default { DesktopForm, MobileForm, assign, + forward, + rollback, }, data() { return { + isShowRollback: false, + isShowForward: false, isShowAssign: false, info: [], config: {}, subConfig: new Map(), + myStatus: new Map([ + [-2,'会签退回'], + [-1,'退回'], + [0, "办理中"], + [1, "已完成"], + ]), + statusColor: new Map([ + [-2, "warning"], + [-1, "warning"], + [0, ""], + [1, "success"], + ]), form: {}, result: {}, @@ -199,6 +252,14 @@ export default { } }); }, + formatTime(time) { + const days = parseInt(time / (1000 * 60 * 60 * 24)); + const hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + const minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = (time % (1000 * 60)) / 1000; + return `${days > 0 ? (days) + '天' : ''}${hours > 0 ? (hours) + '时' : ''}${minutes}分${seconds}秒`; + }, + async getConfig() { const loading = this.$loading({ lock: true, @@ -409,6 +470,21 @@ export default { return this.config?.customModel?.js; } }, + diffTime() { + return function (end,start) { + const diff = this.$moment(end).diff(this.$moment(start)) + return this.formatTime(diff) + } + }, + footerData() { + const diff = this.$moment(this.config?.logs?.at(-1)?.updated_at).diff(this.$moment(this.config?.logs?.at(0)?.created_at)); + return [ + { + seq: "总耗时", + 'use_time': this.formatTime(diff), + } + ] + }, }, created() { this.getConfig(); @@ -439,7 +515,14 @@ export default { } @media (max-width: 768px) { .container { - padding: 10px; + padding: 0; + } +} + + diff --git a/src/views/flow/list.vue b/src/views/flow/list.vue index b467700..5f6c5c5 100644 --- a/src/views/flow/list.vue +++ b/src/views/flow/list.vue @@ -195,7 +195,11 @@ >