14.f187fd27.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[14],{"15e8":function(e,t){},c643:function(e,t,a){},cbb2:function(e,t,a){"use strict";a("c643")},cdc4:function(e,t,a){"use strict";var n=a("15e8"),i=a.n(n);t["default"]=i.a},fbe5: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)}}},[["bound_department"].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("q-btn-group",{staticClass:"q-ml-md",attrs:{push:""}}),t("q-input",{attrs:{outlined:"",rounded:"",dense:"",debounce:"300",color:"primary",placeholder:e.$t("search")},on:{input:function(t){return e.getSearchList()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.getSearchList()}},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{attrs:{name:"search"},on:{click:function(t){return e.getSearchList()}}})]},proxy:!0}]),model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1)]},proxy:!0},{key:"body",fn:function(a){var n;return[t("q-tr",{attrs:{props:a}},[t("q-td",{attrs:{"auto-width":""}},[t("q-btn",{attrs:{size:"sm",round:"",icon:a.row.expand?"remove":"ballot"},on:{click:function(t){return e.handle_row_expand(a.row)}}})],1),e._l(e.columns.filter((e=>"expand"!==e.name)),(function(n){return t("q-td",{key:n.name,attrs:{props:a}},[e._v("\n "+e._s(n.field?a.row[n.field]:a.row[n.name])+"\n ")])}))],2),t("q-tr",{directives:[{name:"show",rawName:"v-show",value:a.row.expand,expression:"props.row.expand"}],staticClass:"expanded-row",attrs:{props:a}},[t("q-td",{attrs:{colspan:"100%"}},[t("div",{staticClass:"q-pa-md timeline-wrapper"},[null!==(n=a.row.batch_items)&&void 0!==n&&n.length?t("q-timeline",{attrs:{color:"#e0e0e0"}},e._l(a.row.batch_items,(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("批次 "+e._s(a.bound_number))]),t("div",{staticClass:"row"},[t("div",{staticClass:"col"},[t("div",{staticClass:"custom-title"},[e._v("\n "+e._s(a.goods_desc)+"\n ")])]),t("div",{staticClass:"col"},[t("div",{staticClass:"custom-title"},[e._v("\n 计划数量:"+e._s(a.goods_qty)+"\n ")])]),t("div",{staticClass:"col"},[t("div",{staticClass:"custom-title"},[e._v("\n 入库数量:"+e._s(a.goods_in_qty)+"\n ")])]),t("div",{staticClass:"col"},[t("div",{staticClass:"custom-title"},[e._v("\n 实际在库数量:"+e._s(a.goods_in_location_qty)+"\n ")])]),t("div",{staticClass:"col"},[t("div",{staticClass:"custom-title"},[e._v("\n 预定/已出库数量:"+e._s(a.goods_out_qty)+"\n ")])])])])]},proxy:!0}],null,!0)})})),1):a.row.loading?t("div",{staticClass:"text-center q-pa-md"},[t("q-spinner",{attrs:{color:"primary",size:"2em"}}),t("div",{staticClass:"q-mt-sm"},[e._v("正在加载信息...")])],1):e._e()],1)])],1)]}}])})],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)},i=[],s=(a("a79d"),a("ddb0"),a("9861"),a("5319"),a("3004")),o=(a("c4e3"),a("bd4c")),l=a("18d6"),r={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,filterModels:{bound_department:null},activeSearchField:"",activeSearchLabel:"",filterdata:{}}},computed:{interval(){return this.$t("download_center.start")+" - "+this.$t("download_center.end")}},methods:{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;default:return[]}},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"])("bound/batch/count/"+e.id+"/",{}).then((a=>{t.$set(e,"batch_items",a.batch_items),console.log("当前的",e.batch_items)})).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,batch_items:[],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,document_date__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=o["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+"?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=r,d=(a("cbb2"),a("42e1")),h=a("cdc4"),u=a("eaac"),p=a("357e"),m=a("ddd8"),g=a("e7a9"),_=a("9c40"),b=a("05c0"),f=a("2c91"),v=a("27f9"),x=a("0016"),y=a("bd08"),w=a("db86"),q=a("05eb"),k=a("74af"),S=a("0d59"),$=a("3b16"),C=a("52ee"),L=a("eebe"),I=a.n(L),D=Object(d["a"])(c,n,i,!1,null,"18cb7066",null);"function"===typeof h["default"]&&Object(h["default"])(D);t["default"]=D.exports;I()(D,"components",{QTable:u["a"],QTh:p["a"],QSelect:m["a"],QBtnGroup:g["a"],QBtn:_["a"],QTooltip:b["a"],QSpace:f["a"],QInput:v["a"],QIcon:x["a"],QTr:y["a"],QTd:w["a"],QTimeline:q["a"],QTimelineEntry:k["a"],QSpinner:S["a"],QPagination:$["a"],QDate:C["a"]})}}]);