工艺问题修改

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. 65
      src/views/zhgd-work/childWarehousing/index.vue

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

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

@ -16,19 +16,6 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="仓库" prop="shId" label-width="60px"> <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 <jhSelect
v-model="formData.shId" v-model="formData.shId"
placeholder="请搜索选择" placeholder="请搜索选择"
@ -43,7 +30,7 @@
value-key="id" value-key="id"
search-key="id" search-key="id"
:debounce-time="500" :debounce-time="500"
@change="(val,item) => storeHouse(val,item)" @change="(val, item) => storeHouse(val, item)"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -65,7 +52,7 @@
:debounce-time="500" :debounce-time="500"
:disabled="!formData.shId" :disabled="!formData.shId"
:params="{ shId: formData.shId }" :params="{ shId: formData.shId }"
@change="(val,item) => storeHouse(val,item)" @change="(val, item) => storeHouse(val, item)"
/> />
<!-- <el-select <!-- <el-select
v-model="formData.cslId" v-model="formData.cslId"
@ -82,17 +69,28 @@
</el-select> --> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
</div> </div>
<div class="text item"> <div class="text item">
<el-descriptions <el-descriptions :column="3" label-width="100px" class="equal-width-descriptions" border>
:column="3"
label-width="100px"
:content-style="{ 'min-width': '120px' }"
class="margin-top"
border
>
<el-descriptions-item> <el-descriptions-item>
<template #label> 流程卡号 </template> <template #label> 流程卡号 </template>
{{ tableObj.cardNo }} {{ tableObj.cardNo }}
@ -103,7 +101,8 @@
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template #label> 批次 </template> <template #label> 批次 </template>
{{ tableObj.batchNo }} <!-- {{ tableObj.batchNo }} -->
<el-input style="width: 220px" v-model="tableObj.batchNo" placeholder="请输入" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
@ -132,7 +131,11 @@
</div> </div>
</template> </template>
<script> <script>
import { pdaLoadCardNo, pdaSaveSubOrder ,getStorageLocationList} from '@/api/zhgd-work/childWarehousing'; import {
pdaLoadCardNo,
pdaSaveSubOrder,
getStorageLocationList,
} from '@/api/zhgd-work/childWarehousing';
export default { export default {
name: 'ChildWarehousing', name: 'ChildWarehousing',
@ -143,6 +146,8 @@ export default {
shId: null, shId: null,
wpId: null, wpId: null,
cslId: null, cslId: null,
qualityNumber: '', //
dueDate: '', //
}, },
rules: { rules: {
cardNo: [ cardNo: [
@ -169,8 +174,7 @@ export default {
locationOptions: [], locationOptions: [],
}; };
}, },
mounted() { mounted() {},
},
methods: { methods: {
codeKeyUp() { codeKeyUp() {
if (this.formData.cardNo) { if (this.formData.cardNo) {
@ -199,3 +203,12 @@ export default {
}, },
}; };
</script> </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