|
|
@@ -381,52 +381,58 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
|
|
|
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;
|
|
|
+ getKey('companyName').then((companyName){
|
|
|
+ getKey('companyCustomerPhone').then((companyCustomerPhone){
|
|
|
+ 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)).then((value){
|
|
|
- if(value==null){
|
|
|
- showDialog <Null> (
|
|
|
- context: context,
|
|
|
- barrierDismissible: false,
|
|
|
- builder: (BuildContext context) {
|
|
|
- return MyAlertDialog(text: '未连接打印机',childCallback:(val){});
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
+ 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",
|
|
|
+ "[companyCustomerPhone]":"$companyCustomerPhone",
|
|
|
+ "[companyName]":"$companyName"
|
|
|
+ };
|
|
|
+ bluetooth.printOrder(pum, int.parse(printType)).then((value){
|
|
|
+ if(value==null){
|
|
|
+ showDialog <Null> (
|
|
|
+ context: context,
|
|
|
+ barrierDismissible: false,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return MyAlertDialog(text: '未连接打印机',childCallback:(val){});
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
});
|