Beispiel #1
0
    def DrawTable(self):
        self.m_grid1.SetRowBackgroundColourChangeEnable(True)
        item1 = qtable.MenuBarItem("查看/修改\tF2", self.update)
        self.m_grid1.AddPopupMenuItem(item1)
        item2 = qtable.MenuBarItem("设置", None)
        item2.AddChild(qtable.MenuBarItem("有效", self.valid_status))
        item2.AddChild(qtable.MenuBarItem("失效", self.invalid_status))
        self.m_grid1.AddPopupMenuItem(item2)

        self.m_grid1.AddHotKey(wx.WXK_F2, self.update)

        db = sqliteUtil.EasySqlite()
        result = db.execute(self.GenQuerySql())
        self.m_grid1.DrawTable(qtable.GridData(self.m_grid1, columns, result))
Beispiel #2
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        vbox = wx.BoxSizer(wx.VERTICAL)

        # 查询栏
        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        self.supplier_name = wx.StaticText(self, label=u'供应商名称:')
        hbox1.Add(self.supplier_name, flag=wx.RIGHT, border=8)
        self.supplier_name_text = wx.TextCtrl(self, size=wx.Size(150, -1))
        hbox1.Add(self.supplier_name_text, flag=wx.RIGHT, border=8)
        self.supplier_phone = wx.StaticText(self, label=u'电话:')
        hbox1.Add(self.supplier_phone, flag=wx.RIGHT, border=8)
        self.supplier_phone_text = wx.TextCtrl(self, size=wx.Size(150, -1))
        hbox1.Add(self.supplier_phone_text, flag=wx.RIGHT, border=8)
        self.search_button = wx.Button(self, wx.ID_ANY, u"搜索", size=(45, 25))
        self.search_button.SetToolTipString(u"根据条件搜索")
        self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click)
        hbox1.Add(self.search_button, flag=wx.RIGHT, border=10)
        self.clear_button = wx.Button(self, wx.ID_ANY, u"清空", size=(45, 25))
        self.clear_button.SetToolTipString(u"清空搜索条件")
        self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click)
        hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10)

        # 操作按钮栏
        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
        self.add_button = wx.Button(self, wx.ID_ANY, u"添加", size=(70, 25))
        self.add_button.SetToolTipString(u"添加供应商")
        self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click)
        hbox2.Add(self.add_button, flag=wx.RIGHT, border=8)
        self.del_button = wx.Button(self, wx.ID_ANY, u"删除", size=(70, 25))
        self.del_button.SetToolTipString(u"删除供应商")
        self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click)
        hbox2.Add(self.del_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox2, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10)

        # 失效选择栏
        hbox3 = wx.BoxSizer(wx.HORIZONTAL)
        self.checkBox_status = wx.CheckBox(self, -1, u'显示失效客户', pos=(10, 10))
        self.checkBox_status.Bind(wx.EVT_CHECKBOX, self.checkBox_status_change)
        hbox3.Add(self.checkBox_status, flag=wx.RIGHT, border=10)
        vbox.Add(hbox3, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10)

        # 画表格
        self.m_grid1 = qtable.QGridTable(self)

        vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5)

        self.DrawTable()

        self.SetSizer(vbox)
        self.Layout()

        self.Centre(wx.BOTH)
    def drawBottomPanel(self):
        vbox = wx.BoxSizer(wx.VERTICAL)

        # 画表格
        self.m_grid2 = qtable.QGridTable(self.bottom)

        vbox.Add(self.m_grid2, 1, wx.ALL | wx.EXPAND, 5)

        self.bottom.SetSizer(vbox)
Beispiel #4
0
#############################
# 库位维护
#############################

import wx
import util.QTable as qtable
import util.SqliteUtil as sqliteUtil

columns = [qtable.CheckBoxColumnDfn(),
           qtable.ColumnDfn(u'仓库', 'shAlias', percent=20, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'库位编号', 'slId', percent=15, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'库位名称', 'slName', percent=15, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'备注', 'remark', percent=40, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'录入时间', 'ctime', size=150, type=qtable.TextType(), readonly=True)
           ]
