master
xy 3 years ago
parent 427ff00a7c
commit c307a8a74c

@ -52,8 +52,8 @@ export function imports(data,isLoading = true){
}) })
} }
export async function exports(params){ export async function exports(params,filename = `模板-${params.year}.xlsx`){
await download('/api/admin/recruit/export','get',params,`统招生管理-${params.year}.xlsx`) await download('/api/admin/recruit/export','get',params,filename)
} }

@ -225,6 +225,7 @@ export default {
candidate_no: "", candidate_no: "",
allow_no: "", allow_no: "",
template_id: "", template_id: "",
template_item_id:""
}, },
originalRules: { originalRules: {
year: [{ required: true, message: "请选择年份", trigger: "blur" }], year: [{ required: true, message: "请选择年份", trigger: "blur" }],

@ -35,6 +35,20 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:footerContent>
<template>
<Poptip
:transfer="true"
confirm
title="确认要删除吗"
@on-ok="destroy">
<Button type="error" ghost>删除</Button>
</Poptip>
</template>
<Button @click="$refs['dialog'].reset()" style="margin-left: 8px">重置</Button>
<Button type="primary" @click="submit"></Button>
</template>
</xy-dialog> </xy-dialog>
</div> </div>
</template> </template>
@ -42,7 +56,8 @@
<script> <script>
import { import {
show, show,
save save,
destroy
} from '@/api/unifiedRecruitment/templateItem'; } from '@/api/unifiedRecruitment/templateItem';
export default { export default {
props:{ props:{
@ -80,23 +95,40 @@
}, },
submit() { submit() {
if(this.type === 'add'){ this.$refs['dialog'].validate().then(val => {
if(this.form.hasOwnProperty('id')){ if(val){
delete this.form.id if(this.type === 'add'){
if(this.form.hasOwnProperty('id')){
delete this.form.id
}
}
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', {
value: this.id,
enumerable: true,
configurable: true,
writable: true
})
}
save(this.form).then(res => {
this.$successMessage(this.type, '')
this.isShow = false
this.$emit('refresh')
})
} }
} })
if (this.type === 'editor') {
Object.defineProperty(this.form, 'id', { },
value: this.id, destroy(){
enumerable: true, destroy({
configurable: true, id:this.id
writable: true }).then(res => {
this.$message({
type:'success',
message:"删除成功"
}) })
}
save(this.form).then(res => {
this.$successMessage(this.type, '')
this.isShow = false
this.$emit('refresh') this.$emit('refresh')
this.isShow = false
}) })
} }
}, },

