import{j as k,c as v,a as e,w as o,k as U,F as S,h as f,r as d,i as h,l as c,o as P,f as u,t as E,E as w}from"./index-DtJUIYo6.js";import{d as T,P as q}from"./help-ByrA6SoP.js";const M={__name:"PlcSend",setup(B){const a=c({orderNo:"",sn:"",stationNo:1,processCombination:""}),r=c({orderNo:"",status:""}),m=h([]);async function V(){if(!a.orderNo||!a.processCombination)return w.warning("请填写工单号和工序组合");try{await f.post("/plc/send-process",{...a}),w.success("工序码下发成功(未收到完成信号不会下发下一条)"),i()}catch{}}async function i(){m.value=await f.get("/plc/send-logs",{params:r})||[]}return k(i),(N,l)=>{const p=d("el-input"),s=d("el-form-item"),y=d("el-input-number"),_=d("el-button"),b=d("el-form"),x=d("el-divider"),n=d("el-table-column"),C=d("el-table"),g=d("el-card");return P(),v(S,null,[e(g,null,{default:o(()=>[e(b,{inline:""},{default:o(()=>[e(s,{label:"工单号"},{default:o(()=>[e(p,{modelValue:a.orderNo,"onUpdate:modelValue":l[0]||(l[0]=t=>a.orderNo=t),style:{width:"170px"}},null,8,["modelValue"])]),_:1}),e(s,{label:"工件SN"},{default:o(()=>[e(p,{modelValue:a.sn,"onUpdate:modelValue":l[1]||(l[1]=t=>a.sn=t),style:{width:"170px"}},null,8,["modelValue"])]),_:1}),e(s,{label:"工位"},{default:o(()=>[e(y,{modelValue:a.stationNo,"onUpdate:modelValue":l[2]||(l[2]=t=>a.stationNo=t),min:1,max:12},null,8,["modelValue"])]),_:1}),e(s,{label:"工序组合"},{default:o(()=>[e(p,{modelValue:a.processCombination,"onUpdate:modelValue":l[3]||(l[3]=t=>a.processCombination=t),placeholder:"如 135",style:{width:"110px"}},null,8,["modelValue"])]),_:1}),e(s,null,{default:o(()=>[e(_,{type:"primary",onClick:V},{default:o(()=>[...l[6]||(l[6]=[u("下发工序码",-1)])]),_:1})]),_:1})]),_:1}),e(x,{"content-position":"left"},{default:o(()=>[...l[7]||(l[7]=[u("下发日志",-1)])]),_:1}),e(b,{inline:""},{default:o(()=>[e(s,{label:"工单号"},{default:o(()=>[e(p,{modelValue:r.orderNo,"onUpdate:modelValue":l[4]||(l[4]=t=>r.orderNo=t),clearable:"",style:{width:"160px"}},null,8,["modelValue"])]),_:1}),e(s,{label:"状态"},{default:o(()=>[e(p,{modelValue:r.status,"onUpdate:modelValue":l[5]||(l[5]=t=>r.status=t),style:{width:"120px"}},null,8,["modelValue"])]),_:1}),e(s,null,{default:o(()=>[e(_,{onClick:i},{default:o(()=>[...l[8]||(l[8]=[u("刷新",-1)])]),_:1})]),_:1})]),_:1}),e(C,{data:m.value,border:"",size:"small"},{default:o(()=>[e(n,{prop:"id",label:"ID",width:"60"}),e(n,{prop:"orderNo",label:"工单号","min-width":"130"}),e(n,{prop:"sn",label:"SN","min-width":"130"}),e(n,{prop:"stationNo",label:"工位",width:"70"}),e(n,{prop:"processCombination",label:"工序组合",width:"100"}),e(n,{prop:"processCodes",label:"工序码",width:"120"}),e(n,{prop:"status",label:"状态",width:"90"}),e(n,{prop:"ack",label:"完成",width:"70"},{default:o(({row:t})=>[u(E(t.ack?"是":"否"),1)]),_:1}),e(n,{prop:"sendTime",label:"下发时间",width:"170"}),e(n,{prop:"doneTime",label:"完成时间",width:"170"}),e(n,{prop:"operator",label:"操作人",width:"90"})]),_:1},8,["data"])]),_:1}),e(q,{data:U(T)},null,8,["data"])],64)}}};export{M as default};