1 |
- import{_ as V,d as x,W as q,bs as v,ag as F,aU as N,w as U,r as _,o as j,G as I,C as n,j as s,l,b1 as M,h as d,M as S,aq as O,aN as D}from"./index.js";import{h as R}from"./index.1b996d7e.js";const re=[{value:"0",label:"\u7981\u7528"},{value:"1",label:"\u542F\u7528"}],P=(r,u,e)=>{const{required:a}=r;(u===""||u===void 0)&&a?e(new Error("\u4E3B\u7BA1\u5229\u7387\u6BDB\u5229\u7387\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):e()},z=(r,u,e)=>{const{required:a}=r;(u===""||u===void 0)&&a?e(new Error("\u9884\u7B97\u2192\u6210\u672C\u6BDB\u5229\u7387\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):e()},T=(r,u,e)=>{const{required:a}=r;(u===""||u===void 0)&&a?e(new Error("\u6210\u672C\u2192\u552E\u4EF7\u6BDB\u5229\u7387\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):e()},G=(r,u,e)=>{const{required:a}=r;(u===""||u===void 0)&&a?e(new Error("BOSS\u6BDB\u5229\u7387\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):e()},W=(r,u,e)=>{const{required:a}=r;(u===""||u===void 0)&&a?e(new Error("\u9879\u76EE\u6700\u4F4E\u6BDB\u5229\u7387\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):e()},H=(r,u,e)=>{const{required:a}=r;(u===""||u===void 0)&&a?e(new Error("\u8D22\u52A1\u6BDB\u5229\u7387\u4E0D\u80FD\u4E3A\u7A7A\uFF01")):e()},J={order_rate:[{required:!0,validator:z,trigger:"blur"}],sale_rate:[{required:!0,validator:T,trigger:"blur"}],lower_rate:[{required:!1,validator:G,trigger:"blur"}],rate:[{required:!0,validator:P,trigger:"blur"}],low_rate:[{required:!0,validator:W,trigger:"blur"}],money_rate:[{required:!0,validator:H,trigger:"blur"}]},K={class:"flex w-full"},L=d("p",{class:"ml-[10px]"},"%",-1),Q={class:"flex w-full"},X=d("p",{class:"ml-[10px]"},"%",-1),Y={class:"flex w-full"},Z=d("p",{class:"ml-[10px]"},"%",-1),$={class:"flex w-full"},k=d("p",{class:"ml-[10px]"},"%",-1),ee={class:"w-full flex justify-end"},ue=x({__name:"modal",props:{data:{type:null,required:!0,default:{}},pid:{type:String,required:!0},visible:{type:Boolean,required:!0},breadcrumb:{type:Array,required:!0}},emits:["refresh"],setup(r,{emit:u}){const e=r,{currentCompany:a}=q(),w={pid:"",name:"",id:"",companyNo:""},t=v(e,"data"),p=v(e,"visible"),b=F(()=>t.value.id?"\u7F16\u8F91\u4E1A\u52A1\u516C\u53F8\u5206\u7C7B\u6BDB\u5229":"\u6DFB\u52A0\u4E1A\u52A1\u516C\u53F8\u5206\u7C7B\u6BDB\u5229");F(()=>{const{breadcrumb:m=[]}=e;return m.slice(0).map(({name:o})=>o).join("/")});const E=N(!1),B=U(null);function A(){t.value={...w},p.value=!1}async function g(){try{await B.value.validate(),E.value=!0;const m=await R({money_rate:0,...t.value,cat_id:t.value.id,companyNo:a.value.companyNo});E.value=!1,m.code===0?(p.value=!1,D.success("\u66F4\u65B0\u6210\u529F"),u("refresh")):D.warning("\u66F4\u65B0\u5931\u8D25")}catch{}}return(m,o)=>{const y=_("ElInput"),c=_("ElFormItem"),f=_("ElInputNumber"),h=_("ElButton"),C=_("ElDialog");return j(),I(C,{modelValue:l(p),"onUpdate:modelValue":o[5]||(o[5]=i=>O(p)?p.value=i:null),title:l(b),center:"",onClose:A},{default:n(()=>[s(l(M),{model:l(t),rules:l(J),size:"small",ref_key:"formRef",ref:B,"label-width":"100px"},{default:n(()=>[s(c,{label:"\u5206\u7C7B\u540D\u79F0",prop:"cat_name"},{default:n(()=>[s(y,{modelValue:l(t).cat_name,"onUpdate:modelValue":o[0]||(o[0]=i=>l(t).cat_name=i),placeholder:"\u5206\u7C7B\u540D\u79F0",disabled:l(t).id},null,8,["modelValue","disabled"])]),_:1}),s(c,{label:"\u9884\u7B97\u2192\u6210\u672C",prop:"order_rate"},{default:n(()=>[d("div",K,[s(f,{placeholder:"\u9884\u7B97\u2192\u6210\u672C",style:{width:"100%"},min:0,max:100,"controls-position":"right",modelValue:l(t).order_rate,"onUpdate:modelValue":o[1]||(o[1]=i=>l(t).order_rate=i),disbaled:"",precision:"2"},null,8,["modelValue"]),L])]),_:1}),s(c,{label:"\u6210\u672C\u2192\u552E\u4EF7",prop:"sale_rate"},{default:n(()=>[d("div",Q,[s(f,{placeholder:"\u6210\u672C\u2192\u552E\u4EF7",style:{width:"100%"},min:0,max:100,"controls-position":"right",modelValue:l(t).sale_rate,"onUpdate:modelValue":o[2]||(o[2]=i=>l(t).sale_rate=i),disbaled:"",precision:"2"},null,8,["modelValue"]),X])]),_:1}),s(c,{label:"\u4E3B\u7BA1\u5229\u7387",prop:"rate"},{default:n(()=>[d("div",Y,[s(f,{placeholder:"\u4E3B\u7BA1\u5229\u7387",style:{width:"100%"},min:0,max:100,"controls-position":"right",modelValue:l(t).rate,"onUpdate:modelValue":o[3]||(o[3]=i=>l(t).rate=i),disbaled:"",precision:"2"},null,8,["modelValue"]),Z])]),_:1}),s(c,{label:"\u9879\u76EE\u6700\u4F4E\u6BDB\u5229",prop:"low_rate"},{default:n(()=>[d("div",$,[s(f,{placeholder:"\u9879\u76EE\u6700\u4F4E\u6BDB\u5229",style:{width:"100%"},min:0,max:100,"controls-position":"right",modelValue:l(t).low_rate,"onUpdate:modelValue":o[4]||(o[4]=i=>l(t).low_rate=i),disbaled:"",precision:"2"},null,8,["modelValue"]),k])]),_:1}),d("div",ee,[s(h,{type:"primary",loading:l(E),onClick:g},{default:n(()=>[S("\u4FDD\u5B58")]),_:1},8,["loading"])])]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});var le=V(ue,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/grossProfit/cpns/modal.vue"]]),ae=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));export{le as M,ae as m,re as s};
|