工作流

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
export function exportRecordExcel(query) {
return request({

@ -1,23 +1,92 @@
<!-- 按钮 -->
<template>
<div>
<el-button type="info" size="mini" v-if="isWin == 3" disabled style="margin-bottom:10px;"></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>
<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" />
<el-button
type="info"
size="mini"
v-if="isWin == 3"
disabled
style="margin-bottom: 10px"
>已流标</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
>
<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>
</template>
<script>
export default {
name: '',
name: "",
components: {
Toast: () => import('./components/Toast.vue')
Toast: () => import("./components/Toast.vue"),
},
props: {
isAuthorised: Boolean,
@ -26,30 +95,28 @@ export default {
isWin: [Number, String], // 3
saveTitle: {
type: String,
default: '保存'
}
default: "提交",
},
},
data() {
return {
isOpen: false,
key: null
}
key: null,
};
},
methods: {
handleConfirm(key) {
if (key == 4 || key == 5) {
this.key = key
this.isOpen = true
this.key = key;
this.isOpen = true;
} else {
this.$emit('onConfirm', key)
this.$emit("onConfirm", key);
}
},
handleBack() {
history.back()
history.back();
},
}
}
},
};
</script>
<style lang='scss' scoped>
</style>
<style lang="scss" scoped></style>

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

