Commit cc4c8296 authored by 高宇's avatar 高宇

1.优化代码

parent 24d86333
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<el-button type="primary" class="tarButon" @click="upload">上传</el-button> <el-button type="primary" class="tarButon" @click="upload">上传</el-button>
</div> </div>
<!-- 第一个模板 --> <!-- 第一个模板 -->
<div v-if="showTable"> <div v-if="sheetForm">
<div class="tableArea" v-if="index === 0 || index=== 4"> <div class="tableArea" v-if="index === 0 || index=== 4">
<div class="measureTable"> <div class="measureTable">
<!-- 测量 --> <!-- 测量 -->
...@@ -434,7 +434,7 @@ ...@@ -434,7 +434,7 @@
:close-on-click-modal="false" append-to-body> :close-on-click-modal="false" append-to-body>
<el-form ref="sheetRef" :model="sheetForm" :rules="rules" label-width="80" label-position="right"> <el-form ref="sheetRef" :model="sheetForm" :rules="rules" label-width="80" label-position="right">
<el-form-item> <el-form-item>
<el-select v-model="sheetForm.sheetIndex" placeholder="请选择sheet页"> <el-select v-model="sheetForm.sheetIndex" clearable placeholder="请选择sheet页">
<el-option <el-option
v-for="(item,index) in sheetList" v-for="(item,index) in sheetList"
:key="index" :key="index"
...@@ -461,7 +461,7 @@ export default { ...@@ -461,7 +461,7 @@ export default {
props: { props: {
defaultIndex: { defaultIndex: {
type: Number, type: Number,
default: 0 default: null
}, },
defaultObject: { defaultObject: {
type: Object, type: Object,
...@@ -471,15 +471,9 @@ export default { ...@@ -471,15 +471,9 @@ export default {
type: String, type: String,
required: true required: true
}, },
defaultShow: {
type: String,
}
// 是否显示table 1:显示 0:不显示 // 是否显示table 1:显示 0:不显示
}, },
computed: { computed: {
showTable() {
return this.defaultShow === '1'
}
}, },
data() { data() {
return { return {
...@@ -494,7 +488,7 @@ export default { ...@@ -494,7 +488,7 @@ export default {
}, },
// 选中的sheet下坐表 // 选中的sheet下坐表
sheetForm: { sheetForm: {
sheetIndex: 0, sheetIndex: null,
}, },
rules: {}, rules: {},
// 选择sheet下拉框 // 选择sheet下拉框
...@@ -504,7 +498,9 @@ export default { ...@@ -504,7 +498,9 @@ export default {
methods: { methods: {
// 提交按钮 // 提交按钮
submitForm() { submitForm() {
console.log('1111') console.log('sheetIndex',this.sheetForm.sheetIndex)
if (this.sheetForm.sheetIndex !== null && this.sheetForm.sheetIndex !== '') {
console.log('111')
// 获取要预览的表格内容 // 获取要预览的表格内容
sheetData(this.sheetForm.sheetIndex).then(res => { sheetData(this.sheetForm.sheetIndex).then(res => {
let tempList = res.data let tempList = res.data
...@@ -742,12 +738,25 @@ export default { ...@@ -742,12 +738,25 @@ export default {
this.index = this.sheetForm.sheetIndex this.index = this.sheetForm.sheetIndex
this.dialogController.open = false this.dialogController.open = false
} }
console.log('form',this.form)
this.showTable = true
this.$emit('sheetIndex',this.index) this.$emit('sheetIndex',this.index)
this.$emit('tarFrom',this.form) this.$emit('tarFrom',this.form)
this.$emit('ShowTabel','1');
}) })
} else {
this.form.LD = []
this.form.LDA = []
this.form.WDAList = []
this.form.projectDList = []
this.form.LDB = []
this.form.WDBList = []
this.form.projectAList = []
this.form.projectCList = []
this.form.projetcBList = []
this.index = this.sheetForm.sheetIndex
this.dialogController.open = false
this.$emit('sheetIndex',null)
this.$emit('tarFrom',this.form)
}
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
......
...@@ -2321,7 +2321,7 @@ ...@@ -2321,7 +2321,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="标签四" name="fourthly"> <el-tab-pane label="标签四" name="fourthly">
<div class="fourTarContainer" style="height: 1100px"> <div class="fourTarContainer" style="height: 1100px">
<tagfour @ShowTabel="getIsShowTabel" :default-show="inspectJbAl2o3List.isShowTabel" :default-index="inspectJbAl2o3List.sheetIndex" :default-controls="controlsForm.approveStatus" :default-object="tabfourForm" @sheetIndex="handleSheetIndex" @tarFrom="handleTarForm"></tagfour> <tagfour @ShowTabel="getIsShowTabel" :default-index="inspectJbAl2o3List.sheetIndex" :default-controls="controlsForm.approveStatus" :default-object="tabfourForm" @sheetIndex="handleSheetIndex" @tarFrom="handleTarForm"></tagfour>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -2946,7 +2946,7 @@ export default { ...@@ -2946,7 +2946,7 @@ export default {
recode1: [], recode1: [],
recode2: [], recode2: [],
recode3: [], recode3: [],
sheetIndex: 0, sheetIndex: null,
ld: null, ld: null,
lda: null, lda: null,
ldb: null, ldb: null,
...@@ -4189,8 +4189,6 @@ export default { ...@@ -4189,8 +4189,6 @@ export default {
this.inspectJbAl2o3List.oneJcDate = response.data.oneJcDate this.inspectJbAl2o3List.oneJcDate = response.data.oneJcDate
this.inspectJbAl2o3List.twoJcUser = response.data.twoJcUser this.inspectJbAl2o3List.twoJcUser = response.data.twoJcUser
this.inspectJbAl2o3List.twoJcDate = response.data.twoJcDate this.inspectJbAl2o3List.twoJcDate = response.data.twoJcDate
this.inspectJbAl2o3List.isShowTabel = response.data.isShowTabel
console.log('isShowTabel',response.data.isShowTabel)
this.inspectJbAl2o3List.limitOne = response.data.limitOne this.inspectJbAl2o3List.limitOne = response.data.limitOne
this.inspectJbAl2o3List.limitTwo = response.data.limitTwo this.inspectJbAl2o3List.limitTwo = response.data.limitTwo
if (response.data.sheetIndex) { if (response.data.sheetIndex) {
...@@ -4832,8 +4830,7 @@ export default { ...@@ -4832,8 +4830,7 @@ export default {
projecta: null, projecta: null,
projectb: null, projectb: null,
projectc: null, projectc: null,
projectd: null, projectd: null
isShowTabel: '0',
} }
}, },
/** /**
...@@ -4919,6 +4916,7 @@ export default { ...@@ -4919,6 +4916,7 @@ export default {
this.getRecordInfo(response.data.incomeInspectInfo.businessId) this.getRecordInfo(response.data.incomeInspectInfo.businessId)
this.controlsForm.approveStatus = '0' this.controlsForm.approveStatus = '0'
this.controlsForm.controls = '2' this.controlsForm.controls = '2'
this.inspectJbAl2o3List.sheetIndex = null
this.submitLoadIng = false this.submitLoadIng = false
} else { } else {
this.submitLoadIng = false this.submitLoadIng = false
...@@ -4999,6 +4997,7 @@ export default { ...@@ -4999,6 +4997,7 @@ export default {
this.presentLoading = false this.presentLoading = false
this.controlsForm.approveStatus = '0' this.controlsForm.approveStatus = '0'
this.controlsForm.controls = '2' this.controlsForm.controls = '2'
this.inspectJbAl2o3List.sheetIndex = null
this.msgSuccess('提交成功') this.msgSuccess('提交成功')
this.resetInspectInfo() this.resetInspectInfo()
this.resetinspectJbAl2o3List() this.resetinspectJbAl2o3List()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment