32.c084dcec.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[32],{"480d":function(t,e,a){"use strict";a("b006")},b006:function(t,e,a){},d434:function(t,e,a){"use strict";a.r(e);a("caad");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:"header-cell",fn:function(a){return[e("q-th",{attrs:{props:a},on:{dblclick:function(e){return t.handleHeaderDblClick(a.col)}}},[["bound_department"].includes(a.col.name)?[e("q-select",{staticStyle:{"min-width":"120px"},attrs:{dense:"",outlined:"",options:t.getFilterOptions(a.col.name),"option-label":"label","option-value":"value","emit-value":"","map-options":"",clearable:""},on:{input:t.handleFilterChange},scopedSlots:t._u([{key:"prepend",fn:function(){return[e("span",{staticClass:"text-caption"},[t._v(t._s(a.col.label))])]},proxy:!0}],null,!0),model:{value:t.filterModels[a.col.name],callback:function(e){t.$set(t.filterModels,a.col.name,e)},expression:"filterModels[props.col.name]"}})]:[t._v("\n "+t._s(a.col.label)+"\n ")]],2)]}},{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-btn",{attrs:{outlined:"",rounded:"",dense:"",debounce:"300",color:"primary",label:"校验",icon:"check_circle"},on:{click:function(e){return t.check_container()}}})],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(),[e("q-td",{key:"container_code",attrs:{props:a}},[t._v(t._s(a.row.container_code))])],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:"target_location",attrs:{props:a}},[e("q-input",{attrs:{dense:"",outlined:"",square:"",label:"目标位置",rules:[e=>e&&e.length>0||t.error2]},model:{value:t.editFormData.target_location,callback:function(e){t.$set(t.editFormData,"target_location",e)},expression:"editFormData.target_location"}})],1)]:a.row.id!==t.editid?[e("q-td",{key:"target_location",attrs:{props:a}},[t._v(t._s(a.row.target_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(),a.row.id===t.editid?[e("q-btn",{attrs:{dense:"",round:"",color:"positive",icon:"save"},on:{click:function(e){return t.saveEditRow(a.row)}}},[e("q-tooltip",[t._v("保存修改")])],1),e("q-btn",{attrs:{dense:"",round:"",color:"negative",icon:"cancel"},on:{click:function(e){return t.cancelEditRow(a.row)}}},[e("q-tooltip",[t._v("取消编辑")])],1)]:[e("q-btn",{attrs:{dense:"",round:"",color:"primary",icon:"edit"},on:{click:function(e){return t.handleEditRow(a.row)}}},[e("q-tooltip",[t._v("编辑该行数据")])],1)]],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"),l=a.n(s),c=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:"target_location",label:"目标位置",field:"target_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,filterModels:{bound_department:null},filterdata:{},activeSearchField:"",activeSearchLabel:""}},methods:{handleEditRow(t){this.editid=t.id,this.editFormData={container_code:t.container_code,current_location:t.current_location,target_location:t.target_location,status:t.status,last_operation:t.last_operation},this.editDialog=!0},saveEditRow(){const t=this;Object(o["i"])(`container/list/${t.editid}/`,t.editFormData).then((e=>{if(t.editDialog=!1,400!==e.status_code)t.$q.notify({message:"修改成功",color:"positive"}),t.getSearchList();else{const a={note:"备注",check_user:"质检人"};let n="修改失败";for(const t in e){if(Array.isArray(e[t])&&e[t].length>0){const i=a[t]||t;n=`${i}: ${e[t].join(" ")}`;break}n=e[t][0]}t.$q.notify({message:n,color:"negative"})}})).catch((e=>{t.$q.notify({message:e.detail,color:"negative"})}))},cancelEditRow(){this.editid=0,this.editFormData={},this.editDialog=!1},handleFilterChange(){this.pagination.page=1,this.getSearchList(1)},getFilterOptions(t){switch(t){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(t){["detail","action"].includes(t.name)||(this.activeSearchField=t.field,this.activeSearchLabel=t.label,this.$q.dialog({title:`搜索${t.label}`,message:`请输入${t.label}的搜索条件`,prompt:{model:"",type:"text"},cancel:!0,persistent:!0}).onOk((e=>{this.executeColumnSearch(t.field,e)})).onCancel((()=>{this.activeSearchField="",this.activeSearchLabel=""})))},executeColumnSearch(t,e){if("type"===t||"audit_status"===t||"save_status"===t||"bound_status"===t){const a={[t]:e};this.filter="",this.date_range="",this.getList({...a,page:1}),this.activeSearchField="",this.activeSearchLabel=""}else{const a={[t+"__icontains"]:e};this.filter="",this.date_range="",this.getList({...a,page:1}),this.filterdata=a,this.$q.notify({message:`已搜索 ${this.activeSearchLabel} 含有 "${e}" 的结果`,icon:"search",color:"positive"}),this.activeSearchField="",this.activeSearchLabel=""}},setCurrentBatch(t){this.currentBarcode=t||""},getPrintConfig(){return this.generateBarcode(),{id:"printBarcode"}},generateBarcode(){this.$refs.barcodeElement.innerHTML="";try{l()(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"})}))},check_container(){var t=this;Object(o["e"])("/container/check/").then((e=>{t.table_list=e.results,t.total=e.count,t.max=Math.ceil(e.count/t.pagination.rowsPerPage)||0,t.pathname_previous=e.previous,t.pathname_next=e.next,this.$q.notify({message:"请确认这些托盘位置是否正确,这些托盘无法正常出库",icon:"done",color:"positive"})})).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;const e={};for(const[a,n]of Object.entries(this.filterModels))null!==n&&""!==n&&(e[a]=n);this.getList({number__icontains:this.filter,document_date__range:this.date_range,...e,...this.filterdata})},getListPrevious(){var t=this;c["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;c["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;this.filterdata={},this.filterModels={bound_department:null},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;c["a"].has("openid")?t.openid=c["a"].getItem("openid"):(t.openid="",c["a"].set("openid","")),c["a"].has("login_name")?t.login_name=c["a"].getItem("login_name"):(t.login_name="",c["a"].set("login_name","")),c["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("480d"),a("42e1")),h=a("eaac"),g=a("357e"),_=a("ddd8"),m=a("e7a9"),b=a("9c40"),f=a("05c0"),v=a("2c91"),y=a("bd08"),q=a("db86"),w=a("27f9"),x=a("3b16"),k=a("52ee"),$=a("eebe"),S=a.n($),D=Object(p["a"])(u,n,i,!1,null,"0e5da179",null);e["default"]=D.exports;S()(D,"components",{QTable:h["a"],QTh:g["a"],QSelect:_["a"],QBtnGroup:m["a"],QBtn:b["a"],QTooltip:f["a"],QSpace:v["a"],QTr:y["a"],QTd:q["a"],QInput:w["a"],QPagination:x["a"],QDate:k["a"]})}}]);