w_spt_ecomm_edit.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. $PBExportHeader$w_spt_ecomm_edit.srw
  2. forward
  3. global type w_spt_ecomm_edit from w_publ_easyq
  4. end type
  5. type cbx_1 from checkbox within w_spt_ecomm_edit
  6. end type
  7. type cb_save from uo_imflatbutton within w_spt_ecomm_edit
  8. end type
  9. type cb_edit from uo_imflatbutton within w_spt_ecomm_edit
  10. end type
  11. type cb_p from uo_imflatbutton within w_spt_ecomm_edit
  12. end type
  13. type dw_2 from u_dw_rbtnfilter within w_spt_ecomm_edit
  14. end type
  15. end forward
  16. global type w_spt_ecomm_edit from w_publ_easyq
  17. string title = "供应商电子商务设置"
  18. event ue_p_check ( )
  19. event ue_p_nocheck ( )
  20. cbx_1 cbx_1
  21. cb_save cb_save
  22. cb_edit cb_edit
  23. cb_p cb_p
  24. dw_2 dw_2
  25. end type
  26. global w_spt_ecomm_edit w_spt_ecomm_edit
  27. type variables
  28. int ins_spttypeid
  29. end variables
  30. forward prototypes
  31. public function integer wf_face ()
  32. end prototypes
  33. event ue_p_check();IF MessageBox(publ_operator,'是否要确定要批设定限价', question!, YesNo!, 2) = 2 THEN
  34. RETURN
  35. END IF
  36. Long ll_i
  37. dw_1.AcceptText()
  38. dw_1.SetRedraw(False)
  39. FOR ll_i = 1 To dw_1.RowCount()
  40. dw_1.Object.u_spt_ifnocheck[ll_i] = 0
  41. NEXT
  42. dw_1.SetRedraw(True)
  43. end event
  44. event ue_p_nocheck();IF MessageBox(publ_operator,'是否要确定要批设定不限价', question!, YesNo!, 2) = 2 THEN
  45. RETURN
  46. END IF
  47. Long ll_i
  48. dw_1.AcceptText()
  49. dw_1.SetRedraw(False)
  50. FOR ll_i = 1 To dw_1.RowCount()
  51. dw_1.Object.u_spt_ifnocheck[ll_i] = 1
  52. NEXT
  53. dw_1.SetRedraw(True)
  54. end event
  55. public function integer wf_face ();cb_1.Enabled = Not dw_edit_mode
  56. cb_save.Enabled = dw_edit_mode
  57. cb_p.Enabled = dw_edit_mode
  58. cb_func.Enabled = Not dw_edit_mode
  59. cb_psetup.Enabled = Not dw_edit_mode
  60. cb_2.Enabled = Not dw_edit_mode
  61. cbx_yl.Enabled = Not dw_edit_mode
  62. cbx_1.Enabled = Not dw_edit_mode
  63. Int ls_i
  64. IF dw_edit_mode THEN
  65. dw_1.SetTabOrder('u_spt_ifecomm',10)
  66. dw_1.SetTabOrder('u_spt_commsccode',20)
  67. cb_edit.Text = '放弃'
  68. cb_edit.normalpicname = 'Undo.bmp'
  69. ELSE
  70. dw_1.SetTabOrder('u_spt_ifecomm',0)
  71. dw_1.SetTabOrder('u_spt_commsccode',0)
  72. cb_edit.Text = '修改'
  73. cb_edit.normalpicname = 'OPEN.bmp'
  74. END IF
  75. cb_edit.of_init_draw()
  76. cb_edit.of_paint()
  77. cb_edit.TriggerEvent('ue_textchange')
  78. RETURN 1
  79. end function
  80. on w_spt_ecomm_edit.create
  81. int iCurrent
  82. call super::create
  83. this.cbx_1=create cbx_1
  84. this.cb_save=create cb_save
  85. this.cb_edit=create cb_edit
  86. this.cb_p=create cb_p
  87. this.dw_2=create dw_2
  88. iCurrent=UpperBound(this.Control)
  89. this.Control[iCurrent+1]=this.cbx_1
  90. this.Control[iCurrent+2]=this.cb_save
  91. this.Control[iCurrent+3]=this.cb_edit
  92. this.Control[iCurrent+4]=this.cb_p
  93. this.Control[iCurrent+5]=this.dw_2
  94. end on
  95. on w_spt_ecomm_edit.destroy
  96. call super::destroy
  97. destroy(this.cbx_1)
  98. destroy(this.cb_save)
  99. destroy(this.cb_edit)
  100. destroy(this.cb_p)
  101. destroy(this.dw_2)
  102. end on
  103. event resize;ln_bar.EndX = This.Width
  104. ln_bar2.EndX = This.Width
  105. ln_1.EndX = This.Width
  106. ln_2.EndX = This.Width
  107. r_bar.Width = This.Width
  108. dw_1.Width = This.Width - dw_1.X - 40
  109. dw_1.Height = This.Height - dw_1.Y - 150
  110. dw_2.height = dw_1.height
  111. end event
  112. event open;call super::open;dw_2.retrieve()
  113. cb_1.triggerevent(clicked!)
  114. end event
  115. event ue_before_open;call super::ue_before_open;if_ue_retr = TRUE
  116. if_ue_filter = TRUE
  117. if_ue_sort = TRUE
  118. if_ue_sentdataout = TRUE
  119. dw_2.settransobject(sqlca)
  120. end event
  121. type cb_func from w_publ_easyq`cb_func within w_spt_ecomm_edit
  122. integer x = 457
  123. end type
  124. type cb_exit from w_publ_easyq`cb_exit within w_spt_ecomm_edit
  125. integer x = 759
  126. end type
  127. type cb_2 from w_publ_easyq`cb_2 within w_spt_ecomm_edit
  128. integer x = 1847
  129. integer y = 468
  130. integer width = 165
  131. integer taborder = 100
  132. boolean bringtotop = true
  133. end type
  134. type cb_psetup from w_publ_easyq`cb_psetup within w_spt_ecomm_edit
  135. integer x = 1723
  136. integer y = 444
  137. boolean bringtotop = true
  138. end type
  139. type cb_1 from w_publ_easyq`cb_1 within w_spt_ecomm_edit
  140. boolean bringtotop = true
  141. end type
  142. event cb_1::clicked;call super::clicked;Int li_isuse
  143. IF cbx_1.Checked THEN
  144. li_isuse = 1
  145. ELSE
  146. li_isuse = -1
  147. END IF
  148. dw_1.Retrieve(li_isuse,sys_user_spttype,ins_spttypeid)
  149. end event
  150. type st_3 from w_publ_easyq`st_3 within w_spt_ecomm_edit
  151. boolean visible = false
  152. integer x = 1641
  153. integer y = 648
  154. end type
  155. type st_4 from w_publ_easyq`st_4 within w_spt_ecomm_edit
  156. boolean visible = false
  157. integer x = 1655
  158. integer y = 552
  159. end type
  160. type em_1 from w_publ_easyq`em_1 within w_spt_ecomm_edit
  161. boolean visible = false
  162. integer x = 1221
  163. integer y = 480
  164. integer taborder = 110
  165. end type
  166. type em_2 from w_publ_easyq`em_2 within w_spt_ecomm_edit
  167. boolean visible = false
  168. integer x = 1275
  169. integer y = 448
  170. integer taborder = 140
  171. end type
  172. type ddlb_yl from w_publ_easyq`ddlb_yl within w_spt_ecomm_edit
  173. integer x = 1723
  174. integer y = 584
  175. end type
  176. type cbx_yl from w_publ_easyq`cbx_yl within w_spt_ecomm_edit
  177. integer x = 1792
  178. integer y = 444
  179. end type
  180. type dw_1 from w_publ_easyq`dw_1 within w_spt_ecomm_edit
  181. integer x = 809
  182. integer y = 288
  183. integer width = 2898
  184. integer height = 1332
  185. string dataobject = "dw_spt_ecomm_edit"
  186. end type
  187. event dw_1::clicked;call super::clicked;
  188. IF row > 0 THEN
  189. THIS.SelectRow(0,FALSE)
  190. THIS.SetRow(row)
  191. THIS.SelectRow(row,TRUE)
  192. END IF
  193. end event
  194. event dw_1::doubleclicked;call super::doubleclicked;IF Not dw_edit_mode THEN RETURN
  195. Long ll_row
  196. ll_row = dw_1.GetRow()
  197. IF ll_row <= 0 THEN RETURN
  198. OpenWithParm(w_cuscomm_list_ch,1)
  199. s_cuscomm_ljfieb INS_RT_STRU
  200. INS_RT_STRU = Message.PowerObjectParm
  201. dw_1.Object.u_spt_ifecomm[ll_row] = 1
  202. dw_1.Object.u_spt_commcode[ll_row] = INS_RT_STRU.CusCode
  203. dw_1.accepttext()
  204. end event
  205. type sle_mtrl from w_publ_easyq`sle_mtrl within w_spt_ecomm_edit
  206. end type
  207. type sle_cust from w_publ_easyq`sle_cust within w_spt_ecomm_edit
  208. end type
  209. type st_mtrl from w_publ_easyq`st_mtrl within w_spt_ecomm_edit
  210. end type
  211. type st_cust from w_publ_easyq`st_cust within w_spt_ecomm_edit
  212. end type
  213. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_spt_ecomm_edit
  214. end type
  215. type pb_em1 from w_publ_easyq`pb_em1 within w_spt_ecomm_edit
  216. boolean visible = false
  217. end type
  218. type pb_em2 from w_publ_easyq`pb_em2 within w_spt_ecomm_edit
  219. boolean visible = false
  220. end type
  221. type pb_2 from w_publ_easyq`pb_2 within w_spt_ecomm_edit
  222. boolean visible = false
  223. end type
  224. type cb_help from w_publ_easyq`cb_help within w_spt_ecomm_edit
  225. integer x = 608
  226. end type
  227. type cb_copyself from w_publ_easyq`cb_copyself within w_spt_ecomm_edit
  228. boolean visible = false
  229. end type
  230. type gb_1 from w_publ_easyq`gb_1 within w_spt_ecomm_edit
  231. integer x = 1463
  232. integer y = 476
  233. integer width = 183
  234. end type
  235. type ln_bar from w_publ_easyq`ln_bar within w_spt_ecomm_edit
  236. end type
  237. type ln_bar2 from w_publ_easyq`ln_bar2 within w_spt_ecomm_edit
  238. end type
  239. type r_bar from w_publ_easyq`r_bar within w_spt_ecomm_edit
  240. integer x = 2455
  241. integer y = 28
  242. end type
  243. type ln_1 from w_publ_easyq`ln_1 within w_spt_ecomm_edit
  244. integer beginy = 280
  245. integer endy = 280
  246. end type
  247. type ln_2 from w_publ_easyq`ln_2 within w_spt_ecomm_edit
  248. integer beginy = 284
  249. integer endy = 284
  250. end type
  251. type ln_3 from w_publ_easyq`ln_3 within w_spt_ecomm_edit
  252. boolean visible = false
  253. end type
  254. type ln_4 from w_publ_easyq`ln_4 within w_spt_ecomm_edit
  255. boolean visible = false
  256. end type
  257. type cbx_1 from checkbox within w_spt_ecomm_edit
  258. integer x = 23
  259. integer y = 200
  260. integer width = 402
  261. integer height = 60
  262. boolean bringtotop = true
  263. integer textsize = -9
  264. integer weight = 400
  265. fontcharset fontcharset = gb2312charset!
  266. fontpitch fontpitch = variable!
  267. string facename = "宋体"
  268. long textcolor = 33554432
  269. long backcolor = 134217739
  270. string text = "只显示有效"
  271. boolean checked = true
  272. end type
  273. event clicked;cb_1.triggerevent(clicked!)
  274. end event
  275. type cb_save from uo_imflatbutton within w_spt_ecomm_edit
  276. integer x = 151
  277. integer width = 151
  278. integer height = 164
  279. integer taborder = 30
  280. boolean bringtotop = true
  281. boolean enabled = false
  282. string text = "保存"
  283. string normalpicname = "save.bmp"
  284. integer picsize = 16
  285. toolbaralignment pic_align = alignattop!
  286. boolean border = false
  287. end type
  288. event clicked;call super::clicked;
  289. IF NOT f_power_ind(1563) THEN
  290. MessageBox(publ_operator,sys_msg_pow)
  291. RETURN
  292. END IF
  293. Long ll_cnt
  294. Long ll_i
  295. String commcode,commsccode
  296. //dw_1.AcceptText()
  297. //
  298. //
  299. FOR ll_i = 1 To dw_1.RowCount()
  300. IF dw_1.Object.u_spt_ifecomm[ll_i] = 0 THEN
  301. dw_1.Object.u_spt_commcode[ll_i] = ''
  302. dw_1.Object.u_spt_commsccode[ll_i] = ''
  303. CONTINUE
  304. END IF
  305. // commcode = dw_1.Object.u_spt_commcode[ll_i]
  306. // commsccode = dw_1.Object.u_spt_commsccode[ll_i]
  307. //
  308. // IF Trim(commcode) = '' THEN
  309. // MessageBox('Error','供应商:'+String(dw_1.Object.sptcode[ll_i])+',使用电子商务功能,请选择对应的企业编号')
  310. // RETURN
  311. // END IF
  312. //
  313. // SELECT count(*)
  314. // INTO :ll_cnt
  315. // FROM u_spt
  316. // WHERE commcode = :commcode
  317. // And commsccode = :commsccode;
  318. // IF sqlca.SQLCode <> 0 THEN
  319. // MessageBox('Error','供应商:'+String(dw_1.Object.sptcode[ll_i])+',查询企业编号是否有重复失败,'+sqlca.SQLErrText)
  320. // RETURN
  321. // END IF
  322. //
  323. // IF ll_cnt > 1 THEN
  324. // MessageBox('系统提示','企业代码:'+commcode+',分部代号:'+commsccode+',已被使用,不能重复指定')
  325. // RETURN
  326. // END IF
  327. NEXT
  328. dw_1.AcceptText()
  329. IF dw_1.Update() <> 1 THEN
  330. ROLLBACK;
  331. MessageBox('提示','保存失败')
  332. RETURN
  333. END IF
  334. COMMIT;
  335. string arg_msg
  336. f_setsysoplog('供应商电子商务属性修改','供应商电子商务属性修改',arg_msg,true)
  337. MessageBox('提示','保存成功!')
  338. dw_edit_mode = NOT dw_edit_mode
  339. wf_face()
  340. cb_1.TriggerEvent(Clicked!)
  341. end event
  342. type cb_edit from uo_imflatbutton within w_spt_ecomm_edit
  343. integer x = 302
  344. integer width = 151
  345. integer height = 164
  346. integer taborder = 50
  347. boolean bringtotop = true
  348. string text = "修改"
  349. string normalpicname = "open.bmp"
  350. integer picsize = 16
  351. toolbaralignment pic_align = alignattop!
  352. boolean border = false
  353. end type
  354. event clicked;call super::clicked;IF sys_email_sqlca.DBHandle() = 0 THEN
  355. MessageBox('Error','电子商务数据库连接失败,请检查')
  356. RETURN
  357. END IF
  358. IF Not f_power_ind(1563) THEN
  359. MessageBox(publ_operator,sys_msg_pow)
  360. RETURN
  361. END IF
  362. Long ll_row_cnt
  363. ll_row_cnt = dw_1.RowCount()
  364. IF ll_row_cnt <= 0 THEN
  365. MessageBox('系统提示','没有可修改的资料!')
  366. RETURN
  367. END IF
  368. dw_edit_mode = Not dw_edit_mode
  369. wf_face()
  370. end event
  371. type cb_p from uo_imflatbutton within w_spt_ecomm_edit
  372. boolean visible = false
  373. integer x = 453
  374. integer width = 219
  375. integer height = 164
  376. integer taborder = 40
  377. boolean bringtotop = true
  378. boolean enabled = false
  379. string text = "批设置"
  380. string normalpicname = "open.bmp"
  381. integer picsize = 16
  382. toolbaralignment pic_align = alignattop!
  383. boolean border = false
  384. end type
  385. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  386. String menustr
  387. menustr = "Text=批设限价~tEvent=ue_p_check"
  388. menustr = menustr + "|" + "Text=-"
  389. menustr = menustr + "|" + "Text=批设不限价~tEvent=ue_p_nocheck"
  390. IF Len(Trim(menustr)) <> 0 THEN
  391. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  392. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  393. dmPopupMenu.mf_PopMenu()
  394. DESTROY dmPopupMenu
  395. END IF
  396. end event
  397. type dw_2 from u_dw_rbtnfilter within w_spt_ecomm_edit
  398. integer y = 288
  399. integer width = 809
  400. integer height = 1340
  401. integer taborder = 90
  402. boolean bringtotop = true
  403. string dataobject = "dw_spttype_index"
  404. boolean hscrollbar = true
  405. boolean vscrollbar = true
  406. end type
  407. event rowfocuschanged;call super::rowfocuschanged;IF dw_edit_mode THEN RETURN
  408. IF dw_2.GetRow() <= 0 THEN
  409. ins_spttypeid = 0
  410. ELSE
  411. ins_spttypeid = dw_2.Object.spttypeid[dw_2.GetRow()]
  412. END IF
  413. IF currentrow > 0 THEN
  414. THIS.SelectRow(0,FALSE)
  415. THIS.SelectRow(currentrow,TRUE)
  416. END IF
  417. cb_1.triggerevent(clicked!)
  418. end event
  419. event rowfocuschanging;call super::rowfocuschanging;IF dw_edit_mode THEN RETURN
  420. end event