|
@@ -19,10 +19,13 @@
|
|
|
<div class="container">
|
|
<div class="container">
|
|
|
<div class="main">
|
|
<div class="main">
|
|
|
<div class="form">
|
|
<div class="form">
|
|
|
- <el-form ref="form" :model="form" label-width="120px" :rules="rules">
|
|
|
|
|
|
|
+ <el-form ref="form" :model="form" label-width="120px" :rules="rules" :hide-required-asterisk="true">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="类型:" prop="lei_xing_">
|
|
<el-form-item label="类型:" prop="lei_xing_">
|
|
|
|
|
+ <template slot="label">
|
|
|
|
|
+ <span class="required">类型</span>
|
|
|
|
|
+ </template>
|
|
|
<el-select v-model="form.lei_xing_" placeholder="请选择" size="mini" style="width:80%">
|
|
<el-select v-model="form.lei_xing_" placeholder="请选择" size="mini" style="width:80%">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="(value,key) in config"
|
|
v-for="(value,key) in config"
|
|
@@ -350,9 +353,8 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
|
|
+ <FecDialog v-if="subDialogVisible" ref="FecDialogRef" @onSubmit="sonSubmit" @onClose="sonClose" />
|
|
|
</div>
|
|
</div>
|
|
|
- <FecDialog v-if="subDialogVisible" ref="FecDialogRef" @onSubmit="sonSubmit" @onClose="sonClose" />
|
|
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -582,26 +584,26 @@ export default {
|
|
|
switch (val) {
|
|
switch (val) {
|
|
|
case '01-室内温湿度监控':
|
|
case '01-室内温湿度监控':
|
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
|
- { label: '上午温度', range: [], fixValue: '', value: '', result: '', status: '' },
|
|
|
|
|
- { label: '上午湿度', range: [], fixValue: '', value: '', result: '', status: '' },
|
|
|
|
|
- { label: '下午温度', range: [], fixValue: '', value: '', result: '', status: '' },
|
|
|
|
|
- { label: '下午湿度', range: [], fixValue: '', value: '', result: '', status: '' }
|
|
|
|
|
|
|
+ { label: '上午温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' },
|
|
|
|
|
+ { label: '上午湿度', range: [], fixValue: '', value: '', result: '', status: '', unit: '%' },
|
|
|
|
|
+ { label: '下午温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' },
|
|
|
|
|
+ { label: '下午湿度', range: [], fixValue: '', value: '', result: '', status: '', unit: '%' }
|
|
|
])
|
|
])
|
|
|
break
|
|
break
|
|
|
case '02-冰箱温度监控':
|
|
case '02-冰箱温度监控':
|
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
|
- { label: '冷藏', range: [], fixValue: '', value: '', result: '', status: '' },
|
|
|
|
|
- { label: '冷冻', range: [], fixValue: '', value: '', result: '', status: '' }
|
|
|
|
|
|
|
+ { label: '冷藏', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' },
|
|
|
|
|
+ { label: '冷冻', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
|
|
|
])
|
|
])
|
|
|
break
|
|
break
|
|
|
case '03-温浴箱温度监控':
|
|
case '03-温浴箱温度监控':
|
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
|
- { label: '温度', range: [], fixValue: '', value: '', result: '', status: '' }
|
|
|
|
|
|
|
+ { label: '温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
|
|
|
])
|
|
])
|
|
|
break
|
|
break
|
|
|
case '04-阴凉柜温度监控':
|
|
case '04-阴凉柜温度监控':
|
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
this.form.lie_biao_shu_ju_ = JSON.stringify([
|
|
|
- { label: '温度', range: [], fixValue: '', value: '', result: '', status: '' }
|
|
|
|
|
|
|
+ { label: '温度', range: [], fixValue: '', value: '', result: '', status: '', unit: '℃' }
|
|
|
])
|
|
])
|
|
|
break
|
|
break
|
|
|
default:
|
|
default:
|
|
@@ -930,15 +932,22 @@ export default {
|
|
|
if (item.lie_biao_shu_ju_ && this.form.lie_biao_shu_ju_) {
|
|
if (item.lie_biao_shu_ju_ && this.form.lie_biao_shu_ju_) {
|
|
|
const main = JSON.parse(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_)
|
|
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)
|
|
|
|
|
|
|
+ if (sub.length === 0) {
|
|
|
|
|
+ item.lie_biao_shu_ju_ = JSON.stringify(sub)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sub.length > 0) {
|
|
|
|
|
+ sub.forEach((i, index) => {
|
|
|
|
|
+ if (i.label === main[index].label && (i.range.length === 0 || i.range.join(',') === [null, null].join(',') || i.range.join(',') === ['', ''].join(','))) {
|
|
|
|
|
+ i.range = main[index].range
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i.label === main[index].label && i.fixValue === '') {
|
|
|
|
|
+ i.fixValue = main[index].fixValue
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ item.lie_biao_shu_ju_ = JSON.stringify(sub)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.lie_biao_shu_ju_ = this.form.lie_biao_shu_ju_
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
@@ -1030,7 +1039,7 @@ export default {
|
|
|
handleSelectionChange (val) {
|
|
handleSelectionChange (val) {
|
|
|
this.multipleSelection = val
|
|
this.multipleSelection = val
|
|
|
},
|
|
},
|
|
|
- submit () {
|
|
|
|
|
|
|
+ async submit () {
|
|
|
if (this.subForm.length === 0) {
|
|
if (this.subForm.length === 0) {
|
|
|
return this.$message.warning('请添加子表数据')
|
|
return this.$message.warning('请添加子表数据')
|
|
|
}
|
|
}
|
|
@@ -1088,7 +1097,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
- this.$common.request('update', params).then(() => {
|
|
|
|
|
|
|
+ await this.$common.request('update', params).then(async () => {
|
|
|
console.log('主表更新数据成功')
|
|
console.log('主表更新数据成功')
|
|
|
if (addList.length) {
|
|
if (addList.length) {
|
|
|
const params = {
|
|
const params = {
|
|
@@ -1113,7 +1122,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- this.$common.request('add', params).then(() => { console.log('子表添加数据成功') })
|
|
|
|
|
|
|
+ await this.$common.request('add', params).then(() => { console.log('子表添加数据成功') })
|
|
|
}
|
|
}
|
|
|
if (updateList.length) {
|
|
if (updateList.length) {
|
|
|
const params = {
|
|
const params = {
|
|
@@ -1139,14 +1148,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
}))
|
|
}))
|
|
|
}
|
|
}
|
|
|
- this.$common.request('update', params).then(() => { console.log('子表更新数据成功') })
|
|
|
|
|
|
|
+ await this.$common.request('update', params).then(() => { console.log('子表更新数据成功') })
|
|
|
}
|
|
}
|
|
|
if (deleteList.length) {
|
|
if (deleteList.length) {
|
|
|
const params = {
|
|
const params = {
|
|
|
tableName: 't_sshjpzxq',
|
|
tableName: 't_sshjpzxq',
|
|
|
paramWhere: { zi_wai_deng_wai_j: deleteList.join(',') }
|
|
paramWhere: { zi_wai_deng_wai_j: deleteList.join(',') }
|
|
|
}
|
|
}
|
|
|
- this.$common.request('delete', params).then(() => { console.log('子表删除数据成功') })
|
|
|
|
|
|
|
+ await this.$common.request('delete', params).then(() => { console.log('子表删除数据成功') })
|
|
|
}
|
|
}
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$message.success('修改成功!')
|
|
this.$message.success('修改成功!')
|
|
@@ -1160,7 +1169,7 @@ export default {
|
|
|
...this.form
|
|
...this.form
|
|
|
}]
|
|
}]
|
|
|
}
|
|
}
|
|
|
- this.$common.request('add', params).then((res) => {
|
|
|
|
|
|
|
+ await this.$common.request('add', params).then(async (res) => {
|
|
|
console.log('主表新增数据成功')
|
|
console.log('主表新增数据成功')
|
|
|
const { cont = [] } = res.variables || {}
|
|
const { cont = [] } = res.variables || {}
|
|
|
if (addList.length) {
|
|
if (addList.length) {
|
|
@@ -1186,7 +1195,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- this.$common.request('add', params).then(() => {
|
|
|
|
|
|
|
+ await this.$common.request('add', params).then(() => {
|
|
|
this.$message.success('添加成功!')
|
|
this.$message.success('添加成功!')
|
|
|
console.log('子表添加数据成功')
|
|
console.log('子表添加数据成功')
|
|
|
this.closeDialog()
|
|
this.closeDialog()
|
|
@@ -1246,7 +1255,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 执行所有请求
|
|
// 执行所有请求
|
|
|
- Promise.all(allRequests)
|
|
|
|
|
|
|
+ await Promise.all(allRequests)
|
|
|
.then(() => console.log('所有请求完成'))
|
|
.then(() => console.log('所有请求完成'))
|
|
|
.catch(error => console.error('请求出错:', error))
|
|
.catch(error => console.error('请求出错:', error))
|
|
|
}
|
|
}
|
|
@@ -1450,13 +1459,23 @@ export default {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
-
|
|
|
|
|
|
|
+ .el-row{
|
|
|
|
|
+ margin: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .required{
|
|
|
|
|
+ color: #606266 !important;
|
|
|
|
|
+ &::before{
|
|
|
|
|
+ content: '*';
|
|
|
|
|
+ margin: 0 4px 0 -7.5px;
|
|
|
|
|
+ color: #F56C6C;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.main{
|
|
.main{
|
|
|
width: 80%;
|
|
width: 80%;
|
|
|
height: calc(100vh - 70px);
|
|
height: calc(100vh - 70px);
|
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
|
padding:20px;
|
|
padding:20px;
|
|
|
- // overflow-y: auto;
|
|
|
|
|
|
|
+ overflow-y: auto;
|
|
|
.form{
|
|
.form{
|
|
|
.el-row{
|
|
.el-row{
|
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|