Commit 71ab590e by 李定达

1.补充提交

parent 548e866a
......@@ -10,6 +10,7 @@
#include <QTimer>
#include <QEventLoop>
#include <QVariantMap>
#include <QSettings>
#include "QsLog.h"
......@@ -365,6 +366,16 @@ bool OrderGetWork::bingToServer(QString &error)
}
#else
void OrderGetWork::SetStoreInfoToConfig()
{
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_PARNETID, _storeinfo[JSON_KEY_PARTNERID]);
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_STOREID, _storeinfo[JSON_STOREID]);
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_STATIONIID, _storeinfo[JSON_STATIONID]);
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_USERID, _storeinfo[JSON_KEY_USERID]);
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_PWD, _storeinfo[JSON_KEY_PWD]);
}
bool OrderGetWork::loginToServer(QString &error)
{
......
......@@ -77,7 +77,8 @@ private:
bool PullOrder(unsigned int timeout, QString &error);
//订单操作
void optOrderWithType(const QVariantMap &map);
//登录成功回写数据
void SetStoreInfoToConfig();
private:
//门店信息 门店编号 pos编号 用户名 密码
QVariantMap _storeinfo;
......
......@@ -2,7 +2,7 @@
#define WORKCONTROL_H
#include <QObject>
//根据配置实例化工作流为实现;
class WorkControl : public QObject
{
Q_OBJECT
......
......@@ -56,7 +56,8 @@ SOURCES += main.cpp \
control/orderlocalizework.cpp \
control/orderprintwork.cpp \
view/loginform.cpp \
model/discountObject.cpp
model/discountObject.cpp \
control/workcontrol.cpp
HEADERS += \
event/fmapplication.h \
......@@ -91,7 +92,8 @@ HEADERS += \
control/orderlocalizework.h \
control/orderprintwork.h \
view/loginform.h \
model/discountObject.h
model/discountObject.h \
control/workcontrol.h
DISTFILES += takeout.rc
......
......@@ -4,8 +4,8 @@
#include <winver.h>
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,7
PRODUCTVERSION 1,0,0,7
FILEVERSION 1,0,0,8
PRODUCTVERSION 1,0,0,8
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
......@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "ShangHai Freemud Co., Ltd."
VALUE "FileDescription", "FREEMUD Manager System"
VALUE "FileVersion", "1.0.0.7"
VALUE "FileVersion", "1.0.0.8"
VALUE "InternalName", "FREEMUD"
VALUE "LegalCopyright", "Copyright (C)2017-2020"
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "fmTakeout"
VALUE "ProductVersion", "1.0.0.7"
VALUE "ProductVersion", "1.0.0.8"
END
END
BLOCK "VarFileInfo"
......
......@@ -8,6 +8,7 @@
#include <QDebug>
#include <QVariantMap>
#include <QSettings>
#include <QsLog.h>
......@@ -25,6 +26,8 @@ LoginForm::LoginForm(QWidget *parent) :
connect(ui->lineEdit_account, &ClickedLineEdit::clicked, this, &LoginForm::GetCurrLineEdit);
connect(ui->lineEdit_partnerid, &ClickedLineEdit::clicked, this, &LoginForm::GetCurrLineEdit);
connect(ui->lineEdit_pwd, &ClickedLineEdit::clicked, this, &LoginForm::GetCurrLineEdit);
connect(ui->lineEdit_posno, &ClickedLineEdit::clicked, this, &LoginForm::GetCurrLineEdit);
connect(ui->lineEdit_storeid, &ClickedLineEdit::clicked, this, &LoginForm::GetCurrLineEdit);
connect(ui->pushButton_0, &QPushButton::clicked, this, &LoginForm::number_btn_click);
connect(ui->pushButton_1, &QPushButton::clicked, this, &LoginForm::number_btn_click);
......@@ -74,15 +77,32 @@ LoginForm::~LoginForm()
delete ui;
}
void LoginForm::SetStoreInfo()
{
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString storeid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STOREID).toString();
QString partnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString();
QString userid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_USERID).toString();
QString pwd = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PWD).toString();
QString stationid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STATIONIID).toString();
if(storeid.isEmpty() || partnerid.isEmpty() || userid.isEmpty() || pwd.isEmpty() || stationid.isEmpty())
return ;
ui->lineEdit_partnerid->setText(partnerid);
ui->lineEdit_storeid->setText(storeid);
ui->lineEdit_posno->setText(stationid);
ui->lineEdit_account->setText(userid);
ui->lineEdit_pwd->setText(pwd);
}
void LoginForm::showfull()
{
if(!is_login)
{
// ui->lineEdit_account->clear();
// ui->lineEdit_partnerid->clear();
// ui->lineEdit_pwd->clear();
SetStoreInfo();
this->showFullScreen();
//this->show();
return ;
}
......@@ -156,9 +176,11 @@ void LoginForm::on_pushButton_login_clicked()
if(ui->lineEdit_account->text().isEmpty() ||
ui->lineEdit_pwd->text().isEmpty() ||
ui->lineEdit_partnerid->text().isEmpty())
ui->lineEdit_partnerid->text().isEmpty() ||
ui->lineEdit_posno->text().isEmpty() ||
ui->lineEdit_storeid->text().isEmpty() )
{
onShowAlert(AlertForm::ERROR, QString::fromLocal8Bit("门店号/账号/密码均不能为空"));
onShowAlert(AlertForm::ERROR, QString::fromLocal8Bit("商户号/门店号/POS编号/账号/密码均不能为空"));
return ;
}
......@@ -166,13 +188,15 @@ void LoginForm::on_pushButton_login_clicked()
// map.insert(JSON_STOREID, "1036");
// map.insert(JSON_STATIONID, "saas_bf_pos");
map.insert(JSON_STOREID, "fm10001");
map.insert(JSON_STATIONID, "1001");
//map.insert(JSON_STOREID, "fm10001");
//map.insert(JSON_STATIONID, "1001");
//map.insert(JSON_STOREID, "FM00001");
//map.insert(JSON_STATIONID, "saas_pos");
//map.insert(JSON_STATIONID, "FM00001");
map.insert(JSON_STOREID, ui->lineEdit_storeid->text());
map.insert(JSON_STATIONID, ui->lineEdit_posno->text());
map.insert(JSON_KEY_USERID, ui->lineEdit_account->text());
map.insert(JSON_KEY_PWD, ui->lineEdit_pwd->text());
map.insert(JSON_KEY_PARTNERID, ui->lineEdit_partnerid->text());
......
......@@ -39,6 +39,7 @@ private slots:
void on_pushButton_close_clicked();
void SetStoreInfo();
private:
Ui::LoginForm *ui;
......@@ -48,7 +49,6 @@ private:
// 通知窗口
AlertForm *m_alertForm;
};
#endif // LOGINFORM_H
......@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>726</height>
<width>1090</width>
<height>780</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
......@@ -30,7 +30,7 @@
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_6">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
......@@ -115,58 +115,40 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_9">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>70</height>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_logo">
<property name="minimumSize">
<size>
......@@ -201,52 +183,70 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>100</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<widget class="QWidget" name="widget_left" native="true">
<property name="minimumSize">
<size>
<width>300</width>
<height>540</height>
<width>350</width>
<height>350</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>540</height>
<width>350</width>
<height>350</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
......@@ -263,7 +263,7 @@
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_8">
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
......@@ -272,49 +272,57 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>11</width>
<height>12</height>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_title">
<property name="text">
<string>门店登录</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string> 门店登录</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>29</height>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>39</number>
</property>
<property name="rightMargin">
<number>39</number>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="bottomMargin">
<number>0</number>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
......@@ -363,7 +371,7 @@
</size>
</property>
<property name="text">
<string>1794</string>
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Normal</enum>
......@@ -373,6 +381,86 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_storeid">
<property name="text">
<string>门店号:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="ClickedLineEdit" name="lineEdit_storeid">
<property name="minimumSize">
<size>
<width>150</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_posno">
<property name="text">
<string>POS编号:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="ClickedLineEdit" name="lineEdit_posno">
<property name="minimumSize">
<size>
<width>150</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
......@@ -411,11 +499,11 @@
<property name="maximumSize">
<size>
<width>150</width>
<height>30</height>
<height>32</height>
</size>
</property>
<property name="text">
<string>1001</string>
<string/>
</property>
</widget>
</item>
......@@ -464,7 +552,7 @@
</size>
</property>
<property name="text">
<string>1001</string>
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
......@@ -505,14 +593,112 @@
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
</layout>
<zorder>verticalSpacer_2</zorder>
<zorder>verticalSpacer</zorder>
<zorder>verticalSpacer_9</zorder>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QWidget" name="widget_right" native="true">
<property name="minimumSize">
<size>
<width>350</width>
<height>350</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>350</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>59</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>18</height>
<height>40</height>
</size>
</property>
</spacer>
......@@ -785,17 +971,30 @@
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>29</height>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>58</width>
<height>20</height>
</size>
</property>
</spacer>
......@@ -804,7 +1003,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -826,7 +1025,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>26</height>
<height>165</height>
</size>
</property>
</spacer>
......
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