import{g as B,s as S,h as b}from"./index-Ckpf801C.js";import{d as T,r as c,z as D,c as C,b as a,u as e,N as I,w as s,C as U,B as p,i as $,D as z,x as E,A as F,m as y,n as G,q as w,o as h,E as i,I as L,s as O,G as R,h as d,t as j,g as A,j as M,p as P}from"./index-oRjfHbF4.js";import"./baseUrl-CEnR8jFP.js";const H={class:"flex flex-col"},J={key:0,class:"fixed bottom-0 left-0 flex w-full my-[10px] bg-[#ffff]"},K={class:"flex"},Z=T({__name:"cost-detail",setup(Q){const f=E(),k=F(),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 B({spuCode:f.query.id});G(),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:f.query.id,out_tax_id:"",out_tax:"",status:"10"});n==0&&(w("审核成功"),o.value=!1,m())}function N(){S({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:f.query.id,remark:""});n==0&&(w("审核成功"),o.value=!1,m())}).catch(()=>{})}return D(m),(n,t)=>(h(),C("div",H,[a(e(I),{title:"咨询商品详情","left-arrow":"",onClick:t[0]||(t[0]=u=>e(k).push("/home?path=cost"))}),a(e(U),null,{default:s(()=>{var u,g;return[a(e(i),{title:"商品图片"},{value:s(()=>[a(e(L),{style:{height:"25px",width:"25px"},src:l.value.good_thumb_img,onClick:t[1]||(t[1]=()=>e(O)(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(R),{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(j(((v=x.find(({value:V})=>l.value.status==V))==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",J,[a(e(p),{class:"flex-1 mx-[10px]",type:"warning",plain:"",onClick:t[2]||(t[2]=u=>o.value=!0)},{default:s(()=>[d("审核不通过")]),_:1}),a(e(p),{class:"flex-1 mx-[10px]",type:"warning",onClick:N},{default:s(()=>[d("审核通过")]),_:1})])):$("",!0),a(e(z),{show:o.value,"onUpdate:show":t[5]||(t[5]=u=>o.value=u),title:"驳回原因"},{footer:s(()=>[A("div",K,[a(e(p),{class:"flex-1",onClick:t[4]||(t[4]=u=>{o.value=!1,r.value=""})},{default:s(()=>[d("取消")]),_:1}),a(e(p),{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{Z as default};
