
供应链协同平台质量协同管理不合格品处理流程线上化优化
{ "type ": "doc ", "content ":[{ "type ": "heading ", "attrs ":{ "id ": "7aac84dd-f364-4ee6-a353-7917ae496944 ", "textAlign ": "inherit ", "indent ":0, "level ":1, "isHoverDra
{"type":"doc","content":[{"type":"heading","attrs":{"id":"7aac84dd-f364-4ee6-a353-7917ae496944","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"引言 "}]},{"type":"paragraph","attrs":{"id":"1fffd223-f629-4ec3-bc35-0a03f8c497a0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"在供应链现场,质量问题往往是最棘手的一环。品牌商仓库收货时发现外包装破损,质检员抽检发现尺寸超差,或者终端客户投诉产品失效——这些场景每天都在发生。然而,传统的不合格品处理流程却像一场“漫长的拉锯战”:质检员手写《不良品报告》,传真给供应商,供应商邮件回复“收到”,几天后寄来整改报告,品牌商再人工归档。整个过程缺乏透明度,责任界定模糊,整改效果难以追踪。更严重的是,不良品信息散落在各个角落,无法沉淀为企业知识库,导致同类问题在不同批次、不同供应商之间反复发生。"}]},{"type":"paragraph","attrs":{"id":"8d73422d-bc23-47f1-a159-5289ac966bb6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"质量协同管理"},{"type":"text","text":"的核心,是将“事后救火”转变为“事前预防、事中控制、事后改进”的闭环体系。通过线上化系统,实现缺陷的标准化分类、整改任务的全流程跟踪、质量数据的跨企业共享。"}]},{"type":"paragraph","attrs":{"id":"5715d4ef-9942-4182-bb0e-876a13d14f67","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"本文将构建一套完整的 "},{"type":"text","marks":[{"type":"bold"}],"text":"不合格品处理(NCR)"},{"type":"text","text":" 系统,重点攻克"},{"type":"text","marks":[{"type":"bold"}],"text":"缺陷分类体系"},{"type":"text","text":"、"},{"type":"text","marks":[{"type":"bold"}],"text":"8D 整改流程"},{"type":"text","text":"以及"},{"type":"text","marks":[{"type":"bold"}],"text":"质量追溯"},{"type":"text","text":"三大难题,让质量问题看得见、管得住、改得好。"}]},{"type":"heading","attrs":{"id":"7b3ecf04-1218-4276-a11a-a2f6305e4251","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"一、业务全景:从发现不良到闭环整改 "}]},{"type":"paragraph","attrs":{"id":"112c74e7-8053-4b0c-a22a-f55d345edcba","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"质量协同不仅仅是记录“谁家的东西坏了”,更是要建立一套跨组织的改进机制。"}]},{"type":"heading","attrs":{"id":"4ac8bd05-819f-4629-9293-8e6de9c51bf7","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"1.1 核心业务角色与诉求 "}]},{"type":"bulletList","attrs":{"id":"d92eb5e9-654f-4c3f-ad54-abfe5c3bdfed","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"b213f7fa-cf27-4138-a82c-95c65d1c39c7"},"content":[{"type":"paragraph","attrs":{"id":"539e7e43-7088-44a5-b1d6-4c8f4ec3a3b3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"品牌商(买方)"},{"type":"text","text":":希望快速记录不良现象,冻结问题物料,追踪供应商整改,防止复发。"}]}]},{"type":"listItem","attrs":{"id":"526a0a55-da5c-4773-bcee-73cd7d8125cd"},"content":[{"type":"paragraph","attrs":{"id":"caac1148-cd39-43b6-9aad-1de179180b12","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"供应商(卖方)"},{"type":"text","text":":希望第一时间获知不良详情,分析原因,制定措施,恢复供货资格。"}]}]},{"type":"listItem","attrs":{"id":"c9a53111-600e-41f9-b0ea-171fdcc689ad"},"content":[{"type":"paragraph","attrs":{"id":"8b7d14ac-4a2f-48fc-a08d-3f2828524a45","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"物流商"},{"type":"text","text":":涉及退货运输时,需明确责任归属(运输损坏 vs 出厂缺陷)。"}]}]}]},{"type":"heading","attrs":{"id":"dea7f738-e08b-4f4f-aa58-eff8af7f9787","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"1.2 典型 NCR(不合格品报告)流程 "}]},{"type":"image","attrs":{"id":"5e6eabd4-dedf-468d-ae3d-0a04934a8aac","src":"https://developer.qcloudimg.com/http-sa ve/audit-10133498/b4241ac7f3e8384a327ff6cda9598231.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1012,"aspectRatio":"1.190999","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"48206e16-c7f4-4757-a747-fe4b8f291dd4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"heading","attrs":{"id":"8e28b3eb-0a9b-4b5d-9154-c179db4685a7","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"1.3 痛点与系统化解决方案 "}]},{"type":"table","attrs":{"id":"7d9ace29-6a31-4bf4-b1a2-f2c758d722b7","isHoverDragHandle":false},"content":[{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"04316ee9-3ebc-4b3d-a76b-b518590bf80f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"传统痛点"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"8fdbf874-20cf-415e-879d-bcd19d18a103","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"系统化解决方案"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"863fc618-6a63-4d8a-8046-f222000de1f4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"描述模糊(“东西坏了”)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"53df7041-f534-4c65-8b70-e92dbe3d25a8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"结构化缺陷分类(外观/尺寸/功能) 多媒体附件"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"3a601c32-1172-4395-a1e4-565b3dc6680e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"责任推诿(供需扯皮)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"b413965d-b35f-4f8b-9d29-119f289b54c2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"时间戳固化证据 多方协同评审"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"9e0d1b5e-aa49-4882-80ff-6814987e953d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"整改无效(治标不治本)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"857f8811-e338-4464-bd06-e826a6e7026b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"强制 8D 报告流程 有效性验证"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"2309fd7c-3218-4803-b7a3-f5113f6a61a4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"数据孤岛(无法统计)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"border-color: rgb(217, 217, 217);"},"content":[{"type":"paragraph","attrs":{"id":"98223414-73ba-445e-b5aa-fb7b6a902108","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}}],"text":"统一数据仓库 多维度质量看板"}]}]}]}]},{"type":"heading","attrs":{"id":"9052e83a-0dce-4376-be62-6ca7d69ae647","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"二、架构设计:质量协同的核心引擎 "}]},{"type":"paragraph","attrs":{"id":"bc9ba985-b98f-4051-9bbb-4432323b6c72","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"质量管理系统需要处理大量的文件上传、复杂的状态流转以及严格的权限控制。"}]},{"type":"heading","attrs":{"id":"97a4a9e0-be67-45a4-b90b-6912c644e866","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"2.1 系统架构图 "}]},{"type":"image","attrs":{"id":"7a99daf8-e0ea-4246-873b-cfcf9526983e","src":"https://developer.qcloudimg.com/http-sa ve/audit-10133498/37e887aaaf6c35197167ae6b8c549aef.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1012,"aspectRatio":"3.927184","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"3079fa12-d3c6-4ebe-8071-9ff2ffa30178","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"架构亮点:"}]},{"type":"bulletList","attrs":{"id":"73b579db-3d60-4d42-ad52-4e5a232172e8","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"1aded34c-4c2a-4607-879d-5134966a3dbd"},"content":[{"type":"paragraph","attrs":{"id":"ea48f9dc-86af-43fa-b8ec-182ff4be391c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"文件服务独立"},{"type":"text","text":":质检图片往往很大,单独的文件服务负责压缩、加水印(防篡改)、OCR识别(提取文字信息)。"}]}]},{"type":"listItem","attrs":{"id":"6f98586e-644f-49fa-9155-5f26ce791fd1"},"content":[{"type":"paragraph","attrs":{"id":"457be547-2b5a-42bc-b7f5-2f517c562beb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"规则引擎"},{"type":"text","text":":自动判断缺陷等级(Critical/Major/Minor),并根据等级自动设定处理时限(SLA),超时自动升级告警。"}]}]},{"type":"listItem","attrs":{"id":"01e91699-3715-4128-8c12-492b96a588a7"},"content":[{"type":"paragraph","attrs":{"id":"c22dea12-b980-4ada-8d1a-060eb23da858","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"GridFS"},{"type":"text","text":":MongoDB 的 GridFS 用于存储大于 16MB 的文件(如高清视频),小文件直接存在文档中或对象存储(OSS/S3)。"}]}]}]},{"type":"heading","attrs":{"id":"b0d3f604-6c72-4d25-948d-047b8a0424cb","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"2.2 缺陷分类体系设计 "}]},{"type":"paragraph","attrs":{"id":"618a79d1-390e-4368-9db5-3901da3d3ef2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"标准化的分类是数据统计的基础。"}]},{"type":"image","attrs":{"id":"2425f0ab-2acf-40db-b3c9-7f8b44780644","src":"https://developer.qcloudimg.com/http-sa ve/audit-10133498/a44d5588d72f640d818b1787c1cee785.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1012,"aspectRatio":"1.595472","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"73d92b8e-1946-4eb1-bd2c-b21b7fbdea1e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"heading","attrs":{"id":"ea7d3e48-4475-42b0-956f-85fa621a51ff","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"三、核心数据模型设计 "}]},{"type":"paragraph","attrs":{"id":"f83c3602-49d4-4e76-9992-64fc9f999e22","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"质量是严肃的,数据结构必须严谨,支持审计追踪。"}]},{"type":"heading","attrs":{"id":"b699b85b-50e2-461d-ba0d-10b004897995","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.1 NCR 主表 (NonConformanceReport) "}]},{"type":"codeBlock","attrs":{"id":"41c6efd8-921f-4e29-b385-db1879fad240","language":"ja vascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"ja vascript"},"content":[{"type":"text","text":"// models/NCR.jsnconst mongoose = require('mongoose');nnconst NCRSchema = new mongoose.Schema({ntenantId: { type: String, required: true, index: true },nncrNo: { type: String, required: true, unique: true }, // NCR编号nn// 关联业务单据nsource: {ntype: { type: String, enum: ['PO', 'ASN', 'RETURN', 'PRODUCTION'], required: true },nid: String, // 关联PO_ID或ASN_IDnpoNo: String,nasnNo: Stringn},nn// 物料信息nmaterial: {ncode: String,nname: String,nbatchNo: String,nserialNo: Stringn},nn// 供应商与发现方nsupplier: { companyId: String, name: String },ndiscovered: {nby: String, // 发现人IDnat: { type: Date, default: Date.now },nlocation: { type: String, enum: ['IQC', 'IPQC', 'OQC', 'WAREHOUSE', 'FIELD'] },nstage: String // 具体工序或环节n},nn// 缺陷详情ndefect: {ncategory: { type: String, enum: ['APPEARANCE', 'DIMENSION', 'FUNCTION', 'PACKAGING', 'DOCUMENT'] },nsubCategory: String, // 如 "划伤"ndescription: String,nseverity: { type: String, enum: ['CRITICAL', 'MAJOR', 'MINOR'], required: true },nquantity: {nrejected: Number, // 不良数量nsampleSize: Number, // 抽样数量ntotalBatch: Number // 批次总数n},nattachments: [{ name: String, url: String, type: String }] // 图片/视频n},nn// 处置方式ndisposition: {ndecision: { type: String, enum: ['RTV', 'REWORK', 'SCRAP', 'USE_AS_IS', 'Sorting'], default: 'RTV' },ninspectorComments: String,napprover: String,napprovedAt: Daten},nn// 状态机核心nstatus: {ntype: String,nenum: ['OPEN', 'SUPPLIER_ACK', 'ROOT_CAUSE_ANALYSIS', 'CAP_SUBMITTED', 'VERIFICATION', 'CLOSED', 'REJECTED'],ndefault: 'OPEN',nindex: truen},nn// 时效控制 (SLA)nsla: {nresponseDue: Date, // 供应商响应截止时间nresolutionDue: Date, // 整改完成截止时间nescalated: { type: Boolean, default: false }n},nn// 审计字段ncreatedBy: String,nupdatedBy: String,nhistory: [{nstatus: String,ntimestamp: Date,noperator: String,ncomment: Stringn}]n}, { timestamps: true });nn// 索引优化nNCRSchema.index({ tenantId: 1, status: 1 });nNCRSchema.index({ 'supplier.companyId': 1 });nNCRSchema.index({ 'defect.severity': 1 });nnmodule.exports = mongoose.model('NCR', NCRSchema);"}]},{"type":"paragraph","attrs":{"id":"9eb59624-e69a-4634-bf4e-2caeb3872468","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"代码解析:"}]},{"type":"bulletList","attrs":{"id":"f7d39343-443c-47ae-8c6a-e16192c25ea2","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"05b6966a-f563-45f4-9f9e-55edc93e1cbe"},"content":[{"type":"paragraph","attrs":{"id":"0096bd65-8b06-4554-a794-d624735f4bb5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"来源追溯"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"source"},{"type":"text","text":" 字段将 NCR 与订单(PO)或发货单(ASN)强关联,实现“单据-物料-缺陷”的穿透查询。"}]}]},{"type":"listItem","attrs":{"id":"3674aa24-ed4b-4499-9c37-b3b548292161"},"content":[{"type":"paragraph","attrs":{"id":"43dc5df3-9277-4551-8e92-208c8eea9bc9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"缺陷结构化"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"defect.category"},{"type":"text","text":" 和 "},{"type":"text","marks":[{"type":"code"}],"text":"subCategory"},{"type":"text","text":" 强制标准化录入,"},{"type":"text","marks":[{"type":"code"}],"text":"severity"},{"type":"text","text":" 区分致命/严重/轻微缺陷,为后续统计分析提供维度。"}]}]},{"type":"listItem","attrs":{"id":"baadabac-35a7-4d72-93fb-7eeb335cf1fc"},"content":[{"type":"paragraph","attrs":{"id":"00e77282-e5fb-48d4-a204-7de42a96d0ca","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"处置决策"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"disposition.decision"},{"type":"text","text":" 记录最终处理方式(退货 RTV、返工 Rework、报废 Scrap 等),这是质量成本控制的关键数据。"}]}]},{"type":"listItem","attrs":{"id":"1d1f3b53-d4d1-4e2a-9c6e-3764a9bd83ab"},"content":[{"type":"paragraph","attrs":{"id":"3b3a8f20-0521-41c2-8893-052cb3585534","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"SLA 管理"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"sla"},{"type":"text","text":" 字段记录响应和处理时限,结合定时任务可实现超时自动升级(Escalation)。"}]}]},{"type":"listItem","attrs":{"id":"89cc5657-a80c-4ecf-9047-beee4629e497"},"content":[{"type":"paragraph","attrs":{"id":"1b740dd7-0333-44dc-9d5e-3e9d55be67ca","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"历史轨迹"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"history"},{"type":"text","text":" 数组记录每一次状态变更,形成不可篡改的审计链。"}]}]}]},{"type":"heading","attrs":{"id":"13b45a7d-d791-4461-8d23-ad1266f21288","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.2 整改措施表 (CorrectiveActionPlan) "}]},{"type":"paragraph","attrs":{"id":"89e8f1c4-5245-4ebc-a3a9-c40c9bf964ce","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"对应 8D 报告中的核心内容(D4-D7)。"}]},{"type":"codeBlock","attrs":{"id":"7f5b362e-6a00-47e2-b35f-444adfe10d90","language":"ja vascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"ja vascript"},"content":[{"type":"text","text":"// models/CorrectiveAction.jsnconst mongoose = require('mongoose');nnconst CorrectiveActionSchema = new mongoose.Schema({ntenantId: String,nncrId: { type: mongoose.Schema.Types.ObjectId, ref: 'NCR', required: true },nncrNo: String,nn// D4: Root Cause Analysis (根本原因分析)nrootCause: {nmethod: { type: String, enum: ['5WHY', 'FISHBONE', 'FMEA'] },ndescription: String, // 根本原因描述nfishbone: { // 鱼骨图数据 (JSON结构)ncategories: [{ name: String, causes: [String] }] // 人、机、料、法、环、测n}n},nn// D5: Containment Action (遏制措施)ncontainment: [{naction: String, // 措施描述nowner: String,ndueDate: Date,ncompletedDate: Date,nevidence: [String] // 证据文件URLn}],nn// D6: Corrective Action (纠正措施)ncorrection: [{naction: String,nowner: String,ndueDate: Date,ncompletedDate: Date,neffectiveness: { type: String, enum: ['PENDING', 'EFFECTIVE', 'INEFFECTIVE'] }n}],nn// D7: Preventive Action (预防措施)nprevention: [{naction: String,nscope: String, // 适用范围 (如: 所有类似模具)nowner: Stringn}],nn// 验证信息nverification: {nverifiedBy: String,nverifiedAt: Date,nresult: { type: String, enum: ['PASS', 'FAIL'] },ncomments: Stringn},nnsubmittedBy: String,nsubmittedAt: Daten});nnmodule.exports = mongoose.model('CorrectiveAction', CorrectiveActionSchema);"}]},{"type":"paragraph","attrs":{"id":"c2410c0e-1f04-4dc7-9009-4a5a3ad302dc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"代码解析:"}]},{"type":"bulletList","attrs":{"id":"5c525baa-9405-4422-8443-f02ddedc45d1","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"50bbfa08-80d1-44e5-9779-9fbb626131fa"},"content":[{"type":"paragraph","attrs":{"id":"9750ad5a-bcff-446e-9e7d-f9f88471eabd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"8D 结构化"},{"type":"text","text":":将非结构化的整改报告拆解为根因、遏制、纠正、预防四个逻辑块,引导供应商进行系统性思考,而非头痛医头。"}]}]},{"type":"listItem","attrs":{"id":"da4d02d4-3b4f-4130-9eba-311f87be5a8f"},"content":[{"type":"paragraph","attrs":{"id":"b44cea7e-f3f3-4544-83b6-fb991e1d9a62","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"鱼骨图存储"},{"type":"text","text":":使用 JSON 格式存储鱼骨图的拓扑结构,前端可使用 AntV G6 或 ECharts 进行可视化渲染。"}]}]},{"type":"listItem","attrs":{"id":"6fa2c43f-f2f2-4542-b93d-5279fd94fe44"},"content":[{"type":"paragraph","attrs":{"id":"8826e94b-2597-4f39-b13b-89157c54b730","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"措施跟踪"},{"type":"text","text":":每条措施都有负责人、截止日期和完成状态,便于品牌商跟踪整改进度。"}]}]},{"type":"listItem","attrs":{"id":"92a2f3ec-3a6b-4013-903b-f213d2c95d5c"},"content":[{"type":"paragraph","attrs":{"id":"84c3a8d6-8554-423b-9746-a2bc88c4a50f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"有效性验证"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"effectiveness"},{"type":"text","text":" 字段用于记录措施实施后的效果,形成 PDCA 闭环。"}]}]}]},{"type":"heading","attrs":{"id":"c3da50ce-f3bd-4d0e-b22b-e82efc5c2a11","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"四、后端核心逻辑实现 "}]},{"type":"heading","attrs":{"id":"6fd00d40-41c3-44da-ba4a-24ec0aee0ae6","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"4.1 创建 NCR 与 SLA 计算 "}]},{"type":"codeBlock","attrs":{"id":"d76e9b2c-8424-4198-980a-17d6eb2a9815","language":"ja vascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"ja vascript"},"content":[{"type":"text","text":"// services/ncrService.jsnconst NCR = require('../models/NCR');nconst { v4: uuidv4 } = require('uuid');nnclass NCRService {n/**n * 创建不合格品报告n * @param {Object} ncrData - NCR数据n * @param {Object} user - 当前用户n */nasync createNCR(ncrData, user) {nconst session = await NCR.startSession();nsession.startTransaction();nntry {n// 1. 生成唯一 NCR 编号 (规则: 租户前缀 年月 流水号)nconst ncrNo = await this.generateNCRNo(ncrData.tenantId, session);nn// 2. 计算 SLA 截止时间 (根据严重程度设定)nconst slaTimes = this.calculateSLA(ncrData.defect.severity);nn// 3. 构建 NCR 文档nconst ncr = new NCR({n...ncrData,ntenantId: user.tenantId,nncrNo,ncreatedBy: user.userId,nstatus: 'OPEN',nsla: {nresponseDue: slaTimes.responseDue,nresolutionDue: slaTimes.resolutionDuen},nhistory: [{nstatus: 'OPEN',ntimestamp: new Date(),noperator: user.userId,ncomment: 'NCR Created'n}]n});nnawait ncr.sa ve({ session });nn// 4. 触发后续动作 (异步)nawait this.triggerWorkflow(ncr);nnawait session.commitTransaction();nreturn ncr;n} catch (error) {nawait session.abortTransaction();nthrow error;n} finally {nsession.endSession();n}n}nn/**n * 计算 SLA 时间n * Critical: 2小时响应, 24小时解决n * Major: 8小时响应, 72小时解决n * Minor: 24小时响应, 7天解决n */ncalculateSLA(severity) {nconst now = new Date();nlet responseHours, resolutionDays;nnswitch (severity) {ncase 'CRITICAL':nresponseHours = 2;nresolutionDays = 1;nbreak;ncase 'MAJOR':nresponseHours = 8;nresolutionDays = 3;nbreak;ncase 'MINOR':ndefault:nresponseHours = 24;nresolutionDays = 7;nbreak;n}nnreturn {nresponseDue: new Date(now.getTime() responseHours * 60 * 60 * 1000),nresolutionDue: new Date(now.getTime() resolutionDays * 24 * 60 * 60 * 1000)n};n}nn/**n * 触发工作流 (发送通知、更新统计等)n */nasync triggerWorkflow(ncr) {nconst io = require('../socket').getIO();nn// 1. 实时通知供应商nio.to(`company_${ncr.supplier.companyId}`).emit('ncr:new', {nncrNo: ncr.ncrNo,nseverity: ncr.defect.severity,nmaterial: ncr.material.name,nmessage: `新的不合格品报告: ${ncr.ncrNo}`n});nn// 2. 发送邮件/信息 (伪代码)n// await NotificationService.sendEmail(ncr.supplier.email, 'New NCR Alert', ...);nn// 3. 更新供应商绩效看板 (伪代码)n// await SupplierPerformanceService.incrementOpenNCR(ncr.supplier.companyId);n}nnasync generateNCRNo(tenantId, session) {n// 简化版:基于时间戳和随机数n// 生产环境建议使用 Redis INCR 或 MongoDB 计数器集合nconst dateStr = new Date().toISOString().slice(0, 10).replace(/-/g, '');nconst randomStr = Math.random().toString(36).substring(2, 6).toUpperCase();nreturn `NCR-${dateStr}-${randomStr}`;n}n}nnmodule.exports = new NCRService();"}]},{"type":"paragraph","attrs":{"id":"6ed45f1b-b263-4d8d-b33d-777ef84c6803","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"代码解析:"}]},{"type":"bulletList","attrs":{"id":"b678d538-355d-4a66-8df0-ec35a01dcbe5","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"a015d9ec-ad8c-4f52-8cc1-3ca30dcf6fab"},"content":[{"type":"paragraph","attrs":{"id":"484cf373-3691-406d-aa0a-00b10a0f8061","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"事务处理"},{"type":"text","text":":创建 NCR 涉及编号生成、数据保存和历史记录,必须在事务中完成。"}]}]},{"type":"listItem","attrs":{"id":"340b4986-0860-46ec-bdcf-d86c30f293c9"},"content":[{"type":"paragraph","attrs":{"id":"5245439e-3942-4d5a-bf65-365e70f46ccf","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"SLA 自动化"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"calculateSLA"},{"type":"text","text":" 方法根据缺陷严重性自动设定响应和解决时限,体现了质量管理的前瞻性。"}]}]},{"type":"listItem","attrs":{"id":"cacc82e3-7bad-4e38-83b5-0218e292d1c4"},"content":[{"type":"paragraph","attrs":{"id":"bd0aa8f4-3621-47f1-aef2-358be98e53b2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"事件驱动"},{"type":"text","text":":"},{"type":"text","marks":[{"type":"code"}],"text":"triggerWorkflow"},{"type":"text","text":" 方法在事务提交后执行,负责发送实时通知(Socket.io)和邮件,解耦了核心业务逻辑与通知逻辑。"}]}]},{"type":"listItem","attrs":{"id":"276297e5-46e4-47de-9542-58a11e4d30fb"},"content":[{"type":"paragraph","attrs":{"id":"bf0c4a2b-8dbd-430e-926d-93298619f5e4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"编号生成"},{"type":"text","text":":展示了基于时间戳的编号生成策略,实际生产中需考虑并发和高可用(如使用 Redis 原子计数器)。"}]}]}]},{"type":"heading","attrs":{"id":"76063c62-ca64-4463-ad92-f64051f22055","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"4.2 供应商提交整改措施 "}]},{"type":"codeBlock","attrs":{"id":"2ca9ed44-607a-4465-bfc8-1a7000ff60c8","language":"ja vascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"ja vascript"},"content":[{"type":"text","text":"// controllers/correctiveActionController.jsnconst CorrectiveAction = require('../models/CorrectiveAction');nconst NCR = require('../models/NCR');nconst NCRService = require('../services/ncrService');nnexports.submitCorrectiveAction = async (req, res) => {nconst { ncrId, rootCause, containment, correction, prevention } = req.body;nconst { tenantId, userId, companyId } = req.user;nntry {n// 1. 验证 NCR 是否存在且属于当前供应商nconst ncr = await NCR.findById(ncrId);nif (!ncr) return res.status(404).json({ error: 'NCR not found' });nif (ncr.supplier.companyId !== companyId) {nreturn res.status(403).json({ error: 'Permission denied' });n}nif (!['OPEN', 'SUPPLIER_ACK', 'ROOT_CAUSE_ANALYSIS'].includes(ncr.status)) {nreturn res.status(400).json({ error: 'NCR status does not allow submission' });n}nn// 2. 创建或更新整改措施nlet cap = await CorrectiveAction.findOne({ ncrId });nif (!cap) {ncap = new CorrectiveAction({ntenantId,nncrId,nncrNo: ncr.ncrNo,nrootCause,ncontainment,ncorrection,nprevention,nsubmittedBy: userId,nsubmittedAt: new Date()n});n} else {n// 更新逻辑ncap.rootCause = rootCause;ncap.containment = containment;ncap.correction = correction;ncap.prevention = prevention;ncap.submittedAt = new Date();n}nawait cap.sa ve();nn// 3. 更新 NCR 状态为 "CAP_SUBMITTED"nawait NCR.findByIdAndUpdate(ncrId, {n$set: { status: 'CAP_SUBMITTED' },n$push: {nhistory: {nstatus: 'CAP_SUBMITTED',ntimestamp: new Date(),noperator: userId,ncomment: 'Corrective Action Plan Submitted'n}n}n});nn// 4. 通知品牌商审核nconst io = require('../socket').getIO();nio.to(`tenant_${tenantId}`).emit('ncr:cap_submitted', {nncrNo: ncr.ncrNo,nsupplier: companyId,nmessage: `供应商已提交整改报告: ${ncr.ncrNo}`n});nnres.status(200).json(cap);n} catch (error) {nres.status(500).json({ error: error.message });n}n};"}]},{"type":"paragraph","attrs":{"id":"5bd12d7d-a592-4240-9772-55d1b8b7587f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"代码解析:"}]},{"type":"bulletList","attrs":{"id":"cd6cf170-b2dd-4ff5-807f-0a8474a309b7","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"51841f70-8386-4c28-9187-39ac54441dc6"},"content":[{"type":"paragraph","attrs":{"id":"c1606bd0-e9de-4575-bedf-15a52cddfa1b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"权限双重校验"},{"type":"text","text":":先校验用户是否属于该供应商,再校验 NCR 当前状态是否允许提交整改,防止越权和非法操作。"}]}]},{"type":"listItem","attrs":{"id":"2e42bb5f-9d53-44ec-a5a0-e1690338747e"},"content":[{"type":"paragraph","attrs":{"id":"4cab5f80-4ade-4d91-99dc-d53c2f91435f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"状态流转"},{"type":"text","text":":提交整改后,NCR 状态自动变更为 "},{"type":"text","marks":[{"type":"code"}],"text":"CAP_SUBMITTED"},{"type":"text","text":",推动流程前进。"}]}]},{"type":"listItem","attrs":{"id":"5306dd09-341d-4399-be55-5e950724da40"},"content":[{"type":"paragraph","attrs":{"id":"057491f5-8aa4-4db4-bc73-4b97b45acf05","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"历史留痕"},{"type":"text","text":":记录状态变更的历史,包括操作人和时间,满足审计要求。"}]}]},{"type":"listItem","attrs":{"id":"1cb99969-f93d-44df-86fd-905ac7b7af8c"},"content":[{"type":"paragraph","attrs":{"id":"2e9d6d2c-f11d-4642-aabc-5d0367dcfcbc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"实时协同"},{"type":"text","text":":通过 Socket.io 通知品牌商,缩短了审核等待时间。"}]}]}]},{"type":"heading","attrs":{"id":"d96ec707-2004-4f5f-88c1-0b9664ba9bc4","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"五、前端交互:移动端质检与 8D 报告 "}]},{"type":"heading","attrs":{"id":"7561625c-6074-41e3-b402-d7d7a29c6969","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"5.1 移动端 NCR 快速录入 "}]},{"type":"paragraph","attrs":{"id":"0dd25c7b-4820-40ad-95d8-5b881e2aa5cf","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"现场质检员通常使用手机或 PDA 操作,界面需简洁高效。"}]},{"type":"codeBlock","attrs":{"id":"7ba87352-c235-47de-82fe-4b4ae012e4b0","language":"ja vascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"ja vascript"},"content":[{"type":"text","text":"// mobile/pages/NCRCreate.jsxnimport React, { useState, useEffect } from 'react';nimport { View, Text, Input, Button, Image, Picker, Uploader } from '@tarojs/components';nimport Taro from '@tarojs/taro';nimport { AtForm, AtInput, AtTextarea, AtImagePicker, AtSegmentedControl } from 'taro-ui';nimport { Camera } from '@tarojs/components';nnconst NCRCreate = () => {nconst [formData, setFormData] = useState({nmaterialCode: '',ndefectCategory: 'APPEARANCE',nseverity: 'MAJOR',ndescription: '',nimages: []n});nnconst severityOptions = [n{ label: '致命', value: 'CRITICAL' },n{ label: '严重', value: 'MAJOR' },n{ label: '轻微', value: 'MINOR' }n];nnconst handleSubmit = async () => {n// 1. 压缩图片nconst compressedImages = await Promise.all(nformData.images.map(img => compressImage(img.url))n);nn// 2. 上传图片到 OSSnconst uploadPromises = compressedImages.map(img => uploadToOSS(img));nconst imageUrls = await Promise.all(uploadPromises);nn// 3. 提交 NCR 数据nconst res = await Taro.request({nurl: `${API_BASE}/ncr`,nmethod: 'POST',ndata: {n...formData,nattachments: imageUrls.map(url => ({ url, type: 'image' }))n},nheader: { Authorization: `Bearer ${getToken()}` }n});nnif (res.statusCode === 200) {nTaro.showToast({ title: 'NCR创建成功', icon: 'success' });nTaro.na vigateBack();n}n};nnconst compressImage = async (url) => {n// 使用 Taro.compressImage APInconst res = await Taro.compressImage({nsrc: url,nquality: 80n});nreturn res.tempFilePath;n};nnreturn (nnn物料信息 n setFormData({...formData, materialCode: value})}n/>n nnn缺陷信息 n setFormData({...formData, defectCategory: e.detail.value})}n>n缺陷类别: {formData.defectCategory} nnn o.label)}nonClick={(index) => setFormData({...formData, severity: severityOptions[index].value})}ncurrent={severityOptions.findIndex(o => o.value === formData.severity)}n/>nn setFormData({...formData, description: value})}nmaxLength={200}nplaceholder="请详细描述缺陷现象..."n/>n nnn现场拍照 n setFormData({...formData, images: files})}nonFail={(mes) => console.log(mes)}n/>nn nnnn);n};nnexport default NCRCreate;"}]},{"type":"paragraph","attrs":{"id":"861a368b-4af2-47d4-8a68-4a93808c1bb7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"代码解析:"}]},{"type":"bulletList","attrs":{"id":"048797dc-6e0c-4c01-8a8b-9b05e6964ab6","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"fb25c4a2-0914-4782-b664-78d94fddbc5b"},"content":[{"type":"paragraph","attrs":{"id":"a8d18b58-8ccc-4800-b784-917f418e2293","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"移动端适配"},{"type":"text","text":":使用 Taro UI 组件库,确保在手机端有良好的触控体验。"}]}]},{"type":"listItem","attrs":{"id":"6b44d485-961d-49b4-8292-674d44c0029b"},"content":[{"type":"paragraph","attrs":{"id":"cc504296-abfc-45c6-ba49-94984b7ba00a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"图像预处理"},{"type":"text","text":":在上传前对图片进行压缩,减少流量消耗和上传时间,这对现场网络环境较差的情况尤为重要。"}]}]},{"type":"listItem","attrs":{"id":"f8b68c4e-e101-4d78-8c36-c71c3bcfcabb"},"content":[{"type":"paragraph","attrs":{"id":"bee2d969-0540-44a6-b6b1-c7656b829cc5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"扫码集成"},{"type":"text","text":":物料编码支持扫码输入,减少手工输入错误。"}]}]},{"type":"listItem","attrs":{"id":"ea75ade1-34de-4ce5-9c0f-1586bfecc127"},"content":[{"type":"paragraph","attrs":{"id":"51174200-bb91-433f-8de2-bdea675c0689","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"结构化录入"},{"type":"text","text":":通过选择器(Picker)和分段器(SegmentedControl)引导用户输入标准化数据,而非自由文本。"}]}]}]},{"type":"heading","attrs":{"id":"0d04f509-17ce-4cca-8950-3056ffc29308","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"5.2 8D 整改报告编辑器 "}]},{"type":"paragraph","attrs":{"id":"f3dc6516-ab22-4db7-8580-000d52ed4174","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"供应商端需要一个功能强大的编辑器来填写 8D 报告。"}]},{"type":"codeBlock","attrs":{"id":"a339aea9-3f58-485e-90e4-59d46132ee4f","language":"ja vascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"ja vascript"},"content":[{"type":"text","text":"// components/EightDReport.jsxnimport React, { useState } from 'react';nimport { Form, Input, Button, Select, DatePicker, Upload, message } from 'antd';nimport { FishboneDiagram } from './FishboneDiagram'; // 这里引入的是自定义鱼骨图组件nimport { PlusOutlined, DeleteOutlined } from '@ant-design/icons';nnconst { TextArea } = Input;nconst { Option } = Select;nnconst EightDReport = ({ ncr, onSubmit }) => {nconst [form] = Form.useForm();nconst [fishboneData, setFishboneData] = useState({ncategories: [n{ name: '人', causes: [] },n{ name: '机', causes: [] },n{ name: '料', causes: [] },n{ name: '法', causes: [] },n{ name: '环', causes: [] },n{ name: '测', causes: [] }n]n});nnconst onFinish = (values) => {nconst finalData = {n...values,nrootCause: {n...values.rootCause,nfishbone: fishboneDatan}n};nonSubmit(finalData);n};nnreturn (nn);n};nnexport default EightDReport;"}]},{"type":"paragraph","attrs":{"id":"31b1f1ad-1c82-4708-b9c8-71328428c90c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"代码解析:"}]},{"type":"bulletList","attrs":{"id":"c71426e8-619d-4329-a847-68b5612cf8e3","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"40212d27-f127-4667-84c8-147bd64a4ca9"},"content":[{"type":"paragraph","attrs":{"id":"2443bf9e-6763-4925-85b5-4b2b19c650c2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"动态表单"},{"type":"text","text":":使用 "},{"type":"text","marks":[{"type":"code"}],"text":"Form.List"},{"type":"text","text":" 实现遏制、纠正、预防措施的动态增减,适应不同复杂度的整改需求。"}]}]},{"type":"listItem","attrs":{"id":"d1cd7f34-d039-4ae1-a420-e16e721b0200"},"content":[{"type":"paragraph","attrs":{"id":"92db0177-58ae-4dce-aed4-e9f3e3ae1f04","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"嵌套数据结构"},{"type":"text","text":":通过 "},{"type":"text","marks":[{"type":"code"}],"text":"name={['rootCause', 'description']}"},{"type":"text","text":" 的语法,轻松处理嵌套的 JSON 数据,与后端模型完美契合。"}]}]},{"type":"listItem","attrs":{"id":"654b061e-b278-4b12-8f7d-c234c784d67d"},"content":[{"type":"paragraph","attrs":{"id":"e91c82c9-ccc6-47a1-b5ff-76aaa4201b42","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"可视化组件"},{"type":"text","text":":集成自定义的 "},{"type":"text","marks":[{"type":"code"}],"text":"FishboneDiagram"},{"type":"text","text":" 组件,让供应商能够直观地绘制鱼骨图,提升分析质量。"}]}]},{"type":"listItem","attrs":{"id":"996da130-dea0-4f71-8d46-372ae87b6a9a"},"content":[{"type":"paragraph","attrs":{"id":"71cdc0d9-dd8d-4833-b722-60038dd6cd8d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"引导式填写"},{"type":"text","text":":表单结构严格按照 8D 报告的框架设计,引导用户系统性地思考和填写,避免遗漏关键环节。"}]}]}]},{"type":"heading","attrs":{"id":"b55a56ec-f2b0-4fce-aa89-1911f39e98df","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"六、质量数据分析与可视化 "}]},{"type":"paragraph","attrs":{"id":"bc200283-3ca5-40d9-ac67-1919d1c75fde","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"数据是质量的镜子。系统需要为管理层提供多维度的质量看板。"}]},{"type":"heading","attrs":{"id":"e5de522d-ee5c-4dd7-967f-c7a60d9c3e0c","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"6.1 供应商质量绩效排名 "}]},{"type":"image","attrs":{"id":"b766d1c5-164a-4ebf-90ea-74b650d915b4","src":"https://developer.qcloudimg.com/http-sa ve/audit-10133498/91e973ebf745ec3885eec287965457d6.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1012,"aspectRatio":"1.370370","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"5d2bee85-b8bf-4040-856f-755ed4537016","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"359d1a84-5053-49e5-9ffb-a20b140a8520","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"italic"}],"text":"注:PPM = (不良数量 / 总出货数量) * 1,000,000"}]},{"type":"heading","attrs":{"id":"4d770803-6849-4371-b8b7-416a942338d8","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"6.2 缺陷柏拉图 (Pareto Chart) "}]},{"type":"image","attrs":{"id":"69d144cc-87be-4bad-8984-ac2f7cd0b077","src":"https://developer.qcloudimg.com/http-sa ve/audit-10133498/3be8c6b4e405c22ebb5a872417432bea.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1012,"aspectRatio":"1.370370","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"9365026c-3151-4fa1-8ba5-6f04bc32f30b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"e0bda538-8695-4088-83c6-ec6cd4d35d89","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"italic"}],"text":"注:柏拉图用于识别“关键的少数”,80%的问题往往由20%的原因造成。"}]},{"type":"heading","attrs":{"id":"3e957212-751f-45e6-9ac5-97bdcc950923","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"总结 "}]},{"type":"paragraph","attrs":{"id":"c566c1d0-557f-4d30-bea3-32b5970e0c04","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"本文系统性地构建了供应链协同平台(SCP)中的 "},{"type":"text","marks":[{"type":"bold"}],"text":"质量协同管理模块"},{"type":"text","text":",重点实现了不合格品处理(NCR)流程的线上化与闭环化。"}]},{"type":"paragraph","attrs":{"id":"fec218bf-1c9a-4161-afc9-8afdca96a881","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"核心内容回顾:"}]},{"type":"bulletList","attrs":{"id":"72d766cd-0bc8-4704-ba8e-bddf3f81166a","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"469b4311-9c48-463b-900e-a0da0879ec1f"},"content":[{"type":"paragraph","attrs":{"id":"2906006f-4944-4f58-b12e-917e9845f3cf","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"结构化缺陷管理"},{"type":"text","text":":我们摒弃了模糊的文本描述,建立了标准化的"},{"type":"text","marks":[{"type":"bold"}],"text":"缺陷分类体系"},{"type":"text","text":"(外观、尺寸、功能等),并结合严重程度(Critical/Major/Minor)进行精细化管理,为数据统计奠定了坚实基础。"}]}]},{"type":"listItem","attrs":{"id":"7823b972-6389-43bf-b1e8-7fbdb7994e01"},"content":[{"type":"paragraph","attrs":{"id":"b46b4e2f-d022-4a6f-a8a3-b649909e4517","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"8D 整改流程数字化"},{"type":"text","text":":将复杂的 8D 报告拆解为根因分析、遏制措施、纠正措施和预防措施四个核心模块,并通过"},{"type":"text","marks":[{"type":"bold"}],"text":"动态表单"},{"type":"text","text":"和"},{"type":"text","marks":[{"type":"bold"}],"text":"鱼骨图可视化"},{"type":"text","text":"组件,引导供应商进行系统性改进,而非简单的表面修复。"}]}]},{"type":"listItem","attrs":{"id":"ea5805a7-1b80-48d6-be68-5a55b9c1ebbc"},"content":[{"type":"paragraph","attrs":{"id":"bbb8a6c0-8dc5-4ed0-b5d3-54b449669f43","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"SLA 驱动的流程控制"},{"type":"text","text":":系统根据缺陷严重程度自动计算响应和解决时限,通过"},{"type":"text","marks":[{"type":"bold"}],"text":"工作流引擎"},{"type":"text","text":"自动推进流程,并在超时前进行预警,确保质量问题得到及时处理。"}]}]},{"type":"listItem","attrs":{"id":"dfe90e98-3a73-4585-a79e-f96835bdc795"},"content":[{"type":"paragraph","attrs":{"id":"f6d63fe6-028e-4c21-a4ce-9748505bba3e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"全生命周期追溯"},{"type":"text","text":":从 NCR 创建、整改措施提交、品牌商审核到最终关闭,每一个环节都被完整记录,形成了不可篡改的"},{"type":"text","marks":[{"type":"bold"}],"text":"审计链条"},{"type":"text","text":",满足了合规性和追溯性要求。"}]}]},{"type":"listItem","attrs":{"id":"56d9a740-6995-4968-a3d4-d24b7ab030f7"},"content":[{"type":"paragraph","attrs":{"id":"d096d157-5b6b-4975-ad77-152d6c3aee3c","textAlign":"inher移动端与实时协同:专门做了适配移动设备的质检录入页面,支持现场拍照和图片压缩,并结合 Socket.io 完成跨企业的实时消息推送,明显缩短了问题响应时间。
数据驱动决策:借助 PPM 指标、柏拉图等可视化工具,把质量数据进一步沉淀为管理洞察,便于管理层快速识别关键供应商以及主要问题点。Align":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"阅读收获:"}]},{"type":"bulletList","attrs":{"id":"57cb3fbf-a7d9-4df3-9f0e-4a8885db5bb7","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"8ac89d8c-f7e8-4373-b538-66e4e2b2244c"},"content":[{"type":"paragraph","attrs":{"id":"eaed88b1-145d-4ed9-91a8-446bb0dc4313","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"你将掌握"},{"type":"text","marks":[{"type":"bold"}],"text":"质量管理信息系统(QMIS)"},{"type":"text","text":"的核心设计理念,理解如何将 ISO 9001、IATF 16949 等质量标准落地为软件功能。"}]}]},{"type":"listItem","attrs":{"id":"93380976-f7bd-4254-89c5-1f31565ab484"},"content":[{"type":"paragraph","attrs":{"id":"625cb4c2-89e5-4b44-a7d3-c62b54c760ac","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"深入理解 "},{"type":"text","marks":[{"type":"bold"}],"text":"8D 报告"},{"type":"text","text":"的数字化实现方法,学会如何设计表单结构和引导用户进行系统性思考。"}]}]},{"type":"listItem","attrs":{"id":"51c008b2-b4c1-4253-822b-0e93faa7a6b5"},"content":[{"type":"paragraph","attrs":{"id":"7bc7b7a6-272f-4401-8272-012cb43bb4e4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"获得一套"},{"type":"text","marks":[{"type":"bold"}],"text":"完整的 NCR 流程代码实现"},{"type":"text","text":",包括数据模型设计、后端业务逻辑、API 接口以及前端交互组件。"}]}]},{"type":"listItem","attrs":{"id":"82979785-522a-491c-bb43-eb6f58bdd04f"},"content":[{"type":"paragraph","attrs":{"id":"f041c99a-33f1-4286-b94a-2b35f798b5a9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"学会如何利用 "},{"type":"text","marks":[{"type":"bold"}],"text":"SLA 管理机制"},{"type":"text","text":"提升业务流程的执行力,以及如何通过 "},{"type":"text","marks":[{"type":"bold"}],"text":"数据可视化"},{"type":"text","text":"将质量信息转化为管理价值。"}]}]}]},{"type":"paragraph","attrs":{"id":"314d3378-57a5-4118-946e-45bf0cd048b1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"通过本模块的落地,企业不仅能够高效处理当下的质量问题,更能通过数据沉淀和趋势分析,推动供应链质量的持续改进,实现从“救火”到“防火”的转变。"}]}]}","createTime":1786545435,"ext":{"closeTextLink":0,"comment_ban":0,"description":"","focusRead":0},"fa vNum":0,"html":"","isOriginal":0,"likeNum":1,

来源:https://cloud.tencent.com.cn/developer/article/2725194
本站内容用于信息整理与展示,如有侵权或内容问题请及时联系处理。
相关推荐
补充同频道和同主题内容,方便继续浏览更多相关内容。
同类最新
继续查看同栏目最近更新的文章。
CAD零基础入门教程:坐标输入、图层管理与基础绘图命令
本文面向CAD零基础学习者,系统讲解坐标输入、图层管理与基础绘图命令的核心用法。通过分步实操与常见问题排查,帮助新手建立精确绘图习惯,掌握规范出图的基础能力。
CAD从入门到项目交付:绘图、标注、图块与实战工作流
掌握CAD的核心在于建立“画得准、标得清、复用快、交付稳”的工作流。本文提供从环境设置、高频命令组合、标注规范、图块标准化到项目分阶段交付的完整路径,帮助初学者避免常见返工陷阱,独立完成可检查、可复用、可打印的工程图纸。
Claude Code 登录指南:个人、Teams 与企业账号区分与授权步骤
本文详细解析 Claude Code 登录前的账号类型区分方法,涵盖个人订阅、Teams 席位与企业 Enterprise 席位的授权路径差异。提供终端登录命令、环境变量排查及常见异常处理步骤,帮助用户快速完成正确授权并避免登录路径混淆。
Claude Code 文件修改前的权限模式配置与命令审批指南
本文详细介绍Claude Code在修改文件前的权限模式配置方法,包括defaultMode可选值、permissions allow与deny规则设置、多层级配置文件管理以及 status验证技巧,帮助开发者安全高效地使用AI编程助手。
Claude Code接入VS Code后先测扩展和终端命令
在VS Code中接入Claude Code后,建议优先验证扩展面板与集成终端两条入口。本文提供标准检查顺序、关键命令与常见故障排查路径,帮助你快速确认环境就绪,避免后续开发受阻。
