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-WeUkftbp.js";import{d as p}from"./index.BcUDVLb2.js";import{d as _}from"./dropDown.BqJIy245.js";import{t as m}from"./index.UoUmV3WH.js";import{i as f}from"./invoiceDetail.BZOgfIlr.js";import{c as h,ae as g,af as v}from"./customer.C_v9K5hM.js";import{d as y}from"./business.Bp32YIvd.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.cBITQXNK.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-easyinput.D5FSIQIk.js";/* empty css                                                                      */import"./uni-popup-dialog.BxVMJasy.js";import"./uni-popup.CI1Fmu1z.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BVw2wyB9.js";import"./uni-dateformat.CAFQ6hZt.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};
