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

📄 formphszj.pas

📁 小灵通机卡分离模块的设计.建立在数据库服务器
💻 PAS
📖 第 1 页 / 共 5 页
字号:
          frminterfacepop2:=nil;
  end;

  //写产品性质,并将显示产品性质的控件设为不可用
  ProdInfo.LwlProdInfo.Edit;
  if iproducttype = '1' then //合一机
  begin
    ProdInfo.LwlProdInfo.FieldByName('prod_prop').AsString:='B1';
  end
  else if iproducttype = '0' then
  begin                  //分离机
    ProdInfo.LwlProdInfo.FieldByName('prod_prop').AsString:='B3';
  end;
  ProdInfo.LwlProdInfo.Post;
 // MessageDlg(ProdInfo.LwlProdInfo.FieldByName('prod_prop').AsString,mtWarning	,[mbok],0);
 // prodInfo.DblcProdClas.Update;

  prodInfo.DblcProdprop.Enabled:=false;

  if iproducttype = '1' then //合一机
  begin
   framephsinfo.Init;         //合一机的初始化
   framephsinfo.Visible:=true;
   PhsSimInfo1.Visible:=false;

  end
  else if iproducttype = '0' then
  begin                  //分离机
        PhsSimInfo1.PhsSimInit;
        PhsSimInfo1.Visible:=true;
        framephsinfo.Visible:=false;
        PhsSimInfo1.iOldSim:='';
        PhsSimInfo1.itempSim:='';
        PhsSimInfo1.DblcCardType.Enabled:=true;

  end;

  //---------------------生产编号不为空
     //根据给定的生产编号,生产流水检索流动市话的特有信息
  if  iscbh <> '' then
  begin
    if iproducttype = '1' then
    begin
        if FramePHsinfo.retrievenewvalue(currscbh,currscls,currcpbh) <>1 then
        begin
                messagedlg('检索无线市话相关信息失败!',mtinformation,[mbok],0);
        end;
        //对当前的流动市话PS所在的局向信息进行赋值
        framephsinfo.setcurrexchcode(trim(ProdInfo.LwlProdInfo.fieldbyname('exch_code').asstring));
    end
    else if iproducttype = '0' then
    begin
       GetProdData(PhsSimInfo1.LwlPhsSim,iscbh,iscls,icpbh,'J2','1','');
       if PhsSimInfo1.LwlPhsSim.RecordCount = 0 then
        begin
        MessageDlg('缺少SIM卡信息,请确认!',mtInformation,[mbok],0);
        PostMessage(self.handle, WM_CLOSE, 0, 0); //关闭窗口
        exit;
        end;
        PhsSimInfo1.iOldSim:=self.PhsSimInfo1.LwlPhsSim.fieldbyname('card_iccid').asstring;
        PhsSimInfo1.itempSim:= PhsSimInfo1.iOldSim;
        PhsSimInfo1.DblcCardType.Enabled:=true;
        
       // showmessage('PhsSimInfo1.itempSim:='+PhsSimInfo1.itempSim+' PhsSimInfo1.iOldSim:='+PhsSimInfo1.iOldSim);
    end;
  end;
  //ProdInfo.DblcProdProp.
  ///////////////add by yed end  1 ///////////////////////
//add by qyd about 机卡分离---激活 at 20050525 start
  if  FrmYyslzx.Getywm ='I7' then
  begin
         disablePanel(PhsSimInfo1);
         PhoneInfo.DbePhoneNo.Enabled:=false;
         PhoneInfo.DbeGroupNo.Enabled:=false;
         PhoneInfo.DbeInsideNo.Enabled:=false;
  end;

end;

