+
-
+
流转记录
-
-
-
+
+
+
{{ myStatus.get(row.status) }}{{ myStatus.get(row.status) }}
-
-
-
-
+
+
+
+
- {{ $moment(row.updated_at).format('YYYY年MM月DD日 HH:mm:ss') }}
+ {{
+ $moment(row.updated_at).format("YYYY年MM月DD日 HH:mm:ss")
+ }}
@@ -116,7 +174,7 @@
type="danger"
size="small"
@click="isShowRollback = true"
- >退回退回
部门内转办部门内转办
暂存不流转暂存不流转
保存并流转 保存并流转
返回返回
- 返回
- 打印
- 打印(带审批记录)
- 下载附件
+ 返回
+ 打印
+ 打印(带审批记录)
+ 下载附件
@@ -182,11 +223,14 @@
+ :flow="config.flow"
+ >
-
+
@@ -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;