Files
bj_power/bj_power_wms_client/web/static/assets/Stocktake-YjnlyZRF.js
T
SunYF 047cdd9870 chore: 批量更新前端静态资源与界面文案
1. 更新多个项目的index.html引入的资源hash文件名
2. 替换BOM页面标题为物料清单,同步路由菜单文案
3. 为多个select组件添加placeholder提示文案
4. 重构MES布局,移除侧边抽屉菜单,添加页面标题
5. 新增/替换部分静态资源文件,删除旧的冗余资源文件
2026-08-28 17:42:50 +08:00

2 lines
7.6 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,d as B,a as e,w as t,D as A,l as E,p as Q,F as te,r as i,h as f,o as R,f as d,t as p,H as K,e as D,L as le,g as L,E as g,N as ae}from"./index-9NS-icag.js";import{r as V}from"./request-DS_8eNi1.js";import{b as M}from"./format-C9Ok6skr.js";import{d as oe,P as ne}from"./help-BMgMow4j.js";const se={__name:"Stocktake",setup(re){const U=Z(),I=f(!1),s=L({no:"",totalTargets:0});async function P(){I.value=!0;try{const o=await V.post("/stocktake/start",{operator:U});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{I.value=!1}}const _=L({targetId:"",scanQty:1}),N=f(!1),F=f(),b=f([]);async function x(){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}N.value=!0;try{const n=await V.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="",ae(()=>{var c;return(c=F.value)==null?void 0:c.focus()})}finally{N.value=!1}}const k=f(!0),$=f(!1),m=f(null);async function G(){if(!s.no){g.warning("请先发起盘点");return}$.value=!0;try{const o=await V.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{$.value=!1}}const w=f(""),H=f([]),S=f(!1);async function v(){S.value=!0;try{const o={};w.value.trim()&&(o.stocktakeNo=w.value.trim());const l=await V.get("/stocktake/query",{params:o});H.value=(l==null?void 0:l.list)||[]}finally{S.value=!1}}return(o,l)=>{const n=i("el-descriptions-item"),h=i("el-descriptions"),u=i("el-button"),c=i("el-card"),J=i("el-switch"),y=i("el-form-item"),T=i("el-form"),j=i("el-col"),C=i("el-input"),O=i("el-input-number"),r=i("el-table-column"),z=i("el-table"),W=i("el-row"),X=i("el-alert"),q=i("el-tag");return R(),ee(te,null,[B("div",null,[e(W,{gutter:12},{default:t(()=>[e(j,{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(Q(U)||"-"),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:I.value,disabled:!!s.no&&!m.value,onClick:P},{default:t(()=>[...l[5]||(l[5]=[d(" 发起盘点(冻结库存快照) ",-1)])]),_:1},8,["loading","disabled"])]),_:1}),e(c,{shadow:"never",header:"完成盘点"},{default:t(()=>[e(T,{"label-width":"120px"},{default:t(()=>[e(y,{label:"差异写回库存"},{default:t(()=>[e(J,{modelValue:k.value,"onUpdate:modelValue":l[0]||(l[0]=a=>k.value=a)},null,8,["modelValue"]),l[6]||(l[6]=B("span",{class:"tip"},"开启后按实盘差异修正库存",-1))]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"warning",loading:$.value,onClick:G},{default:t(()=>[...l[7]||(l[7]=[d("完成并生成差异",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1})]),_:1}),e(j,{span:14},{default:t(()=>[e(c,{shadow:"never",class:"mb12",header:"扫码快速盘点(回车即提交并清空)"},{default:t(()=>[s.no?E("",!0):(R(),A(C,{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(T,{inline:"",onSubmit:K(x,["prevent"])},{default:t(()=>[e(y,{label:"目标编号"},{default:t(()=>[e(C,{ref_key:"idRef",ref:F,modelValue:_.targetId,"onUpdate:modelValue":l[2]||(l[2]=a=>_.targetId=a),clearable:"",autofocus:"",placeholder:"批次号 / SN",style:{width:"220px"},onKeyup:D(x,["enter"])},null,8,["modelValue"])]),_:1}),e(y,{label:"实盘数量"},{default:t(()=>[e(O,{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:N.value,onClick:x},{default:t(()=>[...l[9]||(l[9]=[d("提交",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),e(z,{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})=>[B("span",{class:le({bad:a.diffQty!==0})},p(a.diffQty),3)]),_:1})]),_:1},8,["data"])]),_:1})]),_:1})]),_:1}),m.value?(R(),A(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(z,{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(q,{type:a.diffQty>0?"success":"danger",size:"small"},{default:t(()=>[d(p(a.diffQty),1)]),_:2},1032,["type"])]),_:1})]),_:1},8,["data"])]),_:1})):E("",!0),e(c,{shadow:"never",header:"历史盘点单查询"},{default:t(()=>[e(T,{inline:"",onSubmit:K(v,["prevent"])},{default:t(()=>[e(y,{label:"盘点单号"},{default:t(()=>[e(C,{modelValue:w.value,"onUpdate:modelValue":l[4]||(l[4]=a=>w.value=a),placeholder:"留空查最近全部",clearable:"",style:{width:"240px"},onKeyup:D(v,["enter"])},null,8,["modelValue"])]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"primary",loading:S.value,onClick:v},{default:t(()=>[...l[10]||(l[10]=[d("查询",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),e(z,{data:H.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(q,{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(Q(M)(a.createdAt)),1)]),_:1}),e(r,{label:"完成时间",width:"160",align:"center"},{default:t(({row:a})=>[d(p(Q(M)(a.finishedAt)),1)]),_:1})]),_:1},8,["data"])]),_:1})]),e(ne,{data:Q(oe)},null,8,["data"])],64)}}},fe=Y(se,[["__scopeId","data-v-bb344ff6"]]);export{fe as default};