📄 output.pas
字号:
end;
if ComboBox1.Text = '工程部' then
begin
bumenshu := Query1.FieldByName('gcbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',gcbshuliang='''+bumenshu+''',gcbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '器件厂' then
begin
bumenshu := Query1.FieldByName('qjcshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',qjcshuliang='''+bumenshu+''',qjcjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '企管部' then
begin
bumenshu := Query1.FieldByName('qgbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',qgbshuliang='''+bumenshu+''',qgbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '总办' then
begin
bumenshu := Query1.FieldByName('zbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',zbshuliang='''+bumenshu+''',zbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '财务部' then
begin
bumenshu := Query1.FieldByName('cwbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',cwbshuliang='''+bumenshu+''',cwbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '品管部' then
begin
bumenshu := Query1.FieldByName('pgbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',pgbshuliang='''+bumenshu+''',pgbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '销管中心' then
begin
bumenshu := Query1.FieldByName('xgzxshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',xgzxshuliang='''+bumenshu+''',xgzxjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '业务部' then
begin
bumenshu := Query1.FieldByName('ywbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)+StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',ywbshuliang='''+bumenshu+''',ywbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
Query1.Close; {更新WeekHaoCai和WeekDataCache}
Query1.SQL.Clear;
Query1.SQL.Add(sql);
Query1.ExecSQL;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Update WeekDataCache set chukushu='''+chukushu+''',chukujine='''+
chukujine+''' where class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''');
Query1.ExecSQL;
end;
{月}
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select max(riqi) as maxDate from MonthHaoCai where class='''+clclass+
''' and cailiaoming='''+Edit1.Text+'''');
Query1.Prepared;
Query1.Open;
if Not Query1.Eof then
riqi := Query1.FieldByName('maxDate').AsString;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select * from MonthHaoCai where class='''+clclass+''' and cailiaoming='''+
Edit1.Text+''' and riqi='''+riqi+'''');
Query1.Prepared;
Query1.Open; {提取数}
if Not Query1.Eof then
begin
kucunshu := Query1.FieldByName('kucunshu').AsString;
kucunjine := Query1.FieldbyName('kucunjine').AsString;
rukushu := Query1.FieldbyName('rukushu').AsString;
rukujine := Query1.FieldbyName('rukujine').AsString;
chukushu := Query1.FieldbyName('chukushu').AsString;
chukushu := FloatToStr(StrToFloat(chukushu)+StrToFloat(values));
chukujine := FloatToStr(StrToFloat(chukushu)*StrToFloat(Edit3.Text));
jiecunshu := FloatToStr(StrToFloat(kucunshu)+StrToFloat(rukushu)-StrToFloat(chukushu));
jiecunjine := FloatToStr(StrToFloat(kucunjine)+StrToFloat(rukujine)-StrToFloat(chukujine));
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Update MonthHaoCai set chukushu='''+chukushu+''',chukujine='''+chukujine+
''',jiecunshu='''+jiecunshu+''',jiecunjine='''+jiecunjine+''' where class='''+
clclass+''' and cailiaoming='''+Edit1.Text+''' and riqi='''+riqi+'''');
Query1.ExecSQL;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Update MonthDataCache set chukushu='''+chukushu+''',chukujine='''+chukujine+
''' where class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''');
Query1.ExecSQL;
end;
{年}
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select max(nian) as maxYear from YearHaoCai where class='''+clclass+''' and cailiaoming='''+
Edit1.Text+'''');
Query1.Prepared;
Query1.Open;
if Not Query1.Eof then
nian := Query1.FieldByName('maxYear').AsInteger;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select * from YearHaoCai where class='''+clclass+''' and cailiaoming='''+Edit1.Text+
''' and nian='+IntToStr(nian));
Query1.Prepared;
Query1.Open;
if Not Query1.Eof then
begin
kucunshu := Query1.FieldByName('kucunshu').AsString;
kucunjine := Query1.FieldByName('kucunjine').AsString;
rukushu := Query1.FieldByName('rukushu').AsString;
rukujine := Query1.FieldByName('rukujine').AsString;
chukushu := Query1.FieldByName('chukushu').AsString;
chukushu := FloatToStr(StrToFloat(chukushu)+StrToFloat(values));
chukujine := FloatToStr(StrToFloat(chukushu)*StrToFloat(Edit3.Text));
jiecunshu := FloatToStr(StrToFloat(kucunshu)+StrToFloat(rukushu)-StrToFloat(chukushu));
jiecunjine := FloatToStr(StrToFloat(kucunjine)+StrToFloat(rukujine)-StrToFloat(chukujine));
Query1.Close;
Query1.SQL.Clear;
Query1.sql.Add('Update YearHaoCai set chukushu='''+chukushu+''',chukujine='''+chukujine+
''',jiecunshu='''+jiecunshu+''',jiecunjine='''+jiecunjine+''' where class='''+clclass+
''' and cailiaoming='''+Edit1.Text+''' and nian='+IntToStr(nian));
Query1.ExecSQL;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Update YearDataCache set chukushu='''+chukushu+''',chukujine='''+
chukujine+''' where class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''');
Query1.ExecSQL;
end;
end;
end
else {多出,减去一部分}
begin
values := FloatToStr(StrToFloatDef(LastOut,0)-StrToFloatDef(Edit7.Text,0));
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select * from WeekHaoCai where class='''+ clclass+ ''' and nian='+IntToStr(nian)+
' and zhou='+IntToStr(zhou)+' and cailiaoming='''+Edit1.Text+'''');
Query1.Prepared;
Query1.Open;
if Not Query1.Eof then
begin
kucunshu := Query1.FieldByName('kucunshuliang').AsString;
kucunjine := Query1.FieldByName('kucunjine').AsString;
rukushu := Query1.FieldByName('rukushuliang').AsString;
rukujine := Query1.FieldByName('rukujine').AsString;
chukushu := Query1.FieldByName('chukushuliang').AsString;
chukushu := FloatToStr(StrToFloat(chukushu)-StrToFloat(values));
chukujine := FloatToStr(StrToFloat(chukushu)*StrToFloat(Edit3.Text));
jiecunshu := FloatToStr(StrToFloat(kucunshu)+StrToFloat(rukushu)-StrToFloat(chukushu));
jiecunjine := FloatToStr(StrToFloat(kucunjine)+StrToFloat(rukujine)-StrToFloat(chukujine));
if ComboBox1.Text = '生产部' then
begin
bumenshu := Query1.FieldByName('scbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)-StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',scbshuliang='''+bumenshu+''',scbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '工程部' then
begin
bumenshu := Query1.FieldByName('gcbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)-StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',gcbshuliang='''+bumenshu+''',gcbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '器件厂' then
begin
bumenshu := Query1.FieldByName('qjcshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)-StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',qjcshuliang='''+bumenshu+''',qjcjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '企管部' then
begin
bumenshu := Query1.FieldByName('qgbshuliang').AsString;
bumenshu := FloatToStr(StrToFloat(bumenshu)-StrToFloat(values));
bumenjine := FloatToStr(StrToFloat(bumenshu)*StrToFloat(Edit3.Text));
sql := 'Update WeekHaoCai set chukushuliang='''+chukushu+''',chukujine='''+chukujine+
''',qgbshuliang='''+bumenshu+''',qgbjine='''+bumenjine+''',jiecunshuliang='''+
jiecunshu+''',jiecunjine='''+jiecunjine+''' where nian='+IntToStr(nian)+' and zhou='+
IntToStr(zhou)+' and class='''+clclass+''' and cailiaoming='''+Edit1.Text+'''';
end;
if ComboBox1.Text = '总办' then
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -