3.4366e891.js 46 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[3],{2304:function(t,e,s){},"260b":function(t,e,s){},"7c1d":function(t,e,s){"use strict";s.r(e);var a=function(){var t,e,s,a,o,i,l,n,r,c,d,u,h,_,p,m,g,v,y,f,b,w,C,q,k,x,S,$,I,D,P,R,T=this,L=T._self._c;return L("div",[L("q-toolbar",{staticClass:"row items-center"},[L("q-btn-group",{staticClass:"btn-group",attrs:{push:""}},[L("q-btn",{attrs:{label:T.$t("stock.shelf.shelf_up"),icon:"upload"},on:{click:function(t){return T.handleShelfUp()}}}),L("div",{staticClass:"self-center text-center q-px-sm"},[T._v("\n "+T._s(T.$t("stock.layertip"))+"\n ")]),L("q-input",{staticStyle:{width:"50px"},attrs:{dense:"",color:"primary"},model:{value:T.shelf.layer_now,callback:function(t){T.$set(T.shelf,"layer_now",t)},expression:"shelf.layer_now"}}),L("q-btn",{attrs:{label:T.$t("stock.shelf.shelf_down"),icon:"download"},on:{click:function(t){return T.handleShelfDown()}}}),L("q-btn",{attrs:{label:T.$t("refresh"),icon:"refresh"},on:{click:function(t){return T.reFresh()}}},[L("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[T._v("\n "+T._s(T.$t("refreshtip"))+"\n ")])],1),L("q-separator"),L("q-toggle",{attrs:{"checked-icon":"check","unchecked-icon":"close",label:T.showInventoryStatus?"显示质检状态":"显示库位状态",size:"sm",color:"primary"},model:{value:T.showInventoryStatus,callback:function(t){T.showInventoryStatus=t},expression:"showInventoryStatus"}})],1),T.showInventoryDetails?L("goodscard",{ref:"goodscard",attrs:{"col-index":T.select_Inventory.colIndex,"row-index":T.select_Inventory.rowIndex,"layer-index":T.select_Inventory.layerIndex,"selected-shelf-type":T.select_Inventory.shelf_type,"goods-data":T.select_Inventory.goods_data},on:{close:function(t){T.showInventoryDetails=!1}}}):T._e()],1),L("q-page",{staticClass:"q-pa-md"},[L("div",{staticClass:"layout-container"},[L("div",{staticClass:"shelf-section"},[L("div",{staticClass:"grid-system"},[L("div",{staticClass:"axis y-axis"},[L("div",{staticClass:"axis-numbers"},T._l(T.shelf.rows,(function(t){return L("div",{key:"y"+t},[T._v("\n "+T._s(t)+"\n ")])})),0),L("div",{staticClass:"axis-arrow"})]),L("div",{staticClass:"axis x-axis"},[L("div",{staticClass:"axis-arrow"}),L("div",{staticClass:"axis-numbers"},[T._l(T.shelf.cols,(function(t){return L("div",{key:"x"+t,staticClass:"axis-label"},[T._v("\n "+T._s(t)+"\n ")])})),L("div",{staticClass:"axis-label"})],2)]),L("div",{staticClass:"grid-container"},[L("div",{staticClass:"grid-content"},T._l(T.shelf.rows,(function(t,e){return L("div",{key:`row-${e}|${T.shelf.layer_now}`,staticClass:"grid-row",style:{cursor:"pointer"}},T._l(T.shelf.cols,(function(t,s){return L("div",{key:`col-${s}|${T.shelf.layer_now}`,staticClass:"grid-item",style:{cursor:"pointer"}},[T.shouldShowButton(T.shelf.rows-e,s+1,T.shelf.layer_now)?L("div",{key:`${T.shelf.rows-e}-${s}-${T.shelf.layer_now}`,staticClass:"select-item",style:{border:"1px solid #ccc",borderRadius:"5px",width:"var(--cell-d)",height:"var(--cell-d)",backgroundColor:T.getBinColor(T.shelf.rows-e,s+1,T.shelf.layer_now),cursor:"pointer"},on:{click:function(t){return T.handleBinClick(T.shelf.rows-e,s+1,T.shelf.layer_now)}}}):T._e(),T.shouldShowButton(T.shelf.rows-e,s+1,T.shelf.layer_now)?L("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 12px; max-width: 300px;"}},[L("div",{staticClass:"tooltip-header"},[T._v("\n "+T._s(T.$t("stock.rowtip"))+" "+T._s(T.shelf.rows-e)+"\n "+T._s(T.$t("stock.coltip"))+" "+T._s(s+1)+"\n ")]),L("q-separator",{attrs:{color:"dark",inset:""}}),L("div",{staticClass:"tooltip-content"},[T.getBinbatch(T.shelf.rows-e,s+1,T.shelf.layer_now).length?L("div",T._l(T.getBinbatch(T.shelf.rows-e,s+1,T.shelf.layer_now),(function(t,e){return L("div",{key:e,staticClass:"batch-item",class:{"batch-pending":0===t.status,"batch-approved":1===t.status,"batch-rejected":2===t.status,"batch-no-goods":404===t.status}},[L("div",{staticClass:"batch-status"},[L("q-icon",{staticClass:"q-mr-xs",attrs:{name:T.getStatusIcon(t.status),size:"sm",color:T.getStatusColor(t.status)}}),T._v("\n "+T._s(T.getStatusLabel(t.status))+"\n ")],1),"no_batch"!==t.batchId&&t.batchId?L("div",[T._v("\n "+T._s("批次号")+": "+T._s(t.batchId)+"\n ")]):T._e(),"no_check_time"!==t.time&&t.time?L("div",[T._v("\n "+T._s("库位数目")+": "+T._s(t.qty)+"\n ")]):T._e(),"no_check_time"!==t.time&&t.time?L("div",[T._v("\n "+T._s("时间")+": "+T._s(T.formatDateTime(t.time))+"\n ")]):T._e()])})),0):L("div",{staticClass:"batch-no-goods"},[L("q-icon",{staticClass:"q-mr-xs",attrs:{name:"inventory",size:"sm"}}),T._v("\n "+T._s(T.$t("stock.batch.no_goods"))+"\n ")],1)])],1):T._e()],1)})),0)})),0)])])]),L("div",{staticClass:"stats-section"},[L("div",{staticClass:"stats-panel",attrs:{role:"region","aria-label":"统计面板"}},[T.statsLoaded?L("div",{staticClass:"stats-cards"},[L("q-card",{staticClass:"stat-card",on:{click:T.reFreshStatistics}},[L("q-card-section",[L("div",{staticClass:"card-title"},[T._v("总体统计")]),L("div",{staticClass:"big-num"},[T._v(T._s(T.stats.total_locations))]),L("div",{staticClass:"row items-center q-mt-sm"},[L("div",{staticClass:"col"},[L("div",{staticClass:"muted"},[T._v("已占用")]),L("div",{staticClass:"small-num used"},[T._v(T._s(T.stats.total_used))])]),L("div",{staticClass:"col"},[L("div",{staticClass:"muted"},[T._v("可用")]),L("div",{staticClass:"small-num available"},[T._v("\n "+T._s(T.stats.total_available)+"\n ")])])]),L("div",{staticClass:"util-row q-mt-md"},[L("div",{staticClass:"muted"},[T._v("使用率")]),L("div",{staticClass:"util-number"},[T._v("\n "+T._s(T.formatPercent(T.stats.utilization_rate))+"\n ")])]),L("q-linear-progress",{staticClass:"q-mt-xs",attrs:{value:(Number(T.stats.utilization_rate)||0)/100,"track-color":"grey-3",size:"12px"}})],1)],1),L("q-card",{staticClass:"stat-card",on:{click:T.openGroupStatsDialog}},[L("q-card-section",[L("div",{staticClass:"card-title"},[T._v("各类型统计")]),L("div",{staticClass:"type-list"},T._l(T.typeList,(function(t){return L("div",{key:t.key,staticClass:"type-item"},[L("div",{staticClass:"type-info"},[L("div",{staticClass:"type-name"},[T._v(T._s(t.label))]),L("div",{staticClass:"type-total"},[T._v("\n 共 "+T._s(T.stats[t.totalKey])+" 个\n ")])]),L("div",{staticClass:"type-details"},[L("div",{staticClass:"detail-item"},[L("span",{staticClass:"detail-label"},[T._v("占用")]),L("span",{staticClass:"detail-value used"},[T._v(T._s(T.stats[t.usedKey]))])]),L("div",{staticClass:"detail-item"},[L("span",{staticClass:"detail-label"},[T._v("可用")]),L("span",{staticClass:"detail-value available"},[T._v(T._s(T.stats[t.availKey]))])])])])})),0)])],1),L("q-card",{staticClass:"stat-card small"},[L("q-card-section",[L("div",{staticClass:"card-title"},[T._v("数据管理")]),L("div",{staticClass:"muted q-mt-xs"},[T._v("\n "+T._s(T.stats.statistic_time_display||"-")+"\n ")]),L("div",{staticClass:"action-buttons q-mt-sm"},[L("q-btn",{staticClass:"full-width q-mb-sm",attrs:{icon:"refresh",label:"刷新统计",flat:"",dense:""},on:{click:function(t){return T.getStatistics()}}}),L("q-btn",{staticClass:"full-width",attrs:{icon:"verified",label:T.$t("validate")||"数据校验",disable:T.checking,flat:"",dense:"",color:T.checking?"grey":"primary"},on:{click:function(t){return T.runCheck()}}},[T.checking?T._e():L("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size:12px"}},[T._v("\n 执行数据一致性校验\n ")])],1)],1)])],1)],1):L("div",{staticClass:"stats-loading"},[L("q-spinner-dots",{attrs:{size:"36px",color:"primary"}}),L("div",{staticClass:"muted q-mt-sm"},[T._v("正在加载统计数据...")])],1)])])]),L("q-dialog",{attrs:{maximized:"","transition-show":"scale","transition-hide":"scale"},model:{value:T.showCheckDialog,callback:function(t){T.showCheckDialog=t},expression:"showCheckDialog"}},[L("q-card",{staticClass:"check-dialog"},[L("q-card-section",{staticClass:"dialog-header"},[L("div",{staticClass:"header-content"},[L("div",[L("div",{staticClass:"dialog-title"},[T._v("数据一致性校验结果")]),L("div",{staticClass:"dialog-subtitle"},[T._v("\n "+T._s(null!==(t=T.checkResult)&&void 0!==t&&null!==(e=t.summary)&&void 0!==e&&e.check_time?T.formatDateTime(T.checkResult.summary.check_time):"-")+"\n ")])]),L("q-btn",{attrs:{icon:"close",flat:"",round:"",dense:""},on:{click:function(t){T.showCheckDialog=!1}}})],1)]),L("q-separator"),L("q-card-section",{staticClass:"dialog-content"},[L("div",{staticClass:"summary-cards"},[L("q-card",{staticClass:"summary-card",attrs:{flat:""}},[L("q-card-section",[L("div",{staticClass:"summary-value"},[T._v("\n "+T._s(null!==(s=null===(a=T.checkResult)||void 0===a||null===(o=a.summary)||void 0===o||null===(i=o.total_checked)||void 0===i?void 0:i.locations)&&void 0!==s?s:"-")+"\n ")]),L("div",{staticClass:"summary-label"},[T._v("已校验位置")])])],1),L("q-card",{staticClass:"summary-card error",attrs:{flat:""}},[L("q-card-section",[L("div",{staticClass:"summary-value"},[T._v("\n "+T._s(null!==(l=null===(n=T.checkResult)||void 0===n||null===(r=n.summary)||void 0===r||null===(c=r.errors_found)||void 0===c?void 0:c.locations)&&void 0!==l?l:"-")+"\n ")]),L("div",{staticClass:"summary-label"},[T._v("发现错误")])])],1),L("q-card",{staticClass:"summary-card success",attrs:{flat:""}},[L("q-card-section",[L("div",{staticClass:"summary-value"},[T._v("\n "+T._s(null!==(d=null===(u=T.checkResult)||void 0===u||null===(h=u.summary)||void 0===h||null===(_=h.fixed)||void 0===_?void 0:_.locations)&&void 0!==d?d:"-")+"\n ")]),L("div",{staticClass:"summary-label"},[T._v("已修复")])])],1)],1),L("q-separator",{staticClass:"q-my-md"}),L("div",{staticClass:"error-sections"},[L("div",{staticClass:"error-section"},[L("div",{staticClass:"section-header"},[L("q-icon",{staticClass:"q-mr-sm",attrs:{name:"place"}}),L("span",[T._v("位置级别错误")]),L("q-badge",{staticClass:"q-ml-sm",attrs:{color:"negative"}},[T._v("\n "+T._s((null===(p=T.checkResult)||void 0===p||null===(m=p.details)||void 0===m||null===(g=m.location_errors)||void 0===g?void 0:g.length)||0)+"\n ")])],1),null!==(v=T.checkResult)&&void 0!==v&&null!==(y=v.details)&&void 0!==y&&null!==(f=y.location_errors)&&void 0!==f&&f.length?L("q-table",{staticClass:"error-table q-mt-md",attrs:{data:T.checkResult.details.location_errors,columns:T.checkColumns,"row-key":"location_id",flat:"",bordered:"",dense:""},scopedSlots:T._u([{key:"body-cell-actions",fn:function(t){return[L("div",{staticClass:"action-buttons"},[L("q-btn",{attrs:{icon:"place",size:"sm",flat:"",dense:"",title:"定位到该位置"},on:{click:function(e){return T.highlightLocation(t.row)}}}),L("q-btn",{attrs:{icon:"open_in_new",size:"sm",flat:"",dense:"",title:"查看详情"},on:{click:function(e){return T.openLocationDetail(t.row)}}})],1)]}}],null,!1,512846156)}):L("div",{staticClass:"no-errors"},[T._v("未发现位置级别错误")])],1),L("div",{staticClass:"error-section q-mt-lg"},[L("div",{staticClass:"section-header"},[L("q-icon",{staticClass:"q-mr-sm",attrs:{name:"folder"}}),L("span",[T._v("分组级别错误")]),L("q-badge",{staticClass:"q-ml-sm",attrs:{color:"warning"}},[T._v("\n "+T._s((null===(b=T.checkResult)||void 0===b||null===(w=b.details)||void 0===w||null===(C=w.group_errors)||void 0===C?void 0:C.length)||0)+"\n ")])],1),null!==(q=T.checkResult)&&void 0!==q&&null!==(k=q.details)&&void 0!==k&&null!==(x=k.group_errors)&&void 0!==x&&x.length?L("div",{staticClass:"group-errors q-mt-md"},T._l(T.checkResult.details.group_errors,(function(t,e){return L("div",{key:e,staticClass:"group-error-item"},[L("div",{staticClass:"group-info"},[L("strong",[T._v(T._s(t.group_name||t.group_code))]),L("span",{staticClass:"error-type"},[T._v(T._s(t.error_type))])]),L("div",{staticClass:"group-details"},[T._v("\n 当前: "+T._s(t.current_status)+" → 期望:\n "+T._s(t.expected_status)+"\n ")])])})),0):L("div",{staticClass:"no-errors"},[T._v("未发现分组级别错误")])])])],1),L("q-card-actions",{staticClass:"dialog-actions",attrs:{align:"right"}},[L("q-btn",{attrs:{label:"关闭",flat:""},on:{click:function(t){T.showCheckDialog=!1}}}),T.checkResult?L("q-btn",{attrs:{label:"导出报告",icon:"download",color:"primary"},on:{click:function(t){return T.exportCheckReport()}}}):T._e()],1)],1)],1),L("q-dialog",{attrs:{persistent:""},model:{value:T.showGroupStatsDialog,callback:function(t){T.showGroupStatsDialog=t},expression:"showGroupStatsDialog"}},[L("q-card",{staticStyle:{"min-width":"500px"}},[L("q-card-section",[L("div",{staticClass:"text-h6"},[T._v("货位组统计查询")])]),L("q-card-section",{staticClass:"q-pt-none"},[L("div",{staticClass:"q-gutter-md"},[L("q-input",{attrs:{filled:"",type:"number",label:"最小使用率 (%)",hint:"输入0-100之间的数值",rules:[t=>t>=0&&t<=100||"请输入0-100之间的数值"]},model:{value:T.groupStatsParams.min_utilization,callback:function(t){T.$set(T.groupStatsParams,"min_utilization",t)},expression:"groupStatsParams.min_utilization"}}),L("q-input",{attrs:{filled:"",type:"number",label:"最小使用数目",hint:"输入最小已使用货位数",rules:[t=>t>=0||"请输入非负数"]},model:{value:T.groupStatsParams.min_used_locations,callback:function(t){T.$set(T.groupStatsParams,"min_used_locations",t)},expression:"groupStatsParams.min_used_locations"}})],1)]),L("q-card-actions",{attrs:{align:"right"}},[L("q-btn",{attrs:{flat:"",label:"取消",color:"primary"},on:{click:function(t){T.showGroupStatsDialog=!1}}}),L("q-btn",{attrs:{flat:"",label:"查询",color:"primary",loading:T.loadingGroupStats},on:{click:function(t){return T.getGroupStatistics()}}})],1)],1)],1),L("q-dialog",{attrs:{maximized:""},model:{value:T.showGroupStatsResult,callback:function(t){T.showGroupStatsResult=t},expression:"showGroupStatsResult"}},[L("q-card",[L("q-card-section",[L("div",{staticClass:"row items-center"},[L("div",{staticClass:"text-h6"},[T._v("货位组统计结果")]),L("q-space"),L("q-btn",{attrs:{icon:"close",flat:"",round:"",dense:""},on:{click:function(t){T.showGroupStatsResult=!1}}})],1),L("div",{staticClass:"text-caption text-grey"},[T._v("\n 查询时间:\n "+T._s(null!==(S=T.groupStatsResult)&&void 0!==S&&S.timestamp?T.formatDateTime(T.groupStatsResult.timestamp):"-")+"\n | 筛选条件: 使用率≥"+T._s(T.groupStatsParams.min_utilization)+"%,\n 使用数≥"+T._s(T.groupStatsParams.min_used_locations)+" | 共\n "+T._s((null===($=T.groupStatsResult)||void 0===$||null===(I=$.filters)||void 0===I?void 0:I.total_records)||0)+" 条记录\n ")])]),L("q-separator"),L("q-card-section",[L("q-table",{attrs:{flat:"",bordered:"",data:(null===(D=T.groupStatsResult)||void 0===D?void 0:D.data)||[],columns:T.groupStatsColumns,"row-key":"id",loading:T.loadingGroupStats},on:{request:T.onGroupStatsRequest},scopedSlots:T._u([{key:"body-cell-utilization_rate",fn:function(t){return[L("q-td",{attrs:{props:t}},[L("div",{staticClass:"row items-center"},[L("div",{staticClass:"col"},[T._v(T._s(t.value)+"%")]),L("div",{staticClass:"col-auto"},[L("q-linear-progress",{staticStyle:{width:"60px",height:"8px"},attrs:{value:parseFloat(t.value)/100,color:T.getUtilizationColor(t.value)}})],1)])])]}},{key:"body-cell-actions",fn:function(t){return[L("q-td",{attrs:{props:t}},[L("q-btn",{attrs:{icon:"visibility",size:"sm",flat:"",dense:"",title:"查看该货位组"},on:{click:function(e){return T.highlightGroupLocation(t.row)}}})],1)]}}])})],1),L("q-card-actions",{attrs:{align:"right"}},[L("q-btn",{attrs:{flat:"",label:"关闭"},on:{click:function(t){T.showGroupStatsResult=!1}}}),null!==(P=T.groupStatsResult)&&void 0!==P&&null!==(R=P.data)&&void 0!==R&&R.length?L("q-btn",{attrs:{flat:"",label:"导出数据",icon:"download",color:"primary"},on:{click:function(t){return T.exportGroupStats()}}}):T._e()],1)],1)],1)],1)],1)},o=[],i=(s("ddb0"),s("9861"),s("a79d"),s("2b3d"),s("caad"),function(){var t=this,e=t._self._c;return e("div",{style:{backgroundColor:t.bgColor}},[e("q-dialog",{model:{value:t.release_dialog,callback:function(e){t.release_dialog=e},expression:"release_dialog"}},[e("q-card",{staticStyle:{"min-width":"400px"}},[e("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders"},[e("div",[t._v("释放库位")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}})],1),e("q-card-section",[e("q-item",[e("q-item-section",[e("q-item-label",[t._v("库位信息")]),e("q-item-label",{attrs:{caption:""}},[t._v("\n "+t._s(t.formatLocation(t.current_location))+"\n ")])],1)],1),e("q-separator",{staticClass:"q-my-md"}),e("div",{staticClass:"q-gutter-y-md"},[e("div",{staticClass:"text-subtitle1"},[t._v("库位状态")]),e("q-item",[e("q-item-section",[e("q-item-label",[t._v("托盘编码:"+t._s(t.container_code||"无"))]),e("q-item-label",{attrs:{caption:""}},[t._v(t._s(t.location_status_display))])],1)],1),e("q-separator",{staticClass:"q-my-md"}),t.container_code?e("div",[e("div",{staticClass:"text-subtitle1"},[t._v("确认释放操作")]),e("div",{staticClass:"q-mt-sm text-grey-7"},[t._v("\n 此操作将解除托盘与库位的关联,并将库位状态重置为可用\n ")])]):e("div",{staticClass:"text-subtitle1 text-primary"},[t._v("\n 当前库位为空,无需释放\n ")])],1)],1),e("q-card-actions",{attrs:{align:"right"}},[e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:"取消"}}),e("q-btn",{attrs:{color:"primary",label:"确认释放",disable:!t.container_code},on:{click:t.confirmRelease}})],1)],1)],1),e("q-dialog",{model:{value:t.move_dialog,callback:function(e){t.move_dialog=e},expression:"move_dialog"}},[e("q-card",{staticStyle:{"min-width":"400px"}},[e("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders"},[e("div",[t._v("移动托盘")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}})],1),e("q-card-section",[e("q-item",[e("q-item-section",[e("q-item-label",[t._v("起始库位")]),e("q-item-label",{attrs:{caption:""}},[t._v(t._s(t.formatLocation(t.start_loc)))])],1)],1),e("q-separator",{staticClass:"q-my-md"}),e("div",{staticClass:"q-gutter-y-md"},[e("div",{staticClass:"text-subtitle1"},[t._v("选择目标库位")]),e("div",{staticClass:"row q-gutter-sm"},[e("q-select",{staticClass:"col",attrs:{options:t.layerOptions,label:"层",dense:"","emit-value":"","map-options":""},model:{value:t.target_loc.layer,callback:function(e){t.$set(t.target_loc,"layer",e)},expression:"target_loc.layer"}}),e("q-select",{staticClass:"col",attrs:{options:t.rowOptions,label:"行",dense:"","emit-value":"","map-options":""},model:{value:t.target_loc.row,callback:function(e){t.$set(t.target_loc,"row",e)},expression:"target_loc.row"}}),e("q-select",{staticClass:"col",attrs:{options:t.colOptions,label:"列",dense:"","emit-value":"","map-options":""},model:{value:t.target_loc.col,callback:function(e){t.$set(t.target_loc,"col",e)},expression:"target_loc.col"}})],1)])],1),e("q-card-actions",{attrs:{align:"right"}},[e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:"取消"}}),e("q-btn",{attrs:{color:"primary",label:"确认移动"},on:{click:t.confirmMove}})],1)],1)],1),e("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},on:{show:function(e){return t.prepareDialog()}},model:{value:t.storage_dialog,callback:function(e){t.storage_dialog=e},expression:"storage_dialog"}},[e("q-card",{staticStyle:{"min-width":"900px"}},[e("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[e("div",[t._v("\n "+t._s(t.$t("stock.shelf.shelf_details"))+"\n ")]),e("q-space"),t._v("\n "+t._s(t.layerIndex)+" 层 "+t._s(t.rowIndex)+" 行 "+t._s(t.colIndex)+"列\n ")],1),e("q-card-section",{staticClass:"q-pt-md"},[e("q-tabs",{model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("q-tab",{attrs:{name:"tab2",label:"批次信息"}}),e("q-tab",{attrs:{name:"tab3",label:"库存明细"}})],1)],1),e("q-tab-panels",{attrs:{animated:""},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("q-tab-panel",{staticStyle:{height:"300px"},attrs:{name:"tab2"}},[[e("div",{staticClass:"text-h6 q-mb-md row items-center justify-between"},[e("div",{staticClass:"col"},[t._v(t._s("批次信息"))]),e("div",{staticClass:"col-auto"},[t.hasPermission("edit")?e("q-btn",{attrs:{color:"primary",label:"释放库位"},on:{click:t.showReleaseDialog}}):t._e(),t.hasPermission("edit")?e("q-btn",{attrs:{color:"primary",label:"移动库位"},on:{click:t.showMoveDialog}}):t._e()],1)]),t.storage_form.length>0?e("q-table",{staticClass:"my-sticky-table scrollable-table",style:{"max-height":"400px"},attrs:{data:t.storage_form,columns:t.columns_batch,"row-key":"id",flat:"",bordered:"","hide-pagination":"","container-style":{height:"auto"},pagination:{rowsPerPage:0}}}):t._e(),e("div",{staticStyle:{float:"right","min-width":"100%"},attrs:{flow:"row wrap"}},[e("q-card",{staticClass:"q-mb-md",attrs:{bordered:""}},[e("q-card-actions",{staticClass:"q-px-none",staticStyle:{position:"absolute",right:"20px",top:"10px","z-index":"100"}},[t.onlyread?t._e():e("q-btn",{attrs:{icon:"add",flat:"",dense:"",color:"primary",label:t.$t("stock.add")},on:{click:function(e){return t.addInventoryDetail()}}}),t.onlyread?t._e():e("q-btn",{attrs:{icon:"delete",flat:"",dense:"",color:"primary",label:t.$t("stock.delete")},on:{click:function(e){return t.deleteInventoryDetail()}}}),t.storage_form.length>0?e("div",[t._v("\n 托盘码:\n "+t._s(t.container_code)+"\n ")]):t._e(),e("q-btn",{attrs:{flat:"",dense:"",color:"primary"},on:{click:function(e){t.showInventoryDetails=!t.showInventoryDetails}}},[t._v("\n "+t._s(t.showInventoryDetails?"收起":"展开")+"\n ")])],1),e("q-card-section",[e("div",{staticClass:"text-h6 q-mb-md"},[t._v("\n "+t._s("物料详情")+"\n ")]),t.showInventoryDetails?e("q-table",{staticClass:"my-sticky-table scrollable-table",style:{"max-height":"400px"},attrs:{data:t.results,columns:t.columns_results,"row-key":"id",flat:"",bordered:"","hide-pagination":"","container-style":{height:"auto"},pagination:{rowsPerPage:0}}}):t._e()],1)],1)],1)]],2),e("q-tab-panel",{staticStyle:{height:"300px"},attrs:{name:"tab3"}},[e("div",{staticClass:"row q-gutter-x-md"},[e("div",{staticClass:"col column q-gutter-y-md"}),e("div",{staticClass:"col column q-gutter-y-md"})])])],1)],1)],1),e("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},on:{show:function(e){return t.prepareDialog()}},model:{value:t.elevator_dialog,callback:function(e){t.elevator_dialog=e},expression:"elevator_dialog"}},[e("q-card",{staticStyle:{"min-width":"350px"}},[e("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[e("div",[t._v("\n "+t._s(t.$t("stock.elevator.elevator"))+"\n ")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 12px"}},[t._v("\n "+t._s(t.$t("index.close")))])],1)],1),e("q-card-section",{staticClass:"q-pt-md"},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:t.$t("stock.elevator.ip"),readonly:t.onlyread,rules:[e=>(null===e||void 0===e?void 0:e.length)>0||t.error1]},model:{value:t.elevator_form.ip,callback:function(e){t.$set(t.elevator_form,"ip",e)},expression:"elevator_form.ip"}}),e("q-input",{attrs:{dense:"",outlined:"",square:"",label:t.$t("stock.elevator.port"),type:"number",readonly:t.onlyread,rules:[e=>null!==e||t.error1,e=>e>=0||t.error1]},model:{value:t.elevator_form.port,callback:function(e){t.$set(t.elevator_form,"port",e)},expression:"elevator_form.port"}}),e("q-input",{attrs:{dense:"",outlined:"",square:"",label:t.$t("stock.conveyor.status"),readonly:t.onlyread,rules:[e=>(null===e||void 0===e?void 0:e.length)>0||t.error1]},model:{value:t.elevator_form.status,callback:function(e){t.$set(t.elevator_form,"status",e)},expression:"elevator_form.status"}})],1),e("div",{staticStyle:{float:"right",padding:"15px 15px 15px 0"}},[e("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"white","text-color":"black"},on:{click:function(e){t.shelfLocal="undefined",t.handleclick()}}},[t._v("\n "+t._s(t.$t("stock.return")))]),e("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"primary","text-color":"white"},on:{click:function(e){return t.handleEdit()}}},[t._v("\n "+t._s(t.onlyread?t.$t("stock.shelf.shelf_edit"):t.$t("stock.shelf.shelf_confirm")))])],1)],1)],1),e("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},on:{show:function(e){return t.prepareDialog()}},model:{value:t.conveyor_dialog,callback:function(e){t.conveyor_dialog=e},expression:"conveyor_dialog"}},[e("q-card",{staticStyle:{"min-width":"350px"}},[e("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[e("div",[t._v("\n "+t._s(t.$t("stock.conveyor.conveyor"))+"\n ")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 12px"}},[t._v("\n "+t._s(t.$t("index.close")))])],1)],1),e("q-card-section",{staticClass:"q-pt-md"},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:t.$t("stock.conveyor.ip"),readonly:t.onlyread,rules:[e=>(null===e||void 0===e?void 0:e.length)>0||t.error1]},model:{value:t.conveyor_form.ip,callback:function(e){t.$set(t.conveyor_form,"ip",e)},expression:"conveyor_form.ip"}}),e("q-input",{attrs:{dense:"",outlined:"",square:"",label:t.$t("stock.elevator.port"),type:"number",readonly:t.onlyread,rules:[e=>null!==e||t.error1,e=>e>=0||t.error1]},model:{value:t.conveyor_form.port,callback:function(e){t.$set(t.conveyor_form,"port",e)},expression:"conveyor_form.port"}}),e("q-input",{attrs:{dense:"",outlined:"",square:"",label:t.$t("stock.conveyor.status"),readonly:t.onlyread,rules:[e=>(null===e||void 0===e?void 0:e.length)>0||t.error1]},model:{value:t.conveyor_form.status,callback:function(e){t.$set(t.conveyor_form,"status",e)},expression:"conveyor_form.status"}})],1),e("div",{staticStyle:{float:"right",padding:"15px 15px 15px 0"}},[e("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"white","text-color":"black"},on:{click:function(e){t.shelfLocal="undefined",t.handleclick()}}},[t._v("\n "+t._s(t.$t("stock.return")))]),e("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"primary","text-color":"white"},on:{click:function(e){return t.handleEdit()}}},[t._v("\n "+t._s(t.onlyread?t.$t("stock.shelf.shelf_edit"):t.$t("stock.shelf.shelf_confirm")))])],1)],1)],1)],1)}),l=[],n=(s("d9e2"),s("3004")),r=s("18d6"),c={props:{rowIndex:Number,colIndex:Number,layerIndex:Number,selectedShelfType:String,goodsData:Object},data(){return{pathname:"bin/",pathnamecontainer:"container/locationdetail/",container_id:123456,container_code:0,results:[],location_status_display:"库位空闲",storage_form:[],elevator_form:{ip:"",port:8080,status:"未连接"},conveyor_form:{ip:"",port:8080,status:"未连接"},showInventoryDetails:!0,inventoryDetails:[{id:1,batch:"",quantity:0,location:""},{id:2,batch:"",quantity:0,location:""}],columns_batch:[{name:"bound_number",label:"批次",field:t=>t.bound_number,align:"center"},{name:"plan_weight",label:"当前库位容纳重量",field:t=>t.total_batch_qty,align:"center"}],columns_results:[{label:"物料编码",field:t=>t.goods_code,align:"center"},{label:"物料名称",field:t=>t.goods_desc,align:"center"},{label:"物料批次",field:t=>t.bound_number,align:"center"},{label:"每件重量",field:t=>t.goods_qty,align:"center"},{label:"件数",field:t=>t.group_qty,align:"center"},{label:"批次计划重量",field:t=>t.batch_total_qty,align:"center"},{label:"在库重量",field:t=>t.batch_total_in_qty,align:"center"},{label:"录入时间",field:t=>t.create_time.slice(0,10),align:"center"}],inventoryColumns:[{name:"batch",label:"批次",field:"batch",align:"left"},{name:"quantity",label:"数量",field:"quantity",align:"right"},{name:"location",label:"位置",field:"location",align:"left"}],user_id:"",auth_id:"",onlyread:!0,clickedinput:!1,storage_dialog:!1,elevator_dialog:!1,conveyor_dialog:!1,bgColor:"transparent",shelf_type:{shelf_type:"undefined"},ip_change:{ip_address:"192.168.1.100",port:8080,status:"offline"},goods_change:{shelf_status:"未满",goods_batch:"20230701-001",goods_code:"A010203",goods_name:"存货货物",goods_std:"规格型号",goods_desc:"存货描述",goods_qty:123456,goods_unit:"kg",goods_price:123456,goods_notes:"备注",goods_in:123456,goods_out:123456},error1:this.$t("stock.shelf.error1"),shelfLocal:"",activeTab:"tab2",start_loc:{layer:1,row:1,col:1},target_loc:{layer:1,row:1,col:1},release_dialog:!1,current_location:{layer:this.layerIndex,row:this.rowIndex,col:this.colIndex},move_dialog:!1,layerOptions:Array.from({length:3},((t,e)=>({label:`${e+1}层`,value:e+1}))),rowOptions:Array.from({length:17},((t,e)=>({label:`${e+1}行`,value:e+1}))),colOptions:Array.from({length:29},((t,e)=>({label:`${e+1}列`,value:e+1}))),userComponentPermissions:[],login_mode:r["a"].getItem("login_mode")}},created(){this.loadUserPermissions(),this.shelfLocal=this.selectedShelfType,this.handleclick()},methods:{loadUserPermissions(){Object(n["h"])("staff/role-comPermissions/"+this.login_mode+"/",{page:"/stock/management"}).then((t=>{this.userComponentPermissions=t}),(t=>{this.$q.notify({type:"negative",message:"加载用户权限失败,"+t.message})}))},hasPermission(t){if(!this.userComponentPermissions)return!1;const e=this.userComponentPermissions.find((e=>e.component===t));return e&&e.enabled},prepareDialog(){this.onlyread=!0},formatLocation(t){return`W01-${t.row.toString().padStart(2,"0")}-${t.col.toString().padStart(2,"0")}-${t.layer.toString().padStart(2,"0")}`},showReleaseDialog(){this.container_code?this.location_status_display=`托盘: ${this.container_code} - 占用中`:this.location_status_display="库位空闲",this.current_location={layer:this.layerIndex,row:this.rowIndex,col:this.colIndex},this.release_dialog=!0},async confirmRelease(){try{const t=this.formatLocation(this.current_location),e={location_release:t},s=await Object(n["h"])("container/location_release/",e);if("200"!==s.code)throw new Error(s.message||"释放操作失败");this.$q.notify({color:"positive",message:"库位释放成功",icon:"check_circle"}),this.container_code="",this.storage_form=[],this.results=[],this.release_dialog=!1,this.$emit("location-released")}catch(t){console.error("库位释放失败",t),this.$q.notify({color:"negative",message:"库位释放失败",caption:t.message||"请检查网络连接"})}},showMoveDialog(){this.start_loc={layer:this.layerIndex,row:this.rowIndex,col:this.colIndex},this.target_loc={...this.start_loc},this.move_dialog=!0},async confirmMove(){const t={container_code:this.container_code,start_location:this.formatLocation(this.start_loc),target_location:this.formatLocation(this.target_loc)};try{const e=await Object(n["h"])("container/container_wcs/",t);console.log("托盘移动指令发送成功",e),"200"===e.code&&(this.$q.notify({color:"positive",message:"托盘移动指令已发送"}),this.move_dialog=!1)}catch(e){console.error("托盘移动失败",e),this.$q.notify({color:"negative",message:"托盘移动失败",caption:e.message||"请检查网络连接"})}},handleclick(){this.shelfLocal=this.selectedShelfType,"undefined"===this.shelfLocal&&(this.clickedinput=!0,this.storage_dialog=!1,this.elevator_dialog=!1,this.conveyor_dialog=!1),"storage"===this.shelfLocal&&(this.getList(),this.clickedinput=!1,this.storage_dialog=!0,this.elevator_dialog=!1,this.conveyor_dialog=!1),"elevator"===this.shelfLocal&&(this.getList(),this.clickedinput=!1,this.storage_dialog=!1,this.elevator_dialog=!0,this.conveyor_dialog=!1),"conveyor"===this.shelfLocal&&(this.getList(),this.clickedinput=!1,this.storage_dialog=!1,this.elevator_dialog=!1,this.conveyor_dialog=!0)},getList(){var t=this;t.storage_form=[],t.results=[],t.inventoryDetails=[{id:1,batch:"",quantity:0,location:""},{id:2,batch:"",quantity:0,location:""}],Object(n["e"])(t.pathname+t.goodsData.id+"/").then((e=>{if(console.log(e),console.log(e.current_containers),0===e.current_containers.length)return console.log("当前托盘ID为空"),t.$q.notify({message:"当前库位为空",icon:"info",color:"info"}),t.container_code="",t.storage_form=[],void(t.results=[]);t.container_id=e.current_containers[0].id,t.container_code=e.current_containers[0].container_code,console.log("当前托盘ID",t.container_id),console.log("当前托盘ID长度",e.current_containers.length),Object(n["e"])(t.pathnamecontainer+"?container="+t.container_id).then((t=>{var e=t.data;this.storage_form=e.batch_totals,this.results=e.results}))})).catch((e=>{t.$q.notify({message:e.detail,icon:"close",color:"negative"})}))}}},d=c,u=(s("aa31"),s("42e1")),h=s("24e8"),_=s("f09f"),p=s("d847"),m=s("2c91"),g=s("9c40"),v=s("a370"),y=s("66e5"),f=s("4074"),b=s("0170"),w=s("eb85"),C=s("4b7e"),q=s("ddd8"),k=s("429b"),x=s("7460"),S=s("adad"),$=s("823b"),I=s("eaac"),D=s("e7a9"),P=s("05c0"),R=s("27f9"),T=s("8572"),L=s("7f67"),Q=s("eebe"),z=s.n(Q),G=Object(u["a"])(d,i,l,!1,null,"131144c6",null),j=G.exports;z()(G,"components",{QDialog:h["a"],QCard:_["a"],QBar:p["a"],QSpace:m["a"],QBtn:g["a"],QCardSection:v["a"],QItem:y["a"],QItemSection:f["a"],QItemLabel:b["a"],QSeparator:w["a"],QCardActions:C["a"],QSelect:q["a"],QTabs:k["a"],QTab:x["a"],QTabPanels:S["a"],QTabPanel:$["a"],QTable:I["a"],QBtnGroup:D["a"],QTooltip:P["a"],QInput:R["a"],QField:T["a"]}),z()(G,"directives",{ClosePopup:L["a"]});var O=s("bd4c"),F={name:"LocationManagement",components:{goodscard:j},data(){return{pathname:"bin/",warehouse_code:"",warehouse_name:"",shelf_name:"A区货架",shelf:{rows:17,cols:29,layers:3,layer_now:1},filter:"",auth_edit:!1,goodsMap:{},goodsMatrix:[],binColors:{T1:"#FFD700",T2:"#FFA500",T4:"#FF7300",T5:"#FF4100",S4:"#FF7300",M1:"#C8C8C8",E1:"#80620B",C1:"#808780",B1:"#00C300",reserved:"rgba(20, 125, 200, 0.3)",occupied:"rgba(20, 125, 255, 0.6)",default:"rgba(200, 200, 200, 0.3)"},showInventoryDetails:!1,select_Inventory:{rowIndex:0,colIndex:0,layerIndex:0,shelf_type:"storage",goods_data:{}},showInventoryStatus:!0,userComponentPermissions:[],login_mode:r["a"].getItem("login_mode"),stats:{},statsLoaded:!1,typeList:[{key:"t5",label:"T5",totalKey:"t5_total",usedKey:"t5_used",availKey:"t5_available"},{key:"t4",label:"T4",totalKey:"t4_total",usedKey:"t4_used",availKey:"t4_available"},{key:"s4",label:"S4",totalKey:"s4_total",usedKey:"s4_used",availKey:"s4_available"},{key:"t2",label:"T2",totalKey:"t2_total",usedKey:"t2_used",availKey:"t2_available"},{key:"t1",label:"T1",totalKey:"t1_total",usedKey:"t1_used",availKey:"t1_available"}],checking:!1,showCheckDialog:!1,checkResult:null,checkColumns:[{name:"location_code",label:"位置编码",field:"location_code",align:"left"},{name:"layer",label:"层",field:"layer",align:"center",style:"width:60px"},{name:"row",label:"行",field:"row",align:"center",style:"width:60px"},{name:"col",label:"列",field:"col",align:"center",style:"width:60px"},{name:"current_status",label:"当前状态",field:"current_status",align:"left"},{name:"expected_status",label:"期望状态",field:"expected_status",align:"left"},{name:"detected_at",label:"检测时间",field:"detected_at",align:"left"},{name:"actions",label:"操作",field:"actions",align:"center",style:"width:100px"}],showGroupStatsDialog:!1,showGroupStatsResult:!1,loadingGroupStats:!1,groupStatsParams:{min_utilization:100,min_used_locations:2},groupStatsResult:null,groupStatsColumns:[{name:"location_group",label:"货位组",field:"location_group",align:"left",sortable:!0},{name:"warehouse_display",label:"仓库",field:"warehouse_display",align:"left",sortable:!0},{name:"layer_display",label:"楼层",field:"layer_display",align:"center",sortable:!0},{name:"total_locations",label:"总货位数",field:"total_locations",align:"center",sortable:!0},{name:"used_locations",label:"已使用",field:"used_locations",align:"center",sortable:!0},{name:"available_locations",label:"可用数",field:"available_locations",align:"center",sortable:!0},{name:"utilization_rate",label:"使用率",field:"utilization_rate",align:"center",sortable:!0},{name:"statistic_time",label:"统计时间",field:"statistic_time",align:"center",sortable:!0},{name:"actions",label:"操作",field:"actions",align:"center"}],groupStatsPagination:{page:1,rowsPerPage:10,rowsNumber:0}}},methods:{openGroupStatsDialog(){this.showGroupStatsDialog=!0},getGroupStatistics(){const t=this.shelf.layer_now||1,e=new URLSearchParams({layer:t,min_utilization:this.groupStatsParams.min_utilization||0,min_used_locations:this.groupStatsParams.min_used_locations||0}),s=`location_statistics/group-statistics/?${e}`;this.loadingGroupStats=!0,Object(n["e"])(s).then((t=>{var e;this.groupStatsResult=t||{},this.groupStatsPagination.rowsNumber=(null===(e=this.groupStatsResult.filters)||void 0===e?void 0:e.total_records)||0,this.showGroupStatsDialog=!1,this.showGroupStatsResult=!0})).catch((t=>{console.error("获取货位组统计失败",t),this.$q.notify({type:"negative",message:"获取货位组统计失败: "+((null===t||void 0===t?void 0:t.message)||"未知错误")})})).finally((()=>{this.loadingGroupStats=!1}))},onGroupStatsRequest(t){var e;const{page:s,rowsPerPage:a}=t.pagination;if(this.groupStatsPagination.page=s,this.groupStatsPagination.rowsPerPage=a,null!==(e=this.groupStatsResult)&&void 0!==e&&e.data){const t=(s-1)*a,e=t+a;this.groupStatsResult.displayData=this.groupStatsResult.data.slice(t,e)}},highlightGroupLocation(t){this.$q.notify({message:`定位到货位组: ${t.location_group}`,color:"primary"})},exportGroupStats(){var t;if(null===(t=this.groupStatsResult)||void 0===t||!t.data)return;const e=JSON.stringify(this.groupStatsResult,null,2),s=new Blob([e],{type:"application/json"}),a=document.createElement("a");a.href=URL.createObjectURL(s),a.download=`group-statistics-${(new Date).toISOString().split("T")[0]}.json`,a.click()},getUtilizationColor(t){const e=Number(t)||0;return e<30?"positive":e<70?"warning":"negative"},formatPercent(t){if(void 0===t||null===t||""===t)return"0%";const e=Number(t);return Number.isNaN(e)?"0%":`${e.toFixed(1)}%`},exportCheckReport(){if(!this.checkResult)return;const t=JSON.stringify(this.checkResult,null,2),e=new Blob([t],{type:"application/json"}),s=document.createElement("a");s.href=URL.createObjectURL(e),s.download=`location-check-report-${(new Date).toISOString().split("T")[0]}.json`,s.click()},highlightLocation(t){var e;t&&(this.select_Inventory.rowIndex=t.row,this.select_Inventory.colIndex=t.col,this.select_Inventory.layerIndex=t.layer,this.select_Inventory.goods_data=this.goodsMap[`${t.row}-${t.col}-${t.layer}`]||{},this.select_Inventory.shelf_type=null!==(e=this.select_Inventory.goods_data)&&void 0!==e&&e.location_type?"storage":"corridor",this.showInventoryDetails=!0,this.$nextTick((()=>{this.$refs.goodscard.handleclick()})))},openLocationDetail(t){this.$q.notify({message:`打开位置 ${t.location_code} 的详情`})},loadUserPermissions(){Object(n["h"])("staff/role-comPermissions/"+this.login_mode+"/",{page:"/stock/management"}).then((t=>{this.userComponentPermissions=t}),(t=>{this.$q.notify({type:"negative",message:"加载用户权限失败,"+t.message})}))},hasPermission(t){if(!this.userComponentPermissions)return!1;const e=this.userComponentPermissions.find((e=>e.component===t));return e&&e.enabled},runCheck(){const t=this.shelf.layer_now||1,e=`/location_statistics/CheckView/?layer=${t}`;this.checking=!0,Object(n["h"])(e,{}).then((t=>{t&&t.data?!1===t.data.success?(this.$q.notify({type:"negative",message:"校验返回失败"}),this.checkResult=null):(this.checkResult=t.data.data||t.data,this.showCheckDialog=!0):this.$q.notify({type:"warning",message:"校验无返回内容"})})).catch((t=>{this.$q.notify({type:"negative",message:"校验请求失败: "+(t&&t.message)})})).finally((()=>{this.checking=!1}))},shouldShowButton(t,e,s){const a=this.goodsMap[`${t}-${e}-${s}`];return["T1","T2","T4","T5","S4","M1","E1","C1","B1"].includes(null===a||void 0===a?void 0:a.location_type)},getList(){var t=this;Object(n["h"])(t.pathname+"check/",{layer:t.shelf.layer_now,warehouse_code:t.warehouse_code}).then((e=>{t.goodsMap={},e.data.forEach((e=>{const s=`${e.row}-${e.col}-${e.layer}`;t.goodsMap[s]={id:e.id,location_type:e.location_type,shelf_type:e.shelf_type,status:e.status,check:e.batch_statuses}})),t.$q.notify({message:"刷新成功",icon:"done",color:"positive"})}))},handle_setting(){r["a"].has("warehouse_code")&&(this.warehouse_code=r["a"].getItem("warehouse_code")),r["a"].has("warehouse_name")&&(this.warehouse_name=r["a"].getItem("warehouse_name"))},formatDateTime(t){return t?!t.includes("T")||t.includes("no_check_time")?t:O["b"].formatDate(new Date(t),"YYYY-MM-DD HH:mm:ss"):""},getBinbatch(t,e,s){const a=this.goodsMap[`${t}-${e}-${s}`];return a&&a.check&&0!==a.check.length?a.check.map((t=>"404"===t[0]?{status:404,time:"no_check_time",batchId:"no_batch"}:{status:t[0],time:t[1],batchId:t[2],qty:t[3]})):[{status:404,time:"",batchId:""}]},getStatusIcon(t){switch(t){case 0:return"schedule";case 1:return"check_circle";case 2:return"cancel";case 404:return"block";default:return"help"}},getStatusColor(t){switch(t){case 0:return"yellow";case 1:return"green";case 2:return"red";case 404:return"grey";default:return"blue"}},getStatusLabel(t){switch(t){case 0:return"待检";case 1:return"合格";case 2:return"不合格";case 404:return"无货";default:return"无货"}},getBinColor(t,e,s){const a=this.goodsMap[`${t}-${e}-${s}`];if(this.showInventoryStatus){if(!a||!a.check||0===a.check.length)return"#CCCCCC";const t=a.check[0][0],e={0:"#FFD700",1:"#00FF00",2:"#FF0000",404:"#CCCCCC"};return e[t]||"#CCCCCC"}return a?"reserved"==a.status||"occupied"==a.status?this.binColors[a.status]:this.binColors[a.location_type]||"#CCCCCC":"#CCCCCC"},handleBinClick(t,e,s){var a;this.select_Inventory.rowIndex=t,this.select_Inventory.colIndex=e,this.select_Inventory.layerIndex=s;const o=null===(a=this.goodsMap[`${t}-${e}-${s}`])||void 0===a?void 0:a.location_type;["T1","T2","T4","T5","S4"].includes(o)?this.select_Inventory.shelf_type="storage":["E1","C1"].includes(o)?this.select_Inventory.shelf_type="elevator":this.select_Inventory.shelf_type="corridor",this.select_Inventory.goods_data=this.goodsMap[`${t}-${e}-${s}`],this.showInventoryDetails=!0,this.$nextTick((()=>{this.$refs.goodscard.handleclick()}))},handleShelfDown(){this.shelf.layer_now>this.shelf.layers&&(this.shelf.layer_now=this.shelf.layers),this.shelf.layer_now>1&&(this.shelf.layer_now-=1,this.reFresh())},handleShelfUp(){this.shelf.layer_now<this.shelf.layers?(this.shelf.layer_now+=1,this.reFresh()):this.shelf.layer_now=this.shelf.layers},reFresh(){this.handle_setting(),this.getList(),this.getStatistics()},handle_edit(){this.auth_edit=!this.auth_edit,r["a"].set("auth_edit",this.auth_edit)},getStatistics(){const t=this.shelf.layer_now||1,e=`location_statistics/refresh-statistics/?layer=${t}`;this.statsLoaded=!1,Object(n["e"])(e).then((t=>{const e=t.data&&(t.data.data||t.data),s=Array.isArray(e)&&e.length?e[0]:t.data||{};this._applyStats(s),this.statsLoaded=!0})).catch((t=>{console.warn("获取统计失败",t&&t.message),this.statsLoaded=!0}))},reFreshStatistics(){const t=this.shelf.layer_now||1,e=`location_statistics/refresh-statistics/?layer=${t}`;Object(n["h"])(e)},_applyStats(t){if(this.stats=t||{},this.stats.statistic_time)try{this.stats.statistic_time_display=this.formatDateTime(this.stats.statistic_time)}catch(e){this.stats.statistic_time_display=this.stats.statistic_time}else this.stats.statistic_time_display=""},updateCSSVariables(){const t=document.documentElement,e=document.documentElement.clientWidth,s=document.documentElement.clientHeight,a=.6*e,o=.6*s;var i=8.5*a/10/this.shelf.cols,l=1*i/5,n=l/2,r=o/this.shelf.rows-i;r<2&&(r=2,i=(o-r*this.shelf.rows)/this.shelf.rows,l=3*i/5,n=l/2);var c=r/2,d=l*this.shelf.cols+i*this.shelf.cols;t.style.setProperty("--cell-d",`${i}px`),t.style.setProperty("--cell-d-x",`${i+l}px`),t.style.setProperty("--cell-x-2",`${n}px`),t.style.setProperty("--cell-x",`${l}px`),t.style.setProperty("--cell-y",`${r+i}px`),t.style.setProperty("--cell-y-2",`${c}px`),t.style.setProperty("--axis-x",`${d}px`)},handleResize(){clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((()=>{this.updateCSSVariables()}),200)}},mounted(){this.updateCSSVariables(),window.addEventListener("resize",this.handleResize)},beforeUnmount(){this.goodsMap={},this.goodsMatrix=[],window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimer),this.$refs.goodscard&&this.$refs.goodscard.$destroy()},created(){r["a"].set("auth_edit",this.auth_edit),this.loadUserPermissions(),this.handle_setting(),this.getList(),this.getStatistics()}},B=F,M=(s("ff51"),s("65c6")),N=s("9564"),K=s("9989"),E=s("0016"),U=s("6b1d"),A=s("8380"),J=s("58a81"),V=s("db86"),Y=Object(u["a"])(B,a,o,!1,null,"737da33f",null);e["default"]=Y.exports;z()(Y,"components",{QToolbar:M["a"],QBtnGroup:D["a"],QBtn:g["a"],QInput:R["a"],QTooltip:P["a"],QSeparator:w["a"],QToggle:N["a"],QPage:K["a"],QIcon:E["a"],QCard:_["a"],QCardSection:v["a"],QLinearProgress:U["a"],QSpinnerDots:A["a"],QDialog:h["a"],QBadge:J["a"],QTable:I["a"],QCardActions:C["a"],QSpace:m["a"],QTd:V["a"]})},aa31:function(t,e,s){"use strict";s("2304")},ff51:function(t,e,s){"use strict";s("260b")}}]);