|
@@ -6,6 +6,8 @@ import '../../util/models.dart';
|
|
|
import '../../util/util.dart';
|
|
import '../../util/util.dart';
|
|
|
import '../../showAlert.dart';
|
|
import '../../showAlert.dart';
|
|
|
import '../../showLineModal.dart';
|
|
import '../../showLineModal.dart';
|
|
|
|
|
+import '../../util/session.dart';
|
|
|
|
|
+import '../../util/bluetooth_utils.dart';
|
|
|
class OrderDetailPage extends StatefulWidget {
|
|
class OrderDetailPage extends StatefulWidget {
|
|
|
final String orderNo;
|
|
final String orderNo;
|
|
|
|
|
|
|
@@ -112,10 +114,11 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
|
|
|
int afterGoodsNumber=0;//数量
|
|
int afterGoodsNumber=0;//数量
|
|
|
double afterCollectingFee=0.0;//代收
|
|
double afterCollectingFee=0.0;//代收
|
|
|
bool submitStatus = true;
|
|
bool submitStatus = true;
|
|
|
- String lineId = '-1';
|
|
|
|
|
- List<CompanyOfLineList> lineList = [];
|
|
|
|
|
- String showTextPaymentMehod = '现付';
|
|
|
|
|
|
|
+ String lineId = '-1';
|
|
|
|
|
+ List<CompanyOfLineList> lineList = [];
|
|
|
|
|
+ String showTextPaymentMehod = '现付';
|
|
|
int goodsPaymentMethod = 1;
|
|
int goodsPaymentMethod = 1;
|
|
|
|
|
+ BluetoothUtils bluetooth = BluetoothUtils();
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
|
super.initState();
|
|
super.initState();
|
|
@@ -373,6 +376,50 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
|
|
|
context: context, //BuildContext对象
|
|
context: context, //BuildContext对象
|
|
|
barrierDismissible: false,
|
|
barrierDismissible: false,
|
|
|
builder: (BuildContext context) {
|
|
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( //调用对话框
|
|
return MyAlertDialog( //调用对话框
|
|
|
text: '订单修改成功!', childCallback: (val) {
|
|
text: '订单修改成功!', childCallback: (val) {
|
|
|
if(val){
|
|
if(val){
|