baseForm.bb3fee.js 9.9 KB

1
  1. import{_ as O,d as Y,bs as te,w as C,x as oe,o as d,G as V,l as o,aq as ne,bX as re,bw as se,W as ie,bx as S,Z as de,z as M,r as i,aC as pe,c as g,j as e,C as u,F as R,D as I,bS as me,bT as ce,h as k,M as f,H as fe,L as E,a as x,J as _e,b1 as ve,aN as q}from"./index.js";import{P as Ee}from"./platform-query.44bd7119.js";import{u as be}from"./useTask.8a645393.js";import{i as ye,b as Ce,r as we,a as z}from"./_options.e9511092.js";import{h as he}from"./index.3c9dc929.js";import ge from"./activityProductModal.5f58cd.js";import De from"./index.00bc39.js";import"./validator.92b8f4b2.js";const Fe=Y({__name:"area-query",props:{modelValue:{type:String,required:!1}},emits:["change"],setup(N,{expose:D,emit:m}){const s=te(N,"modelValue"),b=C(null);return oe(()=>{s.value&&b.value.initalData(s.value)}),D({initialData:y=>b.value.initalData(y),getRecurrentValue:y=>b.value.getRecurrentValue(y)}),(y,_)=>(d(),V(o(se),{modelValue:o(s),"onUpdate:modelValue":_[0]||(_[0]=a=>ne(s)?s.value=a:null),"is-root":"",ref_key:"RemoteSelectRef",ref:b,style:{width:"100%"},api:o(re),"request-prop":"name","response-label-prop":"search_name","response-val-prop":"code",onItemChange:_[1]||(_[1]=a=>m("change",a)),onClear:_[2]||(_[2]=a=>m("change")),"pro-data":()=>({level:2})},null,8,["modelValue","api","pro-data"]))}});var Be=O(Fe,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/components/BasicForm/src/fields/area-query.vue"]]);const Ve={style:{width:"100%"}},Ae={class:"flex w-full"},xe={key:0},ke={class:"flex w-full justify-between"},je=k("p",null,"\u64CD\u4F5C",-1),Re={class:"flex justify-end"},Ne=Y({__name:"baseForm",setup(N){const{currentCompany:D}=ie(),m=S({project:!1,activity:!1}),A=C(null),s=S({freedom:"",name:""}),b=C(null),y=C(null),_=C(null),a=C({...ye}),F=C([]),j=be({initialData:{},success:async r=>{var h;const{khName:t,platform_code:B}=r;a.value.platform_code=B,a.value.khNo=await((h=y.value)==null?void 0:h.getRecurrentValue({companyName:t}))}}),w=de({detail:{},index:-1});async function H(){try{A.value&&A.value.validate();const{ladder:r}=formData.value}catch{}}function G(){if(a.value.is_project==="1"){if(F.value.length===0){q.warning("\u5FC5\u987B\u9009\u62E9\u4E00\u4E2A\u9879\u76EE\u5546\u54C1\u8981\u6C42\uFF01");return}if(F.value.length>1){q.warning("\u6BCF\u6B21\u521B\u5EFA\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u9879\u76EE\u5546\u54C1\u8981\u6C42\uFF01");return}const{addtime:r,budget_price:t,good_name:B,num:h}=F.value[0];w.detail={...z,arrival_time:r,budget_price:t,good_name:B,num:h}}else w.detail={...z};m.activity=!0,w.index=-1}const L=r=>r.getTime()<Date.now()-60*60*24*1e3,W=r=>j.run(he({projectNo:r}));async function $({area:r}={}){var t;r==="\u65E0\u9650\u5236"||r==="\u4E0D\u9650\u533A\u57DF"?(s.freedom="0",s.name="0",a.value.area=""):(s.freedom="",s.name=r,a.value.area=await((t=b.value)==null?void 0:t.getRecurrentValue({name:s.name})))}function J(r){s.name=r.search_name}return M(()=>a.value.is_project,()=>{a.value.platform_code="",a.value.khNo="",F.value=[]},{immediate:!0}),M(()=>D,()=>{!D||(a.value.companyNo=D.value.companyNo)},{immediate:!0,deep:!0}),(r,t)=>{const B=i("ElOption"),h=i("ElSelect"),c=i("ElFormItem"),p=i("ElCol"),X=i("ElDatePicker"),Z=i("ElRadio"),K=i("ElAlert"),n=i("ElTableColumn"),ee=i("ElTag"),T=i("ElImage"),U=i("ElTable"),P=i("ElButton"),le=i("ElTooltip"),ae=i("ElRow"),ue=pe("loading");return d(),g("div",Ve,[e(o(ve),{"label-width":"100px",rules:o(we),ref_key:"formRef",ref:A,model:a.value},{default:u(()=>[e(ae,{gutter:10},{default:u(()=>[e(p,{span:6},{default:u(()=>[e(c,{label:"\u7ADE\u4EF7\u7C7B\u578B",prop:"is_project"},{default:u(()=>[e(h,{modelValue:a.value.is_project,"onUpdate:modelValue":t[0]||(t[0]=l=>a.value.is_project=l),placeholder:"\u7ADE\u4EF7\u7C7B\u578B",style:{width:"100%"}},{default:u(()=>[(d(!0),g(R,null,I(o(Ce),l=>(d(),V(B,{value:l.value,label:l.label,key:l.value},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(p,{span:6},{default:u(()=>[e(c,{label:"\u7ADE\u4EF7\u622A\u6B62\u65F6\u95F4",prop:"endtime","label-width":"120px"},{default:u(()=>[e(X,{modelValue:a.value.endtime,"onUpdate:modelValue":t[1]||(t[1]=l=>a.value.endtime=l),disabledDate:L,"value-format":"YYYY-MM-DD HH:mm:ss",type:"datetime",style:{width:"100%"},placeholder:"\u7ADE\u4EF7\u622A\u6B62\u65F6\u95F4"},null,8,["modelValue"])]),_:1})]),_:1}),e(p,{span:12},{default:u(()=>[e(c,{label:"\u6240\u5C5E\u5E73\u53F0",prop:"platform_code"},{default:u(()=>[e(o(Ee),{ref_key:"platformQueryRef",ref:_,modelValue:a.value.platform_code,"onUpdate:modelValue":t[2]||(t[2]=l=>a.value.platform_code=l),placeholder:"\u6240\u5C5E\u5E73\u53F0",disabled:a.value.is_project==="1"},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e(p,{span:12},{default:u(()=>[e(c,{label:"\u9500\u552E\u65B9",prop:"companyNo"},{default:u(()=>[e(o(me),{modelValue:a.value.companyNo,"onUpdate:modelValue":t[3]||(t[3]=l=>a.value.companyNo=l),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),e(p,{span:12},{default:u(()=>[e(c,{label:"\u8D2D\u4E70\u65B9",prop:"khNo"},{default:u(()=>[e(o(ce),{ref_key:"customerQueryRef",ref:y,modelValue:a.value.khNo,"onUpdate:modelValue":t[4]||(t[4]=l=>a.value.khNo=l),placeholder:"\u8D2D\u4E70\u65B9",disabled:a.value.is_project==="1",onChange:$},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e(p,{span:24},{default:u(()=>[e(c,{label:"\u6536\u8D27\u533A\u57DF",prop:"area"},{default:u(()=>[k("div",Ae,[e(Z,{modelValue:o(s).freedom,"onUpdate:modelValue":t[5]||(t[5]=l=>o(s).freedom=l),disabled:!a.value.khNo||a.value.is_project==="1",label:"0"},{default:u(()=>[f("\u4E0D\u9650")]),_:1},8,["modelValue","disabled"]),e(o(Be),{ref_key:"areaQueryRef",ref:b,modelValue:a.value.area,"onUpdate:modelValue":t[6]||(t[6]=l=>a.value.area=l),disabled:!a.value.khNo||a.value.is_project==="1",style:{width:"100%"},onChange:J},null,8,["modelValue","disabled"])])]),_:1})]),_:1}),a.value.is_project==="1"?(d(),g(R,{key:0},[e(p,{span:24},{default:u(()=>[e(c,{label:"\u9879\u76EE\u4FE1\u606F"},{default:u(()=>[e(K,{onClick:t[7]||(t[7]=()=>o(m).project=!0),class:"cursor-pointer select-none",title:"\u70B9\u51FB\u6B64\u5904\u9009\u62E9\u9879\u76EE",type:"warning","show-icon":"",center:""})]),_:1})]),_:1}),e(p,{span:24},{default:u(()=>[e(c,{label:"\u9879\u76EE\u5546\u54C1\u8981\u6C42","label-width":"100px"},{default:u(()=>[fe((d(),V(U,{data:o(j).data.ladder||[],onSelectionChange:t[8]||(t[8]=l=>F.value=l),size:"small",border:""},{default:u(()=>[e(n,{width:"40px",type:"selection"}),e(n,{label:"\u5546\u54C1\u9636\u68AF",width:"70px","show-overflow-tooltip":""},{default:u(({$index:l})=>[f(E(l),1)]),_:1}),e(n,{label:"\u5546\u54C1\u7C7B\u578B",width:"70px","show-overflow-tooltip":""},{default:u(({row:l})=>[e(ee,null,{default:u(()=>[f(E(Number(l.good_type)===1?"\u7ADE\u54C1":Number(l.good_type)===2?"\u7ADE\u8058":"--"),1)]),_:2},1024)]),_:1}),e(n,{label:"\u9884\u7B97\u5355\u4EF7",prop:"budget_price",width:"100px","show-overflow-tooltip":""}),e(n,{label:"\u8D2D\u4E70\u6570\u91CF",prop:"num",width:"100px","show-overflow-tooltip":""}),e(n,{label:"\u5546\u54C1\u5206\u7C7B","min-width":"300px","show-overflow-tooltip":""},{default:u(({row:l})=>[f(E(l.cat_info.map(({name:v})=>v).join("-")),1)]),_:1}),e(n,{label:"\u56FE\u7247",width:"80px"},{default:u(({row:l})=>[l.good_img?(d(),V(T,{key:0,style:{width:"20px",height:"20px"},src:l.good_img,"preview-src-list":[l.good_name]},null,8,["src","preview-src-list"])):x("v-if",!0)]),_:1}),e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name","min-width":"180px","show-overflow-tooltip":""})]),_:1},8,["data"])),[[ue,o(j).loading]])]),_:1})]),_:1})],64)):x("v-if",!0),e(p,{span:24},{default:u(()=>[e(c,{label:"\u7ADE\u4EF7\u5546\u54C1\u8981\u6C42",prop:"ladder","label-width":"100px"},{default:u(()=>[e(U,{border:"",size:"small",data:a.value.ladder},{default:u(()=>[e(n,{label:"\u5546\u54C1\u9636\u68AF"},{default:u(({$index:l})=>[f(E(l+1),1)]),_:1}),e(n,{label:"\u9884\u7B97\u5355\u4EF7",prop:"budget_price"}),e(n,{label:"\u8D2D\u4E70\u6570\u91CF",prop:"num"}),e(n,{label:"\u5546\u54C1\u5206\u7C7B",prop:"cat_id_name"}),e(n,{label:"\u56FE\u7247"},{default:u(({row:l})=>[l.good_img?(d(),V(T,{key:0,src:l.good_img,style:{width:"20px",height:"20px"},"preview-src-list":[l.good_img]},null,8,["src","preview-src-list"])):x("v-if",!0)]),_:1}),e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name",minWidth:"170"}),e(n,{prop:"good_name",label:"\u5546\u54C1\u540D\u79F0","show-overflow-tooltip":"","min-width":"170"}),e(n,{prop:"specinfo",label:"\u5546\u54C1\u89C4\u683C","show-overflow-tooltip":"",width:"170"},{default:u(({row:l})=>[(d(!0),g(R,null,I(l.specs,(v,Q)=>(d(),g("span",{key:v.spec_name+Q},[Q!==0?(d(),g("span",xe,"-")):x("v-if",!0),f(" "+E(v.spec_name)+":["+E(v.spec_value_name)+"] ",1)]))),128))]),_:1}),e(n,{prop:"is_addrs",label:"\u662F\u5426\u591A\u5730",width:"70","show-overflow-tooltip":""},{default:u(({row:l})=>[f(E(l.is_addrs==="1"?"\u591A\u5730":"\u4E00\u5730"),1)]),_:1}),e(n,{prop:"is_custom",label:"\u662F\u5426\u5B9A\u5236",width:"70","show-overflow-tooltip":""},{default:u(({row:l})=>[f(E(l.is_custom==="1"?"\u5B9A\u5236":"\u975E\u5B9A\u5236"),1)]),_:1}),e(n,{label:"\u64CD\u4F5C",fixed:"right"},{header:u(()=>[k("div",ke,[je,e(le,{content:"\u6DFB\u52A0\u6D3B\u52A8\u5546\u54C1",placement:"top"},{default:u(()=>[e(P,{link:"",size:"small",type:"primary",icon:o(_e)("add"),onClick:G},null,8,["icon"])]),_:1})])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1}),e(p,{span:24},{default:u(()=>[k("div",Re,[e(P,{type:"primary",onClick:H},{default:u(()=>[f("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1})]),_:1},8,["rules","model"]),e(De,{visible:o(m).project,"onUpdate:visible":t[9]||(t[9]=l=>o(m).project=l),onConfirm:W},null,8,["visible"]),e(ge,{visible:o(m).activity,"onUpdate:visible":t[10]||(t[10]=l=>o(m).activity=l),data:w.detail,"onUpdate:data":t[11]||(t[11]=l=>w.detail=l),index:w.index,isProject:a.value.is_project==="1",onSubmit:t[12]||(t[12]=({newData:l,index:v})=>v===-1?a.value.ladder.push(l):a.value.ladder[v]=l)},null,8,["visible","data","index","isProject"])])}}});var ze=O(Ne,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/sellOut/zixunOrder/components/baseForm.vue"]]);export{ze as default};