|
|
@@ -1,118 +1,272 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <basic-container
|
|
|
- v-if="show">
|
|
|
- <avue-crud
|
|
|
+ <basic-container v-if="show">
|
|
|
+ <avue-crud
|
|
|
+ ref="crud"
|
|
|
:option="option"
|
|
|
+ :data="dataList"
|
|
|
:before-open="beforeOpen"
|
|
|
- ></avue-crud>
|
|
|
-
|
|
|
- </basic-container>
|
|
|
- <div v-else class="borderless">
|
|
|
- <div class="customer-head">
|
|
|
- <div class="customer-back">
|
|
|
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
- @click="backToList">返回列表
|
|
|
+ :page.sync="page"
|
|
|
+ :search.sync="search"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @on-load="onLoad"
|
|
|
+ :table-loading="loading"
|
|
|
+ @saveColumn="saveColumn"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ >
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-bottom"
|
|
|
+ @click="excelBox = true"
|
|
|
+ >导入
|
|
|
</el-button>
|
|
|
- </div>
|
|
|
- <el-button
|
|
|
- class="el-button--small-yh add-customer-btn"
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
|
- :disabled="disabled"
|
|
|
size="small"
|
|
|
- @click="editCustomer"
|
|
|
- >{{ form.id ? '确认修改' : '确认新增' }}
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <containerTitle title="基础资料" style="margin-top: 60px"></containerTitle>
|
|
|
- <basic-container>
|
|
|
- <img src="https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/图层2.png" alt="" style="width: 100%;">
|
|
|
- </basic-container>
|
|
|
- <containerTitle title="详细信息"></containerTitle>
|
|
|
- <basic-container>
|
|
|
- <img src="https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/图层3.png" alt="" style="width: 100%;">
|
|
|
- </basic-container>
|
|
|
- </div>
|
|
|
+ icon="el-icon-bottom"
|
|
|
+ @click.stop="openExport()"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="menu">
|
|
|
+ <el-button type="text" size="small" @click.stop="editOpen(row)">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button type="text" size="small" @click.stop="rowDel(row, index)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ title="导入教职工资料"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="excelBox"
|
|
|
+ width="555px"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <avue-form
|
|
|
+ :option="excelOption"
|
|
|
+ v-model="excelForm"
|
|
|
+ table-loading="excelLoading"
|
|
|
+ :upload-after="uploadAfter"
|
|
|
+ >
|
|
|
+ <template slot="excelTemplate">
|
|
|
+ <el-button type="primary" @click="derivation">
|
|
|
+ 点击下载<i class="el-icon-download el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ <p style="text-align: center;color: #DC0505">
|
|
|
+ 温馨提示 第一次导入时请先下载模板
|
|
|
+ </p>
|
|
|
+ </el-dialog>
|
|
|
+ </basic-container>
|
|
|
+ <details-page v-else @goBack="backToList" :detailData="detailData" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import detailsPage from "./detailsPage";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import { getList, remove } from "@/api/basicData/facultyManagement";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
- data(){
|
|
|
+ data() {
|
|
|
return {
|
|
|
- show:true,
|
|
|
- form:{},
|
|
|
- option:{
|
|
|
- lazy: true,
|
|
|
- tip: false,
|
|
|
- simplePage: true,
|
|
|
+ show: true,
|
|
|
+ loading: false,
|
|
|
+ form: {},
|
|
|
+ search: {},
|
|
|
+ detailData: {},
|
|
|
+ dataList: [],
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ option: {
|
|
|
searchShow: true,
|
|
|
- searchMenuSpan: 24,
|
|
|
- dialogWidth: "60%",
|
|
|
+ searchMenuSpan: 16,
|
|
|
align: "center",
|
|
|
searchSpan: 8,
|
|
|
- searchMenuPosition: "right",
|
|
|
- tree: true,
|
|
|
border: true,
|
|
|
index: true,
|
|
|
- selection: true,
|
|
|
viewBtn: false,
|
|
|
editBtn: false,
|
|
|
delBtn: false,
|
|
|
- menuWidth: 180,
|
|
|
+ menuWidth: 100,
|
|
|
dialogClickModal: false,
|
|
|
searchLabelWidth: 100,
|
|
|
searchIcon: true,
|
|
|
searchIndex: 2,
|
|
|
addBtnText: "新单",
|
|
|
- expand: true,
|
|
|
- expandWidth: 38,
|
|
|
- selectionWidth: 40,
|
|
|
- column:[
|
|
|
+ column: [
|
|
|
{
|
|
|
- label:'工号',
|
|
|
- prop:'name',
|
|
|
- search:true,
|
|
|
+ label: "工号",
|
|
|
+ prop: "code",
|
|
|
+ search: true,
|
|
|
span: 8,
|
|
|
- maxlength: 3,
|
|
|
+ maxlength: 3
|
|
|
},
|
|
|
{
|
|
|
- label:'姓名',
|
|
|
- prop:'name1',
|
|
|
- search:true,
|
|
|
+ label: "姓名",
|
|
|
+ prop: "cname",
|
|
|
+ search: true,
|
|
|
span: 8,
|
|
|
- maxlength: 3,
|
|
|
+ maxlength: 3
|
|
|
},
|
|
|
{
|
|
|
- label:'身份类别',
|
|
|
- prop:'name1',
|
|
|
- search:true,
|
|
|
+ label: "身份类别",
|
|
|
+ prop: "identityCategory",
|
|
|
+ search: true,
|
|
|
+ type: "select",
|
|
|
+ dicUrl:
|
|
|
+ "/api/blade-system/dict-biz/dictionary?code=identity_category",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
span: 8,
|
|
|
- maxlength: 3,
|
|
|
+ maxlength: 3
|
|
|
},
|
|
|
{
|
|
|
- label:'教师类别',
|
|
|
- prop:'name1',
|
|
|
- search:true,
|
|
|
+ label: "教师类别",
|
|
|
+ prop: "teacherCategory",
|
|
|
+ search: true,
|
|
|
+ type: "select",
|
|
|
+ dataType: "string",
|
|
|
+ multiple: true,
|
|
|
+ dicUrl:
|
|
|
+ "/api/blade-system/dict-biz/dictionary?code=teacher_category",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
span: 8,
|
|
|
- maxlength: 3,
|
|
|
- }]
|
|
|
+ maxlength: 3
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ excelBox: false,
|
|
|
+ excelLoading: false,
|
|
|
+ excelForm: {},
|
|
|
+ excelOption: {
|
|
|
+ submitBtn: false,
|
|
|
+ emptyBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "模板下载",
|
|
|
+ prop: "excelTemplate",
|
|
|
+ formslot: true,
|
|
|
+ span: 24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "模板上传",
|
|
|
+ prop: "excelFile",
|
|
|
+ type: "upload",
|
|
|
+ drag: true,
|
|
|
+ loadText: "模板上传中,请稍等",
|
|
|
+ span: 24,
|
|
|
+ propsHttp: {
|
|
|
+ res: "data"
|
|
|
+ },
|
|
|
+ tip: "请上传 .xls,.xlsx 标准格式文件",
|
|
|
+ action: "/api/blade-client/schoolteacher/import"
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ detailsPage
|
|
|
},
|
|
|
- methods:{
|
|
|
- beforeOpen(row, index){
|
|
|
- this.show = false
|
|
|
+ methods: {
|
|
|
+ derivation() {
|
|
|
+ window.open(
|
|
|
+ `/api/blade-client/schoolteacher/export/template?${
|
|
|
+ this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ //点击搜索按钮触发
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ openExport() {
|
|
|
+ window.open(
|
|
|
+ `/api/blade-client/schoolteacher/export/teacher?${
|
|
|
+ this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ beforeOpen(row, index) {
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ uploadAfter(res, done, loading) {
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ onLoad(page, params) {
|
|
|
+ this.loading = true;
|
|
|
+ getList(page.currentPage, page.pageSize, params)
|
|
|
+ .then(res => {
|
|
|
+ this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
+ if (this.page.total) {
|
|
|
+ this.option.height = window.innerHeight - 350;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editOpen(row) {
|
|
|
+ this.detailData = {
|
|
|
+ id: row.id
|
|
|
+ };
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ currentChange(val) {
|
|
|
+ this.page.currentPage = val;
|
|
|
+ },
|
|
|
+ sizeChange(val) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.page.pageSize = val;
|
|
|
+ },
|
|
|
+ rowDel(row, index, done) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ remove(row.id).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
- this.show = true
|
|
|
- },
|
|
|
+ this.show = true;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped></style>
|