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

📄 frmphsmodifyinfo.pas

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

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, interfacesecond, ExtCtrls, StdCtrls, Buttons, ComCtrls, Mask,
  DBCtrls, DB, kbmMemTable, LWLINK, FrameProdInfo, FrameVouchInfo,
  FrameUserInfo, FramePhone, FrameProgFunc, FrameAccount, Grids, DBGrids,
  FramePhs, Menus, FramePhsSim  ;

type
  TFrmPhsmodify = class(TFrminterfacesecond)
    BtnOk: TButton;
    Panel3: TPanel;
    LwlSysFields: TLWLINK;
    DsSysFields: TDataSource;
    LwlSysFieldstable_code: TStringField;
    LwlSysFieldsfield_code: TStringField;
    LwlSysFieldsfield_name: TStringField;
    LwlSysFieldscomments: TStringField;
    DsAcceLog: TDataSource;
    LwlAcceLog: TLWLINK;
    LwlAcceLogproduce_id: TStringField;
    LwlAcceLogproduce_no: TStringField;
    LwlAcceLogorder_id: TStringField;
    LwlAcceLogaccept_id: TStringField;
    LwlAcceLogproduct_id: TStringField;
    LwlAcceLogsrv_code: TStringField;
    LwlAcceLogsub_srv: TStringField;
    LwlAcceLogaccept_lan: TStringField;
    LwlAcceLogvest_lan: TStringField;
    LwlAcceLogapply_name: TStringField;
    LwlAcceLogreq_certtype: TStringField;
    LwlAcceLogreq_certno: TStringField;
    LwlAcceLogbtime: TStringField;
    LwlAcceLogbact: TStringField;
    LwlAcceLogatime: TStringField;
    LwlAcceLogaccept_grade: TStringField;
    LwlAcceLogaccept_mode: TStringField;
    LwlAcceLogdeal_grade: TStringField;
    LwlAcceLogcharge_tache: TStringField;
    LwlAcceLogLuAcceGrad: TStringField;
    DsDealGrad: TDataSource;
    LwlDealGrad: TLWLINK;
    LwlDealGradcust_level_code: TStringField;
    LwlDealGradaccept_grad: TStringField;
    LwlDealGraddeal_grad: TStringField;
    LwlServCont: TLWLINK;
    LwlServContproduce_id: TStringField;
    LwlServContproduce_no: TStringField;
    LwlServContorder_id: TStringField;
    LwlServContaccept_id: TStringField;
    LwlServContproduct_id: TStringField;
    LwlServContsrv_code: TStringField;
    LwlServContsub_srv: TStringField;
    LwlServContaccept_state: TStringField;
    LwlServContdisp_flag: TStringField;
    LwlServContsrv_type: TStringField;
    LwlServContatime: TStringField;
    BtnCancel: TButton;
    DsServCont: TDataSource;
    LwlServInfo: TLWLINK;
    LwlServInfoprod_class: TStringField;
    LwlServInfosrv_code: TStringField;
    LwlServInfotable_name: TStringField;
    LwlServInfofield_modify: TStringField;
    Lwlphsmodify: TLWLINK;
    Lwlphsmodifytab_brief: TStringField;
    Lwlphsmodifyfld_id: TStringField;
    Lwlphsmodifyfield_code: TStringField;
    Lwlphsmodifyfield_name: TStringField;
    Lwlphsmodifyfield_type: TStringField;
    Lwlphsmodifyrecord_type: TStringField;
    Lwlphsmodifyrecord_id: TStringField;
    Lwlphsmodifynew_value: TStringField;
    Lwlphsmodifyold_value: TStringField;
    LwlAcceLogapply_cert: TStringField;
    LwlAcceLogapply_certno: TStringField;
    LwlAcceLogapply_tel: TStringField;
    LwlAcceLogapply_addr: TStringField;
    Panel2: TPanel;
    Panel5: TPanel;
    Panel6: TPanel;
    Panel7: TPanel;
    StaticText3: TStaticText;
    ProgFunc: TProgFunc;
    Framephsinfo: TFramephsinfo;
    Cbxrepair: TCheckBox;
    Panel9: TPanel;
    PhoneInfo: TPhoneInfo;
    StaticText4: TStaticText;
    Panel10: TPanel;
    StaticText1: TStaticText;
    FrmYhxx: TUserInfo;
    Label1: TLabel;
    DblcAcceGrad: TDBLookupComboBox;
    ProdInfo: TProdInfo;
    CBxmend: TCheckBox;
    PhsSimInfo1: TPhsSimInfo;
    DataSource1: TDataSource;
    procedure FrmYhxxDbeUserPwdKeyPress(Sender: TObject; var Key: Char);
    procedure BtnOkClick(Sender: TObject);
    procedure FrmYhxxDbeUserNamExit(Sender: TObject);
    procedure FrmYhxxDblcCustLabeClick(Sender: TObject);
    procedure BtnCancelClick(Sender: TObject);
    procedure FrmYhxxDblcCustKindClick(Sender: TObject);
    procedure ProgFuncEdSwslKeyPress(Sender: TObject; var Key: Char);
    procedure ProgFuncEdSubNumKeyPress(Sender: TObject; var Key: Char);
    procedure ProdInfoDbeUseTimeKeyPress(Sender: TObject; var Key: Char);
    procedure ProdInfoDbeOutDistKeyPress(Sender: TObject; var Key: Char);
    procedure PhoneInfoDbeSubProNumKeyPress(Sender: TObject;
      var Key: Char);
    procedure ProdInfoDbeProdPwdKeyPress(Sender: TObject; var Key: Char);
    procedure PhoneInfoBtnNumSelClick(Sender: TObject);
    procedure FrmYhxxDbeUserPwdChange(Sender: TObject);
    procedure ProdInfoDbeProdPwdChange(Sender: TObject);
    procedure FrmYhxxDbeUserNamKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeCertNoKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeCertDateKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeRelPeopKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeRelDepaKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeRelPhonKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeRelFaxKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeRelEmailKeyPress(Sender: TObject; var Key: Char);
    procedure FrmYhxxDbeRelAddrKeyPress(Sender: TObject; var Key: Char);
    procedure ProdInfoDbePostalCodeKeyPress(Sender: TObject;
      var Key: Char);
    procedure ProdInfoDbeNearPhonKeyPress(Sender: TObject; var Key: Char);
    procedure ProdInfoEdTownKeyPress(Sender: TObject; var Key: Char);
    procedure ProdInfoDbeAddressKeyPress(Sender: TObject; var Key: Char);
    procedure ProdInfoDbeConfNoKeyPress(Sender: TObject; var Key: Char);
    procedure PhoneInfoDbePhoneNoKeyPress(Sender: TObject; var Key: Char);
    procedure PhoneInfoDbeGroupNoKeyPress(Sender: TObject; var Key: Char);
    procedure PhoneInfoDbeInsideNoKeyPress(Sender: TObject; var Key: Char);
    procedure ProgFuncBtnFuncClick(Sender: TObject);
    procedure ProgFuncBtnDeviceClick(Sender: TObject);
    procedure ProdInfoDblcProdClasClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure PhoneInfoBtnGroupSelClick(Sender: TObject);
    procedure PhoneInfoDbePhoneNoExit(Sender: TObject);
    procedure PhsSimInfo1DblcCardTypeClick(Sender: TObject);
    procedure PhsSimInfo1Button1Click(Sender: TObject);
  private
    { Private declarations }
    iscbh,iscls,icpbh : string; //生产编号、生产流水、产品编号
    Currsldlx,Oldprodno:string;
    Currscbh,Currscls,Currcpbh:integer;
    Currslbh,Currddbh:string;
    Currywm:string;
    function appendvalue(alink:tlwlink;apara1,apara2,apara3,apara4,apara5,apara6,apara7,apara8,apara9:string):integer;
    procedure EnableControl(APanel: TFrame);
    procedure DisableControl(APanel: TFrame);
    function OperationJudge() : integer;
    function CheckUptPayNoPrepay:boolean;
    function getUptNoByPayNo(aPayProdId:string):string;

  public
    iProcFunc: string;  //返回的程控功能串
    iFuncNum: integer;  //返回的程控功能记录数(数组pdnfuncnew的维数)
    iDevNum:  integer;  //返回的设备记录数(数组pdndevicenew的维数)
    itempstr: string;
    Key :char;
    iSourflag: integer;   //资源标志
  end;

