Commit fa5d596d by NitefullWind

1. 流水查询只查一天。 2. 修改流水查询界面,显示当天总金额。

parent ce9d6bc1
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
#define JSON_KEY_PRODUCTS_PRICE "price" #define JSON_KEY_PRODUCTS_PRICE "price"
#define JSON_KEY_TOTALNUM "totalNum" #define JSON_KEY_TOTALNUM "totalNum"
#define JSON_KEY_TOTALAMOUNT "totalAmount"
#define JSON_KEY_QUERYINFO "queryInfo" #define JSON_KEY_QUERYINFO "queryInfo"
#define JSON_KEY_PAGENUM "pageNum" #define JSON_KEY_PAGENUM "pageNum"
......
...@@ -259,9 +259,9 @@ void HostWidget::ShowWithRequest(AlipayRequest request) ...@@ -259,9 +259,9 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
_type = finds; _type = finds;
ui->label_find_msg->clear(); ui->label_find_msg->clear();
ui->dateEdit_find_begin->setDate(QDate::currentDate()); ui->dateEdit_find_begin->setDate(QDate::currentDate());
ui->dateEdit_find_end->setDate(QDate::currentDate());
ui->tableWidget->hide(); ui->tableWidget->hide();
ui->frame->hide(); ui->frame->hide();
ui->label_total_amount->setText("");
ui->widget_check_load->hide(); ui->widget_check_load->hide();
ShowWidget(ui->find); ShowWidget(ui->find);
_curr_show_widget = ui->find; _curr_show_widget = ui->find;
...@@ -275,6 +275,7 @@ void HostWidget::ShowWiteJson(bool flag, QJsonObject object, QString error) ...@@ -275,6 +275,7 @@ void HostWidget::ShowWiteJson(bool flag, QJsonObject object, QString error)
flag = true; flag = true;
object[JSON_KEY_STATUSCODE] = 100; object[JSON_KEY_STATUSCODE] = 100;
object[JSON_KEY_TOTALNUM] = 10; object[JSON_KEY_TOTALNUM] = 10;
object[JSON_KEY_TOTALAMOUNT] = 998;
QJsonArray queryInfo; QJsonArray queryInfo;
QJsonObject queryObj; QJsonObject queryObj;
if(ui->comBox_payment_method->currentIndex() < 3) { if(ui->comBox_payment_method->currentIndex() < 3) {
...@@ -323,7 +324,8 @@ void HostWidget::ShowWiteJson(bool flag, QJsonObject object, QString error) ...@@ -323,7 +324,8 @@ void HostWidget::ShowWiteJson(bool flag, QJsonObject object, QString error)
else else
{ {
ui->frame->show(); ui->frame->show();
ui->label_find_msg->setText(QString::fromLocal8Bit("%1到%2的账单流水").arg(ui->dateEdit_find_begin->text(), ui->dateEdit_find_end->text())); ui->label_find_msg->setText(QString::fromLocal8Bit("%1的账单流水").arg(ui->dateEdit_find_begin->text()));
ui->label_total_amount->setText(QString::fromLocal8Bit("总金额:%1").arg(object[JSON_KEY_TOTALAMOUNT].toInt(0) / 100.0));
if(ui->label_find_page->text().compare("1") == 0) if(ui->label_find_page->text().compare("1") == 0)
{ {
...@@ -701,16 +703,16 @@ void HostWidget::on_btn_mananger_check_clicked() ...@@ -701,16 +703,16 @@ void HostWidget::on_btn_mananger_check_clicked()
ui->label_find_title->setText(QString::fromLocal8Bit("门店%1交易流水查询").arg(FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STOREID).toString())); ui->label_find_title->setText(QString::fromLocal8Bit("门店%1交易流水查询").arg(FMTool::GetJsonValue(_posReqJsonObj, JSON_KEY_STOREID).toString()));
ui->label_find_msg->clear(); ui->label_find_msg->clear();
ui->dateEdit_find_begin->setDisplayFormat("yyyy-MM-dd"); ui->dateEdit_find_begin->setDisplayFormat("yyyy-MM-dd");
ui->dateEdit_find_end->setDisplayFormat("yyyy-MM-dd");
ui->dateEdit_find_begin->setDate(QDate::currentDate()); ui->dateEdit_find_begin->setDate(QDate::currentDate());
ui->dateEdit_find_end->setDate(QDate::currentDate()); ui->dateEdit_find_begin->setMinimumDate(QDate::currentDate().addDays(-35));
ui->dateEdit_find_begin->setMaximumDate(QDate::currentDate());
ui->tableWidget->hide(); ui->tableWidget->hide();
ui->frame->hide(); ui->frame->hide();
ui->label_total_amount->setText("");
ui->widget_check_load->hide(); ui->widget_check_load->hide();
ShowWidget(ui->find); ShowWidget(ui->find);
_curr_show_widget = ui->find; _curr_show_widget = ui->find;
ui->label_find_page->setText("1"); ui->label_find_page->setText("1");
} }
void HostWidget::on_btn_mananger_print_clicked() void HostWidget::on_btn_mananger_print_clicked()
...@@ -802,10 +804,13 @@ void HostWidget::on_btn_find_check_clicked() ...@@ -802,10 +804,13 @@ void HostWidget::on_btn_find_check_clicked()
SetTableWidgetHeader(); SetTableWidgetHeader();
ui->frame->hide(); ui->frame->hide();
ui->label_total_amount->setText("");
ui->widget_check_load->show(); ui->widget_check_load->show();
ui->btn_find_check->hide(); ui->btn_find_check->hide();
list.append(ui->dateEdit_find_begin->text().replace("/","-")); list.append(ui->dateEdit_find_begin->dateTime().toString("yyyy-MM-dd hh:mm:ss"));
list.append(ui->dateEdit_find_end->text().replace("/","-")); list.append(ui->dateEdit_find_begin->dateTime().addDays(1).toString("yyyy-MM-dd hh:mm:ss"));
// list.append(ui->dateEdit_find_begin->text().replace("/","-"));
list.append(ui->label_find_page->text()); list.append(ui->label_find_page->text());
// 支付方式code // 支付方式code
......
...@@ -608,7 +608,7 @@ QComboBox::down-arrow, QDateEdit::drop-down { ...@@ -608,7 +608,7 @@ QComboBox::down-arrow, QDateEdit::drop-down {
}</string> }</string>
</property> </property>
<property name="text"> <property name="text">
<string>开始时间</string> <string>查询日期</string>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -666,78 +666,6 @@ QComboBox::down-arrow, QDateEdit::drop-down { ...@@ -666,78 +666,6 @@ QComboBox::down-arrow, QDateEdit::drop-down {
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_27">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_find_end">
<property name="styleSheet">
<string notr="true">#label_find_end
{
font: 75 20px &quot;Microsoft YaHei UI Light&quot;;
}</string>
</property>
<property name="text">
<string>结束时间</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_26">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDateEdit" name="dateEdit_find_end">
<property name="styleSheet">
<string notr="true">#dateEdit_find_end
{
font: 75 20px &quot;Microsoft YaHei UI Light&quot;;
min-width: 120px;
}</string>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="displayFormat">
<string>yyyy-MM-dd</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
<property name="date">
<date>
<year>2017</year>
<month>8</month>
<day>15</day>
</date>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9"> <spacer name="horizontalSpacer_9">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
...@@ -1046,6 +974,21 @@ QHeaderView::section{ ...@@ -1046,6 +974,21 @@ QHeaderView::section{
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_total_amount">
<property name="font">
<font>
<family>Microsoft YaHei UI Light</family>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>总金额:0</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_10"> <spacer name="verticalSpacer_10">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
......
...@@ -298,10 +298,10 @@ private: ...@@ -298,10 +298,10 @@ private:
QString tmp2 = list[2]; QString tmp2 = list[2];
QString paymentMethod = list[3]; QString paymentMethod = list[3];
QString cur = QDateTime::currentDateTime().toString("hh:mm:ss"); // QString cur = QDateTime::currentDateTime().toString("hh:mm:ss");
tmp0.append(" 00:00:00"); // tmp0.append(" 00:00:00");
tmp1.append(QString(" ") + cur); // tmp1.append(QString(" ") + cur);
json.insert(JSON_KEY_VER, DEFAULT_JSON_VER_VALUE); json.insert(JSON_KEY_VER, DEFAULT_JSON_VER_VALUE);
json.insert(JSON_KEY_REQTYPE, JSON_REQTYPE_FIND); json.insert(JSON_KEY_REQTYPE, JSON_REQTYPE_FIND);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment