📄 mpmu.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#include "mPmu.h"
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma package(smart_init)
TKSPmu *sdPmu;
//---------------------------------------------------------------------------
__fastcall TKSPmu::TKSPmu()
:TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidHeadValues()
{
//成品单
ValidPmuWepCode();
//成品单行号
ValidPmuWepdLine();
//工单号
ValidPmuWoCode();
//物料编码
ValidPmuGoods();
//货位
ValidPmuLoc();
//耗用数量
ValidPmuUQty();
//损坏数量
ValidPmuDQty();
//报废数量
ValidPmuLQty();
//填报日期
ValidPmuDate();
//备注
ValidPmuDesc();
//操作员
ValidPmuUser();
//损坏原因
ValidPmuUdr();
//系统日期
ValidPmuSysDate();
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuWepCode() //成品单
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuWepdLine() //成品单行号
{
int m_PmuWepdLine;
int b_PmuWepdLine;
AnsiString m_PmuWepCode;
m_PmuWepCode=GetMasterValue("PmuWepCode");
m_PmuWepdLine=GetMasterValue("PmuWepdLine");
b_PmuWepdLine=GetMasterOldValue("PmuWepdLine");
if(m_PmuWepdLine<1)
throw Exception("日报行号不能小于1");
if(m_PmuWepdLine!=b_PmuWepdLine)
{
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("select * from sdWepd where WepdCode='"+m_PmuWepCode+"' and WepdLine="+AnsiString(m_PmuWepdLine));
Query->Open();
if(Query->RecordCount<1)
{
Query->Close();
throw Exception("日报行号不存在!");
}
Query->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuWoCode() //工单号
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuGoods() //物料编码
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuLoc() //货位
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuUQty() //耗用数量
{
double m_PmuUQty;
double b_PmuUQty;
AnsiString m_PmuWoCode,m_PmuGoods;
m_PmuUQty=GetMasterValue("PmuUQty");
b_PmuUQty=GetMasterOldValue("PmuUQty");
m_PmuWoCode=GetMasterValue("PmuWoCode");
m_PmuGoods=GetMasterValue("PmuGoods");
if(m_PmuUQty!=b_PmuUQty)
{
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("select WsgmGQty=WsgmGQty-WsgmRQty-WsgmUQty from sdWsgm where WsgmWo='"+m_PmuWoCode+"' and WsgmGoods='"+m_PmuGoods+"'");
Query->Open();
if(Query->RecordCount<1)
{
Query->Close();
throw Exception("物料不存在!");
}
if(Query->FieldValues["WsgmGQty"]<m_PmuUQty)
{
Query->Close();
throw Exception("耗用数量不能大于可耗用数量");
}
Query->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuDQty() //损坏数量
{
double m_PmuDQty;
double m_PmuUQty;
m_PmuUQty=GetMasterValue("PmuUQty");
m_PmuDQty=GetMasterValue("PmuDQty");
if(m_PmuDQty>m_PmuUQty)
throw Exception("损坏数量不能大于耗用量");
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuLQty() //报废数量
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuDate() //填报日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuDesc() //备注
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuUser() //操作员
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuUdr() //损坏原因
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::ValidPmuSysDate() //系统日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPmu::CmdExec(AnsiString Param)
{
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -