import{g as S,s as T,h as b}from"./index-7VGDwax7.js";import{e as B,d as c,b as D,h as C,K as a,u as e,aq as F,F as s,ar as R,ac as f,R as U,ah as $,ao as j,as as I,aj as y,ak as L,am as w,f as h,at as i,ad as O,ae as z,au as E,a5 as d,Z as G,j as K,ag as M,al as P}from"./index-D6Xt1sgO.js";import"./baseUrl-C_rSP_rE.js";const Z={class:"flex flex-col"},A={key:0,class:"fixed bottom-0 left-0 flex w-full my-[10px] bg-[#ffff]"},H={class:"flex"},Y=B({__name:"cost-detail",setup(J){const p=j(),k=I(),x=[{value:"",label:"全部",type:"primary"},{value:"0",label:"新建待审核",type:"primary"},{value:"9",label:"待财务审核",type:"primary"},{value:"1",label:"审核通过",type:"success"},{value:"2",label:"基础修改待审核",type:"primary"},{value:"3",label:"成本修改待审核",type:"primary"},{value:"4",label:"基础修改驳回",type:"danger"},{value:"5",label:"成本修改驳回",type:"danger"},{value:"10",label:"财务审核驳回",type:"danger"},{value:"6",label:"新建审核驳回",type:"danger"},{value:"7",label:"复制商品待编辑",type:"primary"},{value:"8",label:"竞价商品待编辑",type:"primary"}],l=c({}),r=c(""),o=c(!1);async function m(){y({message:"加载中...",forbidClick:!0});const{code:n,data:t}=await S({spuCode:p.query.id});L(),n==0&&(l.value=t)}async function q(){if(r.value.trim().length===0){o.value=!0,P("请输入驳回原因!");return}y({message:"审核中...",forbidClick:!0});const{code:n}=await b({remark:r.value,spuCode:p.query.id,out_tax_id:"",out_tax:"",status:"10"});n==0&&(w("审核成功"),o.value=!1,m())}function V(){T({title:"提示",message:"是否确认通过?"}).then(async()=>{y({message:"审核中...",forbidClick:!0});const{code:n}=await b({status:"1",out_tax:l.value.tax+"%",out_tax_id:l.value.tax_info.id,spuCode:p.query.id,remark:""});n==0&&(w("审核成功"),o.value=!1,m())}).catch(()=>{})}return D(m),(n,t)=>(h(),C("div",Z,[a(e(F),{title:"咨询商品详情","left-arrow":"",onClick:t[0]||(t[0]=u=>e(k).push("/home?path=cost"))}),a(e(R),null,{default:s(()=>{var u,g;return[a(e(i),{title:"商品图片"},{value:s(()=>[a(e(O),{style:{height:"25px",width:"25px"},src:l.value.good_thumb_img,onClick:t[1]||(t[1]=()=>e(z)(l.value.good_thumb_img))},null,8,["src"])]),_:1}),a(e(i),{title:"商品名称",value:l.value.good_name},null,8,["value"]),a(e(i),{title:"商品编码",value:l.value.spuCode},null,8,["value"]),a(e(i),{title:"状态"},{default:s(()=>{var _;return[a(e(E),{class:"mb-[5px]",size:"large",name:l.value.value,type:(_=x.find(({value:v})=>l.value.status==v))==null?void 0:_.type},{default:s(()=>{var v;return[d(G(((v=x.find(({value:N})=>l.value.status==N))==null?void 0:v.label)||"--"),1)]}),_:1},8,["name","type"])]}),_:1}),a(e(i),{title:"进项类目编号",value:(u=l.value.tax_info)==null?void 0:u.in_tax_merge},null,8,["value"]),a(e(i),{title:"进项类目名称",value:(g=l.value.tax_info)==null?void 0:g.in_tax_name},null,8,["value"]),a(e(i),{title:"进项税率",value:l.value.tax+"%"},null,8,["value"])]}),_:1}),l.value.status=="9"&&l.value.spuCode.indexOf("SSU")===-1?(h(),C("div",A,[a(e(f),{class:"flex-1 mx-[10px]",type:"warning",plain:"",onClick:t[2]||(t[2]=u=>o.value=!0)},{default:s(()=>[d("审核不通过")]),_:1}),a(e(f),{class:"flex-1 mx-[10px]",type:"warning",onClick:V},{default:s(()=>[d("审核通过")]),_:1})])):U("",!0),a(e($),{show:o.value,"onUpdate:show":t[5]||(t[5]=u=>o.value=u),title:"驳回原因"},{footer:s(()=>[K("div",H,[a(e(f),{class:"flex-1",onClick:t[4]||(t[4]=u=>{o.value=!1,r.value=""})},{default:s(()=>[d("取消")]),_:1}),a(e(f),{class:"flex-1",type:"warning",onClick:q},{default:s(()=>[d("保存")]),_:1})])]),default:s(()=>[a(e(M),{modelValue:r.value,"onUpdate:modelValue":t[3]||(t[3]=u=>r.value=u),placeholder:"驳回原因",type:"textarea",rows:"3"},null,8,["modelValue"])]),_:1},8,["show"])]))}});export{Y as default};
