设备绑定辅助设备

yangwl
A0010407 10 months ago
parent 8e8e847ecf
commit 1215f67a96

@ -328,6 +328,7 @@
<el-step title="设备使用状况"></el-step> <el-step title="设备使用状况"></el-step>
<el-step title="设备资产信息"></el-step> <el-step title="设备资产信息"></el-step>
<el-step title="设备绑定备件"></el-step> <el-step title="设备绑定备件"></el-step>
<el-step title="设备绑定辅助设备"></el-step>
</el-steps> </el-steps>
</div> </div>
<!-- 维修基本信息 --> <!-- 维修基本信息 -->
@ -512,24 +513,23 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备负责人" prop="equipmentHeadName"> <el-form-item label="设备负责人" prop="equipmentHead">
<el-select <el-input
v-model="queryParams.equipmentHeadName" v-model="form.equipmentHead"
placeholder="请选择设备负责人" placeholder="请选择设备负责人"
@change="$forceUpdate()" >
filterable <el-button
clearable slot="append"
style="width: 195px" @click="handleSelectPerson"
@keyup.enter.native="handleQuery" icon="el-icon-search"
> ></el-button>
<el-option </el-input>
v-for="item in equipmentHeadOption" <ItemSelectPerson
:key="item.userName" ref="itemSelectPerson"
:label="item.teamUserName" @onSelected="onItemSelectedPerson"
:value="item.userName" >
></el-option> </ItemSelectPerson>
</el-select> </el-form-item>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -617,7 +617,7 @@
</el-row> </el-row>
</div> </div>
<!-- 维修基本信息 --> <!-- 设备绑定备件 -->
<div v-if="this.repairRecordSteps == 3" class="step-body"> <div v-if="this.repairRecordSteps == 3" class="step-body">
<template> <template>
<el-transfer <el-transfer
@ -631,16 +631,32 @@
</el-transfer> </el-transfer>
</template> </template>
</div> </div>
<!-- 设备绑定辅助设备 -->
<div v-if="this.repairRecordSteps == 4" class="step-body">
<template>
<el-transfer
filterable
filter-placeholder="请输入辅助设备名称"
v-model="auxiliaryEquipmentRightList"
:titles="['未绑定辅助设备列表', '已绑定辅助设备列表']"
:button-texts="['取消', '绑定']"
:data="auxiliaryEquipmentLeftList"
>
</el-transfer>
</template>
</div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button v-if="this.repairRecordSteps > 0" @click="stepLast" <el-button v-if="this.repairRecordSteps > 0" @click="stepLast"
>上一步</el-button >上一步</el-button
> >
<el-button v-if="this.repairRecordSteps < 3" @click="stepNext" <el-button v-if="this.repairRecordSteps < 4" @click="stepNext"
>下一步</el-button >下一步</el-button
> >
<el-button <el-button
v-if="this.repairRecordSteps == 3" v-if="this.repairRecordSteps == 4"
type="primary" type="primary"
@click="submitForm" @click="submitForm"
> </el-button > </el-button
@ -719,7 +735,7 @@
form.department form.department
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="设备负责人">{{ <el-descriptions-item label="设备负责人">{{
form.equipmentHeadName form.equipmentHead
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
@ -890,11 +906,12 @@ import { listTeamMembers } from "@/api/wms/team";
import EquipmentSpareParts from "./single.vue"; import EquipmentSpareParts from "./single.vue";
import { Message } from "element-ui"; import { Message } from "element-ui";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import ItemSelectPerson from "./single.vue";
export default { export default {
name: "Equipment", name: "Equipment",
dicts: ["sys_normal_disable", "equ_type", "equipment_status"], dicts: ["sys_normal_disable", "equ_type", "equipment_status"],
components: { EquipmentSpareParts }, components: { EquipmentSpareParts ,ItemSelectPerson},
data() { data() {
return { return {
CS: { CS: {
@ -969,6 +986,9 @@ export default {
repairRecordSteps: 0, repairRecordSteps: 0,
leftList: [], leftList: [],
rightList: [], rightList: [],
//
auxiliaryEquipmentRightList:[],
auxiliaryEquipmentLeftList:[],
bind: undefined, bind: undefined,
imageFileList: [], imageFileList: [],
qrFileList: [], qrFileList: [],
@ -1108,16 +1128,13 @@ export default {
this.queryEquipmentHeadParams.pageNum = 1; this.queryEquipmentHeadParams.pageNum = 1;
this.queryEquipmentHeadParams.pageSize = 2000; this.queryEquipmentHeadParams.pageSize = 2000;
listTeamMembers(this.queryHeadParams).then((response) => { listTeamMembers(this.queryHeadParams).then((response) => {
console.log(response.rows);
this.equipmentHeadOption = response.rows; this.equipmentHeadOption = response.rows;
}); });
}, },
/** 查询设备分类 */ /** 查询设备分类 */
getEquipmentType() { getEquipmentType() {
getEquipmentTypeList().then((response) => { getEquipmentTypeList().then((response) => {
console.log(response.rows);
this.equipmentTypeOption = response.rows; this.equipmentTypeOption = response.rows;
console.log(this.treeData1);
}); });
}, },
/** 查询设备备件 */ /** 查询设备备件 */
@ -1147,6 +1164,17 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listEquipment(this.queryParams).then((response) => { listEquipment(this.queryParams).then((response) => {
for (let i in response.rows) {
// 穿
this.auxiliaryEquipmentLeftList.push({
key: response.rows[i].equipmentCode,
label: response.rows[i].equipmentName,
});
}
for (let i in response.selected) {
this.auxiliaryEquipmentLeftList.push(response.selected[i].key);
this.form.auxiliaryEquipmentRightData = this.auxiliaryEquipmentRightList;
}
this.equipmentList = response.rows; this.equipmentList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -1194,6 +1222,7 @@ export default {
workshopSection: null, workshopSection: null,
equipmentLocation: null, equipmentLocation: null,
hourlyUnitPrice: null, hourlyUnitPrice: null,
equipmentHead : null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -1246,25 +1275,29 @@ export default {
this.reset(); this.reset();
getWorkCenterList().then((response) => { getWorkCenterList().then((response) => {
this.options1 = response.rows; this.options1 = response.rows;
console.log(this.options1);
}); });
this.repairRecordSteps = 0;
this.open = true; this.open = true;
this.title = "添加设备管理"; this.title = "添加设备管理";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const equipmentId = row.equipmentId || this.ids; const equipmentId = row.equipmentId || this.ids;
getWorkCenterList().then((response) => { getWorkCenterList().then((response) => {
this.options1 = response.rows; this.options1 = response.rows;
console.log(this.options1);
}); });
getEquipment(equipmentId).then((response) => { getEquipment(equipmentId).then((response) => {
this.form = response.data; this.form = response.data;
for (let i in response.data.selectedData) { for (let i in response.data.selectedData) {
// 穿 // 穿
this.rightList.push(response.data.selectedData[i].spareCode); this.rightList.push(response.data.selectedData[i].spareCode);
} }
for (let i in response.data.selectedEquipmentData) {
// 穿
this.auxiliaryEquipmentRightList.push(response.data.selectedEquipmentData[i].auxiliaryEquipmentCode);
}
if (response.data.imageFiles != null) { if (response.data.imageFiles != null) {
var newFiles = []; var newFiles = [];
@ -1275,7 +1308,6 @@ export default {
newFiles.push(newFile); newFiles.push(newFile);
}); });
this.form.imageFileList = newFiles; this.form.imageFileList = newFiles;
console.log("55555", this.form.imageFileList);
} }
if (response.data.qrFiles != null) { if (response.data.qrFiles != null) {
var newFiles = []; var newFiles = [];
@ -1298,16 +1330,17 @@ export default {
this.form.barCodeFileList = newFiles; this.form.barCodeFileList = newFiles;
} }
this.form.workCenter = this.form.workshopCode; this.form.workCenter = this.form.workshopCode;
this.repairRecordSteps = 0;
this.open = true; this.open = true;
this.title = "修改设备管理"; this.title = "修改设备管理";
}); });
}, },
// //
handleView(row) { handleView(row) {
this.reset(); this.reset();
const equipmentId = row.equipmentId || this.ids; const equipmentId = row.equipmentId || this.ids;
getWorkCenterList().then((response) => { getWorkCenterList().then((response) => {
console.log(this.options1);
}); });
getEquipment(equipmentId).then((response) => { getEquipment(equipmentId).then((response) => {
this.form = response.data; this.form = response.data;
@ -1341,6 +1374,7 @@ export default {
this.optType = "view"; this.optType = "view";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if (Array.isArray(this.form.qrFileList)) { if (Array.isArray(this.form.qrFileList)) {
@ -1358,6 +1392,7 @@ export default {
if (valid) { if (valid) {
if (this.form.equipmentId != null) { if (this.form.equipmentId != null) {
this.form.rightData = this.rightList; this.form.rightData = this.rightList;
this.form.auxiliaryEquipmentRightData = this.auxiliaryEquipmentRightList;
updateEquipment(this.form).then((response) => { updateEquipment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -1381,6 +1416,7 @@ export default {
"【设备基础信息】设备类型为空,请选择设备类型!" "【设备基础信息】设备类型为空,请选择设备类型!"
); );
} else { } else {
this.form.auxiliaryEquipmentRightData = this.auxiliaryEquipmentRightList;
this.form.rightData = this.rightList; this.form.rightData = this.rightList;
addEquipment(this.form).then((response) => { addEquipment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
@ -1467,6 +1503,17 @@ export default {
); );
}, },
//
handleSelectPerson() {
this.$refs.itemSelectPerson.showFlag = true;
},
//
onItemSelectedPerson(obj) {
this.$set(this.form,"equipmentHead",obj[0].nickName + "(" + obj[0].userName+")" );
console.log(this.form.equipmentHead);
},
// //
handleStatusChange(row) { handleStatusChange(row) {
let text = row.status === "1" ? "启用" : "停用"; let text = row.status === "1" ? "启用" : "停用";
@ -1498,4 +1545,8 @@ export default {
.step-body { .step-body {
margin-top: 50px; margin-top: 50px;
} }
.el-transfer-panel {
width: 350px;
}
</style> </style>

@ -1,37 +1,130 @@
<template> <template>
<el-dialog <el-dialog
title="备品备件绑定" title="人员选择"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal="false" :modal="false"
width="1100px" width="800px"
center center
:before-close="cancel"
> >
<el-transfer <el-row :gutter="20">
filterable <!--人员数据-->
filter-placeholder="请输入班组人员名称" <el-col :span="24">
v-model="rightList" <el-form
:titles="['未绑定备件列表', '已绑定备件列表']" :model="queryParams"
:button-texts="['取消绑定', '绑定备件']" ref="queryForm"
:data="leftList" 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: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="人员名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入人员名称"
clearable
style="width: 150px"
@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="handleSelectionChange"
ref="multipleTable"
>
<el-table-column
width="50"
align="center"
type="selection"
></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="userName"
v-if="columns[0].visible"
>
</el-table-column>
<el-table-column
label="人员名称"
align="left"
key="itemName"
prop="nickName"
v-if="columns[1].visible"
:show-overflow-tooltip="true"
/>
<el-table-column
label="人员联系方式"
align="left"
prop="phonenumber"
v-if="columns[2].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="submitForm" :disabled="multiple"
> </el-button
> >
</el-transfer> <el-button @click="cancel"> </el-button>
<div slot="footer" class="dialog-footer"> </div>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click=""> </el-button>
</div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getSparePartsList,bindSpareParts } from "@/api/wms/equipment"; import { getRepairPersonList } from "@/api/device/faultReport";
import { Message } from "element-ui"; import { Message } from "element-ui";
export default { export default {
name: "MdItemSingle", name: "MdItemSingle",
data() { data() {
return { return {
treeData1: [],
showFlag: false, showFlag: false,
//
selectedItemId: undefined,
selectedRows: undefined,
// //
single: true, single: true,
// //
@ -40,59 +133,97 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
//
itemList: null,
//
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
itemName: null,
itemCodeGet: "",
itemCode: null,
nickName: null,
userName: null,
}, },
// //
form: {}, columns: [
leftList: [], { key: 0, label: `人员编码`, visible: true },
rightList: [], { key: 1, label: `人员名称`, visible: true },
{ key: 1, label: `联系方式`, visible: true },
],
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询备品备件列表 */ //
cancel() {
this.showFlag = false;
this.reset();
},
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleSelectionChange(val) {
this.itemList = val;
},
//
indexMethod(index) {
return index + 1;
},
/** 查询设备编码列表*/
getList() { getList() {
this.loading = true; this.loading = true;
getSparePartsList(this.queryParams).then((response) => { this.queryParams.userName = this.queryParams.itemCode;
for (let i in response.rows) { this.queryParams.nickName = this.queryParams.itemName;
// 穿 getRepairPersonList(this.queryParams).then((response) => {
this.leftList.push({ this.itemList = response.rows;
key: response.rows[i].materialCode, this.total = response.total;
label: response.rows[i].materialDesc,
});
}
for (let i in response.selected) {
this.rightList.push(response.selected[i].key);
this.form.rightData = this.rightList;
}
this.loading = false; this.loading = false;
}); });
}, },
/** 提交按钮 */ /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.userCodes = selection.map((item) => item.userName);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
submitForm() { submitForm() {
this.form.rightData = this.rightList; if (this.$refs.multipleTable.selection.length > 1) {
bindSpareParts(this.form).then((response) => { Message.warning("只能选择一个人员,请勿选择多个!");
this.showFlag = false; } else {
this.$modal.msgSuccess("绑定成功"); this.$emit("onSelected", this.$refs.multipleTable.selection);
}); this.showFlag = false;
this.getList();
}
}, },
}, },
}; };
</script> </script>
<style>
.el-transfer-panel {
width: 350px;
}
.query {
display: flex;
justify-content: space-between;
padding-right: 4px;
}
</style>

Loading…
Cancel
Save