xy 12 months ago
parent a6cd5a8a42
commit 88b0440af9

@ -220,3 +220,13 @@ export function updateFlowTime(params,isLoading=true) {
isLoading isLoading
}) })
} }
export function getOvertimeHoliday(params,isLoading=false) {
return request({
method: 'get',
url: '/api/oa/flow/get-overtime-holiday',
params,
isLoading
})
}

@ -13,7 +13,7 @@ export default {
name: 'AppMain', name: 'AppMain',
computed: { computed: {
key() { key() {
return this.$route.path return this.$route.fullPath
} }
} }
} }

@ -305,7 +305,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
"application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
multiple: !!info.multiple, multiple: !!info.multiple,
limit: info.multiple ? 20 : 1, limit: info.multiple ? 20 : 1,
fileList: this.form[info.name].map(i => { fileList: this.form[info.name]?.map(i => {
if (i.hasOwnProperty('original_name')) { if (i.hasOwnProperty('original_name')) {
i.name = i.original_name i.name = i.original_name
} }
@ -569,7 +569,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
"min-height": "200px", "min-height": "200px",
border: true, border: true,
stripe: true, stripe: true,
data: this.form[info.name], data: (this.form[info.name] && typeof this.form[info.name] !== 'string') ? this.form[info.name] : [],
"keep-source": true, "keep-source": true,
"column-config": { resizable: true }, "column-config": { resizable: true },
"show-overflow": true, "show-overflow": true,
@ -800,11 +800,42 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
color: "#333", color: "#333",
}, },
}, },
this.form[info.name]?.toString()?.split(',').map(j => { this.form[info.name]?.toString()?.split(',')?.map(j => {
return this.flows[info.name]?.find((i) => let flow = this.flows[info.name]?.find((i) =>
i.id == j i.id == j
)?.title; )
})?.toString() return flow ? h('el-link', {
props: {
type: 'primary'
},
style: {
'line-height': '1.5'
},
on: {
click: _ => {
let target = this.$router.resolve({
path: '/flow/detail',
query: {
module_id: flow.custom_model_id,
flow_id: flow.id,
isSinglePage: 1
}
});
this.modalRender = h => h('iframe',{
attrs: {
src: target.href,
},
style: {
border: 'none',
width: '100%',
height: '100%'
}
})
this.isShowModal = true
}
}
},flow.title) : ''
})
); );
break; break;
case "file": case "file":
@ -836,7 +867,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
accept: accept:
"application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
multiple: true, multiple: true,
fileList: (this.form[info.name] instanceof Array) ? this.form[info.name].map(i => { fileList: (this.form[info.name] instanceof Array) ? this.form[info.name]?.map(i => {
if (i.hasOwnProperty('original_name')) { if (i.hasOwnProperty('original_name')) {
i.name = i.original_name i.name = i.original_name
} }
@ -1215,12 +1246,12 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
accept: accept:
"application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
multiple: !!info.multiple, multiple: !!info.multiple,
fileList: row ? row[info.name].map(i => { fileList: row ? row[info.name]?.map(i => {
if (i.hasOwnProperty('original_name')) { if (i.hasOwnProperty('original_name')) {
i.name = i.original_name i.name = i.original_name
} }
return i return i
}) : this.form[info.name].map(i => { }) : this.form[info.name]?.map(i => {
if (i.hasOwnProperty('original_name')) { if (i.hasOwnProperty('original_name')) {
i.name = i.original_name i.name = i.original_name
} }
@ -1408,7 +1439,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
]), ]),
h( h(
"div", "div",
this.form[info.name].map((sForm, sIndex) => this.form[info.name] instanceof Array ? this.form[info.name]?.map((sForm, sIndex) =>
h( h(
"van-cell-group", "van-cell-group",
{ {
@ -1463,7 +1494,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
), ),
] ]
) )
) ) : ''
), ),
]); ]);
break; break;
@ -1579,7 +1610,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
}), }),
h( h(
"div", "div",
this.form[info.name]?.map((sForm, sIndex) => this.form[info.name] instanceof Array ? this.form[info.name]?.map((sForm, sIndex) =>
h( h(
"van-cell-group", "van-cell-group",
{ {
@ -1620,7 +1651,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
), ),
] ]
) )
) ) : ''
), ),
]); ]);
break; break;
@ -1642,18 +1673,45 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab
for: info.name for: info.name
}, },
props: { props: {
title: info.label, title: info.label
value: row ? row[info.name]?.toString()?.split(',').map(j => {
return this.flows[info.name]?.find((i) =>
i.id == j
)?.title;
})?.toString() : this.form[info.name]?.toString()?.split(',').map(j => {
return this.flows[info.name]?.find((i) =>
i.id == j
)?.title;
})?.toString()
} }
}, },
this.form[info.name]?.toString()?.split(',')?.map(j => {
let flow = this.flows[info.name]?.find((i) =>
i.id == j
)
return flow ? h('el-link', {
props: {
type: 'primary'
},
style: {
'line-height': '1.5'
},
on: {
click: _ => {
let target = this.$router.resolve({
path: '/flow/detail',
query: {
module_id: flow.custom_model_id,
flow_id: flow.id,
isSinglePage: 1
}
});
this.modalRender = h => h('iframe',{
attrs: {
src: target.href,
},
style: {
border: 'none',
width: '100%',
height: '100%'
}
})
this.isShowModal = true
}
}
},flow.title) : ''
})
); );
break; break;
default: default:

