生产追溯维护接口联调

dev-scheduling
zhangdi 5 days ago
parent 0f0a26124c
commit 4f4eb1f1f1
  1. 17
      src/api/zhgd-work/retrospectDefend.js
  2. 64
      src/views/zhgd-work/retrospectDefend/components/oneRetrospectDefend.vue
  3. 44
      src/views/zhgd-work/retrospectDefend/components/twoRetrospectDefend.vue

@ -35,3 +35,20 @@ export const getDataByMtnCodeRb = (params) => {
}); });
}; };
// 加载当前工序检验数据
export const loadPrMacToolUseByMtnCode = (params) => {
return request({
url: '/blade-desk/processMaintenance/loadPrMacToolUseByMtnCode',
method: 'get',
params:params
});
};
// 根据工序查询电子档案的数据
export const remarryRedeemRetrospectDefend = (params) => {
return request({
url: '/blade-desk/processMaintenance/remarryRedeemRetrospectDefend',
method: 'get',
params:params
});
};

@ -47,8 +47,8 @@
<el-table-column label="批次号" align="center" prop="batchNo" /> <el-table-column label="批次号" align="center" prop="batchNo" />
<el-table-column label="当前工序" align="center" prop="currentWpTitle" /> <el-table-column label="当前工序" align="center" prop="currentWpTitle" />
<el-table-column align="center" width="100" fixed="right" label="操作"> <el-table-column align="center" width="100" fixed="right" label="操作">
<template #scope="scope"> <template #default="scope">
<el-button type="text" size="mini" @click="deleteRow(scope.row.currentWpId)" <el-button type="text" @click="deleteRow(scope.row.currentWpId)"
>删除</el-button >删除</el-button
> >
</template> </template>
@ -56,17 +56,16 @@
</el-table> </el-table>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span style="color: rgb(85, 85, 243)">维护电子档案</span> <span style="color: rgb(85, 85, 243);">维护电子档案</span>
</div> </div>
<el-form ref="form" :model="formData" :rules="rulesMold" inline> <el-form ref="form" :model="formData" :rules="rulesMold" inline style="margin-top: 10px;">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="设备编码:" prop="ecId"> <el-form-item label="设备编码:" prop="ecId">
<!-- <equipment-card v-model="formData.ecId" clearable /> -->
<jhSelect <jhSelect
:value="ecId" :value="formData.ecId"
@input="val => (ecId = val)" @input="val => (formData.ecId = val)"
placeholder="请搜索选择" placeholder="请搜索选择"
api-url="/blade-desk/processMaintenance/queryEquipmentCard" api-url="/blade-desk/processMaintenance/queryEquipmentCard"
echo-api="/blade-desk/processMaintenance/queryEquipmentCard" echo-api="/blade-desk/processMaintenance/queryEquipmentCard"
@ -93,16 +92,16 @@
> >
<el-option <el-option
v-for="item in dsRbFilePreserveList" v-for="item in dsRbFilePreserveList"
:key="item.rfpId" :key="item.id"
:label="item.name" :label="item.name"
:value="item.rfpId" :value="item.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div class="tableBox"> <div class="tableBoxs">
<table <table
v-if="preserveSlotList.length > 0" v-if="preserveSlotList.length > 0"
id="cus-table" id="cus-table"
@ -152,6 +151,8 @@ export default {
line: true, line: true,
formData: { ecId: null, rfpId: null }, formData: { ecId: null, rfpId: null },
rulesMold: { rulesMold: {
ecId: [{ required: true, message: '请选择设备编码' }],
rfpId: [{ required: true, message: '请选择模板' }],
// ecId: [this.$validation.required], // ecId: [this.$validation.required],
// rfpId: [this.$validation.required], // rfpId: [this.$validation.required],
}, },
@ -350,14 +351,14 @@ export default {
if (item) { if (item) {
loadCurrentWp({ cardNo: item }).then(res => { loadCurrentWp({ cardNo: item }).then(res => {
const obj = this.wpList.find(item => { const obj = this.wpList.find(item => {
return item.currentWpId == res.data.data.currentWpId; return item.wpId == res.data.data.wpId;
}); });
if (obj != null) { if (obj != null) {
return this.$message.warning('此订单已存在'); return this.$message.warning('此订单已存在');
} }
this.dsRbFilePreserveList = []; this.dsRbFilePreserveList = [];
this.wpList.push(res.data); this.wpList.push(res.data.data);
this.getRbFilePreserve(res.data.currentWpId); this.getRbFilePreserve(res.data.data.wpId);
}); });
// this.$ajax.get('prMakeRec/loadCurrentWp/' + item).then(res => { // this.$ajax.get('prMakeRec/loadCurrentWp/' + item).then(res => {
// if (this.$ifAjax(res)) { // if (this.$ifAjax(res)) {
@ -376,15 +377,21 @@ export default {
}, },
codeKeyUpMtnCode() { codeKeyUpMtnCode() {
if (this.mtnCode) { if (this.mtnCode) {
this.$ajax.get('prMacToolUse/loadPrMacToolUseByMtnCode/' + this.mtnCode).then(res => { loadPrMacToolUseByMtnCode({ mtnCode: this.mtnCode }).then(res => {
if (this.$ifAjax(res)) { const list = res.data.data;
console.log(res); for (var i = 0; i < list.length; i++) {
const list = res.data; this.commonMethod(list[i]);
for (var i = 0; i < list.length; i++) {
this.commonMethod(list[i]);
}
} }
}); });
// this.$ajax.get('prMacToolUse/loadPrMacToolUseByMtnCode/' + this.mtnCode).then(res => {
// if (this.$ifAjax(res)) {
// console.log(res);
// const list = res.data;
// for (var i = 0; i < list.length; i++) {
// this.commonMethod(list[i]);
// }
// }
// });
} }
}, },
// //
@ -405,9 +412,9 @@ export default {
// }); // });
}, },
rbFilePreserveChange() { rbFilePreserveChange() {
getByRfpId({ rfpId: this.rfpId }).then(res => { getByRfpId({ rfpId: this.formData.rfpId }).then(res => {
this.mtnCode = null; this.mtnCode = null;
this.preserveSlotList = res.data.data; this.preserveSlotList = res.data.data.preserveSlotList
}); });
// this.$ajax.get('dsRbFilePreserveSlot/getByRfpId/' + this.formData.rfpId).then(res => { // this.$ajax.get('dsRbFilePreserveSlot/getByRfpId/' + this.formData.rfpId).then(res => {
// if (this.$ifAjax(res)) { // if (this.$ifAjax(res)) {
@ -429,7 +436,7 @@ export default {
ecId: this.formData.ecId, ecId: this.formData.ecId,
rfpId: this.formData.rfpId, rfpId: this.formData.rfpId,
line: this.line, line: this.line,
preserveSlotList: this.preserveSlotList, produceMonitorFileSlotVOList: this.preserveSlotList,
}; };
saveRetrospectDefend(query).then(res => { saveRetrospectDefend(query).then(res => {
this.$message.success('保存成功'); this.$message.success('保存成功');
@ -464,12 +471,12 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.content-box{ .content-box {
height: calc(100vh - 40px - 40px - 20px - 10px - 51px - 60px); height: calc(100vh - 40px - 40px - 20px - 10px - 51px - 60px);
overflow-y: auto; overflow-y: auto;
} }
.tableBox { .tableBoxs {
min-height: 100%; min-height: 100%;
padding-bottom: 30px; padding-bottom: 30px;
table { table {
@ -498,3 +505,8 @@ export default {
margin-top: 10px !important; margin-top: 10px !important;
} }
</style> </style>
<style lang="scss" scoped>
:deep(.el-form--inline .el-form-item){
margin-bottom: 5px;
}
</style>

@ -63,6 +63,7 @@ import {
loadCurrentWp, loadCurrentWp,
remarryRedeemSaveRetrospectDefend, remarryRedeemSaveRetrospectDefend,
getDataByMtnCodeRb, getDataByMtnCodeRb,
remarryRedeemRetrospectDefend,
} from '@/api/zhgd-work/retrospectDefend.js'; } from '@/api/zhgd-work/retrospectDefend.js';
import { getByRfpId, getRbFilePreserveByWpId } from '@/api/zhgd-work/eleFilesEdit.js'; import { getByRfpId, getRbFilePreserveByWpId } from '@/api/zhgd-work/eleFilesEdit.js';
import Templates from '../../../qualityTemplate/index.js'; import Templates from '../../../qualityTemplate/index.js';
@ -259,20 +260,27 @@ export default {
}, },
codeKeyUp() { codeKeyUp() {
if (this.cardNo) { if (this.cardNo) {
this.$ajax remarryRedeemRetrospectDefend({ cardNo: this.cardNo, line: this.line }).then(res => {
.post('prMakeRec/remarryRedeemRetrospectDefend', { if (res.data != null && res.data.dsRbFilePreserveSlotList.length <= 0) {
cardNo: this.cardNo, return this.$message.warning('暂未查到对应的数据');
line: this.line, }
}) this.preserveSlotList = res.data.dsRbFilePreserveSlotList;
.then(res => { this.obj = res.data;
if (this.$ifAjax(res)) { });
if (res.data != null && res.data.dsRbFilePreserveSlotList.length <= 0) { // this.$ajax
return this.$message.warning('暂未查到对应的数据'); // .post('prMakeRec/remarryRedeemRetrospectDefend', {
} // cardNo: this.cardNo,
this.preserveSlotList = res.data.dsRbFilePreserveSlotList; // line: this.line,
this.obj = res.data; // })
} // .then(res => {
}); // if (this.$ifAjax(res)) {
// if (res.data != null && res.data.dsRbFilePreserveSlotList.length <= 0) {
// return this.$message.warning('');
// }
// this.preserveSlotList = res.data.dsRbFilePreserveSlotList;
// this.obj = res.data;
// }
// });
} }
}, },
@ -280,7 +288,7 @@ export default {
let query = { let query = {
mtuId: this.obj.mtuId, mtuId: this.obj.mtuId,
line: this.line, line: this.line,
preserveSlotList: this.preserveSlotList, produceMonitorFileSlotVOList: this.preserveSlotList,
}; };
remarryRedeemSaveRetrospectDefend(query).then(res => { remarryRedeemSaveRetrospectDefend(query).then(res => {
this.$message.success('保存成功'); this.$message.success('保存成功');
@ -310,7 +318,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content-box{ .content-box {
height: calc(100vh - 40px - 40px - 20px - 10px - 51px - 60px); height: calc(100vh - 40px - 40px - 20px - 10px - 51px - 60px);
overflow-y: auto; overflow-y: auto;
} }
@ -339,5 +347,9 @@ export default {
} }
} }
} }
:deep(.el-form-item){
margin-bottom: 10px;
margin-top: 10px;
}
} }
</style> </style>
Loading…
Cancel
Save