|
@@ -6,9 +6,11 @@
|
|
|
v-model="form"
|
|
v-model="form"
|
|
|
:page.sync="page"
|
|
:page.sync="page"
|
|
|
:before-open="handleBeforeOpen"
|
|
:before-open="handleBeforeOpen"
|
|
|
|
|
+ :permission="permissionList"
|
|
|
>
|
|
>
|
|
|
<template slot="menuLeft">
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ v-if="!isSelAnnual"
|
|
|
type="danger"
|
|
type="danger"
|
|
|
size="small"
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
@@ -18,6 +20,7 @@
|
|
|
删 除
|
|
删 除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ v-if="!isSelAnnual"
|
|
|
type="success"
|
|
type="success"
|
|
|
size="small"
|
|
size="small"
|
|
|
plain
|
|
plain
|
|
@@ -36,6 +39,7 @@
|
|
|
导出
|
|
导出
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ v-if="!isSelAnnual"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="small"
|
|
size="small"
|
|
|
plain
|
|
plain
|
|
@@ -50,7 +54,7 @@
|
|
|
|
|
|
|
|
</avue-crud>
|
|
</avue-crud>
|
|
|
|
|
|
|
|
- <el-dialog title="行政区划数据导入"
|
|
|
|
|
|
|
+ <el-dialog title="技术人员花名册导入"
|
|
|
append-to-body
|
|
append-to-body
|
|
|
:visible.sync="excelBox"
|
|
:visible.sync="excelBox"
|
|
|
width="555px">
|
|
width="555px">
|
|
@@ -74,7 +78,6 @@ import NProgress from 'nprogress';
|
|
|
import 'nprogress/nprogress.css';
|
|
import 'nprogress/nprogress.css';
|
|
|
import {getToken} from "@/util/auth";
|
|
import {getToken} from "@/util/auth";
|
|
|
import {downloadXls} from "@/util/util";
|
|
import {downloadXls} from "@/util/util";
|
|
|
-import {dateNow} from "@/util/date";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
export default window.$crudCommon({
|
|
@@ -105,14 +108,13 @@ export default window.$crudCommon({
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- // permissionList() {
|
|
|
|
|
- // return {
|
|
|
|
|
- // addBtn: this.vaildData(this.permission.dictbiz_add, false),
|
|
|
|
|
- // delBtn: this.vaildData(this.permission.dictbiz_delete, false),
|
|
|
|
|
- // editBtn: this.vaildData(this.permission.dictbiz_edit, false),
|
|
|
|
|
- // viewBtn: false,
|
|
|
|
|
- // };
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ permissionList() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addBtn: !this.isSelAnnual,
|
|
|
|
|
+ editBtn: !this.isSelAnnual,
|
|
|
|
|
+ delBtn: !this.isSelAnnual,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
excelOption() {
|
|
excelOption() {
|
|
|
return {
|
|
return {
|
|
|
submitBtn: false,
|
|
submitBtn: false,
|
|
@@ -123,7 +125,7 @@ export default window.$crudCommon({
|
|
|
props: 'yearAndMonth',
|
|
props: 'yearAndMonth',
|
|
|
type: 'input',
|
|
type: 'input',
|
|
|
span: 24,
|
|
span: 24,
|
|
|
- value: this.yearAndMonth,
|
|
|
|
|
|
|
+ value: this.params.yearAndMonth,
|
|
|
disabled: true,
|
|
disabled: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -137,7 +139,7 @@ export default window.$crudCommon({
|
|
|
res: 'data'
|
|
res: 'data'
|
|
|
},
|
|
},
|
|
|
data: {
|
|
data: {
|
|
|
- yearAndMonth: this.yearAndMonth,
|
|
|
|
|
|
|
+ yearAndMonth: this.params.yearAndMonth,
|
|
|
},
|
|
},
|
|
|
tip: '请上传 .xls,.xlsx 标准格式文件',
|
|
tip: '请上传 .xls,.xlsx 标准格式文件',
|
|
|
action: '/api/kd-scientific/technician/import'
|
|
action: '/api/kd-scientific/technician/import'
|
|
@@ -153,18 +155,7 @@ export default window.$crudCommon({
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- handleBeforeOpen(done, type) {
|
|
|
|
|
- if (type == 'add' && this.isSelAnnual) {
|
|
|
|
|
- this.$message.warning('请选择月份');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- done();
|
|
|
|
|
- },
|
|
|
|
|
handleImport() {
|
|
handleImport() {
|
|
|
- if (this.isSelAnnual) {
|
|
|
|
|
- this.$message.warning("请选择月份");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
this.excelBox = true;
|
|
this.excelBox = true;
|
|
|
},
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
uploadAfter(res, done, loading, column) {
|
|
@@ -180,8 +171,8 @@ export default window.$crudCommon({
|
|
|
type: "warning"
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
NProgress.start();
|
|
NProgress.start();
|
|
|
- exportBlob(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`).then(res => {
|
|
|
|
|
- downloadXls(res.data, `技术人员花名册${dateNow()}.xlsx`);
|
|
|
|
|
|
|
+ exportBlob(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}&yearAndMonth=${this.params.yearAndMonth}`).then(res => {
|
|
|
|
|
+ downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
|
|
|
NProgress.done();
|
|
NProgress.done();
|
|
|
})
|
|
})
|
|
|
});
|
|
});
|
|
@@ -193,17 +184,12 @@ export default window.$crudCommon({
|
|
|
// });
|
|
// });
|
|
|
},
|
|
},
|
|
|
handleReadyLastMonData() {
|
|
handleReadyLastMonData() {
|
|
|
- if (this.isSelAnnual) {
|
|
|
|
|
- this.$message.warning("请选择月份");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.$confirm("确认要读取上个月的数据吗?", "提示", {
|
|
this.$confirm("确认要读取上个月的数据吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
- let lastMonth = moment(this.yearAndMonth).subtract(1, 'months').format("YYYY-MM");
|
|
|
|
|
|
|
+ let lastMonth = moment(this.params.yearAndMonth).subtract(1, 'months').format("YYYY-MM");
|
|
|
getLastMonthData({ yearAndMonth: lastMonth}).then(res => {
|
|
getLastMonthData({ yearAndMonth: lastMonth}).then(res => {
|
|
|
let data = res.data;
|
|
let data = res.data;
|
|
|
if (data.success) {
|
|
if (data.success) {
|