w_outware_scll_cmpmtrl.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. $PBExportHeader$w_outware_scll_cmpmtrl.srw
  2. forward
  3. global type w_outware_scll_cmpmtrl from window
  4. end type
  5. type st_5 from statictext within w_outware_scll_cmpmtrl
  6. end type
  7. type sle_cusname from singlelineedit within w_outware_scll_cmpmtrl
  8. end type
  9. type cb_2 from uo_imflatbutton within w_outware_scll_cmpmtrl
  10. end type
  11. type sle_cuscode from singlelineedit within w_outware_scll_cmpmtrl
  12. end type
  13. type st_4 from statictext within w_outware_scll_cmpmtrl
  14. end type
  15. type cb_ok from uo_imflatbutton within w_outware_scll_cmpmtrl
  16. end type
  17. type cb_exit from uo_imflatbutton within w_outware_scll_cmpmtrl
  18. end type
  19. type st_unit from statictext within w_outware_scll_cmpmtrl
  20. end type
  21. type sle_qty from singlelineedit within w_outware_scll_cmpmtrl
  22. end type
  23. type st_3 from statictext within w_outware_scll_cmpmtrl
  24. end type
  25. type cb_1 from uo_imflatbutton within w_outware_scll_cmpmtrl
  26. end type
  27. type st_2 from statictext within w_outware_scll_cmpmtrl
  28. end type
  29. type sle_mtrlname from singlelineedit within w_outware_scll_cmpmtrl
  30. end type
  31. type sle_mtrlcode from singlelineedit within w_outware_scll_cmpmtrl
  32. end type
  33. type st_1 from statictext within w_outware_scll_cmpmtrl
  34. end type
  35. end forward
  36. global type w_outware_scll_cmpmtrl from window
  37. integer width = 2139
  38. integer height = 860
  39. boolean titlebar = true
  40. string title = "领料计算"
  41. boolean controlmenu = true
  42. windowtype windowtype = response!
  43. long backcolor = 67108864
  44. string icon = "AppIcon!"
  45. boolean center = true
  46. st_5 st_5
  47. sle_cusname sle_cusname
  48. cb_2 cb_2
  49. sle_cuscode sle_cuscode
  50. st_4 st_4
  51. cb_ok cb_ok
  52. cb_exit cb_exit
  53. st_unit st_unit
  54. sle_qty sle_qty
  55. st_3 st_3
  56. cb_1 cb_1
  57. st_2 st_2
  58. sle_mtrlname sle_mtrlname
  59. sle_mtrlcode sle_mtrlcode
  60. st_1 st_1
  61. end type
  62. global w_outware_scll_cmpmtrl w_outware_scll_cmpmtrl
  63. type variables
  64. long cur_mtrlid
  65. long cur_cusid
  66. s_rqmtrl s_mtrl
  67. end variables
  68. on w_outware_scll_cmpmtrl.create
  69. this.st_5=create st_5
  70. this.sle_cusname=create sle_cusname
  71. this.cb_2=create cb_2
  72. this.sle_cuscode=create sle_cuscode
  73. this.st_4=create st_4
  74. this.cb_ok=create cb_ok
  75. this.cb_exit=create cb_exit
  76. this.st_unit=create st_unit
  77. this.sle_qty=create sle_qty
  78. this.st_3=create st_3
  79. this.cb_1=create cb_1
  80. this.st_2=create st_2
  81. this.sle_mtrlname=create sle_mtrlname
  82. this.sle_mtrlcode=create sle_mtrlcode
  83. this.st_1=create st_1
  84. this.Control[]={this.st_5,&
  85. this.sle_cusname,&
  86. this.cb_2,&
  87. this.sle_cuscode,&
  88. this.st_4,&
  89. this.cb_ok,&
  90. this.cb_exit,&
  91. this.st_unit,&
  92. this.sle_qty,&
  93. this.st_3,&
  94. this.cb_1,&
  95. this.st_2,&
  96. this.sle_mtrlname,&
  97. this.sle_mtrlcode,&
  98. this.st_1}
  99. end on
  100. on w_outware_scll_cmpmtrl.destroy
  101. destroy(this.st_5)
  102. destroy(this.sle_cusname)
  103. destroy(this.cb_2)
  104. destroy(this.sle_cuscode)
  105. destroy(this.st_4)
  106. destroy(this.cb_ok)
  107. destroy(this.cb_exit)
  108. destroy(this.st_unit)
  109. destroy(this.sle_qty)
  110. destroy(this.st_3)
  111. destroy(this.cb_1)
  112. destroy(this.st_2)
  113. destroy(this.sle_mtrlname)
  114. destroy(this.sle_mtrlcode)
  115. destroy(this.st_1)
  116. end on
  117. event open;cur_mtrlid = 0
  118. cur_cusid = 0
  119. end event
  120. event close;s_mtrl.mtrlid = cur_mtrlid
  121. s_mtrl.qty = dec(sle_qty.text)
  122. s_mtrl.cusid = cur_cusid
  123. closewithreturn(this,s_mtrl)
  124. end event
  125. type st_5 from statictext within w_outware_scll_cmpmtrl
  126. integer x = 128
  127. integer y = 156
  128. integer width = 242
  129. integer height = 60
  130. integer textsize = -9
  131. integer weight = 400
  132. fontcharset fontcharset = gb2312charset!
  133. fontpitch fontpitch = variable!
  134. string facename = "宋体"
  135. long textcolor = 33554432
  136. long backcolor = 67108864
  137. string text = "客户名称"
  138. alignment alignment = right!
  139. boolean focusrectangle = false
  140. end type
  141. type sle_cusname from singlelineedit within w_outware_scll_cmpmtrl
  142. integer x = 389
  143. integer y = 136
  144. integer width = 1605
  145. integer height = 84
  146. integer taborder = 20
  147. integer textsize = -9
  148. integer weight = 400
  149. fontcharset fontcharset = gb2312charset!
  150. fontpitch fontpitch = variable!
  151. string facename = "宋体"
  152. long textcolor = 33554432
  153. end type
  154. type cb_2 from uo_imflatbutton within w_outware_scll_cmpmtrl
  155. integer x = 1097
  156. integer y = 4
  157. integer width = 293
  158. integer height = 92
  159. integer taborder = 10
  160. string text = "选择"
  161. end type
  162. event clicked;call super::clicked;
  163. IF NOT IsValid(W_cust_edit) THEN
  164. s_edit_index_tran s_ch_tran //传递参数使用
  165. s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行
  166. s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  167. s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  168. //查询列(物料编码)部分内容,用于初步筛选
  169. s_ch_tran.arg_string_code = Upper(Trim(sle_cuscode.text))
  170. OpenWithParm(W_cust_edit,s_ch_tran) //调用
  171. s_custom S_INSCUST
  172. S_INSCUST = Message.PowerObjectParm //接受返回结构
  173. IF S_INSCUST.cusid > 0 THEN //正常返回值则可以取以下值
  174. cur_cusid = S_INSCUST.cusid
  175. sle_cusName.text = S_INSCUST.Name
  176. sle_cuscode.text = S_INSCUST.cuscode
  177. END IF
  178. END IF
  179. end event
  180. type sle_cuscode from singlelineedit within w_outware_scll_cmpmtrl
  181. integer x = 389
  182. integer y = 12
  183. integer width = 686
  184. integer height = 84
  185. integer taborder = 10
  186. integer textsize = -9
  187. integer weight = 400
  188. fontcharset fontcharset = gb2312charset!
  189. fontpitch fontpitch = variable!
  190. string facename = "宋体"
  191. long textcolor = 33554432
  192. end type
  193. event modified;String ls_code,ls_name,ls_custype,ls_find_code
  194. String ls_freight,ls_freight_tele
  195. String ls_cus_address,ls_cus_tele,ls_cus_fax
  196. Long ls_cusid
  197. Long cnt = 0
  198. Boolean if_find = FALSE
  199. ls_code = Trim(sle_cuscode.Text)
  200. SELECT u_cust.cusid,
  201. u_cust.name,
  202. u_cust.custype,
  203. u_cust.cuscode,
  204. u_cust.freight,
  205. u_cust.freight_tele,
  206. u_cust.address,
  207. u_cust.tele,
  208. u_cust.faxno
  209. INTO :ls_cusid,:ls_name,:ls_custype,:ls_code,
  210. :ls_freight,:ls_freight_tele,
  211. :ls_cus_address,:ls_cus_tele,:ls_cus_fax
  212. FROM u_cust
  213. Where (cuscode = :ls_code OR Name = :ls_code);
  214. IF sqlca.SQLCode <> 0 THEN
  215. IF Pos(Trim(ls_code),'%') = 0 THEN
  216. ls_find_code = '%'+ Trim(ls_code) + '%'
  217. ELSE
  218. ls_find_code = Trim(ls_code)
  219. END IF
  220. SELECT count(*) INTO :cnt
  221. FROM u_cust
  222. Where ( cuscode Like :ls_find_code OR Name Like :ls_find_code );
  223. IF sqlca.SQLCode <> 0 THEN
  224. cb_2.TriggerEvent(Clicked!)
  225. RETURN 1
  226. END IF
  227. IF cnt <> 1 THEN
  228. cb_2.TriggerEvent(Clicked!)
  229. RETURN 1
  230. ELSE
  231. SELECT u_cust.cusid,
  232. u_cust.cuscode,
  233. u_cust.name,
  234. u_cust.freight,
  235. u_cust.freight_tele,
  236. u_cust.address,
  237. u_cust.tele,
  238. u_cust.faxno
  239. INTO :ls_cusid,:ls_code,:ls_name,
  240. :ls_freight,:ls_freight_tele,
  241. :ls_cus_address,:ls_cus_tele,:ls_cus_fax
  242. FROM u_cust
  243. Where ( cuscode Like :ls_find_code OR Name Like :ls_find_code );
  244. IF sqlca.SQLCode <> 0 THEN
  245. cb_2.TriggerEvent(Clicked!)
  246. RETURN 1
  247. ELSE
  248. if_find = TRUE
  249. END IF
  250. END IF
  251. ELSE
  252. if_find = TRUE
  253. END IF
  254. IF if_find THEN
  255. cur_cusid = ls_cusid
  256. sle_cuscode.Text = ls_code
  257. sle_cusname.Text = ls_name
  258. RETURN 1
  259. END IF
  260. end event
  261. type st_4 from statictext within w_outware_scll_cmpmtrl
  262. integer x = 128
  263. integer y = 28
  264. integer width = 242
  265. integer height = 60
  266. integer textsize = -9
  267. integer weight = 400
  268. fontcharset fontcharset = gb2312charset!
  269. fontpitch fontpitch = variable!
  270. string facename = "宋体"
  271. long textcolor = 33554432
  272. long backcolor = 67108864
  273. string text = "客户编号"
  274. alignment alignment = right!
  275. boolean focusrectangle = false
  276. end type
  277. type cb_ok from uo_imflatbutton within w_outware_scll_cmpmtrl
  278. integer x = 576
  279. integer y = 648
  280. integer taborder = 50
  281. end type
  282. event clicked;call super::clicked;close(parent)
  283. end event
  284. type cb_exit from uo_imflatbutton within w_outware_scll_cmpmtrl
  285. integer x = 1207
  286. integer y = 648
  287. integer taborder = 40
  288. string text = "退出"
  289. end type
  290. event clicked;call super::clicked;cur_mtrlid = 0
  291. cur_cusid = 0
  292. close(parent)
  293. end event
  294. type st_unit from statictext within w_outware_scll_cmpmtrl
  295. integer x = 763
  296. integer y = 524
  297. integer width = 215
  298. integer height = 48
  299. integer textsize = -9
  300. integer weight = 400
  301. fontcharset fontcharset = gb2312charset!
  302. fontpitch fontpitch = variable!
  303. string facename = "宋体"
  304. long textcolor = 33554432
  305. long backcolor = 67108864
  306. string text = "单位"
  307. boolean focusrectangle = false
  308. end type
  309. type sle_qty from singlelineedit within w_outware_scll_cmpmtrl
  310. integer x = 389
  311. integer y = 504
  312. integer width = 311
  313. integer height = 84
  314. integer taborder = 30
  315. integer textsize = -9
  316. integer weight = 400
  317. fontcharset fontcharset = gb2312charset!
  318. fontpitch fontpitch = variable!
  319. string facename = "宋体"
  320. long textcolor = 33554432
  321. string text = "1"
  322. borderstyle borderstyle = stylelowered!
  323. boolean righttoleft = true
  324. end type
  325. type st_3 from statictext within w_outware_scll_cmpmtrl
  326. integer x = 128
  327. integer y = 524
  328. integer width = 242
  329. integer height = 48
  330. integer textsize = -9
  331. integer weight = 400
  332. fontcharset fontcharset = gb2312charset!
  333. fontpitch fontpitch = variable!
  334. string facename = "宋体"
  335. long textcolor = 33554432
  336. long backcolor = 67108864
  337. string text = "数 量"
  338. alignment alignment = right!
  339. boolean focusrectangle = false
  340. end type
  341. type cb_1 from uo_imflatbutton within w_outware_scll_cmpmtrl
  342. integer x = 1097
  343. integer y = 256
  344. integer width = 293
  345. integer height = 92
  346. integer taborder = 10
  347. string text = "选择"
  348. end type
  349. event clicked;call super::clicked;s_edit_index_tran s_ch_tran //传递参数使用
  350. s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行
  351. s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  352. s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  353. s_ch_tran.arg_string_code = Upper(Trim(sle_mtrlcode.text))
  354. //查询列(物料编码)部分内容,用于初步筛选
  355. OpenWithParm(w_mtrldef_edit,s_ch_tran) //调用
  356. s_mtrldef_array S_INSCUST
  357. S_INSCUST = Message.PowerObjectParm //接受返回结构
  358. IF S_INSCUST.mtrlid[1] > 0 THEN
  359. sle_mtrlname.Text = S_INSCUST.mtrlname[1]
  360. sle_mtrlcode.Text = S_INSCUST.mtrlcode[1]
  361. st_unit.Text = S_INSCUST.unit[1]
  362. cur_mtrlid = S_INSCUST.mtrlid[1]
  363. END IF
  364. end event
  365. type st_2 from statictext within w_outware_scll_cmpmtrl
  366. integer x = 128
  367. integer y = 412
  368. integer width = 242
  369. integer height = 60
  370. integer textsize = -9
  371. integer weight = 400
  372. fontcharset fontcharset = gb2312charset!
  373. fontpitch fontpitch = variable!
  374. string facename = "宋体"
  375. long textcolor = 33554432
  376. long backcolor = 67108864
  377. string text = "品 名"
  378. alignment alignment = right!
  379. boolean focusrectangle = false
  380. end type
  381. type sle_mtrlname from singlelineedit within w_outware_scll_cmpmtrl
  382. integer x = 389
  383. integer y = 392
  384. integer width = 1605
  385. integer height = 84
  386. integer taborder = 20
  387. integer textsize = -9
  388. integer weight = 400
  389. fontcharset fontcharset = gb2312charset!
  390. fontpitch fontpitch = variable!
  391. string facename = "宋体"
  392. long textcolor = 33554432
  393. end type
  394. type sle_mtrlcode from singlelineedit within w_outware_scll_cmpmtrl
  395. integer x = 389
  396. integer y = 264
  397. integer width = 686
  398. integer height = 84
  399. integer taborder = 10
  400. integer textsize = -9
  401. integer weight = 400
  402. fontcharset fontcharset = gb2312charset!
  403. fontpitch fontpitch = variable!
  404. string facename = "宋体"
  405. long textcolor = 33554432
  406. end type
  407. event modified;String ls_mtrlcode
  408. long ls_mtrlid
  409. string ls_mtrlname
  410. string ls_unit
  411. ls_mtrlcode = sle_mtrlcode.text
  412. s_mtrldef_array arg_s_mtrldef
  413. IF f_find_mtrl(ls_mtrlcode,-1,arg_s_mtrldef) = 0 THEN
  414. cb_1.TriggerEvent(clicked!)
  415. RETURN 1
  416. ELSE
  417. ls_mtrlid = arg_s_mtrldef.mtrlid[1]
  418. ls_mtrlcode = arg_s_mtrldef.mtrlcode[1]
  419. ls_mtrlname = arg_s_mtrldef.mtrlname[1]
  420. ls_unit = arg_s_mtrldef.unit[1]
  421. END IF
  422. cur_mtrlid = ls_mtrlid
  423. sle_mtrlcode.text = ls_mtrlcode
  424. sle_mtrlname.text = ls_mtrlname
  425. st_unit.text = ls_unit
  426. end event
  427. type st_1 from statictext within w_outware_scll_cmpmtrl
  428. integer x = 128
  429. integer y = 280
  430. integer width = 242
  431. integer height = 60
  432. integer textsize = -9
  433. integer weight = 400
  434. fontcharset fontcharset = gb2312charset!
  435. fontpitch fontpitch = variable!
  436. string facename = "宋体"
  437. long textcolor = 33554432
  438. long backcolor = 67108864
  439. string text = "编 码"
  440. alignment alignment = right!
  441. boolean focusrectangle = false
  442. end type