w_pmod_taskwork_workprice.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. $PBExportHeader$w_pmod_taskwork_workprice.srw
  2. forward
  3. global type w_pmod_taskwork_workprice from w_publ_easyq
  4. end type
  5. type cb_3 from uo_imflatbutton within w_pmod_taskwork_workprice
  6. end type
  7. type cb_4 from uo_imflatbutton within w_pmod_taskwork_workprice
  8. end type
  9. type ddlb_type from dropdownlistbox within w_pmod_taskwork_workprice
  10. end type
  11. type ddlb_1 from dropdownlistbox within w_pmod_taskwork_workprice
  12. end type
  13. end forward
  14. global type w_pmod_taskwork_workprice from w_publ_easyq
  15. string title = "批修改计件单计件单价"
  16. boolean if_ue_retr = true
  17. boolean if_ue_filter = true
  18. boolean if_ue_sort = true
  19. boolean if_ue_sentdataout = true
  20. cb_3 cb_3
  21. cb_4 cb_4
  22. ddlb_type ddlb_type
  23. ddlb_1 ddlb_1
  24. end type
  25. global w_pmod_taskwork_workprice w_pmod_taskwork_workprice
  26. forward prototypes
  27. public function integer wf_update_taskwork (ref string arg_msg)
  28. public function integer wf_update_person (ref string arg_msg)
  29. end prototypes
  30. public function integer wf_update_taskwork (ref string arg_msg);//产品个人工序计件单
  31. Int rslt = 1
  32. Open(w_sys_wait_jdt) //初始化进度条
  33. w_sys_wait_jdt.Show()
  34. w_sys_wait_jdt.wf_accepttol(dw_1.RowCount()) //初始化进度条1
  35. Long i
  36. String ls_billcode,ls_mtrlcode,ls_empcode,ls_procode
  37. Int li_auditingflag
  38. Decimal ld_billprice, ld_workprice,ld_taskprice
  39. Long ll_billid,ll_printid, ll_empid,ll_scid
  40. long ll_suc
  41. FOR i = 1 To dw_1.RowCount()
  42. ls_billcode = dw_1.Object.u_sc_taskwork_billcode[i]
  43. ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[i]
  44. li_auditingflag = dw_1.Object.u_sc_taskwork_auditingflag[i]
  45. ls_empcode = dw_1.Object.u_rs_empinfo_empcode[i]
  46. ls_procode = dw_1.Object.u_sc_taskworkmx_procode[i]
  47. ld_billprice = dw_1.Object.u_sc_taskworkmx_workprice[i]
  48. ld_workprice = dw_1.Object.u_sc_workprice_workprice[i]
  49. ll_scid = dw_1.Object.u_sc_taskwork_scid[i]
  50. ll_billid = dw_1.Object.u_sc_taskwork_billid[i]
  51. ll_printid = dw_1.Object.u_sc_taskworkmx_printid[i]
  52. ll_empid = dw_1.Object.u_sc_taskworkmx_empid[i]
  53. w_sys_wait_jdt.st_msg.Text = "正在更新单号:"+ls_billcode+',物料:'+ls_mtrlcode+',工号:'+ls_empcode+',工序号:'+ls_procode+'...' //进度信息
  54. w_sys_wait_jdt.wf_inc(i) //进度
  55. IF li_auditingflag = 1 THEN CONTINUE
  56. IF ld_billprice = ld_workprice THEN CONTINUE
  57. UPDATE u_sc_taskworkmx
  58. SET Workprice = :ld_workprice
  59. WHERE scid = :ll_scid
  60. AND billid = :ll_billid
  61. AND printid = :ll_printid;
  62. IF sqlca.SQLCode <> 0 THEN
  63. arg_msg = "单号:"+ls_billcode+',物料:'+ls_mtrlcode+',工号:'+ls_empcode+',工序号:'+ls_procode+',更新失败,'+sqlca.SQLErrText
  64. rslt = 0
  65. GOTO ext
  66. END IF
  67. ll_suc++
  68. NEXT
  69. //日志
  70. f_setsysoplog('产品个人工序计件单','批修改单价,成功修改数据:'+string(ll_suc),arg_msg,true)
  71. //--
  72. ext:
  73. Close(w_sys_wait_jdt)
  74. IF rslt = 0 THEN
  75. ROLLBACK;
  76. ELSE
  77. COMMIT;
  78. END IF
  79. RETURN rslt
  80. end function
  81. public function integer wf_update_person (ref string arg_msg);//个人产品工序计件单
  82. Int rslt = 1
  83. Open(w_sys_wait_jdt) //初始化进度条
  84. w_sys_wait_jdt.Show()
  85. w_sys_wait_jdt.wf_accepttol(dw_1.RowCount()) //初始化进度条1
  86. Long i
  87. String ls_billcode,ls_mtrlcode,ls_empcode,ls_procode
  88. Int li_auditingflag
  89. Decimal ld_billprice, ld_workprice,ld_taskprice
  90. Long ll_billid,ll_printid,ll_scid
  91. long ll_suc, ll_fail
  92. FOR i = 1 To dw_1.RowCount()
  93. ls_billcode = dw_1.Object.u_scwg_taskwork_2_billcode[i]
  94. ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[i]
  95. li_auditingflag = dw_1.Object.u_scwg_taskwork_2_flag[i]
  96. ls_empcode = dw_1.Object.u_rs_empinfo_empcode[i]
  97. ls_procode = dw_1.Object.procode[i]
  98. ld_billprice = dw_1.Object.price[i]
  99. ld_workprice = dw_1.Object.u_sc_workprice_workprice[i]
  100. ll_scid = dw_1.Object.u_scwg_taskwork_2_scid[i]
  101. ll_billid = dw_1.Object.u_scwg_taskwork_2_billid[i]
  102. ll_printid = dw_1.Object.printid[i]
  103. w_sys_wait_jdt.st_msg.Text = "正在更新单号:"+ls_billcode+',物料:'+ls_mtrlcode+',工号:'+ls_empcode+',工序号:'+ls_procode+'...' //进度信息
  104. w_sys_wait_jdt.wf_inc(i) //进度
  105. IF li_auditingflag = 1 THEN CONTINUE
  106. IF ld_billprice = ld_workprice THEN CONTINUE
  107. UPDATE u_scwg_taskwork_2_mx
  108. SET price = :ld_workprice
  109. WHERE billid = :ll_billid
  110. And printid = :ll_printid;
  111. IF sqlca.SQLCode <> 0 THEN
  112. arg_msg = "单号:"+ls_billcode+',物料:'+ls_mtrlcode+',工号:'+ls_empcode+',工序号:'+ls_procode+',更新失败,'+sqlca.SQLErrText
  113. rslt = 0
  114. GOTO ext
  115. END IF
  116. ll_suc++
  117. NEXT
  118. //日志
  119. f_setsysoplog('个人产品工序计件单','批修改单价,成功修改数据:'+string(ll_suc),arg_msg,true)
  120. //--
  121. ext:
  122. Close(w_sys_wait_jdt)
  123. IF rslt = 0 THEN
  124. ROLLBACK;
  125. ELSE
  126. COMMIT;
  127. END IF
  128. RETURN rslt
  129. end function
  130. on w_pmod_taskwork_workprice.create
  131. int iCurrent
  132. call super::create
  133. this.cb_3=create cb_3
  134. this.cb_4=create cb_4
  135. this.ddlb_type=create ddlb_type
  136. this.ddlb_1=create ddlb_1
  137. iCurrent=UpperBound(this.Control)
  138. this.Control[iCurrent+1]=this.cb_3
  139. this.Control[iCurrent+2]=this.cb_4
  140. this.Control[iCurrent+3]=this.ddlb_type
  141. this.Control[iCurrent+4]=this.ddlb_1
  142. end on
  143. on w_pmod_taskwork_workprice.destroy
  144. call super::destroy
  145. destroy(this.cb_3)
  146. destroy(this.cb_4)
  147. destroy(this.ddlb_type)
  148. destroy(this.ddlb_1)
  149. end on
  150. event open;call super::open;cb_1.TriggerEvent(Clicked!)
  151. end event
  152. event ue_before_open;call super::ue_before_open;if_ue_retr=true
  153. if_ue_filter=true
  154. if_ue_sort=true
  155. if_ue_sentdataout=true
  156. end event
  157. type cb_func from w_publ_easyq`cb_func within w_pmod_taskwork_workprice
  158. end type
  159. type cb_exit from w_publ_easyq`cb_exit within w_pmod_taskwork_workprice
  160. integer x = 1504
  161. end type
  162. type cb_2 from w_publ_easyq`cb_2 within w_pmod_taskwork_workprice
  163. integer x = 1189
  164. integer width = 165
  165. end type
  166. type cb_psetup from w_publ_easyq`cb_psetup within w_pmod_taskwork_workprice
  167. integer x = 933
  168. end type
  169. type cb_1 from w_publ_easyq`cb_1 within w_pmod_taskwork_workprice
  170. end type
  171. event cb_1::clicked;call super::clicked;Int li_view_sameprice
  172. DateTime firstdate,enddate
  173. IF ddlb_1.text = '显示计件单价与工价表不相同的计件明细' THEN
  174. li_view_sameprice = 1
  175. ELSE
  176. li_view_sameprice = 0
  177. END IF
  178. firstdate = DateTime(Date(em_1.Text),Time(0))
  179. enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
  180. dw_1.Retrieve(firstdate,enddate,li_view_sameprice)
  181. end event
  182. type st_3 from w_publ_easyq`st_3 within w_pmod_taskwork_workprice
  183. end type
  184. type st_4 from w_publ_easyq`st_4 within w_pmod_taskwork_workprice
  185. end type
  186. type em_1 from w_publ_easyq`em_1 within w_pmod_taskwork_workprice
  187. end type
  188. type em_2 from w_publ_easyq`em_2 within w_pmod_taskwork_workprice
  189. end type
  190. type ddlb_yl from w_publ_easyq`ddlb_yl within w_pmod_taskwork_workprice
  191. integer x = 1938
  192. integer y = 4
  193. end type
  194. type cbx_yl from w_publ_easyq`cbx_yl within w_pmod_taskwork_workprice
  195. integer x = 1728
  196. integer y = 8
  197. end type
  198. type dw_1 from w_publ_easyq`dw_1 within w_pmod_taskwork_workprice
  199. integer y = 300
  200. string dataobject = "dw_pmod_sc_taskwork_workprice"
  201. end type
  202. event dw_1::doubleclicked;call super::doubleclicked;
  203. //IF dw_1.DataObject = 'dw_pmod_taskwork_workprice' THEN
  204. // IF row > 0 THEN
  205. // String ls_code
  206. // Long ll_scid
  207. //
  208. // ls_code = THIS.Object.u_sc_taskwork_billcode[row]
  209. // ll_scid = dw_1.Object.u_sc_taskworkmx_scid[row]
  210. //
  211. // f_open_win(ll_scid,ls_code)
  212. // END IF
  213. //END IF
  214. end event
  215. type sle_mtrl from w_publ_easyq`sle_mtrl within w_pmod_taskwork_workprice
  216. end type
  217. type sle_cust from w_publ_easyq`sle_cust within w_pmod_taskwork_workprice
  218. end type
  219. type st_mtrl from w_publ_easyq`st_mtrl within w_pmod_taskwork_workprice
  220. end type
  221. type st_cust from w_publ_easyq`st_cust within w_pmod_taskwork_workprice
  222. end type
  223. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_pmod_taskwork_workprice
  224. boolean visible = true
  225. integer x = 1728
  226. integer y = 92
  227. end type
  228. type pb_em1 from w_publ_easyq`pb_em1 within w_pmod_taskwork_workprice
  229. end type
  230. type pb_em2 from w_publ_easyq`pb_em2 within w_pmod_taskwork_workprice
  231. end type
  232. type pb_2 from w_publ_easyq`pb_2 within w_pmod_taskwork_workprice
  233. end type
  234. type cb_help from w_publ_easyq`cb_help within w_pmod_taskwork_workprice
  235. integer x = 1353
  236. end type
  237. type cb_copyself from w_publ_easyq`cb_copyself within w_pmod_taskwork_workprice
  238. boolean visible = false
  239. end type
  240. type gb_1 from w_publ_easyq`gb_1 within w_pmod_taskwork_workprice
  241. integer x = 1106
  242. integer y = 432
  243. integer width = 110
  244. end type
  245. type ln_bar from w_publ_easyq`ln_bar within w_pmod_taskwork_workprice
  246. end type
  247. type ln_bar2 from w_publ_easyq`ln_bar2 within w_pmod_taskwork_workprice
  248. end type
  249. type r_bar from w_publ_easyq`r_bar within w_pmod_taskwork_workprice
  250. end type
  251. type ln_1 from w_publ_easyq`ln_1 within w_pmod_taskwork_workprice
  252. end type
  253. type ln_2 from w_publ_easyq`ln_2 within w_pmod_taskwork_workprice
  254. end type
  255. type ln_3 from w_publ_easyq`ln_3 within w_pmod_taskwork_workprice
  256. boolean visible = false
  257. end type
  258. type ln_4 from w_publ_easyq`ln_4 within w_pmod_taskwork_workprice
  259. boolean visible = false
  260. end type
  261. type cb_3 from uo_imflatbutton within w_pmod_taskwork_workprice
  262. integer x = 302
  263. integer width = 274
  264. integer height = 164
  265. integer taborder = 30
  266. boolean bringtotop = true
  267. string text = "更新单价"
  268. string normalpicname = "save.bmp"
  269. integer picsize = 16
  270. toolbaralignment pic_align = alignattop!
  271. boolean border = false
  272. end type
  273. event clicked;call super::clicked;
  274. IF Not f_power_ind(1535) THEN
  275. MessageBox(publ_operator,"你没有权限")
  276. RETURN
  277. END IF
  278. IF MessageBox("IF","你是否要将工价表单价|指令单工价更新到未审核的计件单单价? ~n注意,更新后不能逆向操作!",Exclamation!, OKCancel!, 2) = 2 THEN RETURN
  279. String arg_msg
  280. IF ddlb_type.Text = '产品个人工序计件单' THEN
  281. IF wf_update_taskwork(arg_msg) = 0 THEN
  282. MessageBox('Error',arg_msg)
  283. RETURN
  284. ELSE
  285. MessageBox('提示','更新成功,请核对')
  286. cb_1.TriggerEvent(Clicked!)
  287. END IF
  288. ELSEIF ddlb_type.Text = '个人产品工序计件单' THEN
  289. IF wf_update_person(arg_msg) = 0 THEN
  290. MessageBox('Error',arg_msg)
  291. RETURN
  292. ELSE
  293. MessageBox('提示','更新成功,请核对')
  294. cb_1.TriggerEvent(Clicked!)
  295. END IF
  296. END IF
  297. end event
  298. type cb_4 from uo_imflatbutton within w_pmod_taskwork_workprice
  299. integer x = 576
  300. integer width = 357
  301. integer height = 164
  302. integer taborder = 50
  303. boolean bringtotop = true
  304. string text = "查看工价表"
  305. string normalpicname = "find.bmp"
  306. integer picsize = 16
  307. toolbaralignment pic_align = alignattop!
  308. boolean border = false
  309. end type
  310. event clicked;call super::clicked;Long ll_row
  311. String ls_mtrlcode
  312. ll_row = dw_1.GetRow()
  313. IF ll_row <= 0 THEN
  314. MessageBox(publ_operator,'请选择产品')
  315. RETURN
  316. END IF
  317. ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[ll_row]
  318. s_edit_index_tran s_tran
  319. s_tran.arg_string_code = ls_mtrlcode
  320. s_tran.if_retrieve_all = local_retrieve_all
  321. OpenWithParm(w_sc_workpricetable,s_tran)
  322. end event
  323. type ddlb_type from dropdownlistbox within w_pmod_taskwork_workprice
  324. integer x = 2395
  325. integer y = 32
  326. integer width = 718
  327. integer height = 412
  328. integer taborder = 130
  329. boolean bringtotop = true
  330. integer textsize = -9
  331. integer weight = 400
  332. fontcharset fontcharset = gb2312charset!
  333. fontpitch fontpitch = variable!
  334. string facename = "宋体"
  335. long textcolor = 33554432
  336. string text = "产品个人工序计件单"
  337. boolean sorted = false
  338. boolean vscrollbar = true
  339. string item[] = {"产品个人工序计件单","个人产品工序计件单"}
  340. borderstyle borderstyle = stylelowered!
  341. end type
  342. event selectionchanged;dw_1.uf_save_profile_layout()
  343. IF This.Text = '产品个人工序计件单' THEN
  344. dw_1.DataObject = 'dw_pmod_sc_taskwork_workprice'
  345. ELSEIF This.Text = '个人产品工序计件单' THEN
  346. dw_1.DataObject = 'dw_pmod_scwg_taskwork_2_person_workprice'
  347. END IF
  348. dw_1.SetTransObject(sqlca)
  349. dw_1.ins_INIfile_name = sys_inifilename
  350. dw_1.ins_opemp = publ_operator
  351. dw_1.cardw_empid = sys_empid
  352. dw_1.cur_DataObject = dw_1.DataObject
  353. dw_1.uf_read_profile_layout()
  354. cb_1.TriggerEvent(Clicked!)
  355. end event
  356. type ddlb_1 from dropdownlistbox within w_pmod_taskwork_workprice
  357. integer x = 1838
  358. integer y = 196
  359. integer width = 1865
  360. integer height = 300
  361. integer taborder = 130
  362. boolean bringtotop = true
  363. integer textsize = -9
  364. integer weight = 400
  365. fontcharset fontcharset = gb2312charset!
  366. fontpitch fontpitch = variable!
  367. string facename = "宋体"
  368. long textcolor = 33554432
  369. string text = "显示计件单价与工价表不相同的计件明细"
  370. boolean sorted = false
  371. string item[] = {"显示计件单价与工价表不相同的计件明细","显示全部"}
  372. borderstyle borderstyle = stylelowered!
  373. end type
  374. event selectionchanged;cb_1.TriggerEvent(Clicked!)
  375. end event