# Conflicts:
#	src/views/quality/material/index.vue
master
shaoyong 1 year ago
commit 8f539b5e06

@ -1,5 +1,14 @@
import request from '@/utils/request' import request from '@/utils/request'
// 处理计划-设备信息
export function formatEquItem(data) {
return request({
url: '/device/upkeepPlan/formatEquItem',
method: 'post',
data: data
});
}
// 查询保养计划列表 // 查询保养计划列表
export function listUpkeepPlan(query) { export function listUpkeepPlan(query) {
return request({ return request({

@ -55,12 +55,12 @@ export default {
// (MB) // (MB)
fileSize: { fileSize: {
type: Number, type: Number,
default: 5, default: 50,
}, },
// , ['png', 'jpg', 'jpeg'] // , ['png', 'jpg', 'jpeg']
fileType: { fileType: {
type: Array, type: Array,
default: () => ["doc", "xls", "docx", "xlsx","ppt", "txt", "pdf",'png', 'jpg', 'jpeg'], default: () => ["doc", "xls", "docx", "xlsx","ppt", "txt", "pdf",'png', 'jpg', 'jpeg','apk'],
}, },
// //
isShowTip: { isShowTip: {

@ -1227,6 +1227,6 @@ export default {
} }
.el-transfer-panel { .el-transfer-panel {
width: 300px; width: 260px;
} }
</style> </style>

@ -330,108 +330,315 @@
/> />
<!-- 添加或修改保养计划对话框 --> <!-- 添加或修改保养计划对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="计划编码" prop="planCode"> <el-form-item v-if="false" label="计划编码" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编码" /> <el-input v-model="form.planCode" placeholder="请输入计划编码" />
</el-form-item> </el-form-item>
<el-form-item label="计划名称" prop="planName"> <div class="my-step-mar">
<el-input v-model="form.planName" placeholder="请输入计划名称" /> <el-steps :active="upkeepSteps" finish-status="success" align-center>
</el-form-item> <el-step title="保养计划基本信息"></el-step>
<el-form-item label="车间" prop="planWorkshop"> <el-step title="选择设备、保养项"></el-step>
<el-input v-model="form.planWorkshop" placeholder="请输入车间" /> <el-step title="更换备件"></el-step>
</el-form-item> <el-step title="人员"></el-step>
<el-form-item label="产线" prop="planProdLine"> </el-steps>
<el-input v-model="form.planProdLine" placeholder="请输入产线" /> <!-- 保养计划基本信息 -->
</el-form-item> <div class="my-step-body" v-if="this.upkeepSteps==0">
<el-form-item label="设备名称" prop="equipmentName"> <el-row>
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" /> <el-col :span="8">
</el-form-item> <el-form-item label="保养名称:">
<el-form-item label="设备编码" prop="equipmentCode"> <el-input v-model="form.planName" placeholder="请输入保养名称"/>
<el-input v-model="form.equipmentCode" placeholder="请输入设备编码" /> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="循环周期" prop="planLoop"> <el-col :span=12 :offset="1">
<el-input v-model="form.planLoop" placeholder="请输入循环周期" /> <el-form-item label="保养类型:">
</el-form-item> <el-radio v-model="form.upkeep" label="0"></el-radio>
<el-form-item label="循环周期类型" prop="planLoopType"> <el-radio v-model="form.upkeep" label="1"></el-radio>
<el-select v-model="form.planLoopType" placeholder="请选择循环周期类型"> </el-form-item>
<el-option </el-col>
v-for="dict in dict.type.device_loop_type" </el-row>
:key="dict.value" <el-row>
:label="dict.label" <el-col :span="6">
:value="dict.value" <el-form-item label="循环周期:">
></el-option> <el-input v-model="form.planLoop" placeholder="请输入循环周期"/>
</el-select> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="循环执行时间开始" prop="planLoopStart"> <el-col :span="2">
<el-date-picker clearable <el-select v-model="form.planLoopType" placeholder="周期" clearable>
v-model="form.planLoopStart" <el-option
type="date" v-for="dict in dict.type.device_loop_type"
value-format="yyyy-MM-dd" :key="dict.value"
placeholder="请选择循环执行时间开始"> :label="dict.label"
</el-date-picker> :value="dict.value"
</el-form-item> />
<el-form-item label="循环执行时间结束" prop="planLoopEnd"> </el-select>
<el-date-picker clearable </el-col>
v-model="form.planLoopEnd" <el-col :span="8" :offset="1">
type="date" <el-form-item label="工作中心:">
value-format="yyyy-MM-dd" <el-select v-model="form.planWorkshop" placeholder="工作中心" clearable>
placeholder="请选择循环执行时间结束"> <el-option
</el-date-picker> v-for="item in workCenterList"
</el-form-item> :key="item.factoryCode"
<el-form-item label="巡检人员" prop="planPerson"> :label="item.factoryName"
<el-input v-model="form.planPerson" placeholder="请输入巡检人员" /> :value="item.factoryCode">
</el-form-item> </el-option>
<el-form-item label="计划状态" prop="planStatus"> </el-select>
<el-radio-group v-model="form.planStatus"> </el-form-item>
<el-radio </el-col>
v-for="dict in dict.type.sys_normal_disable" </el-row>
:key="dict.value" <el-row>
:label="dict.value" <el-col :span="20">
>{{dict.label}}</el-radio> <el-form-item label-width="160px" label="计划保养时间计算规则:">
</el-radio-group> <el-radio v-model="form.calculationRule" label="0"></el-radio>
</el-form-item> <el-radio v-model="form.calculationRule" label="1"></el-radio>
<el-form-item label="是否可生产-限制" prop="planRestrict"> </el-form-item>
<el-input v-model="form.planRestrict" placeholder="请输入是否可生产-限制" /> </el-col>
</el-form-item> </el-row>
<el-form-item label="是否委外" prop="planOutsource"> <el-row>
<el-input v-model="form.planOutsource" placeholder="请输入是否委外" /> <el-col :span="20">
</el-form-item> <el-form-item label-width="110px" label="是否停机保养:">
<el-form-item label="委外工单编码" prop="workCode"> <el-radio v-model="form.shutDown" label="0"></el-radio>
<el-input v-model="form.workCode" placeholder="请输入委外工单编码" /> <el-radio v-model="form.shutDown" label="1"></el-radio>
</el-form-item> </el-form-item>
<el-form-item label="工厂" prop="factoryCode"> </el-col>
<el-input v-model="form.factoryCode" placeholder="请输入工厂" /> </el-row>
</el-form-item> </div>
<el-form-item label="备用字段1" prop="attr1"> <!-- 选择设备保养项 -->
<el-input v-model="form.attr1" placeholder="请输入备用字段1" /> <div class="my-step-body" v-if="this.upkeepSteps==1">
</el-form-item> <el-row>
<el-form-item label="备用字段2" prop="attr2"> <el-col class="my-step-mar" :span="1.5">
<el-input v-model="form.attr2" placeholder="请输入备用字段2" /> <el-button
</el-form-item> type="primary"
<el-form-item label="备用字段3" prop="attr3"> plain
<el-input v-model="form.attr3" placeholder="请输入备用字段3" /> size="mini"
</el-form-item> @click="selectEquBtn">
<el-form-item label="删除标志" prop="delFlag"> 选择设备
<el-input v-model="form.delFlag" placeholder="请输入删除标志" /> </el-button>
</el-form-item> </el-col>
</el-row>
<el-table
:data="form.equipmentItem"
stripe
style="width: 100%">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column
prop="equipmentCode"
label="设备编码"
width="180">
</el-table-column>
<el-table-column
prop="equipmentName"
label="设备名称"
width="180">
</el-table-column>
<el-table-column
prop="itemTempName"
label="巡检项"
width="300">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
>
<template slot-scope="scope">
<el-button @click="editorTheItem(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="delTheEquItem(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 编辑检查项弹窗 -->
<el-dialog
title="编辑检查项"
:visible.sync="editorItem"
width="50%"
append-to-body
>
<!-- 编辑检查标准 -->
<el-table
:data="itemDetailList"
v-loading="detailLoading"
stripe
@selection-change="selectChangeEqu"
style="width: 100%">
<el-table-column width="55" align="center"/>
<el-table-column
prop="itemName"
label="检查项">
</el-table-column>
<el-table-column
prop="standardName"
label="检查标准">
</el-table-column>
<el-table-column
prop="standardTypeName"
label="标准类型">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
>
<template slot-scope="scope">
<el-button @click="delStandard(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="standardBtn"> </el-button>
</span>
</el-dialog>
<!-- 选择设备弹窗 -->
<el-dialog
title="选择设备"
:visible.sync="selectEqu"
width="50%"
append-to-body
>
<el-form :model="equipmentQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="设备编码">
<el-input
v-model="equipmentQuery.equipmentCode"
placeholder="请输入设备编码"
clearable
/>
</el-form-item>
<el-form-item label="设备名称">
<el-input
v-model="equipmentQuery.equipmentName"
placeholder="请输入设备名称"
clearable
/>
</el-form-item>
<el-form-item v-if="false" label="设备类型">
<el-input
v-model="equipmentQuery.equipmentName"
placeholder="请输入设备类型"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getEquList"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetEqu"></el-button>
</el-form-item>
</el-form>
<!-- 搜索-设备列表 -->
<el-table
:data="queryEquipment"
v-loading="equLoading"
stripe
@selection-change="selectChangeEqu"
style="width: 100%">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column
prop="equipmentCode"
label="设备编码">
</el-table-column>
<el-table-column
prop="equipmentName"
label="设备名称">
</el-table-column>
<el-table-column
prop="equipmentTypeName"
label="设备类型">
</el-table-column>
<el-table-column
prop="workshopName"
label="工作中心">
</el-table-column>
</el-table>
<pagination
v-show="equTotal>0"
:total="equTotal"
:page.sync="equipmentQuery.pageNum"
:limit.sync="equipmentQuery.pageSize"
@pagination="getEquList"
/>
<span slot="footer" class="dialog-footer">
<el-button @click="selectEqu = false"> </el-button>
<el-button type="primary" @click="confirmSelectEquBtn"> </el-button>
</span>
</el-dialog>
</div>
<!-- 更换备件 -->
<div class="my-step-body" v-if="this.upkeepSteps==2">
更换备件
</div>
<!-- 人员 -->
<div class="my-step-body" v-if="this.upkeepSteps==3">
<el-row>
<el-col :span="24" :offset="1">
<el-transfer
:titles="['人员','已选择人员']"
filterable
:filter-method="filterMethod"
filter-placeholder="请输入人员名称"
v-model="selectPersonList"
:data="personList">
</el-transfer>
</el-col>
</el-row>
</div>
</div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button style="margin-top: 12px;" v-if="this.upkeepSteps > 0" @click="stepLast"></el-button>
<el-button @click="cancel"> </el-button> <el-button style="margin-top: 12px;" v-if="this.upkeepSteps < 3" @click="stepNext"></el-button>
<el-button type="primary" v-if="this.upkeepSteps == 3" @click="submitForm"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listUpkeepPlan, getUpkeepPlan, delUpkeepPlan, addUpkeepPlan, updateUpkeepPlan } from "@/api/device/upkeepPlan"; import {
listUpkeepPlan,
getUpkeepPlan,
delUpkeepPlan,
addUpkeepPlan,
updateUpkeepPlan,
formatEquItem
} from "@/api/device/upkeepPlan";
import {getEquList, getPersonList, getWorkCenter} from "@/api/device/plan";
export default { export default {
name: "UpkeepPlan", name: "UpkeepPlan",
dicts: ['device_loop_type', 'sys_normal_disable'], dicts: ['device_loop_type', 'sys_normal_disable'],
data() { data() {
return { return {
// 穿
personList: [],
selectPersonList: [],
// list
workCenterList: [],
// list
itemDetailList: [],
// loading
detailLoading: false,
//
selectEquList: [],
// loading
equLoading: false,
//
equTotal: 0,
// list
queryEquipment: [],
//
equipmentQuery: {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
pageNum: 1,
pageSize: 10,
},
//
selectEqu: false,
//
editorItem: false,
//
upkeepSteps: 0,
// //
loading: true, loading: true,
// //
@ -481,76 +688,169 @@ export default {
updateTime: null updateTime: null
}, },
// //
form: {}, form: {
equipmentItem: [],
shutDown: '0',
calculationRule: '0',
planLoopType: 'day',
planLoop: null,
upkeep: '1',
planName: null,
planWorkshop: null,
},
// //
rules: { rules: {}
planCode: [
{ required: true, message: "计划编码不能为空", trigger: "blur" }
],
planName: [
{ required: true, message: "计划名称不能为空", trigger: "blur" }
],
planWorkshop: [
{ required: true, message: "车间不能为空", trigger: "blur" }
],
planProdLine: [
{ required: true, message: "产线不能为空", trigger: "blur" }
],
equipmentName: [
{ required: true, message: "设备名称不能为空", trigger: "blur" }
],
equipmentCode: [
{ required: true, message: "设备编码不能为空", trigger: "blur" }
],
planLoop: [
{ required: true, message: "循环周期不能为空", trigger: "blur" }
],
planLoopType: [
{ required: true, message: "循环周期类型不能为空", trigger: "change" }
],
planLoopStart: [
{ required: true, message: "循环执行时间开始不能为空", trigger: "blur" }
],
planLoopEnd: [
{ required: true, message: "循环执行时间结束不能为空", trigger: "blur" }
],
planPerson: [
{ required: true, message: "巡检人员不能为空", trigger: "blur" }
],
planStatus: [
{ required: true, message: "计划状态不能为空", trigger: "change" }
],
planType: [
{ required: true, message: "维护类型不能为空", trigger: "change" }
],
planOutsource: [
{ required: true, message: "是否委外不能为空", trigger: "blur" }
],
factoryCode: [
{ required: true, message: "工厂不能为空", trigger: "blur" }
],
delFlag: [
{ required: true, message: "删除标志不能为空", trigger: "blur" }
],
createBy: [
{ required: true, message: "创建人不能为空", trigger: "blur" }
],
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
],
updateBy: [
{ required: true, message: "更新人不能为空", trigger: "blur" }
],
updateTime: [
{ required: true, message: "更新时间不能为空", trigger: "blur" }
]
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
// List-穿
setPerson() {
getPersonList().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.personList.push({
label: response.data[i].nickName + '(' + response.data[i].userName + ')',
key: response.data[i].userId,
})
}
});
},
// 穿
filterMethod(query, item) {
return item.label.indexOf(query) > -1;
},
//
setWorkCenter() {
getWorkCenter().then(response => {
this.workCenterList = response.data;
})
},
//
standardBtn() {
this.editorItem = false;
},
//
delStandard(e) {
e.showFlag = false;
for (let i = 0; i < this.itemDetailList.length; i++) {
if (this.itemDetailList[i].detailCode == e.detailCode) {
this.itemDetailList[i].showFlag = false;
this.itemDetailList.splice(i, 1);
}
}
},
// -
editorTheItem(e) {
//
this.itemDetailList = [];
//
if (e.equCheckItemList == null) {
// -
for (let i = 0; i < e.equPlanDetailList.length; i++) {
for (let j = 0; j < e.equPlanDetailList[i].equPlanStandardList.length; j++) {
//
e.equPlanDetailList[i].equPlanStandardList[j].itemName = e.equPlanDetailList[i].itemName;
//
if (e.equPlanDetailList[i].equPlanStandardList[j].standardType == "qualitative") {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定性";
} else {
e.equPlanDetailList[i].equPlanStandardList[j].standardTypeName = "定量";
}
this.itemDetailList.push(e.equPlanDetailList[i].equPlanStandardList[j]);
}
}
} else {
// -
for (let i = 0; i < e.equCheckItemList.length; i++) {
for (let j = 0; j < e.equCheckItemList[i].equCheckItemDetailList.length; j++) {
//
e.equCheckItemList[i].equCheckItemDetailList[j].itemName = e.equCheckItemList[i].itemName;
// false
if (e.equCheckItemList[i].equCheckItemDetailList[j].showFlag == false) {
e.equCheckItemList[i].equCheckItemDetailList.splice(j, 1);
}
//
if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性";
} else {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量";
}
this.itemDetailList.push(e.equCheckItemList[i].equCheckItemDetailList[j]);
}
}
}
this.editorItem = true;
},
// -
delTheEquItem(e) {
this.form.equipmentItem.splice(e.equipmentCode, 1)
},
//
confirmSelectEquBtn() {
//
for (let i = 0; i < this.form.equipmentItem.length; i++) {
for (let j = 0; j < this.selectEquList.length; j++) {
if (this.form.equipmentItem[i].equipmentCode == this.selectEquList[j].equipmentCode) {
this.$message({
message: "存在已选择的设备!",
type: "warning"
})
return
}
}
}
//
formatEquItem(this.selectEquList).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.form.equipmentItem.push(response.data[i]);
}
this.selectEqu = false;
})
},
//
selectChangeEqu(e) {
this.selectEquList = e;
},
//
getEquList() {
this.equLoading = true;
this.equipmentQuery.workshopCode = this.form.planWorkshop;
getEquList(this.equipmentQuery).then(response => {
this.equTotal = response.total;
this.queryEquipment = response.rows;
this.equLoading = false;
})
},
//
selectEquBtn() {
this.getEquList();
this.selectEqu = true;
},
//
stepLast() {
this.upkeepSteps--;
},
//
stepNext() {
this.upkeepSteps++;
},
/** 查询保养计划列表 */ /** 查询保养计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -576,7 +876,7 @@ export default {
equipmentName: null, equipmentName: null,
equipmentCode: null, equipmentCode: null,
planLoop: null, planLoop: null,
planLoopType: null, planLoopType: 'day',
planLoopStart: null, planLoopStart: null,
planLoopEnd: null, planLoopEnd: null,
planPerson: null, planPerson: null,
@ -593,10 +893,25 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
upkeep: '1',
calculationRule: '0',
shutDown: '0',
equipmentItem: [],
}; };
this.resetForm("form"); this.resetForm("form");
}, },
//
resetEqu() {
this.equipmentQuery = {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
pageNum: 1,
pageSize: 10,
};
this.getEquList();
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -616,6 +931,15 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
//
this.resetQuery();
this.queryEquipment = [];
this.upkeepSteps = 0;
this.selectPersonList = [];
this.personList = [];
this.setPerson();
this.setWorkCenter();
this.open = true; this.open = true;
this.title = "添加保养计划"; this.title = "添加保养计划";
}, },
@ -634,6 +958,7 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.planId != null) { if (this.form.planId != null) {
this.form.personList = this.selectPersonList;
updateUpkeepPlan(this.form).then(response => { updateUpkeepPlan(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -668,3 +993,17 @@ export default {
} }
}; };
</script> </script>
<style>
.my-step-mar {
margin-left: 10px;
margin-right: 10px;
}
.my-step-body {
margin-top: 15px;
}
.el-transfer-panel {
width: 270px;
}
</style>

@ -110,10 +110,9 @@
<el-form-item label="文件名称" prop="fileName"> <el-form-item label="文件名称" prop="fileName">
<el-input v-model="form.fileName" placeholder="请输入文件名称" /> <el-input v-model="form.fileName" placeholder="请输入文件名称" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="文件地址" prop="fileList">
<el-form-item label="文件地址" prop="fileAddress"> <FileUpload v-model="form.fileList"/>
<el-input v-model="form.fileAddress" placeholder="请输入文件地址" /> </el-form-item>
</el-form-item>-->
<el-form-item label="版本号" prop="version"> <el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" /> <el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item> </el-form-item>
@ -165,9 +164,11 @@ export default {
attr2: null, attr2: null,
attr3: null, attr3: null,
attr4: null, attr4: null,
fileList:''
}, },
// //
form: {}, form: {},
fileList:[],
// //
rules: { rules: {
fileName: [ fileName: [
@ -244,12 +245,30 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getFile(id).then(response => { getFile(id).then(response => {
this.form = response.data; this.form = response.data;
/**
if(response.data.files != null){
var newFiles = [];
response.data.files.forEach(item =>{
var newfile = {};
newfile.name = item.fileName;
newfile.url = item.fileAddress;
newFiles.push(newfile);
})
this.form.fileList = newFiles;
}
**/
this.open = true; this.open = true;
this.title = "修改手持apk版本控制"; this.title = "修改手持apk版本控制";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if(Array.isArray(this.form.fileList)){
this.form.fileList = this.listToString(this.form.fileList);
}
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {

Loading…
Cancel
Save