15.9ce89ba7.js 9.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[15],{"15e8":function(t,e){},"9f80":function(t,e,a){"use strict";a("abd9")},abd9:function(t,e,a){},cdc4:function(t,e,a){"use strict";var n=a("15e8"),i=a.n(n);e["default"]=i.a},fbe5:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("div",[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: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){var n;return[e("q-tr",{attrs:{props:a}},[e("q-td",{attrs:{"auto-width":""}},[e("q-btn",{attrs:{size:"sm",round:"",icon:a.row.expand?"remove":"ballot"},on:{click:function(e){return t.handle_row_expand(a.row)}}})],1),t._l(t.columns.filter((t=>"expand"!==t.name)),(function(n){return e("q-td",{key:n.name,attrs:{props:a}},[t._v("\n "+t._s(n.field?a.row[n.field]:a.row[n.name])+"\n ")])}))],2),e("q-tr",{directives:[{name:"show",rawName:"v-show",value:a.row.expand,expression:"props.row.expand"}],staticClass:"expanded-row",attrs:{props:a}},[e("q-td",{attrs:{colspan:"100%"}},[e("div",{staticClass:"q-pa-md timeline-wrapper"},[null!==(n=a.row.batch_items)&&void 0!==n&&n.length?e("q-timeline",{attrs:{color:"#e0e0e0"}},t._l(a.row.batch_items,(function(a,n){return e("q-timeline-entry",{key:n,staticClass:"custom-node",scopedSlots:t._u([{key:"title",fn:function(){return[e("span",[e("div",[t._v("批次 "+t._s(a.bound_number))]),e("div",{staticClass:"row"},[e("div",{staticClass:"col"},[e("div",{staticClass:"custom-title"},[t._v("\n "+t._s(a.goods_desc)+"\n ")])]),e("div",{staticClass:"col"},[e("div",{staticClass:"custom-title"},[t._v("\n 计划数量:"+t._s(a.goods_qty)+"\n ")])]),e("div",{staticClass:"col"},[e("div",{staticClass:"custom-title"},[t._v("\n 入库数量:"+t._s(a.goods_in_qty)+"\n ")])]),e("div",{staticClass:"col"},[e("div",{staticClass:"custom-title"},[t._v("\n 在库数量:"+t._s(a.goods_in_qty-a.goods_out_qty)+"\n ")])])])])]},proxy:!0}],null,!0)})})),1):a.row.loading?e("div",{staticClass:"text-center q-pa-md"},[e("q-spinner",{attrs:{color:"primary",size:"2em"}}),e("div",{staticClass:"q-mt-sm"},[t._v("正在加载信息...")])],1):t._e()],1)])],1)]}}])})],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)]],2)},i=[],s=(a("a79d"),a("ddb0"),a("9861"),a("5319"),a("3004")),o=a("bd4c"),r=a("18d6"),l={name:"PageTask",data(){return{createDate1:"",createDate2:"",date_range:"",proxyDate:"",date:"",goods_code:"",goods_desc:"",openid:"",login_name:"",authin:"0",searchUrl:"",pathname:"bound/batch/count/",pathname_previous:"",pathname_next:"",separator:"cell",loading:!1,height:"",viewForm:!1,table_list:[],columns:[{name:"expand",label:"",align:"left",headerStyle:"width: 50px"},{name:"goods_code",label:"存货编码",field:"goods_code",align:"center"},{name:"goods_desc",label:"存货名称",field:"goods_desc",align:"center"},{name:"total_quantity",label:"在库数目",field:"total_quantity",align:"center"},{name:"goods_unit",label:"单位",field:"goods_unit",align:"center",headerStyle:"width: 20px"}],filter:"",pagination:{page:1,rowsPerPage:11},current:1,max:0,total:0,paginationIpt:1,containers:{},timer:null}},computed:{interval(){return this.$t("download_center.start")+" - "+this.$t("download_center.end")}},methods:{class_to_name(t){const e={1:"整盘",2:"托盘组",3:"零盘"};return e[t]},handle_row_expand(t){const e=this;t.expand=!t.expand,t.expand&&(e.$set(t,"loading",!0),Object(s["e"])("bound/batch/count/"+t.id+"/",{}).then((a=>{e.$set(t,"batch_items",a.batch_items),console.log("当前的",t.batch_items)})).catch((t=>{e.$q.notify({message:t.detail,color:"negative"})})).finally((()=>{t.loading=!1})))},getlog(){console.log("当前loading状态:",this.loading)},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(s["e"])(`${e.pathname}?${n}`).then((t=>{e.table_list=t.results.map((t=>({...t,expand:!1,batch_items:[],loading:!1}))),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({goods_desc__icontains:this.filter,create_time__range:this.date_range})},getListPrevious(){var t=this;r["a"].has("auth")&&Object(s["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;r["a"].has("auth")&&Object(s["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()},updateProxy(){var t=this;t.proxyDate=t.date}},created(){var t=this;if(r["a"].has("openid")?t.openid=r["a"].getItem("openid"):(t.openid="",r["a"].set("openid","")),r["a"].has("login_name")?t.login_name=r["a"].getItem("login_name"):(t.login_name="",r["a"].set("login_name","")),r["a"].has("auth")){const e=Date.now(),a=o["b"].formatDate(e,"YYYY/MM/DD");t.date=a,console.log(t.date),t.authin="1",t.getList()}else 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(){},watch:{createDate1(t){t?(t.to?(this.createDate2=`${t.from} - ${t.to}`,this.date_range=`${t.from},${t.to} `):(this.createDate2=`${t}`,this.dateArray=t.split("/"),this.searchUrl=this.pathname+"?document_date__year="+this.dateArray[0]+"&document_date__month="+this.dateArray[1]+"&document_date__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())}}},c=l,d=(a("9f80"),a("42e1")),p=a("cdc4"),u=a("eaac"),h=a("e7a9"),g=a("9c40"),m=a("05c0"),_=a("2c91"),f=a("27f9"),v=a("0016"),b=a("bd08"),x=a("db86"),y=a("05eb"),w=a("74af"),q=a("0d59"),k=a("3b16"),$=a("52ee"),C=a("eebe"),S=a.n(C),I=Object(d["a"])(c,n,i,!1,null,"1dede899",null);"function"===typeof p["default"]&&Object(p["default"])(I);e["default"]=I.exports;S()(I,"components",{QTable:u["a"],QBtnGroup:h["a"],QBtn:g["a"],QTooltip:m["a"],QSpace:_["a"],QInput:f["a"],QIcon:v["a"],QTr:b["a"],QTd:x["a"],QTimeline:y["a"],QTimelineEntry:w["a"],QSpinner:q["a"],QPagination:k["a"],QDate:$["a"]})}}]);