Merge remote-tracking branch 'origin/master'

master
wws 1 year ago
commit 90ba20aa3f

@ -68,3 +68,12 @@ export function checkFaultReport(data) {
data: data
});
}
// 查询报修人员列表
export function getPersonList(query) {
return request({
url: '/device/faultReport/getPersonList',
method: 'get',
params: query
});
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询委外工单列表
export function listOutsourceWorkOrder(query) {
return request({
url: '/device/outsourceWorkOrder/list',
method: 'get',
params: query
});
}
// 查询委外工单详细
export function getOutsourceWorkOrder(workId) {
return request({
url: '/device/outsourceWorkOrder/' + workId,
method: 'get'
});
}
// 新增委外工单
export function addOutsourceWorkOrder(data) {
return request({
url: '/device/outsourceWorkOrder',
method: 'post',
data: data
});
}
// 修改委外工单
export function updateOutsourceWorkOrder(data) {
return request({
url: '/device/outsourceWorkOrder',
method: 'put',
data: data
});
}
// 删除委外工单
export function delOutsourceWorkOrder(workId) {
return request({
url: '/device/outsourceWorkOrder/' + workId,
method: 'delete'
});
}

@ -194,7 +194,7 @@
<span>{{ parseTime(scope.row.orderTime) }}</span>
</template>
</el-table-column>
<el-table-column label="报修人" align="center" prop="orderRepairman" />
<el-table-column label="报修人" align="center" prop="orderRepairman" width="150"/>
<el-table-column
label="联系方式"
align="center"
@ -493,19 +493,24 @@
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workTeam" label="委外单位">
<el-input v-model="form.workTeam" placeholder="请填写委外单位" />
<el-form-item prop="workOutsourcingUnit" label="委外单位">
<el-input v-model="form.workOutsourcingUnit" placeholder="请填写委外单位" />
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workPlanTime" label="委外人员">
<el-input v-model="form.workTeam" placeholder="请选填写委外人员" />
<el-form-item prop="outSourcePerson" label="委外维修人员">
<el-input v-model="form.outSourcePerson" placeholder="请填写委外维修人员" />
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workConnection" label="联系方式">
<el-input v-model="form.workConnection" placeholder="请填写委外联系方式" />
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workPlanDownTime" label="委外原因">
<el-form-item prop="outSourceReason" label="委外原因">
<el-input
v-model="form.orderDesc"
v-model="form.outSourceReason"
placeholder="请输入委外原因"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
@ -515,7 +520,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitCheckForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button @click="cancelCheckForm"> </el-button>
</div>
</el-dialog>
@ -533,6 +538,7 @@
<el-input
v-model="form.equipmentCode"
placeholder="请选择辅助设备"
style="width: 200px"
>
<el-button
slot="append"
@ -552,14 +558,17 @@
<el-date-picker
clearable
v-model="form.orderBreakdownTime"
placeholder="选择日期时间"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="报修时间"
style="width: 200px"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报修来源" prop="orderSource">
<el-select v-model="form.orderSource" style="width: 195px">
<el-select v-model="form.orderSource" style="width: 200px">
<el-option
v-for="dict in dict.type.device_order_source"
:key="dict.value"
@ -579,6 +588,7 @@
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="报修时间"
style="width: 200px"
>
</el-date-picker>
</el-form-item>
@ -587,14 +597,27 @@
<el-form-item label="报修人" prop="orderRepairman">
<el-input
v-model="form.orderRepairman"
placeholder="请输入报修人"
/>
placeholder="请选择报修人"
style="width: 200px"
>
<el-button
slot="append"
@click="handleSelectPerson"
icon="el-icon-search"
></el-button>
</el-input>
<ItemSelectPerson
ref="itemSelectPerson"
@onSelected="onItemSelectedPerson"
>
</ItemSelectPerson>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系方式" prop="orderConnection">
<el-input
v-model="form.orderConnection"
style="width: 200px"
placeholder="请输入联系方式"
/>
</el-form-item>
@ -632,10 +655,13 @@ import {
getEquipmentList,
checkFaultReport,
} from "@/api/device/faultReport";
import ItemSelect from "./single.vue";
import ItemSelect from "./selectSingleEquipment.vue";
import ItemSelectPerson from "./selectSinglePerson.vue";
import { Message } from 'element-ui'
export default {
name: "FaultReport",
components: { ItemSelect },
components: { ItemSelect,ItemSelectPerson },
dicts: ["device_order_source"],
data() {
return {
@ -760,11 +786,19 @@ export default {
this.form.workPlanTime = new Date();
log("时间时间", new Date());
},
//
//
handleSelectEquipment() {
this.$refs.itemSelect.showFlag = true;
},
//
//
handleSelectPerson() {
this.$refs.itemSelectPerson.showFlag = true;
},
//
onItemSelectedPerson(obj) {
this.form.orderRepairman = obj;
},
//
onItemSelectedEquipment(obj) {
this.form.equipmentCode = obj;
},
@ -782,9 +816,10 @@ export default {
this.open = false;
this.reset();
},
//
cancel() {
//
cancelCheckForm() {
this.openCheck = false;
this.reset();
},
//
reset() {
@ -851,9 +886,13 @@ export default {
this.reset();
const orderId = row.orderId || this.ids;
getFaultReport(orderId).then((response) => {
if(response.data.orderStatus == "审核通过" || response.data.orderStatus == "驳回"){
Message.warning("该报修记录已审核,请勿重复审核!");
}else{
this.form = response.data;
this.openCheck = true;
this.title = "审核故障报修";
}
});
},
/** 提交按钮 */

@ -155,7 +155,6 @@ export default {
indexMethod(index){
return index+1 ;
},
//
/** 查询设备编码列表*/
getList() {
@ -205,19 +204,6 @@ export default {
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) {
@ -227,34 +213,12 @@ export default {
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);
if(data.length >1){
Message.warning("只能选择一个报修机器,请勿选择多个!");
}else{
const equipmentCode = data.toString();
console.log("拆分数据",equipmentCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = equipmentCode;
}else{
@ -267,13 +231,16 @@ export default {
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
},
cancelEquipmentForm(){
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
}
}
};
</script>

@ -0,0 +1,183 @@
<template>
<el-dialog title="人员选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="800px"
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--人员数据-->
<el-col :span="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: 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="handleEquipmentSelectionChange" ref="myTable">
<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>
<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="submitPersonForm"> </el-button>
<el-button @click="cancelEquipmentForm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getPersonList} from "@/api/device/faultReport";
import { Message } from 'element-ui'
export default {
name: "MdItemSingle",
data() {
return {
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total:0,
//
itemList: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
{ key: 0, label: `人员编码`, visible: true },
{ key: 1, label: `人员名称`, visible: true },
]
};
},
created() {
this.getList();
},
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;
getPersonList(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;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.nickName);
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){
Message.warning("只能选择一个报修人,请勿选择多个!");
}else{
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = nickName;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.getList();
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
}
}
};
</script>

@ -0,0 +1,349 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="委外工单编码" prop="workCode">
<el-input
v-model="queryParams.workCode"
placeholder="请输入委外工单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维修人员" prop="workPerson">
<el-input
v-model="queryParams.workPerson"
placeholder="请输入维修人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="委外单位" prop="workOutsourcingUnit">
<el-input
v-model="queryParams.workOutsourcingUnit"
placeholder="请输入委外单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系方式" prop="workConnection">
<el-input
v-model="queryParams.workConnection"
placeholder="请输入联系方式"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="委外费用" prop="workCost">
<el-input
v-model="queryParams.workCost"
placeholder="请输入委外费用"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="委外用时" prop="workCostTime">
<el-input
v-model="queryParams.workCostTime"
placeholder="请输入委外用时"
clearable
@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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['device:outsourceWorkOrder:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:outsourceWorkOrder:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:outsourceWorkOrder:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['device:outsourceWorkOrder:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="outsourceWorkOrderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="委外工单编码" align="center" prop="workCode" width="180"/>
<el-table-column label="维修人员" align="center" prop="workPerson" width="150"/>
<el-table-column label="委外单位" align="center" prop="workOutsourcingUnit" width="200"/>
<el-table-column label="联系方式" align="center" prop="workConnection" width="150"/>
<el-table-column label="原因" align="center" prop="workReason" width="150"/>
<el-table-column label="委外类型" align="center" prop="workType" />
<el-table-column label="管理单号" align="center" prop="managementCode" />
<el-table-column label="委外费用" align="center" prop="workCost" />
<el-table-column label="委外用时" align="center" prop="workCostTime" />
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:outsourceWorkOrder:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:outsourceWorkOrder:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改委外工单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="委外工单编码" prop="workCode">
<el-input v-model="form.workCode" placeholder="请输入委外工单编码" />
</el-form-item>
<el-form-item label="维修人员" prop="workPerson">
<el-input v-model="form.workPerson" placeholder="请输入维修人员" />
</el-form-item>
<el-form-item label="委外单位" prop="workOutsourcingUnit">
<el-input v-model="form.workOutsourcingUnit" placeholder="请输入委外单位" />
</el-form-item>
<el-form-item label="联系方式" prop="workConnection">
<el-input v-model="form.workConnection" placeholder="请输入联系方式" />
</el-form-item>
<el-form-item label="原因" prop="workReason">
<el-input v-model="form.workReason" placeholder="请输入原因" />
</el-form-item>
<el-form-item label="管理单号" prop="managementCode">
<el-input v-model="form.managementCode" placeholder="请输入管理单号" />
</el-form-item>
<el-form-item label="委外费用" prop="workCost">
<el-input v-model="form.workCost" placeholder="请输入委外费用" />
</el-form-item>
<el-form-item label="委外用时" prop="workCostTime">
<el-input v-model="form.workCostTime" placeholder="请输入委外用时" />
</el-form-item>
<el-form-item label="删除标识" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
</el-form-item>
<el-form-item label="工厂编码" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listOutsourceWorkOrder, getOutsourceWorkOrder, delOutsourceWorkOrder, addOutsourceWorkOrder, updateOutsourceWorkOrder } from "@/api/device/outsourceWorkOrder";
export default {
name: "OutsourceWorkOrder",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
outsourceWorkOrderList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
workCode: null,
workPerson: null,
workOutsourcingUnit: null,
workConnection: null,
workReason: null,
workType: null,
managementCode: null,
workCost: null,
workCostTime: null,
attr1: null,
attr2: null,
attr3: null,
factoryCode: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询委外工单列表 */
getList() {
this.loading = true;
listOutsourceWorkOrder(this.queryParams).then(response => {
this.outsourceWorkOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
workId: null,
workCode: null,
workPerson: null,
workOutsourcingUnit: null,
workConnection: null,
workReason: null,
workType: null,
managementCode: null,
workCost: null,
workCostTime: null,
attr1: null,
attr2: null,
attr3: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.workId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加委外工单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const workId = row.workId || this.ids
getOutsourceWorkOrder(workId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改委外工单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.workId != null) {
updateOutsourceWorkOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOutsourceWorkOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const workIds = row.workId || this.ids;
this.$modal.confirm('是否确认删除委外工单编号为"' + workIds + '"的数据项?').then(function() {
return delOutsourceWorkOrder(workIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/outsourceWorkOrder/export', {
...this.queryParams
}, `outsourceWorkOrder_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save