Files
bj_power/bj_power_mes/public/assets_bak_1791594689/ProcessCard-C2RD9qR4.js
T
SunYF 8be6e03a15 docs: 统一修正全项目“SN管理”相关术语为“序列号”
本次 commit 统一修正了全项目范围内关于 SN 管理的术语表述,将原“SN管理”、“序列号件”、“批次件”等表述调整为“序列号”、“序列号=是”、“序列号=否”,同时同步更新了相关文档、代码注释、前端提示文本、数据库 schema 注释、API 文档等,确保全链路术语统一,消除理解歧义。
2026-10-10 15:58:59 +08:00

2 lines
17 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as te,o as oe,j as T,c,f as p,b as e,w as l,q as N,t as D,l as se,F as U,k as f,r as v,e as d,p as ne,i as $,h as r,v as o,E as re,A as Y}from"./index-DJDmNdMC.js";import{o as H}from"./print-DcJyQc1u.js";import{r as ie,P as ue}from"./help-BzRl7tMm.js";const de={class:"hd"},pe={class:"sub"},ce={key:0},me={key:0,class:"muted"},ve={key:1,class:"muted"},be={key:0},we={key:1,class:"muted"},fe={key:0},_e={key:1,class:"muted"},he={key:0},ge={key:1,class:"muted"},ye={class:"hd"},ke={class:"sub"},Ne={key:0,class:"sec"},xe={key:0},Ce={key:1,class:"muted"},Se={key:0},ze={key:1,class:"muted"},Ve={key:0},qe={key:1,class:"muted"},Me={class:"hd"},Ae={class:"sub"},Pe={__name:"ProcessCard",setup(De){const F=f([]),M=f(""),_=f(""),g=f(""),h=f([]),w=f(""),s=f(null),u=f(null),b=f(null),x=f(!1),C=f("");function B(){const m=new Date,t=m.getFullYear(),S=m.getMonth(),z=new Date(t,S-1,1),j=new Date(t,S,0,23,59,59),k=V=>{const O=q=>String(q).padStart(2,"0");return`${V.getFullYear()}-${O(V.getMonth()+1)}-${O(V.getDate())}`};return[k(z),k(j)]}function K(m){m&&(_.value="",g.value=""),b.value=null}async function R(){C.value="",_.value.trim()?await L(_.value.trim()):g.value.trim()?await G(g.value.trim()):M.value?await Q(M.value):re.warning("请选择产品型号或填写工单号 / 成品SN")}async function L(m){x.value=!0,C.value="",w.value="workorder",u.value=null,b.value=null;try{s.value=await T.get("/process-card/workorder",{params:{no:m,format:"json"}})}catch{s.value=null}finally{x.value=!1}}async function G(m){x.value=!0,C.value="",w.value="sn",s.value=null,b.value=null;try{u.value=await T.get("/process-card/by-sn",{params:{sn:m,format:"json"}})}catch{u.value=null}finally{x.value=!1}}async function Q(m){x.value=!0,C.value="",w.value="model",s.value=null,u.value=null;try{b.value=await T.get("/process-card/by-model",{params:{code:m}})}catch{b.value=null}finally{x.value=!1}}const I=Y(()=>{const m=b.value&&b.value.workOrders||[];if(!h.value||!h.value.length)return m;const[t,S]=h.value;return m.filter(z=>z.createdAt?z.createdAt>=t&&z.createdAt<=S+" 23:59:59":!0)}),W=Y(()=>h.value&&h.value.length?h.value.join(" ~ "):"全部时间"),J=Y(()=>w.value==="workorder"&&s.value||w.value==="sn"&&u.value);function X(){w.value==="workorder"&&_.value?H("/process-card/workorder",{no:_.value}):w.value==="sn"&&g.value&&H("/process-card/by-sn",{sn:g.value})}function Z(m){_.value=m,L(m)}function ee(){M.value="",_.value="",g.value="",h.value=B(),w.value="",s.value=null,u.value=null,b.value=null,C.value=""}return oe(async()=>{h.value=B();try{F.value=await T.get("/product-types")||[]}catch{F.value=[]}}),(m,t)=>{const S=v("el-alert"),z=v("el-option"),j=v("el-select"),k=v("el-form-item"),V=v("el-input"),O=v("el-date-picker"),q=v("el-button"),le=v("el-form"),A=v("el-card"),i=v("el-descriptions-item"),P=v("el-descriptions"),a=v("el-table-column"),E=v("el-tag"),y=v("el-table"),ae=v("el-empty");return d(),c(U,null,[p("div",null,[e(A,null,{default:l(()=>[e(S,{type:"info",closable:!1,style:{"margin-bottom":"12px"},title:"生产流程卡(工单维度主卡):以工单为唯一主键,展示该工单的工序实绩、用料清单(序列号=是/序列号=否分组、类型取自物料档案)、成品明细与签字确认。成品 SN 是工单卡下的追溯子视图;产品型号仅作筛选入口(按型号查该型号下的工单列表)。可打印或另存为 PDF。"}),e(le,{inline:""},{default:l(()=>[e(k,{label:"产品型号"},{default:l(()=>[e(j,{modelValue:M.value,"onUpdate:modelValue":t[0]||(t[0]=n=>M.value=n),filterable:"",clearable:"",placeholder:"按型号筛选工单",style:{width:"260px"},onChange:K},{default:l(()=>[(d(!0),c(U,null,ne(F.value,n=>(d(),N(z,{key:n.id,label:n.name+(n.code?" / "+n.code:""),value:n.code},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(k,{label:"工单号"},{default:l(()=>[e(V,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=n=>_.value=n),placeholder:"输入工单号查主卡",clearable:"",style:{width:"220px"},onKeyup:$(R,["enter"])},null,8,["modelValue"])]),_:1}),e(k,{label:"成品SN"},{default:l(()=>[e(V,{modelValue:g.value,"onUpdate:modelValue":t[2]||(t[2]=n=>g.value=n),placeholder:"输入成品SN查追溯卡",clearable:"",style:{width:"220px"},onKeyup:$(R,["enter"])},null,8,["modelValue"])]),_:1}),w.value==="model"||!_.value&&!g.value?(d(),N(k,{key:0,label:"时间范围"},{default:l(()=>[e(O,{modelValue:h.value,"onUpdate:modelValue":t[3]||(t[3]=n=>h.value=n),type:"monthrange","range-separator":"至","start-placeholder":"起始月","end-placeholder":"结束月","value-format":"YYYY-MM-DD",style:{width:"260px"}},null,8,["modelValue"])]),_:1})):D("",!0),e(k,null,{default:l(()=>[e(q,{type:"primary",loading:x.value,onClick:R},{default:l(()=>[...t[4]||(t[4]=[r("查询",-1)])]),_:1},8,["loading"]),e(q,{disabled:!J.value,onClick:X},{default:l(()=>[...t[5]||(t[5]=[r("打印 / 导出 PDF",-1)])]),_:1},8,["disabled"]),e(q,{onClick:ee},{default:l(()=>[...t[6]||(t[6]=[r("重置",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),C.value?(d(),N(S,{key:0,title:C.value,type:"error","show-icon":"",closable:"",style:{"margin-top":"12px"}},null,8,["title"])):D("",!0),w.value==="workorder"&&s.value?(d(),N(A,{key:1,style:{"margin-top":"12px"}},{header:l(()=>[p("div",de,[t[7]||(t[7]=p("span",{class:"t"},"生产流程卡(工单维度)",-1)),p("span",pe,o(s.value.workOrderNo),1)])]),default:l(()=>[e(P,{column:4,border:"",size:"small",style:{"margin-bottom":"14px"}},{default:l(()=>[e(i,{label:"工单号"},{default:l(()=>[r(o(s.value.workOrderNo),1)]),_:1}),e(i,{label:"产品型号"},{default:l(()=>[r(o(s.value.productCode||"-"),1)]),_:1}),e(i,{label:"产品名称"},{default:l(()=>[r(o(s.value.productName||"-"),1)]),_:1}),e(i,{label:"图号"},{default:l(()=>[r(o(s.value.drawingNo||"-"),1)]),_:1}),e(i,{label:"计划数"},{default:l(()=>[r(o(s.value.planQty),1)]),_:1}),e(i,{label:"完成数"},{default:l(()=>[r(o(s.value.finishedNum),1)]),_:1}),e(i,{label:"不良数"},{default:l(()=>[r(o(s.value.failNum),1)]),_:1}),e(i,{label:"状态"},{default:l(()=>[r(o(s.value.status||"-"),1)]),_:1}),e(i,{label:"计划开始"},{default:l(()=>[r(o(s.value.planStart||"-"),1)]),_:1}),e(i,{label:"计划结束"},{default:l(()=>[r(o(s.value.planEnd||"-"),1)]),_:1}),e(i,{label:"实际开始"},{default:l(()=>[r(o(s.value.actualStart||"-"),1)]),_:1}),e(i,{label:"实际结束"},{default:l(()=>[r(o(s.value.actualFinish||"-"),1)]),_:1}),e(i,{label:"生成时间"},{default:l(()=>[r(o(s.value.generatedAt),1)]),_:1})]),_:1}),t[9]||(t[9]=p("h3",{class:"sec"},"一、工序实绩",-1)),e(y,{data:s.value.processSteps||[],border:"",size:"small","empty-text":"暂无工序实绩"},{default:l(()=>[e(a,{prop:"seq",label:"序号",width:"70",align:"center"}),e(a,{prop:"processName",label:"工序","min-width":"160","show-overflow-tooltip":""}),e(a,{prop:"stationNo",label:"工位",width:"80",align:"center"}),e(a,{prop:"planHours",label:"计划工时",width:"90",align:"center"}),e(a,{prop:"actualStart",label:"实绩开始",width:"150"}),e(a,{prop:"actualEnd",label:"实绩结束",width:"150"}),e(a,{prop:"operators",label:"操作人","min-width":"150","show-overflow-tooltip":""}),e(a,{label:"状态",width:"90",align:"center"},{default:l(({row:n})=>[e(E,{type:n.status==="完成"?"success":n.status==="进行中"?"warning":"info",size:"small"},{default:l(()=>[r(o(n.status),1)]),_:2},1032,["type"])]),_:1}),e(a,{label:"审核人","min-width":"160"},{default:l(({row:n})=>[n.auditor?(d(),c("span",ce,[r(o(n.auditor),1),n.auditRole?(d(),c("small",me,"("+o(n.auditRole)+")",1)):D("",!0)])):(d(),c("span",ve,"-"))]),_:1}),e(a,{prop:"auditedAt",label:"审核时间",width:"150"})]),_:1},8,["data"]),t[10]||(t[10]=p("h3",{class:"sec"},"二、用料清单 · 序列号=是(逐件追溯)",-1)),e(y,{data:s.value.serialMaterials||[],border:"",size:"small","empty-text":"暂无序列号=是实绩"},{default:l(()=>[e(a,{prop:"materialCode",label:"图号","min-width":"140","show-overflow-tooltip":""}),e(a,{prop:"materialName",label:"名称","min-width":"150","show-overflow-tooltip":""}),e(a,{prop:"materialType",label:"类型",width:"100",align:"center"}),e(a,{prop:"spec",label:"规格","min-width":"120","show-overflow-tooltip":""}),e(a,{prop:"unit",label:"单位",width:"70",align:"center"}),e(a,{label:"物料SN","min-width":"220"},{default:l(({row:n})=>[r(o((n.snList||[]).join(" ")||"-"),1)]),_:1}),e(a,{prop:"qty",label:"数量",width:"80",align:"center"}),e(a,{prop:"stationNo",label:"装配工位",width:"90",align:"center"}),e(a,{prop:"operator",label:"装配人","min-width":"100"})]),_:1},8,["data"]),t[11]||(t[11]=p("h3",{class:"sec"},"三、用料清单 · 序列号=否(按批追溯)",-1)),e(y,{data:s.value.batchMaterials||[],border:"",size:"small","empty-text":"暂无序列号=否实绩"},{default:l(()=>[e(a,{prop:"materialCode",label:"图号","min-width":"140","show-overflow-tooltip":""}),e(a,{prop:"materialName",label:"名称","min-width":"150","show-overflow-tooltip":""}),e(a,{prop:"materialType",label:"类型",width:"100",align:"center"}),e(a,{prop:"spec",label:"规格","min-width":"120","show-overflow-tooltip":""}),e(a,{prop:"unit",label:"单位",width:"70",align:"center"}),e(a,{prop:"batchNo",label:"批次号","min-width":"160","show-overflow-tooltip":""}),e(a,{prop:"qty",label:"数量",width:"80",align:"center"}),e(a,{prop:"stationNo",label:"装配工位",width:"90",align:"center"}),e(a,{prop:"operator",label:"装配人","min-width":"100"})]),_:1},8,["data"]),t[12]||(t[12]=p("h3",{class:"sec"},"四、成品明细",-1)),e(y,{data:s.value.products||[],border:"",size:"small","empty-text":"暂无成品记录","max-height":"320"},{default:l(()=>[e(a,{prop:"sn",label:"SN","min-width":"180","show-overflow-tooltip":""}),e(a,{prop:"status",label:"状态",width:"100",align:"center"}),e(a,{prop:"doneAt",label:"完工时间",width:"160"})]),_:1},8,["data"]),t[13]||(t[13]=p("h3",{class:"sec"},"五、签字确认",-1)),e(P,{column:4,border:"",size:"small"},{default:l(()=>[e(i,{label:"操作工"},{default:l(()=>[s.value.signs&&s.value.signs.operator?(d(),c("span",be,o(s.value.signs.operator.names)+"("+o(s.value.signs.operator.count)+"次,最近 "+o(s.value.signs.operator.latestTime)+")",1)):(d(),c("span",we,"待签"))]),_:1}),e(i,{label:"检验员"},{default:l(()=>[s.value.signs&&s.value.signs.inspector?(d(),c("span",fe,o(s.value.signs.inspector.names)+"("+o(s.value.signs.inspector.count)+"次,最近 "+o(s.value.signs.inspector.latestTime)+")",1)):(d(),c("span",_e,"待签"))]),_:1}),e(i,{label:"审核人"},{default:l(()=>[s.value.signs&&s.value.signs.auditor?(d(),c("span",he,o(s.value.signs.auditor.names)+"("+o(s.value.signs.auditor.count)+"次,最近 "+o(s.value.signs.auditor.latestTime)+")",1)):(d(),c("span",ge,"待签"))]),_:1}),e(i,{label:"批准人"},{default:l(()=>[...t[8]||(t[8]=[p("span",{class:"muted"},"手签",-1)])]),_:1})]),_:1})]),_:1})):w.value==="sn"&&u.value?(d(),N(A,{key:2,style:{"margin-top":"12px"}},{header:l(()=>[p("div",ye,[t[14]||(t[14]=p("span",{class:"t"},"成品追溯卡(SN 维度)",-1)),p("span",ke,o(u.value.sn),1)])]),default:l(()=>[e(P,{column:4,border:"",size:"small",style:{"margin-bottom":"14px"}},{default:l(()=>[e(i,{label:"SN"},{default:l(()=>[r(o(u.value.sn),1)]),_:1}),e(i,{label:"工单号"},{default:l(()=>[r(o(u.value.workOrderNo||"-"),1)]),_:1}),e(i,{label:"产品型号"},{default:l(()=>[r(o(u.value.productCode||"-"),1)]),_:1}),e(i,{label:"状态"},{default:l(()=>[r(o(u.value.status||"-"),1)]),_:1}),e(i,{label:"完工时间"},{default:l(()=>[r(o(u.value.doneAt||"-"),1)]),_:1}),e(i,{label:"生成时间"},{default:l(()=>[r(o(u.value.generatedAt),1)]),_:1})]),_:1}),t[16]||(t[16]=p("h3",{class:"sec"},"一、工序实绩",-1)),e(y,{data:u.value.processes||[],border:"",size:"small","empty-text":"暂无工序实绩"},{default:l(()=>[e(a,{prop:"stationNo",label:"工位",width:"90",align:"center"}),e(a,{prop:"processName",label:"工序","min-width":"160","show-overflow-tooltip":""}),e(a,{prop:"startAt",label:"开始",width:"150"}),e(a,{prop:"endAt",label:"结束",width:"150"}),e(a,{prop:"operator",label:"操作人","min-width":"100"}),e(a,{prop:"status",label:"状态",width:"90",align:"center"}),e(a,{label:"结果",width:"90",align:"center"},{default:l(({row:n})=>[e(E,{type:n.result==="NG"?"danger":"success",size:"small"},{default:l(()=>[r(o(n.result||"-"),1)]),_:2},1032,["type"])]),_:1})]),_:1},8,["data"]),t[17]||(t[17]=p("h3",{class:"sec"},"二、用料清单 · 序列号=是",-1)),e(y,{data:u.value.serialMaterials||[],border:"",size:"small","empty-text":"暂无序列号=是实绩"},{default:l(()=>[e(a,{prop:"materialCode",label:"图号","min-width":"140","show-overflow-tooltip":""}),e(a,{prop:"materialName",label:"名称","min-width":"150","show-overflow-tooltip":""}),e(a,{prop:"materialType",label:"类型",width:"100",align:"center"}),e(a,{prop:"spec",label:"规格","min-width":"120","show-overflow-tooltip":""}),e(a,{prop:"unit",label:"单位",width:"70",align:"center"}),e(a,{label:"物料SN","min-width":"220"},{default:l(({row:n})=>[r(o((n.snList||[]).join(" ")||"-"),1)]),_:1}),e(a,{prop:"qty",label:"数量",width:"80",align:"center"}),e(a,{prop:"stationNo",label:"装配工位",width:"90",align:"center"}),e(a,{prop:"operator",label:"装配人","min-width":"100"})]),_:1},8,["data"]),t[18]||(t[18]=p("h3",{class:"sec"},"三、用料清单 · 序列号=否",-1)),e(y,{data:u.value.batchMaterials||[],border:"",size:"small","empty-text":"暂无序列号=否实绩"},{default:l(()=>[e(a,{prop:"materialCode",label:"图号","min-width":"140","show-overflow-tooltip":""}),e(a,{prop:"materialName",label:"名称","min-width":"150","show-overflow-tooltip":""}),e(a,{prop:"materialType",label:"类型",width:"100",align:"center"}),e(a,{prop:"spec",label:"规格","min-width":"120","show-overflow-tooltip":""}),e(a,{prop:"unit",label:"单位",width:"70",align:"center"}),e(a,{prop:"batchNo",label:"批次号","min-width":"160","show-overflow-tooltip":""}),e(a,{prop:"qty",label:"数量",width:"80",align:"center"}),e(a,{prop:"stationNo",label:"装配工位",width:"90",align:"center"}),e(a,{prop:"operator",label:"装配人","min-width":"100"})]),_:1},8,["data"]),(u.value.torqueRows||[]).length?(d(),c("h3",Ne,"四、拧紧数据")):D("",!0),(u.value.torqueRows||[]).length?(d(),N(y,{key:1,data:u.value.torqueRows,border:"",size:"small"},{default:l(()=>[e(a,{prop:"screwNo",label:"螺丝编号",width:"110"}),e(a,{prop:"torque",label:"扭矩(N·m)",width:"110",align:"center"}),e(a,{prop:"angle",label:"角度(°)",width:"100",align:"center"}),e(a,{label:"结果",width:"90",align:"center"},{default:l(({row:n})=>[e(E,{type:n.result==="NG"?"danger":"success",size:"small"},{default:l(()=>[r(o(n.result||"-"),1)]),_:2},1032,["type"])]),_:1}),e(a,{prop:"operator",label:"操作人",width:"100"}),e(a,{prop:"time",label:"时间","min-width":"160"})]),_:1},8,["data"])):D("",!0),t[19]||(t[19]=p("h3",{class:"sec"},"五、签字确认",-1)),e(P,{column:4,border:"",size:"small"},{default:l(()=>[e(i,{label:"操作工"},{default:l(()=>[u.value.signs&&u.value.signs.operator?(d(),c("span",xe,o(u.value.signs.operator.names),1)):(d(),c("span",Ce,"待签"))]),_:1}),e(i,{label:"检验员"},{default:l(()=>[u.value.signs&&u.value.signs.inspector?(d(),c("span",Se,o(u.value.signs.inspector.names),1)):(d(),c("span",ze,"待签"))]),_:1}),e(i,{label:"审核人"},{default:l(()=>[u.value.signs&&u.value.signs.auditor?(d(),c("span",Ve,o(u.value.signs.auditor.names),1)):(d(),c("span",qe,"待签"))]),_:1}),e(i,{label:"批准人"},{default:l(()=>[...t[15]||(t[15]=[p("span",{class:"muted"},"手签",-1)])]),_:1})]),_:1})]),_:1})):w.value==="model"&&b.value?(d(),N(A,{key:3,style:{"margin-top":"12px"}},{header:l(()=>[p("div",Me,[t[20]||(t[20]=p("span",{class:"t"},"型号工单列表",-1)),p("span",Ae,o(b.value.productCode)+"("+o(b.value.productName||"-")+")",1)])]),default:l(()=>[e(P,{column:4,border:"",size:"small",style:{"margin-bottom":"14px"}},{default:l(()=>[e(i,{label:"工单总数"},{default:l(()=>[r(o(b.value.totalOrders),1)]),_:1}),e(i,{label:"计划总数"},{default:l(()=>[r(o(b.value.totalPlanQty),1)]),_:1}),e(i,{label:"完成总数"},{default:l(()=>[r(o(b.value.totalFinished),1)]),_:1}),e(i,{label:"筛选区间"},{default:l(()=>[r(o(W.value),1)]),_:1})]),_:1}),e(y,{data:I.value,border:"",size:"small","empty-text":"该时间范围内暂无工单"},{default:l(()=>[e(a,{prop:"no",label:"工单号","min-width":"180","show-overflow-tooltip":""}),e(a,{prop:"productCode",label:"产品型号",width:"140"}),e(a,{prop:"productName",label:"产品名称","min-width":"160","show-overflow-tooltip":""}),e(a,{prop:"status",label:"状态",width:"100",align:"center"}),e(a,{prop:"planStart",label:"计划开始",width:"150"}),e(a,{prop:"planEnd",label:"计划结束",width:"150"}),e(a,{prop:"quantity",label:"计划数",width:"90",align:"center"}),e(a,{prop:"finishedNum",label:"完成数",width:"90",align:"center"}),e(a,{prop:"createdAt",label:"创建时间",width:"160"}),e(a,{label:"操作",width:"100",align:"center",fixed:"right"},{default:l(({row:n})=>[e(q,{link:"",type:"primary",size:"small",onClick:Oe=>Z(n.no)},{default:l(()=>[...t[21]||(t[21]=[r("查看主卡",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})):(d(),N(A,{key:4,style:{"margin-top":"12px"}},{default:l(()=>[e(ae,{description:"请选择产品型号(或填写工单号 / 成品SN)后点击「查询」"})]),_:1}))]),e(ue,{data:se(ie),page:"ProcessCard"},null,8,["data"])],64)}}},je=te(Pe,[["__scopeId","data-v-407c7643"]]);export{je as default};