procedure  TFrmPhsZj.addDefaultProgFunc;
begin
    //无应答呼转
    ProgFunc.LwlIncrProd.Append;
    ProgFunc.LwlIncrProd.FieldByName('product_id').AsString := icpbh;
    ProgFunc.LwlIncrProd.FieldByName('prod_class').AsString := 'B6';
    ProgFunc.LwlIncrProd.FieldByName('cons_flag').AsString := 'A';
    //无连接转移(小灵通)
    ProgFunc.LwlIncrProd.Append;
    ProgFunc.LwlIncrProd.FieldByName('product_id').AsString := icpbh;
    ProgFunc.LwlIncrProd.FieldByName('prod_class').AsString := 'I4';
    ProgFunc.LwlIncrProd.FieldByName('cons_flag').AsString := 'A';
    //主叫显示
    ProgFunc.LwlIncrProd.Append;
    ProgFunc.LwlIncrProd.FieldByName('product_id').AsString := icpbh;
    ProgFunc.LwlIncrProd.FieldByName('prod_class').AsString := 'B8';
    ProgFunc.LwlIncrProd.FieldByName('cons_flag').AsString := 'A';
    //无条件呼转
    ProgFunc.LwlIncrProd.Append;
    ProgFunc.LwlIncrProd.FieldByName('product_id').AsString := icpbh;
    ProgFunc.LwlIncrProd.FieldByName('prod_class').AsString := 'A5';
    ProgFunc.LwlIncrProd.FieldByName('cons_flag').AsString := 'A';
    //国内长途
    ProgFunc.LwlIncrProd.Append;
    ProgFunc.LwlIncrProd.FieldByName('product_id').AsString := icpbh;
    ProgFunc.LwlIncrProd.FieldByName('prod_class').AsString := 'G2';
    ProgFunc.LwlIncrProd.FieldByName('cons_flag').AsString := 'A';

    //小灵通预付费
    ProgFunc.LwlIncrProd.Append;
    ProgFunc.LwlIncrProd.FieldByName('product_id').AsString := icpbh;
    ProgFunc.LwlIncrProd.FieldByName('prod_class').AsString := 'J5';
    ProgFunc.LwlIncrProd.FieldByName('cons_flag').AsString := 'A';

    ProgFunc.LwlIncrProd.Edit;
    ProgFunc.LwlIncrProd.Post;
    //预付费信息
    ProgFunc.LwlPrepay.FieldByName('account_id').AsString := 'acc01';
    ProgFunc.LwlPrepay.FieldByName('bala_mode').AsString := '0';
    ProgFunc.LwlPrepay.FieldByName('rent_flag').AsString := '0';
    ProgFunc.LwlPrepay.FieldByName('fetch_flag').AsString := '0';
    ProgFunc.LwlPrepay.Edit;
    ProgFunc.LwlPrepay.Post;
    //预付费属性
    ProgFunc.LwlIncrProdProp.Append;
    ProgFunc.LwlIncrProdProp.FieldByName('product_id').AsString := icpbh;      //产品编号
    ProgFunc.LwlIncrProdProp.FieldByName('prod_class').AsString := 'J5';  //增值产品类别
    ProgFunc.LwlIncrProdProp.FieldByName('item_code').AsString := 'prepay_info';   //属性项编码
    ProgFunc.LwlIncrProdProp.FieldByName('item_value').AsString := 'acc01';   //属性项编码
    ProgFunc.LwlIncrProdProp.Edit;
    ProgFunc.LwlIncrProdProp.Post;



    SetComboBox(ProgFunc.CbProgFunc,ProgFunc.LwlIncrProd,'LuProdClass');
end;
//进行选号
procedure TFrmPhsZj.PhoneInfoBtnNumSelClick(Sender: TObject);
begin
  inherited;
  if ProdInfo.DblcAddrNo.KeyValue = null then
  begin
    MessageDlg('客户地址错误或模糊,重新确定局向!',mtInformation,[mbok],0);
    exit;        
  end;
  PhoneInfo.iSwithId := PhoneInfo.LwlPhoneInfo.FieldByName('switch_id').AsString; //交换机
  PhoneInfo.iExchCode := ProdInfo.LwlProdInfo.FieldByName('exch_code').AsString;  //地址局向
  PhoneInfo.iProtCode := ProdInfo.LwlProdInfo.FieldByName('prot_code').AsString;  //协议编号
  PhoneInfo.iProdClass := ProdInfo.LwlProdInfo.FieldByName('prod_class').AsString;//产品类别
  PhoneInfo.gExchName := ProdInfo.DblcAddrNo.Text;  //管理局名称  
  PhoneInfo.iCustType := FrmYhxx.LwlUserInfo.FieldByName('cust_type').AsString;//客户等级
  PhoneInfo.BtnNumSelClick(Sender);
