|
|
@@ -10,26 +10,6 @@
|
|
|
>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
|
- v-if="!isSelAnnual"
|
|
|
- type="danger"
|
|
|
- size="small"
|
|
|
- icon="el-icon-delete"
|
|
|
- plain
|
|
|
- @click="handleDelete"
|
|
|
- >
|
|
|
- 删 除
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="!isSelAnnual"
|
|
|
- type="success"
|
|
|
- size="small"
|
|
|
- plain
|
|
|
- icon="el-icon-upload2"
|
|
|
- @click="handleImport"
|
|
|
- >
|
|
|
- 导入
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
type="warning"
|
|
|
size="small"
|
|
|
plain
|
|
|
@@ -38,15 +18,6 @@
|
|
|
>
|
|
|
导出
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- v-if="!isSelAnnual"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- plain
|
|
|
- @click="handleReadyLastMonData"
|
|
|
- >
|
|
|
- 读取上个月人员名单
|
|
|
- </el-button>
|
|
|
<print-table-btn @click="printTable" />
|
|
|
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
@@ -70,13 +41,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getLastMonthData } from "@/api/basicResource/technicianRoster";
|
|
|
-import {exportBloByPost} from "@/api/common";
|
|
|
import YearMonthSelect from "@/components/year-month-select";
|
|
|
import UploadExcelDialog from "@/components/upload-excel-dialog";
|
|
|
import moment from "moment";
|
|
|
-import {getToken} from "@/util/auth";
|
|
|
-import {downloadXls} from "@/util/util";
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
|
@@ -107,92 +74,14 @@ export default window.$crudCommon({
|
|
|
this.getList(this.page);
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- permissionList() {
|
|
|
- return {
|
|
|
- addBtn: !this.isSelAnnual,
|
|
|
- editBtn: !this.isSelAnnual,
|
|
|
- delBtn: !this.isSelAnnual,
|
|
|
- };
|
|
|
- },
|
|
|
- },
|
|
|
methods: {
|
|
|
- getList() {
|
|
|
- this.loading = false;
|
|
|
- },
|
|
|
- validCustom() {
|
|
|
- if (!this.form.number && !this.form.identityCard) {
|
|
|
- this.$message.warning("工号和身份证号必须填写一项!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- },
|
|
|
- addBefore(loading, callback) {
|
|
|
- if (!this.validCustom()) {
|
|
|
- loading();
|
|
|
- return;
|
|
|
- }
|
|
|
- callback && callback();
|
|
|
- },
|
|
|
- updateBefore(loading, callback) {
|
|
|
- if (!this.validCustom()) {
|
|
|
- loading();
|
|
|
- return false;
|
|
|
- }
|
|
|
- callback && callback();
|
|
|
- },
|
|
|
- getDelParams(row) {
|
|
|
- return [{ id: row.id, yearAndMonth: this.params.yearAndMonth }];
|
|
|
- },
|
|
|
- getBatchDelParams() {
|
|
|
- let delArr = [];
|
|
|
- this.data.forEach(item => {
|
|
|
- if (this.ids.indexOf(item.id) > -1) {
|
|
|
- delArr.push({ yearAndMonth: this.params.yearAndMonth, id: item.id });
|
|
|
- }
|
|
|
- });
|
|
|
- return delArr;
|
|
|
- },
|
|
|
- handleImport() {
|
|
|
- let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
|
- this.$refs.uploadExcelDialog.open('/api/kd-scientific/technician/import', excelParams);
|
|
|
- },
|
|
|
- uploadAfter() {
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.getList(this.page);
|
|
|
- },
|
|
|
- handleExport() {
|
|
|
- exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
- downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
|
|
|
- });
|
|
|
- },
|
|
|
- handleTemplate() {
|
|
|
- this.$message.warning("暂未配置模板");
|
|
|
- },
|
|
|
- handleReadyLastMonData() {
|
|
|
- this.$confirm("确认要读取上个月的数据吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- getLastMonthData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
|
|
|
- let data = res.data;
|
|
|
- if (data.success) {
|
|
|
-
|
|
|
- this.$message.success('读取成功!');
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.getList(this.page);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
/**
|
|
|
* 打印表格
|
|
|
* @param isLandscape 是否横向打印
|
|
|
*/
|
|
|
printTable(isLandscape) {
|
|
|
this.wideTableColumns = this.$refs.crud.columnOption;
|
|
|
- this.printTitle = `技术人员花名册${this.params.yearAndMonth}`;
|
|
|
+ this.printTitle = `研发资产费用分摊汇总表${this.params.yearAndMonth}`;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
|
})
|