Files
bj_power/bj_power_mes/public_bak_20260918215750/assets/Station-Cq77xR4A.js
T
SunYF 37f10d3a13 refactor: 重构产线工位与备料流程,移除冗余字段
1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段
2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据
3. 重构日排产为工位产量分配模式,替代原接驳台列表
4. 新增备料单工位级字段与分批出库支持
5. 移除定时同步可生产数量,改为WMS实时拉取接口
6. 过滤操作日志,排除登录/退出相关日志
7. 调整仪表盘工序展示逻辑为今日派工路线
8. 新增接驳台维护菜单与基础数据
2026-09-19 07:50:21 +08:00

2 lines
5.4 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{j as D,h as f,c as v,a,w as l,k as _,F as C,i as I,r as s,o as d,d as E,n as c,f as u,p as y,t as H,m as G,x as J,E as N,l as K}from"./index-CeNpw27z.js";import{c as V}from"./perm-DCTK2KrM.js";import{g as Q,P as R}from"./help-92MqPoF4.js";const W={style:{"margin-bottom":"12px"}},X={key:0,style:{color:"#909399","font-size":"12px","line-height":"1.5","margin-top":"4px"}},ot={__name:"Station",setup(Y){const p=I([]),x=I([]),L=J(()=>[...p.value].sort((e,t)=>(e.stationNo||0)-(t.stationNo||0)).map(e=>({id:e.id,stationNo:e.stationNo,name:e.name,flowId:e.flowId,flowName:e.flowName,stationType:e.stationType}))),o=K({show:!1,isAdd:!1,title:"",id:0,stationNo:1,name:"",stationType:"LINE"});async function g(){p.value=await f.get("/stations")||[]}function h(){const e=new Set(p.value.map(b=>b.stationNo));let t=14;for(;e.has(t);)t++;Object.assign(o,{show:!0,isAdd:!0,title:"新增工位",id:0,stationNo:t,name:"",stationType:"LINE"})}function A(e){Object.assign(o,{show:!0,isAdd:!1,title:`工位${e.stationNo} - 修改`,id:e.id,stationNo:e.stationNo,name:e.name,stationType:e.stationType||"LINE"})}async function F(){if(!o.name)return N.warning("请输入工位名称");if(o.isAdd&&p.value.some(e=>e.stationNo===o.stationNo))return N.warning(`工位${o.stationNo} 已存在,请换一个工位号`);await f.post("/stations",{id:o.id,stationNo:o.stationNo,name:o.name,stationType:o.stationType}),N.success(o.isAdd?"工位已新增":"已保存"),o.show=!1,g()}async function z(e,t){try{await f.post("/stations",{id:e.id,stationNo:e.stationNo,name:e.name,stationType:e.stationType||"LINE",flowId:t}),N.success(t?"已绑定工艺流程":"已解除绑定")}catch{}finally{await g()}}return D(async()=>{var e;await g(),x.value=((e=await f.get("/process-flows",{params:{pageSize:1e3,page:1}}))==null?void 0:e.list)||[]}),(e,t)=>{const b=s("el-alert"),r=s("el-button"),m=s("el-table-column"),S=s("el-tag"),T=s("el-option"),O=s("el-select"),P=s("el-table"),B=s("el-input-number"),w=s("el-form-item"),U=s("el-input"),k=s("el-radio"),$=s("el-radio-group"),j=s("el-form"),q=s("el-dialog"),M=s("el-card");return d(),v(C,null,[a(M,null,{default:l(()=>[a(b,{type:"info",closable:!1,style:{"margin-bottom":"12px"},title:"工位数量以数据库为准。本页可新增工位(工位号自定义,可扩展到 14、15…)与改名;每个工位的工艺流程在「关联工位」页维护:在下拉选择启用的工艺流程即绑定到该工位;一个工位只能有一个启用的工艺流程。"}),E("div",W,[_(V)("produce.station:add")?(d(),c(r,{key:0,type:"primary",onClick:h},{default:l(()=>[...t[5]||(t[5]=[u("新增工位",-1)])]),_:1})):y("",!0),t[6]||(t[6]=E("span",{style:{"margin-left":"12px",color:"#909399","font-size":"12px"}},"虚拟工位(如 0 上线位、13 下线位)类型选「线下位」,不连 PLC、仅记录上下线。",-1))]),a(P,{data:L.value,border:"",size:"small"},{default:l(()=>[a(m,{prop:"stationNo",label:"工位号",width:"90",align:"center"}),a(m,{prop:"name",label:"工位名称","min-width":"170","show-overflow-tooltip":""}),a(m,{label:"类型",width:"90",align:"center"},{default:l(({row:n})=>[a(S,{size:"small",type:n.stationType==="OFFLINE"?"info":"success"},{default:l(()=>[u(H(n.stationType==="OFFLINE"?"线下位":"线上位"),1)]),_:2},1032,["type"])]),_:1}),a(m,{label:"绑定工艺流程","min-width":"240"},{default:l(({row:n})=>[a(O,{"model-value":n.flowId,size:"small",placeholder:"未绑定",onChange:i=>z(n,i),style:{width:"100%"}},{default:l(()=>[a(T,{value:0,label:"未绑定"}),(d(!0),v(C,null,G(x.value,i=>(d(),c(T,{key:i.id,value:i.id,label:i.name+(i.status==="ACTIVE"?"":"(停用)")},null,8,["value","label"]))),128))]),_:1},8,["model-value","onChange"])]),_:1}),a(m,{label:"操作",width:"120",align:"center",fixed:"right"},{default:l(({row:n})=>[_(V)("produce.station:edit")?(d(),c(r,{key:0,size:"small",onClick:i=>A(n)},{default:l(()=>[...t[7]||(t[7]=[u("改名",-1)])]),_:1},8,["onClick"])):y("",!0)]),_:1})]),_:1},8,["data"]),a(q,{modelValue:o.show,"onUpdate:modelValue":t[4]||(t[4]=n=>o.show=n),title:o.title,width:"440px"},{footer:l(()=>[a(r,{onClick:t[3]||(t[3]=n=>o.show=!1)},{default:l(()=>[...t[10]||(t[10]=[u("取消",-1)])]),_:1}),_(V)("produce.station:edit")?(d(),c(r,{key:0,type:"primary",onClick:F},{default:l(()=>[...t[11]||(t[11]=[u("保存",-1)])]),_:1})):y("",!0)]),default:l(()=>[a(j,{model:o,"label-width":"90px"},{default:l(()=>[a(w,{label:"工位号",required:""},{default:l(()=>[a(B,{modelValue:o.stationNo,"onUpdate:modelValue":t[0]||(t[0]=n=>o.stationNo=n),min:0,max:999,disabled:!o.isAdd,style:{width:"100%"}},null,8,["modelValue","disabled"]),o.isAdd?(d(),v("div",X," 自定义工位号,可与现有工位不连续(如 14、15…);0 为上线位、13 为下线位以外的编号均按物理/虚拟位识别。 ")):y("",!0)]),_:1}),a(w,{label:"工位名称",required:""},{default:l(()=>[a(U,{modelValue:o.name,"onUpdate:modelValue":t[1]||(t[1]=n=>o.name=n),placeholder:"如 一号装配工位"},null,8,["modelValue"])]),_:1}),a(w,{label:"工位类型"},{default:l(()=>[a($,{modelValue:o.stationType,"onUpdate:modelValue":t[2]||(t[2]=n=>o.stationType=n)},{default:l(()=>[a(k,{label:"LINE"},{default:l(()=>[...t[8]||(t[8]=[u("线上位(连 PLC",-1)])]),_:1}),a(k,{label:"OFFLINE"},{default:l(()=>[...t[9]||(t[9]=[u("线下位(虚拟,不连 PLC",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])]),_:1}),a(R,{data:_(Q),page:"Station"},null,8,["data"])],64)}}};export{ot as default};