Merge remote-tracking branch 'origin/master'

yangwl
wws 1 year ago
commit 1164a2faa6

@ -50,3 +50,21 @@ export function getMaintenanceTeamList() {
method: 'get'
});
}
// 查询班组列表
export function listTeamMembers(query) {
return request({
url: '/device/equTeam/listTeamMembers',
method: 'get',
params: query
});
}
// 查询班组列表
export function getRightList(query) {
return request({
url: '/device/equTeam/getRightList',
method: 'get',
params: query
});
}

@ -163,3 +163,14 @@ export function getMesListBom(query) {
// method: 'get'
// });
// }
//获取批次
export function getBatchList(workorderCode) {
const data = {
workorderCode
}
return request({
url: '/mes/reportWork/getBatchList',
method: 'put',
data: data
});
}

@ -58,3 +58,28 @@ export function getEquipmentTypeList() {
method: 'get'
});
}
// 查询设备备件
export function getSparePartsList() {
return request({
url: '/wms/equipment/getSparePartsList',
method: 'get'
});
}
// 查询设备备件右侧列表
export function getRightSparePartsList() {
return request({
url: '/wms/equipment/getRightSparePartsList',
method: 'get'
});
}
// 绑定
export function bindSpareParts(data) {
return request({
url: '/wms/equipment/bindSpareParts',
method: 'post',
data: data
});
}

@ -234,5 +234,5 @@ export default {
this.showFlag = false;
}
}
};
};
</script>

