w_company_ch_mutil.srw 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. $PBExportHeader$w_company_ch_mutil.srw
  2. forward
  3. global type w_company_ch_mutil from w_publ_base_style
  4. end type
  5. type cb_refresh from uo_imflatbutton within w_company_ch_mutil
  6. end type
  7. type cb_select from uo_imflatbutton within w_company_ch_mutil
  8. end type
  9. type dw_company_choose from u_dw_rbtnfilter within w_company_ch_mutil
  10. end type
  11. type cbx_1 from checkbox within w_company_ch_mutil
  12. end type
  13. end forward
  14. global type w_company_ch_mutil from w_publ_base_style
  15. integer width = 3607
  16. integer height = 2436
  17. string title = "公司选择"
  18. boolean minbox = false
  19. windowtype windowtype = response!
  20. cb_refresh cb_refresh
  21. cb_select cb_select
  22. dw_company_choose dw_company_choose
  23. cbx_1 cbx_1
  24. end type
  25. global w_company_ch_mutil w_company_ch_mutil
  26. type variables
  27. s_edit_index_tran s_rslt
  28. end variables
  29. forward prototypes
  30. public subroutine wf_retrieve_company ()
  31. end prototypes
  32. public subroutine wf_retrieve_company ();string arg_msg
  33. long i,row
  34. oleobject request,response,mxs,item
  35. request = FXAppCom.CreatePbDictionary()
  36. request.SetString('token', app_token_fx)
  37. request.SetInt('userid', 0)
  38. response = FXAppCom.DoExecute('GetCompanyRange', request)
  39. arg_msg = response.GetString('ErrMsg')
  40. if (arg_msg <> '') then
  41. messagebox('提示', '获取订单明细失败,原因:' + arg_msg)
  42. return
  43. end if
  44. dw_company_choose.Reset()
  45. dw_company_choose.SetRedraw(false)
  46. mxs = response.GetArrOfPBDictionary('companies')
  47. Datetime ld_now,requiredate
  48. ld_now = DateTime(Today(),Now())
  49. for i = 1 to mxs.Count
  50. item = mxs.GetItem(i - 1)
  51. row = dw_company_choose.InsertRow(0)
  52. dw_company_choose.SetItem(row, 'comid', item.GetInt('comid'))
  53. dw_company_choose.SetItem(row, 'fx_company_comname', item.GetString('comname'))
  54. dw_company_choose.SetItem(row, 'fx_company_simplename', item.GetString('simplename'))
  55. dw_company_choose.SetItem(row, 'fx_company_tele', item.GetString('tele'))
  56. dw_company_choose.SetItem(row, 'fx_company_address', item.GetString('address'))
  57. dw_company_choose.SetItem(row, 'fx_relation_relcode', item.GetString('relcode'))
  58. dw_company_choose.SetItem(row, 'fx_company_fx_title_erp', item.GetString('fx_title_erp'))
  59. next
  60. dw_company_choose.SetRedraw(true)
  61. end subroutine
  62. on w_company_ch_mutil.create
  63. int iCurrent
  64. call super::create
  65. this.cb_refresh=create cb_refresh
  66. this.cb_select=create cb_select
  67. this.dw_company_choose=create dw_company_choose
  68. this.cbx_1=create cbx_1
  69. iCurrent=UpperBound(this.Control)
  70. this.Control[iCurrent+1]=this.cb_refresh
  71. this.Control[iCurrent+2]=this.cb_select
  72. this.Control[iCurrent+3]=this.dw_company_choose
  73. this.Control[iCurrent+4]=this.cbx_1
  74. end on
  75. on w_company_ch_mutil.destroy
  76. call super::destroy
  77. destroy(this.cb_refresh)
  78. destroy(this.cb_select)
  79. destroy(this.dw_company_choose)
  80. destroy(this.cbx_1)
  81. end on
  82. event resize;call super::resize;r_bar.height = this.height
  83. dw_company_choose.width = this.workspacewidth()
  84. dw_company_choose.height = this.workspaceheight() - dw_company_choose.y
  85. end event
  86. event open;call super::open;s_rslt.b_long = 0
  87. wf_movetocenter()
  88. wf_retrieve_company()
  89. end event
  90. event close;call super::close;closewithreturn(this, s_rslt)
  91. end event
  92. type cb_func from w_publ_base_style`cb_func within w_company_ch_mutil
  93. boolean visible = false
  94. end type
  95. type cb_exit from w_publ_base_style`cb_exit within w_company_ch_mutil
  96. integer x = 315
  97. end type
  98. type ln_bar from w_publ_base_style`ln_bar within w_company_ch_mutil
  99. end type
  100. type ln_bar2 from w_publ_base_style`ln_bar2 within w_company_ch_mutil
  101. end type
  102. type r_bar from w_publ_base_style`r_bar within w_company_ch_mutil
  103. end type
  104. type cb_refresh from uo_imflatbutton within w_company_ch_mutil
  105. integer width = 151
  106. integer height = 164
  107. integer taborder = 10
  108. boolean bringtotop = true
  109. string text = "刷新"
  110. string normalpicname = "refresh.bmp"
  111. integer picsize = 16
  112. toolbaralignment pic_align = alignattop!
  113. boolean border = false
  114. end type
  115. event clicked;call super::clicked;wf_retrieve_company()
  116. end event
  117. type cb_select from uo_imflatbutton within w_company_ch_mutil
  118. integer x = 151
  119. integer width = 165
  120. integer height = 164
  121. integer taborder = 10
  122. boolean bringtotop = true
  123. string text = "选定"
  124. string normalpicname = "ok.bmp"
  125. integer picsize = 16
  126. toolbaralignment pic_align = alignattop!
  127. boolean border = false
  128. end type
  129. event clicked;call super::clicked;
  130. long i, cnt = 0
  131. long arr_comid[]
  132. for i = 1 to dw_company_choose.RowCount()
  133. if dw_company_choose.Object.ch[i] = 0 then continue
  134. cnt++
  135. arr_comid[cnt] = dw_company_choose.Object.comid[i]
  136. next
  137. if cnt = 0 then
  138. MessageBox('提示', '请先选择要操作的公司!')
  139. return
  140. end if
  141. s_rslt.arr_long = arr_comid
  142. s_rslt.b_long = 1
  143. Close(PARENT)
  144. end event
  145. type dw_company_choose from u_dw_rbtnfilter within w_company_ch_mutil
  146. integer y = 180
  147. integer width = 3593
  148. integer height = 2180
  149. integer taborder = 20
  150. boolean bringtotop = true
  151. string dataobject = "dw_company_ch_mutil"
  152. boolean hscrollbar = true
  153. boolean vscrollbar = true
  154. boolean rbutton_filter_use = true
  155. boolean rbutton_setposition_use = true
  156. boolean titleclick_sort_use = true
  157. end type
  158. event clicked;call super::clicked;IF (row > 0) THEN
  159. THIS.SetRow(row)
  160. THIS.SelectRow(0, FALSE)
  161. THIS.SelectRow(row, TRUE)
  162. END IF
  163. end event
  164. type cbx_1 from checkbox within w_company_ch_mutil
  165. integer x = 622
  166. integer y = 52
  167. integer width = 457
  168. integer height = 96
  169. boolean bringtotop = true
  170. integer textsize = -9
  171. integer weight = 400
  172. fontcharset fontcharset = gb2312charset!
  173. fontpitch fontpitch = variable!
  174. string facename = "宋体"
  175. long textcolor = 16711680
  176. long backcolor = 67108864
  177. string text = "全选/全不选"
  178. end type
  179. event constructor;this.backcolor = 14215660
  180. end event
  181. event clicked;Long ll_check
  182. IF This.Checked THEN
  183. ll_check = 1
  184. ELSE
  185. ll_check = 0
  186. END IF
  187. long i
  188. for i = 1 to dw_company_choose.RowCount()
  189. dw_company_choose.Object.ch[i] = ll_check
  190. next
  191. end event