@ -20,12 +20,12 @@ export function validUsername(str) {
} }
export const validation = new Map([ export const validation = new Map([
['integer',/^-?\d+$/],//整数 ['integer',/(^$)|^-?\d+$/],//整数
['date',/(^\d{10})|(^\d{13})|(^((\d\d\d\d(.+)|\d\d(.+))?(0?[1-9](.+)|1[012](.+))?((0?[1-9]|[12]\d|3[01])(.+))?\s?)((0?[0-9]|1[0-9]|2[0-3])(.+))?((0?[0-9]|[1-5][0-9])(.+))?((0?[0-9]|[1-5][0-9])(.+))?)$/], ['date',/(^$)|(^\d{10})|(^\d{13})|(^((\d\d\d\d(.+)|\d\d(.+))?(0?[1-9](.+)|1[012](.+))?((0?[1-9]|[12]\d|3[01])(.+))?\s?)((0?[0-9]|1[0-9]|2[0-3])(.+))?((0?[0-9]|[1-5][0-9])(.+))?((0?[0-9]|[1-5][0-9])(.+))?)$/],
['email',/^[^\s@]+@[^\s@]+\.[^\s@]+$/], ['email',/(^$)|^[^\s@]+@[^\s@]+\.[^\s@]+$/],
['isIdCard',/(^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3})|(^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx])$/], ['isIdCard',/(^$)|(^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3})|(^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx])$/],
['isMobile',/(^1[3456789]\d{9})|(^(0\d{2,3}(-)*)?\d{7})$/], ['isMobile',/(^$)|(^1[3456789]\d{9})|(^(0\d{2,3}(-)*)?\d{7})$/],
['numeric',/^-?\d+(.\d+)?$/], ['numeric',/(^$)|^-?\d+(.\d+)?$/],
]) ])
export const validationName = new Map([ export const validationName = new Map([
['integer','整数'],//整数 ['integer','整数'],//整数

@ -3,7 +3,18 @@
<card-container> <card-container>
<vxe-toolbar print custom export> <vxe-toolbar print custom export>
<template #buttons> <template #buttons>
<el-button icon="el-icon-search" type="primary" plain size="small" @click="getList"></el-button> <el-date-picker
:value="(select.start_date && select.end_date) ? [select.start_date,select.end_date] : []"
type="daterange"
size="small"
value-format="yyyy-MM-dd"
clearable
style="width: 260px;"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getList"></el-button>
</template> </template>
</vxe-toolbar> </vxe-toolbar>
<vxe-table <vxe-table
@ -84,7 +95,7 @@
</template> </template>
<script> <script>
import { flowList } from "@/api/flow" import { getOvertimeHoliday } from "@/api/flow"
export default { export default {
data() { data() {
return { return {
@ -103,30 +114,25 @@ export default {
select: { select: {
page: 1, page: 1,
page_size: 9999, page_size: 9999,
sort_name: "", start_date: this.$moment().subtract(1, 'months').format('YYYY-MM-DD'),
sort_type: "", end_date: this.$moment().add(1, 'months').format('YYYY-MM-DD')
keyword: "",
department_id: "",
is_fav: "",
custom_model_id: "69",
date_range: "",
date_type: "create_date",
}, },
total: 0,
} }
}, },
methods: { methods: {
detail(row) { detail(row) {
this.$router.push( this.$router.push(
`/flow/detail?module_id=${row.custom_model.id}&flow_id=${row.id}` `/flow/detail?module_id=${row.custom_model_id}&flow_id=${row.id}`
); );
}, },
async getList() { async getList() {
this.loading = true; this.loading = true;
try { try {
const res = await flowList('my', this.select, false); const res = await getOvertimeHoliday(this.select, false);
console.log(res); console.log(res);
this.tableData = res?.data?.data || []; this.tableData = res?.flows?.data || [];
this.total = res?.data?.total ?? 0; this.total = res?.flows?.total ?? 0;
this.loading = false; this.loading = false;
} catch (err) { } catch (err) {
console.error(err); console.error(err);

@ -223,6 +223,8 @@ export default {
isShowModal(newVal) { isShowModal(newVal) {
if (newVal) { if (newVal) {
this.zIndex = PopupManager.nextZIndex(); this.zIndex = PopupManager.nextZIndex();
} else {
this.modalRender = () => {}
} }
}, },
logs: { logs: {

Loading…
Cancel
Save