w_oppose_cust_ch.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. $PBExportHeader$w_oppose_cust_ch.srw
  2. forward
  3. global type w_oppose_cust_ch from w_publ_choice
  4. end type
  5. type st_2 from statictext within w_oppose_cust_ch
  6. end type
  7. type st_4 from statictext within w_oppose_cust_ch
  8. end type
  9. type em_1 from editmask within w_oppose_cust_ch
  10. end type
  11. type em_2 from editmask within w_oppose_cust_ch
  12. end type
  13. type pb_em1 from picturebutton within w_oppose_cust_ch
  14. end type
  15. type pb_em2 from picturebutton within w_oppose_cust_ch
  16. end type
  17. type pb_2 from picturebutton within w_oppose_cust_ch
  18. end type
  19. end forward
  20. global type w_oppose_cust_ch from w_publ_choice
  21. integer width = 3584
  22. integer height = 1836
  23. string title = "客户投诉单选择"
  24. event ue_date1 ( )
  25. event ue_date2 ( )
  26. event ue_date3 ( )
  27. event ue_date4 ( )
  28. st_2 st_2
  29. st_4 st_4
  30. em_1 em_1
  31. em_2 em_2
  32. pb_em1 pb_em1
  33. pb_em2 pb_em2
  34. pb_2 pb_2
  35. end type
  36. global w_oppose_cust_ch w_oppose_cust_ch
  37. type variables
  38. s_oppose_cust_ch s_rslt
  39. end variables
  40. forward prototypes
  41. public function integer days_in_month (integer month, integer year)
  42. end prototypes
  43. event ue_date1();//IF THIS.Text = "本日" THEN
  44. em_1.text = string(today(),"yyyy-mm-dd")
  45. em_2.text = string(today(),"yyyy-mm-dd")
  46. //ELSEIF THIS.Text = "本周" THEN
  47. // int li_DayNum
  48. // li_DayNum = DayNumber(today())
  49. // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  50. // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  51. //ELSEIF THIS.Text = "本月" THEN
  52. // int li_Month, li_Year, li_Days
  53. // li_Month = Month(today())
  54. // li_Year = Year(today())
  55. // li_Days = days_in_month(li_Month, li_Year)
  56. // em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  57. // em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  58. //END IF
  59. end event
  60. event ue_date2();//IF THIS.Text = "本日" THEN
  61. // em_1.text = string(today(),"yyyy-mm-dd")
  62. // em_2.text = string(today(),"yyyy-mm-dd")
  63. //ELSEIF THIS.Text = "本周" THEN
  64. int li_DayNum
  65. li_DayNum = DayNumber(today())
  66. em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  67. em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  68. //ELSEIF THIS.Text = "本月" THEN
  69. // int li_Month, li_Year, li_Days
  70. // li_Month = Month(today())
  71. // li_Year = Year(today())
  72. // li_Days = days_in_month(li_Month, li_Year)
  73. // em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  74. // em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  75. //END IF
  76. end event
  77. event ue_date3();//IF THIS.Text = "本日" THEN
  78. // em_1.text = string(today(),"yyyy-mm-dd")
  79. // em_2.text = string(today(),"yyyy-mm-dd")
  80. //ELSEIF THIS.Text = "本周" THEN
  81. // int li_DayNum
  82. // li_DayNum = DayNumber(today())
  83. // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  84. // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  85. //ELSEIF THIS.Text = "本月" THEN
  86. int li_Month, li_Year, li_Days
  87. li_Month = Month(today())
  88. li_Year = Year(today())
  89. li_Days = days_in_month(li_Month, li_Year)
  90. em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  91. em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  92. //END IF
  93. end event
  94. event ue_date4();//IF THIS.Text = "本日" THEN
  95. // em_1.text = string(today(),"yyyy-mm-dd")
  96. // em_2.text = string(today(),"yyyy-mm-dd")
  97. //ELSEIF THIS.Text = "本周" THEN
  98. // int li_DayNum
  99. // li_DayNum = DayNumber(today())
  100. // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  101. // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  102. //ELSEIF THIS.Text = "本月" THEN
  103. Int li_Month, li_Year, li_Days
  104. li_Month = Month(Today())
  105. li_Year = Year(Today())
  106. IF li_Month = 1 THEN
  107. li_Month = 12
  108. li_Year = li_Year - 1
  109. ELSE
  110. li_Month -= 1
  111. END IF
  112. li_Days = days_in_month(li_Month, li_Year)
  113. em_1.Text = String(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  114. em_2.Text = String(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  115. //END IF
  116. end event
  117. public function integer days_in_month (integer month, integer year);//Most cases are straight forward in that there are a fixed number of
  118. //days in 11 of the 12 months. February is, of course, the problem.
  119. //In a leap year February has 29 days, otherwise 28.
  120. Integer li_DaysInMonth, li_Days[12] = {31,28,31,30,31,30,31,31,30,31,30,31}
  121. // Get the number of days per month for a non leap year.
  122. li_DaysInMonth = li_Days[Month]
  123. // Check for a leap year.
  124. If Month = 2 Then
  125. // If the year is a leap year, change the number of days.
  126. // Leap Year Calculation:
  127. // Year divisible by 4, but not by 100, unless it is also divisible by 400
  128. If ( (Mod(Year,4) = 0 And Mod(Year,100) <> 0) Or (Mod(Year,400) = 0) ) Then
  129. li_DaysInMonth = 29
  130. End If
  131. End If
  132. //Return the number of days in the relevant month
  133. Return li_DaysInMonth
  134. end function
  135. on w_oppose_cust_ch.create
  136. int iCurrent
  137. call super::create
  138. this.st_2=create st_2
  139. this.st_4=create st_4
  140. this.em_1=create em_1
  141. this.em_2=create em_2
  142. this.pb_em1=create pb_em1
  143. this.pb_em2=create pb_em2
  144. this.pb_2=create pb_2
  145. iCurrent=UpperBound(this.Control)
  146. this.Control[iCurrent+1]=this.st_2
  147. this.Control[iCurrent+2]=this.st_4
  148. this.Control[iCurrent+3]=this.em_1
  149. this.Control[iCurrent+4]=this.em_2
  150. this.Control[iCurrent+5]=this.pb_em1
  151. this.Control[iCurrent+6]=this.pb_em2
  152. this.Control[iCurrent+7]=this.pb_2
  153. end on
  154. on w_oppose_cust_ch.destroy
  155. call super::destroy
  156. destroy(this.st_2)
  157. destroy(this.st_4)
  158. destroy(this.em_1)
  159. destroy(this.em_2)
  160. destroy(this.pb_em1)
  161. destroy(this.pb_em2)
  162. destroy(this.pb_2)
  163. end on
  164. event resize;call super::resize;dw_ch.Width = this.workspacewidth() - dw_ch.x
  165. dw_ch.height = this.workspacewidth() - dw_ch.y
  166. end event
  167. event ue_before_open;call super::ue_before_open;triggerevent('ue_date1')
  168. end event
  169. event open;call super::open;s_rslt.billid = 0
  170. end event
  171. event close;call super::close;closewithreturn(this, s_rslt)
  172. end event
  173. type cb_func from w_publ_choice`cb_func within w_oppose_cust_ch
  174. end type
  175. type cb_exit from w_publ_choice`cb_exit within w_oppose_cust_ch
  176. end type
  177. type sle_ch from w_publ_choice`sle_ch within w_oppose_cust_ch
  178. integer x = 567
  179. end type
  180. type dw_ch from w_publ_choice`dw_ch within w_oppose_cust_ch
  181. string dataobject = "dw_oppsoe_cust_ch"
  182. end type
  183. type st_1 from w_publ_choice`st_1 within w_oppose_cust_ch
  184. integer width = 535
  185. string text = "物料编码/单据编码含"
  186. end type
  187. type cb_retrieve from w_publ_choice`cb_retrieve within w_oppose_cust_ch
  188. end type
  189. event cb_retrieve::clicked;String ls_query
  190. ls_query = sle_ch.Text
  191. IF Pos(ls_query, '%') <= 0 THEN
  192. ls_query = '%' + ls_query + '%'
  193. END IF
  194. DateTime ld_begin, ld_end
  195. ld_begin = DateTime(Date(em_1.Text), Time(0))
  196. ld_end = DateTime(Date(em_2.Text), Time('23:59:59'))
  197. dw_ch.Retrieve(ls_query, ld_begin, ld_end)
  198. end event
  199. type cb_choice from w_publ_choice`cb_choice within w_oppose_cust_ch
  200. end type
  201. event cb_choice::clicked;call super::clicked;LONG LS_ROW
  202. LS_ROW=dw_CH.getrow()
  203. if LS_ROW<=0 then
  204. messagebox('系统提示','请先选择目标行!',StopSign!)
  205. return
  206. end if
  207. s_rslt.billid=dw_CH.OBJECT.billid[LS_ROW]
  208. s_rslt.billcode = dw_ch.Object.billcode[LS_ROW]
  209. CLOSE(PARENT)
  210. end event
  211. type ln_bar from w_publ_choice`ln_bar within w_oppose_cust_ch
  212. end type
  213. type ln_bar2 from w_publ_choice`ln_bar2 within w_oppose_cust_ch
  214. end type
  215. type r_bar from w_publ_choice`r_bar within w_oppose_cust_ch
  216. end type
  217. type ln_1 from w_publ_choice`ln_1 within w_oppose_cust_ch
  218. end type
  219. type ln_2 from w_publ_choice`ln_2 within w_oppose_cust_ch
  220. end type
  221. type st_2 from statictext within w_oppose_cust_ch
  222. integer x = 1125
  223. integer y = 208
  224. integer width = 251
  225. integer height = 48
  226. boolean bringtotop = true
  227. integer textsize = -9
  228. integer weight = 400
  229. fontcharset fontcharset = gb2312charset!
  230. fontpitch fontpitch = variable!
  231. string facename = "宋体"
  232. long textcolor = 33554432
  233. long backcolor = 134217739
  234. string text = "投诉日期"
  235. boolean focusrectangle = false
  236. end type
  237. type st_4 from statictext within w_oppose_cust_ch
  238. integer x = 1861
  239. integer y = 196
  240. integer width = 105
  241. integer height = 60
  242. boolean bringtotop = true
  243. integer textsize = -9
  244. integer weight = 400
  245. fontcharset fontcharset = gb2312charset!
  246. fontpitch fontpitch = variable!
  247. string facename = "宋体"
  248. long textcolor = 33554432
  249. long backcolor = 134217739
  250. boolean enabled = false
  251. string text = "到:"
  252. alignment alignment = right!
  253. boolean focusrectangle = false
  254. end type
  255. type em_1 from editmask within w_oppose_cust_ch
  256. integer x = 1353
  257. integer y = 180
  258. integer width = 407
  259. integer height = 88
  260. integer taborder = 110
  261. boolean bringtotop = true
  262. integer textsize = -9
  263. integer weight = 400
  264. fontcharset fontcharset = gb2312charset!
  265. fontpitch fontpitch = variable!
  266. string facename = "宋体"
  267. long textcolor = 33554432
  268. borderstyle borderstyle = stylelowered!
  269. maskdatatype maskdatatype = datemask!
  270. string mask = "yyyy-mm-dd"
  271. boolean spin = true
  272. end type
  273. event rbuttondown;s_calender_arg s_calender
  274. s_calender.PointerX = THIS.PointerX()
  275. s_calender.PointerY = THIS.PointerY()
  276. s_calender.X = THIS.X
  277. s_calender.Y = THIS.Y
  278. OpenWithParm(w_calendar,s_calender)
  279. THIS.Text = String(id_date_selected)
  280. end event
  281. type em_2 from editmask within w_oppose_cust_ch
  282. integer x = 1966
  283. integer y = 180
  284. integer width = 407
  285. integer height = 88
  286. integer taborder = 120
  287. boolean bringtotop = true
  288. integer textsize = -9
  289. integer weight = 400
  290. fontcharset fontcharset = gb2312charset!
  291. fontpitch fontpitch = variable!
  292. string facename = "宋体"
  293. long textcolor = 33554432
  294. borderstyle borderstyle = stylelowered!
  295. maskdatatype maskdatatype = datemask!
  296. string mask = "yyyy-mm-dd"
  297. boolean spin = true
  298. end type
  299. event rbuttondown;s_calender_arg s_calender
  300. s_calender.PointerX = THIS.PointerX()
  301. s_calender.PointerY = THIS.PointerY()
  302. s_calender.X = THIS.X
  303. s_calender.Y = THIS.Y
  304. OpenWithParm(w_calendar,s_calender)
  305. THIS.Text = String(id_date_selected)
  306. end event
  307. type pb_em1 from picturebutton within w_oppose_cust_ch
  308. integer x = 1769
  309. integer y = 180
  310. integer width = 101
  311. integer height = 92
  312. integer taborder = 120
  313. boolean bringtotop = true
  314. integer textsize = -9
  315. integer weight = 400
  316. fontcharset fontcharset = gb2312charset!
  317. fontpitch fontpitch = variable!
  318. string facename = "宋体"
  319. string picturename = "date.BMP"
  320. alignment htextalign = left!
  321. end type
  322. event clicked;em_1.triggerevent(rbuttondown!)
  323. end event
  324. type pb_em2 from picturebutton within w_oppose_cust_ch
  325. integer x = 2382
  326. integer y = 180
  327. integer width = 101
  328. integer height = 92
  329. integer taborder = 130
  330. boolean bringtotop = true
  331. integer textsize = -9
  332. integer weight = 400
  333. fontcharset fontcharset = gb2312charset!
  334. fontpitch fontpitch = variable!
  335. string facename = "宋体"
  336. string picturename = "date.BMP"
  337. alignment htextalign = left!
  338. end type
  339. event clicked;em_2.triggerevent(rbuttondown!)
  340. end event
  341. type pb_2 from picturebutton within w_oppose_cust_ch
  342. integer x = 2491
  343. integer y = 180
  344. integer width = 101
  345. integer height = 92
  346. integer taborder = 140
  347. boolean bringtotop = true
  348. integer textsize = -9
  349. integer weight = 400
  350. fontcharset fontcharset = gb2312charset!
  351. fontpitch fontpitch = variable!
  352. string facename = "宋体"
  353. string picturename = "date1.BMP"
  354. alignment htextalign = left!
  355. end type
  356. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  357. string menustr
  358. menustr="Text=本日~tEvent=ue_date1"
  359. menustr = menustr + "|" + "Text=本周~tEvent=ue_date2"
  360. menustr = menustr + "|" + "Text=本月~tEvent=ue_date3"
  361. menustr = menustr + "|" + "Text=上月~tEvent=ue_date4"
  362. if len(trim(menustr))<>0 then
  363. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  364. dmPopupMenu.mf_BuildMenu(This, menustr)
  365. dmPopupMenu.mf_PopMenu()
  366. Destroy dmPopupMenu
  367. end if
  368. end event