YES_NO = 1
SAVE_NO = 2


def GetSHDict():
    dic = {}
    db = sqliteUtil.EasySqlite()
    result = db.execute(
        " select t1.sh_id as key, t1.sh_id || '-' || (case when t1.status = 1 then t1.sh_name else t1.sh_name || '(失效)' end) as value "
        " from storehouse t1 "
        " order by t1.ctime desc")
    for e in result:
        dic[e["key"]] = e["value"]

    return dic
    def drawTopPanel(self):
        # 为top面板设置一个布局管理器
        vbox = wx.BoxSizer(wx.VERTICAL)

        # 查询栏
        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        orderNo = wx.StaticText(self.top, label=u'入库单号:')
        hbox1.Add(orderNo, flag=wx.RIGHT, border=8)
        self.tc_orderNo = wx.TextCtrl(self.top, size=wx.Size(150, -1))
        hbox1.Add(self.tc_orderNo, flag=wx.RIGHT, border=8)
        orderType = wx.StaticText(self.top, label=u'入库类型:')
        hbox1.Add(orderType, flag=wx.RIGHT, border=8)
        self.choice_orderType = wx.Choice(self.top)
        hbox1.Add(self.choice_orderType, flag=wx.RIGHT, border=8)
        customerName = wx.StaticText(self.top, label=u'供应商:')
        hbox1.Add(customerName, flag=wx.RIGHT, border=8)
        self.choice_customerName = wx.Choice(self.top)
        hbox1.Add(self.choice_customerName, flag=wx.RIGHT, border=8)
        productName = wx.StaticText(self.top, label=u'产品:')
        hbox1.Add(productName, flag=wx.RIGHT, border=8)
        self.choice_productName = wx.Choice(self.top)
        hbox1.Add(self.choice_productName, flag=wx.RIGHT, border=8)
        outdate = wx.StaticText(self.top, label=u'入库日期:')
        hbox1.Add(outdate, flag=wx.RIGHT, border=8)
        self.datectl_start = adv.DatePickerCtrl(self.top,
                                                style=adv.DP_DROPDOWN
                                                | adv.DP_SHOWCENTURY
                                                | adv.DP_ALLOWNONE)
        hbox1.Add(self.datectl_start, flag=wx.RIGHT, border=8)
        todate = wx.StaticText(self.top, label=u'~')
        hbox1.Add(todate, flag=wx.RIGHT, border=8)
        self.datectl_end = adv.DatePickerCtrl(self.top,
                                              style=adv.DP_DROPDOWN
                                              | adv.DP_SHOWCENTURY
                                              | adv.DP_ALLOWNONE)
        hbox1.Add(self.datectl_end, flag=wx.RIGHT, border=8)
        self.search_button = wx.Button(self.top,
                                       wx.ID_ANY,
                                       u"搜索",
                                       size=(45, 25))
        self.search_button.SetToolTipString(u"根据条件搜索")
        self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click)
        hbox1.Add(self.search_button, flag=wx.RIGHT, border=10)
        self.clear_button = wx.Button(self.top,
                                      wx.ID_ANY,
                                      u"清空",
                                      size=(45, 25))
        self.clear_button.SetToolTipString(u"清空搜索条件")
        self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click)
        hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox1,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 操作按钮栏
        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
        self.add_button = wx.Button(self.top, wx.ID_ANY, u"添加", size=(70, 25))
        self.add_button.SetToolTipString(u"添加入库单")
        self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click)
        hbox2.Add(self.add_button, flag=wx.RIGHT, border=8)
        self.del_button = wx.Button(self.top, wx.ID_ANY, u"撤回", size=(70, 25))
        self.del_button.SetToolTipString(u"撤回入库单")
        self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click)
        hbox2.Add(self.del_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox2,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 画表格
        self.m_grid1 = qtable.QGridTable(self.top)

        vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5)

        self.top.SetSizer(vbox)
#############################
# 入库作业
#############################
import wx
import util.QTable as qtable
import util.SqliteUtil as sqliteUtil
import wx.adv as adv