var
  FrmPhsmodify: TFrmPhsmodify;


implementation

uses FormProdFunc,YyslFunction, dictdm, FormDevice,FormMoveType,
  FormAccount, Yyslzx, NDPublic, AddGet, seleNum, DMyyslzx, ndfundeclare,
  FrameLinkInfo,feepulic;

{$R *.dfm}
//根据业务码限制修改信息
function TFrmPhsmodify.OperationJudge() : integer;
var
  ls_tablecode,ls_fldstr:string;
begin
{如果业务码(Getywm)为空,通过(GetOldywmstr)获取当前产品在此之前已受理的业务,判断是否
为空:为空则界面都可以修改,不为空则取出互斥业务对应的字段并置为不可修改;
如果业务码(Getywm)不为空,说明对特定业务的工单进行修改或修正,这是根据业务码对应的可修改字段
显示相应的状态}
  if FrmYyslzx.Getywm() = '' then
  begin
    if FrmYyslzx.GetOldywmstr() <> '' then
    begin
	    LwlServInfo.First;
	    while not LwlServInfo.Eof do
	    begin
	      if LwlServInfo.FieldByName('table_name').AsString = 'A0' then             //可修改pdn_pdinfo
	      begin
	        DisableControl(ProdInfo);
	      end
	      else if LwlServInfo.FieldByName('table_name').AsString = 'A1' then        //可修改pdn_phone
	      begin
	        DisableControl(PhoneInfo);
	      end
	      else if LwlServInfo.FieldByName('table_name').AsString = 'G0' then        //可修改pdn_incr_prod和pdn_incrprod_prop
	      begin
          if LwlServInfo.FieldByName('field_modify').AsString <> '//' then
          begin
            ProgFunc.CbProgFunc.Color := $00F7FFFF;
            ProgFunc.BtnFunc.Enabled := false;
          end;
	      end
	      else if LwlServInfo.FieldByName('table_name').AsString = 'A5' then        //可修改pdn_device
	      begin
          if LwlServInfo.FieldByName('field_modify').AsString <> '//' then
          begin
            ProgFunc.CbDevice.Color := $00F7FFFF;
            ProgFunc.BtnDevice.Enabled := false;
          end;
	      end
        else if LwlServInfo.FieldByName('table_name').AsString = 'D6' then        //可修改pdn_device
	      begin
          framephsinfo.DBEdtpscode.Color := $00F7FFFF;
          framephsinfo.DBEdtpscode.Enabled := false;
 	      end;
	      LwlServInfo.Next;
	    end;
	  end;
  end
  else if FrmYyslzx.Getywm <> '' then
  begin
    disablePanel(ProdInfo);
    disablePanel(PhoneInfo);
    disablePanel(ProgFunc);
    disablepanel(framephsinfo);
    LwlServInfo.First;
    while not LwlServInfo.Eof do
    begin
      if LwlServInfo.FieldByName('table_name').AsString = 'A0' then             //可修改pdn_pdinfo
      begin
        if LwlServInfo.FieldByName('field_modify').AsString <> '//' then
        begin
          EnableControl(ProdInfo);
        end
        else
          enablePanel(ProdInfo);
      end
      else if LwlServInfo.FieldByName('table_name').AsString = 'A1' then        //可修改pdn_phone
      begin
        if LwlServInfo.FieldByName('field_modify').AsString <> '//' then
        begin
          EnableControl(PhoneInfo);
        end
        else
          enablePanel(PhoneInfo);
      end
      else if LwlServInfo.FieldByName('table_name').AsString = 'G0' then        //可修改pdn_incr_prod和pdn_incrprod_prop
      begin
        ProgFunc.CbProgFunc.Color := clwhite;
        ProgFunc.CbProgFunc.Enabled := true;
        ProgFunc.BtnFunc.Enabled := true;
      end
      else if LwlServInfo.FieldByName('table_name').AsString = 'A5' then        //可修改pdn_device
      begin
        ProgFunc.CbDevice.Color := clwhite;
        ProgFunc.CbDevice.Enabled := true;
        ProgFunc.BtnDevice.Enabled := true;
      end
      else if LwlServInfo.FieldByName('table_name').AsString = 'D6' then        //可修改pdn_phs
      begin
         framephsinfo.DBEdtpscode.Color := clwhite;
         framephsinfo.DBEdtpscode.Enabled := true;
      end;
      LwlServInfo.Next;
    end;
  end;
