w_gz_wageitemdef.srw 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. $PBExportHeader$w_gz_wageitemdef.srw
  2. forward
  3. global type w_gz_wageitemdef from w_publ_edit_index
  4. end type
  5. type cbx_1 from checkbox within w_gz_wageitemdef
  6. end type
  7. end forward
  8. global type w_gz_wageitemdef from w_publ_edit_index
  9. integer width = 2491
  10. integer height = 1620
  11. string title = "工资项目"
  12. boolean minbox = true
  13. windowtype windowtype = popup!
  14. cbx_1 cbx_1
  15. end type
  16. global w_gz_wageitemdef w_gz_wageitemdef
  17. type variables
  18. boolean if_addnew=false
  19. end variables
  20. on w_gz_wageitemdef.create
  21. int iCurrent
  22. call super::create
  23. this.cbx_1=create cbx_1
  24. iCurrent=UpperBound(this.Control)
  25. this.Control[iCurrent+1]=this.cbx_1
  26. end on
  27. on w_gz_wageitemdef.destroy
  28. call super::destroy
  29. destroy(this.cbx_1)
  30. end on
  31. event ue_usual_query_filt;call super::ue_usual_query_filt;if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return
  32. string obj_expr=''
  33. if trim(sle_usual_query.text)<>'' then
  34. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  35. obj_expr=obj_expr+'( wagename LIKE "%'+trim(sle_usual_query.text)+'%" )'
  36. ELSE
  37. obj_expr=obj_expr+'( wagename LIKE "'+trim(sle_usual_query.text)+'" )'
  38. END IF
  39. end if
  40. dw_UC.setfilter(obj_expr)
  41. dw_UC.SetRedraw(False)
  42. dw_INDEX.SetRedraw(False)
  43. dw_UC.filter()
  44. if dw_index.rowcount()>=1 then
  45. dw_index.selectrow(0,false)
  46. dw_index.selectrow(1,true)
  47. end if
  48. dw_UC.SetRedraw(TRUE)
  49. dw_INDEX.SetRedraw(TRUE)
  50. end event
  51. event ue_usual_query_retr;call super::ue_usual_query_retr;if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return
  52. string ls_querystrpart=''
  53. ls_newselect=lower(ori_oldselect)
  54. if trim(sle_usual_query.text)<>'' then
  55. if pos(trim(sle_usual_query.text),'%')=0 then
  56. ls_querystrpart="(wagename like '%"+trim(sle_usual_query.text)+"%')"
  57. else
  58. ls_querystrpart="(wagename like '"+trim(sle_usual_query.text)+"')"
  59. end if
  60. if Pos(ls_newselect," where ") <> 0 then
  61. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  62. else
  63. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  64. end if
  65. end if
  66. wf_retrieveuc(dw_uc,ls_newselect,1)
  67. this.triggerevent('retrieve_uc') //注意必须有此句
  68. end event
  69. event retrieve_uc;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  70. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  71. cb_firstpage_enabled=cb_firstpage.enabled
  72. cb_nextpage_enabled=cb_nextpage.enabled
  73. cb_retrieveall_enabled=cb_retrieveall.enabled
  74. cb_priorpage_enabled=cb_priorpage.enabled
  75. cb_func_enabled=cb_func.enabled
  76. cb_retrieve_enabled=cb_retrieve.enabled
  77. cb_firstpage.enabled=false
  78. cb_nextpage.enabled=false
  79. cb_retrieveall.enabled=false
  80. cb_priorpage.enabled=false
  81. cb_func.enabled=false
  82. cb_retrieve.enabled=false
  83. Long ifuse
  84. IF NOT cbx_1.Checked THEN
  85. ifuse = -1
  86. ELSE
  87. ifuse = 1
  88. END IF
  89. dw_UC.setredraw(false)
  90. dw_index.ShareDataOff()
  91. SetPointer(HourGlass!)
  92. dw_UC.retrieve(ifuse)
  93. SetPointer(Arrow!)
  94. dw_uc.sharedata(dw_index)
  95. dw_UC.setredraw(true)
  96. if dw_index.rowcount()>=1 then
  97. dw_index.selectrow(0,false)
  98. dw_index.selectrow(1,true)
  99. end if
  100. cb_firstpage.enabled=cb_firstpage_enabled
  101. cb_nextpage.enabled=cb_nextpage_enabled
  102. cb_retrieveall.enabled=cb_retrieveall_enabled
  103. cb_priorpage.enabled=cb_priorpage_enabled
  104. cb_func.enabled=cb_func_enabled
  105. cb_retrieve.enabled=cb_retrieve_enabled
  106. end event
  107. type cb_func from w_publ_edit_index`cb_func within w_gz_wageitemdef
  108. end type
  109. type cb_exit from w_publ_edit_index`cb_exit within w_gz_wageitemdef
  110. integer x = 1179
  111. end type
  112. type sle_usual_query from w_publ_edit_index`sle_usual_query within w_gz_wageitemdef
  113. end type
  114. type cb_nextpage from w_publ_edit_index`cb_nextpage within w_gz_wageitemdef
  115. end type
  116. type cb_priorpage from w_publ_edit_index`cb_priorpage within w_gz_wageitemdef
  117. end type
  118. type cb_firstpage from w_publ_edit_index`cb_firstpage within w_gz_wageitemdef
  119. end type
  120. type cb_retrieveall from w_publ_edit_index`cb_retrieveall within w_gz_wageitemdef
  121. end type
  122. type em_pagerowno from w_publ_edit_index`em_pagerowno within w_gz_wageitemdef
  123. end type
  124. type st_pagerowno from w_publ_edit_index`st_pagerowno within w_gz_wageitemdef
  125. end type
  126. type st_1 from w_publ_edit_index`st_1 within w_gz_wageitemdef
  127. string text = "名称含:"
  128. end type
  129. type cb_add from w_publ_edit_index`cb_add within w_gz_wageitemdef
  130. end type
  131. event cb_add::clicked;if not f_power_ind(195) then
  132. messagebox('提示','你没有使用权限!', Information!, OK! )
  133. return
  134. end if
  135. long ll_wageid=0,ls_itemtype
  136. string errmsg='',ls_name
  137. IF dw_edit_mode THEN
  138. dw_uc.accepttext()
  139. if dw_uc.GetNextModified(0, Primary!)=0 then
  140. MESSAGEBOX('提示','没有任何修改,不可以保存!', Information!, OK! )
  141. RETURN
  142. end if
  143. if DW_UC.getrow()=0 then
  144. return
  145. end if
  146. IF isnull(DW_UC.OBJECT.wagename[DW_UC.GETROW()]) or trim(DW_UC.OBJECT.wagename[DW_UC.GETROW()])='' THEN
  147. MESSAGEBOX('提示','请输入工资项目名称!', Information!, OK! )
  148. RETURN
  149. END IF
  150. ls_name=DW_UC.OBJECT.wagename[DW_UC.GETROW()]
  151. ls_itemtype=DW_UC.OBJECT.wagetype[DW_UC.GETROW()]
  152. ll_wageid=dw_uc.object.wageid[dw_uc.getrow()]
  153. if ll_wageid=0 then
  154. ll_wageid=f_sys_scidentity(0,"u_gz_wageitem","wageid",errmsg,false,sqlca)
  155. if ll_wageid<0 then
  156. messagebox("提示",errmsg, Information!, OK! )
  157. return
  158. else
  159. dw_uc.object.wageid[DW_UC.GETROW()]=ll_wageid
  160. if_addnew=true
  161. end if
  162. end if
  163. /////////////////////////////
  164. end if
  165. CALL SUPER::CLICKED
  166. if dw_edit_mode then
  167. dw_uc.setcolumn('wagename')
  168. else
  169. if not if_addnew then //修改时
  170. //更新未审核的明细的项目名字/类型
  171. UPDATE u_gz_wagemx
  172. SET wagetype = :ls_itemtype,
  173. Wagename = :ls_name
  174. from u_gz_wagemx,u_gz_wage
  175. where u_gz_wage.wagemth=u_gz_wagemx.wagemth and
  176. u_gz_wage.empid=u_gz_wagemx.empid and
  177. u_gz_wagemx.wageid=:ll_wageid and
  178. u_gz_wage.Auditingflag=0 and
  179. ( u_gz_wagemx.wagetype <> :ls_itemtype or u_gz_wagemx.Wagename <> :ls_name);
  180. if sqlca.sqlcode<>0 then
  181. errmsg=sqlca.sqlerrtext
  182. rollback;
  183. messagebox('提示',"更新未审核的明细的项目"+string(ls_name)+"名字以及计算类型失败>>"+errmsg, Information!, OK! )
  184. else
  185. commit;
  186. end if
  187. end if
  188. cb_retrieve.triggerevent(clicked!)
  189. end if
  190. end event
  191. type cb_edit from w_publ_edit_index`cb_edit within w_gz_wageitemdef
  192. end type
  193. event cb_edit::clicked;if not f_power_ind(195) then
  194. messagebox('提示','你没有使用权限!', Information!, OK! )
  195. return
  196. end if
  197. if_addnew = FALSE
  198. Long cnt = 0,ls_row,ls_id
  199. String ls_name
  200. ls_row = dw_uc.GetRow()
  201. IF ls_row = 0 THEN
  202. MessageBox('提示','没有修改对象!', Information!, OK! )
  203. RETURN
  204. END IF
  205. //IF dw_uc.Object.wagemode[ls_row] = 12 THEN
  206. //
  207. // ls_id = dw_uc.Object.wageid[ls_row]
  208. // ls_name = dw_uc.Object.wagename[ls_row]
  209. //
  210. // SELECT count(u_gz_mltaskmx.wageid) as cnt
  211. // INTO :cnt
  212. // FROM u_gz_mltaskmx
  213. // Where u_gz_mltaskmx.wageid = :ls_id;
  214. // IF sqlca.SQLCode <> 0 THEN
  215. // MessageBox('提示','查询工资项目['+ls_name+']是否使用操作失败!>>'+sqlca.SQLErrText)
  216. // RETURN
  217. // END IF
  218. // IF cnt > 0 THEN
  219. // dw_uc.SetTabOrder("wagemode",0)
  220. // RETURN
  221. // END IF
  222. //END IF
  223. CALL SUPER::Clicked
  224. end event
  225. type cb_delet from w_publ_edit_index`cb_delet within w_gz_wageitemdef
  226. end type
  227. event cb_delet::clicked;call super::clicked;IF Not f_power_ind(195) THEN
  228. MessageBox('提示','你没有使用权限!', Information!, OK! )
  229. RETURN
  230. END IF
  231. Long cnt = 0,ls_row,ls_id
  232. String ls_name
  233. ls_row = dw_uc.GetRow()
  234. IF ls_row = 0 THEN
  235. MessageBox('提示','没有删除对象!', Information!, OK! )
  236. RETURN
  237. END IF
  238. ls_id = dw_uc.Object.wageid[ls_row]
  239. ls_name = dw_uc.Object.wagename[ls_row]
  240. SELECT count(u_gz_wagemx.wageid) as cnt
  241. INTO :cnt
  242. FROM u_gz_wagemx
  243. Where u_gz_wagemx.wageid = :ls_id;
  244. IF sqlca.SQLCode <> 0 THEN
  245. MessageBox('提示','查询工资项目['+ls_name+']是否在工资表中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  246. RETURN
  247. END IF
  248. IF cnt > 0 THEN
  249. MessageBox('提示','工资项目['+ls_name+']已经在工资表中使用,不可以删除!', Information!, OK! )
  250. RETURN
  251. END IF
  252. ////20101210
  253. SELECT count(u_gz_award_punish.wageid) as cnt
  254. INTO :cnt
  255. FROM u_gz_award_punish
  256. Where u_gz_award_punish.wageid = :ls_id;
  257. IF sqlca.SQLCode <> 0 THEN
  258. MessageBox('提示','查询工资项目['+ls_name+']是否在奖罚单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  259. RETURN
  260. END IF
  261. IF cnt > 0 THEN
  262. MessageBox('提示','工资项目['+ls_name+']已经在奖罚单中使用,不可以删除!', Information!, OK! )
  263. RETURN
  264. END IF
  265. SELECT count(u_gz_cwork.wageid) as cnt
  266. INTO :cnt
  267. FROM u_gz_cwork
  268. Where u_gz_cwork.wageid = :ls_id;
  269. IF sqlca.SQLCode <> 0 THEN
  270. MessageBox('提示','查询工资项目['+ls_name+']是否在考勤单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  271. RETURN
  272. END IF
  273. IF cnt > 0 THEN
  274. MessageBox('提示','工资项目['+ls_name+']已经在考勤单中使用,不可以删除!', Information!, OK! )
  275. RETURN
  276. END IF
  277. SELECT count(u_gz_loanwage.wageid) as cnt
  278. INTO :cnt
  279. FROM u_gz_loanwage
  280. Where u_gz_loanwage.wageid = :ls_id;
  281. IF sqlca.SQLCode <> 0 THEN
  282. MessageBox('提示','查询工资项目['+ls_name+']是否在借支单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  283. RETURN
  284. END IF
  285. IF cnt > 0 THEN
  286. MessageBox('提示','工资项目['+ls_name+']已经在借支单中使用,不可以删除!', Information!, OK! )
  287. RETURN
  288. END IF
  289. SELECT count(u_outware.relid) as cnt
  290. INTO :cnt
  291. FROM u_outware
  292. Where u_outware.relid = :ls_id and u_outware.billtype = 10;
  293. IF sqlca.SQLCode <> 0 THEN
  294. MessageBox('提示','查询工资项目['+ls_name+']是否在扣费品单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  295. RETURN
  296. END IF
  297. IF cnt > 0 THEN
  298. MessageBox('提示','工资项目['+ls_name+']已经在扣费品单中使用,不可以删除!', Information!, OK! )
  299. RETURN
  300. END IF
  301. SELECT count(u_sc_abnormity.wageid) as cnt
  302. INTO :cnt
  303. FROM u_sc_abnormity
  304. Where u_sc_abnormity.wageid = :ls_id;
  305. IF sqlca.SQLCode <> 0 THEN
  306. MessageBox('提示','查询工资项目['+ls_name+']是否在个人工序计件单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  307. RETURN
  308. END IF
  309. IF cnt > 0 THEN
  310. MessageBox('提示','工资项目['+ls_name+']已经在个人工序计件单中使用,不可以删除!', Information!, OK! )
  311. RETURN
  312. END IF
  313. SELECT count(u_sc_taskwork.wageid) as cnt
  314. INTO :cnt
  315. FROM u_sc_taskwork
  316. Where u_sc_taskwork.wageid = :ls_id;
  317. IF sqlca.SQLCode <> 0 THEN
  318. MessageBox('提示','查询工资项目['+ls_name+']是否在产品个人工序计件单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  319. RETURN
  320. END IF
  321. IF cnt > 0 THEN
  322. MessageBox('提示','工资项目['+ls_name+']已经在产品个人工序计件单中使用,不可以删除!', Information!, OK! )
  323. RETURN
  324. END IF
  325. SELECT count(u_scwg_taskwork_2.wageid) as cnt
  326. INTO :cnt
  327. FROM u_scwg_taskwork_2
  328. Where u_scwg_taskwork_2.wageid = :ls_id;
  329. IF sqlca.SQLCode <> 0 THEN
  330. MessageBox('提示','查询工资项目['+ls_name+']是否在个人产品工序计件单中使用操作失败!>>'+sqlca.SQLErrText, Information!, OK! )
  331. RETURN
  332. END IF
  333. IF cnt > 0 THEN
  334. MessageBox('提示','工资项目['+ls_name+']已经在个人产品工序计件单中使用,不可以删除!', Information!, OK! )
  335. RETURN
  336. END IF
  337. ////
  338. IF MessageBox ("询问","是否确定要删除当前记录["+ls_name+"]?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  339. RETURN
  340. END IF
  341. dw_uc.SetRedraw (False)
  342. dw_uc.DeleteRow (ls_row)
  343. dw_uc.TriggerEvent (RowFocusChanged!)
  344. IF dw_uc.Update() = -1 THEN
  345. ROLLBACK;
  346. MessageBox ("NO","删除记录操作失败!",Exclamation!,OK!)
  347. ELSE
  348. COMMIT;
  349. END IF
  350. dw_uc.SetRedraw (True)
  351. WF_INDEX_UC()
  352. end event
  353. type cb_choice from w_publ_edit_index`cb_choice within w_gz_wageitemdef
  354. integer x = 1029
  355. end type
  356. type cb_cancel from w_publ_edit_index`cb_cancel within w_gz_wageitemdef
  357. end type
  358. type cbx_mlselect from w_publ_edit_index`cbx_mlselect within w_gz_wageitemdef
  359. integer x = 1778
  360. integer y = 212
  361. end type
  362. type cbx_allselect from w_publ_edit_index`cbx_allselect within w_gz_wageitemdef
  363. integer x = 2112
  364. integer y = 212
  365. end type
  366. type cb_mode_itfchg_b from w_publ_edit_index`cb_mode_itfchg_b within w_gz_wageitemdef
  367. end type
  368. type cb_mode_itfchg from w_publ_edit_index`cb_mode_itfchg within w_gz_wageitemdef
  369. integer x = 1330
  370. end type
  371. type gb_1 from w_publ_edit_index`gb_1 within w_gz_wageitemdef
  372. end type
  373. type dw_uc from w_publ_edit_index`dw_uc within w_gz_wageitemdef
  374. integer x = 1221
  375. integer width = 1216
  376. integer height = 1232
  377. string dataobject = "dw_wageitem_def_edit"
  378. end type
  379. type cb_retrieve from w_publ_edit_index`cb_retrieve within w_gz_wageitemdef
  380. end type
  381. type cb_print from w_publ_edit_index`cb_print within w_gz_wageitemdef
  382. end type
  383. event cb_print::clicked;call super::clicked;S_print_MSG LS_PRMSG
  384. LS_PRMSG.obj_dwNAME='dw_rp_wageitem_index'
  385. LS_PRMSG.SHARE_DW=DW_UC
  386. LS_PRMSG.TAG_TEXT='工资项目'
  387. LS_PRMSG.SETUP_FLAG=0
  388. LS_PRMSG.PAGECH_FLAG=1
  389. Openwithparm(w_publ_preview,LS_PRMSG)
  390. end event
  391. type ln_bar from w_publ_edit_index`ln_bar within w_gz_wageitemdef
  392. end type
  393. type ln_bar2 from w_publ_edit_index`ln_bar2 within w_gz_wageitemdef
  394. end type
  395. type r_bar from w_publ_edit_index`r_bar within w_gz_wageitemdef
  396. end type
  397. type ln_1 from w_publ_edit_index`ln_1 within w_gz_wageitemdef
  398. end type
  399. type ln_2 from w_publ_edit_index`ln_2 within w_gz_wageitemdef
  400. end type
  401. type dw_index from w_publ_edit_index`dw_index within w_gz_wageitemdef
  402. integer y = 296
  403. integer width = 1221
  404. integer height = 1232
  405. string dataobject = "dw_wageitem_def_index"
  406. end type
  407. event dw_index::constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
  408. RBUTTON_FILTER_USE=true //右键查询功能开关
  409. end event
  410. type cb_help from w_publ_edit_index`cb_help within w_gz_wageitemdef
  411. end type
  412. type cbx_1 from checkbox within w_gz_wageitemdef
  413. integer x = 919
  414. integer y = 212
  415. integer width = 402
  416. integer height = 60
  417. boolean bringtotop = true
  418. integer textsize = -9
  419. integer weight = 400
  420. fontcharset fontcharset = gb2312charset!
  421. fontpitch fontpitch = variable!
  422. string facename = "宋体"
  423. long textcolor = 33554432
  424. long backcolor = 134217739
  425. string text = "只显示有效"
  426. end type
  427. event clicked;int ll_ifuse
  428. if this.checked then
  429. ll_ifuse = 1
  430. else
  431. ll_ifuse = -1
  432. end if
  433. f_SetProfileString (sys_empid,dw_uc.DATAOBJECT, "if_user",string(ll_ifuse) )
  434. parent.triggerevent('retrieve_uc')
  435. end event
  436. event constructor;Int ll_ifuse
  437. ll_ifuse = Long(f_ProfileString (sys_empid,dw_uc.DataObject, "if_user",'-1'))
  438. IF ll_ifuse = 1 THEN
  439. THIS.Checked = TRUE
  440. ELSE
  441. THIS.Checked = FALSE
  442. END IF
  443. end event