HomePage-Bdx-elTv.js 10 KB

1
  1. import{I as K,d as L,a as z,b as _,g as j,S as ee,_ as te,c as se,T as ne,B as le,e as oe,f as ae,h as ie,i as ce,j as re,k as ue,l as de,M as D}from"./index-CFl91DGD.js";import{c as i,d as fe,u as pe,r as k,a as ve,o as me,b as ge,e as T,f as _e,w as c,g as v,h as t,i as be,j as B,k as C,F as $,l as M,m as N,t as d,n as U,p as R,_ as ye}from"./index-M7pGrfO0.js";var he={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};function F(m){for(var r=1;r<arguments.length;r++){var u=arguments[r]!=null?Object(arguments[r]):{},f=Object.keys(u);typeof Object.getOwnPropertySymbols=="function"&&(f=f.concat(Object.getOwnPropertySymbols(u).filter(function(g){return Object.getOwnPropertyDescriptor(u,g).enumerable}))),f.forEach(function(g){xe(m,g,u[g])})}return m}function xe(m,r,u){return r in m?Object.defineProperty(m,r,{value:u,enumerable:!0,configurable:!0,writable:!0}):m[r]=u,m}var G=function(r,u){var f=F({},r,u.attrs);return i(K,F({},f,{icon:he}),null)};G.displayName="ReloadOutlined";G.inheritAttrs=!1;const Te={class:"vehicle-operation flex items-center justify-center"},ke={class:"vehicle-content flex flex-col"},Ce={class:"vehicle-content-top flex items-center"},Ne={class:"vehicle-operation-car-options"},Oe={class:"click-wrap"},Ie=["aria-label"],Pe={class:"reload"},Se={class:"vehicle-info-content"},we={class:"vehicle-info-desc"},ze={class:"vehicle-info-desc"},je={class:"vehicle-info-desc"},De={class:"vehicle-info-desc"},Be={class:"vehicle-info-desc"},$e={class:"vehicle-info-desc"},Me={class:"vehicle-info-desc"},Re={class:"truck-wrapper flex-1"},Ge={class:"truck-img-wrap"},Ve={class:"license_plate"},Ae=fe({__name:"HomePage",setup(m){const r=_e(),u=pe(),f=u.params.ccmNo||"5",g=u.params.positionNo||"1",h=k(!1),s=k({id:"",licensePlate:"",destination:"",typeConfigId:void 0,ccmNo:"",ccmNo_dictText:"",shift:"",shiftGroup:"",shiftGroup_dictText:"",shift_dictText:"",arrivalTime:"",outTime:"",steel:"",size:"",amountTotal:0,licensePlateStatus:0,hasDestination:!1}),E=ve(()=>L[String(f)].map(n=>n)),V=k([]),H=k(!1),J=async()=>{try{let n=[];if(localStorage.getItem("lg_cars")){const{cars_list:e,time:l}=JSON.parse(localStorage.getItem("lg_cars")||"");new Date().getTime()-l<1e3*60*60*24&&(n=e)}if(!n.length){const{data:e}=await z.get("/jeecgbootbus/sys/dict/getAllLicensePlate",{params:{}}),{result:l}=e;n=l,localStorage.setItem("lg_cars",JSON.stringify({cars_list:n,time:new Date().getTime()}))}V.value=n}catch(n){console.log("err = ",n)}},W=()=>{H.value=!0},O=()=>{h.value=!0,z.get("/jeecgbootbus/storageBill/listNoToken",{params:{column:"createTime",order:"desc",ccmNo:f,positionNum:g,pageNo:1,pageSize:1}}).then(n=>{h.value=!1;const{status:e,data:l}=n;if(e===200){const{code:p,result:o}=l;if(p!==200){_.warning(l.message);return}if(!o)return;s.value={...o,ccmNo_dictText:j(o==null?void 0:o.ccmNo,"lg_zj"),shift_dictText:j(o==null?void 0:o.shift,"lg_bb"),shiftGroup_dictText:j(o.shiftGroup,"lg_bz"),typeConfigId:o.typeConfigId&&o.typeConfigId!="1024"?o.typeConfigId:void 0,hasDestination:!!(o&&o.typeConfigId&&o.destination)}}I()}).catch(n=>{h.value=!1,console.log("err = ",n),I()})},X=(n,e)=>{let l;const p=()=>{o(),l=setTimeout(n,e)},o=()=>{l&&clearTimeout(l)};return{start:p,stop:o}},{start:I,stop:A}=X(()=>{r.go(0)},3e4),P=n=>{if(n==="confirmCar"){D.confirm({iconType:"warning",title:"确认",content:"是否确认当前车辆已到达?",centered:!0,okText:"确认",cancelText:"取消",onOk:()=>{Number(g)===3?S({licensePlate:s.value.licensePlate},n):_.success("确认成功!")}});return}let e={};if(n==="error"){if(s.value.licensePlateStatus===1){_.warning("当前车辆已确认错误,请到钢坯装运单修改车辆信息!");return}e={licensePlateStatus:1},D.confirm({iconType:"warning",title:"确认",content:"是否确认当前车辆为错误?",centered:!0,okText:"确认",cancelText:"取消",onOk:()=>{S(e,n)}});return}if(n==="confirmDestination"){if(!s.value.typeConfigId){_.error("请选择目的地!");return}const l=L[Number(f)].find(p=>p.value===s.value.typeConfigId);e={destination:l==null?void 0:l.label,typeConfigId:s.value.typeConfigId},D.confirm({iconType:"warning",centered:!0,title:R("div",[R("span","目的地 "),R("span",{style:{color:"#f5222d",fontSize:"36px"}},`【 ${l==null?void 0:l.label} 】`)]),content:()=>"注:确认目的地后,不能修改目的地 !",class:"confirm-destination-modal",okText:"确认",cancelText:"取消",onOk:()=>{S(e,n)}})}},S=(n,e)=>{A(),h.value=!0,z.put(e==="confirmDestination"?"/jeecgbootbus/storageBill/editSynData":"/jeecgbootbus/storageBill/editLicensePlate",{id:s.value.id,...n}).then(l=>{const{status:p,data:o}=l;if(p===200){const{code:x,result:w}=o;if(x!==200){_.warning(o.message);return}if(!w)return}e==="error"?_.success("确认错误成功,请到钢坯装运单修改车辆信息!"):_.success("确认成功!")}).catch(l=>{_.error(l.message?l.message:"确认失败!")}).finally(()=>{I(),O(),h.value=!1})};return me(()=>{O(),J()}),ge(()=>{A()}),(n,e)=>{const l=ne,p=se,o=te,x=le,w=ae,q=oe,b=re,y=ce,Q=ie,Y=ee;return v(),T(Y,{wrapperClassName:"vehicle-operation-wrapper",spinning:h.value},{default:c(()=>[t("div",Te,[t("div",ke,[t("div",Ce,[e[10]||(e[10]=t("div",{class:"title-txt"},"当前车辆",-1)),Number(B(g))===3&&Number(B(f))===6?(v(),T(o,{key:0,placement:"bottomLeft",trigger:"click",overlayClassName:"vehicle-operation-car-popover"},{content:c(()=>[t("div",Ne,[(v(!0),C($,null,M(V.value,a=>(v(),T(l,{color:a.value===s.value.licensePlate?"processing":"default",onClick:()=>s.value.licensePlate=a.value,key:a.value},{default:c(()=>[N(d(a.label),1)]),_:2},1032,["color","onClick"]))),128))])]),default:c(()=>[t("div",Oe,[t("div",{class:"vehicle-content-top-icon",onClick:W}),i(p,{class:"input-txt",value:s.value.licensePlate,"onUpdate:value":e[0]||(e[0]=a=>s.value.licensePlate=a),disabled:""},null,8,["value"])])]),_:1})):(v(),T(p,{key:1,class:"input-txt",value:s.value.licensePlate,"onUpdate:value":e[1]||(e[1]=a=>s.value.licensePlate=a),disabled:""},null,8,["value"])),i(x,{class:"confirm-btn1",size:"large",type:"primary",onClick:e[2]||(e[2]=a=>P("confirmCar"))},{default:c(()=>e[7]||(e[7]=[N(" 确认 ")])),_:1}),i(x,{class:"error-btn",size:"large",type:"primary",danger:"",disabled:!!s.value.outTime,onClick:e[3]||(e[3]=a=>P("error"))},{default:c(()=>e[8]||(e[8]=[N(" 错误 ")])),_:1},8,["disabled"]),e[11]||(e[11]=t("div",{class:"title-txt txt2"},"目的地",-1)),i(q,{class:"select-wrap",size:"large",disabled:!!s.value.hasDestination,placeholder:"请选择目的地",value:s.value.typeConfigId,"onUpdate:value":e[4]||(e[4]=a=>s.value.typeConfigId=a)},{default:c(()=>[(v(!0),C($,null,M(E.value,a=>(v(),T(w,{value:a.value,label:a.label,key:a.value},{default:c(()=>[t("span",{role:"img","aria-label":a.label,style:U({fontSize:"18px",fontWeight:600,color:`${a.color||"#000"}`})},"   "+d(a.label),13,Ie)]),_:2},1032,["value","label"]))),128))]),_:1},8,["disabled","value"]),!s.value.outTime&&!s.value.hasDestination?(v(),T(x,{key:2,class:"confirm-btn1",size:"large",type:"primary",disabled:!!s.value.outTime,onClick:e[5]||(e[5]=a=>P("confirmDestination"))},{default:c(()=>e[9]||(e[9]=[N(" 确认 ")])),_:1},8,["disabled"])):be("",!0),t("div",Pe,[i(x,{size:"large",type:"primary",onClick:e[6]||(e[6]=()=>O())},{default:c(()=>[i(B(G))]),_:1})])]),e[20]||(e[20]=t("div",{class:"vehicle-content-title flex items-center justify-center"},[t("span",{class:"vehicle-content-title-text"},"信息概览")],-1)),t("div",Se,[i(Q,{gutter:[0,26]},{default:c(()=>[i(y,{span:5,class:"vehicle-info-content-item flex items-center"},{default:c(()=>[e[12]||(e[12]=t("div",{class:"vehicle-info-title"},"铸机",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",we,d(s.value.ccmNo_dictText),1)]),_:1}),i(y,{span:5,class:"vehicle-info-content-item green flex items-center"},{default:c(()=>[e[13]||(e[13]=t("div",{class:"vehicle-info-title"},"班组",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",ze,d(s.value.shiftGroup_dictText)+" - "+d(s.value.shift_dictText),1)]),_:1}),i(y,{span:7,class:"vehicle-info-content-item green flex items-center"},{default:c(()=>[e[14]||(e[14]=t("div",{class:"vehicle-info-title"},"到站时间",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",je,d(s.value.arrivalTime),1)]),_:1}),i(y,{span:7,class:"vehicle-info-content-item red flex items-center"},{default:c(()=>[e[15]||(e[15]=t("div",{class:"vehicle-info-title"},"离站时间",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",De,d(s.value.outTime),1)]),_:1}),i(y,{span:5,class:"vehicle-info-content-item flex items-center"},{default:c(()=>[e[16]||(e[16]=t("div",{class:"vehicle-info-title"},"钢种",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",Be,d(s.value.steel),1)]),_:1}),i(y,{span:5,class:"vehicle-info-content-item flex items-center"},{default:c(()=>[e[17]||(e[17]=t("div",{class:"vehicle-info-title"},"定尺",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",$e,d(s.value.size),1)]),_:1}),i(y,{span:5,class:"vehicle-info-content-item flex items-center"},{default:c(()=>[e[18]||(e[18]=t("div",{class:"vehicle-info-title"},"支数",-1)),i(b,{type:"vertical",style:{"background-color":"#1e91bb"}}),t("div",Me,d(s.value.amountTotal),1)]),_:1})]),_:1})]),t("div",Re,[(v(!0),C($,null,M(Math.ceil(Number(s.value.amountTotal)/4),(a,Z)=>(v(),C("img",{style:U({transform:`perspective(1000px) translate3d(-65%, -${Z*12+6}px, 0px) rotateX(45deg)`}),key:a,src:ue,class:"steel_billet-img"},null,4))),128)),t("div",Ge,[e[19]||(e[19]=t("img",{src:de},null,-1)),t("div",Ve,d(s.value.licensePlate||""),1)])])])])]),_:1},8,["spinning"])}}}),Fe=ye(Ae,[["__scopeId","data-v-14685457"]]);export{Fe as default};