| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[43],{"393d":function(t,e,a){"use strict";a.r(e);a("caad");var i=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,filter:t.filter,columns:t.columns,"hide-bottom":"",pagination:t.pagination,"no-data-label":"暂无数据","no-results-label":"没有找到匹配的数据","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)}}},[["status","group_type"].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",{staticClass:"q-mr-sm",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),e("q-btn",{staticClass:"q-mr-sm",attrs:{label:"托盘数检测",icon:"fact_check",loading:t.checkLoading,disable:t.checkLoading},on:{click:t.runConsistencyCheck}},[e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[t._v("检测库位组托盘数一致性")])],1)],1),e("q-space"),e("q-space"),e("q-input",{staticClass:"search-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"}})]},proxy:!0},{key:"body",fn:function(a){return[e("q-tr",{class:t.statusRowClass(a.row),attrs:{props:a}},[e("q-td",{key:"detail",attrs:{props:a}},[e("q-btn",{attrs:{round:"",flat:"",push:"",color:"primary",icon:"description",size:"sm"},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("查看库位详情")])],1)],1),e("q-td",{key:"location_items",staticClass:"text-center",attrs:{props:a}},[e("q-badge",{attrs:{color:"blue",rounded:""}},[t._v(t._s((a.row.location_items||[]).length))])],1),e("q-td",{key:"group_name",staticClass:"text-bold",attrs:{props:a}},[t._v(t._s(a.row.group_name))]),e("q-td",{key:"group_code",staticClass:"text-grey-8",attrs:{props:a}},[t._v(t._s(a.row.group_code))]),e("q-td",{key:"group_type",attrs:{props:a}},[e("q-badge",{attrs:{color:"teal",rounded:""}},[t._v(t._s(t.groupTypeLabel(a.row.group_type)))])],1),e("q-td",{key:"max_capacity",staticClass:"text-center",attrs:{props:a}},[t._v(t._s(a.row.max_capacity))]),e("q-td",{key:"current_quantity",staticClass:"text-center",attrs:{props:a}},[e("span",{class:{"text-positive":a.row.current_quantity<a.row.max_capacity,"text-negative":a.row.current_quantity>=a.row.max_capacity}},[t._v("\n "+t._s(a.row.current_quantity)+"\n ")])]),e("q-td",{key:"current_batch",staticClass:"text-center",attrs:{props:a}},[a.row.current_batch?e("span",{staticClass:"text-caption text-grey-7"},[t._v(t._s(a.row.current_batch))]):e("span",{staticClass:"text-caption text-grey-4"},[t._v("--")])]),e("q-td",{key:"current_goods_code",staticClass:"text-center",attrs:{props:a}},[a.row.current_goods_code?e("span",{staticClass:"text-caption"},[t._v(t._s(a.row.current_goods_code))]):e("span",{staticClass:"text-caption text-grey-4"},[t._v("--")])]),e("q-td",{key:"status",staticClass:"text-center",attrs:{props:a}},[e("q-badge",{staticClass:"text-body2 status-badge",attrs:{color:t.statusColor(a.row.status),align:"middle"}},[t._v("\n "+t._s(t.statusLabel(a.row.status))+"\n ")])],1),e("q-td",{key:"operation",staticClass:"text-center",attrs:{props:a}},[e("q-btn",{attrs:{flat:"",dense:"",icon:"edit",color:"primary",size:"sm"},on:{click:function(e){return t.openEdit(a.row)}}},[e("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[t._v("编辑库位组")])],1)],1)],1)]}}])})],1),e("q-dialog",{attrs:{persistent:""},model:{value:t.detailDialog,callback:function(e){t.detailDialog=e},expression:"detailDialog"}},[e("q-card",{staticClass:"dialog-card",staticStyle:{"min-width":"700px","max-width":"90vw"}},[e("q-card-section",{staticClass:"row items-center dialog-header"},[e("div",{staticClass:"text-h6 dialog-title"},[t._v("库位组详情")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"close-btn",attrs:{icon:"close",flat:"",round:"",dense:""}})],1),e("q-separator"),e("q-card-section",{staticClass:"dialog-content"},[e("q-table",{attrs:{loading:t.detailLoading,columns:t.detailColumns,data:t.detailLocations,"row-key":"id",flat:"",bordered:"","hide-bottom":"","no-data-label":"暂无库位数据","no-results-label":"暂无库位数据"},scopedSlots:t._u([{key:"body-cell-status",fn:function(a){return[e("q-td",{staticClass:"text-center",attrs:{props:a}},[e("q-badge",{staticClass:"status-badge",attrs:{color:t.statusColor(a.row.status),align:"middle"}},[t._v("\n "+t._s(t.statusLabel(a.row.status))+"\n ")])],1)]}}])})],1),e("q-card-actions",{staticClass:"dialog-actions",attrs:{align:"right"}},[e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"action-btn",attrs:{flat:"",label:"关闭",color:"primary"}})],1)],1)],1),e("q-dialog",{attrs:{persistent:""},model:{value:t.editDialog,callback:function(e){t.editDialog=e},expression:"editDialog"}},[e("q-card",{staticClass:"dialog-card edit-dialog",staticStyle:{"min-width":"520px","max-width":"90vw"}},[e("q-form",{on:{submit:function(e){return e.preventDefault(),t.submitEdit.apply(null,arguments)}}},[e("q-card-section",{staticClass:"row items-center dialog-header"},[e("div",{staticClass:"text-h6 dialog-title"},[t._v("编辑库位组")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"close-btn",attrs:{icon:"close",flat:"",round:"",dense:"",disable:t.editLoading}})],1),e("q-separator"),e("q-card-section",{staticClass:"dialog-content edit-form"},[e("div",{staticClass:"form-grid"},[e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{label:"库位组名称",readonly:""},model:{value:t.editForm.group_name,callback:function(e){t.$set(t.editForm,"group_name",e)},expression:"editForm.group_name"}})],1),e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{label:"库位组编码",readonly:""},model:{value:t.editForm.group_code,callback:function(e){t.$set(t.editForm,"group_code",e)},expression:"editForm.group_code"}})],1),e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{value:t.groupTypeLabel(t.editForm.group_type),label:"库位组类型",readonly:""}})],1),e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{type:"number",label:"最大容量",readonly:""},model:{value:t.editForm.max_capacity,callback:function(e){t.$set(t.editForm,"max_capacity",t._n(e))},expression:"editForm.max_capacity"}})],1),e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{type:"number",label:"当前托盘数",rules:[t=>t>=0||"不得为负"]},model:{value:t.editForm.current_quantity,callback:function(e){t.$set(t.editForm,"current_quantity",t._n(e))},expression:"editForm.current_quantity"}})],1),e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{label:"当前批次"},model:{value:t.editForm.current_batch,callback:function(e){t.$set(t.editForm,"current_batch",e)},expression:"editForm.current_batch"}})],1),e("div",{staticClass:"form-item"},[e("q-input",{staticClass:"form-input",attrs:{label:"当前货物编码"},model:{value:t.editForm.current_goods_code,callback:function(e){t.$set(t.editForm,"current_goods_code",e)},expression:"editForm.current_goods_code"}})],1),e("div",{staticClass:"form-item full-width"},[e("q-select",{staticClass:"form-input",attrs:{options:t.statusOptions,"option-value":"value","option-label":"label","emit-value":"","map-options":"",label:"状态"},model:{value:t.editForm.status,callback:function(e){t.$set(t.editForm,"status",e)},expression:"editForm.status"}})],1)])]),e("q-card-actions",{staticClass:"dialog-actions",attrs:{align:"right"}},[e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"action-btn",attrs:{flat:"",label:"取消",color:"primary",disable:t.editLoading}}),e("q-btn",{staticClass:"action-btn save-btn",attrs:{color:"primary",label:"保存",type:"submit",loading:t.editLoading}})],1)],1)],1)],1),e("q-dialog",{model:{value:t.consistencyDialog,callback:function(e){t.consistencyDialog=e},expression:"consistencyDialog"}},[e("q-card",{staticClass:"dialog-card",staticStyle:{"min-width":"720px","max-width":"95vw"}},[e("q-card-section",{staticClass:"row items-center dialog-header"},[e("div",{staticClass:"text-h6 dialog-title"},[t._v("托盘数一致性检测")]),e("q-space"),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"close-btn",attrs:{icon:"close",flat:"",round:"",dense:"",disable:t.checkLoading}})],1),e("q-separator"),e("q-card-section",{staticClass:"dialog-content"},[e("q-banner",{staticClass:"q-mb-md",class:t.consistencySummary.inconsistent_groups>0?"bg-orange-2 text-dark":"bg-green-2 text-dark",attrs:{dense:""}},[t._v("\n 共检测 "+t._s(t.consistencySummary.total_groups||0)+" 个库位组,\n 发现 "+t._s(t.consistencySummary.inconsistent_groups||0)+" 个异常。\n ")]),e("q-table",{attrs:{flat:"",bordered:"","row-key":"group_code",loading:t.checkLoading,pagination:t.consistencyPagination,columns:t.consistencyColumns,data:t.consistencyResults,"rows-per-page-options":[0],"hide-bottom":"","no-data-label":"未发现异常库位组"},scopedSlots:t._u([{key:"body-cell-difference",fn:function(a){return[e("q-td",{class:{"text-negative":0!==a.value},attrs:{props:a}},[t._v("\n "+t._s(a.value)+"\n ")])]}},{key:"body-cell-locations",fn:function(a){return[e("q-td",{attrs:{props:a}},[a.row.locations&&a.row.locations.length?e("div",t._l(a.row.locations,(function(a){return e("div",{key:a.location_code,staticClass:"text-caption q-mb-xs"},[t._v("\n "+t._s(a.location_code)+"(记录: "+t._s(a.recorded_quantity)+",实际:\n "+t._s(a.link_quantity)+",差值: "+t._s(a.difference)+")\n ")])})),0):e("div",{staticClass:"text-grey-5"},[t._v("--")])])]}}])})],1),e("q-card-actions",{staticClass:"dialog-actions",attrs:{align:"right"}},[e("q-btn",{staticClass:"action-btn q-mr-sm",attrs:{flat:"",label:"修复异常",color:"warning",loading:t.fixLoading,disable:t.fixLoading||t.checkLoading||!t.hasInconsistentResults},on:{click:t.fixConsistencyIssues}}),e("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"action-btn",attrs:{flat:"",label:"关闭",color:"primary",disable:t.checkLoading}})],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 pagination-container"},[e("div",{staticClass:"total-text"},[t._v("共 "+t._s(t.total)+" 条记录")]),e("q-pagination",{staticClass:"custom-pagination",attrs:{color:"primary",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",{staticClass:"page-input-container"},[e("span",{staticClass:"page-text"},[t._v("跳至")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.paginationIpt,expression:"paginationIpt"}],staticClass:"page-input",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)}}}),e("span",{staticClass:"page-text"},[t._v("页")])])],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)},s=[],n=(a("d9e2"),a("ddb0"),a("9861"),a("a79d"),a("3004")),o=a("18d6"),r={name:"Pageflowlist",data(){return{createDate1:"",createDate2:"",date_range:"",proxyDate:"",date:"",goods_code:"",goods_desc:"",openid:"",login_name:"",authin:"0",searchUrl:"",pathname:"bin/group/",pathfilename:"reportcenter/file/",current_bin_type:"",bin_type:["T1","T2","T4","T5","S4"],bin_type_name:["散盘","2托","4托","5托","4散"],pathname_previous:"",pathname_next:"",separator:"cell",loading:!1,checkLoading:!1,fixLoading:!1,height:"",viewForm:!1,printObj:{id:"printMe",popTitle:this.$t("inbound.asn")},table_list:[],columns:[{name:"detail",label:"库位详情",field:"detail",align:"center",filterType:"none"},{name:"location_items",label:"库位数",field:"location_items",align:"center",filterType:"text"},{name:"group_name",required:!0,label:"库位组名称",align:"center",field:"group_name",filterType:"text"},{name:"group_code",label:"库位组编码",field:"group_code",align:"center",filterType:"text"},{name:"group_type",label:"库位组类型",field:"group_type",align:"center",filterType:"select"},{name:"max_capacity",label:"最大容量",field:"max_capacity",align:"center",filterType:"text"},{name:"current_quantity",label:"当前托盘数",field:"current_quantity",align:"center",filterType:"text"},{name:"current_batch",label:"当前批次",field:"current_batch",align:"center",filterType:"text"},{name:"current_goods_code",label:"当前货物编码",field:"current_goods_code",align:"center",filterType:"text"},{name:"status",label:"状态",field:"status",align:"center",filterType:"select"},{name:"operation",label:"操作",field:"operation",align:"center",filterType:"none"}],filter:"",pagination:{page:1,rowsPerPage:11},newForm:!1,newFormData:{document_date:"",document_number:"",document_type:"",business_type:"",iout_type:"",department:"",warehouse_code:"",warehouse_name:"",goods_code:"",goods_desc:"",goods_std:"",goods_batch:"",in_batch:"",out_batch:"",goods_unit:"",goods_in:"",goods_out:"",goods_notes:"",creator:""},editid:0,editFormData:{},editMode:!1,deleteForm:!1,deleteid:0,bar_code:"",error1:this.$t("goods.view_goodslist.error1"),current:1,max:0,total:0,paginationIpt:1,detailDialog:!1,detailLoading:!1,detailLocations:[],detailColumns:[{name:"location_code",label:"库位编码",field:"location_code",align:"center"},{name:"status",label:"状态",field:"status",align:"center"},{name:"current_quantity",label:"当前托盘数",field:"current_quantity",align:"center"},{name:"location_type",label:"货位类型",field:"location_type",align:"center"}],editDialog:!1,editLoading:!1,editForm:{},consistencyDialog:!1,consistencyPagination:{rowsPerPage:0},consistencySummary:{total_groups:0,inconsistent_groups:0,consistent_groups:0},consistencyResults:[],consistencyColumns:[{name:"group_code",label:"库位组编码",field:"group_code",align:"center"},{name:"group_name",label:"库位组名称",field:"group_name",align:"center"},{name:"recorded_quantity",label:"记录托盘数",field:"recorded_quantity",align:"center"},{name:"link_quantity",label:"实际托盘数",field:"link_quantity",align:"center"},{name:"difference",label:"差值",field:"difference",align:"center"},{name:"locations",label:"异常库位明细",field:"locations",align:"left"}],statusOptions:[{label:"可用",value:"available"},{label:"占用",value:"occupied"},{label:"满",value:"full"},{label:"禁用",value:"disabled"},{label:"预留",value:"reserved"},{label:"维护中",value:"maintenance"}],statusColorMap:{available:"positive",occupied:"warning",reserved:"info",full:"negative",disabled:"grey-6",maintenance:"orange-5"},filterParams:{},filterModels:{status:null,group_type:null},activeSearchField:"",activeSearchLabel:"",filterdata:{}}},computed:{interval(){return this.$t("download_center.start")+" - "+this.$t("download_center.end")},activeIndex(){const t=this.bin_type.indexOf(this.current_bin_type);return t>=0?t:0},groupTypeMap(){return this.bin_type.reduce(((t,e,a)=>(t[e]=this.bin_type_name[a]||e,t)),{})},statusLabelMap(){return this.statusOptions.reduce(((t,e)=>(t[e.value]=e.label,t)),{})},hasInconsistentResults(){return!!Array.isArray(this.consistencyResults)&&this.consistencyResults.some((t=>t&&"object"===typeof t&&0!==Number(t.difference||0)))},sliderStyle(){return{width:100/this.bin_type.length+"%",transform:`translateX(${100*this.activeIndex}%)`}}},methods:{getList(t={}){var e=this;e.loading=!0;const a=new Promise(((t,e)=>{setTimeout((()=>{e(new Error("请求超时,请检查网络连接或API服务状态"))}),1e4)})),i={page:e.current,page_size:e.pagination.rowsPerPage},s=new URLSearchParams({...i,...t});Array.from(s.entries()).forEach((([t,e])=>{""!==e&&null!==e&&void 0!==e||s.delete(t)}));const o=s.toString(),r=o?`${e.pathname}?${o}`:e.pathname;Promise.race([Object(n["e"])(r),a]).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=>{console.error("API请求错误:",t),e.$q.notify({message:t.message||t.detail||"请求失败,请检查网络连接",icon:"close",color:"negative",timeout:5e3})})).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,e={}){this.current=t,this.paginationIpt=t;const a={};for(const[s,n]of Object.entries(this.filterModels))null!==n&&""!==n&&(a[s]=n);const i={...this.filterParams,...e,...a,group_name__icontains:this.filter||void 0};Object.keys(i).forEach((t=>{""!==i[t]&&null!==i[t]&&void 0!==i[t]||delete i[t]})),this.filterParams=i,this.getList(this.filterParams)},getListPrevious(){var t=this;o["a"].has("auth")&&Object(n["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;o["a"].has("auth")&&Object(n["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.filterModels={status:null,group_type:null},this.filterdata={},this.filter="",t.getSearchList()},async runConsistencyCheck(){this.checkLoading=!0;try{const t=`${this.pathname}check-pallet-consistency/?only_inconsistent=true`,e=await Object(n["e"])(t);this.consistencySummary=(null===e||void 0===e?void 0:e.summary)||{total_groups:0,inconsistent_groups:0,consistent_groups:0},this.consistencyResults=(null===e||void 0===e?void 0:e.data)||[];const a=this.consistencySummary.inconsistent_groups||0;this.$q.notify({message:a>0?`发现 ${a} 个库位组托盘数异常`:"所有库位组托盘数一致",color:a>0?"warning":"positive",icon:a>0?"warning":"check"}),this.consistencyDialog=!0}catch(s){var t,e,a,i;console.error("托盘数检测失败:",s),this.$q.notify({message:(null===s||void 0===s||null===(t=s.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.message)||(null===s||void 0===s||null===(a=s.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.detail)||(null===s||void 0===s?void 0:s.message)||"托盘数检测失败,请稍后重试",color:"negative",icon:"close",timeout:5e3})}finally{this.checkLoading=!1}},async fixConsistencyIssues(){const t=(this.consistencyResults||[]).filter((t=>0!==Number((null===t||void 0===t?void 0:t.difference)||0)));if(0!==t.length){this.fixLoading=!0;try{var e,a;const i={group_codes:t.map((t=>null===t||void 0===t?void 0:t.group_code)).filter((t=>!!t))},s=await Object(n["h"])(`${this.pathname}fix-pallet-consistency/`,i),o=(null===s||void 0===s||null===(e=s.summary)||void 0===e?void 0:e.fixed_groups)||0,r=(null===s||void 0===s||null===(a=s.summary)||void 0===a?void 0:a.fixed_locations)||0;this.$q.notify({message:`修复完成,更新 ${o} 个库位组、${r} 个库位`,color:"positive",icon:"check"}),await this.getList(this.filterParams),await this.runConsistencyCheck()}catch(l){var i,s,o,r;console.error("托盘数修复失败:",l),this.$q.notify({message:(null===l||void 0===l||null===(i=l.response)||void 0===i||null===(s=i.data)||void 0===s?void 0:s.message)||(null===l||void 0===l||null===(o=l.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.detail)||(null===l||void 0===l?void 0:l.message)||"托盘数修复失败,请稍后重试",color:"negative",icon:"close",timeout:5e3})}finally{this.fixLoading=!1}}else this.$q.notify({message:"暂无需要修复的库位组",color:"info",icon:"info"})},handleSwitch(t){if(this.current_bin_type===t)return this.current_bin_type="",delete this.filterParams.group_type,this.current=1,this.paginationIpt=1,void this.getSearchList(1,{group_type:void 0});this.current_bin_type=t,this.current=1,this.paginationIpt=1,this.getSearchList(1,{group_type:t})},groupTypeLabel(t){return t?this.groupTypeMap[t]||t:"--"},statusColor(t){return this.statusColorMap[t]||"grey-6"},statusLabel(t){if(!t)return"--";const e="string"===typeof t?t:String(t),a="string"===typeof e?e.toLowerCase():e;return this.statusLabelMap[e]||this.statusLabelMap[a]||e},statusRowClass(t){if(!t||!t.status)return"";const e=`row-status-${t.status}`,a=t.current_quantity>=t.max_capacity?"row-full":"";return`${e} ${a}`.trim()},detailData(t){console.log("查看详情:",t),this.detailDialog=!0},openEdit(t){var e,a;t&&"object"===typeof t?(this.editid=t.id,this.editForm={id:t.id,group_name:t.group_name||"",group_code:t.group_code||"",group_type:t.group_type||"",max_capacity:Number(null!==(e=t.max_capacity)&&void 0!==e?e:0),current_quantity:Number(null!==(a=t.current_quantity)&&void 0!==a?a:0),current_batch:t.current_batch||"",current_goods_code:t.current_goods_code||"",status:t.status||""},this.editDialog=!0):this.$q.notify({message:"未找到可编辑的数据行",color:"warning",icon:"warning"})},async submitEdit(){var t,e;if(!this.editForm||!this.editForm.id)return void this.$q.notify({message:"未找到有效的编辑数据",color:"negative",icon:"error"});if(this.editForm.current_quantity<0)return void this.$q.notify({message:"当前托盘数不得为负数",color:"warning",icon:"warning"});this.editLoading=!0;const a={group_name:this.editForm.group_name,group_code:this.editForm.group_code,group_type:this.editForm.group_type,max_capacity:Number(null!==(t=this.editForm.max_capacity)&&void 0!==t?t:0),current_quantity:Number(null!==(e=this.editForm.current_quantity)&&void 0!==e?e:0),current_batch:this.editForm.current_batch||"",current_goods_code:this.editForm.current_goods_code||"",status:this.editForm.status||""};try{await Object(n["i"])(`${this.pathname}${this.editForm.id}/`,a),this.$q.notify({message:"保存成功",color:"positive",icon:"check"}),this.editDialog=!1,this.getList(this.filterParams)}catch(o){var i,s;console.error("保存库位组失败:",o),this.$q.notify({message:(null===o||void 0===o||null===(i=o.response)||void 0===i||null===(s=i.data)||void 0===s?void 0:s.detail)||(null===o||void 0===o?void 0:o.message)||"保存失败,请稍后重试",color:"negative",icon:"close",timeout:5e3})}finally{this.editLoading=!1}},handleHeaderDblClick(t){["detail","operation"].includes(t.name)||(this.activeSearchField=t.field,this.activeSearchLabel=t.label,"select"===t.filterType||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(!e)return;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=""},handleFilterChange(){this.pagination.page=1,this.getSearchList(1)},getFilterOptions(t){switch(t){case"status":return this.statusOptions;case"group_type":return this.bin_type.map(((t,e)=>({label:this.bin_type_name[e]||t,value:t})));default:return[]}}},created(){var t=this;o["a"].has("openid")?t.openid=o["a"].getItem("openid"):(t.openid="",o["a"].set("openid","")),o["a"].has("login_name")?t.login_name=o["a"].getItem("login_name"):(t.login_name="",o["a"].set("login_name","")),o["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"}},l=r,c=(a("c878"),a("42e1")),d=a("eaac"),u=a("357e"),p=a("ddd8"),g=a("e7a9"),m=a("9c40"),h=a("05c0"),_=a("2c91"),b=a("27f9"),f=a("0016"),y=a("bd08"),v=a("db86"),x=a("58a81"),q=a("24e8"),C=a("f09f"),w=a("a370"),k=a("eb85"),L=a("4b7e"),F=a("0378"),$=a("54e1"),S=a("3b16"),P=a("8572"),T=a("7f67"),D=a("eebe"),I=a.n(D),Q=Object(c["a"])(l,i,s,!1,null,"453308d9",null);e["default"]=Q.exports;I()(Q,"components",{QTable:d["a"],QTh:u["a"],QSelect:p["a"],QBtnGroup:g["a"],QBtn:m["a"],QTooltip:h["a"],QSpace:_["a"],QInput:b["a"],QIcon:f["a"],QTr:y["a"],QTd:v["a"],QBadge:x["a"],QDialog:q["a"],QCard:C["a"],QCardSection:w["a"],QSeparator:k["a"],QCardActions:L["a"],QForm:F["a"],QBanner:$["a"],QPagination:S["a"],QField:P["a"]}),I()(Q,"directives",{ClosePopup:T["a"]})},c878:function(t,e,a){"use strict";a("cfbc")},cfbc:function(t,e,a){}}]);
|