<template>
|
<div class="mod-prod-plan-det">
|
<el-form :inline="true" :model="dataForm">
|
<el-form-item>
|
<span>入洗明细</span><span>【{{dataForm.lsh}}】</span>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="mini" @click="getDataList()">{{ $t('refresh') }}</el-button>
|
<el-button size="mini" type="primary" @click="openForm(dataForm.id)">新增</el-button>
|
</el-form-item>
|
</el-form>
|
<el-table
|
ref="table"
|
:data="dataList"
|
border
|
height="400"
|
highlight-current-row
|
v-loading="dataListLoading"
|
style="width: 100%;">
|
<el-table-column type="index" header-align="center" align="center" width="50" label="序号"></el-table-column>
|
<el-table-column prop="mzName" header-align="center" align="center" label="入洗煤种"></el-table-column>
|
<el-table-column prop="bl" header-align="center" align="center" label="入洗比例(%)"></el-table-column>
|
<el-table-column prop="rxl" header-align="center" align="center" label="入洗量"></el-table-column>
|
<el-table-column prop="bz" header-align="center" align="center" label="备注"></el-table-column>
|
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
<template slot-scope="scope">
|
<el-button type="text" size="small" @click="openForm(dataForm.id,scope.row.id)">修改</el-button>
|
<el-button type="text" size="small" @click="handleDelete(scope.row.id)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
</div>
|
</template>
|
<script>
|
import mixinViewModule from '@/mixins/view-module'
|
import AddOrUpdate from './list-add-or-update';
|
export default {
|
mixins: [mixinViewModule],
|
data() {
|
return {
|
dataList: [],
|
dataForm: {
|
id: '',
|
lsh: ''
|
},
|
dataListLoading: false
|
}
|
},
|
components: {
|
AddOrUpdate
|
},
|
methods: {
|
// 新增 或 修改
|
openForm (washId,id) {
|
if( washId == ''){
|
this.$alert('请先选择要编辑的总入洗量', '提示', {
|
confirmButtonText: '确定',
|
});
|
}else{
|
this.addOrUpdateVisible = true
|
this.$nextTick(() => {
|
this.$refs.addOrUpdate.init(id,washId)
|
})
|
}
|
},
|
//删除
|
handleDelete(id){
|
this.$confirm(`确定对所选项目进行[删除]操作?`, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.$http.post(`/iailab-iems-coal-proddisp/wash/to-wash/deleteDet/${id}`).then(({data: res}) => {
|
if (res.code !== 0) {
|
this.$message.error(data.msg)
|
} else {
|
this.$message({
|
message: '操作成功',
|
type: 'success',
|
duration: 1500,
|
})
|
this.getDataList()
|
}
|
})
|
}).catch(() => {})
|
},
|
|
init(row) {
|
this.dataForm.id = row.id || '0'
|
this.dataForm.lsh = row.lsh
|
this.$nextTick(() => {
|
this.getDataList()
|
})
|
},
|
// 获取数据列表
|
getDataList() {
|
this.dataListLoading = true
|
this.$http.get(`/iailab-iems-coal-proddisp/wash/to-wash/selectDetList/${this.dataForm.id}`).then(({data: res}) => {
|
if (res.code !== 0) {
|
return this.$message.error(res.msg)
|
this.dataListLoading = false
|
}
|
this.dataList = res.list
|
this.dataListLoading = false
|
}).catch(() => {
|
})
|
}
|
}
|
}
|
</script>
|