Merge branch 'newHost' of https://git.oa00.com/1281228557/aku_new_community into newHost
commit
776582c54d
@ -1,24 +1,45 @@
|
||||
import 'package:aku_new_community/model/common/img_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'team_list_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class TeamListModel {
|
||||
class TeamListModel extends Equatable {
|
||||
final int id;
|
||||
final String name;
|
||||
final List<ImgModel> imgs;
|
||||
final String tel;
|
||||
final String position;
|
||||
final int userType;
|
||||
final int manageUserId;
|
||||
final String manageUserName;
|
||||
final String manageUserTel;
|
||||
final int departmentId;
|
||||
final String departmentName;
|
||||
final int positionId;
|
||||
final String positionName;
|
||||
|
||||
factory TeamListModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$TeamListModelFromJson(json);
|
||||
|
||||
const TeamListModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.imgs,
|
||||
required this.tel,
|
||||
required this.position,
|
||||
required this.userType,
|
||||
required this.manageUserId,
|
||||
required this.manageUserName,
|
||||
required this.manageUserTel,
|
||||
required this.departmentId,
|
||||
required this.departmentName,
|
||||
required this.positionId,
|
||||
required this.positionName,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
userType,
|
||||
manageUserId,
|
||||
manageUserName,
|
||||
manageUserTel,
|
||||
departmentId,
|
||||
departmentName,
|
||||
positionId,
|
||||
positionName,
|
||||
];
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'work_order_bill_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WorkOrderBillModel extends Equatable {
|
||||
final int id;
|
||||
final int costType;
|
||||
final String name;
|
||||
@JsonKey(name: 'num')
|
||||
final int number;
|
||||
final num price;
|
||||
|
||||
factory WorkOrderBillModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$WorkOrderBillModelFromJson(json);
|
||||
|
||||
const WorkOrderBillModel({
|
||||
required this.id,
|
||||
required this.costType,
|
||||
required this.name,
|
||||
required this.number,
|
||||
required this.price,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
costType,
|
||||
name,
|
||||
number,
|
||||
price,
|
||||
];
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'work_order_bill_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WorkOrderBillModel _$WorkOrderBillModelFromJson(Map<String, dynamic> json) =>
|
||||
WorkOrderBillModel(
|
||||
id: json['id'] as int,
|
||||
costType: json['costType'] as int,
|
||||
name: json['name'] as String,
|
||||
number: json['num'] as int,
|
||||
price: json['price'] as num,
|
||||
);
|
@ -0,0 +1,58 @@
|
||||
import 'package:aku_new_community/model/common/img_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'work_order_detail_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WorkOrderDetailModel extends Equatable {
|
||||
final int id;
|
||||
final String code;
|
||||
final int status;
|
||||
final String workOrderTypeName;
|
||||
final String reserveAddress;
|
||||
final String reserveDate;
|
||||
final String content;
|
||||
final String createDate;
|
||||
final List<ImgModel>? servicePersonnelImgList;
|
||||
final int newReportNum;
|
||||
final int? evaluateLevel;
|
||||
final String? evaluateContent;
|
||||
final String? evaluateDate;
|
||||
|
||||
factory WorkOrderDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$WorkOrderDetailModelFromJson(json);
|
||||
|
||||
const WorkOrderDetailModel({
|
||||
required this.id,
|
||||
required this.code,
|
||||
required this.status,
|
||||
required this.workOrderTypeName,
|
||||
required this.reserveAddress,
|
||||
required this.reserveDate,
|
||||
required this.content,
|
||||
required this.createDate,
|
||||
this.servicePersonnelImgList,
|
||||
required this.newReportNum,
|
||||
this.evaluateLevel,
|
||||
this.evaluateContent,
|
||||
this.evaluateDate,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
code,
|
||||
status,
|
||||
workOrderTypeName,
|
||||
reserveAddress,
|
||||
reserveDate,
|
||||
content,
|
||||
createDate,
|
||||
servicePersonnelImgList,
|
||||
newReportNum,
|
||||
evaluateLevel,
|
||||
evaluateContent,
|
||||
evaluateDate,
|
||||
];
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'work_order_detail_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WorkOrderDetailModel _$WorkOrderDetailModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
WorkOrderDetailModel(
|
||||
id: json['id'] as int,
|
||||
code: json['code'] as String,
|
||||
status: json['status'] as int,
|
||||
workOrderTypeName: json['workOrderTypeName'] as String,
|
||||
reserveAddress: json['reserveAddress'] as String,
|
||||
reserveDate: json['reserveDate'] as String,
|
||||
content: json['content'] as String,
|
||||
createDate: json['createDate'] as String,
|
||||
servicePersonnelImgList:
|
||||
(json['servicePersonnelImgList'] as List<dynamic>?)
|
||||
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
newReportNum: json['newReportNum'] as int,
|
||||
evaluateLevel: json['evaluateLevel'] as int?,
|
||||
evaluateContent: json['evaluateContent'] as String?,
|
||||
evaluateDate: json['evaluateDate'] as String?,
|
||||
);
|
@ -0,0 +1,48 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'work_order_list_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WorkOrderListModel extends Equatable {
|
||||
final int id;
|
||||
final String code;
|
||||
final int status;
|
||||
final String workOrderTypeName;
|
||||
final String reserveAddress;
|
||||
final String reserveDate;
|
||||
final String content;
|
||||
final String updateDate;
|
||||
final String createDate;
|
||||
|
||||
factory WorkOrderListModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$WorkOrderListModelFromJson(json);
|
||||
DateTime? get updateDateDT => DateUtil.getDateTime(updateDate);
|
||||
DateTime? get createDateDT => DateUtil.getDateTime(createDate);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
code,
|
||||
status,
|
||||
workOrderTypeName,
|
||||
reserveAddress,
|
||||
reserveDate,
|
||||
content,
|
||||
updateDate,
|
||||
createDate,
|
||||
];
|
||||
|
||||
const WorkOrderListModel({
|
||||
required this.id,
|
||||
required this.code,
|
||||
required this.status,
|
||||
required this.workOrderTypeName,
|
||||
required this.reserveAddress,
|
||||
required this.reserveDate,
|
||||
required this.content,
|
||||
required this.updateDate,
|
||||
required this.createDate,
|
||||
});
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'work_order_list_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WorkOrderListModel _$WorkOrderListModelFromJson(Map<String, dynamic> json) =>
|
||||
WorkOrderListModel(
|
||||
id: json['id'] as int,
|
||||
code: json['code'] as String,
|
||||
status: json['status'] as int,
|
||||
workOrderTypeName: json['workOrderTypeName'] as String,
|
||||
reserveAddress: json['reserveAddress'] as String,
|
||||
reserveDate: json['reserveDate'] as String,
|
||||
content: json['content'] as String,
|
||||
updateDate: json['updateDate'] as String,
|
||||
createDate: json['createDate'] as String,
|
||||
);
|
@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'work_order_progress_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WorkOrderProgressModel _$WorkOrderProgressModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
WorkOrderProgressModel(
|
||||
id: json['id'] as int,
|
||||
status: json['status'] as int,
|
||||
content: json['content'] as String,
|
||||
userType: json['userType'] as int,
|
||||
createId: json['createId'] as int,
|
||||
createName: json['createName'] as String,
|
||||
createDate: json['createDate'] as String,
|
||||
);
|
@ -0,0 +1,81 @@
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:aku_new_community/model/common/img_model.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'work_order_report_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WorkOrderReportModel extends Equatable {
|
||||
final int id;
|
||||
final int type;
|
||||
final String content;
|
||||
final int userType;
|
||||
final int createId;
|
||||
final String createName;
|
||||
final String createDate;
|
||||
final String totalCost;
|
||||
final List<ImgModel> imgList;
|
||||
final List<ReportRecordVoList> reportRecordVoList;
|
||||
|
||||
factory WorkOrderReportModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$WorkOrderReportModelFromJson(json);
|
||||
|
||||
const WorkOrderReportModel({
|
||||
required this.id,
|
||||
required this.type,
|
||||
required this.content,
|
||||
required this.userType,
|
||||
required this.createId,
|
||||
required this.createName,
|
||||
required this.createDate,
|
||||
required this.totalCost,
|
||||
required this.imgList,
|
||||
required this.reportRecordVoList,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
type,
|
||||
content,
|
||||
userType,
|
||||
createId,
|
||||
createName,
|
||||
createDate,
|
||||
totalCost,
|
||||
imgList,
|
||||
reportRecordVoList,
|
||||
];
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ReportRecordVoList extends Equatable {
|
||||
final int id;
|
||||
final int costType;
|
||||
final String name;
|
||||
@JsonKey(name: 'num')
|
||||
final int number;
|
||||
final num price;
|
||||
|
||||
factory ReportRecordVoList.fromJson(Map<String, dynamic> json) =>
|
||||
_$ReportRecordVoListFromJson(json);
|
||||
|
||||
const ReportRecordVoList({
|
||||
required this.id,
|
||||
required this.costType,
|
||||
required this.name,
|
||||
required this.number,
|
||||
required this.price,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
costType,
|
||||
name,
|
||||
number,
|
||||
price,
|
||||
];
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'work_order_report_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WorkOrderReportModel _$WorkOrderReportModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
WorkOrderReportModel(
|
||||
id: json['id'] as int,
|
||||
type: json['type'] as int,
|
||||
content: json['content'] as String,
|
||||
userType: json['userType'] as int,
|
||||
createId: json['createId'] as int,
|
||||
createName: json['createName'] as String,
|
||||
createDate: json['createDate'] as String,
|
||||
totalCost: json['totalCost'] as String,
|
||||
imgList: (json['imgList'] as List<dynamic>)
|
||||
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
reportRecordVoList: (json['reportRecordVoList'] as List<dynamic>)
|
||||
.map((e) => ReportRecordVoList.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
ReportRecordVoList _$ReportRecordVoListFromJson(Map<String, dynamic> json) =>
|
||||
ReportRecordVoList(
|
||||
id: json['id'] as int,
|
||||
costType: json['costType'] as int,
|
||||
name: json['name'] as String,
|
||||
number: json['num'] as int,
|
||||
price: json['price'] as num,
|
||||
);
|
@ -0,0 +1,37 @@
|
||||
import 'package:aku_new_community/extensions/num_ext.dart';
|
||||
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
|
||||
class CancelDialog extends StatelessWidget {
|
||||
final VoidCallback onCancel;
|
||||
|
||||
const CancelDialog({
|
||||
Key? key,
|
||||
required this.onCancel,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
120.hb,
|
||||
'确认要取消工单?'.text.size(36.sp).black.bold.isIntrinsic.make(),
|
||||
40.hb,
|
||||
'确认后,工单会马上取消,\n且服务人员的工作会立即结束'
|
||||
.text
|
||||
.align(TextAlign.center)
|
||||
.size(28.sp)
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
150.hb,
|
||||
BeeLongButton(onPressed: onCancel, text: '确认提醒')
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
import 'package:aku_new_community/extensions/num_ext.dart';
|
||||
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
|
||||
class UrgeDialog extends StatelessWidget {
|
||||
final VoidCallback onConfirm;
|
||||
|
||||
const UrgeDialog({
|
||||
Key? key,
|
||||
required this.onConfirm,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
120.hb,
|
||||
'确认发送提醒?'.text.size(36.sp).black.bold.isIntrinsic.make(),
|
||||
40.hb,
|
||||
'确认后,会对服务人员发送尽快完成任务的通知'.text.size(28.sp).isIntrinsic.make(),
|
||||
150.hb,
|
||||
BeeLongButton(onPressed: onConfirm, text: '确认提醒')
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
import 'package:aku_new_community/extensions/num_ext.dart';
|
||||
import 'package:aku_new_community/models/work_order/work_order_bill_model.dart';
|
||||
import 'package:aku_new_community/widget/bee_divider.dart';
|
||||
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
|
||||
class WorkOrderBillDialog extends StatelessWidget {
|
||||
final List<WorkOrderBillModel> models;
|
||||
|
||||
const WorkOrderBillDialog({Key? key, required this.models}) : super(key: key);
|
||||
|
||||
double get total {
|
||||
double sum = 0;
|
||||
for (var item in models) {
|
||||
sum = sum + item.price;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
40.hb,
|
||||
'确认账单'
|
||||
.text
|
||||
.size(32.sp)
|
||||
.isIntrinsic
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.make(),
|
||||
80.hb,
|
||||
...models
|
||||
.map((e) => Row(
|
||||
children: [
|
||||
'${e.costType == 1 ? '人工费' : '耗材费'}${e.name}${e.costType == 1 ? '' : '*${e.number}'}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
Spacer(),
|
||||
'¥${e.price}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
],
|
||||
))
|
||||
.toList(),
|
||||
BeeDivider.horizontal(),
|
||||
Row(
|
||||
children: [
|
||||
'工单总费用'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
Spacer(),
|
||||
'¥${total}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Color(0xFFF5222D))
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
80.hb,
|
||||
BeeLongButton(onPressed: () {}, text: '确认支付'),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
import 'package:aku_new_community/extensions/num_ext.dart';
|
||||
import 'package:aku_new_community/models/work_order/work_order_progress_model.dart';
|
||||
import 'package:aku_new_community/widget/bee_divider.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class WorkOrderProgressDialog extends StatelessWidget {
|
||||
final List<WorkOrderProgressModel> models;
|
||||
|
||||
const WorkOrderProgressDialog({Key? key, required this.models})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16.w), color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 36.w),
|
||||
child: Row(
|
||||
children: [
|
||||
'工单进度'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.isIntrinsic
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
),
|
||||
BeeDivider.horizontal(),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.w, vertical: 36.w),
|
||||
child: Column(
|
||||
children: [
|
||||
...models
|
||||
.mapIndexed((currentValue, index) => _buildLine(
|
||||
currentValue,
|
||||
index,
|
||||
))
|
||||
.toList()
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLine(WorkOrderProgressModel model, int index) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
DateUtil.formatDateStr(model.createDate, format: 'MM/dd')
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
16.wb,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16.w),
|
||||
border: index == 0
|
||||
? Border.all(color: Color(0xFFFAC058), width: 4.w)
|
||||
: null,
|
||||
color: index == 0
|
||||
? Colors.white
|
||||
: Colors.black.withOpacity(0.25)),
|
||||
child: Container(
|
||||
width: 16.w,
|
||||
height: 16.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
color: index == 0
|
||||
? Color(0xFFFAC058)
|
||||
: Colors.black.withOpacity(0.25)),
|
||||
),
|
||||
),
|
||||
Offstage(
|
||||
offstage: index == models.length - 1,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
16.hb,
|
||||
Container(
|
||||
width: 4.w,
|
||||
height: 55.w,
|
||||
color: index == 0
|
||||
? Color(0xFFFAC058)
|
||||
: Colors.black.withOpacity(0.25),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
16.wb,
|
||||
DateUtil.formatDateStr(model.createDate, format: 'HH:mm')
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
32.wb,
|
||||
'${model.content}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(index == 0
|
||||
? Color(0xFFFAC058)
|
||||
: Colors.black.withOpacity(0.65))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,263 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:aku_new_community/extensions/num_ext.dart';
|
||||
import 'package:aku_new_community/models/work_order/work_order_report_model.dart';
|
||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||
import 'package:aku_new_community/widget/dotted_line.dart';
|
||||
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class HistoryReportPage extends StatefulWidget {
|
||||
final int id;
|
||||
|
||||
const HistoryReportPage({Key? key, required this.id}) : super(key: key);
|
||||
|
||||
@override
|
||||
_HistoryReportPageState createState() => _HistoryReportPageState();
|
||||
}
|
||||
|
||||
class _HistoryReportPageState extends State<HistoryReportPage> {
|
||||
List<WorkOrderReportModel> _models = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '历史报告',
|
||||
body: EasyRefresh(
|
||||
firstRefresh: true,
|
||||
header: MaterialHeader(),
|
||||
onRefresh: () async {
|
||||
// var base =
|
||||
// await NetUtil().get(SAASAPI.workOrder.findRRById, params: {
|
||||
// 'workOrderId': widget.id,
|
||||
// });
|
||||
// if (base.success) {
|
||||
// _models = (base.data as List)
|
||||
// .map((e) => WorkOrderReportModel.fromJson(e))
|
||||
// .toList();
|
||||
// setState(() {});
|
||||
// }
|
||||
_models.add(WorkOrderReportModel(
|
||||
id: Random().nextInt(100),
|
||||
type: Random().nextInt(100),
|
||||
content: '${List.filled(Random().nextInt(50), 'aabb')}',
|
||||
userType: Random().nextInt(2),
|
||||
createId: Random().nextInt(100),
|
||||
createName: 'xxx',
|
||||
createDate: DateTime.now().toString(),
|
||||
totalCost: '300',
|
||||
imgList: [],
|
||||
reportRecordVoList: []));
|
||||
setState(() {});
|
||||
},
|
||||
child: _models.isEmpty
|
||||
? Container()
|
||||
: ListView(children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(32.w),
|
||||
margin: EdgeInsets.only(top: 10.w),
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: _models
|
||||
.mapIndexed((e, index) => LineCard(
|
||||
key: ValueKey(e.id),
|
||||
model: e,
|
||||
index: index,
|
||||
length: _models.length,
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LineCard extends StatefulWidget {
|
||||
final WorkOrderReportModel model;
|
||||
final int index;
|
||||
final int length;
|
||||
|
||||
const LineCard(
|
||||
{Key? key,
|
||||
required this.model,
|
||||
required this.index,
|
||||
required this.length})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_LineCardState createState() => _LineCardState();
|
||||
}
|
||||
|
||||
class _LineCardState extends State<LineCard> {
|
||||
double _height = 0;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
|
||||
_height = context.size?.height ?? 0;
|
||||
print(context.size?.height);
|
||||
setState(() {});
|
||||
});
|
||||
super.didChangeDependencies();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant LineCard oldWidget) {
|
||||
// WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
|
||||
// _height = context.size?.height ?? 0;
|
||||
// print(context.size?.height);
|
||||
// });
|
||||
super.didUpdateWidget(oldWidget);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
widget.index == 0
|
||||
? Container(
|
||||
alignment: Alignment.center,
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFAC058),
|
||||
borderRadius: BorderRadius.circular(20.w)),
|
||||
child: Icon(
|
||||
CupertinoIcons.checkmark_alt,
|
||||
color: Colors.white,
|
||||
size: 24.w,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
margin: EdgeInsets.all(4.w),
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16.w),
|
||||
border: Border.all(
|
||||
color: Colors.black.withOpacity(0.25), width: 4.w),
|
||||
),
|
||||
child: Container(
|
||||
width: 16.w,
|
||||
height: 16.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.25),
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.index != widget.length - 1)
|
||||
SizedBox(
|
||||
height: _height,
|
||||
child: DottedLine(
|
||||
width: 10.w,
|
||||
color: Colors.black.withOpacity(0.25),
|
||||
proportion: 0.5,
|
||||
direction: Axis.vertical,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
40.wb,
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
'${widget.model.type == 1 ? '工单报告' : '完结报告'}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.85))
|
||||
.make(),
|
||||
16.wb,
|
||||
DateUtil.formatDateStr(widget.model.createDate,
|
||||
format: 'MM-dd HH:ss')
|
||||
.text
|
||||
.size(26.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
Spacer(),
|
||||
'${widget.model.userType == 1 ? '负责人' : '协同人'}'
|
||||
.text
|
||||
.size(26.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
16.wb,
|
||||
widget.model.createName.text
|
||||
.size(26.sp)
|
||||
.color(Colors.black.withOpacity(0.45))
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 606.w,
|
||||
child: Text(
|
||||
widget.model.content,
|
||||
style: TextStyle(
|
||||
color: Colors.black.withOpacity(0.45), fontSize: 26.sp),
|
||||
),
|
||||
),
|
||||
Offstage(
|
||||
offstage: widget.model.imgList.isEmpty,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
24.hb,
|
||||
BeeGridImageView(
|
||||
urls: widget.model.imgList.map((e) => e.url).toList()),
|
||||
],
|
||||
),
|
||||
),
|
||||
Offstage(
|
||||
offstage: widget.model.reportRecordVoList.isEmpty,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
...widget.model.reportRecordVoList
|
||||
.map((e) => Row(
|
||||
children: [
|
||||
'${e.costType == 1 ? '人工费' : '耗材费'}${e.name}${e.costType == 1 ? '' : '*${e.number}'}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
Spacer(),
|
||||
'¥${e.price}'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.isIntrinsic
|
||||
.make(),
|
||||
],
|
||||
))
|
||||
.toList(),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
import 'package:aku_new_community/constants/saas_api.dart';
|
||||
import 'package:aku_new_community/models/work_order/work_order_bill_model.dart';
|
||||
import 'package:aku_new_community/utils/network/base_model.dart';
|
||||
import 'package:aku_new_community/utils/network/net_util.dart';
|
||||
|
||||
class WorkOrderFuc {
|
||||
///催促
|
||||
static Future<bool> promotionRate(int id) async {
|
||||
BaseModel baseModel = await NetUtil().get(SAASAPI.workOrder.promotionRate,
|
||||
params: {'workOrderId': id}, showMessage: true);
|
||||
return baseModel.success;
|
||||
}
|
||||
|
||||
///确认完成
|
||||
static Future<bool> confirmComplete(int id) async {
|
||||
BaseModel baseModel = await NetUtil().get(
|
||||
SAASAPI.workOrder.confirmCompletion,
|
||||
params: {'workOrderId': id},
|
||||
showMessage: true);
|
||||
return baseModel.success;
|
||||
}
|
||||
|
||||
///评价
|
||||
static Future<bool> evaluate({
|
||||
required int workOrderId,
|
||||
required int star,
|
||||
required String evaluation,
|
||||
}) async {
|
||||
var base = await NetUtil().get(SAASAPI.workOrder.evaluate,
|
||||
params: {
|
||||
'workOrderId': workOrderId,
|
||||
'evaluateLevel': star,
|
||||
'evaluateContent': evaluation
|
||||
},
|
||||
showMessage: true);
|
||||
return base.success;
|
||||
}
|
||||
|
||||
///取消
|
||||
static Future<bool> cancel({
|
||||
required int workOrderId,
|
||||
}) async {
|
||||
var base = await NetUtil().get(SAASAPI.workOrder.cancel,
|
||||
params: {
|
||||
'workOrderId': workOrderId,
|
||||
},
|
||||
showMessage: true);
|
||||
return base.success;
|
||||
}
|
||||
|
||||
///账单
|
||||
static Future<List<WorkOrderBillModel>> getBill({
|
||||
required int workOrderId,
|
||||
}) async {
|
||||
var models = <WorkOrderBillModel>[];
|
||||
var base = await NetUtil().get(SAASAPI.workOrder.cancel, params: {
|
||||
'workOrderId': workOrderId,
|
||||
});
|
||||
if (base.success) {
|
||||
models = (base.data as List)
|
||||
.map((e) => WorkOrderBillModel.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
return models;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue