前端接口对接逻辑修改
This commit is contained in:
parent
986af6c10c
commit
576e5c586b
|
|
@ -60,4 +60,14 @@ export function delHoliday(HolidayId) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportHoliday(query) {
|
||||
return request({
|
||||
url: '/system/export/exportHoliday',
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -24,7 +24,10 @@
|
|||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -143,12 +146,35 @@
|
|||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<!-- <div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
|
||||
</div> -->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板</el-link> -->
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listHoliday,getHoliday,delHoliday,addHoliday,updateHoliday,changeHolidayStatus } from "@/api/process/rest";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
export default {
|
||||
name: "rules",
|
||||
|
|
@ -184,7 +210,7 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
leaveType:"请假",
|
||||
leaveType:"假",
|
||||
userName: undefined,
|
||||
orgName: undefined,
|
||||
},
|
||||
|
|
@ -209,52 +235,23 @@ export default {
|
|||
],
|
||||
leaveReason: [
|
||||
{ required: true, message: "请假事由不能为空", trigger: "blur" }
|
||||
],
|
||||
attDays: [
|
||||
{ required: true, message: "考勤时间不能为空", trigger: "blur" }
|
||||
],
|
||||
checkList: [
|
||||
{ required: true, message: "考勤人员不能为空", trigger: "blur" }
|
||||
],
|
||||
toWorkTime: [
|
||||
{ required: true, message: "上班时间不能为空", trigger: "blur" }
|
||||
],
|
||||
offWorkTime: [
|
||||
{ required: true, message: "下班时间不能为空", trigger: "blur" }
|
||||
],
|
||||
lateMinute: [
|
||||
{ required: true, message: "时间不能为空", trigger: "blur" },
|
||||
{ type: 'number', message: '必须为数字值', trigger: 'change' },
|
||||
],
|
||||
leaveMinute: [
|
||||
{ required: true, message: "时间不能为空", trigger: "blur" },
|
||||
{ type: 'number', message: '必须为数字值', trigger: 'change' },
|
||||
],
|
||||
absenteeismLateMinute: [
|
||||
{ required: true, message: "时间不能为空", trigger: "blur" },
|
||||
{ type: 'number', message: '必须为数字值', trigger: 'change' },
|
||||
],
|
||||
absenteeismLeaveMinute: [
|
||||
{ required: true, message: "时间不能为空", trigger: "blur" },
|
||||
{ type: 'number', message: '必须为数字值', trigger: 'change' },
|
||||
],
|
||||
entryAbnormalMinute: [
|
||||
{ required: true, message: "出入异常时间不能为空", trigger: "blur" },
|
||||
{ type: 'number', message: '必须为数字值', trigger: 'change' },
|
||||
],
|
||||
todayClockNum: [
|
||||
{ required: true, message: "每天打卡次数不能为空", trigger: "change" },
|
||||
{
|
||||
pattern: /^[1|2]\d{0}$/,
|
||||
message: "每天打卡次数必须为 1 或 2",
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
attendanceDuration: [
|
||||
{ required: true, message: "应出勤时长不能为空", trigger: "blur" },
|
||||
{ type: 'number', message: '必须为数字值', trigger: 'change' },
|
||||
]
|
||||
}
|
||||
},
|
||||
// 导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(导入)
|
||||
open: false,
|
||||
// 弹出层标题(导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/import/excelUpload"
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -365,6 +362,32 @@ export default {
|
|||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "数据导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('system/user/importTemplate', {
|
||||
}, `user_template_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listHoliday,getHoliday,delHoliday,addHoliday,updateHoliday,changeHolidayStatus } from "@/api/process/rest";
|
||||
import { listHoliday,getHoliday,delHoliday,addHoliday,updateHoliday,changeHolidayStatus,exportHoliday } from "@/api/process/rest";
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
export default {
|
||||
|
|
@ -460,9 +461,10 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/dict/type/export', {
|
||||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
this.queryParams.exportType="查询";
|
||||
exportHoliday(this.queryParams).then(res => {
|
||||
downloadFile({ fileName: `临时外出_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
|
@ -68,6 +66,7 @@
|
|||
<el-button
|
||||
type="primary" size="mini"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.examineStatus==0"
|
||||
>审核</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -157,7 +156,7 @@
|
|||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审批意见:" prop="examineOpinion">
|
||||
<el-input type="textarea" v-model="form.examineOpinion" maxlength="100"></el-input>
|
||||
<el-input type="textarea" v-model="form.examineOpinion" maxlength="100" :readonly="isView"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -172,7 +171,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { checkListHoliday,getHoliday,changeHolidayStatus } from "@/api/process/rest";
|
||||
import { checkListHoliday,getHoliday,changeHolidayStatus,exportHoliday} from "@/api/process/rest";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
export default {
|
||||
|
|
@ -354,9 +353,10 @@ export default {
|
|||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/dict/type/export', {
|
||||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
this.queryParams.exportType="审批";
|
||||
exportHoliday(this.queryParams).then(res => {
|
||||
downloadFile({ fileName: `临时外出_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,8 +208,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listHoliday,getHoliday,delHoliday,addHoliday,updateHoliday,changeHolidayStatus } from "@/api/process/rest";
|
||||
import { listHoliday,getHoliday,delHoliday,addHoliday,updateHoliday,changeHolidayStatus,exportHoliday } from "@/api/process/rest";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
export default {
|
||||
name: "rules",
|
||||
|
|
@ -451,9 +452,10 @@
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/dict/type/export', {
|
||||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
this.queryParams.exportType="查询";
|
||||
exportHoliday(this.queryParams).then(res => {
|
||||
downloadFile({ fileName: `轮休_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@
|
|||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary" size="mini"
|
||||
v-if="scope.row.examineStatus==0"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>审核</el-button>
|
||||
<el-button
|
||||
|
|
@ -157,7 +158,7 @@
|
|||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审批意见:" prop="examineOpinion">
|
||||
<el-input type="textarea" v-model="form.examineOpinion" maxlength="100"></el-input>
|
||||
<el-input type="textarea" v-model="form.examineOpinion" maxlength="100" :readonly="isView"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -172,7 +173,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { checkListHoliday,getHoliday,changeHolidayStatus } from "@/api/process/rest";
|
||||
import { checkListHoliday,getHoliday,changeHolidayStatus,exportHoliday } from "@/api/process/rest";
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
export default {
|
||||
|
|
@ -354,9 +356,10 @@ export default {
|
|||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/dict/type/export', {
|
||||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
this.queryParams.exportType="审批";
|
||||
exportHoliday(this.queryParams).then(res => {
|
||||
downloadFile({ fileName: `轮休_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@
|
|||
{ required: true, message: "考勤时间不能为空", trigger: "blur" }
|
||||
],
|
||||
checkList: [
|
||||
{ required: true, message: "考勤人员不能为空", trigger: "blur" }
|
||||
{ required: true, message: "考勤人员不能为空", trigger: "change" }
|
||||
],
|
||||
toWorkTime: [
|
||||
{ required: true, message: "上班时间不能为空", trigger: "blur" }
|
||||
|
|
@ -364,7 +364,10 @@
|
|||
handleSelect(value, instanceId) {
|
||||
console.log('Selected:', value);
|
||||
// 在这里处理选择事件
|
||||
// this.$refs["form"].validateField('checkList');
|
||||
// this.$forceUpdate()
|
||||
},
|
||||
|
||||
/** 转换部门数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" >
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -398,6 +398,9 @@ export default {
|
|||
this.reset();
|
||||
getDept(row.id).then(response => {
|
||||
this.form = response.data;
|
||||
if(!this.form.parentId){
|
||||
this.form.parentId=0
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改部门";
|
||||
listDept().then(response => {
|
||||
|
|
|
|||
|
|
@ -1,42 +1,29 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="全部消息" name="all"></el-tab-pane>
|
||||
<el-tab-pane label="未处理" name="unCare"></el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary" plain
|
||||
size="mini"
|
||||
>全部消息</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
size="mini"
|
||||
>未处理</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消息内容" align="center" prop="msgContent" />
|
||||
<el-table-column label="提交人" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消息内容" align="center" prop="msgContent" />
|
||||
<el-table-column label="提交人" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -72,13 +59,17 @@
|
|||
userName: undefined,
|
||||
orgId: undefined,
|
||||
},
|
||||
|
||||
activeName: 'all'
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab.name);
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
// this.loading = true;
|
||||
|
|
@ -87,18 +78,14 @@
|
|||
// this.total = response.total;
|
||||
// this.loading = false;
|
||||
// }
|
||||
// );
|
||||
// );
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属部门" prop="orgId">
|
||||
<treeselect v-model="form.orgId" :options="deptOptions" :normalizer="normalizer" placeholder="选择所属部门" style="width: 240px"/>
|
||||
<treeselect v-model="form.orgId" :options="deptOptions" :normalizer="normalizer" placeholder="选择所属部门"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
Loading…
Reference in New Issue