Files
bj_power/bj_power_wms_client/web/static/assets/Inbound-DGRjaxp8.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

2 lines
8.8 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 ue,i as ie,c as x,a as t,w as a,p as se,F as C,h as d,r as u,o as s,k as q,D as _,f as c,l as T,e as re,H as de,d as V,t as $,g as H,E as g,I as j}from"./index-BhhFt5Di.js";import{r as z}from"./request-By4ij0Lz.js";import{h as pe,P as me}from"./help-DfzkTHcJ.js";const ce={style:{"margin-bottom":"8px"}},fe={style:{"margin-top":"12px"}},be={style:{"margin-top":"12px"}},ve={__name:"Inbound",setup(ye){const S=d([]),D=d([]);ie(async()=>{const[o,e]=await Promise.all([z.get("/material/list"),z.get("/zone/list")]);S.value=Array.isArray(o)?o:(o==null?void 0:o.list)||[],D.value=Array.isArray(e)?e:(e==null?void 0:e.list)||[]});const M=d(),U=d(!1),E=d(""),n=H({materialCode:"",batchNo:"",quantity:1,zoneCode:"",productionDate:"",supplier:""}),G={materialCode:[{required:!0,message:"请选择物料",trigger:"change"}],quantity:[{required:!0,message:"请输入数量",trigger:"blur"}]};async function J(){if(await M.value.validate(),!n.quantity||n.quantity<=0){g.warning("数量必须大于 0");return}U.value=!0;try{const o=await z.post("/inbound/create",{inboundType:"purchase",materialCode:n.materialCode,batchNo:n.batchNo.trim(),quantity:n.quantity,zoneCode:n.zoneCode,productionDate:n.productionDate,supplier:n.supplier.trim(),operator:j()});E.value=(o==null?void 0:o.inboundNo)||"",g.success(`入库成功:入库单号 ${(o==null?void 0:o.inboundNo)||""},数量 ${(o==null?void 0:o.quantity)??n.quantity}`),n.batchNo="",n.quantity=1}finally{U.value=!1}}const h=d(""),F=d(!1),r=d([]),b=H({materialCode:"",zoneCode:""});function O(){const o=String(h.value).split(/\s+/);for(let e of o){const p=e.trim();p&&(r.value.includes(p)||r.value.push(p))}h.value=""}function Q(o){r.value.splice(o,1)}async function W(){if(!b.materialCode){g.warning("请选择物料");return}if(!r.value.length){g.warning("请先扫码录入 SN(输入后回车追加)");return}F.value=!0;try{const o=await z.post("/inbound/create",{inboundType:"purchase",materialCode:b.materialCode,zoneCode:b.zoneCode,snList:[...r.value],operator:j()});g.success(`入库成功:入库单号 ${(o==null?void 0:o.inboundNo)||""}SN 共 ${r.value.length} 条`),r.value=[],h.value=""}finally{F.value=!1}}const N=d(),I=d([]),R=d(!1),v=d(null);function X(o,e){I.value=e.slice(-1)}function Z(o){N.value.clearFiles();const e=o[0];e&&N.value.handleStart(e)}async function ee(){var y,i,w;const o=I.value[0]||((i=(y=N.value)==null?void 0:y.uploadFiles)==null?void 0:i[0]),e=o==null?void 0:o.raw;if(!e){g.warning("请先选择 .xlsx 文件");return}const p=new FormData;p.append("file",e),R.value=!0;try{const m=await z.post("/inbound/batch-excel",p);v.value=m||{},g.success(`导入完成:共 ${(m==null?void 0:m.total)??0} 行,成功 ${(m==null?void 0:m.success)??0} 行`),(w=N.value)==null||w.clearFiles(),I.value=[]}finally{R.value=!1}}return(o,e)=>{const p=u("el-option"),y=u("el-select"),i=u("el-form-item"),w=u("el-input"),m=u("el-input-number"),le=u("el-date-picker"),k=u("el-button"),A=u("el-form"),L=u("el-alert"),B=u("el-tab-pane"),f=u("el-table-column"),Y=u("el-table"),te=u("el-upload"),ae=u("el-divider"),K=u("el-tag"),oe=u("el-tabs"),ne=u("el-card");return s(),x(C,null,[t(ne,{shadow:"never"},{default:a(()=>[t(oe,null,{default:a(()=>[t(B,{label:"结构件入库"},{default:a(()=>[t(A,{ref_key:"batchRef",ref:M,model:n,rules:G,"label-width":"110px",style:{"max-width":"560px"}},{default:a(()=>[t(i,{label:"物料",prop:"materialCode"},{default:a(()=>[t(y,{modelValue:n.materialCode,"onUpdate:modelValue":e[0]||(e[0]=l=>n.materialCode=l),filterable:"",placeholder:"选择物料编码",style:{width:"100%"}},{default:a(()=>[(s(!0),x(C,null,q(S.value,l=>(s(),_(p,{key:l.id,value:l.code,label:`${l.code} ${l.name||""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"批次号"},{default:a(()=>[t(w,{modelValue:n.batchNo,"onUpdate:modelValue":e[1]||(e[1]=l=>n.batchNo=l),placeholder:"留空则自动生成",clearable:""},null,8,["modelValue"])]),_:1}),t(i,{label:"数量",prop:"quantity"},{default:a(()=>[t(m,{modelValue:n.quantity,"onUpdate:modelValue":e[2]||(e[2]=l=>n.quantity=l),min:1,step:1,"step-strictly":"",style:{width:"100%"}},null,8,["modelValue"])]),_:1}),t(i,{label:"区域"},{default:a(()=>[t(y,{modelValue:n.zoneCode,"onUpdate:modelValue":e[3]||(e[3]=l=>n.zoneCode=l),placeholder:"选择库区",clearable:"",style:{width:"100%"}},{default:a(()=>[(s(!0),x(C,null,q(D.value,l=>(s(),_(p,{key:l.id,value:l.zoneCode,label:`${l.zoneCode} ${l.zoneName||""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"生产日期"},{default:a(()=>[t(le,{modelValue:n.productionDate,"onUpdate:modelValue":e[4]||(e[4]=l=>n.productionDate=l),type:"date","value-format":"YYYY-MM-DD",placeholder:"选择生产日期",style:{width:"100%"}},null,8,["modelValue"])]),_:1}),t(i,{label:"供应商"},{default:a(()=>[t(w,{modelValue:n.supplier,"onUpdate:modelValue":e[5]||(e[5]=l=>n.supplier=l),placeholder:"供应商名称",clearable:""},null,8,["modelValue"])]),_:1}),t(i,null,{default:a(()=>[t(k,{type:"primary",loading:U.value,onClick:J},{default:a(()=>[...e[10]||(e[10]=[c("提交入库",-1)])]),_:1},8,["loading"])]),_:1})]),_:1},8,["model"]),E.value?(s(),_(L,{key:0,type:"success",closable:!1,title:`最近入库单号:${E.value}`,style:{"max-width":"560px"}},null,8,["title"])):T("",!0)]),_:1}),t(B,{label:`精密件 SN 入库${r.value.length?`(已扫 ${r.value.length}`:""}`},{default:a(()=>[t(A,{"label-width":"110px",style:{"max-width":"680px"}},{default:a(()=>[t(i,{label:"物料"},{default:a(()=>[t(y,{modelValue:b.materialCode,"onUpdate:modelValue":e[6]||(e[6]=l=>b.materialCode=l),filterable:"",placeholder:"选择物料编码",style:{width:"100%"}},{default:a(()=>[(s(!0),x(C,null,q(S.value,l=>(s(),_(p,{key:l.id,value:l.code,label:`${l.code} ${l.name||""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"区域"},{default:a(()=>[t(y,{modelValue:b.zoneCode,"onUpdate:modelValue":e[7]||(e[7]=l=>b.zoneCode=l),placeholder:"选择库区(可空)",clearable:"",style:{width:"100%"}},{default:a(()=>[(s(!0),x(C,null,q(D.value,l=>(s(),_(p,{key:l.id,value:l.zoneCode,label:`${l.zoneCode} ${l.zoneName||""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"扫码录入"},{default:a(()=>[t(w,{modelValue:h.value,"onUpdate:modelValue":e[8]||(e[8]=l=>h.value=l),type:"textarea",rows:4,autofocus:"",placeholder:"扫入或粘贴 SN 后按回车追加一行(支持一次多条,空白分隔)",onKeydown:re(de(O,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"])]),_:1})]),_:1}),V("div",ce,[e[11]||(e[11]=c(" 已录入 ",-1)),V("b",null,$(r.value.length),1),e[12]||(e[12]=c(" 条 SN ",-1))]),t(Y,{data:r.value.map((l,P)=>({i:P,v:l})),size:"small",border:"","max-height":"320","empty-text":"暂无 SN"},{default:a(()=>[t(f,{type:"index",label:"#",width:"56",align:"center"}),t(f,{prop:"v",label:"SN 序列号","min-width":"220"}),t(f,{label:"操作",width:"80",align:"center"},{default:a(({row:l})=>[t(k,{link:"",type:"danger",size:"small",onClick:P=>Q(l.i)},{default:a(()=>[...e[13]||(e[13]=[c("删除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"]),V("div",fe,[t(k,{type:"primary",loading:F.value,onClick:W},{default:a(()=>[...e[14]||(e[14]=[c("提交入库",-1)])]),_:1},8,["loading"]),t(k,{onClick:e[9]||(e[9]=l=>r.value=[])},{default:a(()=>[...e[15]||(e[15]=[c("清空列表",-1)])]),_:1})])]),_:1},8,["label"]),t(B,{label:"Excel 导入"},{default:a(()=>[t(L,{type:"info",closable:!1,title:"列头顺序(首行忽略):物料编码 | 批次号(可空自动生成) | 数量 | 生产日期 | 供应商 | 区域",style:{"max-width":"760px","margin-bottom":"14px"}}),t(te,{ref_key:"uploadRef",ref:N,drag:"",accept:".xlsx",limit:1,"auto-upload":!1,"on-change":X,"on-exceed":Z},{default:a(()=>[...e[16]||(e[16]=[V("div",{class:"dropzone"},"将 .xlsx 文件拖到此处,或点击选择文件",-1)])]),_:1},512),V("div",be,[t(k,{type:"primary",loading:R.value,onClick:ee},{default:a(()=>[...e[17]||(e[17]=[c("开始导入",-1)])]),_:1},8,["loading"])]),v.value?(s(),x(C,{key:0},[t(ae),V("h4",null,"导入结果:共 "+$(v.value.total)+" 行,成功 "+$(v.value.success)+" 行,失败 "+$(v.value.total-v.value.success)+" 行",1),t(Y,{data:v.value.rows||[],size:"small",border:"","max-height":"360"},{default:a(()=>[t(f,{prop:"row",label:"行号",width:"70",align:"center"}),t(f,{prop:"materialCode",label:"物料编码","min-width":"140"}),t(f,{prop:"batchNo",label:"批次号","min-width":"160"}),t(f,{prop:"quantity",label:"数量",width:"90",align:"center"}),t(f,{label:"结果","min-width":"200"},{default:a(({row:l})=>[l.error?(s(),_(K,{key:1,type:"danger",size:"small"},{default:a(()=>[c($(l.error),1)]),_:2},1024)):(s(),_(K,{key:0,type:"success",size:"small"},{default:a(()=>[...e[18]||(e[18]=[c("成功",-1)])]),_:1}))]),_:1})]),_:1},8,["data"])],64)):T("",!0)]),_:1})]),_:1})]),_:1}),t(me,{data:se(pe)},null,8,["data"])],64)}}},xe=ue(ve,[["__scopeId","data-v-474430a2"]]);export{xe as default};