|
@@ -243,6 +243,9 @@
|
|
|
<div class="search-item" style="width:60px">
|
|
<div class="search-item" style="width:60px">
|
|
|
<el-button type="primary" size="mini" icon="el-icon-download" @click="exportExcel">导出</el-button>
|
|
<el-button type="primary" size="mini" icon="el-icon-download" @click="exportExcel">导出</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="trueList.length>0" class="search-item" style="width:110px">
|
|
|
|
|
+ <el-button type="info" size="mini" icon="el-icon-setting" @click="settingData">使用默认数据</el-button>
|
|
|
|
|
+ </div>
|
|
|
<div class="search-item" style="width:60px">
|
|
<div class="search-item" style="width:60px">
|
|
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeItem">删除</el-button>
|
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeItem">删除</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -895,6 +898,49 @@ export default {
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 使用默认数据
|
|
|
|
|
+ settingData () {
|
|
|
|
|
+ this.$confirm('使用默认数据后子表中为空的字段将会被以上数据代替,是否继续?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.subForm.forEach(item => {
|
|
|
|
|
+ if (item.bu_men_ === '') {
|
|
|
|
|
+ item.bu_men_ = this.form.bian_zhi_bu_men_
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.jian_ce_gang_wei_ === '') {
|
|
|
|
|
+ item.jian_ce_gang_wei_ = this.form.gang_wei_
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.kong_zhi_tiao_jia === '') {
|
|
|
|
|
+ item.kong_zhi_tiao_jia = this.form.tiao_jian_
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.jian_ce_ri_qi_ === '') {
|
|
|
|
|
+ item.jian_ce_ri_qi_ = this.form.jian_ce_ri_qi_
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.ri_qi_lie_biao_ === '') {
|
|
|
|
|
+ item.ri_qi_lie_biao_ = this.form.ri_qi_lie_biao_
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.jian_ce_zhou_qi_ === '') {
|
|
|
|
|
+ item.jian_ce_zhou_qi_ = this.form.zhou_qi_
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.lie_biao_shu_ju_ && this.form.lie_biao_shu_ju_) {
|
|
|
|
|
+ const main = JSON.parse(this.form.lie_biao_shu_ju_)
|
|
|
|
|
+ const sub = JSON.parse(item.lie_biao_shu_ju_)
|
|
|
|
|
+ sub.forEach((i, index) => {
|
|
|
|
|
+ if (i.range.length === 0 || i.range === [null, null]) {
|
|
|
|
|
+ i.range = main[index].range
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i.fixValue === '') {
|
|
|
|
|
+ i.fixValue = main[index].fixValue
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ item.lie_biao_shu_ju_ = JSON.stringify(sub)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 当前页码改变
|
|
// 当前页码改变
|
|
|
handleCurrentChange (val) {
|
|
handleCurrentChange (val) {
|
|
|
this.currentPage = val
|
|
this.currentPage = val
|
|
@@ -1229,6 +1275,9 @@ export default {
|
|
|
const workBook = xlsx.read(dataBinary, { type: 'binary', cellDates: true })
|
|
const workBook = xlsx.read(dataBinary, { type: 'binary', cellDates: true })
|
|
|
const workSheet = workBook.Sheets[workBook.SheetNames[0]]
|
|
const workSheet = workBook.Sheets[workBook.SheetNames[0]]
|
|
|
const data = xlsx.utils.sheet_to_json(workSheet)
|
|
const data = xlsx.utils.sheet_to_json(workSheet)
|
|
|
|
|
+ if (!this.form.lei_xing_) {
|
|
|
|
|
+ return this.$message.warning('请先选择类型!')
|
|
|
|
|
+ }
|
|
|
if (data.length === 0) {
|
|
if (data.length === 0) {
|
|
|
return this.$message.warning('文件内容为空!')
|
|
return this.$message.warning('文件内容为空!')
|
|
|
}
|
|
}
|
|
@@ -1246,7 +1295,8 @@ export default {
|
|
|
deviceno2_: item['监控设备编号'] || '',
|
|
deviceno2_: item['监控设备编号'] || '',
|
|
|
jian_ce_ri_qi_: '',
|
|
jian_ce_ri_qi_: '',
|
|
|
ri_qi_lie_biao_: '',
|
|
ri_qi_lie_biao_: '',
|
|
|
- zi_wai_deng_wai_j: this.$utils.guid()
|
|
|
|
|
|
|
+ zi_wai_deng_wai_j: this.$utils.guid(),
|
|
|
|
|
+ lie_biao_shu_ju_: this.form.lie_biao_shu_ju_
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
this.$message.success('导入成功!')
|
|
this.$message.success('导入成功!')
|