import{_ as O,d as M,w as A,bn as R,r as n,aC as z,o as d,c as k,H as _,l as a,G as f,C as t,j as e,aq as G,b1 as H,h as F,L as J,M as w,aN as K,aa as Q}from"./index.js";import{B as g}from"./basic-descriptions.64fbdf9d.js";import{u as W}from"./useDetail.1ef9c113.js";import{b as X,p as Y,c as Z,a as $,r as aa,h as ea,d as ta,e as la,f as sa}from"./index.8ca3be50.js";import{u as C}from"./useTask.8a645393.js";const ua={class:"p-[10px] bg-white"},oa={class:"flex"},na={class:"flex mr-[10px]"},da={key:0},ca=["src"],ia={class:"w-full flex justify-end"},ra=M({__name:"detail",setup(pa){const V="bargainListDetail",T=A(null),{id:D,isDetail:ma,title:B,collapses:h}=W({baseName:"\u8BAE\u4EF7\u5355",collapseLen:5}),s=A({state:"",adjunct:"",adjunct_name:"",remark:""}),N=C({success(o){K.success("\u4E0A\u4F20\u6210\u529F"),s.value.adjunct_name=o[0].name,s.value.adjunct="http://cxinv.api.caixiao365.com/"+o[0].url}}),c=C({initialData:{},success(o){const{spuCode:u,status:l,remark:r,adjunct:v,adjunct_name:p}=o;let i=l;i==="0"||i==="2"?i="0":i="1",s.value={state:i,remark:r,adjunct:v,adjunct_name:p},E.run(ea({spuCode:u}))}}),E=C({initialData:{}}),j=C({success:()=>x()}),x=()=>c.run(ta({bargainNo:D.value}));R(V);async function U({file:o}){const u=Q(),l=new FormData;l.append("files",o),l.append("token",u),N.run(la(l))}async function I(){try{await T.value.validate();const{state:o,adjunct:u,adjunct_name:l,remark:r}=s.value,v={remark:r,status:o,adjunct:u,adjunct_name:l,bargainNo:D.value};j.run(sa(v))}catch{}}return x(),(o,u)=>{const l=n("ElCollapseItem"),r=n("ElOption"),v=n("ElSelect"),p=n("ElFormItem"),i=n("ElInput"),y=n("ElButton"),L=n("ElUpload"),P=n("ElCollapse"),S=n("ElTabPane"),q=n("ElTabs"),m=z("loading");return d(),k("div",ua,[_((d(),f(q,null,{default:t(()=>[e(S,{label:a(B)},{default:t(()=>[e(P,{modelValue:a(h),"onUpdate:modelValue":u[2]||(u[2]=b=>G(h)?h.value=b:null)},{default:t(()=>[_((d(),f(l,{title:a(B),name:"1"},{default:t(()=>[e(a(g),{columns:a(X),data:a(c).data},null,8,["columns","data"])]),_:1},8,["title"])),[[m,a(c).loading]]),_((d(),f(l,{title:"\u5546\u54C1\u4FE1\u606F",name:"2"},{default:t(()=>[e(a(g),{columns:a(Y),data:a(E).data},null,8,["columns","data"])]),_:1})),[[m,a(E).loading]]),_((d(),f(l,{title:"\u5546\u54C1\u6210\u672C\u4FE1\u606F",name:"3"},{default:t(()=>[e(a(g),{columns:a(Z),data:a(E).data},null,8,["columns","data"])]),_:1})),[[m,a(E).loading]]),_((d(),f(l,{title:"\u5546\u54C1\u6BDB\u5229\u4FE1\u606F",name:"4"},{default:t(()=>[e(a(g),{columns:a($),data:a(c).data},null,8,["columns","data"])]),_:1})),[[m,a(c).loading]]),_((d(),f(l,{title:"\u4E1A\u52A1\u90E8\u95E8\u5BA1\u6279",name:"5"},{default:t(()=>[e(a(H),{"label-width":"80px",model:s.value,style:{width:"500px"},rules:a(aa),disabled:a(c).data.status!=="0"},{default:t(()=>[e(p,{label:"\u5BA1\u6838\u72B6\u6001",prop:"state"},{default:t(()=>[e(v,{style:{width:"100%"},modelValue:s.value.state,"onUpdate:modelValue":u[0]||(u[0]=b=>s.value.state=b),placeholder:"\u5BA1\u6838\u72B6\u6001"},{default:t(()=>[e(r,{value:"0",label:"\u9A73\u56DE"}),e(r,{value:"1",label:"\u901A\u8FC7"})]),_:1},8,["modelValue"])]),_:1}),e(p,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[e(i,{type:"textarea",modelValue:s.value.remark,"onUpdate:modelValue":u[1]||(u[1]=b=>s.value.remark=b),placeholder:"\u5907\u6CE8"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u9644\u4EF6",prop:"adjunct"},{default:t(()=>[F("div",oa,[F("div",na,[s.value.adjunct_name?(d(),k("a",{key:1,src:s.value.adjunct,target:"_blank",underline:!1},J(s.value.adjunct_name),9,ca)):(d(),k("p",da,"\u6682\u672A\u4E0A\u4F20\u6587\u4EF6"))]),e(L,{"show-file-list":!1,"before-upload":()=>!0,accept:".pdf","http-request":U},{trigger:t(()=>[e(y,{type:"primary",size:"small"},{default:t(()=>[w("\u9009\u62E9\u6587\u4EF6")]),_:1})]),_:1},8,["before-upload"])])]),_:1}),e(p,null,{default:t(()=>[F("div",ia,[e(y,{type:"primary",onClick:I},{default:t(()=>[w("\u63D0\u4EA4")]),_:1})])]),_:1})]),_:1},8,["model","rules","disabled"])]),_:1})),[[m,a(j).loading]])]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1})),[[m,a(c).loading]])])}}});var ga=O(ra,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/sellOut/bargainList/detail.vue"]]);export{ga as default};
