Files
bj_power/bj_power_wms_client/web/static/assets/Package-heKgWJZs.js
T
SunYF a2afd2f6dc feat: 五项目业务实现并对接完成
- MES(B): 工单/BOM/备料/工序字典/PLC下发/拧紧/扫码报工/半成品/AGV/追溯逻辑,WMS与海康RCS客户端,看板Redis缓存API(概览/设备/进度/报警/趋势)+SSE
- WMS(C): JWT滑动续签、Excel导入、盘点、内部API、种子数据、独立Postgres配置
- WMS客户端(E): Go网关8891反向代理+内嵌Vue3十页
- 工位终端(D): SQLite本地缓存+模拟拧紧源+内嵌Vue3页面
- Dashboard(A): 看板数据改接MES内部缓存API,SSE实时刷新+vite代理
- 清理各项目球形磨遗留代码,新增部署手册.md
2026-08-27 19:50:57 +08:00

2 lines
5.2 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 Q,I as W,i as X,c as U,a as t,w as o,h as d,g as q,r as n,J as Y,o as _,H as h,F as Z,k as j,D as E,p as F,e as I,d as S,f as u,t as f,K as ee,E as k}from"./index-VJa6cW1h.js";import{r as C}from"./request-43HjEGU6.js";import{b as te}from"./format-C9Ok6skr.js";const le={style:{"margin-bottom":"8px"}},ae={class:"pager"},oe={__name:"Package",setup(ne){const V=d([]),z=W();X(async()=>{try{const a=await C.get("/material/list");V.value=Array.isArray(a)?a:(a==null?void 0:a.list)||[]}catch{}await v()});const r=q({boxNo:"",materialCode:""}),m=d(""),i=d([]),y=d(!1);function M(){for(let a of String(m.value).split(/\s+/)){const e=a.trim();e&&!i.value.includes(e)&&i.value.push(e)}m.value=""}function J(a){i.value.splice(a,1)}async function P(){if(!r.boxNo.trim()){k.warning("请输入箱号");return}if(!i.value.length){k.warning("请扫码录入 SN(回车追加)");return}y.value=!0;try{await C.post("/package/bind",{boxNo:r.boxNo.trim(),materialCode:r.materialCode||void 0,snList:[...i.value],operator:z}),k.success(`绑定成功:箱号 ${r.boxNo.trim()}${i.value.length} 个 SN`),i.value=[],m.value="",r.boxNo="",p.current=1,await v()}finally{y.value=!1}}const w=d(""),K=d([]),A=d(0),b=d(!1),p=q({current:1,size:10});function T(a){try{const e=JSON.parse(a||"[]");return Array.isArray(e)?e.join(", "):String(a)}catch{return String(a||"-")}}async function v(){b.value=!0;try{const a=await C.get("/package/query",{params:{boxNo:w.value.trim(),page:p.current,pageSize:p.size}});K.value=(a==null?void 0:a.list)||[],A.value=(a==null?void 0:a.total)||0}finally{b.value=!1}}function x(){p.current=1,v()}return(a,e)=>{const g=n("el-input"),c=n("el-form-item"),H=n("el-option"),O=n("el-select"),B=n("el-form"),s=n("el-table-column"),N=n("el-button"),L=n("el-table"),$=n("el-card"),R=n("el-pagination"),G=Y("loading");return _(),U("div",null,[t($,{shadow:"never",class:"mb12",header:"箱号绑定(连续扫码 SN"},{default:o(()=>[t(B,{inline:"","label-width":"90px",onSubmit:e[2]||(e[2]=h(()=>{},["prevent"]))},{default:o(()=>[t(c,{label:"箱号"},{default:o(()=>[t(g,{modelValue:r.boxNo,"onUpdate:modelValue":e[0]||(e[0]=l=>r.boxNo=l),placeholder:"扫描或输入箱号",clearable:"",style:{width:"200px"}},null,8,["modelValue"])]),_:1}),t(c,{label:"物料"},{default:o(()=>[t(O,{modelValue:r.materialCode,"onUpdate:modelValue":e[1]||(e[1]=l=>r.materialCode=l),filterable:"",clearable:"",placeholder:"可选",style:{width:"240px"}},{default:o(()=>[(_(!0),U(Z,null,j(V.value,l=>(_(),E(H,{key:l.id,value:l.code,label:`${l.code} ${l.name||""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:"操作人"},{default:o(()=>[t(g,{"model-value":F(z),disabled:"",style:{width:"140px"}},null,8,["model-value"])]),_:1})]),_:1}),t(g,{modelValue:m.value,"onUpdate:modelValue":e[3]||(e[3]=l=>m.value=l),type:"textarea",rows:3,autofocus:"",placeholder:"连续扫描 SN,每次回车追加(可一次多条,空白分隔)",style:{"max-width":"560px","margin-bottom":"8px"},onKeydown:I(h(M,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),S("div",le,[e[6]||(e[6]=u("待绑定 SN",-1)),S("b",null,f(i.value.length),1),e[7]||(e[7]=u(" 条",-1))]),t(L,{data:i.value.map((l,D)=>({i:D,v:l})),size:"small",border:"","max-height":"240","empty-text":"暂无 SN",style:{"max-width":"760px"}},{default:o(()=>[t(s,{type:"index",label:"#",width:"56",align:"center"}),t(s,{prop:"v",label:"SN 序列号","min-width":"200"}),t(s,{label:"操作",width:"80",align:"center"},{default:o(({row:l})=>[t(N,{link:"",type:"danger",size:"small",onClick:D=>J(l.i)},{default:o(()=>[...e[8]||(e[8]=[u("移除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"]),t(N,{type:"primary",class:"mt12",loading:y.value,onClick:P},{default:o(()=>[...e[9]||(e[9]=[u("确认绑定",-1)])]),_:1},8,["loading"])]),_:1}),t($,{shadow:"never",header:"包装查询"},{default:o(()=>[t(B,{inline:"",onSubmit:h(x,["prevent"])},{default:o(()=>[t(c,{label:"箱号"},{default:o(()=>[t(g,{modelValue:w.value,"onUpdate:modelValue":e[4]||(e[4]=l=>w.value=l),placeholder:"按箱号模糊查询",clearable:"",style:{width:"220px"},onKeyup:I(x,["enter"])},null,8,["modelValue"])]),_:1}),t(c,null,{default:o(()=>[t(N,{type:"primary",loading:b.value,onClick:x},{default:o(()=>[...e[10]||(e[10]=[u("查询",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),ee((_(),E(L,{data:K.value,border:"",size:"small","empty-text":"暂无包装记录"},{default:o(()=>[t(s,{prop:"boxNo",label:"箱号","min-width":"150"}),t(s,{label:"SN 列表","min-width":"300"},{default:o(({row:l})=>[u(f(T(l.snList)),1)]),_:1}),t(s,{prop:"quantity",label:"SN 数量",width:"90",align:"center"}),t(s,{prop:"materialCode",label:"物料编码","min-width":"130"},{default:o(({row:l})=>[u(f(l.materialCode||"-"),1)]),_:1}),t(s,{prop:"operator",label:"操作人",width:"100",align:"center"},{default:o(({row:l})=>[u(f(l.operator||"-"),1)]),_:1}),t(s,{label:"创建时间",width:"160",align:"center"},{default:o(({row:l})=>[u(f(F(te)(l.createdAt)),1)]),_:1})]),_:1},8,["data"])),[[G,b.value]]),S("div",ae,[t(R,{background:"",layout:"total, prev, pager, next",total:A.value,"current-page":p.current,"page-size":p.size,onCurrentChange:e[5]||(e[5]=l=>{p.current=l,v()})},null,8,["total","current-page","page-size"])])]),_:1})])}}},ue=Q(oe,[["__scopeId","data-v-54bf0b78"]]);export{ue as default};