12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943 |
- $PBExportHeader$w_rp_mtrl_will_rqqty.srw
- forward
- global type w_rp_mtrl_will_rqqty from w_publ_easyq
- end type
- type cbx_1 from checkbox within w_rp_mtrl_will_rqqty
- end type
- type ddlb_scid from uo_ddlb_scid within w_rp_mtrl_will_rqqty
- end type
- type tab_1 from tab within w_rp_mtrl_will_rqqty
- end type
- type tabpage_5 from userobject within tab_1
- end type
- type dw_rq_taskmx from u_dw_rbtnfilter within tabpage_5
- end type
- type tabpage_5 from userobject within tab_1
- dw_rq_taskmx dw_rq_taskmx
- end type
- type tabpage_1 from userobject within tab_1
- end type
- type cb_4 from commandbutton within tabpage_1
- end type
- type dw_2 from u_dw_rbtnfilter within tabpage_1
- end type
- type tabpage_1 from userobject within tab_1
- cb_4 cb_4
- dw_2 dw_2
- end type
- type tabpage_6 from userobject within tab_1
- end type
- type dw_ware from u_dw_rbtnfilter within tabpage_6
- end type
- type tabpage_6 from userobject within tab_1
- dw_ware dw_ware
- end type
- type tabpage_2 from userobject within tab_1
- end type
- type dw_3 from u_dw_rbtnfilter within tabpage_2
- end type
- type tabpage_2 from userobject within tab_1
- dw_3 dw_3
- end type
- type tabpage_3 from userobject within tab_1
- end type
- type dw_4 from u_dw_rbtnfilter within tabpage_3
- end type
- type tabpage_3 from userobject within tab_1
- dw_4 dw_4
- end type
- type tabpage_4 from userobject within tab_1
- end type
- type dw_5 from u_dw_rbtnfilter within tabpage_4
- end type
- type tabpage_4 from userobject within tab_1
- dw_5 dw_5
- end type
- type tab_1 from tab within w_rp_mtrl_will_rqqty
- tabpage_5 tabpage_5
- tabpage_1 tabpage_1
- tabpage_6 tabpage_6
- tabpage_2 tabpage_2
- tabpage_3 tabpage_3
- tabpage_4 tabpage_4
- end type
- type cbx_ifminqty from checkbox within w_rp_mtrl_will_rqqty
- end type
- type cbx_ifnoallocqty from checkbox within w_rp_mtrl_will_rqqty
- end type
- type cbx_ifbuytask from checkbox within w_rp_mtrl_will_rqqty
- end type
- type cbx_iforder from checkbox within w_rp_mtrl_will_rqqty
- end type
- type cbx_ifwfjg from checkbox within w_rp_mtrl_will_rqqty
- end type
- type st_2 from statictext within w_rp_mtrl_will_rqqty
- end type
- type tv_1 from uo_tv_mtrltype within w_rp_mtrl_will_rqqty
- end type
- type p_resize from picture within w_rp_mtrl_will_rqqty
- end type
- type cbx_2 from checkbox within w_rp_mtrl_will_rqqty
- end type
- type ddlb_mtrlorigin from uo_ddlb_mtrlorigin within w_rp_mtrl_will_rqqty
- end type
- type st_1 from statictext within w_rp_mtrl_will_rqqty
- end type
- type st_5 from statictext within w_rp_mtrl_will_rqqty
- end type
- type cb_billfunc from uo_imflatbutton within w_rp_mtrl_will_rqqty
- end type
- type cb_other from uo_imflatbutton within w_rp_mtrl_will_rqqty
- end type
- type cbx_ifrqqty from checkbox within w_rp_mtrl_will_rqqty
- end type
- type cbx_iftaskqty from checkbox within w_rp_mtrl_will_rqqty
- end type
- end forward
- global type w_rp_mtrl_will_rqqty from w_publ_easyq
- integer width = 3895
- integer height = 2396
- string title = "物料监控"
- event retrieve_mx ( )
- event auto_requestbuy ( )
- event auto_wfjg ( )
- event auto_order ( )
- event ue_view_mtrl_mx ( )
- event ue_create_buytask ( )
- event ue_retrieve_info ( )
- event ue_create_buytask_view ( )
- cbx_1 cbx_1
- ddlb_scid ddlb_scid
- tab_1 tab_1
- cbx_ifminqty cbx_ifminqty
- cbx_ifnoallocqty cbx_ifnoallocqty
- cbx_ifbuytask cbx_ifbuytask
- cbx_iforder cbx_iforder
- cbx_ifwfjg cbx_ifwfjg
- st_2 st_2
- tv_1 tv_1
- p_resize p_resize
- cbx_2 cbx_2
- ddlb_mtrlorigin ddlb_mtrlorigin
- st_1 st_1
- st_5 st_5
- cb_billfunc cb_billfunc
- cb_other cb_other
- cbx_ifrqqty cbx_ifrqqty
- cbx_iftaskqty cbx_iftaskqty
- end type
- global w_rp_mtrl_will_rqqty w_rp_mtrl_will_rqqty
- type variables
- Int cur_mtrlorigin = 0 //当前显示物料来源
- Int cur_mtrlprp = -1
- Long cur_scid = 0
- Long cur_scid_arr[]
- int cur_mtrlkind = -1
- datawindow dw_order_ml,dw_buytask,dw_order,dw_wfjg
- datawindow dw_saletask, dw_ware
- String ls_handtype = ''
- end variables
- forward prototypes
- public function integer wf_cmpl_qty ()
- end prototypes
- event retrieve_mx();Long li_row,li_mtrlid
- String ls_status,ls_woodcode,ls_pcode
- DateTime ld_dt
- ld_dt = DateTime(Date(em_1.Text),Time('23:59:59'))
- li_row = dw_1.GetRow()
- IF li_row <= 0 THEN
- dw_order_ml.Reset()
- dw_buytask.Reset()
- dw_order.Reset()
- dw_wfjg.Reset()
- dw_saletask.Reset()
- dw_ware.Reset()
- ELSE
- li_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[li_row]
- ls_status = dw_1.Object.uv_mtrl_willuse_status[li_row]
- ls_woodcode = dw_1.Object.uv_mtrl_willuse_woodcode[li_row]
- ls_pcode = dw_1.Object.uv_mtrl_willuse_pcode[li_row]
- dw_order_ml.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
- dw_buytask.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
- dw_order.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
- dw_wfjg.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
- dw_saletask.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode,ld_dt)
- dw_ware.Retrieve(cur_scid_arr,li_mtrlid,ls_status,ls_woodcode,ls_pcode)
- END IF
- end event
- event auto_requestbuy();Long i,cnt
- s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
- s_tran.if_retrieve_all = local_retrieve_all //是否一次RETRIEVE所有行
- s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
- s_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
- s_tran.c_long = cur_scid
- s_tran.d_long = 1
- s_tran.d_string = ddlb_scid.Text
- IF NOT f_power_ind(1053) THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- dw_1.AcceptText()
- FOR i = 1 TO dw_1.RowCount()
- IF dw_1.Object.selectflag[i] = 1 THEN
- cnt++
- s_tran.arr_long[cnt] = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
- s_tran.arr_dec[cnt] = dw_1.Object.truerqqty[i]
- s_tran.arr_string[cnt] = dw_1.Object.uv_mtrl_willuse_status[i]
- s_tran.arr_string2[cnt] = dw_1.Object.uv_mtrl_willuse_woodcode[i]
- s_tran.arr_string3[cnt] = dw_1.Object.uv_mtrl_willuse_pcode[i]
- END IF
- NEXT
- IF cnt = 0 THEN
- MessageBox(publ_operator,'请选择物料')
- RETURN
- END IF
- //OpenWithParm(w_requestbuy,s_tran)
- end event
- event auto_wfjg();long i,cnt
- s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
- s_tran.if_retrieve_all = local_retrieve_all //是否一次RETRIEVE所有行
- s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
- s_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
- s_tran.c_long = cur_scid
- s_tran.d_long = 1
- s_tran.d_string = ddlb_scid.text
- if not f_power_ind(1251) then
- messagebox(publ_operator,'你没有使用权限!')
- return
- end if
- dw_1.accepttext()
- for i = 1 to dw_1.rowcount()
- if dw_1.object.selectflag[i]=1 then
- cnt++
- s_tran.arr_long[cnt] = dw_1.object.uv_mtrl_willuse_mtrlid[i]
- s_tran.arr_dec[cnt] = dw_1.object.truerqqty[i]
- end if
- next
- if cnt = 0 then
- messagebox(publ_operator,'请选择物料')
- return
- end if
- //openwithparm(w_request_wfjg,s_tran)
- end event
- event auto_order();Long i,cnt
- s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
- s_tran.if_retrieve_all = local_retrieve_all //是否一次RETRIEVE所有行
- s_tran.work_mode = 0 //0-单纯编辑模式, 1-选择模式
- s_tran.arg_pkid = 0 //目标定位PKID (备用)
- s_tran.arg_string_code = '' //查询列部分内容,用于初步筛选
- s_tran.c_long = cur_scid
- s_tran.d_long = 1
- s_tran.d_string = ddlb_scid.Text
- IF NOT f_power_ind(35) THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- dw_1.AcceptText()
- FOR i = 1 TO dw_1.RowCount()
- IF dw_1.Object.selectflag[i] = 1 THEN
- cnt++
- s_tran.arr_long[cnt] = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
- s_tran.arr_dec[cnt] = dw_1.Object.truerqqty[i]
- END IF
- NEXT
- IF cnt = 0 THEN
- MessageBox(publ_operator,'请选择物料')
- RETURN
- END IF
- //OpenWithParm(w_order_ml_add,s_tran)
- end event
- event ue_view_mtrl_mx();dw_1.AcceptText()
- Long ll_row
- Long ll_mtrlid
- string ls_mtrlcode
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择物料')
- RETURN
- END IF
- ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
- ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[ll_row]
- IF ll_mtrlid = 0 THEN
- MessageBox('提示','请选择物料')
- RETURN
- END IF
- f_view_mtrl_mx(ll_mtrlid,1)
- end event
- event ue_create_buytask();Long rslt = 1
- String ls_msg = ''
- Long i,j, cnt
- Long ll_mtrlid
- Long sptid[]
- Long it_mx = 1
- String arg_msg
- uo_buytask obj_task
- obj_task = Create uo_buytask
- obj_task.commit_transaction = sqlca
- uo_spt_price uo_sptprice
- uo_sptprice = Create uo_spt_price
- IF cur_scid < 0 THEN
- rslt = 0
- arg_msg = "请先选择分部"
- GOTO ext
- END IF
- //确定供应商
- FOR i = 1 To dw_1.RowCount()
- IF dw_1.Object.selectflag[i] = 1 And dw_1.Object.truerqqty[i] > 0 THEN
- FOR j = 1 To UpperBound(sptid)
- IF sptid[j] = dw_1.Object.u_mtrldef_dftsptid[i] THEN
- GOTO nxt
- END IF
- NEXT
-
- cnt ++
- sptid[cnt] = dw_1.Object.u_mtrldef_dftsptid[i]
- END IF
- nxt:
- NEXT
- IF cnt = 0 THEN
- rslt = 0
- arg_msg = "请选择已有默认供应商的缺料物料"
- GOTO ext
- END IF
- //按供应商生成订单
- Long dftbanktypeid,dftmoneyid
- String ls_sptcode, ls_sptname
- FOR i = 1 To cnt
- //查询默认结算方式,默认币种
- SELECT dftbanktypeid,dftmoneyid, sptcode,name
- INTO :dftbanktypeid,:dftmoneyid, :ls_sptcode, :ls_sptname
- FROM u_spt
- Where sptid = :sptid[i] Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询供应商信息失败,ID['+String(sptid[i])+'],'+sqlca.SQLErrText
- GOTO ext
- END IF
-
- IF dftbanktypeid = 0 THEN
- rslt = 0
- arg_msg = '供应商编号['+ls_sptcode+']未定义默认结算方式'
- GOTO ext
- END IF
-
- IF dftmoneyid = 0 THEN
- rslt = 0
- arg_msg = '供应商编号['+ls_sptcode+']未定义默认币种'
- GOTO ext
- END IF
-
-
- s_buytaskmx_arr s_buy
-
- IF obj_task.newbegin(cur_scid,arg_msg) = 0 THEN //
- rslt = 0
- GOTO ext
- END IF
-
- obj_task.requiredate = DateTime(Today())
- obj_task.Assign_emp = publ_operator
- obj_task.Kind = 0
- obj_task.sptid = sptid[i]
- obj_task.relcode = ''
-
- obj_task.banktypeid = dftbanktypeid
- obj_task.train = ''
- obj_task.billtype = 0
- obj_task.moneyid = dftmoneyid
- obj_task.mrate = f_get_mrate( dftmoneyid)
-
-
-
-
- FOR j = 1 To dw_1.RowCount()
- 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
-
-
-
-
- it_mx++
- s_buy.MtrlID[it_mx] = dw_1.Object.uv_mtrl_willuse_mtrlid[j]
- s_buy.mtrlcode[it_mx] = dw_1.Object.u_mtrldef_mtrlcode[j]
- s_buy.status[it_mx] = dw_1.Object.uv_mtrl_willuse_status[j]
- s_buy.woodcode[it_mx] = dw_1.Object.uv_mtrl_willuse_woodcode[j]
- s_buy.pcode[it_mx] = dw_1.Object.uv_mtrl_willuse_pcode[j]
- s_buy.unit[it_mx] = dw_1.Object.u_mtrldef_unit[j]
- s_buy.mrp_unit[it_mx] = dw_1.Object.u_mtrldef_mrp_unit[j]
- s_buy.unit_buy[it_mx] = dw_1.Object.u_mtrldef_unit_buy[j]
- s_buy.rate_buy[it_mx] = dw_1.Object.u_mtrldef_rate_buy[j]
- s_buy.unit_scll[it_mx] = dw_1.Object.u_mtrldef_unit_scll[j]
- s_buy.rate_scll[it_mx] = dw_1.Object.u_mtrldef_rate_scll[j]
- s_buy.unit_sale[it_mx] = dw_1.Object.u_mtrldef_unit_sale[j]
- s_buy.rate_sale[it_mx] = dw_1.Object.u_mtrldef_rate_sale[j]
- s_buy.buyunit[it_mx] = dw_1.Object.u_mtrldef_buyunit[j]
- s_buy.uqty[it_mx] = dw_1.Object.truerqqty[j]
-
- CHOOSE CASE s_buy.buyunit[it_mx] //mrp_unit
- CASE 0
- s_buy.rate[it_mx] = 1
- CASE 1
- IF s_buy.rate_buy[it_mx] = 0 THEN s_buy.rate_buy[it_mx] = 1
- s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_buy[it_mx]
- s_buy.rate[it_mx] = s_buy.rate_buy[it_mx]
- s_buy.unit[it_mx] = s_buy.unit_buy[it_mx]
- CASE 2
- s_buy.unit[it_mx] = s_buy.unit_scll[it_mx]
- s_buy.rate[it_mx] = s_buy.rate_scll[it_mx]
- IF s_buy.rate_scll[it_mx] = 0 THEN s_buy.rate_scll[it_mx] = 1
- s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_scll[it_mx]
- CASE 3
- s_buy.unit[it_mx] = s_buy.unit_sale[it_mx]
- s_buy.rate[it_mx] = s_buy.rate_sale[it_mx]
- IF s_buy.rate_sale[it_mx] = 0 THEN s_buy.rate_sale[it_mx] = 1
- s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_sale[it_mx]
- END CHOOSE
-
-
- Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate,ld_rate
- String ls_unit
- ls_unit = s_buy.unit[it_mx]
- // 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
- // s_buy.uprice[it_mx] = ls_1stnewcost
- // // s_buy.rate[it_mx] = ls_1stzqrate
- // ELSE
- // s_buy.uprice[it_mx] = 0
- // END IF
-
-
- //新的取价模式
- IF uo_sptprice.uof_get_mtrl_buyprice(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
- s_buy.uprice[it_mx] = ls_1stnewcost
- // s_buy.rate[it_mx] = ls_1stzqrate
- ELSE
- s_buy.uprice[it_mx] = 0
- END IF
-
-
-
-
- SELECT top 1 storageid
- INTO :s_buy.storageid[it_mx]
- FROM u_mtrl_storage
- Where MtrlID = :s_buy.MtrlID[it_mx] Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- SELECT top 1 storageid
- INTO :s_buy.storageid[it_mx]
- FROM u_buytaskmx
- WHERE mtrlid = :s_buy.MtrlID[it_mx]
- Order By taskid Desc Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = s_buy.mtrlcode[it_mx] + '请先设置存放仓库'
- END IF
- END IF
-
-
- IF obj_task.acceptmx(0,&
- 0,&
- '',&
- s_buy.MtrlID[it_mx],&
- s_buy.uqty[it_mx],&
- 0,&
- s_buy.uprice[it_mx],&
- 1,&
- 0,&
- '',&
- s_buy.mtrlcode[it_mx],&
- arg_msg,&
- j,&
- DateTime(Today()),&
- s_buy.storageid[it_mx],&
- s_buy.status[it_mx],&
- s_buy.woodcode[it_mx],&
- s_buy.pcode[it_mx],&
- s_buy.unit[it_mx],&
- s_buy.rate[it_mx],&
- 0,&
- 0,&
- '',&
- '',&
- 0,0,'','','','') = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- NEXT
-
- IF obj_task.savesubmit(publ_operator,arg_msg,False) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF ls_msg = '' THEN
- ls_msg = obj_task.taskcode
- ELSE
- ls_msg += ',' + obj_task.taskcode
- END IF
-
- NEXT
- IF arg_msg = '' THEN
- arg_msg = '没有采购订单生成'
- ELSE
- arg_msg = '生成采购订单:' + ls_msg
- END IF
- //arg_msg = ls_msg
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using sqlca;
- MessageBox("Error",arg_msg)
- ELSE
- COMMIT Using sqlca;
- MessageBox("系统提示",arg_msg)
- END IF
- end event
- event ue_retrieve_info();Long ll_row
- Long ll_mtrlid
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- ll_mtrlid = 0
- ELSE
- ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
- END IF
- IF IsValid(w_mtrl_info) THEN
- w_mtrl_info.WindowState = Normal!
- w_mtrl_info.ins_mtrlid = ll_mtrlid
- w_mtrl_info.wf_retrieve(ll_mtrlid)
- END IF
- end event
- event ue_create_buytask_view();//辅助生成采购订单
- IF Not f_power_ind(93) THEN
- MessageBox('提示',sys_msg_pow, Information!, OK! )
- RETURN
- END IF
- Int rslt = 1
- String arg_msg
- //Long cnt
- //String ls_msg
- Long i, it_mx
- Long ll_storageid
- IF cur_scid < 0 THEN
- MessageBox('系统提示','请先选择分部!',Information!,OK!)
- RETURN
- END IF
- dw_1.AcceptText()
- i = dw_1.Find('selectflag = 1', 1, dw_1.RowCount() )
- IF i <= 0 THEN
- MessageBox('系统提示','请选定当前目标订单!',Information!,OK!)
- RETURN
- END IF
- s_buytaskmx_arr s_buy
- FOR i = 1 To dw_1.RowCount()
- IF dw_1.Object.selectflag[i] = 1 THEN
- it_mx++
- s_buy.MtrlID[it_mx] = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
- s_buy.mtrlcode[it_mx] = dw_1.Object.u_mtrldef_mtrlcode[i]
- s_buy.mtrlname[it_mx] = dw_1.Object.u_mtrldef_mtrlname[i]
- s_buy.mtrlmode[it_mx] = dw_1.Object.u_mtrldef_mtrlmode[i]
-
- s_buy.zxmtrlmode[it_mx] = dw_1.Object.u_mtrldef_zxmtrlmode[i]
- s_buy.mtrlsectype[it_mx] = dw_1.Object.u_mtrldef_mtrlsectype[i]
-
- s_buy.status[it_mx] = dw_1.Object.uv_mtrl_willuse_status[i]
- s_buy.woodcode[it_mx] = dw_1.Object.uv_mtrl_willuse_woodcode[i]
- s_buy.pcode[it_mx] = dw_1.Object.uv_mtrl_willuse_pcode[i]
- s_buy.unit[it_mx] = dw_1.Object.u_mtrldef_unit[i]
- s_buy.mrp_unit[it_mx] = dw_1.Object.u_mtrldef_mrp_unit[i]
- s_buy.unit_buy[it_mx] = dw_1.Object.u_mtrldef_unit_buy[i]
- s_buy.rate_buy[it_mx] = dw_1.Object.u_mtrldef_rate_buy[i]
- s_buy.unit_scll[it_mx] = dw_1.Object.u_mtrldef_unit_scll[i]
- s_buy.rate_scll[it_mx] = dw_1.Object.u_mtrldef_rate_scll[i]
- s_buy.unit_sale[it_mx] = dw_1.Object.u_mtrldef_unit_sale[i]
- s_buy.rate_sale[it_mx] = dw_1.Object.u_mtrldef_rate_sale[i]
- s_buy.buyunit[it_mx] = dw_1.Object.u_mtrldef_buyunit[i]
- if dw_1.Object.truerqqty[i] > 0 then
- s_buy.uqty[it_mx] = dw_1.Object.truerqqty[i]
- s_buy.qty[it_mx] = dw_1.Object.truerqqty[i]
- else
- s_buy.uqty[it_mx] = 0
- s_buy.qty[it_mx] = 0
- end if
-
- CHOOSE CASE s_buy.buyunit[it_mx]
- CASE 0
- s_buy.rate[it_mx] = 1
- CASE 1
- IF s_buy.rate_buy[it_mx] = 0 THEN s_buy.rate_buy[it_mx] = 1
- s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_buy[it_mx]
- s_buy.rate[it_mx] = s_buy.rate_buy[it_mx]
- s_buy.unit[it_mx] = s_buy.unit_buy[it_mx]
- CASE 2
- s_buy.unit[it_mx] = s_buy.unit_scll[it_mx]
- s_buy.rate[it_mx] = s_buy.rate_scll[it_mx]
- IF s_buy.rate_scll[it_mx] = 0 THEN s_buy.rate_scll[it_mx] = 1
- s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_scll[it_mx]
- CASE 3
- s_buy.unit[it_mx] = s_buy.unit_sale[it_mx]
- s_buy.rate[it_mx] = s_buy.rate_sale[it_mx]
- IF s_buy.rate_sale[it_mx] = 0 THEN s_buy.rate_sale[it_mx] = 1
- s_buy.uqty[it_mx] = s_buy.uqty[it_mx] / s_buy.rate_sale[it_mx]
- END CHOOSE
- END IF
- NEXT
- s_edit_index_tran s_open
- IF Not IsValid(w_buytask) THEN
- OpenWithParm(w_buytask,s_open)
-
- w_buytask.ddlb_scid.uf_selectsc(cur_scid)
- w_buytask.cb_add.TriggerEvent(Clicked!)
-
- w_buytask.dw_uc.Object.u_buytask_billtype[w_buytask.dw_uc.GetRow()] = 0
- w_buytask.TriggerEvent('ue_f9')
- w_buytask.wf_autoaddmx_will_rq(s_buy)
- END IF
- end event
- public function integer wf_cmpl_qty ();Long i
- Long ll_mtrlid,ll_storageid
- String ls_status_uc,arg_msg,arg_lsg,ls_mtrlcode
- Decimal ld_ref_qty
- Open(w_sys_wait_jdt) //初始化进度条
- w_sys_wait_jdt.Show()
- w_sys_wait_jdt.wf_accepttol(dw_1.RowCount()) //初始化进度条1
- FOR i = 1 TO dw_1.RowCount()
- ls_mtrlcode = dw_1.Object.u_mtrldef_mtrlcode[i]
- w_sys_wait_jdt.st_msg.Text = "处理:"+ls_mtrlcode //进度信息
- ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[i]
- ll_storageid = -1
- ls_status_uc = dw_1.Object.uv_mtrl_willuse_status[i]
-
- IF f_cmp_di_qty(ll_mtrlid,ll_storageid,ls_status_uc,ld_ref_qty,arg_lsg,arg_msg) = 0 THEN
- CONTINUE;
- END IF
-
- dw_1.Object.install_cmplqty[i] = ld_ref_qty
- w_sys_wait_jdt.wf_inc(i) //进度
- NEXT
- Close(w_sys_wait_jdt)
- RETURN 1
- end function
- on w_rp_mtrl_will_rqqty.create
- int iCurrent
- call super::create
- this.cbx_1=create cbx_1
- this.ddlb_scid=create ddlb_scid
- this.tab_1=create tab_1
- this.cbx_ifminqty=create cbx_ifminqty
- this.cbx_ifnoallocqty=create cbx_ifnoallocqty
- this.cbx_ifbuytask=create cbx_ifbuytask
- this.cbx_iforder=create cbx_iforder
- this.cbx_ifwfjg=create cbx_ifwfjg
- this.st_2=create st_2
- this.tv_1=create tv_1
- this.p_resize=create p_resize
- this.cbx_2=create cbx_2
- this.ddlb_mtrlorigin=create ddlb_mtrlorigin
- this.st_1=create st_1
- this.st_5=create st_5
- this.cb_billfunc=create cb_billfunc
- this.cb_other=create cb_other
- this.cbx_ifrqqty=create cbx_ifrqqty
- this.cbx_iftaskqty=create cbx_iftaskqty
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cbx_1
- this.Control[iCurrent+2]=this.ddlb_scid
- this.Control[iCurrent+3]=this.tab_1
- this.Control[iCurrent+4]=this.cbx_ifminqty
- this.Control[iCurrent+5]=this.cbx_ifnoallocqty
- this.Control[iCurrent+6]=this.cbx_ifbuytask
- this.Control[iCurrent+7]=this.cbx_iforder
- this.Control[iCurrent+8]=this.cbx_ifwfjg
- this.Control[iCurrent+9]=this.st_2
- this.Control[iCurrent+10]=this.tv_1
- this.Control[iCurrent+11]=this.p_resize
- this.Control[iCurrent+12]=this.cbx_2
- this.Control[iCurrent+13]=this.ddlb_mtrlorigin
- this.Control[iCurrent+14]=this.st_1
- this.Control[iCurrent+15]=this.st_5
- this.Control[iCurrent+16]=this.cb_billfunc
- this.Control[iCurrent+17]=this.cb_other
- this.Control[iCurrent+18]=this.cbx_ifrqqty
- this.Control[iCurrent+19]=this.cbx_iftaskqty
- end on
- on w_rp_mtrl_will_rqqty.destroy
- call super::destroy
- destroy(this.cbx_1)
- destroy(this.ddlb_scid)
- destroy(this.tab_1)
- destroy(this.cbx_ifminqty)
- destroy(this.cbx_ifnoallocqty)
- destroy(this.cbx_ifbuytask)
- destroy(this.cbx_iforder)
- destroy(this.cbx_ifwfjg)
- destroy(this.st_2)
- destroy(this.tv_1)
- destroy(this.p_resize)
- destroy(this.cbx_2)
- destroy(this.ddlb_mtrlorigin)
- destroy(this.st_1)
- destroy(this.st_5)
- destroy(this.cb_billfunc)
- destroy(this.cb_other)
- destroy(this.cbx_ifrqqty)
- destroy(this.cbx_iftaskqty)
- end on
- event resize;ln_bar.endx = this.width
- ln_bar2.endx = this.width
- ln_1.endx = this.width
- ln_2.endx = this.width
- ln_3.endx = this.width
- ln_4.endx = this.width
- r_bar.width = this.width
- Long w_width,w_height
- w_width = 3600
- w_height = 2300
- IF newwidth < w_width THEN THIS.Width = w_width
- IF newheight < w_height THEN THIS.Height = w_height
- dw_1.Width = THIS.Width - dw_1.X - 60
- dw_1.Height = THIS.Height - (w_height - 1020)
- p_resize.Height = dw_1.Height
- tv_1.Height = dw_1.Height
- tab_1.Width = THIS.Width - (w_width - 3543)
- dw_order_ml.Width = THIS.Width - (w_width - 3502)
- dw_buytask.Width = THIS.Width - (w_width - 3502)
- dw_order.Width = THIS.Width - (w_width - 3502)
- dw_wfjg.Width = THIS.Width - (w_width - 3502)
- dw_saletask.Width = THIS.Width - (w_width - 3502)
- dw_ware.Width = THIS.Width - (w_width - 3502)
- tab_1.Y = THIS.Height - (w_height - 1444)
- end event
- event ue_before_open;call super::ue_before_open;if_ue_filter = True
- if_ue_sort = True
- if_ue_sentdataout = True
- IF sys_version = 802001 THEN //商业版
- cbx_iforder.Visible = False
- cbx_ifwfjg.Visible = False
- tab_1.tabpage_1.Visible = False
- tab_1.tabpage_3.Visible = False
- tab_1.tabpage_4.Visible = False
- END IF
- dw_order_ml = tab_1.tabpage_1.dw_2
- dw_buytask = tab_1.tabpage_2.dw_3
- dw_order = tab_1.tabpage_3.dw_4
- dw_wfjg = tab_1.tabpage_4.dw_5
- dw_saletask = tab_1.tabpage_5.dw_rq_taskmx
- dw_ware = tab_1.tabpage_6.dw_ware
- dw_order_ml.SetTransObject(sqlca)
- dw_buytask.SetTransObject(sqlca)
- dw_order.SetTransObject(sqlca)
- dw_wfjg.SetTransObject(sqlca)
- dw_saletask.SetTransObject(sqlca)
- dw_ware.SetTransObject(sqlca)
- p_resize.PictureName = ProfileString(SYS_INIFILENAME, "w_rp_mtrl_will_rqqty", "p_resize", 'w_resize_2.bmp')
- IF p_resize.PictureName = 'w_resize_2.bmp' THEN
- p_resize.X = 891
- dw_1.X = 928
- tv_1.Visible = TRUE
- ELSE
- p_resize.X = 0
- dw_1.X = p_resize.Width + 5
- tv_1.Visible = FALSE
- END IF
- THIS.TriggerEvent(Resize!)
- end event
- event close;call super::close;SetProfileString(SYS_INIFILENAME,"w_rp_mtrl_will_rqqty","p_resize",p_resize.PictureName)
- end event
- event ue_before_openretrieve;call super::ue_before_openretrieve;EM_1.Text = String(RelativeDate ( Today(), 30 ),'YYYY-MM-DD')
- cur_mtrlorigin = integer(f_ProfileString (sys_empid,dw_1.DataObject, "ddlb_mtrlorigin",'0'))
- ddlb_mtrlorigin.uf_setitem(cur_mtrlorigin)
- end event
- event ue_sentdataout;IF NOT f_power_ind(1830) THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- OpenWithParm(w_sentdataout,DW_1)
- end event
- type cb_func from w_publ_easyq`cb_func within w_rp_mtrl_will_rqqty
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_rp_mtrl_will_rqqty
- integer x = 1477
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_rp_mtrl_will_rqqty
- integer x = 1175
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1394
- integer y = 512
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_rp_mtrl_will_rqqty
- end type
- event cb_1::clicked;call super::clicked;Int li_qty,li_ifminqty,li_ifnoallocqty,li_ifbuytask,li_iforder,li_ifwfjg,li_ifrqqty,li_iftaskqty
- DateTime ld_dt
- ld_dt = DateTime(Date(em_1.Text),Time('23:59:59'))
- IF cbx_1.Checked THEN li_qty = 1
- IF cbx_ifminqty.Checked THEN li_ifminqty = 1
- IF cbx_ifnoallocqty.Checked THEN li_ifnoallocqty = 1
- IF cbx_ifbuytask.Checked THEN li_ifbuytask = 1
- IF cbx_iforder.Checked THEN li_iforder = 1
- IF cbx_ifwfjg.Checked THEN li_ifwfjg = 1
- if cbx_ifrqqty.checked then li_ifrqqty = 1
- if cbx_iftaskqty.checked then li_iftaskqty = 1
- DELETE FROM u_parm_pay Where id = 9 ;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','数据库操作失败!')
- ROLLBACK;
- RETURN
- END IF
- INSERT INTO u_parm_pay (firstdate,enddate,id)
- Values (:ld_dt,:ld_dt,9);
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','数据库操作失败')
- ROLLBACK;
- RETURN
- END IF
- COMMIT;
- 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)
- PARENT.TriggerEvent('retrieve_mx')
- wf_cmpl_qty() //计算可装数
- end event
- type st_3 from w_publ_easyq`st_3 within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1138
- integer y = 524
- integer width = 142
- string text = "日期:"
- end type
- type st_4 from w_publ_easyq`st_4 within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1175
- integer y = 640
- end type
- type em_1 from w_publ_easyq`em_1 within w_rp_mtrl_will_rqqty
- integer x = 2181
- integer y = 188
- integer width = 398
- end type
- type em_2 from w_publ_easyq`em_2 within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1083
- integer y = 624
- boolean enabled = false
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1902
- integer y = 512
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_rp_mtrl_will_rqqty
- integer x = 1678
- integer y = 12
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_rp_mtrl_will_rqqty
- integer x = 928
- integer width = 2903
- integer height = 1020
- string title = "缺料明细"
- string dataobject = "dw_rp_mtrl_will_rqqty"
- boolean maxbox = true
- end type
- event dw_1::rowfocuschanged;call super::rowfocuschanged;PARENT.TriggerEvent('retrieve_mx')
- PARENT.TriggerEvent('ue_retrieve_info')
- end event
- event dw_1::clicked;call super::clicked;IF row > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(row,TRUE)
- this.setrow(row)
- END IF
- end event
- event dw_1::doubleclicked;call super::doubleclicked;parent.triggerevent("ue_view_mtrl_mx")
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_mtrl_will_rqqty
- integer y = 664
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_rp_mtrl_will_rqqty
- integer y = 664
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_rp_mtrl_will_rqqty
- integer y = 680
- end type
- type st_cust from w_publ_easyq`st_cust within w_rp_mtrl_will_rqqty
- integer y = 680
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_mtrl_will_rqqty
- boolean visible = true
- integer x = 1678
- integer y = 96
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_rp_mtrl_will_rqqty
- integer x = 2587
- integer y = 188
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1422
- integer y = 608
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_rp_mtrl_will_rqqty
- boolean visible = false
- integer x = 1531
- integer y = 608
- end type
- type cb_help from w_publ_easyq`cb_help within w_rp_mtrl_will_rqqty
- integer x = 1326
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_rp_mtrl_will_rqqty
- integer x = 919
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_rp_mtrl_will_rqqty
- integer x = 1138
- integer y = 676
- integer width = 1696
- integer height = 60
- long backcolor = 134217739
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_rp_mtrl_will_rqqty
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_mtrl_will_rqqty
- end type
- type r_bar from w_publ_easyq`r_bar within w_rp_mtrl_will_rqqty
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_rp_mtrl_will_rqqty
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_rp_mtrl_will_rqqty
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_rp_mtrl_will_rqqty
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_rp_mtrl_will_rqqty
- end type
- type cbx_1 from checkbox within w_rp_mtrl_will_rqqty
- integer x = 1385
- integer y = 200
- integer width = 521
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "只显示缺料物料"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifqty", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifqty", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type ddlb_scid from uo_ddlb_scid within w_rp_mtrl_will_rqqty
- integer x = 155
- integer y = 188
- integer width = 558
- integer height = 544
- integer taborder = 90
- boolean bringtotop = true
- end type
- event constructor;call super::constructor;cur_scid=this.uo_scid
- cur_scid_arr = THIS.uo_scid_arr
- end event
- event selectionchanged;call super::selectionchanged;cur_scid=this.uo_scid
- cur_scid_arr = THIS.uo_scid_arr
- parent.triggerevent("retrieve_pageretr")
- end event
- type tab_1 from tab within w_rp_mtrl_will_rqqty
- integer y = 1444
- integer width = 3826
- integer height = 704
- integer taborder = 80
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 134217739
- boolean raggedright = true
- boolean focusonbuttondown = true
- integer selectedtab = 1
- tabpage_5 tabpage_5
- tabpage_1 tabpage_1
- tabpage_6 tabpage_6
- tabpage_2 tabpage_2
- tabpage_3 tabpage_3
- tabpage_4 tabpage_4
- end type
- on tab_1.create
- this.tabpage_5=create tabpage_5
- this.tabpage_1=create tabpage_1
- this.tabpage_6=create tabpage_6
- this.tabpage_2=create tabpage_2
- this.tabpage_3=create tabpage_3
- this.tabpage_4=create tabpage_4
- this.Control[]={this.tabpage_5,&
- this.tabpage_1,&
- this.tabpage_6,&
- this.tabpage_2,&
- this.tabpage_3,&
- this.tabpage_4}
- end on
- on tab_1.destroy
- destroy(this.tabpage_5)
- destroy(this.tabpage_1)
- destroy(this.tabpage_6)
- destroy(this.tabpage_2)
- destroy(this.tabpage_3)
- destroy(this.tabpage_4)
- end on
- type tabpage_5 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3790
- integer height = 592
- long backcolor = 134217739
- string text = "订单需求明细"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_rq_taskmx dw_rq_taskmx
- end type
- on tabpage_5.create
- this.dw_rq_taskmx=create dw_rq_taskmx
- this.Control[]={this.dw_rq_taskmx}
- end on
- on tabpage_5.destroy
- destroy(this.dw_rq_taskmx)
- end on
- type dw_rq_taskmx from u_dw_rbtnfilter within tabpage_5
- integer width = 3502
- integer height = 592
- string dataobject = "dw_rp_mtrl_will_rqqty_mx_saletask"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- type tabpage_1 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3790
- integer height = 592
- long backcolor = 134217739
- string text = "生产需求明细"
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- cb_4 cb_4
- dw_2 dw_2
- end type
- on tabpage_1.create
- this.cb_4=create cb_4
- this.dw_2=create dw_2
- this.Control[]={this.cb_4,&
- this.dw_2}
- end on
- on tabpage_1.destroy
- destroy(this.cb_4)
- destroy(this.dw_2)
- end on
- type cb_4 from commandbutton within tabpage_1
- integer y = 4
- integer width = 402
- integer height = 72
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "修改需求日期"
- end type
- event clicked;
- s_rp_mtrl_will_rqqty_rqdate_mod s_rqdate
- Long ll_row
- DateTime ld_dt
- ld_dt = DateTime(Date(em_1.Text),Time('23:59:59'))
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN RETURN
- s_rqdate.scid = cur_scid_arr
- s_rqdate.mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
- s_rqdate.status = dw_1.Object.uv_mtrl_willuse_status[ll_row]
- s_rqdate.woodcode = dw_1.Object.uv_mtrl_willuse_woodcode[ll_row]
- s_rqdate.pcode = dw_1.Object.uv_mtrl_willuse_pcode[ll_row]
- s_rqdate.rqdate = ld_dt
- OpenWithParm(w_rp_mtrl_will_rqqty_rqdate_mod,s_rqdate)
- PARENT.GetParent().GetParent().TriggerEvent('retrieve_mx')
- end event
- type dw_2 from u_dw_rbtnfilter within tabpage_1
- integer y = 80
- integer width = 3502
- integer height = 512
- integer taborder = 20
- string dataobject = "dw_rp_mtrl_will_rqqty_mx_order_ml"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- type tabpage_6 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3790
- integer height = 592
- long backcolor = 134217739
- string text = "库存明细"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_ware dw_ware
- end type
- on tabpage_6.create
- this.dw_ware=create dw_ware
- this.Control[]={this.dw_ware}
- end on
- on tabpage_6.destroy
- destroy(this.dw_ware)
- end on
- type dw_ware from u_dw_rbtnfilter within tabpage_6
- integer width = 3081
- integer height = 592
- string dataobject = "dw_rp_mtrl_will_rqqty_mx_mtrlware"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- type tabpage_2 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3790
- integer height = 592
- long backcolor = 134217739
- string text = "采购未到数"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_3 dw_3
- end type
- on tabpage_2.create
- this.dw_3=create dw_3
- this.Control[]={this.dw_3}
- end on
- on tabpage_2.destroy
- destroy(this.dw_3)
- end on
- type dw_3 from u_dw_rbtnfilter within tabpage_2
- integer width = 3502
- integer height = 592
- integer taborder = 20
- string dataobject = "dw_rp_mtrl_will_rqqty_mx_buytask"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- type tabpage_3 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3790
- integer height = 592
- long backcolor = 134217739
- string text = "计划未完成数"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_4 dw_4
- end type
- on tabpage_3.create
- this.dw_4=create dw_4
- this.Control[]={this.dw_4}
- end on
- on tabpage_3.destroy
- destroy(this.dw_4)
- end on
- type dw_4 from u_dw_rbtnfilter within tabpage_3
- integer width = 3488
- integer height = 592
- integer taborder = 20
- string dataobject = "dw_rp_mtrl_will_rqqty_mx_order"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- type tabpage_4 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 3790
- integer height = 592
- long backcolor = 134217739
- string text = "外协未完成数"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_5 dw_5
- end type
- on tabpage_4.create
- this.dw_5=create dw_5
- this.Control[]={this.dw_5}
- end on
- on tabpage_4.destroy
- destroy(this.dw_5)
- end on
- type dw_5 from u_dw_rbtnfilter within tabpage_4
- integer width = 3502
- integer height = 592
- integer taborder = 20
- string dataobject = "dw_rp_mtrl_will_rqqty_mx_wfjg"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- type cbx_ifminqty from checkbox within w_rp_mtrl_will_rqqty
- integer x = 270
- integer y = 316
- integer width = 411
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "考虑库存下限"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifminqty", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifminqty", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type cbx_ifnoallocqty from checkbox within w_rp_mtrl_will_rqqty
- integer x = 727
- integer y = 316
- integer width = 402
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "考虑库存数"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifnoallocqty", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifnoallocqty", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type cbx_ifbuytask from checkbox within w_rp_mtrl_will_rqqty
- integer x = 1175
- integer y = 316
- integer width = 466
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "考虑采购未到数"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifbuytask", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifbuytask", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type cbx_iforder from checkbox within w_rp_mtrl_will_rqqty
- integer x = 1687
- integer y = 316
- integer width = 521
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "考虑生产未完成数"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "iforder", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "iforder", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type cbx_ifwfjg from checkbox within w_rp_mtrl_will_rqqty
- integer x = 2254
- integer y = 316
- integer width = 521
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "考虑外协未完成数"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifwfjg", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifwfjg", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type st_2 from statictext within w_rp_mtrl_will_rqqty
- integer x = 1911
- integer y = 208
- integer width = 256
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "需求日期"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type tv_1 from uo_tv_mtrltype within w_rp_mtrl_will_rqqty
- integer y = 412
- integer width = 887
- integer height = 1020
- integer taborder = 70
- boolean bringtotop = true
- integer textsize = -9
- fontcharset fontcharset = gb2312charset!
- fontfamily fontfamily = anyfont!
- string facename = "宋体"
- end type
- event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype
- ls_handtype = ls_handtype + '%'
- cb_1.triggerevent(clicked!)
- end event
- type p_resize from picture within w_rp_mtrl_will_rqqty
- integer x = 891
- integer y = 412
- integer width = 32
- integer height = 1020
- boolean bringtotop = true
- string pointer = "HyperLink!"
- string picturename = "w_resize_2.bmp"
- boolean focusrectangle = false
- end type
- event clicked;IF THIS.picturename = 'w_resize_1.bmp' THEN
- THIS.picturename = 'w_resize_2.bmp'
- THIS.X = 891
- dw_1.X = 928
- tv_1.Visible = TRUE
- ELSE
- THIS.picturename = 'w_resize_1.bmp'
- THIS.X = 0
- dw_1.X = p_resize.Width + 5
- tv_1.Visible = FALSE
- END IF
- PARENT.TriggerEvent(Resize!)
- end event
- type cbx_2 from checkbox within w_rp_mtrl_will_rqqty
- integer x = 41
- integer y = 316
- integer width = 206
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 16711680
- long backcolor = 134217739
- string text = "全选"
- end type
- event clicked;Long ll_i
- IF THIS.Checked THEN
- FOR ll_i = 1 TO dw_1.RowCount()
- dw_1.Object.selectflag[ll_i] = 1
- NEXT
- ELSE
- FOR ll_i = 1 TO dw_1.RowCount()
- dw_1.Object.selectflag[ll_i] = 0
- NEXT
- END IF
- end event
- type ddlb_mtrlorigin from uo_ddlb_mtrlorigin within w_rp_mtrl_will_rqqty
- integer x = 859
- integer y = 188
- integer width = 457
- integer taborder = 20
- boolean bringtotop = true
- end type
- event selectionchanged;call super::selectionchanged;cur_mtrlorigin = this.uo_mtrlorigin
- //SetProfileString (sys_inifilename,dw_1.DATAOBJECT, "ddlb_mtrlorigin",string(cur_mtrlorigin))
- f_SetProfileString (sys_empid,dw_1.DataObject, "ddlb_mtrlorigin",String(cur_mtrlorigin))
- cb_1.triggerevent(clicked!)
-
- end event
- type st_1 from statictext within w_rp_mtrl_will_rqqty
- integer x = 18
- integer y = 204
- integer width = 137
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "分部"
- boolean focusrectangle = false
- end type
- type st_5 from statictext within w_rp_mtrl_will_rqqty
- integer x = 722
- integer y = 204
- integer width = 137
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "来源"
- boolean focusrectangle = false
- end type
- type cb_billfunc from uo_imflatbutton within w_rp_mtrl_will_rqqty
- integer x = 302
- integer width = 256
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- string text = "辅助功能"
- string normalpicname = "update.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
- String menustr
- menustr = "Text=辅助生成采购订单~tEvent=ue_create_buytask"
- menustr = menustr + "|" + "Text=辅助建立采购订单~tEvent=ue_create_buytask_view"
- //menustr = menustr + "|" + "Text=辅助生成外协订单~tEvent=ue_create_orderwfjg"
- IF Len(Trim(menustr)) <> 0 THEN
- dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
- dmPopupMenu.mf_BuildMenu(THIS, menustr)
- dmPopupMenu.mf_PopMenu()
- DESTROY dmPopupMenu
- END IF
- end event
- type cb_other from uo_imflatbutton within w_rp_mtrl_will_rqqty
- integer x = 558
- integer width = 361
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "物料相关查询"
- string normalpicname = "imexport.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择物料', Information!, OK! )
- RETURN
- END IF
- Long ll_mtrlid
- ll_mtrlid = dw_1.Object.uv_mtrl_willuse_mtrlid[ll_row]
- IF IsValid(w_mtrl_info) THEN
- w_mtrl_info.WindowState = Normal!
- w_mtrl_info.ins_mtrlid = ll_mtrlid
- w_mtrl_info.wf_retrieve(ll_mtrlid)
- ELSE
- OpenWithParm(w_mtrl_info,ll_mtrlid)
- END IF
- end event
- type cbx_ifrqqty from checkbox within w_rp_mtrl_will_rqqty
- integer x = 2825
- integer y = 316
- integer width = 521
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 255
- long backcolor = 134217739
- string text = "考虑生产需求数"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "ifrqqty", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "ifrqqty", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type cbx_iftaskqty from checkbox within w_rp_mtrl_will_rqqty
- integer x = 3355
- integer y = 312
- integer width = 466
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "考虑订单需求数"
- boolean checked = true
- end type
- event clicked;int li_if
- if this.checked then
- li_if=1
- else
- li_if=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "iftaskqty", string(li_if))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;int li_if
- li_if=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "iftaskqty", '1'))
- if li_if =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
|