巡检计划修改初始化

master
wws 1 year ago
parent 55ffe9f104
commit d6165a0092

@ -1,9 +1,26 @@
import request from '@/utils/request'
// 修改计划初始化信息
export function initUpdatePlanInfo(data) {
return request({
url: '/device/inspectionPlan/initUpdatePlanInfo',
method: 'post',
data: data
});
}
// 查询工作中心
export function getWorkCenter() {
return request({
url: '/device/inspectionPlan/getWorkCenter',
method: 'get'
});
}
// 查询人员信息
export function getPersonList() {
return request({
url: '/device/plan/getPersonList',
url: '/device/inspectionPlan/getPersonList',
method: 'get'
});
}
@ -11,7 +28,7 @@ export function getPersonList() {
// 处理计划-设备信息
export function formatEquItem(data) {
return request({
url: '/device/plan/formatEquItem',
url: '/device/inspectionPlan/formatEquItem',
method: 'post',
data: data
});
@ -20,7 +37,7 @@ export function formatEquItem(data) {
// 获取设备信息list
export function getEquList(equQuery) {
return request({
url: '/device/plan/getEquList',
url: '/device/inspectionPlan/getEquList',
method: 'get',
params: equQuery
});
@ -29,7 +46,7 @@ export function getEquList(equQuery) {
// 查询计划列表
export function listPlan(query) {
return request({
url: '/device/plan/list',
url: '/device/inspectionPlan/list',
method: 'get',
params: query
});
@ -38,7 +55,7 @@ export function listPlan(query) {
// 查询计划详细
export function getPlan(planId) {
return request({
url: '/device/plan/' + planId,
url: '/device/inspectionPlan/' + planId,
method: 'get'
});
}
@ -46,7 +63,7 @@ export function getPlan(planId) {
// 新增计划
export function addPlan(data) {
return request({
url: '/device/plan',
url: '/device/inspectionPlan',
method: 'post',
data: data
});
@ -55,7 +72,7 @@ export function addPlan(data) {
// 修改计划
export function updatePlan(data) {
return request({
url: '/device/plan',
url: '/device/inspectionPlan',
method: 'put',
data: data
});
@ -64,7 +81,7 @@ export function updatePlan(data) {
// 删除计划
export function delPlan(planId) {
return request({
url: '/device/plan/' + planId,
url: '/device/inspectionPlan/' + planId,
method: 'delete'
});
}

@ -25,7 +25,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产线" prop="planProdLine">
<el-form-item v-if="false" label="产线" prop="planProdLine">
<el-input
v-model="queryParams.planProdLine"
placeholder="请输入产线"
@ -33,7 +33,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-form-item v-if="false" label="设备名称" prop="equipmentName">
<el-input
v-model="queryParams.equipmentName"
placeholder="请输入设备名称"
@ -41,7 +41,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-form-item v-if="false" label="设备编码" prop="equipmentCode">
<el-input
v-model="queryParams.equipmentCode"
placeholder="请输入设备编码"
@ -73,7 +73,7 @@
placeholder="请选择循环执行时间结束">
</el-date-picker>
</el-form-item>
<el-form-item label="巡检人员" prop="planPerson">
<el-form-item v-if="false" label="巡检人员" prop="planPerson">
<el-input
v-model="queryParams.planPerson"
placeholder="请输入巡检人员"
@ -250,9 +250,9 @@
<el-table-column label="计划编码" align="center" prop="planCode"/>
<el-table-column label="计划名称" align="center" prop="planName"/>
<el-table-column label="车间" align="center" prop="planWorkshop"/>
<el-table-column label="产线" align="center" prop="planProdLine"/>
<el-table-column label="设备名称" align="center" prop="equipmentName"/>
<el-table-column label="设备编码" align="center" prop="equipmentCode"/>
<el-table-column v-if="false" label="产线" align="center" prop="planProdLine"/>
<el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName"/>
<el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode"/>
<el-table-column label="循环周期" align="center" prop="planLoop"/>
<el-table-column label="循环周期类型" align="center" prop="planLoopType"/>
<el-table-column label="循环执行时间开始" align="center" prop="planLoopStart" width="180">
@ -265,7 +265,7 @@
<span>{{ parseTime(scope.row.planLoopEnd, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="巡检人员" align="center" prop="planPerson"/>
<el-table-column v-if="false" label="巡检人员" align="center" prop="planPerson"/>
<el-table-column label="计划状态" align="center" prop="planStatus"/>
<el-table-column v-if="false" label="是否可生产-限制" align="center" prop="planRestrict"/>
<el-table-column v-if="false" label="维护类型" align="center" prop="planType"/>
@ -376,10 +376,16 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="false">
<el-row>
<el-col :span="8">
<el-form-item label="巡检人员">
<el-select v-model="form.planPerson" placeholder="请选择巡检人员" clearable>
<el-form-item label="车间">
<el-select @change="changeCenter" v-model="form.planWorkshop" placeholder="请选择车间" clearable>
<el-option
v-for="item in workCenterList"
:key="item.factoryCode"
:label="item.factoryName"
:value="item.factoryCode">
</el-option>
</el-select>
</el-form-item>
</el-col>
@ -523,6 +529,10 @@
prop="equipmentTypeName"
label="设备类型">
</el-table-column>
<el-table-column
prop="workshopName"
label="工作中心">
</el-table-column>
</el-table>
<pagination
@ -574,7 +584,7 @@ import {
updatePlan,
getEquList,
formatEquItem,
getPersonList
getPersonList, getWorkCenter, initUpdatePlanInfo
} from "@/api/device/plan";
export default {
@ -582,6 +592,14 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable'],
data() {
return {
//
changeCenter() {
console.log("改变了工作中心")
console.log(this.form.planWorkshop)
},
// list
workCenterList:[],
// 穿
personList: [],
selectPersonList: [],
@ -601,6 +619,7 @@ export default {
equipmentQuery: {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
pageNum: 1,
pageSize: 10,
},
@ -698,6 +717,7 @@ export default {
planTimeArray: [],
equipmentItem: [],
personList: [],
planWorkshop:null,
planType: "inspection",
},
//
@ -725,7 +745,7 @@ export default {
},
//
selectEquBtn() {
this.getEquList();
this.selectEqu = true;
},
//
@ -751,25 +771,54 @@ export default {
//
this.itemDetailList = [];
console.log("12312312")
console.log(e.equCheckItemList)
//
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 == null) {
// -
console.log("出现了")
console.log(e.equPlanDetailList)
for (let i = 0; i < e.equPlanDetailList.length; i++) {
for (let j = 0; j < e.equPlanDetailList[i].equPlanStandardList.length; j++) {
//
if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性";
}else {
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量";
//
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]);
}
}
this.itemDetailList.push(e.equCheckItemList[i].equCheckItemDetailList[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;
@ -818,6 +867,7 @@ export default {
//
getEquList() {
this.equLoading = true;
this.equipmentQuery.workshopCode = this.form.planWorkshop;
getEquList(this.equipmentQuery).then(response => {
this.equTotal = response.total;
this.queryEquipment = response.rows;
@ -829,6 +879,7 @@ export default {
this.equipmentQuery = {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
pageNum: 1,
pageSize: 10,
};
@ -838,8 +889,15 @@ export default {
stepLast() {
this.inspectionPlanStep--;
},
// -
// --
stepNext() {
if (this.form.planWorkshop == null) {
this.$message({
message: '请选择工作中心!',
type: 'warning'
})
return
}
this.inspectionPlanStep++;
},
/** 查询计划列表 */
@ -914,27 +972,62 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
//
this.resetQuery();
this.queryEquipment = [];
this.inspectionPlanStep = 0;
this.selectPersonList = [];
this.personList = [];
this.getEquList();
this.setPerson();
this.setWorkCenter();
this.open = true;
this.title = "添加计划";
},
//
setWorkCenter(){
getWorkCenter().then(response => {
console.log("这里是工作中心")
console.log(response.data)
this.workCenterList = response.data;
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const planId = row.planId || this.ids
getPlan(planId).then(response => {
//
this.resetQuery();
this.queryEquipment = [];
this.inspectionPlanStep = 0;
this.selectPersonList = [];
this.personList = [];
this.setPerson();
this.setWorkCenter();
initUpdatePlanInfo(row).then(response => {
console.log(row)
console.log("返回数据如下")
console.log(response.data)
this.form = response.data;
this.selectPersonList = response.data.personListVO;
for (let i = 0; i < this.form.equipmentItem.length; i++) {
if (this.form.equipmentItem[i].itemTempName == null) {
this.form.equipmentItem[i].itemTempName = '';
}
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
this.form.equipmentItem[i].itemTempName = this.form.equipmentItem[i].itemTempName + this.form.equipmentItem[i].equPlanDetailList[j].itemName +","
}
}
this.open = true;
this.title = "修改计划";
});
})
},
/** 提交按钮 */
submitForm() {
@ -987,6 +1080,8 @@ export default {
});
} else {
this.form.personList = this.selectPersonList;
console.log("这里是人员信息")
console.log(this.form.personList)
addPlan(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;

Loading…
Cancel
Save