import{u as e}from"./useCreate-b3492f2b.js";import{u as a}from"./useShow-ca493df3.js";import{d as l,p as r,r as m,K as o,J as p,f as s,o as u,j as d,w as n,a as t,e as c,b as i,t as _}from"./index-018fb6dd.js";const V=c("label",{style:{color:"red"}},"注意：分成比例为百分比,请输入0到100之间的数字，最小为0最大是100",-1),b={class:"flex justify-end"},f=l({__name:"create",props:{primary:String|Number,api:String},emits:["close"],setup(l,{emit:f}){const y=l,{formData:g,form:h,loading:U,submitForm:k,close:j}=e(y.api,y.primary);return g.value.status=1,g.value.sort=1,y.primary&&a(y.api,y.primary,g),r((()=>{j((()=>f("close")))})),(e,a)=>{const l=m("el-input"),r=m("el-form-item"),f=m("el-button"),y=m("el-form"),j=o("loading");return p((u(),d(y,{model:s(g),"label-width":"120px",ref_key:"form",ref:h,class:"pr-4"},{default:n((()=>[t(r,{label:"cp名称",prop:"cp_name",rules:[{required:!0,message:"cp名称必须填写"}]},{default:n((()=>[s(g).cp_id?(u(),d(l,{key:0,modelValue:s(g).cp_name,"onUpdate:modelValue":a[0]||(a[0]=e=>s(g).cp_name=e),readonly:"",name:"cp_name",clearable:""},null,8,["modelValue"])):(u(),d(l,{key:1,modelValue:s(g).cp_name,"onUpdate:modelValue":a[1]||(a[1]=e=>s(g).cp_name=e),name:"cp_name",clearable:""},null,8,["modelValue"]))])),_:1}),t(r,{label:"cp简称",prop:"cp_nick",rules:[{required:!0,message:"cp简称必须填写"}]},{default:n((()=>[t(l,{modelValue:s(g).cp_nick,"onUpdate:modelValue":a[2]||(a[2]=e=>s(g).cp_nick=e),name:"cp_nick",clearable:""},null,8,["modelValue"])])),_:1}),t(r,{label:"所属公司",prop:"cp_company",rules:[{required:!0,message:"所属公司必须填写"}]},{default:n((()=>[t(l,{modelValue:s(g).cp_company,"onUpdate:modelValue":a[3]||(a[3]=e=>s(g).cp_company=e),name:"cp_company",clearable:""},null,8,["modelValue"])])),_:1}),t(r,{label:"联系人",prop:"manager",rules:[]},{default:n((()=>[t(l,{modelValue:s(g).manager,"onUpdate:modelValue":a[4]||(a[4]=e=>s(g).manager=e),name:"manager",clearable:""},null,8,["modelValue"])])),_:1}),t(r,{label:"联系电话",prop:"phone",rules:[{pattern:/^1[3456789]\d{9}$/,message:"联系电话号码格式不正确",trigger:"blur"}]},{default:n((()=>[t(l,{modelValue:s(g).phone,"onUpdate:modelValue":a[5]||(a[5]=e=>s(g).phone=e),name:"phone",clearable:""},null,8,["modelValue"])])),_:1}),t(r,{label:"电子邮箱",prop:"email",rules:[{type:"email",message:"邮箱格式不正确"}]},{default:n((()=>[t(l,{modelValue:s(g).email,"onUpdate:modelValue":a[6]||(a[6]=e=>s(g).email=e),name:"email",clearable:""},null,8,["modelValue"])])),_:1}),t(r,{label:"分成比例:",prop:"share_per",rules:[{required:!0,message:"分成比例必须填写"}]},{default:n((()=>[t(l,{type:"number",modelValue:s(g).share_per,"onUpdate:modelValue":a[7]||(a[7]=e=>s(g).share_per=e),name:"share_per",clearable:""},null,8,["modelValue"]),V])),_:1}),t(r,{label:"公司地址",prop:"address",rules:[{required:!0,message:"公司地址必须填写"}]},{default:n((()=>[t(l,{modelValue:s(g).address,"onUpdate:modelValue":a[8]||(a[8]=e=>s(g).address=e),name:"address",clearable:""},null,8,["modelValue"])])),_:1}),c("div",b,[t(f,{type:"primary",onClick:a[9]||(a[9]=e=>s(k)(s(h)))},{default:n((()=>[i(_(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[j,s(U)]])}}});export{f as _};
