工厂选择+设备选择

master
A0010407 1 year ago
parent 0f4f8ec394
commit 13dd814849

@ -50,3 +50,11 @@ export function treeselect() {
method: 'get' method: 'get'
}) })
} }
// 查询设备类型
export function getEquipmentTypeList() {
return request({
url: '/wms/equipment/getEquipmentTypeList',
method: 'get'
});
}

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item label="设备编码" prop="equipmentCode">
<el-input <el-input
v-model="queryParams.equipmentCode" v-model="queryParams.equipmentCode"
@ -17,14 +17,17 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="设备类型编码" prop="equipmentTypeCode"> <el-form-item label="设备类型" prop="equipmentTypeCode">
<el-input <el-select
v-model="queryParams.equipmentTypeCode" v-model="queryParams.equipmentTypeCode"
placeholder="请输入设备类型编码" placeholder="请选择设备类型"
clearable @change="$forceUpdate()"
@keyup.enter.native="handleQuery" clearable
/> style="width:205px"
</el-form-item> @keyup.enter.native="handleQuery">
<el-option v-for="item in equipmentTypeOption" :key="item.equipmentTypeCode" :label="item.equipmentTypeName" :value="item.equipmentTypeCode"></el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -97,8 +100,8 @@
>{{scope.row.equipmentCode}}</el-button> >{{scope.row.equipmentCode}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备名称" align="center" prop="equipmentName" /> <el-table-column label="设备名称" align="center" prop="equipmentName" width="120"/>
<el-table-column label="规格型号" align="center" prop="equipmentSpec" /> <el-table-column label="规格型号" align="center" prop="equipmentSpec" width="120"/>
<el-table-column label="设备类型编码" align="center" prop="equipmentTypeCode" width="120" /> <el-table-column label="设备类型编码" align="center" prop="equipmentTypeCode" width="120" />
<el-table-column label="设备类型名称" align="center" prop="equipmentTypeName" width="120"/> <el-table-column label="设备类型名称" align="center" prop="equipmentTypeName" width="120"/>
<el-table-column label="所属工作中心编码" align="center" prop="workshopCode" width="150"/> <el-table-column label="所属工作中心编码" align="center" prop="workshopCode" width="150"/>
@ -391,15 +394,16 @@
</template> </template>
<script> <script>
import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment} from "@/api/wms/equipment"; import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment,getEquipmentTypeList} from "@/api/wms/equipment";
import { getWorkCenterList,listFactory} from "@/api/wms/factory"; import { getWorkCenterList,listFactory} from "@/api/wms/factory";
export default { export default {
name: "Equipment", name: "Equipment",
dicts: ['sys_normal_disable', 'equ_type'], dicts: ['sys_normal_disable', 'equ_type'],
data() { data() {
return { return {
workCenter:[], equipmentTypeOption:[],
options1: [], workCenter:[],
options1: [],
value: '', value: '',
// //
loading: true, loading: true,
@ -466,8 +470,17 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getEquipmentType();
}, },
methods: { methods: {
/** 查询设备分类 */
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.equipmentTypeOption = response.rows;
console.log(this.treeData1);
});
},
selectWorkCenter(){ selectWorkCenter(){
this.form.workshopCode = this.form.workCenter; this.form.workshopCode = this.form.workCenter;
}, },

@ -18,16 +18,16 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="启用状态" prop="status"> <el-form-item label="启用状态" prop="status">
<el-input <el-select
v-model="queryParams.status" v-model="queryParams.status"
placeholder="请输入启用状态(1/0)" placeholder="请选择启用状态"
clearable @change="$forceUpdate()"
@keyup.enter.native="handleQuery" clearable
/> style="width:205px"
<!-- <el-select v-model="form.status" placeholder="请选择是否启用" @change="$forceUpdate()" clearable> @keyup.enter.native="handleQuery">
<el-option v-for="item in options" :key="item.status" :label="item.label" :value="item.status"></el-option> <el-option v-for="item in options" :key="item.status" :label="item.label" :value="item.status"></el-option>
</el-select> --> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -71,7 +71,7 @@
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column prop="status" label="是否启用" align="center" > <el-table-column prop="status" label="是否启用" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status == 1 ? "是" : "否" }} {{ scope.row.status == 1 ? "启用" : "停用" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -177,10 +177,10 @@ export default {
}, },
options: [{ options: [{
status: "1", status: "1",
label: '' label: '启用'
}, { }, {
status: "0", status: "0",
label: '' label: '停用'
}], }],
// //
form: {}, form: {},

Loading…
Cancel
Save