@ -154,8 +154,9 @@
/>
<!-- 添加或修改设备班组维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="班组编号" prop="teamCode">
<el-input
@ -212,6 +213,24 @@
</ItemSelectPerson>
</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-card>
<div class = "my-team">
<template>
<el-transfer
filterable
filter-placeholder="请输入班组人员名称"
:titles="['可选班组人员', '当前班组人员']"
:button-texts="['解除添加', '添加']"
:data="leftList"
v-model="rightList"
style="text-align: left"
>
</el-transfer>
</template>
</div>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -229,6 +248,8 @@ import {
addEquTeam,
updateEquTeam,
getMaintenanceTeamList,
listTeamMembers,
getRightList,
} from "@/api/device/equTeam";
import ItemSelectPerson from "./selectSinglePerson.vue";
@ -237,6 +258,10 @@ export default {
components: { ItemSelectPerson },
data() {
return {
//
leftList: [],
// key
rightList: [],
//
checkTeamPerson: null,
//
@ -293,8 +318,28 @@ export default {
},
created() {
this.getList();
this.getTeamMembers();
},
methods: {
getTeamMembers() {
//
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 2000;
listTeamMembers(this.queryParams).then(response => {
for(let i in response.rows){
// 穿
this.leftList.push({
key: response.rows[i].userId,
label: response.rows[i].teamUserName
})
}
for(let i in response.selected){
this.rightList.push(response.selected[i].key);
this.form.rightData = this.rightList;
}
this.loading = false;
});
},
//
handleSelectPerson() {
this.$refs.itemSelectPerson.showFlag = true;
@ -362,21 +407,30 @@ export default {
const id = row.id || this.ids;
getEquTeam(id).then((response) => {
this.form = response.data;
for(let i in response.data.selectedData){
// 穿
this.rightList.push(
response.data.selectedData[i].userId
)
};
console.log('response.data.selectedData',response.data.selectedData);
this.open = true;
this.title = "修改设备班组维护";
});
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
this.form.rightData = this.rightList;
updateEquTeam(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.rightData = this.rightList;
addEquTeam(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
@ -432,3 +486,13 @@ export default {
},
};
</script>
<style>
.el-transfer-panel{
width: 320px;
height: 400px;
}
.el-transfer-panel__list.is-filterable{
height: 300px;
}
</style>

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@
:modal= false
width="800px"
center
:before-close="cancelEquipmentForm"
:before-close="cancel"
>
<el-row :gutter="20">
<!--人员数据-->
@ -34,7 +34,7 @@
<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 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>
@ -53,8 +53,8 @@
</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>
@ -112,7 +112,7 @@ export default {
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
handleSelectionChange (val) {
this.itemList = val;
},
@ -133,14 +133,6 @@ export default {
);
},
//
handleNodeClick(data) {
console.log('id',data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -155,27 +147,20 @@ export default {
},
//
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){
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();
this.$emit('onSelected', this.$refs.multipleTable.selection);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
this.getList();
}
}
}

@ -88,12 +88,12 @@
style="width: 200px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in workStatusOption"
:key="item.workStatus"
:label="item.label"
:value="item.workStatus"
></el-option>
<el-option
v-for="dict in dict.type.device_repair_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否委外" prop="workOutsource">
@ -250,13 +250,13 @@
label="维修单号"
align="center"
prop="workCode"
width="180"
width="200"
/>
<el-table-column
label="报修单号"
align="center"
prop="orderCode"
width="180"
width="200"
/>
<el-table-column label="设备编码" align="center" prop="equipmentCode" />
<el-table-column
@ -347,10 +347,13 @@
</template>
</el-table-column>
<el-table-column label="维修费用" align="center" prop="workCost" />
<el-table-column label="维修状态" align="center" prop="workStatus" >
<template slot-scope="scope">
{{ scope.row.workStatus == "1"?'维修结束': scope.row.workStatus == "2"?'维修中' : scope.row.workStatus == "0" ? '待维修' : '无'}}
</template>
<el-table-column label="维修状态" align="center" prop="workStatus" width="150">
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_repair_status"
:value="scope.row.workStatus"
/>
</template>
</el-table-column>
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
<el-table-column
@ -953,12 +956,12 @@
style="width: 195px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in workStatusOption"
:key="item.workStatus"
:label="item.label"
:value="item.workStatus"
></el-option>
<el-option
v-for="dict in dict.type.device_repair_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-form-item>
@ -1070,6 +1073,7 @@ import ItemSelectSpareParts from "./selectSpareParts.vue";
export default {
name: " RepairOrder",
components: { ItemSelect, ItemSelectPerson, ItemSelectSpareParts },
dicts: ["device_repair_status"],
data() {
return {
//
@ -1153,21 +1157,6 @@ export default {
label: "不停机",
},
],
//
workStatusOption: [
{
workStatus: "0",
label: "待维修",
},
{
workStatus: "2",
label: "维修中",
},
{
workStatus: "1",
label: "维修结束",
},
],
//
pickerOptions: {
shortcuts: [

@ -159,20 +159,20 @@ export default {
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.nickName);
this.ids = selection.map(item => item.userId);
this.userCodes = selection.map(item => item.userNames);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
submitPersonForm() {
const data = this.ids;
const nickName = data.toString();
const data = this.userNames;
const userCodes = data.toString();
if(data.length >1){
Message.warning("只能选择一个维修人,请勿选择多个!");
}else{
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = nickName;
this.queryParams.itemCodeGet = userCodes;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);

@ -10,18 +10,7 @@
@click="handleSelectSparePartsLedger"
v-hasPermi="['device:sparePartsApplicationRecord:add']"
>新增</el-button>
<ItemSelectSparePartsLedger ref="itemSelectSparePartsLedger" @onSelected="selectSparePartsLedger" ></ItemSelectSparePartsLedger>
</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:sparePartsApplicationRecord:edit']"
>修改</el-button>
<ItemSelectSparePartsLedger ref="itemSelectSparePartsLedger" @onSelected="selectSparePartsLedger"></ItemSelectSparePartsLedger>
</el-col>
<el-col :span="1.5">
<el-button
@ -40,8 +29,8 @@
<el-table v-loading="loading" :data="sparePartsApplicationRecordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"/>
<el-table-column label="维修单号" align="center" prop="workCode" width="150"/>
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号" fixed/>
<el-table-column label="维修单号" align="center" prop="workCode" width="200" fixed/>
<el-table-column label="使用设备" align="center" prop="spareUseEquipment" />
<el-table-column label="备品备件编码" align="center" prop="spareCode" width="120"/>
<el-table-column label="备品备件名称" align="center" prop="spareName" width="120"/>
@ -54,24 +43,6 @@
</el-table-column>
<el-table-column label="申领人" align="center" prop="applyPeople" width="80"/>
<el-table-column label="批准人" align="center" prop="applyApprovePeople" width="80"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:sparePartsApplicationRecord:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:sparePartsApplicationRecord:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
@ -87,7 +58,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAddForm"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -141,42 +112,14 @@ export default {
attr1: null,
attr2: null,
attr3: null,
factoryCode: null,
applyTimeArray: []
factoryCode: null
},
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
//
form: {},
//
rules: {
}
},
componentKey:0
};
},
props: {
@ -190,6 +133,7 @@ export default {
methods: {
//
handleSelectSparePartsLedger() {
this.$forceUpdate();
this.$refs.itemSelectSparePartsLedger.showFlag = true;
},
//
@ -235,7 +179,8 @@ export default {
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null
factoryCode: null,
spareApplyLists : []
};
this.resetForm("form");
},
@ -247,7 +192,6 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.applyTimeArray = [];
this.handleQuery();
},
//
@ -294,16 +238,23 @@ export default {
},
//
selectSparePartsLedger(obj){
console.log("接收参数",obj[0]);
console.log("接收参数",obj);
//使
this.form.spareCode = obj[0].materialCode;
this.form.spareName = obj[0].materialDesc;
this.form.spareModel = obj[0].spareMode;
this.form.spareUseEquipment = this.queryParams.equipmentCode;
this.form.spareQuantity = obj[0].spareQuantity;
this.form.workCode = this.queryParams.workCode;
var spareApplyLists = [];
obj.forEach(item => {
var spareApplyList = {};
spareApplyList.spareCode = item.materialCode;
spareApplyList.spareName = item.materialDesc;
spareApplyList.spareModel = item.spareMode;
spareApplyList.spareUseEquipment = this.queryParams.equipmentCode;
spareApplyList.spareQuantity = item.spareQuantity;
spareApplyList.workCode = this.queryParams.workCode;
spareApplyList.storageId = item.storageId;
spareApplyList.amount = item.amount;
spareApplyLists.push(spareApplyList);
});
this.form.spareApplyLists = spareApplyLists;
addSparePartsApplicationRecord(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});

@ -63,7 +63,7 @@
/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm" :disabled="multiple"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -71,6 +71,7 @@
<script>
import { listSparePartsLedger, getSparePartsLedger, delSparePartsLedger, addSparePartsLedger, updateSparePartsLedger } from "@/api/device/sparePartsLedger";
import { Message } from "element-ui";
export default {
name: "SparePartsLedger",
@ -167,7 +168,6 @@ export default {
methods: {
handleEdit(index, row) {
console.log('row:',index, row);
console.log('storageId:',row.storageId) //name
},
//
indexMethod(index) {
@ -250,7 +250,8 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.storageId)
this.ids = selection.map(item => item.storageId);
this.codes = selection.map(item => item.materialCode);
this.single = selection.length!==1
this.multiple = !selection.length
},
@ -258,8 +259,15 @@ export default {
submitForm(){
console.log('data:',this.sparePartsLedgerList);
console.log("选择的数据",this.$refs.multipleTable.selection);
this.$refs.multipleTable.selection.forEach(item => {
if(item.spareQuantity >(item.amount - item.storageAmount)){
Message.warning('备件编码"' + item.materialCode + '"的申领数量大于可用数量,请重新填写!');
this.$refs.multipleTable.clearSelection();
}
});
this.$emit('onSelected',this.$refs.multipleTable.selection);
this.showFlag = false;
this.getList();
},
}
};

@ -0,0 +1,789 @@
<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
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报修单号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入报修单号"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="queryParams.equipmentCode"
placeholder="请输入设备编码"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-select
v-model="queryParams.workDownMachine"
placeholder="请选择是否停机"
@change="$forceUpdate()"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in workDownMachineOption"
:key="item.workDownMachine"
:label="item.label"
:value="item.workDownMachine"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="维修人员" prop="workPerson">
<el-input
v-model="queryParams.workPerson"
placeholder="请输入维修人员"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维修组" prop="workTeam">
<el-select
v-model="queryParams.workTeam"
placeholder="请选择维修组"
@change="$forceUpdate()"
clearable
filterable
style="width: 200px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in teamOption"
:key="item.teamCode"
:label="item.teamName"
:value="item.teamCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="维修状态" prop="workStatus">
<el-select
v-model="queryParams.workStatus"
placeholder="请选择维修状态"
@change="$forceUpdate()"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="dict in dict.type.device_repair_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否委外" prop="workOutsource">
<el-select
v-model="queryParams.workOutsource"
placeholder="请选择是否委外"
@change="$forceUpdate()"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in workOutsourceOption"
:key="item.workOutsource"
:label="item.label"
:value="item.workOutsource"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="委外工单编码" prop="outWorkCode">
<el-input
v-model="queryParams.outWorkCode"
placeholder="请输入委外工单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划维修时间" prop="workPlanTime">
<el-date-picker
clearable
v-model="queryParams.workPlanTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="计划停机时间" prop="workPlanDownTime">
<el-date-picker
clearable
v-model="queryParams.workPlanDownTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
>
</el-date-picker>
</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="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['device: repairOrder:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="repairOrderList">
<el-table-column width="55" align="center" border />
<el-table-column
label="维修单号"
align="center"
prop="workCode"
width="200"
fixed
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleView(scope.row)"
v-hasPermi="['device:repairOrderReport:query']"
>{{ scope.row.workCode }}</el-button
>
</template>
</el-table-column>
<el-table-column
label="报修单号"
align="center"
prop="orderCode"
width="200"
/>
<el-table-column label="设备编码" align="center" prop="equipmentCode" />
<el-table-column
label="故障描述"
align="center"
prop="workFaultDesc"
width="300"
/>
<el-table-column
label="计划维修时间"
align="center"
prop="workPlanTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workPlanTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="是否停机维修"
align="center"
prop="workDownMachine"
width="180"
>
<template slot-scope="scope">
{{ scope.row.workDownMachine == "1" ? "停机" : "不停机" }}
</template>
</el-table-column>
<el-table-column
label="计划停机时间"
align="center"
prop="workPlanDownTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workPlanDownTime) }}</span>
</template>
</el-table-column>
<el-table-column label="维修人员" align="center" prop="workPerson" />
<el-table-column
label="维修组编码"
align="center"
prop="workTeam"
width="100"
/>
<el-table-column
label="维修组名称"
align="center"
prop="teamName"
width="100"
/>
<el-table-column
label="维修组人员"
align="center"
prop="teamPerson"
width="300"
/>
<el-table-column label="是否委外" align="center" prop="workOutsource">
<template slot-scope="scope">
{{ scope.row.workOutsource == "1" ? "转委外" : "不委外" }}
</template>
</el-table-column>
<el-table-column
label="委外工单编码"
align="center"
prop="outWorkCode"
width="180"
/>
<el-table-column
label="原因分析"
align="center"
prop="workReason"
width="300"
/>
<el-table-column
label="维修开始时间"
align="center"
prop="workStartTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workStartTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="维修结束时间"
align="center"
prop="workEndTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workEndTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="维修用时"
align="center"
prop="workCostTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workCostTime) }}</span>
</template>
</el-table-column>
<el-table-column label="维修费用" align="center" prop="workCost" />
<el-table-column
label="维修状态"
align="center"
prop="workStatus"
width="150"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.device_repair_status"
:value="scope.row.workStatus"
/>
</template>
</el-table-column>
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
</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="openView"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-tabs type="border-card">
<el-tab-pane label="报修基本信息">
<el-descriptions :column="3" border>
<el-descriptions-item label="报修单编号">{{
form.orderCode
}}</el-descriptions-item>
<el-descriptions-item label="设备编号">{{
form.equipmentCode
}}</el-descriptions-item>
<el-descriptions-item label="设备名称">{{
form.equipmentName
}}</el-descriptions-item>
<el-descriptions-item label="报修来源">{{
form.orderSource
}}</el-descriptions-item>
<el-descriptions-item label="报修时间">{{
form.orderTime
}}</el-descriptions-item>
<el-descriptions-item label="报修人名字">{{
form.orderRepairmanName
}}</el-descriptions-item>
<el-descriptions-item label="联系方式">{{
form.orderConnection
}}</el-descriptions-item>
<el-descriptions-item label="是否立即处理">{{
form.workHandle ? "否" : "是"
}}</el-descriptions-item>
<el-descriptions-item label="计划维修时间">{{
form.workPlanTime
}}</el-descriptions-item>
<el-descriptions-item label="是否停机维修">{{
form.workDownMachine ? "否" : "是"
}}</el-descriptions-item>
<el-descriptions-item label="计划停机时间">{{
form.workPlanDownTime
}}</el-descriptions-item>
<el-descriptions-item label="是否委外">{{
form.workOutsource ? "否" : "是"
}}</el-descriptions-item>
<el-descriptions-item label="故障描述">{{
form.orderDesc
}}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" border>
<el-descriptions-item label="维修前故障图片">
<el-image
v-for="(item, index) in urlBeforeLists"
:key="index"
:src="item"
></el-image
></el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="维修基本信息">
<el-descriptions :column="2" border>
<el-descriptions-item label="维修工单号">{{
form.workCode
}}</el-descriptions-item>
<el-descriptions-item label="报修单号">{{
form.workCode
}}</el-descriptions-item>
<el-descriptions-item label="设备编号">{{
form.equipmentCode
}}</el-descriptions-item>
<el-descriptions-item label="设备名称">{{
form.equipmentName
}}</el-descriptions-item>
<el-descriptions-item label="设备类型">{{
form.equipmentTypeName
}}</el-descriptions-item>
<el-descriptions-item label="设备位置">{{
form.equipmentLocation
}}</el-descriptions-item>
<el-descriptions-item label="工作中心编码">{{
form.workshopCode
}}</el-descriptions-item>
<el-descriptions-item label="工作中心名称">{{
form.workshopName
}}</el-descriptions-item>
<el-descriptions-item label="维修开始时间">{{
form.workStartTime
}}</el-descriptions-item>
<el-descriptions-item label="维修结束时间">{{
form.workEndTime
}}</el-descriptions-item>
<el-descriptions-item label="维修实际开始停机时间">{{
form.actualDownStartTime
}}</el-descriptions-item>
<el-descriptions-item label="维修实际结束停机时间">{{
form.actualDownEndTime
}}</el-descriptions-item>
<el-descriptions-item label="维修人(负责人)">{{
form.workPerson
}}</el-descriptions-item>
<el-descriptions-item label="维修人联系方式">{{
form.workConnection
}}</el-descriptions-item>
<el-descriptions-item label="维修班组">{{
form.workTeam
}}</el-descriptions-item>
<el-descriptions-item label="维修班组人员">{{
form.workTeamPerson
}}</el-descriptions-item>
<el-descriptions-item label="维修用时">{{
form.workCostTime
}}</el-descriptions-item>
<el-descriptions-item label="维修费用">{{
form.workCost
}}</el-descriptions-item>
<el-descriptions-item label="故障原因">{{
form.orderDesc
}}</el-descriptions-item>
<el-descriptions-item label="维修后原因分析">{{
form.workReason
}}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" border>
<el-descriptions-item label="维修后图片">
<el-image
v-for="(item, index) in urlAfterLists"
:key="index"
:src="item"
></el-image
></el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="检查项信息">
<el-table :data="detailList" border style="width: 100%">
<el-table-column prop="itemName" label="检查项名称" width="150">
</el-table-column>
<el-table-column prop="standardName" label="标准名称" width="180">
</el-table-column>
<el-table-column prop="standardType" label="标准类型" width="100">
</el-table-column>
<el-table-column prop="detailReach" label="是否达标" width="50">
</el-table-column>
<el-table-column prop="actualValue" label="实际值" width="50">
</el-table-column>
<el-table-column prop="detailUpLimit" label="上限" width="50">
</el-table-column>
<el-table-column prop="detailDownLimit" label="下限" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="故障图片">
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listRepairOrder,
getRepairOrder,
delRepairOrder,
addRepairOrder,
updateRepairOrder,
applyOutsource,
writeRepairOrder,
} from "@/api/device/repairOrder";
import { Message } from "element-ui";
export default {
name: "RepairOrderReport",
dicts: ["device_repair_status"],
data() {
return {
//
urlBeforeLists: [],
//
urlAfterLists: [],
//
teamOption: [],
optType: undefined,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
repairOrderList: [],
//
title: "",
//
openView: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
orderId: null,
orderCode: null,
workCode: null,
workHandle: null,
workPlanTime: null,
workPlanDownTime: null,
orderRelevance: null,
workPerson: null,
workTeam: null,
workOutsource: null,
workDownMachine: null,
equipmentCode: null,
workReason: null,
workFaultDesc: null,
workCostTime: null,
workCost: null,
outWorkId: null,
outWorkCode: null,
attr1: null,
attr2: null,
attr3: null,
factoryCode: null,
//
workPlanTimeArray: [],
workPlanDownTimeArray: [],
},
//
workOutsourceOption: [
{
workOutsource: "1",
label: "转委外",
},
{
workOutsource: "0",
label: "不委外",
},
],
//
workDownMachineOption: [
{
workDownMachine: "1",
label: "停机",
},
{
workDownMachine: "0",
label: "不停机",
},
],
//
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询维修工单列表 */
getList() {
this.loading = true;
listRepairOrder(this.queryParams).then((response) => {
this.repairOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.openView = false;
},
//
reset() {
this.form = {
workId: null,
orderId: null,
orderCode: null,
workHandle: null,
workPlanTime: null,
workPlanDownTime: null,
orderRelevance: null,
workPerson: null,
workTeam: null,
workOutsource: null,
workDownMachine: null,
equipmentCode: null,
workReason: null,
workFaultDesc: null,
workCostTime: null,
workCost: null,
outWorkId: null,
outWorkCode: null,
attr1: null,
attr2: null,
attr3: null,
createBy: null,
createTime: null,
updateTime: null,
updateBy: null,
delFlag: null,
factoryCode: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
//
(this.queryParams.workPlanTimeArray = []),
(this.queryParams.workPlanDownTimeArray = []),
this.handleQuery();
},
/** 查询按钮操作 */
handleView(row) {
this.reset();
const workId = row.workId || this.ids;
getRepairOrder(workId).then((response) => {
this.form = response.data;
//response.data.beforeRepairFiles
if (response.data.beforeRepairFiles != null) {
var beforeNewFiles = [];
response.data.beforeRepairFiles.forEach((item) => {
var beforeNewFile = {};
beforeNewFile.name = item.fileName;
beforeNewFile.url = item.fileAddress;
beforeNewFiles.push(beforeNewFile);
});
this.form.beforeRepairFiles = beforeNewFiles;
//
var urlBeforeLists = [];
beforeNewFiles.forEach((item) => {
urlBeforeLists.push(item.url);
});
this.urlBeforeLists = urlBeforeLists;
}
//response.data.afterRepairFiles
if (response.data.afterRepairFiles != null) {
var afterNewFiles = [];
response.data.afterRepairFiles.forEach((item) => {
var afterNewFile = {};
afterNewFile.name = item.fileName;
afterNewFile.url = item.fileAddress;
afterNewFiles.push(afterNewFile);
});
this.form.afterRepairFiles = afterNewFiles;
//
var urlAfterLists = [];
afterNewFiles.forEach((item) => {
urlAfterLists.push(item.url);
});
this.urlAfterLists = urlAfterLists;
}
this.detailList = response.data.detailList;
//
var standards = [];
this.detailList.forEach((item1) => {
//
item1.standardList.forEach((item) => {
var standard = {};
standard.itemName = item1.itemName;
standard.standardName = item.standardName;
standard.detailUpLimit = item.detailUpLimit;
standard.detailDownLimit = item.detailDownLimit;
standard.detailUnit = item.detailUnit;
standard.detailReach = item.detailReach;
standard.actualValue = item.actualValue;
standard.standardType = item.standardType;
standards.push(standard);
});
});
this.detailList = standards;
//
this.openView = true;
this.title = "查看维修工单";
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"device/repairOrder/export",
{
...this.queryParams,
},
` repairOrder_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -166,9 +166,10 @@
:formatter="productCodeFormate"
/>
<el-table-column label="产品名称" align="center" prop="productName" width="200"/>
<el-table-column label="规格型号" align="center" prop="spec" />
<el-table-column label="排产数量(母)" align="center" prop="quantity" width="100"/>
<el-table-column label="规格型号" align="center" prop="spec" v-if="false"/>
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="报工批次" align="center" prop="batch" width="100"/>
<el-table-column label="本次报工数量" align="center" prop="quantityFeedback" width="100"/>
<el-table-column label="用人数" align="center" prop="useMan" />
<el-table-column label="工时" align="center" prop="workTime" />
@ -233,7 +234,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="生产工单编码" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请选择生产工单" >
<el-input v-model="form.workorderCode" placeholder="请选择生产工单">
<el-button slot="append" @click="handleSelectWorkOrder" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
@ -332,7 +333,6 @@
/>
</el-form-item>
</el-col>
<!--
<el-col :span="6">
<el-form-item label="班组编码" prop="teamCode">
@ -346,6 +346,25 @@
</el-form-item>
</el-col>-->
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="批次编码" prop="batch">
<el-select v-model="form.batch" class="selectItem" placeholder="请选择班组" clearable>
<el-option v-for="(item,index) in batchList"
:key="index"
:label="item.batchCode"
:value="item.batchCode">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束报工" prop="endReport">
<el-radio v-model="form.endReport" label="0"></el-radio>
<el-radio v-model="form.endReport" label="1"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
@ -386,7 +405,7 @@
</template>
<script>
import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork,reportSap } from "@/api/mes/reportWork";
import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork,reportSap,getBatchList } from "@/api/mes/reportWork";
import ReportWorkConsume from "./reportWorkConsume.vue";
import ItemSelectUser from "./selectUser.vue";
import ItemSelectWorkOrder from "./selectWorkOrder.vue";
@ -459,13 +478,16 @@ export default {
attr4: null,
},
//
form: {},
form: {
endReport:'0'
},
uploadStatusList:[
{"dictLabel":"待报工","dictValue":"0"},
{"dictLabel":"报工成功","dictValue":"1"},
{"dictLabel":"报工失败","dictValue":"2"}
],
teamList:[],
batchList:[],
//
rules: {
workorderCode:[
@ -587,7 +609,8 @@ export default {
createBy: null,
createTime: null,
updateTime: null,
updateBy: null
updateBy: null,
endReport:'0'
};
this.resetForm("form");
},
@ -723,6 +746,9 @@ export default {
this.form.unit = obj.unit;
this.form.shiftId = obj.shiftId;
this.form.shiftName = obj.shiftName;
getBatchList(obj.workorderCode).then(response => {
this.batchList = response;
});
},
/**线体选择弹出框**/
handleSelectEquip() {

@ -150,6 +150,17 @@
>打印预览
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleDetail"
>工单详情
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -168,7 +179,12 @@
<el-table-column width="300" label="产品名称" align="center" prop="productName"/>
<el-table-column label="规格型号" align="center" prop="productSpc" v-if="false"/>
<el-table-column width="50" label="单位" align="center" prop="unit"/>
<el-table-column width="120" label="已生产数量" align="center" prop="quantityProduced"/>
<!--
<el-table-column label="子单批次信息" width="300" align="center" prop="batchInfo">
<template slot-scope="scope">
<div v-for="item in scope.row.batchInfo">{{ item }}</div>
</template>
</el-table-column>-->
<el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/>
<el-table-column width="150" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="200" label="工艺名称" align="center" prop="routeName" />
@ -188,6 +204,7 @@
</el-table-column>
<el-table-column label="班次" align="center" prop="shiftId" :formatter="shiftFormat">
</el-table-column>
<el-table-column label="工单状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.workorder_type" :value="scope.row.status"/>
@ -463,12 +480,13 @@
<el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="90" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="90" label="班次" align="center" prop="shiftDesc" :formatter="shiftFormat"/>
<el-table-column align="center" prop="batchCodeList" label="批次号"></el-table-column>
<el-table-column align="center" width="230" prop="batchCodeList" label="批次号"></el-table-column>
<el-table-column align="center" width="150" prop="batchNumList" label="批次数量"></el-table-column>
</el-table>
<!-- 测试 -->
<!-- 操作按钮 -->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm" v-if="showDetail"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -486,7 +504,6 @@
v-model="materielParams.productCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="productCode">
@ -494,7 +511,6 @@
v-model="materielParams.productDescZh"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleMaterielQuery"
/>
</el-form-item>
<el-form-item>
@ -554,6 +570,7 @@ export default {
//
formRef: 'form',
validateRules: [],
materielList:[],
printData: {
printable: 'printFrom',
ignore: ['no-print'],
@ -698,6 +715,7 @@ export default {
pageSize: 10,
},
materielBP: [],
showDetail:true
};
},
@ -714,6 +732,12 @@ export default {
return cellValue.slice(7,18); //
},
// -
handleMaterielQuery() {
this.materielQueryParams.pageNum = 1;
this.getMaterielList();
},
// -
changeCarNum(num) {
@ -1279,9 +1303,150 @@ export default {
this.loading = false;
});
},
//
handleDetail(row) {
//
this.reset();
this.splitData = [];
this.productData = [];
this.splitForm = {
prodLineCodeArray: [],
splitNum: null,
productDate: null,
shiftId: null,
routeCode: null,
carNum: null,
prodType:null,
materialCode:null,
materialName:null
}
this.formFields = []
this.converCarNum = null;
//
getProShifts().then(response => {
this.workShift = response.data
})
//
getProRoutes(this.selectWork.productCode).then(response => {
this.routes = response.data
getProEquipment(this.selectWork.routeCode).then(response => {
this.proline = response.data
})
//
for (let i = 0; i < this.routes.length; i++) {
if (this.routes[i].routeCode == this.selectWork.routeCode) {
this.converCarNum = this.routes[i].carNumUnit;
}
}
})
//
getProEquipment(this.selectWork.routeCode).then(response2 => {
this.eRouteOptions = response2.data
})
// list
getWorkBatchList(this.selectWork).then(response => {
this.formFields = response.data
})
//
//
this.proLoading = true // true
this.workerLoading = true // true
getOrderAndWork(this.selectWork).then(response => {
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
//
this.splitForm.prodType = this.splitData[0].prodType
if(this.productData[0].prodType == 'white') {
this.checkType = true
this.splitForm.materialName = this.splitData[0].materialName
this.splitForm.materialCode = this.splitData[0].materialCode
}else {
this.checkType = false
}
this.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true // refreshProTabletrue
this.proLoading = false // false
})
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
//
this.splitForm.splitNum = this.splitData[0].quantitySplit
//
this.splitForm.prodLineCodeArray = response.data.workOrder.prodLineCodeArray
//
this.splitForm.carNum = this.splitData[0].carNum
//
this.splitForm.shiftId = this.splitData[0].shiftDesc
//
this.splitForm.routeCode = this.splitData[0].routeCode
//
if(this.splitData[0].productDate != null){
this.splitForm.productDate = this.splitData[0].productDate;
}else{
this.splitForm.productDate = new Date();
}
//
if (this.productData[0].prodType == 'white'){
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
//
if (this.productData[0],prototype != 'white'){
if(this.splitData[0].sortNo != null){
this.splitForm.sortNo = this.splitData[0].sortNo
}
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work.children[0]);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
})
this.open = true;
this.title = "生产工单详情";
this.showDetail = false;
},
//
cancel() {
this.open = false;
this.showDetail = true;
this.reset();
},
// -

Loading…
Cancel
Save