daShangDao_psiWebApp/dist/assets/product.3797b436.js
97694731 1fa4f33695
Some checks failed
CI / build (18.x) (push) Failing after 37m26s
CI / build (20.x) (push) Failing after 15s
CI / deploy-preview (push) Has been skipped
CI / lint (push) Failing after 16m50s
CI / test (push) Successful in 40m41s
CI / security (push) Successful in 29m36s
多拍
2026-06-25 14:37:30 +08:00

7 lines
36 KiB
JavaScript

import{a8 as ee,r as w,a as j,$ as ue,a5 as le,az as oe,aH as ge,S as ye,U as he,av as se,_ as te,aA as ne,E as k,C as Q,b as d,a0 as ie,o as r,c as v,d as y,e as t,w as a,g as re,h as c,B as p,A as T,a1 as de,y as $,F as Y,ad as H,n as Z,a4 as Ce,aI as Fe}from"./index.173459ae.js";import{G as ve}from"./index.f2800e80.js";import{fetchProductList as be,retryProductPublish as De,destroyProduct as x,importProductsByExcel as Ee,deleteProduct as Be,createProduct as we,updateNameAndImages as ke}from"./product.9843f944.js";import{a as ce}from"./warehouse.64342456.js";import{b as Ae}from"./inventory.a8553d0e.js";import{u as Se}from"./uploadLivingPicture.bec29dca.js";import{e as Ve}from"./location.83be51dc.js";import"./request.431ecd42.js";import"./axios.e318b91e.js";const $e=ee({name:"ProductList",components:{GoodsPop:ve},emits:["edit","delete"],setup(e,{emit:u}){const L=w(!1),P=w([]),M=w([]),z=w(!1),I=j({keyword:"",status:null}),b=j({current:1,pageSize:10,total:0}),s={85:"\u516B\u4E94\u54C1",90:"\u4E5D\u54C1",100:"\u5341\u54C1"},S=j({total:0,located_count:0,unlocated_count:0,enabled_count:0,disabled_count:0}),A=m=>{var F;return m==null?"-":(F=s[m])!=null?F:String(m)},g=m=>!m&&m!==0?"-":ne.unix(Number(m)).format("YYYY-MM-DD HH:mm:ss"),_=m=>m?Array.isArray(m)?m.flatMap(U=>typeof U=="string"?U.split(",").map(J=>J.trim()).filter(Boolean):[])[0]||"":typeof m=="string"&&m.split(",").map(U=>U.trim()).filter(Boolean)[0]||"":"",V=m=>m?Array.isArray(m)?m.flatMap(F=>typeof F=="string"?F.split(",").map(U=>U.trim()).filter(Boolean):[]):typeof m=="string"?m.split(",").map(F=>F.trim()).filter(Boolean):[]:[],R=m=>m.map(F=>`${F.shop_alias_name}(${F.shop_type_name})-${F.out_task_log_id>0?F.msg||"\u5931\u8D25":"\u6210\u529F"}`).join(`
`),n=async()=>{L.value=!0;try{const F=await be({keyword:I.keyword,status:I.status!==null?String(I.status):"",page:b.current,pageSize:b.pageSize})||{};P.value=F.list||[],b.total=F.total||0,S.total=F.total,S.located_count=F.located_count,S.unlocated_count=F.unlocated_count,S.enabled_count=F.enabled_count,S.disabled_count=F.disabled_count,z.value=!0}catch{k.error({message:"\u83B7\u53D6\u5546\u54C1\u5217\u8868\u5931\u8D25",customClass:"scan-error-message"})}finally{L.value=!1}},B=()=>{b.current=1,n()},O=()=>{b.current=1,n()},G=()=>{I.keyword="",I.status=null,B()},N=(m,F)=>{De(m.id,F.shop_id,F.shop_type).then(()=>{k.success({message:"\u91CD\u8BD5\u6210\u529F",customClass:"scan-success-message"}),B()}).catch(()=>{k.error({message:"\u91CD\u8BD5\u5931\u8D25",customClass:"scan-error-message"})})},W=m=>{b.current=m,n()},f=m=>{b.pageSize=m,b.current=1,n()},D=m=>{u("edit",m)},h=m=>{u("delete",m)},E=m=>{Q.confirm(`\u786E\u5B9A\u8981\u9500\u6BC1\u5546\u54C1 "${m.name}" \u5417\uFF1F`,"\u9500\u6BC1\u786E\u8BA4",{confirmButtonText:"\u786E\u5B9A\u9500\u6BC1",cancelButtonText:"\u53D6\u6D88",type:"error"}).then(async()=>{try{await x({product_id:m.id}),k.success({message:"\u9500\u6BC1\u6210\u529F",customClass:"scan-success-message"}),B()}catch{k.error({message:"\u9500\u6BC1\u5931\u8D25",customClass:"scan-error-message"})}}).catch(()=>{})},o=m=>{M.value=m},C=w(!1),l=w(null),i=w(null),q=w(!1),K=w(null),X=w([]);async function pe(){try{const m=await ce({keyword:"",page:1,pageSize:9999});X.value=m.list||[]}catch{X.value=[]}}function me(){l.value=null,i.value=null,q.value=!1,pe(),C.value=!0}function _e(m){i.value=m.raw||null}function fe(){if(!l.value||!i.value)return;const m=localStorage.getItem("admin_userInfo");if(!m){k.error({message:"\u672A\u83B7\u53D6\u5230\u7528\u6237\u4FE1\u606F",customClass:"scan-error-message"});return}let F;try{if(F=JSON.parse(m).about_id,!F){k.error({message:"\u7528\u6237\u4FE1\u606F\u4E2D\u7F3A\u5C11 about_id",customClass:"scan-error-message"});return}}catch{k.error({message:"\u7528\u6237\u4FE1\u606F\u89E3\u6790\u5931\u8D25",customClass:"scan-error-message"});return}Ee({userId:F,warehouse_id:l.value,file:i.value}).then(()=>{n()}).catch(U=>{var J,ae;console.error("\u5BFC\u5165\u5931\u8D25",U),k.error({message:((ae=(J=U==null?void 0:U.response)==null?void 0:J.data)==null?void 0:ae.message)||(U==null?void 0:U.message)||"\u5BFC\u5165\u5931\u8D25",customClass:"scan-error-message"})}),k.success({message:"\u5DF2\u5F00\u59CB\u5BFC\u5165",customClass:"scan-success-message"}),C.value=!1,i.value=null}return ue(()=>{n()}),{loading:L,tableData:P,loadedOnce:z,searchParams:I,pagination:b,Search:le,Refresh:oe,MoreFilled:ge,Upload:ye,Edit:he,Delete:se,stats:S,formatTimestamp:g,formatAppearance:A,getFirstImage:_,getImageList:V,showAllShopMsg:R,handleSearch:O,resetSearch:G,handleCurrentChange:W,handleSizeChange:f,handleEdit:D,handleDelete:h,reTryGoosTask:N,handleDestroy:E,refreshList:B,selectedRows:M,handleSelectionChange:o,importDialogVisible:C,importWarehouseId:l,importFile:i,importLoading:q,uploadRef:K,warehouseOptions:X,handleImportClick:me,handleFileChange:_e,handleImportSubmit:fe}}}),ze={class:"product-list-wrapper"},Le={class:"filter-bar"},Ie={key:0,class:"stats-row"},Pe={class:"stat-card"},Re={class:"stat-card__value"},Ue={class:"stat-card"},Te={class:"stat-card__value"},qe={class:"stat-card"},Me={class:"stat-card__value"},Ne={class:"stat-card"},Ge={class:"stat-card__value"},Oe={class:"stat-card"},We={class:"stat-card__value"},Ye={style:{"margin-bottom":"16px",display:"flex",gap:"8px","flex-wrap":"wrap"}},je={style:{"font-weight":"600","margin-bottom":"10px","font-size":"14px"}},He={style:{display:"flex","flex-wrap":"wrap",gap:"8px"}},Ke={key:1,style:{color:"#c0c4cc"}},Je={key:1,style:{color:"#c0c4cc"}},Qe={key:0,class:"shop-list-cell"},Xe={key:0,class:"shop-item"},Ze={key:0,class:"shop-item"},xe={key:1,style:{color:"#c0c4cc"}},et={class:"pagination-wrapper"},tt={class:"dialog-footer"};function at(e,u,L,P,M,z){const I=d("Search"),b=d("el-icon"),s=d("el-input"),S=d("el-option"),A=d("el-select"),g=d("el-button"),_=d("el-table-column"),V=d("el-image"),R=d("el-popover"),n=d("GoodsPop"),B=d("el-tag"),O=d("MoreFilled"),G=d("el-link"),N=d("el-table"),W=d("el-tooltip"),f=d("el-pagination"),D=d("el-form-item"),h=d("el-upload"),E=d("el-form"),o=d("el-dialog"),C=ie("loading");return r(),v("div",ze,[y("div",Le,[t(s,{modelValue:e.searchParams.keyword,"onUpdate:modelValue":u[0]||(u[0]=l=>e.searchParams.keyword=l),placeholder:"\u5546\u54C1\u540D\u79F0/\u6761\u7801",clearable:"",style:{width:"220px"},onKeyup:re(e.handleSearch,["enter"])},{prefix:a(()=>[t(b,null,{default:a(()=>[t(I)]),_:1})]),_:1},8,["modelValue","onKeyup"]),t(A,{modelValue:e.searchParams.status,"onUpdate:modelValue":u[1]||(u[1]=l=>e.searchParams.status=l),placeholder:"\u72B6\u6001",clearable:"",style:{width:"140px"}},{default:a(()=>[t(S,{label:"\u542F\u7528",value:1}),t(S,{label:"\u7981\u7528",value:0})]),_:1},8,["modelValue"]),t(g,{type:"primary",icon:e.Search,onClick:e.handleSearch},{default:a(()=>[...u[7]||(u[7]=[c("\u641C\u7D22",-1)])]),_:1},8,["icon","onClick"]),t(g,{icon:e.Refresh,onClick:e.resetSearch},{default:a(()=>[...u[8]||(u[8]=[c("\u91CD\u7F6E",-1)])]),_:1},8,["icon","onClick"])]),e.loadedOnce?(r(),v("div",Ie,[y("div",Pe,[y("div",Re,p(e.stats.total),1),u[9]||(u[9]=y("div",{class:"stat-card__label"},"\u603B\u5546\u54C1\u6570",-1))]),y("div",Ue,[y("div",Te,p(e.stats.located_count),1),u[10]||(u[10]=y("div",{class:"stat-card__label"},"\u5DF2\u843D\u4F4D",-1))]),y("div",qe,[y("div",Me,p(e.stats.unlocated_count),1),u[11]||(u[11]=y("div",{class:"stat-card__label"},"\u672A\u843D\u4F4D",-1))]),y("div",Ne,[y("div",Ge,p(e.stats.enabled_count),1),u[12]||(u[12]=y("div",{class:"stat-card__label"},"\u542F\u7528\u4E2D",-1))]),y("div",Oe,[y("div",We,p(e.stats.disabled_count),1),u[13]||(u[13]=y("div",{class:"stat-card__label"},"\u5DF2\u7981\u7528",-1))])])):T("",!0),y("div",Ye,[t(g,{type:"primary"},{default:a(()=>[...u[14]||(u[14]=[c("\u65B0\u589E",-1)])]),_:1}),t(g,{type:"primary"},{default:a(()=>[...u[15]||(u[15]=[c("\u5BFC\u51FA",-1)])]),_:1}),t(g,{type:"primary"},{default:a(()=>[...u[16]||(u[16]=[c("\u5BFC\u51FA\u6A21\u677F",-1)])]),_:1}),t(g,{type:"primary",onClick:e.handleImportClick},{default:a(()=>[...u[17]||(u[17]=[c("\u5BFC\u5165",-1)])]),_:1},8,["onClick"]),t(g,{type:"primary"},{default:a(()=>[...u[18]||(u[18]=[c("\u53D1\u5E03",-1)])]),_:1}),t(g,{type:"primary"},{default:a(()=>[...u[19]||(u[19]=[c("\u4E00\u952E\u53D1\u5E03",-1)])]),_:1}),t(g,{type:"primary"},{default:a(()=>[...u[20]||(u[20]=[c("\u5E93\u5B58\u540C\u6B65",-1)])]),_:1}),t(g,{type:"primary"},{default:a(()=>[...u[21]||(u[21]=[c("\u6279\u91CF\u4FEE\u6539\u8D27\u533A",-1)])]),_:1})]),de((r(),$(N,{data:e.tableData,border:"",stripe:"",style:{width:"100%"},onSelectionChange:e.handleSelectionChange},{default:a(()=>[t(_,{type:"selection",width:"55",align:"center"}),t(_,{prop:"name",label:"\u5546\u54C1\u540D\u79F0","min-width":"100","show-overflow-tooltip":"",align:"center"}),t(_,{prop:"appearance",label:"\u54C1\u76F8",width:"90",align:"center"},{default:a(({row:l})=>[c(p(e.formatAppearance(l.appearance)),1)]),_:1}),t(_,{label:"\u5B9E\u62CD\u56FE",width:"120",align:"center"},{default:a(({row:l})=>[e.getImageList(l.live_image).length>0?(r(),$(R,{key:0,placement:"right",width:400,trigger:"hover",teleported:!0},{reference:a(()=>[t(V,{src:e.getFirstImage(l.live_image),"preview-src-list":e.getImageList(l.live_image),style:{width:"48px",height:"48px","border-radius":"4px",cursor:"pointer"},fit:"cover","preview-teleported":""},null,8,["src","preview-src-list"])]),default:a(()=>[y("div",null,[y("div",je," \u5171"+p(e.getImageList(l.live_image).length)+"\u5F20\u56FE\u7247 ",1),y("div",He,[(r(!0),v(Y,null,H(e.getImageList(l.live_image),(i,q)=>(r(),$(V,{key:q,src:i,"preview-src-list":e.getImageList(l.live_image),"initial-index":q,style:{width:"64px",height:"64px","border-radius":"4px",cursor:"pointer"},fit:"cover","preview-teleported":""},null,8,["src","preview-src-list","initial-index"]))),128))])])]),_:2},1024)):(r(),v("span",Ke,"\u6682\u65E0"))]),_:1}),t(_,{label:"ISBN","min-width":"130","show-overflow-tooltip":"",align:"center"},{default:a(({row:l})=>[l.barcode?(r(),$(n,{key:0,isbn:l.barcode},{default:a(()=>[c(p(l.barcode),1)]),_:2},1032,["isbn"])):(r(),v("span",Je,"--"))]),_:1}),t(_,{prop:"category_name",label:"\u5206\u7C7B",width:"90",align:"center"},{default:a(({row:l})=>[c(p(l.category_name||"-"),1)]),_:1}),t(_,{label:"\u4ED3\u5E93-\u5E93\u4F4D","min-width":"165",align:"center","show-overflow-tooltip":""},{default:a(({row:l})=>[t(B,{size:"small",type:"danger"},{default:a(()=>[c(p(l.warehouse_name||"\u672A\u843D\u4F4D"),1)]),_:2},1024),u[22]||(u[22]=c(" - ",-1)),t(B,{size:"small"},{default:a(()=>[c(p(l.location_code||"\u672A\u843D\u4F4D"),1)]),_:2},1024)]),_:1}),t(_,{prop:"quantity",label:"\u5E93\u5B58","min-width":"100","show-overflow-tooltip":"",align:"center"}),t(_,{label:"\u5E73\u53F0\u53D1\u5E03\u60C5\u51B5","min-width":"230",align:"center"},{default:a(({row:l})=>[l.shop_list&&l.shop_list.length>0?(r(),v("div",Qe,[(r(!0),v(Y,null,H(l.shop_list,(i,q)=>(r(),v(Y,{key:q},[q<2||l.shop_list.length<=2?(r(),v("div",Xe,[i.out_task_log_id==0&&i.status==0?(r(),$(B,{key:0,type:"warning",effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+")- \u4EFB\u52A1\u5DF2\u521B\u5EFA\u672A\u53D1\u9001\u5230\u5E97\u94FA ",1)]),_:2},1024)):T("",!0),i.out_task_log_id>0&&i.status==0?(r(),$(B,{key:1,type:"danger",effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+")- \u4EFB\u52A1\u5DF2\u521B\u5EFA\u5355\u53D1\u9001\u5230\u5E97\u94FA\u5931\u8D25 ",1)]),_:2},1024)):T("",!0),i.out_task_log_id>0&&i.status==1?(r(),$(B,{key:2,effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+")- \u4EFB\u52A1\u5DF2\u521B\u5EFA\u5355\u53D1\u9001\u5230\u5E97\u94FA\u6210\u529F ",1)]),_:2},1024)):T("",!0)])):T("",!0)],64))),128)),l.shop_list.length>=1?(r(),v("div",Ze,[t(R,{placement:"top",width:500,teleported:!0,"popper-style":{minWidth:"400px",width:"auto",maxWidth:"600px"}},{reference:a(()=>[t(b,{style:{color:"#909399",cursor:"pointer","font-size":"18px"}},{default:a(()=>[t(O)]),_:1})]),default:a(()=>[t(N,{data:l.shop_list,style:{width:"100%"}},{default:a(()=>[t(_,{label:"\u5E97\u94FA\u4FE1\u606F","min-width":"250"},{default:a(({row:i})=>[i.out_task_log_id==0&&i.status==0?(r(),$(B,{key:0,type:"warning",effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+") - \u4EFB\u52A1\u5DF2\u521B\u5EFA\u672A\u53D1\u9001\u5230\u5E97\u94FA ",1)]),_:2},1024)):i.out_task_log_id>0&&i.status==1?(r(),$(B,{key:1,type:"danger",effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+") - \u4EFB\u52A1\u5DF2\u521B\u5EFA\u4F46\u53D1\u9001\u5230\u5E97\u94FA\u5931\u8D25 ",1)]),_:2},1024)):i.out_task_log_id>0&&i.status==2?(r(),$(B,{key:2,effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+") - \u4EFB\u52A1\u5DF2\u521B\u5EFA\u4F46\u53D1\u9001\u5230\u5E97\u94FA\u6210\u529F ",1)]),_:2},1024)):(r(),$(B,{key:3,effect:"plain",size:"small"},{default:a(()=>[c(p(i.shop_alias_name)+"("+p(i.shop_type_name)+") - \u672A\u77E5\u72B6\u6001 ",1)]),_:2},1024))]),_:1}),t(_,{label:"\u64CD\u4F5C",width:"100"},{default:a(({row:i})=>[t(G,{type:"primary",onClick:q=>e.reTryGoosTask(l,i)},{default:a(()=>[...u[23]||(u[23]=[c("\u91CD\u8BD5",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1032,["data"])]),_:2},1024)])):T("",!0)])):(r(),v("span",xe,"--"))]),_:1}),t(_,{prop:"sale_price",label:"\u4EF7\u683C(\u5143)",width:"100",align:"center"},{default:a(({row:l})=>[c(p(l.sale_price/100),1)]),_:1}),t(_,{prop:"is_batch_managed",label:"\u6279\u6B21\u7BA1\u7406",width:"100",align:"center"},{default:a(({row:l})=>[t(B,{type:l.is_batch_managed===1?"success":"info",size:"small"},{default:a(()=>[c(p(l.is_batch_managed===1?"\u662F":"\u5426"),1)]),_:2},1032,["type"])]),_:1}),t(_,{prop:"is_shelf_life_managed",label:"\u6548\u671F\u7BA1\u7406",width:"100",align:"center"},{default:a(({row:l})=>[t(B,{type:l.is_shelf_life_managed===1?"success":"info",size:"small"},{default:a(()=>[c(p(l.is_shelf_life_managed===1?"\u662F":"\u5426"),1)]),_:2},1032,["type"])]),_:1}),t(_,{prop:"status",label:"\u72B6\u6001",width:"100",align:"center"},{default:a(({row:l})=>[t(B,{type:l.status===1?"success":"danger",size:"small"},{default:a(()=>[c(p(l.status===1?"\u542F\u7528":"\u7981\u7528"),1)]),_:2},1032,["type"])]),_:1}),t(_,{prop:"created_at",label:"\u521B\u5EFA\u65F6\u95F4",width:"170",align:"center"},{default:a(({row:l})=>[c(p(e.formatTimestamp(l.created_at)),1)]),_:1}),t(_,{prop:"updated_at",label:"\u66F4\u65B0\u65F6\u95F4",width:"170",align:"center"},{default:a(({row:l})=>[c(p(e.formatTimestamp(l.updated_at)),1)]),_:1}),t(_,{label:"\u64CD\u4F5C",width:"180",align:"center",fixed:"right"},{default:a(({row:l})=>[t(g,{type:"primary",link:"",icon:e.Edit,size:"small",onClick:i=>e.handleEdit(l)},{default:a(()=>[...u[24]||(u[24]=[c("\u4FEE\u6539",-1)])]),_:1},8,["icon","onClick"]),l.warehouse_name?(r(),$(W,{key:0,content:"\u5DF2\u843D\u4F4D\u5546\u54C1\u4E0D\u53EF\u5220\u9664",placement:"top",disabled:!1},{default:a(()=>[t(g,{type:"danger",link:"",icon:e.Delete,size:"small",disabled:""},{default:a(()=>[...u[25]||(u[25]=[c("\u5220\u9664",-1)])]),_:1},8,["icon"])]),_:1})):(r(),$(g,{key:1,type:"danger",link:"",icon:e.Delete,size:"small",onClick:i=>e.handleDelete(l)},{default:a(()=>[...u[26]||(u[26]=[c("\u5220\u9664",-1)])]),_:1},8,["icon","onClick"])),t(g,{type:"danger",link:"",icon:e.Delete,size:"small",onClick:i=>e.handleDestroy(l)},{default:a(()=>[...u[27]||(u[27]=[c("\u9500\u6BC1",-1)])]),_:1},8,["icon","onClick"])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[C,e.loading]]),y("div",et,[t(f,{"current-page":e.pagination.current,"onUpdate:currentPage":u[2]||(u[2]=l=>e.pagination.current=l),"page-size":e.pagination.pageSize,"onUpdate:pageSize":u[3]||(u[3]=l=>e.pagination.pageSize=l),"page-sizes":[10,20,50,100],total:e.pagination.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])]),t(o,{modelValue:e.importDialogVisible,"onUpdate:modelValue":u[6]||(u[6]=l=>e.importDialogVisible=l),title:"\u5BFC\u5165\u5546\u54C1",width:"500px","destroy-on-close":""},{footer:a(()=>[y("span",tt,[t(g,{onClick:u[5]||(u[5]=l=>e.importDialogVisible=!1)},{default:a(()=>[...u[30]||(u[30]=[c("\u53D6\u6D88",-1)])]),_:1}),t(g,{type:"primary",loading:e.importLoading,disabled:!e.importWarehouseId||!e.importFile,onClick:e.handleImportSubmit},{default:a(()=>[...u[31]||(u[31]=[c(" \u5F00\u59CB\u5BFC\u5165 ",-1)])]),_:1},8,["loading","disabled","onClick"])])]),default:a(()=>[t(E,{"label-width":"100px","label-position":"right"},{default:a(()=>[t(D,{label:"\u9009\u62E9\u4ED3\u5E93"},{default:a(()=>[t(A,{modelValue:e.importWarehouseId,"onUpdate:modelValue":u[4]||(u[4]=l=>e.importWarehouseId=l),placeholder:"\u8BF7\u9009\u62E9\u4ED3\u5E93",filterable:"",clearable:"",style:{width:"100%"}},{default:a(()=>[(r(!0),v(Y,null,H(e.warehouseOptions,l=>(r(),$(S,{key:l.id,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(D,{label:"\u4E0A\u4F20\u6587\u4EF6"},{default:a(()=>[t(h,{ref:"uploadRef","auto-upload":!1,"show-file-list":!0,limit:1,"on-change":e.handleFileChange,accept:".xlsx,.xls"},{tip:a(()=>[...u[29]||(u[29]=[y("span",{style:{"font-size":"12px",color:"#909399"}},"\u652F\u6301 .xlsx / .xls \u683C\u5F0F",-1)])]),default:a(()=>[t(g,{type:"primary",icon:e.Upload},{default:a(()=>[...u[28]||(u[28]=[c("\u9009\u62E9\u6587\u4EF6",-1)])]),_:1},8,["icon"])]),_:1},8,["on-change"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}var ut=te($e,[["render",at],["__scopeId","data-v-dbac05a0"]]);const lt=ee({name:"ProductByLocation",setup(){const e=w(!1),u=w(),L=w([]),P=w([]),M=j({keyword:""}),z=j({current:1,pageSize:10,total:0}),I=w(0),b=Z(()=>{var D;const f=[];for(const h of P.value){const E=((D=h.details)==null?void 0:D.length)||0;if(f.push({rowId:`loc-${h.location_id}`,_isLocationRow:!0,_locationId:h.location_id,_detailCount:E,warehouse_name:h.warehouse_name,location_code:h.location_code,total_quantity:h.total_quantity,locked_quantity:h.locked_quantity,item_count:h.item_count,_summaryText:`\u5171 ${E} \u4EF6\u5546\u54C1`}),Array.isArray(h.details))for(const o of h.details)f.push({rowId:`detail-${o.id}`,_isLocationRow:!1,_locationId:h.location_id,_detailCount:0,id:o.id,product_id:o.product_id,product_name:o.product_name,name:o.product_name,warehouse_id:h.warehouse_id,location_id:h.location_id,barcode:o.barcode,quantity:o.quantity,locked_quantity:o.locked_quantity,sale_price:o.sale_price,batch_no:o.batch_no,created_at:o.created_at})}return f}),s=Z(()=>{const f=new Map;for(const D of b.value)D._isLocationRow?f.set(D.rowId,{rowspan:D._detailCount+1,colspan:1}):f.set(D.rowId,{rowspan:0,colspan:0});return f}),S=({rowIndex:f,columnIndex:D})=>{if(D>2)return{rowspan:1,colspan:1};const h=b.value[f];return h?s.value.get(h.rowId)||{rowspan:1,colspan:1}:{rowspan:1,colspan:1}},A=f=>!f&&f!==0?"-":ne.unix(Number(f)).format("YYYY-MM-DD HH:mm:ss"),g=f=>f==null?"-":(f/100).toFixed(2),_=async()=>{e.value=!0;try{const D=await Ae({keyword:M.keyword||void 0,page:z.current,pageSize:z.pageSize})||{};P.value=D.list||[],z.total=D.total||0,I.value=P.value.reduce((h,E)=>h+(E.total_quantity||0),0)}catch{k.error({message:"\u83B7\u53D6\u5E93\u4F4D\u5546\u54C1\u5217\u8868\u5931\u8D25",customClass:"scan-error-message"}),P.value=[]}finally{e.value=!1}},V=()=>{z.current=1,_()},R=()=>{M.keyword="",z.current=1,_()},n=f=>{z.current=f,_()},B=f=>{z.pageSize=f,z.current=1,_()},O=f=>f._isLocationRow===!0,G=f=>{L.value=f},N=()=>{if(L.value.length===0){k.warning({message:"\u8BF7\u5148\u9009\u62E9\u8981\u9500\u6BC1\u7684\u5E93\u4F4D",customClass:"scan-error-message"});return}const f=L.value.map(E=>`"${E.location_code}"`).join("\u3001"),D=new Set(L.value.map(E=>E._locationId)),h=[];for(const E of P.value)if(D.has(E.location_id)&&Array.isArray(E.details))for(const o of E.details)h.push({product_id:o.id,product_name:o.product_name,location_code:E.location_code});if(h.length===0){k.warning({message:"\u6240\u9009\u5E93\u4F4D\u4E0B\u6CA1\u6709\u53EF\u9500\u6BC1\u7684\u5546\u54C1",customClass:"scan-error-message"});return}Q.confirm(`\u786E\u5B9A\u8981\u9500\u6BC1\u4EE5\u4E0B ${L.value.length} \u4E2A\u5E93\u4F4D\u4E0B\u7684\u5168\u90E8\u5546\u54C1\u5417\uFF1F
${f}
\u5171 ${h.length} \u4EF6\u5546\u54C1\u5C06\u88AB\u9500\u6BC1\uFF01`,"\u6279\u91CF\u9500\u6BC1\u786E\u8BA4",{confirmButtonText:"\u786E\u5B9A\u9500\u6BC1",cancelButtonText:"\u53D6\u6D88",type:"error"}).then(async()=>{let E=0,o=0;for(const C of h)try{await x({product_id:C.product_id}),E++}catch{o++}k.success({message:`\u9500\u6BC1\u5B8C\u6210\uFF1A\u6210\u529F ${E} \u4EF6${o>0?`\uFF0C\u5931\u8D25 ${o} \u4EF6`:""}`,customClass:"scan-success-message"}),L.value=[],_()}).catch(()=>{})},W=f=>{const D=f.product_name||f.name||"";Q.confirm(`\u786E\u5B9A\u8981\u9500\u6BC1\u5546\u54C1 "${D}" \u5417\uFF1F`,"\u9500\u6BC1\u786E\u8BA4",{confirmButtonText:"\u786E\u5B9A\u9500\u6BC1",cancelButtonText:"\u53D6\u6D88",type:"error"}).then(async()=>{try{await x({product_id:f.id}),k.success({message:"\u9500\u6BC1\u6210\u529F",customClass:"scan-success-message"}),_()}catch{k.error({message:"\u9500\u6BC1\u5931\u8D25",customClass:"scan-error-message"})}}).catch(()=>{})};return ue(()=>{_()}),{loading:e,tableRef:u,selectedRows:L,flatRows:b,sourceGroups:P,searchParams:M,pagination:z,totalAllQuantity:I,Search:le,Refresh:oe,Delete:se,mergeSpanMethod:S,checkSelectable:O,formatTimestamp:A,formatPrice:g,handleSearch:V,resetSearch:R,handleCurrentChange:n,handleSizeChange:B,handleSelectionChange:G,handleBatchDestroy:N,handleDestroySingle:W}}}),ot={class:"product-by-location"},st={class:"filter-bar"},nt={key:0,class:"summary-info"},it={key:0,style:{"font-weight":"600"}},rt={key:0,style:{color:"#409eff","font-weight":"600"}},dt={key:1},ct={key:0},pt={key:0,style:{"font-weight":"600",color:"#409eff"}},mt={key:1},_t={key:0,style:{color:"#e6a23c"}},ft={key:1},gt={key:0},yt={key:0,style:{"font-size":"12px",color:"#909399"}},ht={key:0},Ct={class:"pagination-wrapper"};function Ft(e,u,L,P,M,z){const I=d("Search"),b=d("el-icon"),s=d("el-input"),S=d("el-button"),A=d("el-table-column"),g=d("el-tag"),_=d("el-table"),V=d("el-pagination"),R=ie("loading");return r(),v("div",ot,[y("div",st,[t(s,{modelValue:e.searchParams.keyword,"onUpdate:modelValue":u[0]||(u[0]=n=>e.searchParams.keyword=n),placeholder:"\u5E93\u4F4D\u7F16\u53F7 / \u5546\u54C1\u540D\u79F0 / \u6761\u7801",clearable:"",style:{width:"260px"},onKeyup:re(e.handleSearch,["enter"])},{prefix:a(()=>[t(b,null,{default:a(()=>[t(I)]),_:1})]),_:1},8,["modelValue","onKeyup"]),t(S,{type:"primary",icon:e.Search,onClick:e.handleSearch},{default:a(()=>[...u[3]||(u[3]=[c("\u641C\u7D22",-1)])]),_:1},8,["icon","onClick"]),t(S,{icon:e.Refresh,onClick:e.resetSearch},{default:a(()=>[...u[4]||(u[4]=[c("\u91CD\u7F6E",-1)])]),_:1},8,["icon","onClick"]),e.sourceGroups.length>0?(r(),v("span",nt,[u[5]||(u[5]=c(" \u5171 ",-1)),y("strong",null,p(e.pagination.total),1),u[6]||(u[6]=c(" \u4E2A\u5E93\u4F4D\uFF0C \u603B\u8BA1 ",-1)),y("strong",null,p(e.totalAllQuantity),1),u[7]||(u[7]=c(" \u4EF6\u5546\u54C1 ",-1))])):T("",!0),t(S,{type:"danger",icon:e.Delete,disabled:e.selectedRows.length===0,onClick:e.handleBatchDestroy},{default:a(()=>[c(" \u6279\u91CF\u9500\u6BC1\uFF08"+p(e.selectedRows.length)+"\uFF09 ",1)]),_:1},8,["icon","disabled","onClick"])]),de((r(),$(_,{ref:"tableRef",data:e.flatRows,border:"",stripe:"",style:{width:"100%"},"span-method":e.mergeSpanMethod,"header-cell-style":{background:"#f5f7fa"},"row-key":"rowId",onSelectionChange:e.handleSelectionChange},{default:a(()=>[t(A,{type:"selection",width:"45",align:"center",selectable:e.checkSelectable,"reserve-selection":!0},null,8,["selectable"]),t(A,{prop:"warehouse_name",label:"\u6240\u5C5E\u4ED3\u5E93",width:"120",align:"center","show-overflow-tooltip":""},{default:a(({row:n})=>[n._isLocationRow?(r(),v("span",it,p(n.warehouse_name),1)):T("",!0)]),_:1}),t(A,{prop:"location_code",label:"\u5E93\u4F4D\u7F16\u53F7",width:"110",align:"center","show-overflow-tooltip":""},{default:a(({row:n})=>[n._isLocationRow?(r(),$(g,{key:0,type:"success",size:"small"},{default:a(()=>[c(p(n.location_code),1)]),_:2},1024)):T("",!0)]),_:1}),t(A,{label:"\u5546\u54C1\u540D\u79F0","min-width":"160","show-overflow-tooltip":"",align:"center"},{default:a(({row:n})=>[n._isLocationRow?(r(),v("span",rt,p(n._summaryText),1)):(r(),v("span",dt,p(n.product_name||"--"),1))]),_:1}),t(A,{label:"ISBN",width:"140","show-overflow-tooltip":"",align:"center"},{default:a(({row:n})=>[n._isLocationRow?T("",!0):(r(),v("span",ct,p(n.barcode||"--"),1))]),_:1}),t(A,{label:"\u5E93\u5B58",width:"70",align:"center"},{default:a(({row:n})=>[n._isLocationRow?(r(),v("span",pt,p(n.total_quantity),1)):(r(),v("span",mt,p(n.quantity),1))]),_:1}),t(A,{label:"\u9501\u5B9A",width:"60",align:"center"},{default:a(({row:n})=>[n._isLocationRow?(r(),v("span",_t,p(n.locked_quantity),1)):(r(),v("span",ft,p(n.locked_quantity),1))]),_:1}),t(A,{label:"\u4EF7\u683C(\u5143)",width:"90",align:"center"},{default:a(({row:n})=>[n._isLocationRow?T("",!0):(r(),v("span",gt,p(e.formatPrice(n.sale_price)),1))]),_:1}),t(A,{label:"\u6279\u6B21\u53F7","min-width":"160","show-overflow-tooltip":"",align:"center"},{default:a(({row:n})=>[n._isLocationRow?T("",!0):(r(),v("span",yt,p(n.batch_no||"--"),1))]),_:1}),t(A,{label:"\u521B\u5EFA\u65F6\u95F4",width:"150",align:"center"},{default:a(({row:n})=>[n._isLocationRow?T("",!0):(r(),v("span",ht,p(e.formatTimestamp(n.created_at)),1))]),_:1}),t(A,{label:"\u64CD\u4F5C",width:"100",align:"center",fixed:"right"},{default:a(({row:n})=>[n._isLocationRow?T("",!0):(r(),$(S,{key:0,type:"danger",link:"",icon:e.Delete,onClick:B=>e.handleDestroySingle(n)},{default:a(()=>[...u[8]||(u[8]=[c("\u9500\u6BC1",-1)])]),_:1},8,["icon","onClick"]))]),_:1})]),_:1},8,["data","span-method","onSelectionChange"])),[[R,e.loading]]),y("div",Ct,[t(V,{"current-page":e.pagination.current,"onUpdate:currentPage":u[1]||(u[1]=n=>e.pagination.current=n),"page-size":e.pagination.pageSize,"onUpdate:pageSize":u[2]||(u[2]=n=>e.pagination.pageSize=n),"page-sizes":[10,20,50,100],total:e.pagination.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])])])}var vt=te(lt,[["render",Ft],["__scopeId","data-v-75672e79"]]);const bt=ee({name:"Product",components:{ProductList:ut,ProductByLocation:vt},setup(){const e=w("byGoods"),u=w(null),L=w(!1),P=w(!1),M=10,z=w(!1),I=w(""),b=w(null),s=j({id:null,category_id:0,standard_product_id:0,name:"",barcode:"",price:0,live_image:[],is_batch_managed:0,is_shelf_life_managed:0,status:1,appearance:85,quantity:0,warehouse_id:null,location_id:null,shop_list:[]}),S={name:[{required:!0,message:"\u5546\u54C1\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},{min:1,max:255,message:"\u957F\u5EA6\u57281\u5230255\u4E2A\u5B57\u7B26",trigger:"blur"}]},A=Z({get:()=>s.price==null||s.price===0?0:Number((s.price/100).toFixed(2)),set:o=>{s.price=Math.round((o||0)*100)}}),g=w([]),_=async()=>{try{const o=await ce({page:1,pageSize:9999});g.value=o.list||[]}catch{g.value=[]}},V=w([]),R=async o=>{if(!o){V.value=[];return}try{const C=await Ve({warehouseId:o,page:1,pageSize:9999});V.value=C.list||[]}catch{V.value=[]}},n=o=>{s.location_id=null,o?R(o):V.value=[]},B=o=>{s.live_image.splice(o,1)},O=o=>["image/jpeg","image/png","image/webp","image/gif"].includes(o.type)?o.size/1024/1024<10?!0:(k.error({message:"\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 10MB",customClass:"scan-error-message"}),!1):(k.error({message:"\u4EC5\u652F\u6301 JPG/PNG/WebP/GIF \u683C\u5F0F",customClass:"scan-error-message"}),!1),G=async o=>{P.value=!0;try{const C=`${Date.now()}-${Math.random().toString(36).substring(2,8)}.jpg`,l=await Se(o.file,C);s.live_image.push(l)}catch{k.error({message:"\u56FE\u7247\u4E0A\u4F20\u5931\u8D25",customClass:"scan-error-message"})}finally{P.value=!1}},N=()=>{var o,C;(C=(o=u.value)==null?void 0:o.refreshList)==null||C.call(o)},W=o=>{var C,l,i,q;I.value="\u7F16\u8F91\u5546\u54C1",_(),s.id=o.id,s.category_id=o.category_id,s.standard_product_id=o.standard_product_id,s.name=o.name,s.barcode=o.barcode,s.price=o.price,s.live_image=f(o.live_image),s.is_batch_managed=o.is_batch_managed,s.is_shelf_life_managed=o.is_shelf_life_managed,s.status=o.status,s.appearance=(C=o.appearance)!=null?C:85,s.quantity=(l=o.quantity)!=null?l:0,s.warehouse_id=(i=o.warehouse_id)!=null?i:null,s.location_id=(q=o.location_id)!=null?q:null,s.shop_list=o.shop_list||[],s.warehouse_id&&R(s.warehouse_id),z.value=!0,setTimeout(()=>{var K;(K=b.value)==null||K.clearValidate()},0)},f=o=>{if(!o)return[];if(Array.isArray(o)){const C=[];for(const l of o)typeof l=="string"&&l.length>0&&(l.includes(",")?C.push(...l.split(",").map(i=>i.trim()).filter(Boolean)):C.push(l));return C}return typeof o=="string"&&o.length>0?o.includes(",")?o.split(",").map(C=>C.trim()).filter(Boolean):[o]:[]};return{activeTab:e,productListRef:u,submitLoading:L,imageUploading:P,maxImageCount:M,dialogVisible:z,dialogTitle:I,formRef:b,formData:s,formRules:S,priceYuan:A,warehouseOptions:g,locationOptions:V,onWarehouseChange:n,removeLiveImage:B,beforeImageUpload:O,handleImageUpload:G,handleEdit:W,handleDelete:o=>{Q.confirm(`\u786E\u5B9A\u8981\u5220\u9664\u5546\u54C1 "${o.name}" \u5417\uFF1F`,"\u5220\u9664\u786E\u8BA4",{confirmButtonText:"\u786E\u5B9A\u5220\u9664",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{try{await Be({id:o.id}),k.success({message:"\u5220\u9664\u6210\u529F",customClass:"scan-success-message"}),N()}catch{k.error({message:"\u5220\u9664\u5931\u8D25",customClass:"scan-error-message"})}}).catch(()=>{})},submitForm:async()=>{var o;try{await((o=b.value)==null?void 0:o.validate()),L.value=!0;const C={name:s.name,liveimage:s.live_image||[],product_id:s.id};s.id===null?(await we(C),k.success({message:"\u65B0\u589E\u5546\u54C1\u6210\u529F",customClass:"scan-success-message"})):(await ke({id:s.id,name:s.name,liveimage:s.live_image,product_id:s.id}),k.success({message:"\u7F16\u8F91\u5546\u54C1\u6210\u529F",customClass:"scan-success-message"})),z.value=!1,N()}catch{}finally{L.value=!1}},resetForm:()=>{var o;(o=b.value)==null||o.resetFields(),s.id=null,s.category_id=0,s.standard_product_id=0,s.name="",s.barcode="",s.price=0,s.live_image=[],s.is_batch_managed=0,s.is_shelf_life_managed=0,s.status=1,s.appearance=85,s.quantity=0,s.warehouse_id=null,s.location_id=null,s.shop_list=[],V.value=[]},Plus:Ce,CircleClose:Fe}}}),Dt={class:"live-image-upload"},Et={class:"upload-tip"},Bt={class:"dialog-footer"};function wt(e,u,L,P,M,z){const I=d("ProductList"),b=d("el-tab-pane"),s=d("ProductByLocation"),S=d("el-tabs"),A=d("el-input"),g=d("el-form-item"),_=d("el-col"),V=d("el-option"),R=d("el-select"),n=d("el-row"),B=d("el-image"),O=d("CircleClose"),G=d("el-icon"),N=d("Plus"),W=d("el-upload"),f=d("el-input-number"),D=d("el-switch"),h=d("el-form"),E=d("el-button"),o=d("el-dialog"),C=d("el-card");return r(),$(C,{class:"product-manager"},{header:a(()=>[...u[13]||(u[13]=[y("div",{class:"card-header"},"\u5546\u54C1\u7BA1\u7406",-1)])]),default:a(()=>[t(S,{modelValue:e.activeTab,"onUpdate:modelValue":u[0]||(u[0]=l=>e.activeTab=l),type:"border-card"},{default:a(()=>[t(b,{label:"\u6309\u5546\u54C1\u67E5\u770B",name:"byGoods"},{default:a(()=>[t(I,{ref:"productListRef",onEdit:e.handleEdit,onDelete:e.handleDelete},null,8,["onEdit","onDelete"])]),_:1}),t(b,{label:"\u6309\u5E93\u4F4D\u67E5\u770B",name:"byLocation"},{default:a(()=>[t(s)]),_:1})]),_:1},8,["modelValue"]),t(o,{modelValue:e.dialogVisible,"onUpdate:modelValue":u[12]||(u[12]=l=>e.dialogVisible=l),title:e.dialogTitle,width:"850px","destroy-on-close":"",onClose:e.resetForm},{footer:a(()=>[y("span",Bt,[t(E,{onClick:u[11]||(u[11]=l=>e.dialogVisible=!1)},{default:a(()=>[...u[14]||(u[14]=[c("\u53D6\u6D88",-1)])]),_:1}),t(E,{type:"primary",onClick:e.submitForm,loading:e.submitLoading},{default:a(()=>[...u[15]||(u[15]=[c("\u786E\u5B9A",-1)])]),_:1},8,["onClick","loading"])])]),default:a(()=>[t(h,{ref:"formRef",model:e.formData,rules:e.formRules,"label-width":"110px","label-position":"right"},{default:a(()=>[t(n,{gutter:16},{default:a(()=>[t(_,{span:12},{default:a(()=>[t(g,{label:"\u5546\u54C1\u540D\u79F0",prop:"name"},{default:a(()=>[t(A,{modelValue:e.formData.name,"onUpdate:modelValue":u[1]||(u[1]=l=>e.formData.name=l),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),t(_,{span:12},{default:a(()=>[t(g,{label:"\u54C1\u76F8",prop:"appearance"},{default:a(()=>[t(R,{modelValue:e.formData.appearance,"onUpdate:modelValue":u[2]||(u[2]=l=>e.formData.appearance=l),placeholder:"\u8BF7\u9009\u62E9\u54C1\u76F8",style:{width:"100%"},disabled:""},{default:a(()=>[t(V,{label:"\u516B\u4E94\u54C1",value:85}),t(V,{label:"\u4E5D\u54C1",value:90}),t(V,{label:"\u5341\u54C1",value:100})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(g,{label:"\u5B9E\u62CD\u56FE",prop:"live_image"},{default:a(()=>[y("div",Dt,[(r(!0),v(Y,null,H(e.formData.live_image,(l,i)=>(r(),v("div",{key:i,class:"live-image-item"},[t(B,{src:l,"preview-src-list":e.formData.live_image,"initial-index":i,fit:"cover",class:"live-image-thumb","preview-teleported":""},null,8,["src","preview-src-list","initial-index"]),t(G,{class:"live-image-delete",onClick:q=>e.removeLiveImage(i)},{default:a(()=>[t(O)]),_:1},8,["onClick"])]))),128)),e.formData.live_image.length<e.maxImageCount?(r(),$(W,{key:0,"show-file-list":!1,"http-request":e.handleImageUpload,"before-upload":e.beforeImageUpload,accept:"image/jpeg,image/png,image/webp,image/gif",class:"live-image-uploader"},{default:a(()=>[t(G,{class:"live-image-uploader-icon"},{default:a(()=>[t(N)]),_:1})]),_:1},8,["http-request","before-upload"])):T("",!0)]),y("span",Et,"\xA0\xA0\xA0\xA0\xA0\xA0\xA0\u652F\u6301 jpg/png/webp/gif\uFF0C\u6700\u591A "+p(e.maxImageCount)+" \u5F20",1)]),_:1}),t(n,{gutter:16},{default:a(()=>[t(_,{span:24},{default:a(()=>[t(g,{label:"\u5206\u7C7B",prop:"category_id"},{default:a(()=>[t(R,{modelValue:e.formData.category_id,"onUpdate:modelValue":u[3]||(u[3]=l=>e.formData.category_id=l),placeholder:"\u8BF7\u9009\u62E9\u5206\u7C7B",filterable:"",clearable:"",style:{width:"100%"},disabled:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(n,{gutter:16},{default:a(()=>[t(_,{span:12},{default:a(()=>[t(g,{label:"\u4ED3\u5E93",prop:"warehouse_id"},{default:a(()=>[t(R,{modelValue:e.formData.warehouse_id,"onUpdate:modelValue":u[4]||(u[4]=l=>e.formData.warehouse_id=l),placeholder:"\u8BF7\u9009\u62E9\u4ED3\u5E93",filterable:"",clearable:"",style:{width:"100%"},disabled:""},{default:a(()=>[(r(!0),v(Y,null,H(e.warehouseOptions,l=>(r(),$(V,{key:l.id,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(_,{span:12},{default:a(()=>[t(g,{label:"\u5E93\u4F4D",prop:"location_id"},{default:a(()=>[t(R,{modelValue:e.formData.location_id,"onUpdate:modelValue":u[5]||(u[5]=l=>e.formData.location_id=l),placeholder:"\u8BF7\u9009\u62E9\u5E93\u4F4D",filterable:"",clearable:"",style:{width:"100%"},disabled:""},{default:a(()=>[(r(!0),v(Y,null,H(e.locationOptions,l=>(r(),$(V,{key:l.id,label:l.code,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(n,{gutter:16},{default:a(()=>[t(_,{span:12},{default:a(()=>[t(g,{label:"\u5E93\u5B58",prop:"quantity"},{default:a(()=>[t(f,{modelValue:e.formData.quantity,"onUpdate:modelValue":u[6]||(u[6]=l=>e.formData.quantity=l),min:0,step:1,"controls-position":"right",style:{width:"100%"},disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),t(_,{span:12},{default:a(()=>[t(g,{label:"\u4EF7\u683C(\u5143)",prop:"price"},{default:a(()=>[t(f,{modelValue:e.priceYuan,"onUpdate:modelValue":u[7]||(u[7]=l=>e.priceYuan=l),min:0,step:.01,precision:2,"controls-position":"right",style:{width:"100%"},disabled:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(n,{gutter:16},{default:a(()=>[t(_,{span:8},{default:a(()=>[t(g,{label:"\u6279\u6B21\u7BA1\u7406",prop:"is_batch_managed"},{default:a(()=>[t(D,{modelValue:e.formData.is_batch_managed,"onUpdate:modelValue":u[8]||(u[8]=l=>e.formData.is_batch_managed=l),"active-value":1,"inactive-value":0,"active-text":"\u662F","inactive-text":"\u5426",disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),t(_,{span:8},{default:a(()=>[t(g,{label:"\u6548\u671F\u7BA1\u7406",prop:"is_shelf_life_managed"},{default:a(()=>[t(D,{modelValue:e.formData.is_shelf_life_managed,"onUpdate:modelValue":u[9]||(u[9]=l=>e.formData.is_shelf_life_managed=l),"active-value":1,"inactive-value":0,"active-text":"\u662F","inactive-text":"\u5426",disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),t(_,{span:8},{default:a(()=>[t(g,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[t(D,{modelValue:e.formData.status,"onUpdate:modelValue":u[10]||(u[10]=l=>e.formData.status=l),"active-value":1,"inactive-value":0,"active-text":"\u542F\u7528","inactive-text":"\u7981\u7528","active-color":"#67C23A",disabled:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title","onClose"])]),_:1})}var Rt=te(bt,[["render",wt],["__scopeId","data-v-30fcdf22"]]);export{Rt as default};