21.16125990.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[21],{"4ef2":function(t,e,a){},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("q-dialog",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"},model:{value:t.detailForm,callback:function(e){t.detailForm=e},expression:"detailForm"}},[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("批次信息")+"\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-tabs",{model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("q-tab",{attrs:{name:"tab1",label:"组盘信息"}}),e("q-tab",{attrs:{name:"tab2",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:"70px"},attrs:{name:"tab1"}},[e("div",{staticClass:"row q-gutter-x-md"},[e("div",{staticClass:"col column q-gutter-y-md"},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"托盘编码",readonly:!0},model:{value:t.table_detail[0].container.container_code,callback:function(e){t.$set(t.table_detail[0].container,"container_code",e)},expression:"table_detail[0].container.container_code"}})],1),e("div",{staticClass:"col column q-gutter-y-md"},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"当前位置",readonly:!0},model:{value:t.table_detail[0].container.current_location,callback:function(e){t.$set(t.table_detail[0].container,"current_location",e)},expression:"table_detail[0].container.current_location"}})],1)]),e("div",{staticStyle:{float:"right",padding:"15px 15px 50px 15px","min-width":"100%"},attrs:{flow:"row wrap"}},[e("q-card",{staticClass:"q-mb-md",attrs:{bordered:""}},[e("q-card-section",[[e("div",{staticClass:"text-h6 q-mb-md"},[t._v(t._s("托盘物料"))]),t.table_detail.length>0?t._l(t.table_detail,(function(a,n){return e("div",{key:n,staticClass:"row q-col-gutter-md q-mb-sm"},[e("div",{staticClass:"col",staticStyle:{"min-width":"150px"}},[e("q-input",{attrs:{label:"批次",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.bound_number,callback:function(e){t.$set(a.batch,"bound_number",e)},expression:"item.batch.bound_number"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"货物",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.goods_desc,callback:function(e){t.$set(a.batch,"goods_desc",e)},expression:"item.batch.goods_desc"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"单重",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.goods_weight,callback:function(e){t.$set(a.batch,"goods_weight",e)},expression:"item.batch.goods_weight"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"数量",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.goods_qty,callback:function(e){t.$set(a,"goods_qty",e)},expression:"item.goods_qty"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"组盘",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.creater,callback:function(e){t.$set(a.batch,"creater",e)},expression:"item.batch.creater"}})],1)])})):t._e()]],2)],1)],1)]),e("q-tab-panel",{staticStyle:{height:"70px"},attrs:{name:"tab2"}},[e("div",{staticClass:"row q-gutter-x-md"},[e("div",{staticClass:"col column q-gutter-y-md"},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"托盘编码",readonly:!0},model:{value:t.table_detail[0].container.container_code,callback:function(e){t.$set(t.table_detail[0].container,"container_code",e)},expression:"table_detail[0].container.container_code"}})],1),e("div",{staticClass:"col column q-gutter-y-md"},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"当前位置",readonly:!0},model:{value:t.table_detail[0].container.current_location,callback:function(e){t.$set(t.table_detail[0].container,"current_location",e)},expression:"table_detail[0].container.current_location"}})],1)]),e("div",{staticStyle:{float:"right",padding:"15px 15px 50px 15px","min-width":"100%"},attrs:{flow:"row wrap"}},[e("q-card",{staticClass:"q-mb-md",attrs:{bordered:""}},[e("q-card-section",[[e("div",{staticClass:"text-h6 q-mb-md",staticStyle:{display:"flex","justify-content":"space-between"}},[t._v("\n "+t._s("操作记录")+"\n "),e("q-btn",{staticClass:"q-ml-sm",attrs:{color:"primary",icon:"event"},on:{click:t.sortoperatedetail}},[t._v("近一个月操作记录")])],1),t.listSize>0?[e("q-list",{staticClass:"rounded-borders",attrs:{bordered:""}},t._l(t.nodeList,(function(a,n){return a.value&&a.value.length>0?e("q-expansion-item",{key:n,attrs:{group:"op-group",caption:`操作类型: ${t.formatType(a.value[0].operation_type)} ----- 操作时间:${a.value[0].timestamp}`}},[e("q-card",[e("q-card-section",t._l(a.value,(function(a,n){return e("div",{key:n,staticClass:"row q-col-gutter-md q-mb-sm",staticStyle:{display:"flex","justify-content":"space-between"}},[e("div",{staticClass:"col",staticStyle:{"min-width":"150px"}},[e("q-input",{attrs:{label:"批次",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.bound_number,callback:function(e){t.$set(a.batch,"bound_number",e)},expression:"item.batch.bound_number"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"货物",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.goods_desc,callback:function(e){t.$set(a.batch,"goods_desc",e)},expression:"item.batch.goods_desc"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"单重",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.batch.goods_weight,callback:function(e){t.$set(a.batch,"goods_weight",e)},expression:"item.batch.goods_weight"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"数量",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.goods_qty,callback:function(e){t.$set(a,"goods_qty",e)},expression:"item.goods_qty"}})],1),e("div",{staticClass:"col"},[e("q-input",{attrs:{label:"经手人",readonly:t.onlyread,dense:"",outlined:""},model:{value:a.operator,callback:function(e){t.$set(a,"operator",e)},expression:"item.operator"}})],1),e("div",{staticClass:"col"},[e("q-input",{staticStyle:{"min-width":"100px","max-width":"600px"},attrs:{label:"备注",readonly:t.onlyread,dense:"",outlined:"",type:"textarea","input-style":{whiteSpace:"pre-wrap",overflowY:"auto",minHeight:"40px"}},model:{value:a.memo,callback:function(e){t.$set(a,"memo",e)},expression:"item.memo"}})],1)])})),0)],1)],1):t._e()})),1)]:e("div",{staticClass:"text-grey-8"},[t._v("暂无操作记录")])]],2)],1)],1)])],1)],1)],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"}})])])],2)},i=[],o=(a("ddb0"),a("9861"),a("a79d"),a("3004")),s=a("62c5"),r=a.n(s),l=a("18d6");class c{constructor(t){this.value=t,this.next=null}}class d{constructor(){this.head=null,this.size=0}append(t){const e=new c(t);if(this.head){let t=this.head;while(t.next)t=t.next;t.next=e}else this.head=e;this.size++}delete(t){if(!this.head)return;if(this.head.value===t)return this.head=this.head.next,void this.size--;let e=this.head;while(e.next){if(e.next.value===t)return e.next=e.next.next,void this.size--;e=e.next}}toArray(){const t=[];let e=this.head;while(e)t.push({value:e.value}),e=e.next;return t}clear(){this.head=null,this.size=0}}var u={name:"PageContainerlist",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:[],linkedList:new d,newValue:"",error1:this.$t("goods.view_goodslist.error1"),current:1,max:0,total:0,paginationIpt:1,onlyread:!0,currentBarcode:""}},methods:{setCurrentBatch(t){this.currentBarcode=t||""},getPrintConfig(){return this.generateBarcode(),{id:"printBarcode"}},generateBarcode(){this.$refs.barcodeElement.innerHTML="";try{r()(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.detailForm=!0,e.detailid=t.id,console.log("detail查询的id是:",e.detailid),Object(o["e"])(e.detailpathname+"?status__lte=2&container="+e.detailid).then((t=>{if(0===t.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:"close",color:"negative"});e.table_detail=t.results})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})})),e.getOperationRecord(t)},getOperationRecord(t){var e=this;e.operate_detail=[];var a=[];e.linkedList.clear(),Object(o["e"])("container/operate/?status=1&container="+t.id).then((t=>{if(e.operate_detail=t.results,0!==e.operate_detail.length){a.push(e.operate_detail[0]);for(let t=0;t<e.operate_detail.length-1;t++){const n=e.operate_detail[t],i=e.operate_detail[t+1];n.operation_type===i.operation_type?a.push(i):(e.linkedList.append([...a]),a=[i])}a.length>0&&e.linkedList.append([...a])}})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},formatType(t){switch(t){case"container":return"组盘";case"outbound":return"出库";case"3":return"盘点";case"4":return"移库";case"5":return"调拨";case"6":return"其他";default:return"未知"}},sortoperatedetail(){var t=this;console.log("近一个月操作记录",t.nodeList)}},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(){},computed:{nodeList(){return this.linkedList.toArray()},listSize(){return this.linkedList.size}}},p=u,h=(a("dd6c"),a("42e1")),b=a("eaac"),m=a("e7a9"),g=a("9c40"),_=a("05c0"),v=a("2c91"),f=a("27f9"),y=a("0016"),x=a("bd08"),q=a("db86"),w=a("3b16"),k=a("24e8"),C=a("f09f"),$=a("d847"),S=a("a370"),L=a("429b"),F=a("7460"),Q=a("adad"),P=a("823b"),D=a("1c1c"),I=a("3b73"),T=a("52ee"),z=a("7f67"),B=a("eebe"),O=a.n(B),j=Object(h["a"])(p,n,i,!1,null,"f81b652a",null);e["default"]=j.exports;O()(j,"components",{QTable:b["a"],QBtnGroup:m["a"],QBtn:g["a"],QTooltip:_["a"],QSpace:v["a"],QInput:f["a"],QIcon:y["a"],QTr:x["a"],QTd:q["a"],QPagination:w["a"],QDialog:k["a"],QCard:C["a"],QBar:$["a"],QCardSection:S["a"],QTabs:L["a"],QTab:F["a"],QTabPanels:Q["a"],QTabPanel:P["a"],QList:D["a"],QExpansionItem:I["a"],QDate:T["a"]}),O()(j,"directives",{ClosePopup:z["a"]})},dd6c:function(t,e,a){"use strict";a("4ef2")}}]);