feat: add run.ps1 script to start projects easily

add a powershell script that supports starting MES, WMS, WMSClient, Workstation and Dashboard projects with one command, includes build and run logic for backend services and npm dev for dashboard
This commit is contained in:
SunYF
2026-08-28 17:03:03 +08:00
parent a9c3fbeb41
commit cbd55338f1
30 changed files with 592 additions and 61 deletions
@@ -0,0 +1 @@
import{j as c,h as b,m as Q,w as t,i as k,r as n,o as v,a as e,c as S,F as j,l as z,f as r,t as F,E as U,n as $,k as A}from"./index-DK0Mia3I.js";const G={__name:"Bom",setup(D){const i=k(""),N=k([]),w=k([]),a=A({show:!1,materialCode:"",materialName:"",spec:"",unit:"",manageMode:"2",unitQty:1,lossRate:0,requiredQty:1});async function f(){if(!i.value)return U.warning("请选择/输入工单号");w.value=await b.get("/bom",{params:{workOrderNo:i.value}})||[]}function O(){Object.assign(a,{show:!0,materialCode:"",materialName:"",spec:"",unit:"",manageMode:"2",unitQty:1,lossRate:0,requiredQty:1})}async function x(){await b.put("/bom",{workOrderNo:i.value,items:[a]}),U.success("保存成功"),a.show=!1,f()}async function q(C){await $.confirm("确认移除该物料?","提示",{type:"warning"});const l=w.value.filter(p=>p.id!==C.id).map(({materialCode:p,materialName:V,spec:d,unit:m,manageMode:_,unitQty:u,lossRate:y,requiredQty:s})=>({materialCode:p,materialName:V,spec:d,unit:m,manageMode:_,unitQty:u,lossRate:y,requiredQty:s}));await b.put("/bom",{workOrderNo:i.value,items:l}),await f()}return c(async()=>{N.value=await b.get("/work-orders")||[]}),(C,l)=>{const p=n("el-option"),V=n("el-select"),d=n("el-form-item"),m=n("el-button"),_=n("el-form"),u=n("el-table-column"),y=n("el-table"),s=n("el-input"),M=n("el-radio"),B=n("el-radio-group"),g=n("el-input-number"),R=n("el-dialog"),E=n("el-card");return v(),Q(E,null,{default:t(()=>[e(_,{inline:""},{default:t(()=>[e(d,{label:"工单号"},{default:t(()=>[e(V,{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=o=>i.value=o),filterable:"","allow-create":"","default-first-option":"",style:{width:"220px"},onChange:f},{default:t(()=>[(v(!0),S(j,null,z(N.value,o=>(v(),Q(p,{key:o.workOrderNo,label:o.workOrderNo,value:o.workOrderNo},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(d,null,{default:t(()=>[e(m,{type:"primary",onClick:f},{default:t(()=>[...l[11]||(l[11]=[r("查询",-1)])]),_:1}),e(m,{onClick:O},{default:t(()=>[...l[12]||(l[12]=[r("添加物料",-1)])]),_:1})]),_:1})]),_:1}),e(y,{data:w.value,border:"",size:"small"},{default:t(()=>[e(u,{prop:"materialCode",label:"物料编码","min-width":"120"}),e(u,{prop:"materialName",label:"物料名称","min-width":"120"}),e(u,{prop:"spec",label:"规格"}),e(u,{prop:"unit",label:"单位",width:"70"}),e(u,{prop:"manageMode",label:"管理方式",width:"100"},{default:t(({row:o})=>[r(F(o.manageMode==="1"?"精密件(SN)":"结构件(批次)"),1)]),_:1}),e(u,{prop:"unitQty",label:"单台用量",width:"90"}),e(u,{prop:"lossRate",label:"损耗率%",width:"90"}),e(u,{prop:"requiredQty",label:"需求量",width:"90"}),e(u,{label:"操作",width:"90"},{default:t(({row:o})=>[e(m,{size:"small",type:"danger",onClick:L=>q(o)},{default:t(()=>[...l[13]||(l[13]=[r("移除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"]),e(R,{modelValue:a.show,"onUpdate:modelValue":l[10]||(l[10]=o=>a.show=o),title:"添加BOM物料",width:"520px"},{footer:t(()=>[e(m,{onClick:l[9]||(l[9]=o=>a.show=!1)},{default:t(()=>[...l[16]||(l[16]=[r("取消",-1)])]),_:1}),e(m,{type:"primary",onClick:x},{default:t(()=>[...l[17]||(l[17]=[r("保存",-1)])]),_:1})]),default:t(()=>[e(_,{model:a,"label-width":"90px"},{default:t(()=>[e(d,{label:"物料编码"},{default:t(()=>[e(s,{modelValue:a.materialCode,"onUpdate:modelValue":l[1]||(l[1]=o=>a.materialCode=o)},null,8,["modelValue"])]),_:1}),e(d,{label:"物料名称"},{default:t(()=>[e(s,{modelValue:a.materialName,"onUpdate:modelValue":l[2]||(l[2]=o=>a.materialName=o)},null,8,["modelValue"])]),_:1}),e(d,{label:"规格"},{default:t(()=>[e(s,{modelValue:a.spec,"onUpdate:modelValue":l[3]||(l[3]=o=>a.spec=o)},null,8,["modelValue"])]),_:1}),e(d,{label:"单位"},{default:t(()=>[e(s,{modelValue:a.unit,"onUpdate:modelValue":l[4]||(l[4]=o=>a.unit=o)},null,8,["modelValue"])]),_:1}),e(d,{label:"管理方式"},{default:t(()=>[e(B,{modelValue:a.manageMode,"onUpdate:modelValue":l[5]||(l[5]=o=>a.manageMode=o)},{default:t(()=>[e(M,{label:"1"},{default:t(()=>[...l[14]||(l[14]=[r("精密件(SN)",-1)])]),_:1}),e(M,{label:"2"},{default:t(()=>[...l[15]||(l[15]=[r("结构件(批次)",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(d,{label:"单台用量"},{default:t(()=>[e(g,{modelValue:a.unitQty,"onUpdate:modelValue":l[6]||(l[6]=o=>a.unitQty=o),min:0},null,8,["modelValue"])]),_:1}),e(d,{label:"损耗率%"},{default:t(()=>[e(g,{modelValue:a.lossRate,"onUpdate:modelValue":l[7]||(l[7]=o=>a.lossRate=o),min:0},null,8,["modelValue"])]),_:1}),e(d,{label:"需求量"},{default:t(()=>[e(g,{modelValue:a.requiredQty,"onUpdate:modelValue":l[8]||(l[8]=o=>a.requiredQty=o),min:0},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])]),_:1})}}};export{G as default};