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