(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[8],{"431e":function(e,t,a){"use strict";var n=a("fb85"),o=a.n(n);t["default"]=o.a},"72be":function(e,t,a){},b62e:function(e,t,a){"use strict";a("72be")},d807:function(e,t,a){"use strict";a.r(t);a("caad");var n=function(){var e=this,t=e._self._c;return t("div",[t("transition",{attrs:{appear:"","enter-active-class":"animated fadeIn"}},[t("q-table",{staticClass:"my-sticky-header-column-table shadow-24",attrs:{data:e.table_list,"row-key":"id",separator:e.separator,loading:e.loading,columns:e.columns,"hide-bottom":"",pagination:e.pagination,"no-data-label":"No data","no-results-label":"No data you want","table-style":{height:e.height},flat:"",bordered:""},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"header-cell",fn:function(a){return[t("q-th",{attrs:{props:a},on:{dblclick:function(t){return e.handleHeaderDblClick(a.col)}}},[["check_status","log_type"].includes(a.col.name)?[t("q-select",{staticStyle:{"min-width":"120px"},attrs:{dense:"",outlined:"",options:e.getFilterOptions(a.col.name),"option-label":"label","option-value":"value","emit-value":"","map-options":"",clearable:""},on:{input:e.handleFilterChange},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("span",{staticClass:"text-caption"},[e._v(e._s(a.col.label))])]},proxy:!0}],null,!0),model:{value:e.filterModels[a.col.name],callback:function(t){e.$set(e.filterModels,a.col.name,t)},expression:"filterModels[props.col.name]"}})]:[e._v("\n "+e._s(a.col.label)+"\n ")]],2)]}},{key:"top",fn:function(){return[t("q-btn-group",{attrs:{push:""}},[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(e._s(e.$t("refreshtip")))])],1)],1),t("q-space"),t("div",{staticClass:"flex items-center"},[t("div",{staticClass:"q-mr-md"},[e._v(e._s(e.$t("download_center.createTime")))]),t("q-input",{attrs:{readonly:"",outlined:"",dense:"",placeholder:e.interval},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"event"}},[t("q-popup-proxy",{ref:"qDateProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{range:""},model:{value:e.createDate1,callback:function(t){e.createDate1=t},expression:"createDate1"}},[t("div",{staticClass:"row items-center justify-end q-gutter-sm"},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("index.cancel"),color:"primary",flat:""}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("index.clear"),color:"primary"},on:{click:function(t){e.createDate2="",e.createDate1=""}}})],1)])],1)],1)]},proxy:!0}]),model:{value:e.createDate2,callback:function(t){e.createDate2=t},expression:"createDate2"}}),t("q-btn-group",{staticClass:"q-ml-md",attrs:{push:""}})],1)]},proxy:!0},{key:"body",fn:function(a){var n;return[t("q-tr",{style:e.getRowStyle(a.row),attrs:{props:a}},[t("q-td",{attrs:{"auto-width":""}},[t("q-btn",{attrs:{size:"sm",round:"",icon:a.row.expand?"unfold_less":"expand"},on:{click:function(t){return e.handle_row_expand(a.row)}}},[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("查看流水下的托盘日志")+"\n ")])],1)],1),e._l(e.columns.filter((e=>"expand"!==e.name)),(function(n){return t("q-td",{key:n.name,attrs:{props:a}},["check_status"===n.name?t("span",[e._v("\n "+e._s(e.checkStatusToText(a.row[n.field]))+"\n ")]):"goods_qty"===n.name?t("span",[e._v("\n "+e._s(a.row.goods_in_qty-a.row.goods_out_qty)+"\n ")]):"log_type"===n.name?t("span",[e._v("\n "+e._s(e.logtypeToText(a.row[n.field]))+"\n ")]):-1===["check_status","goods_qty"].indexOf(n.name)?t("span",[e._v("\n "+e._s(n.field?a.row[n.field]:a.row[n.name])+"\n ")]):e._e()])}))],2),t("q-tr",{directives:[{name:"show",rawName:"v-show",value:a.row.expand,expression:"props.row.expand"}],staticClass:"expanded-row",style:e.getRowStyle(a.row),attrs:{props:a}},[[t("q-td",{attrs:{colspan:"100%"}},[t("div",{staticClass:"q-pa-md timeline-wrapper"},[null!==(n=a.row.containers)&&void 0!==n&&n.length?t("q-timeline",{attrs:{color:"#e0e0e0"}},e._l(a.row.containers,(function(a,n){return t("q-timeline-entry",{key:n,staticClass:"custom-node",scopedSlots:e._u([{key:"title",fn:function(){return[t("span",[t("div",[e._v("\n 托盘 "+e._s(a.container_code)+"\n "),t("span",{staticClass:"text-caption"},[e._v("\n 操作时间:"+e._s(a.create_time)+"\n ")])])])]},proxy:!0},{key:"subtitle",fn:function(){return[t("div",{staticClass:"text-caption"},[e._v("\n 批次: "+e._s(a.batch)+" |\n 物料编码:\n "+e._s(a.goods_code)+" |"+e._s(a.goods_desc)+" |\n "),t("br"),e._v("\n 批次计划入库数:\n "+e._s(a.batch_goods_qty)+" |\n 批次总组盘数:\n "+e._s(a.batch_goods_in_qty)+" |\n 批次总出库数:\n "+e._s(a.batch_goods_out_qty)+" |\n 在库数量:\n "+e._s(a.batch_goods_in_location_qty)+" |\n ")])]},proxy:!0}],null,!0)},[t("div",{staticClass:"timeline-content"},[t("div",{staticClass:"row"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"text-caption"},[e._v("\n 操作类型: "+e._s(e.logtypeToText(a.log_type))+"\n ")]),t("div",{staticClass:"text-caption"},[e._v("\n 操作人: "+e._s(a.creater)+"\n ")])]),t("div",{staticClass:"col-6"},[e._v("\n 数量变化:"),t("br"),"delete"===a.log_type?t("span",[e._v("\n "+e._s(a.old_goods_qty)+" →\n "+e._s(a.new_goods_qty)+"\n ")]):"out"===a.log_type?t("span",[e._v("\n 出库数量:"+e._s(a.old_goods_out_qty)+" →\n "+e._s(a.new_goods_out_qty)+"\n ")]):"create"===a.log_type?t("span",[e._v("\n 入库数量:"+e._s(a.old_goods_qty)+" →\n "+e._s(a.new_goods_in_qty)+"\n ")]):"update"===a.log_type?t("span",[e._v("\n 入库数量:"+e._s(a.old_goods_qty)+" →\n "+e._s(a.new_goods_qty)+"\n "),t("br"),e._v("\n 出库数量:"+e._s(a.old_goods_out_qty)+" →\n "+e._s(a.new_goods_out_qty)+"\n ")]):e._e()])])])])})),1):t("div",{staticClass:"text-caption text-grey"},[e._v("\n 暂无容器操作记录\n ")])],1)])]],2)]}}])})],1),[t("div",{directives:[{name:"show",rawName:"v-show",value:0!==e.max,expression:"max !== 0"}],staticClass:"q-pa-lg flex flex-center"},[t("div",[e._v(e._s(e.total))]),t("q-pagination",{attrs:{color:"black",max:e.max,"max-pages":6,"boundary-links":""},on:{click:function(t){e.getSearchList(e.current),e.paginationIpt=e.current}},model:{value:e.current,callback:function(t){e.current=t},expression:"current"}}),t("div",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.paginationIpt,expression:"paginationIpt"}],staticStyle:{width:"60px","text-align":"center"},domProps:{value:e.paginationIpt},on:{blur:e.changePageEnter,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.changePageEnter.apply(null,arguments)},input:function(t){t.target.composing||(e.paginationIpt=t.target.value)}}})])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:0===e.max,expression:"max === 0"}],staticClass:"q-pa-lg flex flex-center"},[t("q-btn",{attrs:{flat:"",push:"",color:"dark",label:e.$t("no_data")}})],1)]],2)},o=[],s=(a("a79d"),a("ddb0"),a("9861"),a("5319"),a("3004")),i=a("bd4c"),l=a("18d6"),r=a("91f1"),c={name:"PageTask",components:{containercard:r["a"]},data(){return{createDate1:"",createDate2:"",date_range:"",proxyDate:"",date:"",goods_code:"",goods_desc:"",openid:"",login_name:"",authin:"0",searchUrl:"",pathname:"container/batchdetaillog/",pathname_previous:"",pathname_next:"",separator:"cell",loading:!1,height:"",viewForm:!1,editDialog:!1,table_list:[],columns:[{name:"expand",label:"",align:"left",headerStyle:"width: 50px"},{name:"create_time",label:"操作时间",field:"create_time",align:"center",headerStyle:"width: 40px"},{name:"log_type",label:"操作类型",field:"log_type",align:"center",headerStyle:"width: 20px"},{name:"bound_code",label:"单据编号",align:"center",field:"bound_code"},{name:"batch_code",label:"批号",align:"center",field:"batch_code"},{name:"goods_code",label:"存货编码",field:"goods_code",align:"center"},{name:"goods_desc",label:"存货名称",field:"goods_desc",align:"center"},{name:"goods_qty",label:"数目",align:"center"},{name:"goods_unit",label:"单位",field:"goods_unit",align:"center",headerStyle:"width: 20px"},{name:"check_status",label:"质检状态",field:"check_status",align:"center",headerStyle:"width: 20px"}],filter:"",pagination:{page:1,rowsPerPage:11},current:1,max:0,total:0,paginationIpt:1,containers:{},timer:null,showInventoryDetails:!1,select_container_number:0,select_container_code:0,filterModels:{bound_department:null},editForm:{id:"",bound_number:"",goods_code:"",goods_desc:"",goods_qty:"",goods_unit:"",goods_package:"",goods_in_qty:"",goods_out_qty:"",goods_std:"",check_status:"",check_user:"默认质检人",create_time:"",note:"无"},activeSearchField:"",activeSearchLabel:"",filterdata:{}}},computed:{interval(){return this.$t("download_center.start")+" - "+this.$t("download_center.end")}},methods:{handleEditRow(e){this.editForm={...e},this.editForm.note=this.editForm.note||"无",this.editForm.check_user=this.editForm.check_user||"默认质检人",console.log(this.editForm),this.editDialog=!0},saveEditRow(){const e=this;Object(s["i"])(`bound/batch/${e.editForm.id}/`,e.editForm).then((t=>{if(e.editDialog=!1,400!==t.status_code)e.$q.notify({message:"修改成功",color:"positive"}),e.getSearchList();else{const a={note:"备注",check_user:"质检人"};let n="修改失败";for(const e in t)if(Array.isArray(t[e])&&t[e].length>0){const o=a[e]||e;n=`${o}: ${t[e].join(" ")}`;break}console.error("修改失败",n),e.$q.notify({message:n,color:"negative"})}})).catch((t=>{console.error("修改失败",t),e.$q.notify({message:"发生未知错误,请联系管理员",color:"negative"})}))},checkStatusToText(e){const t={0:"待质检",1:"质检合格",2:"质检问题"};return t[e]||"未知状态"},logtypeToText(e){const t={create:"批次入库",out:"批次出库",delete:"批次删除",update:"批次更新"};return t[e]||"未知状态"},getRowStyle(e){const t={0:"#fff9c4",1:"#c8e6c9",2:"#ffcdd2"},a=t[e.check_status]||"";return a?{backgroundColor:a}:{}},handleFilterChange(){this.pagination.page=1,this.getSearchList(1)},getFilterOptions(e){switch(e){case"type":return[{label:"生产入库",value:1},{label:"采购入库",value:2},{label:"其他入库",value:3},{label:"调拨入库",value:4}];case"bound_status":return[{label:"待质检",value:0},{label:"质检合格",value:1}];case"bound_department":return this.bound_department_list;case"check_status":return[{label:"待质检",value:0},{label:"质检合格",value:1},{label:"质检问题",value:2}];case"log_type":return[{label:"批次入库",value:"create"},{label:"批次出库",value:"out"},{label:"批次删除",value:"delete"},{label:"批次更新",value:"update"}];default:return[]}},getStatusText(e){const t={0:"待入库",1:"在库",2:"待出库",3:"已出库",4:"异常"};return t[e]||"未知状态"},handleHeaderDblClick(e){["detail","action"].includes(e.name)||(this.activeSearchField=e.field,this.activeSearchLabel=e.label,this.$q.dialog({title:`搜索${e.label}`,message:`请输入${e.label}的搜索条件`,prompt:{model:"",type:"text"},cancel:!0,persistent:!0}).onOk((t=>{this.executeColumnSearch(e.field,t)})).onCancel((()=>{this.activeSearchField="",this.activeSearchLabel=""})))},executeColumnSearch(e,t){if("type"===e||"audit_status"===e||"save_status"===e||"bound_status"===e){const a={[e]:t};this.filter="",this.date_range="",this.getList({...a,page:1}),this.filterdata=a,this.$q.notify({message:`已搜索 ${this.activeSearchLabel} 含有 "${t}" 的结果`,icon:"search",color:"positive"}),this.activeSearchField="",this.activeSearchLabel=""}else{const a={[e+"__icontains"]:t};this.filter="",this.date_range="",this.getList({...a,page:1}),this.filterdata=a,this.$q.notify({message:`已搜索 ${this.activeSearchLabel} 含有 "${t}" 的结果`,icon:"search",color:"positive"}),this.activeSearchField="",this.activeSearchLabel=""}},class_to_name(e){const t={1:"整盘",2:"托盘组",3:"零盘"};return t[e]},handle_row_expand(e){const t=this;e.expand=!e.expand,e.expand&&(t.$set(e,"loading",!0),Object(s["e"])("container/batchdetaillog/containerlog/?batchlog_id="+e.id).then((a=>{t.$set(e,"containers",a),console.log("当前的",e.containers)})).catch((e=>{t.$q.notify({message:e.detail,color:"negative"})})).finally((()=>{e.loading=!1})))},getlog(){console.log("当前loading状态:",this.loading)},getList(e={}){var t=this;t.loading=!0;const a={page:t.current,page_size:t.pagination.rowsPerPage},n=new URLSearchParams({...a,...e});console.log(n),Array.from(n.entries()).forEach((([e,t])=>{""!==t&&null!==t&&void 0!==t||n.delete(e)})),Object(s["e"])(`${t.pathname}?${n}`).then((e=>{t.table_list=e.results.map((e=>({...e,expand:!1,containers:[],loading:!1}))),t.total=e.count,t.max=Math.ceil(e.count/t.pagination.rowsPerPage)||0,t.pathname_previous=e.previous,t.pathname_next=e.next})).catch((e=>{t.$q.notify({message:e.detail,icon:"close",color:"negative"})})).finally((()=>{t.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(e=1){this.current=e,this.paginationIpt=e;const t={};for(const[a,n]of Object.entries(this.filterModels))null!==n&&""!==n&&(t[a]=n);this.getList({number__icontains:this.filter,create_time__range:this.date_range,...t,...this.filterdata})},getListPrevious(){var e=this;l["a"].has("auth")&&Object(s["e"])(e.pathname_previous,{}).then((t=>{e.table_list=t.results,e.pathname_previous=t.previous,e.pathname_next=t.next})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},getListNext(){var e=this;l["a"].has("auth")&&Object(s["e"])(e.pathname_next,{}).then((t=>{e.table_list=t.results,e.pathname_previous=t.previous,e.pathname_next=t.next})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},reFresh(){var e=this;this.filterdata={},this.filterModels={bound_department:null},e.getSearchList()},updateProxy(){var e=this;e.proxyDate=e.date}},created(){var e=this;if(l["a"].has("openid")?e.openid=l["a"].getItem("openid"):(e.openid="",l["a"].set("openid","")),l["a"].has("login_name")?e.login_name=l["a"].getItem("login_name"):(e.login_name="",l["a"].set("login_name","")),l["a"].has("auth")){const t=Date.now(),a=i["b"].formatDate(t,"YYYY/MM/DD");e.date=a,console.log(e.date),e.authin="1",e.getList()}else e.authin="0"},mounted(){var e=this;e.$q.platform.is.electron?e.height=String(e.$q.screen.height-290)+"px":e.height=e.$q.screen.height-290+"px"},updated(){},destroyed(){},watch:{createDate1(e){e?(e.to?(this.createDate2=`${e.from} - ${e.to}`,this.date_range=`${e.from},${e.to} `):(this.createDate2=`${e}`,this.dateArray=e.split("/"),this.searchUrl=this.pathname+"?create_time__year="+this.dateArray[0]+"&create_time__month="+this.dateArray[1]+"&create_time__day="+this.dateArray[2]),this.date_range=this.date_range.replace(/\//g,"-"),this.getSearchList(),this.$refs.qDateProxy.hide()):(this.createDate2="",this.date_range="",this.getSearchList())}}},d=c,p=(a("b62e"),a("42e1")),h=a("431e"),u=a("eaac"),_=a("357e"),g=a("ddd8"),m=a("e7a9"),b=a("9c40"),f=a("05c0"),v=a("2c91"),y=a("27f9"),x=a("0016"),w=a("7cbe"),q=a("52ee"),k=a("bd08"),S=a("db86"),$=a("05eb"),C=a("74af"),D=a("3b16"),L=a("7f67"),F=a("eebe"),P=a.n(F),T=Object(p["a"])(d,n,o,!1,null,"9265d28c",null);"function"===typeof h["default"]&&Object(h["default"])(T);t["default"]=T.exports;P()(T,"components",{QTable:u["a"],QTh:_["a"],QSelect:g["a"],QBtnGroup:m["a"],QBtn:b["a"],QTooltip:f["a"],QSpace:v["a"],QInput:y["a"],QIcon:x["a"],QPopupProxy:w["a"],QDate:q["a"],QTr:k["a"],QTd:S["a"],QTimeline:$["a"],QTimelineEntry:C["a"],QPagination:D["a"]}),P()(T,"directives",{ClosePopup:L["a"]})},fb85:function(e,t){}}]);