import{az as f,d as q,r as m,s as w,b as S,p as N,c as r,e as T,k as L,i as s,h as a,u as l,m as y,t as R,a2 as O,q as P,g as _,E as z}from"./index.0308b213.js";import{g as I}from"./product.20e23ccf.js";const M=d=>f.request({url:"addon/visa.type/editSave",method:"POST",data:d}),Z=d=>f.request({url:"addon/visa.type/list",method:"POST",data:d}),j=d=>f.request({url:"addon/visa.type/detail",params:{id:d}}),G=_("div",{class:"tn-form-item__tips"},"\u586B\u5199\u540D\u79F0",-1),H=_("div",{class:"tn-form-item__tips"},"\u7528\u4E8E\u4ECB\u7ECD\u7C7B\u578B\u7684\u8BF4\u660E",-1),J=_("div",{class:"tn-form-item__tips",style:{color:"red"}},"\u6240\u9700\u6750\u6599:",-1),K=_("div",{class:"tn-form-item__tips",style:{color:"red"}},"\u529E\u7406\u6D41\u7A0B:",-1),Q=y("\u63D0\u4EA4"),W=y("\u53D6\u6D88"),$=q({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(d,{emit:B}){const n=d;let p=m(!1),E=w(()=>Number(n.id)>0);const F=m(),e=S({id:0,parent_id:0,type_name:"",desc:"",material_list:[],process_list:[]});N(()=>n.modelValue,u=>{p.value=u,u&&n.id&&(e.id=n.id,A()),k()});const A=()=>{j(n.id).then(u=>{e.type_name=u.type_name||"",e.desc=u.desc||"",e.parent_id=u.parent_id||0,e.material_list=u.material_list||[],e.process_list=u.process_list||[]})},h=()=>{M(e).then(()=>{z.success("\u4FDD\u5B58\u6210\u529F"),c()})},c=()=>{B("update:modelValue",!1),B("onClose")};let V=m([]),D=m([]),v=m([]);const k=()=>{I().then(u=>{D.value=[{id:0,name:"\u9876\u7EA7\u7C7B\u578B",children:u.visa_type_list}],V.value=u.process_list.map(t=>({value:t.id,desc:t.title,disabled:!1})),v.value=u.materials_list.map(t=>({value:t.id,desc:t.title,disabled:!1}))})};return(u,t)=>{const x=r("el-tree-select"),i=r("el-form-item"),b=r("el-input"),g=r("el-transfer"),C=r("el-button"),U=r("el-dialog");return T(),L(U,{modelValue:l(p),"onUpdate:modelValue":t[5]||(t[5]=o=>P(p)?p.value=o:p=o),title:l(E)?"\u7F16\u8F91":"\u65B0\u589E",width:"80%","destroy-on-close":"",onClose:c},{footer:s(()=>[a(C,{type:"primary",onClick:h},{default:s(()=>[Q]),_:1}),a(C,{type:"danger",onClick:c},{default:s(()=>[W]),_:1})]),default:s(()=>[a(l(O),{ref_key:"formRef",ref:F,model:l(e),"label-width":"150px"},{default:s(()=>[a(i,{label:"\u7236\u7C7B\u578B",prop:"parent_id"},{default:s(()=>[a(x,{modelValue:l(e).parent_id,"onUpdate:modelValue":t[0]||(t[0]=o=>l(e).parent_id=o),"check-strictly":!1,data:l(D),"node-key":"id","default-expand-all":!0,props:{label:"name"}},{default:s(({data:o})=>[y(R(o.name),1)]),_:1},8,["modelValue","data"])]),_:1}),a(i,{label:"\u540D\u79F0",prop:"type_name"},{default:s(()=>[a(b,{modelValue:l(e).type_name,"onUpdate:modelValue":t[1]||(t[1]=o=>l(e).type_name=o)},null,8,["modelValue"]),G]),_:1}),a(i,{label:"\u63CF\u8FF0",prop:"desc"},{default:s(()=>[a(b,{modelValue:l(e).desc,"onUpdate:modelValue":t[2]||(t[2]=o=>l(e).desc=o),type:"textarea",rows:6},null,8,["modelValue"]),H]),_:1}),a(i,null,{default:s(()=>[J]),_:1}),a(i,{prop:"material_list"},{default:s(()=>[a(g,{modelValue:l(e).material_list,"onUpdate:modelValue":t[3]||(t[3]=o=>l(e).material_list=o),filterable:"","filter-placeholder":"\u6240\u9700\u6750\u6599",titles:["\u7B7E\u8BC1\u6750\u6599\u5217\u8868","\u9700\u8981\u7684\u6750\u6599"],"button-texts":["\u79FB\u9664","\u6DFB\u52A0"],"target-order":u.push,props:{key:"value",label:"desc"},data:l(v)},null,8,["modelValue","target-order","data"])]),_:1}),a(i,null,{default:s(()=>[K]),_:1}),a(i,{prop:"process_list"},{default:s(()=>[a(g,{modelValue:l(e).process_list,"onUpdate:modelValue":t[4]||(t[4]=o=>l(e).process_list=o),filterable:"","filter-placeholder":"\u529E\u7406\u6D41\u7A0B","target-order":"push",titles:["\u6D41\u7A0B\u5217\u8868","\u9700\u8981\u7684\u6D41\u7A0B"],"button-texts":["\u79FB\u9664","\u6DFB\u52A0"],props:{key:"value",label:"desc"},data:l(V)},null,8,["modelValue","data"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{$ as _,Z as l};