end;

//选择程控功能
procedure TFrmPhsZj.ProgFuncBtnFuncClick(Sender: TObject);
var
  i :integer;
begin
  inherited;
//(modify by terry 2002.8.7)
  ProgFunc.gSwitchCode := PhoneInfo.LwlPhoneInfo.FieldByName('switch_id').AsString;  //交换机编码
  ProgFunc.gCpbh := icpbh;  
  ProgFunc.BtnFuncClick(Sender);
  //modify kenshine 20040609
  //PHS的CENTREX功能检验(modify on 2003.02.23)
  {if ProgFunc.LwlIncrProd.Locate('prod_class','H3',[loCaseInsensitive]) then
  begin
    PhoneInfo.DbeGroupNo.Enabled := true;
    PhoneInfo.DbeGroupNo.Color := clWindow;
    PhoneInfo.DbeInsideNo.Enabled := true;
    PhoneInfo.DbeInsideNo.Color := clWindow;
    PhoneInfo.BtnGroupSel.Enabled := true;
  end
  else
  begin
    PhoneInfo.DbeGroupNo.Enabled := false;
    PhoneInfo.DbeGroupNo.Color := $00EAEAEA;
    PhoneInfo.DbeInsideNo.Enabled := false;
    PhoneInfo.DbeInsideNo.Color := $00EAEAEA;
    PhoneInfo.BtnGroupSel.Enabled := false;
    PhoneInfo.LwlPhoneInfo.FieldByName('group_no').AsString := '';
    PhoneInfo.LwlPhoneInfo.FieldByName('inside_no').AsString := '';      
  end;} 
end;


//如果客户名称、客户联系人、用户联系人为空时,变更用户名称的同时将以上几项设为相同
procedure TFrmPhsZj.FrmYhxxDbeUserNamExit(Sender: TObject);
var
  ls_username,ls_payname:string;
begin
  inherited;
  FrmYhxx.DbeUserNamExit(Sender);
  ls_payname:=trim(AccountInfo.LwlAccoInfo.fieldbyname('pay_name').AsString);
  ls_username:=trim(FrmYhxx.LwlUserInfo.fieldbyname('cust_name').AsString);
  if (AccountInfo.RbPayAll.Checked and AccountInfo.DbePayName.Enabled) then
  begin
     if ((ls_payname='') and (ls_username<>'')) then
     begin
        AccountInfo.LwlAccoInfo.Edit;
        AccountInfo.LwlAccoInfo.FieldByName('pay_name').AsString:=ls_username;
        Accountinfo.PostMode();
        AccountInfo.LwlAccoInfo.Post;
     end;
  end;
  //设置查号名称的默认值(add on 2003.10.30)
  if PhoneInfo.iCustName = '' then
  begin
    PhoneInfo.iCustName := ls_username;
    if trim(PhoneInfo.LwlPhoneInfo.FieldByName('prodno_name').AsString) = '' then
      PhoneInfo.LwlPhoneInfo.FieldByName('prodno_name').AsString := ls_username;
  end;
end;

procedure TFrmPhsZj.AccountInfoRbPayAllClick(Sender: TObject);
begin
  inherited;
  if AccountInfo.LwlAccount.RecordCount > 1 then //如果已变更缴费信息,清空数据集,加入一空白记录
  begin
    SetBlankData(AccountInfo.LwlAccount);
    SetBlankData(AccountInfo.LwlAccoInfo);
    AccountInfo.DblcPayMode.KeyValue := 'A';  //付款方式
    AccountInfo.DblcPostFlag.KeyValue := '0'; //投递标志
    AccountInfo.DblcScoCode.KeyValue := '0000'; //全部费用
    AccountInfo.DblcScoCode.Enabled :=false;
  end;
  AccountInfo.BtnAcco.Enabled := false;
  AccountInfo.DbePayName.Enabled := true;
  AccountInfo.DbeContract.Enabled := true;
  AccountInfo.DbeAccName.Enabled := true;
  AccountInfo.DbeBankAcc.Enabled := true;
  AccountInfo.DbeBankCod.Enabled := true;
  AccountInfo.DbePosName.Enabled := true;
  AccountInfo.DbePostZip.Enabled := true;
  AccountInfo.DbePostAddr.Enabled := true;
  AccountInfo.DblcPayMode.Enabled := true;
  AccountInfo.DblcPostFlag.Enabled := true;
