w_taobao_sku.srw 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. $PBExportHeader$w_taobao_sku.srw
  2. forward
  3. global type w_taobao_sku from w_publ_base_style
  4. end type
  5. type cb_reflash from uo_imflatbutton within w_taobao_sku
  6. end type
  7. type dw_1 from u_dw_rbtnfilter within w_taobao_sku
  8. end type
  9. type cb_edit from uo_imflatbutton within w_taobao_sku
  10. end type
  11. type cb_del from uo_imflatbutton within w_taobao_sku
  12. end type
  13. end forward
  14. global type w_taobao_sku from w_publ_base_style
  15. integer width = 3739
  16. integer height = 2040
  17. string title = "淘宝sku配置设置"
  18. boolean maxbox = true
  19. boolean resizable = true
  20. windowstate windowstate = maximized!
  21. cb_reflash cb_reflash
  22. dw_1 dw_1
  23. cb_edit cb_edit
  24. cb_del cb_del
  25. end type
  26. global w_taobao_sku w_taobao_sku
  27. type variables
  28. long ins_child = 4
  29. long ins_child_min = 1
  30. end variables
  31. forward prototypes
  32. public subroutine wf_face ()
  33. public function integer wf_save (ref string arg_msg, ref long rt_row)
  34. end prototypes
  35. public subroutine wf_face ();long i
  36. cb_reflash.Enabled = not dw_edit_mode
  37. cb_del.Enabled = dw_edit_mode
  38. IF dw_edit_mode THEN
  39. FOR i = 1 To ins_child
  40. dw_1.SetTabOrder(i, i * 10)
  41. NEXT
  42. cb_edit.Text = '保存'
  43. cb_edit.normalpicname = 'Save.bmp'
  44. ELSE
  45. FOR i = 1 To ins_child_min - 1
  46. dw_1.SetTabOrder(i, i * 10)
  47. NEXT
  48. FOR i = ins_child_min To ins_child
  49. dw_1.SetTabOrder(i, 0)
  50. NEXT
  51. cb_edit.Text = '修改'
  52. cb_edit.normalpicname = 'OPEN.bmp'
  53. END IF
  54. cb_edit.of_init_draw()
  55. cb_edit.of_paint()
  56. cb_edit.TriggerEvent('ue_textchange')
  57. end subroutine
  58. public function integer wf_save (ref string arg_msg, ref long rt_row);Int rslt = 1
  59. Long i
  60. String ls_skuid, ls_outer_status, ls_outer_woodcode, ls_outer_pcode
  61. long ll_fetchflag
  62. FOR i = 1 To dw_1.RowCount()
  63. ls_skuid = dw_1.Object.tb_sku_sku_id[i]
  64. ls_outer_status = dw_1.Object.tb_sku_outer_status[i]
  65. ls_outer_woodcode = dw_1.Object.tb_sku_outer_woodcode[i]
  66. ls_outer_pcode = dw_1.Object.tb_sku_outer_pcode[i]
  67. ll_fetchflag = dw_1.Object.tb_sku_fetchflag[i]
  68. UPDATE tb_sku SET
  69. outer_status = :ls_outer_status,
  70. outer_woodcode = :ls_outer_woodcode,
  71. outer_pcode = :ls_outer_pcode,
  72. fetchflag = :ll_fetchflag
  73. Where sku_id = :ls_skuid;
  74. IF sqlca.SQLCode <> 0 THEN
  75. rt_row = i
  76. rslt = 0
  77. arg_msg = '第'+string(i)+'行,更新淘宝sku配置信息失败,' + sqlca.SQLErrText
  78. GOTO ext
  79. END IF
  80. NEXT
  81. ext:
  82. IF rslt = 1 THEN
  83. COMMIT;
  84. ELSE
  85. ROLLBACK;
  86. END IF
  87. return rslt
  88. end function
  89. on w_taobao_sku.create
  90. int iCurrent
  91. call super::create
  92. this.cb_reflash=create cb_reflash
  93. this.dw_1=create dw_1
  94. this.cb_edit=create cb_edit
  95. this.cb_del=create cb_del
  96. iCurrent=UpperBound(this.Control)
  97. this.Control[iCurrent+1]=this.cb_reflash
  98. this.Control[iCurrent+2]=this.dw_1
  99. this.Control[iCurrent+3]=this.cb_edit
  100. this.Control[iCurrent+4]=this.cb_del
  101. end on
  102. on w_taobao_sku.destroy
  103. call super::destroy
  104. destroy(this.cb_reflash)
  105. destroy(this.dw_1)
  106. destroy(this.cb_edit)
  107. destroy(this.cb_del)
  108. end on
  109. event ue_before_open;call super::ue_before_open;dw_1.SetTransObject(sqlca)
  110. end event
  111. event open;call super::open;cb_reflash.TriggerEvent(clicked!)
  112. end event
  113. event resize;call super::resize;dw_1.width = this.workspacewidth() - dw_1.x
  114. dw_1.Height = this.workspaceheight() - dw_1.Y
  115. end event
  116. type cb_func from w_publ_base_style`cb_func within w_taobao_sku
  117. integer x = 453
  118. end type
  119. type cb_exit from w_publ_base_style`cb_exit within w_taobao_sku
  120. integer x = 603
  121. end type
  122. type ln_bar from w_publ_base_style`ln_bar within w_taobao_sku
  123. end type
  124. type ln_bar2 from w_publ_base_style`ln_bar2 within w_taobao_sku
  125. end type
  126. type r_bar from w_publ_base_style`r_bar within w_taobao_sku
  127. end type
  128. type cb_reflash from uo_imflatbutton within w_taobao_sku
  129. integer width = 151
  130. integer height = 164
  131. integer taborder = 40
  132. boolean bringtotop = true
  133. string text = "刷新"
  134. string normalpicname = "refresh.BMP"
  135. integer picsize = 16
  136. toolbaralignment pic_align = alignattop!
  137. boolean border = false
  138. end type
  139. event clicked;call super::clicked;dw_1.Retrieve()
  140. end event
  141. type dw_1 from u_dw_rbtnfilter within w_taobao_sku
  142. event ue_dwndropdown pbm_dwndropdown
  143. integer y = 184
  144. integer width = 3314
  145. integer height = 1640
  146. integer taborder = 30
  147. boolean bringtotop = true
  148. string dataobject = "dw_taobao_sku"
  149. boolean hscrollbar = true
  150. boolean vscrollbar = true
  151. boolean hsplitscroll = true
  152. boolean rbutton_filter_use = true
  153. boolean rbutton_setposition_use = true
  154. boolean titleclick_sort_use = true
  155. end type
  156. event ue_dwndropdown;IF Not dw_edit_mode THEN RETURN
  157. String ls_col_pz,ls_col_mtrlid
  158. String ls_pz_ch
  159. String ls_col_value
  160. String ls_data_type
  161. Long ll_row,ll_mtrlid
  162. s_pzwin_open arg_s_win
  163. ll_row = This.GetRow()
  164. IF ll_row > 0 THEN
  165. ls_col_mtrlid = "u_mtrldef_mtrlid"//This.Describe("#1.Name")
  166. IF Not Pos(Lower(ls_col_mtrlid),'mtrlid') > 0 THEN RETURN
  167. ll_mtrlid = This.GetItemNumber(ll_row,ls_col_mtrlid)
  168. if isnull(ll_mtrlid) then return
  169. ls_col_pz = This.GetColumnName( )
  170. ls_data_type = This.Describe(ls_col_pz+".ColType")
  171. IF Pos(Lower(ls_data_type),"char") > 0 THEN
  172. ls_col_value = This.GetItemString(ll_row,ls_col_pz)
  173. END IF
  174. arg_s_win.arg_x = This.X + This.PointerX() + Parent.X
  175. arg_s_win.arg_y = This.Y + This.PointerY() + Parent.Y
  176. arg_s_win.arg_col = ls_col_pz
  177. arg_s_win.arg_mtrlid = ll_mtrlid
  178. arg_s_win.arg_col_value = ls_col_value
  179. ls_pz_ch = f_mtrl_pz(arg_s_win)
  180. IF IsNull(ls_pz_ch) Or ls_pz_ch = '' THEN RETURN
  181. This.SetItem(ll_row,ls_col_pz,ls_pz_ch)
  182. END IF
  183. end event
  184. event clicked;call super::clicked;IF row > 0 THEN
  185. This.SetRow(row)
  186. this.selectrow(row, true)
  187. END IF
  188. end event
  189. event rowfocuschanged;call super::rowfocuschanged;This.SelectRow(0, False)
  190. Long row
  191. row = This.GetRow()
  192. IF row > 0 THEN
  193. This.SelectRow(row, True)
  194. END IF
  195. end event
  196. type cb_edit from uo_imflatbutton within w_taobao_sku
  197. integer x = 151
  198. integer width = 151
  199. integer height = 164
  200. integer taborder = 50
  201. boolean bringtotop = true
  202. string text = "修改"
  203. string normalpicname = "open.BMP"
  204. integer picsize = 16
  205. toolbaralignment pic_align = alignattop!
  206. boolean border = false
  207. end type
  208. event clicked;call super::clicked;IF Not uo_power_spi.f_taobao_sku_edit(sys_msg_pow) THEN
  209. MessageBox(publ_operator,sys_msg_pow)
  210. RETURN
  211. END IF
  212. String arg_msg
  213. Long ll_row
  214. IF dw_edit_mode THEN
  215. dw_1.AcceptText()
  216. IF wf_save(arg_msg, ll_row) <> 1 THEN
  217. dw_1.ScrollToRow(ll_row)
  218. MessageBox('ERROR', arg_msg)
  219. RETURN
  220. END IF
  221. END IF
  222. dw_edit_mode = Not dw_edit_mode
  223. wf_face()
  224. end event
  225. type cb_del from uo_imflatbutton within w_taobao_sku
  226. integer x = 302
  227. integer width = 151
  228. integer height = 164
  229. integer taborder = 20
  230. boolean bringtotop = true
  231. boolean enabled = false
  232. string text = "放弃"
  233. string normalpicname = "Undo.bmp"
  234. integer picsize = 16
  235. toolbaralignment pic_align = alignattop!
  236. boolean border = false
  237. end type
  238. event clicked;call super::clicked;String ls_msg
  239. IF dw_edit_mode THEN
  240. dw_edit_mode = Not dw_edit_mode
  241. cb_reflash.TriggerEvent(Clicked!)
  242. wf_face()
  243. END IF
  244. end event