From e23f6326740ff37e69c9745ea851b03684361351 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 26 Jul 2024 12:14:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E5=8E=86=E5=8F=B2=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2ui=E7=BB=98=E5=88=B6=E4=B8=8E=E4=BA=A4=E4=BA=92,?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5=EF=BC=9B?= =?UTF-8?q?=20=E6=8A=AC=E5=A4=B4=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2ui?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E4=B8=8E=E4=BA=A4=E4=BA=92=EF=BC=8C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5=EF=BC=9B=20?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E5=8F=91=E7=A5=A8=E4=BF=A1=E6=81=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2ui=E7=BB=98=E5=88=B6=E4=B8=8E=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=EF=BC=8C=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=EF=BC=9B=20=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=91=E7=A5=A8=E5=8A=A9=E6=89=8B=EF=BC=9B=20?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=9B=A0app=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=8E=9F=E5=9B=A0=EF=BC=8C=E4=B8=8D=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=80=E7=A5=A8=E9=80=89=E9=A1=B9=EF=BC=9B?= =?UTF-8?q?=20=E5=BC=80=E7=A5=A8=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5=EF=BC=8C=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=B0=83=E8=AF=95;=20=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BA=A4=E4=BA=92=E8=B0=83=E8=AF=95=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/disenable_seletor_tow.webp | Bin 0 -> 320 bytes assets/image/2x/invoice_history.webp | Bin 739 -> 486 bytes assets/image/2x/invoice_title.webp | Bin 457 -> 388 bytes assets/image/2x/tip_info.webp | Bin 0 -> 434 bytes assets/image/2x/title_del.webp | Bin 0 -> 182 bytes assets/image/2x/title_info_edit.webp | Bin 0 -> 202 bytes assets/image/3x/disenable_seletor_tow.webp | Bin 0 -> 478 bytes assets/image/3x/invoice_history.webp | Bin 1074 -> 636 bytes assets/image/3x/invoice_title.webp | Bin 552 -> 450 bytes assets/image/3x/tip_info.webp | Bin 0 -> 582 bytes assets/image/3x/title_del.webp | Bin 0 -> 214 bytes assets/image/3x/title_info_edit.webp | Bin 0 -> 250 bytes assets/image/disenable_seletor_tow.webp | Bin 0 -> 196 bytes assets/image/invoice_history.webp | Bin 400 -> 256 bytes assets/image/invoice_title.webp | Bin 294 -> 260 bytes assets/image/tip_info.webp | Bin 0 -> 282 bytes assets/image/title_del.webp | Bin 0 -> 138 bytes assets/image/title_info_edit.webp | Bin 0 -> 148 bytes lib/home/home_page.dart | 2 +- lib/main.dart | 17 + lib/mine/mine_view/mine_item.dart | 12 +- .../invoices_manage/add_invoices_title.dart | 899 ++++++++++-- .../invoices_manage/edit_invoices_info.dart | 594 ++++++++ .../invoices_manage/invoices_history.dart | 454 ++++++ .../invoices_manage/invoices_manage_page.dart | 679 +++++++++ .../invoices_manage/invoices_title_info.dart | 571 ++++++++ lib/order/order_history_page.dart | 2 + lib/retrofit/data/invoice_list.dart | 1212 +++++++++++++++++ lib/retrofit/data/invoices_history_list.dart | 385 ++++++ lib/retrofit/data/title_info_list.dart | 286 ++++ lib/retrofit/retrofit_api.dart | 32 +- lib/retrofit/retrofit_api.g.dart | 160 +++ lib/utils/status_utils.dart | 28 + 33 files changed, 5239 insertions(+), 94 deletions(-) create mode 100644 assets/image/2x/disenable_seletor_tow.webp create mode 100644 assets/image/2x/tip_info.webp create mode 100644 assets/image/2x/title_del.webp create mode 100644 assets/image/2x/title_info_edit.webp create mode 100644 assets/image/3x/disenable_seletor_tow.webp create mode 100644 assets/image/3x/tip_info.webp create mode 100644 assets/image/3x/title_del.webp create mode 100644 assets/image/3x/title_info_edit.webp create mode 100644 assets/image/disenable_seletor_tow.webp create mode 100644 assets/image/tip_info.webp create mode 100644 assets/image/title_del.webp create mode 100644 assets/image/title_info_edit.webp create mode 100644 lib/order/invoices_manage/edit_invoices_info.dart create mode 100644 lib/order/invoices_manage/invoices_history.dart create mode 100644 lib/order/invoices_manage/invoices_manage_page.dart create mode 100644 lib/order/invoices_manage/invoices_title_info.dart create mode 100644 lib/retrofit/data/invoice_list.dart create mode 100644 lib/retrofit/data/invoices_history_list.dart create mode 100644 lib/retrofit/data/title_info_list.dart diff --git a/assets/image/2x/disenable_seletor_tow.webp b/assets/image/2x/disenable_seletor_tow.webp new file mode 100644 index 0000000000000000000000000000000000000000..8301d7981bb27628604dc1f85a2b3937f77d278b GIT binary patch literal 320 zcmV-G0l)rINk&FE0RRA3MM6+kP&il$0000G0000V0018V06|PpNb3Lq00CE^q>Usv zy7+#!x9F@~LHOr-=61LrT-```ue z0q#Xa4j>tb1s7709^QfU`KfY)6{hY#>X6K`V68c1Q$)kB<{e+g{zx*?nugRl%h9!e zT;&+pAl&8{BK6c38gxl@6S+;@J-B6=zo%v4L;fCPAL-=oc`6W1?j4q{{+$}UBW(2h z+f)LOoU+j1pJ=U!0j(b?e0Kl<09H^qASM6+0MG&eodGH!03ZN9kwTnGC8MIDs0aYC S5(#Ml06n9i0RHi{H2?rM)r6n` literal 0 HcmV?d00001 diff --git a/assets/image/2x/invoice_history.webp b/assets/image/2x/invoice_history.webp index da5b9a2e347a7f4eeccf70c92c169b0e4ec7e96b..09dc454bf6cd79bb3ca367e710e31502421b31a1 100644 GIT binary patch literal 486 zcmVMNk&HA0RRA3MM6+kP&il$0000G0000h001ih06|PpNV)(300Dqn+qP@v zH1Gp7lf$tn6qTTGo1{=*{zg!YaV+5tx_Awc-4gdcxbF~UL`;DFE4nh)L{hIsMu;Mi zCDdQ2r&}iM=!-{^J{CRQGGRww1hRx8zLrNIEGTa-4_2EwF?2#)zf(Re4%=9un!wCq3UbwdX7)?s0qX(&1JnldH=qYg2tqH1{$5!*pm+fO+#TnK zEmTnF-k`L+9ji{s>t5||PN=H|@>SM17lqvmui#Ea(^ptVb(&oEr|>FCKR)FHCQP>e z+xtylP~WVY(*r?_|HwsMP9nVtM`79MX10S>f9CwIkyEU_^yJ-Rhxj%zVF}WZslz_m zp>%ndz4NlHnl%FwkBaS59Smm|sc?(AdryxXB~5G;dznj5Z&Gchh8kGE`2{Nyq~00j=$yZ`_I literal 739 zcmV<90v!E`P)8P`6o9{Tg9Hfr0Pp}X*QwN{qK?FZ#LQT(`v6Q#9k3&T zm>76~*0(b&5+kls2~}#+y)VFqkdTlV>cbG*ZBllOX9!e)4AuId#|CPp`l?O zGI?Sxwtfo!5?p372wXIJTnKxyjS#|x8KtDkO^*IuFT4`fM1;1V)5a z*c3pNgUMl77PCg(EKBCHG{SY$2-i)~B?KO1U!Hm{xVJQ;F|-XMZjATgmF%;f-*}D4 z-NuA}WEc7%{e>&dMB6}{p&Kwdalom-eUy)bAdZ$`H$^sav=vVCbN_D9Rb?%qwRwCiVhEy9l>y? zmEy(r2+>}en#0?7P4COI-EUQYyR>ji>865TviiRR2qX$;zy@#=VI5@M7=8Kc=NX=R zexjJ3F?!hFav#cglun7`z$JP07ad~;UTh;pUjg*3>kO=WJh1K-$|FH`KtE9|W@J^+ z7pVDK)}vBN{uo4Mu0Hw`QJ+9JTg!z~M za{n{zzr>f(gHZ#}1NH;cBiXPODHTHL8grYl0092iNvo`&G~-OruR=e2I&46>{}3u- zM1Nzb#rHK%$j!OLOmg$d)G;0}H1ih>9|)!VWR&rA+!Ackk1Qq(&DC4+48=0zS z3JCQ%Y{0A=h!RJKfs7z6yvBoQ(Vs=-s%7I(!vNWybuZ`M z+Tw(Z=Hi5{hYpoi`{n+-0+%eBJ6Bsc@pK|IN;5hL!8gUrUlN{jTch{z2w{lwZekZV z!cMqooN&=tZwZAv|Fz$$LdHUp4hV>LOvn}%o)9fpEElsOl4}#OgatkozDjf2i#F4; zkR_}PmhQuGKAdpT*#E<8{CPM*xj8m*9L_ob{w!Pq=xR0icz9bJo6nFdyvF~hJ&!n5 zZj(B&IhA~2)fgC@-i1D%p5u>P;W(T>pQD3wBnbS}(NLAB(A!;08)1b=AlMvP z)qt#pzZLVR;YfvENj?YBP{wuHvN;?MM*;i*QI}lBL#oi900000NkvXXu0mjfl5fUA diff --git a/assets/image/2x/tip_info.webp b/assets/image/2x/tip_info.webp new file mode 100644 index 0000000000000000000000000000000000000000..658dd6e7b961f0d43193e7ec3caa080d4741f679 GIT binary patch literal 434 zcmV;j0Zsl=Nk&Gh0RRA3MM6+kP&il$0000G0000X001EX06|PpNSXiu00Ac;5J=%> z7ZDMIgV?qj=TQV~iGVE#NQN(f^8K6QmzgMt=>G&j{8g?GjN9b31ZA5n7p1dago~|l z8Kwf@;+5)LH~>xfpbH;hI0zd%I9w9dDWxVE^KgBn=Xr)iQvlE%Z#1y{(R9mn(I1rV zYp(ot#myBkl_3CP&gp!0000G z2LPP`Dk16of8ufZIYPoH@xXY-LwFP`4_6Qg?ny{byJ{k1oUmk0o z@9!&iggi=v|NT+K$?Em2H#g}OKsngM|J}Co;K(831Bt_);ie|EKp6~>^t;TJ`O^VY zc$vm=IsN(SvEX^-N7nOD1uuSS_dz|-{{&Y04`Fcs!4J$(bU=hIuWD5YXECYi)1B0VafJYLL$EdC#;PEg`Tu_jC^^I*) z=cqGoU^vf|z&LNtzoj$U50|_AS7*5GQ*_{*i_sgybCw&^^Pl}Yuvl$J$(bU=hIuWD5YXJQz9p1bCDJd5r1`0v-?3#03SLA8+eb@r>Th zIEPUrO{?i3%Z3$Y{{nq?$N%ns@t>vO#V_s&Q$I!3=3O^e2z}gmo2zxQ)}FA6m4~uh zrz02-cAk%7T%raS^%vFNcwqL_pY{^v@5{HDRfl95TI`W!0J=v(4QTrXCWg6;S_%vb j40aP;=6Wq%ylCMH4u%avoS6&^wu=`q{QGfU>Hq@(_^wNy literal 0 HcmV?d00001 diff --git a/assets/image/3x/disenable_seletor_tow.webp b/assets/image/3x/disenable_seletor_tow.webp new file mode 100644 index 0000000000000000000000000000000000000000..d6821d647203d007c91942e9a1efb5e7876bed73 GIT binary patch literal 478 zcmV<40U`cUNk&H20RRA3MM6+kP&il$0000G0000l001ul06|PpNP__Y00D2HsF5T! zw(vy(cn}c*Ho^HNo}M7cakfp7oL8gLa)+B?xOX5gXQl%%)4&CcAv)DU1LKSvW7VVAfs#9skV8h&aVxL#{l-xh&;%KXm( z1GO~jecSupURWsGyy-wL)0~gMTLrWPM>P&kuuz3~-+`hF>cTSxHPM`MR2lpWbE$dR z9MuR5im1by#(xT~#u(cra~3|wn1N!i>%!j{hoI;-{Eu-Pa$D?$GRB)WRgCuy%Ak(% z4Sp(}w3A^UN&ArNI-4?{4SDMLcYn&H%oob;$)wEhQH`u=JnjeIYucOQA181&#c%4u zy)=Jju$JcM5x+cQ{zrDWdRdbtTwiO2OmaOATfgMNSSx~A7lGI+WMj+BxgE2%^+>X2 zi1jBN&c_;}I(@&ek9KGY09H^qAS?g?05AgpodGH^05AYPkw~9RC8Q#vBZvU75(#Ml U02_h7zq$Yb{_(XfMC>2{0Bl9nQ~&?~ literal 0 HcmV?d00001 diff --git a/assets/image/3x/invoice_history.webp b/assets/image/3x/invoice_history.webp index 237560e236585e966d86937dbcad87e39011c752..d9896b77029180f31aea65d59037589bef3c7adc 100644 GIT binary patch literal 636 zcmV-?0)zchNk&F=0ssJ4MM6+kP&il$0000G0000%002P%06|PpND2V}00EF<+qP>d zr?RRxl&T`Ofw2jSHlT87Lf#6M9SX(3M$I?`MFTP_Dp2K6i}2q4e_Q;QKZyw*-2Wm2K=Hk<#;jL4JfhNEavAX}llaco^StQ^Q0mSIaK0o*Z zw>l7jt&kGHV?WOCI(4#xFwLo$aDoUoI3}GWWG9(Y)ai8=mCOcHctn*n6v{G=|CRw( zP&gn&0RR9n2>_h|DnbB406vL4lt-l_q9HRiTmYaE31|S&NO4UNTH%}cuS5syAL|Fa zub>Su4=o>L5L}jFCDNw&QVv7V;Bgxh){(xifV};{Sxcue0092-v_JpvOAeOaL+|_y z^gZ{>)x-aRETjf_e|4u<+2`dr`AO60MIA#owaclBtGkFVu`iTk9~fURiruIX!rNlFm}gm z|9UxsBKo?<5|kDqV-F+e5W)2wNZfVz{)A0n0+VkpqmcQ*Evu>J!)A0NlgZ3b;FEBc zVOkXq-;C>+nZ(N@{;JRXn7R5!Z8+52|Qmayc=5c*2*nfE<42s5qYj$F)^}qjdrHg zUn_jqaEyC|$e*Y_IV$KEz~`$sX{o#na@&3Wt6VWAgsT27@XV+n_lB|kcs2H|hA=fx zA>4-1yO!&G*Kl|t9Mfivg=x8Uf06MLh!iqWjsXJ5HZ9lDxJQJkNphi=3q65ITuMxe z?2vGj3%xKkNz=bwhsK0xr6$_5rZ;m2TsR7?(M=Jg5g`gMkWxZaAq$jFpmc`DN}zO5 zx>WO^!cl8V3T;(1Ge%UrpqeTNaODgjOwCvuH!O#;V`zz(Ae`m z6@h5oU8I%}t<*$g-Y{qSKTta7g*A7PT0)F%k|^C_Y?FD~4`Q3?n!7~7+5@WcCek{0 z+G+_=-Yp6?`DBs@tF0@8NYxITGJiCzLj#?fuh;0_8rdtG6?zGLN<46;! z1Y`H&^!=jv;+@xb9t8Qmh_r=#AEZ6$YZU!$7=QZXLNDQ{Jw^;;o9tP0Pz;)(HF{NW z^{69C)#tx{%vRvo*H{;xxOwMk0XY$O#E!&POu78?GEvjQ*q1{aPJBofhB(l|r^$Q#Oa{VcIbv2C>Zo srL!qnqouLvl22p_ec?2Ee@hGXaBfwC<~YzanA+@TclY(Oh!s=0Xb5=196plJpe@$v=nt zO_F4+(0wjlBe}sKNz(rqqLm~WD|DaB^&+{!AW71{RdwtQAR?-BaOcT`d>LhL0Hu_3 zD83=OHs?Z#MVCoi0!$PC%vMl1AQS-r0B{KaodGIB073vhi9D1?r6ZytG58Evpb-gV z0L*oaZX5bRqyx+c>CdfpnopnymS3~b5#5nr+=Ye`%Hvf#BKU0w&1nsX+r2mOBEyK^ zF^EA+fB^pR+86)(Z24;m@;~OPa%ouaxFz}a_hnE|i9*1I@x{DfUtz#YqyWKpoivY^ z`Pg!WmO={8@~`6U1R#MVekUwPSsz?r%;mp@J+Sx`G_cPd22T4)sPoFg);yM5T0JP7}UjP6A literal 552 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|1|%PcFuVX#EX7WqAsj$Z!;#X#z`%Il)5S5Q zV$R!Jwn2vt1Xv$zZ`@qK;Ow6vxnOzMB?D()&&Hjs_O4U38En_BP>5+{zHo7~NKQ}g znhBB zm>2Aj|E+Z8zj*3B*57Og=he44O0XqLv?K~Z8Jzn9Rz9%#{7yC1(6e)0`0R%Y4O@R) z{UbL=O3gxvp+aL`km#fq1^&`j@z}0Re(~7Kn*o(8z7=Mnnvy7>_QUC`R@IcBAL~vf zJ-Xa~I8{8h;msAh8^u6_Y?MUG1uFd_yqR{1zl!|gfBoa$*&>0jUV1#cdpzd(qSdm^ z20VuhI1VeES#)2=d#1cB!;Rk1BWHY1zd!fqMOEFJ15X#vjyt+5|7wuqp2>49RA2Z$ zw!5w2zAEn6&gbcKq|#mrDjtZOBedk^t{L*nV_xcr0`=FVdQ&MBb@05 z7ZDMIgW7i6=35DXE&w{N0CX5YB8xw%MB}ssBKki8@GqaQeLEq2dE0rV`v zx3~n@vgBz>oR{U7GcAx4wn{pvM_})9uo45nMFea`4?v3sVAYL(Z`sOLEqizZ034CJ zF`dz=%4}pT+G24^%(C$ZqIG-SR<^#%=<<8OED~TZS^*9$Ap#KE0sydka-E(W*bCDE zS|B)m6)b1al)&W_dC*B_yGs8i4b%S-l;;Mey| z0$3oN`tQOYS|vydo|&pYYybfM;IBCQb}R_$K5WGxdYGXg?UT!xMXvDm*8AX60ga9d zU%;Q~0sQQ;W?YIBG0>C|c~{b;f4H~cmj8MKJ*PMkU&j3#XEp23>-7cS|Mw-1%;5?h z@k`(QB5{X1|Ab9X`EvchiqCo-M>UT`GX+}T9F#j-e*V?i^X9hRev*j!m!QY@{~#A1 z!iTCdrl%I@{aW+mj7Y@3gkvMl1W3)18@RWhC|!RDB+9`Zcdz{OYh0NQ`ZaWKT78hs zZAVjA*NovO3-e5Rujt>Lr;**%Phm4eFNwdQZ9C#`=vtV+O;r#W6F0ImB7nE(I) literal 0 HcmV?d00001 diff --git a/assets/image/3x/title_del.webp b/assets/image/3x/title_del.webp new file mode 100644 index 0000000000000000000000000000000000000000..7e4ec00d4a83f6d858a9500c665cfa423ca0f05a GIT binary patch literal 214 zcmV;{04e`cNk&G_00012MM6+kP&il$0000G0000i001ul06|PpNPYkS00Ac;5J=%> z7ZDMItJ=1eYF`O}1<(LI32|UrUs8)be0Gukzy$G?6Epn+YuOdaTkkgp! zIU~wq9UDsiB8D;VCjbCeP&gne0000m0|1=?DlGso06vjOpG&2rBB7&*0I(7XX#fBl QfxSKs0092@&iyC=0QR&^bN~PV literal 0 HcmV?d00001 diff --git a/assets/image/3x/title_info_edit.webp b/assets/image/3x/title_info_edit.webp new file mode 100644 index 0000000000000000000000000000000000000000..be3d202233886cd47afa0380b197bdcf44658edc GIT binary patch literal 250 zcmWIYbaVT}z`zjh>J$(bU=hIuWD5YXJ{URr1b8e2@)*?>1Uw$5i39 z_A3Is;>{{td1=O*XI?*)owzk=>!U5twxn%I+;TC0_5EqrHH$u1<=xryzxz(rf3M|1 z%O|Z{w)$k*iKw`p^9-*y`xh|Q-#hw1;-~ct8RL54ol?y*ZnKmheX(KCxyQr+bi0BU y(4_{<409Q^3>XX;>?V55_g=b0Y2o4yh7CfTnG6iljeG6*7#RNjIQLhBfdK&L^I+5f literal 0 HcmV?d00001 diff --git a/assets/image/disenable_seletor_tow.webp b/assets/image/disenable_seletor_tow.webp new file mode 100644 index 0000000000000000000000000000000000000000..99ea086eb3073c0ce33c80b851cc381e5f13bb53 GIT binary patch literal 196 zcmWIYbaUIoz`zjh>J$(bU=hIuWD5W>KNvas1bEZ|d5rE07UW8sMX~8NZ5Es%CfI2D ze@mP6?QL_P9O_b?aatzI%G+p)0rO_Q#!GJ`Et)%C{Fm`Kxpk9@>-Wkp8<%XB{5Dl{ zla$1}weA1g%eI}(V%U9R9>e6t-`Q@+UXSfBHNUx&ZNuj9_xx)gy81C6J`uERgT3yO t6`P*fdk1~lsiz8bmx2V)6$Xq9a~ZV+fbL^rFi~B?z+Axa@4E~G0|5UcNrV6Z literal 0 HcmV?d00001 diff --git a/assets/image/invoice_history.webp b/assets/image/invoice_history.webp index ad1ea94115a969a7775c0dc2dc82360c62d19e27..806d3da6649a474ad9f9ea6f7d6800df6b5ad5d0 100644 GIT binary patch literal 256 zcmWIYbaVT`z`zjh>J$(bU=hIuWD5YXC>S~V1bCzYd5i_Z43if3ELnddk>>#mV~sh} ziULRf{cHvwi~F7n%0DySoxIFG@k~5V`=u18v>*-! z<&!_Y=%{i$NV3mc{?&eq1NY&NRsYzz*gt;mzI3=jN%^8P(0+v+pluVF8Rjx-i7|*V z*iCep;kk72B1H|Z6&r*&vl!+YUCQrc+Rap5!SL_&)(>p2&Hqe1<{|pwxtWdQmxQ^x zcOJ_cW?MWv7*po-e8Ml*iT^pR)qd?iz3%t_3%hID=QV72mGx;O#~ zBxB_)P{%`I69q^lBd0=4y?Q%4y9@ssWB_sH(zTHv1Spnm=8GeM&R77oiRE-MInaXv zLQyuEuct8M%B3Cs3|+YfU-cXtwm3SJ`b-hf9FPiA^--28cz<4}~Hv4|>H zz_4v`%aC~|63iZCIupUwXva!@<2j3n|-Yp6pp`l>3Ut uN=9Okw$5AcSd=o7sbGLW%nrf%L;3(toQhTW-m6>y0000J$(bU=hIuWD5YXC>S~V1bBo1d5j6dp4+Be{FqzA?9Xd8k5|b> z;Q=QDzssKv4rcQ|!457y47yj87anrl6H!?EXUCz19}hFJe@v3BsWCq+_-MN<-=m{N zJ`d+UsQc;vN8Wp7!!d4O7NBhkO+d3hFf+_$)DmM5W3ZcOGQ)l8qD2c0BzPD$2yx~x z%r%x=e>|m&rFKr-1cra7*D%#G?9t);wZ4A-%N4Onm-R2)|Gs&3_XWw2Fx{}abdg{4 zAK&|KFV=p<{qX*l3N!E7EgyL1)|*_q92M}d?y%#k8`FCOS?7zmlwPr_pJ9Jt<&V6- IE*lsa05}wAOaK4? literal 294 zcmV+>0oneEP)j%F58{VF0>dLr$N>Mu5CE9MdJtxB5e4($*r$=711|`!EwosLDkD%{gCTO(!XRo1aH+w;vDdos@w&iwdOYrHu?mtCs9l2rT5Dkd zt+*a~Y&p}aU-=;E{O^O?V sf?aUz?-R`w)@#uO*d82jwa$;_3fUb#9=}^FLI3~&07*qoM6N<$f+~-DAOHXW diff --git a/assets/image/tip_info.webp b/assets/image/tip_info.webp new file mode 100644 index 0000000000000000000000000000000000000000..74d08e03440e257c06e4dd57413c9cf21902a1d2 GIT binary patch literal 282 zcmV+#0p00Ac;5J=%> z7ZDMIgEo>JsV)GB08WqK!VvhG;!kRCIYjh-0$_RL2e6d718F<5sE;088kYv?_mKLQ zI+YGrqee4VXX=gr-t`qMYU%-LJHk@x4sbrP16EKtAd~odGHl01*H_kvf@3 zrK2LDFc=5`uo4Mu0J|>&davRKAVvUtfd2u}|DXT40k{F%{shK!@BsecxqV?wd%yoQ zFCEkS)za-TL>x&1(#<82<>YpRwLwe`D`mgkhO)!ADHkQ&D4g$W$;JBLo`n2VrbO^& gVRRW{8JJ-M=^*!!=hD0${0)p=@E_muHoyP?0C@jK1 z8Ft2;#0QfZCNX9GU9Du*@!~&=!^eY5S$jlJg+*bVmFmoOQu@hs&QZ%ZEZ1?+;Y6pWA(=GMp{cZ$*n` s5@WfGtz^yoEet?=6eNJA8Za`I0Kus%xc~qF literal 0 HcmV?d00001 diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index f785bee2..9498e6b6 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -582,7 +582,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ), autoplay: true, duration: 1000, - autoplayDelay: 2000, + autoplayDelay: 100000, physics: BouncingScrollPhysics(), itemBuilder: (context, position) { return InkWell( diff --git a/lib/main.dart b/lib/main.dart index 9c99f38d..301c616f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -169,6 +169,12 @@ import 'mine/personal_page.dart'; import 'order/exchange_write_off_page.dart'; import 'mine/release_page.dart'; import 'mine/roll_center_page.dart'; +import 'order/invoices_manage/add_invoices_title.dart'; +import 'order/invoices_manage/edit_invoices_info.dart'; +import 'order/invoices_manage/invoices_history.dart'; +import 'order/invoices_manage/invoices_manage_page.dart'; +import 'order/invoices_manage/invoices_title_info.dart'; + void main() async { if (Platform.isAndroid) { @@ -577,4 +583,15 @@ Map routers = { ServicePurchaseRecord(arguments:arguments), '/router/set_goods_specs_value': (context, {arguments}) => SetGoodsSpecsValue(arguments:arguments), + '/router/invoices_manage_page': (context, {arguments}) => + InvoicesManagePage(), + '/router/invoices_title_info': (context, {arguments}) => + InvoicesTitleInfo(arguments:arguments), + '/router/add_invoices_title': (context, {arguments}) => + AddInvoicesTitle(arguments:arguments), + '/router/invoices_history': (context, {arguments}) => + InvoicesHistory(), + '/router/edit_invoices_info': (context, {arguments}) => + EditInvoicesInfo(arguments:arguments), + }; diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 066ba56c..26ee261f 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -351,9 +351,17 @@ class _MineItem extends State { ), ), - ///商家管理 + ///发票助手 Expanded( - child: Container(), + child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/invoices_manage_page'); + }, + child: mineItem( + S.of(context).fapiaozhushou, + "assets/image/bill_gl.webp", + ), + ), ), Expanded( child: Container(), diff --git a/lib/order/invoices_manage/add_invoices_title.dart b/lib/order/invoices_manage/add_invoices_title.dart index ec600fb4..1bd65a6f 100644 --- a/lib/order/invoices_manage/add_invoices_title.dart +++ b/lib/order/invoices_manage/add_invoices_title.dart @@ -3,130 +3,849 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:intl/intl.dart'; -import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:shimmer/shimmer.dart'; +import '../../retrofit/data/title_info_list.dart'; import '../../generated/l10n.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/retrofit_api.dart'; +import '../../utils/flutter_utils.dart'; import '../../utils/font_weight.dart'; -import '../../view_widget/classic_header.dart'; +import '../../view_widget/border_text.dart'; import '../../view_widget/my_appbar.dart'; -import '../../view_widget/my_footer.dart'; -import '../../view_widget/no_data_view.dart'; -class InvoicesManagePage extends StatefulWidget { +class AddInvoicesTitle extends StatefulWidget { + final Map arguments; + + AddInvoicesTitle({this.arguments}); + @override State createState() { - return _InvoicesManagePage(); + return _AddInvoicesTitle(); } } -class _InvoicesManagePage extends State { +class _AddInvoicesTitle extends State { + bool isKeyBoardShow = false; + FocusNode _focusNode = FocusNode(); + final TextEditingController editNameController = TextEditingController(); + final TextEditingController editDutyCodeController = TextEditingController(); + final TextEditingController editAddressController = TextEditingController(); + final TextEditingController editPhoneController = TextEditingController(); + final TextEditingController editBankController = TextEditingController(); + final TextEditingController editAccountController = TextEditingController(); + int titleType; + ApiService apiService; + String userId; + String titleName; + Records records; @override void initState() { super.initState(); - // _onRefresh(); + titleName = widget?.arguments["titleName"] ??""; + records = widget.arguments["records"]; + titleType = ((widget.arguments["titleType"] == 1) ? 1 : 0) ?? 0; + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + print("object: ${MediaQuery.of(context).viewInsets.bottom}"); + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + isKeyBoardShow = false; + //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 + FocusScope.of(context).requestFocus(FocusNode()); + } + } else { + isKeyBoardShow = true; + } + }); + }); } ///离开页面记着销毁和清除 @override void dispose() { + _focusNode.unfocus(); super.dispose(); } + ///添加抬头信息 + addInvoiceHeaders() async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + userId = value.getString('userId'); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService.invoiceHeader({ + "bank": editBankController.text == "" ? (records?.bank??"") : editBankController.text, //开户银行 + "bankNumber": editAccountController.text == "" ? (records?.bankNumber??"") : editAccountController.text, //开户账号 + "companyAddr":editAddressController.text == "" ? (records?.companyAddr??"") : editAddressController.text, //单位地址 + "companyPhone":editPhoneController.text == "" ? (records?.companyPhone??"") : editPhoneController.text, //单位电话 + "id": "", //修改信息时传修改id + "isDefault": 1, //是否默认 + "isDelete": 0, //逻辑删除 + "name": editNameController.text == "" ? (records?.name??"") : editNameController.text, //名称 + "taxId": editDutyCodeController.text == "" ? (records?.taxId??"") : editDutyCodeController.text, //税号 + "type": titleType == 0 ? "PERSONAL" : "COMPANY", //抬头类型 + "userId": userId, //所属用户ID + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + }); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(); + Future.delayed(Duration(milliseconds: 500), () { + SmartDialog.showToast("添加抬头信息成功", alignment: Alignment.center); + }); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + EasyLoading.dismiss(); + } + } + + ///编辑抬头信息 + editInvoiceHeaders() async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + userId = value.getString('userId'); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService.invoiceHeaders({ + "bank": editBankController.text == "" ? (records?.bank??"") : editBankController.text, //开户银行 + "bankNumber": editAccountController.text == "" ? (records?.bankNumber??"") : editAccountController.text, //开户账号 + "companyAddr":editAddressController.text == "" ? (records?.companyAddr??"") : editAddressController.text, //单位地址 + "companyPhone":editPhoneController.text == "" ? (records?.companyPhone??"") : editPhoneController.text, //单位电话 + "id": records?.id ?? "", //修改信息时传修改id + "isDefault": 1, //是否默认 + "isDelete": 0, //逻辑删除 + "name": editNameController.text == "" ? (records?.name??"") : editNameController.text, //名称 + "taxId": editDutyCodeController.text == "" ? (records?.taxId??"") : editDutyCodeController.text, //税号 + "type": titleType == 0 ? "PERSONAL" : "COMPANY", //抬头类型 + "userId": userId, //所属用户ID + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center);}); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(1); + Future.delayed(Duration(milliseconds: 500), () { + SmartDialog.showToast("编辑抬头信息成功", alignment: Alignment.center); + }); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + EasyLoading.dismiss(); + } + } + @override Widget build(BuildContext context) { - return Scaffold( - resizeToAvoidBottomInset: false, - appBar: MyAppBar( - title: "添加抬头", - titleColor: Colors.black, - background: Colors.white, - leadingColor: Colors.black, - ), - body: - // networkStatus == -1 ? noNetwork() : - Column( - crossAxisAlignment: CrossAxisAlignment.start, + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + appBar: MyAppBar( + title: titleName??"", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: Container( + color: Colors.white, + margin: EdgeInsets.only(top: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "请填写抬头信息:", - style: TextStyle( - color: Color(0xFF000000), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 16.h), + child: Text( + "请填写抬头信息", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 16.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 13.w), + child: Text( + "抬头类型", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ), + Padding( + padding: EdgeInsets.only(right: 8.w), + child: InkWell( + child: BorderText( + text: "个人", + textColor: titleType == 0 + ? Color(0xff32A060) + : Color(0xff181818), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + borderColor: titleType == 0 + ? Color(0xff32A060) + : Color(0xffE6E6E6), + radius: 2, + padding: EdgeInsets.symmetric( + vertical: 6.h, horizontal: 13.w), + borderWidth: 1, + ), + onTap: () { + setState(() { + titleType = 0; + }); + }, + ), + ), + InkWell( + child: BorderText( + text: "单位", + textColor: titleType == 1 + ? Color(0xff32A060) + : Color(0xff181818), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + borderColor: titleType == 1 + ? Color(0xff32A060) + : Color(0xffE6E6E6), + radius: 2, + padding: EdgeInsets.symmetric( + vertical: 6.h, horizontal: 13.w), + borderWidth: 1, + ), + onTap: () { + setState(() { + titleType = 1; + }); + }, + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + Row( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFBC161C), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "名称 ", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: FontWeight.w800, + ), + ), + ], + ), + ), + Expanded( + child: TextField( + controller: editNameController, + decoration: InputDecoration( + hintText: records?.name ?? (titleType == 0 + ? "建议填写个人姓名(必填)" + : "单位名称(必填)"), + hintStyle: TextStyle( + color: ((records?.name??"") == "") ? Color(0xFFACACAC) : Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16.w), + ), + style: TextStyle( + color:Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + if (titleType == 1) + Column( + children: [ + Row( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFBC161C), + fontSize: 14.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "税号 ", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: FontWeight.w800, + ), + ), + ], + ), + ), + Expanded( + child: TextField( + controller: editDutyCodeController, + decoration: InputDecoration( + hintText: records?.taxId ?? "纳税人识别号(必填)", + hintStyle: TextStyle( + color: ((records?.taxId??"") == "") ? Color(0xFFACACAC) : Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: + EdgeInsets.only(left: 16.w), + ), + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + Row( + children: [ + Text( + "单位地址", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Expanded( + child: TextField( + controller: editAddressController, + decoration: InputDecoration( + hintText: records?.companyAddr ?? "请输入单位地址", + hintStyle: TextStyle( + color: ((records?.companyAddr??"") == "") ? Color(0xFFACACAC) : Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: + EdgeInsets.only(left: 16.w), + ), + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + Row( + children: [ + Text( + "单位电话", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Expanded( + child: TextField( + controller: editPhoneController, + decoration: InputDecoration( + hintText: records?.companyPhone ?? "请输入单位电话", + hintStyle: TextStyle( + color: ((records?.companyPhone??"") == "") ? Color(0xFFACACAC) : Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: + EdgeInsets.only(left: 16.w), + ), + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + Row( + children: [ + Text( + "开户银行", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Expanded( + child: TextField( + controller: editBankController, + decoration: InputDecoration( + hintText: records?.bank ?? "请输入开户银行", + hintStyle: TextStyle( + color: ((records?.bank??"") == "") ? Color(0xFFACACAC) : Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: + EdgeInsets.only(left: 16.w), + ), + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + Row( + children: [ + Text( + "开户账号", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Expanded( + child: TextField( + controller: editAccountController, + decoration: InputDecoration( + hintText: records?.bankNumber ?? "请输入开户账号", + hintStyle: TextStyle( + color: ((records?.bankNumber??"") == "") ? Color(0xFFACACAC) : Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + border: InputBorder.none, + contentPadding: + EdgeInsets.only(left: 16.w), + ), + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ) + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + ], + ) + ], + ), ), - ) + )), + GestureDetector( + onTap: () { + if (editNameController.text == "" && ((records?.name ??"") == "")) { + SmartDialog.showToast("请输入名称", + alignment: Alignment.center); + return; + } else if (titleType == 1 && + editDutyCodeController.text == ""&& ((records?.taxId ??"") == "")) { + SmartDialog.showToast("请输入税号", + alignment: Alignment.center); + return; + } else { + if(titleName == "编辑抬头"){ + editInvoiceHeaders(); + }else{ + addInvoiceHeaders(); + } + } + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 20.h), + color: Color(0xff32A060), + width: double.infinity, + alignment: Alignment.center, + child: Text( + S.of(context).baocun, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), ], ), - ); + ), + )); } - Widget invoicesOrderItemSm() { - return Container( - padding: EdgeInsets.only(top: 12, bottom: 12, left: 16), - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 6), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x0F06152E), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ) - ], - borderRadius: BorderRadius.circular(8), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Shimmer.fromColors( - baseColor: Color(0XFFD8D8D8), - highlightColor: Color(0XFFD8D8D8), + Widget addInvoiceTitleSm() { + return Column( + children: [ + Expanded( child: Container( - margin: EdgeInsets.only(bottom: 16), - decoration: BoxDecoration( - color: Color(0XFFD8D8D8), - borderRadius: BorderRadius.circular(2), - ), - width: 149, - height: 20, + padding: EdgeInsets.only(top: 12, bottom: 12, left: 16), + margin: EdgeInsets.only(top: 12.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom: 16), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 162, + height: 22, + ), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 12), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 59, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 54, + height: 28, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 54, + height: 28, + ), + ), + ]), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 8.h, bottom: 16.h), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 61, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 134, + height: 20, + ), + ), + ]), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 12.h, bottom: 16.h), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 61, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 134, + height: 20, + ), + ), + ]), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 12.h, bottom: 16.h), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 61, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 134, + height: 20, + ), + ), + ]), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 12.h, bottom: 16.h), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 61, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 134, + height: 20, + ), + ), + ]), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 12.h, bottom: 16.h), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 61, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 8.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 134, + height: 20, + ), + ), + ]), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xffF4F4F4), + margin: EdgeInsets.only(top: 12.h, bottom: 16.h), + ), + ], + ))), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), ), + width: double.infinity, + height: 54, ), - Row( - children: [ - Shimmer.fromColors( - baseColor: Color(0XFFD8D8D8), - highlightColor: Color(0XFFD8D8D8), - child: Container( - margin: EdgeInsets.only(right: 10), - decoration: BoxDecoration( - color: Color(0XFFD8D8D8), - borderRadius: BorderRadius.circular(2), - ), - width: 42, - height: 20, - ), - ), - Shimmer.fromColors( - baseColor: Color(0XFFD8D8D8), - highlightColor: Color(0XFFD8D8D8), - child: Container( - decoration: BoxDecoration( - color: Color(0XFFD8D8D8), - borderRadius: BorderRadius.circular(2), - ), - width: 60, - height: 20, - ), - ), - ], - ) - ], - ), + ), + ], ); } - } diff --git a/lib/order/invoices_manage/edit_invoices_info.dart b/lib/order/invoices_manage/edit_invoices_info.dart new file mode 100644 index 00000000..1cb53bed --- /dev/null +++ b/lib/order/invoices_manage/edit_invoices_info.dart @@ -0,0 +1,594 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../generated/l10n.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/data/user_info.dart'; +import '../../retrofit/retrofit_api.dart'; +import '../../utils/flutter_utils.dart'; +import '../../utils/font_weight.dart'; +import '../../view_widget/my_appbar.dart'; + +class EditInvoicesInfo extends StatefulWidget { + final Map arguments; + + EditInvoicesInfo({this.arguments}); + + @override + State createState() { + return _EditInvoicesInfo(); + } +} + +class _EditInvoicesInfo extends State { + bool isKeyBoardShow = false; + FocusNode _focusNode = FocusNode(); + String selectPrice; + String headerId = ""; + String phone = ""; + String name = ""; + ApiService apiService; + Map invoicesInfo; + String mobile; + final TextEditingController editPhoneController = TextEditingController(); + List ids; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + print("object: ${MediaQuery.of(context).viewInsets.bottom}"); + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + isKeyBoardShow = false; + //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 + FocusScope.of(context).requestFocus(FocusNode()); + } + } else { + isKeyBoardShow = true; + } + }); + }); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), + context: context, token: value.getString('token'),), + setState(() { + mobile = value.getString('mobile'); + }) + }); + selectPrice = widget?.arguments["selectPrice"] ?? ""; + ids = widget?.arguments["ids"] ?? []; + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + _focusNode.unfocus(); + } + + ///提交发票审核 + submitInvoiceReview() async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + BaseData baseData = await apiService.invoiceSubmit({ + "headerId": headerId, //选择的抬头id + "isDelete": 0, + "money": selectPrice, //开票金额 + "orderIds": ids, //开票的订单id数组 + "ossId": 0, + "phone": phone, //抬头保存的号码 + "reason": "", + "reviewerBy": 0, + "reviewerTime": "", + "state": 0, + "type": 1, + "receivingPhone": editPhoneController.text == "" ? mobile :editPhoneController.text, //申请人手机号码 + }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + }); + if (baseData != null && baseData.isSuccess) { + Navigator.of(context).pop(1); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + EasyLoading.dismiss(); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + appBar: MyAppBar( + title: "填写发票信息", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: // networkStatus == -1 ? noNetwork() : + Container( + margin: EdgeInsets.only(top: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ///业务流程需求暂时用不到 + // Container( + // padding: EdgeInsets.only( + // top: 12.h, bottom: 12.h, left: 12.w, right: 10.w), + // margin: EdgeInsets.only(bottom: 12.h), + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(6), + // boxShadow: [ + // BoxShadow( + // color: Color(0x0F06152E), + // offset: Offset(0, 2), + // blurRadius: 4, + // spreadRadius: 0, + // ) + // ], + // ), + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.only(top: 5.h), + // child: Image.asset( + // "assets/image/tip_info.webp", + // width: 17.h, + // height: 17.h, + // fit: BoxFit.fill, + // ), + // ), + // Padding( + // padding: EdgeInsets.only(left: 5.w), + // child: Text( + // "失败原因:已经开具过纸质发票,不能重复开具\n电子发票", + // style: TextStyle( + // letterSpacing: 0.5, + // height: 1.5, + // color: Color(0xFF32A060), + // fontSize: 14.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ) + // ], + // ), + // ), + Container( + padding: + EdgeInsets.only(top: 16.h, bottom: 16.h, left: 18.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "发票抬头", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Padding( + padding: EdgeInsets.only(top: 16.h, bottom: 18.h), + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(right: 31.w), + child: Text( + "发票类型", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + "电子发票", + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ), + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + Navigator.of(context) + .pushNamed('/router/invoices_title_info',arguments:{ + "enterType":0, + }) + .then((value) { + if(value != null){ + invoicesInfo = value; + headerId = (value as Map)['id']; + phone = (value as Map)['phone']; + name = (value as Map)['name']; + setState(() {}); + } + }); + }, + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(right: 31.w), + child: Text( + "发票抬头", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Expanded( + child: Text( + name == "" ? "请选择" : name, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Padding( + padding: EdgeInsets.only(right: 21.w), + child: Icon(Icons.arrow_forward_ios, + color: Color(0xFF181818), + size: 14.sp)) + ], + )) + ], + ), + ), + Container( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 17.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + "开票金额", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Padding( + padding: EdgeInsets.only(right: 6.w), + child: Text( + "可开票金额", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Text( + "${selectPrice ?? "0"}元", + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ) + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "发票接收", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Expanded( + child: TextField( + controller: editPhoneController, + decoration: InputDecoration( + hintText: mobile, + hintStyle: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + hintTextDirection: TextDirection.rtl, + border: InputBorder.none, + contentPadding: + EdgeInsets.only(left: 16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + ), + ], + ), + ), + ], + ), + ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap:(){ + if(name == ""){ + SmartDialog.showToast("请选择发票抬头", + alignment: Alignment.center); + }else{ + submitInvoiceReview(); + } + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 20.h), + color: Color(0xff32A060), + width: double.infinity, + alignment: Alignment.center, + child: Text( + "确认提交", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + ], + ), + ), + )); + } + + Widget editInvoicesInfoSm() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 18.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 62, + height: 20, + ), + ), + Padding( + padding: EdgeInsets.only(top: 16.h, bottom: 18.h), + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 31.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58, + height: 20, + ), + ), + ], + ), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 31.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 140, + height: 20, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 21.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 14, + height: 14), + ), + ], + ) + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 17.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58, + height: 20, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 6.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 70, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 31, + height: 20, + ), + ), + ], + ), + ), + ], + ); + } +} diff --git a/lib/order/invoices_manage/invoices_history.dart b/lib/order/invoices_manage/invoices_history.dart new file mode 100644 index 00000000..54dac85e --- /dev/null +++ b/lib/order/invoices_manage/invoices_history.dart @@ -0,0 +1,454 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:intl/intl.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../generated/l10n.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/data/invoices_history_list.dart'; +import '../../retrofit/retrofit_api.dart'; +import '../../utils/flutter_utils.dart'; +import '../../utils/font_weight.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_appbar.dart'; +import '../../view_widget/my_footer.dart'; +import '../../view_widget/no_data_view.dart'; + +class InvoicesHistory extends StatefulWidget { + @override + State createState() { + return _InvoicesHistory(); + } +} + +class _InvoicesHistory extends State { + final RefreshController refreshController = RefreshController(); + ApiService apiService; + String networkError = ""; + int networkStatus = 0; + List records = []; + int _current = 1; + Map> _map = {}; + String _timeList; + + @override + void initState() { + super.initState(); + _onRefresh(); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + ///开票列表 + queryInvoiceList() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, + token: value.getString("token"), + showLoading: false); + } + BaseData baseData = await apiService.invoicePage({ + "current": _current, + "size": 10, + "searchKey": "", + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records.addAll(baseData?.data?.records ?? []); + (baseData?.data?.records ?? []).forEach((element) { + if(_map.containsKey((element.reviewerTime ?? element.createTime).toString().substring(0,7))){ + _map[(element.reviewerTime ?? element.createTime).toString().substring(0,7)].add(element); + }else{ + _map[(element.reviewerTime ?? element.createTime).toString().substring(0,7)] = [element]; + } + }); + _timeList = _map.keys.toList().first; + if ((baseData?.data?.records ?? []).isEmpty || + records.length.toString() == baseData.data.total) + refreshController.loadNoData(); + else + refreshController.loadComplete(); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + _onRefresh({bool isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + await queryInvoiceList(); + EasyLoading.dismiss(); + if (!mounted) return; + if (refreshController.isRefresh) refreshController.refreshCompleted(); + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + appBar: MyAppBar( + title: "开票历史", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: + networkStatus == -1 ? noNetwork() : + Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: records.length == 0 ? false : true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + }, + onLoading: () { + _current++; + _onRefresh(isShowLoad: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + child: networkStatus == 0 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom: 16.h,top: 16.h,left: 17.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 70.w, + height: 20.h, + ), + ), + Expanded(child: ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: invoicesHistoryListSm(), + ); + }, + )), + ], + ) + : + ((records == null || records.length == 0) + ? NoDataView( + src: "assets/image/bs_no data_logo.webp", + isShowBtn: false, + text: "暂无商品分类", + fontSize: 16, + margin: EdgeInsets.all(20), + ) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 17.w), + child: Text( + _timeList.toString(), + style: TextStyle( + color: Color(0xff1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Expanded(child: ListView.builder( + itemCount: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: invoicesHistoryList(records[position]), + ); + }, + )) + ], + )),), + ), + ), + ); + } + + Widget invoicesHistoryList(Records records) { + return Container( + padding: EdgeInsets.symmetric(vertical: 14.h, horizontal: 12.w), + margin: EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + records?.invoiceHeaderName ?? "", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + )), + Text( + invoicesStatus(records?.state ?? ""), + style: TextStyle( + color: Color(0xff32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ) + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 16.w), + child: Text( + "¥${records?.money ?? ""}", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + )), + Expanded( + child: Text( + "电子普票", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + records?.reviewerTime ?? records?.createTime ?? "", + style: TextStyle( + color: Color(0xff4D4D4D), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ) + ], + ) + ], + ), + ); + } + + ///发票状态 + String invoicesStatus(state) { + if (state == "UN_AUDIT") { + return "待审核"; + } else if (state =="AUDIT_PASS") { + return "开票成功"; + } else if (state =="AUDIT_VOID") { + return "已作废"; + }else if (state =="AUDIT_FAIL") { + return "开票失败"; + } + } + + Widget invoicesHistoryListSm() { + return Container( + padding: EdgeInsets.symmetric(vertical: 14.h, horizontal: 12.w), + margin: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 24), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 180.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 25), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 42.w, + height: 20.h, + ), + ), + ], + ), + SizedBox( + height: 25.h, + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 20), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 47.w, + height: 20.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 56.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 25), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 80.w, + height: 20.h, + ), + ), + ], + ), + ], + ), + ); + } + + Widget noNetwork() { + return Container( + margin: EdgeInsets.only(top: 120.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + // "无法连接到网络", + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _onRefresh(); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } +} diff --git a/lib/order/invoices_manage/invoices_manage_page.dart b/lib/order/invoices_manage/invoices_manage_page.dart new file mode 100644 index 00000000..1a5b45a0 --- /dev/null +++ b/lib/order/invoices_manage/invoices_manage_page.dart @@ -0,0 +1,679 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../generated/l10n.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/data/invoice_list.dart'; +import '../../retrofit/retrofit_api.dart'; +import '../../utils/flutter_utils.dart'; +import '../../utils/font_weight.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_appbar.dart'; +import '../../view_widget/my_footer.dart'; +import '../../view_widget/no_data_view.dart'; +import '../../view_widget/settlement_tips_dialog.dart'; + +class InvoicesManagePage extends StatefulWidget { + @override + State createState() { + return _InvoicesManagePage(); + } +} + +class _InvoicesManagePage extends State { + final RefreshController refreshController = RefreshController(); + ApiService apiService; + String networkError = ""; + int networkStatus = 0; + int _pageNum = 1; + var allCheckIndex = false; + List records = []; + List unRecords = []; + + @override + void initState() { + super.initState(); + _onRefresh(); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + ///开票列表 + queryInvoiceList() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, + token: value.getString("token"), + showLoading: false); + } + BaseData baseData = await apiService.invoiceOrderList({ + "current": _pageNum, + "size": 10, + "searchKey": "", + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records.addAll(baseData?.data?.records ?? []); + baseData.data.records.forEach((element) { + if (double.tryParse(element?.payedPrice ?? "") > 0) + unRecords.add(element); + }); + if ((baseData?.data?.records ?? []).isEmpty || + records.length.toString() == baseData.data.total) + refreshController.loadNoData(); + else + refreshController.loadComplete(); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + _onRefresh({bool isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + await queryInvoiceList(); + EasyLoading.dismiss(); + if (!mounted) return; + if (refreshController.isRefresh) refreshController.refreshCompleted(); + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + appBar: MyAppBar( + title: "发票管理", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: networkStatus == -1 + ? noNetwork() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 15.h, bottom: 10.h), + margin: EdgeInsets.only(bottom: 12.h), + child: Row( + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + Navigator.of(context) + .pushNamed('/router/invoices_title_info',arguments:{ + "enterType":1, + }); + }, + child: Column( + children: [ + Image.asset( + "assets/image/invoice_title.webp", + width: 26.h, + height: 26.h, + fit: BoxFit.fitWidth, + ), + Padding( + padding: EdgeInsets.only(top: 7.6.h), + child: Text( + "抬头管理", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + ) + ], + ), + )), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + Navigator.of(context) + .pushNamed('/router/invoices_history'); + }, + child: Column( + children: [ + Image.asset( + "assets/image/invoice_history.webp", + width: 26.h, + height: 26.h, + fit: BoxFit.fitWidth, + ), + Padding( + padding: EdgeInsets.only(top: 7.6.h), + child: Text( + "开票历史", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + ) + ], + ))), + ], + ), + ), + Padding( + padding: EdgeInsets.only(left: 14.w, bottom: 6.h), + child: Text( + "可开票订单", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.left, + ), + ), + Expanded( + child: Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp:records.length == 0 ? false :true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _pageNum = 1; + records.clear(); + unRecords.clear(); + _onRefresh(isShowLoad: false); + }, + onLoading: () { + _pageNum++; + _onRefresh(isShowLoad: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + child: networkStatus == 0 + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: invoicesOrderItemSm(), + ); + }, + ) + : ((records == null || records.length == 0) + ? NoDataView( + src: "assets/image/ding_dan.webp", + isShowBtn: false, + text: "暂无可开票的订单", + fontSize: 16, + margin: EdgeInsets.only(top: 120,left: 20,right: 20), + ) + : ListView.builder( + itemCount: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + records[position].isSelect = + !records[position].isSelect; + }); + }, + child: + invoicesOrderItem(records[position]), + ); + }, + )), + ), + ), + )), + if (records != null && records.length > 0) + Container( + decoration: BoxDecoration( + color: Colors.white, + ), + width: double.infinity, + padding: EdgeInsets.only( + top: 16.h, bottom: 45.h, left: 14.w, right: 17.w), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 10.h), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 6.w), + child: Text( + "已选${selectNum()}个订单合计:", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Expanded( + child: Text( + "¥${selectPrice()}", + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 20.sp, + fontWeight: MyFontWeight.medium, + ), + )), + Text( + "开票金额以实际发票为准", + style: TextStyle( + color: Color(0xFF727272), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + records.forEach((element) { + element.isSelect = !allCheckIndex; + }); + allCheckIndex = !allCheckIndex; + setState(() {}); + }, + child: Container( + padding: EdgeInsets.only(right: 8.w), + child: Image.asset( + allCheckIndex + ? "assets/image/icon_radio_selected.webp" + : "assets/image/icon_radio_unselected.webp", + width: 16.w, + height: 16.h, + )), + ), + Expanded( + child: GestureDetector( + onTap: () { + records.forEach((element) { + element.isSelect = !allCheckIndex; + }); + allCheckIndex = !allCheckIndex; + setState(() {}); + }, + child: Text( + "全选", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + )), + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + List ids = []; + records.forEach((element) { + if (element.isSelect) ids.add(element.id); + }); + if((double.tryParse(selectNum()) > 0)) + Navigator.of(context) + .pushNamed('/router/edit_invoices_info',arguments:{ + "selectPrice": selectPrice(), + "ids":ids ?? [] + }).then((value) async{ + if(value ==1){ + _pageNum = 1; + records.clear(); + unRecords.clear(); + await _onRefresh(); + Future.delayed(Duration(milliseconds: 500), () { + SmartDialog.show( + widget: SettlementTips( + () {}, + text: "已成功提交发票信息", + ), + ); + }); + } + }); + }, + child: Container( + decoration: BoxDecoration( + color: (double.tryParse(selectNum()) > 0) + ? Color(0xFF32A060) + : Color(0xFFd6d6d6), + borderRadius: BorderRadius.circular(4), + ), + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + horizontal: 23.w, vertical: 8.h), + child: Text( + "去开票", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + ) + ], + ), + ], + ), + ) + ], + ), + ); + } + + ///选中数量 + String selectNum() { + return unRecords.where((element) => element.isSelect).length.toString(); + } + + ///选中的总价格 + String selectPrice() { + return unRecords + .where((element) => element.isSelect) + .fold( + 0.0, + (previousValue, element) => + previousValue + double.tryParse(element.payedPrice ?? "0") ?? + 0.0) + .toStringAsFixed(2); + } + + ///可开票订单list + Widget invoicesOrderItem(Records records) { + return Container( + padding: EdgeInsets.only(top: 12.h, bottom: 12.h, right: 20.w), + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ((double.tryParse(records?.payedPrice ?? "0") ?? 0) > 0) + ? GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + setState(() { + records.isSelect = !records.isSelect; + }); + }, + child: Container( + padding: EdgeInsets.only( + right: 15.w, left: 12.w, top: 5.h, bottom: 5.h), + alignment: Alignment.center, + child: Image.asset( + (records?.isSelect ?? false) + ? "assets/image/icon_radio_selected.webp" + : "assets/image/icon_radio_unselected.webp", + width: 15.w, + height: 15.h, + ), + ), + ) + : Container( + padding: EdgeInsets.only( + right: 15.w, left: 12.w, top: 5.h, bottom: 5.h), + alignment: Alignment.center, + child: Image.asset( + "assets/image/disenable_seletor_tow.webp", + width: 15.w, + height: 15.h, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + records?.storeName ?? "", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.h, bottom: 14.h), + child: Text( + "订单编号:${records?.id ?? ""}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + )), + Text( + "下单时间: ${records?.createTime ?? ""}", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + ), + ), + ], + )), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: records?.finalPayPrice ?? "0.00", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 16.sp, + fontWeight: MyFontWeight.bold, + ), + ), + TextSpan( + text: "元", + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget invoicesOrderItemSm() { + return Container( + padding: EdgeInsets.only(top: 12, bottom: 12, left: 16), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 6), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 13.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 16, + height: 16, + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 180, + height: 20, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(top: 8.h, bottom: 14.h), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 182, + height: 17, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 170, + height: 14, + ), + ) + ], + )), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 13.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 49, + height: 20, + ), + ), + ], + ), + ); + } + + Widget noNetwork() { + return Container( + color: Colors.white, + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold, + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular, + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _onRefresh(); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 3), + child: Text( + "重试", + style: TextStyle( + fontSize: 14, + color: Colors.white, + fontWeight: MyFontWeight.regular, + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/order/invoices_manage/invoices_title_info.dart b/lib/order/invoices_manage/invoices_title_info.dart new file mode 100644 index 00000000..b8cc4c79 --- /dev/null +++ b/lib/order/invoices_manage/invoices_title_info.dart @@ -0,0 +1,571 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../generated/l10n.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/data/title_info_list.dart'; +import '../../retrofit/retrofit_api.dart'; +import '../../utils/flutter_utils.dart'; +import '../../utils/font_weight.dart'; +import '../../view_widget/border_text.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_appbar.dart'; +import '../../view_widget/my_footer.dart'; +import '../../view_widget/no_data_view.dart'; +import '../../view_widget/round_button.dart'; + +class InvoicesTitleInfo extends StatefulWidget { + final Map arguments; + + InvoicesTitleInfo({this.arguments}); + + @override + State createState() { + return _InvoicesTitleInfo(); + } +} + +class _InvoicesTitleInfo extends State { + final RefreshController refreshController = RefreshController(); + String networkError = ""; + int networkStatus = 0; + ApiService apiService; + List records = []; + int _current = 1; + + + @override + void initState() { + super.initState(); + _onRefresh(); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + _onRefresh({bool isShowLoad = true}) async { + if (isShowLoad) + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + await queryInvoiceHeadersList(); + EasyLoading.dismiss(); + if (!mounted) return; + if (refreshController.isRefresh) refreshController.refreshCompleted(); + setState(() {}); + } + + ///查询抬头信心列表 + queryInvoiceHeadersList() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService.invoiceHeaderList({ + "current": _current, + "map": {}, + "model": {}, + "order": "descending", + "size": 50, + "sort": "id" + }).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (!mounted) return; + if (baseData != null && baseData.isSuccess) { + records.addAll(baseData?.data?.records ?? []); + if ((baseData?.data?.records ?? []).isEmpty || + records.length.toString() == baseData.data.total) + refreshController.loadNoData(); + else + refreshController.loadComplete(); + networkStatus = 1; + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + ///删除抬头信息 + delTitleInfo(ids) async { + try { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService.delInvoiceHeader(ids).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (baseData != null && baseData.isSuccess) { + await editOnRefresh(); + Future.delayed(Duration(milliseconds: 500), () { + SmartDialog.showToast("删除信息成功", alignment: Alignment.center); + }); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } finally { + EasyLoading.dismiss(); + } + } + + editOnRefresh() { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + appBar: MyAppBar( + title: "抬头管理", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: networkStatus == -1 + ? noNetwork() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + // enablePullUp: records.length == 0 ? false : true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + }, + onLoading: () { + _current++; + _onRefresh(isShowLoad: false); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + margin: EdgeInsets.only(bottom: 20.h), + child: networkStatus == 0 + ? ListView.builder( + itemCount: 10, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: titleInfoListSm(), + ); + }, + ) + : ((records == null || records.length == 0) + ? NoDataView( + src: "assets/image/guan_zhu.webp", + isShowBtn: false, + text: "暂无抬头信息", + fontSize: 16, + margin: EdgeInsets.only(top:120), + ) + : ListView.builder( + itemCount: records?.length ?? 0, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if(widget.arguments["enterType"] == 0){ + Navigator.of(context).pop({ + "id":records[position]?.id ?? "", + "phone":records[position]?.companyPhone ?? "", + "name":records[position]?.name ?? "" + }); + }}, + child: titleInfoList(records[position]), + ); + }, + ))), + ), + )), + if (networkStatus == 1) + GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/add_invoices_title',arguments:{ + "titleName":"添加抬头", + }).then((value) { + _current = 1; + records.clear(); + _onRefresh(isShowLoad: false); + }); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 20.h), + color: Color(0xff32A060), + width: double.infinity, + alignment: Alignment.center, + child: Text( + "添加抬头", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + ], + ), + ); + } + + Widget titleInfoList(Records records) { + return Container( + padding: EdgeInsets.only( + top: ((records?.type ?? "") == "PERSONAL") ? 30.h : 14.h, + bottom: ((records?.type ?? "") == "PERSONAL") ? 30.h : 14.h, + left: 12.w), + margin: EdgeInsets.only(top: 12.h, bottom: 4.h, right: 14.w, left: 14.w), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + records?.name ?? "", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + ), + ), + if ((records?.type ?? "") == "COMPANY") + Padding( + padding: EdgeInsets.only(top: 20.h), + child: Text( + "税号:${records?.taxId ?? ""}", + style: TextStyle( + color: Color(0xff353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + ], + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed('/router/add_invoices_title',arguments: { + "titleName":"编辑抬头", + "titleType":records.type == "COMPANY" ? 1:0, + "records":records, + }).then((value){ + if(value == 1) + editOnRefresh(); + }); + }, + child: Padding( + padding: EdgeInsets.only(left:30.w,right: 12.w), + child: Image.asset( + "assets/image/title_info_edit.webp", + width: 16.h, + height: 16.h, + fit: BoxFit.fitWidth, + ))), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showTitleInfoDialog(records?.id ?? ""); + }, + child: Padding( + padding: EdgeInsets.only(left: 12.w, right: 31.w), + child: Image.asset( + "assets/image/title_del.webp", + width: 15.h, + height: 16.h, + fit: BoxFit.fitWidth, + )), + ), + ], + ), + ); + } + + Widget titleInfoListSm() { + return Container( + padding: EdgeInsets.only(top: 12, bottom: 12, left: 16), + margin: EdgeInsets.symmetric(horizontal: 14, vertical: 6), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(bottom: 16), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 180.w, + height: 20.h, + ), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 40.w, + height: 20.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 120, + height: 20, + ), + ), + ], + ), + ], + )), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 24), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 16.w, + height: 16.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 25), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 16, + height: 16, + ), + ), + ], + ), + ], + ), + ); + } + + Widget noNetwork() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 120.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + // "无法连接到网络", + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + _onRefresh(); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } + + //抬头信心删除提示弹窗 + showTitleInfoDialog(id) { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + content: Container( + width: MediaQuery.of(context).size.width - 84, + height: 139, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "确认要删除这条数据吗?", + style: TextStyle( + color: Colors.black, + fontSize: 16, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox(height: 35), + Row( + children: [ + Expanded( + child: InkWell( + child: BorderText( + text: S.of(context).quxiao, + textColor: Color(0xff32A060), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + borderColor: Color(0xff32A060), + radius: 4, + padding: EdgeInsets.all(12), + borderWidth: 1, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + flex: 1, + ), + SizedBox( + width: 16.w, + ), + Expanded( + child: InkWell( + child: RoundButton( + text: S.of(context).shanchu, + textColor: Colors.white, + radius: 4, + padding: EdgeInsets.all(12), + backgroup: Color(0xff32A060), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + onTap: () { + delTitleInfo(id); + Navigator.of(context).pop(); + }, + ), + flex: 1, + ), + ], + ) + ], + ), + ), + ); + }, + ); + } +} diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 4372e863..691b7a83 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -196,6 +196,7 @@ class _OrderHistoryList extends State } else { if((baseData?.msg ?? "") != "") SmartDialog.showToast(baseData.msg,alignment: Alignment.center); + networkStatus = 2; refreshController.refreshFailed(); refreshController.loadFailed(); }}finally{ @@ -632,6 +633,7 @@ class _OrderHistoryList extends State ? StatusUtils.statusBtn( context, orderInfo.payStatus, + orderInfo.payChannel, orderInfo.orderStatus, orderInfo.isTakeOut, orderInfo.sendStatus, diff --git a/lib/retrofit/data/invoice_list.dart b/lib/retrofit/data/invoice_list.dart new file mode 100644 index 00000000..d921cde1 --- /dev/null +++ b/lib/retrofit/data/invoice_list.dart @@ -0,0 +1,1212 @@ +/// records : [{"id":"1815299099583315968","createTime":"2024-07-22 16:13:27","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"前进麦味烘焙*海峡姐妹茶(哈乐城店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1815299100225044480","createTime":"2024-07-22 16:13:27","createUser":"1428617748061093888","updateTime":"2024-07-22 16:13:27","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1432164681279078400","orderId":"1815299099583315968","actInfo":null,"productId":"1711580655285960704","times":null,"usedTimes":null,"productName":"桂花红豆包","skuId":"1711580655323709440","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"8.00","sellPrice":"8.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"16.00","useInvoice":null,"payedPrice":"0","finalPayPrice":"16.00","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1808763658105257984","createTime":"2024-07-04 15:23:56","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1808763658377887744","createTime":"2024-07-04 15:23:56","createUser":"1428617748061093888","updateTime":"2024-07-04 15:23:56","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1808763658105257984","actInfo":null,"productId":"1780474355029901312","times":null,"usedTimes":null,"productName":"拿铁加吐司下午茶套餐","skuId":"1780474355088621568","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"28.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"0.01","useInvoice":null,"payedPrice":"0.01","finalPayPrice":"0.01","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1808758418991742976","createTime":"2024-07-04 15:03:07","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1808758419272761344","createTime":"2024-07-04 15:03:07","createUser":"1428617748061093888","updateTime":"2024-07-04 15:03:07","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1808758418991742976","actInfo":null,"productId":"1780474355029901312","times":null,"usedTimes":null,"productName":"拿铁加吐司下午茶套餐","skuId":"1780474355088621568","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"28.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"0.02","useInvoice":null,"payedPrice":"0","finalPayPrice":"0.02","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1739531721478504448","createTime":"2023-12-26 14:20:56","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1739531721784688640","createTime":"2023-12-26 14:20:56","createUser":"1428617748061093888","updateTime":"2023-12-26 14:20:56","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1739531721478504448","actInfo":null,"productId":"1722077521022812160","times":0,"usedTimes":0,"productName":"新品台式套餐","skuId":"1722902248855437312","skuNameStr":"美式咖啡(热)360ml 正常糖 花生厚吐司","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"23.00","sellPrice":"13.90","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"13.90","useInvoice":null,"payedPrice":"0","finalPayPrice":"13.90","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1739529082455982080","createTime":"2023-12-26 14:10:27","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1739529082883801088","createTime":"2023-12-26 14:10:27","createUser":"1428617748061093888","updateTime":"2023-12-26 14:10:27","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1739529082455982080","actInfo":null,"productId":"1722077521022812160","times":0,"usedTimes":0,"productName":"新品台式套餐","skuId":"1722902248855437312","skuNameStr":"美式咖啡(热)360ml 正常糖 花生厚吐司","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"23.00","sellPrice":"13.90","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"13.90","useInvoice":null,"payedPrice":"0","finalPayPrice":"13.90","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1739528149030404096","createTime":"2023-12-26 14:06:44","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1739528149391114240","createTime":"2023-12-26 14:06:44","createUser":"1428617748061093888","updateTime":"2023-12-26 14:06:44","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1739528149030404096","actInfo":null,"productId":"1717143790415773696","times":0,"usedTimes":0,"productName":"红薯芋圆","skuId":"1717143790453522432","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"2.00","sellPrice":"2.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"2.00","useInvoice":null,"payedPrice":"0","finalPayPrice":"2.00","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1721749099142709248","createTime":"2023-11-07 12:39:08","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1721749099251761152","createTime":"2023-11-07 12:39:08","createUser":"1428617748061093888","updateTime":"2023-11-07 12:39:08","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721749099142709248","actInfo":null,"productId":"1668152814867578880","times":0,"usedTimes":0,"productName":"茗茶","skuId":"1696084971438997504","skuNameStr":"少冰 无糖 700ml 台18(红玉红茶)","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"9.00","sellPrice":"9.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"9.00","useInvoice":null,"payedPrice":"0","finalPayPrice":"9.00","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1721748992578027520","createTime":"2023-11-07 12:38:43","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1721748992607387648","createTime":"2023-11-07 12:38:43","createUser":"1428617748061093888","updateTime":"2023-11-07 12:38:43","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721748992578027520","actInfo":{"promotionId":null,"promotionType":null,"discountAmount":null,"discountRate":null,"couponId":"1569618358515531776","couponType":1,"couponDiscountAmount":"17.6","couponDiscountRate":100},"productId":"1715256863185960960","times":0,"usedTimes":0,"productName":"椰香酒酿","skuId":"1719915581567664128","skuNameStr":"500ml 热 少糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"19.00","sellPrice":"19.00","postPay":"0.00","isDelete":0,"discountAmount":"17.60","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"},{"id":"1721748992615776256","createTime":"2023-11-07 12:38:43","createUser":"1428617748061093888","updateTime":"2023-11-07 12:38:43","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721748992578027520","actInfo":{"promotionId":null,"promotionType":null,"discountAmount":null,"discountRate":null,"couponId":"1569618358515531776","couponType":1,"couponDiscountAmount":"17.6","couponDiscountRate":100},"productId":"1715256863185960960","times":0,"usedTimes":0,"productName":"椰香酒酿","skuId":"1719915581357948928","skuNameStr":"500ml 少冰 七分糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"19.00","sellPrice":"19.00","postPay":"0.00","isDelete":0,"discountAmount":"17.60","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"},{"id":"1721748992615776257","createTime":"2023-11-07 12:38:43","createUser":"1428617748061093888","updateTime":"2023-11-07 12:38:43","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721748992578027520","actInfo":{"promotionId":null,"promotionType":null,"discountAmount":null,"discountRate":null,"couponId":"1569618358515531776","couponType":1,"couponDiscountAmount":"14.8","couponDiscountRate":100},"productId":"1711327281898586112","times":0,"usedTimes":0,"productName":"金宣乌龙轻乳茶","skuId":"1713376100739973120","skuNameStr":"500ml 温热 七分糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"16.00","sellPrice":"16.00","postPay":"0.00","isDelete":0,"discountAmount":"14.80","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"54.00","useInvoice":null,"payedPrice":"4.00","finalPayPrice":"4.00","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1721748249640960000","createTime":"2023-11-07 12:35:46","createUser":null,"updateTime":null,"updateUser":null,"tenantCode":null,"storeId":null,"storeName":"海峡姐妹茶(歌笛湖印象里店)","tableId":null,"responsible":null,"orderType":null,"clearTable":null,"mid":null,"parentId":"0","parentCode":null,"orderCode":null,"dayFlowCode":null,"orderStatus":null,"sendStatus":null,"payStatus":1,"haveTimes":null,"invoicing":null,"memberAccount":null,"owner":null,"logisticsId":null,"shipperCode":null,"logisticsName":null,"logisticsNum":null,"logisticsCase":null,"refundStatus":null,"addressExt":null,"contactsExtList":null,"postFee":"0","totalPackagingFee":"0","couponSubPrice":"0","removeDecimal":"0","isSubscribe":null,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":null,"prepayId":null,"payTime":null,"payChannel":null,"payNum":null,"promotionId":null,"actId":null,"couponId":null,"isDelete":null,"isTakeOut":null,"batch":1,"orderDiscountPrice":"0","dishesDiscountPrice":"0","orderPercentPrice":"0","activityNoPrice":"0","activityDiscountPrice":"0","uniqueDiscountType":null,"totalDiscountPrice":"0","vipDayDiscountPrice":"0","orderSource":null,"benefitDiscountAmount":"0","vipDiscountPrice":"0","orderMerge":null,"canSettlement":null,"endRefundTime":null,"orderProductList":[{"id":"1721748249666125824","createTime":"2023-11-07 12:35:46","createUser":"1428617748061093888","updateTime":"2023-11-07 12:35:46","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721748249640960000","actInfo":{"promotionId":null,"promotionType":null,"discountAmount":null,"discountRate":null,"couponId":"1569618358515531776","couponType":1,"couponDiscountAmount":"18.0","couponDiscountRate":100},"productId":"1668141170858917888","times":0,"usedTimes":0,"productName":"洛神果果","skuId":"1696083296192036864","skuNameStr":"正常冰 七分糖 700ml","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"18.00","sellPrice":"18.00","postPay":"0.00","isDelete":0,"discountAmount":"18.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"},{"id":"1721748249674514432","createTime":"2023-11-07 12:35:46","createUser":"1428617748061093888","updateTime":"2023-11-07 12:35:46","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721748249640960000","actInfo":{"promotionId":null,"promotionType":null,"discountAmount":null,"discountRate":null,"couponId":"1569618358515531776","couponType":1,"couponDiscountAmount":"16.0","couponDiscountRate":100},"productId":"1668149489031970816","times":0,"usedTimes":0,"productName":"红枣桂圆姜茶","skuId":"1696084860218638336","skuNameStr":"热 正常糖 500ml","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"16.00","sellPrice":"16.00","postPay":"0.00","isDelete":0,"discountAmount":"16.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"},{"id":"1721748249674514433","createTime":"2023-11-07 12:35:46","createUser":"1428617748061093888","updateTime":"2023-11-07 12:35:46","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1721748249640960000","actInfo":{"promotionId":null,"promotionType":null,"discountAmount":null,"discountRate":null,"couponId":"1569618358515531776","couponType":1,"couponDiscountAmount":"16.0","couponDiscountRate":100},"productId":"1711327733293776896","times":0,"usedTimes":0,"productName":"凤凰单枞轻乳茶","skuId":"1713394940744040448","skuNameStr":"500ml 少冰 无糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"16.00","sellPrice":"16.00","postPay":"0.00","isDelete":0,"discountAmount":"16.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}],"businessType":null,"paySum":"50.00","useInvoice":null,"payedPrice":"0.00","finalPayPrice":"0.00","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null}] +/// total : "9" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "1" + +class InvoiceList { + InvoiceList({ + List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages,}){ + _records = records; + _total = total; + _size = size; + _current = current; + _orders = orders; + _hitCount = hitCount; + _searchCount = searchCount; + _pages = pages; +} + + InvoiceList.fromJson(dynamic json) { + if (json['records'] != null) { + _records = []; + json['records'].forEach((v) { + _records.add(Records.fromJson(v)); + }); + } + _total = json['total']; + _size = json['size']; + _current = json['current']; + if (json['orders'] != null) { + _orders = []; + json['orders'].forEach((v) { + _orders.add(Orders.fromJson(v)); + }); + } + _hitCount = json['hitCount']; + _searchCount = json['searchCount']; + _pages = json['pages']; + } + List _records; + String _total; + String _size; + String _current; + List _orders; + bool _hitCount; + bool _searchCount; + String _pages; +InvoiceList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => InvoiceList( records: records ?? _records, + total: total ?? _total, + size: size ?? _size, + current: current ?? _current, + orders: orders ?? _orders, + hitCount: hitCount ?? _hitCount, + searchCount: searchCount ?? _searchCount, + pages: pages ?? _pages, +); + List get records => _records; + String get total => _total; + String get size => _size; + String get current => _current; + List get orders => _orders; + bool get hitCount => _hitCount; + bool get searchCount => _searchCount; + String get pages => _pages; + + Map toJson() { + final map = {}; + if (_records != null) { + map['records'] = _records.map((v) => v.toJson()).toList(); + } + map['total'] = _total; + map['size'] = _size; + map['current'] = _current; + if (_orders != null) { + map['orders'] = _orders.map((v) => v.toJson()).toList(); + } + map['hitCount'] = _hitCount; + map['searchCount'] = _searchCount; + map['pages'] = _pages; + return map; + } + +} + +/// column : "id" +/// asc : false + +class Orders { + Orders({ + String column, + bool asc,}){ + _column = column; + _asc = asc; +} + + Orders.fromJson(dynamic json) { + _column = json['column']; + _asc = json['asc']; + } + String _column; + bool _asc; +Orders copyWith({ String column, + bool asc, +}) => Orders( column: column ?? _column, + asc: asc ?? _asc, +); + String get column => _column; + bool get asc => _asc; + + Map toJson() { + final map = {}; + map['column'] = _column; + map['asc'] = _asc; + return map; + } + +} + +/// id : "1815299099583315968" +/// createTime : "2024-07-22 16:13:27" +/// createUser : null +/// updateTime : null +/// updateUser : null +/// tenantCode : null +/// storeId : null +/// storeName : "前进麦味烘焙*海峡姐妹茶(哈乐城店)" +/// tableId : null +/// responsible : null +/// orderType : null +/// clearTable : null +/// mid : null +/// parentId : "0" +/// parentCode : null +/// orderCode : null +/// dayFlowCode : null +/// orderStatus : null +/// sendStatus : null +/// payStatus : 1 +/// haveTimes : null +/// invoicing : null +/// memberAccount : null +/// owner : null +/// logisticsId : null +/// shipperCode : null +/// logisticsName : null +/// logisticsNum : null +/// logisticsCase : null +/// refundStatus : null +/// addressExt : null +/// contactsExtList : null +/// postFee : "0" +/// totalPackagingFee : "0" +/// couponSubPrice : "0" +/// removeDecimal : "0" +/// isSubscribe : null +/// subcribeTime : null +/// sendTime : null +/// confirmTime : null +/// returnMoneyTime : null +/// notes : null +/// prepayId : null +/// payTime : null +/// payChannel : null +/// payNum : null +/// promotionId : null +/// actId : null +/// couponId : null +/// isDelete : null +/// isTakeOut : null +/// batch : 1 +/// orderDiscountPrice : "0" +/// dishesDiscountPrice : "0" +/// orderPercentPrice : "0" +/// activityNoPrice : "0" +/// activityDiscountPrice : "0" +/// uniqueDiscountType : null +/// totalDiscountPrice : "0" +/// vipDayDiscountPrice : "0" +/// orderSource : null +/// benefitDiscountAmount : "0" +/// vipDiscountPrice : "0" +/// orderMerge : null +/// canSettlement : null +/// endRefundTime : null +/// orderProductList : [{"id":"1815299100225044480","createTime":"2024-07-22 16:13:27","createUser":"1428617748061093888","updateTime":"2024-07-22 16:13:27","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1432164681279078400","orderId":"1815299099583315968","actInfo":null,"productId":"1711580655285960704","times":null,"usedTimes":null,"productName":"桂花红豆包","skuId":"1711580655323709440","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"8.00","sellPrice":"8.00","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":[],"packagingFee":"0.00"}] +/// businessType : null +/// paySum : "16.00" +/// useInvoice : null +/// payedPrice : "0" +/// finalPayPrice : "16.00" +/// isEnableSubscribePay : null +/// invoiceId : null +/// invoiceState : null +/// posType : null + +class Records { + Records({ + String id, + String createTime, + dynamic createUser, + dynamic updateTime, + dynamic updateUser, + dynamic tenantCode, + dynamic storeId, + String storeName, + dynamic tableId, + dynamic responsible, + dynamic orderType, + dynamic clearTable, + dynamic mid, + String parentId, + dynamic parentCode, + dynamic orderCode, + dynamic dayFlowCode, + dynamic orderStatus, + dynamic sendStatus, + num payStatus, + dynamic haveTimes, + dynamic invoicing, + dynamic memberAccount, + dynamic owner, + dynamic logisticsId, + dynamic shipperCode, + dynamic logisticsName, + dynamic logisticsNum, + dynamic logisticsCase, + dynamic refundStatus, + dynamic addressExt, + dynamic contactsExtList, + String postFee, + String totalPackagingFee, + String couponSubPrice, + String removeDecimal, + dynamic isSubscribe, + dynamic subcribeTime, + dynamic sendTime, + dynamic confirmTime, + dynamic returnMoneyTime, + dynamic notes, + dynamic prepayId, + dynamic payTime, + dynamic payChannel, + dynamic payNum, + dynamic promotionId, + dynamic actId, + dynamic couponId, + dynamic isDelete, + dynamic isTakeOut, + num batch, + String orderDiscountPrice, + String dishesDiscountPrice, + String orderPercentPrice, + String activityNoPrice, + String activityDiscountPrice, + dynamic uniqueDiscountType, + String totalDiscountPrice, + String vipDayDiscountPrice, + dynamic orderSource, + String benefitDiscountAmount, + String vipDiscountPrice, + dynamic orderMerge, + dynamic canSettlement, + dynamic endRefundTime, + List orderProductList, + dynamic businessType, + String paySum, + dynamic useInvoice, + String payedPrice, + String finalPayPrice, + dynamic isEnableSubscribePay, + dynamic invoiceId, + dynamic invoiceState, + dynamic posType,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _tenantCode = tenantCode; + _storeId = storeId; + _storeName = storeName; + _tableId = tableId; + _responsible = responsible; + _orderType = orderType; + _clearTable = clearTable; + _mid = mid; + _parentId = parentId; + _parentCode = parentCode; + _orderCode = orderCode; + _dayFlowCode = dayFlowCode; + _orderStatus = orderStatus; + _sendStatus = sendStatus; + _payStatus = payStatus; + _haveTimes = haveTimes; + _invoicing = invoicing; + _memberAccount = memberAccount; + _owner = owner; + _logisticsId = logisticsId; + _shipperCode = shipperCode; + _logisticsName = logisticsName; + _logisticsNum = logisticsNum; + _logisticsCase = logisticsCase; + _refundStatus = refundStatus; + _addressExt = addressExt; + _contactsExtList = contactsExtList; + _postFee = postFee; + _totalPackagingFee = totalPackagingFee; + _couponSubPrice = couponSubPrice; + _removeDecimal = removeDecimal; + _isSubscribe = isSubscribe; + _subcribeTime = subcribeTime; + _sendTime = sendTime; + _confirmTime = confirmTime; + _returnMoneyTime = returnMoneyTime; + _notes = notes; + _prepayId = prepayId; + _payTime = payTime; + _payChannel = payChannel; + _payNum = payNum; + _promotionId = promotionId; + _actId = actId; + _couponId = couponId; + _isDelete = isDelete; + _isTakeOut = isTakeOut; + _batch = batch; + _orderDiscountPrice = orderDiscountPrice; + _dishesDiscountPrice = dishesDiscountPrice; + _orderPercentPrice = orderPercentPrice; + _activityNoPrice = activityNoPrice; + _activityDiscountPrice = activityDiscountPrice; + _uniqueDiscountType = uniqueDiscountType; + _totalDiscountPrice = totalDiscountPrice; + _vipDayDiscountPrice = vipDayDiscountPrice; + _orderSource = orderSource; + _benefitDiscountAmount = benefitDiscountAmount; + _vipDiscountPrice = vipDiscountPrice; + _orderMerge = orderMerge; + _canSettlement = canSettlement; + _endRefundTime = endRefundTime; + _orderProductList = orderProductList; + _businessType = businessType; + _paySum = paySum; + _useInvoice = useInvoice; + _payedPrice = payedPrice; + _finalPayPrice = finalPayPrice; + _isEnableSubscribePay = isEnableSubscribePay; + _invoiceId = invoiceId; + _invoiceState = invoiceState; + _posType = posType; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _tenantCode = json['tenantCode']; + _storeId = json['storeId']; + _storeName = json['storeName']; + _tableId = json['tableId']; + _responsible = json['responsible']; + _orderType = json['orderType']; + _clearTable = json['clearTable']; + _mid = json['mid']; + _parentId = json['parentId']; + _parentCode = json['parentCode']; + _orderCode = json['orderCode']; + _dayFlowCode = json['dayFlowCode']; + _orderStatus = json['orderStatus']; + _sendStatus = json['sendStatus']; + _payStatus = json['payStatus']; + _haveTimes = json['haveTimes']; + _invoicing = json['invoicing']; + _memberAccount = json['memberAccount']; + _owner = json['owner']; + _logisticsId = json['logisticsId']; + _shipperCode = json['shipperCode']; + _logisticsName = json['logisticsName']; + _logisticsNum = json['logisticsNum']; + _logisticsCase = json['logisticsCase']; + _refundStatus = json['refundStatus']; + _addressExt = json['addressExt']; + _contactsExtList = json['contactsExtList']; + _postFee = json['postFee']; + _totalPackagingFee = json['totalPackagingFee']; + _couponSubPrice = json['couponSubPrice']; + _removeDecimal = json['removeDecimal']; + _isSubscribe = json['isSubscribe']; + _subcribeTime = json['subcribeTime']; + _sendTime = json['sendTime']; + _confirmTime = json['confirmTime']; + _returnMoneyTime = json['returnMoneyTime']; + _notes = json['notes']; + _prepayId = json['prepayId']; + _payTime = json['payTime']; + _payChannel = json['payChannel']; + _payNum = json['payNum']; + _promotionId = json['promotionId']; + _actId = json['actId']; + _couponId = json['couponId']; + _isDelete = json['isDelete']; + _isTakeOut = json['isTakeOut']; + _batch = json['batch']; + _orderDiscountPrice = json['orderDiscountPrice']; + _dishesDiscountPrice = json['dishesDiscountPrice']; + _orderPercentPrice = json['orderPercentPrice']; + _activityNoPrice = json['activityNoPrice']; + _activityDiscountPrice = json['activityDiscountPrice']; + _uniqueDiscountType = json['uniqueDiscountType']; + _totalDiscountPrice = json['totalDiscountPrice']; + _vipDayDiscountPrice = json['vipDayDiscountPrice']; + _orderSource = json['orderSource']; + _benefitDiscountAmount = json['benefitDiscountAmount']; + _vipDiscountPrice = json['vipDiscountPrice']; + _orderMerge = json['orderMerge']; + _canSettlement = json['canSettlement']; + _endRefundTime = json['endRefundTime']; + if (json['orderProductList'] != null) { + _orderProductList = []; + json['orderProductList'].forEach((v) { + _orderProductList.add(OrderProductList.fromJson(v)); + }); + } + _businessType = json['businessType']; + _paySum = json['paySum']; + _useInvoice = json['useInvoice']; + _payedPrice = json['payedPrice']; + _finalPayPrice = json['finalPayPrice']; + _isEnableSubscribePay = json['isEnableSubscribePay']; + _invoiceId = json['invoiceId']; + _invoiceState = json['invoiceState']; + _posType = json['posType']; + } + String _id; + String _createTime; + dynamic _createUser; + dynamic _updateTime; + dynamic _updateUser; + dynamic _tenantCode; + dynamic _storeId; + String _storeName; + dynamic _tableId; + dynamic _responsible; + dynamic _orderType; + dynamic _clearTable; + dynamic _mid; + String _parentId; + dynamic _parentCode; + dynamic _orderCode; + dynamic _dayFlowCode; + dynamic _orderStatus; + dynamic _sendStatus; + num _payStatus; + dynamic _haveTimes; + dynamic _invoicing; + dynamic _memberAccount; + dynamic _owner; + dynamic _logisticsId; + dynamic _shipperCode; + dynamic _logisticsName; + dynamic _logisticsNum; + dynamic _logisticsCase; + dynamic _refundStatus; + dynamic _addressExt; + dynamic _contactsExtList; + String _postFee; + String _totalPackagingFee; + String _couponSubPrice; + String _removeDecimal; + dynamic _isSubscribe; + dynamic _subcribeTime; + dynamic _sendTime; + dynamic _confirmTime; + dynamic _returnMoneyTime; + dynamic _notes; + dynamic _prepayId; + dynamic _payTime; + dynamic _payChannel; + dynamic _payNum; + dynamic _promotionId; + dynamic _actId; + dynamic _couponId; + dynamic _isDelete; + dynamic _isTakeOut; + num _batch; + String _orderDiscountPrice; + String _dishesDiscountPrice; + String _orderPercentPrice; + String _activityNoPrice; + String _activityDiscountPrice; + dynamic _uniqueDiscountType; + String _totalDiscountPrice; + String _vipDayDiscountPrice; + dynamic _orderSource; + String _benefitDiscountAmount; + String _vipDiscountPrice; + dynamic _orderMerge; + dynamic _canSettlement; + dynamic _endRefundTime; + List _orderProductList; + dynamic _businessType; + String _paySum; + dynamic _useInvoice; + String _payedPrice; + String _finalPayPrice; + dynamic _isEnableSubscribePay; + dynamic _invoiceId; + dynamic _invoiceState; + dynamic _posType; +Records copyWith({ String id, + String createTime, + dynamic createUser, + dynamic updateTime, + dynamic updateUser, + dynamic tenantCode, + dynamic storeId, + String storeName, + dynamic tableId, + dynamic responsible, + dynamic orderType, + dynamic clearTable, + dynamic mid, + String parentId, + dynamic parentCode, + dynamic orderCode, + dynamic dayFlowCode, + dynamic orderStatus, + dynamic sendStatus, + num payStatus, + dynamic haveTimes, + dynamic invoicing, + dynamic memberAccount, + dynamic owner, + dynamic logisticsId, + dynamic shipperCode, + dynamic logisticsName, + dynamic logisticsNum, + dynamic logisticsCase, + dynamic refundStatus, + dynamic addressExt, + dynamic contactsExtList, + String postFee, + String totalPackagingFee, + String couponSubPrice, + String removeDecimal, + dynamic isSubscribe, + dynamic subcribeTime, + dynamic sendTime, + dynamic confirmTime, + dynamic returnMoneyTime, + dynamic notes, + dynamic prepayId, + dynamic payTime, + dynamic payChannel, + dynamic payNum, + dynamic promotionId, + dynamic actId, + dynamic couponId, + dynamic isDelete, + dynamic isTakeOut, + num batch, + String orderDiscountPrice, + String dishesDiscountPrice, + String orderPercentPrice, + String activityNoPrice, + String activityDiscountPrice, + dynamic uniqueDiscountType, + String totalDiscountPrice, + String vipDayDiscountPrice, + dynamic orderSource, + String benefitDiscountAmount, + String vipDiscountPrice, + dynamic orderMerge, + dynamic canSettlement, + dynamic endRefundTime, + List orderProductList, + dynamic businessType, + String paySum, + dynamic useInvoice, + String payedPrice, + String finalPayPrice, + dynamic isEnableSubscribePay, + dynamic invoiceId, + dynamic invoiceState, + dynamic posType, +}) => Records( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + tenantCode: tenantCode ?? _tenantCode, + storeId: storeId ?? _storeId, + storeName: storeName ?? _storeName, + tableId: tableId ?? _tableId, + responsible: responsible ?? _responsible, + orderType: orderType ?? _orderType, + clearTable: clearTable ?? _clearTable, + mid: mid ?? _mid, + parentId: parentId ?? _parentId, + parentCode: parentCode ?? _parentCode, + orderCode: orderCode ?? _orderCode, + dayFlowCode: dayFlowCode ?? _dayFlowCode, + orderStatus: orderStatus ?? _orderStatus, + sendStatus: sendStatus ?? _sendStatus, + payStatus: payStatus ?? _payStatus, + haveTimes: haveTimes ?? _haveTimes, + invoicing: invoicing ?? _invoicing, + memberAccount: memberAccount ?? _memberAccount, + owner: owner ?? _owner, + logisticsId: logisticsId ?? _logisticsId, + shipperCode: shipperCode ?? _shipperCode, + logisticsName: logisticsName ?? _logisticsName, + logisticsNum: logisticsNum ?? _logisticsNum, + logisticsCase: logisticsCase ?? _logisticsCase, + refundStatus: refundStatus ?? _refundStatus, + addressExt: addressExt ?? _addressExt, + contactsExtList: contactsExtList ?? _contactsExtList, + postFee: postFee ?? _postFee, + totalPackagingFee: totalPackagingFee ?? _totalPackagingFee, + couponSubPrice: couponSubPrice ?? _couponSubPrice, + removeDecimal: removeDecimal ?? _removeDecimal, + isSubscribe: isSubscribe ?? _isSubscribe, + subcribeTime: subcribeTime ?? _subcribeTime, + sendTime: sendTime ?? _sendTime, + confirmTime: confirmTime ?? _confirmTime, + returnMoneyTime: returnMoneyTime ?? _returnMoneyTime, + notes: notes ?? _notes, + prepayId: prepayId ?? _prepayId, + payTime: payTime ?? _payTime, + payChannel: payChannel ?? _payChannel, + payNum: payNum ?? _payNum, + promotionId: promotionId ?? _promotionId, + actId: actId ?? _actId, + couponId: couponId ?? _couponId, + isDelete: isDelete ?? _isDelete, + isTakeOut: isTakeOut ?? _isTakeOut, + batch: batch ?? _batch, + orderDiscountPrice: orderDiscountPrice ?? _orderDiscountPrice, + dishesDiscountPrice: dishesDiscountPrice ?? _dishesDiscountPrice, + orderPercentPrice: orderPercentPrice ?? _orderPercentPrice, + activityNoPrice: activityNoPrice ?? _activityNoPrice, + activityDiscountPrice: activityDiscountPrice ?? _activityDiscountPrice, + uniqueDiscountType: uniqueDiscountType ?? _uniqueDiscountType, + totalDiscountPrice: totalDiscountPrice ?? _totalDiscountPrice, + vipDayDiscountPrice: vipDayDiscountPrice ?? _vipDayDiscountPrice, + orderSource: orderSource ?? _orderSource, + benefitDiscountAmount: benefitDiscountAmount ?? _benefitDiscountAmount, + vipDiscountPrice: vipDiscountPrice ?? _vipDiscountPrice, + orderMerge: orderMerge ?? _orderMerge, + canSettlement: canSettlement ?? _canSettlement, + endRefundTime: endRefundTime ?? _endRefundTime, + orderProductList: orderProductList ?? _orderProductList, + businessType: businessType ?? _businessType, + paySum: paySum ?? _paySum, + useInvoice: useInvoice ?? _useInvoice, + payedPrice: payedPrice ?? _payedPrice, + finalPayPrice: finalPayPrice ?? _finalPayPrice, + isEnableSubscribePay: isEnableSubscribePay ?? _isEnableSubscribePay, + invoiceId: invoiceId ?? _invoiceId, + invoiceState: invoiceState ?? _invoiceState, + posType: posType ?? _posType, +); + String get id => _id; + String get createTime => _createTime; + dynamic get createUser => _createUser; + dynamic get updateTime => _updateTime; + dynamic get updateUser => _updateUser; + dynamic get tenantCode => _tenantCode; + dynamic get storeId => _storeId; + String get storeName => _storeName; + dynamic get tableId => _tableId; + dynamic get responsible => _responsible; + dynamic get orderType => _orderType; + dynamic get clearTable => _clearTable; + dynamic get mid => _mid; + String get parentId => _parentId; + dynamic get parentCode => _parentCode; + dynamic get orderCode => _orderCode; + dynamic get dayFlowCode => _dayFlowCode; + dynamic get orderStatus => _orderStatus; + dynamic get sendStatus => _sendStatus; + num get payStatus => _payStatus; + dynamic get haveTimes => _haveTimes; + dynamic get invoicing => _invoicing; + dynamic get memberAccount => _memberAccount; + dynamic get owner => _owner; + dynamic get logisticsId => _logisticsId; + dynamic get shipperCode => _shipperCode; + dynamic get logisticsName => _logisticsName; + dynamic get logisticsNum => _logisticsNum; + dynamic get logisticsCase => _logisticsCase; + dynamic get refundStatus => _refundStatus; + dynamic get addressExt => _addressExt; + dynamic get contactsExtList => _contactsExtList; + String get postFee => _postFee; + String get totalPackagingFee => _totalPackagingFee; + String get couponSubPrice => _couponSubPrice; + String get removeDecimal => _removeDecimal; + dynamic get isSubscribe => _isSubscribe; + dynamic get subcribeTime => _subcribeTime; + dynamic get sendTime => _sendTime; + dynamic get confirmTime => _confirmTime; + dynamic get returnMoneyTime => _returnMoneyTime; + dynamic get notes => _notes; + dynamic get prepayId => _prepayId; + dynamic get payTime => _payTime; + dynamic get payChannel => _payChannel; + dynamic get payNum => _payNum; + dynamic get promotionId => _promotionId; + dynamic get actId => _actId; + dynamic get couponId => _couponId; + dynamic get isDelete => _isDelete; + dynamic get isTakeOut => _isTakeOut; + num get batch => _batch; + String get orderDiscountPrice => _orderDiscountPrice; + String get dishesDiscountPrice => _dishesDiscountPrice; + String get orderPercentPrice => _orderPercentPrice; + String get activityNoPrice => _activityNoPrice; + String get activityDiscountPrice => _activityDiscountPrice; + dynamic get uniqueDiscountType => _uniqueDiscountType; + String get totalDiscountPrice => _totalDiscountPrice; + String get vipDayDiscountPrice => _vipDayDiscountPrice; + dynamic get orderSource => _orderSource; + String get benefitDiscountAmount => _benefitDiscountAmount; + String get vipDiscountPrice => _vipDiscountPrice; + dynamic get orderMerge => _orderMerge; + dynamic get canSettlement => _canSettlement; + dynamic get endRefundTime => _endRefundTime; + List get orderProductList => _orderProductList; + dynamic get businessType => _businessType; + String get paySum => _paySum; + dynamic get useInvoice => _useInvoice; + String get payedPrice => _payedPrice; + String get finalPayPrice => _finalPayPrice; + dynamic get isEnableSubscribePay => _isEnableSubscribePay; + dynamic get invoiceId => _invoiceId; + dynamic get invoiceState => _invoiceState; + dynamic get posType => _posType; + bool _isSelect = false; + + bool get isSelect => _isSelect; + + set isSelect(bool value) { + _isSelect = value; + } + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['tenantCode'] = _tenantCode; + map['storeId'] = _storeId; + map['storeName'] = _storeName; + map['tableId'] = _tableId; + map['responsible'] = _responsible; + map['orderType'] = _orderType; + map['clearTable'] = _clearTable; + map['mid'] = _mid; + map['parentId'] = _parentId; + map['parentCode'] = _parentCode; + map['orderCode'] = _orderCode; + map['dayFlowCode'] = _dayFlowCode; + map['orderStatus'] = _orderStatus; + map['sendStatus'] = _sendStatus; + map['payStatus'] = _payStatus; + map['haveTimes'] = _haveTimes; + map['invoicing'] = _invoicing; + map['memberAccount'] = _memberAccount; + map['owner'] = _owner; + map['logisticsId'] = _logisticsId; + map['shipperCode'] = _shipperCode; + map['logisticsName'] = _logisticsName; + map['logisticsNum'] = _logisticsNum; + map['logisticsCase'] = _logisticsCase; + map['refundStatus'] = _refundStatus; + map['addressExt'] = _addressExt; + map['contactsExtList'] = _contactsExtList; + map['postFee'] = _postFee; + map['totalPackagingFee'] = _totalPackagingFee; + map['couponSubPrice'] = _couponSubPrice; + map['removeDecimal'] = _removeDecimal; + map['isSubscribe'] = _isSubscribe; + map['subcribeTime'] = _subcribeTime; + map['sendTime'] = _sendTime; + map['confirmTime'] = _confirmTime; + map['returnMoneyTime'] = _returnMoneyTime; + map['notes'] = _notes; + map['prepayId'] = _prepayId; + map['payTime'] = _payTime; + map['payChannel'] = _payChannel; + map['payNum'] = _payNum; + map['promotionId'] = _promotionId; + map['actId'] = _actId; + map['couponId'] = _couponId; + map['isDelete'] = _isDelete; + map['isTakeOut'] = _isTakeOut; + map['batch'] = _batch; + map['orderDiscountPrice'] = _orderDiscountPrice; + map['dishesDiscountPrice'] = _dishesDiscountPrice; + map['orderPercentPrice'] = _orderPercentPrice; + map['activityNoPrice'] = _activityNoPrice; + map['activityDiscountPrice'] = _activityDiscountPrice; + map['uniqueDiscountType'] = _uniqueDiscountType; + map['totalDiscountPrice'] = _totalDiscountPrice; + map['vipDayDiscountPrice'] = _vipDayDiscountPrice; + map['orderSource'] = _orderSource; + map['benefitDiscountAmount'] = _benefitDiscountAmount; + map['vipDiscountPrice'] = _vipDiscountPrice; + map['orderMerge'] = _orderMerge; + map['canSettlement'] = _canSettlement; + map['endRefundTime'] = _endRefundTime; + if (_orderProductList != null) { + map['orderProductList'] = _orderProductList.map((v) => v.toJson()).toList(); + } + map['businessType'] = _businessType; + map['paySum'] = _paySum; + map['useInvoice'] = _useInvoice; + map['payedPrice'] = _payedPrice; + map['finalPayPrice'] = _finalPayPrice; + map['isEnableSubscribePay'] = _isEnableSubscribePay; + map['invoiceId'] = _invoiceId; + map['invoiceState'] = _invoiceState; + map['posType'] = _posType; + return map; + } + +} + +/// id : "1815299100225044480" +/// createTime : "2024-07-22 16:13:27" +/// createUser : "1428617748061093888" +/// updateTime : "2024-07-22 16:13:27" +/// updateUser : "1428617748061093888" +/// tenantCode : "1175" +/// storeId : "1432164681279078400" +/// orderId : "1815299099583315968" +/// actInfo : null +/// productId : "1711580655285960704" +/// times : null +/// usedTimes : null +/// productName : "桂花红豆包" +/// skuId : "1711580655323709440" +/// skuNameStr : "" +/// skuImg : "" +/// buyNum : 2 +/// refundNum : 0 +/// type : 0 +/// reason : null +/// weight : 0.0 +/// applyPrice : "8.00" +/// sellPrice : "8.00" +/// postPay : "0.00" +/// isDelete : 0 +/// discountAmount : "0.00" +/// discountPercent : 100 +/// status : true +/// batch : 1 +/// deliveries : 0 +/// ticketType : "" +/// ticketDays : "0" +/// takeType : null +/// skuTickets : [] +/// ticketStyle : "" +/// setMealDataList : [] +/// packagingFee : "0.00" + +class OrderProductList { + OrderProductList({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String orderId, + dynamic actInfo, + String productId, + dynamic times, + dynamic usedTimes, + String productName, + String skuId, + String skuNameStr, + String skuImg, + num buyNum, + num refundNum, + num type, + dynamic reason, + num weight, + String applyPrice, + String sellPrice, + String postPay, + num isDelete, + String discountAmount, + num discountPercent, + bool status, + num batch, + num deliveries, + String ticketType, + String ticketDays, + dynamic takeType, + List skuTickets, + String ticketStyle, + List setMealDataList, + String packagingFee,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _tenantCode = tenantCode; + _storeId = storeId; + _orderId = orderId; + _actInfo = actInfo; + _productId = productId; + _times = times; + _usedTimes = usedTimes; + _productName = productName; + _skuId = skuId; + _skuNameStr = skuNameStr; + _skuImg = skuImg; + _buyNum = buyNum; + _refundNum = refundNum; + _type = type; + _reason = reason; + _weight = weight; + _applyPrice = applyPrice; + _sellPrice = sellPrice; + _postPay = postPay; + _isDelete = isDelete; + _discountAmount = discountAmount; + _discountPercent = discountPercent; + _status = status; + _batch = batch; + _deliveries = deliveries; + _ticketType = ticketType; + _ticketDays = ticketDays; + _takeType = takeType; + _skuTickets = skuTickets; + _ticketStyle = ticketStyle; + _setMealDataList = setMealDataList; + _packagingFee = packagingFee; +} + + OrderProductList.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _tenantCode = json['tenantCode']; + _storeId = json['storeId']; + _orderId = json['orderId']; + _actInfo = json['actInfo']; + _productId = json['productId']; + _times = json['times']; + _usedTimes = json['usedTimes']; + _productName = json['productName']; + _skuId = json['skuId']; + _skuNameStr = json['skuNameStr']; + _skuImg = json['skuImg']; + _buyNum = json['buyNum']; + _refundNum = json['refundNum']; + _type = json['type']; + _reason = json['reason']; + _weight = json['weight']; + _applyPrice = json['applyPrice']; + _sellPrice = json['sellPrice']; + _postPay = json['postPay']; + _isDelete = json['isDelete']; + _discountAmount = json['discountAmount']; + _discountPercent = json['discountPercent']; + _status = json['status']; + _batch = json['batch']; + _deliveries = json['deliveries']; + _ticketType = json['ticketType']; + _ticketDays = json['ticketDays']; + _takeType = json['takeType']; + if (json['skuTickets'] != null) { + _skuTickets = []; + // json['skuTickets'].forEach((v) { + // _skuTickets.add(Dynamic.fromJson(v)); + // }); + } + _ticketStyle = json['ticketStyle']; + if (json['setMealDataList'] != null) { + _setMealDataList = []; + // json['setMealDataList'].forEach((v) { + // _setMealDataList.add(Dynamic.fromJson(v)); + // }); + } + _packagingFee = json['packagingFee']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _tenantCode; + String _storeId; + String _orderId; + dynamic _actInfo; + String _productId; + dynamic _times; + dynamic _usedTimes; + String _productName; + String _skuId; + String _skuNameStr; + String _skuImg; + num _buyNum; + num _refundNum; + num _type; + dynamic _reason; + num _weight; + String _applyPrice; + String _sellPrice; + String _postPay; + num _isDelete; + String _discountAmount; + num _discountPercent; + bool _status; + num _batch; + num _deliveries; + String _ticketType; + String _ticketDays; + dynamic _takeType; + List _skuTickets; + String _ticketStyle; + List _setMealDataList; + String _packagingFee; +OrderProductList copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String orderId, + dynamic actInfo, + String productId, + dynamic times, + dynamic usedTimes, + String productName, + String skuId, + String skuNameStr, + String skuImg, + num buyNum, + num refundNum, + num type, + dynamic reason, + num weight, + String applyPrice, + String sellPrice, + String postPay, + num isDelete, + String discountAmount, + num discountPercent, + bool status, + num batch, + num deliveries, + String ticketType, + String ticketDays, + dynamic takeType, + List skuTickets, + String ticketStyle, + List setMealDataList, + String packagingFee, +}) => OrderProductList( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + tenantCode: tenantCode ?? _tenantCode, + storeId: storeId ?? _storeId, + orderId: orderId ?? _orderId, + actInfo: actInfo ?? _actInfo, + productId: productId ?? _productId, + times: times ?? _times, + usedTimes: usedTimes ?? _usedTimes, + productName: productName ?? _productName, + skuId: skuId ?? _skuId, + skuNameStr: skuNameStr ?? _skuNameStr, + skuImg: skuImg ?? _skuImg, + buyNum: buyNum ?? _buyNum, + refundNum: refundNum ?? _refundNum, + type: type ?? _type, + reason: reason ?? _reason, + weight: weight ?? _weight, + applyPrice: applyPrice ?? _applyPrice, + sellPrice: sellPrice ?? _sellPrice, + postPay: postPay ?? _postPay, + isDelete: isDelete ?? _isDelete, + discountAmount: discountAmount ?? _discountAmount, + discountPercent: discountPercent ?? _discountPercent, + status: status ?? _status, + batch: batch ?? _batch, + deliveries: deliveries ?? _deliveries, + ticketType: ticketType ?? _ticketType, + ticketDays: ticketDays ?? _ticketDays, + takeType: takeType ?? _takeType, + skuTickets: skuTickets ?? _skuTickets, + ticketStyle: ticketStyle ?? _ticketStyle, + setMealDataList: setMealDataList ?? _setMealDataList, + packagingFee: packagingFee ?? _packagingFee, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get tenantCode => _tenantCode; + String get storeId => _storeId; + String get orderId => _orderId; + dynamic get actInfo => _actInfo; + String get productId => _productId; + dynamic get times => _times; + dynamic get usedTimes => _usedTimes; + String get productName => _productName; + String get skuId => _skuId; + String get skuNameStr => _skuNameStr; + String get skuImg => _skuImg; + num get buyNum => _buyNum; + num get refundNum => _refundNum; + num get type => _type; + dynamic get reason => _reason; + num get weight => _weight; + String get applyPrice => _applyPrice; + String get sellPrice => _sellPrice; + String get postPay => _postPay; + num get isDelete => _isDelete; + String get discountAmount => _discountAmount; + num get discountPercent => _discountPercent; + bool get status => _status; + num get batch => _batch; + num get deliveries => _deliveries; + String get ticketType => _ticketType; + String get ticketDays => _ticketDays; + dynamic get takeType => _takeType; + List get skuTickets => _skuTickets; + String get ticketStyle => _ticketStyle; + List get setMealDataList => _setMealDataList; + String get packagingFee => _packagingFee; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['tenantCode'] = _tenantCode; + map['storeId'] = _storeId; + map['orderId'] = _orderId; + map['actInfo'] = _actInfo; + map['productId'] = _productId; + map['times'] = _times; + map['usedTimes'] = _usedTimes; + map['productName'] = _productName; + map['skuId'] = _skuId; + map['skuNameStr'] = _skuNameStr; + map['skuImg'] = _skuImg; + map['buyNum'] = _buyNum; + map['refundNum'] = _refundNum; + map['type'] = _type; + map['reason'] = _reason; + map['weight'] = _weight; + map['applyPrice'] = _applyPrice; + map['sellPrice'] = _sellPrice; + map['postPay'] = _postPay; + map['isDelete'] = _isDelete; + map['discountAmount'] = _discountAmount; + map['discountPercent'] = _discountPercent; + map['status'] = _status; + map['batch'] = _batch; + map['deliveries'] = _deliveries; + map['ticketType'] = _ticketType; + map['ticketDays'] = _ticketDays; + map['takeType'] = _takeType; + if (_skuTickets != null) { + map['skuTickets'] = _skuTickets.map((v) => v.toJson()).toList(); + } + map['ticketStyle'] = _ticketStyle; + if (_setMealDataList != null) { + map['setMealDataList'] = _setMealDataList.map((v) => v.toJson()).toList(); + } + map['packagingFee'] = _packagingFee; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/invoices_history_list.dart b/lib/retrofit/data/invoices_history_list.dart new file mode 100644 index 00000000..4158b09e --- /dev/null +++ b/lib/retrofit/data/invoices_history_list.dart @@ -0,0 +1,385 @@ +/// records : [{"id":"1816408165248401408","createTime":"2024-07-25 17:40:28","createUser":"1379254113602109440","updateTime":"2024-07-25 17:40:28","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816397314357460992","1816396872328151040","1815299099583315968","1808758418991742976","1739531721478504448","1739529082455982080","1739528149030404096","1721749099142709248","1721748992578027520","1721748249640960000","1708069378165047296","1708069229195952128"],"money":"4.00","type":"ELECTRONIC","headerId":"1816011766241427456","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"u我i","invoiceHeaderCode":"1233456","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816394976490160128","createTime":"2024-07-25 16:48:04","createUser":"1379254113602109440","updateTime":"2024-07-25 16:48:04","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1808763201462992896"],"money":"0.01","type":"ELECTRONIC","headerId":"1816011766241427456","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"u我i","invoiceHeaderCode":"1233456","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816394876095299584","createTime":"2024-07-25 16:47:40","createUser":"1379254113602109440","updateTime":"2024-07-25 16:47:40","updateUser":"1379254113602109440","phone":"","receivingPhone":"131789456123","mid":"1379254113602109440","orderIds":["1808763658105257984"],"money":"0.01","type":"ELECTRONIC","headerId":"1816011766241427456","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"u我i","invoiceHeaderCode":"1233456","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816393433175031808","createTime":"2024-07-25 16:41:56","createUser":"1379254113602109440","updateTime":"2024-07-25 16:41:56","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1810210939736162304"],"money":"0.01","type":"ELECTRONIC","headerId":"1816011766241427456","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"u我i","invoiceHeaderCode":"1233456","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null}] +/// total : "4" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "1" + +class InvoicesHistoryList { + InvoicesHistoryList({ + List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages,}){ + _records = records; + _total = total; + _size = size; + _current = current; + _orders = orders; + _hitCount = hitCount; + _searchCount = searchCount; + _pages = pages; +} + + InvoicesHistoryList.fromJson(dynamic json) { + if (json['records'] != null) { + _records = []; + json['records'].forEach((v) { + _records.add(Records.fromJson(v)); + }); + } + _total = json['total']; + _size = json['size']; + _current = json['current']; + if (json['orders'] != null) { + _orders = []; + json['orders'].forEach((v) { + _orders.add(Orders.fromJson(v)); + }); + } + _hitCount = json['hitCount']; + _searchCount = json['searchCount']; + _pages = json['pages']; + } + List _records; + String _total; + String _size; + String _current; + List _orders; + bool _hitCount; + bool _searchCount; + String _pages; +InvoicesHistoryList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => InvoicesHistoryList( records: records ?? _records, + total: total ?? _total, + size: size ?? _size, + current: current ?? _current, + orders: orders ?? _orders, + hitCount: hitCount ?? _hitCount, + searchCount: searchCount ?? _searchCount, + pages: pages ?? _pages, +); + List get records => _records; + String get total => _total; + String get size => _size; + String get current => _current; + List get orders => _orders; + bool get hitCount => _hitCount; + bool get searchCount => _searchCount; + String get pages => _pages; + + Map toJson() { + final map = {}; + if (_records != null) { + map['records'] = _records.map((v) => v.toJson()).toList(); + } + map['total'] = _total; + map['size'] = _size; + map['current'] = _current; + if (_orders != null) { + map['orders'] = _orders.map((v) => v.toJson()).toList(); + } + map['hitCount'] = _hitCount; + map['searchCount'] = _searchCount; + map['pages'] = _pages; + return map; + } + +} + +/// column : "id" +/// asc : false + +class Orders { + Orders({ + String column, + bool asc,}){ + _column = column; + _asc = asc; +} + + Orders.fromJson(dynamic json) { + _column = json['column']; + _asc = json['asc']; + } + String _column; + bool _asc; +Orders copyWith({ String column, + bool asc, +}) => Orders( column: column ?? _column, + asc: asc ?? _asc, +); + String get column => _column; + bool get asc => _asc; + + Map toJson() { + final map = {}; + map['column'] = _column; + map['asc'] = _asc; + return map; + } + +} + +/// id : "1816408165248401408" +/// createTime : "2024-07-25 17:40:28" +/// createUser : "1379254113602109440" +/// updateTime : "2024-07-25 17:40:28" +/// updateUser : "1379254113602109440" +/// phone : "" +/// receivingPhone : "13052919193" +/// mid : "1379254113602109440" +/// orderIds : ["1816397314357460992","1816396872328151040","1815299099583315968","1808758418991742976","1739531721478504448","1739529082455982080","1739528149030404096","1721749099142709248","1721748992578027520","1721748249640960000","1708069378165047296","1708069229195952128"] +/// money : "4.00" +/// type : "ELECTRONIC" +/// headerId : "1816011766241427456" +/// state : "UN_AUDIT" +/// reviewerTime : null +/// reviewerBy : "0" +/// ossUrl : null +/// reason : "" +/// isDelete : 0 +/// invoiceHeaderName : "u我i" +/// invoiceHeaderCode : "1233456" +/// orderList : null +/// headertype : null +/// companyAddr : null +/// companyPhone : null +/// bank : null +/// bankNumber : null + +class Records { + Records({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String phone, + String receivingPhone, + String mid, + List orderIds, + String money, + String type, + String headerId, + String state, + dynamic reviewerTime, + String reviewerBy, + dynamic ossUrl, + String reason, + num isDelete, + String invoiceHeaderName, + String invoiceHeaderCode, + dynamic orderList, + dynamic headertype, + dynamic companyAddr, + dynamic companyPhone, + dynamic bank, + dynamic bankNumber,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _phone = phone; + _receivingPhone = receivingPhone; + _mid = mid; + _orderIds = orderIds; + _money = money; + _type = type; + _headerId = headerId; + _state = state; + _reviewerTime = reviewerTime; + _reviewerBy = reviewerBy; + _ossUrl = ossUrl; + _reason = reason; + _isDelete = isDelete; + _invoiceHeaderName = invoiceHeaderName; + _invoiceHeaderCode = invoiceHeaderCode; + _orderList = orderList; + _headertype = headertype; + _companyAddr = companyAddr; + _companyPhone = companyPhone; + _bank = bank; + _bankNumber = bankNumber; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _phone = json['phone']; + _receivingPhone = json['receivingPhone']; + _mid = json['mid']; + _orderIds = json['orderIds'] != null ? json['orderIds'].cast() : []; + _money = json['money']; + _type = json['type']; + _headerId = json['headerId']; + _state = json['state']; + _reviewerTime = json['reviewerTime']; + _reviewerBy = json['reviewerBy']; + _ossUrl = json['ossUrl']; + _reason = json['reason']; + _isDelete = json['isDelete']; + _invoiceHeaderName = json['invoiceHeaderName']; + _invoiceHeaderCode = json['invoiceHeaderCode']; + _orderList = json['orderList']; + _headertype = json['headertype']; + _companyAddr = json['companyAddr']; + _companyPhone = json['companyPhone']; + _bank = json['bank']; + _bankNumber = json['bankNumber']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _phone; + String _receivingPhone; + String _mid; + List _orderIds; + String _money; + String _type; + String _headerId; + String _state; + dynamic _reviewerTime; + String _reviewerBy; + dynamic _ossUrl; + String _reason; + num _isDelete; + String _invoiceHeaderName; + String _invoiceHeaderCode; + dynamic _orderList; + dynamic _headertype; + dynamic _companyAddr; + dynamic _companyPhone; + dynamic _bank; + dynamic _bankNumber; +Records copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String phone, + String receivingPhone, + String mid, + List orderIds, + String money, + String type, + String headerId, + String state, + dynamic reviewerTime, + String reviewerBy, + dynamic ossUrl, + String reason, + num isDelete, + String invoiceHeaderName, + String invoiceHeaderCode, + dynamic orderList, + dynamic headertype, + dynamic companyAddr, + dynamic companyPhone, + dynamic bank, + dynamic bankNumber, +}) => Records( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + phone: phone ?? _phone, + receivingPhone: receivingPhone ?? _receivingPhone, + mid: mid ?? _mid, + orderIds: orderIds ?? _orderIds, + money: money ?? _money, + type: type ?? _type, + headerId: headerId ?? _headerId, + state: state ?? _state, + reviewerTime: reviewerTime ?? _reviewerTime, + reviewerBy: reviewerBy ?? _reviewerBy, + ossUrl: ossUrl ?? _ossUrl, + reason: reason ?? _reason, + isDelete: isDelete ?? _isDelete, + invoiceHeaderName: invoiceHeaderName ?? _invoiceHeaderName, + invoiceHeaderCode: invoiceHeaderCode ?? _invoiceHeaderCode, + orderList: orderList ?? _orderList, + headertype: headertype ?? _headertype, + companyAddr: companyAddr ?? _companyAddr, + companyPhone: companyPhone ?? _companyPhone, + bank: bank ?? _bank, + bankNumber: bankNumber ?? _bankNumber, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get phone => _phone; + String get receivingPhone => _receivingPhone; + String get mid => _mid; + List get orderIds => _orderIds; + String get money => _money; + String get type => _type; + String get headerId => _headerId; + String get state => _state; + dynamic get reviewerTime => _reviewerTime; + String get reviewerBy => _reviewerBy; + dynamic get ossUrl => _ossUrl; + String get reason => _reason; + num get isDelete => _isDelete; + String get invoiceHeaderName => _invoiceHeaderName; + String get invoiceHeaderCode => _invoiceHeaderCode; + dynamic get orderList => _orderList; + dynamic get headertype => _headertype; + dynamic get companyAddr => _companyAddr; + dynamic get companyPhone => _companyPhone; + dynamic get bank => _bank; + dynamic get bankNumber => _bankNumber; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['phone'] = _phone; + map['receivingPhone'] = _receivingPhone; + map['mid'] = _mid; + map['orderIds'] = _orderIds; + map['money'] = _money; + map['type'] = _type; + map['headerId'] = _headerId; + map['state'] = _state; + map['reviewerTime'] = _reviewerTime; + map['reviewerBy'] = _reviewerBy; + map['ossUrl'] = _ossUrl; + map['reason'] = _reason; + map['isDelete'] = _isDelete; + map['invoiceHeaderName'] = _invoiceHeaderName; + map['invoiceHeaderCode'] = _invoiceHeaderCode; + map['orderList'] = _orderList; + map['headertype'] = _headertype; + map['companyAddr'] = _companyAddr; + map['companyPhone'] = _companyPhone; + map['bank'] = _bank; + map['bankNumber'] = _bankNumber; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/title_info_list.dart b/lib/retrofit/data/title_info_list.dart new file mode 100644 index 00000000..5c6fcb7c --- /dev/null +++ b/lib/retrofit/data/title_info_list.dart @@ -0,0 +1,286 @@ +/// records : [{"id":"1815947305409314816","createTime":"2024-07-24 11:09:11","createUser":"1379254113602109440","updateTime":"2024-07-24 11:09:11","updateUser":"1379254113602109440","userId":"1379254113602109440","isDefault":1,"type":"PERSONAL","name":"回乡信息","taxId":"202407027106","companyAddr":"中海中心","companyPhone":null,"bank":"中国银行","bankNumber":"4123456789987456123","isDelete":0}] +/// total : "1" +/// size : "50" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "1" + +class TitleInfoList { + TitleInfoList({ + List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages,}){ + _records = records; + _total = total; + _size = size; + _current = current; + _orders = orders; + _hitCount = hitCount; + _searchCount = searchCount; + _pages = pages; +} + + TitleInfoList.fromJson(dynamic json) { + if (json['records'] != null) { + _records = []; + json['records'].forEach((v) { + _records.add(Records.fromJson(v)); + }); + } + _total = json['total']; + _size = json['size']; + _current = json['current']; + if (json['orders'] != null) { + _orders = []; + json['orders'].forEach((v) { + _orders.add(Orders.fromJson(v)); + }); + } + _hitCount = json['hitCount']; + _searchCount = json['searchCount']; + _pages = json['pages']; + } + List _records; + String _total; + String _size; + String _current; + List _orders; + bool _hitCount; + bool _searchCount; + String _pages; +TitleInfoList copyWith({ List records, + String total, + String size, + String current, + List orders, + bool hitCount, + bool searchCount, + String pages, +}) => TitleInfoList( records: records ?? _records, + total: total ?? _total, + size: size ?? _size, + current: current ?? _current, + orders: orders ?? _orders, + hitCount: hitCount ?? _hitCount, + searchCount: searchCount ?? _searchCount, + pages: pages ?? _pages, +); + List get records => _records; + String get total => _total; + String get size => _size; + String get current => _current; + List get orders => _orders; + bool get hitCount => _hitCount; + bool get searchCount => _searchCount; + String get pages => _pages; + + Map toJson() { + final map = {}; + if (_records != null) { + map['records'] = _records.map((v) => v.toJson()).toList(); + } + map['total'] = _total; + map['size'] = _size; + map['current'] = _current; + if (_orders != null) { + map['orders'] = _orders.map((v) => v.toJson()).toList(); + } + map['hitCount'] = _hitCount; + map['searchCount'] = _searchCount; + map['pages'] = _pages; + return map; + } + +} + +/// column : "id" +/// asc : false + +class Orders { + Orders({ + String column, + bool asc,}){ + _column = column; + _asc = asc; +} + + Orders.fromJson(dynamic json) { + _column = json['column']; + _asc = json['asc']; + } + String _column; + bool _asc; +Orders copyWith({ String column, + bool asc, +}) => Orders( column: column ?? _column, + asc: asc ?? _asc, +); + String get column => _column; + bool get asc => _asc; + + Map toJson() { + final map = {}; + map['column'] = _column; + map['asc'] = _asc; + return map; + } + +} + +/// id : "1815947305409314816" +/// createTime : "2024-07-24 11:09:11" +/// createUser : "1379254113602109440" +/// updateTime : "2024-07-24 11:09:11" +/// updateUser : "1379254113602109440" +/// userId : "1379254113602109440" +/// isDefault : 1 +/// type : "PERSONAL" +/// name : "回乡信息" +/// taxId : "202407027106" +/// companyAddr : "中海中心" +/// companyPhone : null +/// bank : "中国银行" +/// bankNumber : "4123456789987456123" +/// isDelete : 0 + +class Records { + Records({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String userId, + num isDefault, + String type, + String name, + String taxId, + String companyAddr, + dynamic companyPhone, + String bank, + String bankNumber, + num isDelete,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _userId = userId; + _isDefault = isDefault; + _type = type; + _name = name; + _taxId = taxId; + _companyAddr = companyAddr; + _companyPhone = companyPhone; + _bank = bank; + _bankNumber = bankNumber; + _isDelete = isDelete; +} + + Records.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _userId = json['userId']; + _isDefault = json['isDefault']; + _type = json['type']; + _name = json['name']; + _taxId = json['taxId']; + _companyAddr = json['companyAddr']; + _companyPhone = json['companyPhone']; + _bank = json['bank']; + _bankNumber = json['bankNumber']; + _isDelete = json['isDelete']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _userId; + num _isDefault; + String _type; + String _name; + String _taxId; + String _companyAddr; + dynamic _companyPhone; + String _bank; + String _bankNumber; + num _isDelete; +Records copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String userId, + num isDefault, + String type, + String name, + String taxId, + String companyAddr, + dynamic companyPhone, + String bank, + String bankNumber, + num isDelete, +}) => Records( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + userId: userId ?? _userId, + isDefault: isDefault ?? _isDefault, + type: type ?? _type, + name: name ?? _name, + taxId: taxId ?? _taxId, + companyAddr: companyAddr ?? _companyAddr, + companyPhone: companyPhone ?? _companyPhone, + bank: bank ?? _bank, + bankNumber: bankNumber ?? _bankNumber, + isDelete: isDelete ?? _isDelete, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get userId => _userId; + num get isDefault => _isDefault; + String get type => _type; + String get name => _name; + String get taxId => _taxId; + String get companyAddr => _companyAddr; + dynamic get companyPhone => _companyPhone; + String get bank => _bank; + String get bankNumber => _bankNumber; + num get isDelete => _isDelete; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['userId'] = _userId; + map['isDefault'] = _isDefault; + map['type'] = _type; + map['name'] = _name; + map['taxId'] = _taxId; + map['companyAddr'] = _companyAddr; + map['companyPhone'] = _companyPhone; + map['bank'] = _bank; + map['bankNumber'] = _bankNumber; + map['isDelete'] = _isDelete; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 4ca5a825..6c6f2a94 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -19,7 +19,6 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; import '../login/captcha/click_word_captcha.dart'; -import '../utils/flutter_utils.dart'; import 'data/achievement_detail_list.dart'; import 'data/activity_pos.dart'; import 'data/address.dart'; @@ -41,6 +40,8 @@ import 'data/headlines_list.dart'; import 'data/headlines_list_details.dart'; import 'data/home_rank.dart'; import 'data/invitation_list.dart'; +import 'data/invoice_list.dart'; +import 'data/invoices_history_list.dart'; import 'data/ip_data.dart'; import 'data/logistics.dart'; import 'data/member_Infor.dart'; @@ -54,6 +55,7 @@ import 'data/second_card_list.dart'; import 'data/sign_info.dart'; import 'data/social_info.dart'; import 'data/store.dart'; +import 'data/title_info_list.dart'; import 'data/upload_result.dart'; import 'data/user_bill.dart'; import 'data/user_info.dart'; @@ -611,4 +613,32 @@ abstract class ApiService { ///获取APP门店推广渠道 @GET("/ipJson.jsp") Future getIpInfo(); + + ///查询订单状态完成的并且可以开发票的订单列表 + @POST("order/invoiceOrderList") + Future> invoiceOrderList(@Body() Map param); + + ///新增发票抬头 + @POST("invoiceHeader") + Future invoiceHeader(@Body() Map param); + + ///修改发票抬头 + @PUT("invoiceHeader") + Future invoiceHeaders(@Body() Map param); + + ///抬头信息列表 + @POST("invoiceHeader/page") + Future> invoiceHeaderList(@Body() Map param); + + ///删除抬头信息 + @DELETE("invoiceHeader?ids[]={ids}") + Future delInvoiceHeader(@Path("ids") String ids); + + ///提交发票审核 + @POST("invoice") + Future invoiceSubmit(@Body() Map param); + + ///开票历史 + @POST("invoice/page") + Future> invoicePage(@Body() Map param); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 65f62dad..37ffa091 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -2302,4 +2302,164 @@ class _ApiService implements ApiService { .toList()); return value; } + + @override + Future> invoiceOrderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'order/invoiceOrderList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : InvoiceList.fromJson(json), + ); + return value; + } + + @override + Future invoiceHeader(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'invoiceHeader', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : json, + ); + return value; + } + + @override + Future invoiceHeaders(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'invoiceHeader', + queryParameters: queryParameters, + options: RequestOptions( + method: 'PUT', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : json, + ); + return value; + } + + @override + Future> invoiceHeaderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'invoiceHeader/page', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : TitleInfoList.fromJson(json), + ); + return value; + } + + @override + Future> delInvoiceHeader(ids) async { + ArgumentError.checkNotNull(ids, 'ids'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'invoiceHeader?ids[]=$ids', + queryParameters: queryParameters, + options: RequestOptions( + method: 'DELETE', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future invoiceSubmit(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'invoice', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : json, + ); + return value; + } + + @override + Future> invoicePage(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'invoice/page', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => (json ?? "") == "" ? null : InvoicesHistoryList.fromJson(json), + ); + return value; + } } diff --git a/lib/utils/status_utils.dart b/lib/utils/status_utils.dart index 78f9450f..42619f0e 100644 --- a/lib/utils/status_utils.dart +++ b/lib/utils/status_utils.dart @@ -89,6 +89,7 @@ class StatusUtils { static List statusBtn( context, payStatus, + payChannel, orderStatus, isTakeOut, sendStatus, @@ -260,6 +261,33 @@ class StatusUtils { SizedBox( width: 10.w, ), + //因接口问题,列表不展示开票入口,统一从发票助手进入 + // if(payChannel == 0 || payChannel == 1 || payChannel == 2) + // Container( + // width: 72.w, + // height: 24.h, + // child: TextButton( + // onPressed: () { + // Navigator.of(context).pushNamed('/router/invoices_manage_page'); + // }, + // style: ButtonStyle( + // padding: MaterialStateProperty.all(EdgeInsets.zero), + // side: MaterialStateProperty.all( + // BorderSide( + // color: Color(0xff32A060), + // width: 0.5, + // ), + // ), + // ), + // child: Text( + // "开发票", + // style: TextStyle( + // color: Color(0xff32A060), + // fontSize: 12.sp, + // ), + // ), + // ), + // ), ]; } }