1 |
- import{_ as x,d as F,aU as z,bs as w,r as s,l as d,o as b,G as E,aq as q,a as j,bV as M,w as B,ag as D,z as R,aC as O,C as r,H as T,b1 as A,j as u,h,c as L,F as G,D as H,bW as P,M as Q}from"./index.js";import{g as W,l as $}from"./_options.b485149d.js";import{e as J}from"./index.3c9dc929.js";const K=F({__name:"category-query",props:{placeholder:{type:String,required:!0},disabled:{type:Boolean,required:!0},size:{type:String,required:!0},companyNo:{type:String,required:!0},modelValue:{type:String,required:!0}},setup(v){const f=v,i=z(!1),n=w(f,"modelValue"),g={checkStrictly:!0,expandTrigger:"hover",lazy:!0,lazyLoad:async(c,p)=>{const{level:m,value:V}=c,e={pid:"",cat_name:"",status:"",companyNo:f.companyNo||"GS2404151647395616",size:1e3},C=[];m===0?e.pid="0":e.pid=V;const o=await M(e),{code:l,data:_}=o;l===0?(_.list.forEach(t=>{const y={value:t.cat_id,label:t.cat_name,leaf:m>=2,desc:t.cat_desc};String(t.status)!=="0"&&t.status!==null&&C.push(y)}),p(C)):p([])}};return(c,p)=>{const m=s("el-cascader");return d(i)?j("v-if",!0):(b(),E(m,{key:0,modelValue:d(n),"onUpdate:modelValue":p[0]||(p[0]=V=>q(n)?n.value=V:null),placeholder:v.placeholder||"",disabled:v.disabled,style:{width:"100%"},props:g,filterable:"",clearable:""},null,8,["modelValue","placeholder","disabled"]))}}});var X=x(K,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/components/BasicForm/src/fields/category-query.vue"]]);const Y={class:"flex",style:{width:"100%"}},Z=h("p",{class:"ml-[10px]"},"\u5143",-1),ee={class:"flex justify-end"},le=F({__name:"ladderModal",props:{type:{type:String,required:!0},index:{type:Number,required:!0},visible:{type:Boolean,required:!0},detail:{type:null,required:!0}},emits:["add","update"],setup(v,{emit:f}){const i=v,n=w(i,"visible"),g=B(null),c=B(!1),p=D(()=>{const o={update:"\u7F16\u8F91\u5546\u54C1\u8981\u6C42",create:"\u6DFB\u52A0\u5546\u54C1\u8981\u6C42",preview:"\u67E5\u770B\u5546\u54C1\u8981\u6C42"};return o[i.type]||o.create}),m=D(()=>{const{can:o,...l}=$;return{...l,can:[{...o[0],required:Number(e.value.good_type)!==2}]}}),e=B((()=>({budget_price:"",good_name:"",good_type:"",good_img:"",can:[],num:0}))());R(()=>n.value,()=>{!n.value||(e.value={...i.detail})},{immediate:!0});async function C(){try{g.value&&g.value.validate(),c.value=!0;for(const o in e.value.can||[]){const l=e.value.can[o],_=await J({id:l}),{cat_name:t,id:y}=_.data;e.value.can[o]={id:y,name:t}}c.value=!1,i.type==="create"?f("add",e.value):f("update",{data:e.value,index:i.index}),n.value=!1}catch{}}return(o,l)=>{const _=s("ElInputNumber"),t=s("ElFormItem"),y=s("ElOption"),U=s("ElSelect"),N=s("ElInput"),S=s("ElButton"),k=s("ElDialog"),I=O("loading");return b(),E(k,{title:d(p),width:"800px",top:"10px",center:"",modelValue:d(n),"onUpdate:modelValue":l[6]||(l[6]=a=>q(n)?n.value=a:null)},{default:r(()=>[T((b(),E(d(A),{size:"small",center:"",model:e.value,rules:d(m),ref_key:"formRef",ref:g},{default:r(()=>[u(t,{label:"\u9884\u7B97\u5355\u4EF7",prop:"budget_price"},{default:r(()=>[h("div",Y,[u(_,{class:"flex-1",modelValue:e.value.budget_price,"onUpdate:modelValue":l[0]||(l[0]=a=>e.value.budget_price=a),"controls-position":"right",precision:2,min:0,placeholder:"\u9884\u7B97\u5355\u4EF7"},null,8,["modelValue"]),Z])]),_:1}),u(t,{label:"\u8D2D\u4E70\u6570\u91CF",prop:"num"},{default:r(()=>[u(_,{class:"w-full",style:{width:"100%"},modelValue:e.value.num,"onUpdate:modelValue":l[1]||(l[1]=a=>e.value.num=a),"controls-position":"right",placeholder:"\u8D2D\u4E70\u6570\u91CF",precision:0,min:0},null,8,["modelValue"])]),_:1}),u(t,{label:"\u5546\u54C1\u7C7B\u578B",prop:"good_type"},{default:r(()=>[u(U,{class:"w-full",style:{width:"100%"},modelValue:e.value.good_type,"onUpdate:modelValue":l[2]||(l[2]=a=>e.value.good_type=a),placeholder:"\u5546\u54C1\u7C7B\u578B"},{default:r(()=>[(b(!0),L(G,null,H(d(W),a=>(b(),E(y,{value:a.value,label:a.label},null,8,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),u(t,{label:"\u5546\u54C1\u5206\u7C7B",prop:"can"},{default:r(()=>[u(d(X),{modelValue:e.value.can,"onUpdate:modelValue":l[3]||(l[3]=a=>e.value.can=a),placeholder:"\u5546\u54C1\u5206\u7C7B"},null,8,["modelValue"])]),_:1}),u(t,{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name"},{default:r(()=>[u(N,{modelValue:e.value.good_name,"onUpdate:modelValue":l[4]||(l[4]=a=>e.value.good_name=a),placeholder:"\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(t,{label:"\u5546\u54C1\u56FE\u7247",prop:"goog_img"},{default:r(()=>[u(P,{modelValue:e.value.good_img,"onUpdate:modelValue":l[5]||(l[5]=a=>e.value.good_img=a)},null,8,["modelValue"])]),_:1}),h("div",ee,[u(S,{type:"primary",onClick:C},{default:r(()=>[Q("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model","rules"])),[[I,c.value]])]),_:1},8,["title","modelValue"])}}});var oe=x(le,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/sellOut/project/components/ladderModal.vue"]]);export{oe as default};
|