|
|
|
|
@ -1,12 +1,14 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<el-card :shadow="device === 'desktop' ? 'always' : 'never'"
|
|
|
|
|
class="card"
|
|
|
|
|
:style="{
|
|
|
|
|
border: device === 'desktop' ? '' : 'none',
|
|
|
|
|
background: device === 'desktop' ? '' : '#f7f8fa',
|
|
|
|
|
'min-height': device === 'desktop' ? '' : '100vh',
|
|
|
|
|
}">
|
|
|
|
|
<el-card
|
|
|
|
|
:shadow="device === 'desktop' ? 'always' : 'never'"
|
|
|
|
|
class="card"
|
|
|
|
|
:style="{
|
|
|
|
|
border: device === 'desktop' ? '' : 'none',
|
|
|
|
|
background: device === 'desktop' ? '' : '#f7f8fa',
|
|
|
|
|
'min-height': device === 'desktop' ? '' : '100vh',
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<template #header>
|
|
|
|
|
<p>{{ config.customModel ? config.customModel.name : "办理" }}</p>
|
|
|
|
|
</template>
|
|
|
|
|
@ -29,10 +31,9 @@
|
|
|
|
|
</el-steps>
|
|
|
|
|
|
|
|
|
|
<el-divider></el-divider>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-container">
|
|
|
|
|
<div class="form-container" id="print-content">
|
|
|
|
|
<template v-if="device === 'desktop'">
|
|
|
|
|
<DesktopForm
|
|
|
|
|
:device="device"
|
|
|
|
|
@ -63,10 +64,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 审批日志-->
|
|
|
|
|
<!-- 审批日志-->
|
|
|
|
|
<div v-if="/\/detail/.test($route.path)" style="margin-top: 10px">
|
|
|
|
|
<div>流转记录</div>
|
|
|
|
|
<vxe-table
|
|
|
|
|
style="margin-top: 10px;"
|
|
|
|
|
show-footer
|
|
|
|
|
ref="table"
|
|
|
|
|
stripe
|
|
|
|
|
@ -80,24 +82,80 @@
|
|
|
|
|
:footer-data="footerData"
|
|
|
|
|
:data="config.logs || []"
|
|
|
|
|
>
|
|
|
|
|
<vxe-column type="seq" width="62" align="center" field="seq" title="编号"/>
|
|
|
|
|
<vxe-column width="140" title="节点名称" align="center" field="node.name" :formatter="({ cellValue }) => (cellValue || '节点已调整')"></vxe-column>
|
|
|
|
|
<vxe-column width="80" align="center" title="办理状态" field="status" :formatter="({ cellValue }) => (myStatus.get(cellValue))">
|
|
|
|
|
<vxe-column
|
|
|
|
|
type="seq"
|
|
|
|
|
width="62"
|
|
|
|
|
align="center"
|
|
|
|
|
field="seq"
|
|
|
|
|
title="编号"
|
|
|
|
|
/>
|
|
|
|
|
<vxe-column
|
|
|
|
|
width="140"
|
|
|
|
|
title="节点名称"
|
|
|
|
|
align="center"
|
|
|
|
|
field="node.name"
|
|
|
|
|
:formatter="({ cellValue }) => cellValue || '节点已调整'"
|
|
|
|
|
></vxe-column>
|
|
|
|
|
<vxe-column
|
|
|
|
|
width="80"
|
|
|
|
|
align="center"
|
|
|
|
|
title="办理状态"
|
|
|
|
|
field="status"
|
|
|
|
|
:formatter="({ cellValue }) => myStatus.get(cellValue)"
|
|
|
|
|
>
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-tag
|
|
|
|
|
size="mini"
|
|
|
|
|
:type="statusColor.get(row.status)"
|
|
|
|
|
effect="dark"
|
|
|
|
|
>{{ myStatus.get(row.status) }}</el-tag
|
|
|
|
|
>{{ myStatus.get(row.status) }}</el-tag
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column align="center" width="80" title="承办人员" field="user.name"></vxe-column>
|
|
|
|
|
<vxe-column align="center" width="200" title="流转时间" field="created_at" :formatter="({ cellValue }) => $moment(cellValue).format('YYYY年MM月DD日 HH:mm:ss')"></vxe-column>
|
|
|
|
|
<vxe-column min-width="200" header-align="center" title="退回原因" field="reason"></vxe-column>
|
|
|
|
|
<vxe-column align="center" width="200" title="办理时间" field="updated_at">
|
|
|
|
|
<vxe-column
|
|
|
|
|
align="center"
|
|
|
|
|
width="80"
|
|
|
|
|
title="承办人员"
|
|
|
|
|
field="user.name"
|
|
|
|
|
></vxe-column>
|
|
|
|
|
<vxe-column
|
|
|
|
|
align="center"
|
|
|
|
|
width="200"
|
|
|
|
|
title="流转时间"
|
|
|
|
|
field="created_at"
|
|
|
|
|
:formatter="
|
|
|
|
|
({ cellValue }) =>
|
|
|
|
|
$moment(cellValue).format('YYYY年MM月DD日 HH:mm:ss')
|
|
|
|
|
"
|
|
|
|
|
></vxe-column>
|
|
|
|
|
<vxe-column
|
|
|
|
|
min-width="200"
|
|
|
|
|
header-align="center"
|
|
|
|
|
title="退回原因"
|
|
|
|
|
field="reason"
|
|
|
|
|
></vxe-column>
|
|
|
|
|
<vxe-column
|
|
|
|
|
align="center"
|
|
|
|
|
width="200"
|
|
|
|
|
title="办理时间"
|
|
|
|
|
field="updated_at"
|
|
|
|
|
>
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<span :style="{ 'color': (row.deadline && row.updated_at && $moment(row.updated_at).isAfter($moment(row.deadline).endOf('day')) ? 'red' : '') }">{{ $moment(row.updated_at).format('YYYY年MM月DD日 HH:mm:ss') }}</span>
|
|
|
|
|
<span
|
|
|
|
|
:style="{
|
|
|
|
|
color:
|
|
|
|
|
row.deadline &&
|
|
|
|
|
row.updated_at &&
|
|
|
|
|
$moment(row.updated_at).isAfter(
|
|
|
|
|
$moment(row.deadline).endOf('day')
|
|
|
|
|
)
|
|
|
|
|
? 'red'
|
|
|
|
|
: '',
|
|
|
|
|
}"
|
|
|
|
|
>{{
|
|
|
|
|
$moment(row.updated_at).format("YYYY年MM月DD日 HH:mm:ss")
|
|
|
|
|
}}</span
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column align="center" title="耗时" field="use_time" width="120">
|
|
|
|
|
@ -116,7 +174,7 @@
|
|
|
|
|
type="danger"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="isShowRollback = true"
|
|
|
|
|
>退回</el-button
|
|
|
|
|
>退回</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="$route.query.flow_id"
|
|
|
|
|
@ -125,7 +183,7 @@
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
@click="isShowForward = true"
|
|
|
|
|
>部门内转办</el-button
|
|
|
|
|
>部门内转办</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="$route.query.flow_id"
|
|
|
|
|
@ -133,41 +191,24 @@
|
|
|
|
|
type="info"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="submit('only-submit')"
|
|
|
|
|
>暂存不流转</el-button
|
|
|
|
|
>暂存不流转</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" size="small" @click="submit('assign')"
|
|
|
|
|
>保存并流转 <i class="el-icon-right"></i
|
|
|
|
|
>保存并流转 <i class="el-icon-right"></i
|
|
|
|
|
></el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="!$route.query.flow_id"
|
|
|
|
|
type="info"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="$router.go(-1)"
|
|
|
|
|
>返回</el-button
|
|
|
|
|
>返回</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
@click="$router.go(-1)"
|
|
|
|
|
>返回</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
>打印</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
>打印(带审批记录)</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
>下载附件</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button plain size="small" @click="$router.go(-1)">返回</el-button>
|
|
|
|
|
<el-button plain size="small" @click="print(false)">打印</el-button>
|
|
|
|
|
<el-button plain size="small" @click="print(true)">打印(带审批记录)</el-button>
|
|
|
|
|
<el-button plain size="small">下载附件</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
@ -182,11 +223,14 @@
|
|
|
|
|
<forward
|
|
|
|
|
ref="forward"
|
|
|
|
|
:is-show.sync="isShowForward"
|
|
|
|
|
:flow="config.flow"></forward>
|
|
|
|
|
:flow="config.flow"
|
|
|
|
|
></forward>
|
|
|
|
|
|
|
|
|
|
<rollback ref="rollback"
|
|
|
|
|
:is-show.sync="isShowRollback"
|
|
|
|
|
:flow="config.flow"></rollback>
|
|
|
|
|
<rollback
|
|
|
|
|
ref="rollback"
|
|
|
|
|
:is-show.sync="isShowRollback"
|
|
|
|
|
:flow="config.flow"
|
|
|
|
|
></rollback>
|
|
|
|
|
|
|
|
|
|
<el-backtop></el-backtop>
|
|
|
|
|
</div>
|
|
|
|
|
@ -198,10 +242,17 @@ 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 {
|
|
|
|
|
create,
|
|
|
|
|
deal,
|
|
|
|
|
fieldConfig,
|
|
|
|
|
preConfig,
|
|
|
|
|
preDeal,
|
|
|
|
|
view,
|
|
|
|
|
} from "@/api/flow";
|
|
|
|
|
import { deepCopy } from "@/utils";
|
|
|
|
|
import { validation, validationName } from "@/utils/validate";
|
|
|
|
|
|
|
|
|
|
import { print } from "@/utils/print";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
DesktopForm,
|
|
|
|
|
@ -219,8 +270,8 @@ export default {
|
|
|
|
|
config: {},
|
|
|
|
|
subConfig: new Map(),
|
|
|
|
|
myStatus: new Map([
|
|
|
|
|
[-2,'会签退回'],
|
|
|
|
|
[-1,'退回'],
|
|
|
|
|
[-2, "会签退回"],
|
|
|
|
|
[-1, "退回"],
|
|
|
|
|
[0, "办理中"],
|
|
|
|
|
[1, "已完成"],
|
|
|
|
|
]),
|
|
|
|
|
@ -234,31 +285,51 @@ export default {
|
|
|
|
|
form: {},
|
|
|
|
|
result: {},
|
|
|
|
|
fileList: {},
|
|
|
|
|
rules: {}
|
|
|
|
|
rules: {},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async print(isLog=false) {
|
|
|
|
|
if(isLog) {
|
|
|
|
|
const res = await this.$refs['table'].exportData({
|
|
|
|
|
type: 'html',
|
|
|
|
|
download: false
|
|
|
|
|
})
|
|
|
|
|
print(this.config.customModel.print_format, isLog, res.content)
|
|
|
|
|
} else {
|
|
|
|
|
print(this.config.customModel.print_format, isLog)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
generateForm(object, fields) {
|
|
|
|
|
this.rules = {}
|
|
|
|
|
this.rules = {};
|
|
|
|
|
fields.forEach((field) => {
|
|
|
|
|
if(field.rules && field.rules.length > 0) {
|
|
|
|
|
this.rules[field.name] = field.rules.map(rule => {
|
|
|
|
|
if (field.rules && field.rules.length > 0) {
|
|
|
|
|
this.rules[field.name] = field.rules.map((rule) => {
|
|
|
|
|
switch (rule) {
|
|
|
|
|
case 'required':
|
|
|
|
|
return { required: true, message: `请填写${field.label}`, trigger: 'blur' }
|
|
|
|
|
case "required":
|
|
|
|
|
return {
|
|
|
|
|
required: true,
|
|
|
|
|
message: `请填写${field.label}`,
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
};
|
|
|
|
|
default:
|
|
|
|
|
return {
|
|
|
|
|
validator: (myRule, value, callback) => {
|
|
|
|
|
if(validation.get(rule).test(value)) {
|
|
|
|
|
callback()
|
|
|
|
|
if (validation.get(rule).test(value)) {
|
|
|
|
|
callback();
|
|
|
|
|
} else {
|
|
|
|
|
callback(new Error(`${field.label}必须为${validationName.get(rule)}`))
|
|
|
|
|
callback(
|
|
|
|
|
new Error(
|
|
|
|
|
`${field.label}必须为${validationName.get(rule)}`
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (field.type === "file") {
|
|
|
|
|
this.fileList[field.name] = [];
|
|
|
|
|
@ -280,7 +351,9 @@ export default {
|
|
|
|
|
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}秒`;
|
|
|
|
|
return `${days > 0 ? days + "天" : ""}${
|
|
|
|
|
hours > 0 ? hours + "时" : ""
|
|
|
|
|
}${minutes}分${seconds}秒`;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getConfig() {
|
|
|
|
|
@ -291,10 +364,10 @@ export default {
|
|
|
|
|
background: "rgba(0, 0, 0, 0.8)",
|
|
|
|
|
});
|
|
|
|
|
//路由为detail为详情
|
|
|
|
|
if(/\/detail/.test(this.$route.path) && this.$route.query.flow_id) {
|
|
|
|
|
if (/\/detail/.test(this.$route.path) && this.$route.query.flow_id) {
|
|
|
|
|
try {
|
|
|
|
|
const res = await view(this.$route.query.flow_id);
|
|
|
|
|
console.log('view',res)
|
|
|
|
|
console.log("view", res);
|
|
|
|
|
const { fields } = res?.customModel;
|
|
|
|
|
let subFormRequest = [];
|
|
|
|
|
const getSubForm = (id) => {
|
|
|
|
|
@ -422,7 +495,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async submit(type) {
|
|
|
|
|
let copyForm,copyFile;
|
|
|
|
|
let copyForm, copyFile;
|
|
|
|
|
if (this.device === "desktop") {
|
|
|
|
|
copyForm = deepCopy(this.$refs["desktopForm"].form);
|
|
|
|
|
copyFile = deepCopy(this.$refs["desktopForm"].file);
|
|
|
|
|
@ -430,7 +503,7 @@ export default {
|
|
|
|
|
copyForm = deepCopy(this.$refs["mobileForm"].form);
|
|
|
|
|
copyFile = deepCopy(this.$refs["mobileForm"].file);
|
|
|
|
|
}
|
|
|
|
|
console.log(copyForm,copyFile)
|
|
|
|
|
console.log(copyForm, copyFile);
|
|
|
|
|
for (let [key, value] of Object.entries(copyFile)) {
|
|
|
|
|
if (copyForm.hasOwnProperty(key)) {
|
|
|
|
|
copyForm[key] = value.map((i) => i.response?.id)?.toString();
|
|
|
|
|
@ -455,7 +528,7 @@ export default {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (this.device === "desktop") {
|
|
|
|
|
if(!await this.$refs['desktopForm'].validate()) return
|
|
|
|
|
if (!(await this.$refs["desktopForm"].validate())) return;
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.flow_id) {
|
|
|
|
|
copyForm.id = this.$route.query.flow_id;
|
|
|
|
|
@ -464,10 +537,14 @@ export default {
|
|
|
|
|
copyForm
|
|
|
|
|
);
|
|
|
|
|
this.result = flow;
|
|
|
|
|
if(!is_last_handled_log) {
|
|
|
|
|
await this.$alert('办理成功,其他会签办理完成后,由最后办理的成员流转到下一节点。','提示',{
|
|
|
|
|
showClose: false,
|
|
|
|
|
})
|
|
|
|
|
if (!is_last_handled_log) {
|
|
|
|
|
await this.$alert(
|
|
|
|
|
"办理成功,其他会签办理完成后,由最后办理的成员流转到下一节点。",
|
|
|
|
|
"提示",
|
|
|
|
|
{
|
|
|
|
|
showClose: false,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
callback = () => this.$router.push("/flow/list/todo");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
@ -487,7 +564,9 @@ export default {
|
|
|
|
|
return this.config?.customModel?.fields || [];
|
|
|
|
|
},
|
|
|
|
|
readableFields() {
|
|
|
|
|
return /\/detail/.test(this.$route.path) ? this.fields?.map(i => i.id) : (this.config?.currentNode?.readable || []);
|
|
|
|
|
return /\/detail/.test(this.$route.path)
|
|
|
|
|
? this.fields?.map((i) => i.id)
|
|
|
|
|
: this.config?.currentNode?.readable || [];
|
|
|
|
|
},
|
|
|
|
|
writeableFields() {
|
|
|
|
|
return this.config?.currentNode?.writeable || [];
|
|
|
|
|
@ -503,19 +582,21 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
diffTime() {
|
|
|
|
|
return function (end,start) {
|
|
|
|
|
const diff = this.$moment(end).diff(this.$moment(start))
|
|
|
|
|
return this.formatTime(diff)
|
|
|
|
|
}
|
|
|
|
|
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));
|
|
|
|
|
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),
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
use_time: this.formatTime(diff),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -547,7 +628,7 @@ export default {
|
|
|
|
|
.container {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
.btns {
|
|
|
|
|
.btns {
|
|
|
|
|
justify-content: space-evenly;
|
|
|
|
|
& > * {
|
|
|
|
|
margin: 4px 6px;
|
|
|
|
|
|