//  AccountInfo.DblcScoCode.Enabled := true;
end;

procedure TFrmPhsZj.AccountInfoRbPayDiffClick(Sender: TObject);
begin
  inherited;
  AccountInfo.DbePayName.Enabled := false;
  AccountInfo.DbeContract.Enabled := false;
  AccountInfo.DbeAccName.Enabled := false;
  AccountInfo.DbeBankAcc.Enabled := false;
  AccountInfo.DbeBankCod.Enabled := false;
  AccountInfo.DbePosName.Enabled := false;
  AccountInfo.DbePostZip.Enabled := false;
  AccountInfo.DbePostAddr.Enabled := false;
  AccountInfo.DblcPayMode.Enabled := false;
  AccountInfo.DblcScoCode.Enabled := false;
  AccountInfo.DblcPostFlag.Enabled := false;
  AccountInfo.BtnAcco.Enabled := true;
end;

procedure TFrmPhsZj.ProdInfoDbeProdPwdKeyPress(Sender: TObject;
  var Key: Char);
begin
  inherited;
  ProdInfo.DbeProdPwdKeyPress(Sender, Key);
{  if Key = #13 then
  begin
    if ProdInfo.iProdcount =  then
      PhoneInfo.DbePhoneNo.SetFocus;
  end;}
end;

{//*****************************************************************************
功能:输入信息的合法性校验;记录的插入
//*****************************************************************************}
procedure TFrmPhsZj.BtnOkClick(Sender: TObject);
var
  i,j :integer;
  RetVal : integer;
  ls_prodno,ls_cust_level:string;
  ls_newpscode,ls_oldpscode,ls_ownerid,ls_userid:string;
  ls_scbh,ls_scls,ls_slbh,ls_ywm,ls_cplb,ls_msgout :string;
  ls_accprepay,ls_prodprepay :integer;     //预付费信息标志(记录是否选择预付费信息)    
begin
  inherited;
  //判定生产编号,生产流水
  if Currscbh=-1 then
  begin
    ls_scbh:='';
  end
  else
  begin
    ls_scbh:=inttostr(Currscbh);
  end;
  if Currscls=-1 then
  begin
    ls_scls:='';
  end
  else
  begin
    ls_scls:=inttostr(Currscls);
  end;
//表之间有相同的字段,要保持信息的一致性
//如果主号码变更,填入产品基本信息表中
  ProdInfo.LwlProdInfo.Edit;
  ProdInfo.LwlProdInfo.FieldByName('product_no').AsString := PhoneInfo.LwlPhoneInfo.FieldByName('product_no').AsString;
  ProdInfo.LwlProdInfo.Post;
//测量室的填写到
//modify kenshine 20040826
  PhoneInfo.LwlPhoneInfo.FieldByName('measure_id').AsString:=ProdInfo.LwlProdInfo.FieldByName('measure_code').AsString;
  PhoneInfo.LwlPhoneInfo.Edit;
  PhoneInfo.LwlPhoneInfo.Post;
//--------校验各类信息------------------------------------
//检查用户信息的合法性和有效性--------------------------------------------------
  RetVal :=FrmYhxx.UserValidate();
  if RetVal = 1 then
  begin
    PageControl1.ActivePage := TabSheet2;
    FrmYhxx.FocusSet(); //设置焦点
    exit;
  end;

//检查客户信息的合法性和有效性--------------------------------------------------
  if CbxDifference.Checked = true then  //如果需要输入客户资料,执行以下代码
  begin
    RetVal := FrmKhxx.UserValidate();
    if RetVal =1 then
    begin
      PageControl1.ActivePage := TabSheet1;
      FrmKhxx.FocusSet(); //设置焦点
      exit;
    end;
  end;

//检查帐务信息
  RetVal := AccountInfo.AccountValidate();
  if RetVal =1 then
  begin
    PageControl1.ActivePage := TabSheet2;
    AccountInfo.FocusSet(); //设置焦点
    exit;
  end;

⌨️ 快捷键说明

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