工艺问题修改

dev-scheduling
zhangdi 3 days ago
parent d23b44b81f
commit f1d4088555
  1. 102
      src/views/processManagement/components/processMainte/processPlanning.vue
  2. 4
      src/views/productionTesting/InspectionTemplate.vue
  3. 69
      src/views/zhgd-work/childWarehousing/index.vue

@ -677,52 +677,64 @@ export default {
},
//
importInspectionTemplate() {
// 1.
if (!this.cascaderValue || this.cascaderValue.length === 0) {
return this.$message.warning('请选择模板');
}
const templateId = this.cascaderValue[this.cascaderValue.length - 1];
this.modelLevelLoading = true;
getInspectionDetail({
id: this.cascaderValue,
})
getInspectionDetail({ id: templateId })
.then(res => {
this.modelLevelLoading = false;
console.log('res--------------------------', res.data.data);
const templateData = res.data.data.detailList;
const templateData = res.data.data?.detailList; //
if (!templateData || !Array.isArray(templateData)) {
return this.$message.warning('模板数据为空');
}
// trialNo
// 2.
const existingLength = this.form2.tableData2.length;
// trialNo
const mappedData = templateData.map((item, index) => {
// P001, P002...
const trialNo = `P${String(existingLength + index + 1).padStart(3, '0')}`;
// P001, P002...
const trialNo = this.treeNodes.processNo + '-' + this.getProcessNo(this.form2.tableData2);
// projectCode projectName
//
let projectName = '';
if (item.projectCode) {
const projectOption = this.projectOptions.find(p => p.id === item.projectCode);
if (item.inspectionItemId) {
const projectOption = this.projectOptions.find(p => p.id === item.inspectionItemId);
projectName = projectOption ? projectOption.name : '';
}
//
let projectStandardName = '';
if (item.standardId) {
const standardOption = this.standardList.find(s => s.id === item.standardId);
projectStandardName = standardOption ? standardOption.name : '';
}
return {
id: null, // ID
_tempId: `temp_${Date.now()}_${index}`, //
id: null, // ID
_tempId: `temp_project_${Date.now()}_${index}`,
trialNo: trialNo,
projectCode: item.inspectionItemId || '',
projectName: projectName || item.projectName || '',
projectName: projectName,
projectStandard: item.standardId || '',
projectStandardName: item.projectStandardName || '',
projectStandardName: projectStandardName,
proHours: item.proHours != null ? item.proHours : 0,
prepareHours: item.prepareHours != null ? item.prepareHours : 0,
};
});
//
// 3.
this.form2.tableData2 = [...this.form2.tableData2, ...mappedData];
this.$message.success('模板导入成功,请检查后保存');
// this.form2.tableData2 = res.data.data;
this.$message.success('模板导入成功');
})
.catch(err => {
console.error('导入失败:', err);
this.modelLevelLoading = false;
this.$message.error('模板导入失败,请重试');
});
},
changeMtId(val, item, index) {
@ -1023,16 +1035,17 @@ export default {
const findAndSelectNode = nodes => {
for (let node of nodes) {
if (node.id === this.cachedSelectedNodeId) {
//
this.handleNodeClick(node, {
// node el-tree level parent
const mockNode = {
level: node.level,
parent: {
data: this.getParentNode(this.data, node.id),
data: node.level === 1 ? null : this.getParentNode(this.data, node.id),
isRoot: node.level === 1,
},
});
};
//
//
this.handleNodeClick(node, mockNode);
this.$nextTick(() => {
if (this.$refs.tree) {
this.$refs.tree.setCurrentKey(node.id);
@ -1048,20 +1061,33 @@ export default {
return false;
};
findAndSelectNode(this.data);
// 退
if (!findAndSelectNode(this.data)) {
this.cachedSelectedNodeId = null;
if (this.data.length > 0) {
this.handleNodeClick(this.data[0], {
level: 1,
parent: { data: null, isRoot: true },
});
this.$refs.tree?.setCurrentKey(this.data[0].id);
}
}
},
//
getParentNode(nodes, targetId, parent = null) {
for (let node of nodes) {
if (node.id === targetId) {
return parent;
// ID
if (node.children && node.children.some(child => child.id === targetId)) {
return node;
}
//
if (node.children && node.children.length > 0) {
const found = this.getParentNode(node.children, targetId, node);
if (found) return found;
const parent = this.getParentNode(node.children, targetId);
if (parent) return parent;
}
}
return null;
return null; //
},
autoSelectFirstProcess() {
if (!this.data || this.data.length === 0) return;
@ -1704,12 +1730,7 @@ export default {
.then(res => {
this.$message.success('保存成功');
this.craftLoading = false;
//
if (this.treeLeave === 3) {
this.treeNodes.rawData.projectList = this.form2.tableData2;
this.updateTreeNodeProject();
this.refreshTableData(); //
}
this.getDetails(true);
})
.catch(err => {
this.craftLoading = false;
@ -1730,12 +1751,7 @@ export default {
.then(res => {
this.$message.success('保存成功');
this.craftLoading = false;
//
if (this.treeLeave === 3) {
this.treeNodes.rawData.measuringToolList = this.form3.tableData3;
this.updateTreeNodeProject();
this.refreshTableData(); //
}
this.getDetails(true); //
})
.catch(err => {
this.craftLoading = false;

@ -759,8 +759,8 @@ export default {
this.tidList = res.data.data.detailList;
if (this.tidList.length > 0) {
this.tidList.map(item => {
item.inspectionItemId = item.inspectionItemId+''
item.inspectionTemplateId = item.inspectionTemplateId+''
item.inspectionItemId = item.inspectionItemId?item.inspectionItemId+'':item.inspectionItemId
item.standardId = item.standardId?item.standardId+'':item.standardId
});
}
this.showDialog = true;

@ -16,19 +16,6 @@
</el-col>
<el-col :span="6">
<el-form-item label="仓库" prop="shId" label-width="60px">
<!-- <el-select
v-model="formData.shId"
filterable
placeholder="请选择仓库"
@change="storeHouse"
>
<el-option
v-for="item in storeHouseOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<jhSelect
v-model="formData.shId"
placeholder="请搜索选择"
@ -43,13 +30,13 @@
value-key="id"
search-key="id"
:debounce-time="500"
@change="(val,item) => storeHouse(val,item)"
@change="(val, item) => storeHouse(val, item)"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="库位" prop="cslId" label-width="60px">
<jhSelect
<jhSelect
v-model="formData.cslId"
placeholder="请搜索选择"
api-url="/blade-wms/stStorageLocation/list"
@ -64,8 +51,8 @@
search-key="id"
:debounce-time="500"
:disabled="!formData.shId"
:params="{ shId: formData.shId }"
@change="(val,item) => storeHouse(val,item)"
:params="{ shId: formData.shId }"
@change="(val, item) => storeHouse(val, item)"
/>
<!-- <el-select
v-model="formData.cslId"
@ -82,17 +69,28 @@
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="质量编号" prop="qualityNumber" label-width="60px">
<el-input v-model="formData.qualityNumber" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="到期日期" prop="dueDate" label-width="60px">
<el-date-picker
v-model="formData.dueDate"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="text item">
<el-descriptions
:column="3"
label-width="100px"
:content-style="{ 'min-width': '120px' }"
class="margin-top"
border
>
<el-descriptions :column="3" label-width="100px" class="equal-width-descriptions" border>
<el-descriptions-item>
<template #label> 流程卡号 </template>
{{ tableObj.cardNo }}
@ -103,7 +101,8 @@
</el-descriptions-item>
<el-descriptions-item>
<template #label> 批次 </template>
{{ tableObj.batchNo }}
<!-- {{ tableObj.batchNo }} -->
<el-input style="width: 220px" v-model="tableObj.batchNo" placeholder="请输入" />
</el-descriptions-item>
<el-descriptions-item>
@ -132,7 +131,11 @@
</div>
</template>
<script>
import { pdaLoadCardNo, pdaSaveSubOrder ,getStorageLocationList} from '@/api/zhgd-work/childWarehousing';
import {
pdaLoadCardNo,
pdaSaveSubOrder,
getStorageLocationList,
} from '@/api/zhgd-work/childWarehousing';
export default {
name: 'ChildWarehousing',
@ -143,6 +146,8 @@ export default {
shId: null,
wpId: null,
cslId: null,
qualityNumber: '', //
dueDate: '', //
},
rules: {
cardNo: [
@ -169,8 +174,7 @@ export default {
locationOptions: [],
};
},
mounted() {
},
mounted() {},
methods: {
codeKeyUp() {
if (this.formData.cardNo) {
@ -199,3 +203,12 @@ export default {
},
};
</script>
<style lang="scss" scoped>
:deep(.equal-width-descriptions .el-descriptions__body table) {
width: 100%;
table-layout: fixed; /* 关键:强制等宽 */
}
:deep(.equal-width-descriptions .el-descriptions__cell) {
word-break: break-word; /* 长文本自动换行 */
}
</style>

Loading…
Cancel
Save