1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[22],{"022c":function(t,e,a){},"6c2b":function(t,e,a){"use strict";a("022c")},d434:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{"margin-top":"42px"}},[e("transition",{attrs:{appear:"","enter-active-class":"animated fadeIn"}},[e("q-table",{staticClass:"my-sticky-header-column-table shadow-24",attrs:{data:t.table_list,"row-key":"id",separator:t.separator,loading:t.loading,columns:t.columns,"hide-bottom":"",pagination:t.pagination,"no-data-label":"No data","no-results-label":"No data you want","table-style":{height:t.height},flat:"",bordered:""},on:{"update:pagination":function(e){t.pagination=e}},scopedSlots:t._u([{key:"top",fn:function(){return[e("q-btn-group",{attrs:{push:""}},[e("q-btn",{attrs:{label:"新增",icon:"add"},on:{click:function(e){return t.add()}}}),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(t._s(t.$t("refreshtip")))])],1)],1),e("q-space"),e("div",{staticClass:"flex items-center"},[e("q-btn-group",{staticClass:"q-ml-md",attrs:{push:""}}),e("q-input",{attrs:{outlined:"",rounded:"",dense:"",debounce:"300",color:"primary",placeholder:t.$t("search")},on:{input:function(e){return t.getSearchList()},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getSearchList()}},scopedSlots:t._u([{key:"append",fn:function(){return[e("q-icon",{attrs:{name:"search"},on:{click:function(e){return t.getSearchList()}}})]},proxy:!0}]),model:{value:t.filter,callback:function(e){t.filter=e},expression:"filter"}})],1)]},proxy:!0},{key:"body",fn:function(a){return[e("q-tr",{attrs:{props:a}},[a.row.id===t.editid?[e("q-td",{key:"detail",attrs:{props:a}},[e("q-btn",{attrs:{round:"",flat:"",push:"",color:"black",icon:"description"},on:{click:function(e){return t.detailData(a.row)}}},[e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[t._v(t._s("查看批次详情"))])],1)],1)]:a.row.id!==t.editid?[e("q-td",{key:"detail",staticStyle:{"max-width":"10px"},attrs:{props:a}},[e("q-btn",{attrs:{round:"",flat:"",push:"",color:"black",icon:"description"},on:{click:function(e){return t.detailData(a.row)}}},[e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[t._v(t._s("查看批次详情"))])],1),e("q-btn",{directives:[{name:"print",rawName:"v-print",value:t.getPrintConfig(),expression:"getPrintConfig()"}],attrs:{icon:"print",flat:""},on:{click:function(e){return t.setCurrentBatch(a.row.container_code)}}},[e("q-tooltip",[t._v("打印条码")])],1)],1)]:t._e(),a.row.id===t.editid?[e("q-td",{key:"container_code",attrs:{props:a}},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"托盘编码",autofocus:"",rules:[e=>e&&e.length>0||t.error1]},model:{value:t.editFormData.container_code,callback:function(e){t.$set(t.editFormData,"container_code",e)},expression:"editFormData.container_code"}})],1)]:a.row.id!==t.editid?[e("q-td",{key:"container_code",attrs:{props:a}},[t._v(t._s(a.row.container_code))])]:t._e(),a.row.id===t.editid?[e("q-td",{key:"current_location",attrs:{props:a}},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"当前位置",rules:[e=>e&&e.length>0||t.error2]},model:{value:t.editFormData.current_location,callback:function(e){t.$set(t.editFormData,"current_location",e)},expression:"editFormData.current_location"}})],1)]:a.row.id!==t.editid?[e("q-td",{key:"current_location",attrs:{props:a}},[t._v(t._s(a.row.current_location))])]:t._e(),a.row.id===t.editid?[e("q-td",{key:"status",attrs:{props:a}},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"状态",rules:[e=>e&&e.length>0||t.error2]},model:{value:t.editFormData.status,callback:function(e){t.$set(t.editFormData,"status",e)},expression:"editFormData.status"}})],1)]:a.row.id!==t.editid?[e("q-td",{key:"status",attrs:{props:a}},[t._v(t._s(a.row.status))])]:t._e(),a.row.id===t.editid?[e("q-td",{key:"last_operation",attrs:{props:a}},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"最后操作时间",rules:[e=>e&&e.length>0||t.error4]},model:{value:t.editFormData.last_operation,callback:function(e){t.$set(t.editFormData,"last_operation",e)},expression:"editFormData.last_operation"}})],1)]:a.row.id!==t.editid?[e("q-td",{key:"last_operation",attrs:{props:a}},[t._v(t._s(a.row.last_operation))])]:t._e()],2)]}}])})],1),[e("div",{directives:[{name:"show",rawName:"v-show",value:0!==t.max,expression:"max !== 0"}],staticClass:"q-pa-lg flex flex-center"},[e("div",[t._v(t._s(t.total))]),e("q-pagination",{attrs:{color:"black",max:t.max,"max-pages":6,"boundary-links":""},on:{click:function(e){t.getSearchList(t.current),t.paginationIpt=t.current}},model:{value:t.current,callback:function(e){t.current=e},expression:"current"}}),e("div",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.paginationIpt,expression:"paginationIpt"}],staticStyle:{width:"60px","text-align":"center"},domProps:{value:t.paginationIpt},on:{blur:t.changePageEnter,keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.changePageEnter.apply(null,arguments)},input:function(e){e.target.composing||(t.paginationIpt=e.target.value)}}})])],1),e("div",{directives:[{name:"show",rawName:"v-show",value:0===t.max,expression:"max === 0"}],staticClass:"q-pa-lg flex flex-center"},[e("q-btn",{attrs:{flat:"",push:"",color:"dark",label:t.$t("no_data")}})],1)],e("div",{staticClass:"print-area",attrs:{id:"printBarcode"}},[e("div",{staticClass:"q-pa-md text-center",staticStyle:{flex:"none"}},[e("svg",{ref:"barcodeElement",staticStyle:{width:"100%",height:"auto"}})])]),t.showInventoryDetails?e("containercard",{key:t.select_container_number,ref:"containercard",attrs:{"container-number":t.select_container_number,"container-code":t.select_container_code}}):t._e()],2)},i=[],o=(a("ddb0"),a("9861"),a("a79d"),a("3004")),r=a("91f1"),s=a("62c5"),c=a.n(s),l=a("18d6"),d={name:"PageContainerlist",components:{containercard:r["a"]},data(){return{goods_code:"",goods_desc:"",openid:"",login_name:"",authin:"0",searchUrl:"",pathname:"container/list/",detailpathname:"container/detail/",pathname_previous:"",pathname_next:"",separator:"cell",loading:!1,height:"",table_list:[],columns:[{name:"detail",label:"详情",field:"detail",align:"center"},{name:"container_code",required:!0,label:"托盘编码",align:"center",field:"container_code"},{name:"current_location",label:"当前位置",field:"current_location",align:"center"},{name:"status",label:"托盘状态",field:"status",align:"center"},{name:"last_operation",label:"上次操作时间",field:"last_operation",align:"center"}],filter:"",pagination:{page:1,rowsPerPage:11},editid:0,editFormData:{},detailForm:!1,activeTab:"tab1",table_detail:[{container:{container_code:"",current_location:""},batch:{bound_number:"",goods_desc:"",goods_weight:"",goods_qty:"",creater:""}}],operate_detail:[],newValue:"",error1:this.$t("goods.view_goodslist.error1"),current:1,max:0,total:0,paginationIpt:1,onlyread:!0,currentBarcode:"",select_container_number:0,select_container_code:0,showInventoryDetails:!1}},methods:{setCurrentBatch(t){this.currentBarcode=t||""},getPrintConfig(){return this.generateBarcode(),{id:"printBarcode"}},generateBarcode(){this.$refs.barcodeElement.innerHTML="";try{c()(this.$refs.barcodeElement,this.currentBarcode,{format:"CODE128",displayValue:!0,fontSize:16,height:60,margin:10})}catch(t){console.error("条码生成失败:",t)}},add(){Object(o["h"])("/container/list/",{}).then((t=>{this.$q.notify({message:"添加成功",icon:"done",color:"positive"}),this.reFresh()})).catch((t=>{this.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},getList(t={}){var e=this;e.loading=!0;const a={page:e.current,page_size:e.pagination.rowsPerPage},n=new URLSearchParams({...a,...t});console.log(n),Array.from(n.entries()).forEach((([t,e])=>{""!==e&&null!==e&&void 0!==e||n.delete(t)})),Object(o["e"])(`${e.pathname}?${n}`).then((t=>{e.table_list=t.results,e.total=t.count,e.max=Math.ceil(t.count/e.pagination.rowsPerPage)||0,e.pathname_previous=t.previous,e.pathname_next=t.next})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})})).finally((()=>{e.loading=!1}))},changePageEnter(){Number(this.paginationIpt)<1?(this.current=1,this.paginationIpt=1):Number(this.paginationIpt)>this.max?(this.current=this.max,this.paginationIpt=this.max):this.current=Number(this.paginationIpt),this.getSearchList(this.current)},getSearchList(t=1){this.current=t,this.paginationIpt=t,this.getList({container_code__icontains:this.filter})},getListPrevious(){var t=this;l["a"].has("auth")&&Object(o["e"])(t.pathname_previous,{}).then((e=>{t.table_list=e.results,t.pathname_previous=e.previous,t.pathname_next=e.next})).catch((e=>{t.$q.notify({message:e.detail,icon:"close",color:"negative"})}))},getListNext(){var t=this;l["a"].has("auth")&&Object(o["e"])(t.pathname_next,{}).then((e=>{t.table_list=e.results,t.pathname_previous=e.previous,t.pathname_next=e.next})).catch((e=>{t.$q.notify({message:e.detail,icon:"close",color:"negative"})}))},reFresh(){var t=this;t.getSearchList()},detailData(t){var e=this;e.detailid=t.id,console.log("detail查询的id是:",e.detailid),Object(o["e"])(e.detailpathname+"?status__lte=2&container="+e.detailid).then((a=>{if(0===a.results.length)return e.table_detail=[{container:{container_code:"",current_location:""},batch:{bound_number:"",goods_desc:"",goods_weight:"",goods_qty:"",creater:""}}],void e.$q.notify({message:"该托盘暂无物料信息",icon:"info",color:"positive"});e.showInventoryDetails=!0,e.select_container_number=t.id,e.select_container_code=t.container_code,e.$refs.containercard.handleclick()})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))}},created(){var t=this;l["a"].has("openid")?t.openid=l["a"].getItem("openid"):(t.openid="",l["a"].set("openid","")),l["a"].has("login_name")?t.login_name=l["a"].getItem("login_name"):(t.login_name="",l["a"].set("login_name","")),l["a"].has("auth")?(t.authin="1",t.getList()):t.authin="0"},mounted(){var t=this;t.$q.platform.is.electron?t.height=String(t.$q.screen.height-290)+"px":t.height=t.$q.screen.height-290+"px"},updated(){},destroyed(){}},u=d,p=(a("6c2b"),a("42e1")),h=a("eaac"),g=a("e7a9"),m=a("9c40"),_=a("05c0"),f=a("2c91"),b=a("27f9"),v=a("0016"),y=a("bd08"),x=a("db86"),q=a("3b16"),w=a("52ee"),k=a("eebe"),$=a.n(k),D=Object(p["a"])(u,n,i,!1,null,"caa3275a",null);e["default"]=D.exports;$()(D,"components",{QTable:h["a"],QBtnGroup:g["a"],QBtn:m["a"],QTooltip:_["a"],QSpace:f["a"],QInput:b["a"],QIcon:v["a"],QTr:y["a"],QTd:x["a"],QPagination:q["a"],QDate:w["a"]})}}]);
|