|
|
@ -529,20 +529,7 @@ |
|
|
|
> |
|
|
|
<el-table-column prop="name" label="姓名" /> |
|
|
|
<el-table-column prop="idNo" label="身份证号码" /> |
|
|
|
<!-- <el-table-column prop="attendanceYear" label="考勤所属年月" /> --> |
|
|
|
<el-table-column |
|
|
|
label="考勤所属年月" |
|
|
|
align="center" |
|
|
|
prop="attendanceYear" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- <span>{{ parseTime(scope.row.attendanceYear, "{y}-{m}-{d}") }}</span> --> |
|
|
|
<span>{{ parseTime(scope.row.attendanceYear, "{y}-{m}") }}</span> |
|
|
|
<!-- <span>{{ scope.row.attendanceYear }}</span> --> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="attendanceDay" label="考勤天数" /> |
|
|
|
<el-table-column prop="phone" label="手机号" /> |
|
|
|
</el-table> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="submitTemplate">确 定</el-button> |
|
|
@ -778,19 +765,29 @@ export default { |
|
|
|
outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); //outdata就是读取excel内容之后输出的东西 |
|
|
|
this.da = [...outdata]; |
|
|
|
let arr = []; |
|
|
|
let successNo = 0; |
|
|
|
this.da.map((v) => { |
|
|
|
console.log(7777, v); |
|
|
|
let obj = {}; |
|
|
|
obj.attendanceDay = v["考勤天数"]; //ip是表的标题 |
|
|
|
obj.attendanceYear = v["考勤所属年月"].setMonth( |
|
|
|
v["考勤所属年月"].getMonth() + 1 |
|
|
|
); //ip是表的标题 |
|
|
|
obj.idNo = v["身份证"]; //ip是表的标题 |
|
|
|
obj.name = v["姓名"]; //ip是表的标题 |
|
|
|
if (obj.idNo && obj.name) { |
|
|
|
obj.phone = v["手机号"]; //ip是表的标题 |
|
|
|
if (obj.idNo && obj.name && obj.phone) { |
|
|
|
successNo += 1; |
|
|
|
arr.push(obj); |
|
|
|
} |
|
|
|
}); |
|
|
|
// if (this.da.length > 0) { |
|
|
|
// _this.$message({ |
|
|
|
// type: "success", |
|
|
|
// message: |
|
|
|
// "一共" + |
|
|
|
// this.da.length + |
|
|
|
// "条数据,成功导入" + |
|
|
|
// successNo + |
|
|
|
// "条数据", |
|
|
|
// }); |
|
|
|
// } |
|
|
|
|
|
|
|
//return arr |
|
|
|
// 把读取的excel表格中的内容放进tableData中(这里要改成自己的表的名字) |
|
|
|