工艺管理-生产工序-修改/新增界面-辅助设备页面

yangwl
A0010407 1 year ago
parent b7ab73d87c
commit 3c857c1889

@ -2,43 +2,51 @@ import request from '@/utils/request'
// 查询设备管理列表
export function listEquipment(query) {
return request({
url: '/wms/equipment/list',
method: 'get',
params: query
});
return request({
url: '/wms/equipment/list',
method: 'get',
params: query
});
}
// 查询设备管理详细
export function getEquipment(equipmentId) {
return request({
url: '/wms/equipment/' + equipmentId,
method: 'get'
});
return request({
url: '/wms/equipment/' + equipmentId,
method: 'get'
});
}
// 新增设备管理
export function addEquipment(data) {
return request({
url: '/wms/equipment',
method: 'post',
data: data
});
return request({
url: '/wms/equipment',
method: 'post',
data: data
});
}
// 修改设备管理
export function updateEquipment(data) {
return request({
url: '/wms/equipment',
method: 'put',
data: data
});
return request({
url: '/wms/equipment',
method: 'put',
data: data
});
}
// 删除设备管
// 删除设备管
export function delEquipment(equipmentId) {
return request({
url: '/wms/equipment/' + equipmentId,
method: 'delete'
});
return request({
url: '/wms/equipment/' + equipmentId,
method: 'delete'
});
}
// 查询部门下拉树结构
export function treeselect() {
return request({
url: '/wms/equipment/tree',
method: 'get'
})
}

