1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[3],{"53ea":function(e,t,o){},"7c1d":function(e,t,o){"use strict";o.r(t);var s=function(){var e=this,t=e._self._c;return t("div",[t("q-toolbar",{staticClass:"row items-center"},[t("q-btn-group",{staticClass:"btn-group",attrs:{push:""}},[t("q-btn",{attrs:{label:e.$t("stock.shelf.shelf_up"),icon:"upload"},on:{click:function(t){return e.handleShelfUp()}}}),t("div",{staticClass:"self-center text-center q-px-sm"},[e._v("\n "+e._s(e.$t("stock.layertip"))+"\n ")]),t("q-input",{staticStyle:{width:"50px"},attrs:{dense:"",color:"primary"},model:{value:e.shelf.layer_now,callback:function(t){e.$set(e.shelf,"layer_now",t)},expression:"shelf.layer_now"}}),t("q-btn",{attrs:{label:e.$t("stock.shelf.shelf_down"),icon:"download"},on:{click:function(t){return e.handleShelfDown()}}}),t("q-btn",{attrs:{label:e.$t("refresh"),icon:"refresh"},on:{click:function(t){return e.reFresh()}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("refreshtip"))+"\n ")])],1),t("q-separator"),t("q-btn",{attrs:{label:e.$t("stock.edit"),icon:"edit"},on:{click:function(t){return e.handle_edit()}}})],1),e.showInventoryDetails?t("goodscard",{ref:"goodscard",attrs:{"col-index":e.select_Inventory.colIndex,"row-index":e.select_Inventory.rowIndex,"layer-index":e.select_Inventory.layerIndex,"selected-shelf-type":e.select_Inventory.shelf_type,"goods-data":e.select_Inventory.goods_data},on:{close:function(t){e.showInventoryDetails=!1}}}):e._e()],1),t("q-page",{staticClass:"q-pa-md"},[t("div",{staticClass:"grid-system"},[t("div",{staticClass:"axis y-axis"},[t("div",{staticClass:"axis-numbers"},e._l(e.shelf.rows,(function(o){return t("div",{key:"y"+o},[e._v("\n "+e._s(o)+"\n ")])})),0),t("div",{staticClass:"axis-arrow"})]),t("div",{staticClass:"axis x-axis"},[t("div",{staticClass:"axis-arrow"}),t("div",{staticClass:"axis-numbers"},[e._l(e.shelf.cols,(function(o){return t("div",{key:"x"+o,staticClass:"axis-label"},[e._v("\n "+e._s(o)+"\n ")])})),t("div",{staticClass:"axis-label"})],2)]),t("div",{staticClass:"grid-container"},[t("div",{staticClass:"grid-content"},e._l(e.shelf.rows,(function(o,s){return t("div",{key:`row-${s}|${e.shelf.layer_now}`,staticClass:"grid-row",style:{cursor:"pointer"}},e._l(e.shelf.cols,(function(o,a){return t("div",{key:`col-${a}|${e.shelf.layer_now}`,staticClass:"grid-item",style:{cursor:"pointer"}},[e.shouldShowButton(e.shelf.rows-s,a+1,e.shelf.layer_now)?t("div",{key:`${e.shelf.rows-s}-${a}-${e.shelf.layer_now}`,staticClass:"select-item",style:{border:"1px solid #ccc",borderRadius:"5px",width:"var(--cell-d)",height:"var(--cell-d)",backgroundColor:e.getBinColor(e.shelf.rows-s,a+1,e.shelf.layer_now),cursor:"pointer"},on:{click:function(t){return e.handleBinClick(e.shelf.rows-s,a+1,e.shelf.layer_now)}}}):e._e(),e.shouldShowButton(e.shelf.rows-s,a+1,e.shelf.layer_now)?t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 10px"}},[e._v("\n "+e._s(e.$t("stock.rowtip"))+" "+e._s(e.shelf.rows-s)+"\n "+e._s(e.$t("stock.coltip"))+" "+e._s(a+1)+"\n ")]):e._e()],1)})),0)})),0)])])])],1)},a=[],l=(o("caad"),function(){var e=this,t=e._self._c;return t("div",{style:{backgroundColor:e.bgColor}},[t("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},on:{show:function(t){return e.prepareDialog()}},model:{value:e.storage_dialog,callback:function(t){e.storage_dialog=t},expression:"storage_dialog"}},[t("q-card",{staticStyle:{"min-width":"600px"}},[t("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[t("div",[e._v("\n "+e._s(e.$t("stock.shelf.shelf_details"))+" "+e._s(e.rowIndex)+"-"+e._s(e.colIndex)+"-"+e._s(e.layerIndex)+"\n ")]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("index.close")))])],1)],1),t("q-card-section",{staticClass:"q-pt-md"},[t("q-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[t("q-tab",{attrs:{name:"tab1",label:"货架属性"}}),t("q-tab",{attrs:{name:"tab2",label:"批次信息"}}),t("q-tab",{attrs:{name:"tab3",label:"库存明细"}})],1)],1),t("q-tab-panels",{attrs:{animated:""},model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[t("q-tab-panel",{staticStyle:{height:"300px"},attrs:{name:"tab1"}},[t("div",{staticClass:"row q-gutter-x-md"},[t("div",{staticClass:"col column q-gutter-y-md"},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_code"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_code,callback:function(t){e.$set(e.storage_form,"goods_code",t)},expression:"storage_form.goods_code"}})],1),t("div",{staticClass:"col column q-gutter-y-md"},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_name"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_name,callback:function(t){e.$set(e.storage_form,"goods_name",t)},expression:"storage_form.goods_name"}})],1)])]),t("q-tab-panel",{staticStyle:{height:"300px"},attrs:{name:"tab2"}},[t("div",{staticClass:"row q-gutter-x-md"},[t("div",{staticClass:"col column q-gutter-y-md"},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_code"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_code,callback:function(t){e.$set(e.storage_form,"goods_code",t)},expression:"storage_form.goods_code"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_batch"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_batch,callback:function(t){e.$set(e.storage_form,"goods_batch",t)},expression:"storage_form.goods_batch"}}),t("q-input",{staticClass:"col",attrs:{dense:"",outlined:"",square:"",label:"批次总数",readonly:e.onlyread,rules:[t=>t>=0||e.error1]},model:{value:e.storage_form.goods_qty,callback:function(t){e.$set(e.storage_form,"goods_qty",t)},expression:"storage_form.goods_qty"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_desc"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_desc,callback:function(t){e.$set(e.storage_form,"goods_desc",t)},expression:"storage_form.goods_desc"}})],1),t("div",{staticClass:"col column q-gutter-y-md"},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_name"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_name,callback:function(t){e.$set(e.storage_form,"goods_name",t)},expression:"storage_form.goods_name"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_std"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_std,callback:function(t){e.$set(e.storage_form,"goods_std",t)},expression:"storage_form.goods_std"}}),t("q-input",{staticClass:"col",attrs:{dense:"",outlined:"",square:"",label:"库位容纳",readonly:e.onlyread,rules:[t=>t>=0||e.error1]},model:{value:e.storage_form.goods_notes,callback:function(t){e.$set(e.storage_form,"goods_notes",t)},expression:"storage_form.goods_notes"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.shelf.goods_unit"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.storage_form.goods_unit,callback:function(t){e.$set(e.storage_form,"goods_unit",t)},expression:"storage_form.goods_unit"}})],1)])]),t("q-tab-panel",{staticStyle:{height:"300px"},attrs:{name:"tab3"}},[t("div",{staticClass:"row q-gutter-x-md"},[t("div",{staticClass:"col column q-gutter-y-md"}),t("div",{staticClass:"col column q-gutter-y-md"})])])],1),t("div",{staticStyle:{position:"absolute",right:"20px",bottom:"12px","z-index":"100"}},[t("q-btn-group",{attrs:{push:""}},[t("q-btn",{attrs:{color:"white","text-color":"black"},on:{click:function(t){e.shelfLocal="undefined",e.handleclick()}}},[e._v("\n "+e._s(e.$t("stock.return"))+"\n ")]),t("q-btn",{attrs:{color:"white","text-color":"black"},on:{click:function(t){e.showInventoryDetails=!e.showInventoryDetails}}},[e._v("\n "+e._s(e.$t("stock.details"))+"\n ")]),t("q-btn",{attrs:{color:"primary","text-color":"white"},on:{click:function(t){return e.handleEdit()}}},[e._v("\n "+e._s(e.onlyread?e.$t("stock.shelf.shelf_edit"):e.$t("stock.shelf.shelf_confirm"))+"\n ")])],1)],1),t("div",{staticStyle:{float:"right",padding:"15px 15px 50px 15px","min-width":"100%"},attrs:{flow:"row wrap"}},[e.showInventoryDetails?t("q-card",{staticClass:"q-mb-md",attrs:{bordered:""}},[t("q-card-actions",{staticClass:"q-px-none",staticStyle:{position:"absolute",right:"20px",top:"10px","z-index":"100"}},[e.onlyread?e._e():t("q-btn",{attrs:{icon:"add",flat:"",dense:"",color:"primary",label:e.$t("stock.add")},on:{click:function(t){return e.addInventoryDetail()}}}),e.onlyread?e._e():t("q-btn",{attrs:{icon:"delete",flat:"",dense:"",color:"primary",label:e.$t("stock.delete")},on:{click:function(t){return e.deleteInventoryDetail()}}})],1),t("q-card-section",[t("div",{staticClass:"text-h6 q-mb-md"},[e._v(e._s(e.$t("stock.inventory_details")))]),e._l(e.inventoryDetails,(function(o,s){return t("div",{key:s,staticClass:"row q-col-gutter-md q-mb-sm"},[t("div",{staticClass:"col"},[t("q-input",{attrs:{label:e.$t("stock.batch"),readonly:e.onlyread,dense:"",outlined:""},model:{value:o.id,callback:function(t){e.$set(o,"id",t)},expression:"detail.id"}})],1),t("div",{staticClass:"col"},[t("q-input",{attrs:{label:e.$t("stock.quantity"),readonly:e.onlyread,type:"number",dense:"",outlined:""},model:{value:o.quantity,callback:function(t){e.$set(o,"quantity",t)},expression:"detail.quantity"}})],1),t("div",{staticClass:"col"},[t("q-input",{attrs:{label:e.$t("stock.location"),readonly:e.onlyread,dense:"",standout:"",outlined:""},model:{value:o.location,callback:function(t){e.$set(o,"location",t)},expression:"detail.location"}})],1)])}))],2)],1):e._e()],1)],1)],1),t("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},on:{show:function(t){return e.prepareDialog()}},model:{value:e.elevator_dialog,callback:function(t){e.elevator_dialog=t},expression:"elevator_dialog"}},[t("q-card",{staticStyle:{"min-width":"350px"}},[t("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[t("div",[e._v("\n "+e._s(e.$t("stock.elevator.elevator"))+"\n ")]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("index.close")))])],1)],1),t("q-card-section",{staticClass:"q-pt-md"},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.elevator.ip"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.elevator_form.ip,callback:function(t){e.$set(e.elevator_form,"ip",t)},expression:"elevator_form.ip"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.elevator.port"),type:"number",readonly:e.onlyread,rules:[t=>null!==t||e.error1,t=>t>=0||e.error1]},model:{value:e.elevator_form.port,callback:function(t){e.$set(e.elevator_form,"port",t)},expression:"elevator_form.port"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.conveyor.status"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.elevator_form.status,callback:function(t){e.$set(e.elevator_form,"status",t)},expression:"elevator_form.status"}})],1),t("div",{staticStyle:{float:"right",padding:"15px 15px 15px 0"}},[t("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"white","text-color":"black"},on:{click:function(t){e.shelfLocal="undefined",e.handleclick()}}},[e._v("\n "+e._s(e.$t("stock.return")))]),t("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"primary","text-color":"white"},on:{click:function(t){return e.handleEdit()}}},[e._v("\n "+e._s(e.onlyread?e.$t("stock.shelf.shelf_edit"):e.$t("stock.shelf.shelf_confirm")))])],1)],1)],1),t("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},on:{show:function(t){return e.prepareDialog()}},model:{value:e.conveyor_dialog,callback:function(t){e.conveyor_dialog=t},expression:"conveyor_dialog"}},[t("q-card",{staticStyle:{"min-width":"350px"}},[t("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[t("div",[e._v("\n "+e._s(e.$t("stock.conveyor.conveyor"))+"\n ")]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("index.close")))])],1)],1),t("q-card-section",{staticClass:"q-pt-md"},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.conveyor.ip"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.conveyor_form.ip,callback:function(t){e.$set(e.conveyor_form,"ip",t)},expression:"conveyor_form.ip"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.elevator.port"),type:"number",readonly:e.onlyread,rules:[t=>null!==t||e.error1,t=>t>=0||e.error1]},model:{value:e.conveyor_form.port,callback:function(t){e.$set(e.conveyor_form,"port",t)},expression:"conveyor_form.port"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("stock.conveyor.status"),readonly:e.onlyread,rules:[t=>(null===t||void 0===t?void 0:t.length)>0||e.error1]},model:{value:e.conveyor_form.status,callback:function(t){e.$set(e.conveyor_form,"status",t)},expression:"conveyor_form.status"}})],1),t("div",{staticStyle:{float:"right",padding:"15px 15px 15px 0"}},[t("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"white","text-color":"black"},on:{click:function(t){e.shelfLocal="undefined",e.handleclick()}}},[e._v("\n "+e._s(e.$t("stock.return")))]),t("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"primary","text-color":"white"},on:{click:function(t){return e.handleEdit()}}},[e._v("\n "+e._s(e.onlyread?e.$t("stock.shelf.shelf_edit"):e.$t("stock.shelf.shelf_confirm")))])],1)],1)],1)],1)}),r=[],n=o("18d6"),i=o("3004"),d={props:{rowIndex:Number,colIndex:Number,layerIndex:Number,selectedShelfType:String,goodsData:Object},data(){return{pathname:"bin/",pathnamecontainer:"container/detail/",container_id:123456,results:[],storage_form:{shelf_name:"",shelf_department:"",shelf_warehouse:"",shelf_status:"",goods_code:"",goods_name:"",goods_std:"",goods_desc:"",goods_qty:"",goods_unit:"",goods_price:"",goods_batch:"",goods_notes:"",goods_in:"",goods_out:""},elevator_form:{ip:"",port:8080,status:"未连接"},conveyor_form:{ip:"",port:8080,status:"未连接"},showInventoryDetails:!1,inventoryDetails:[{id:1,batch:"",quantity:0,location:""},{id:2,batch:"",quantity:0,location:""}],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"}},created(){this.shelfLocal=this.selectedShelfType,this.handleclick()},methods:{prepareDialog(){this.onlyread=!0},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 e=this;e.storage_form={shelf_name:"",shelf_department:"",shelf_warehouse:"",shelf_status:"",goods_code:"",goods_name:"",goods_std:"",goods_desc:"",goods_qty:0,goods_unit:"",goods_price:0,goods_batch:"",goods_notes:0,goods_in:0,goods_out:0},e.inventoryDetails=[{id:1,batch:"",quantity:0,location:""},{id:2,batch:"",quantity:0,location:""}],Object(i["e"])(e.pathname+e.goodsData.id+"/").then((t=>{if(console.log(t),console.log(t.current_containers),0==t.current_containers.length)return console.log("当前托盘ID为空"),void e.$q.notify({message:"当前库位为空",icon:"info",color:"info"});e.container_id=t.current_containers[0].id,console.log("当前托盘ID",e.container_id),console.log("当前托盘ID长度",t.current_containers.length),Object(i["e"])(e.pathnamecontainer+"?container="+e.container_id).then((e=>{var t=e.results[0];this.storage_form.goods_batch=t.batch.bound_number,this.storage_form.goods_code=t.batch.goods_code,this.storage_form.goods_name=t.batch.goods_desc,this.storage_form.goods_std=t.batch.goods_std,this.storage_form.goods_desc=t.batch.goods_desc,this.storage_form.goods_qty=t.batch.goods_qty,this.storage_form.goods_unit=t.batch.goods_unit,this.storage_form.goods_price=t.batch.goods_price,this.storage_form.goods_notes=t.goods_qty,this.storage_form.goods_in=t.batch.goods_in,this.storage_form.goods_out=t.batch.goods_out,this.storage_form.shelf_name=t.shelf_name,this.storage_form.shelf_department=t.shelf_department,this.storage_form.shelf_warehouse=t.warehouse_name,this.storage_form.shelf_status=t.status}))})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))}}},c=d,h=(o("bae9"),o("42e1")),u=o("24e8"),_=o("f09f"),g=o("d847"),f=o("2c91"),p=o("9c40"),m=o("05c0"),y=o("a370"),b=o("429b"),v=o("7460"),x=o("adad"),q=o("823b"),w=o("27f9"),k=o("e7a9"),$=o("4b7e"),C=o("8572"),I=o("7f67"),S=o("eebe"),T=o.n(S),D=Object(h["a"])(c,l,r,!1,null,"623ad4f4",null),Q=D.exports;T()(D,"components",{QDialog:u["a"],QCard:_["a"],QBar:g["a"],QSpace:f["a"],QBtn:p["a"],QTooltip:m["a"],QCardSection:y["a"],QTabs:b["a"],QTab:v["a"],QTabPanels:x["a"],QTabPanel:q["a"],QInput:w["a"],QBtnGroup:k["a"],QCardActions:$["a"],QField:C["a"]}),T()(D,"directives",{ClosePopup:I["a"]});var L={components:{goodscard:Q},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:"rgba(255, 215, 0, 0.5)",T2:"rgba(255, 165, 0, 0.5)",T4:"rgba(255, 115, 0, 0.5)",T5:"rgba(255, 65, 0, 0.5)",S4:"rgba(255, 115, 0, 0.5)",M1:"rgba(200, 200, 200, 0.5)",E1:"rgba(128, 98, 11, 0.5)",C1:"rgba(128, 135, 128, 0.5)",B1:"rgba(0, 195, 0, 0.5)",reserved:"rgba(20, 125, 200, 0.25)",occupied:"rgba(20, 125, 255, 0.5)",default:"rgba(255, 0.5)"},showInventoryDetails:!1,select_Inventory:{rowIndex:0,colIndex:0,layerIndex:0,goods_data:{}}}},beforeRouteEnter(e,t,o){o((e=>{e.goodsMatrix=[],e.goodsMap={}}))},beforeDestroy(){this.goodsMap={},this.goodsMatrix=[]},methods:{shouldShowButton(e,t,o){const s=this.goodsMap[`${e}-${t}-${o}`];return["T1","T2","T4","T5","S4","M1","E1","C1","B1"].includes(null===s||void 0===s?void 0:s.location_type)},getList(){var e=this;Object(i["e"])(e.pathname+"?layer="+e.shelf.layer_now+"&warehouse_code="+e.warehouse_code+"&max_page=1000&shelf_name="+e.shelf_name,{}).then((t=>{e.goodsMap={},t.results.forEach((t=>{const o=`${t.row}-${t.col}-${t.layer}`;e.goodsMap[o]={id:t.id,location_type:t.location_type,shelf_type:t.shelf_type,status:t.status}})),e.$q.notify({message:t.detail,icon:"done",color:"positive"})})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},handle_setting(){n["a"].has("warehouse_code")&&(this.warehouse_code=n["a"].getItem("warehouse_code")),n["a"].has("warehouse_name")&&(this.warehouse_name=n["a"].getItem("warehouse_name"))},getBinColor(e,t,o){const s=this.goodsMap[`${e}-${t}-${o}`];return s?"reserved"==s.status||"occupied"==s.status?this.binColors[s.status]:this.binColors[s.shelf_type]||this.binColors.default:this.binColors.default},handleBinClick(e,t,o){var s,a;this.select_Inventory.rowIndex=e,this.select_Inventory.colIndex=t,this.select_Inventory.layerIndex=o,console.log(this.goodsMap[`${e}-${t}-${o}`]),["T1","T2","T4","T5","S4"].includes(null===(s=this.goodsMap[`${e}-${t}-${o}`])||void 0===s?void 0:s.location_type)?this.select_Inventory.shelf_type="storage":["E1","C1"].includes(null===(a=this.goodsMap[`${e}-${t}-${o}`])||void 0===a?void 0:a.location_type)?this.select_Inventory.shelf_type="elevator":this.select_Inventory.shelf_type="corridor",this.select_Inventory.goods_data=this.goodsMap[`${e}-${t}-${o}`],this.showInventoryDetails=!0,console.log(this.select_Inventory),this.$nextTick((()=>{this.$refs.goodscard.handleclick()}))},updateCSSVariables(){const e=document.documentElement,t=document.documentElement.clientWidth,o=document.documentElement.clientHeight;console.log(t,o);const s=.6*t,a=.6*o;var l=8.5*s/10/this.shelf.cols,r=1*l/5,n=r/2,i=a/this.shelf.rows-l;i<2&&(i=2,l=(a-i*this.shelf.rows)/this.shelf.rows,r=3*l/5,n=r/2);var d=i/2,c=r*this.shelf.cols+l*this.shelf.cols;e.style.setProperty("--cell-d",`${l}px`),e.style.setProperty("--cell-d-x",`${l+r}px`),e.style.setProperty("--cell-x-2",`${n}px`),e.style.setProperty("--cell-x",`${r}px`),e.style.setProperty("--cell-y",`${i+l}px`),e.style.setProperty("--cell-y-2",`${d}px`),e.style.setProperty("--axis-x",`${c}px`)},handleResize(){clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout((()=>{this.updateCSSVariables()}),200)},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()},handle_edit(){this.auth_edit=!this.auth_edit,n["a"].set("auth_edit",this.auth_edit)}},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(){n["a"].set("auth_edit",this.auth_edit),n["a"].has("warehouse_code")&&(this.warehouse_code=n["a"].getItem("warehouse_code")),n["a"].has("warehouse_name")&&(this.warehouse_name=n["a"].getItem("warehouse_name")),this.getList()}},M=L,z=(o("9a24"),o("65c6")),B=o("eb85"),E=o("9989"),j=Object(h["a"])(M,s,a,!1,null,"007386ca",null);t["default"]=j.exports;T()(j,"components",{QToolbar:z["a"],QBtnGroup:k["a"],QBtn:p["a"],QInput:w["a"],QTooltip:m["a"],QSeparator:B["a"],QPage:E["a"]})},"99bf":function(e,t,o){},"9a24":function(e,t,o){"use strict";o("99bf")},bae9:function(e,t,o){"use strict";o("53ea")}}]);
|