From bf023f794ac543dda08b509db04018e91d705029 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 14 Aug 2024 12:24:59 +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=20=E6=96=B0=E5=A2=9E=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=9B=20pdf=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A4=84=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=88flutter=5Fpdfview=EF=BC=89=EF=BC=9B=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E7=A5=A8=E8=AF=A6=E6=83=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/data/invoice_list.dart | 1198 ++++++++++++++ lib/data/invoices_detail_info.dart | 1472 +++++++++++++++++ lib/data/invoices_history_list.dart | 385 +++++ lib/data/title_info_list.dart | 286 ++++ lib/login/login_page.dart | 2 +- lib/main.dart | 15 + lib/mine/mine_view/mine_item.dart | 11 +- .../invoices_manage/add_invoices_title.dart | 911 ++++++++-- .../invoices_manage/edit_invoices_info.dart | 599 +++++++ .../invoices_manage/invoices_detail_page.dart | 820 +++++++++ .../invoices_manage/invoices_history.dart | 462 ++++++ .../invoices_manage/invoices_manage_page.dart | 678 ++++++++ .../invoices_manage/invoices_title_info.dart | 577 +++++++ lib/order/invoices_manage/pdf_screen.dart | 195 +++ lib/retrofit/retrofit_api.dart | 37 + lib/retrofit/retrofit_api.g.dart | 222 +++ lib/utils/status_utils.dart | 53 +- pubspec.lock | 8 + pubspec.yaml | 2 + 19 files changed, 7812 insertions(+), 121 deletions(-) create mode 100644 lib/data/invoice_list.dart create mode 100644 lib/data/invoices_detail_info.dart create mode 100644 lib/data/invoices_history_list.dart create mode 100644 lib/data/title_info_list.dart create mode 100644 lib/order/invoices_manage/edit_invoices_info.dart create mode 100644 lib/order/invoices_manage/invoices_detail_page.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/order/invoices_manage/pdf_screen.dart diff --git a/lib/data/invoice_list.dart b/lib/data/invoice_list.dart new file mode 100644 index 00000000..1819f611 --- /dev/null +++ b/lib/data/invoice_list.dart @@ -0,0 +1,1198 @@ +/// records : [{"id":"1816725032987000832","createTime":"2024-07-26 14:39:36","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":"1816725033523871744","createTime":"2024-07-26 14:39:36","createUser":"1428617748061093888","updateTime":"2024-07-26 14:39:36","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1432164681279078400","orderId":"1816725032987000832","actInfo":null,"productId":"-2","times":null,"usedTimes":null,"productName":"扫码支付","skuId":"-2","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":false,"batch":0,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"businessType":null,"paySum":"2.00","useInvoice":null,"payedPrice":"2.00","finalPayPrice":"2.00","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1816713266378833920","createTime":"2024-07-26 13:52:50","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":"1816713270577332224","createTime":"2024-07-26 13:52:51","createUser":"1428617748061093888","updateTime":"2024-07-26 13:52:51","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1432164681279078400","orderId":"1816713266378833920","actInfo":null,"productId":"-2","times":null,"usedTimes":null,"productName":"扫码支付","skuId":"-2","skuNameStr":"扫码支付","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"0.01","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":false,"batch":0,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":null,"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":"1816681510762184704","createTime":"2024-07-26 11:46:39","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":"1816681513949855744","createTime":"2024-07-26 11:46:40","createUser":"1428617748061093888","updateTime":"2024-07-26 11:46:40","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1665555596536971264","orderId":"1816681510762184704","actInfo":null,"productId":"-2","times":null,"usedTimes":null,"productName":"扫码支付","skuId":"-2","skuNameStr":"扫码支付","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"0.69","sellPrice":"0.69","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":false,"batch":0,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"businessType":null,"paySum":"0.69","useInvoice":null,"payedPrice":"0.69","finalPayPrice":"0.69","isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null}] +/// total : "3" +/// 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 : "1816725032987000832" +/// createTime : "2024-07-26 14:39:36" +/// 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":"1816725033523871744","createTime":"2024-07-26 14:39:36","createUser":"1428617748061093888","updateTime":"2024-07-26 14:39:36","updateUser":"1428617748061093888","tenantCode":"1175","storeId":"1432164681279078400","orderId":"1816725032987000832","actInfo":null,"productId":"-2","times":null,"usedTimes":null,"productName":"扫码支付","skuId":"-2","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":false,"batch":0,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":null,"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}] +/// businessType : null +/// paySum : "2.00" +/// useInvoice : null +/// payedPrice : "2.00" +/// finalPayPrice : "2.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 : "1816725033523871744" +/// createTime : "2024-07-26 14:39:36" +/// createUser : "1428617748061093888" +/// updateTime : "2024-07-26 14:39:36" +/// updateUser : "1428617748061093888" +/// tenantCode : "1175" +/// storeId : "1432164681279078400" +/// orderId : "1816725032987000832" +/// actInfo : null +/// productId : "-2" +/// times : null +/// usedTimes : null +/// productName : "扫码支付" +/// skuId : "-2" +/// 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 : false +/// batch : 0 +/// deliveries : 0 +/// ticketType : "" +/// ticketDays : "0" +/// takeType : null +/// skuTickets : null +/// ticketStyle : "" +/// setMealDataList : null +/// 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, + dynamic skuTickets, + String? ticketStyle, + dynamic 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']; + _skuTickets = json['skuTickets']; + _ticketStyle = json['ticketStyle']; + _setMealDataList = json['setMealDataList']; + _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; + dynamic _skuTickets; + String? _ticketStyle; + dynamic _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, + dynamic skuTickets, + String? ticketStyle, + dynamic 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; + dynamic get skuTickets => _skuTickets; + String? get ticketStyle => _ticketStyle; + dynamic 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; + map['skuTickets'] = _skuTickets; + map['ticketStyle'] = _ticketStyle; + map['setMealDataList'] = _setMealDataList; + map['packagingFee'] = _packagingFee; + return map; + } + +} \ No newline at end of file diff --git a/lib/data/invoices_detail_info.dart b/lib/data/invoices_detail_info.dart new file mode 100644 index 00000000..22d5f439 --- /dev/null +++ b/lib/data/invoices_detail_info.dart @@ -0,0 +1,1472 @@ +/// id : "1819597461556035584" +/// createTime : "2024-08-03 12:53:36" +/// createUser : "1806191393635303424" +/// updateTime : "2024-08-06 09:59:36" +/// updateUser : "0" +/// phone : "04122910688" +/// receivingPhone : "15842244123" +/// mid : "1806191393635303424" +/// orderIds : ["1819561960786624512","1806191906170863616"] +/// money : "128.00" +/// type : "ELECTRONIC" +/// headerId : "1819564499242319872" +/// state : "AUDIT_PASS" +/// reviewerTime : "2024-08-06 09:59:36" +/// reviewerBy : "1783126216884797442" +/// ossUrl : "https://file.oa.yixinhuixiang.com/2024/08/06/e716b61ed0c4444db4e8e33bf2712432.pdf" +/// reason : "" +/// isDelete : 0 +/// invoiceHeaderName : "后英集团鞍山活龙矿业有限公司" +/// invoiceHeaderCode : "91210300119151260U" +/// orderList : [{"id":"1806191906170863616","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","storeName":"海峡姐妹茶膳坊","tableId":"1696410065575084032","responsible":null,"orderType":0,"clearTable":false,"mid":"1806191393635303424","parentId":"0","parentCode":null,"orderCode":"202406271304420002","dayFlowCode":"387","orderStatus":4,"sendStatus":0,"payStatus":1,"haveTimes":false,"invoicing":true,"memberAccount":"_oN8Jj42Co26O5WO3YmEdPoA--tgk","owner":"1806191393635303424","logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"refundStatus":0,"addressExt":{"addressId":null,"country":null,"countryId":null,"province":"北京","provinceId":null,"city":"北京","cityId":null,"district":"东城区","districtId":null,"cityInfo":null,"address":"北京市东城区毛家湾胡同甲13号北京站第八候车室西侧第一跨2-8-1B","recName":null,"recMobile":null,"longitude":"116.427341","latitude":"39.902842"},"contactsExtList":null,"postFee":"0.00","totalPackagingFee":"0.00","couponSubPrice":"0.00","removeDecimal":"0.00","isSubscribe":false,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":"","prepayId":"WxPayMpOrderResult(appId=wx8f3ce8f059abff52, timeStamp=1719464683, nonceStr=ZYJQdVgtxb7N2TId, packageValue=prepay_id=wx27130443445531311c29498a3c6c400001, signType=MD5, paySign=46FE1C4141A27095B3C5B6F1642A9005)","payTime":"2024-06-27 13:04:49","payChannel":1,"payNum":"","promotionId":"0","actId":"0","couponId":"0","isDelete":0,"isTakeOut":4,"batch":1,"orderDiscountPrice":"0.00","dishesDiscountPrice":"0.00","orderPercentPrice":"0.00","activityNoPrice":"0.00","activityDiscountPrice":"0.00","uniqueDiscountType":"AUTO","totalDiscountPrice":null,"vipDayDiscountPrice":"0.00","orderSource":1,"benefitDiscountAmount":"0.00","vipDiscountPrice":"0.00","orderMerge":null,"canSettlement":true,"endRefundTime":null,"orderProductList":[{"id":"1806191906217000960","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1646769691940618240","times":null,"usedTimes":null,"productName":"素燥饭","skuId":"1646769691995144192","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"24.00","sellPrice":"24.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":null,"packagingFee":"0.00"},{"id":"1806191906221195264","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1646774726388875264","times":null,"usedTimes":null,"productName":"猪排咖喱饭","skuId":"1646774726443401216","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"46.00","sellPrice":"46.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":null,"packagingFee":"0.00"},{"id":"1806191906225389568","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1647859487752585216","times":null,"usedTimes":null,"productName":"卤蛋","skuId":"1647859487807111168","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"3.00","sellPrice":"3.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":null,"packagingFee":"0.00"},{"id":"1806191906225389569","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1647847691482300416","times":null,"usedTimes":null,"productName":"炸杏鲍菇","skuId":"1647847691570380800","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"15.00","sellPrice":"15.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":null,"packagingFee":"0.00"}],"businessType":null,"paySum":"91.00","useInvoice":null,"payedPrice":"91.00","finalPayPrice":null,"isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null},{"id":"1819561960786624512","createTime":"2024-08-03 10:32:32","createUser":"1806191393635303424","updateTime":"2024-08-03 10:32:32","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","storeName":"海峡姐妹茶膳坊","tableId":"1696410209934639104","responsible":null,"orderType":0,"clearTable":false,"mid":"1806191393635303424","parentId":"0","parentCode":null,"orderCode":"202408031032310009","dayFlowCode":"389","orderStatus":4,"sendStatus":0,"payStatus":1,"haveTimes":false,"invoicing":true,"memberAccount":"_oN8Jj42Co26O5WO3YmEdPoA--tgk","owner":"1819561597685727232","logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"refundStatus":0,"addressExt":{"addressId":null,"country":null,"countryId":null,"province":"北京","provinceId":null,"city":"北京","cityId":null,"district":"东城区","districtId":null,"cityInfo":null,"address":"北京市东城区毛家湾胡同甲13号北京站第八候车室西侧第一跨2-8-1B","recName":null,"recMobile":null,"longitude":"116.427341","latitude":"39.902842"},"contactsExtList":null,"postFee":"0.00","totalPackagingFee":"0.00","couponSubPrice":"0.00","removeDecimal":"0.00","isSubscribe":false,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":"","prepayId":"WxPayMpOrderResult(appId=wx8f3ce8f059abff52, timeStamp=1722652353, nonceStr=N5mxWYstroaSFUnv, packageValue=prepay_id=wx03103233026690f13768cd8eedb2730001, signType=MD5, paySign=32928F5E4BBBACDE7F2A72D784814E61)","payTime":"2024-08-03 10:32:39","payChannel":1,"payNum":"","promotionId":"0","actId":"0","couponId":"0","isDelete":0,"isTakeOut":4,"batch":1,"orderDiscountPrice":"0.00","dishesDiscountPrice":"0.00","orderPercentPrice":"0.00","activityNoPrice":"0.00","activityDiscountPrice":"0.00","uniqueDiscountType":"AUTO","totalDiscountPrice":null,"vipDayDiscountPrice":"0.00","orderSource":1,"benefitDiscountAmount":"0.00","vipDiscountPrice":"0.00","orderMerge":null,"canSettlement":true,"endRefundTime":null,"orderProductList":[{"id":"1819561960891482112","createTime":"2024-08-03 10:32:32","createUser":"1806191393635303424","updateTime":"2024-08-03 10:32:32","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1819561960786624512","actInfo":null,"productId":"1647843685146034176","times":null,"usedTimes":null,"productName":"素燥饭套餐","skuId":"1647843685221531648","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"37.00","sellPrice":"37.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":[{"groupName":"主食(选一)","productInfoList":[{"skuId":"1646769691995144192","skuName":"","storeId":null,"buyNumber":1,"productId":"1646769691940618240","sellPrice":24.0,"productName":"素燥饭"}]},{"groupName":"汤品(选一)","productInfoList":[{"skuId":"1646820518692651008","skuName":"","storeId":null,"buyNumber":1,"productId":"1646820518629736448","sellPrice":15.0,"productName":"回乡贡丸汤"}]}],"packagingFee":"0.00"}],"businessType":null,"paySum":"37.00","useInvoice":null,"payedPrice":"37.00","finalPayPrice":null,"isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null}] +/// headertype : "COMPANY" +/// companyAddr : "鞍山市千山区汤岗子镇活龙寨村" +/// companyPhone : "04122910688" +/// bank : "中国银行海城支行" +/// bankNumber : "311656314106" + +class InvoicesDetailInfo { + InvoicesDetailInfo({ + 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, + String? reviewerTime, + String? reviewerBy, + String? ossUrl, + String? reason, + num? isDelete, + String? invoiceHeaderName, + String? invoiceHeaderCode, + List? orderList, + String? headertype, + String? companyAddr, + String? companyPhone, + String? bank, + String? 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; +} + + InvoicesDetailInfo.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']; + if (json['orderList'] != null) { + _orderList = []; + json['orderList'].forEach((v) { + _orderList?.add(OrderList.fromJson(v)); + }); + } + _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; + String? _reviewerTime; + String? _reviewerBy; + String? _ossUrl; + String? _reason; + num? _isDelete; + String? _invoiceHeaderName; + String? _invoiceHeaderCode; + List? _orderList; + String? _headertype; + String? _companyAddr; + String? _companyPhone; + String? _bank; + String? _bankNumber; +InvoicesDetailInfo 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, + String? reviewerTime, + String? reviewerBy, + String? ossUrl, + String? reason, + num? isDelete, + String? invoiceHeaderName, + String? invoiceHeaderCode, + List? orderList, + String? headertype, + String? companyAddr, + String? companyPhone, + String? bank, + String? bankNumber, +}) => InvoicesDetailInfo( 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; + String? get reviewerTime => _reviewerTime; + String? get reviewerBy => _reviewerBy; + String? get ossUrl => _ossUrl; + String? get reason => _reason; + num? get isDelete => _isDelete; + String? get invoiceHeaderName => _invoiceHeaderName; + String? get invoiceHeaderCode => _invoiceHeaderCode; + List? get orderList => _orderList; + String? get headertype => _headertype; + String? get companyAddr => _companyAddr; + String? get companyPhone => _companyPhone; + String? get bank => _bank; + String? 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; + if (_orderList != null) { + map['orderList'] = _orderList?.map((v) => v.toJson()).toList(); + } + map['headertype'] = _headertype; + map['companyAddr'] = _companyAddr; + map['companyPhone'] = _companyPhone; + map['bank'] = _bank; + map['bankNumber'] = _bankNumber; + return map; + } + +} + +/// id : "1806191906170863616" +/// createTime : "2024-06-27 13:04:43" +/// createUser : "1806191393635303424" +/// updateTime : "2024-06-27 13:04:43" +/// updateUser : "1806191393635303424" +/// tenantCode : "1193" +/// storeId : "1627869775969386496" +/// storeName : "海峡姐妹茶膳坊" +/// tableId : "1696410065575084032" +/// responsible : null +/// orderType : 0 +/// clearTable : false +/// mid : "1806191393635303424" +/// parentId : "0" +/// parentCode : null +/// orderCode : "202406271304420002" +/// dayFlowCode : "387" +/// orderStatus : 4 +/// sendStatus : 0 +/// payStatus : 1 +/// haveTimes : false +/// invoicing : true +/// memberAccount : "_oN8Jj42Co26O5WO3YmEdPoA--tgk" +/// owner : "1806191393635303424" +/// logisticsId : "0" +/// shipperCode : "" +/// logisticsName : "" +/// logisticsNum : "" +/// logisticsCase : null +/// refundStatus : 0 +/// addressExt : {"addressId":null,"country":null,"countryId":null,"province":"北京","provinceId":null,"city":"北京","cityId":null,"district":"东城区","districtId":null,"cityInfo":null,"address":"北京市东城区毛家湾胡同甲13号北京站第八候车室西侧第一跨2-8-1B","recName":null,"recMobile":null,"longitude":"116.427341","latitude":"39.902842"} +/// contactsExtList : null +/// postFee : "0.00" +/// totalPackagingFee : "0.00" +/// couponSubPrice : "0.00" +/// removeDecimal : "0.00" +/// isSubscribe : false +/// subcribeTime : null +/// sendTime : null +/// confirmTime : null +/// returnMoneyTime : null +/// notes : "" +/// prepayId : "WxPayMpOrderResult(appId=wx8f3ce8f059abff52, timeStamp=1719464683, nonceStr=ZYJQdVgtxb7N2TId, packageValue=prepay_id=wx27130443445531311c29498a3c6c400001, signType=MD5, paySign=46FE1C4141A27095B3C5B6F1642A9005)" +/// payTime : "2024-06-27 13:04:49" +/// payChannel : 1 +/// payNum : "" +/// promotionId : "0" +/// actId : "0" +/// couponId : "0" +/// isDelete : 0 +/// isTakeOut : 4 +/// batch : 1 +/// orderDiscountPrice : "0.00" +/// dishesDiscountPrice : "0.00" +/// orderPercentPrice : "0.00" +/// activityNoPrice : "0.00" +/// activityDiscountPrice : "0.00" +/// uniqueDiscountType : "AUTO" +/// totalDiscountPrice : null +/// vipDayDiscountPrice : "0.00" +/// orderSource : 1 +/// benefitDiscountAmount : "0.00" +/// vipDiscountPrice : "0.00" +/// orderMerge : null +/// canSettlement : true +/// endRefundTime : null +/// orderProductList : [{"id":"1806191906217000960","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1646769691940618240","times":null,"usedTimes":null,"productName":"素燥饭","skuId":"1646769691995144192","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"24.00","sellPrice":"24.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":null,"packagingFee":"0.00"},{"id":"1806191906221195264","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1646774726388875264","times":null,"usedTimes":null,"productName":"猪排咖喱饭","skuId":"1646774726443401216","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"46.00","sellPrice":"46.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":null,"packagingFee":"0.00"},{"id":"1806191906225389568","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1647859487752585216","times":null,"usedTimes":null,"productName":"卤蛋","skuId":"1647859487807111168","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"3.00","sellPrice":"3.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":null,"packagingFee":"0.00"},{"id":"1806191906225389569","createTime":"2024-06-27 13:04:43","createUser":"1806191393635303424","updateTime":"2024-06-27 13:04:43","updateUser":"1806191393635303424","tenantCode":"1193","storeId":"1627869775969386496","orderId":"1806191906170863616","actInfo":null,"productId":"1647847691482300416","times":null,"usedTimes":null,"productName":"炸杏鲍菇","skuId":"1647847691570380800","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"15.00","sellPrice":"15.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":null,"packagingFee":"0.00"}] +/// businessType : null +/// paySum : "91.00" +/// useInvoice : null +/// payedPrice : "91.00" +/// finalPayPrice : null +/// isEnableSubscribePay : null +/// invoiceId : null +/// invoiceState : null +/// posType : null + +class OrderList { + OrderList({ + String? id, + String? createTime, + String? createUser, + String? updateTime, + String? updateUser, + String? tenantCode, + String? storeId, + String? storeName, + String? tableId, + dynamic responsible, + num? orderType, + bool? clearTable, + String? mid, + String? parentId, + dynamic parentCode, + String? orderCode, + String? dayFlowCode, + num? orderStatus, + num? sendStatus, + num? payStatus, + bool? haveTimes, + bool? invoicing, + String? memberAccount, + String? owner, + String? logisticsId, + String? shipperCode, + String? logisticsName, + String? logisticsNum, + dynamic logisticsCase, + num? refundStatus, + AddressExt? addressExt, + dynamic contactsExtList, + String? postFee, + String? totalPackagingFee, + String? couponSubPrice, + String? removeDecimal, + bool? isSubscribe, + dynamic subcribeTime, + dynamic sendTime, + dynamic confirmTime, + dynamic returnMoneyTime, + String? notes, + String? prepayId, + String? payTime, + num? payChannel, + String? payNum, + String? promotionId, + String? actId, + String? couponId, + num? isDelete, + num? isTakeOut, + num? batch, + String? orderDiscountPrice, + String? dishesDiscountPrice, + String? orderPercentPrice, + String? activityNoPrice, + String? activityDiscountPrice, + String? uniqueDiscountType, + dynamic totalDiscountPrice, + String? vipDayDiscountPrice, + num? orderSource, + String? benefitDiscountAmount, + String? vipDiscountPrice, + dynamic orderMerge, + bool? canSettlement, + dynamic endRefundTime, + List? orderProductList, + dynamic businessType, + String? paySum, + dynamic useInvoice, + String? payedPrice, + dynamic 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; +} + + OrderList.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'] != null ? AddressExt.fromJson(json['addressExt']) : null; + _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; + String? _createUser; + String? _updateTime; + String? _updateUser; + String? _tenantCode; + String? _storeId; + String? _storeName; + String? _tableId; + dynamic _responsible; + num? _orderType; + bool? _clearTable; + String? _mid; + String? _parentId; + dynamic _parentCode; + String? _orderCode; + String? _dayFlowCode; + num? _orderStatus; + num? _sendStatus; + num? _payStatus; + bool? _haveTimes; + bool? _invoicing; + String? _memberAccount; + String? _owner; + String? _logisticsId; + String? _shipperCode; + String? _logisticsName; + String? _logisticsNum; + dynamic _logisticsCase; + num? _refundStatus; + AddressExt? _addressExt; + dynamic _contactsExtList; + String? _postFee; + String? _totalPackagingFee; + String? _couponSubPrice; + String? _removeDecimal; + bool? _isSubscribe; + dynamic _subcribeTime; + dynamic _sendTime; + dynamic _confirmTime; + dynamic _returnMoneyTime; + String? _notes; + String? _prepayId; + String? _payTime; + num? _payChannel; + String? _payNum; + String? _promotionId; + String? _actId; + String? _couponId; + num? _isDelete; + num? _isTakeOut; + num? _batch; + String? _orderDiscountPrice; + String? _dishesDiscountPrice; + String? _orderPercentPrice; + String? _activityNoPrice; + String? _activityDiscountPrice; + String? _uniqueDiscountType; + dynamic _totalDiscountPrice; + String? _vipDayDiscountPrice; + num? _orderSource; + String? _benefitDiscountAmount; + String? _vipDiscountPrice; + dynamic _orderMerge; + bool? _canSettlement; + dynamic _endRefundTime; + List? _orderProductList; + dynamic _businessType; + String? _paySum; + dynamic _useInvoice; + String? _payedPrice; + dynamic _finalPayPrice; + dynamic _isEnableSubscribePay; + dynamic _invoiceId; + dynamic _invoiceState; + dynamic _posType; +OrderList copyWith({ String? id, + String? createTime, + String? createUser, + String? updateTime, + String? updateUser, + String? tenantCode, + String? storeId, + String? storeName, + String? tableId, + dynamic responsible, + num? orderType, + bool? clearTable, + String? mid, + String? parentId, + dynamic parentCode, + String? orderCode, + String? dayFlowCode, + num? orderStatus, + num? sendStatus, + num? payStatus, + bool? haveTimes, + bool? invoicing, + String? memberAccount, + String? owner, + String? logisticsId, + String? shipperCode, + String? logisticsName, + String? logisticsNum, + dynamic logisticsCase, + num? refundStatus, + AddressExt? addressExt, + dynamic contactsExtList, + String? postFee, + String? totalPackagingFee, + String? couponSubPrice, + String? removeDecimal, + bool? isSubscribe, + dynamic subcribeTime, + dynamic sendTime, + dynamic confirmTime, + dynamic returnMoneyTime, + String? notes, + String? prepayId, + String? payTime, + num? payChannel, + String? payNum, + String? promotionId, + String? actId, + String? couponId, + num? isDelete, + num? isTakeOut, + num? batch, + String? orderDiscountPrice, + String? dishesDiscountPrice, + String? orderPercentPrice, + String? activityNoPrice, + String? activityDiscountPrice, + String? uniqueDiscountType, + dynamic totalDiscountPrice, + String? vipDayDiscountPrice, + num? orderSource, + String? benefitDiscountAmount, + String? vipDiscountPrice, + dynamic orderMerge, + bool? canSettlement, + dynamic endRefundTime, + List? orderProductList, + dynamic businessType, + String? paySum, + dynamic useInvoice, + String? payedPrice, + dynamic finalPayPrice, + dynamic isEnableSubscribePay, + dynamic invoiceId, + dynamic invoiceState, + dynamic posType, +}) => OrderList( 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; + String? get createUser => _createUser; + String? get updateTime => _updateTime; + String? get updateUser => _updateUser; + String? get tenantCode => _tenantCode; + String? get storeId => _storeId; + String? get storeName => _storeName; + String? get tableId => _tableId; + dynamic get responsible => _responsible; + num? get orderType => _orderType; + bool? get clearTable => _clearTable; + String? get mid => _mid; + String? get parentId => _parentId; + dynamic get parentCode => _parentCode; + String? get orderCode => _orderCode; + String? get dayFlowCode => _dayFlowCode; + num? get orderStatus => _orderStatus; + num? get sendStatus => _sendStatus; + num? get payStatus => _payStatus; + bool? get haveTimes => _haveTimes; + bool? get invoicing => _invoicing; + String? get memberAccount => _memberAccount; + String? get owner => _owner; + String? get logisticsId => _logisticsId; + String? get shipperCode => _shipperCode; + String? get logisticsName => _logisticsName; + String? get logisticsNum => _logisticsNum; + dynamic get logisticsCase => _logisticsCase; + num? get refundStatus => _refundStatus; + AddressExt? get addressExt => _addressExt; + dynamic get contactsExtList => _contactsExtList; + String? get postFee => _postFee; + String? get totalPackagingFee => _totalPackagingFee; + String? get couponSubPrice => _couponSubPrice; + String? get removeDecimal => _removeDecimal; + bool? get isSubscribe => _isSubscribe; + dynamic get subcribeTime => _subcribeTime; + dynamic get sendTime => _sendTime; + dynamic get confirmTime => _confirmTime; + dynamic get returnMoneyTime => _returnMoneyTime; + String? get notes => _notes; + String? get prepayId => _prepayId; + String? get payTime => _payTime; + num? get payChannel => _payChannel; + String? get payNum => _payNum; + String? get promotionId => _promotionId; + String? get actId => _actId; + String? get couponId => _couponId; + num? get isDelete => _isDelete; + num? 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; + String? get uniqueDiscountType => _uniqueDiscountType; + dynamic get totalDiscountPrice => _totalDiscountPrice; + String? get vipDayDiscountPrice => _vipDayDiscountPrice; + num? get orderSource => _orderSource; + String? get benefitDiscountAmount => _benefitDiscountAmount; + String? get vipDiscountPrice => _vipDiscountPrice; + dynamic get orderMerge => _orderMerge; + bool? 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; + dynamic get finalPayPrice => _finalPayPrice; + dynamic get isEnableSubscribePay => _isEnableSubscribePay; + dynamic get invoiceId => _invoiceId; + dynamic get invoiceState => _invoiceState; + dynamic get posType => _posType; + + 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; + if (_addressExt != null) { + map['addressExt'] = _addressExt?.toJson(); + } + 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 : "1806191906217000960" +/// createTime : "2024-06-27 13:04:43" +/// createUser : "1806191393635303424" +/// updateTime : "2024-06-27 13:04:43" +/// updateUser : "1806191393635303424" +/// tenantCode : "1193" +/// storeId : "1627869775969386496" +/// orderId : "1806191906170863616" +/// actInfo : null +/// productId : "1646769691940618240" +/// times : null +/// usedTimes : null +/// productName : "素燥饭" +/// skuId : "1646769691995144192" +/// skuNameStr : "" +/// skuImg : "" +/// buyNum : 1 +/// refundNum : 0 +/// type : 0 +/// reason : null +/// weight : 0.0 +/// applyPrice : "24.00" +/// sellPrice : "24.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 : null +/// 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, + dynamic 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']; + _setMealDataList = json['setMealDataList']; + _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; + dynamic _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, + dynamic 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; + dynamic 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; + map['setMealDataList'] = _setMealDataList; + map['packagingFee'] = _packagingFee; + return map; + } + +} + +/// addressId : null +/// country : null +/// countryId : null +/// province : "北京" +/// provinceId : null +/// city : "北京" +/// cityId : null +/// district : "东城区" +/// districtId : null +/// cityInfo : null +/// address : "北京市东城区毛家湾胡同甲13号北京站第八候车室西侧第一跨2-8-1B" +/// recName : null +/// recMobile : null +/// longitude : "116.427341" +/// latitude : "39.902842" + +class AddressExt { + AddressExt({ + dynamic addressId, + dynamic country, + dynamic countryId, + String? province, + dynamic provinceId, + String? city, + dynamic cityId, + String? district, + dynamic districtId, + dynamic cityInfo, + String? address, + dynamic recName, + dynamic recMobile, + String? longitude, + String? latitude,}){ + _addressId = addressId; + _country = country; + _countryId = countryId; + _province = province; + _provinceId = provinceId; + _city = city; + _cityId = cityId; + _district = district; + _districtId = districtId; + _cityInfo = cityInfo; + _address = address; + _recName = recName; + _recMobile = recMobile; + _longitude = longitude; + _latitude = latitude; +} + + AddressExt.fromJson(dynamic json) { + _addressId = json['addressId']; + _country = json['country']; + _countryId = json['countryId']; + _province = json['province']; + _provinceId = json['provinceId']; + _city = json['city']; + _cityId = json['cityId']; + _district = json['district']; + _districtId = json['districtId']; + _cityInfo = json['cityInfo']; + _address = json['address']; + _recName = json['recName']; + _recMobile = json['recMobile']; + _longitude = json['longitude']; + _latitude = json['latitude']; + } + dynamic _addressId; + dynamic _country; + dynamic _countryId; + String? _province; + dynamic _provinceId; + String? _city; + dynamic _cityId; + String? _district; + dynamic _districtId; + dynamic _cityInfo; + String? _address; + dynamic _recName; + dynamic _recMobile; + String? _longitude; + String? _latitude; +AddressExt copyWith({ dynamic addressId, + dynamic country, + dynamic countryId, + String? province, + dynamic provinceId, + String? city, + dynamic cityId, + String? district, + dynamic districtId, + dynamic cityInfo, + String? address, + dynamic recName, + dynamic recMobile, + String? longitude, + String? latitude, +}) => AddressExt( addressId: addressId ?? _addressId, + country: country ?? _country, + countryId: countryId ?? _countryId, + province: province ?? _province, + provinceId: provinceId ?? _provinceId, + city: city ?? _city, + cityId: cityId ?? _cityId, + district: district ?? _district, + districtId: districtId ?? _districtId, + cityInfo: cityInfo ?? _cityInfo, + address: address ?? _address, + recName: recName ?? _recName, + recMobile: recMobile ?? _recMobile, + longitude: longitude ?? _longitude, + latitude: latitude ?? _latitude, +); + dynamic get addressId => _addressId; + dynamic get country => _country; + dynamic get countryId => _countryId; + String? get province => _province; + dynamic get provinceId => _provinceId; + String? get city => _city; + dynamic get cityId => _cityId; + String? get district => _district; + dynamic get districtId => _districtId; + dynamic get cityInfo => _cityInfo; + String? get address => _address; + dynamic get recName => _recName; + dynamic get recMobile => _recMobile; + String? get longitude => _longitude; + String? get latitude => _latitude; + + Map toJson() { + final map = {}; + map['addressId'] = _addressId; + map['country'] = _country; + map['countryId'] = _countryId; + map['province'] = _province; + map['provinceId'] = _provinceId; + map['city'] = _city; + map['cityId'] = _cityId; + map['district'] = _district; + map['districtId'] = _districtId; + map['cityInfo'] = _cityInfo; + map['address'] = _address; + map['recName'] = _recName; + map['recMobile'] = _recMobile; + map['longitude'] = _longitude; + map['latitude'] = _latitude; + return map; + } + +} \ No newline at end of file diff --git a/lib/data/invoices_history_list.dart b/lib/data/invoices_history_list.dart new file mode 100644 index 00000000..bcb557ca --- /dev/null +++ b/lib/data/invoices_history_list.dart @@ -0,0 +1,385 @@ +/// records : [{"id":"1823231566596276224","createTime":"2024-08-13 13:34:14","createUser":"1379254113602109440","updateTime":"2024-08-13 13:34:14","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816764013200015360"],"money":"2.00","type":"ELECTRONIC","headerId":"1818128371540819968","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"彗星","invoiceHeaderCode":"123568986457","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1820730457528991744","createTime":"2024-08-06 15:55:43","createUser":"1379254113602109440","updateTime":"2024-08-06 15:55:43","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816724620737249280"],"money":"0.02","type":"ELECTRONIC","headerId":"1818128371540819968","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"彗星","invoiceHeaderCode":"123568986457","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1820730164074512384","createTime":"2024-08-06 15:54:33","createUser":"1379254113602109440","updateTime":"2024-08-06 15:54:33","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816724573748461568"],"money":"0.01","type":"ELECTRONIC","headerId":"1818128371540819968","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"彗星","invoiceHeaderCode":"123568986457","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1818128393347006464","createTime":"2024-07-30 11:36:03","createUser":"1379254113602109440","updateTime":"2024-07-30 11:36:03","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816763957935865856"],"money":"1.00","type":"ELECTRONIC","headerId":"1818128371540819968","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"彗星","invoiceHeaderCode":"123568986457","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816688308449705984","createTime":"2024-07-26 12:13:40","createUser":"1379254113602109440","updateTime":"2024-07-26 12:13:40","updateUser":"1379254113602109440","phone":"","receivingPhone":"UI","mid":"1379254113602109440","orderIds":["1816406896014262272"],"money":"0.14","type":"ELECTRONIC","headerId":"1816688003569942528","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"顾好","invoiceHeaderCode":"","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816683371409965056","createTime":"2024-07-26 11:54:03","createUser":"1379254113602109440","updateTime":"2024-07-26 11:54:03","updateUser":"1379254113602109440","phone":"12547896","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816406781086138368"],"money":"0.11","type":"ELECTRONIC","headerId":"1816683354544668672","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"华夏","invoiceHeaderCode":"22336559955","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816681820477980672","createTime":"2024-07-26 11:47:53","createUser":"1379254113602109440","updateTime":"2024-07-26 11:47:53","updateUser":"1379254113602109440","phone":"","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816681463005839360","1816681276996845568"],"money":"0.25","type":"ELECTRONIC","headerId":"1816681805231685632","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"呜呜","invoiceHeaderCode":"","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816664893273669632","createTime":"2024-07-26 10:40:37","createUser":"1379254113602109440","updateTime":"2024-07-26 10:40:37","updateUser":"1379254113602109440","phone":"13864536699","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816298665912827904"],"money":"0.01","type":"ELECTRONIC","headerId":"1816663221906440192","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"回血","invoiceHeaderCode":"1325566645499","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816664648762523648","createTime":"2024-07-26 10:39:39","createUser":"1379254113602109440","updateTime":"2024-07-26 10:39:39","updateUser":"1379254113602109440","phone":"13864536699","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816028241291378688"],"money":"0.01","type":"ELECTRONIC","headerId":"1816663221906440192","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"回血","invoiceHeaderCode":"1325566645499","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null},{"id":"1816664088302845952","createTime":"2024-07-26 10:37:25","createUser":"1379254113602109440","updateTime":"2024-07-26 10:37:25","updateUser":"1379254113602109440","phone":"13864536699","receivingPhone":"13052919193","mid":"1379254113602109440","orderIds":["1816409113630867456","1816406953434284032","1816406830440513536"],"money":"0.32","type":"ELECTRONIC","headerId":"1816663221906440192","state":"UN_AUDIT","reviewerTime":null,"reviewerBy":"0","ossUrl":null,"reason":"","isDelete":0,"invoiceHeaderName":"回血","invoiceHeaderCode":"1325566645499","orderList":null,"headertype":null,"companyAddr":null,"companyPhone":null,"bank":null,"bankNumber":null}] +/// total : "14" +/// size : "10" +/// current : "1" +/// orders : [{"column":"id","asc":false}] +/// hitCount : false +/// searchCount : true +/// pages : "2" + +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 : "1823231566596276224" +/// createTime : "2024-08-13 13:34:14" +/// createUser : "1379254113602109440" +/// updateTime : "2024-08-13 13:34:14" +/// updateUser : "1379254113602109440" +/// phone : "" +/// receivingPhone : "13052919193" +/// mid : "1379254113602109440" +/// orderIds : ["1816764013200015360"] +/// money : "2.00" +/// type : "ELECTRONIC" +/// headerId : "1818128371540819968" +/// state : "UN_AUDIT" +/// reviewerTime : null +/// reviewerBy : "0" +/// ossUrl : null +/// reason : "" +/// isDelete : 0 +/// invoiceHeaderName : "彗星" +/// invoiceHeaderCode : "123568986457" +/// 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/data/title_info_list.dart b/lib/data/title_info_list.dart new file mode 100644 index 00000000..b317c115 --- /dev/null +++ b/lib/data/title_info_list.dart @@ -0,0 +1,286 @@ +/// records : [{"id":"1820725763083599872","createTime":"2024-08-06 15:37:04","createUser":"1379254113602109440","updateTime":"2024-08-06 15:37:04","updateUser":"1379254113602109440","userId":"1379254113602109440","isDefault":1,"type":"PERSONAL","name":"哈哈","taxId":"","companyAddr":"","companyPhone":"","bank":"","bankNumber":"","isDelete":0},{"id":"1818128371540819968","createTime":"2024-07-30 11:35:58","createUser":"1379254113602109440","updateTime":"2024-07-30 11:35:58","updateUser":"1379254113602109440","userId":"1379254113602109440","isDefault":1,"type":"COMPANY","name":"彗星","taxId":"123568986457","companyAddr":"","companyPhone":"","bank":"","bankNumber":"","isDelete":0}] +/// total : "2" +/// 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 : "1820725763083599872" +/// createTime : "2024-08-06 15:37:04" +/// createUser : "1379254113602109440" +/// updateTime : "2024-08-06 15:37:04" +/// updateUser : "1379254113602109440" +/// userId : "1379254113602109440" +/// isDefault : 1 +/// type : "PERSONAL" +/// name : "哈哈" +/// taxId : "" +/// companyAddr : "" +/// companyPhone : "" +/// bank : "" +/// bankNumber : "" +/// 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, + String? 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; + String? _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, + String? 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; + String? 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/login/login_page.dart b/lib/login/login_page.dart index 8a963d10..401042c3 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -224,7 +224,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { client?.sendVerify( {"areaCode": areaCode, "mobile": mobile, "verification": ""}) .then((value) => { - if (value?.isSuccess ?? false) + if (value.isSuccess ?? false) {_sendCodeStatus = 1, countdown()} else { diff --git a/lib/main.dart b/lib/main.dart index 7256e3fc..50428e5d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -130,6 +130,11 @@ 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_detail_page.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) { @@ -535,4 +540,14 @@ Map routers = { UnionSelectCity(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), + '/router/invoices_detail_page': (context, {arguments}) => + InvoicesDetailPage(arguments:arguments), }; diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 3c7bf866..1132e028 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -305,8 +305,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 fa25d281..23cb1f5c 100644 --- a/lib/order/invoices_manage/add_invoices_title.dart +++ b/lib/order/invoices_manage/add_invoices_title.dart @@ -3,130 +3,855 @@ 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 '../../data/base_data.dart'; +import '../../data/title_info_list.dart'; import '../../generated/l10n.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?.isSuccess ?? false) { + 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?.isSuccess ?? false) { + 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, - children: [ - Text( - "请填写抬头信息:", - style: TextStyle( - color: Color(0xFF000000), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, + 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: [ + 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( + margin: EdgeInsets.only(bottom:25.h,left:20.w,right: 20.w), + padding: EdgeInsets.symmetric(vertical:16.h), + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular( + 45 + ), + ), + 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..ccf0b3f7 --- /dev/null +++ b/lib/order/invoices_manage/edit_invoices_info.dart @@ -0,0 +1,599 @@ +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 '../../data/base_data.dart'; +import '../../generated/l10n.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?.isSuccess ?? false) { + 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 as Map?; + 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:16.h), + margin: EdgeInsets.only(bottom:25.h,left:20.w,right: 20.w), + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular( + 45 + ), + ), + 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_detail_page.dart b/lib/order/invoices_manage/invoices_detail_page.dart new file mode 100644 index 00000000..96b1265e --- /dev/null +++ b/lib/order/invoices_manage/invoices_detail_page.dart @@ -0,0 +1,820 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/order/invoices_manage/pdf_screen.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../../community/photo_view_gallery_screen.dart'; +import '../../data/base_data.dart'; +import '../../data/invoices_detail_info.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'; + +class InvoicesDetailPage extends StatefulWidget { + final Map? arguments; + + InvoicesDetailPage({this.arguments}); + + @override + State createState() { + return _InvoicesDetailPage(); + } +} + +class _InvoicesDetailPage extends State { + ApiService? apiService; + InvoicesDetailInfo? invoicesDetailInfo; + String remotePDFpath = ""; + String networkError = ""; + int networkStatus = 0; + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService( + Dio(), + context: context, + token: value.getString('token'), + ), + queryInvoices("1797587255380934656"), + }); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + ///发票详情 + queryInvoices(id) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData? baseData = + await apiService?.invoiceDetail(id).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (baseData?.isSuccess ?? false) { + invoicesDetailInfo = baseData?.data; + createFileOfPdfUrl().then((f) { + setState(() { + remotePDFpath = f.path; + }); + }); + refreshController.refreshCompleted(); + networkStatus = 1; + setState(() {}); + } else { + refreshController.refreshFailed(); + refreshController.loadFailed(); + SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center); + } + } + + ///从网络下载 PDF 文件。 + Future createFileOfPdfUrl() async { + Completer completer = Completer(); + print("Start download file from internet!"); + try { + final url = invoicesDetailInfo?.ossUrl ?? ""; + final filename = url.substring(url.lastIndexOf("/") + 1); + var request = await HttpClient().getUrl(Uri.parse(url)); + var response = await request.close(); + var bytes = await consolidateHttpClientResponseBytes(response); + var dir = await getApplicationDocumentsDirectory(); + print("Download files"); + print("${dir.path}/$filename"); + File file = File("${dir.path}/$filename"); + + await file.writeAsBytes(bytes, flush: true); + completer.complete(file); + } catch (e) { + throw Exception('Error parsing asset file!'); + } + return completer.future; + } + + @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() + : (networkStatus == 0 + ? invoicesSm() + : SmartRefresher( + controller: refreshController, + enablePullDown: true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + queryInvoices(widget.arguments?["id"] ?? ""); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + margin: EdgeInsets.only(top: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 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: [ + Expanded( + child: Text( + "发票状态", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + invoicesState( + invoicesDetailInfo?.state ?? + ""), + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: Row( + children: [ + Expanded( + child: Text( + "发票抬头", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Expanded( + child: Text( + invoicesDetailInfo + ?.invoiceHeaderName ?? + "", + maxLines: 1, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.end, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: Row( + children: [ + Expanded( + child: Text( + "申请时间", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + invoicesDetailInfo?.reviewerTime ?? + "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ), + Row( + children: [ + Expanded( + child: Text( + "开票金额", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + invoicesDetailInfo?.money ?? "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ) + ], + ), + ), + GestureDetector( + onTap: () { + if ((invoicesDetailInfo?.ossUrl ?? "") + .endsWith("pdf")) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PDFScreen( + path: remotePDFpath, + inlet: 0, + ), + ), + ); + } else { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PhotoViewGalleryScreen( + images: [ + invoicesDetailInfo?.ossUrl ?? "" + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + } + }, + child: 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( + "1张发票,含${invoicesDetailInfo?.orderList?.length ?? 0}个订单", + 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, + ), + ), + ), + Icon(Icons.arrow_forward_ios, + color: Color(0xFF181818), size: 14.sp) + ], + ), + ), + ), + ], + ), + )), + Row( + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if ((invoicesDetailInfo?.ossUrl ?? "") + .endsWith("pdf")) { + showPdfAlertDialog(); + } else { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PhotoViewGalleryScreen( + images: [ + invoicesDetailInfo?.ossUrl ?? "" + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + } + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 16.h), + margin: EdgeInsets.only( + bottom: 34.h, right: 9.5.w, left: 14.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(45), + border: Border.all( + color: Color(0xff32A060), + width: 1.w, + ), + ), + width: double.infinity, + alignment: Alignment.center, + child: Text( + "查看电子发票", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + )), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + launchBrowser(); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 16.h), + margin: EdgeInsets.only( + bottom: 34.h, left: 9.5.w, right: 14.w), + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular(45), + ), + width: double.infinity, + alignment: Alignment.center, + child: Text( + "下载电子发票", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + )), + ], + ) + ], + ), + ), + )), + ); + } + + ///发票状态 + String invoicesState(state) { + if (state == "UN_AUDIT") { + return "待审核"; + } else if (state == "AUDIT_PASS") { + return "开票成功"; + } else if (state == "AUDIT_VOID") { + return "已作废"; + } else if (state == "AUDIT_FAIL") { + return "开票失败"; + } else { + return ""; + } + } + + ///查看电子发票 + showPdfAlertDialog() { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return PDFScreen(path: remotePDFpath, inlet: 1); + }, + ); + } + + ///下载电子发票 + launchBrowser() async { + String url = invoicesDetailInfo?.ossUrl ?? ""; + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + + Widget invoicesSm() { + return Container( + margin: EdgeInsets.only(top: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.symmetric(vertical: 16.h, horizontal: 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( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 90.w, + height: 20.h, + ), + ), + 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: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + Spacer(), + 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: 58.w, + height: 20.h, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: 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: 58.w, + height: 20.h, + ), + ), + Spacer(), + 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: 58.w, + height: 20.h, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: 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: 58.w, + height: 20.h, + ), + ), + Spacer(), + 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: 58.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: 58.w, + height: 20.h, + ), + ), + Spacer(), + 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: 58.w, + height: 20.h, + ), + ), + ], + ) + ], + ), + ), + 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( + 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: 124.w, + height: 20.h, + ), + ), + Spacer(), + 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: 28.w, + height: 20.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 18.w, + height: 20.h, + ), + ), + ], + ), + ), + ], + ), + )), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + // padding: EdgeInsets.symmetric(vertical: 16.h), + margin: + EdgeInsets.only(bottom: 34.h, right: 9.5.w, left: 14.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(45), + ), + width: 164.w, + height: 48.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + // padding: EdgeInsets.symmetric(vertical: 16.h), + margin: + EdgeInsets.only(bottom: 34.h, right: 9.5.w, left: 14.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(45), + ), + width: 164.w, + height: 48.h, + ), + ), + ], + ), + ], + ), + ); + } + + Widget noNetwork() { + return Container( + width: double.infinity, + 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: () { + queryInvoices(widget.arguments?["id"] ?? ""); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xff32A060), + 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_history.dart b/lib/order/invoices_manage/invoices_history.dart new file mode 100644 index 00000000..b21a0988 --- /dev/null +++ b/lib/order/invoices_manage/invoices_history.dart @@ -0,0 +1,462 @@ +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:huixiang/data/invoices_history_list.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; + +import '../../data/base_data.dart'; +import '../../generated/l10n.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?.isSuccess ?? false) { + 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]; + } + }); + if(_map.isNotEmpty) + _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/ding_dan.webp", + isShowBtn: false, + text: "暂无开票记录", + fontSize: 16, + margin: EdgeInsets.only(top: 120,left: 20,right: 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: () { + // if(records[position].state == "AUDIT_PASS") + Navigator.of(context) + .pushNamed('/router/invoices_detail_page',arguments: { + "id":records[position].id ?? "" + }); + }, + 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 "开票失败"; + }else { + 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( + width: double.infinity, + 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(0xff32A060), + 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..71e4968a --- /dev/null +++ b/lib/order/invoices_manage/invoices_manage_page.dart @@ -0,0 +1,678 @@ +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 '../../data/base_data.dart'; +import '../../data/invoice_list.dart'; +import '../../generated/l10n.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?.isSuccess ?? false) { + records.addAll(baseData?.data?.records ?? []); + baseData?.data?.records?.forEach((element) { + if ((double.tryParse(element.payedPrice ?? "")??0) > 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) > 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) > 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) => + ((double.tryParse(previousValue.toString()) ?? 0.0) + (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(0xff32A060), + 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..c9ec9d9c --- /dev/null +++ b/lib/order/invoices_manage/invoices_title_info.dart @@ -0,0 +1,577 @@ +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 '../../data/base_data.dart'; +import '../../data/title_info_list.dart'; +import '../../generated/l10n.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?.isSuccess ?? false) { + 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?.isSuccess ??false) { + await editOnRefresh(); + Future.delayed(Duration(milliseconds: 500), () { + SmartDialog.showToast("删除信息成功", alignment: Alignment.center); + }); + networkStatus = 1; + } 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:16.h), + margin: EdgeInsets.only(bottom:25.h,left:20.w,right: 20.w), + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular( + 45 + ), + ), + 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, + 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(0xff32A060), + 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/invoices_manage/pdf_screen.dart b/lib/order/invoices_manage/pdf_screen.dart new file mode 100644 index 00000000..3fc7c160 --- /dev/null +++ b/lib/order/invoices_manage/pdf_screen.dart @@ -0,0 +1,195 @@ +import 'dart:async'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_pdfview/flutter_pdfview.dart'; + +class PDFScreen extends StatefulWidget { + final String? path; + final int? inlet; + + PDFScreen({Key? key,this.path,this.inlet}) : super(key: key); + + _PDFScreenState createState() => _PDFScreenState(); +} + +class _PDFScreenState extends State with WidgetsBindingObserver { + final Completer _controller = + Completer(); + int pages = 0; + int currentPage = 0; + int pageTotal = 0; + bool isReady = false; + String errorMessage = ''; + + @override + Widget build(BuildContext context) { + return widget.inlet == 1 + ? Material( + type: MaterialType.transparency, + child: Stack( + children: [ + Center( + child: Container( + height: 250, + decoration: BoxDecoration( + color: Colors.white, + ), + child: PDFView( + filePath: widget.path, + enableSwipe: true, + swipeHorizontal: true, + autoSpacing: false, + pageFling: true, + pageSnap: true, + defaultPage: currentPage, + fitPolicy: FitPolicy.BOTH, + preventLinkNavigation: false, + // if set to true the link is handled in flutter + onRender: (_pages) { + setState(() { + pages = _pages ?? 0; + isReady = true; + }); + }, + onError: (error) { + setState(() { + errorMessage = error.toString(); + }); + print(error.toString()); + }, + onPageError: (page, error) { + setState(() { + errorMessage = '$page: ${error.toString()}'; + }); + print('$page: ${error.toString()}'); + }, + onViewCreated: (PDFViewController pdfViewController) { + _controller.complete(pdfViewController); + }, + onLinkHandler: (String? uri) { + print('goto uri: $uri'); + }, + onPageChanged: (int? page, int? total) { + if ((total??0) > 0) { + print('page change: $page/$total'); + setState(() { + currentPage = page ?? 0; + pageTotal = total ??0; + }); + } else { + pageTotal = 1; + } + }, + ), + ), + ), + errorMessage.isEmpty + ? !isReady + ? Center( + child: CircularProgressIndicator(), + ) + : Container() + : Center( + child: Text(errorMessage), + ), + //pdfindex显示 + Positioned( + width: MediaQuery.of(context).size.width, + bottom: 45, + child: Center( + child: Text("${currentPage + 1}/${(pageTotal > 0)?pageTotal:1}", + style: TextStyle(color: Colors.white, fontSize: 16)), + ), + ), + ], + ), + ) + : Scaffold( + body: Stack( + children: [ + PDFView( + filePath: widget.path, + enableSwipe: true, + swipeHorizontal: true, + autoSpacing: false, + pageFling: true, + pageSnap: true, + defaultPage: currentPage, + fitPolicy: FitPolicy.BOTH, + preventLinkNavigation: false, + // if set to true the link is handled in flutter + onRender: (_pages) { + setState(() { + pages = _pages ?? 0; + isReady = true; + }); + }, + onError: (error) { + setState(() { + errorMessage = error.toString(); + }); + print(error.toString()); + }, + onPageError: (page, error) { + setState(() { + errorMessage = '$page: ${error.toString()}'; + }); + print('$page: ${error.toString()}'); + }, + onViewCreated: (PDFViewController pdfViewController) { + _controller.complete(pdfViewController); + }, + onLinkHandler: (String? uri) { + print('goto uri: $uri'); + }, + onPageChanged: (int? page, int? total) { + if ((total ?? 0) > 0) { + print('page change: $page/$total'); + setState(() { + currentPage = page ??0; + pageTotal = total ??0; + }); + } else { + pageTotal = 1; + } + }, + ), + errorMessage.isEmpty + ? !isReady + ? Center( + child: CircularProgressIndicator(), + ) + : Container() + : Center( + child: Text(errorMessage), + ), + //pdfindex显示 + Positioned( + bottom: 45, + width: MediaQuery.of(context).size.width, + child: Center( + child: Text("${currentPage + 1}/${(pageTotal > 0)?pageTotal:1}", + style: TextStyle(color: Colors.black, fontSize: 16)), + ), + ), + Positioned( + //右上角关闭按钮 + right: 10, + top: MediaQuery.of(context).padding.top, + child: IconButton( + icon: Icon( + Icons.close, + size: 30, + color: Colors.black, + ), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ], + ), + ); + } +} diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 0e2057f6..cb9e8283 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -62,6 +62,11 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; import 'package:huixiang/login/captcha/click_word_captcha.dart'; +import '../data/invoice_list.dart'; +import '../data/invoices_detail_info.dart'; +import '../data/invoices_history_list.dart'; +import '../data/title_info_list.dart'; + part 'retrofit_api.g.dart'; const localBaseUrl = "http://192.168.10.54:8766/app/";///本地 @@ -603,4 +608,36 @@ 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); + + ///发票详情 + @GET("invoice/detail{id}") + Future> invoiceDetail(@Path("id") String id); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 49b79a22..0cda47ef 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -2808,6 +2808,228 @@ class _ApiService implements ApiService { return value; } + @override + Future> invoiceOrderList(Map param) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(param); + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'order/invoiceOrderList', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> invoiceHeader(Map param) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(param); + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoiceHeader', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> invoiceHeaders(Map param) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(param); + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoiceHeader', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> invoiceHeaderList(Map param) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(param); + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoiceHeader/page', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> delInvoiceHeader(String ids) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'DELETE', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoiceHeader?ids[]=$ids', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> invoiceSubmit(Map param) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(param); + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoice', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> invoicePage(Map param) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(param); + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoiceHeader/page', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + + @override + Future> invoiceDetail(String id) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _result = await _dio.fetch>( + _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'invoice/detail${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + final value = BaseData.fromJson(_result.data!); + return value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/utils/status_utils.dart b/lib/utils/status_utils.dart index 666efd8e..aaf18ad0 100644 --- a/lib/utils/status_utils.dart +++ b/lib/utils/status_utils.dart @@ -259,32 +259,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, - ), - ), - ), - ), + ///因接口问题,列表不展示开票入口,统一从发票助手进入 + // 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, + // ), + // ), + // ), + // ), ]; } } diff --git a/pubspec.lock b/pubspec.lock index 42bc55e8..858ccf71 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -427,6 +427,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_pdfview: + dependency: "direct main" + description: + name: flutter_pdfview + sha256: a9055bf920c7095bf08c2781db431ba23577aa5da5a056a7152dc89a18fbec6f + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.2" flutter_screenutil: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 3e3fef0b..c54d0e09 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,8 @@ dependencies: geolocator: ^7.0.0 # location: ^3.2.4 + flutter_pdfview: ^1.3.2 + dio: ^5.4.1 rxdart: ^0.27.07 retrofit: ^4.1.0