巡检计划修改初始化

master
wws 1 year ago
parent 55ffe9f104
commit d6165a0092

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

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

Loading…
Cancel
Save