@ -8,7 +8,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:pro:processcontent:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
@ -19,7 +19,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:pro:processcontent:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
@ -30,7 +30,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:pro:processcontent:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
@ -40,7 +40,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:processcontent:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -60,14 +60,14 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:processcontent:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:processcontent:remove']"
>删除</el-button>
</template>
</el-table-column>
@ -100,7 +100,10 @@
<el-row>
<el-col :span="12">
<el-form-item label="辅助设备" prop="device">
<el-input v-model="form.device" placeholder="请输入辅助设备" />
<el-input v-model="form.device" placeholder="请选择辅助设备" >
<el-button slot="append" @click="handleSelectEquipment" icon="el-icon-search"></el-button>
</el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
</el-form-item>
</el-col>
<el-col :span="12">
@ -129,16 +132,15 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
</div>
</template>
<script>
import { listProcesscontent, getProcesscontent, delProcesscontent, addProcesscontent, updateProcesscontent } from "@/api/technology/processcontent";
import ItemSelect from "@/components/itemSelect/index.vue";
import ItemSelect from "./single.vue";
export default {
name: "Processcontent",
components: { ItemSelect },
components: {ItemSelect},
data() {
return {
//
@ -188,6 +190,26 @@ export default {
this.getList();
},
methods: {
//
onItemSelected(obj){
if(obj != undefined && obj != null){
console.log('返回',obj);
if(this.form.device == null){
//obj = obj.slice(1);
console.log("if获取的",obj);
console.log("if获取的device",this.form.device);
this.form.device = obj;
}else{
console.log("else获取的",obj);
console.log("else获取的device",this.form.device);
this.form.device = this.form.device +","+obj;
}
}
},
//
handleSelectEquipment(){
this.$refs.itemSelect.showFlag = true;
},
/** 查询生产工序内容列表 */
getList() {
this.loading = true;

@ -355,7 +355,6 @@ export default {
}
]
}],
useTypeKey:0,
//
autoGenFlag:false,
optType: undefined,
@ -427,17 +426,11 @@ export default {
},
fileList:[],
equipmentId:'',
watch: {
equipmentTypeName(val) {
this.$refs.tree.filter(val);
}
}
};
},
created() {
this.getList();
this.getEquipmentList();
},
methods: {
activated(){

@ -0,0 +1,301 @@
<template>
<el-dialog title="设备选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1100px"
center
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-tree
:data="treeData"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--设备数据-->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入设备编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入设备名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleEquipmentSelectionChange" ref="myTable">
<el-table-column width="50" align="center" type="selection">
<!-- <template v-slot="scope">
<el-radio v-model="selectedItemId" :label="scope.row.itemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template> -->
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="设备编码" align="center" key="itemCode" prop="equipmentCode" v-if="columns[0].visible" >
</el-table-column>
<el-table-column label="设备类型编码" align="center" key="itemTypeCode" prop="equipmentTypeCode" v-if="columns[2].visible" >
</el-table-column>
<el-table-column label="设备名称" align="left" key="itemName" prop="equipmentName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitEquipmentForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment } from "@/api/wms/equipment";
import { treeselect } from "@/api/wms/equipment";
// import Treeselect from "@riophae/vue-treeselect";
// import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "MdItemSingle",
// components: { Treeselect },
data() {
return {
treeData: [{
id: '1',
label: '设备类别',
children: [{
id: 'equ_type_lg',
label: '料罐'
}, {
id: 'equ_type_cxj',
label: '成型机'
}, {
id: 'equ_type_hf',
label: '烘房'
}, {
id: 'equ_type_spj',
label: '收坯机'
}, {
id: 'equ_type_bzx',
label: '包装线'
}
]
}],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
itemList: null,
//
itemTypeOptions: undefined,
//
equipmentTypeCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
equipmentTypeCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
},
//
columns: [
{ key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true },
]
};
},
created() {
this.getList();
// this.getTreeselect();
},
methods: {
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
this.itemList = val
},
//
indexMethod(index){
return index+1 ;
},
//
/** 查询设备编码列表*/
getList() {
this.loading = true;
listEquipment(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询分类下拉树结构 */
// getTreeselect() {
// treeselect().then(response => {
// this.itemTypeOptions = response.rows;
// console.log(response.rows);
// num = response.total;
// for (let id of response.rows) {
// if(id == 'equ_type_lg'){
// lable = '';
// }else if(id == 'equ_type_hf'){
// lable = '';
// }else if(id == 'equ_type_cpj'){
// lable = '';
// }else if(id == 'equ_type_bzx'){
// lable = '线';
// }else if(id == 'equ_type_cxj'){
// lable = '';
// }
// }
// });
// },
//
filterNode(value, data) {
console.log(value, data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.equipmentTypeCode = data.id;
console.log(this.equipmentTypeCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// handleCurrent(row){
// if(row){
// this.selectedRows = row;
// }
// },
// handleRowDbClick(row){
// if(row){
// this.selectedRows = row;
// this.$emit('onSelected',this.selectedRows);
// this.showFlag = false;
// }
// },
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.equipmentCode);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
//
// handleRowChange(row) {
// debugger;
// if(row){
// this.selectedRows = row;
// }
// },
//
// confirmSelect(){
// if(this.selectedItemId ==null || this.selectedItemId==0){
// this.$notify({
// title:'',
// type:'warning',
// message: '!'
// });
// return;
// }
// this.$emit('onSelected',this.selectedRows);
// this.showFlag = false;
// }
//
submitEquipmentForm() {
const data = this.ids;
console.log("数据",data);
const equipmentCode = data.toString();
console.log("拆分数据",equipmentCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = equipmentCode;
}else{
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ equipmentCode;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
},
}
};
</script>

@ -90,10 +90,8 @@
</el-table-column>
<el-table-column label="设备名称" align="center" prop="equipmentName" />
<el-table-column label="规格型号" align="center" prop="equipmentSpec" />
<el-table-column label="设备类型ID" align="center" prop="equipmentTypeId" width="100"/>
<el-table-column label="设备类型编码" align="center" prop="equipmentTypeCode" width="100" />
<el-table-column label="设备类型名称" align="center" prop="equipmentTypeName" width="100"/>
<el-table-column label="所属车间ID" align="center" prop="workshopId" width="100"/>
<el-table-column label="所属车间编码" align="center" prop="workshopCode" width="100"/>
<el-table-column label="所属车间名称" align="center" prop="workshopName" width="100"/>
<el-table-column label="设备状态" align="center" prop="status" />
@ -151,8 +149,15 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备类型名称" prop="equipmentTypeName">
<el-input v-model="form.equipmentTypeName" placeholder="请输入设备类型名称" />
<el-form-item label="设备类型" prop="equipmentTypeCode">
<el-select v-model="form.equipmentTypeCode" placeholder="请选择设备类型">
<el-option
v-for="dict in dict.type.equ_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -212,6 +217,7 @@ import EquipmentBoundMaterials from "./equipmentBoundMaterials";
export default {
name: "Equipment",
components: {EquipmentBoundMaterials},
dicts: ['sys_normal_disable', 'equ_type'],
data() {
return {
//

Loading…
Cancel
Save