columns = [
    qtable.CheckBoxColumnDfn(),
    qtable.ColumnDfn(u'产品编码',
                     'productCode',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'产品名称',
                     'productName',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'产品分类',
                     'productCategoryName',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'产品描述',
                     'productDesc',
                     percent=20,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'备注',
Beispiel #7
0
#############################
# 供应商维护
#############################

import wx
import util.QTable as qtable
import util.SqliteUtil as sqliteUtil

columns = [qtable.CheckBoxColumnDfn(),
           qtable.ColumnDfn(u'编号', 'supplierId', size=60, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'名称', 'supplierName', percent=10, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'地址', 'supplierAddr', percent=20, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'电话', 'phoneNumber', percent=10, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'邮箱', 'email', percent=10,
                            type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'备注', 'remark', percent=20, type=qtable.TextType(), readonly=True),
           qtable.ColumnDfn(u'录入时间', 'ctime', size=150, type=qtable.TextType(), readonly=True)
           ]
YES_NO = 1
SAVE_NO = 2


class SupplierPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        vbox = wx.BoxSizer(wx.VERTICAL)

        # 查询栏
        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        self.supplier_name = wx.StaticText(self, label=u'供应商名称:')
Beispiel #8
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        vbox = wx.BoxSizer(wx.VERTICAL)

        # 查询栏
        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        self.dic_type = wx.StaticText(self, label=u'字典类型:')
        hbox1.Add(self.dic_type, flag=wx.RIGHT, border=8)
        self.dic_type_choice = wx.Choice(self)
        hbox1.Add(self.dic_type_choice, flag=wx.RIGHT, border=8)
        self.dic_value = wx.StaticText(self, label=u'字典值:')
        hbox1.Add(self.dic_value, flag=wx.RIGHT, border=8)
        self.dic_value_text = wx.TextCtrl(self, size=wx.Size(150, -1))
        hbox1.Add(self.dic_value_text, flag=wx.RIGHT, border=8)
        self.search_button = wx.Button(self, wx.ID_ANY, u"搜索", size=(45, 25))
        self.search_button.SetToolTipString(u"根据条件搜索")
        self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click)
        hbox1.Add(self.search_button, flag=wx.RIGHT, border=10)
        self.clear_button = wx.Button(self, wx.ID_ANY, u"清空", size=(45, 25))
        self.clear_button.SetToolTipString(u"清空搜索条件")
        self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click)
        hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox1,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 操作按钮栏
        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
        self.add_button = wx.Button(self, wx.ID_ANY, u"添加", size=(70, 25))
        self.add_button.SetToolTipString(u"添加字典")
        self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click)
        hbox2.Add(self.add_button, flag=wx.RIGHT, border=8)
        # self.del_button = wx.Button(self, wx.ID_ANY, u"失效", size=(70, 25))
        # self.del_button.SetToolTipString(u"失效字典")
        # self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click)
        # hbox2.Add(self.del_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox2,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 失效选择栏
        hbox3 = wx.BoxSizer(wx.HORIZONTAL)
        self.checkBox_status = wx.CheckBox(self, -1, u'显示失效字典', pos=(10, 10))
        self.checkBox_status.Bind(wx.EVT_CHECKBOX, self.checkBox_status_change)
        hbox3.Add(self.checkBox_status, flag=wx.RIGHT, border=10)
        vbox.Add(hbox3,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 画表格
        self.m_grid1 = qtable.QGridTable(self)

        vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5)

        self.dic_type_choice.SetItems(GetDicTypeChoice())
        self.dic_type_choice.SetStringSelection("")
        self.DrawTable()

        self.SetSizer(vbox)
        self.Layout()
        self.Centre(wx.BOTH)
Beispiel #9
0
#############################
# 字典维护
#############################

import wx
import util.QTable as qtable
import util.SqliteUtil as sqliteUtil

