工艺管理接口联调

dev-scheduling
zhangdi 3 months ago
parent b842cc558b
commit 9aae1104f2
  1. 41
      src/views/processManagement/components/processMainte/partDetails.vue
  2. 209
      src/views/processManagement/components/processMainte/processPlanning.vue
  3. 29
      src/views/processManagement/sinTer/index.vue
  4. 12
      src/views/processManagement/taskProcessing.vue

@ -6,7 +6,15 @@
<el-tab-pane label="工艺编制" name="2"> </el-tab-pane>
</el-tabs>
<div class="content-right">
<p v-if="showProcessVersion">工艺版本202510191001</p>
<p v-if="this.detailsType == 'taskProcessing'">工艺版本202510191001</p>
<el-select v-else v-model="version" placeholder="请输入" clearable filterable disabled>
<el-option
v-for="(item, index) in versionOptions"
:key="index"
:label="item.partVersions"
:value="item.partVersions"
/>
</el-select>
</div>
<div v-show="activeNameTab === '1'">
<el-card class="box-card-info">
@ -88,7 +96,14 @@
v-if="partType == '热表' || (partType == '烧结' && formData.isGlassCake)"
>
<el-form-item label="物料编码:" prop="wuliaobianma">
<el-select v-model="value" placeholder="请选择" style="width: 250px" disabled clearable filterable>
<el-select
v-model="value"
placeholder="请选择"
style="width: 250px"
disabled
clearable
filterable
>
<el-option label="物料一" value="1" />
<el-option label="物料二" value="2" />
<el-option label="物料三" value="3" />
@ -102,7 +117,8 @@
placeholder="请选择"
style="width: 250px"
disabled
clearable filterable
clearable
filterable
>
<el-option label="镀种一" value="1" />
<el-option label="镀种二" value="2" />
@ -127,7 +143,8 @@
placeholder="请选择"
style="width: 250px"
disabled
clearable filterable
clearable
filterable
>
<el-option label="镀种一" value="1" />
<el-option label="镀种二" value="2" />
@ -269,7 +286,8 @@
placeholder="请选择"
style="width: 220px"
@change="leavelChange"
clearable filterable
clearable
filterable
>
<el-option label="一级工艺" value="1" />
<el-option label="二级工艺" value="2" />
@ -384,6 +402,7 @@ import {
getProcessManagementAuthorized,
getPartDetail,
getProcessAuthorized,
getVersion,
} from '@/api/processManagement/taskProcessing';
export default {
@ -522,7 +541,7 @@ export default {
sortable: true,
overHidden: true,
type: 'select',
filterable:true,
filterable: true,
clearable: true,
cell: true,
dicData: [
@ -569,6 +588,8 @@ export default {
children: 'children',
label: 'label',
},
version:'',//
versionOptions:[],//
};
},
mounted() {
@ -578,7 +599,13 @@ export default {
this.getPartInfo();
},
methods: {
//
//
partChange(partId) {
getVersion({ partId: partId }).then(res => {
this.versionOptions = res.data.data;
});
},//
handleNodeClick(nodes, node, self) {
if (nodes.disabled) {
return false;

@ -20,8 +20,8 @@
</el-form-item>
</el-form>
</div>
<!-- style="width: 240px" -->
<el-tree
style="width: 240px"
:data="data"
:props="defaultProps"
@node-click="handleNodeClick"
@ -105,7 +105,7 @@
:value="item.id"
/>
</el-select>
<el-button type="primary" @change="modelLevelChange()">导入模板</el-button>
<el-button type="primary" @click="modelLevelChange()">导入模板</el-button>
</div>
</div>
<!-- 工序 -->
@ -116,7 +116,11 @@
label-width="0px"
v-if="activeName == '1'"
>
<el-table :data="form1.tableData1" style="width: 100%">
<el-table
:data="form1.tableData1"
style="width: 100%"
@selection-change="handleSelectionChange1"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="processNo" label="工序号">
<template #header>
@ -242,7 +246,11 @@
label-width="0px"
v-if="activeName == '2'"
>
<el-table :data="form2.tableData2" style="width: 100%">
<el-table
:data="form2.tableData2"
style="width: 100%"
@selection-change="handleSelectionChange2"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="trialNo" label="工序号">
<template #default="scope">
@ -326,7 +334,12 @@
label-width="0px"
v-if="activeName == '3'"
>
<el-table :data="form3.tableData3" class="tableHeight" style="width: 100%">
<el-table
:data="form3.tableData3"
class="tableHeight"
style="width: 100%"
@selection-change="handleSelectionChange3"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="trialNo" label="工序号">
<template #default="scope">
@ -394,7 +407,11 @@
label-width="0px"
v-if="activeName == '4'"
>
<el-table :data="form4.tableData4" style="width: 100%">
<el-table
:data="form4.tableData4"
style="width: 100%"
@selection-change="handleSelectionChange4"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="trialNo" label="工序号">
<template #default="scope">
@ -474,7 +491,7 @@ import {
saveProcessMoldTool,
getProcessSetList,
getCraftAbilityList,
getPartDetail
getPartDetail,
} from '@/api/processManagement/taskProcessing';
import { getPqList } from '@/api/qualityManagement/remindRedeem/remindRedeem';
export default {
@ -540,15 +557,23 @@ export default {
modelLevel: null, //
form1: {
tableData1: [], //
deleteIds: [],
selectIds: [], //ID
},
form2: {
tableData2: [], //
deleteIds: [],
selectIds: [], //ID
},
form3: {
tableData3: [], //
deleteIds: [],
selectIds: [], //ID
},
form4: {
tableData4: [], //
deleteIds: [],
selectIds: [], //ID
},
formRules1: {
processCode: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }],
@ -573,11 +598,13 @@ export default {
},
treeNodes: {}, //
partInfoData: {}, //
tempId: 0,
};
},
mounted() {
this.getDetails();
this.getModelList();
this.getDetails();
this.getProcessSetList();
this.getCraftAbilityList();
this.getPqList();
@ -600,9 +627,10 @@ export default {
});
},
//
getModelList() {
getModelList().then(res => {
async getModelList () {
await getModelList().then(res => {
this.modelOption = res.data.data;
});
},
//
@ -619,17 +647,47 @@ export default {
},
//
modelLevelChange() {
getModelDetailList({ modelId: this.modelLevel }).then(res => {});
getModelDetailList({ modelId: this.modelLevel }).then(res => {
// this.form1.tableData1=res.data.data;
const templateData = res.data.data;
const existing = [...this.form1.tableData1];
//
const mappedData = templateData.map((item, index) => {
// 使
return {
id: null, // null
processNo: this.getProcessNo(this.form1.tableData1), //
processCode: item.processCode || item.id, // processCode id
processName: item.processName,
craftCode: item.craftCode,
craftName: item.craftName,
proDes: item.proDes || item.description,
proHours: item.proHours || '',
setoutHours: item.setoutHours || '',
isMain: item.isMain || '0',
// ...
};
});
// 12
this.form1.tableData1 = [...existing, ...mappedData]; //
this.$message.success('模板导入成功');
});
},
//
getDetails() {
getProcessAuthorized({
async getDetails() {
await getProcessAuthorized({
partId: this.partId,
taskId: this.updateRow.id,
rank: this.rank,
}).then(res => {
this.data = this.transformCraftTree(res.data.data);
this.partInfoData = res.data.data.partInfo;
if (this.partInfoData.partName == '石墨模') {
let graphite = this.modelOption.find(item => item.name == '石墨模');
this.modelLevel = graphite.id;
this.modelLevelChange();
}
});
},
//
@ -744,41 +802,102 @@ export default {
},
//
addTable() {
this.tempId++;
if (this.activeName == '1') {
this.form1.tableData1.push({
_tempId: this.tempId, //
id: null,
processNo: this.getProcessNo(this.form1.tableData1),
});
}
if (this.activeName == '2') {
this.form2.tableData2.push({
_tempId: this.tempId, //
id: null,
trialNo: this.getProcessNo(this.form2.tableData2),
});
}
if (this.activeName == '3') {
this.form3.tableData3.push({
_tempId: this.tempId, //
id: null,
trialNo: this.getProcessNo(this.form3.tableData3),
});
}
if (this.activeName == '4') {
this.form4.tableData4.push({
_tempId: this.tempId, //
id: null,
trialNo: this.getProcessNo(this.form4.tableData4),
});
}
},
handleSelectionChange1(val) {
this.form1.selectIds = val.map(row => row.id || row._tempId);
this.form1.deleteIds = val
.filter(row => row.id != null && row.id !== '') // id null
.map(row => row.id);
},
handleSelectionChange2(val) {
this.form2.selectIds = val.map(row => row.id || row._tempId);
this.form2.deleteIds = val.filter(row => row.id != null).map(row => row.id);
},
handleSelectionChange3(val) {
this.form3.selectIds = val.map(row => row.id || row._tempId);
this.form3.deleteIds = val.filter(row => row.id != null).map(row => row.id);
},
handleSelectionChange4(val) {
this.form4.selectIds = val.map(row => row.id || row._tempId);
this.form4.deleteIds = val.filter(row => row.id != null).map(row => row.id);
},
//
delTable() {
if (this.activeName == '1') {
}
if (this.activeName == '2') {
}
if (this.activeName == '3') {
}
if (this.activeName == '4') {
const active = this.activeName;
let message = '请至少选择一条数据进行删除';
if (active === '1') {
if (this.form1.selectIds.length === 0) {
this.$message.warning(message);
return;
}
this.form1.tableData1 = this.form1.tableData1.filter(row => {
const key = row.id || row._tempId;
return !this.form1.selectIds.includes(key);
});
this.form1.selectIds = []; //
} else if (active === '2') {
if (this.form2.selectIds.length === 0) {
this.$message.warning(message);
return;
}
this.form2.tableData2 = this.form2.tableData2.filter(row => {
const key = row.id || row._tempId;
return !this.form2.selectIds.includes(key);
});
this.form2.selectIds = [];
} else if (active === '3') {
if (this.form3.selectIds.length === 0) {
this.$message.warning(message);
return;
}
this.form3.tableData3 = this.form3.tableData3.filter(row => {
const key = row.id || row._tempId;
return !this.form3.selectIds.includes(key);
});
this.form3.selectIds = [];
} else if (active === '4') {
if (this.form4.selectIds.length === 0) {
this.$message.warning(message);
return;
}
this.form4.tableData4 = this.form4.tableData4.filter(row => {
const key = row.id || row._tempId;
return !this.form4.selectIds.includes(key);
});
this.form4.selectIds = [];
}
this.$message.success('删除成功');
},
checkingProNo(table) {
//
@ -798,7 +917,7 @@ export default {
saveInfo() {
if (this.activeName == '1') {
// Form
this.$refs.tableForm1.validate(async(isValid, invalidFields) => {
this.$refs.tableForm1.validate(async (isValid, invalidFields) => {
if (isValid) {
if (Object.keys(this.treeNodes).length == 0) {
return this.$message.warning('请先选择左侧组织树数据');
@ -815,7 +934,7 @@ export default {
});
//
let noMainPro = false;
const arr = [];
const arr = [];
const pidList = [];
const tableData = this.form1.tableData1;
tableData.forEach(item => {
@ -835,18 +954,18 @@ export default {
return this.$message.warning('涂色标的工时定额必须大于0,请修改!');
}
const res = await getPartDetail(this.partId)
console.log(res)
let dsCraftMold = res.data.data.dsPartEntity
const res = await getPartDetail(this.partId);
console.log(res);
let dsCraftMold = res.data.data.dsPartEntity;
if (dsCraftMold.markingsTest=='1') {
if (dsCraftMold.markingsTest == '1') {
if (!arr.includes('涂色标')) {
return this.$message.warning('该工艺包含的工序必须包含涂色标');
}
}
//
if (dsCraftMold.hardness =='1') {
if (dsCraftMold.hardness == '1') {
if (!arr.includes('热处理检验')) {
this.$message({
dangerouslyUseHTMLString: true,
@ -858,7 +977,7 @@ export default {
'</strong>',
showClose: true,
duration: 7000,
type: 'warning'
type: 'warning',
});
} else {
this.$message({
@ -871,16 +990,13 @@ export default {
'</strong>',
showClose: true,
duration: 7000,
type: 'success'
type: 'success',
});
}
}
// SB
if (
dsCraftMold.plate != null &&
dsCraftMold.plate.indexOf('SB') != -1
) {
if (dsCraftMold.plate != null && dsCraftMold.plate.indexOf('SB') != -1) {
if (!arr.includes('喷砂')) {
this.$message({
dangerouslyUseHTMLString: true,
@ -892,25 +1008,22 @@ export default {
'</strong>',
showClose: true,
duration: 7000,
type: 'warning'
type: 'warning',
});
}
}
//
if (
dsCraftMold.plate != null &&
dsCraftMold.plate.indexOf('不钝化') != -1
) {
if (dsCraftMold.plate != null && dsCraftMold.plate.indexOf('不钝化') != -1) {
//
if (pidList.length > 0) {
//
let isExist = 0;
const res1 = await this.$ajax.post(
'dsMatingInfo/loadMatingInfoByPidList',
{ pidList: pidList, miType: 1 }
);
res1.data.forEach((item) => {
const res1 = await this.$ajax.post('dsMatingInfo/loadMatingInfoByPidList', {
pidList: pidList,
miType: 1,
});
res1.data.forEach(item => {
if (item.trialItem.indexOf('可焊性') != -1) {
//
isExist = 1;
@ -927,7 +1040,7 @@ export default {
'</strong>',
showClose: true,
duration: 7000,
type: 'warning'
type: 'warning',
});
}
}
@ -1002,7 +1115,7 @@ export default {
dsPart: this.partInfoData, //
craft: this.treeNodes.rawData, //
processList: this.form1.tableData1, //
deleteIds: [], //ids
deleteIds: this.form1.deleteIds, //ids
};
authorizedAccomplish2(query_).then(res => {
@ -1017,7 +1130,7 @@ export default {
let query_ = {
processEntity: this.treeNodes.rawData.processInfo, //
processProjectEntityList: this.form2.tableData2, //
deleteIds: [], //ids
deleteIds: this.form2.deleteIds, //ids
};
saveProcessProjectSave(query_).then(res => {
@ -1032,7 +1145,7 @@ export default {
let query_ = {
processEntity: this.treeNodes.rawData.processInfo, //
processMeasuringToolEntities: this.form3.tableData3, //
deleteIds: [], //ids
deleteIds: this.form3.deleteIds, //ids
};
saveProcessMeasuringTool(query_).then(res => {
this.$message.success('保存成功');
@ -1046,7 +1159,7 @@ export default {
let query_ = {
processEntity: this.treeNodes.rawData.processInfo, //
processMoldToolEntities: this.form4.tableData4, //
deleteIds: [], //ids
deleteIds: this.form4.deleteIds, //ids
};
saveProcessMoldTool(query_).then(res => {
this.$message.success('保存成功');

@ -49,7 +49,13 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
></avue-crud>
>
<template #bpartCode="scope">
<el-button type="text" @click="linkToPartTree(scope.row)">{{
scope.row.bpartCode
}}</el-button>
</template>
</avue-crud>
</div>
</div>
</basic-container>
@ -157,22 +163,33 @@ export default {
},
isSubOpen: false,
isComponentOpen: false,
data:[]
data: [],
};
},
methods: {
//
linkToPartTree(row) {
this.isComponentOpen = true;
this.isSubOpen = false;
getDsPartTree({ partCode: row.bpartCode, zPartCode: '' }).then(res => {
let resData = res.data.data;
let arr = JSON.parse(JSON.stringify(resData).replace(/partName/g, 'name'));
this.$nextTick(() => {
this.createBarChart(arr);
});
});
},
searchFn() {
if (this.form.zijian != '') {
this.isComponentOpen = false;
this.isSubOpen = true;
getSinteringPart({ zPartCode: 'PART001-01' }).then(res => {
getSinteringPart({ partCode: this.form.bujian, zPartCode: this.form.zijian }).then(res => {
this.data = res.data.data;
});
} else if (this.form.bujian != '') {
this.isComponentOpen = true;
this.isSubOpen = false;
getDsPartTree({ partCode: 'PART001' }).then(res => {
getDsPartTree({ partCode: this.form.bujian, zPartCode: this.form.zijian }).then(res => {
let resData = res.data.data;
let arr = JSON.parse(JSON.stringify(resData).replace(/partName/g, 'name'));
this.$nextTick(() => {
@ -264,7 +281,7 @@ export default {
mapBoxEchart.on('click', params => {
// label/text线
if (params.componentType === 'series' && params.seriesType === 'tree' && params.data) {
window.open(`${params.data.docLink}`, '_blank');
window.open(`${params.data.docLink}`, '_blank');
}
});
},

@ -50,7 +50,7 @@
type="primary"
link
@click="setBathCrew(scope.row)"
v-if="scope.row.taskStatus == 1 && scope.row.children"
v-if="scope.row.taskStatus == 1"
>转派</el-button
>
</template>
@ -89,7 +89,7 @@
@cancel="cancel"
:partType="partType"
:dialogType="dialogType"
:updateRow="updateRow"
:updateRow="updateRow"
></dsPartIndex>
<!-- 返工任务编制 -->
@ -224,7 +224,7 @@ export default {
search: true,
overHidden: true,
type: 'select',
filterable:true,
filterable: true,
clearable: true,
headerAlign: 'center',
align: 'center',
@ -293,7 +293,7 @@ export default {
overHidden: true,
width: 120,
type: 'select',
filterable:true,
filterable: true,
clearable: true,
headerAlign: 'center',
align: 'center',
@ -364,9 +364,11 @@ export default {
isTestOpen: false, //
detailsRow: {},
updateRow: [], //
};
},
methods: {
//
addFn() {
this.isTestOpen = true;
@ -434,7 +436,7 @@ export default {
//
organization(partId, row) {
this.partId = partId;
this.updateRow = row
this.updateRow = row;
if (row.taskType == '6') {
this.isReworkOpen = true;
} else {

Loading…
Cancel
Save