daxu0403 hace 7 años
padre
commit
2306524be0

+ 50 - 3
lib/pages/order_management_page/order_detail_page.dart

@@ -6,6 +6,8 @@ import '../../util/models.dart';
 import '../../util/util.dart';
 import '../../showAlert.dart';
 import '../../showLineModal.dart';
+import '../../util/session.dart';
+import '../../util/bluetooth_utils.dart';
 class OrderDetailPage extends StatefulWidget {
   final String orderNo;
 
@@ -112,10 +114,11 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
   int afterGoodsNumber=0;//数量
   double afterCollectingFee=0.0;//代收
   bool submitStatus = true;
-   String lineId = '-1';
-   List<CompanyOfLineList>  lineList = [];
-   String showTextPaymentMehod = '现付';
+  String lineId = '-1';
+  List<CompanyOfLineList>  lineList = [];
+  String showTextPaymentMehod = '现付';
   int goodsPaymentMethod = 1;
+  BluetoothUtils bluetooth = BluetoothUtils();
   @override
   void initState() {
     super.initState();
@@ -373,6 +376,50 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
           context: context, //BuildContext对象
           barrierDismissible: false,
           builder: (BuildContext context) {
+            //打印
+            OrderDetailData data = OrderDetailObj.fromJson(resp.data).data;
+            getKey('printType').then((printType){
+                getKey('stationName').then((stationName){
+                  getKey('nickName').then((nickName){
+                      double goodsYs = (data.goodsFreight/100)+(data.goodsAgencyFund/100);
+                      String nowDate = fromatDate( DateTime.now().millisecondsSinceEpoch);//打印时间
+                      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]": "$createTime",
+                        "[sendStationName]": "$stationName",
+                        "[dealerCode]": "${data.sendCompanyCode ?? ''}",
+                        "[dealerName]": "${data.sendCompanyName}",
+                        "[dealerTel]": "${data.sendCompanyPhone ?? ''}",
+                        "[repairName]": "${data.receiptCompanyName ?? ''}",
+                        "[repairTel]": "${data.receiptCompanyPhone ?? ''}",
+                        "[endStationName]": "${data.receiptStationName}",
+                        "[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));
+                  });
+                });
+              });
             return MyAlertDialog( //调用对话框
               text: '订单修改成功!', childCallback: (val) {
                 if(val){

+ 12 - 5
lib/pages/order_taking_page.dart

@@ -203,8 +203,15 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
                   margin: EdgeInsets.fromLTRB(0, 1, 1, 0),
                   padding: EdgeInsets.fromLTRB(1, 0, 1, 0),
                   decoration: BoxDecoration(
-                    color: Color.fromRGBO(0, 0, 0, 0.7),
-                    borderRadius: BorderRadius.all(Radius.circular(4.0))
+                    color: Color.fromRGBO(255, 255, 255, 1),
+                    borderRadius: BorderRadius.all(Radius.circular(4.0)),
+                     boxShadow: [ //阴影
+                        BoxShadow(
+                            color: Colors.black54,
+                            offset: Offset(2.0, 2.0),
+                            blurRadius: 4.0
+                        )
+                      ]
                   ),
                   child: lineList.length == 0 ? Center(
                     child: Container(
@@ -242,13 +249,13 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
         child: Row(
           children: < Widget > [
             Padding(
-              padding: EdgeInsets.only(right: 10),
-              child: checked ? Icon(Icons.check, color: Colors.white, ) : Icon(Icons.check, color: Color.fromRGBO(0, 0, 0, 0.0, )),
+              padding: EdgeInsets.only(right: 5),
+              child: checked ? Icon(Icons.check, color: Colors.black, ) : Icon(Icons.check, color: Color.fromRGBO(255, 255, 255, 0.0, )),
             ),
             Expanded(
               flex: 1,
               child: Center(
-                child: Text(lineObj.name, style: TextStyle(color: Colors.white))
+                child: Text(lineObj.name, style: TextStyle(color: Colors.black))
               )
             )
           ],

+ 1 - 1
lib/pages/send_express_page.dart

@@ -995,7 +995,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                           //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
                           SizedBox(
                             width: ScreenUtil.getInstance().setWidth(500),
-                            child: Text(key == '包装类型' ? showTextGoodsPackage : key == '商品类型' ? showTextGoodsCategory : showTextPaymentMehod, textAlign: TextAlign.end, )
+                            child: Text(key == '包装类型' ? showTextGoodsPackage : key == '货物类型' ? showTextGoodsCategory : showTextPaymentMehod, textAlign: TextAlign.end, )
                           ),
                           Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
                         ],