|
|
|
|
@ -10,52 +10,90 @@
|
|
|
|
|
>
|
|
|
|
|
<div class="label">
|
|
|
|
|
<div class="label_title">省份选择</div>
|
|
|
|
|
<el-select size="small" v-model="form.province_id" placeholder="请选择省份">
|
|
|
|
|
<el-option v-for="item in provinces" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
|
|
|
<el-select
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="form.province_id"
|
|
|
|
|
placeholder="请选择省份"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in provinces"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-top: 6px;display: flex;align-items: flex-start;">
|
|
|
|
|
<el-button size="small" type="primary" @click="downLoad">下载导入模板</el-button>
|
|
|
|
|
<div style="margin-top: 6px; display: flex; align-items: flex-start">
|
|
|
|
|
<el-button size="small" type="primary" @click="downLoad"
|
|
|
|
|
>下载导入模板</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="
|
|
|
|
|
($refs['addYearScoreDetail'].type = 'add'),
|
|
|
|
|
($refs['addYearScoreDetail'].form.province_id = form.province_id),
|
|
|
|
|
($refs['addYearScoreDetail'].form.year = form.year),
|
|
|
|
|
($refs['addYearScoreDetail'].isShow = true)
|
|
|
|
|
"
|
|
|
|
|
>新增</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-upload
|
|
|
|
|
style="margin-left: 10px;"
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
ref="upload"
|
|
|
|
|
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
|
|
:headers="{
|
|
|
|
|
'Authorization':`Bearer ${getToken()}`
|
|
|
|
|
Authorization: `Bearer ${getToken()}`,
|
|
|
|
|
}"
|
|
|
|
|
:action="action"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:on-success="successHandle"
|
|
|
|
|
:on-error="errorHandle"
|
|
|
|
|
:auto-upload="false">
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="$refs['upload'].submit()">开始上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">支持文件格式:EXCEL,扩展名为 XLSX、XLS</div>
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
>
|
|
|
|
|
<el-button slot="trigger" size="small" type="primary"
|
|
|
|
|
>选取文件</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
size="small"
|
|
|
|
|
type="success"
|
|
|
|
|
@click="$refs['upload'].submit()"
|
|
|
|
|
>开始上传</el-button
|
|
|
|
|
>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">
|
|
|
|
|
支持文件格式:EXCEL,扩展名为 XLSX、XLS
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<xy-table
|
|
|
|
|
ref="xyTable"
|
|
|
|
|
:is-page="false"
|
|
|
|
|
:list="list"
|
|
|
|
|
:table-item="table"
|
|
|
|
|
>
|
|
|
|
|
<xy-table ref="xyTable" :is-page="false" :list="list" :table-item="table">
|
|
|
|
|
<template v-slot:btns></template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
|
|
|
|
|
<template v-slot:footer>
|
|
|
|
|
<Button @click="$emit('update:isShow',false)">取消</Button>
|
|
|
|
|
<Button @click="$emit('update:isShow', false)">取消</Button>
|
|
|
|
|
<Button type="primary" @click="submit">确认</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
<addYearScoreDetail
|
|
|
|
|
ref="addYearScoreDetail"
|
|
|
|
|
:specialize_ids="specializes"
|
|
|
|
|
></addYearScoreDetail>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { index,imports} from "@/api/yearScore/yearScoreDetail"
|
|
|
|
|
import { getToken } from "@/utils/auth"
|
|
|
|
|
import { index, imports } from "@/api/yearScore/yearScoreDetail";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
import { index as specializeIndex } from "@/api/manage/specialize";
|
|
|
|
|
|
|
|
|
|
import addYearScoreDetail from "./addYearScoreDetail.vue";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addYearScoreDetail,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
isShow: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
@ -68,65 +106,93 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
action:`${process.env.VUE_APP_BASE_API}/api/admin/year_socre_detail/excel_analyse`,
|
|
|
|
|
fileList:[],
|
|
|
|
|
list:[],
|
|
|
|
|
table: [
|
|
|
|
|
],
|
|
|
|
|
action: `${process.env.VUE_APP_BASE_API}/api/admin/year_socre_detail/excel_analyse`,
|
|
|
|
|
fileList: [],
|
|
|
|
|
list: [],
|
|
|
|
|
table: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
specializes: [],
|
|
|
|
|
|
|
|
|
|
form: {
|
|
|
|
|
province_id: "",
|
|
|
|
|
year: String(new Date().getFullYear()),
|
|
|
|
|
detail: [],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
index,
|
|
|
|
|
getToken,
|
|
|
|
|
|
|
|
|
|
downLoad(){
|
|
|
|
|
|
|
|
|
|
downLoad() {},
|
|
|
|
|
async getSpecializes() {
|
|
|
|
|
const res = await specializeIndex(
|
|
|
|
|
{
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.specializes = res.data;
|
|
|
|
|
},
|
|
|
|
|
successHandle(response, file, fileList){
|
|
|
|
|
this.list = response ?? []
|
|
|
|
|
async getList() {
|
|
|
|
|
this.$refs["xyTable"].loading = true;
|
|
|
|
|
const res = await index(
|
|
|
|
|
{
|
|
|
|
|
year: this.form.year,
|
|
|
|
|
province_id: this.form.province_id,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.list = res.data;
|
|
|
|
|
this.$refs["xyTable"].loading = false;
|
|
|
|
|
},
|
|
|
|
|
errorHandle(err, file, fileList){
|
|
|
|
|
successHandle(response, file, fileList) {
|
|
|
|
|
this.list = response ?? [];
|
|
|
|
|
},
|
|
|
|
|
errorHandle(err, file, fileList) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'error',
|
|
|
|
|
message:err
|
|
|
|
|
})
|
|
|
|
|
type: "error",
|
|
|
|
|
message: err,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
submit(){
|
|
|
|
|
if(this.form.detail.length <= 0){
|
|
|
|
|
submit() {
|
|
|
|
|
if (this.form.detail.length <= 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'warning',
|
|
|
|
|
message:"请选择需要初始化数据"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
type: "warning",
|
|
|
|
|
message: "请选择需要初始化数据",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let promiseAll = this.list.map(item => {
|
|
|
|
|
return imports(item)
|
|
|
|
|
})
|
|
|
|
|
Promise.all(promiseAll).then(res => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:`成功导入${res.length}条`
|
|
|
|
|
let promiseAll = this.list.map((item) => {
|
|
|
|
|
return imports(item);
|
|
|
|
|
});
|
|
|
|
|
Promise.all(promiseAll)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: `成功导入${res.length}条`,
|
|
|
|
|
});
|
|
|
|
|
this.$emit("refresh");
|
|
|
|
|
this.$emit("update:isShow", false);
|
|
|
|
|
})
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
this.$emit('update:isShow',false)
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
watch: {
|
|
|
|
|
isShow(newVal) {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
this.$refs["xyTable"].getTableData();
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getSpecializes();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|