end;

//根据Tag控制控件的修改
procedure TFrmPhsmodify.DisableControl(APanel: TFrame);
var
  iCount :integer;
begin
  with APanel do
  begin
    for iCount:=0 to ControlCount-1 do
    begin
      if pos(IntChangeStr(Controls[iCount].Tag,2,'0')+ '/',LwlServInfo.FieldByName('field_modify').AsString) > 0 then
      begin
        if Controls[iCount].ClassType=TDBLookupComboBox then
        begin
          TDBLookupComboBox(controls[iCount]).Enabled := false;
          TDBLookupComboBox(controls[iCount]).Color:=$00F7FFFF;
        end;
        if Controls[iCount].ClassType=TDBEdit then
        begin
          TDBEdit(controls[iCount]).Enabled := false;
          TDBEdit(controls[iCount]).color :=$00F7FFFF;
        end;
        if Controls[iCount].ClassType=TDateTimePicker then
        begin
          TDateTimePicker(controls[iCount]).Enabled := false;
          TDateTimePicker(controls[iCount]).color :=$00F7FFFF;
        end;
        if Controls[iCount].ClassType=TButton then
        begin
          TButton(controls[iCount]).Enabled := false;
        end;
        if Controls[iCount].ClassType=TRadioButton then
        begin
          TRadioButton(controls[iCount]).Enabled := false;
                TRadioButton(controls[iCount]).color :=$00F7FFFF;
              end;
        if Controls[iCount].ClassType=TCheckBox then
        begin
          TCheckBox(controls[iCount]).Enabled := false;
          TCheckBox(controls[iCount]).Color :=$00F7FFFF;
        end;
        if Controls[iCount].ClassType=TEdit then
        begin
          TEdit(controls[iCount]).Enabled := false;
          TEdit(controls[iCount]).color :=$00F7FFFF;
        end;
        if Controls[iCount].ClassType=TComboBox then
        begin
          TComboBox(controls[iCount]).color :=$00F7FFFF;
        end;
      end;
    end;
  end;

⌨️ 快捷键说明

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