w_gz_award_punish.srw 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. $PBExportHeader$w_gz_award_punish.srw
  2. forward
  3. global type w_gz_award_punish from w_publ_1ton_share_detail
  4. end type
  5. type ddlb_status from dropdownlistbox within w_gz_award_punish
  6. end type
  7. type st_2 from statictext within w_gz_award_punish
  8. end type
  9. end forward
  10. global type w_gz_award_punish from w_publ_1ton_share_detail
  11. integer height = 2036
  12. string title = "奖罚单"
  13. event ue_fj_edit ( )
  14. event ue_fj_view ( )
  15. ddlb_status ddlb_status
  16. st_2 st_2
  17. end type
  18. global w_gz_award_punish w_gz_award_punish
  19. type variables
  20. uo_award_punish uo_award_punish_dq
  21. Int cur_flag = -1
  22. end variables
  23. forward prototypes
  24. public function integer wf_refresh_curuc (long arg_billid)
  25. public subroutine wf_check_billfj ()
  26. public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg)
  27. end prototypes
  28. event ue_fj_edit();IF dw_edit_mode THEN
  29. MessageBox('提示','编辑状态下不可用', Information!, OK! )
  30. RETURN
  31. END IF
  32. //IF NOT f_power_ind(1446) THEN
  33. // MessageBox(publ_operator,'你没有使用权限!')
  34. // RETURN
  35. //END IF
  36. s_edit_index_tran s_pic
  37. Long ll_ConnectionID
  38. String arg_msg
  39. Long ls_row
  40. ls_row = dw_uc.GetRow()
  41. IF ls_row <= 0 THEN
  42. RETURN
  43. END IF
  44. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  45. MessageBox('提示','没有指定附件数据库连接'+arg_msg, Information!, OK! )
  46. RETURN
  47. END IF
  48. s_pic.f_long = 724 //采购订单的mainID
  49. s_pic.f_string = dw_uc.Object.u_gz_award_punish_billcode[ls_row]
  50. s_pic.g_long = dw_uc.Object.u_gz_award_punish_billid[ls_row]
  51. s_pic.e_long = 0
  52. s_pic.sqltransaction = sys_filedb_sqlca
  53. OpenWithParm(w_fj_bill_mng,s_pic)
  54. //wf_check_billfj()
  55. end event
  56. event ue_fj_view();IF dw_edit_mode THEN
  57. MessageBox('提示','编辑状态下不可用', Information!, OK! )
  58. RETURN
  59. END IF
  60. s_edit_index_tran s_pic
  61. Long ll_ConnectionID
  62. String arg_msg
  63. Long ls_row
  64. ls_row = dw_uc.GetRow()
  65. IF ls_row <= 0 THEN
  66. RETURN
  67. END IF
  68. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  69. MessageBox('提示','没有指定附件数据库连接'+arg_msg, Information!, OK! )
  70. RETURN
  71. END IF
  72. s_pic.f_long = 724 //采购订单的mainID
  73. s_pic.f_string = dw_uc.Object.u_gz_award_punish_billcode[ls_row]
  74. s_pic.g_long = dw_uc.Object.u_gz_award_punish_billid[ls_row]
  75. s_pic.e_long = 0
  76. s_pic.sqltransaction = sys_filedb_sqlca
  77. OpenWithParm(w_fj_bill_view,s_pic)
  78. end event
  79. public function integer wf_refresh_curuc (long arg_billid);IF arg_billid <= 0 OR IsNull(arg_billid) THEN RETURN 0
  80. Long uc_row
  81. uc_row = dw_pageretr.GetRow()
  82. IF uc_row <= 0 THEN RETURN 0
  83. Long wageid
  84. Int billtype
  85. String Empcode
  86. DateTime billdate
  87. Decimal award_punish_amt
  88. Long wagemth
  89. String reason
  90. Long deptid
  91. String rep
  92. Long empid
  93. String billcode
  94. DateTime moddate
  95. String modemp
  96. DateTime auditdate
  97. Int flag
  98. String auditrep
  99. String opemp
  100. DateTime opdate
  101. String Empname
  102. String duty
  103. Long deptid2
  104. String departmentname
  105. long ll_printnum
  106. string ls_dealtype
  107. SELECT u_gz_award_punish.wageid,
  108. u_gz_award_punish.billtype,
  109. u_rs_empinfo.Empcode,
  110. u_gz_award_punish.billdate,
  111. u_gz_award_punish.award_punish_amt,
  112. u_gz_award_punish.wagemth,
  113. u_gz_award_punish.reason,
  114. u_gz_award_punish.deptid,
  115. u_gz_award_punish.rep,
  116. u_gz_award_punish.empid,
  117. u_gz_award_punish.billcode,
  118. u_gz_award_punish.moddate,
  119. u_gz_award_punish.modemp,
  120. u_gz_award_punish.auditdate,
  121. u_gz_award_punish.flag,
  122. u_gz_award_punish.auditrep,
  123. u_gz_award_punish.opemp,
  124. u_gz_award_punish.opdate,
  125. u_rs_empinfo.Empname,
  126. u_rs_empinfo.duty,
  127. u_rs_empinfo.deptid,
  128. cw_department.departmentname,
  129. u_gz_award_punish.printnum,
  130. u_gz_award_punish.dealtype
  131. INTO :wageid,
  132. :billtype,
  133. :Empcode,
  134. :billdate,
  135. :award_punish_amt,
  136. :wagemth,
  137. :reason,
  138. :deptid,
  139. :rep,
  140. :empid,
  141. :billcode,
  142. :moddate,
  143. :modemp,
  144. :auditdate,
  145. :flag,
  146. :auditrep,
  147. :opemp,
  148. :opdate,
  149. :Empname,
  150. :duty,
  151. :deptid2,
  152. :departmentname,
  153. :ll_printnum,
  154. :ls_dealtype
  155. FROM u_gz_award_punish,
  156. u_rs_empinfo,
  157. cw_department
  158. WHERE ( u_gz_award_punish.empid = u_rs_empinfo.empid )
  159. AND ( u_rs_empinfo.deptid = cw_department.departmentid )
  160. And ( u_gz_award_punish.billid = :arg_billid );
  161. IF sqlca.SQLCode <> 0 THEN
  162. MessageBox('提示',"查询奖罚单操作失败"+sqlca.SQLErrText, Information!, OK! )
  163. RETURN 0
  164. END IF
  165. dw_pageretr.Object.u_gz_award_punish_billid[uc_row] = arg_billid
  166. dw_pageretr.Object.u_gz_award_punish_wageid[uc_row] = wageid
  167. dw_pageretr.Object.u_gz_award_punish_billtype[uc_row] = billtype
  168. dw_pageretr.Object.u_rs_empinfo_empcode[uc_row] = Empcode
  169. dw_pageretr.Object.u_gz_award_punish_billdate[uc_row] = billdate
  170. dw_pageretr.Object.u_gz_award_punish_award_punish_amt[uc_row] = award_punish_amt
  171. dw_pageretr.Object.u_gz_award_punish_wagemth[uc_row] = wagemth
  172. dw_pageretr.Object.u_gz_award_punish_deptid[uc_row] = deptid
  173. dw_pageretr.Object.u_gz_award_punish_reason[uc_row] = reason
  174. dw_pageretr.Object.u_gz_award_punish_empid[uc_row] = empid
  175. dw_pageretr.Object.u_gz_award_punish_billcode[uc_row] = billcode
  176. dw_pageretr.Object.u_gz_award_punish_modemp[uc_row] = modemp
  177. dw_pageretr.Object.u_gz_award_punish_moddate[uc_row] = moddate
  178. dw_pageretr.Object.u_gz_award_punish_auditdate[uc_row] = auditdate
  179. dw_pageretr.Object.u_gz_award_punish_flag[uc_row] = flag
  180. dw_pageretr.Object.u_gz_award_punish_auditrep[uc_row] = auditrep
  181. dw_pageretr.Object.u_gz_award_punish_opemp[uc_row] = opemp
  182. dw_pageretr.Object.u_gz_award_punish_opdate[uc_row] = opdate
  183. dw_pageretr.Object.u_rs_empinfo_duty[uc_row] = duty
  184. dw_pageretr.Object.u_rs_empinfo_deptid[uc_row] = deptid2
  185. dw_pageretr.Object.cw_department_departmentname[uc_row] = departmentname
  186. dw_pageretr.Object.u_gz_award_punish_rep[uc_row] = rep
  187. dw_pageretr.Object.u_rs_empinfo_Empname[uc_row] = Empname
  188. dw_pageretr.Object.u_gz_award_punish_printnum[uc_row] = ll_printnum
  189. dw_pageretr.Object.u_gz_award_punish_dealtype[uc_row] = ls_dealtype
  190. dw_uc.Reset()
  191. dw_pageretr.RowsCopy(dw_pageretr.GetRow(), dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!)
  192. dw_uc.ResetUpdate()
  193. dw_uc.SetRedraw(TRUE)
  194. RETURN 1
  195. end function
  196. public subroutine wf_check_billfj ();String arg_msg
  197. Long ll_ConnectionID
  198. Long cur_billtype
  199. long ll_relid,ll_relid_mx,ll_scid
  200. Long ls_filecount = 0
  201. Int rslt = 1
  202. uo_fj_mng_billtype ls_uo_fjbt
  203. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  204. Long row,uc_relid
  205. row = dw_pageretr.GetRow()
  206. IF row > 0 THEN
  207. ll_relid = dw_pageretr.Object.u_gz_award_punish_billid[row]
  208. ll_scid = 0
  209. ll_relid_mx = 0
  210. ELSE
  211. rslt = 0
  212. GOTO ext
  213. END IF
  214. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  215. rslt = 0
  216. GOTO ext
  217. END IF
  218. cur_billtype = 724 //客户投拆单的 mainiD
  219. ls_uo_fjbt.uf_check_billfj( cur_billtype, ll_relid,ll_relid_mx,ll_scid, sys_fileDB_sqlca, arg_msg, ls_filecount)
  220. IF ls_filecount > 0 THEN
  221. rslt = 1
  222. GOTO ext
  223. ELSE
  224. rslt = 0
  225. GOTO ext
  226. END IF
  227. ext:
  228. wf_encl(rslt)
  229. DESTROY ls_uo_fjbt
  230. end subroutine
  231. public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg);//==============================================================================
  232. // 函数: w_publ_1ton_share_detail::wf_xls_retrievedata()
  233. //------------------------------------------------------------------------------
  234. // 描述: 此函数需要 重载,复制祖先范例代码,然后修改retrieve参数部分两处即可
  235. //------------------------------------------------------------------------------
  236. Long LS_ROW,ll_id,i,ll_scid
  237. LS_ROW = dw_uc.GetRow()
  238. IF LS_ROW <= 0 THEN
  239. arg_msg = '没有目标单据!'
  240. RETURN 0
  241. END IF
  242. //修改点:获取 指定retriev参数
  243. ll_id = dw_uc.Object.#1[LS_ROW]
  244. ll_scid = 0
  245. //查询所选模版是否含有图片信息
  246. Long ll_ifpic
  247. Long ll_classid
  248. SELECT ifpic
  249. INTO :ll_ifpic
  250. FROM U_XLS_Templates
  251. Where id = :ll_xls_Templatesid;
  252. IF sqlca.SQLCode <> 0 THEN
  253. ll_ifpic = 0
  254. END IF
  255. Long ll_i,ll_j
  256. Long ll_mtrlid
  257. Long ll_fileid
  258. Blob ls_filedata
  259. SetNull(ls_filedata)
  260. String Pathname,ls_filename,ls_filetype
  261. String errmsg
  262. uo_fj_mng_billtype ls_uo_fjbt
  263. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  264. s_xls_pic_list s_pic //结构数组-用于保存图片路径
  265. IF ll_ifpic = 1 THEN //如果含有图片信息,则查询本类型单据需要带出哪类附件
  266. SELECT classid
  267. INTO :ll_classid
  268. FROM u_billpic_fileclass
  269. Where (billtype = 724);
  270. IF sqlca.SQLCode <> 0 THEN
  271. ll_classid = 0
  272. END IF
  273. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  274. FOR ll_i = 1 TO dw_child.RowCount()
  275. ll_mtrlid = dw_child.Object.mtrlid[ll_i]
  276. //取该附件类型中的第一个附件.
  277. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  278. FROM u_file
  279. WHERE relid = :ll_mtrlid
  280. AND classid = :ll_classid
  281. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  282. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  283. USING sys_fileDB_sqlca;
  284. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  285. ll_fileid = 0
  286. END IF
  287. IF ll_fileid > 0 THEN
  288. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  289. IF Trim(Pathname) <> '' THEN
  290. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  291. RETURN 0
  292. END IF
  293. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  294. RETURN 0
  295. ELSE
  296. s_pic.path[ll_i] = Pathname
  297. //记录临时文件位置,本窗口退出后删除
  298. wf_addlog_tempfilepathname(Pathname)
  299. END IF
  300. ELSE
  301. s_pic.path[ll_i] = ''
  302. END IF
  303. ELSE
  304. s_pic.path[ll_i] = ''
  305. END IF
  306. NEXT
  307. END IF
  308. //
  309. END IF
  310. ////可选设置///
  311. arg_obj_st.uo_const.create_new_pwd( ) //创建随机密码
  312. if sys_option_xls_ifuse_passwd = 1 then arg_obj_st.uo_const.pwd = trim(sys_option_xls_user_passwd) //默认加密密码 默认为随即密码
  313. boolean xls_locked
  314. xls_locked = not (sys_option_xls_lock = 1)
  315. /// Excel 的可选设置
  316. if arg_obj_st.of_setoption(arg_ationid, xls_locked,true,arg_msg) <> 1 then
  317. return 0
  318. end if
  319. for i = 1 to arg_str_billlist.count
  320. ////可选操作///
  321. arg_str_billlist.bill[i].ds_data = create datastore //
  322. arg_str_billlist.bill[i].ds_data.dataobject = arg_str_billlist.bill[i].datawindow //
  323. arg_str_billlist.bill[i].ds_data.settransobject(sqlca)
  324. //修改点:注意retrieve 参数与上文对应
  325. arg_str_billlist.bill[i].ds_data.retrieve(ll_scid,ll_id)
  326. next
  327. return 1
  328. end function
  329. on w_gz_award_punish.create
  330. int iCurrent
  331. call super::create
  332. this.ddlb_status=create ddlb_status
  333. this.st_2=create st_2
  334. iCurrent=UpperBound(this.Control)
  335. this.Control[iCurrent+1]=this.ddlb_status
  336. this.Control[iCurrent+2]=this.st_2
  337. end on
  338. on w_gz_award_punish.destroy
  339. call super::destroy
  340. destroy(this.ddlb_status)
  341. destroy(this.st_2)
  342. end on
  343. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  344. ls_newselect=lower(ori_oldselect)
  345. if trim(sle_usual_query.text)<>'' then
  346. if pos(trim(sle_usual_query.text),'%')=0 then
  347. ls_querystrpart="(u_gz_award_punish.billcode like '%"+trim(sle_usual_query.text)+"%')"
  348. else
  349. ls_querystrpart="(u_gz_award_punish.billcode like '"+trim(sle_usual_query.text)+"')"
  350. end if
  351. if pos(ls_newselect," where ") <> 0 then
  352. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  353. else
  354. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  355. end if
  356. end if
  357. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  358. this.triggerevent('retrieve_pageretr')
  359. end event
  360. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  361. if trim(sle_usual_query.text)<>'' then
  362. if pos(trim(sle_usual_query.text),'%')=0 then
  363. obj_expr=obj_expr+'( u_gz_award_punish_billcode like "%'+trim(sle_usual_query.text)+'%" )'
  364. else
  365. obj_expr=obj_expr+'( u_gz_award_punish_billcode like "'+trim(sle_usual_query.text)+'" )'
  366. end if
  367. end if
  368. dw_pageretr.setfilter(obj_expr)
  369. dw_pageretr.setredraw(false)
  370. dw_pageretr.filter()
  371. if dw_pageretr.rowcount()>=1 then
  372. dw_pageretr.selectrow(0,false)
  373. dw_pageretr.selectrow(1,true)
  374. end if
  375. dw_pageretr.setredraw(true)
  376. end event
  377. event close;call super::close;destroy uo_award_punish_dq
  378. wf_del_tempfilepathname()
  379. end event
  380. event open;call super::open;uc_column_int=11 //uc dw前6列可以编辑
  381. uo_award_punish_dq =create uo_award_punish
  382. end event
  383. event refresh_interface;call super::refresh_interface;ddlb_status.enabled=not dw_edit_mode
  384. end event
  385. event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled
  386. Boolean cb_func_enabled,cb_retrieve_enabled
  387. cb_nextpage_enabled = cb_nextpage.Enabled
  388. cb_retrieveall_enabled = cb_retrieveall.Enabled
  389. cb_func_enabled = cb_func.Enabled
  390. cb_nextpage.Enabled = FALSE
  391. cb_retrieveall.Enabled = FALSE
  392. cb_func.Enabled = FALSE
  393. dw_uc.Retrieve()
  394. dw_pageretr.Retrieve(cur_flag)
  395. IF dw_pageretr.RowCount() > 0 THEN
  396. dw_pageretr.SetRow(1)
  397. dw_pageretr.triggerevent(rowfocuschanged!)
  398. end if
  399. THIS.TriggerEvent('retrieve_childdw')
  400. cb_nextpage.Enabled = cb_nextpage_enabled
  401. cb_retrieveall.Enabled = cb_retrieveall_enabled
  402. cb_func.Enabled = cb_func_enabled
  403. end event
  404. event ue_f9;call super::ue_f9;IF NOT dw_edit_mode THEN RETURN
  405. Long uc_row,ls_j
  406. s_empselect s_select
  407. String tmp_empcode
  408. uc_row = dw_uc.GetRow()
  409. IF uc_row = 0 THEN
  410. MessageBox('提示','请选定借支单!', Information!, OK! )
  411. RETURN
  412. END IF
  413. dw_uc.AcceptText()
  414. tmp_empcode = Trim(dw_uc.Object.u_rs_empinfo_empcode[uc_row])
  415. IF NOT IsValid(w_empinfo_choice) THEN
  416. OpenWithParm(w_empinfo_choice,tmp_empcode)
  417. s_select = Message.PowerObjectParm //接受返回结构
  418. IF s_select.empid > 0 THEN
  419. dw_uc.SetRedraw(FALSE)
  420. dw_uc.Object.u_gz_award_punish_empid[uc_row] = s_select.empid
  421. dw_uc.Object.u_rs_empinfo_empcode[uc_row] = s_select.empcode
  422. dw_uc.Object.u_rs_empinfo_empname[uc_row] = s_select.empname
  423. dw_uc.SetColumn('u_gz_award_punish_billdate')
  424. dw_uc.SetRedraw(TRUE)
  425. END IF
  426. END IF
  427. end event
  428. event ue_viewprint;call super::ue_viewprint;if not f_power_ind(483) then
  429. messagebox('提示','你没有使用权限!', Information!, OK! )
  430. return
  431. end if
  432. Long LS_ROW
  433. LS_ROW = dw_pageretr.GetRow()
  434. IF LS_ROW <= 0 THEN
  435. MessageBox('提示','没有打印目标单据!', Information!, OK! )
  436. RETURN
  437. END IF
  438. S_print_MSG LS_PRMSG
  439. IF ls_newname <> '' THEN
  440. IF li_auditprint = 1 THEN
  441. IF dw_pageretr.Object.u_gz_award_punish_flag[dw_pageretr.GetRow()] = 0 THEN
  442. MessageBox('提示','目标单据还未审核,不能打印!', Information!, OK! )
  443. RETURN
  444. END IF
  445. END IF
  446. ls_prmsg.obj_dwNAME = ls_newname
  447. ELSE
  448. ls_prmsg.obj_dwNAME = 'dw_rp_gz_award_punish_edit'
  449. END IF
  450. LS_PRMSG.TAG_TEXT = '奖罚单'
  451. LS_PRMSG.FILTER_STRING = ''
  452. LS_PRMSG.retr_pram_falg = 2
  453. LS_PRMSG.PAGECH_FLAG = 0
  454. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_gz_award_punish_billid[LS_ROW]
  455. OpenWithParm(w_publ_preview,LS_PRMSG)
  456. //**更新打印次料
  457. String arg_msg
  458. printnum = Message.DoubleParm
  459. f_update_printnum('u_gz_award_punish',printnum,0,dw_pageretr.Object.u_gz_award_punish_billid[LS_ROW],'','',arg_msg,TRUE)
  460. end event
  461. event ue_print;call super::ue_print;//--直接打印
  462. IF NOT f_power_ind(483) THEN
  463. MessageBox('提示','你没有使用权限!', Information!, OK! )
  464. RETURN
  465. END IF
  466. uo_print_preview uo_print
  467. S_print_MSG LS_PRMSG
  468. IF dw_pageretr.RowCount() = 0 THEN
  469. MessageBox('提示','没有可打印的单据!', Information!, OK! )
  470. RETURN
  471. END IF
  472. IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  473. IF ls_newname <> '' THEN
  474. IF li_auditprint = 1 THEN
  475. IF dw_pageretr.Object.u_gz_award_punish_flag[dw_pageretr.GetRow()] = 0 THEN
  476. MessageBox('提示','目标单据还未审核,不能打印!', Information!, OK! )
  477. RETURN
  478. END IF
  479. END IF
  480. LS_PRMSG.obj_dwNAME = ls_newname
  481. ELSE
  482. LS_PRMSG.obj_dwNAME = 'dw_rp_gz_award_punish_edit'
  483. END IF
  484. LS_PRMSG.retr_pram_falg = 2
  485. LS_PRMSG.TAG_TEXT = '奖罚单'
  486. LS_PRMSG.FILTER_STRING = ''
  487. LS_PRMSG.PAGECH_FLAG = 0
  488. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_gz_award_punish_billid[dw_pageretr.GetRow()]
  489. uo_print.FACT_PRINT_MSG = LS_PRMSG
  490. String arg_msg
  491. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  492. MessageBox("提示",arg_msg, Information!, OK! )
  493. RETURN
  494. END IF
  495. uo_print.ds_print()
  496. //**更新打印次料
  497. f_update_printnum('u_gz_award_punish',1,0,dw_pageretr.Object.u_gz_award_punish_billid[dw_pageretr.GetRow()],'','',arg_msg,TRUE)
  498. end event
  499. event ue_addzy;call super::ue_addzy;IF dw_edit_mode THEN
  500. MessageBox('提示',"编辑状态下不可以使用!", Information!, OK! )
  501. return
  502. END IF
  503. if not f_power_ind(773) then
  504. messagebox('提示','你没有使用权限!', Information!, OK! )
  505. return
  506. end if
  507. string arg_msg=''
  508. string ls_str
  509. long uc_row
  510. s_inputbox s_sreu
  511. uc_row=dw_uc.getrow()
  512. if uc_row<=0 then
  513. messagebox('系统提示','请选定当前目标单据!', Information!, OK! )
  514. return
  515. end if
  516. s_sreu.title='请输入要补充到备注的内容'
  517. s_sreu.old_text=''
  518. openwithparm(w_inputbox,s_sreu)
  519. ls_str=message.stringparm
  520. if trim(ls_str)='' or isnull(ls_str) then return
  521. if uo_award_punish_dq.add_dscrp(dw_uc.object.u_gz_award_punish_billid[uc_row],ls_str,arg_msg)=0 then
  522. messagebox('error!',arg_msg)
  523. return
  524. else
  525. messagebox('提示','添加备注操作成功!', Information!, OK! )
  526. wf_refresh_curuc(dw_uc.object.u_gz_award_punish_billid[uc_row])
  527. end if
  528. end event
  529. event resize;ln_bar.endx = this.width
  530. ln_bar2.endx = this.width
  531. r_bar.width = this.width
  532. end event
  533. type cb_func from w_publ_1ton_share_detail`cb_func within w_gz_award_punish
  534. end type
  535. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_gz_award_punish
  536. integer x = 2267
  537. end type
  538. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_gz_award_punish
  539. integer x = 192
  540. integer width = 530
  541. end type
  542. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_gz_award_punish
  543. integer x = 2894
  544. end type
  545. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_gz_award_punish
  546. integer x = 2533
  547. integer y = 40
  548. integer width = 320
  549. end type
  550. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_gz_award_punish
  551. event dwnkey pbm_dwnkey
  552. integer x = 1746
  553. integer width = 1792
  554. integer height = 1644
  555. string dataobject = "dw_gz_award_punish_index"
  556. end type
  557. event dw_pageretr::dwnkey;call super::dwnkey;Int h = 0
  558. end event
  559. event dw_pageretr::constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
  560. RBUTTON_FILTER_USE=true //右键查询功能开关
  561. end event
  562. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_check_billfj()
  563. end event
  564. type st_1 from w_publ_1ton_share_detail`st_1 within w_gz_award_punish
  565. integer y = 208
  566. end type
  567. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_gz_award_punish
  568. integer x = 3045
  569. end type
  570. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_gz_award_punish
  571. integer width = 1737
  572. integer height = 1652
  573. string dataobject = "dw_gz_award_punish_edit"
  574. end type
  575. event dw_uc::dwnkey;PARENT.TriggerEvent('user_key')
  576. IF Key = KeyDownArrow! THEN RETURN 1
  577. IF dw_edit_mode THEN
  578. String ls_empcode
  579. String ls_empname
  580. Long ll_empid,li_row
  581. dw_uc.AcceptText()
  582. li_row = dw_uc.GetRow()
  583. IF dw_uc.GetColumnName ( ) = 'u_rs_empinfo_empcode' AND Key = keyenter! THEN
  584. ls_empcode = Trim(dw_uc.Object.u_rs_empinfo_empcode[li_row])
  585. SELECT empid,empname INTO :ll_empid,:ls_empname FROM u_rs_empinfo Where empcode = :ls_empcode;
  586. dw_uc.SetRedraw(FALSE)
  587. IF sqlca.SQLCode <> 0 THEN
  588. PARENT.TriggerEvent('ue_f9')
  589. RETURN 1
  590. ELSE
  591. dw_uc.Object.u_gz_award_punish_empid[li_row] = ll_empid
  592. dw_uc.Object.u_rs_empinfo_empname[li_row] = ls_empname
  593. END IF
  594. dw_uc.SetRedraw(TRUE)
  595. dw_uc.SetColumn("u_gz_loanwage_billdate")
  596. RETURN 1
  597. ELSE
  598. IF Key = keyenter! OR Key = KeyDownArrow! THEN //
  599. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  600. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  601. RETURN 1
  602. ELSEIF Key = keyuparrow! THEN
  603. keybd_event ( 16, 0, 0 , 0 )
  604. keybd_event ( 9, 0, 0 , 0 )
  605. keybd_event ( 9, 0, 2, 0 )
  606. keybd_event ( 16, 0, 2, 0 )
  607. RETURN 1
  608. END IF
  609. END IF
  610. END IF
  611. end event
  612. event dw_uc::clicked;call super::clicked;if not dw_edit_mode then return
  613. if row <= 0 then return
  614. if dwo.name='p_p' then
  615. parent.TRIGGEREVENT('ue_f9')
  616. end if
  617. end event
  618. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_gz_award_punish
  619. end type
  620. type dw_child from w_publ_1ton_share_detail`dw_child within w_gz_award_punish
  621. integer x = 1029
  622. integer y = 2408
  623. integer height = 604
  624. end type
  625. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_gz_award_punish
  626. integer x = 1623
  627. end type
  628. type cb_print from w_publ_1ton_share_detail`cb_print within w_gz_award_punish
  629. integer x = 1431
  630. end type
  631. type cb_add from w_publ_1ton_share_detail`cb_add within w_gz_award_punish
  632. end type
  633. event cb_add::clicked;IF NOT f_power_ind(209) THEN
  634. MessageBox('提示','你没有使用权限!', Information!, OK! )
  635. RETURN
  636. END IF
  637. String arg_msg = ''
  638. Long uc_row
  639. IF dw_edit_mode THEN
  640. dw_uc.AcceptText()
  641. uc_row = dw_uc.GetRow()
  642. IF uc_row <= 0 THEN
  643. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  644. RETURN
  645. END IF
  646. IF NOT dw_uc.Object.u_gz_award_punish_billdate[uc_row] > DateTime(2000-01-01,Now()) THEN
  647. MessageBox('提示','不合理计件日期', Information!, OK! )
  648. RETURN
  649. END IF
  650. uo_award_punish_dq.billtype = dw_uc.Object.u_gz_award_punish_billtype[uc_row]
  651. uo_award_punish_dq.empid = dw_uc.Object.u_gz_award_punish_empid[uc_row]
  652. uo_award_punish_dq.billdate = dw_uc.Object.u_gz_award_punish_billdate[uc_row]
  653. uo_award_punish_dq.award_punish_amt = dw_uc.Object.u_gz_award_punish_award_punish_amt[uc_row]
  654. uo_award_punish_dq.reason = dw_uc.Object.u_gz_award_punish_reason[uc_row]
  655. uo_award_punish_dq.reason = dw_uc.Object.u_gz_award_punish_reason[uc_row]
  656. uo_award_punish_dq.deptid = dw_uc.Object.u_gz_award_punish_deptid[uc_row]
  657. uo_award_punish_dq.rep = dw_uc.Object.u_gz_award_punish_rep[uc_row]
  658. uo_award_punish_dq.wagemth = dw_uc.Object.u_gz_award_punish_wagemth[uc_row]
  659. uo_award_punish_dq.wageid = dw_uc.Object.u_gz_award_punish_wageid[uc_row]
  660. uo_award_punish_dq.dealtype = dw_uc.Object.u_gz_award_punish_dealtype[uc_row]
  661. IF uo_award_punish_dq.Save(arg_msg,TRUE) = 0 THEN
  662. MessageBox('错误',arg_msg, StopSign!, OK! )
  663. RETURN
  664. END IF
  665. // messagebox('提示','保存操作成功!')
  666. //write ini
  667. f_SetProfileString (sys_empid,dw_uc.DataObject, "ddlb_wageid",String(dw_uc.Object.u_gz_award_punish_wageid[dw_uc.GetRow()]))
  668. //
  669. Long ll_row
  670. ll_row = dw_pageretr.GetRow()
  671. dw_pageretr.SelectRow(0,FALSE)
  672. dw_pageretr.SelectRow(ll_row,TRUE)
  673. wf_refresh_curuc(uo_award_punish_dq.billid)
  674. ELSE
  675. IF uo_award_punish_dq.newbegin(arg_msg) = 0 THEN
  676. MessageBox('错误',arg_msg, StopSign!, OK! )
  677. RETURN
  678. END IF
  679. END IF
  680. CALL SUPER::Clicked
  681. IF dw_edit_mode THEN
  682. //read ini
  683. String ls_wageid
  684. ls_wageid = f_ProfileString (sys_empid,dw_uc.DataObject, "ddlb_wageid",'0')
  685. dw_uc.Object.u_gz_award_punish_wageid[dw_uc.GetRow()] = Long(ls_wageid)
  686. dw_uc.Object.u_gz_award_punish_wagemth[dw_uc.GetRow()] = Long(String(Today(),'yyyymm'))
  687. dw_uc.SetColumn('u_gz_award_punish_wageid')
  688. //
  689. ELSE
  690. PARENT.TriggerEvent("retrieve_childdw")
  691. END IF
  692. THIS.TriggerEvent('refresh_interface')
  693. // billid
  694. // empcode
  695. // u_sc_taskworkmx_procode
  696. // u_sc_taskworkmx_proname
  697. // workprice
  698. // amount
  699. // workhour
  700. // u_sc_taskworkmx_mxdscrp
  701. // empid
  702. // u_sc_taskworkmx_printid
  703. // empname
  704. // pid
  705. // amt
  706. end event
  707. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_gz_award_punish
  708. end type
  709. event cb_edit::clicked;IF NOT f_power_ind(209) THEN
  710. MessageBox('提示','你没有使用权限!', Information!, OK! )
  711. RETURN
  712. END IF
  713. String arg_msg = ''
  714. Long uc_row
  715. uc_row = dw_pageretr.GetRow()
  716. IF uc_row <= 0 THEN
  717. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  718. RETURN
  719. END IF
  720. IF NOT dw_edit_mode THEN
  721. IF uo_award_punish_dq.updatebegin(dw_pageretr.Object.u_gz_award_punish_billid[uc_row],arg_msg) = 0 THEN
  722. MessageBox('Error!',arg_msg)
  723. RETURN
  724. END IF
  725. wf_refresh_curuc(dw_pageretr.Object.u_gz_award_punish_billid[uc_row])
  726. END IF
  727. CALL SUPER::Clicked
  728. end event
  729. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_gz_award_punish
  730. end type
  731. event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(629) THEN
  732. MessageBox('提示','你没有使用权限!', Information!, OK! )
  733. RETURN
  734. END IF
  735. IF dw_edit_mode THEN RETURN
  736. String arg_msg = ''
  737. Long uc_row
  738. uc_row = dw_pageretr.GetRow()
  739. IF uc_row <= 0 THEN
  740. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  741. RETURN
  742. END IF
  743. IF MessageBox ("IF","是否确定要删除当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  744. IF uo_award_punish_dq.del(dw_pageretr.Object.u_gz_award_punish_billid[uc_row],arg_msg) = 0 THEN
  745. MessageBox('Error!',arg_msg)
  746. ELSE
  747. //日志
  748. Long ls_id
  749. String ls_code
  750. ls_id = dw_pageretr.Object.u_gz_award_punish_billid[uc_row]
  751. ls_code = dw_pageretr.Object.u_gz_award_punish_billcode[uc_row]
  752. f_setsysoplog('奖罚单','奖罚单删除,id:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE)
  753. //--
  754. MessageBox('提示','删除单据'+String(dw_pageretr.Object.u_gz_award_punish_billcode[uc_row])+'成功!', Information!, OK! )
  755. dw_pageretr.DeleteRow(uc_row)
  756. dw_pageretr.Triggerevent(rowfocuschanged!)
  757. END IF
  758. end event
  759. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_gz_award_punish
  760. end type
  761. event cb_addzy::clicked;call super::clicked;
  762. m_Dfc_Control_PopupMenu dmPopupMenu
  763. string menustr
  764. menustr="Text=补充事宜~tEvent=ue_addzy"
  765. menustr=menustr + "|" + "Text=-"
  766. menustr=menustr + "|" + "Text=查看附件~tEvent=ue_fj_view"
  767. menustr=menustr + "|" + "Text=添加附件~tEvent=ue_fj_edit"
  768. if len(trim(menustr))<>0 then
  769. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  770. dmPopupMenu.mf_BuildMenu(This, menustr)
  771. dmPopupMenu.mf_PopMenu()
  772. Destroy dmPopupMenu
  773. end if
  774. end event
  775. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_gz_award_punish
  776. end type
  777. event cb_auditing::clicked;call super::clicked;IF Not f_power_ind(210) THEN
  778. MessageBox('提示','你没有使用权限!', Information!, OK! )
  779. RETURN
  780. END IF
  781. s_taskwork_abnormity_audit s_audit
  782. OpenWithParm(w_gz_award_punish_audit,1)
  783. s_audit = Message.PowerObjectParm
  784. IF s_audit.audit_month = 0 THEN RETURN
  785. String arg_msg
  786. IF uo_award_punish_dq.auditing(s_audit.audit_wageid,s_audit.audit_month,arg_msg,True) = 0 THEN
  787. MessageBox('提示','奖罚单审核失败,原因>>'+arg_msg, Information!, OK! )
  788. RETURN
  789. END IF
  790. MessageBox('提示','奖罚单审核成功', Information!, OK! )
  791. Parent.TriggerEvent('retrieve_pageretr')
  792. end event
  793. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_gz_award_punish
  794. boolean visible = false
  795. end type
  796. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_gz_award_punish
  797. end type
  798. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_gz_award_punish
  799. integer x = 1815
  800. end type
  801. type cb_help from w_publ_1ton_share_detail`cb_help within w_gz_award_punish
  802. integer x = 2117
  803. end type
  804. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_gz_award_punish
  805. end type
  806. event cb_auditing_cancel::clicked;call super::clicked;IF Not f_power_ind(905) THEN
  807. MessageBox('提示','你没有使用权限!', Information!, OK! )
  808. RETURN
  809. END IF
  810. s_taskwork_abnormity_audit s_audit
  811. OpenWithParm(w_gz_award_punish_audit,0)
  812. s_audit = Message.PowerObjectParm
  813. IF s_audit.audit_month = 0 THEN RETURN
  814. String arg_msg
  815. IF uo_award_punish_dq.c_auditing(s_audit.audit_wageid,s_audit.audit_month,arg_msg,True) = 0 THEN
  816. MessageBox('提示','奖罚单撤审失败,原因>>'+arg_msg, Information!, OK! )
  817. RETURN
  818. END IF
  819. MessageBox('提示','奖罚单撤审成功', Information!, OK! )
  820. Parent.TriggerEvent('retrieve_pageretr')
  821. end event
  822. type p_msg from w_publ_1ton_share_detail`p_msg within w_gz_award_punish
  823. end type
  824. type p_help from w_publ_1ton_share_detail`p_help within w_gz_award_punish
  825. end type
  826. type p_encl from w_publ_1ton_share_detail`p_encl within w_gz_award_punish
  827. end type
  828. type p_other from w_publ_1ton_share_detail`p_other within w_gz_award_punish
  829. end type
  830. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_gz_award_punish
  831. end type
  832. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_gz_award_punish
  833. end type
  834. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_gz_award_punish
  835. end type
  836. type r_bar from w_publ_1ton_share_detail`r_bar within w_gz_award_punish
  837. end type
  838. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_gz_award_punish
  839. end type
  840. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_gz_award_punish
  841. end type
  842. type ddlb_status from dropdownlistbox within w_gz_award_punish
  843. integer x = 919
  844. integer y = 188
  845. integer width = 421
  846. integer height = 300
  847. integer taborder = 10
  848. boolean bringtotop = true
  849. integer textsize = -9
  850. integer weight = 400
  851. fontcharset fontcharset = gb2312charset!
  852. fontpitch fontpitch = variable!
  853. string facename = "宋体"
  854. long textcolor = 33554432
  855. string text = "[全部]"
  856. boolean sorted = false
  857. string item[] = {"[全部]","待审核","已审核"}
  858. borderstyle borderstyle = stylelowered!
  859. end type
  860. event selectionchanged;if index=1 then
  861. cur_flag=-1
  862. elseif index=2 then
  863. cur_flag=0
  864. elseif index=3 then
  865. cur_flag=1
  866. end if
  867. parent.triggerevent('retrieve_pageretr')
  868. end event
  869. type st_2 from statictext within w_gz_award_punish
  870. integer x = 736
  871. integer y = 204
  872. integer width = 219
  873. integer height = 48
  874. integer textsize = -9
  875. integer weight = 400
  876. fontcharset fontcharset = gb2312charset!
  877. fontpitch fontpitch = variable!
  878. string facename = "宋体"
  879. long textcolor = 33554432
  880. long backcolor = 134217739
  881. string text = "状 态"
  882. boolean focusrectangle = false
  883. end type