工作流

main
mo 1 year ago
parent 33cbd6c8b6
commit 94cb133273

@ -51,6 +51,15 @@ export function getRecordPage(query) {
}) })
} }
// 获得归档分页
export function getRecordList(query) {
return request({
url: '/archives/record/list',
method: 'get',
params: query
})
}
// 导出归档 Excel // 导出归档 Excel
export function exportRecordExcel(query) { export function exportRecordExcel(query) {
return request({ return request({

@ -1,55 +1,122 @@
<!-- 按钮 --> <!-- 按钮 -->
<template> <template>
<div> <div>
<el-button type="info" size="mini" v-if="isWin == 3" disabled style="margin-bottom:10px;"></el-button> <el-button
<el-button type="primary" plain size="mini" v-if="['add','edit'].includes($route.query.flag)" @click="handleConfirm(0)" style="margin-bottom:10px;"></el-button> type="info"
<el-button type="primary" plain size="mini" v-if="['add','edit'].includes($route.query.flag) || ['quotationSheetBidding'].includes(listType) && isWin==2 " @click="handleConfirm(1)" style="margin-bottom:10px;">{{saveTitle}}</el-button> size="mini"
<el-button type="primary" plain size="mini" v-if="['edit','show'].includes($route.query.flag)" @click="handleConfirm(2)" style="margin-bottom:10px;"></el-button> v-if="isWin == 3"
<el-button type="primary" plain size="mini" v-if="['show','edit'].includes($route.query.flag)" @click="handleConfirm(3)" style="margin-bottom:10px;"></el-button> disabled
<el-button type="success" plain size="mini" v-if="isAuthorised" @click="handleConfirm(4)" style="margin-bottom:10px;"></el-button> style="margin-bottom: 10px"
<el-button type="danger" plain size="mini" v-if="isAuthorised" @click="handleConfirm(5)" style="margin-bottom:10px;"></el-button> >已流标</el-button
<el-button type="primary" size="mini" @click="handleBack" style="margin-bottom:10px;">返回</el-button> >
<Toast :accessId="accessId" :newKey="key" :isOpen="isOpen" @onCancel="isOpen=false" /> <el-button
type="primary"
plain
size="mini"
v-if="['add', 'edit'].includes($route.query.flag)"
@click="handleConfirm(0)"
style="margin-bottom: 10px"
>暂存</el-button
>
<el-button
type="primary"
plain
size="mini"
v-if="
['add', 'edit'].includes($route.query.flag) ||
(['quotationSheetBidding'].includes(listType) && isWin == 2)
"
@click="handleConfirm(1)"
style="margin-bottom: 10px"
>{{ saveTitle }}</el-button
>
<el-button
type="primary"
plain
size="mini"
v-if="['edit', 'show'].includes($route.query.flag)"
@click="handleConfirm(2)"
style="margin-bottom: 10px"
>打印预览</el-button
>
<el-button
type="primary"
plain
size="mini"
v-if="['show', 'edit'].includes($route.query.flag)"
@click="handleConfirm(3)"
style="margin-bottom: 10px"
>审批流程</el-button
>
<el-button
type="success"
plain
size="mini"
v-if="isAuthorised"
@click="handleConfirm(4)"
style="margin-bottom: 10px"
>同意</el-button
>
<el-button
type="danger"
plain
size="mini"
v-if="isAuthorised"
@click="handleConfirm(5)"
style="margin-bottom: 10px"
>驳回</el-button
>
<el-button
type="primary"
size="mini"
@click="handleBack"
style="margin-bottom: 10px"
>返回</el-button
>
<Toast
:accessId="accessId"
:newKey="key"
:isOpen="isOpen"
@onCancel="isOpen = false"
/>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: '', name: "",
components: { components: {
Toast: () => import('./components/Toast.vue') Toast: () => import("./components/Toast.vue"),
}, },
props: { props: {
isAuthorised: Boolean, isAuthorised: Boolean,
accessId: [Number, String], accessId: [Number, String],
listType: String, listType: String,
isWin: [Number, String], // 3 isWin: [Number, String], // 3
saveTitle: { saveTitle: {
type: String, type: String,
default: '保存' default: "提交",
} },
}, },
data() { data() {
return { return {
isOpen: false, isOpen: false,
key: null key: null,
} };
}, },
methods: { methods: {
handleConfirm(key) { handleConfirm(key) {
if (key == 4 || key == 5) { if (key == 4 || key == 5) {
this.key = key this.key = key;
this.isOpen = true this.isOpen = true;
} else { } else {
this.$emit('onConfirm', key) this.$emit("onConfirm", key);
} }
}, },
handleBack() { handleBack() {
history.back() history.back();
}, },
} },
} };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped></style>
</style>

@ -1,51 +1,79 @@
<!-- --> <!-- -->
<template> <template>
<el-dialog title="审批信息" :visible.sync="dialogVisible" width="850px" :before-close="handleCancel"> <el-dialog
title="审批信息"
:visible.sync="dialogVisible"
width="850px"
:before-close="handleCancel"
>
<div v-loading="processInstanceLoading"> <div v-loading="processInstanceLoading">
<div class="start-msg"> <div class="start-msg">
<div class="title-box"><span>申请人</span>{{ startUserObj.nickname || '-'}}</div> <div class="title-box">
<div class="title-box"><span>所属部门</span>{{ startUserObj.deptName || '-'}}</div> <span>申请人</span>{{ startUserObj.nickname || "-" }}
<div class="title-box"><span>创建时间</span>{{ startUserObj.createTime || '-'}}</div> </div>
<div class="title-box">
<span>所属部门</span>{{ startUserObj.deptName || "-" }}
</div>
<div class="title-box">
<span>创建时间</span>{{ startUserObj.createTime || "-" }}
</div>
</div> </div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-table stripe border :data="tasks" ref="tasks"> <el-table stripe border :data="tasks" ref="tasks">
<el-table-column label="审批人员" align="center" prop="assigneeUser"> <el-table-column
<template slot-scope="{row}"> label="审批人员"
{{row.assigneeUser.nickname || '-' }} align="center"
prop="assigneeUser"
>
<template slot-scope="{ row }">
{{ row.assigneeUser.nickname || "-" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属部门" align="center" prop="assigneeUser"> <el-table-column
<template slot-scope="{row}"> label="所属部门"
{{row.assigneeUser.deptName || '-' }} align="center"
prop="assigneeUser"
>
<template slot-scope="{ row }">
{{ row.assigneeUser.deptName || "-" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="审批意见" align="center" prop="reason"> <el-table-column label="审批意见" align="center" prop="reason">
<template slot-scope="{row}"> <template slot-scope="{ row }">
{{ row.reason || '-' }} {{ row.reason || "-" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="reason"> <el-table-column label="状态" align="center" prop="reason">
<template slot-scope="{row}"> <template slot-scope="{ row }">
<el-tag :type="getTimelineItemType(row)"> {{getTimelineItemTypeStr(row) || '-' }}</el-tag> <el-tag :type="getTimelineItemType(row)">
{{ getTimelineItemTypeStr(row) || "-" }}</el-tag
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="审批时间" align="center" prop="endTime"> <el-table-column label="审批时间" align="center" prop="endTime">
<template slot-scope="{row}"> <template slot-scope="{ row }">
{{ parseTime(row.endTime) || '-' }} {{ parseTime(row.endTime) || "-" }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col> </el-col>
</el-row> </el-row>
<!-- 审批流程图 --> <!-- 审批流程图 -->
<el-row style="margin-top: 10px;"> <el-row style="margin-top: 10px">
<el-col :span="24"> <el-col :span="24">
<!-- 高亮流程图 --> <!-- 高亮流程图 -->
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="el-icon-picture-outline">流程图 </span> <span class="el-icon-picture-outline">流程图 </span>
</div> </div>
<my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" :activityData="activityList" :processInstanceData="processInstance" :taskData="tasks" /> <my-process-viewer
key="designer"
v-model="bpmnXML"
v-bind="bpmnControlForm"
:activityData="activityList"
:processInstanceData="processInstance"
:taskData="tasks"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -58,13 +86,13 @@ import { getActivityList } from "@/api/bpm/activity";
import { getTaskListByProcessInstanceId } from "@/api/bpm/task"; import { getTaskListByProcessInstanceId } from "@/api/bpm/task";
import store from "@/store"; import store from "@/store";
import Vue from "vue"; import Vue from "vue";
import dayjs from 'dayjs'; import dayjs from "dayjs";
import { parseTime } from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
export default { export default {
name: '', name: "",
props: { props: {
isOpen: Boolean, isOpen: Boolean,
processInstanceId: [Number, String] processInstanceId: [Number, String],
}, },
data() { data() {
return { return {
@ -83,73 +111,75 @@ export default {
// //
detailForm: { detailForm: {
fields: [] fields: [],
}, },
runningTasks: [], runningTasks: [],
// BPMN // BPMN
bpmnXML: null, bpmnXML: null,
bpmnControlForm: { bpmnControlForm: {
prefix: "flowable" prefix: "flowable",
}, },
} };
}, },
watch: { watch: {
isOpen: { isOpen: {
handler(val) { handler(val) {
this.dialogVisible = val this.dialogVisible = val;
if (val) { if (val) {
this.processInstanceId && this.getDetail(this.processInstanceId) this.processInstanceId && this.getDetail(this.processInstanceId);
} }
}, },
deep: true, deep: true,
immediate: true immediate: true,
} },
}, },
methods: { methods: {
getTimelineItemTypeStr(item) { getTimelineItemTypeStr(item) {
if (item.result === 1) { if (item.result === 1) {
return '处理中'; return "处理中";
} }
if (item.result === 2) { if (item.result === 2) {
return '通过'; return "通过";
} }
if (item.result === 3) { if (item.result === 3) {
return '驳回'; return "驳回";
} }
if (item.result === 4) { if (item.result === 4) {
return '取消'; return "取消";
} }
return '未知'; return "未知";
}, },
getTimelineItemType(item) { getTimelineItemType(item) {
if (item.result === 1) { if (item.result === 1) {
return 'primary'; return "primary";
} }
if (item.result === 2) { if (item.result === 2) {
return 'success'; return "success";
} }
if (item.result === 3) { if (item.result === 3) {
return 'danger'; return "danger";
} }
if (item.result === 4) { if (item.result === 4) {
return 'info'; return "info";
} }
return ''; return "";
}, },
getDetail(id) { getDetail(id) {
// //
this.processInstanceLoading = true this.processInstanceLoading = true;
getProcessInstance(id).then(response => { getProcessInstance(id).then((response) => {
if (!response.data) { if (!response.data) {
this.$message.error('查询不到流程信息!'); this.$message.error("查询不到流程信息!");
return; return;
} }
// //
this.processInstance = response.data; this.processInstance = response.data;
this.startUserObj = { this.startUserObj = {
...(response.data.startUser || {}), ...(response.data.startUser || {}),
createTime: response.data.createTime && parseTime(response.data.createTime) || '-' createTime:
} (response.data.createTime && parseTime(response.data.createTime)) ||
"-",
};
// //
const path = this.processInstance.processDefinition.formCustomViewPath; const path = this.processInstance.processDefinition.formCustomViewPath;
Vue.component("async-biz-form-component", function (resolve) { Vue.component("async-biz-form-component", function (resolve) {
@ -162,25 +192,29 @@ export default {
...JSON.parse(this.processInstance.processDefinition.formConf), ...JSON.parse(this.processInstance.processDefinition.formConf),
disabled: true, // disabled: true, //
formBtns: false, // formBtns: false, //
fields: decodeFields(this.processInstance.processDefinition.formFields) fields: decodeFields(
} this.processInstance.processDefinition.formFields
),
};
// //
this.detailForm.fields.forEach(item => { this.detailForm.fields.forEach((item) => {
const val = this.processInstance.formVariables[item.__vModel__] const val = this.processInstance.formVariables[item.__vModel__];
if (val) { if (val) {
item.__config__.defaultValue = val item.__config__.defaultValue = val;
} }
}); });
} }
// //
getProcessDefinitionBpmnXML(this.processInstance.processDefinition.id).then(response => { getProcessDefinitionBpmnXML(
this.bpmnXML = response.data this.processInstance.processDefinition.id
).then((response) => {
this.bpmnXML = response.data;
}); });
// //
getActivityList({ getActivityList({
processInstanceId: this.processInstance.id processInstanceId: this.processInstance.id,
}).then(response => { }).then((response) => {
this.activityList = response.data; this.activityList = response.data;
}); });
@ -189,11 +223,11 @@ export default {
// //
this.runningTasks = []; this.runningTasks = [];
this.auditForms = []; this.auditForms = [];
getTaskListByProcessInstanceId(id).then(response => { getTaskListByProcessInstanceId(id).then((response) => {
// //
this.tasks = []; this.tasks = [];
// //
response.data.forEach(task => { response.data.forEach((task) => {
if (task.result !== 4) { if (task.result !== 4) {
this.tasks.push(task); this.tasks.push(task);
} }
@ -215,27 +249,40 @@ export default {
// //
const userId = store.getters.userId; const userId = store.getters.userId;
this.tasks.forEach(task => { this.tasks.forEach((task) => {
if (task.result !== 1) { // if (task.result !== 1) {
//
return; return;
} }
if (!task.assigneeUser || task.assigneeUser.id !== userId) { // if (!task.assigneeUser || task.assigneeUser.id !== userId) {
//
return; return;
} }
this.runningTasks.push({ ...task }); this.runningTasks.push({ ...task });
this.auditForms.push({ this.auditForms.push({
reason: '' reason: "",
}) });
}); });
let newTasks = this.tasks.map(item => { let newTasks = this.tasks.map((item) => {
return { return {
...item, ...item,
result: this.getTimelineItemTypeStr(item), result: this.getTimelineItemTypeStr(item),
endTime: item.endTime ? dayjs(item.endTime).format('YYYY-MM-DD HH:ss:mm') : '-' endTime: item.endTime
} ? dayjs(item.endTime).format("YYYY-MM-DD HH:ss:mm")
}) : "-",
this.$emit('onTasks', { tasks: newTasks || [], startUserObj: this.startUserObj }) };
this.$emit('onSetId', (Array.isArray(this.runningTasks) && this.runningTasks.length ? this.runningTasks[this.runningTasks.length - 1] : {}).id) });
this.$emit("onTasks", {
tasks: newTasks || [],
startUserObj: this.startUserObj,
});
this.$emit(
"onSetId",
(Array.isArray(this.runningTasks) && this.runningTasks.length
? this.runningTasks[this.runningTasks.length - 1]
: {}
).id
);
this.processInstanceLoading = false; this.processInstanceLoading = false;
// //
// this.tasksLoad = false; // this.tasksLoad = false;
@ -243,16 +290,15 @@ export default {
}); });
}, },
handleCancel() { handleCancel() {
this.$emit('onCancel') this.$emit("onCancel");
}, },
handleConfirm() { handleConfirm() {
this.$emit('onCancel') this.$emit("onCancel");
}, },
} },
} };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.start-msg { .start-msg {
display: flex; display: flex;
margin-bottom: 15px; margin-bottom: 15px;
@ -270,4 +316,4 @@ export default {
.my-process-designer { .my-process-designer {
height: 500px; height: 500px;
} }
</style> </style>

@ -95,6 +95,21 @@ export const oaRouter = [
] ]
}, },
// 借阅申请单
{
path: '/borrow',
component: Layout,
hidden: true,
permissions: ['*'],
children: [
// 借阅申请单
{
path: 'apply/in',
component: () => import('@/views/borrow/apply/components/form'),
meta: { title: '', activeMenu: '/borrow/apply' }
},
]
},
// 报价申请单 // 报价申请单
{ {

@ -263,8 +263,8 @@
v-model="form.turnExplain" v-model="form.turnExplain"
placeholder="请输入移交说明" placeholder="请输入移交说明"
/> />
</el-form-item> </el-col </el-form-item>
> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="移交人" prop="outputName"> <el-form-item label="移交人" prop="outputName">
<el-input <el-input
@ -346,12 +346,20 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="案卷数量" prop="amount"> <el-form-item label="案卷数量" prop="amount">
<el-input class="wd100" v-model="form.amount" placeholder="请输入案卷数量" /> <el-input
class="wd100"
v-model="form.amount"
placeholder="请输入案卷数量"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="流程编号" prop="processInstanceId"> <el-form-item label="流程编号" prop="processInstanceId">
<el-input class="wd100" v-model="form.processInstanceId" readonly /> <el-input
class="wd100"
v-model="form.processInstanceId"
readonly
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -525,6 +533,7 @@ export default {
// //
handleNewSiteChanged(obj) { handleNewSiteChanged(obj) {
if (obj != null) { if (obj != null) {
this.newSiteArray = obj;
this.form.toOrganizationId = obj[0]; this.form.toOrganizationId = obj[0];
this.form.toDepotId = obj[1]; this.form.toDepotId = obj[1];
this.form.toCabinetId = obj[2]; this.form.toCabinetId = obj[2];
@ -695,5 +704,5 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/assets/styles/header/index.scss"; @import "@/assets/styles/header/index.scss";
@import "@/assets/styles/common/index.scss"; @import "@/assets/styles/common/index.scss";
@import '@/assets/styles/edit/index.scss'; @import "@/assets/styles/edit/index.scss";
</style> </style>

@ -0,0 +1,308 @@
<template>
<div class="app-container form-box" style="padding: 20px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card class="top15">
<div class="table-card">
<el-row type="flex" justify="space-around">
<el-col :span="8"></el-col>
<el-col :span="8" class="formTitle"> {{ title }}</el-col>
<el-col :span="8" style="text-align: right; padding-right: 20px">
<BottomBtn
:accessId="accessId"
:isAuthorised="isAuthorised"
@onConfirm="handleBtTottom"
/>
</el-col>
</el-row>
</div>
<div class="table-card table-card-content">
<el-row>
<el-col :span="8">
<el-form-item label="借阅申请编码" prop="borrowCode">
<el-input
v-model="form.borrowCode"
:disabled="disabled"
placeholder="请输入借阅申请编码"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请人">
<CommonName str="an" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请部门">
<CommonName str="apt" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="预计归还日期" prop="returnTime">
<el-date-picker
class="formItemFullWidth"
:disabled="disabled"
clearable
v-model="form.returnTime"
type="date"
value-format="timestamp"
placeholder="选择预计归还日期"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="借阅方式" prop="way">
<el-select
v-model="form.way"
:disabled="disabled"
placeholder="请选择借阅方式"
class="formItemFullWidth"
>
<el-option
v-for="item in wayOptions"
:key="item.id"
:value="item.value"
:label="item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="档案介质" prop="media">
<el-select
v-model="form.media"
:disabled="disabled"
placeholder="请选择档案介质"
class="formItemFullWidth"
>
<el-option
v-for="item in mediaOptions"
:key="item.id"
:value="item.value"
:label="item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="借阅档案" prop="recordId">
<el-select
v-model="form.recordId"
:disabled="disabled"
clearable
filterable
placeholder="请选择借阅档案"
class="formItemFullWidth"
>
<el-option
v-for="item in filesNumOptions"
:key="item.id"
:value="item.id"
:label="item.filesNum"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="申请事由" prop="reason">
<el-input
type="textarea"
:disabled="disabled"
size="small"
:rows="5"
v-model="form.reason"
placeholder="请输入"
/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-card>
</el-form>
<!-- 打印信息 -->
<el-dialog
:visible.sync="showPrintPage"
width="1200px"
custom-class="print-dialog"
style="height: 98vh; overflow-y: auto"
>
<div style="text-align: right; margin-bottom: 10px">
<el-button @click="PrintRow" type="primary" size="mini" plain
>确认打印</el-button
>
</div>
<div id="printMe" ref="print" class="print-main">
<print-html :infoForm="form" dialogTitle="借阅申请单" :tasks="tasks" />
</div>
</el-dialog>
<!-- 审批流程信息 -->
<FlowDialog
ref="FlowDialog"
:isOpen="showFlow"
@onCancel="showFlow = false"
@onSetId="handleSetApprovalId"
@onTasks="handleTasks"
:processInstanceId="form.processInstanceId"
/>
</div>
</template>
<script>
import { createBorrowApply, getBorrowApply } from "@/api/borrow/apply";
import { debounce } from "lodash";
import { listData } from "@/api/system/dict/data";
import { getRecordList } from "@/api/archives/record";
export default {
name: "supplierTb",
components: {
printHtml: () => import("./printHtml"),
CommonName: () => import("@/components/CommonName"),
FlowDialog: () => import("@/components/FlowDialog"),
BottomBtn: () => import("@/components/BottomBtn"),
},
data() {
return {
loading: true,
isAuthorised: false,
accessId: null,
tasks: {},
showFlow: false,
showPrintPage: false,
form: {
borrowCode: undefined,
reason: null,
returnTime: null,
way: null,
media: null,
recordId: null,
},
//
rules: {
reason: [{ required: true, message: "请输入", trigger: "blur" }],
recordId: [
{ required: true, message: "借阅档案不能为空", trigger: "blur" },
],
},
userList: [],
index: 0,
wayOptions: [], //
mediaOptions: [], //
filesNumOptions: [], //
};
},
computed: {
disabled() {
return !["add", "edit"].includes(this.$route.query.flag);
},
title() {
return this.$route.query.title;
},
},
created() {
if (this.$route.query.id) {
this.handleInitForm(this.$route.query.id);
}
this.getFiles();
this.handleInitList();
},
methods: {
//
getFiles() {
getRecordList({ ids: "", fileNum: "" }).then((res) => {
this.filesNumOptions = res.data;
});
},
handleSetApprovalId(id) {
this.accessId = id;
},
handleBtTottom(val) {
if (val === 0 || val === 1) {
this.submitForm(val);
} else if (val == 2) {
this.showPrintPage = true;
} else {
this.showFlow = true;
}
},
handleTasks(tasks) {
this.tasks = tasks;
},
PrintRow: debounce(function () {
//
this.$print(this.$refs.print);
}, 200),
handlePrint() {
this.showPrintPage = true;
},
//
handleInitList() {
//
listData({
pageNo: 1,
pageSize: 100,
dictType: "way_type",
}).then((res) => {
this.wayOptions = res.data.list || [];
});
//
listData({
pageNo: 1,
pageSize: 100,
dictType: "media_type",
}).then((res) => {
this.mediaOptions = res.data.list || [];
});
},
//
handleInitForm(id) {
this.processInstanceLoading = true;
getBorrowApply(id).then((response) => {
this.form = response.data || {};
this.$nextTick(() => {
this.form.processInstanceId &&
this.$refs.FlowDialog.getDetail(this.form.processInstanceId);
});
this.isAuthorised = this.form.isAuthorised;
});
},
submitForm(type) {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
// /
let newForm = {
...this.form,
status: type,
};
createBorrowApply(newForm).then((response) => {
this.$modal.msgSuccess(`${this.form.id ? "修改成功!" : "新增成功!"}`);
history.back();
});
});
},
cancel() {
this.$emit("onCancel");
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/form/index.scss";
.my-process-designer {
background: #fff !important;
}
.formItemFullWidth {
width: 100% !important;
}
</style>

@ -0,0 +1,150 @@
<template>
<div
style="page-break-after: always; padding: 0px 20px; box-sizing: border-box"
class="print-html-wrap"
id="printDiv"
>
<div class="print-title">{{ dialogTitle }}</div>
<table border="1px" class="table-write">
<tr>
<td class="keep">借阅申请编码</td>
<td class="tx-lf">{{ infoForm.borrowCode }}</td>
</tr>
<tr>
<td class="keep">申请人</td>
<td class="tx-lf">{{ $store.getters.userInfo.nickname }}</td>
<td class="keep">申请部门</td>
<td class="tx-lf max200">{{ $store.getters.userInfo.dept.name }}</td>
</tr>
<tr>
<td class="keep">预计归还日期</td>
<td class="tx-lf">{{ infoForm.returnTime }}</td>
<td class="keep">借阅方式</td>
<td class="tx-lf">{{ infoForm.way }}</td>
</tr>
<tr>
<td class="keep">档案介质</td>
<td class="tx-lf">{{ infoForm.media }}</td>
<td class="keep">借阅档案</td>
<td class="tx-lf">{{ infoForm.recordId }}</td>
</tr>
<tr>
<td class="keep">申请事由</td>
<td class="tx-lf" colspan="5">{{ infoForm.reason }}</td>
</tr>
<tr>
<td class="keep">申请人信息</td>
<td>
姓名{{ (tasks.startUserObj && tasks.startUserObj.nickname) || "-" }}
</td>
<td>
所属部门{{
(tasks.startUserObj && tasks.startUserObj.deptName) || "-"
}}
</td>
<td>
创建时间{{
(tasks.startUserObj && tasks.startUserObj.createTime) || "-"
}}
</td>
</tr>
<tr>
<td class="keep">审批流程</td>
<td colspan="5">
<table class="bottom-table-write">
<tr>
<td>审批人员</td>
<td>所属部门</td>
<td>审批意见</td>
<td>审批状态</td>
<td>审批时间</td>
</tr>
<tr v-for="(item, index) in tasks.tasks" :key="index">
<td>
{{ (item.assigneeUser && item.assigneeUser.nickname) || "-" }}
</td>
<td>
{{ (item.assigneeUser && item.assigneeUser.deptName) || "-" }}
</td>
<td>{{ item.reason || "-" }}</td>
<td>{{ item.result || "-" }}</td>
<td>{{ item.endTime || "-" }}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</template>
<script>
import dayjs from "dayjs";
import { findAreaIdName } from "@/utils";
export default {
props: {
userList: Array,
tripTypeList: Array,
infoForm: {
type: Object,
},
dialogTitle: {
type: String,
},
tasks: Object,
},
computed: {
cn() {
return window.localStorage.getItem("cn");
},
},
methods: {
dayjs,
handleFilterStr(val) {
const { label } = this.tripTypeList.find((item) => item.id == val) || {};
return label;
},
handleTripPartners(list) {
let nameArr = this.userList.map((item) => {
// item.id
if (Array.isArray(list)) {
if (list.includes(item.id)) {
return item.username;
} else {
return "";
}
}
});
return nameArr.filter((item) => item !== "").join("、");
},
handleFindTitle(val) {
return (findAreaIdName(this.$store.getters.areaTree, val) || {}).name;
// return (findAreaIdName(this.$store.getters.areaTree, val) || {}).name
},
},
data() {
return {
// defaultImg: require('@/assets/Images/defaultHeader.png')
};
},
filters: {},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/index.scss";
</style>
<style media="print" scoped>
/*去除页眉页脚*/
@page {
size: auto; /* auto is the initial value */
margin: 3mm; /* this affects the margin in the printer settings */
}
html {
background-color: #ffffff;
margin: 0; /* this affects the margin on the html before sending to printer */
}
body {
border: solid 1px blue;
margin: 10mm 15mm 10mm 15mm; /* margin you want for the content */
}
/*去除页眉页脚*/
</style>

@ -53,7 +53,7 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['archives:borrowAapply:create']" v-hasPermi="['archives:borrowAapply:create']"
>新增</el-button >创建申请单</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -81,9 +81,8 @@
align="center" align="center"
prop="borrowCode" prop="borrowCode"
/> />
<el-table-column label="借阅人名称" align="center" prop="userName" /> <el-table-column label="借阅人" align="center" prop="userName" />
<el-table-column label="借阅部门名称" align="center" prop="deptName" /> <el-table-column label="借阅部门" align="center" prop="deptName" />
<el-table-column label="借阅事由" align="center" prop="reason" />
<el-table-column <el-table-column
label="预计归还日期" label="预计归还日期"
align="center" align="center"
@ -107,7 +106,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="借阅描述" align="center" prop="describes" /> <el-table-column label="借阅事由" align="center" prop="reason" />
<el-table-column <el-table-column
label="创建日期" label="创建日期"
align="center" align="center"
@ -118,42 +117,46 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="申请状态" align="center" prop="status">
<template v-slot="scope">
<dict-tag
:type="DICT_TYPE.BS_EXPENSE_APPLY_STATUS"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
width="200"
fixed="right" fixed="right"
> >
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-check" icon="el-icon-edit"
@click="handlePass(scope.row)" v-if="scope.row.borrowState == null"
v-hasPermi="['archives:borrowAapply:update']" :disabled="scope.row.status != 0"
>通过</el-button @click="handleUpdate(scope.row)"
>
<el-button
size="mini"
type="text"
icon="el-icon-close"
@click="handleUnpass(scope.row)"
v-hasPermi="['archives:borrowAapply:update']" v-hasPermi="['archives:borrowAapply:update']"
>驳回</el-button >修改</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-view"
v-if="scope.row.borrowState == null" v-if="scope.row.borrowState == null"
@click="handleUpdate(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['archives:borrowAapply:update']" v-hasPermi="['archives:borrowAapply:update']"
>修改</el-button >查看</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
:disabled="scope.row.status != 0"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['archives:borrowAapply:delete']" v-hasPermi="['archives:borrowAapply:delete']"
>删除</el-button >删除</el-button
@ -170,167 +173,20 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
<!-- 对话框(添加 / 修改) -->
<el-dialog
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-row>
<el-col :span="8">
<el-form-item label="借阅申请编码" prop="borrowCode">
<el-input
v-model="form.borrowCode"
placeholder="请输入借阅申请编码"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="借阅人" prop="userName">
<el-input
v-model="form.userName"
placeholder="请选择借阅人"
readonly
>
<el-button
slot="append"
@click="handleSelectUser"
icon="el-icon-search"
style="
border-color: #46a6ff;
background-color: #46a6ff;
color: white;
"
></el-button>
</el-input>
<UserSelect ref="UserSelect" @onSelected="onUserSelected" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="借阅部门名称" prop="deptName">
<el-input
v-model="form.deptName"
placeholder="请输入借阅部门名称"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="借阅事由" prop="reason">
<el-input
v-model="form.reason"
placeholder="请输入借阅事由"
/> </el-form-item
></el-col>
<el-col :span="8">
<el-form-item label="预计归还日期" prop="returnTime">
<el-date-picker
clearable
v-model="form.returnTime"
type="date"
value-format="timestamp"
placeholder="选择预计归还日期"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="借阅方式" prop="way">
<el-select v-model="form.way" placeholder="请选择借阅方式">
<el-option
v-for="item in wayOptions"
:key="item.id"
:value="item.value"
:label="item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="档案介质" prop="media">
<el-select v-model="form.media" placeholder="请选择档案介质">
<el-option
v-for="item in mediaOptions"
:key="item.id"
:value="item.value"
:label="item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="借阅档案案卷号" prop="recordId">
<el-select v-model="form.recordId" placeholder="请选择借阅档案">
<el-option
v-for="item in filesNumOptions"
:key="item.id"
:value="item.id"
:label="item.filesNum"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if="optType == 'edit'">
<el-form-item label="档案类型" prop="recordId">
<el-select v-model="form.fileType" placeholder="" clearable>
<el-option
v-for="item in fileTypeOptions"
:key="item.id"
:value="item.value"
:label="item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="optType == 'edit'">
<el-form-item label="位置" prop="site">
<el-input v-model="form.site" placeholder="" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="借阅描述" prop="describes">
<el-input v-model="form.describes" placeholder="请输入借阅描述" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
createBorrowApply,
updateBorrowApply,
deleteBorrowApply, deleteBorrowApply,
getBorrowApply,
getBorrowApplyPage, getBorrowApplyPage,
exportBorrowApplyExcel, exportBorrowApplyExcel,
} from "@/api/borrow/apply"; } from "@/api/borrow/apply";
import { listData } from "@/api/system/dict/data"; import { listData } from "@/api/system/dict/data";
import { getRecordPage } from "@/api/archives/record";
import UserSelect from "@/components/UserSelect/single.vue";
export default { export default {
name: "BorrowApply", name: "BorrowApply",
components: { UserSelect }, components: {},
data() { data() {
return { return {
// //
@ -373,17 +229,11 @@ export default {
form: {}, form: {},
// //
rules: {}, rules: {},
borrowStateOptions: [],
wayOptions: [],
mediaOptions: [],
filesNumOptions: [], //
fileTypeOptions: [], //
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.handleInitList(); this.handleInitList();
this.getFilesNum();
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
@ -396,12 +246,6 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
//
getFilesNum() {
getRecordPage().then((response) => {
this.filesNumOptions = response.data.list;
});
},
// //
handleInitList() { handleInitList() {
// //
@ -412,56 +256,10 @@ export default {
}).then((res) => { }).then((res) => {
this.borrowStateOptions = res.data.list || []; this.borrowStateOptions = res.data.list || [];
}); });
//
listData({
pageNo: 1,
pageSize: 100,
dictType: "way_type",
}).then((res) => {
this.wayOptions = res.data.list || [];
});
//
listData({
pageNo: 1,
pageSize: 100,
dictType: "media_type",
}).then((res) => {
this.mediaOptions = res.data.list || [];
});
//
listData({
pageNo: 1,
pageSize: 100,
dictType: "archives_file_type",
}).then((res) => {
this.fileTypeOptions = res.data.list || [];
});
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
borrowCode: undefined,
borrowState: undefined,
reason: undefined,
describes: undefined,
userId: undefined,
userName: undefined,
deptId: undefined,
deptName: undefined,
returnTime: undefined,
way: undefined,
media: undefined,
companyId: undefined,
company: undefined,
remark: undefined,
};
this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
@ -475,59 +273,38 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.$router.push({
this.optType = "add"; path: "/borrow/apply/in",
this.open = true; query: {
this.title = "添加档案借阅申请"; id: null,
flag: "add",
title: "借阅申请单添加",
typeStr: "in",
},
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.$router.push({
this.optType = "edit"; path: "/borrow/apply/in",
const id = row.id; query: {
getBorrowApply(id).then((response) => { id: row.id,
this.form = response.data; flag: "edit",
this.open = true; title: "借阅申请单修改",
this.title = "修改档案借阅申请"; typeStr: "in",
}); },
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateBorrowApply(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createBorrowApply(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}); });
}, },
// /** 查看按钮操作 */
handlePass(row) { handleView(row) {
const data = { id: row.id, borrowState: "0" }; this.$router.push({
updateBorrowApply(data).then((response) => { path: "/borrow/apply/in",
this.getList(); query: {
this.$modal.msgSuccess("已通过"); id: row.id,
}); flag: "show",
}, title: "借阅申请单查看",
// typeStr: "in",
handleUnpass(row) { },
const data = { id: row.id, borrowState: "1" };
updateBorrowApply(data).then((response) => {
this.getList();
this.$modal.msgError("已驳回");
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -562,17 +339,6 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//
handleSelectUser() {
this.$refs.UserSelect.showFlag = true;
},
//
onUserSelected(obj) {
console.log(obj);
if (obj != undefined && obj != null) {
this.form.userName = obj.username;
}
},
}, },
}; };
</script> </script>

@ -1,13 +1,17 @@
<template> <template>
<div class="app-container form-box" style="padding:20px"> <div class="app-container form-box" style="padding: 20px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card class="top15 "> <el-card class="top15">
<div class="table-card"> <div class="table-card">
<el-row type="flex" justify="space-around"> <el-row type="flex" justify="space-around">
<el-col :span="8"></el-col> <el-col :span="8"></el-col>
<el-col :span="8" class="formTitle"> {{title}}</el-col> <el-col :span="8" class="formTitle"> {{ title }}</el-col>
<el-col :span="8" style="text-align: right;padding-right: 20px;"> <el-col :span="8" style="text-align: right; padding-right: 20px">
<BottomBtn :accessId="accessId" :isAuthorised="isAuthorised" @onConfirm="handleBtTottom" /> <BottomBtn
:accessId="accessId"
:isAuthorised="isAuthorised"
@onConfirm="handleBtTottom"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -15,7 +19,12 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="单号" prop="applyNo" v-if="$route.query.id"> <el-form-item label="单号" prop="applyNo" v-if="$route.query.id">
<el-input size="small" v-model="form.applyNo" disabled placeholder="请输入" /> <el-input
size="small"
v-model="form.applyNo"
disabled
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -27,7 +36,12 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input size="small" :disabled="disabled" v-model="form.projectName" placeholder="请输入" /> <el-input
size="small"
:disabled="disabled"
v-model="form.projectName"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -45,8 +59,21 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="预计费用" prop="amount" v-if="$route.query.typeStr === 'daily'" :rules="[{ message: '请输入正整数', required: false, trigger: 'blur'},{ validator: VerifyFunc.newNumber }]"> <el-form-item
<el-input size="small" v-model="form.amount" :disabled="disabled" placeholder="请输入"> label="预计费用"
prop="amount"
v-if="$route.query.typeStr === 'daily'"
:rules="[
{ message: '请输入正整数', required: false, trigger: 'blur' },
{ validator: VerifyFunc.newNumber },
]"
>
<el-input
size="small"
v-model="form.amount"
:disabled="disabled"
placeholder="请输入"
>
<span slot="suffix"></span> <span slot="suffix"></span>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -55,12 +82,26 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="申请事由" prop="reason"> <el-form-item label="申请事由" prop="reason">
<el-input type="textarea" :disabled="disabled" size="small" :rows="5" v-model="form.reason" placeholder="请输入" /> <el-input
type="textarea"
:disabled="disabled"
size="small"
:rows="5"
v-model="form.reason"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注信息" prop="remark"> <el-form-item label="备注信息" prop="remark">
<el-input type="textarea" :disabled="disabled" size="small" :rows="5" v-model="form.remark" placeholder="请输入" /> <el-input
type="textarea"
:disabled="disabled"
size="small"
:rows="5"
v-model="form.remark"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -75,60 +116,205 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="行程信息"> <el-form-item label="行程信息">
<div class="rode-box"> <div class="rode-box">
<div class="item-box" v-for="(item,index) in form.expenseApplyTrips" :key="index"> <div
class="item-box"
v-for="(item, index) in form.expenseApplyTrips"
:key="index"
>
<div class="box-tt"> <div class="box-tt">
<span>行程{{index + 1}} <span
>行程{{ index + 1 }}
<span v-if="item.tripPartners.length"> <span v-if="item.tripPartners.length">
<el-button icon="el-icon-user" type="text" :disabled="disabled" @click="handleShowFw(item.tripPartners,index)">{{item.tripPartners.length}}</el-button> <el-button
icon="el-icon-user"
type="text"
:disabled="disabled"
@click="handleShowFw(item.tripPartners, index)"
>查看{{
item.tripPartners.length
}}位同行人</el-button
>
</span> </span>
</span> </span>
<span class="delicon" v-if="form.expenseApplyTrips.length >1" @click="handleDelRode(index)"><i class="el-icon-delete"></i></span> <span
class="delicon"
v-if="form.expenseApplyTrips.length > 1"
@click="handleDelRode(index)"
><i class="el-icon-delete"></i
></span>
</div> </div>
<div class="box-content"> <div class="box-content">
<el-row class="rw-bt"> <el-row class="rw-bt">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="行程时间" :prop="`expenseApplyTrips.${index}.time`" :rules="[{ message: '请选择', required: true, trigger: 'change'}]"> <el-form-item
<el-date-picker class="wd100" :disabled="disabled" v-model="item.time" size="small" @change="handleTimeChange($event,index)" type="daterange" align="right" start-placeholder="开始日期" end-placeholder="结束日期"> label="行程时间"
:prop="`expenseApplyTrips.${index}.time`"
:rules="[
{
message: '请选择',
required: true,
trigger: 'change',
},
]"
>
<el-date-picker
class="wd100"
:disabled="disabled"
v-model="item.time"
size="small"
@change="handleTimeChange($event, index)"
type="daterange"
align="right"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="出差天数" :prop="`expenseApplyTrips.${index}.tripDay`" :rules="[{ message: '请输入', required: true, trigger: 'blur'},{ validator: VerifyFunc.newNumber }]"> <el-form-item
<el-input-number class="wd100" :disabled="disabled" :controls="false" size="small" v-model="item.tripDay" placeholder="请输入" /> label="出差天数"
:prop="`expenseApplyTrips.${index}.tripDay`"
:rules="[
{
message: '请输入',
required: true,
trigger: 'blur',
},
{ validator: VerifyFunc.newNumber },
]"
>
<el-input-number
class="wd100"
:disabled="disabled"
:controls="false"
size="small"
v-model="item.tripDay"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="出差类型" :prop="`expenseApplyTrips.${index}.tripType`" :rules="[{ message: '请选择', required: true, trigger: 'change'}]"> <el-form-item
<el-select v-model="item.tripType" :disabled="disabled" class="wd100" size="small" placeholder="请选择" filterable> label="出差类型"
<el-option v-for="it of tripTypeList" :key="it.id" :value="it.value" :label="it.label"></el-option> :prop="`expenseApplyTrips.${index}.tripType`"
:rules="[
{
message: '请选择',
required: true,
trigger: 'change',
},
]"
>
<el-select
v-model="item.tripType"
:disabled="disabled"
class="wd100"
size="small"
placeholder="请选择"
filterable
>
<el-option
v-for="it of tripTypeList"
:key="it.id"
:value="it.value"
:label="it.label"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="rw-bt"> <el-row class="rw-bt">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="出发地" :prop="`expenseApplyTrips.${index}.departureLocation`" :rules="[{ message: '请选择', required: true, trigger: 'change'}]"> <el-form-item
<el-cascader size="small" :disabled="disabled" filterable clearable :props="defaultProps" class="wd100" v-model="item.departureLocation" :options="$store.getters.areaTree"></el-cascader> label="出发地"
:prop="`expenseApplyTrips.${index}.departureLocation`"
:rules="[
{
message: '请选择',
required: true,
trigger: 'change',
},
]"
>
<el-cascader
size="small"
:disabled="disabled"
filterable
clearable
:props="defaultProps"
class="wd100"
v-model="item.departureLocation"
:options="$store.getters.areaTree"
></el-cascader>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="目的地" :prop="`expenseApplyTrips.${index}.destinationLocation`" :rules="[{ message: '请选择', required: true, trigger: 'change'}]"> <el-form-item
<el-cascader size="small" :disabled="disabled" filterable clearable :props="defaultProps" class="wd100" v-model="item.destinationLocation" :options="$store.getters.areaTree"></el-cascader> label="目的地"
:prop="`expenseApplyTrips.${index}.destinationLocation`"
:rules="[
{
message: '请选择',
required: true,
trigger: 'change',
},
]"
>
<el-cascader
size="small"
:disabled="disabled"
filterable
clearable
:props="defaultProps"
class="wd100"
v-model="item.destinationLocation"
:options="$store.getters.areaTree"
></el-cascader>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="rw-bt"> <el-row class="rw-bt">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="行程时间" class="op0"> <el-form-item label="行程时间" class="op0">
<el-button icon="el-icon-plus" :disabled="disabled" @click="handleAddFw(index)" size="small" plain type="primary"> 添加同行人</el-button> <el-button
icon="el-icon-plus"
:disabled="disabled"
@click="handleAddFw(index)"
size="small"
plain
type="primary"
>
添加同行人</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<div class="account-box"> <div class="account-box">
<el-form-item :prop="`expenseApplyTrips.${index}.amount`" :rules="[{ message: '请输入正整数', required: false, trigger: 'blur'},{ validator: VerifyFunc.newNumber }]"> <el-form-item
<span style="margin-right:10px">行程{{index+1}}预计费用</span> <span><el-input-number v-model="item.amount" :disabled="disabled" style="width:100px" :controls="false"></el-input-number></span> :prop="`expenseApplyTrips.${index}.amount`"
:rules="[
{
message: '请输入正整数',
required: false,
trigger: 'blur',
},
{ validator: VerifyFunc.newNumber },
]"
>
<span style="margin-right: 10px"
>行程{{ index + 1 }}预计费用</span
>
<span
><el-input-number
v-model="item.amount"
:disabled="disabled"
style="width: 100px"
:controls="false"
></el-input-number
></span>
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
@ -137,7 +323,8 @@
</div> </div>
</div> </div>
<div class="btn-box" @click="handleAddRode" v-if="!disabled"> <div class="btn-box" @click="handleAddRode" v-if="!disabled">
<i class="el-icon-plus" style="color:#1890ff"></i> <span style="color:#1890ff">添加行程信息</span> <i class="el-icon-plus" style="color: #1890ff"></i>
<span style="color: #1890ff">添加行程信息</span>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -145,53 +332,91 @@
</div> </div>
</el-card> </el-card>
</el-form> </el-form>
<el-image-viewer v-if="dialogVisible" :zIndex="9999" :on-close="closeImgViewer" :url-list="imgList" /> <el-image-viewer
v-if="dialogVisible"
:zIndex="9999"
:on-close="closeImgViewer"
:url-list="imgList"
/>
<!-- 添加同行人 --> <!-- 添加同行人 -->
<Together :isOpen="tgIsOpen" :selectUserIds="selectUserIds" @onCancel="handleTgCl" @onConfirm="handleTgCm" @onList="handleInit" /> <Together
:isOpen="tgIsOpen"
:selectUserIds="selectUserIds"
@onCancel="handleTgCl"
@onConfirm="handleTgCm"
@onList="handleInit"
/>
<!-- 展示同行人列表 --> <!-- 展示同行人列表 -->
<List :isOpen="lsIsOpen" :userList="userList" :selectIds="selectIds" @onCancel="handleLsCl" @onConfirm="handleLsCm" /> <List
:isOpen="lsIsOpen"
:userList="userList"
:selectIds="selectIds"
@onCancel="handleLsCl"
@onConfirm="handleLsCm"
/>
<!-- 打印信息 --> <!-- 打印信息 -->
<el-dialog :visible.sync="showPrintPage" width='1200px' custom-class="print-dialog" style="height: 98vh;overflow-y: auto;"> <el-dialog
<div style="text-align: right;margin-bottom:10px;"> :visible.sync="showPrintPage"
<el-button @click="PrintRow" type='primary' size='mini' plain>确认打印</el-button> width="1200px"
custom-class="print-dialog"
style="height: 98vh; overflow-y: auto"
>
<div style="text-align: right; margin-bottom: 10px">
<el-button @click="PrintRow" type="primary" size="mini" plain
>确认打印</el-button
>
</div> </div>
<div id="printMe" ref="print" class="print-main"> <div id="printMe" ref="print" class="print-main">
<print-html :infoForm='form' :dialogTitle="`${this.$route.query.typeStr==='daily' ? '日常申请单' : '出差申请单'}`" :tasks="tasks" :tripTypeList="tripTypeList" :userList="userList" /> <print-html
:infoForm="form"
:dialogTitle="`${
this.$route.query.typeStr === 'daily' ? '日常申请单' : '出差申请单'
}`"
:tasks="tasks"
:tripTypeList="tripTypeList"
:userList="userList"
/>
</div> </div>
</el-dialog> </el-dialog>
<!-- 审批流程信息 --> <!-- 审批流程信息 -->
<FlowDialog ref="FlowDialog" :isOpen="showFlow" @onCancel="showFlow = false" @onSetId="handleSetApprovalId" @onTasks="handleTasks" :processInstanceId="form.processInstanceId" /> <FlowDialog
ref="FlowDialog"
:isOpen="showFlow"
@onCancel="showFlow = false"
@onSetId="handleSetApprovalId"
@onTasks="handleTasks"
:processInstanceId="form.processInstanceId"
/>
</div> </div>
</template> </template>
<script> <script>
import { debounce } from 'lodash' import { debounce } from "lodash";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { listData } from "@/api/system/dict/data"; import { listData } from "@/api/system/dict/data";
import { createExpenseApply, getExpenseApply } from "@/api/bs/expenseApply"; import { createExpenseApply, getExpenseApply } from "@/api/bs/expenseApply";
import VerifyFunc from "@/utils/verity"; import VerifyFunc from "@/utils/verity";
import isBetween from 'dayjs/plugin/isBetween'; import isBetween from "dayjs/plugin/isBetween";
dayjs.extend(isBetween) dayjs.extend(isBetween);
export default { export default {
name: 'supplierTb', name: "supplierTb",
components: { components: {
printHtml: () => import('./printHtml'), printHtml: () => import("./printHtml"),
FilePreview: () => import('@/components/FilePreview'), FilePreview: () => import("@/components/FilePreview"),
CommonName: () => import('@/components/CommonName'), CommonName: () => import("@/components/CommonName"),
FlowDialog: () => import('@/components/FlowDialog'), FlowDialog: () => import("@/components/FlowDialog"),
BottomBtn: () => import('@/components/BottomBtn'), BottomBtn: () => import("@/components/BottomBtn"),
UploadFile: () => import('@/components/UploadFile'), UploadFile: () => import("@/components/UploadFile"),
Together: () => import('../../../components/Together'), Together: () => import("../../../components/Together"),
List: () => import('../../../components/TogetherList'), List: () => import("../../../components/TogetherList"),
// printHtml: () => import('./printHtml'), // printHtml: () => import('./printHtml'),
}, },
created() { created() {
if (this.$route.query.id) { if (this.$route.query.id) {
this.handleInitForm(this.$route.query.id) this.handleInitForm(this.$route.query.id);
} }
this.handleInitList() this.handleInitList();
}, },
watch: { watch: {
fileList: { fileList: {
@ -199,23 +424,21 @@ export default {
deep: true, deep: true,
handler(val) { handler(val) {
if (val.length >= 1) { if (val.length >= 1) {
this.hideUpload = true this.hideUpload = true;
} else { } else {
this.hideUpload = false this.hideUpload = false;
} }
} },
} },
}, },
computed: { computed: {
disabled() { disabled() {
return !['add', 'edit'].includes(this.$route.query.flag) return !["add", "edit"].includes(this.$route.query.flag);
}, },
title() { title() {
return this.$route.query.title return this.$route.query.title;
},
isShow() {
}, },
isShow() {},
}, },
data() { data() {
return { return {
@ -229,8 +452,8 @@ export default {
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "name", label: "name",
value: 'id', value: "id",
checkStrictly: false checkStrictly: false,
}, },
areaTree: [], areaTree: [],
previewFile: false, previewFile: false,
@ -243,7 +466,7 @@ export default {
tripTypeList: [], tripTypeList: [],
pdfName: null, pdfName: null,
isPdf: false, isPdf: false,
imgType: '.jpeg, .jpg, .png, .pdf', imgType: ".jpeg, .jpg, .png, .pdf",
fileList: [], fileList: [],
hideUpload: false, hideUpload: false,
imgList: [], //src imgList: [], //src
@ -265,49 +488,50 @@ export default {
tripDay: undefined, tripDay: undefined,
tripType: null, tripType: null,
tripPartners: [], // tripPartners: [], //
amount: undefined amount: undefined,
} },
] ],
}, },
// //
rules: { rules: {
reason: [{ required: true, message: "请输入", trigger: "blur" }], reason: [{ required: true, message: "请输入", trigger: "blur" }],
}, },
userList: [], userList: [],
index: 0 index: 0,
} };
}, },
methods: { methods: {
handleSetApprovalId(id) { handleSetApprovalId(id) {
this.accessId = id this.accessId = id;
}, },
handleUpload(list) { handleUpload(list) {
this.fileList = list this.fileList = list;
}, },
handleBtTottom(val) { handleBtTottom(val) {
if (val === 0 || val === 1) { if (val === 0 || val === 1) {
this.submitForm(val) this.submitForm(val);
} else if (val == 2) { } else if (val == 2) {
this.showPrintPage = true this.showPrintPage = true;
} else { } else {
this.showFlow = true this.showFlow = true;
} }
}, },
handleTasks(tasks) { handleTasks(tasks) {
this.tasks = tasks this.tasks = tasks;
}, },
PrintRow: debounce(function () { // PrintRow: debounce(function () {
this.$print(this.$refs.print) //
this.$print(this.$refs.print);
}, 200), }, 200),
handlePrint() { handlePrint() {
this.showPrintPage = true this.showPrintPage = true;
}, },
handleLoop(array) { handleLoop(array) {
array.forEach(el => { array.forEach((el) => {
if (el.children && !el.children.length) { if (el.children && !el.children.length) {
delete el.children delete el.children;
} else { } else {
this.handleLoop(el.children) this.handleLoop(el.children);
} }
}); });
}, },
@ -315,13 +539,13 @@ export default {
listData({ listData({
pageNo: 1, pageNo: 1,
pageSize: 50, pageSize: 50,
dictType: 'bs_trip_type', dictType: "bs_trip_type",
}).then((res) => { }).then((res) => {
this.tripTypeList = res.data.list || [] this.tripTypeList = res.data.list || [];
}) });
}, },
handleTimeChange(val, index) { handleTimeChange(val, index) {
let trips = this.form.expenseApplyTrips let trips = this.form.expenseApplyTrips;
if (trips.length && val && val.length) { if (trips.length && val && val.length) {
// //
let start1 = dayjs(val[0]); let start1 = dayjs(val[0]);
@ -331,73 +555,80 @@ export default {
let start2 = dayjs(trips[i].time[0]); let start2 = dayjs(trips[i].time[0]);
let end2 = dayjs(trips[i].time[1]); let end2 = dayjs(trips[i].time[1]);
let range2 = { start: start2, end: end2 }; let range2 = { start: start2, end: end2 };
if (index !== i && range1.start.isBefore(range2.end) && range2.start.isBefore(range1.end) if (
index !== i &&
range1.start.isBefore(range2.end) &&
range2.start.isBefore(range1.end)
) { ) {
this.$set(this.form.expenseApplyTrips[index], 'time', null) this.$set(this.form.expenseApplyTrips[index], "time", null);
return this.$modal.msgWarning(`行程时间范围与行程${i + 1}时间范围冲突!`) return this.$modal.msgWarning(
`行程时间范围与行程${i + 1}时间范围冲突!`
);
} }
} }
} }
let startTime = val && val.length && dayjs(val[0]).format('YYYY/MM/DD 00:00:00') let startTime =
let endTime = val && val.length && dayjs(val[1]).format('YYYY/MM/DD 23:59:59') val && val.length && dayjs(val[0]).format("YYYY/MM/DD 00:00:00");
this.$set(this.form.expenseApplyTrips[index], 'startTime', startTime) let endTime =
this.$set(this.form.expenseApplyTrips[index], 'endTime', endTime) val && val.length && dayjs(val[1]).format("YYYY/MM/DD 23:59:59");
let day = list && list.length && Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1 this.$set(this.form.expenseApplyTrips[index], "startTime", startTime);
this.$set(this.form.expenseApplyTrips[index], 'tripDay', day) this.$set(this.form.expenseApplyTrips[index], "endTime", endTime);
let day =
list &&
list.length &&
Number(dayjs(list[1]).diff(dayjs(list[0]), "day")) + 1;
this.$set(this.form.expenseApplyTrips[index], "tripDay", day);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate([`expenseApplyTrips.${index}.tripDay`]) this.$refs.form.clearValidate([`expenseApplyTrips.${index}.tripDay`]);
}) });
}, },
downloadFile(obj) { downloadFile(obj) {
this.fileUrl = obj.url this.fileUrl = obj.url;
if (this.fileUrl.indexOf('png') || this.fileUrl.indexOf('jpg')) { if (this.fileUrl.indexOf("png") || this.fileUrl.indexOf("jpg")) {
// this.previewFile = true // this.previewFile = true
window.open(this.fileUrl); window.open(this.fileUrl);
} else { } else {
this.previewFile = true this.previewFile = true;
} }
}, },
handleOutSubmit() { handleOutSubmit() {},
},
handleLsCl() { handleLsCl() {
this.lsIsOpen = false this.lsIsOpen = false;
}, },
handleLsCm(list) { handleLsCm(list) {
this.$set(this.form.expenseApplyTrips[this.index], 'tripPartners', list) this.$set(this.form.expenseApplyTrips[this.index], "tripPartners", list);
this.lsIsOpen = false this.lsIsOpen = false;
}, },
handleShowFw(list, index) { handleShowFw(list, index) {
this.selectIds = list this.selectIds = list;
this.index = index this.index = index;
this.lsIsOpen = true this.lsIsOpen = true;
}, },
handleInit(list) { handleInit(list) {
this.userList = list this.userList = list;
}, },
handleTgCl() { handleTgCl() {
this.tgIsOpen = false this.tgIsOpen = false;
}, },
handleTgCm(list) { handleTgCm(list) {
let flag = (list.filter(item => this.selectUserIds.includes(item)) || []) let flag = list.filter((item) => this.selectUserIds.includes(item)) || [];
if (flag.length) { if (flag.length) {
const { username } = this.userList.find(item => item.id === flag[0]) const { username } = this.userList.find((item) => item.id === flag[0]);
this.$modal.msgError(`同行人${username}已经被添加,请勿重复添加!`); this.$modal.msgError(`同行人${username}已经被添加,请勿重复添加!`);
} else { } else {
list.forEach(v => { list.forEach((v) => {
this.form.expenseApplyTrips[this.index].tripPartners.push(v) this.form.expenseApplyTrips[this.index].tripPartners.push(v);
}) });
this.tgIsOpen = false this.tgIsOpen = false;
} }
}, },
handleAddFw(index) { handleAddFw(index) {
this.index = index this.index = index;
this.tgIsOpen = true this.tgIsOpen = true;
this.selectUserIds = this.form.expenseApplyTrips[index].tripPartners this.selectUserIds = this.form.expenseApplyTrips[index].tripPartners;
}, },
handleDelRode(index) { handleDelRode(index) {
this.form.expenseApplyTrips.splice(index, 1) this.form.expenseApplyTrips.splice(index, 1);
}, },
handleAddRode() { handleAddRode() {
this.form.expenseApplyTrips.push({ this.form.expenseApplyTrips.push({
@ -409,98 +640,107 @@ export default {
tripDay: undefined, tripDay: undefined,
tripType: null, tripType: null,
tripPartners: [], // tripPartners: [], //
amount: undefined amount: undefined,
}) });
}, },
// //
uploadFile(item) { uploadFile(item) {
//formdata; //formdata;
let FormDatas = new FormData() let FormDatas = new FormData();
FormDatas.append('file', item.file); FormDatas.append("file", item.file);
FormDatas.append('path', item.file.name); FormDatas.append("path", item.file.name);
uploadFileApi(FormDatas).then((res) => { uploadFileApi(FormDatas).then((res) => {
this.fileList.push({ name: item.file.name, url: res.data });// this.fileList.push({ name: item.file.name, url: res.data }); //
if (this.fileList.length > 0) {// if (this.fileList.length > 0) {
//
this.fileflag = false; this.fileflag = false;
} }
this.$modal.closeLoading() this.$modal.closeLoading();
}) });
}, },
// //
handleRemove() { handleRemove() {},
},
// //
handleClose(i) { handleClose(i) {
this.fileList.splice(i, 1);// this.fileList.splice(i, 1); //
if (this.fileList.length == 0) {// if (this.fileList.length == 0) {
this.fileflag = true;//url //
this.fileflag = true; //url
// this.$set(this.demoObj.url, 0, { required: true, validator: this.validatorUrl, trigger: 'blur' })// // this.$set(this.demoObj.url, 0, { required: true, validator: this.validatorUrl, trigger: 'blur' })//
} }
}, },
handleInitForm(id) { handleInitForm(id) {
this.processInstanceLoading = true this.processInstanceLoading = true;
getExpenseApply(id).then(response => { getExpenseApply(id).then((response) => {
this.form = response.data || {}; this.form = response.data || {};
if (this.$route.query.typeStr === 'business') { if (this.$route.query.typeStr === "business") {
this.form.expenseApplyTrips = this.form.expenseApplyTrips.map((item) => { this.form.expenseApplyTrips = this.form.expenseApplyTrips.map(
return { (item) => {
...item, return {
departureLocation: Number(item.departureLocation), ...item,
destinationLocation: Number(item.destinationLocation), departureLocation: Number(item.departureLocation),
amount: item.amount ? item.amount : undefined, destinationLocation: Number(item.destinationLocation),
time: [new Date(dayjs(item.startTime).format('YYYY/MM/DD')), new Date(dayjs(item.endTime).format('YYYY/MM/DD'))] amount: item.amount ? item.amount : undefined,
time: [
new Date(dayjs(item.startTime).format("YYYY/MM/DD")),
new Date(dayjs(item.endTime).format("YYYY/MM/DD")),
],
};
} }
}) );
} }
this.fileList = this.form.files || [] this.fileList = this.form.files || [];
this.$nextTick(() => { this.$nextTick(() => {
this.form.processInstanceId && this.$refs.FlowDialog.getDetail(this.form.processInstanceId) this.form.processInstanceId &&
}) this.$refs.FlowDialog.getDetail(this.form.processInstanceId);
this.isAuthorised = this.form.isAuthorised });
this.isAuthorised = this.form.isAuthorised;
}); });
}, },
submitForm(type) { submitForm(type) {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
// / // /
let newForm = { let newForm = {
...this.form, ...this.form,
billType: this.$route.query.typeStr == 'business' ? 'CLSQ' : 'RCSQ', billType: this.$route.query.typeStr == "business" ? "CLSQ" : "RCSQ",
status: type, status: type,
files: this.fileList, files: this.fileList,
expenseApplyTrips: (this.form.expenseApplyTrips || []).map( expenseApplyTrips: (this.form.expenseApplyTrips || []).map((item) => {
item => { return {
return { ...item,
...item, departureLocation: Array.isArray(item.departureLocation)
departureLocation: Array.isArray(item.departureLocation) ? item.departureLocation[item.departureLocation.length - 1] : item.departureLocation, ? item.departureLocation[item.departureLocation.length - 1]
destinationLocation: Array.isArray(item.destinationLocation) ? item.destinationLocation[item.destinationLocation.length - 1] : item.destinationLocation, : item.departureLocation,
startTime: dayjs(item.startTime).valueOf(), destinationLocation: Array.isArray(item.destinationLocation)
endTime: dayjs(item.endTime).valueOf() ? item.destinationLocation[item.destinationLocation.length - 1]
} : item.destinationLocation,
} startTime: dayjs(item.startTime).valueOf(),
) endTime: dayjs(item.endTime).valueOf(),
} };
if (this.$route.query.typeStr == 'daily') { }),
delete newForm.expenseApplyTrips };
if (this.$route.query.typeStr == "daily") {
delete newForm.expenseApplyTrips;
} }
createExpenseApply(newForm).then(response => { createExpenseApply(newForm).then((response) => {
this.$modal.msgSuccess(`${this.form.id ? '修改成功!' : '新增成功!'}`); this.$modal.msgSuccess(`${this.form.id ? "修改成功!" : "新增成功!"}`);
history.back() history.back();
}); });
}); });
}, },
cancel() { cancel() {
this.$emit('onCancel') this.$emit("onCancel");
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/assets/styles/form/index.scss'; @import "@/assets/styles/form/index.scss";
.my-process-designer { .my-process-designer {
background: #fff !important; background: #fff !important;
} }
</style> </style>

@ -2,25 +2,60 @@
<div class="app-container new-box"> <div class="app-container new-box">
<el-card> <el-card>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
>
<div class="filter-box"> <div class="filter-box">
<div class="filter-lf"> <div class="filter-lf">
<el-form-item label="申请类型" prop="billType"> <el-form-item label="申请类型" prop="billType">
<el-select v-model="queryParams.billType" placeholder="请选择申请类型" clearable size="small"> <el-select
<el-option v-for="dict in applyTypeList" :key="dict.value" :label="dict.label" :value="dict.value" /> v-model="queryParams.billType"
placeholder="请选择申请类型"
clearable
size="small"
>
<el-option
v-for="dict in applyTypeList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> <el-select
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BS_EXPENSE_APPLY_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" /> v-model="queryParams.status"
placeholder="请选择状态"
clearable
size="small"
>
<el-option
v-for="dict in this.getDictDatas(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS
)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="行程" prop="remark"> <el-form-item label="行程" prop="remark">
<AreaTree v-model="queryParams.remark" /> <AreaTree v-model="queryParams.remark" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> type="primary"
icon="el-icon-search"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
@ -28,8 +63,12 @@
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-dropdown trigger="click" v-hasPermi="['bs:expense-apply:create']" @command="handleCommand"> <el-dropdown
<el-button type="primary" size="mini" style="margin-right:5px;"> trigger="click"
v-hasPermi="['bs:expense-apply:create']"
@command="handleCommand"
>
<el-button type="primary" size="mini" style="margin-right: 5px">
<i class="el-icon-plus"></i> 创建申请单 <i class="el-icon-plus"></i> 创建申请单
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -39,14 +78,25 @@
<el-dropdown-item :command="beforeHandleCommand(2)"> <el-dropdown-item :command="beforeHandleCommand(2)">
<el-button type="text">日常申请单</el-button> <el-button type="text">日常申请单</el-button>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" v-hasPermi="['bs:expense-apply:export']"></el-button> <el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['bs:expense-apply:export']"
>导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
@ -56,50 +106,97 @@
<el-table-column label="申请人" align="center" prop="nickname" /> <el-table-column label="申请人" align="center" prop="nickname" />
<el-table-column label="申请类型" align="center" prop="billType"> <el-table-column label="申请类型" align="center" prop="billType">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.BS_BILL_TYPE" :value="scope.row.billType" /> <dict-tag
:type="DICT_TYPE.BS_BILL_TYPE"
:value="scope.row.billType"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="行程路线" align="center" prop="rode"> <el-table-column label="行程路线" align="center" prop="rode">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.rode || '-'}} {{ scope.row.rode || "-" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出差天数" align="center" prop="tripDay"> <el-table-column label="出差天数" align="center" prop="tripDay">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.tripDay? `${scope.row.tripDay}` : '-'}} {{ scope.row.tripDay ? `${scope.row.tripDay}` : "-" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="开始-结束时间" align="center" prop="time" /> <el-table-column label="开始-结束时间" align="center" prop="time" />
<el-table-column label="审批状态" align="center" prop="status"> <el-table-column label="审批状态" align="center" prop="status">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.BS_EXPENSE_APPLY_STATUS" :value="scope.row.status" /> <dict-tag
:type="DICT_TYPE.BS_EXPENSE_APPLY_STATUS"
:value="scope.row.status"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" :disabled="scope.row.status!=0" @click="handleUpdate(scope.row)" v-hasPermi="['bs:expense-apply:create']"></el-button> <el-button
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)" v-hasPermi="['bs:expense-apply:show']"></el-button> size="mini"
<el-button size="mini" type="text" icon="el-icon-delete" :disabled="scope.row.status!=0" @click="handleDelete(scope.row)" v-hasPermi="['bs:expense-apply:delete']"></el-button> type="text"
icon="el-icon-edit"
:disabled="scope.row.status != 0"
@click="handleUpdate(scope.row)"
v-hasPermi="['bs:expense-apply:create']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleShow(scope.row)"
v-hasPermi="['bs:expense-apply:show']"
>查看</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
:disabled="scope.row.status != 0"
@click="handleDelete(scope.row)"
v-hasPermi="['bs:expense-apply:delete']"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" @pagination="getList" /> <pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { updateExpenseApply, deleteExpenseApply, getExpenseApply, getExpenseApplyPage, exportExpenseApplyExcel } from "@/api/bs/expenseApply"; import {
import { findAreaIdName } from '@/utils'; updateExpenseApply,
import dayjs from 'dayjs'; deleteExpenseApply,
getExpenseApply,
getExpenseApplyPage,
exportExpenseApplyExcel,
} from "@/api/bs/expenseApply";
import { findAreaIdName } from "@/utils";
import dayjs from "dayjs";
export default { export default {
name: "ExpenseApply", name: "ExpenseApply",
components: { components: {
AreaTree: () => import('@/components/AreaTree') AreaTree: () => import("@/components/AreaTree"),
}, },
created() { created() {
this.applyTypeList = this.getDictDatas(this.DICT_TYPE.BS_BILL_TYPE).filter(item => !["CLBX", "RCBX"].includes(item.value)) this.applyTypeList = this.getDictDatas(this.DICT_TYPE.BS_BILL_TYPE).filter(
(item) => !["CLBX", "RCBX"].includes(item.value)
);
this.getList(); this.getList();
}, },
activated() { activated() {
@ -108,7 +205,7 @@ export default {
data() { data() {
return { return {
billType: '', billType: "",
applyTypeList: [], applyTypeList: [],
// //
loading: true, loading: true,
@ -146,74 +243,98 @@ export default {
}, },
methods: { methods: {
handleCommand(val) { handleCommand(val) {
const { index, row } = val const { index, row } = val;
// 1 2 3 // 1 2 3
if (index === 1) { if (index === 1) {
this.$router.push({ path: "/bs/expenseApply/business", query: { id: null, flag: 'add', title: '出差申请单添加', typeStr: 'business' } }); this.$router.push({
path: "/bs/expenseApply/business",
query: {
id: null,
flag: "add",
title: "出差申请单添加",
typeStr: "business",
},
});
} else { } else {
this.$router.push({ path: "/bs/expenseApply/business", query: { id: null, flag: 'add', title: '日常申请单添加', typeStr: 'daily' } }); this.$router.push({
path: "/bs/expenseApply/business",
query: {
id: null,
flag: "add",
title: "日常申请单添加",
typeStr: "daily",
},
});
} }
}, },
beforeHandleCommand(index, data) { beforeHandleCommand(index, data) {
return { return {
'index': index, index: index,
'row': data row: data,
} };
}, },
unique(arr) { unique(arr) {
let newArr = [arr[0]] let newArr = [arr[0]];
for (let i = 1; i < arr.length; i++) { for (let i = 1; i < arr.length; i++) {
if (arr[i] !== newArr[newArr.length - 1]) { if (arr[i] !== newArr[newArr.length - 1]) {
newArr.push(arr[i]);
newArr.push(arr[i])
} }
} }
return newArr return newArr;
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
console.log(this.queryParams) console.log(this.queryParams);
// //
getExpenseApplyPage(this.queryParams).then(response => { getExpenseApplyPage(this.queryParams).then((response) => {
this.list = response.data.list || []; this.list = response.data.list || [];
this.total = response.data.total this.total = response.data.total;
let areaList = this.$store.getters.areaTree let areaList = this.$store.getters.areaTree;
this.list = this.list.map((item) => { this.list = this.list.map((item) => {
return { return {
...item, ...item,
amount: (item.expenseApplyTrips || []).reduce((acc, cur) => { amount: (item.expenseApplyTrips || []).reduce((acc, cur) => {
return Number(acc) + Number(cur.amount) return Number(acc) + Number(cur.amount);
}, 0), }, 0),
tripDay: (item.expenseApplyTrips || []).reduce((acc, cur) => { tripDay: (item.expenseApplyTrips || []).reduce((acc, cur) => {
return Number(acc) + Number(cur.tripDay) return Number(acc) + Number(cur.tripDay);
}, 0), }, 0),
rodeArr: ((item.expenseApplyTrips || []).map(item => { rodeArr: (item.expenseApplyTrips || []).map((item) => {
return [(findAreaIdName(areaList, item.departureLocation) || {}).name, (findAreaIdName(areaList, item.destinationLocation) || {}).name] return [
})), (findAreaIdName(areaList, item.departureLocation) || {}).name,
time: Array.isArray(item.expenseApplyTrips) && item.expenseApplyTrips.length ? `${dayjs(item.expenseApplyTrips[0].startTime).format('YYYY/MM/DD')}~${dayjs(item.expenseApplyTrips[item.expenseApplyTrips.length - 1].endTime).format('YYYY/MM/DD')}` : '-' (findAreaIdName(areaList, item.destinationLocation) || {}).name,
} ];
}) }),
this.list.forEach(element => { time:
let arr = [] Array.isArray(item.expenseApplyTrips) &&
element.rodeArr.forEach(v => { item.expenseApplyTrips.length
v.forEach(n => { ? `${dayjs(item.expenseApplyTrips[0].startTime).format(
arr.push(n && n) "YYYY/MM/DD"
}) )}~${dayjs(
}) item.expenseApplyTrips[item.expenseApplyTrips.length - 1]
element.rodeArr = arr .endTime
).format("YYYY/MM/DD")}`
: "-",
};
});
this.list.forEach((element) => {
let arr = [];
element.rodeArr.forEach((v) => {
v.forEach((n) => {
arr.push(n && n);
});
});
element.rodeArr = arr;
}); });
// //
this.list.forEach(n => { this.list.forEach((n) => {
n.rode = this.unique(n.rodeArr).join('-') n.rode = this.unique(n.rodeArr).join("-");
}) });
this.billType = this.list.length ? this.list[0].billType : null this.billType = this.list.length ? this.list[0].billType : null;
this.loading = false; this.loading = false;
}); });
}, },
@ -255,25 +376,57 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
const { billType } = row const { billType } = row;
if (billType === 'CLSQ') { if (billType === "CLSQ") {
this.$router.push({ path: "/bs/expenseApply/business", query: { id: row.id, flag: 'edit', title: '出差申请单修改', typeStr: 'business' } }); this.$router.push({
} else if (billType === 'RCSQ') { path: "/bs/expenseApply/business",
this.$router.push({ path: "/bs/expenseApply/business", query: { id: row.id, flag: 'edit', title: '日常申请单修改', typeStr: 'daily' } }); query: {
id: row.id,
flag: "edit",
title: "出差申请单修改",
typeStr: "business",
},
});
} else if (billType === "RCSQ") {
this.$router.push({
path: "/bs/expenseApply/business",
query: {
id: row.id,
flag: "edit",
title: "日常申请单修改",
typeStr: "daily",
},
});
} }
}, },
// //
handleShow(row) { handleShow(row) {
const { billType } = row const { billType } = row;
if (billType === 'CLSQ') { if (billType === "CLSQ") {
this.$router.push({ path: "/bs/expenseApply/business", query: { id: row.id, flag: 'show', title: '出差申请单查看', typeStr: 'business' } }); this.$router.push({
} else if (billType === 'RCSQ') { path: "/bs/expenseApply/business",
this.$router.push({ path: "/bs/expenseApply/business", query: { id: row.id, flag: 'show', title: '日常申请单查看', typeStr: 'daily' } }); query: {
id: row.id,
flag: "show",
title: "出差申请单查看",
typeStr: "business",
},
});
} else if (billType === "RCSQ") {
this.$router.push({
path: "/bs/expenseApply/business",
query: {
id: row.id,
flag: "show",
title: "日常申请单查看",
typeStr: "daily",
},
});
} }
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm(type) { submitForm(type) {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
@ -282,8 +435,8 @@ export default {
let newForm = { let newForm = {
...this.form, ...this.form,
status: type, status: type,
} };
updateExpenseApply(newForm).then(response => { updateExpenseApply(newForm).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -291,7 +444,7 @@ export default {
return; return;
} }
// //
console.log('form', this.form); console.log("form", this.form);
// createExpenseApply(this.form).then(response => { // createExpenseApply(this.form).then(response => {
// this.$modal.msgSuccess(""); // this.$modal.msgSuccess("");
// }); // });
@ -300,12 +453,16 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal.confirm('是否确认删除申请单编号为"' + id + '"的数据项?').then(function () { this.$modal
return deleteExpenseApply(id); .confirm('是否确认删除申请单编号为"' + id + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return deleteExpenseApply(id);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => { }); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -313,19 +470,23 @@ export default {
let params = { ...this.queryParams }; let params = { ...this.queryParams };
params.pageNo = undefined; params.pageNo = undefined;
params.pageSize = undefined; params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有申请单数据项?').then(() => { this.$modal
this.exportLoading = true; .confirm("是否确认导出所有申请单数据项?")
return exportExpenseApplyExcel(params); .then(() => {
}).then(response => { this.exportLoading = true;
this.$download.excel(response, '申请单.xls'); return exportExpenseApplyExcel(params);
this.exportLoading = false; })
}).catch(() => { }); .then((response) => {
} this.$download.excel(response, "申请单.xls");
} this.exportLoading = false;
})
.catch(() => {});
},
},
}; };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
@import '@/assets/styles/header/index.scss'; @import "@/assets/styles/header/index.scss";
@import '@/assets/styles/common/index.scss'; @import "@/assets/styles/common/index.scss";
</style> </style>

@ -213,7 +213,11 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="类型名称" prop="typeName"> <el-form-item label="类型名称" prop="typeName">
<el-select v-model="form.typeName" placeholder="请选择档案类型" class="wd100"> <el-select
v-model="form.typeName"
placeholder="请选择档案类型"
class="wd100"
>
<el-option <el-option
v-for="item in fileTypeOptions" v-for="item in fileTypeOptions"
:key="item.id" :key="item.id"
@ -329,7 +333,18 @@ export default {
// //
form: {}, form: {},
// //
rules: {}, rules: {
categoryCode: [
{ required: true, message: "请输入编码", trigger: "blur" },
],
typeName: [{ required: true, message: "请输入类型", trigger: "blur" }],
catalogNumber: [
{ required: true, message: "请输入目录号", trigger: "blur" },
],
twoCatalogNumber: [
{ required: true, message: "请输入二级类别号", trigger: "blur" },
],
},
}; };
}, },
created() { created() {

Loading…
Cancel
Save