|
@@ -57,7 +57,8 @@
|
|
|
<el-dialog title="技术人员花名册导入"
|
|
<el-dialog title="技术人员花名册导入"
|
|
|
append-to-body
|
|
append-to-body
|
|
|
:visible.sync="excelBox"
|
|
:visible.sync="excelBox"
|
|
|
- width="555px">
|
|
|
|
|
|
|
+ width="555px"
|
|
|
|
|
+ >
|
|
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
|
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
|
|
|
<template slot="excelTemplate">
|
|
<template slot="excelTemplate">
|
|
|
<el-button type="primary" @click="handleTemplate">
|
|
<el-button type="primary" @click="handleTemplate">
|
|
@@ -71,7 +72,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { getLastMonthData } from "@/api/technicianRoster";
|
|
import { getLastMonthData } from "@/api/technicianRoster";
|
|
|
-import {exportBlob} from "@/api/common";
|
|
|
|
|
|
|
+import {exportBloByPost} from "@/api/common";
|
|
|
import YearMonthSelect from "@/components/year-month-select";
|
|
import YearMonthSelect from "@/components/year-month-select";
|
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
|
import NProgress from 'nprogress';
|
|
import NProgress from 'nprogress';
|
|
@@ -116,16 +117,16 @@ export default window.$crudCommon({
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
excelOption() {
|
|
excelOption() {
|
|
|
|
|
+ console.log(this.excelForm)
|
|
|
return {
|
|
return {
|
|
|
submitBtn: false,
|
|
submitBtn: false,
|
|
|
emptyBtn: false,
|
|
emptyBtn: false,
|
|
|
column: [
|
|
column: [
|
|
|
{
|
|
{
|
|
|
label: '上传月份',
|
|
label: '上传月份',
|
|
|
- props: 'yearAndMonth',
|
|
|
|
|
|
|
+ prop: 'yearAndMonth',
|
|
|
type: 'input',
|
|
type: 'input',
|
|
|
span: 24,
|
|
span: 24,
|
|
|
- value: this.params.yearAndMonth,
|
|
|
|
|
disabled: true,
|
|
disabled: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -178,6 +179,7 @@ export default window.$crudCommon({
|
|
|
},
|
|
},
|
|
|
handleImport() {
|
|
handleImport() {
|
|
|
this.excelBox = true;
|
|
this.excelBox = true;
|
|
|
|
|
+ this.excelForm.yearAndMonth = this.params.yearAndMonth;
|
|
|
},
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
uploadAfter(res, done, loading, column) {
|
|
|
this.excelBox = false;
|
|
this.excelBox = false;
|
|
@@ -192,7 +194,7 @@ export default window.$crudCommon({
|
|
|
type: "warning"
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
NProgress.start();
|
|
NProgress.start();
|
|
|
- exportBlob(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}&yearAndMonth=${this.params.yearAndMonth}`).then(res => {
|
|
|
|
|
|
|
+ exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}}`, this.params).then(res => {
|
|
|
downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
|
|
downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
|
|
|
NProgress.done();
|
|
NProgress.done();
|
|
|
})
|
|
})
|
|
@@ -224,6 +226,13 @@ export default window.$crudCommon({
|
|
|
},
|
|
},
|
|
|
}, {
|
|
}, {
|
|
|
// 模块路径
|
|
// 模块路径
|
|
|
- name: 'technicianRoster'
|
|
|
|
|
|
|
+ name: 'technicianRoster',
|
|
|
|
|
+ res: ({ data }) => {
|
|
|
|
|
+ data.records = data.records.map(item => {
|
|
|
|
|
+ item.gender = item.gender ? String(item.gender) : '';
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ return data;
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|