@ -82,6 +82,7 @@ export default {
year:'', year:'',
province_id:'', province_id:'',
template_id:'', template_id:'',
template_item_id:'',
isEnd:0 isEnd:0
}, },
@ -165,6 +166,7 @@ export default {
let promiseAll = this.list.map(item => { let promiseAll = this.list.map(item => {
let form = { let form = {
template_item_id:this.select.template_item_id,
template_id:this.select.template_id, template_id:this.select.template_id,
year:this.select.year, year:this.select.year,
province_id:this.select.province_id, province_id:this.select.province_id,

@ -12,6 +12,7 @@
<template v-slot:search> <template v-slot:search>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<el-date-picker <el-date-picker
:clearable="false"
size="small" size="small"
type="year" type="year"
placement="bottom" placement="bottom"
@ -19,10 +20,28 @@
style="width: 160px; margin-right: 6px" style="width: 160px; margin-right: 6px"
value-format="yyyy" value-format="yyyy"
v-model="select.year" v-model="select.year"
@change="getTemplate"
></el-date-picker> ></el-date-picker>
<el-select v-model="select.template_item_id" size="small" placeholder="模板类型" style="width: 160px; margin-right: 6px"> <el-select
<el-option v-for="item in templateItems" :key="item.id" :label="item.name" :value="item.id"></el-option> v-model="select.template_item_id"
size="small"
placeholder="模板类型"
style="width: 160px; margin-right: 6px"
>
<el-option-group
v-for="group in templates"
:key="group.id"
:label="String(group.year)"
>
<el-option
v-for="item in group.items"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-option-group>
</el-select> </el-select>
<el-input <el-input
@ -37,29 +56,41 @@
<template v-slot:create> <template v-slot:create>
<Button <Button
type="primary" type="primary"
@click="($refs['addRecruit'].type = 'add'), (isShowAdd = true)" @click="
($refs['addRecruit'].form.template_id = select.template_id),
($refs['addRecruit'].form.template_item_id =
select.template_item_id),
($refs['addRecruit'].type = 'add'),
(isShowAdd = true)
"
>新建</Button >新建</Button
> >
</template> </template>
<template v-slot:export> <template v-slot:export>
<el-dropdown @command="downTemplate"> <Button
<el-button size="small" type="primary"> type="primary"
下载模板<i class="el-icon-arrow-down el-icon--right"></i> @click="downTemplate"
</el-button> >下载模板</Button
<el-dropdown-menu slot="dropdown"> >
<el-dropdown-item <!-- <el-dropdown @command="downTemplate">-->
v-for="item in templateItems" <!-- <el-button size="small" type="primary">-->
:key="item.id" <!-- 下载模板<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
:command="item.id" <!-- </el-button>-->
>{{ item.name }}</el-dropdown-item <!-- <el-dropdown-menu slot="dropdown">-->
> <!-- <el-dropdown-item-->
</el-dropdown-menu> <!-- v-for="item in templateItems"-->
</el-dropdown> <!-- :key="item.id"-->
<!-- :command="item.id"-->
<!-- >{{ item.name }}</el-dropdown-item-->
<!-- >-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
</template> </template>
<template v-slot:import> <template v-slot:import>
<Button <Button
type="primary" type="primary"
@click=" @click="
($refs['importRecruitInfo'].select.template_item_id = select.template_item_id),
($refs['importRecruitInfo'].select.year = select.year), ($refs['importRecruitInfo'].select.year = select.year),
(isShowImportRecruitInfo = true) (isShowImportRecruitInfo = true)
" "
@ -81,6 +112,7 @@
@editor=" @editor="
(row) => { (row) => {
$refs['addRecruit'].form.template_id = select.template_id; $refs['addRecruit'].form.template_id = select.template_id;
$refs['addRecruit'].form.template_item_id = select.template_item_id;
$refs['addRecruit'].id = row.id; $refs['addRecruit'].id = row.id;
$refs['addRecruit'].type = 'editor'; $refs['addRecruit'].type = 'editor';
isShowAdd = true; isShowAdd = true;
@ -100,7 +132,7 @@
ref="importRecruitInfo" ref="importRecruitInfo"
:province_ids="provinces" :province_ids="provinces"
:is-show.sync="isShowImportRecruitInfo" :is-show.sync="isShowImportRecruitInfo"
@refresh="$refs['xyTable'].getTableData()" @refresh="getList"
></importRecruitInfo> ></importRecruitInfo>
</div> </div>
</template> </template>
@ -109,9 +141,15 @@
import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit"; import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit";
import { authMixin } from "@/mixin/authMixin"; import { authMixin } from "@/mixin/authMixin";
import { index as provinceIndex } from "@/api/manage/province"; import { index as provinceIndex } from "@/api/manage/province";
import { show as templateShow } from "@/api/unifiedRecruitment/template"; import {
show as templateShow,
index as templateIndex,
} from "@/api/unifiedRecruitment/template";
import { getConst } from "@/const"; import { getConst } from "@/const";
import { index as templateItemIndex } from "@/api/unifiedRecruitment/templateItem"; import {
index as templateItemIndex,
show as templateItemShow,
} from "@/api/unifiedRecruitment/templateItem";
import addRecruit from "./component/addRecruit.vue"; import addRecruit from "./component/addRecruit.vue";
import importRecruitInfo from "./component/importRecruitInfo.vue"; import importRecruitInfo from "./component/importRecruitInfo.vue";
@ -132,9 +170,10 @@ export default {
page: 1, page: 1,
page_size: 10, page_size: 10,
template_id: "", template_id: "",
template_item_id:"", template_item_id: "",
}, },
templateItems: [], templateItems: [],
templates: [],
total: 0, total: 0,
list: [], list: [],
@ -151,14 +190,9 @@ export default {
width: 120, width: 120,
}, },
{ {
prop: "province_id", prop: "province.name",
label: "省份", label: "省份",
width: 120, width: 120,
formatter: (cell, data, val) => {
return (
this.provinces.filter((item) => item.id === val)[0]?.name ?? ""
);
},
}, },
{ {
prop: "idcard", prop: "idcard",
@ -185,38 +219,18 @@ export default {
index, index,
destroy, destroy,
async getTemplateItem() { async getTemplateItemDetail() {
const res = await templateItemIndex({ if (!this.select.template_item_id) {
page: 1, this.$message({
page_size: 999, type: "warning",
template_id: this.select.template_id, message: "当前年份无模板内容",
},false); });
this.templateItems = res.data; return;
this.select.template_item_id = this.templateItems[0]?.id }
}, // const res = await templateItemShow({
async getList() { // id: this.select.template_item_id,
this.$refs['xyTable'].loading = true // });
let res = await index(this.select, false);
this.total = res.total ?? 0;
this.list = res.data.map((item) => {
return item.fileds ? { ...item, ...item.fileds } : item;
});
setTimeout(() => {
this.$refs['xyTable'].loading = false
},500)
},
async getProvinces() {
const res = await provinceIndex(
{
page: 1,
page_size: 9999,
},
false
);
this.provinces = res.data;
},
async getTemplate() {
const res = await templateShow( const res = await templateShow(
{ {
year: this.select.year, year: this.select.year,
@ -235,17 +249,73 @@ export default {
}) ?? []; }) ?? [];
this.table = [...this.originalTable, ...temp]; this.table = [...this.originalTable, ...temp];
}, },
async getList() {
this.$refs["xyTable"].loading = true;
try{
let res = await index(this.select, false);
this.total = res.total ?? 0;
this.list = res.data.map((item) => {
return item.fileds ? { ...item, ...item.fileds } : item;
});
setTimeout(() => {
this.$refs["xyTable"].loading = false;
}, 500);
}catch (e){
setTimeout(() => {
this.$refs["xyTable"].loading = false;
}, 500);
}
},
async getProvinces() {
const res = await provinceIndex(
{
page: 1,
page_size: 999,
},
false
);
this.provinces = res.data;
},
async getTemplate() {
const res = await templateIndex({
type: Number(this.$route.meta.params.type),
year: this.select.year,
page: 1,
page_size: 999,
});
this.templates = res.data;
this.select.template_id = this.templates[0]?.id;
this.select.template_item_id = this.templates[0]?.items[0]?.id;
// const res = await templateShow(
// {
// year: this.select.year,
// type: this.$route.meta.params?.type,
// },
// false
// );
// this.select.template_id = res.id;
// let temp =
// res?.fileds?.map((item) => {
// return {
// prop: item.en,
// label: item.name,
// width: 140,
// };
// }) ?? [];
// this.table = [...this.originalTable, ...temp];
},
async search() { async search() {
await this.getTemplate(); //await this.getTemplate();
await this.getTemplateItem(); //await this.getTemplateItemDetail();
await this.getList(); await this.getList();
}, },
downTemplate(command) { downTemplate() {
exports({ exports({
year: this.select.year, year: this.select.year,
template_item_id: command, template_item_id: this.select.template_item_id,
}); });
}, },
}, },
@ -257,12 +327,10 @@ export default {
}, },
async created() { async created() {
await this.getTemplate(); await this.getTemplate();
await this.getTemplateItem(); await this.getTemplateItemDetail();
await this.getProvinces(); await this.getProvinces();
await this.getList();
}, },
mounted() {
this.getList();
}
}; };
</script> </script>

@ -107,13 +107,13 @@ export default {
}, },
{ {
prop: "remark", prop: "remark",
label: "录取查询说明", label: "备注",
align: "left", align: "left",
minWidth: 300, minWidth: 300,
}, },
{ {
label: "是否开放查询", label: "是否开放查询",
minWidth: 300, minWidth: 340,
showOverflowTooltip:false, showOverflowTooltip:false,
customFn: (row) => { customFn: (row) => {
return ( return (
@ -179,6 +179,10 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.template-item{ .template-item{
display: flex; display: flex;
flex-wrap: wrap;
align-content: center;
align-items: center;
justify-content: space-between;
&>div + div{ &>div + div{
margin-left: 14px; margin-left: 14px;

@ -146,7 +146,7 @@ export default {
width: 140, width: 140,
}, },
{ {
label: "选", label: "选",
align:'left', align:'left',
customFn: (row) => { customFn: (row) => {
return ( return (

@ -9,33 +9,50 @@
:rules="rules" :rules="rules"
@submit="submit" @submit="submit"
> >
<template v-slot:province_id> </template> <template v-slot:province_id>
<template v-slot:year> </template>
<template v-slot:type>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px" <span style="color: red; font-weight: 600; padding-right: 4px"
>*</span >*</span
> >
招生类型 省份
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select <el-select
v-model="form.type" v-model="form.province_id"
clearable clearable
placeholder="请选择招生类型 " placeholder="请选择省份 "
style="width: 300px" style="width: 300px"
> >
<el-option <el-option
v-for="item in getConst('type', 'array')" v-for="item in province_ids"
:key="item.id" :key="item.id"
:label="item.value" :label="item.name"
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:year>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
年份
</div>
<div class="xy-table-item-content">
<el-date-picker
type="year"
v-model="form.year"
placeholder="请选择年份"
style="width: 300px"
value-format="yyyy"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:specialize_id> <template v-slot:specialize_id>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -103,33 +120,16 @@
</template> </template>
<template v-slot:subject> <template v-slot:subject>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> </div> <div class="xy-table-item-label"> </div>
<div class="xy-table-item-content" style="width: 300px"> <div class="xy-table-item-content" style="width: 300px">
<el-tag <el-select v-model="form.subject" style="width: 300px">
:key="tag" <el-option
v-for="tag in form.subject" v-for="item in store.state.subject.split(',')"
closable :key="item"
@close="handleClose(tag)" :label="item"
> :value="item"
{{ tag }} ></el-option>
</el-tag> </el-select>
<el-input
class="input-new-tag"
v-if="inputVisible"
v-model="inputValue"
ref="saveTagInput"
size="small"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
>
</el-input>
<el-button
v-else
class="button-new-tag"
size="small"
@click="showInput"
>+ 新增</el-button
>
</div> </div>
</div> </div>
</template> </template>
@ -154,14 +154,18 @@
<script> <script>
import { show, save } from "@/api/yearScore/yearScoreDetail"; import { show, save } from "@/api/yearScore/yearScoreDetail";
import { getConst } from "@/const";
export default { export default {
props: { props: {
specialize_ids: { specialize_ids: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
province_ids: {
type: Array,
default: () => [],
},
}, },
inject: ["store"],
data() { data() {
return { return {
inputVisible: false, inputVisible: false,
@ -173,7 +177,6 @@ export default {
form: { form: {
province_id: "", province_id: "",
year: "", year: "",
type: "",
specialize_id: "", specialize_id: "",
max_socre: "", max_socre: "",
min_socre: "", min_socre: "",
@ -209,8 +212,6 @@ export default {
}; };
}, },
methods: { methods: {
getConst,
handleClose(tag) { handleClose(tag) {
this.form.subject.splice(this.form.subject.indexOf(tag), 1); this.form.subject.splice(this.form.subject.indexOf(tag), 1);
}, },
@ -231,7 +232,7 @@ export default {
this.inputValue = ""; this.inputValue = "";
}, },
async getDetail() { async getDetail() {
const res = await show(this.id); const res = await show({ id: this.id });
this.$integrateData(this.form, res); this.$integrateData(this.form, res);
}, },
@ -251,7 +252,7 @@ export default {
} }
save({ save({
...this.form, ...this.form,
subject:this.form.subject.toString() subject: this.form.subject.toString(),
}).then((res) => { }).then((res) => {
this.$successMessage(this.type, ""); this.$successMessage(this.type, "");
this.isShow = false; this.isShow = false;
@ -273,6 +274,9 @@ export default {
} }
}, },
}, },
"form.year"(val){
this.form.year = val + ''
}
}; };
</script> </script>

@ -1,75 +1,93 @@
<template> <template>
<div> <div>
<Modal <Modal
:title="`${form.year}分数导入`" :title="`${form.year}分数`"
width="64" width="64"
:value.sync="isShow" :value.sync="isShow"
:loading="true" :loading="true"
@on-ok="submit" @on-ok="submit"
@on-visible-change="(e) => $emit('update:isShow', e)" @on-visible-change="(e) => $emit('update:isShow', e)"
> >
<div class="label"> <el-tabs tab-position="left">
<div class="label_title">省份选择</div> <el-tab-pane label="明细">
<el-select <xy-table
size="small" ref="xyTable2"
v-model="form.province_id" :auths="['edit', 'delete']"
placeholder="请选择省份" :table-item="table2"
> :action="index"
<el-option :destroy-action="destroy"
v-for="item in provinces" :req-opt="{ year: form.year, province_id: form.province_id }"
:key="item.id" @editor="
:value="item.id" row => {
:label="item.name" ($refs['addYearScoreDetail'].type = 'editor'),
></el-option> ($refs['addYearScoreDetail'].form.province_id =
</el-select> form.province_id),
</div> ($refs['addYearScoreDetail'].id = row.id),
<div style="margin-top: 6px; display: flex; align-items: flex-start"> ($refs['addYearScoreDetail'].form.year = form.year),
<el-button size="small" type="primary" @click="downLoad" ($refs['addYearScoreDetail'].isShow = true)
>下载导入模板</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"
ref="upload"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
:headers="{
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 </xy-table>
style="margin-left: 10px" </el-tab-pane>
size="small" <el-tab-pane label="导入">
type="success" <div class="label"></div>
@click="$refs['upload'].submit()" <div style="margin-top: 6px; display: flex; align-items: flex-start">
>开始上传</el-button <!-- <el-button size="small" type="primary" @click="downLoad"-->
> <!-- >下载导入模板</el-button-->
<div slot="tip" class="el-upload__tip"> <!-- >-->
支持文件格式EXCEL扩展名为 XLSXXLS <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"
ref="upload"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
:headers="{
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扩展名为 XLSXXLS
</div>
</el-upload>
</div> </div>
</el-upload>
</div>
<xy-table ref="xyTable" :is-page="false" :list="list" :table-item="table"> <xy-table
<template v-slot:btns></template> style="margin-top: 10px"
</xy-table> ref="xyTable"
:is-page="false"
:list="list"
:table-item="table"
>
<template v-slot:btns></template>
</xy-table>
</el-tab-pane>
</el-tabs>
<template v-slot:footer> <template v-slot:footer>
<Button @click="$emit('update:isShow', false)">取消</Button> <Button @click="$emit('update:isShow', false)">取消</Button>
@ -79,13 +97,15 @@
<addYearScoreDetail <addYearScoreDetail
ref="addYearScoreDetail" ref="addYearScoreDetail"
:province_ids="provinces"
:specialize_ids="specializes" :specialize_ids="specializes"
@refresh="$refs['xyTable2'].getTableData()"
></addYearScoreDetail> ></addYearScoreDetail>
</div> </div>
</template> </template>
<script> <script>
import { index, imports } from "@/api/yearScore/yearScoreDetail"; import { index, imports, destroy } from "@/api/yearScore/yearScoreDetail";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { index as specializeIndex } from "@/api/manage/specialize"; import { index as specializeIndex } from "@/api/manage/specialize";
@ -109,7 +129,41 @@ export default {
action: `${process.env.VUE_APP_BASE_API}/api/admin/year_socre_detail/excel_analyse`, action: `${process.env.VUE_APP_BASE_API}/api/admin/year_socre_detail/excel_analyse`,
fileList: [], fileList: [],
list: [], list: [],
table: [], table: [
{
prop: "year",
label: "年份",
width: 140,
},
{
prop: "province_name",
label: "省份",
width: 180,
},
{
prop: "subject",
label: "选科",
width: 180,
},
{
prop: "max_socre",
label: "最高分",
width: 160,
sortable: true,
},
{
prop: "min_socre",
label: "最低分",
width: 160,
sortable: true,
},
{
prop: "remark",
label: "备注",
minWidth: 200,
align: "left",
},
],
total: 0, total: 0,
specializes: [], specializes: [],
@ -118,10 +172,54 @@ export default {
year: String(new Date().getFullYear()), year: String(new Date().getFullYear()),
detail: [], detail: [],
}, },
table2: [
{
prop: "year",
label: "年份",
width: 140,
sortable: "custom",
},
{
prop: "provinces.name",
label: "省份",
width: 180,
},
{
prop: "subject",
label: "选科",
width: 180,
},
{
prop: "specialize.name",
label: "专业",
width: 180,
},
{
prop: "max_socre",
label: "最高分",
width: 160,
sortable: "custom",
},
{
prop: "min_socre",
label: "最低分",
width: 160,
sortable: "custom",
},
{
prop: "remark",
label: "备注",
minWidht: 200,
align: "left",
},
],
}; };
}, },
methods: { methods: {
getToken, getToken,
index,
destroy,
downLoad() {}, downLoad() {},
async getSpecializes() { async getSpecializes() {
@ -158,35 +256,54 @@ export default {
}); });
}, },
submit() { submit() {
if (this.form.detail.length <= 0) { if (this.list.length <= 0) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "请选择需要初始化数据", message: "请选择需要初始化数据",
}); });
return; return;
} }
let promiseAll = this.list.map((item) => { imports(
return imports(item); {
}); detail:this.list
Promise.all(promiseAll) }
)
.then((res) => { .then((res) => {
this.$message({ this.$message({
type: "success", type: "success",
message: `成功导入${res.length}`, message: `成功导入${this.list.length}`,
}); });
this.$emit("refresh"); this.$emit("refresh");
this.$emit("update:isShow", false); this.$refs["xyTable2"].getTableData();
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
// let promiseAll = this.list.map((item) => {
// return imports({
// detail: item,
// });
// });
// Promise.all(promiseAll)
// .then((res) => {
// this.$message({
// type: "success",
// message: `${res.length}`,
// });
// this.$emit("refresh");
// this.$refs['xyTable2'].getTableData()
// })
// .catch((err) => {
// console.log(err);
// });
}, },
}, },
computed: {}, computed: {},
watch: { watch: {
isShow(newVal) { isShow(newVal) {
if (newVal) { if (newVal) {
this.getList(); //this.getList();
this.$refs["xyTable2"].getTableData(true);
} }
}, },
}, },

@ -51,11 +51,11 @@
} }
" "
> >
<template v-slot:import="scope"> <!-- <template v-slot:import="scope">-->
<Button size="small" type="primary" ghost @click="showImport(scope.row)" <!-- <Button size="small" type="primary" ghost @click="showImport(scope.row)"-->
>导入</Button <!-- >导入</Button-->
> <!-- >-->
</template> <!-- </template>-->
</xy-table> </xy-table>
<addYearScore <addYearScore
@ -81,8 +81,21 @@ export default {
addYearScore, addYearScore,
imports, imports,
}, },
provide(){
return {
store:this.store
}
},
data() { data() {
return { return {
store:{
state:{
subject:""
},
commit(subject,val){
this.state[subject] = val
}
},
isShowImport: false, isShowImport: false,
provinces: [], provinces: [],
select: { select: {
@ -154,6 +167,7 @@ export default {
this.provinces = res.data; this.provinces = res.data;
}, },
showImport(row, province_id = "") { showImport(row, province_id = "") {
this.store.state.subject = row.province_ids?.filter(item => item.province_id == province_id)[0]?.subject ?? ""
this.$refs["imports"].form.year = String(row.year); this.$refs["imports"].form.year = String(row.year);
this.$refs["imports"].form.province_id = province_id; this.$refs["imports"].form.province_id = province_id;
this.isShowImport = true; this.isShowImport = true;

Loading…
Cancel
Save