$PBExportHeader$w_sc_workprocedure.srw forward global type w_sc_workprocedure from w_publ_edit_index end type type st_2 from statictext within w_sc_workprocedure end type type ddlb_publ from dropdownlistbox within w_sc_workprocedure end type type cbx_ineffect from checkbox within w_sc_workprocedure end type end forward global type w_sc_workprocedure from w_publ_edit_index integer width = 2930 integer height = 1768 string title = "工序" boolean minbox = true windowtype windowtype = popup! st_2 st_2 ddlb_publ ddlb_publ cbx_ineffect cbx_ineffect end type global w_sc_workprocedure w_sc_workprocedure type variables s_workprocedure INS_RT_STRU //==================================================================== // Declare Instance Variables // Reason: //-------------------------------------------------------------------- // Modified By: yyx Date: 2003.10.30 //-------------------------------------------------------------------- //日志参数 //==================================================================== string oldcode,oldname,newcode,newname long ins_ineffect = 1 end variables on w_sc_workprocedure.create int iCurrent call super::create this.st_2=create st_2 this.ddlb_publ=create ddlb_publ this.cbx_ineffect=create cbx_ineffect iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.st_2 this.Control[iCurrent+2]=this.ddlb_publ this.Control[iCurrent+3]=this.cbx_ineffect end on on w_sc_workprocedure.destroy call super::destroy destroy(this.st_2) destroy(this.ddlb_publ) destroy(this.cbx_ineffect) end on event ue_usual_query_retr;call super::ue_usual_query_retr;if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return string ls_querystrpart='' ls_newselect=lower(ori_oldselect) if trim(sle_usual_query.text)<>'' then if pos(trim(sle_usual_query.text),'%')=0 then ls_querystrpart="(code like '%"+trim(sle_usual_query.text)+"%')" else ls_querystrpart="(code like '"+trim(sle_usual_query.text)+"')" end if if pos(ls_newselect," where ") <> 0 then ls_newselect=ls_newselect+" and ("+ls_querystrpart+')' else ls_newselect=ls_newselect+" where ("+ls_querystrpart+')' end if end if wf_retrieveuc(dw_uc,ls_newselect,1) //注意必须有此句 this.triggerevent('retrieve_uc') end event event ue_usual_query_filt;call super::ue_usual_query_filt;if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return string obj_expr='' if trim(sle_usual_query.text)<>'' then if pos(trim(sle_usual_query.text),'%')=0 then obj_expr=obj_expr+'( code like "%'+trim(sle_usual_query.text)+'%" )' else obj_expr=obj_expr+'( code like "'+trim(sle_usual_query.text)+'" )' end if end if dw_uc.setfilter(obj_expr) dw_uc.setredraw(false) dw_index.setredraw(false) dw_uc.filter() if dw_index.rowcount()>=1 then dw_index.selectrow(0,false) dw_index.selectrow(1,true) end if dw_uc.setredraw(true) dw_index.setredraw(true) end event event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU) // 窗体级子定义结构变量,用于返回 end event event retrieve_uc;Boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled Boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled Boolean cbx_ineffect_Enabled cb_firstpage_enabled = cb_firstpage.Enabled cb_nextpage_enabled = cb_nextpage.Enabled cb_retrieveall_enabled = cb_retrieveall.Enabled cb_priorpage_enabled = cb_priorpage.Enabled cb_func_enabled = cb_func.Enabled cb_retrieve_enabled = cb_retrieve.Enabled cbx_ineffect_Enabled = cbx_ineffect.Enabled cb_firstpage.Enabled = FALSE cb_nextpage.Enabled = FALSE cb_retrieveall.Enabled = FALSE cb_priorpage.Enabled = FALSE cb_func.Enabled = FALSE cb_retrieve.Enabled = FALSE cbx_ineffect.Enabled = FALSE dw_UC.SetRedraw(FALSE) dw_index.ShareDataOff() SetPointer(HourGlass!) Int li_ifpubl IF ddlb_publ.Text = '全部' THEN li_ifpubl = -1 ELSEIF ddlb_publ.Text = '公共' THEN li_ifpubl = 1 ELSE li_ifpubl = 0 END IF dw_UC.Retrieve(li_ifpubl,ins_ineffect) SetPointer(Arrow!) dw_UC.ShareData(dw_index) dw_UC.SetRedraw(TRUE) IF dw_index.RowCount() >= 1 THEN dw_index.SelectRow(0,FALSE) dw_index.SelectRow(1,TRUE) END IF cb_firstpage.Enabled = cb_firstpage_enabled cb_nextpage.Enabled = cb_nextpage_enabled cb_retrieveall.Enabled = cb_retrieveall_enabled cb_priorpage.Enabled = cb_priorpage_enabled cb_func.Enabled = cb_func_enabled cb_retrieve.Enabled = cb_retrieve_enabled cbx_ineffect.Enabled = cbx_ineffect_Enabled end event type cb_func from w_publ_edit_index`cb_func within w_sc_workprocedure end type type cb_exit from w_publ_edit_index`cb_exit within w_sc_workprocedure end type type sle_usual_query from w_publ_edit_index`sle_usual_query within w_sc_workprocedure end type type cb_nextpage from w_publ_edit_index`cb_nextpage within w_sc_workprocedure integer x = 2258 end type type cb_priorpage from w_publ_edit_index`cb_priorpage within w_sc_workprocedure integer x = 2112 end type type cb_firstpage from w_publ_edit_index`cb_firstpage within w_sc_workprocedure integer x = 1966 end type type cb_retrieveall from w_publ_edit_index`cb_retrieveall within w_sc_workprocedure integer x = 1819 end type type em_pagerowno from w_publ_edit_index`em_pagerowno within w_sc_workprocedure integer x = 1513 end type type st_pagerowno from w_publ_edit_index`st_pagerowno within w_sc_workprocedure end type type st_1 from w_publ_edit_index`st_1 within w_sc_workprocedure end type type cb_add from w_publ_edit_index`cb_add within w_sc_workprocedure end type event cb_add::clicked;IF NOT f_power_ind(1014) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF Long ll_proid = 0 String errmsg = '' IF dw_edit_mode THEN dw_uc.AcceptText() IF dw_uc.GetNextModified(0, Primary!) = 0 THEN MessageBox('提示','没有任何修改,不可以保存!', Information!, OK! ) RETURN END IF dw_uc.Object.code[dw_uc.GetRow()] = Trim(dw_uc.Object.code[dw_uc.GetRow()]) dw_uc.Object.Name[dw_uc.GetRow()] = Trim(dw_uc.Object.Name[dw_uc.GetRow()]) dw_uc.Object.opemp[dw_uc.GetRow()] = publ_operator IF dw_uc.Object.code[dw_uc.GetRow()] = '' THEN MessageBox('提示','请输入工序编号!', Information!, OK! ) dw_uc.SetFocus() dw_uc.SetColumn('code') RETURN END IF IF IsNull(dw_uc.Object.Name[dw_uc.GetRow()]) THEN dw_uc.SetColumn('Name') MessageBox('提示','请输入工序名称!', Information!, OK! ) RETURN END IF IF dw_uc.Object.wrkgrpid[dw_uc.GetRow()] = 0 THEN dw_uc.SetColumn('wrkgrpid') MessageBox('提示','请输入工组!', Information!, OK! ) RETURN END IF IF dw_uc.Object.proid[dw_uc.GetRow()] = 0 THEN ll_proid = f_sys_scidentity(0,"u_sc_workprocedure","proid",errmsg,TRUE,sqlca) IF ll_proid < 0 THEN MessageBox("提示",errmsg, Information!, OK! ) RETURN ELSE dw_uc.Object.proid[dw_uc.GetRow()] = ll_proid END IF ELSE newcode = dw_uc.Object.code[dw_uc.GetRow()] newname = dw_uc.Object.Name[dw_uc.GetRow()] String arg_msg f_setsysoplog('定义资料','工序修改,原:'+oldcode+','+oldname+'->新:'+newcode+','+newname,arg_msg,FALSE) END IF END IF CALL SUPER::Clicked IF dw_edit_mode THEN dw_uc.SetColumn('code') END IF end event type cb_edit from w_publ_edit_index`cb_edit within w_sc_workprocedure end type event cb_edit::clicked;if DW_UC.GETROW() = 0 then return if not f_power_ind(1014) then messagebox(publ_operator,'你没有使用权限!') return end if CALL SUPER::CLICKED if dw_edit_mode then oldcode=DW_UC.OBJECT.code[DW_UC.GETROW()] oldname=DW_UC.OBJECT.name[DW_UC.GETROW()] dw_uc.selecttext(len(string(dw_uc.object.code[dw_uc.getrow()]))+1,0) else oldcode='' oldname='' end if parent.triggerevent("refresh_interface") end event type cb_delet from w_publ_edit_index`cb_delet within w_sc_workprocedure end type event cb_delet::clicked;if not f_power_ind(1014) then messagebox('提示','你没有使用权限!', Information!, OK! ) return end if long cnt = 0,ls_row,ls_id string ls_proname ls_row = dw_uc.getrow() if ls_row = 0 then messagebox('提示','没有删除对象!', Information!, OK! ) return end if ls_id = dw_uc.object.proid[ls_row] ls_proname = dw_uc.object.code[ls_row] if messagebox ("询问","是否确定要删除当前记录["+ls_proname+"]?(选择确定后记录将不可恢复)",question!,yesno! ) = 2 then return end if select count(*) into :cnt from u_sc_abnormitymx where u_sc_abnormitymx.proid = :ls_id ; if sqlca.sqlcode <> 0 then messagebox('提示','查询工序['+ls_proname+']是否使用操作失败!>>'+sqlca.sqlerrtext, Information!, OK! ) return end if if cnt > 0 then messagebox('提示','工序['+ls_proname+']已经用于计件单,不可以删除!', Information!, OK! ) return end if dw_uc.setredraw (false) dw_uc.deleterow (ls_row) dw_uc.triggerevent (rowfocuschanged!) if dw_uc.update() = -1 then rollback; messagebox ("提示","删除记录操作失败!", Information!, OK! ) else commit; end if dw_uc.setredraw (true) wf_index_uc() end event type cb_choice from w_publ_edit_index`cb_choice within w_sc_workprocedure end type event cb_choice::clicked;call super::clicked;Long ROW,ls_i,chC = 0 ROW = dw_index.GetRow() IF ROW <= 0 THEN MessageBox('提示','请先选择目标行!', Information!, OK! ) RETURN END IF FOR ls_i = 1 TO dw_index.RowCount() IF dw_index.IsSelected(ls_i) THEN chC++ INS_RT_STRU.wrkproid[chC] = dw_index.Object.proid[ls_i] INS_RT_STRU.wrkprocode[chC] = dw_index.Object.code[ls_i] INS_RT_STRU.wrkproname[chC] = dw_index.Object.Name[ls_i] INS_RT_STRU.worklevel[chC] = dw_index.Object.u_sc_workprocedure_worklevel[ls_i] INS_RT_STRU.techlevel[chC] = dw_index.Object.u_sc_workprocedure_techlevel[ls_i] INS_RT_STRU.workhour[chC] = dw_index.Object.u_sc_workprocedure_workhour[ls_i] INS_RT_STRU.workprice[chC] = dw_index.Object.workprice[ls_i] INS_RT_STRU.wrkGrid[chC] = dw_index.Object.wrkgrpid[ls_i] END IF NEXT IF chC = 0 THEN MessageBox('提示','请至少选择一个目标行!', Information!, OK! ) RETURN END IF CLOSE(PARENT) end event type cb_cancel from w_publ_edit_index`cb_cancel within w_sc_workprocedure end type type cbx_mlselect from w_publ_edit_index`cbx_mlselect within w_sc_workprocedure end type type cbx_allselect from w_publ_edit_index`cbx_allselect within w_sc_workprocedure end type type cb_mode_itfchg_b from w_publ_edit_index`cb_mode_itfchg_b within w_sc_workprocedure end type type cb_mode_itfchg from w_publ_edit_index`cb_mode_itfchg within w_sc_workprocedure end type type gb_1 from w_publ_edit_index`gb_1 within w_sc_workprocedure end type type dw_uc from w_publ_edit_index`dw_uc within w_sc_workprocedure integer x = 1326 integer width = 1568 string dataobject = "dw_sc_workprocedure_edit" end type type cb_retrieve from w_publ_edit_index`cb_retrieve within w_sc_workprocedure end type type cb_print from w_publ_edit_index`cb_print within w_sc_workprocedure end type event cb_print::clicked;//if not f_power_ind(983) then // messagebox(publ_operator,'你没有使用权限!') // return //end if // S_print_MSG LS_PRMSG LS_PRMSG.obj_dwNAME='dw_sc_rp_workprocedure' LS_PRMSG.SHARE_DW=DW_UC LS_PRMSG.TAG_TEXT='工序列表' LS_PRMSG.SETUP_FLAG=0 LS_PRMSG.PAGECH_FLAG=1 LS_PRMSG.retr_pram_falg = 17 Openwithparm(w_publ_preview,LS_PRMSG) end event type ln_bar from w_publ_edit_index`ln_bar within w_sc_workprocedure end type type ln_bar2 from w_publ_edit_index`ln_bar2 within w_sc_workprocedure end type type r_bar from w_publ_edit_index`r_bar within w_sc_workprocedure end type type ln_1 from w_publ_edit_index`ln_1 within w_sc_workprocedure end type type ln_2 from w_publ_edit_index`ln_2 within w_sc_workprocedure end type type dw_index from w_publ_edit_index`dw_index within w_sc_workprocedure integer width = 1326 string dataobject = "dw_sc_workprocedure_index" end type type cb_help from w_publ_edit_index`cb_help within w_sc_workprocedure end type type st_2 from statictext within w_sc_workprocedure integer x = 722 integer y = 204 integer width = 151 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "类型" boolean focusrectangle = false end type type ddlb_publ from dropdownlistbox within w_sc_workprocedure integer x = 850 integer y = 184 integer width = 480 integer height = 300 integer taborder = 20 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "全部" string item[] = {"非公共","公共","全部"} borderstyle borderstyle = stylelowered! end type event selectionchanged;parent.triggerevent('retrieve_uc') end event type cbx_ineffect from checkbox within w_sc_workprocedure integer x = 2153 integer y = 204 integer width = 466 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "只显示有效工序" boolean checked = true end type event constructor;THIS.backcolor = parent.backcolor end event event clicked;if dw_edit_mode then RETURN IF THIS.checked = TRUE THEN //THIS.checked = FALSE ins_ineffect = 1 ELSE //THIS.checked = TRUE ins_ineffect = -1 END IF parent.triggerevent('retrieve_uc') end event