|
|
|
|
@ -14,6 +14,17 @@
|
|
|
|
|
></vxe-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #buttons>
|
|
|
|
|
<el-input style="width: 100px;" clearable size="small" v-model="select.name" placeholder="姓名.."></el-input>
|
|
|
|
|
<el-input style="width: 120px;" clearable size="small" v-model="select.mobile" placeholder="联系电话.."></el-input>
|
|
|
|
|
<el-date-picker style="width: 120px;" clearable size="small" v-model="select.year" value-format="yyyy" type="year" placeholder="年份.."></el-date-picker>
|
|
|
|
|
<el-cascader v-model="select['filter[0][value]']"
|
|
|
|
|
placeholder="填报表.."
|
|
|
|
|
size="small"
|
|
|
|
|
clearable
|
|
|
|
|
:options="groupAspiration"
|
|
|
|
|
:props="{
|
|
|
|
|
emitPath: false
|
|
|
|
|
}"></el-cascader>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="isHasAuth('search')"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
@ -159,12 +170,13 @@ import VxeUI from "vxe-pc-ui";
|
|
|
|
|
|
|
|
|
|
import { authMixin } from "@/mixin/authMixin";
|
|
|
|
|
import { uploadSize } from "@/settings";
|
|
|
|
|
import { deepCopy } from "@/utils";
|
|
|
|
|
import {deepCopy, paramsSerializer} from "@/utils";
|
|
|
|
|
import { download } from "@/utils/downloadRequest";
|
|
|
|
|
import { destroy, index, save } from "@/api/batch-data/batch-data";
|
|
|
|
|
import ShowBatchData from "./components/ShowBatchData.vue";
|
|
|
|
|
import axios from "axios";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
import {index as aspirationIndex} from "@/api/aspiration/aspiration";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "BatchData",
|
|
|
|
|
@ -185,6 +197,12 @@ export default {
|
|
|
|
|
page_size: 20,
|
|
|
|
|
keyword: "",
|
|
|
|
|
show_relation: ["aspiration", "user"],
|
|
|
|
|
name: "",
|
|
|
|
|
mobile: "",
|
|
|
|
|
year: "",
|
|
|
|
|
"filter[0][key]": 'aspiration_id',
|
|
|
|
|
"filter[0][op]": 'eq',
|
|
|
|
|
"filter[0][value]": ''
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
allAlign: null,
|
|
|
|
|
@ -193,9 +211,34 @@ export default {
|
|
|
|
|
id: "",
|
|
|
|
|
},
|
|
|
|
|
validRules: {},
|
|
|
|
|
|
|
|
|
|
aspiration: [],
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
groupAspiration() {
|
|
|
|
|
const yearMap = {};
|
|
|
|
|
|
|
|
|
|
// 遍历数据,按年份分组
|
|
|
|
|
this.aspiration.forEach(item => {
|
|
|
|
|
if (!yearMap[item.year]) {
|
|
|
|
|
yearMap[item.year] = {
|
|
|
|
|
value: item.year,
|
|
|
|
|
label: `${item.year}年`,
|
|
|
|
|
children: []
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
yearMap[item.year].children.push({
|
|
|
|
|
value: item.id,
|
|
|
|
|
label: item.name
|
|
|
|
|
// 可以根据需要添加其他字段
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 转换为数组格式
|
|
|
|
|
return Object.values(yearMap);
|
|
|
|
|
},
|
|
|
|
|
isActiveStatus() {
|
|
|
|
|
return function (row) {
|
|
|
|
|
if (this.$refs["table"]) {
|
|
|
|
|
@ -210,6 +253,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getAspiration();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
@ -224,13 +268,18 @@ export default {
|
|
|
|
|
distinguishCancelAndClose: true,
|
|
|
|
|
})
|
|
|
|
|
.then((_) => {
|
|
|
|
|
const tableColumns = this.$refs['table'].getFullColumns()
|
|
|
|
|
let export_fields = {}
|
|
|
|
|
Object.keys(this.form).forEach(key => {
|
|
|
|
|
export_fields[key] = tableColumns.find(col => col.field === key)?.title || key
|
|
|
|
|
})
|
|
|
|
|
download("/api/admin/school/index", "get", {
|
|
|
|
|
...this.select,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
is_export: 1,
|
|
|
|
|
export_fields: Object.keys(this.form),
|
|
|
|
|
});
|
|
|
|
|
export_fields
|
|
|
|
|
}, `${this.$route.meta.title}_${this.$moment().valueOf()}.xlsx`,paramsSerializer);
|
|
|
|
|
})
|
|
|
|
|
.catch((action) => {
|
|
|
|
|
if (action === "cancel" && this.$refs["table"]) {
|
|
|
|
|
@ -278,6 +327,20 @@ export default {
|
|
|
|
|
default:
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getAspiration() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await aspirationIndex(
|
|
|
|
|
{
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.aspiration = res.data;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async detail(row) {
|
|
|
|
|
await this.$refs["ShowBatchData"].getDetail(row.id);
|
|
|
|
|
this.isShowDetail = true;
|
|
|
|
|
@ -407,6 +470,9 @@ export default {
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
::v-deep .vxe-buttons--wrapper > * + * {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-card__header {
|
|
|
|
|
padding: 6px 20px;
|
|
|
|
|
}
|
|
|
|
|
|