w_outware_barcode_ch.srw 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. $PBExportHeader$w_outware_barcode_ch.srw
  2. forward
  3. global type w_outware_barcode_ch from w_publ_choice
  4. end type
  5. type cbx_all from checkbox within w_outware_barcode_ch
  6. end type
  7. end forward
  8. global type w_outware_barcode_ch from w_publ_choice
  9. cbx_all cbx_all
  10. end type
  11. global w_outware_barcode_ch w_outware_barcode_ch
  12. type variables
  13. s_edit_index_tran s_tran
  14. end variables
  15. on w_outware_barcode_ch.create
  16. int iCurrent
  17. call super::create
  18. this.cbx_all=create cbx_all
  19. iCurrent=UpperBound(this.Control)
  20. this.Control[iCurrent+1]=this.cbx_all
  21. end on
  22. on w_outware_barcode_ch.destroy
  23. call super::destroy
  24. destroy(this.cbx_all)
  25. end on
  26. event dw_filter;call super::dw_filter;Int rslt = 1
  27. dw_ch.Reset()
  28. String arg_msg,barcode
  29. barcode = sle_ch.Text
  30. oleobject req, rsp
  31. req = FXAppCom.CreatePbDictionary()
  32. req.SetString('token', app_token_fx)
  33. req.SetString('barcode', barcode)
  34. rsp = FXAppCom.DoExecute('GetFxSaletaskBuyBarcode', req)
  35. arg_msg = rsp.GetString('ErrMsg')
  36. If (arg_msg <> '') Then
  37. rslt = 0
  38. MessageBox('提示', '获取条码失败:' + arg_msg)
  39. Return
  40. End If
  41. oleobject list, Item
  42. list = rsp.GetPBArray('barcodeList')
  43. dw_ch.SetRedraw(False)
  44. Long i, row
  45. For i = 1 To list.Count
  46. Item = list.GetPBDictionary(i - 1)
  47. row = dw_ch.InsertRow(0)
  48. dw_ch.SetItem(row, 'taskid', Item.GetInt('taskid'))
  49. dw_ch.SetItem(row, 'printid', Item.GetInt('printid'))
  50. dw_ch.SetItem(row, 'barcode', Item.GetString('barcode'))
  51. dw_ch.SetItem(row, 'taskcode', Item.GetString('taskcode'))
  52. dw_ch.SetItem(row, 'mtrlcode', Item.GetString('mtrlcode'))
  53. dw_ch.SetItem(row, 'mtrlname', Item.GetString('mtrlname'))
  54. dw_ch.SetItem(row, 'mtrlmode', Item.GetString('mtrlmode'))
  55. dw_ch.SetItem(row, 'status', Item.GetString('status'))
  56. dw_ch.SetItem(row, 'woodcode', Item.GetString('woodcode'))
  57. dw_ch.SetItem(row, 'pcode', Item.GetString('pcode'))
  58. dw_ch.SetItem(row, 'qty', Item.GetInt('qty'))
  59. dw_ch.SetItem(row, 'printnum', Item.GetInt('printnum'))
  60. dw_ch.SetItem(row, 'packqty', Item.GetDouble('packqty'))
  61. Next
  62. dw_ch.SetRedraw(True)
  63. end event
  64. event close;call super::close;CloseWithReturn(this, s_tran)
  65. end event
  66. event open;cb_retrieve.TRIGGEREVENT(CLICKED!)
  67. end event
  68. type cb_func from w_publ_choice`cb_func within w_outware_barcode_ch
  69. boolean visible = false
  70. end type
  71. type cb_exit from w_publ_choice`cb_exit within w_outware_barcode_ch
  72. integer x = 306
  73. end type
  74. type sle_ch from w_publ_choice`sle_ch within w_outware_barcode_ch
  75. end type
  76. type dw_ch from w_publ_choice`dw_ch within w_outware_barcode_ch
  77. integer width = 2153
  78. integer height = 1416
  79. string dataobject = "dw_fx_saletask_buy_barcode"
  80. end type
  81. event dw_ch::doubleclicked;return
  82. end event
  83. type st_1 from w_publ_choice`st_1 within w_outware_barcode_ch
  84. string text = "条码号"
  85. end type
  86. type cb_retrieve from w_publ_choice`cb_retrieve within w_outware_barcode_ch
  87. end type
  88. event cb_retrieve::clicked;Int rslt = 1
  89. dw_ch.Reset()
  90. String arg_msg
  91. oleobject req, rsp
  92. req = FXAppCom.CreatePbDictionary()
  93. req.SetString('token', app_token_fx)
  94. rsp = FXAppCom.DoExecute('GetFxSaletaskBuyBarcode', req)
  95. arg_msg = rsp.GetString('ErrMsg')
  96. If (arg_msg <> '') Then
  97. rslt = 0
  98. MessageBox('提示', '获取条码失败:' + arg_msg)
  99. return
  100. End If
  101. oleobject list, Item
  102. list = rsp.GetPBArray('barcodeList')
  103. dw_ch.SetRedraw(False)
  104. Long i, row
  105. For i = 1 To list.Count
  106. Item = list.GetPBDictionary(i - 1)
  107. row = dw_ch.InsertRow(0)
  108. dw_ch.SetItem(row, 'taskid', Item.GetInt('taskid'))
  109. dw_ch.SetItem(row, 'printid', Item.GetInt('printid'))
  110. dw_ch.SetItem(row, 'barcode', Item.GetString('barcode'))
  111. dw_ch.SetItem(row, 'taskcode', Item.GetString('taskcode'))
  112. dw_ch.SetItem(row, 'mtrlcode', Item.GetString('mtrlcode'))
  113. dw_ch.SetItem(row, 'mtrlname', Item.GetString('mtrlname'))
  114. dw_ch.SetItem(row, 'mtrlmode', Item.GetString('mtrlmode'))
  115. dw_ch.SetItem(row, 'status', Item.GetString('status'))
  116. dw_ch.SetItem(row, 'woodcode', Item.GetString('woodcode'))
  117. dw_ch.SetItem(row, 'pcode', Item.GetString('pcode'))
  118. dw_ch.SetItem(row, 'qty', Item.GetInt('qty'))
  119. dw_ch.SetItem(row, 'printnum', Item.GetInt('printnum'))
  120. dw_ch.SetItem(row, 'packqty', Item.GetDouble('packqty'))
  121. Next
  122. dw_ch.SetRedraw(True)
  123. end event
  124. type cb_choice from w_publ_choice`cb_choice within w_outware_barcode_ch
  125. integer x = 155
  126. end type
  127. event cb_choice::clicked;call super::clicked;Long ll_row,i,j
  128. ll_row = dw_ch.RowCount()
  129. j = 0
  130. For i = 1 To ll_row
  131. If dw_ch.Object.ch[i] = 1 Then
  132. j++
  133. s_tran.arr_string[j] = dw_ch.Object.barcode[i]
  134. End If
  135. Next
  136. Close(parent)
  137. end event
  138. type ln_bar from w_publ_choice`ln_bar within w_outware_barcode_ch
  139. end type
  140. type ln_bar2 from w_publ_choice`ln_bar2 within w_outware_barcode_ch
  141. end type
  142. type r_bar from w_publ_choice`r_bar within w_outware_barcode_ch
  143. end type
  144. type ln_1 from w_publ_choice`ln_1 within w_outware_barcode_ch
  145. end type
  146. type ln_2 from w_publ_choice`ln_2 within w_outware_barcode_ch
  147. end type
  148. type cbx_all from checkbox within w_outware_barcode_ch
  149. integer x = 759
  150. integer y = 200
  151. integer width = 261
  152. integer height = 60
  153. boolean bringtotop = true
  154. integer textsize = -9
  155. integer weight = 400
  156. fontcharset fontcharset = gb2312charset!
  157. fontpitch fontpitch = variable!
  158. string facename = "宋体"
  159. long textcolor = 33554432
  160. long backcolor = 134217739
  161. string text = "全选"
  162. end type
  163. event clicked;Long ll_i
  164. dw_ch.SetRedraw(FALSE)
  165. FOR ll_i = 1 TO dw_ch.RowCount()
  166. IF THIS.Checked THEN
  167. dw_ch.Object.ch[ll_i] = 1
  168. ELSE
  169. dw_ch.Object.ch[ll_i] = 0
  170. END IF
  171. NEXT
  172. dw_ch.SetRedraw(TRUE)
  173. end event