⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_allexportbilledit.pas

📁 这是一个基于delphi平台的物流空运管理系统!
💻 PAS
📖 第 1 页 / 共 5 页
字号:
         edtrfileno.Text:=QryTemp.fieldbyName('fileno').asstring;
         {cuscode 发货人}
         comcuscode.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('cuscode').asstring,comcuscode);
         {cuscode 发货人名称}
         EdtCusCodename.Text:=QryTemp.fieldbyName('cuscodename').asstring;
         { Shouhuoren 收货人}
         ComConsign.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('shouhuoren').asstring,Comconsign);
         { Shouhuoren 收货人名称}
         EdtConsignname.Text:=QryTemp.fieldbyName('consignname').asstring;
         {agentcode 目的港代理代理商}
         comagent.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('agentcode').asstring,comagent);
         {trusttype 委托来源}
         comtrustsource.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('trustsource').asstring,comtrustsource);
         {Trusttype  委托类型}
         trusttype.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('trusttype').asstring,trusttype);
         {quotecode 交接单号}
         comprice.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('quotecode').asstring,comprice);
         QuoteCode:=qrytemp.fieldbyname('quotecode').asstring;

         {DJNUMBER 单据数}
         Edtnumber.Text:=QryTemp.fieldbyName('djnumber').asstring;
         {KJKM会计科目}
         comkmdm.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('kjkm').asstring,comkmdm);
         {DJNUMBER 单据数}
         Edtzcnumber.Text:=QryTemp.fieldbyName('zcdjnumber').asstring;
         {KJKM会计科目}
         comzckmdm.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('zckjkm').asstring,comzckmdm);
         {Shipper  发货人}
         shipper.lines.Text:=QryTemp.fieldbyName('Shipper').asstring;
         {Consignee 收货人}
         consignee.lines.Text:=QryTemp.fieldbyName('Consignee').asstring;
         {Agent 通知方}
         inform.lines.Text:=QryTemp.fieldbyName('Agent').asstring;
         {Carrier 航空公司}
         ComShipCom.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('Carrier').asstring,ComShipCom);
         {REciplace 收货地}
         EdtReci.Text:=QryTemp.fieldbyName('Reciplace').asstring;
         {AirPort 装货港}
         ComLoad.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('Airport').asstring,ComLoad);
         {AirPortTo 卸货港}
         ComUnLoad.text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('Airportto').asstring,ComUnLoad);
         {dest 目的地}
         edtdest.Text:=QryTemp.fieldbyName('destination').asstring;

         {一乘航次 by1 航班 to1 经停 Fdate1 出运日期}
         EdtBy.Text:=QryTemp.fieldbyName('by1').asstring;
         EdtTo.Text:=QryTemp.fieldbyName('To1').asstring;
         VoyageDate.DateTime:=strtodatetime(QryTemp.fieldbyName('FDate1').asstring);
         {二乘航次 by2 航班 to2 经停 Fdate2 出运日期}
         EdtBy2.Text:=QryTemp.fieldbyName('by2').asstring;
         EdtTo2.Text:=QryTemp.fieldbyName('To2').asstring;
         VoyageDate2.text:=QryTemp.fieldbyName('FDate2').asstring;
         {三乘航次 by3 航班 to3 经停 Fdate3 出运日期}
         EdtBy3.Text:=QryTemp.fieldbyName('by3').asstring;
         EdtTo3.Text:=QryTemp.fieldbyName('To3').asstring;
         VoyageDate3.text:=QryTemp.fieldbyName('FDate3').asstring;

         {Accinfo  麦头 }
         Ai.lines.Text:=QryTemp.fieldbyName('AccInfo').asstring;
         {A.I.C}
         EdtAIC.Text:=QryTemp.fieldbyName('AIC').asstring;
         {A.n.}
         EdtAccount.Text:=QryTemp.fieldbyName('Account').asstring;
         {Handing 处理}
         Hi.lines.Text:=QryTemp.fieldbyName('Handling').asstring;
         {Accinsurance }
         MemACC.Text:=QryTemp.fieldbyName('accinsurance').asstring;
         {Curr  运费币种}
         EdtCurr.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('Curr').asstring,EdtCurr);
         {CHGS }
         EdtCHGS.Text:=QryTemp.fieldbyName('Chgs').asstring;
         {PPD}
         EdtPpd.Text:=QryTemp.fieldbyName('PPD').asstring;
         {COLL}
         EdtColl.Text:=QryTemp.fieldbyName('COLL').asstring;
         {OPPD}
         EdtOppd.Text:=QryTemp.fieldbyName('OPPD').asstring;
         {OCOLL}
         EdtOcoll.Text:=QryTemp.fieldbyName('OCOLL').asstring;
         {DCV}
         EdtDvc.Text:=QryTemp.fieldbyName('DVC').asstring;
         {DVCus}
         EdtDvc2.Text:=QryTemp.fieldbyName('DVCus').asstring;
         {运费对象}
         ComYunCuscode.Text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('Cuscompany').asstring,ComYunCuscode);

         {签定日期}
         ExecDate.DateTime:=Strtodatetime(QryTemp.fieldbyName('dExecdate').asstring);
         {签单地点}
         EdtPlace.Text:=QryTemp.fieldbyName('Execplace').asstring;
         {业务员}
         Bussiness.text:=FrmMain.setcomboboxtext(QryTemp.fieldbyName('Bussiness').asstring,Bussiness);
         {操作人}
         Edtczr.Text:=QryTemp.fieldbyName('operate').asstring;
         {修改保存人}
         Edtmodioper.Text:=QryTemp.fieldbyName('ModiOper').asstring;

         {befinish 是否完成}
         if QryTemp.fieldbyName('befinish').asinteger=1 then
             chkfinish.Checked :=true
         else
             chkfinish.Checked :=false;

         if QryTemp.fieldbyName('keydown').asinteger=1 then
             chkkeydown.Checked :=true
         else
             chkkeydown.Checked :=false;


         {IFDISCARD 是否作废}
         if QryTemp.fieldbyName('ifdiscard').asinteger=1 then
             chkdiscard.Checked :=true
         else
             chkdiscard.Checked :=false;

         {IFZHIDAN 是否直单}
         if QryTemp.fieldbyName('ifzhidan').asinteger=1 then
           Begin
             Chkzhdan.Checked :=true;
             hawb.TabVisible :=False;
           end
         else
           begin
             Chkzhdan.Checked :=false;
             hawb.TabVisible :=True;  {如果不是直单,则把分单显示出来}
           end;


         ClearSg;  {清空货物信息中的内容}
         ShowGoods; {显示货物信息}

          {判断有无进舱通知}
          with QryTemp do
             begin
                close;
                sql.text:='select * from landtrans where trustcode ='''+Varmain+'''';
                open;
             end;

          {判断有无一乘运输}
          with QryTemp do
             begin
                close;
                sql.text:='select * from FileOcean where FileCode ='''+Varmain+'''';
                open;
             end;

         ShowChild(VarMain); {显示分单信息}
       end;
      QryTemp.close;
      except
           ShowMessage('主单数据显示失败,请检查!');
      end;
   end;
end;

destructor TFrmAllExportBillEdit.Destroy;
begin
  inherited;
end;

procedure TFrmAllExportBillEdit.showChild(Code: string);
begin
   Try
   {检查完毕}
       with QryTemp do
        begin
           close;
           sql.text:='select a.fileCode,a.fileno,a.Hawb,a.cuscodename,a.goodsdesc,'+
           'a.goodsnumber,a.goodsweight,a.goodssize from '+
            'FileTable a where a.MainCode ='''+Varmain+''' and ifdiscard=0 ';
           open;
        end;
       if QryTemp.RecordCount<1 then
            exit;

       LVHW.Items.Clear;
       FrmMain.AddData(LVHW,QryTemp);
       QryTemp.Close;
   except

   end;
end;

Function TFrmAllExportBillEdit.SaveGoods:Boolean;
var
  Count:integer;
  SqlStr:string;
begin
  {检查完毕}
  Result:=false;
  try
   if FrmMain.TestTextNumber(SG.Cells[0,RowLast],'integer') then
    else
      begin
       ShowMessage('请在件数中输入数值类型的信息');
       exit;
      end;

    if FrmMain.TestTextNumber(SG.Cells[1,RowLast],'real') then
    else
      begin
       ShowMessage('请在重量中输入数值类型的信息');
       exit;
      end;

    if FrmMain.TestTextNumber(SG.Cells[6,RowLast],'real') then
    else
      begin
       ShowMessage('请在计费重量中输入数值类型的信息');
       exit;
      end;


    if FrmMain.TestTextNumber(SG.Cells[7,RowLast],'real') then
    else
      begin
       ShowMessage('请在单价中输入数值类型的信息');
       exit;
      end;

    if FrmMain.TestTextNumber(SG.Cells[8,RowLast],'real') then
    else
      begin
       ShowMessage('请在总额中输入数值类型的信息');
       exit;
      end;

  if gIsedit  then
    begin
{件数  重量  单位  体积  等级  公式  }
{计费重量  单价  费用  货物描述  编号 编号  C.M.I  一个 }
      FrmMain.UpStr(SqlStr,'PlaneGoods ');
      FrmMain.UpStr(SqlStr,'Pieces',strtoint(SG.Cells[0,RowLast]),',');
      FrmMain.UpStr(SqlStr,'Weight',strtofloat(SG.Cells[1,RowLast]),',');
      FrmMain.UpStr(SqlStr,'kgid',SG.Cells[2,RowLast],',');
      FrmMain.UpStr(SqlStr,'Size',SG.Cells[3,RowLast],',');
      FrmMain.UpStr(SqlStr,'rateclass',SG.Cells[4,RowLast],',');
      FrmMain.UpStr(SqlStr,'Formula',SG.Cells[5,RowLast],',');
      FrmMain.UpStr(SqlStr,'chargweight',strtofloat(SG.Cells[6,RowLast]),',');
      FrmMain.UpStr(SqlStr,'rate',strtofloat(SG.Cells[7,RowLast]),',');
      FrmMain.UpStr(SqlStr,'total',strtofloat(SG.Cells[8,RowLast]),',');
      FrmMain.UpStr(SqlStr,'Spegoods',SG.Cells[12,RowLast],',');
      FrmMain.UpStr(SqlStr,'SpeRemark',SG.Cells[13,RowLast],',');
      FrmMain.UpStr(SqlStr,'goods',SG.Cells[9,RowLast],'');
     {第十行纪录货物的自动编号}
      FrmMain.UpStr(SqlStr,'GoodsCode=',SG.Cells[10,RowLast],'w');
    end
  else
    begin
      goodscode:=FrmMain.GetCode('B') ;
{件数  单位  体积  等级  公式  }
{计费重量  单价  费用  货物描述  编号 编号  C.M.I  一个 }
      SqlStr:='Insert into PlaneGoods(GoodsCode,FileCode,Pieces,weight,'+
      'kgid,Size,rateclass,Formula,chargweight,rate,'+
      'total,SpeGoods,SpeRemark,goods) Values(';
      FrmMain.InsStr(SqlStr,goodscode,',');
      FrmMain.InsStr(SqlStr,VarMain,',');
      FrmMain.InsStr(SqlStr,strtoint(SG.Cells[0,RowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG.Cells[1,RowLast]),',');
      FrmMain.InsStr(SqlStr,SG.Cells[2,RowLast],',');
      FrmMain.InsStr(SqlStr,strtofloat(SG.Cells[3,RowLast]),',');
      FrmMain.InsStr(SqlStr,(SG.Cells[4,RowLast]),',');
      FrmMain.InsStr(SqlStr,(SG.Cells[5,RowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG.Cells[6,RowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG.Cells[7,RowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG.Cells[8,RowLast]),',');
      FrmMain.InsStr(SqlStr,(SG.Cells[12,RowLast]),',');
      FrmMain.InsStr(SqlStr,(SG.Cells[13,RowLast]),',');
      FrmMain.InsStr(SqlStr,SG.Cells[9,RowLast],'');
    end;

   if FrmMain.ExecSQL(SqlStr) then
   else
    begin
      ShowMessage('操作有失误,货物纪录存储失败,请检查重试!');
      exit;
    end;

   GIsEdit:=True;  {把增加编辑标志置为编辑状态}
   BitBtn5.Enabled :=true;  {把增加按钮置为真}
 except
 end;
 Result:=True;    {保存成功}
end;

Function TFrmAllExportBillEdit.CSaveGoods:Boolean;
var
  Count:integer;
  SqlStr:string;
begin
     Result:=false;
  Try
   if FrmMain.TestTextNumber(SG2.Cells[0,CRowLast],'integer') then
    else
      begin
       ShowMessage('请在件数中输入数值类型的信息');
       exit;
      end;

    if FrmMain.TestTextNumber(SG2.Cells[1,CRowLast],'real') then
    else
      begin
       ShowMessage('请在重量中输入数值类型的信息');
       exit;
      end;

    if FrmMain.TestTextNumber(SG2.Cells[6,CRowLast],'real') then
    else
      begin
       ShowMessage('请在计费重量中输入数值类型的信息');
       exit;
      end;


    if FrmMain.TestTextNumber(SG2.Cells[7,CRowLast],'real') then
    else
      begin
       ShowMessage('请在单价中输入数值类型的信息');
       exit;
      end;

    if FrmMain.TestTextNumber(SG2.Cells[8,CRowLast],'real') then
    else
      begin
       ShowMessage('请在总额中输入数值类型的信息');
       exit;
      end;


  if cgIsedit then
    begin
      FrmMain.UpStr(SqlStr,'PlaneGoods ');
      FrmMain.UpStr(SqlStr,'Pieces',strtoint(SG2.Cells[0,CRowLast]),',');
      FrmMain.UpStr(SqlStr,'Weight',strtofloat(SG2.Cells[1,CRowLast]),',');
      FrmMain.UpStr(SqlStr,'kgid',SG2.Cells[2,CRowLast],',');
      FrmMain.UpStr(SqlStr,'Size',SG2.Cells[3,CRowLast],',');
      FrmMain.UpStr(SqlStr,'rateclass',SG2.Cells[4,CRowLast],',');
      FrmMain.UpStr(SqlStr,'Formula',SG2.Cells[5,CRowLast],',');
      FrmMain.UpStr(SqlStr,'chargweight',strtofloat(SG2.Cells[6,CRowLast]),',');
      FrmMain.UpStr(SqlStr,'rate',strtofloat(SG2.Cells[7,CRowLast]),',');
      FrmMain.UpStr(SqlStr,'total',strtofloat(SG2.Cells[8,CRowLast]),',');

      FrmMain.UpStr(SqlStr,'SpeGoods',SG2.Cells[12,CRowLast],',');
      FrmMain.UpStr(SqlStr,'SpeRemark',SG2.Cells[13,CRowLast],',');

      FrmMain.UpStr(SqlStr,'goods',SG2.Cells[9,CRowLast],'');
      FrmMain.UpStr(SqlStr,'GoodsCode=',SG2.Cells[10,CRowLast],'w');
    end
  else
    begin
      Cgoodscode:=FrmMain.GetCode('B') ;
      SqlStr:='Insert into PlaneGoods(GoodsCode,FileCode,Pieces,weight,'+
      'kgid,Size,rateclass,Formula,chargweight,rate,'+
      'total,SpeGoods,SpeRemark,goods) Values(';
      FrmMain.InsStr(SqlStr,Cgoodscode,',');
      FrmMain.InsStr(SqlStr,varhawb,',');
      FrmMain.InsStr(SqlStr,strtoint(SG2.Cells[0,CRowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG2.Cells[1,CRowLast]),',');
      FrmMain.InsStr(SqlStr,SG2.Cells[2,CRowLast],',');
      FrmMain.InsStr(SqlStr,strtofloat(SG2.Cells[3,CRowLast]),',');
      FrmMain.InsStr(SqlStr,(SG2.Cells[4,CRowLast]),',');
      FrmMain.InsStr(SqlStr,(SG2.Cells[5,CRowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG2.Cells[6,CRowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG2.Cells[7,CRowLast]),',');
      FrmMain.InsStr(SqlStr,strtofloat(SG2.Cells[8,CRowLast]),',');

      FrmMain.InsStr(SqlStr,(SG2.Cells[12,CRowLast]),',');
      FrmMain.InsStr(SqlStr,(SG2.Cells[13,CRowLast]),',');

      FrmMain.InsStr(SqlStr,SG2.Cells[9,CRowLast],'');
    end;

  if FrmMain.ExecSQL(SqlStr) then
  else
    Begin
     ShowMessage('分单货物记录存储失败,请检查!');
     exit;
    end;

   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -