<template>
|
<el-drawer
|
direction="rtl"
|
:visible.sync="visible"
|
@close="handleClose"
|
size="50%">
|
<div class="mod-app-menu" style="padding: 5px;">
|
<el-form :inline="true" :model="dataForm" ref="dataForm" @keyup.enter.native="getDataList()" label-width="10px">
|
<el-form-item prop="mcName">
|
<el-input size="mini" v-model="dataForm.mcName" placeholder="煤仓名称"
|
clearable></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="mini" @click="getDataList()">{{ $t('query') }}</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="mini" v-if="$hasPermission('sys:dict:save')" type="primary" @click="openForm()">{{
|
$t('add') }}
|
</el-button>
|
</el-form-item>
|
</el-form>
|
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
|
<el-table-column prop="mcName" label="煤仓名" header-align="center"
|
align="center" min-width="100"></el-table-column>
|
<el-table-column prop="mc" label="煤仓编号" header-align="center"
|
align="center" min-width="100"></el-table-column>
|
<el-table-column prop="unit" label="单位" header-align="center" min-width="50"
|
align="den"></el-table-column>
|
<el-table-column prop="capacity" label="仓容量" header-align="center" min-width="50"
|
align="center"></el-table-column>
|
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" min-width="100">
|
<template slot-scope="scope">
|
<el-button v-if="$hasPermission('sys:menu:update')" type="text" size="small" @click="openForm(scope.row.id)">修改</el-button>
|
<el-button v-if="$hasPermission('sys:menu:delete')" type="text" size="small" @click="handleDelete(scope.row.id)">删除</el-button>
|
<el-button type="text" size="small" @click="mzHandle(scope.row.mc)">煤种</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
:current-page="page"
|
:page-sizes="[10, 20, 50, 100]"
|
:page-size="limit"
|
:total="total"
|
layout="total, sizes, prev, pager, next, jumper"
|
@size-change="pageSizeChangeHandle"
|
@current-change="pageCurrentChangeHandle">
|
</el-pagination>
|
<!-- 弹窗, 新增 / 修改 -->
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
<mz-management v-if="mzVisible" ref="mz" @refreshDataList="getDataList"></mz-management>
|
</div>
|
</el-drawer>
|
</template>
|
<script>
|
import mixinViewModule from '@/mixins/view-module'
|
import AddOrUpdate from './item-add-or-update'
|
import MzManagement from './mz'
|
import {getDictItem} from "@/utils/dictUtils";
|
|
export default {
|
mixins: [mixinViewModule],
|
data() {
|
return {
|
mixinViewModuleOptions: {
|
createdIsNeed: false,
|
getDataListURL: '/iailab-iems-coal-proddisp/warehouse/item/page',
|
getDataListIsPage: true,
|
deleteURL: '/iailab-iems-coal-proddisp/warehouse/item',
|
deleteIsBatch: true
|
},
|
mzVisible: false,
|
visible: false,
|
dataForm: {
|
id:'',
|
dictId: '',
|
mclx: '',
|
mcName: ''
|
},
|
dictCodeMz: '',
|
}
|
},
|
components: {
|
AddOrUpdate,
|
MzManagement
|
},
|
methods: {
|
init(id, mclx) {
|
this.dataForm.dictId = id
|
this.dataForm.mclx = mclx
|
this.visible = true
|
this.$nextTick(() => {
|
this.getDataList()
|
})
|
if ('ymc' === mclx) {
|
this.dictCodeMz = 'ymmz'
|
} else if ('cpc' === mclx) {
|
this.dictCodeMz = 'cpmz'
|
}
|
},
|
|
getDictItemValue(value) {
|
let data = getDictItem(this.dictCodeMz, value)
|
return data ? data.itemText : '';
|
},
|
|
openForm(id) {
|
this.addOrUpdateVisible = true
|
this.$nextTick(() => {
|
this.$refs.addOrUpdate.init(id,this.dataForm.mclx)
|
})
|
},
|
|
mzHandle(mc) {
|
this.mzVisible = true
|
this.$nextTick(() => {
|
this.$refs.mz.init(mc,this.dataForm.mclx)
|
})
|
},
|
|
handleClose() {
|
this.$refs['dataForm'].resetFields()
|
this.dataList = []
|
}
|
}
|
}
|
</script>
|