|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
:modal="false"
|
|
|
|
|
width="800px"
|
|
|
|
|
center
|
|
|
|
|
:before-close="cancelEquipmentForm"
|
|
|
|
|
:before-close="cancel"
|
|
|
|
|
>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<!--人员数据-->
|
|
|
|
@ -53,8 +53,8 @@
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="itemList"
|
|
|
|
|
@selection-change="handleEquipmentSelectionChange"
|
|
|
|
|
ref="myTable"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
ref="multipleTable"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
width="50"
|
|
|
|
@ -75,7 +75,8 @@
|
|
|
|
|
key="itemCode"
|
|
|
|
|
prop="userName"
|
|
|
|
|
v-if="columns[0].visible"
|
|
|
|
|
></el-table-column>
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="人员名称"
|
|
|
|
|
align="left"
|
|
|
|
@ -96,14 +97,16 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitPersonForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancelEquipmentForm">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm" :disabled="multiple"
|
|
|
|
|
>确 定</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getMaintenancePersonList } from "@/api/device/repairOrder";
|
|
|
|
|
import { getRepairPersonList } from "@/api/device/faultReport";
|
|
|
|
|
import { Message } from "element-ui";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
@ -132,6 +135,8 @@ export default {
|
|
|
|
|
itemName: undefined,
|
|
|
|
|
itemCodeGet: "",
|
|
|
|
|
itemCode: undefined,
|
|
|
|
|
nickName: null,
|
|
|
|
|
userName: null,
|
|
|
|
|
},
|
|
|
|
|
// 列信息
|
|
|
|
|
columns: [
|
|
|
|
@ -155,7 +160,7 @@ export default {
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleEquipmentSelectionChange(val) {
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.itemList = val;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -165,24 +170,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
/** 查询设备编码列表*/
|
|
|
|
|
/** 查询人员列表*/
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getMaintenancePersonList(this.queryParams).then((response) => {
|
|
|
|
|
this.queryParams.userName = this.queryParams.itemCode;
|
|
|
|
|
this.queryParams.nickName = this.queryParams.itemName;
|
|
|
|
|
getRepairPersonList(this.queryParams).then((response) => {
|
|
|
|
|
this.itemList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
console.log("id", data.id);
|
|
|
|
|
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
|
|
|
|
|
console.log(this.equipmentTypeCode);
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
@ -191,33 +190,33 @@ export default {
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.queryParams.equipmentTypeCode = null;
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.queryParams.itemCode = null;
|
|
|
|
|
this.queryParams.itemName = null;
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleEquipmentSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map((item) => item.nickName);
|
|
|
|
|
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;
|
|
|
|
|
console.log("多选框", this.ids);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submitPersonForm() {
|
|
|
|
|
const data = this.ids;
|
|
|
|
|
const nickName = data.toString();
|
|
|
|
|
if (data.length > 1) {
|
|
|
|
|
cancel() {
|
|
|
|
|
this.showFlag = false;
|
|
|
|
|
this.resetQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submitForm() {
|
|
|
|
|
if (this.$refs.multipleTable.selection.length > 1) {
|
|
|
|
|
Message.warning("只能选择一个维修人,请勿选择多个!");
|
|
|
|
|
} else {
|
|
|
|
|
if (this.queryParams.itemCodeGet == "") {
|
|
|
|
|
this.queryParams.itemCodeGet = nickName;
|
|
|
|
|
}
|
|
|
|
|
this.selectedRows = this.queryParams.itemCodeGet;
|
|
|
|
|
this.$emit("onSelected", this.selectedRows);
|
|
|
|
|
this.getList();
|
|
|
|
|
console.log(this.$refs.multipleTable.selection);
|
|
|
|
|
this.$emit("onSelected", this.$refs.multipleTable.selection);
|
|
|
|
|
this.showFlag = false;
|
|
|
|
|
this.queryParams.itemCodeGet = "";
|
|
|
|
|
this.resetQuery();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|