@ -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"
placeholder="请输入移交说明"
/>
</el-form-item> </el-col
>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="移交人" prop="outputName">
<el-input
@ -346,12 +346,20 @@
<el-row>
<el-col :span="8">
<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-col>
<el-col :span="8">
<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-col>
<el-col :span="8">
@ -525,6 +533,7 @@ export default {
//
handleNewSiteChanged(obj) {
if (obj != null) {
this.newSiteArray = obj;
this.form.toOrganizationId = obj[0];
this.form.toDepotId = obj[1];
this.form.toCabinetId = obj[2];
@ -695,5 +704,5 @@ export default {
<style lang="scss" scoped>
@import "@/assets/styles/header/index.scss";
@import "@/assets/styles/common/index.scss";
@import '@/assets/styles/edit/index.scss';
@import "@/assets/styles/edit/index.scss";
</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"
@click="handleAdd"
v-hasPermi="['archives:borrowAapply:create']"
>新增</el-button
>创建申请单</el-button
>
</el-col>
<el-col :span="1.5">
@ -81,9 +81,8 @@
align="center"
prop="borrowCode"
/>
<el-table-column label="借阅人名称" align="center" prop="userName" />
<el-table-column label="借阅部门名称" align="center" prop="deptName" />
<el-table-column label="借阅事由" align="center" prop="reason" />
<el-table-column label="借阅人" align="center" prop="userName" />
<el-table-column label="借阅部门" align="center" prop="deptName" />
<el-table-column
label="预计归还日期"
align="center"
@ -107,7 +106,7 @@
/>
</template>
</el-table-column>
<el-table-column label="借阅描述" align="center" prop="describes" />
<el-table-column label="借阅事由" align="center" prop="reason" />
<el-table-column
label="创建日期"
align="center"
@ -118,42 +117,46 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</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
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200"
fixed="right"
>
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-check"
@click="handlePass(scope.row)"
v-hasPermi="['archives:borrowAapply:update']"
>通过</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-close"
@click="handleUnpass(scope.row)"
icon="el-icon-edit"
v-if="scope.row.borrowState == null"
:disabled="scope.row.status != 0"
@click="handleUpdate(scope.row)"
v-hasPermi="['archives:borrowAapply:update']"
>驳回</el-button
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
icon="el-icon-view"
v-if="scope.row.borrowState == null"
@click="handleUpdate(scope.row)"
@click="handleView(scope.row)"
v-hasPermi="['archives:borrowAapply:update']"
>修改</el-button
>查看</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
:disabled="scope.row.status != 0"
@click="handleDelete(scope.row)"
v-hasPermi="['archives:borrowAapply:delete']"
>删除</el-button
@ -170,167 +173,20 @@
@pagination="getList"
/>
</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>
</template>
<script>
import {
createBorrowApply,
updateBorrowApply,
deleteBorrowApply,
getBorrowApply,
getBorrowApplyPage,
exportBorrowApplyExcel,
} from "@/api/borrow/apply";
import { listData } from "@/api/system/dict/data";
import { getRecordPage } from "@/api/archives/record";
import UserSelect from "@/components/UserSelect/single.vue";
export default {
name: "BorrowApply",
components: { UserSelect },
components: {},
data() {
return {
//
@ -373,17 +229,11 @@ export default {
form: {},
//
rules: {},
borrowStateOptions: [],
wayOptions: [],
mediaOptions: [],
filesNumOptions: [], //
fileTypeOptions: [], //
};
},
created() {
this.getList();
this.handleInitList();
this.getFilesNum();
},
methods: {
/** 查询列表 */
@ -396,12 +246,6 @@ export default {
this.loading = false;
});
},
//
getFilesNum() {
getRecordPage().then((response) => {
this.filesNumOptions = response.data.list;
});
},
//
handleInitList() {
//
@ -412,56 +256,10 @@ export default {
}).then((res) => {
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() {
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() {
@ -475,59 +273,38 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.optType = "add";
this.open = true;
this.title = "添加档案借阅申请";
this.$router.push({
path: "/borrow/apply/in",
query: {
id: null,
flag: "add",
title: "借阅申请单添加",
typeStr: "in",
},
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.optType = "edit";
const id = row.id;
getBorrowApply(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改档案借阅申请";
});
},
/** 提交按钮 */
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();
});
this.$router.push({
path: "/borrow/apply/in",
query: {
id: row.id,
flag: "edit",
title: "借阅申请单修改",
typeStr: "in",
},
});
},
//
handlePass(row) {
const data = { id: row.id, borrowState: "0" };
updateBorrowApply(data).then((response) => {
this.getList();
this.$modal.msgSuccess("已通过");
});
},
//
handleUnpass(row) {
const data = { id: row.id, borrowState: "1" };
updateBorrowApply(data).then((response) => {
this.getList();
this.$modal.msgError("已驳回");
/** 查看按钮操作 */
handleView(row) {
this.$router.push({
path: "/borrow/apply/in",
query: {
id: row.id,
flag: "show",
title: "借阅申请单查看",
typeStr: "in",
},
});
},
/** 删除按钮操作 */
@ -562,17 +339,6 @@ export default {
})
.catch(() => {});
},
//
handleSelectUser() {
this.$refs.UserSelect.showFlag = true;
},
//
onUserSelected(obj) {
console.log(obj);
if (obj != undefined && obj != null) {
this.form.userName = obj.username;
}
},
},
};
</script>

@ -1,13 +1,17 @@
<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-card class="top15 ">
<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 :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>
@ -15,7 +19,12 @@
<el-row>
<el-col :span="24">
<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-col>
</el-row>
@ -27,7 +36,12 @@
</el-col>
<el-col :span="12">
<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-col>
</el-row>
@ -45,8 +59,21 @@
</el-row>
<el-row>
<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-input size="small" v-model="form.amount" :disabled="disabled" placeholder="请输入">
<el-form-item
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>
</el-input>
</el-form-item>
@ -55,12 +82,26 @@
<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-input
type="textarea"
:disabled="disabled"
size="small"
:rows="5"
v-model="form.reason"
placeholder="请输入"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<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-col>
</el-row>
@ -75,60 +116,205 @@
<el-col :span="24">
<el-form-item label="行程信息">
<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">
<span>行程{{index + 1}}
<span
>行程{{ index + 1 }}
<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 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 class="box-content">
<el-row class="rw-bt">
<el-col :span="12">
<el-form-item 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-form-item
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-form-item>
</el-col>
<el-col :span="6">
<el-form-item 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
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-col>
<el-col :span="6">
<el-form-item label="出差类型" :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-form-item
label="出差类型"
: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-form-item>
</el-col>
</el-row>
<el-row class="rw-bt">
<el-col :span="12">
<el-form-item 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
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-col>
<el-col :span="12">
<el-form-item 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
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-col>
</el-row>
<el-row class="rw-bt">
<el-col :span="24">
<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-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="account-box">
<el-form-item :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
: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>
</div>
</el-col>
@ -137,7 +323,8 @@
</div>
</div>
<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>
</el-form-item>
</el-col>
@ -145,53 +332,91 @@
</div>
</el-card>
</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;">
<div style="text-align: right;margin-bottom:10px;">
<el-button @click="PrintRow" type='primary' size='mini' plain>确认打印</el-button>
<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="`${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>
</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>
</template>
<script>
import { debounce } from 'lodash'
import { debounce } from "lodash";
import dayjs from "dayjs";
import { listData } from "@/api/system/dict/data";
import { createExpenseApply, getExpenseApply } from "@/api/bs/expenseApply";
import VerifyFunc from "@/utils/verity";
import isBetween from 'dayjs/plugin/isBetween';
dayjs.extend(isBetween)
import isBetween from "dayjs/plugin/isBetween";
dayjs.extend(isBetween);
export default {
name: 'supplierTb',
name: "supplierTb",
components: {
printHtml: () => import('./printHtml'),
FilePreview: () => import('@/components/FilePreview'),
CommonName: () => import('@/components/CommonName'),
FlowDialog: () => import('@/components/FlowDialog'),
BottomBtn: () => import('@/components/BottomBtn'),
UploadFile: () => import('@/components/UploadFile'),
Together: () => import('../../../components/Together'),
List: () => import('../../../components/TogetherList'),
printHtml: () => import("./printHtml"),
FilePreview: () => import("@/components/FilePreview"),
CommonName: () => import("@/components/CommonName"),
FlowDialog: () => import("@/components/FlowDialog"),
BottomBtn: () => import("@/components/BottomBtn"),
UploadFile: () => import("@/components/UploadFile"),
Together: () => import("../../../components/Together"),
List: () => import("../../../components/TogetherList"),
// printHtml: () => import('./printHtml'),
},
created() {
if (this.$route.query.id) {
this.handleInitForm(this.$route.query.id)
this.handleInitForm(this.$route.query.id);
}
this.handleInitList()
this.handleInitList();
},
watch: {
fileList: {
@ -199,23 +424,21 @@ export default {
deep: true,
handler(val) {
if (val.length >= 1) {
this.hideUpload = true
this.hideUpload = true;
} else {
this.hideUpload = false
this.hideUpload = false;
}
}
}
},
},
},
computed: {
disabled() {
return !['add', 'edit'].includes(this.$route.query.flag)
return !["add", "edit"].includes(this.$route.query.flag);
},
title() {
return this.$route.query.title
},
isShow() {
return this.$route.query.title;
},
isShow() {},
},
data() {
return {
@ -229,8 +452,8 @@ export default {
defaultProps: {
children: "children",
label: "name",
value: 'id',
checkStrictly: false
value: "id",
checkStrictly: false,
},
areaTree: [],
previewFile: false,
@ -243,7 +466,7 @@ export default {
tripTypeList: [],
pdfName: null,
isPdf: false,
imgType: '.jpeg, .jpg, .png, .pdf',
imgType: ".jpeg, .jpg, .png, .pdf",
fileList: [],
hideUpload: false,
imgList: [], //src
@ -265,49 +488,50 @@ export default {
tripDay: undefined,
tripType: null,
tripPartners: [], //
amount: undefined
}
]
amount: undefined,
},
],
},
//
rules: {
reason: [{ required: true, message: "请输入", trigger: "blur" }],
},
userList: [],
index: 0
}
index: 0,
};
},
methods: {
handleSetApprovalId(id) {
this.accessId = id
this.accessId = id;
},
handleUpload(list) {
this.fileList = list
this.fileList = list;
},
handleBtTottom(val) {
if (val === 0 || val === 1) {
this.submitForm(val)
this.submitForm(val);
} else if (val == 2) {
this.showPrintPage = true
this.showPrintPage = true;
} else {
this.showFlow = true
this.showFlow = true;
}
},
handleTasks(tasks) {
this.tasks = tasks
this.tasks = tasks;
},
PrintRow: debounce(function () { //
this.$print(this.$refs.print)
PrintRow: debounce(function () {
//
this.$print(this.$refs.print);
}, 200),
handlePrint() {
this.showPrintPage = true
this.showPrintPage = true;
},
handleLoop(array) {
array.forEach(el => {
array.forEach((el) => {
if (el.children && !el.children.length) {
delete el.children
delete el.children;
} else {
this.handleLoop(el.children)
this.handleLoop(el.children);
}
});
},
@ -315,13 +539,13 @@ export default {
listData({
pageNo: 1,
pageSize: 50,
dictType: 'bs_trip_type',
dictType: "bs_trip_type",
}).then((res) => {
this.tripTypeList = res.data.list || []
})
this.tripTypeList = res.data.list || [];
});
},
handleTimeChange(val, index) {
let trips = this.form.expenseApplyTrips
let trips = this.form.expenseApplyTrips;
if (trips.length && val && val.length) {
//
let start1 = dayjs(val[0]);
@ -331,73 +555,80 @@ export default {
let start2 = dayjs(trips[i].time[0]);
let end2 = dayjs(trips[i].time[1]);
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)
return this.$modal.msgWarning(`行程时间范围与行程${i + 1}时间范围冲突!`)
this.$set(this.form.expenseApplyTrips[index], "time", null);
return this.$modal.msgWarning(
`行程时间范围与行程${i + 1}时间范围冲突!`
);
}
}
}
let startTime = val && val.length && dayjs(val[0]).format('YYYY/MM/DD 00:00:00')
let endTime = val && val.length && dayjs(val[1]).format('YYYY/MM/DD 23:59:59')
this.$set(this.form.expenseApplyTrips[index], 'startTime', startTime)
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)
let startTime =
val && val.length && dayjs(val[0]).format("YYYY/MM/DD 00:00:00");
let endTime =
val && val.length && dayjs(val[1]).format("YYYY/MM/DD 23:59:59");
this.$set(this.form.expenseApplyTrips[index], "startTime", startTime);
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.$refs.form.clearValidate([`expenseApplyTrips.${index}.tripDay`])
})
this.$refs.form.clearValidate([`expenseApplyTrips.${index}.tripDay`]);
});
},
downloadFile(obj) {
this.fileUrl = obj.url
if (this.fileUrl.indexOf('png') || this.fileUrl.indexOf('jpg')) {
this.fileUrl = obj.url;
if (this.fileUrl.indexOf("png") || this.fileUrl.indexOf("jpg")) {
// this.previewFile = true
window.open(this.fileUrl);
} else {
this.previewFile = true
this.previewFile = true;
}
},
handleOutSubmit() {
},
handleOutSubmit() {},
handleLsCl() {
this.lsIsOpen = false
this.lsIsOpen = false;
},
handleLsCm(list) {
this.$set(this.form.expenseApplyTrips[this.index], 'tripPartners', list)
this.lsIsOpen = false
this.$set(this.form.expenseApplyTrips[this.index], "tripPartners", list);
this.lsIsOpen = false;
},
handleShowFw(list, index) {
this.selectIds = list
this.index = index
this.lsIsOpen = true
this.selectIds = list;
this.index = index;
this.lsIsOpen = true;
},
handleInit(list) {
this.userList = list
this.userList = list;
},
handleTgCl() {
this.tgIsOpen = false
this.tgIsOpen = false;
},
handleTgCm(list) {
let flag = (list.filter(item => this.selectUserIds.includes(item)) || [])
let flag = list.filter((item) => this.selectUserIds.includes(item)) || [];
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}已经被添加,请勿重复添加!`);
} else {
list.forEach(v => {
this.form.expenseApplyTrips[this.index].tripPartners.push(v)
})
this.tgIsOpen = false
list.forEach((v) => {
this.form.expenseApplyTrips[this.index].tripPartners.push(v);
});
this.tgIsOpen = false;
}
},
handleAddFw(index) {
this.index = index
this.tgIsOpen = true
this.selectUserIds = this.form.expenseApplyTrips[index].tripPartners
this.index = index;
this.tgIsOpen = true;
this.selectUserIds = this.form.expenseApplyTrips[index].tripPartners;
},
handleDelRode(index) {
this.form.expenseApplyTrips.splice(index, 1)
this.form.expenseApplyTrips.splice(index, 1);
},
handleAddRode() {
this.form.expenseApplyTrips.push({
@ -409,97 +640,106 @@ export default {
tripDay: undefined,
tripType: null,
tripPartners: [], //
amount: undefined
})
amount: undefined,
});
},
//
uploadFile(item) {
//formdata;
let FormDatas = new FormData()
FormDatas.append('file', item.file);
FormDatas.append('path', item.file.name);
let FormDatas = new FormData();
FormDatas.append("file", item.file);
FormDatas.append("path", item.file.name);
uploadFileApi(FormDatas).then((res) => {
this.fileList.push({ name: item.file.name, url: res.data });//
if (this.fileList.length > 0) {//
this.fileList.push({ name: item.file.name, url: res.data }); //
if (this.fileList.length > 0) {
//
this.fileflag = false;
}
this.$modal.closeLoading()
})
this.$modal.closeLoading();
});
},
//
handleRemove() {
},
handleRemove() {},
//
handleClose(i) {
this.fileList.splice(i, 1);//
if (this.fileList.length == 0) {//
this.fileflag = true;//url
this.fileList.splice(i, 1); //
if (this.fileList.length == 0) {
//
this.fileflag = true; //url
// this.$set(this.demoObj.url, 0, { required: true, validator: this.validatorUrl, trigger: 'blur' })//
}
},
handleInitForm(id) {
this.processInstanceLoading = true
getExpenseApply(id).then(response => {
this.processInstanceLoading = true;
getExpenseApply(id).then((response) => {
this.form = response.data || {};
if (this.$route.query.typeStr === 'business') {
this.form.expenseApplyTrips = this.form.expenseApplyTrips.map((item) => {
return {
...item,
departureLocation: Number(item.departureLocation),
destinationLocation: Number(item.destinationLocation),
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'))]
if (this.$route.query.typeStr === "business") {
this.form.expenseApplyTrips = this.form.expenseApplyTrips.map(
(item) => {
return {
...item,
departureLocation: Number(item.departureLocation),
destinationLocation: Number(item.destinationLocation),
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.form.processInstanceId && this.$refs.FlowDialog.getDetail(this.form.processInstanceId)
})
this.isAuthorised = this.form.isAuthorised
this.form.processInstanceId &&
this.$refs.FlowDialog.getDetail(this.form.processInstanceId);
});
this.isAuthorised = this.form.isAuthorised;
});
},
submitForm(type) {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
// /
let newForm = {
...this.form,
billType: this.$route.query.typeStr == 'business' ? 'CLSQ' : 'RCSQ',
billType: this.$route.query.typeStr == "business" ? "CLSQ" : "RCSQ",
status: type,
files: this.fileList,
expenseApplyTrips: (this.form.expenseApplyTrips || []).map(
item => {
return {
...item,
departureLocation: Array.isArray(item.departureLocation) ? item.departureLocation[item.departureLocation.length - 1] : item.departureLocation,
destinationLocation: Array.isArray(item.destinationLocation) ? 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
expenseApplyTrips: (this.form.expenseApplyTrips || []).map((item) => {
return {
...item,
departureLocation: Array.isArray(item.departureLocation)
? item.departureLocation[item.departureLocation.length - 1]
: item.departureLocation,
destinationLocation: Array.isArray(item.destinationLocation)
? 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;
}
createExpenseApply(newForm).then(response => {
this.$modal.msgSuccess(`${this.form.id ? '修改成功!' : '新增成功!'}`);
history.back()
createExpenseApply(newForm).then((response) => {
this.$modal.msgSuccess(`${this.form.id ? "修改成功!" : "新增成功!"}`);
history.back();
});
});
},
cancel() {
this.$emit('onCancel')
this.$emit("onCancel");
},
}
}
},
};
</script>
<style lang="scss" scoped>
@import '@/assets/styles/form/index.scss';
@import "@/assets/styles/form/index.scss";
.my-process-designer {
background: #fff !important;
}

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

@ -213,7 +213,11 @@
</el-col>
<el-col :span="8">
<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
v-for="item in fileTypeOptions"
:key="item.id"
@ -329,7 +333,18 @@ export default {
//
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() {

Loading…
Cancel
Save