Files
bj_power/bj_power_wms_client/web/static/assets/Outbound-DvjCYsMG.js
T
SunYF e82b744bbd build: update frontend build asset hashes
this commit updates all the static asset file hashes in index.html templates, and adds/removes the corresponding chunk files, which is typical after a frontend project rebuild to deploy updated static resources.
2026-08-29 08:11:44 +08:00

8 lines
4.8 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 E,I as K,c as B,d as D,a as t,w as n,D as C,p as M,F as T,r as i,h as $,J as I,o as m,H as Z,e as j,f as g,K as A,t as y,L as H,E as h,g as P,M as R,m as U}from"./index-BhhFt5Di.js";import{r as z}from"./request-By4ij0Lz.js";import{a as J,P as L}from"./help-DfzkTHcJ.js";const G={key:1,style:{color:"#67c23a"}},W={__name:"Outbound",setup(X){const v=P({orderNo:""}),k=K(),f=$(""),N=$(!1),S=$(!1),_=$([]),O=U(()=>_.value.filter(e=>e.status!=="领料完结"));function x(e){return Math.max((e.totalQty||0)-(e.outQty||0),0)}async function F(e){const l=x(e);if(l<=0)return;const d=await z.get("/stock/query",{params:{type:"batch",materialCode:e.materialCode,page:1,pageSize:200}}),p=((d==null?void 0:d.batch)||[]).filter(a=>a.qualityStatus==="合格"&&a.zoneCode==="Z02").sort((a,r)=>String(a.batchNo).localeCompare(String(r.batchNo))),c=[];let u=l;for(const a of p){if(u<=0)break;const r=(a.quantity||0)-(a.lockedQty||0);if(r<=0)continue;const o=Math.min(r,u);c.push({batchNo:a.batchNo,qty:o,zoneCode:a.zoneCode}),u-=o}if(!c.length){h.warning(`物料 ${e.materialCode} 在合格区(Z02)无可用批次库存`);return}if(u>0){h.error(`可用量不足:缺口 ${l}Z02 仅可凑 ${l-u},还差 ${u}`);return}const w=c.map(a=>`· 批次 ${a.batchNo} 出库 ${a.qty}`).join(`
`);await R.confirm(`工单 ${e.orderNo} 物料 ${e.materialCode}
缺口 ${l},按 FIFO 分配如下:
${w}
操作人:${k}${f.value?`
目标口:${f.value}`:""}`,"确认自动分配出库",{type:"warning",confirmButtonText:"确认出库",cancelButtonText:"取消"});const s=[];let b="";for(const a of c){const r=await z.post("/outbound/create",{orderNo:e.orderNo,materialCode:e.materialCode,batchNo:a.batchNo,qty:a.qty,operator:k,targetDock:f.value.trim()||void 0});r!=null&&r.outboundNo&&s.push(r.outboundNo),b=(r==null?void 0:r.status)||b}const V=b==="领料完结";h.success(`出库完成:出库单号 ${s.join("、")};该物料${V?"已":"未"}领料完结`),await q()}function Q(e){return e==="领料完结"?"success":e==="进行中"?"primary":"info"}async function q(){if(!v.orderNo.trim()){h.warning("请输入工单号");return}N.value=!0;try{const e=await z.get("/ledger/query",{params:{orderNo:v.orderNo.trim(),page:1,pageSize:100}});_.value=(e==null?void 0:e.list)||[],S.value=!0,_.value.length||h.info("该工单暂无台账记录")}finally{N.value=!1}}return(e,l)=>{const d=i("el-input"),p=i("el-form-item"),c=i("el-button"),u=i("el-form"),w=i("el-card"),s=i("el-table-column"),b=i("el-tag"),V=i("el-table"),a=i("el-empty"),r=I("loading");return m(),B(T,null,[D("div",null,[t(w,{shadow:"never",class:"mb12"},{default:n(()=>[t(u,{inline:"","label-width":"90px",onSubmit:l[2]||(l[2]=Z(()=>{},["prevent"]))},{default:n(()=>[t(p,{label:"工单号"},{default:n(()=>[t(d,{modelValue:v.orderNo,"onUpdate:modelValue":l[0]||(l[0]=o=>v.orderNo=o),placeholder:"输入工单号回车查询",clearable:"",autofocus:"",style:{width:"260px"},onKeyup:j(q,["enter"])},null,8,["modelValue"])]),_:1}),t(p,{label:"操作人"},{default:n(()=>[t(d,{"model-value":M(k),disabled:"",style:{width:"160px"}},null,8,["model-value"])]),_:1}),t(p,{label:"目标工位"},{default:n(()=>[t(d,{modelValue:f.value,"onUpdate:modelValue":l[1]||(l[1]=o=>f.value=o),placeholder:"可选,如 DOCK-A",clearable:"",style:{width:"180px"}},null,8,["modelValue"])]),_:1}),t(p,null,{default:n(()=>[t(c,{type:"primary",loading:N.value,onClick:q},{default:n(()=>[...l[3]||(l[3]=[g("查询台账",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1}),S.value?(m(),C(w,{key:0,shadow:"never"},{header:n(()=>[g(" 台账明细(共 "+y(_.value.length)+" 行,待补 "+y(O.value.length)+" 行) ",1)]),default:n(()=>[A((m(),C(V,{data:_.value,border:""},{default:n(()=>[t(s,{prop:"orderNo",label:"工单号","min-width":"140"}),t(s,{prop:"materialCode",label:"物料编码","min-width":"150"}),t(s,{prop:"materialName",label:"物料名称","min-width":"140"},{default:n(({row:o})=>[g(y(o.materialName||"-"),1)]),_:1}),t(s,{prop:"totalQty",label:"需求总量",width:"100",align:"center"}),t(s,{prop:"outQty",label:"已出库",width:"90",align:"center"}),t(s,{label:"缺口",width:"90",align:"center"},{default:n(({row:o})=>[D("span",{class:H({gap:x(o)>0})},y(x(o)),3)]),_:1}),t(s,{label:"状态",width:"110",align:"center"},{default:n(({row:o})=>[t(b,{type:Q(o.status),size:"small"},{default:n(()=>[g(y(o.status),1)]),_:2},1032,["type"])]),_:1}),t(s,{label:"操作",width:"140",align:"center"},{default:n(({row:o})=>[o.status!=="领料完结"?(m(),C(c,{key:0,type:"primary",size:"small",onClick:Y=>F(o)},{default:n(()=>[...l[4]||(l[4]=[g("一键分配出库",-1)])]),_:1},8,["onClick"])):(m(),B("span",G,"已完结"))]),_:1})]),_:1},8,["data"])),[[r,N.value]])]),_:1})):(m(),C(a,{key:1,description:"请先按工单号查询物料台账"}))]),t(L,{data:M(J)},null,8,["data"])],64)}}},oe=E(W,[["__scopeId","data-v-89082e0f"]]);export{oe as default};