计量设备月检验报表
parent
8790a91493
commit
222d84ee38
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<el-dialog :title="'选择设备' + (multiple?'(多选)':'(单选)')" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" >
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input
|
||||
v-model="queryParams.equipmentCode"
|
||||
placeholder="请输入设备编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.native.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshopCode">
|
||||
<el-select
|
||||
v-model="queryParams.workshopCode"
|
||||
placeholder="请选择工单类型"
|
||||
style="width: 200px"
|
||||
:clearable="false"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workCenterList"
|
||||
:key="item.factoryCode"
|
||||
:label="item.factoryName"
|
||||
:value="item.factoryCode"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-table
|
||||
ref="refTable"
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
@current-change="handleCurrentChange"
|
||||
@selection-change="handleSelectionChange"
|
||||
:highlight-current-row="!multiple"
|
||||
>
|
||||
<el-table-column type="selection" v-if="multiple" width="55" />
|
||||
<el-table-column label="设备编码" prop="equipmentCode" show-overflow-tooltip />
|
||||
<el-table-column label="设备名称" prop="equipmentName" show-overflow-tooltip />
|
||||
<el-table-column label="所属车间" prop="workshopCode" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelect(true)">确认选择</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script >
|
||||
import {listEquipment} from "@/api/wms/equipment";
|
||||
import {getWorkCenter} from "@/api/device/plan";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
data: [],
|
||||
tableHeight: '',
|
||||
visible: false,
|
||||
total: 0,
|
||||
result: null,
|
||||
queryParams: {
|
||||
...this.params,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyword: undefined
|
||||
},
|
||||
workCenterList:[]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getWorkCenter().then((response) => {
|
||||
this.workCenterList = response.data;
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 显示弹框
|
||||
show() {
|
||||
this.visible = true;
|
||||
},
|
||||
|
||||
// 查询表数据
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listEquipment(this.queryParams)
|
||||
.then(res => {
|
||||
this.data = res.rows;
|
||||
this.total = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
// 多选选中数据
|
||||
handleSelectionChange(res) {
|
||||
if (this.multiple) {
|
||||
this.result = res;
|
||||
}
|
||||
},
|
||||
|
||||
// 单选选中数据
|
||||
handleCurrentChange(res) {
|
||||
if (!this.multiple) {
|
||||
this.result = res;
|
||||
}
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.$refs.queryRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 确认选择 */
|
||||
confirmSelect(close) {
|
||||
if (!this.result || (this.multiple && !this.result.length)) {
|
||||
return this.$modal.msgError("请选择设备");
|
||||
}
|
||||
this.$emit("confirm", this.result);
|
||||
if (close) {
|
||||
this.visible = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
expose: ['show']
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue