1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[3],{1511:function(t,e,o){},5109:function(t,e,o){},"7c1d":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("q-toolbar",{staticClass:"row items-center"},[e("q-btn-group",{staticClass:"btn-group",attrs:{push:""}},[e("q-btn",{attrs:{label:t.$t("stock.shelf.shelf_up"),icon:"upload"},on:{click:function(e){return t.handleShelfUp()}}}),e("div",{staticClass:"self-center text-center q-px-sm"},[t._v("\n "+t._s(t.$t("stock.layertip"))+"\n ")]),e("q-input",{staticStyle:{width:"50px"},attrs:{dense:"",color:"primary"},model:{value:t.shelf.layer_now,callback:function(e){t.$set(t.shelf,"layer_now",e)},expression:"shelf.layer_now"}}),e("q-btn",{attrs:{label:t.$t("stock.shelf.shelf_down"),icon:"download"},on:{click:function(e){return t.handleShelfDown()}}}),e("q-btn",{attrs:{label:t.$t("refresh"),icon:"refresh"},on:{click:function(e){return t.reFresh()}}},[e("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),e("q-separator"),e("q-btn",{attrs:{label:t.$t("stock.edit"),icon:"edit"},on:{click:function(e){return t.handle_edit()}}})],1),t.showInventoryDetails?e("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(e){t.showInventoryDetails=!1}}}):t._e()],1),e("q-page",{staticClass:"q-pa-md"},[e("div",{staticClass:"grid-system"},[e("div",{staticClass:"axis y-axis"},[e("div",{staticClass:"axis-numbers"},t._l(t.shelf.rows,(function(o){return e("div",{key:"y"+o},[t._v("\n "+t._s(o)+"\n ")])})),0),e("div",{staticClass:"axis-arrow"})]),e("div",{staticClass:"axis x-axis"},[e("div",{staticClass:"axis-arrow"}),e("div",{staticClass:"axis-numbers"},[t._l(t.shelf.cols,(function(o){return e("div",{key:"x"+o,staticClass:"axis-label"},[t._v("\n "+t._s(o)+"\n ")])})),e("div",{staticClass:"axis-label"})],2)]),e("div",{staticClass:"grid-container"},[e("div",{staticClass:"grid-content"},t._l(t.shelf.rows,(function(o,a){return e("div",{key:`row-${a}|${t.shelf.layer_now}`,staticClass:"grid-row",style:{cursor:"pointer"}},t._l(t.shelf.cols,(function(o,s){return e("div",{key:`col-${s}|${t.shelf.layer_now}`,staticClass:"grid-item",style:{cursor:"pointer"}},[t.shouldShowButton(t.shelf.rows-a,s+1,t.shelf.layer_now)?e("div",{key:`${t.shelf.rows-a}-${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-a,s+1,t.shelf.layer_now),cursor:"pointer"},on:{click:function(e){return t.handleBinClick(t.shelf.rows-a,s+1,t.shelf.layer_now)}}}):t._e(),t.shouldShowButton(t.shelf.rows-a,s+1,t.shelf.layer_now)?e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[20,20],"content-style":"font-size: 10px"}},[t._v("\n "+t._s(t.$t("stock.rowtip"))+" "+t._s(t.shelf.rows-a)+"\n "+t._s(t.$t("stock.coltip"))+" "+t._s(s+1)+"\n ")]):t._e()],1)})),0)})),0)])])])],1)},s=[],l=(o("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":"800px"}},[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"},[e("q-btn",{attrs:{color:"primary",label:"释放库位"},on:{click:t.showReleaseDialog}}),e("q-btn",{attrs:{color:"primary",label:"移动库位"},on:{click:t.showMoveDialog}})],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)}),i=[],r=(o("d9e2"),o("3004")),n={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:[],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})))}},created(){this.shelfLocal=this.selectedShelfType,this.handleclick()},methods:{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},o=await Object(r["h"])("container/location_release/",e);if("200"!==o.code)throw new Error(o.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(r["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(r["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(r["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"})}))}}},c=n,d=(o("f293"),o("42e1")),h=o("24e8"),u=o("f09f"),_=o("d847"),p=o("2c91"),g=o("9c40"),f=o("a370"),m=o("66e5"),y=o("4074"),v=o("0170"),b=o("eb85"),w=o("4b7e"),q=o("ddd8"),x=o("429b"),$=o("7460"),k=o("adad"),C=o("823b"),I=o("eaac"),S=o("e7a9"),T=o("05c0"),D=o("27f9"),Q=o("8572"),L=o("7f67"),M=o("eebe"),j=o.n(M),P=Object(d["a"])(c,l,i,!1,null,"29e67b69",null),B=P.exports;j()(P,"components",{QDialog:h["a"],QCard:u["a"],QBar:_["a"],QSpace:p["a"],QBtn:g["a"],QCardSection:f["a"],QItem:m["a"],QItemSection:y["a"],QItemLabel:v["a"],QSeparator:b["a"],QCardActions:w["a"],QSelect:q["a"],QTabs:x["a"],QTab:$["a"],QTabPanels:k["a"],QTabPanel:C["a"],QTable:I["a"],QBtnGroup:S["a"],QTooltip:T["a"],QInput:D["a"],QField:Q["a"]}),j()(P,"directives",{ClosePopup:L["a"]});var O=o("18d6"),z={components:{goodscard:B},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(t,e,o){o((t=>{t.goodsMatrix=[],t.goodsMap={}}))},beforeDestroy(){this.goodsMap={},this.goodsMatrix=[]},methods:{shouldShowButton(t,e,o){const a=this.goodsMap[`${t}-${e}-${o}`];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(r["e"])(t.pathname+"?layer="+t.shelf.layer_now+"&warehouse_code="+t.warehouse_code+"&max_page=1000&shelf_name="+t.shelf_name,{}).then((e=>{t.goodsMap={},e.results.forEach((e=>{const o=`${e.row}-${e.col}-${e.layer}`;t.goodsMap[o]={id:e.id,location_type:e.location_type,shelf_type:e.shelf_type,status:e.status}})),t.$q.notify({message:e.detail,icon:"done",color:"positive"})})).catch((e=>{t.$q.notify({message:e.detail,icon:"close",color:"negative"})}))},handle_setting(){O["a"].has("warehouse_code")&&(this.warehouse_code=O["a"].getItem("warehouse_code")),O["a"].has("warehouse_name")&&(this.warehouse_name=O["a"].getItem("warehouse_name"))},getBinColor(t,e,o){const a=this.goodsMap[`${t}-${e}-${o}`];return a?"reserved"==a.status||"occupied"==a.status?this.binColors[a.status]:this.binColors[a.shelf_type]||this.binColors.default:this.binColors.default},handleBinClick(t,e,o){var a,s;this.select_Inventory.rowIndex=t,this.select_Inventory.colIndex=e,this.select_Inventory.layerIndex=o,console.log("goodsMap",this.goodsMap[`${t}-${e}-${o}`]),["T1","T2","T4","T5","S4"].includes(null===(a=this.goodsMap[`${t}-${e}-${o}`])||void 0===a?void 0:a.location_type)?this.select_Inventory.shelf_type="storage":["E1","C1"].includes(null===(s=this.goodsMap[`${t}-${e}-${o}`])||void 0===s?void 0:s.location_type)?this.select_Inventory.shelf_type="elevator":this.select_Inventory.shelf_type="corridor",this.select_Inventory.goods_data=this.goodsMap[`${t}-${e}-${o}`],this.showInventoryDetails=!0,console.log("this.select_Inventory",this.select_Inventory),this.$nextTick((()=>{this.$refs.goodscard.handleclick()}))},updateCSSVariables(){const t=document.documentElement,e=document.documentElement.clientWidth,o=document.documentElement.clientHeight,a=.6*e,s=.6*o;var l=8.5*a/10/this.shelf.cols,i=1*l/5,r=i/2,n=s/this.shelf.rows-l;n<2&&(n=2,l=(s-n*this.shelf.rows)/this.shelf.rows,i=3*l/5,r=i/2);var c=n/2,d=i*this.shelf.cols+l*this.shelf.cols;t.style.setProperty("--cell-d",`${l}px`),t.style.setProperty("--cell-d-x",`${l+i}px`),t.style.setProperty("--cell-x-2",`${r}px`),t.style.setProperty("--cell-x",`${i}px`),t.style.setProperty("--cell-y",`${n+l}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)},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,O["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(){O["a"].set("auth_edit",this.auth_edit),O["a"].has("warehouse_code")&&(this.warehouse_code=O["a"].getItem("warehouse_code")),O["a"].has("warehouse_name")&&(this.warehouse_name=O["a"].getItem("warehouse_name")),this.getList()}},E=z,N=(o("c950"),o("65c6")),R=o("9989"),A=Object(d["a"])(E,a,s,!1,null,"3486a0b7",null);e["default"]=A.exports;j()(A,"components",{QToolbar:N["a"],QBtnGroup:S["a"],QBtn:g["a"],QInput:D["a"],QTooltip:T["a"],QSeparator:b["a"],QPage:R["a"]})},c950:function(t,e,o){"use strict";o("1511")},f293:function(t,e,o){"use strict";o("5109")}}]);
|