Files
bj_power/bj_power_wms_client/web/static/assets/Stocktake-BMfKmR4q.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
7.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
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 Y,I as Z,c as ee,a as e,w as t,D as E,l as H,r as i,h as f,o as z,f as d,t as p,p as B,d as K,H as D,e as F,L as te,g as L,E as g,N as le}from"./index-VJa6cW1h.js";import{r as Q}from"./request-43HjEGU6.js";import{b as M}from"./format-C9Ok6skr.js";const ae={__name:"Stocktake",setup(oe){const R=Z(),V=f(!1),s=L({no:"",totalTargets:0});async function G(){V.value=!0;try{const o=await Q.post("/stocktake/start",{operator:R});s.no=(o==null?void 0:o.stocktakeNo)||"",s.totalTargets=(o==null?void 0:o.totalTargets)||0,g.success(`盘点已发起:盘点单号 ${s.no},目标 ${s.totalTargets} 项`),await v()}finally{V.value=!1}}const _=L({targetId:"",scanQty:1}),I=f(!1),U=f(),b=f([]);async function N(){if(!s.no){g.warning("请先发起或填写盘点单号");return}const o=_.targetId.trim();if(!o){g.warning("请扫入目标编号(批次号或 SN)");return}const l=Number(_.scanQty);if(!Number.isInteger(l)||l<0){g.warning("实盘数量需为非负整数");return}I.value=!0;try{const n=await Q.post("/stocktake/record",{stocktakeNo:s.no,targetId:o,scanQty:l}),h=b.value.findIndex(c=>c.targetId===(n==null?void 0:n.targetId)),u={targetId:(n==null?void 0:n.targetId)??o,bookQty:(n==null?void 0:n.bookQty)??"-",scannedQty:(n==null?void 0:n.scannedQty)??l,diffQty:(n==null?void 0:n.diffQty)??l-((n==null?void 0:n.bookQty)??0)};h>=0?b.value.splice(h,1,u):b.value.unshift(u),g.success(`已记录 ${u.targetId}:账面 ${u.bookQty},实盘 ${u.scannedQty},差异 ${u.diffQty}`),_.targetId="",le(()=>{var c;return(c=U.value)==null?void 0:c.focus()})}finally{I.value=!1}}const k=f(!0),x=f(!1),m=f(null);async function J(){if(!s.no){g.warning("请先发起盘点");return}x.value=!0;try{const o=await Q.post("/stocktake/finish",{stocktakeNo:s.no,adjust:k.value});m.value=o||{},g.success(`盘点完成:已盘 ${(o==null?void 0:o.counted)??0} 项,未盘 ${(o==null?void 0:o.uncounted)??0} 项`+(k.value?",差异已写回库存":"")),b.value=[],await v()}finally{x.value=!1}}const w=f(""),j=f([]),$=f(!1);async function v(){$.value=!0;try{const o={};w.value.trim()&&(o.stocktakeNo=w.value.trim());const l=await Q.get("/stocktake/query",{params:o});j.value=(l==null?void 0:l.list)||[]}finally{$.value=!1}}return(o,l)=>{const n=i("el-descriptions-item"),h=i("el-descriptions"),u=i("el-button"),c=i("el-card"),O=i("el-switch"),y=i("el-form-item"),S=i("el-form"),q=i("el-col"),T=i("el-input"),P=i("el-input-number"),r=i("el-table-column"),C=i("el-table"),W=i("el-row"),X=i("el-alert"),A=i("el-tag");return z(),ee("div",null,[e(W,{gutter:12},{default:t(()=>[e(q,{span:10},{default:t(()=>[e(c,{shadow:"never",class:"mb12",header:"发起盘点"},{default:t(()=>[e(h,{column:1,border:"",size:"small"},{default:t(()=>[e(n,{label:"操作人"},{default:t(()=>[d(p(B(R)||"-"),1)]),_:1}),e(n,{label:"盘点单号"},{default:t(()=>[d(p(s.no||"未发起"),1)]),_:1}),e(n,{label:"目标数量"},{default:t(()=>[d(p(s.no?`${s.totalTargets} 项`:"-"),1)]),_:1})]),_:1}),e(u,{type:"primary",class:"mt12",loading:V.value,disabled:!!s.no&&!m.value,onClick:G},{default:t(()=>[...l[5]||(l[5]=[d(" 发起盘点(冻结库存快照) ",-1)])]),_:1},8,["loading","disabled"])]),_:1}),e(c,{shadow:"never",header:"完成盘点"},{default:t(()=>[e(S,{"label-width":"120px"},{default:t(()=>[e(y,{label:"差异写回库存"},{default:t(()=>[e(O,{modelValue:k.value,"onUpdate:modelValue":l[0]||(l[0]=a=>k.value=a)},null,8,["modelValue"]),l[6]||(l[6]=K("span",{class:"tip"},"开启后按实盘差异修正库存",-1))]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"warning",loading:x.value,onClick:J},{default:t(()=>[...l[7]||(l[7]=[d("完成并生成差异",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1})]),_:1}),e(q,{span:14},{default:t(()=>[e(c,{shadow:"never",class:"mb12",header:"扫码记录区(回车即提交并清空)"},{default:t(()=>[s.no?H("",!0):(z(),E(T,{key:0,modelValue:s.no,"onUpdate:modelValue":l[1]||(l[1]=a=>s.no=a),placeholder:"也可粘贴已有进行中的盘点单号",clearable:""},{prepend:t(()=>[...l[8]||(l[8]=[d("盘点单号",-1)])]),_:1},8,["modelValue"])),e(S,{inline:"",onSubmit:D(N,["prevent"])},{default:t(()=>[e(y,{label:"目标编号"},{default:t(()=>[e(T,{ref_key:"idRef",ref:U,modelValue:_.targetId,"onUpdate:modelValue":l[2]||(l[2]=a=>_.targetId=a),clearable:"",autofocus:"",placeholder:"批次号 / SN",style:{width:"220px"},onKeyup:F(N,["enter"])},null,8,["modelValue"])]),_:1}),e(y,{label:"实盘数量"},{default:t(()=>[e(P,{modelValue:_.scanQty,"onUpdate:modelValue":l[3]||(l[3]=a=>_.scanQty=a),min:0,step:1,"step-strictly":"",style:{width:"120px"}},null,8,["modelValue"])]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"primary",loading:I.value,onClick:N},{default:t(()=>[...l[9]||(l[9]=[d("提交",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),e(C,{data:b.value,border:"",size:"small","max-height":"300","empty-text":"尚无扫码记录"},{default:t(()=>[e(r,{prop:"targetId",label:"目标编号","min-width":"170"}),e(r,{prop:"bookQty",label:"账面数",width:"90",align:"center"}),e(r,{prop:"scannedQty",label:"实盘数",width:"90",align:"center"}),e(r,{label:"差异",width:"90",align:"center"},{default:t(({row:a})=>[K("span",{class:te({bad:a.diffQty!==0})},p(a.diffQty),3)]),_:1})]),_:1},8,["data"])]),_:1})]),_:1})]),_:1}),m.value?(z(),E(c,{key:0,shadow:"never",class:"mb12",header:"差异明细(diffs"},{default:t(()=>[e(X,{type:"info",closable:!1,title:`盘点单 ${m.value.stocktakeNo}:已盘 ${m.value.counted} 项 / 未盘 ${m.value.uncounted}${m.value.adjusted?",差异已写回库存":""}`,style:{"margin-bottom":"10px"}},null,8,["title"]),e(C,{data:m.value.diffs||[],border:"",size:"small","empty-text":"无差异,账实相符"},{default:t(()=>[e(r,{prop:"targetId",label:"目标编号","min-width":"190"}),e(r,{prop:"type",label:"类型",width:"100",align:"center"},{default:t(({row:a})=>[d(p(a.type==="BATCH"?"批次":"SN"),1)]),_:1}),e(r,{prop:"bookQty",label:"账面数",width:"100",align:"center"}),e(r,{prop:"scannedQty",label:"实盘数",width:"100",align:"center"}),e(r,{prop:"diffQty",label:"差异",width:"100",align:"center"},{default:t(({row:a})=>[e(A,{type:a.diffQty>0?"success":"danger",size:"small"},{default:t(()=>[d(p(a.diffQty),1)]),_:2},1032,["type"])]),_:1})]),_:1},8,["data"])]),_:1})):H("",!0),e(c,{shadow:"never",header:"历史盘点单查询"},{default:t(()=>[e(S,{inline:"",onSubmit:D(v,["prevent"])},{default:t(()=>[e(y,{label:"盘点单号"},{default:t(()=>[e(T,{modelValue:w.value,"onUpdate:modelValue":l[4]||(l[4]=a=>w.value=a),placeholder:"留空查最近全部",clearable:"",style:{width:"240px"},onKeyup:F(v,["enter"])},null,8,["modelValue"])]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"primary",loading:$.value,onClick:v},{default:t(()=>[...l[10]||(l[10]=[d("查询",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),e(C,{data:j.value,border:"",size:"small","empty-text":"暂无盘点记录"},{default:t(()=>[e(r,{prop:"stocktakeNo",label:"盘点单号","min-width":"200"}),e(r,{prop:"operator",label:"操作人",width:"110",align:"center"},{default:t(({row:a})=>[d(p(a.operator||"-"),1)]),_:1}),e(r,{prop:"totalTargets",label:"目标数",width:"90",align:"center"}),e(r,{label:"状态",width:"110",align:"center"},{default:t(({row:a})=>[e(A,{type:a.status==="已完成"?"success":"primary",size:"small"},{default:t(()=>[d(p(a.status),1)]),_:2},1032,["type"])]),_:1}),e(r,{label:"发起时间",width:"160",align:"center"},{default:t(({row:a})=>[d(p(B(M)(a.createdAt)),1)]),_:1}),e(r,{label:"完成时间",width:"160",align:"center"},{default:t(({row:a})=>[d(p(B(M)(a.finishedAt)),1)]),_:1})]),_:1},8,["data"])]),_:1})])}}},ie=Y(ae,[["__scopeId","data-v-7156950b"]]);export{ie as default};