w_rp_mtrl_will_rqqty.srw 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943
  1. $PBExportHeader$w_rp_mtrl_will_rqqty.srw
  2. forward
  3. global type w_rp_mtrl_will_rqqty from w_publ_easyq
  4. end type
  5. type cbx_1 from checkbox within w_rp_mtrl_will_rqqty
  6. end type
  7. type ddlb_scid from uo_ddlb_scid within w_rp_mtrl_will_rqqty
  8. end type
  9. type tab_1 from tab within w_rp_mtrl_will_rqqty
  10. end type
  11. type tabpage_5 from userobject within tab_1
  12. end type
  13. type dw_rq_taskmx from u_dw_rbtnfilter within tabpage_5
  14. end type
  15. type tabpage_5 from userobject within tab_1
  16. dw_rq_taskmx dw_rq_taskmx
  17. end type
  18. type tabpage_1 from userobject within tab_1
  19. end type
  20. type cb_4 from commandbutton within tabpage_1
  21. end type
  22. type dw_2 from u_dw_rbtnfilter within tabpage_1
  23. end type
  24. type tabpage_1 from userobject within tab_1
  25. cb_4 cb_4
  26. dw_2 dw_2
  27. end type
  28. type tabpage_6 from userobject within tab_1
  29. end type
  30. type dw_ware from u_dw_rbtnfilter within tabpage_6
  31. end type
  32. type tabpage_6 from userobject within tab_1
  33. dw_ware dw_ware
  34. end type
  35. type tabpage_2 from userobject within tab_1
  36. end type
  37. type dw_3 from u_dw_rbtnfilter within tabpage_2
  38. end type
  39. type tabpage_2 from userobject within tab_1
  40. dw_3 dw_3
  41. end type
  42. type tabpage_3 from userobject within tab_1
  43. end type
  44. type dw_4 from u_dw_rbtnfilter within tabpage_3
  45. end type
  46. type tabpage_3 from userobject within tab_1
  47. dw_4 dw_4
  48. end type
  49. type tabpage_4 from userobject within tab_1
  50. end type
  51. type dw_5 from u_dw_rbtnfilter within tabpage_4
  52. end type
  53. type tabpage_4 from userobject within tab_1
  54. dw_5 dw_5
  55. end type
  56. type tab_1 from tab within w_rp_mtrl_will_rqqty
  57. tabpage_5 tabpage_5
  58. tabpage_1 tabpage_1
  59. tabpage_6 tabpage_6
  60. tabpage_2 tabpage_2
  61. tabpage_3 tabpage_3
  62. tabpage_4 tabpage_4
  63. end type
  64. type cbx_ifminqty from checkbox within w_rp_mtrl_will_rqqty
  65. end type
  66. type cbx_ifnoallocqty from checkbox within w_rp_mtrl_will_rqqty
  67. end type
  68. type cbx_ifbuytask from checkbox within w_rp_mtrl_will_rqqty
  69. end type
  70. type cbx_iforder from checkbox within w_rp_mtrl_will_rqqty
  71. end type
  72. type cbx_ifwfjg from checkbox within w_rp_mtrl_will_rqqty
  73. end type
  74. type st_2 from statictext within w_rp_mtrl_will_rqqty
  75. end type
  76. type tv_1 from uo_tv_mtrltype within w_rp_mtrl_will_rqqty
  77. end type
  78. type p_resize from picture within w_rp_mtrl_will_rqqty
  79. end type
  80. type cbx_2 from checkbox within w_rp_mtrl_will_rqqty
  81. end type
  82. type ddlb_mtrlorigin from uo_ddlb_mtrlorigin within w_rp_mtrl_will_rqqty
  83. end type
  84. type st_1 from statictext within w_rp_mtrl_will_rqqty
  85. end type
  86. type st_5 from statictext within w_rp_mtrl_will_rqqty
  87. end type
  88. type cb_billfunc from uo_imflatbutton within w_rp_mtrl_will_rqqty
  89. end type
  90. type cb_other from uo_imflatbutton within w_rp_mtrl_will_rqqty
  91. end type
  92. type cbx_ifrqqty from checkbox within w_rp_mtrl_will_rqqty
  93. end type
  94. type cbx_iftaskqty from checkbox within w_rp_mtrl_will_rqqty
  95. end type
  96. end forward
  97. global type w_rp_mtrl_will_rqqty from w_publ_easyq
  98. integer width = 3895
  99. integer height = 2396
  100. string title = "物料监控"
  101. event retrieve_mx ( )
  102. event auto_requestbuy ( )
  103. event auto_wfjg ( )
  104. event auto_order ( )
  105. event ue_view_mtrl_mx ( )
  106. event ue_create_buytask ( )
  107. event ue_retrieve_info ( )
  108. event ue_create_buytask_view ( )
  109. cbx_1 cbx_1
  110. ddlb_scid ddlb_scid
  111. tab_1 tab_1
  112. cbx_ifminqty cbx_ifminqty
  113. cbx_ifnoallocqty cbx_ifnoallocqty
  114. cbx_ifbuytask cbx_ifbuytask
  115. cbx_iforder cbx_iforder
  116. cbx_ifwfjg cbx_ifwfjg
  117. st_2 st_2
  118. tv_1 tv_1
  119. p_resize p_resize
  120. cbx_2 cbx_2
  121. ddlb_mtrlorigin ddlb_mtrlorigin
  122. st_1 st_1
  123. st_5 st_5
  124. cb_billfunc cb_billfunc
  125. cb_other cb_other
  126. cbx_ifrqqty cbx_ifrqqty
  127. cbx_iftaskqty cbx_iftaskqty
  128. end type
  129. global w_rp_mtrl_will_rqqty w_rp_mtrl_will_rqqty
  130. type variables
  131. Int cur_mtrlorigin = 0 //当前显示物料来源
  132. Int cur_mtrlprp = -1
  133. Long cur_scid = 0
  134. Long cur_scid_arr[]
  135. int cur_mtrlkind = -1
  136. datawindow dw_order_ml,dw_buytask,dw_order,dw_wfjg
  137. datawindow dw_saletask, dw_ware
  138. String ls_handtype = ''
  139. end variables
  140. forward prototypes
  141. public function integer wf_cmpl_qty ()
  142. end prototypes
  143. event retrieve_mx();Long li_row,li_mtrlid
  144. String ls_status,ls_woodcode,ls_pcode
  145. DateTime ld_dt
  146. ld_dt = DateTime(Date(em_1.Text),Time('23:59:59'))
  147. li_row = dw_1.GetRow()
  148. IF li_row <= 0 THEN
  149. dw_order_ml.Reset()
  150. dw_buytask.Reset()
  151. dw_order.Reset()
  152. dw_wfjg.Reset()
  153. dw_saletask.Reset()
  154. dw_ware.Reset()
  155. ELSE
  156. li_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[li_row]
  157. ls_status = dw_1.Object.uv_mtrl_willuse_status[li_row]
  158. ls_woodcode = dw_1.Object.uv_mtrl_willuse_woodcode[li_row]
  159. ls_pcode = dw_1.Object.uv_mtrl_willuse_pcode[li_row]
  160. dw_order_ml.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
  161. dw_buytask.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
  162. dw_order.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
  163. dw_wfjg.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
  164. dw_saletask.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
  165. dw_ware.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode)
  166. END IF
  167. end event
  168. event auto_requestbuy();Long i,cnt
  169. s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
  170. s_tran.if_retrieve_all = local_retrieve_all //是否一次RETRIEVE所有行
  171. s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
  172. s_tran.arg_pkid = 0 //目标定位PKID (备用)
  173. s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
  174. s_tran.c_long = cur_scid
  175. s_tran.d_long = 1
  176. s_tran.d_string = ddlb_scid.Text
  177. IF NOT f_power_ind(1053) THEN
  178. MessageBox(publ_operator,'你没有使用权限!')
  179. RETURN
  180. END IF
  181. dw_1.AcceptText()
  182. FOR i = 1 TO dw_1.RowCount()
  183. IF dw_1.Object.selectflag[i] = 1 THEN
  184. cnt++
  185. s_tran.arr_long[cnt] = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
  186. s_tran.arr_dec[cnt] = dw_1.Object.truerqqty[i]
  187. s_tran.arr_string[cnt] = dw_1.Object.uv_mtrl_willuse_status[i]
  188. s_tran.arr_string2[cnt] = dw_1.Object.uv_mtrl_willuse_woodcode[i]
  189. s_tran.arr_string3[cnt] = dw_1.Object.uv_mtrl_willuse_pcode[i]
  190. END IF
  191. NEXT
  192. IF cnt = 0 THEN
  193. MessageBox(publ_operator,'请选择物料')
  194. RETURN
  195. END IF
  196. //OpenWithParm(w_requestbuy,s_tran)
  197. end event
  198. event auto_wfjg();long i,cnt
  199. s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
  200. s_tran.if_retrieve_all = local_retrieve_all //是否一次RETRIEVE所有行
  201. s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
  202. s_tran.arg_pkid = 0 //目标定位PKID (备用)
  203. s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
  204. s_tran.c_long = cur_scid
  205. s_tran.d_long = 1
  206. s_tran.d_string = ddlb_scid.text
  207. if not f_power_ind(1251) then
  208. messagebox(publ_operator,'你没有使用权限!')
  209. return
  210. end if
  211. dw_1.accepttext()
  212. for i = 1 to dw_1.rowcount()
  213. if dw_1.object.selectflag[i]=1 then
  214. cnt++
  215. s_tran.arr_long[cnt] = dw_1.object.uv_mtrl_willuse_mtrlid[i]
  216. s_tran.arr_dec[cnt] = dw_1.object.truerqqty[i]
  217. end if
  218. next
  219. if cnt = 0 then
  220. messagebox(publ_operator,'请选择物料')
  221. return
  222. end if
  223. //openwithparm(w_request_wfjg,s_tran)
  224. end event
  225. event auto_order();Long i,cnt
  226. s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
  227. s_tran.if_retrieve_all = local_retrieve_all //是否一次RETRIEVE所有行
  228. s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
  229. s_tran.arg_pkid = 0 //目标定位PKID (备用)
  230. s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
  231. s_tran.c_long = cur_scid
  232. s_tran.d_long = 1
  233. s_tran.d_string = ddlb_scid.Text
  234. IF NOT f_power_ind(35) THEN
  235. MessageBox(publ_operator,'你没有使用权限!')
  236. RETURN
  237. END IF
  238. dw_1.AcceptText()
  239. FOR i = 1 TO dw_1.RowCount()
  240. IF dw_1.Object.selectflag[i] = 1 THEN
  241. cnt++
  242. s_tran.arr_long[cnt] = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
  243. s_tran.arr_dec[cnt] = dw_1.Object.truerqqty[i]
  244. END IF
  245. NEXT
  246. IF cnt = 0 THEN
  247. MessageBox(publ_operator,'请选择物料')
  248. RETURN
  249. END IF
  250. //OpenWithParm(w_order_ml_add,s_tran)
  251. end event
  252. event ue_view_mtrl_mx();dw_1.AcceptText()
  253. Long ll_row
  254. Long ll_mtrlid
  255. string ls_mtrlcode
  256. ll_row = dw_1.GetRow()
  257. IF ll_row <= 0 THEN
  258. MessageBox('提示','请选择物料')
  259. RETURN
  260. END IF
  261. ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
  262. ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[ll_row]
  263. IF ll_mtrlid = 0 THEN
  264. MessageBox('提示','请选择物料')
  265. RETURN
  266. END IF
  267. f_view_mtrl_mx(ll_mtrlid,1)
  268. end event
  269. event ue_create_buytask();Long rslt = 1
  270. String ls_msg = ''
  271. Long i,j, cnt
  272. Long ll_mtrlid
  273. Long sptid[]
  274. Long it_mx = 1
  275. String arg_msg
  276. uo_buytask obj_task
  277. obj_task = Create uo_buytask
  278. obj_task.commit_transaction = sqlca
  279. uo_spt_price uo_sptprice
  280. uo_sptprice = Create uo_spt_price
  281. IF cur_scid < 0 THEN
  282. rslt = 0
  283. arg_msg = "请先选择分部"
  284. GOTO ext
  285. END IF
  286. //确定供应商
  287. FOR i = 1 To dw_1.RowCount()
  288. IF dw_1.Object.selectflag[i] = 1 And dw_1.Object.truerqqty[i] > 0 THEN
  289. FOR j = 1 To UpperBound(sptid)
  290. IF sptid[j] = dw_1.Object.u_mtrldef_dftsptid[i] THEN
  291. GOTO nxt
  292. END IF
  293. NEXT
  294. cnt ++
  295. sptid[cnt] = dw_1.Object.u_mtrldef_dftsptid[i]
  296. END IF
  297. nxt:
  298. NEXT
  299. IF cnt = 0 THEN
  300. rslt = 0
  301. arg_msg = "请选择已有默认供应商的缺料物料"
  302. GOTO ext
  303. END IF
  304. //按供应商生成订单
  305. Long dftbanktypeid,dftmoneyid
  306. String ls_sptcode, ls_sptname
  307. FOR i = 1 To cnt
  308. //查询默认结算方式,默认币种
  309. SELECT dftbanktypeid,dftmoneyid, sptcode,name
  310. INTO :dftbanktypeid,:dftmoneyid, :ls_sptcode, :ls_sptname
  311. FROM u_spt
  312. Where sptid = :sptid[i] Using sqlca;
  313. IF sqlca.SQLCode <> 0 THEN
  314. rslt = 0
  315. arg_msg = '查询供应商信息失败,ID['+String(sptid[i])+'],'+sqlca.SQLErrText
  316. GOTO ext
  317. END IF
  318. IF dftbanktypeid = 0 THEN
  319. rslt = 0
  320. arg_msg = '供应商编号['+ls_sptcode+']未定义默认结算方式'
  321. GOTO ext
  322. END IF
  323. IF dftmoneyid = 0 THEN
  324. rslt = 0
  325. arg_msg = '供应商编号['+ls_sptcode+']未定义默认币种'
  326. GOTO ext
  327. END IF
  328. s_buytaskmx_arr s_buy
  329. IF obj_task.newbegin(cur_scid,arg_msg) = 0 THEN //
  330. rslt = 0
  331. GOTO ext
  332. END IF
  333. obj_task.requiredate = DateTime(Today())
  334. obj_task.Assign_emp = publ_operator
  335. obj_task.Kind = 0
  336. obj_task.sptid = sptid[i]
  337. obj_task.relcode = ''
  338. obj_task.banktypeid = dftbanktypeid
  339. obj_task.train = ''
  340. obj_task.billtype = 0
  341. obj_task.moneyid = dftmoneyid
  342. obj_task.mrate = f_get_mrate( dftmoneyid)
  343. FOR j = 1 To dw_1.RowCount()
  344. IF dw_1.Object.selectflag[j] = 1 And dw_1.Object.truerqqty[j] > 0 And sptid[i] = dw_1.Object.u_mtrldef_dftsptid[j] THEN
  345. it_mx++
  346. s_buy.MtrlID[it_mx] = dw_1.Object.uv_mtrl_willuse_mtrlid[j]
  347. s_buy.mtrlcode[it_mx] = dw_1.Object.u_mtrldef_mtrlcode[j]
  348. s_buy.status[it_mx] = dw_1.Object.uv_mtrl_willuse_status[j]
  349. s_buy.woodcode[it_mx] = dw_1.Object.uv_mtrl_willuse_woodcode[j]
  350. s_buy.pcode[it_mx] = dw_1.Object.uv_mtrl_willuse_pcode[j]
  351. s_buy.unit[it_mx] = dw_1.Object.u_mtrldef_unit[j]
  352. s_buy.mrp_unit[it_mx] = dw_1.Object.u_mtrldef_mrp_unit[j]
  353. s_buy.unit_buy[it_mx] = dw_1.Object.u_mtrldef_unit_buy[j]
  354. s_buy.rate_buy[it_mx] = dw_1.Object.u_mtrldef_rate_buy[j]
  355. s_buy.unit_scll[it_mx] = dw_1.Object.u_mtrldef_unit_scll[j]
  356. s_buy.rate_scll[it_mx] = dw_1.Object.u_mtrldef_rate_scll[j]
  357. s_buy.unit_sale[it_mx] = dw_1.Object.u_mtrldef_unit_sale[j]
  358. s_buy.rate_sale[it_mx] = dw_1.Object.u_mtrldef_rate_sale[j]
  359. s_buy.buyunit[it_mx] = dw_1.Object.u_mtrldef_buyunit[j]
  360. s_buy.uqty[it_mx] = dw_1.Object.truerqqty[j]
  361. CHOOSE CASE s_buy.buyunit[it_mx] //mrp_unit
  362. CASE 0
  363. s_buy.rate[it_mx] = 1
  364. CASE 1
  365. IF s_buy.rate_buy[it_mx] = 0 THEN s_buy.rate_buy[it_mx] = 1
  366. s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_buy[it_mx]
  367. s_buy.rate[it_mx] = s_buy.rate_buy[it_mx]
  368. s_buy.unit[it_mx] = s_buy.unit_buy[it_mx]
  369. CASE 2
  370. s_buy.unit[it_mx] = s_buy.unit_scll[it_mx]
  371. s_buy.rate[it_mx] = s_buy.rate_scll[it_mx]
  372. IF s_buy.rate_scll[it_mx] = 0 THEN s_buy.rate_scll[it_mx] = 1
  373. s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_scll[it_mx]
  374. CASE 3
  375. s_buy.unit[it_mx] = s_buy.unit_sale[it_mx]
  376. s_buy.rate[it_mx] = s_buy.rate_sale[it_mx]
  377. IF s_buy.rate_sale[it_mx] = 0 THEN s_buy.rate_sale[it_mx] = 1
  378. s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_sale[it_mx]
  379. END CHOOSE
  380. Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate,ld_rate
  381. String ls_unit
  382. ls_unit = s_buy.unit[it_mx]
  383. // IF uo_sptprice.uf_getmtrlsptprice(sptid[i],s_buy.MtrlID[it_mx],ls_unit,s_buy.status[it_mx],s_buy.woodcode[it_mx],s_buy.pcode[it_mx],0,ls_1stnewcost,ls_1stzqrate,ls_1strate,arg_msg) = 1 THEN
  384. // s_buy.uprice[it_mx] = ls_1stnewcost
  385. // // s_buy.rate[it_mx] = ls_1stzqrate
  386. // ELSE
  387. // s_buy.uprice[it_mx] = 0
  388. // END IF
  389. //新的取价模式
  390. IF uo_sptprice.uof_get_mtrl_buyprice(sptid[i],s_buy.MtrlID[it_mx],ls_unit,&
  391. s_buy.status[it_mx],s_buy.woodcode[it_mx],s_buy.pcode[it_mx],0,&
  392. ls_1stnewcost,ls_1stzqrate,ls_1strate,arg_msg) = 1 THEN
  393. s_buy.uprice[it_mx] = ls_1stnewcost
  394. // s_buy.rate[it_mx] = ls_1stzqrate
  395. ELSE
  396. s_buy.uprice[it_mx] = 0
  397. END IF
  398. SELECT top 1 storageid
  399. INTO :s_buy.storageid[it_mx]
  400. FROM u_mtrl_storage
  401. Where MtrlID = :s_buy.MtrlID[it_mx] Using sqlca;
  402. IF sqlca.SQLCode <> 0 THEN
  403. SELECT top 1 storageid
  404. INTO :s_buy.storageid[it_mx]
  405. FROM u_buytaskmx
  406. WHERE mtrlid = :s_buy.MtrlID[it_mx]
  407. Order By taskid Desc Using sqlca;
  408. IF sqlca.SQLCode <> 0 THEN
  409. arg_msg = s_buy.mtrlcode[it_mx] + '请先设置存放仓库'
  410. END IF
  411. END IF
  412. IF obj_task.acceptmx(0,&
  413. 0,&
  414. '',&
  415. s_buy.MtrlID[it_mx],&
  416. s_buy.uqty[it_mx],&
  417. 0,&
  418. s_buy.uprice[it_mx],&
  419. 1,&
  420. 0,&
  421. '',&
  422. s_buy.mtrlcode[it_mx],&
  423. arg_msg,&
  424. j,&
  425. DateTime(Today()),&
  426. s_buy.storageid[it_mx],&
  427. s_buy.status[it_mx],&
  428. s_buy.woodcode[it_mx],&
  429. s_buy.pcode[it_mx],&
  430. s_buy.unit[it_mx],&
  431. s_buy.rate[it_mx],&
  432. 0,&
  433. 0,&
  434. '',&
  435. '',&
  436. 0,0,'','','','') = 0 THEN
  437. rslt = 0
  438. GOTO ext
  439. END IF
  440. END IF
  441. NEXT
  442. IF obj_task.savesubmit(publ_operator,arg_msg,False) = 0 THEN
  443. rslt = 0
  444. GOTO ext
  445. END IF
  446. IF ls_msg = '' THEN
  447. ls_msg = obj_task.taskcode
  448. ELSE
  449. ls_msg += ',' + obj_task.taskcode
  450. END IF
  451. NEXT
  452. IF arg_msg = '' THEN
  453. arg_msg = '没有采购订单生成'
  454. ELSE
  455. arg_msg = '生成采购订单:' + ls_msg
  456. END IF
  457. //arg_msg = ls_msg
  458. ext:
  459. IF rslt = 0 THEN
  460. ROLLBACK Using sqlca;
  461. MessageBox("Error",arg_msg)
  462. ELSE
  463. COMMIT Using sqlca;
  464. MessageBox("系统提示",arg_msg)
  465. END IF
  466. end event
  467. event ue_retrieve_info();Long ll_row
  468. Long ll_mtrlid
  469. ll_row = dw_1.GetRow()
  470. IF ll_row <= 0 THEN
  471. ll_mtrlid = 0
  472. ELSE
  473. ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
  474. END IF
  475. IF IsValid(w_mtrl_info) THEN
  476. w_mtrl_info.WindowState = Normal!
  477. w_mtrl_info.ins_mtrlid = ll_mtrlid
  478. w_mtrl_info.wf_retrieve(ll_mtrlid)
  479. END IF
  480. end event
  481. event ue_create_buytask_view();//辅助生成采购订单
  482. IF Not f_power_ind(93) THEN
  483. MessageBox('提示',sys_msg_pow, Information!, OK! )
  484. RETURN
  485. END IF
  486. Int rslt = 1
  487. String arg_msg
  488. //Long cnt
  489. //String ls_msg
  490. Long i, it_mx
  491. Long ll_storageid
  492. IF cur_scid < 0 THEN
  493. MessageBox('系统提示','请先选择分部!',Information!,OK!)
  494. RETURN
  495. END IF
  496. dw_1.AcceptText()
  497. i = dw_1.Find('selectflag = 1', 1, dw_1.RowCount() )
  498. IF i <= 0 THEN
  499. MessageBox('系统提示','请选定当前目标订单!',Information!,OK!)
  500. RETURN
  501. END IF
  502. s_buytaskmx_arr s_buy
  503. FOR i = 1 To dw_1.RowCount()
  504. IF dw_1.Object.selectflag[i] = 1 THEN
  505. it_mx++
  506. s_buy.MtrlID[it_mx] = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
  507. s_buy.mtrlcode[it_mx] = dw_1.Object.u_mtrldef_mtrlcode[i]
  508. s_buy.mtrlname[it_mx] = dw_1.Object.u_mtrldef_mtrlname[i]
  509. s_buy.mtrlmode[it_mx] = dw_1.Object.u_mtrldef_mtrlmode[i]
  510. s_buy.zxmtrlmode[it_mx] = dw_1.Object.u_mtrldef_zxmtrlmode[i]
  511. s_buy.mtrlsectype[it_mx] = dw_1.Object.u_mtrldef_mtrlsectype[i]
  512. s_buy.status[it_mx] = dw_1.Object.uv_mtrl_willuse_status[i]
  513. s_buy.woodcode[it_mx] = dw_1.Object.uv_mtrl_willuse_woodcode[i]
  514. s_buy.pcode[it_mx] = dw_1.Object.uv_mtrl_willuse_pcode[i]
  515. s_buy.unit[it_mx] = dw_1.Object.u_mtrldef_unit[i]
  516. s_buy.mrp_unit[it_mx] = dw_1.Object.u_mtrldef_mrp_unit[i]
  517. s_buy.unit_buy[it_mx] = dw_1.Object.u_mtrldef_unit_buy[i]
  518. s_buy.rate_buy[it_mx] = dw_1.Object.u_mtrldef_rate_buy[i]
  519. s_buy.unit_scll[it_mx] = dw_1.Object.u_mtrldef_unit_scll[i]
  520. s_buy.rate_scll[it_mx] = dw_1.Object.u_mtrldef_rate_scll[i]
  521. s_buy.unit_sale[it_mx] = dw_1.Object.u_mtrldef_unit_sale[i]
  522. s_buy.rate_sale[it_mx] = dw_1.Object.u_mtrldef_rate_sale[i]
  523. s_buy.buyunit[it_mx] = dw_1.Object.u_mtrldef_buyunit[i]
  524. if dw_1.Object.truerqqty[i] > 0 then
  525. s_buy.uqty[it_mx] = dw_1.Object.truerqqty[i]
  526. s_buy.qty[it_mx] = dw_1.Object.truerqqty[i]
  527. else
  528. s_buy.uqty[it_mx] = 0
  529. s_buy.qty[it_mx] = 0
  530. end if
  531. CHOOSE CASE s_buy.buyunit[it_mx]
  532. CASE 0
  533. s_buy.rate[it_mx] = 1
  534. CASE 1
  535. IF s_buy.rate_buy[it_mx] = 0 THEN s_buy.rate_buy[it_mx] = 1
  536. s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_buy[it_mx]
  537. s_buy.rate[it_mx] = s_buy.rate_buy[it_mx]
  538. s_buy.unit[it_mx] = s_buy.unit_buy[it_mx]
  539. CASE 2
  540. s_buy.unit[it_mx] = s_buy.unit_scll[it_mx]
  541. s_buy.rate[it_mx] = s_buy.rate_scll[it_mx]
  542. IF s_buy.rate_scll[it_mx] = 0 THEN s_buy.rate_scll[it_mx] = 1
  543. s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_scll[it_mx]
  544. CASE 3
  545. s_buy.unit[it_mx] = s_buy.unit_sale[it_mx]
  546. s_buy.rate[it_mx] = s_buy.rate_sale[it_mx]
  547. IF s_buy.rate_sale[it_mx] = 0 THEN s_buy.rate_sale[it_mx] = 1
  548. s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_sale[it_mx]
  549. END CHOOSE
  550. END IF
  551. NEXT
  552. s_edit_index_tran s_open
  553. IF Not IsValid(w_buytask) THEN
  554. OpenWithParm(w_buytask,s_open)
  555. w_buytask.ddlb_scid.uf_selectsc(cur_scid)
  556. w_buytask.cb_add.TriggerEvent(Clicked!)
  557. w_buytask.dw_uc.Object.u_buytask_billtype[w_buytask.dw_uc.GetRow()] = 0
  558. w_buytask.TriggerEvent('ue_f9')
  559. w_buytask.wf_autoaddmx_will_rq(s_buy)
  560. END IF
  561. end event
  562. public function integer wf_cmpl_qty ();Long i
  563. Long ll_mtrlid,ll_storageid
  564. String ls_status_uc,arg_msg,arg_lsg,ls_mtrlcode
  565. Decimal ld_ref_qty
  566. Open(w_sys_wait_jdt) //初始化进度条
  567. w_sys_wait_jdt.Show()
  568. w_sys_wait_jdt.wf_accepttol(dw_1.RowCount()) //初始化进度条1
  569. FOR i = 1 TO dw_1.RowCount()
  570. ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[i]
  571. w_sys_wait_jdt.st_msg.Text = "处理:"+ls_mtrlcode //进度信息
  572. ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
  573. ll_storageid = -1
  574. ls_status_uc = dw_1.Object.uv_mtrl_willuse_status[i]
  575. IF f_cmp_di_qty(ll_mtrlid,ll_storageid,ls_status_uc,ld_ref_qty,arg_lsg,arg_msg) = 0 THEN
  576. CONTINUE;
  577. END IF
  578. dw_1.Object.install_cmplqty[i] = ld_ref_qty
  579. w_sys_wait_jdt.wf_inc(i) //进度
  580. NEXT
  581. Close(w_sys_wait_jdt)
  582. RETURN 1
  583. end function
  584. on w_rp_mtrl_will_rqqty.create
  585. int iCurrent
  586. call super::create
  587. this.cbx_1=create cbx_1
  588. this.ddlb_scid=create ddlb_scid
  589. this.tab_1=create tab_1
  590. this.cbx_ifminqty=create cbx_ifminqty
  591. this.cbx_ifnoallocqty=create cbx_ifnoallocqty
  592. this.cbx_ifbuytask=create cbx_ifbuytask
  593. this.cbx_iforder=create cbx_iforder
  594. this.cbx_ifwfjg=create cbx_ifwfjg
  595. this.st_2=create st_2
  596. this.tv_1=create tv_1
  597. this.p_resize=create p_resize
  598. this.cbx_2=create cbx_2
  599. this.ddlb_mtrlorigin=create ddlb_mtrlorigin
  600. this.st_1=create st_1
  601. this.st_5=create st_5
  602. this.cb_billfunc=create cb_billfunc
  603. this.cb_other=create cb_other
  604. this.cbx_ifrqqty=create cbx_ifrqqty
  605. this.cbx_iftaskqty=create cbx_iftaskqty
  606. iCurrent=UpperBound(this.Control)
  607. this.Control[iCurrent+1]=this.cbx_1
  608. this.Control[iCurrent+2]=this.ddlb_scid
  609. this.Control[iCurrent+3]=this.tab_1
  610. this.Control[iCurrent+4]=this.cbx_ifminqty
  611. this.Control[iCurrent+5]=this.cbx_ifnoallocqty
  612. this.Control[iCurrent+6]=this.cbx_ifbuytask
  613. this.Control[iCurrent+7]=this.cbx_iforder
  614. this.Control[iCurrent+8]=this.cbx_ifwfjg
  615. this.Control[iCurrent+9]=this.st_2
  616. this.Control[iCurrent+10]=this.tv_1
  617. this.Control[iCurrent+11]=this.p_resize
  618. this.Control[iCurrent+12]=this.cbx_2
  619. this.Control[iCurrent+13]=this.ddlb_mtrlorigin
  620. this.Control[iCurrent+14]=this.st_1
  621. this.Control[iCurrent+15]=this.st_5
  622. this.Control[iCurrent+16]=this.cb_billfunc
  623. this.Control[iCurrent+17]=this.cb_other
  624. this.Control[iCurrent+18]=this.cbx_ifrqqty
  625. this.Control[iCurrent+19]=this.cbx_iftaskqty
  626. end on
  627. on w_rp_mtrl_will_rqqty.destroy
  628. call super::destroy
  629. destroy(this.cbx_1)
  630. destroy(this.ddlb_scid)
  631. destroy(this.tab_1)
  632. destroy(this.cbx_ifminqty)
  633. destroy(this.cbx_ifnoallocqty)
  634. destroy(this.cbx_ifbuytask)
  635. destroy(this.cbx_iforder)
  636. destroy(this.cbx_ifwfjg)
  637. destroy(this.st_2)
  638. destroy(this.tv_1)
  639. destroy(this.p_resize)
  640. destroy(this.cbx_2)
  641. destroy(this.ddlb_mtrlorigin)
  642. destroy(this.st_1)
  643. destroy(this.st_5)
  644. destroy(this.cb_billfunc)
  645. destroy(this.cb_other)
  646. destroy(this.cbx_ifrqqty)
  647. destroy(this.cbx_iftaskqty)
  648. end on
  649. event resize;ln_bar.endx = this.width
  650. ln_bar2.endx = this.width
  651. ln_1.endx = this.width
  652. ln_2.endx = this.width
  653. ln_3.endx = this.width
  654. ln_4.endx = this.width
  655. r_bar.width = this.width
  656. Long w_width,w_height
  657. w_width = 3600
  658. w_height = 2300
  659. IF newwidth < w_width THEN THIS.Width = w_width
  660. IF newheight < w_height THEN THIS.Height = w_height
  661. dw_1.Width = THIS.Width - dw_1.X - 60
  662. dw_1.Height = THIS.Height - (w_height - 1020)
  663. p_resize.Height = dw_1.Height
  664. tv_1.Height = dw_1.Height
  665. tab_1.Width = THIS.Width - (w_width - 3543)
  666. dw_order_ml.Width = THIS.Width - (w_width - 3502)
  667. dw_buytask.Width = THIS.Width - (w_width - 3502)
  668. dw_order.Width = THIS.Width - (w_width - 3502)
  669. dw_wfjg.Width = THIS.Width - (w_width - 3502)
  670. dw_saletask.Width = THIS.Width - (w_width - 3502)
  671. dw_ware.Width = THIS.Width - (w_width - 3502)
  672. tab_1.Y = THIS.Height - (w_height - 1444)
  673. end event
  674. event ue_before_open;call super::ue_before_open;if_ue_filter = True
  675. if_ue_sort = True
  676. if_ue_sentdataout = True
  677. IF sys_version = 802001 THEN //商业版
  678. cbx_iforder.Visible = False
  679. cbx_ifwfjg.Visible = False
  680. tab_1.tabpage_1.Visible = False
  681. tab_1.tabpage_3.Visible = False
  682. tab_1.tabpage_4.Visible = False
  683. END IF
  684. dw_order_ml = tab_1.tabpage_1.dw_2
  685. dw_buytask = tab_1.tabpage_2.dw_3
  686. dw_order = tab_1.tabpage_3.dw_4
  687. dw_wfjg = tab_1.tabpage_4.dw_5
  688. dw_saletask = tab_1.tabpage_5.dw_rq_taskmx
  689. dw_ware = tab_1.tabpage_6.dw_ware
  690. dw_order_ml.SetTransObject(sqlca)
  691. dw_buytask.SetTransObject(sqlca)
  692. dw_order.SetTransObject(sqlca)
  693. dw_wfjg.SetTransObject(sqlca)
  694. dw_saletask.SetTransObject(sqlca)
  695. dw_ware.SetTransObject(sqlca)
  696. p_resize.PictureName = ProfileString(SYS_INIFILENAME, "w_rp_mtrl_will_rqqty", "p_resize", 'w_resize_2.bmp')
  697. IF p_resize.PictureName = 'w_resize_2.bmp' THEN
  698. p_resize.X = 891
  699. dw_1.X = 928
  700. tv_1.Visible = TRUE
  701. ELSE
  702. p_resize.X = 0
  703. dw_1.X = p_resize.Width + 5
  704. tv_1.Visible = FALSE
  705. END IF
  706. THIS.TriggerEvent(Resize!)
  707. end event
  708. event close;call super::close;SetProfileString(SYS_INIFILENAME,"w_rp_mtrl_will_rqqty","p_resize",p_resize.PictureName)
  709. end event
  710. event ue_before_openretrieve;call super::ue_before_openretrieve;EM_1.Text = String(RelativeDate ( Today(), 30 ),'YYYY-MM-DD')
  711. cur_mtrlorigin = integer(f_ProfileString (sys_empid,dw_1.DataObject, "ddlb_mtrlorigin",'0'))
  712. ddlb_mtrlorigin.uf_setitem(cur_mtrlorigin)
  713. end event
  714. event ue_sentdataout;IF NOT f_power_ind(1830) THEN
  715. MessageBox(publ_operator,'你没有使用权限!')
  716. RETURN
  717. END IF
  718. OpenWithParm(w_sentdataout,DW_1)
  719. end event
  720. type cb_func from w_publ_easyq`cb_func within w_rp_mtrl_will_rqqty
  721. end type
  722. type cb_exit from w_publ_easyq`cb_exit within w_rp_mtrl_will_rqqty
  723. integer x = 1477
  724. end type
  725. type cb_2 from w_publ_easyq`cb_2 within w_rp_mtrl_will_rqqty
  726. integer x = 1175
  727. end type
  728. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_mtrl_will_rqqty
  729. boolean visible = false
  730. integer x = 1394
  731. integer y = 512
  732. end type
  733. type cb_1 from w_publ_easyq`cb_1 within w_rp_mtrl_will_rqqty
  734. end type
  735. event cb_1::clicked;call super::clicked;Int li_qty,li_ifminqty,li_ifnoallocqty,li_ifbuytask,li_iforder,li_ifwfjg,li_ifrqqty,li_iftaskqty
  736. DateTime ld_dt
  737. ld_dt = DateTime(Date(em_1.Text),Time('23:59:59'))
  738. IF cbx_1.Checked THEN li_qty = 1
  739. IF cbx_ifminqty.Checked THEN li_ifminqty = 1
  740. IF cbx_ifnoallocqty.Checked THEN li_ifnoallocqty = 1
  741. IF cbx_ifbuytask.Checked THEN li_ifbuytask = 1
  742. IF cbx_iforder.Checked THEN li_iforder = 1
  743. IF cbx_ifwfjg.Checked THEN li_ifwfjg = 1
  744. if cbx_ifrqqty.checked then li_ifrqqty = 1
  745. if cbx_iftaskqty.checked then li_iftaskqty = 1
  746. DELETE FROM u_parm_pay Where id = 9 ;
  747. IF sqlca.SQLCode <> 0 THEN
  748. MessageBox('系统提示','数据库操作失败!')
  749. ROLLBACK;
  750. RETURN
  751. END IF
  752. INSERT INTO u_parm_pay (firstdate,enddate,id)
  753. Values (:ld_dt,:ld_dt,9);
  754. IF sqlca.SQLCode <> 0 THEN
  755. MessageBox('系统提示','数据库操作失败')
  756. ROLLBACK;
  757. RETURN
  758. END IF
  759. COMMIT;
  760. dw_1.Retrieve(cur_scid_arr,cur_mtrlorigin,li_qty,li_ifminqty,li_ifnoallocqty,li_ifbuytask,li_iforder,li_ifwfjg,ls_handtype,cur_mtrlkind,li_ifrqqty,li_iftaskqty)
  761. PARENT.TriggerEvent('retrieve_mx')
  762. wf_cmpl_qty() //计算可装数
  763. end event
  764. type st_3 from w_publ_easyq`st_3 within w_rp_mtrl_will_rqqty
  765. boolean visible = false
  766. integer x = 1138
  767. integer y = 524
  768. integer width = 142
  769. string text = "日期:"
  770. end type
  771. type st_4 from w_publ_easyq`st_4 within w_rp_mtrl_will_rqqty
  772. boolean visible = false
  773. integer x = 1175
  774. integer y = 640
  775. end type
  776. type em_1 from w_publ_easyq`em_1 within w_rp_mtrl_will_rqqty
  777. integer x = 2181
  778. integer y = 188
  779. integer width = 398
  780. end type
  781. type em_2 from w_publ_easyq`em_2 within w_rp_mtrl_will_rqqty
  782. boolean visible = false
  783. integer x = 1083
  784. integer y = 624
  785. boolean enabled = false
  786. end type
  787. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_mtrl_will_rqqty
  788. boolean visible = false
  789. integer x = 1902
  790. integer y = 512
  791. end type
  792. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_mtrl_will_rqqty
  793. integer x = 1678
  794. integer y = 12
  795. end type
  796. type dw_1 from w_publ_easyq`dw_1 within w_rp_mtrl_will_rqqty
  797. integer x = 928
  798. integer width = 2903
  799. integer height = 1020
  800. string title = "缺料明细"
  801. string dataobject = "dw_rp_mtrl_will_rqqty"
  802. boolean maxbox = true
  803. end type
  804. event dw_1::rowfocuschanged;call super::rowfocuschanged;PARENT.TriggerEvent('retrieve_mx')
  805. PARENT.TriggerEvent('ue_retrieve_info')
  806. end event
  807. event dw_1::clicked;call super::clicked;IF row > 0 THEN
  808. THIS.SelectRow(0,FALSE)
  809. THIS.SelectRow(row,TRUE)
  810. this.setrow(row)
  811. END IF
  812. end event
  813. event dw_1::doubleclicked;call super::doubleclicked;parent.triggerevent("ue_view_mtrl_mx")
  814. end event
  815. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_mtrl_will_rqqty
  816. integer y = 664
  817. end type
  818. type sle_cust from w_publ_easyq`sle_cust within w_rp_mtrl_will_rqqty
  819. integer y = 664
  820. end type
  821. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_mtrl_will_rqqty
  822. integer y = 680
  823. end type
  824. type st_cust from w_publ_easyq`st_cust within w_rp_mtrl_will_rqqty
  825. integer y = 680
  826. end type
  827. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_mtrl_will_rqqty
  828. boolean visible = true
  829. integer x = 1678
  830. integer y = 96
  831. end type
  832. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_mtrl_will_rqqty
  833. integer x = 2587
  834. integer y = 188
  835. end type
  836. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_mtrl_will_rqqty
  837. boolean visible = false
  838. integer x = 1422
  839. integer y = 608
  840. end type
  841. type pb_2 from w_publ_easyq`pb_2 within w_rp_mtrl_will_rqqty
  842. boolean visible = false
  843. integer x = 1531
  844. integer y = 608
  845. end type
  846. type cb_help from w_publ_easyq`cb_help within w_rp_mtrl_will_rqqty
  847. integer x = 1326
  848. end type
  849. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_mtrl_will_rqqty
  850. integer x = 919
  851. end type
  852. type gb_1 from w_publ_easyq`gb_1 within w_rp_mtrl_will_rqqty
  853. integer x = 1138
  854. integer y = 676
  855. integer width = 1696
  856. integer height = 60
  857. long backcolor = 134217739
  858. end type
  859. type ln_bar from w_publ_easyq`ln_bar within w_rp_mtrl_will_rqqty
  860. end type
  861. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_mtrl_will_rqqty
  862. end type
  863. type r_bar from w_publ_easyq`r_bar within w_rp_mtrl_will_rqqty
  864. end type
  865. type ln_1 from w_publ_easyq`ln_1 within w_rp_mtrl_will_rqqty
  866. end type
  867. type ln_2 from w_publ_easyq`ln_2 within w_rp_mtrl_will_rqqty
  868. end type
  869. type ln_3 from w_publ_easyq`ln_3 within w_rp_mtrl_will_rqqty
  870. end type
  871. type ln_4 from w_publ_easyq`ln_4 within w_rp_mtrl_will_rqqty
  872. end type
  873. type cbx_1 from checkbox within w_rp_mtrl_will_rqqty
  874. integer x = 1385
  875. integer y = 200
  876. integer width = 521
  877. integer height = 60
  878. boolean bringtotop = true
  879. integer textsize = -9
  880. integer weight = 400
  881. fontcharset fontcharset = gb2312charset!
  882. fontpitch fontpitch = variable!
  883. string facename = "宋体"
  884. long textcolor = 33554432
  885. long backcolor = 134217739
  886. string text = "只显示缺料物料"
  887. boolean checked = true
  888. end type
  889. event clicked;int li_if
  890. if this.checked then
  891. li_if=1
  892. else
  893. li_if=0
  894. end if
  895. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifqty", string(li_if))
  896. cb_1.triggerevent(clicked!)
  897. end event
  898. event constructor;int li_if
  899. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifqty", '1'))
  900. if li_if =0 then
  901. this.checked=false
  902. else
  903. this.checked=true
  904. end if
  905. end event
  906. type ddlb_scid from uo_ddlb_scid within w_rp_mtrl_will_rqqty
  907. integer x = 155
  908. integer y = 188
  909. integer width = 558
  910. integer height = 544
  911. integer taborder = 90
  912. boolean bringtotop = true
  913. end type
  914. event constructor;call super::constructor;cur_scid=this.uo_scid
  915. cur_scid_arr = THIS.uo_scid_arr
  916. end event
  917. event selectionchanged;call super::selectionchanged;cur_scid=this.uo_scid
  918. cur_scid_arr = THIS.uo_scid_arr
  919. parent.triggerevent("retrieve_pageretr")
  920. end event
  921. type tab_1 from tab within w_rp_mtrl_will_rqqty
  922. integer y = 1444
  923. integer width = 3826
  924. integer height = 704
  925. integer taborder = 80
  926. boolean bringtotop = true
  927. integer textsize = -9
  928. integer weight = 400
  929. fontcharset fontcharset = gb2312charset!
  930. fontpitch fontpitch = variable!
  931. string facename = "宋体"
  932. long backcolor = 134217739
  933. boolean raggedright = true
  934. boolean focusonbuttondown = true
  935. integer selectedtab = 1
  936. tabpage_5 tabpage_5
  937. tabpage_1 tabpage_1
  938. tabpage_6 tabpage_6
  939. tabpage_2 tabpage_2
  940. tabpage_3 tabpage_3
  941. tabpage_4 tabpage_4
  942. end type
  943. on tab_1.create
  944. this.tabpage_5=create tabpage_5
  945. this.tabpage_1=create tabpage_1
  946. this.tabpage_6=create tabpage_6
  947. this.tabpage_2=create tabpage_2
  948. this.tabpage_3=create tabpage_3
  949. this.tabpage_4=create tabpage_4
  950. this.Control[]={this.tabpage_5,&
  951. this.tabpage_1,&
  952. this.tabpage_6,&
  953. this.tabpage_2,&
  954. this.tabpage_3,&
  955. this.tabpage_4}
  956. end on
  957. on tab_1.destroy
  958. destroy(this.tabpage_5)
  959. destroy(this.tabpage_1)
  960. destroy(this.tabpage_6)
  961. destroy(this.tabpage_2)
  962. destroy(this.tabpage_3)
  963. destroy(this.tabpage_4)
  964. end on
  965. type tabpage_5 from userobject within tab_1
  966. integer x = 18
  967. integer y = 96
  968. integer width = 3790
  969. integer height = 592
  970. long backcolor = 134217739
  971. string text = "订单需求明细"
  972. long tabtextcolor = 33554432
  973. long tabbackcolor = 134217739
  974. long picturemaskcolor = 536870912
  975. dw_rq_taskmx dw_rq_taskmx
  976. end type
  977. on tabpage_5.create
  978. this.dw_rq_taskmx=create dw_rq_taskmx
  979. this.Control[]={this.dw_rq_taskmx}
  980. end on
  981. on tabpage_5.destroy
  982. destroy(this.dw_rq_taskmx)
  983. end on
  984. type dw_rq_taskmx from u_dw_rbtnfilter within tabpage_5
  985. integer width = 3502
  986. integer height = 592
  987. string dataobject = "dw_rp_mtrl_will_rqqty_mx_saletask"
  988. boolean hscrollbar = true
  989. boolean vscrollbar = true
  990. boolean hsplitscroll = true
  991. boolean rbutton_setposition_use = true
  992. boolean titleclick_sort_use = true
  993. end type
  994. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  995. THIS.SelectRow(0,FALSE)
  996. THIS.SelectRow(currentrow,TRUE)
  997. END IF
  998. end event
  999. type tabpage_1 from userobject within tab_1
  1000. integer x = 18
  1001. integer y = 96
  1002. integer width = 3790
  1003. integer height = 592
  1004. long backcolor = 134217739
  1005. string text = "生产需求明细"
  1006. long tabbackcolor = 134217739
  1007. long picturemaskcolor = 536870912
  1008. cb_4 cb_4
  1009. dw_2 dw_2
  1010. end type
  1011. on tabpage_1.create
  1012. this.cb_4=create cb_4
  1013. this.dw_2=create dw_2
  1014. this.Control[]={this.cb_4,&
  1015. this.dw_2}
  1016. end on
  1017. on tabpage_1.destroy
  1018. destroy(this.cb_4)
  1019. destroy(this.dw_2)
  1020. end on
  1021. type cb_4 from commandbutton within tabpage_1
  1022. integer y = 4
  1023. integer width = 402
  1024. integer height = 72
  1025. integer taborder = 20
  1026. integer textsize = -9
  1027. integer weight = 400
  1028. fontcharset fontcharset = gb2312charset!
  1029. fontpitch fontpitch = variable!
  1030. string facename = "宋体"
  1031. string text = "修改需求日期"
  1032. end type
  1033. event clicked;
  1034. s_rp_mtrl_will_rqqty_rqdate_mod s_rqdate
  1035. Long ll_row
  1036. DateTime ld_dt
  1037. ld_dt = DateTime(Date(em_1.Text),Time('23:59:59'))
  1038. ll_row = dw_1.GetRow()
  1039. IF ll_row <= 0 THEN RETURN
  1040. s_rqdate.scid = cur_scid_arr
  1041. s_rqdate.mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
  1042. s_rqdate.status = dw_1.Object.uv_mtrl_willuse_status[ll_row]
  1043. s_rqdate.woodcode = dw_1.Object.uv_mtrl_willuse_woodcode[ll_row]
  1044. s_rqdate.pcode = dw_1.Object.uv_mtrl_willuse_pcode[ll_row]
  1045. s_rqdate.rqdate = ld_dt
  1046. OpenWithParm(w_rp_mtrl_will_rqqty_rqdate_mod,s_rqdate)
  1047. PARENT.GetParent().GetParent().TriggerEvent('retrieve_mx')
  1048. end event
  1049. type dw_2 from u_dw_rbtnfilter within tabpage_1
  1050. integer y = 80
  1051. integer width = 3502
  1052. integer height = 512
  1053. integer taborder = 20
  1054. string dataobject = "dw_rp_mtrl_will_rqqty_mx_order_ml"
  1055. boolean hscrollbar = true
  1056. boolean vscrollbar = true
  1057. boolean hsplitscroll = true
  1058. boolean rbutton_setposition_use = true
  1059. boolean titleclick_sort_use = true
  1060. end type
  1061. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  1062. THIS.SelectRow(0,FALSE)
  1063. THIS.SelectRow(currentrow,TRUE)
  1064. END IF
  1065. end event
  1066. type tabpage_6 from userobject within tab_1
  1067. integer x = 18
  1068. integer y = 96
  1069. integer width = 3790
  1070. integer height = 592
  1071. long backcolor = 134217739
  1072. string text = "库存明细"
  1073. long tabtextcolor = 33554432
  1074. long tabbackcolor = 134217739
  1075. long picturemaskcolor = 536870912
  1076. dw_ware dw_ware
  1077. end type
  1078. on tabpage_6.create
  1079. this.dw_ware=create dw_ware
  1080. this.Control[]={this.dw_ware}
  1081. end on
  1082. on tabpage_6.destroy
  1083. destroy(this.dw_ware)
  1084. end on
  1085. type dw_ware from u_dw_rbtnfilter within tabpage_6
  1086. integer width = 3081
  1087. integer height = 592
  1088. string dataobject = "dw_rp_mtrl_will_rqqty_mx_mtrlware"
  1089. boolean hscrollbar = true
  1090. boolean vscrollbar = true
  1091. boolean hsplitscroll = true
  1092. boolean rbutton_setposition_use = true
  1093. boolean titleclick_sort_use = true
  1094. end type
  1095. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  1096. THIS.SelectRow(0,FALSE)
  1097. THIS.SelectRow(currentrow,TRUE)
  1098. END IF
  1099. end event
  1100. type tabpage_2 from userobject within tab_1
  1101. integer x = 18
  1102. integer y = 96
  1103. integer width = 3790
  1104. integer height = 592
  1105. long backcolor = 134217739
  1106. string text = "采购未到数"
  1107. long tabtextcolor = 33554432
  1108. long tabbackcolor = 134217739
  1109. long picturemaskcolor = 536870912
  1110. dw_3 dw_3
  1111. end type
  1112. on tabpage_2.create
  1113. this.dw_3=create dw_3
  1114. this.Control[]={this.dw_3}
  1115. end on
  1116. on tabpage_2.destroy
  1117. destroy(this.dw_3)
  1118. end on
  1119. type dw_3 from u_dw_rbtnfilter within tabpage_2
  1120. integer width = 3502
  1121. integer height = 592
  1122. integer taborder = 20
  1123. string dataobject = "dw_rp_mtrl_will_rqqty_mx_buytask"
  1124. boolean hscrollbar = true
  1125. boolean vscrollbar = true
  1126. boolean hsplitscroll = true
  1127. boolean rbutton_setposition_use = true
  1128. boolean titleclick_sort_use = true
  1129. end type
  1130. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  1131. THIS.SelectRow(0,FALSE)
  1132. THIS.SelectRow(currentrow,TRUE)
  1133. END IF
  1134. end event
  1135. type tabpage_3 from userobject within tab_1
  1136. integer x = 18
  1137. integer y = 96
  1138. integer width = 3790
  1139. integer height = 592
  1140. long backcolor = 134217739
  1141. string text = "计划未完成数"
  1142. long tabtextcolor = 33554432
  1143. long tabbackcolor = 134217739
  1144. long picturemaskcolor = 536870912
  1145. dw_4 dw_4
  1146. end type
  1147. on tabpage_3.create
  1148. this.dw_4=create dw_4
  1149. this.Control[]={this.dw_4}
  1150. end on
  1151. on tabpage_3.destroy
  1152. destroy(this.dw_4)
  1153. end on
  1154. type dw_4 from u_dw_rbtnfilter within tabpage_3
  1155. integer width = 3488
  1156. integer height = 592
  1157. integer taborder = 20
  1158. string dataobject = "dw_rp_mtrl_will_rqqty_mx_order"
  1159. boolean hscrollbar = true
  1160. boolean vscrollbar = true
  1161. boolean hsplitscroll = true
  1162. boolean rbutton_setposition_use = true
  1163. boolean titleclick_sort_use = true
  1164. end type
  1165. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  1166. THIS.SelectRow(0,FALSE)
  1167. THIS.SelectRow(currentrow,TRUE)
  1168. END IF
  1169. end event
  1170. type tabpage_4 from userobject within tab_1
  1171. integer x = 18
  1172. integer y = 96
  1173. integer width = 3790
  1174. integer height = 592
  1175. long backcolor = 134217739
  1176. string text = "外协未完成数"
  1177. long tabtextcolor = 33554432
  1178. long tabbackcolor = 134217739
  1179. long picturemaskcolor = 536870912
  1180. dw_5 dw_5
  1181. end type
  1182. on tabpage_4.create
  1183. this.dw_5=create dw_5
  1184. this.Control[]={this.dw_5}
  1185. end on
  1186. on tabpage_4.destroy
  1187. destroy(this.dw_5)
  1188. end on
  1189. type dw_5 from u_dw_rbtnfilter within tabpage_4
  1190. integer width = 3502
  1191. integer height = 592
  1192. integer taborder = 20
  1193. string dataobject = "dw_rp_mtrl_will_rqqty_mx_wfjg"
  1194. boolean hscrollbar = true
  1195. boolean vscrollbar = true
  1196. boolean hsplitscroll = true
  1197. boolean rbutton_setposition_use = true
  1198. boolean titleclick_sort_use = true
  1199. end type
  1200. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  1201. THIS.SelectRow(0,FALSE)
  1202. THIS.SelectRow(currentrow,TRUE)
  1203. END IF
  1204. end event
  1205. type cbx_ifminqty from checkbox within w_rp_mtrl_will_rqqty
  1206. integer x = 270
  1207. integer y = 316
  1208. integer width = 411
  1209. integer height = 60
  1210. boolean bringtotop = true
  1211. integer textsize = -9
  1212. integer weight = 400
  1213. fontcharset fontcharset = gb2312charset!
  1214. fontpitch fontpitch = variable!
  1215. string facename = "宋体"
  1216. long textcolor = 33554432
  1217. long backcolor = 134217739
  1218. string text = "考虑库存下限"
  1219. boolean checked = true
  1220. end type
  1221. event clicked;int li_if
  1222. if this.checked then
  1223. li_if=1
  1224. else
  1225. li_if=0
  1226. end if
  1227. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifminqty", string(li_if))
  1228. cb_1.triggerevent(clicked!)
  1229. end event
  1230. event constructor;int li_if
  1231. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifminqty", '1'))
  1232. if li_if =0 then
  1233. this.checked=false
  1234. else
  1235. this.checked=true
  1236. end if
  1237. end event
  1238. type cbx_ifnoallocqty from checkbox within w_rp_mtrl_will_rqqty
  1239. integer x = 727
  1240. integer y = 316
  1241. integer width = 402
  1242. integer height = 60
  1243. boolean bringtotop = true
  1244. integer textsize = -9
  1245. integer weight = 400
  1246. fontcharset fontcharset = gb2312charset!
  1247. fontpitch fontpitch = variable!
  1248. string facename = "宋体"
  1249. long textcolor = 33554432
  1250. long backcolor = 134217739
  1251. string text = "考虑库存数"
  1252. boolean checked = true
  1253. end type
  1254. event clicked;int li_if
  1255. if this.checked then
  1256. li_if=1
  1257. else
  1258. li_if=0
  1259. end if
  1260. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifnoallocqty", string(li_if))
  1261. cb_1.triggerevent(clicked!)
  1262. end event
  1263. event constructor;int li_if
  1264. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifnoallocqty", '1'))
  1265. if li_if =0 then
  1266. this.checked=false
  1267. else
  1268. this.checked=true
  1269. end if
  1270. end event
  1271. type cbx_ifbuytask from checkbox within w_rp_mtrl_will_rqqty
  1272. integer x = 1175
  1273. integer y = 316
  1274. integer width = 466
  1275. integer height = 60
  1276. boolean bringtotop = true
  1277. integer textsize = -9
  1278. integer weight = 400
  1279. fontcharset fontcharset = gb2312charset!
  1280. fontpitch fontpitch = variable!
  1281. string facename = "宋体"
  1282. long textcolor = 33554432
  1283. long backcolor = 134217739
  1284. string text = "考虑采购未到数"
  1285. boolean checked = true
  1286. end type
  1287. event clicked;int li_if
  1288. if this.checked then
  1289. li_if=1
  1290. else
  1291. li_if=0
  1292. end if
  1293. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifbuytask", string(li_if))
  1294. cb_1.triggerevent(clicked!)
  1295. end event
  1296. event constructor;int li_if
  1297. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifbuytask", '1'))
  1298. if li_if =0 then
  1299. this.checked=false
  1300. else
  1301. this.checked=true
  1302. end if
  1303. end event
  1304. type cbx_iforder from checkbox within w_rp_mtrl_will_rqqty
  1305. integer x = 1687
  1306. integer y = 316
  1307. integer width = 521
  1308. integer height = 60
  1309. boolean bringtotop = true
  1310. integer textsize = -9
  1311. integer weight = 400
  1312. fontcharset fontcharset = gb2312charset!
  1313. fontpitch fontpitch = variable!
  1314. string facename = "宋体"
  1315. long textcolor = 33554432
  1316. long backcolor = 134217739
  1317. string text = "考虑生产未完成数"
  1318. boolean checked = true
  1319. end type
  1320. event clicked;int li_if
  1321. if this.checked then
  1322. li_if=1
  1323. else
  1324. li_if=0
  1325. end if
  1326. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "iforder", string(li_if))
  1327. cb_1.triggerevent(clicked!)
  1328. end event
  1329. event constructor;int li_if
  1330. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "iforder", '1'))
  1331. if li_if =0 then
  1332. this.checked=false
  1333. else
  1334. this.checked=true
  1335. end if
  1336. end event
  1337. type cbx_ifwfjg from checkbox within w_rp_mtrl_will_rqqty
  1338. integer x = 2254
  1339. integer y = 316
  1340. integer width = 521
  1341. integer height = 60
  1342. boolean bringtotop = true
  1343. integer textsize = -9
  1344. integer weight = 400
  1345. fontcharset fontcharset = gb2312charset!
  1346. fontpitch fontpitch = variable!
  1347. string facename = "宋体"
  1348. long textcolor = 33554432
  1349. long backcolor = 134217739
  1350. string text = "考虑外协未完成数"
  1351. boolean checked = true
  1352. end type
  1353. event clicked;int li_if
  1354. if this.checked then
  1355. li_if=1
  1356. else
  1357. li_if=0
  1358. end if
  1359. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifwfjg", string(li_if))
  1360. cb_1.triggerevent(clicked!)
  1361. end event
  1362. event constructor;int li_if
  1363. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifwfjg", '1'))
  1364. if li_if =0 then
  1365. this.checked=false
  1366. else
  1367. this.checked=true
  1368. end if
  1369. end event
  1370. type st_2 from statictext within w_rp_mtrl_will_rqqty
  1371. integer x = 1911
  1372. integer y = 208
  1373. integer width = 256
  1374. integer height = 48
  1375. boolean bringtotop = true
  1376. integer textsize = -9
  1377. integer weight = 400
  1378. fontcharset fontcharset = gb2312charset!
  1379. fontpitch fontpitch = variable!
  1380. string facename = "宋体"
  1381. long textcolor = 33554432
  1382. long backcolor = 134217739
  1383. string text = "需求日期"
  1384. alignment alignment = right!
  1385. boolean focusrectangle = false
  1386. end type
  1387. type tv_1 from uo_tv_mtrltype within w_rp_mtrl_will_rqqty
  1388. integer y = 412
  1389. integer width = 887
  1390. integer height = 1020
  1391. integer taborder = 70
  1392. boolean bringtotop = true
  1393. integer textsize = -9
  1394. fontcharset fontcharset = gb2312charset!
  1395. fontfamily fontfamily = anyfont!
  1396. string facename = "宋体"
  1397. end type
  1398. event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype
  1399. ls_handtype = ls_handtype + '%'
  1400. cb_1.triggerevent(clicked!)
  1401. end event
  1402. type p_resize from picture within w_rp_mtrl_will_rqqty
  1403. integer x = 891
  1404. integer y = 412
  1405. integer width = 32
  1406. integer height = 1020
  1407. boolean bringtotop = true
  1408. string pointer = "HyperLink!"
  1409. string picturename = "w_resize_2.bmp"
  1410. boolean focusrectangle = false
  1411. end type
  1412. event clicked;IF THIS.picturename = 'w_resize_1.bmp' THEN
  1413. THIS.picturename = 'w_resize_2.bmp'
  1414. THIS.X = 891
  1415. dw_1.X = 928
  1416. tv_1.Visible = TRUE
  1417. ELSE
  1418. THIS.picturename = 'w_resize_1.bmp'
  1419. THIS.X = 0
  1420. dw_1.X = p_resize.Width + 5
  1421. tv_1.Visible = FALSE
  1422. END IF
  1423. PARENT.TriggerEvent(Resize!)
  1424. end event
  1425. type cbx_2 from checkbox within w_rp_mtrl_will_rqqty
  1426. integer x = 41
  1427. integer y = 316
  1428. integer width = 206
  1429. integer height = 60
  1430. boolean bringtotop = true
  1431. integer textsize = -9
  1432. integer weight = 400
  1433. fontcharset fontcharset = gb2312charset!
  1434. fontpitch fontpitch = variable!
  1435. string facename = "宋体"
  1436. long textcolor = 16711680
  1437. long backcolor = 134217739
  1438. string text = "全选"
  1439. end type
  1440. event clicked;Long ll_i
  1441. IF THIS.Checked THEN
  1442. FOR ll_i = 1 TO dw_1.RowCount()
  1443. dw_1.Object.selectflag[ll_i] = 1
  1444. NEXT
  1445. ELSE
  1446. FOR ll_i = 1 TO dw_1.RowCount()
  1447. dw_1.Object.selectflag[ll_i] = 0
  1448. NEXT
  1449. END IF
  1450. end event
  1451. type ddlb_mtrlorigin from uo_ddlb_mtrlorigin within w_rp_mtrl_will_rqqty
  1452. integer x = 859
  1453. integer y = 188
  1454. integer width = 457
  1455. integer taborder = 20
  1456. boolean bringtotop = true
  1457. end type
  1458. event selectionchanged;call super::selectionchanged;cur_mtrlorigin = this.uo_mtrlorigin
  1459. //SetProfileString (sys_inifilename,dw_1.DATAOBJECT, "ddlb_mtrlorigin",string(cur_mtrlorigin))
  1460. f_SetProfileString (sys_empid,dw_1.DataObject, "ddlb_mtrlorigin",String(cur_mtrlorigin))
  1461. cb_1.triggerevent(clicked!)
  1462. end event
  1463. type st_1 from statictext within w_rp_mtrl_will_rqqty
  1464. integer x = 18
  1465. integer y = 204
  1466. integer width = 137
  1467. integer height = 48
  1468. boolean bringtotop = true
  1469. integer textsize = -9
  1470. integer weight = 400
  1471. fontcharset fontcharset = gb2312charset!
  1472. fontpitch fontpitch = variable!
  1473. string facename = "宋体"
  1474. long textcolor = 33554432
  1475. long backcolor = 134217739
  1476. string text = "分部"
  1477. boolean focusrectangle = false
  1478. end type
  1479. type st_5 from statictext within w_rp_mtrl_will_rqqty
  1480. integer x = 722
  1481. integer y = 204
  1482. integer width = 137
  1483. integer height = 48
  1484. boolean bringtotop = true
  1485. integer textsize = -9
  1486. integer weight = 400
  1487. fontcharset fontcharset = gb2312charset!
  1488. fontpitch fontpitch = variable!
  1489. string facename = "宋体"
  1490. long textcolor = 33554432
  1491. long backcolor = 134217739
  1492. string text = "来源"
  1493. boolean focusrectangle = false
  1494. end type
  1495. type cb_billfunc from uo_imflatbutton within w_rp_mtrl_will_rqqty
  1496. integer x = 302
  1497. integer width = 256
  1498. integer height = 164
  1499. integer taborder = 20
  1500. boolean bringtotop = true
  1501. string text = "辅助功能"
  1502. string normalpicname = "update.BMP"
  1503. integer picsize = 16
  1504. toolbaralignment pic_align = alignattop!
  1505. boolean border = false
  1506. end type
  1507. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1508. String menustr
  1509. menustr = "Text=辅助生成采购订单~tEvent=ue_create_buytask"
  1510. menustr = menustr + "|" + "Text=辅助建立采购订单~tEvent=ue_create_buytask_view"
  1511. //menustr = menustr + "|" + "Text=辅助生成外协订单~tEvent=ue_create_orderwfjg"
  1512. IF Len(Trim(menustr)) <> 0 THEN
  1513. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  1514. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  1515. dmPopupMenu.mf_PopMenu()
  1516. DESTROY dmPopupMenu
  1517. END IF
  1518. end event
  1519. type cb_other from uo_imflatbutton within w_rp_mtrl_will_rqqty
  1520. integer x = 558
  1521. integer width = 361
  1522. integer height = 164
  1523. integer taborder = 30
  1524. boolean bringtotop = true
  1525. string text = "物料相关查询"
  1526. string normalpicname = "imexport.BMP"
  1527. integer picsize = 16
  1528. toolbaralignment pic_align = alignattop!
  1529. boolean border = false
  1530. end type
  1531. event clicked;call super::clicked;Long ll_row
  1532. ll_row = dw_1.GetRow()
  1533. IF ll_row <= 0 THEN
  1534. MessageBox('提示','请选择物料', Information!, OK! )
  1535. RETURN
  1536. END IF
  1537. Long ll_mtrlid
  1538. ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
  1539. IF IsValid(w_mtrl_info) THEN
  1540. w_mtrl_info.WindowState = Normal!
  1541. w_mtrl_info.ins_mtrlid = ll_mtrlid
  1542. w_mtrl_info.wf_retrieve(ll_mtrlid)
  1543. ELSE
  1544. OpenWithParm(w_mtrl_info,ll_mtrlid)
  1545. END IF
  1546. end event
  1547. type cbx_ifrqqty from checkbox within w_rp_mtrl_will_rqqty
  1548. integer x = 2825
  1549. integer y = 316
  1550. integer width = 521
  1551. integer height = 60
  1552. boolean bringtotop = true
  1553. integer textsize = -9
  1554. integer weight = 400
  1555. fontcharset fontcharset = gb2312charset!
  1556. fontpitch fontpitch = variable!
  1557. string facename = "宋体"
  1558. long textcolor = 255
  1559. long backcolor = 134217739
  1560. string text = "考虑生产需求数"
  1561. boolean checked = true
  1562. end type
  1563. event clicked;int li_if
  1564. if this.checked then
  1565. li_if=1
  1566. else
  1567. li_if=0
  1568. end if
  1569. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifrqqty", string(li_if))
  1570. cb_1.triggerevent(clicked!)
  1571. end event
  1572. event constructor;int li_if
  1573. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifrqqty", '1'))
  1574. if li_if =0 then
  1575. this.checked=false
  1576. else
  1577. this.checked=true
  1578. end if
  1579. end event
  1580. type cbx_iftaskqty from checkbox within w_rp_mtrl_will_rqqty
  1581. integer x = 3355
  1582. integer y = 312
  1583. integer width = 466
  1584. integer height = 60
  1585. boolean bringtotop = true
  1586. integer textsize = -9
  1587. integer weight = 400
  1588. fontcharset fontcharset = gb2312charset!
  1589. fontpitch fontpitch = variable!
  1590. string facename = "宋体"
  1591. long textcolor = 33554432
  1592. long backcolor = 134217739
  1593. string text = "考虑订单需求数"
  1594. boolean checked = true
  1595. end type
  1596. event clicked;int li_if
  1597. if this.checked then
  1598. li_if=1
  1599. else
  1600. li_if=0
  1601. end if
  1602. f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "iftaskqty", string(li_if))
  1603. cb_1.triggerevent(clicked!)
  1604. end event
  1605. event constructor;int li_if
  1606. li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "iftaskqty", '1'))
  1607. if li_if =0 then
  1608. this.checked=false
  1609. else
  1610. this.checked=true
  1611. end if
  1612. end event