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-Dnh6GPlT.js";import{d as p}from"./index.C9RyZqIW.js";import{d as _}from"./dropDown.Cv_jJ0C_.js";import{t as m}from"./index.B9w7iKIY.js";import{i as f}from"./invoiceDetail.CG8cr47Q.js";import{c as h,ae as g,af as v}from"./customer.C_xRWtM3.js";import{d as y}from"./business.B0hIPKPC.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.Bf2crVgQ.js";import"./uni-icons.C_vWVLAq.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-easyinput.B9QjCcys.js";/* empty css                                                                      */import"./uni-popup-dialog.Bd89u5aW.js";import"./uni-popup.LDlA9brl.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.B5-y41yX.js";import"./uni-dateformat.C-BKL-OF.js";const b=j({__name:"details",setup(j){const b=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=>{b.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=${b.id}`):4==e.id?r(`/pages/users/examine/default?id=${b.buildData.void_invoice_switch}&invoice_id=${b.detail.id}&types=invoice`):1===e.id?(b.configData={title:"备注",placeholder:"请填写备注信息",type:e.id,text:b.detail.mark},D.value.popupOpen()):2===e.id?c("您确定要撤销该发票吗").then((e=>{y(b.detail.link_id).then((e=>{l.success(e.message),C(b.detail.id)}))})).catch((e=>{})):3==e.id&&c("您确定要撤回作废该发票吗").then((e=>{y(b.detail.revoke_id).then((e=>{l.success(e.message),C(b.detail.id)}))})).catch((e=>{}))},M=()=>{h().then((e=>{b.buildData=e.data}))},z=e=>{1===e.type&&I(b.id,{mark:e.value})},C=e=>{b.forumMeus=[{name:"备注",id:1,icon:"icon-gongzuohuibao-bianji"},{name:"转移",id:6,icon:"icon-danchuang-zhuanyi"}],g(e).then((e=>{b.detail=e.data,b.forumMeus.length<=2&&(0===b.detail.status?b.forumMeus.push({name:"发票撤回",id:2,icon:"icon-danchuang-chehui"}):4===b.detail.status?b.forumMeus.push({name:"撤回作废",id:3,icon:"icon-danchuang-chehui"}):5===b.detail.status&&b.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:b.backgroundColor,color:b.color,"default-title":b.defaultTitle,"is-show-title":b.isShowTitle,"right-data":b.rightIcon,onHandleNarItem:k},null,8,["backgroundColor","color","default-title","is-show-title","right-data"])])),_:1}),d(f,{detail:b.detail},null,8,["detail"]),d(_,{ref_key:"dropDownRef",ref:x,"list-data":b.forumMeus,onBtnClick:w},null,8,["list-data"]),d(m,{ref_key:"textareaPopupRef",ref:D,"config-data":b.configData,onChange:z},null,8,["config-data"])])),_:1})}}},[["__scopeId","data-v-fc558a6d"]]);export{b as default};
