|
@@ -20,19 +20,23 @@
|
|
|
children:'Children',
|
|
|
label:'ClassifyName',
|
|
|
value:'BaseFromMysteelChemicalClassifyId',
|
|
|
- multiple:true
|
|
|
+ multiple:true,
|
|
|
+ emitPath:false,
|
|
|
}"
|
|
|
:placeholder="$t('Edb.InputHolderAll.input_classify')"
|
|
|
@change="getEdbList"
|
|
|
></el-cascader>
|
|
|
- <el-input style="width:240px;"
|
|
|
+ <el-input style="width:240px;" v-model="searchName"
|
|
|
:placeholder="$t('Edb.InputHolderAll.input_name_orid')"
|
|
|
prefix-icon="el-icon-search"
|
|
|
@input="getEdbList"
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="select-table">
|
|
|
- <el-table :data="edbList" border @selection-change="handleSelectionChange">
|
|
|
+ <el-table :data="edbList" border
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ v-loading="tableLoading">
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
|
|
<el-table-column :label="$t('Edb.Detail.e_id')" align="center" width="120" prop="edbId"></el-table-column>
|
|
|
<el-table-column :label="$t('Table.edb_name')" align="center">
|
|
@@ -133,13 +137,18 @@ export default {
|
|
|
frequency:'日度',
|
|
|
unit:'吨',
|
|
|
classify:'',
|
|
|
+ isHighlight:false
|
|
|
}, */
|
|
|
],
|
|
|
+ tableLoading:false,
|
|
|
edbClassifyList:[],//指标库目录
|
|
|
selectEdbList:[]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ tableRowClassName({row}){
|
|
|
+ return row.isHighlight?'highlight-row':''
|
|
|
+ },
|
|
|
initDia(){
|
|
|
this.getClassifyList()
|
|
|
this.getClassifyOpt()
|
|
@@ -177,34 +186,25 @@ export default {
|
|
|
this.selectEdbList = []
|
|
|
this.classifyType = 1
|
|
|
//tableData
|
|
|
- this.edbList = [{
|
|
|
- edbId:'123456',
|
|
|
- edbName:'指标名称指标名称',
|
|
|
- frequency:'日度',
|
|
|
- unit:'吨',
|
|
|
- classify:'',
|
|
|
- },
|
|
|
- {
|
|
|
- edbId:'654321',
|
|
|
- edbName:'22222',
|
|
|
- frequency:'日度',
|
|
|
- unit:'吨',
|
|
|
- classify:'',
|
|
|
- },
|
|
|
- {
|
|
|
- edbId:'77777',
|
|
|
- edbName:'11111',
|
|
|
- frequency:'日度',
|
|
|
- unit:'吨',
|
|
|
- classify:'',
|
|
|
- },
|
|
|
- {
|
|
|
- edbId:'888888',
|
|
|
- edbName:'指标名称指标名称',
|
|
|
- frequency:'日度',
|
|
|
- unit:'吨',
|
|
|
- classify:'',
|
|
|
- },]
|
|
|
+ this.tableLoading = true
|
|
|
+ steelInterface.searchEdbBatch({
|
|
|
+ BaseFromMysteelChemicalClassifyIds:Array.isArray(this.searchClassify)?this.searchClassify.join(','):'',
|
|
|
+ Keyword:this.searchName||''
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableLoading = false
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.edbList = res.Data?res.Data.map(item=>{
|
|
|
+ return {
|
|
|
+ edbId:item.IndexCode||'',
|
|
|
+ edbName:item.IndexName||'',
|
|
|
+ frequency:item.FrequencyName||'',
|
|
|
+ unit:item.UnitName||'',
|
|
|
+ classify:'',
|
|
|
+ isHighlight:false
|
|
|
+ }
|
|
|
+ }):[]
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
handleSelectionChange(val){
|
|
|
this.selectEdbList = val
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
handleAddEdb(){
|
|
|
//校验所选指标
|
|
|
if(!this.selectEdbList.length){
|
|
|
- return this.$message.warning(this.$t('InputHolderAll.input_select_edb'))
|
|
|
+ return this.$message.warning(this.$t('Edb.InputHolderAll.input_select_edb'))
|
|
|
}
|
|
|
if(this.selectEdbList.length>30){
|
|
|
return this.$message.warning(this.$t('SteelChemicalPage.batch_add_max_msg'))
|
|
@@ -225,14 +225,16 @@ export default {
|
|
|
|
|
|
let messageList = [] //有问题的列表
|
|
|
this.selectEdbList.forEach((item)=>{
|
|
|
- let checkResult = checkEdbData(item)
|
|
|
- if(checkEdbData(item)){
|
|
|
+ let checkResult = this.checkEdbData(item)
|
|
|
+ if(!this.checkEdbData(item)){
|
|
|
+ item.isHighlight = true
|
|
|
messageList.push(item)
|
|
|
}
|
|
|
})
|
|
|
//message轻提示 同时标出不完整的行
|
|
|
if(messageList.length){
|
|
|
-
|
|
|
+ this.$message.warning('指标信息未填写完整,请检查')
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -241,7 +243,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
checkEdbData(edbData){
|
|
|
- return !(!edbData.edbName||!edbData.frequency||!edbData.unit||this.classifyType===1?(!edbData.classify):false)
|
|
|
+ return edbData.edbName&&edbData.frequency&&edbData.unit&&(this.classifyType===1?edbData.classify:true)
|
|
|
},
|
|
|
batchAddEdb(){
|
|
|
//获取添加结果
|
|
@@ -258,6 +260,9 @@ export default {
|
|
|
.el-input{
|
|
|
width:100%;
|
|
|
}
|
|
|
+ .el-table .highlight-row{
|
|
|
+ background-color:#fef0f0 !important;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|