feat:交易查询适配超市
This commit is contained in:
1 parent
e150f96f3a
commit
481291884d
3 files changed
+30
-21
No files matched your search
@@ -170,10 +170,8 @@ Widget orderSelectPanel(
|
||||
.decorated(color: theme.colorScheme.error)
|
||||
.onTap(
|
||||
() {
|
||||
if (total > 0) {
|
||||
if (onPlusChange != null) {
|
||||
onPlusChange(total - 1, index);
|
||||
}
|
||||
if (onPlusChange != null) {
|
||||
onPlusChange(total - 1, index);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@@ -101,6 +101,11 @@ class OrderHistoryController extends GetxController {
|
||||
orderStatus = "-1";
|
||||
}
|
||||
|
||||
String hourTypeCode = hourType.value.code;
|
||||
if (sysType == SysType.SUPERMARKET.name) {
|
||||
hourTypeCode = "-1";
|
||||
}
|
||||
|
||||
final list = await orderDao.findAll(
|
||||
orderStatus,
|
||||
selectDateTime[0],
|
||||
@@ -108,14 +113,14 @@ class OrderHistoryController extends GetxController {
|
||||
pageSize.value,
|
||||
(currentPage.value - 1) * pageSize.value,
|
||||
sysType,
|
||||
hourType.value.code,
|
||||
hourTypeCode,
|
||||
);
|
||||
final total = await orderDao.count(
|
||||
orderStatus,
|
||||
selectDateTime[0],
|
||||
selectDateTime[1],
|
||||
sysType,
|
||||
hourType.value.code,
|
||||
hourTypeCode,
|
||||
);
|
||||
totalPage.value = total ?? 0;
|
||||
orderList.value = list;
|
||||
@@ -174,16 +179,19 @@ class OrderHistoryController extends GetxController {
|
||||
sysType = ?
|
||||
AND strftime('%Y-%m-%d', createTime) BETWEEN ? AND ?
|
||||
""";
|
||||
final sysType = appSetting.sysType.name;
|
||||
final sysType = appSetting.sysType;
|
||||
List<Object?>? args = [
|
||||
sysType,
|
||||
sysType.name,
|
||||
DateUtil.formatDate(selectDateTime[0], format: DateFormats.y_mo_d),
|
||||
DateUtil.formatDate(selectDateTime[1], format: DateFormats.y_mo_d),
|
||||
];
|
||||
// 组装where条件
|
||||
if (hourType.value.code != "-1") {
|
||||
totalSql += " AND hourType = ?";
|
||||
args.add(hourType.value.code);
|
||||
// 非食堂不查询 sysType
|
||||
if (sysType != SysType.SUPERMARKET) {
|
||||
if (hourType.value.code != "-1") {
|
||||
totalSql += " AND hourType = ?";
|
||||
args.add(hourType.value.code);
|
||||
}
|
||||
}
|
||||
final list = await appC.dataBase.database.rawQuery(totalSql, args);
|
||||
if (!ObjectUtil.isEmptyList(list)) {
|
||||
|
||||
@@ -81,17 +81,20 @@ class OrderHistoryPage extends GetView<OrderHistoryController> {
|
||||
.scrollable(scrollDirection: Axis.horizontal)
|
||||
.expanded(),
|
||||
// 用餐时间段
|
||||
appRadioHourTypeDialog(context, controller.hourTypeC)
|
||||
.width(300.w)
|
||||
.offstage(offstage: controller.sysType.value != SysType.CANTEEN),
|
||||
SizedBox(width: 30.w),
|
||||
Obx(
|
||||
() => appRadioHourTypeDialog(context, controller.hourTypeC)
|
||||
.width(300.w)
|
||||
.offstage(offstage: controller.sysType.value != SysType.CANTEEN),
|
||||
),
|
||||
// 用餐时间
|
||||
Obx(() => appDatePicker(
|
||||
context,
|
||||
datetimeRange: controller.selectDateTime,
|
||||
onChnage: (dateList) => controller.doDateRangeDate(dateList),
|
||||
)).width(400.w),
|
||||
].toRow(mainAxisAlignment: MainAxisAlignment.center);
|
||||
Obx(
|
||||
() => appDatePicker(
|
||||
context,
|
||||
datetimeRange: controller.selectDateTime,
|
||||
onChnage: (dateList) => controller.doDateRangeDate(dateList),
|
||||
),
|
||||
).width(400.w).marginOnly(right: 15.w),
|
||||
].toRowSpace(space: 15.w, mainAxisAlignment: MainAxisAlignment.center);
|
||||
}
|
||||
|
||||
Widget _buildTable(BuildContext context) {
|
||||
|
||||
Reference in new issue
Block a user