w_cd_saletask_bj.srw 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. $PBExportHeader$w_cd_saletask_bj.srw
  2. forward
  3. global type w_cd_saletask_bj from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_cd_saletask_bj
  6. end type
  7. type cb_1 from uo_imflatbutton within w_cd_saletask_bj
  8. end type
  9. type dw_2 from datawindow within w_cd_saletask_bj
  10. end type
  11. type cb_2 from uo_imflatbutton within w_cd_saletask_bj
  12. end type
  13. end forward
  14. global type w_cd_saletask_bj from w_publ_base
  15. integer width = 2793
  16. integer height = 1872
  17. string title = "询价订单"
  18. boolean minbox = false
  19. windowtype windowtype = response!
  20. dw_1 dw_1
  21. cb_1 cb_1
  22. dw_2 dw_2
  23. cb_2 cb_2
  24. end type
  25. global w_cd_saletask_bj w_cd_saletask_bj
  26. type variables
  27. end variables
  28. on w_cd_saletask_bj.create
  29. int iCurrent
  30. call super::create
  31. this.dw_1=create dw_1
  32. this.cb_1=create cb_1
  33. this.dw_2=create dw_2
  34. this.cb_2=create cb_2
  35. iCurrent=UpperBound(this.Control)
  36. this.Control[iCurrent+1]=this.dw_1
  37. this.Control[iCurrent+2]=this.cb_1
  38. this.Control[iCurrent+3]=this.dw_2
  39. this.Control[iCurrent+4]=this.cb_2
  40. end on
  41. on w_cd_saletask_bj.destroy
  42. call super::destroy
  43. destroy(this.dw_1)
  44. destroy(this.cb_1)
  45. destroy(this.dw_2)
  46. destroy(this.cb_2)
  47. end on
  48. event open;call super::open;// DONE: 显示待报价订单信息
  49. oleobject lo_dict
  50. lo_dict = Message.PowerObjectParm
  51. Long row
  52. row = dw_1.InsertRow(0)
  53. dw_1.SetItem(row, 'taskid', lo_dict.GetInt('taskid'))
  54. dw_1.SetItem(row, 'tid', lo_dict.GetString('tid'))
  55. dw_1.SetItem(row, 'taskdate', lo_dict.GetDateTime('taskdate'))
  56. dw_1.SetItem(row, 'cusid', lo_dict.GetInt('cusid'))
  57. dw_1.SetItem(row, 'cus_rep', lo_dict.GetString('cus_rep'))
  58. dw_1.SetItem(row, 'cus_tele', lo_dict.GetString('cus_tele'))
  59. dw_1.SetItem(row, 'cus_address', lo_dict.GetString('cus_address'))
  60. dw_1.SetItem(row, 'freight', lo_dict.GetString('freight'))
  61. dw_1.SetItem(row, 'freight_tele', lo_dict.GetString('freight_tele'))
  62. dw_1.SetItem(row, 'opemp', lo_dict.GetString('opemp'))
  63. dw_1.SetItem(row, 'opdate', lo_dict.GetDateTime('opdate'))
  64. dw_1.SetItem(row, 'modemp', lo_dict.GetString('modemp'))
  65. dw_1.SetItem(row, 'moddate', lo_dict.GetDateTime('moddate'))
  66. dw_1.SetItem(row, 'buyer_name', lo_dict.GetString('buyer_name'))
  67. dw_1.SetItem(row, 'buyer_tele', lo_dict.GetString('buyer_tele'))
  68. dw_1.SetItem(row, 'requiredate', lo_dict.GetDateTime('requiredate'))
  69. dw_1.SetItem(row, 'temp1', lo_dict.GetString('temp1'))
  70. dw_1.SetItem(row, 'temp2', lo_dict.GetString('temp2'))
  71. dw_1.SetItem(row, 'temp3', lo_dict.GetString('temp3'))
  72. dw_1.SetItem(row, 'temp4', lo_dict.GetString('temp4'))
  73. dw_1.SetItem(row, 'temp5', lo_dict.GetString('temp5'))
  74. dw_1.SetItem(row, 'temp6', lo_dict.GetString('temp6'))
  75. dw_1.SetItem(row, 'confirmemp', lo_dict.GetString('confirmemp'))
  76. dw_1.SetItem(row, 'confirmdate', lo_dict.GetDateTime('confirmdate'))
  77. dw_1.SetItem(row, 'status', lo_dict.GetString('status'))
  78. dw_1.SetItem(row, 'taskcode', lo_dict.GetString('taskcode'))
  79. dw_1.SetItem(row, 'outwarecode', lo_dict.GetString('outwarecode'))
  80. dw_1.SetItem(row, 'cuscode', lo_dict.GetString('cuscode'))
  81. dw_1.SetItem(row, 'cusname', lo_dict.GetString('cusname'))
  82. dw_1.SetItem(row, 'price_emp', publ_operator)
  83. dw_1.SetItem(row, 'replyrqdate', lo_dict.GetDateTime('requiredate'))
  84. dw_1.SetItem(row, 'replydscrp', '')
  85. string arg_msg = ''
  86. oleobject parms, lo_rslt, lo_item
  87. parms = AppCom.CreatePbDictionary()
  88. parms.SetString('token', app_token)
  89. parms.SetInt('taskid', lo_dict.GetInt('taskid'))
  90. lo_rslt = AppCom.GetTaskFJs(parms, ref arg_msg)
  91. if arg_msg <> '' then
  92. MessageBox('ERROR', arg_msg)
  93. return
  94. end if
  95. long ll_cnt, i
  96. ll_cnt = lo_rslt.Count
  97. dw_2.SetRedraw(false)
  98. for i = 1 to ll_cnt
  99. lo_item = lo_rslt.GetItem(i - 1)
  100. row = dw_2.InsertRow(0)
  101. dw_2.SetItem(row, 'taskid', lo_item.GetInt('taskid'))
  102. dw_2.SetItem(row, 'printid', lo_item.GetInt('printid'))
  103. dw_2.SetItem(row, 'mxcode', lo_item.GetString('mxcode'))
  104. dw_2.SetItem(row, 'price_ls', lo_item.GetDouble('price_ls'))
  105. dw_2.SetItem(row, 'price_jm', lo_item.GetDouble('price_jm'))
  106. dw_2.SetItem(row, 'mtrltype', lo_item.GetString('mtrltype'))
  107. dw_2.SetItem(row, 'fjname', lo_item.GetString('fjname'))
  108. dw_2.SetItem(row, 'fjdscrp', lo_item.GetString('fjdscrp'))
  109. next
  110. dw_2.SetRedraw(true)
  111. end event
  112. type cb_func from w_publ_base`cb_func within w_cd_saletask_bj
  113. boolean visible = false
  114. integer x = 23
  115. integer y = 892
  116. end type
  117. type cb_exit from w_publ_base`cb_exit within w_cd_saletask_bj
  118. integer x = 2437
  119. integer y = 1660
  120. end type
  121. type dw_1 from datawindow within w_cd_saletask_bj
  122. integer width = 2770
  123. integer height = 1640
  124. integer taborder = 10
  125. boolean bringtotop = true
  126. string title = "none"
  127. string dataobject = "dw_cd_saletask_bj"
  128. boolean livescroll = true
  129. borderstyle borderstyle = stylelowered!
  130. end type
  131. type cb_1 from uo_imflatbutton within w_cd_saletask_bj
  132. integer x = 2048
  133. integer y = 1660
  134. integer width = 370
  135. integer taborder = 20
  136. boolean bringtotop = true
  137. string text = "报价"
  138. string normalpicname = "ok.bmp"
  139. end type
  140. event clicked;call super::clicked;dw_1.AcceptText()
  141. dw_2.AcceptText()
  142. Long i
  143. FOR i = 1 To dw_2.RowCount()
  144. IF dw_2.Object.price_jm[i] <= 0 THEN
  145. MessageBox('提示', '明细报价必须为正数')
  146. dw_2.SetRow(i)
  147. dw_2.SetFocus()
  148. RETURN
  149. END IF
  150. NEXT
  151. oleobject parms
  152. parms = AppCom.CreatePbDictionary()
  153. parms.SetString('token', app_token)
  154. parms.SetInt('taskid', dw_1.Object.taskid[1])
  155. parms.SetString('price_emp', publ_operator)
  156. parms.SetDateTime('replyrqdate', dw_1.Object.replyrqdate[1])
  157. parms.SetString('replydscrp', dw_1.Object.replydscrp[1])
  158. oleobject fj, fjs
  159. fjs = AppCom.CreArrOfPbDictionary()
  160. for i = 1 to dw_2.RowCount()
  161. fj = AppCom.CreatePbDictionary()
  162. fj.SetInt('printid', dw_2.Object.printid[i])
  163. fj.SetDouble('price_jm', dw_2.Object.price_jm[i])
  164. fjs.Add(fj)
  165. next
  166. parms.SetObject('fjs', fjs)
  167. string arg_msg = ''
  168. AppCom.TaskBJ(parms, ref arg_msg)
  169. if arg_msg <> '' then
  170. MessageBox('ERROR', arg_msg)
  171. return
  172. end if
  173. MessageBox('OK', '订单报价成功')
  174. close(parent)
  175. end event
  176. type dw_2 from datawindow within w_cd_saletask_bj
  177. integer x = 23
  178. integer y = 672
  179. integer width = 2670
  180. integer height = 308
  181. integer taborder = 20
  182. boolean bringtotop = true
  183. string title = "none"
  184. string dataobject = "dw_cd_saletask_bj_fj"
  185. boolean hscrollbar = true
  186. boolean vscrollbar = true
  187. boolean livescroll = true
  188. borderstyle borderstyle = stylelowered!
  189. end type
  190. type cb_2 from uo_imflatbutton within w_cd_saletask_bj
  191. integer x = 219
  192. integer y = 1660
  193. integer width = 370
  194. integer taborder = 30
  195. boolean bringtotop = true
  196. string text = "退回"
  197. string normalpicname = "UNDO.bmp"
  198. end type
  199. event clicked;call super::clicked;dw_1.AcceptText()
  200. dw_2.AcceptText()
  201. oleobject parms
  202. parms = AppCom.CreatePbDictionary()
  203. parms.SetString('token', app_token)
  204. parms.SetInt('taskid', dw_1.Object.taskid[1])
  205. parms.SetString('price_emp', publ_operator)
  206. parms.SetString('replydscrp', dw_1.Object.replydscrp[1])
  207. string arg_msg = ''
  208. AppCom.TaskTH(parms, ref arg_msg)
  209. if arg_msg <> '' then
  210. MessageBox('ERROR', arg_msg)
  211. return
  212. end if
  213. MessageBox('OK', '订单退回成功')
  214. close(parent)
  215. end event