|
@@ -1,18 +1,15 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="qualityControl">
|
|
<div class="qualityControl">
|
|
|
<div v-if="!readonly && shiFouGuoShen" class="btn">
|
|
<div v-if="!readonly && shiFouGuoShen" class="btn">
|
|
|
- <el-button type="primary" icon="ibps-icon-plus" @click="onAddClick"
|
|
|
|
|
|
|
+ <el-button icon="ibps-icon-edit" @click="onCopy">复制</el-button>
|
|
|
|
|
+ <el-button type="success" icon="ibps-icon-plus" @click="onAddClick"
|
|
|
>添加</el-button
|
|
>添加</el-button
|
|
|
>
|
|
>
|
|
|
<el-button type="danger" icon="ibps-icon-close" @click="onRemoveClick"
|
|
<el-button type="danger" icon="ibps-icon-close" @click="onRemoveClick"
|
|
|
>删除</el-button
|
|
>删除</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button type="primary" icon="ibps-icon-import" @click="onImportClick"
|
|
|
|
|
- >导入</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button type="primary" icon="ibps-icon-export" @click="onExportClick"
|
|
|
|
|
- >导出</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button icon="ibps-icon-import" @click="onImportClick">导入</el-button>
|
|
|
|
|
+ <el-button icon="ibps-icon-export" @click="onExportClick">导出</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="table">
|
|
<div class="table">
|
|
|
<el-table
|
|
<el-table
|
|
@@ -87,6 +84,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import { cloneDeep } from 'lodash'
|
|
|
import xlsx from 'xlsx'
|
|
import xlsx from 'xlsx'
|
|
|
import fs from 'file-saver'
|
|
import fs from 'file-saver'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
@@ -170,6 +168,16 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ onCopy() {
|
|
|
|
|
+ console.log('复制')
|
|
|
|
|
+ if (this.multipleSelection.length > 0) {
|
|
|
|
|
+ this.tableData = this.tableData.concat(
|
|
|
|
|
+ cloneDeep(this.multipleSelection)
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning('请选择数据')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
xlsx(json, fields, filename = '.xlsx') {
|
|
xlsx(json, fields, filename = '.xlsx') {
|
|
|
// 导出xlsx
|
|
// 导出xlsx
|
|
|
json.forEach((item) => {
|
|
json.forEach((item) => {
|
|
@@ -300,7 +308,7 @@ export default {
|
|
|
const data = xlsx.utils.sheet_to_json(workSheet)
|
|
const data = xlsx.utils.sheet_to_json(workSheet)
|
|
|
const importData = this.switchDeviceObj(data, this.columns)
|
|
const importData = this.switchDeviceObj(data, this.columns)
|
|
|
// console.log(JSON.parse(JSON.stringify(importData)))
|
|
// console.log(JSON.parse(JSON.stringify(importData)))
|
|
|
- this.checkDate(importData)
|
|
|
|
|
|
|
+ // this.checkDate(importData)
|
|
|
await this.switchXmToId(importData)
|
|
await this.switchXmToId(importData)
|
|
|
this.tableData.push(...importData)
|
|
this.tableData.push(...importData)
|
|
|
// console.log(JSON.parse(JSON.stringify(this.tableData)))
|
|
// console.log(JSON.parse(JSON.stringify(this.tableData)))
|