columns = [
    qtable.CheckBoxColumnDfn(),
    qtable.ColumnDfn(u'字典类型',
                     'dicTypeName',
                     percent=20,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'字典值',
                     'dicValue',
                     percent=30,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'备注',
                     'remark',
                     percent=50,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'录入时间',
                     'ctime',
                     size=150,
                     type=qtable.TextType(),
                     readonly=True)
]
#############################
# 出库作业
#############################
import wx
import util.QTable as qtable
import util.SqliteUtil as sqliteUtil
import wx.adv as adv

columns = [
    qtable.CheckBoxColumnDfn(),
    qtable.ColumnDfn(u'出库单号',
                     'orderNo',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'客户',
                     'customerName',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'仓库',
                     'shName',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'出库类型',
                     'orderTypeName',
                     percent=20,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'出库状态',
Beispiel #11
0
#############################
# 仓库维护
#############################

import wx
import util.QTable as qtable
import util.SqliteUtil as sqliteUtil

columns = [
    qtable.CheckBoxColumnDfn(),
    qtable.ColumnDfn(u'编号',
                     'shId',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'名称',
                     'shName',
                     percent=10,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'地址',
                     'shAddr',
                     percent=40,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'备注',
                     'remark',
                     percent=40,
                     type=qtable.TextType(),
                     readonly=True),
    qtable.ColumnDfn(u'录入时间',
Beispiel #12
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        self.product_category_dict = GetProductCategoryDict()

        vbox = wx.BoxSizer(wx.VERTICAL)

        # 查询栏
        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        self.product_category = wx.StaticText(self, label=u'产品分类:')
        hbox1.Add(self.product_category, flag=wx.RIGHT, border=8)
        self.choice_product_category = wx.Choice(self)
        hbox1.Add(self.choice_product_category, flag=wx.RIGHT, border=8)
        self.product_code = wx.StaticText(self, label=u'产品编码:')
        hbox1.Add(self.product_code, flag=wx.RIGHT, border=8)
        self.tc_product_code = wx.TextCtrl(self, size=wx.Size(150, -1))
        hbox1.Add(self.tc_product_code, flag=wx.RIGHT, border=8)
        self.product_name = wx.StaticText(self, label=u'产品名称:')
        hbox1.Add(self.product_name, flag=wx.RIGHT, border=8)
        self.tc_product_name = wx.TextCtrl(self, size=wx.Size(150, -1))
        hbox1.Add(self.tc_product_name, flag=wx.RIGHT, border=8)
        self.search_button = wx.Button(self, wx.ID_ANY, u"搜索", size=(45, 25))
        self.search_button.SetToolTipString(u"根据条件搜索")
        self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click)
        hbox1.Add(self.search_button, flag=wx.RIGHT, border=10)
        self.clear_button = wx.Button(self, wx.ID_ANY, u"清空", size=(45, 25))
        self.clear_button.SetToolTipString(u"清空搜索条件")
        self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click)
        hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox1,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 操作按钮栏
        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
        self.add_button = wx.Button(self, wx.ID_ANY, u"添加", size=(70, 25))
        self.add_button.SetToolTipString(u"添加产品")
        self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click)
        hbox2.Add(self.add_button, flag=wx.RIGHT, border=8)
        self.del_button = wx.Button(self, wx.ID_ANY, u"删除", size=(70, 25))
        self.del_button.SetToolTipString(u"删除产品")
        self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click)
        hbox2.Add(self.del_button, flag=wx.RIGHT, border=8)

        vbox.Add(hbox2,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 失效选择栏
        hbox3 = wx.BoxSizer(wx.HORIZONTAL)
        self.checkBox_status = wx.CheckBox(self, -1, u'显示失效产品', pos=(10, 10))
        self.checkBox_status.Bind(wx.EVT_CHECKBOX, self.checkBox_status_change)
        hbox3.Add(self.checkBox_status, flag=wx.RIGHT, border=10)
        vbox.Add(hbox3,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP,
                 border=10)

        # 画表格
        self.m_grid1 = qtable.QGridTable(self)

        vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5)

        self.choice_product_category.SetItems(
            GetDicTypeChoice(self.product_category_dict))
        self.choice_product_category.SetStringSelection("")
        self.DrawTable()

        self.SetSizer(vbox)
        self.Layout()

        self.Centre(wx.BOTH)