daxu0403 7 tahun lalu
induk
melakukan
012c2bf674

+ 36 - 33
lib/pages/order_management_page.dart

@@ -367,7 +367,8 @@ class _QueryWidgetState extends State < QueryWidget > {
       2: '运途中',
       3: '已签收',
       4: '已拒收',
-      5: '已作废'
+      5: '已作废',
+      6: '已取消'
     };
     return InkWell(
       child: Card(
@@ -678,40 +679,42 @@ class _QueryWidgetState extends State < QueryWidget > {
                           getKey('printType').then((printType){
                             getKey('stationName').then((stationName){
                               getKey('nickName').then((nickName){
-                                 double goodsYs = (obj.goodsFreight/100)+(obj.goodsAgencyFund/100);
+                                 double goodsYs = (data.goodsFreight/100)+(data.goodsAgencyFund/100);
                                   String nowDate = fromatDate( DateTime.now().millisecondsSinceEpoch);//打印时间
-                                  double goodsAgencyFunds = double.parse(resp.goodsAgencyFunds/100);
-                                  double goodsDFreight = 0;
-                                  double goodsXFreight = 0;
+                                  String createTime =  fromatDate(data.createTime);
+                                  double goodsAgencyFunds = data.goodsAgencyFund/100;
+                                  double goodsDFreight = data.goodsPaymentMethod==1?data.goodsFreight/100:0;
+                                  double goodsXFreight = data.goodsPaymentMethod==2?data.goodsFreight/100:0;
+                                  String receiptAddress = data.receiptCompanyAddress.length>10?data.receiptCompanyAddress.substring(0,10):data.receiptCompanyAddress;
 
-                                  // Map<String, String> pum = {
-                                  //   "[logisticsNo]": "${data.orderNo ?? ''}",
-                                  //   "[createTime]": "",
-                                  //   "[sendStationName]": "$stationName",
-                                  //   "[dealerCode]": "${data.sendCompanyCode ?? ''}",
-                                  //   "[dealerName]": "${data.sendCompanyName}",
-                                  //   "[dealerTel]": "${data.sendCompanyPhone ?? ''}",
-                                  //   "[repairName]": "${data.receiptCompanyName ?? ''}",
-                                  //   "[repairTel]": "${data.receiptCompanyPhone ?? ''}",
-                                  //   "[endStationName]": "",
-                                  //   "[goodsLineCode]": "${data.goodsLineCode ?? ''}",
-                                  //   "[goodsLine]": "${data.goodsLine ?? ''}",
-                                  //   "[repairAddress]": "${data.receiptCompanyAddress ?? ''}",
-                                  //   "[goodsQuantity]": "${data.goodsQuantity ?? ''}",
-                                  //   "[goodsInsurance]": "${data.goodsInsurance ?? ''}",
-                                  //   "[goodsFlatCost]": "${data.goodsFlatCost ?? ''}",
-                                  //   // 到付 现付 金额
-                                  //   "[goodsDFreight]": "$goodsDFreight",
-                                  //   "[goodsXFreight]": "$goodsXFreight",
-                                  //   "[goodsAgencyFund]": "$goodsAgencyFunds",
-                                  //   "[goodsYs]": "$goodsYs",
-                                  //   "[dealerBankAccount]": "${data.sendCompanyBankCard ?? ''}",
-                                  //   "[goodsRemark]": "${data.goodsRemark ?? ''}",
-                                  //   "[realName]": "${nickName?? ''}",
-                                  //   "[currentTime]": "$nowDate",
-                                  //   "[currentGoodNumber]": "1/1",
-                                  // };
-                                  // bluetooth.printOrder(pum, int.parse(printType);
+                                  Map<String, String> pum = {
+                                    "[logisticsNo]": "${data.orderNo ?? ''}",
+                                    "[createTime]": "$createTime",
+                                    "[sendStationName]": "$stationName",
+                                    "[dealerCode]": "${data.sendCompanyCode ?? ''}",
+                                    "[dealerName]": "${data.sendCompanyName}",
+                                    "[dealerTel]": "${data.sendCompanyPhone ?? ''}",
+                                    "[repairName]": "${data.receiptCompanyName ?? ''}",
+                                    "[repairTel]": "${data.receiptCompanyPhone ?? ''}",
+                                    "[endStationName]": "收件站点",
+                                    "[goodsLineCode]": "${data.lineCode ?? ''}",
+                                    "[goodsLine]": "${data.lineName ?? ''}",
+                                    "[repairAddress]": "${receiptAddress?? ''}",
+                                    "[goodsQuantity]": "${data.goodsQuantity ?? ''}",
+                                    "[goodsInsurance]": "${data.goodsInsurance ?? ''}",
+                                    "[goodsFlatCost]": "${data.goodsFlatCost ?? ''}",
+                                    // 到付 现付 金额
+                                    "[goodsDFreight]": "$goodsDFreight",
+                                    "[goodsXFreight]": "$goodsXFreight",
+                                    "[goodsAgencyFund]": "$goodsAgencyFunds",
+                                    "[goodsYs]": "$goodsYs",
+                                    "[dealerBankAccount]": "${data.sendCompanyBankCard ?? ''}",
+                                    "[goodsRemark]": "${data.memo ?? ''}",
+                                    "[realName]": "${nickName?? ''}",
+                                    "[currentTime]": "$nowDate",
+                                    "[currentGoodNumber]": "1/1",
+                                  };
+                                  bluetooth.printOrder(pum, int.parse(printType));
                               });
                             });
                           });

+ 4 - 1
lib/pages/order_management_page/order_detail_page.dart

@@ -136,6 +136,7 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
 
   @override
   Widget build(BuildContext context) {
+    showTextPaymentMehod = widget.obj.goodsPaymentMethod==1?'现付':'到付';
     return Container(
       child: Container(
         color: Colors.white,
@@ -149,8 +150,10 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
             _inputWidget("运费", widget.obj.goodsFreight/100),
             _inputWidget("代收", widget.obj.goodsAgencyFund/100),
              _packageType('付款方式'),
-            contentWiget("保价", widget.obj.goodsPriceProtection.toString()),
+            contentWiget("保价", (widget.obj.goodsPriceProtection/100).toString()),
             contentWiget("重量", widget.obj.goodsWeight.toStringAsFixed(1)),
+            contentWiget("包装类型", (widget.obj.goodsPackingName)),
+            contentWiget("货物类型", (widget.obj.goodsCategoryName)),
             _descWidget(widget.obj.memo),
             submitBtn(widget.obj.orderNo)
           ],

+ 4 - 2
lib/pages/order_taking_page.dart

@@ -553,14 +553,16 @@ Widget orderCutLine() { //分割线
 
 
 Widget orderDetailInfo(OrderList obj) { //卡片展开信息
+  String sendAddress = obj.sendCompanyProvinceName +' '+ (obj.sendCompanyCityName=='市辖区'?'':obj.sendCompanyCityName) +' '+ obj.sendCompanyAreaName+' '+ obj.sendCompanyAddress;
+  String receiptAddress = obj.receiptCompanyProvinceName + ' '+(obj.receiptCompanyCityName=='市辖区'?'':obj.receiptCompanyCityName) +' '+ obj.receiptCompanyAreaName+' '+ obj.receiptCompanyAddress;
   return Container(
     child: Wrap(
       children: < Widget > [
         orderCutLine(),
         orderPhone('发件电话', obj.sendCompanyPhone, 15),
-        orderItem('发件地址', obj.sendCompanyAddress, 30),
+        orderItem('发件地址', sendAddress, 30),
         orderPhone('收件电话', obj.receiptCompanyPhone, 15),
-        orderItem('收件地址', obj.receiptCompanyAddress, 30),
+        orderItem('收件地址', receiptAddress, 30),
       ],
     )
   );

+ 1 - 1
lib/pages/send_express_page.dart

@@ -822,7 +822,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
               setState(() {
                 submitStatus = true;
               });
-              CreateOrder orderObj = CreateOrder.fromJson(resp.data);
+              OrderDetailData orderObj = OrderDetailObj.fromJson(resp.data).data;
               showDialog < Null > (
                 context: context, //BuildContext对象
                 barrierDismissible: false,

+ 43 - 12
lib/util/models.dart

@@ -107,9 +107,16 @@ class OrderList {
   String receiptCompanyAddress;
   String receiptCompanyName;
   String receiptCompanyPhone;
+  String receiptCompanyProvinceName;
+  String receiptCompanyCityName;
+  String receiptCompanyAreaName;
   String sendCompanyAddress;
   String sendCompanyName;
   String sendCompanyPhone;
+  String sendCompanyProvinceName;
+  String sendCompanyCityName;
+  String sendCompanyAreaName;
+
   OrderList(
       {this.orderNo,
       this.createTime,
@@ -118,22 +125,36 @@ class OrderList {
       this.receiptCompanyAddress,
       this.receiptCompanyName,
       this.receiptCompanyPhone,
+      this.receiptCompanyProvinceName,
+      this.receiptCompanyCityName,
+      this.receiptCompanyAreaName,
       this.sendCompanyAddress,
       this.sendCompanyName,
-      this.sendCompanyPhone});
+      this.sendCompanyPhone,
+      this.sendCompanyProvinceName,
+      this.sendCompanyCityName,
+      this.sendCompanyAreaName,
+      });
 
   factory OrderList.fromJson(Map<String, dynamic> json) {
     return OrderList(
-        orderNo: json['orderNo'],
-        createTime: json['createTime'],
-        goods: json['goods'],
-        goodsQuantity: json['goodsQuantity'],
-        receiptCompanyAddress: json['receiptCompanyAddress'],
-        receiptCompanyName: json['receiptCompanyName'],
-        receiptCompanyPhone: json['receiptCompanyPhone'],
-        sendCompanyAddress: json['sendCompanyAddress'],
-        sendCompanyName: json['sendCompanyName'],
-        sendCompanyPhone: json['sendCompanyPhone']);
+        orderNo: json['orderNo'] ?? '',
+        createTime: json['createTime'] ?? '',
+        goods: json['goods'] ?? '',
+        goodsQuantity: json['goodsQuantity'] ?? '',
+        receiptCompanyAddress: json['receiptCompanyAddress'] ?? '',
+        receiptCompanyName: json['receiptCompanyName'] ?? '',
+        receiptCompanyPhone: json['receiptCompanyPhone'] ?? '',
+        receiptCompanyProvinceName:json['receiptCompanyProvinceName'] ?? '',
+        receiptCompanyCityName:json['receiptCompanyCityName'] ?? '',
+        receiptCompanyAreaName:json['receiptCompanyAreaName'] ?? '',
+        sendCompanyAddress: json['sendCompanyAddress'] ?? '',
+        sendCompanyName: json['sendCompanyName'] ?? '',
+        sendCompanyPhone: json['sendCompanyPhone'] ?? '',
+        sendCompanyProvinceName:json['sendCompanyProvinceName'] ?? '',
+        sendCompanyCityName:json['sendCompanyCityName'] ?? '',
+        sendCompanyAreaName:json['sendCompanyAreaName'] ?? '',
+        );
   }
 }
 
@@ -403,6 +424,7 @@ class OrderDetailObj {
 }
 
 class OrderDetailData {
+  int createTime;
   String orderNo;
   String goods; //商品名称
   int goodsAgencyFund; //代收款
@@ -453,7 +475,9 @@ class OrderDetailData {
   int stationId;
   String stationName;
   OrderDetailData(
-      {this.orderNo,
+      {
+      this.createTime,
+      this.orderNo,
       this.goods,
       this.goodsAgencyFund,
       this.goodsCategoryId,
@@ -470,6 +494,9 @@ class OrderDetailData {
       this.goodsValue,
       this.goodsWeight,
       this.id,
+      this.lineCode,
+      this.lineId,
+      this.lineName,
       this.memo,
       this.orderStatus,
       this.receiptCompanyAddress,
@@ -503,6 +530,7 @@ class OrderDetailData {
 
   factory OrderDetailData.fromJson(Map<String, dynamic> json) {
     return OrderDetailData(
+        createTime:json['createTime'],
         orderNo: json['orderNo'],
         goods: json['goods'],
         goodsAgencyFund: json['goodsAgencyFund'],
@@ -520,6 +548,9 @@ class OrderDetailData {
         goodsValue: json['goodsValue'],
         goodsWeight: json['goodsWeight'],
         id: json['id'],
+        lineCode:json['lineCode'],
+        lineId:json['lineId'],
+        lineName:json['lineName'],
         memo: json['memo'],
         orderStatus: json['orderStatus'],
         receiptCompanyAddress: json['receiptCompanyAddress'],