|
@@ -489,12 +489,31 @@
|
|
width="400px"
|
|
width="400px"
|
|
append-to-body
|
|
append-to-body
|
|
>
|
|
>
|
|
|
|
+ <template>
|
|
|
|
+ <div style="margin-bottom: 20px">
|
|
|
|
+ <el-radio-group v-model="tabPosition">
|
|
|
|
+ <el-radio-button label="template1">考勤数据</el-radio-button>
|
|
|
|
+ <el-radio-button label="template2">钉钉考勤数据</el-radio-button>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ style="margin-left: 38px; background: green"
|
|
|
|
+ v-show="tabPosition == 'template1'"
|
|
|
|
+ @click="downTemplate"
|
|
|
|
+ >下载模板</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
<el-upload
|
|
<el-upload
|
|
ref="uploads"
|
|
ref="uploads"
|
|
:limit="1"
|
|
:limit="1"
|
|
accept=".xlsx, .xls"
|
|
accept=".xlsx, .xls"
|
|
:headers="uploads.headers"
|
|
:headers="uploads.headers"
|
|
- :action="uploads.url + '?updateSupport=' + uploads.updateSupport"
|
|
|
|
|
|
+ :action="
|
|
|
|
+ (this.tabPosition == 'template1' ? uploads.url1 : uploads.url) +
|
|
|
|
+ '?updateSupport=' +
|
|
|
|
+ uploads.updateSupport
|
|
|
|
+ "
|
|
:disabled="uploads.isUploading"
|
|
:disabled="uploads.isUploading"
|
|
:on-progress="handleFileUploadProgresss"
|
|
:on-progress="handleFileUploadProgresss"
|
|
:on-success="handleFileSuccesss"
|
|
:on-success="handleFileSuccesss"
|
|
@@ -505,6 +524,7 @@
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
<div class="el-upload__tip text-center" slot="tip">
|
|
<div class="el-upload__tip text-center" slot="tip">
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
+ <div style="color: red; margin-top: 5px">注:请按模版格式,进行导入!!!</div>
|
|
</div>
|
|
</div>
|
|
</el-upload>
|
|
</el-upload>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -657,7 +677,6 @@ import {
|
|
listRecord,
|
|
listRecord,
|
|
batchExamineRecord,
|
|
batchExamineRecord,
|
|
selectUserClock,
|
|
selectUserClock,
|
|
- importUserClock,
|
|
|
|
updateAllUserClock,
|
|
updateAllUserClock,
|
|
mateUserRecord,
|
|
mateUserRecord,
|
|
userRecordMerge,
|
|
userRecordMerge,
|
|
@@ -682,6 +701,7 @@ export default {
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ tabPosition: "template1",
|
|
clockDetails: false,
|
|
clockDetails: false,
|
|
detailId: undefined,
|
|
detailId: undefined,
|
|
detailData: [],
|
|
detailData: [],
|
|
@@ -764,6 +784,7 @@ export default {
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
// 上传的地址
|
|
// 上传的地址
|
|
url: process.env.VUE_APP_BASE_API + "/system/user/importUserClock",
|
|
url: process.env.VUE_APP_BASE_API + "/system/user/importUserClock",
|
|
|
|
+ url1: process.env.VUE_APP_BASE_API + "/api/project/importClockData",
|
|
},
|
|
},
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
@@ -965,15 +986,20 @@ export default {
|
|
},
|
|
},
|
|
handleImports() {
|
|
handleImports() {
|
|
const _this = this;
|
|
const _this = this;
|
|
- selectUserClock().then((response) => {
|
|
|
|
- if (!response.data || response.data.length == 0) {
|
|
|
|
- _this.uploads.title = "数据导入";
|
|
|
|
- _this.uploads.open = true;
|
|
|
|
- } else {
|
|
|
|
- _this.checkData = response.data;
|
|
|
|
- _this.checkVisible = true;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if (_this.tabPosition == "template2") {
|
|
|
|
+ selectUserClock().then((response) => {
|
|
|
|
+ if (!response.data || response.data.length == 0) {
|
|
|
|
+ _this.uploads.title = "数据导入";
|
|
|
|
+ _this.uploads.open = true;
|
|
|
|
+ } else {
|
|
|
|
+ _this.checkData = response.data;
|
|
|
|
+ _this.checkVisible = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ _this.uploads.title = "数据导入";
|
|
|
|
+ _this.uploads.open = true;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
/** 下载模板操作 */
|
|
/** 下载模板操作 */
|
|
importTemplate() {
|
|
importTemplate() {
|
|
@@ -983,6 +1009,13 @@ export default {
|
|
`project_record_template_${new Date().getTime()}.xlsx`
|
|
`project_record_template_${new Date().getTime()}.xlsx`
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
+ downTemplate() {
|
|
|
|
+ this.download(
|
|
|
|
+ "api/project/importClockDataTemplate",
|
|
|
|
+ {},
|
|
|
|
+ `project_record_template_${new Date().getTime()}.xlsx`
|
|
|
|
+ );
|
|
|
|
+ },
|
|
// 文件上传中处理
|
|
// 文件上传中处理
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
this.upload.isUploading = true;
|
|
this.upload.isUploading = true;
|
|
@@ -1017,10 +1050,24 @@ export default {
|
|
this.$modal.msgError(response.msg);
|
|
this.$modal.msgError(response.msg);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.uploads.open = false;
|
|
|
|
- this.uploads.isUploading = false;
|
|
|
|
- this.$refs.uploads.clearFiles();
|
|
|
|
- this.handleImports();
|
|
|
|
|
|
+ if (this.tabPosition == "template2") {
|
|
|
|
+ this.uploads.open = false;
|
|
|
|
+ this.uploads.isUploading = false;
|
|
|
|
+ this.$refs.uploads.clearFiles();
|
|
|
|
+ this.handleImports();
|
|
|
|
+ } else {
|
|
|
|
+ this.uploads.open = false;
|
|
|
|
+ this.uploads.isUploading = false;
|
|
|
|
+ this.$refs.uploads.clearFiles();
|
|
|
|
+ this.$alert(
|
|
|
|
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
|
+ response.data +
|
|
|
|
+ "</div>",
|
|
|
|
+ "导入结果",
|
|
|
|
+ { dangerouslyUseHTMLString: true }
|
|
|
|
+ );
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 提交上传文件
|
|
// 提交上传文件
|
|
submitFileForms() {
|
|
submitFileForms() {
|
|
@@ -1162,10 +1209,13 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
|
+<style lang="scss">
|
|
// .head-container {
|
|
// .head-container {
|
|
// word-wrap: break-word;
|
|
// word-wrap: break-word;
|
|
// overflow: hidden;
|
|
// overflow: hidden;
|
|
// word-break: break-all;
|
|
// word-break: break-all;
|
|
// }
|
|
// }
|
|
|
|
+.el-dialog__body {
|
|
|
|
+ padding: 10px 20px 20px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|