import{az as p,d as x,r as g,s as y,b as S,p as w,c as d,e as k,k as q,i,h as o,u as t,a2 as A,q as T,g as v,m as B,E as N}from"./index.0308b213.js";const O=a=>p.request({url:"adminapi/logistics.item/editSave",method:"POST",data:a}),j=a=>p.request({url:"adminapi/logistics.item/list",method:"POST",data:a}),P=a=>p.request({url:"adminapi/logistics.item/detail",method:"POST",data:{id:a}}),G=(a,r)=>p.request({url:"adminapi/logistics.item/editStatus",method:"POST",data:{id:a,item_status:r}}),U=v("div",{class:"tn-form-item__tips"},"\u586B\u5199\u7236\u7C7B\u540D\u79F0",-1),R=v("div",{class:"tn-form-item__tips"},"\u586B\u5199\u7C7B\u76EE\u540D\u79F0",-1),z=B("\u63D0\u4EA4"),I=B("\u53D6\u6D88"),H=x({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(a,{emit:r}){const n=a;let m=g(!1),C=y(()=>Number(n.id)>0);const D=g(),e=S({id:0,parent_name:"",item_name:"",item_status:1});w(()=>n.modelValue,l=>{m.value=l,l&&n.id&&(e.id=n.id,h())});const h=()=>{P(n.id).then(l=>{console.log(l),e.parent_name=l.parent_name,e.item_name=l.item_name,e.item_status=l.item_status})},b=()=>{O(e).then(()=>{N.success("\u4FDD\u5B58\u6210\u529F"),_()})},_=()=>{r("update:modelValue",!1),r("onClose")};return(l,u)=>{const f=d("el-input"),c=d("el-form-item"),E=d("el-switch"),V=d("el-button"),F=d("el-dialog");return k(),q(F,{modelValue:t(m),"onUpdate:modelValue":u[3]||(u[3]=s=>T(m)?m.value=s:m=s),title:t(C)?"\u7F16\u8F91":"\u65B0\u589E",width:"80%","destroy-on-close":"",onClose:_},{footer:i(()=>[o(V,{type:"primary",onClick:b},{default:i(()=>[z]),_:1}),o(V,{type:"danger",onClick:_},{default:i(()=>[I]),_:1})]),default:i(()=>[o(t(A),{ref_key:"formRef",ref:D,model:t(e),"label-width":"150px"},{default:i(()=>[o(c,{label:"\u7236\u7C7B\u540D\u79F0",prop:"type_name"},{default:i(()=>[o(f,{modelValue:t(e).parent_name,"onUpdate:modelValue":u[0]||(u[0]=s=>t(e).parent_name=s)},null,8,["modelValue"]),U]),_:1}),o(c,{label:"\u7C7B\u76EE\u540D\u79F0",prop:"type_name"},{default:i(()=>[o(f,{modelValue:t(e).item_name,"onUpdate:modelValue":u[1]||(u[1]=s=>t(e).item_name=s)},null,8,["modelValue"]),R]),_:1}),o(c,{label:"\u72B6\u6001",prop:"visible"},{default:i(()=>[o(E,{modelValue:t(e).item_status,"onUpdate:modelValue":u[2]||(u[2]=s=>t(e).item_status=s),width:"100px","inline-prompt":"","active-text":"\u542F\u7528","inactive-text":"\u7981\u7528","active-value":1,"inactive-value":2},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{H as _,G as e,j as l};
