import{e,a9 as i,r as a,h as t,w as o,z as n,o as s,i as d,a as u,m as r,s as c,x as l}from"./index-B3cqKsI_.js";import{d as p}from"./index.CL60Q41z.js";import{d as _}from"./dropDown.CM2PBiwT.js";import{t as m}from"./index.Dra0jpE9.js";import{i as f}from"./invoiceDetail.ahnv8ary.js";import{c as h,ae as g,af as v}from"./customer.Crnb53sL.js";import{d as y}from"./business.DGgyidim.js";import{_ as b}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.xE5Um1Eb.js";import"./uni-icons.EqO7jntL.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-easyinput.CqN2D7tl.js";/* empty css                                                                      */import"./uni-popup-dialog.BQPJ7mYw.js";import"./uni-popup.CmxZKYwY.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.CCBXdA0U.js";import"./uni-dateformat.DQ4pg8Wo.js";const j=b({__name:"details",setup(b){const j=e({defaultTitle:"发票详情",isShowTitle:!0,rightIcon:[{type:1,icon:"icon-gengduo1",types:"icon"}],operation_time:"",created_at:"",recordList:[],buildData:[],current:0,backgroundColor:"rgba(0,0,0,0)",color:"#fff",id:0,detail:{},forumMeus:[{name:"备注",id:1,icon:"icon-gongzuohuibao-bianji"},{name:"转移",id:6,icon:"icon-danchuang-zhuanyi"}],configData:{}});i((e=>{j.id=Number(e.id),C(e.id),M()})),a();const x=a(null),k=e=>{x.value.openDropdown()},D=a(null),w=e=>{6===e.id?r(`/pages/customer/list/shift?type=3&iid=${j.id}`):4==e.id?r(`/pages/users/examine/default?id=${j.buildData.void_invoice_switch}&invoice_id=${j.detail.id}&types=invoice`):1===e.id?(j.configData={title:"备注",placeholder:"请填写备注信息",type:e.id,text:j.detail.mark},D.value.popupOpen()):2===e.id?c("您确定要撤销该发票吗").then((e=>{y(j.detail.link_id).then((e=>{l.success(e.message),C(j.detail.id)}))})).catch((e=>{})):3==e.id&&c("您确定要撤回作废该发票吗").then((e=>{y(j.detail.revoke_id).then((e=>{l.success(e.message),C(j.detail.id)}))})).catch((e=>{}))},M=()=>{h().then((e=>{j.buildData=e.data}))},z=e=>{1===e.type&&I(j.id,{mark:e.value})},C=e=>{j.forumMeus=[{name:"备注",id:1,icon:"icon-gongzuohuibao-bianji"},{name:"转移",id:6,icon:"icon-danchuang-zhuanyi"}],g(e).then((e=>{j.detail=e.data,j.forumMeus.length<=2&&(0===j.detail.status?j.forumMeus.push({name:"发票撤回",id:2,icon:"icon-danchuang-chehui"}):4===j.detail.status?j.forumMeus.push({name:"撤回作废",id:3,icon:"icon-danchuang-chehui"}):5===j.detail.status&&j.forumMeus.push({name:"申请作废",id:4,icon:"icon-danchuang-shenqingzuofei"}))}))},I=(e,i)=>{v(e,i).then((i=>{l.success(i.message),C(e)})).catch((e=>{l.error(e.message)}))};return(e,i)=>{const a=n;return s(),t(a,{class:"content"},{default:o((()=>[d(a,{class:"cr-position-header"},{default:o((()=>[d(u(p),{"is-right":!0,backgroundColor:j.backgroundColor,color:j.color,"default-title":j.defaultTitle,"is-show-title":j.isShowTitle,"right-data":j.rightIcon,onHandleNarItem:k},null,8,["backgroundColor","color","default-title","is-show-title","right-data"])])),_:1}),d(f,{detail:j.detail},null,8,["detail"]),d(_,{ref_key:"dropDownRef",ref:x,"list-data":j.forumMeus,onBtnClick:w},null,8,["list-data"]),d(m,{ref_key:"textareaPopupRef",ref:D,"config-data":j.configData,onChange:z},null,8,["config-data"])])),_:1})}}},[["__scopeId","data-v-fc558a6d"]]);export{j as default};
