w_fx_check_bill.srw 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942
  1. $PBExportHeader$w_fx_check_bill.srw
  2. forward
  3. global type w_fx_check_bill from w_publ_base_style
  4. end type
  5. type cb_refresh from uo_imflatbutton within w_fx_check_bill
  6. end type
  7. type cb_new from uo_imflatbutton within w_fx_check_bill
  8. end type
  9. type cb_delete from uo_imflatbutton within w_fx_check_bill
  10. end type
  11. type cb_audit from uo_imflatbutton within w_fx_check_bill
  12. end type
  13. type cb_cancle_audit from uo_imflatbutton within w_fx_check_bill
  14. end type
  15. type cb_print from uo_imflatbutton within w_fx_check_bill
  16. end type
  17. type cb_confirm_return from uo_imflatbutton within w_fx_check_bill
  18. end type
  19. type ddlb_status from dropdownlistbox within w_fx_check_bill
  20. end type
  21. type st_2 from statictext within w_fx_check_bill
  22. end type
  23. type em_datea from editmask within w_fx_check_bill
  24. end type
  25. type em_datez from editmask within w_fx_check_bill
  26. end type
  27. type st_3 from statictext within w_fx_check_bill
  28. end type
  29. type dw_fx_outware_free from datawindow within w_fx_check_bill
  30. end type
  31. type cb_add_mx from commandbutton within w_fx_check_bill
  32. end type
  33. type cb_delete_mx from commandbutton within w_fx_check_bill
  34. end type
  35. type cb_modify from uo_imflatbutton within w_fx_check_bill
  36. end type
  37. type dw_fx_outware from u_dw_rbtnfilter within w_fx_check_bill
  38. end type
  39. type dw_fx_outware_mx from u_dw_rbtnfilter within w_fx_check_bill
  40. end type
  41. type cb_1 from uo_imflatbutton within w_fx_check_bill
  42. end type
  43. type dw_itemmx from u_dw_rbtnfilter within w_fx_check_bill
  44. end type
  45. type st_1 from statictext within w_fx_check_bill
  46. end type
  47. type cb_input from commandbutton within w_fx_check_bill
  48. end type
  49. end forward
  50. global type w_fx_check_bill from w_publ_base_style
  51. integer width = 4608
  52. integer height = 2880
  53. string title = "质量自检单"
  54. boolean maxbox = true
  55. windowstate windowstate = maximized!
  56. event ue_print_outware_all ( )
  57. event ue_print_outware_mx ( )
  58. event ue_print_outware_all_mt ( )
  59. cb_refresh cb_refresh
  60. cb_new cb_new
  61. cb_delete cb_delete
  62. cb_audit cb_audit
  63. cb_cancle_audit cb_cancle_audit
  64. cb_print cb_print
  65. cb_confirm_return cb_confirm_return
  66. ddlb_status ddlb_status
  67. st_2 st_2
  68. em_datea em_datea
  69. em_datez em_datez
  70. st_3 st_3
  71. dw_fx_outware_free dw_fx_outware_free
  72. cb_add_mx cb_add_mx
  73. cb_delete_mx cb_delete_mx
  74. cb_modify cb_modify
  75. dw_fx_outware dw_fx_outware
  76. dw_fx_outware_mx dw_fx_outware_mx
  77. cb_1 cb_1
  78. dw_itemmx dw_itemmx
  79. st_1 st_1
  80. cb_input cb_input
  81. end type
  82. global w_fx_check_bill w_fx_check_bill
  83. type variables
  84. end variables
  85. forward prototypes
  86. public subroutine wf_btn_enabled ()
  87. public subroutine wf_retrieve_outware ()
  88. public subroutine wf_retrieve_outware_mx (long arg_outwareid)
  89. public function integer wf_change_taborder (integer arg_taborder)
  90. public function integer wf_cus_select ()
  91. public function integer wf_send_checkbill (ref string arg_msg)
  92. public subroutine wf_retrieve_outware_itemmx (long arg_outwareid)
  93. public subroutine wf_filtermx ()
  94. end prototypes
  95. event ue_print_outware_all();long ll_row
  96. ll_row = dw_fx_outware.GetRow()
  97. if ll_row <= 0 then
  98. MessageBox('提示', '请先选择要打印的单据')
  99. return
  100. end if
  101. string ls_autocode
  102. string ls_outwarecode
  103. string ls_custname
  104. ls_autocode = dw_fx_outware.Object.outwarecode[ll_row]
  105. ls_custname = dw_fx_outware.Object.cusname[ll_row]
  106. datastore ds_report
  107. ds_report = create datastore
  108. ds_report.dataobject = 'dw_print_outware_fx_mx_data'
  109. long mx_row, i
  110. for i = 1 to dw_fx_outware_mx.rowcount()
  111. if Trim(dw_fx_outware_mx.Object.autocode[i]) <> Trim(ls_autocode) then continue
  112. mx_row = ds_report.InsertRow(0)
  113. ds_report.Object.tid[mx_row] = dw_fx_outware_mx.Object.tid[i]
  114. ds_report.Object.taskcode[mx_row] = dw_fx_outware_mx.Object.taskcode[i]
  115. ds_report.Object.outwarecode[mx_row] = dw_fx_outware_mx.Object.outwarecode[i]
  116. ds_report.Object.username[mx_row] = dw_fx_outware_mx.Object.username[i]
  117. ds_report.Object.outwaredate[mx_row] = dw_fx_outware_mx.Object.outwaredate[i]
  118. ds_report.Object.autocode[mx_row] = Trim(dw_fx_outware_mx.Object.autocode[i])
  119. ds_report.Object.mtrlcode[mx_row] = dw_fx_outware_mx.Object.mtrlcode[i]
  120. ds_report.Object.mtrlname[mx_row] = dw_fx_outware_mx.Object.mtrlname[i]
  121. ds_report.Object.mtrlmode[mx_row] = dw_fx_outware_mx.Object.mtrlmode[i]
  122. ds_report.Object.unit[mx_row] = dw_fx_outware_mx.Object.unit[i]
  123. ds_report.Object.qty[mx_row] = dw_fx_outware_mx.Object.qty[i]
  124. ds_report.Object.mxcode[mx_row] = trim(dw_fx_outware_mx.Object.mxcode[i])
  125. ds_report.Object.custname[mx_row] = ls_custname //客户名称
  126. ds_report.Object.sptname[mx_row] = trim(dw_fx_outware_mx.Object.sptname[i]) //供应商名称
  127. // ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) //产品批号(销售订单相关号)
  128. ds_report.Object.dscrp[mx_row] = dw_fx_outware_mx.Object.mxdscrp[i]
  129. IF trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) = '' THEN
  130. ds_report.Object.mtrlcuscode[mx_row] = dw_fx_outware_mx.Object.mxdscrp[i]
  131. ELSE
  132. ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i])
  133. END IF
  134. ds_report.Object.saletask_mxid[mx_row] = dw_fx_outware_mx.Object.fx_saletaskmx_saletask_mxid[i] //供应商名称
  135. next
  136. S_print_MSG LS_PRMSG
  137. LS_PRMSG.obj_dwNAME='dw_print_outware_fx_mx'
  138. LS_PRMSG.SHARE_DW=ds_report
  139. LS_PRMSG.TAG_TEXT='收货通知单'
  140. LS_PRMSG.SETUP_FLAG=0
  141. LS_PRMSG.PAGECH_FLAG=1
  142. Openwithparm(w_publ_preview,LS_PRMSG)
  143. end event
  144. event ue_print_outware_mx();long row
  145. row = dw_fx_outware.GetRow()
  146. if (row <= 0) then
  147. messagebox('提示', '请先选择要打印的单据')
  148. return
  149. end if
  150. datastore ds_report
  151. ds_report = create datastore
  152. ds_report.dataobject = 'dw_fx_print_saletask_qc'
  153. long i, ll_row
  154. for i = 1 to dw_fx_outware_mx.RowCount()
  155. ll_row = ds_report.InsertRow(0)
  156. ds_report.Object.taskcode[ll_row] = dw_fx_outware_mx.Object.taskcode[i]
  157. ds_report.Object.mtrlcode[ll_row] = dw_fx_outware_mx.Object.mtrlcode[i]
  158. ds_report.Object.mtrlname[ll_row] = dw_fx_outware_mx.Object.mtrlname[i]
  159. ds_report.Object.mtrlmode[ll_row] = dw_fx_outware_mx.Object.mtrlmode[i]
  160. ds_report.Object.status[ll_row] = dw_fx_outware_mx.Object.status[i]
  161. ds_report.Object.qty[ll_row] = dw_fx_outware_mx.Object.qty[i]
  162. ds_report.Object.requiredate[ll_row] = dw_fx_outware_mx.Object.requiredate[i]
  163. next
  164. S_print_MSG LS_PRMSG
  165. LS_PRMSG.obj_dwNAME='dw_fx_print_saletask_qc'
  166. LS_PRMSG.SHARE_DW=ds_report
  167. LS_PRMSG.TAG_TEXT='销售发货单'
  168. LS_PRMSG.SETUP_FLAG=0
  169. LS_PRMSG.PAGECH_FLAG=1
  170. Openwithparm(w_publ_preview,LS_PRMSG)
  171. end event
  172. event ue_print_outware_all_mt();long ll_row
  173. ll_row = dw_fx_outware.GetRow()
  174. if ll_row <= 0 then
  175. MessageBox('提示', '请先选择要打印的单据')
  176. return
  177. end if
  178. string ls_autocode
  179. string ls_outwarecode
  180. string ls_custname
  181. ls_autocode = dw_fx_outware.Object.outwarecode[ll_row]
  182. ls_custname = dw_fx_outware.Object.cusname[ll_row]
  183. datastore ds_report
  184. ds_report = create datastore
  185. ds_report.dataobject = 'dw_print_outware_fx_mx_data'
  186. long mx_row, i
  187. for i = 1 to dw_fx_outware_mx.rowcount()
  188. if Trim(dw_fx_outware_mx.Object.autocode[i]) <> Trim(ls_autocode) then continue
  189. mx_row = ds_report.InsertRow(0)
  190. ds_report.Object.tid[mx_row] = dw_fx_outware_mx.Object.tid[i]
  191. ds_report.Object.taskcode[mx_row] = dw_fx_outware_mx.Object.taskcode[i]
  192. ds_report.Object.outwarecode[mx_row] = dw_fx_outware_mx.Object.outwarecode[i]
  193. ds_report.Object.username[mx_row] = dw_fx_outware_mx.Object.username[i]
  194. ds_report.Object.outwaredate[mx_row] = dw_fx_outware_mx.Object.outwaredate[i]
  195. ds_report.Object.autocode[mx_row] = Trim(dw_fx_outware_mx.Object.autocode[i])
  196. ds_report.Object.mtrlcode[mx_row] = dw_fx_outware_mx.Object.mtrlcode[i]
  197. ds_report.Object.mtrlname[mx_row] = dw_fx_outware_mx.Object.mtrlname[i]
  198. ds_report.Object.mtrlmode[mx_row] = dw_fx_outware_mx.Object.mtrlmode[i]
  199. ds_report.Object.unit[mx_row] = dw_fx_outware_mx.Object.unit[i]
  200. ds_report.Object.qty[mx_row] = dw_fx_outware_mx.Object.qty[i]
  201. ds_report.Object.mxcode[mx_row] = trim(dw_fx_outware_mx.Object.mxcode[i])
  202. ds_report.Object.custname[mx_row] = ls_custname //客户名称
  203. ds_report.Object.sptname[mx_row] = trim(dw_fx_outware_mx.Object.sptname[i]) //供应商名称
  204. ds_report.Object.order_mtrlname_str[mx_row] = dw_fx_outware_mx.Object.order_mtrlname_str[i]
  205. // ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) //产品批号(销售订单相关号)
  206. ds_report.Object.dscrp[mx_row] = trim(dw_fx_outware_mx.Object.mxdscrp[i])
  207. IF trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) = '' THEN
  208. ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mxdscrp[i])
  209. ELSE
  210. ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i])
  211. END IF
  212. ds_report.Object.saletask_mxid[mx_row] = dw_fx_outware_mx.Object.fx_saletaskmx_saletask_mxid[i] //供应商名称
  213. next
  214. ds_report.SetSort("mtrlcuscode A,mtrlname A, mtrlmode A")
  215. ds_report.Sort()
  216. S_print_MSG LS_PRMSG
  217. LS_PRMSG.obj_dwNAME='dw_print_outware_fx_mx_mt'
  218. LS_PRMSG.SHARE_DW=ds_report
  219. LS_PRMSG.TAG_TEXT='收货通知单(唛头)'
  220. LS_PRMSG.SETUP_FLAG=0
  221. LS_PRMSG.PAGECH_FLAG=1
  222. Openwithparm(w_publ_preview,LS_PRMSG)
  223. end event
  224. public subroutine wf_btn_enabled ();if dw_edit_mode OR if_modify_mode then
  225. cb_refresh.enabled = false
  226. cb_new.text = '保存'
  227. cb_new.normalpicname = "save.bmp"
  228. cb_modify.text = '放弃'
  229. cb_modify.normalpicname = "undo.bmp"
  230. cb_delete.enabled = false
  231. cb_audit.enabled = false
  232. cb_cancle_audit.enabled = false
  233. cb_print.enabled = false
  234. cb_confirm_return.enabled = false
  235. cb_add_mx.enabled = true
  236. cb_delete_mx.enabled = true
  237. // cb_input.enabled = true
  238. else
  239. cb_refresh.enabled = true
  240. cb_new.text = '新建'
  241. cb_new.normalpicname = "new.bmp"
  242. cb_modify.text = '修改'
  243. cb_modify.normalpicname = "open.bmp"
  244. cb_delete.enabled = true
  245. cb_audit.enabled = true
  246. cb_cancle_audit.enabled = true
  247. cb_print.enabled = true
  248. cb_confirm_return.enabled = true
  249. cb_add_mx.enabled = false
  250. cb_delete_mx.enabled = false
  251. // cb_input.enabled = false
  252. end if
  253. cb_new.of_init_draw()
  254. cb_new.of_paint()
  255. cb_new.TriggerEvent('ue_textchange')
  256. cb_modify.of_init_draw()
  257. cb_modify.of_paint()
  258. cb_modify.TriggerEvent('ue_textchange')
  259. end subroutine
  260. public subroutine wf_retrieve_outware ();long status, ll_ifback
  261. //if cbx_ifback.checked = false then
  262. // ll_ifback = 0
  263. //else
  264. // ll_ifback = 1
  265. //end if
  266. long ll_pos
  267. ll_pos = Pos(ddlb_status.Text, '[')
  268. if (ll_pos <= 0) then
  269. status = -1
  270. else
  271. status = Long(Mid(ddlb_status.Text, ll_pos + 1, Len(ddlb_status.Text) - ll_pos - 1))
  272. end if
  273. datetime dateA, dateZ
  274. dateA = DateTime(Date(em_dateA.Text), Time(0))
  275. dateZ = DateTime(Date(em_dateZ.Text), Time('23:59:59'))
  276. string arg_msg
  277. oleobject request,response,FxOutwares,item
  278. request = FXAppCom.CreatePbDictionary()
  279. request.SetString('token', app_token_fx)
  280. request.SetInt('flag', status)
  281. request.SetInt('billtype', 0) //自检
  282. request.SetDateTime('begindate', dateA)
  283. request.SetDateTime('enddate', dateZ)
  284. response = FXAppCom.DoExecute('GetCheckbillList', request)
  285. arg_msg = response.GetString('ErrMsg')
  286. if (arg_msg <> '') then
  287. messagebox('提示', '获取质检单列表失败,原因:' + arg_msg)
  288. return
  289. end if
  290. dw_fx_outware.Reset()
  291. dw_fx_outware_mx.Reset()
  292. dw_fx_outware.SetRedraw(false)
  293. FxOutwares = response.GetArrOfPBDictionary('billList')
  294. long i,row
  295. for i = 1 to FxOutwares.Count
  296. item = FxOutwares.GetItem(i - 1)
  297. row = dw_fx_outware.InsertRow(0)
  298. dw_fx_outware.setitem(row,'billid', item.GetInt('billid'))
  299. dw_fx_outware.setitem(row,'billcode', item.GetString('billcode'))
  300. dw_fx_outware.setitem(row,'billtype', item.GetInt('billtype'))
  301. dw_fx_outware.setitem(row,'flag', item.GetInt('flag'))
  302. dw_fx_outware.setitem(row,'billdate', item.GetDateTime('billdate'))
  303. dw_fx_outware.setitem(row,'cuscomid',item.GetInt('cuscomid'))
  304. dw_fx_outware.setitem(row,'sptcomid', item.GetInt('sptcomid'))
  305. dw_fx_outware.setitem(row,'sptid_erp', item.GetInt('sptid_erp'))
  306. dw_fx_outware.setitem(row,'cusname', item.GetString('cuscomname'))
  307. dw_fx_outware.setitem(row,'dscrp', item.GetString('dscrp'))
  308. dw_fx_outware.setitem(row,'sync_flag', item.GetInt('sync_flag'))
  309. dw_fx_outware.setitem(row,'sync_time',item.GetDateTime('sync_time'))
  310. dw_fx_outware.setitem(row,'opemp', item.GetString('opemp'))
  311. dw_fx_outware.setitem(row,'opdate', item.GetDateTime('opdate'))
  312. dw_fx_outware.setitem(row,'modemp', item.GetString('modemp'))
  313. dw_fx_outware.setitem(row,'moddate',item.GetDateTime('moddate'))
  314. dw_fx_outware.setitem(row,'auditemp',item.GetString('auditemp'))
  315. dw_fx_outware.setitem(row,'auditdate', item.GetDateTime('auditdate'))
  316. dw_fx_outware.setitem(row,'erp_affirmemp', item.GetString('erp_affirmemp'))
  317. dw_fx_outware.setitem(row,'erp_affirmdate', item.GetDateTime('erp_affirmdate'))
  318. dw_fx_outware.setitem(row,'erp_begindate', item.GetDateTime('erp_begindate'))
  319. dw_fx_outware.setitem(row,'finishdate', item.GetDateTime('finishdate'))
  320. dw_fx_outware.setitem(row,'cancel_emp', item.GetString('cancel_emp'))
  321. dw_fx_outware.setitem(row,'cancel_date', item.GetDateTime('cancel_date'))
  322. next
  323. dw_fx_outware.sort()
  324. dw_fx_outware.SetRedraw(true)
  325. if (dw_fx_outware.RowCount() > 0) then
  326. dw_fx_outware.SelectRow(0, false)
  327. dw_fx_outware.SelectRow(1, true)
  328. dw_fx_outware.SetRow(1)
  329. dw_fx_outware.post event RowFocusChanged(1)
  330. end if
  331. end subroutine
  332. public subroutine wf_retrieve_outware_mx (long arg_outwareid);IF IsNull(arg_outwareid) Or arg_outwareid <= 0 THEN
  333. RETURN
  334. END IF
  335. String arg_msg
  336. oleobject request, response
  337. oleobject list, Item
  338. request = FXAppCom.CreatePbDictionary()
  339. request.SetString('token', app_token_fx)
  340. request.SetInt('billid', arg_outwareid)
  341. response = FXAppCom.DoExecute('GetCheckbillDetail', request)
  342. arg_msg = response.GetString('ErrMsg')
  343. If (arg_msg <> '') THEN
  344. MessageBox('提示', '获取明细失败:' + arg_msg)
  345. RETURN
  346. END IF
  347. list = response.GetPBArray('mxList')
  348. DateTime dt
  349. Any acceptdate, outwaredate
  350. dt = DateTime(Date('1899-12-30'), Time('00:00:00'))
  351. dw_fx_outware_mx.Reset()
  352. dw_fx_outware_mx.SetRedraw(False)
  353. Long i,row
  354. FOR i = 1 To list.Count
  355. Item = list.GetPBDictionary(i - 1)
  356. row = dw_fx_outware_mx.InsertRow(0)
  357. dw_fx_outware_mx.SetItem(row,'billid', Item.GetInt('billid'))
  358. dw_fx_outware_mx.SetItem(row,'printid', Item.GetInt('printid'))
  359. dw_fx_outware_mx.SetItem(row,'taskcode', Item.GetString('taskcode'))
  360. dw_fx_outware_mx.SetItem(row,'reltaskid', Item.GetInt('reltaskid'))
  361. dw_fx_outware_mx.SetItem(row,'relprintid', Item.GetInt('relprintid'))
  362. dw_fx_outware_mx.SetItem(row,'forqty', Item.GetDouble('forqty'))
  363. dw_fx_outware_mx.SetItem(row,'passqty', Item.GetDouble('passqty'))
  364. dw_fx_outware_mx.SetItem(row,'checktype', Item.GetInt('checktype'))
  365. dw_fx_outware_mx.SetItem(row,'checkqty', Item.GetDouble('checkqty'))
  366. dw_fx_outware_mx.SetItem(row,'goodqty', Item.GetDouble('goodqty'))
  367. dw_fx_outware_mx.SetItem(row,'badqty', Item.GetDouble('badqty'))
  368. dw_fx_outware_mx.SetItem(row,'finishflag', Item.GetInt('finishflag'))
  369. dw_fx_outware_mx.SetItem(row,'checkemp', Item.GetString('checkemp'))
  370. dw_fx_outware_mx.SetItem(row,'checkdate', Item.GetDateTime('checkdate'))
  371. dw_fx_outware_mx.SetItem(row,'mxdscrp', Item.GetString('mxdscrp'))
  372. dw_fx_outware_mx.SetItem(row,'mtrlcode', Item.GetString('mtrlcode'))
  373. dw_fx_outware_mx.SetItem(row,'mtrlname', Item.GetString('mtrlname'))
  374. dw_fx_outware_mx.SetItem(row,'mtrlmode', Item.GetString('mtrlmode'))
  375. dw_fx_outware_mx.SetItem(row,'status', Item.GetString('status'))
  376. dw_fx_outware_mx.SetItem(row,'woodcode', Item.GetString('woodcode'))
  377. dw_fx_outware_mx.SetItem(row,'pcode', Item.GetString('pcode'))
  378. NEXT
  379. IF dw_fx_outware_mx.RowCount() > 0 THEN
  380. dw_fx_outware_mx.SelectRow(0, False)
  381. dw_fx_outware_mx.SelectRow(1, True)
  382. dw_fx_outware_mx.SetRow(1)
  383. wf_filtermx()
  384. END IF
  385. dw_fx_outware_mx.SetRedraw(True)
  386. end subroutine
  387. public function integer wf_change_taborder (integer arg_taborder);IF arg_taborder = 0 THEN
  388. dw_fx_outware_free.SetTabOrder('billdate', 0)
  389. dw_fx_outware_free.SetTabOrder('cusname', 0)
  390. dw_fx_outware_free.SetTabOrder('dscrp', 0)
  391. dw_fx_outware_mx.SetTabOrder('checktype', 0)
  392. dw_fx_outware_mx.SetTabOrder('checkqty', 0)
  393. dw_fx_outware.Enabled = True
  394. ELSE
  395. dw_fx_outware_free.SetTabOrder('billdate', 10)
  396. dw_fx_outware_free.SetTabOrder('cusname', 20)
  397. dw_fx_outware_free.SetTabOrder('dscrp', 30)
  398. dw_fx_outware_mx.SetTabOrder('checktype', 20)
  399. dw_fx_outware_mx.SetTabOrder('checkqty', 30)
  400. dw_fx_outware.Enabled = False
  401. END IF
  402. RETURN 1
  403. end function
  404. public function integer wf_cus_select ();IF NOT dw_edit_mode THEN RETURN 0
  405. long ori_cuscomid, new_cuscomid, row
  406. row = dw_fx_outware_free.GetRow()
  407. ori_cuscomid = dw_fx_outware_free.Object.cuscomid[row]
  408. IF ori_cuscomid > 0 THEN
  409. IF dw_fx_outware_mx.RowCount() > 0 THEN
  410. MessageBox('','修改客户前需要先清除单据明细')
  411. RETURN 0
  412. END IF
  413. END IF
  414. s_fx_company s_tran, s_ret
  415. OpenWithParm(w_cus_ch_fx, s_tran)
  416. s_ret = Message.PowerObjectParm
  417. IF not IsNull(s_ret) then
  418. IF (s_ret.ifselect) then
  419. new_cuscomid = s_ret.comid[1]
  420. IF (ori_cuscomid <> new_cuscomid) then
  421. dw_fx_outware_mx.Reset() // 重选客户,清空明细
  422. END IF
  423. dw_fx_outware_free.Object.cuscomid[row] = new_cuscomid
  424. dw_fx_outware_free.Object.cusname[row] = s_ret.comname[1]
  425. dw_fx_outware_free.Object.sptid_erp[row] = s_ret.relid[1]
  426. dw_fx_outware_free.AcceptText()
  427. RETURN 1
  428. END IF
  429. END IF
  430. RETURN 0
  431. end function
  432. public function integer wf_send_checkbill (ref string arg_msg);Int rslt = 1
  433. Long j
  434. If (dw_fx_outware_mx.RowCount() <= 0) THEN
  435. rslt = 0
  436. arg_msg = '没有明细'
  437. GOTO ext
  438. END IF
  439. Long ll_getrow, ll_billid
  440. ll_getrow = dw_fx_outware_free.GetRow()
  441. String ls_dscrp
  442. DateTime ldt_billdate
  443. Date ld_tempdate
  444. dw_fx_outware_free.AcceptText()
  445. ls_dscrp = dw_fx_outware_free.Object.dscrp[ll_getrow]
  446. ld_tempdate = Date(dw_fx_outware_free.Object.billdate[ll_getrow])
  447. ldt_billdate = DateTime(ld_tempdate, Now())
  448. IF if_modify_mode THEN
  449. ll_billid = dw_fx_outware_free.Object.billid[ll_getrow]
  450. ELSE
  451. ll_billid = 0
  452. END IF
  453. IF IsNull(dw_fx_outware_free.Object.cuscomid[ll_getrow]) Or (dw_fx_outware_free.Object.cuscomid[ll_getrow]) = 0 THEN
  454. rslt = 0
  455. arg_msg = '请选择客户!'
  456. GOTO ext
  457. END IF
  458. dw_fx_outware_free.AcceptText()
  459. dw_fx_outware_mx.AcceptText()
  460. dw_itemmx.SetFilter('')
  461. dw_itemmx.Filter()
  462. dw_itemmx.AcceptText()
  463. IF IsNull(ll_billid) THEN ll_billid = 0
  464. IF IsNull( dw_fx_outware_free.Object.billcode[ll_getrow]) THEN dw_fx_outware_free.Object.billcode[ll_getrow] = ''
  465. IF IsNull(ls_dscrp) THEN ls_dscrp = ''
  466. IF IsNull(dw_fx_outware_free.Object.cuscomid[ll_getrow]) THEN dw_fx_outware_free.Object.cuscomid[ll_getrow] = 0
  467. dw_fx_outware_free.AcceptText()
  468. oleobject Item,Item_1, outware, mxs,fx_fileList,fileList,itemList
  469. fx_fileList = FXAppCom.NewPBArray()
  470. fileList = FXAppCom.NewPBArray()
  471. // FXAppCom.NewPBArray()
  472. outware = FXAppCom.CreatePbDictionary()
  473. outware.SetInt('billid', ll_billid)
  474. outware.SetInt('billtype', 0) //质量自检单
  475. outware.SetInt('flag', 0) //
  476. outware.SetInt('sync_flag', 0) //
  477. outware.SetString('opemp', '')
  478. outware.SetString('modemp', '')
  479. outware.SetString('auditemp', '')
  480. outware.SetString('erp_affirmemp', '')
  481. outware.SetString('cancel_emp', '')
  482. outware.SetInt('billid', ll_billid)
  483. outware.SetString('billcode', dw_fx_outware_free.Object.billcode[ll_getrow])
  484. outware.SetString('dscrp', ls_dscrp)
  485. outware.SetDateTime('billdate', ldt_billdate)
  486. outware.SetInt('cuscomid',dw_fx_outware_free.Object.cuscomid[ll_getrow])
  487. outware.SetInt('sptid_erp',dw_fx_outware_free.Object.sptid_erp[ll_getrow])
  488. mxs = FXAppCom.CreArrOfPbDictionary()
  489. //mxitem = FXAppCom.CreArrOfPbDictionary()
  490. Long i, cnt = 0
  491. DateTime ld_now
  492. ld_now = DateTime(Today(),Now())
  493. FOR i = 1 To dw_fx_outware_mx.RowCount()
  494. IF IsNull(dw_fx_outware_mx.Object.billid[i]) THEN dw_fx_outware_mx.Object.billid[i] = 0
  495. IF IsNull(dw_fx_outware_mx.Object.printid[i]) THEN dw_fx_outware_mx.Object.printid[i] = 0
  496. IF IsNull(dw_fx_outware_mx.Object.taskcode[i]) THEN dw_fx_outware_mx.Object.taskcode[i] = ''
  497. IF IsNull(dw_fx_outware_mx.Object.reltaskid[i]) THEN dw_fx_outware_mx.Object.reltaskid[i] = 0
  498. IF IsNull(dw_fx_outware_mx.Object.relprintid[i]) THEN dw_fx_outware_mx.Object.relprintid[i] = 0
  499. IF IsNull(dw_fx_outware_mx.Object.forqty[i]) THEN dw_fx_outware_mx.Object.forqty[i] = 0
  500. IF IsNull(dw_fx_outware_mx.Object.passqty[i]) THEN dw_fx_outware_mx.Object.passqty[i] = 0
  501. IF IsNull(dw_fx_outware_mx.Object.checktype[i]) THEN dw_fx_outware_mx.Object.checktype[i] = 0
  502. IF IsNull(dw_fx_outware_mx.Object.checkqty[i]) THEN dw_fx_outware_mx.Object.checkqty[i] = 0
  503. IF IsNull(dw_fx_outware_mx.Object.goodqty[i]) THEN dw_fx_outware_mx.Object.goodqty[i] = 0
  504. IF IsNull(dw_fx_outware_mx.Object.badqty[i]) THEN dw_fx_outware_mx.Object.badqty[i] = 0
  505. IF IsNull(dw_fx_outware_mx.Object.finishflag[i]) THEN dw_fx_outware_mx.Object.finishflag[i] = 0
  506. IF IsNull(dw_fx_outware_mx.Object.checkemp[i]) THEN dw_fx_outware_mx.Object.checkemp[i] = ''
  507. IF IsNull(dw_fx_outware_mx.Object.mxdscrp[i]) THEN dw_fx_outware_mx.Object.mxdscrp[i] = ''
  508. If (dw_fx_outware_mx.Object.checkqty[i] <= 0) THEN CONTINUE
  509. If (dw_fx_outware_mx.Object.checkqty[i] > dw_fx_outware_mx.Object.forqty[i]) THEN
  510. rslt = 0
  511. arg_msg = "行:" + String(dw_fx_outware_mx.Object.compute_2[i]) + "检验数不能大于【代表批量】"
  512. GOTO ext
  513. END IF
  514. cnt ++
  515. Item = FXAppCom.CreatePbDictionary()
  516. Item.SetInt('printid', cnt)
  517. Item.SetString('taskcode', dw_fx_outware_mx.Object.taskcode[i])
  518. Item.SetInt('reltaskid', dw_fx_outware_mx.Object.reltaskid[i])
  519. Item.SetInt('relprintid', dw_fx_outware_mx.Object.relprintid[i])
  520. Item.SetDouble('forqty', dw_fx_outware_mx.Object.forqty[i])
  521. Item.SetInt('checktype', dw_fx_outware_mx.Object.checktype[i])
  522. Item.SetDouble('checkqty', dw_fx_outware_mx.Object.checkqty[i])
  523. Item.SetDouble('passqty', dw_fx_outware_mx.Object.passqty[i])
  524. Item.SetDouble('goodqty', dw_fx_outware_mx.Object.goodqty[i])
  525. Item.SetDouble('badqty', dw_fx_outware_mx.Object.badqty[i])
  526. Item.SetDouble('finishflag', dw_fx_outware_mx.Object.finishflag[i])
  527. Item.SetString('checkemp', dw_fx_outware_mx.Object.checkemp[i])
  528. Item.SetString('mxdscrp', dw_fx_outware_mx.Object.mxdscrp[i])
  529. Item.SetObject('fx_fileList', fx_fileList)
  530. Item.SetObject('fileList', fileList)
  531. // 传入检查项目
  532. itemList = FXAppCom.CreArrOfPbDictionary()
  533. FOR j = 1 To dw_itemmx.RowCount()
  534. IF dw_itemmx.Object.fx_check_bill_itemmx_printid[j] = dw_fx_outware_mx.Object.printid[i] THEN
  535. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_billid[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_billid[j] = 0
  536. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_printid[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_printid[j] = 0
  537. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_mxid[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_mxid[j] = 0
  538. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_itemid_erp[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_itemid_erp[j] = 0
  539. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_qcresult[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_qcresult[j] = 0
  540. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_goodqty[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_goodqty[j] = 0
  541. IF IsNull(dw_itemmx.Object.fx_check_bill_itemmx_badqty[j]) THEN dw_itemmx.Object.fx_check_bill_itemmx_badqty[j] = 0
  542. Item_1 = FXAppCom.CreatePbDictionary()
  543. Item_1.SetInt('billid', dw_itemmx.Object.fx_check_bill_itemmx_billid[j])
  544. Item_1.SetInt('printid', dw_itemmx.Object.fx_check_bill_itemmx_printid[j])
  545. Item_1.SetInt('mxid', dw_itemmx.Object.fx_check_bill_itemmx_mxid[j])
  546. Item_1.SetInt('itemid_erp', dw_itemmx.Object.fx_check_bill_itemmx_itemid_erp[j])
  547. Item_1.SetString('qcresult', dw_itemmx.Object.fx_check_bill_itemmx_qcresult[j])
  548. Item_1.SetDouble('goodqty', dw_itemmx.Object.fx_check_bill_itemmx_goodqty[j])
  549. Item_1.SetDouble('badqty', dw_itemmx.Object.fx_check_bill_itemmx_badqty[j])
  550. itemList.Add(Item_1)
  551. END IF
  552. NEXT
  553. Item.SetObject('itemList', itemList)
  554. mxs.Add(Item)
  555. NEXT
  556. If (cnt <= 0) THEN
  557. rslt = 0
  558. arg_msg = '没有明细'
  559. GOTO ext
  560. END IF
  561. //mxs.Add(fx_fileList)
  562. //mxs.Add('fx_fileList', fx_fileList)
  563. //mxs.SetObject('fx_fileList', fx_fileList)
  564. oleobject request,response
  565. request = FXAppCom.CreatePbDictionary()
  566. request.SetString('token', app_token_fx)
  567. request.SetObject('bill', outware)
  568. request.SetObject('mxList', mxs)
  569. response = FXAppCom.DoExecute('SaveCheckBill', request)
  570. arg_msg = response.GetString('ErrMsg')
  571. If (arg_msg <> '') THEN
  572. rslt = 0
  573. GOTO ext
  574. END IF
  575. ext:
  576. RETURN rslt
  577. end function
  578. public subroutine wf_retrieve_outware_itemmx (long arg_outwareid);IF IsNull(arg_outwareid) Or arg_outwareid <= 0 THEN
  579. RETURN
  580. END IF
  581. String arg_msg
  582. oleobject request, response
  583. oleobject list, Item
  584. request = FXAppCom.CreatePbDictionary()
  585. request.SetString('token', app_token_fx)
  586. request.SetInt('billid', arg_outwareid)
  587. request.SetInt('printid', -1)
  588. response = FXAppCom.DoExecute('GetCheckbillItem', request)
  589. arg_msg = response.GetString('ErrMsg')
  590. If (arg_msg <> '') THEN
  591. MessageBox('提示', '获取明细失败:' + arg_msg)
  592. RETURN
  593. END IF
  594. list = response.GetPBArray('mxList')
  595. DateTime dt
  596. Any acceptdate, outwaredate
  597. dt = DateTime(Date('1899-12-30'), Time('00:00:00'))
  598. dw_itemmx.Reset()
  599. dw_itemmx.SetRedraw(False)
  600. Long i,row
  601. FOR i = 1 To list.Count
  602. Item = list.GetPBDictionary(i - 1)
  603. row = dw_itemmx.InsertRow(0)
  604. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_billid', Item.GetInt('billid'))
  605. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_printid', Item.GetInt('printid'))
  606. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_mxid', Item.GetInt('mxid'))
  607. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_itemid_erp', Item.GetInt('itemid_erp'))
  608. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_qcresult', Item.GetString('qcresult'))
  609. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_goodqty', Item.GetDouble('goodqty'))
  610. dw_itemmx.SetItem(row,'fx_check_bill_itemmx_badqty', Item.GetDouble('badqty'))
  611. dw_itemmx.SetItem(row,'fx_checkitem_itemname', Item.GetString('itemname'))
  612. NEXT
  613. dw_itemmx.sort()
  614. dw_itemmx.SetRedraw(True)
  615. end subroutine
  616. public subroutine wf_filtermx ();Long row
  617. String ls_filter = ''
  618. row = dw_fx_outware_mx.GetRow()
  619. IF row <= 0 THEN
  620. ls_filter = '1 = 0'
  621. ELSE
  622. ls_filter = "fx_check_bill_itemmx_printid = " + String(dw_fx_outware_mx.Object.printid[row])
  623. END IF
  624. dw_itemmx.SetFilter(ls_filter)
  625. dw_itemmx.Filter()
  626. end subroutine
  627. on w_fx_check_bill.create
  628. int iCurrent
  629. call super::create
  630. this.cb_refresh=create cb_refresh
  631. this.cb_new=create cb_new
  632. this.cb_delete=create cb_delete
  633. this.cb_audit=create cb_audit
  634. this.cb_cancle_audit=create cb_cancle_audit
  635. this.cb_print=create cb_print
  636. this.cb_confirm_return=create cb_confirm_return
  637. this.ddlb_status=create ddlb_status
  638. this.st_2=create st_2
  639. this.em_datea=create em_datea
  640. this.em_datez=create em_datez
  641. this.st_3=create st_3
  642. this.dw_fx_outware_free=create dw_fx_outware_free
  643. this.cb_add_mx=create cb_add_mx
  644. this.cb_delete_mx=create cb_delete_mx
  645. this.cb_modify=create cb_modify
  646. this.dw_fx_outware=create dw_fx_outware
  647. this.dw_fx_outware_mx=create dw_fx_outware_mx
  648. this.cb_1=create cb_1
  649. this.dw_itemmx=create dw_itemmx
  650. this.st_1=create st_1
  651. this.cb_input=create cb_input
  652. iCurrent=UpperBound(this.Control)
  653. this.Control[iCurrent+1]=this.cb_refresh
  654. this.Control[iCurrent+2]=this.cb_new
  655. this.Control[iCurrent+3]=this.cb_delete
  656. this.Control[iCurrent+4]=this.cb_audit
  657. this.Control[iCurrent+5]=this.cb_cancle_audit
  658. this.Control[iCurrent+6]=this.cb_print
  659. this.Control[iCurrent+7]=this.cb_confirm_return
  660. this.Control[iCurrent+8]=this.ddlb_status
  661. this.Control[iCurrent+9]=this.st_2
  662. this.Control[iCurrent+10]=this.em_datea
  663. this.Control[iCurrent+11]=this.em_datez
  664. this.Control[iCurrent+12]=this.st_3
  665. this.Control[iCurrent+13]=this.dw_fx_outware_free
  666. this.Control[iCurrent+14]=this.cb_add_mx
  667. this.Control[iCurrent+15]=this.cb_delete_mx
  668. this.Control[iCurrent+16]=this.cb_modify
  669. this.Control[iCurrent+17]=this.dw_fx_outware
  670. this.Control[iCurrent+18]=this.dw_fx_outware_mx
  671. this.Control[iCurrent+19]=this.cb_1
  672. this.Control[iCurrent+20]=this.dw_itemmx
  673. this.Control[iCurrent+21]=this.st_1
  674. this.Control[iCurrent+22]=this.cb_input
  675. end on
  676. on w_fx_check_bill.destroy
  677. call super::destroy
  678. destroy(this.cb_refresh)
  679. destroy(this.cb_new)
  680. destroy(this.cb_delete)
  681. destroy(this.cb_audit)
  682. destroy(this.cb_cancle_audit)
  683. destroy(this.cb_print)
  684. destroy(this.cb_confirm_return)
  685. destroy(this.ddlb_status)
  686. destroy(this.st_2)
  687. destroy(this.em_datea)
  688. destroy(this.em_datez)
  689. destroy(this.st_3)
  690. destroy(this.dw_fx_outware_free)
  691. destroy(this.cb_add_mx)
  692. destroy(this.cb_delete_mx)
  693. destroy(this.cb_modify)
  694. destroy(this.dw_fx_outware)
  695. destroy(this.dw_fx_outware_mx)
  696. destroy(this.cb_1)
  697. destroy(this.dw_itemmx)
  698. destroy(this.st_1)
  699. destroy(this.cb_input)
  700. end on
  701. event resize;call super::resize;int li_free_width,li_free_height
  702. li_free_width = 1810 //dw_fx_outwar_free宽度
  703. li_free_height = 1220 //dw_fx_outware_free高度
  704. //dw_fx_outware_free
  705. dw_fx_outware_free.width = li_free_width
  706. dw_fx_outware_free.height = li_free_height
  707. //dw_fx_outware
  708. dw_fx_outware.x = li_free_width + 30
  709. dw_fx_outware.y = dw_fx_outware_free.y
  710. dw_fx_outware.width = this.workspacewidth() - li_free_width
  711. dw_fx_outware.height = dw_fx_outware_free.height
  712. //cb_add_mx, cb_delete_mx
  713. cb_add_mx.x = 40
  714. cb_add_mx.y = dw_fx_outware_free.y + li_free_height + 20
  715. cb_delete_mx.x = cb_add_mx.width + 20
  716. cb_delete_mx.y = cb_add_mx.y
  717. cb_input.x = cb_delete_mx.width + cb_add_mx.width + 20
  718. cb_input.y = cb_delete_mx.y
  719. //dw_fx_outware_mx
  720. dw_fx_outware_mx.y = cb_add_mx.y + cb_add_mx.height + 30
  721. dw_fx_outware_mx.width = this.workspacewidth() / 5 * 3
  722. dw_fx_outware_mx.height = this.workspaceheight() - cb_add_mx.y - cb_add_mx.height - 30
  723. dw_itemmx.x= dw_fx_outware_mx.x + dw_fx_outware_mx.width
  724. dw_itemmx.y = dw_fx_outware_mx.y
  725. dw_itemmx.width = this.workspacewidth() / 5 * 2 - 50
  726. dw_itemmx.height = dw_fx_outware_mx.height
  727. end event
  728. event open;call super::open;wf_movetocenter()
  729. dw_fx_outware_free.insertrow(0)
  730. ddlb_status.SelectItem(6)
  731. em_dateA.Text = String(RelativeDate(Today(), - 30))
  732. em_dateZ.Text = String(Today())
  733. wf_retrieve_outware()
  734. end event
  735. type cb_func from w_publ_base_style`cb_func within w_fx_check_bill
  736. boolean visible = false
  737. integer x = 1618
  738. end type
  739. type cb_exit from w_publ_base_style`cb_exit within w_fx_check_bill
  740. integer x = 1166
  741. integer y = 4
  742. end type
  743. event cb_exit::clicked;if dw_edit_mode or if_modify_mode then
  744. IF MessageBox('提示','是否放弃新建/修改,并退出?',Question! ,OKCancel! , 1 ) = 2 THEN
  745. return
  746. END IF
  747. end if
  748. close(parent)
  749. end event
  750. type ln_bar from w_publ_base_style`ln_bar within w_fx_check_bill
  751. end type
  752. type ln_bar2 from w_publ_base_style`ln_bar2 within w_fx_check_bill
  753. end type
  754. type r_bar from w_publ_base_style`r_bar within w_fx_check_bill
  755. integer x = 2135
  756. end type
  757. type cb_refresh from uo_imflatbutton within w_fx_check_bill
  758. integer width = 151
  759. integer height = 164
  760. integer taborder = 10
  761. boolean bringtotop = true
  762. string text = "刷新"
  763. string normalpicname = "refresh.bmp"
  764. integer picsize = 16
  765. toolbaralignment pic_align = alignattop!
  766. boolean border = false
  767. end type
  768. event clicked;call super::clicked;wf_retrieve_outware()
  769. end event
  770. type cb_new from uo_imflatbutton within w_fx_check_bill
  771. integer x = 155
  772. integer width = 165
  773. integer height = 164
  774. integer taborder = 10
  775. boolean bringtotop = true
  776. string text = "新建"
  777. string normalpicname = "new.bmp"
  778. integer picsize = 16
  779. toolbaralignment pic_align = alignattop!
  780. boolean border = false
  781. end type
  782. event clicked;call super::clicked;long rslt = 1
  783. string arg_msg
  784. if dw_edit_mode then // 新建/修改保存
  785. if wf_send_checkbill(ref arg_msg) = 0 then
  786. messagebox('提示', '保存失败,原因:' + arg_msg)
  787. rslt = 0
  788. goto ext
  789. end if
  790. wf_change_taborder(0)
  791. Messagebox('提示', '保存成功')
  792. wf_retrieve_outware()
  793. else
  794. long li_row
  795. dw_fx_outware.reset()
  796. li_row = dw_fx_outware.insertrow(0)
  797. dw_fx_outware.Object.billdate[li_row] = today()
  798. dw_fx_outware.Object.billid[li_row] = 0
  799. dw_fx_outware.Object.billcode[li_row] = ''
  800. dw_fx_outware_mx.reset()
  801. dw_fx_outware_free.Reset()
  802. dw_fx_outware.RowsCopy(li_row, li_row, Primary!, dw_fx_outware_free, 1, Primary!)
  803. wf_change_taborder(1)
  804. end if
  805. ext:
  806. if rslt = 1 then
  807. dw_edit_mode = Not dw_edit_mode
  808. if_modify_mode = false
  809. wf_btn_enabled()
  810. end if
  811. end event
  812. type cb_delete from uo_imflatbutton within w_fx_check_bill
  813. integer x = 494
  814. integer width = 165
  815. integer height = 164
  816. integer taborder = 10
  817. boolean bringtotop = true
  818. string text = "删除"
  819. string normalpicname = "delete.bmp"
  820. integer picsize = 16
  821. toolbaralignment pic_align = alignattop!
  822. boolean border = false
  823. end type
  824. event clicked;call super::clicked;long ll_row, ll_flag,ll_billid
  825. ll_row = dw_fx_outware.GetRow()
  826. IF ll_row <= 0 THEN
  827. messagebox('提示', '请选择当前行,不能删除!')
  828. end if
  829. IF MessageBox ("IF","是否确定要删除当前单据吗",Question!,YesNo! ) = 2 THEN RETURN
  830. ll_flag = dw_fx_outware.Object.flag[ll_row]
  831. ll_billid = dw_fx_outware.Object.billid[ll_row]
  832. if ll_flag <> 0 then
  833. messagebox('提示', '不是待审核单据,不能删除!')
  834. return
  835. end if
  836. oleobject request,response
  837. request = FXAppCom.CreatePbDictionary()
  838. request.SetString('token', app_token_fx)
  839. request.SetObject('billid', ll_billid)
  840. string arg_msg
  841. response = FXAppCom.DoExecute('DelCheckbill', request)
  842. arg_msg = response.GetString('ErrMsg')
  843. if (arg_msg <> '') then
  844. messagebox('提示', '删除失败,' + arg_msg)
  845. else
  846. messagebox('提示', '删除成功!')
  847. wf_retrieve_outware()
  848. end if
  849. end event
  850. type cb_audit from uo_imflatbutton within w_fx_check_bill
  851. integer x = 663
  852. integer width = 165
  853. integer height = 164
  854. integer taborder = 10
  855. boolean bringtotop = true
  856. string text = "审核"
  857. string normalpicname = "audit.bmp"
  858. integer picsize = 16
  859. toolbaralignment pic_align = alignattop!
  860. boolean border = false
  861. end type
  862. event clicked;call super::clicked;long ll_row, ll_flag, ll_billid
  863. ll_row = dw_fx_outware.GetRow()
  864. IF ll_row <= 0 THEN
  865. messagebox('提示', '请选择当前行,不能审核!')
  866. return
  867. end if
  868. IF MessageBox ("IF","是否确定要审核当前单据吗",Question!,YesNo! ) = 2 THEN RETURN
  869. ll_flag = dw_fx_outware.Object.flag[ll_row]
  870. ll_billid = dw_fx_outware.Object.billid[ll_row]
  871. if ll_flag <> 0 then
  872. messagebox('提示', '不是待审核单据,不能审核!')
  873. return
  874. end if
  875. oleobject request,response
  876. request = FXAppCom.CreatePbDictionary()
  877. request.SetString('token', app_token_fx)
  878. request.SetObject('billid', ll_billid)
  879. request.SetObject('flag', 1)
  880. string arg_msg
  881. response = FXAppCom.DoExecute('SaveCheckbillFlag', request)
  882. arg_msg = response.GetString('ErrMsg')
  883. if (arg_msg <> '') then
  884. messagebox('提示', '审核失败,' + arg_msg)
  885. else
  886. messagebox('提示', '审核成功!')
  887. wf_retrieve_outware()
  888. end if
  889. end event
  890. type cb_cancle_audit from uo_imflatbutton within w_fx_check_bill
  891. integer x = 832
  892. integer width = 165
  893. integer height = 164
  894. integer taborder = 20
  895. boolean bringtotop = true
  896. string text = "撤审"
  897. string normalpicname = "caudit.bmp"
  898. integer picsize = 16
  899. toolbaralignment pic_align = alignattop!
  900. boolean border = false
  901. end type
  902. event clicked;call super::clicked;long ll_row, ll_flag, ll_billid
  903. ll_row = dw_fx_outware.GetRow()
  904. IF ll_row <= 0 THEN
  905. messagebox('提示', '请选择当前行,不能撤审!')
  906. return
  907. end if
  908. IF MessageBox ("IF","是否确定要撤审当前单据吗",Question!,YesNo! ) = 2 THEN RETURN
  909. ll_flag = dw_fx_outware.Object.flag[ll_row]
  910. ll_billid = dw_fx_outware.Object.billid[ll_row]
  911. if ll_flag <> 1 then
  912. messagebox('提示', '不是质检状态,不能撤审!')
  913. return
  914. end if
  915. oleobject request,response
  916. request = FXAppCom.CreatePbDictionary()
  917. request.SetString('token', app_token_fx)
  918. request.SetObject('billid', ll_billid)
  919. request.SetObject('flag', 0)
  920. string arg_msg
  921. response = FXAppCom.DoExecute('SaveCheckbillFlag', request)
  922. arg_msg = response.GetString('ErrMsg')
  923. if (arg_msg <> '') then
  924. messagebox('提示', '撤审失败,' + arg_msg)
  925. else
  926. messagebox('提示', '撤审成功!')
  927. wf_retrieve_outware()
  928. end if
  929. end event
  930. type cb_print from uo_imflatbutton within w_fx_check_bill
  931. integer x = 997
  932. integer y = 4
  933. integer width = 165
  934. integer height = 164
  935. integer taborder = 20
  936. boolean bringtotop = true
  937. string text = "打印"
  938. string normalpicname = "print.bmp"
  939. integer picsize = 16
  940. toolbaralignment pic_align = alignattop!
  941. boolean border = false
  942. end type
  943. event clicked;call super::clicked;return
  944. if (dw_edit_mode) then return
  945. long ll_row, ll_status
  946. ll_row = dw_fx_outware.GetRow()
  947. IF ll_row <= 0 THEN
  948. messagebox('提示', '请选择当前行,不能打印!')
  949. end if
  950. ll_status = dw_fx_outware.Object.status[ll_row]
  951. if ll_status = 0 then
  952. messagebox('提示', '待审核单据,不能打印!')
  953. return
  954. end if
  955. Parent.TriggerEvent('ue_print_outware_all')
  956. end event
  957. type cb_confirm_return from uo_imflatbutton within w_fx_check_bill
  958. boolean visible = false
  959. integer x = 1170
  960. integer width = 274
  961. integer height = 164
  962. integer taborder = 30
  963. boolean bringtotop = true
  964. string text = "退货已收"
  965. string normalpicname = "ok.bmp"
  966. integer picsize = 16
  967. toolbaralignment pic_align = alignattop!
  968. boolean border = false
  969. end type
  970. event clicked;call super::clicked;long ll_row, ll_status, ll_outwareid
  971. ll_row = dw_fx_outware.GetRow()
  972. IF ll_row <= 0 THEN
  973. messagebox('提示', '请选择当前行,不能退货!')
  974. end if
  975. ll_status = dw_fx_outware.Object.status[ll_row]
  976. ll_outwareid = dw_fx_outware.Object.outwareid[ll_row]
  977. if ll_status <> 4 then
  978. messagebox('提示', '单据状态不是退货中,不能确认退货!')
  979. return
  980. end if
  981. oleobject request,response
  982. request = FXAppCom.CreatePbDictionary()
  983. request.SetString('token', app_token_fx)
  984. request.SetObject('outwareid', ll_outwareid)
  985. request.SetObject('status', 5)
  986. string arg_msg
  987. response = FXAppCom.DoExecute('SaveFxOutwareStatus', request)
  988. arg_msg = response.GetString('ErrMsg')
  989. if (arg_msg <> '') then
  990. messagebox('提示', '确认失败,' + arg_msg)
  991. else
  992. messagebox('提示', '确认成功!')
  993. wf_retrieve_outware()
  994. end if
  995. end event
  996. type ddlb_status from dropdownlistbox within w_fx_check_bill
  997. integer x = 329
  998. integer y = 188
  999. integer width = 379
  1000. integer height = 496
  1001. integer taborder = 80
  1002. boolean bringtotop = true
  1003. integer textsize = -9
  1004. integer weight = 400
  1005. fontcharset fontcharset = gb2312charset!
  1006. fontpitch fontpitch = variable!
  1007. string facename = "宋体"
  1008. long textcolor = 33554432
  1009. boolean sorted = false
  1010. boolean vscrollbar = true
  1011. string item[] = {"待审核[0]","质检中[1]","已通知客户[2]","客户已确认[3]","作废[9]","全部"}
  1012. borderstyle borderstyle = stylelowered!
  1013. end type
  1014. event selectionchanged;wf_retrieve_outware()
  1015. end event
  1016. type st_2 from statictext within w_fx_check_bill
  1017. integer x = 722
  1018. integer y = 204
  1019. integer width = 288
  1020. integer height = 60
  1021. boolean bringtotop = true
  1022. integer textsize = -9
  1023. integer weight = 400
  1024. fontcharset fontcharset = gb2312charset!
  1025. fontpitch fontpitch = variable!
  1026. string facename = "宋体"
  1027. long textcolor = 33554432
  1028. long backcolor = 16777215
  1029. string text = "质检日期从"
  1030. alignment alignment = center!
  1031. boolean focusrectangle = false
  1032. end type
  1033. event constructor;this.backcolor = parent.backcolor
  1034. end event
  1035. type em_datea from editmask within w_fx_check_bill
  1036. integer x = 1033
  1037. integer y = 192
  1038. integer width = 389
  1039. integer height = 84
  1040. integer taborder = 90
  1041. boolean bringtotop = true
  1042. integer textsize = -9
  1043. integer weight = 400
  1044. fontcharset fontcharset = gb2312charset!
  1045. fontpitch fontpitch = variable!
  1046. string facename = "宋体"
  1047. long textcolor = 33554432
  1048. string text = "0000-00-00"
  1049. borderstyle borderstyle = stylelowered!
  1050. maskdatatype maskdatatype = datemask!
  1051. string mask = "yyyy-mm-dd"
  1052. boolean spin = true
  1053. end type
  1054. type em_datez from editmask within w_fx_check_bill
  1055. integer x = 1527
  1056. integer y = 188
  1057. integer width = 389
  1058. integer height = 84
  1059. integer taborder = 100
  1060. boolean bringtotop = true
  1061. integer textsize = -9
  1062. integer weight = 400
  1063. fontcharset fontcharset = gb2312charset!
  1064. fontpitch fontpitch = variable!
  1065. string facename = "宋体"
  1066. long textcolor = 33554432
  1067. string text = "0000-00-00"
  1068. borderstyle borderstyle = stylelowered!
  1069. maskdatatype maskdatatype = datemask!
  1070. string mask = "yyyy-mm-dd"
  1071. boolean spin = true
  1072. end type
  1073. type st_3 from statictext within w_fx_check_bill
  1074. integer x = 1422
  1075. integer y = 204
  1076. integer width = 96
  1077. integer height = 48
  1078. boolean bringtotop = true
  1079. integer textsize = -9
  1080. integer weight = 400
  1081. fontcharset fontcharset = gb2312charset!
  1082. fontpitch fontpitch = variable!
  1083. string facename = "宋体"
  1084. long textcolor = 33554432
  1085. long backcolor = 16777215
  1086. string text = "到"
  1087. alignment alignment = center!
  1088. boolean focusrectangle = false
  1089. end type
  1090. event constructor;this.backcolor = parent.backcolor
  1091. end event
  1092. type dw_fx_outware_free from datawindow within w_fx_check_bill
  1093. integer x = 37
  1094. integer y = 288
  1095. integer width = 1792
  1096. integer height = 1132
  1097. integer taborder = 30
  1098. boolean bringtotop = true
  1099. string title = "none"
  1100. string dataobject = "dw_fx_check_bill_edit"
  1101. boolean livescroll = true
  1102. borderstyle borderstyle = stylelowered!
  1103. end type
  1104. event doubleclicked;if (not dw_edit_mode) then return
  1105. if (row <= 0) then return
  1106. if dwo.Type = 'column' and dwo.Name = 'cusname' then
  1107. wf_cus_select()
  1108. end if
  1109. end event
  1110. type cb_add_mx from commandbutton within w_fx_check_bill
  1111. integer x = 32
  1112. integer y = 1452
  1113. integer width = 306
  1114. integer height = 84
  1115. integer taborder = 30
  1116. boolean bringtotop = true
  1117. integer textsize = -9
  1118. integer weight = 400
  1119. fontcharset fontcharset = gb2312charset!
  1120. fontpitch fontpitch = variable!
  1121. string facename = "宋体"
  1122. boolean enabled = false
  1123. string text = "增明细"
  1124. end type
  1125. event clicked;Long currow, cuscomid
  1126. currow = dw_fx_outware_free.GetRow()
  1127. cuscomid = dw_fx_outware_free.Object.cuscomid[currow]
  1128. IF IsNull(cuscomid) Or cuscomid = 0 THEN
  1129. MessageBox('','请先选择客户')
  1130. IF wf_cus_select() = 0 THEN RETURN
  1131. cuscomid = dw_fx_outware_free.Object.cuscomid[currow]
  1132. END IF
  1133. datastore arg_ds
  1134. arg_ds = Create datastore
  1135. arg_ds.DataObject = 'dw_fx_check_bill_saletaskmx_choose'
  1136. s_edit_index_tran s_ch_tran //传递参数使用
  1137. s_ch_tran.b_long=cuscomid
  1138. s_ch_tran.c_long=1 //质量自检单
  1139. OpenWithParm(w_fx_check_bill_saletaskmx_choose1, s_ch_tran)
  1140. arg_ds = Message.PowerObjectParm
  1141. IF IsValid(arg_ds) THEN
  1142. dw_fx_outware_mx.SetRedraw(False)
  1143. Long row, i
  1144. String ls_findstr
  1145. DateTime ld_now
  1146. ld_now = DateTime(Today(),Now())
  1147. FOR i = arg_ds.RowCount() To 1 Step -1
  1148. IF arg_ds.Object.fx_saletaskmx_reltaskid[i] <= 0 THEN CONTINUE
  1149. row = dw_fx_outware_mx.InsertRow(0)
  1150. dw_fx_outware_mx.Object.taskcode[row] = arg_ds.Object.taskcode[i]
  1151. dw_fx_outware_mx.Object.reltaskid[row] = arg_ds.Object.fx_saletaskmx_reltaskid[i]
  1152. dw_fx_outware_mx.Object.relprintid[row] = arg_ds.Object.fx_saletaskmx_relprintid[i]
  1153. dw_fx_outware_mx.Object.mtrlcode[row] = arg_ds.Object.mtrlcode[i]
  1154. dw_fx_outware_mx.Object.mtrlname[row] = arg_ds.Object.mtrlname[i]
  1155. dw_fx_outware_mx.Object.mtrlmode[row] = arg_ds.Object.mtrlmode[i]
  1156. dw_fx_outware_mx.Object.status[row] = arg_ds.Object.status[i]
  1157. dw_fx_outware_mx.Object.woodcode[row] = arg_ds.Object.woodcode[i]
  1158. dw_fx_outware_mx.Object.pcode[row] = arg_ds.Object.pcode[i]
  1159. dw_fx_outware_mx.Object.forqty[row] = arg_ds.Object.forqty[i]
  1160. dw_fx_outware_mx.Object.checkqty[row] = arg_ds.Object.forqty[i]
  1161. dw_fx_outware_mx.Object.checktype[row] = 1
  1162. // dw_fx_outware_mx.Object.taskid[row] = arg_ds.Object.taskid[i]
  1163. // dw_fx_outware_mx.Object.printid[row] = arg_ds.Object.printid[i]
  1164. // dw_fx_outware_mx.Object.mxcode[row] = arg_ds.Object.mxcode[i]
  1165. // dw_fx_outware_mx.Object.fxmtrlid[row] = arg_ds.Object.fxmtrlid[i]
  1166. // dw_fx_outware_mx.Object.mtrlid[row] = arg_ds.Object.mtrlid[i]
  1167. // dw_fx_outware_mx.Object.mtrlcode[row] = arg_ds.Object.mtrlcode[i]
  1168. // dw_fx_outware_mx.Object.mtrlname[row] = arg_ds.Object.mtrlname[i]
  1169. // dw_fx_outware_mx.Object.mtrlmode[row] = arg_ds.Object.mtrlmode[i]
  1170. // dw_fx_outware_mx.Object.status[row] = arg_ds.Object.status[i]
  1171. // dw_fx_outware_mx.Object.woodcode[row] = arg_ds.Object.woodcode[i]
  1172. // dw_fx_outware_mx.Object.pcode[row] = arg_ds.Object.pcode[i]
  1173. // dw_fx_outware_mx.Object.taskqty[row] = arg_ds.Object.qty[i] //订单数量
  1174. // dw_fx_outware_mx.Object.qty_wait[row] = arg_ds.Object.qty_wait[i]
  1175. // dw_fx_outware_mx.Object.cus_receiveqty[row] = arg_ds.Object.cus_receiveqty[i]
  1176. //// IF arg_ds.Object.earliestsenddate[i] > ld_now THEN
  1177. //// dw_fx_outware_mx.Object.qty[row] = 0 //发货数量
  1178. //// ELSE
  1179. // dw_fx_outware_mx.Object.qty[row] = arg_ds.Object.outqty[i]
  1180. //// END IF
  1181. //
  1182. // dw_fx_outware_mx.Object.outwarecode[row] = ''
  1183. // dw_fx_outware_mx.Object.requiredate[row] = arg_ds.Object.requiredate[i]
  1184. // // dw_fx_outware_mx.Object.price[row] = arg_ds.Object.price[i]row] = arg_ds.Object.mxdscrp[i]
  1185. //// dw_fx_outware_mx.Object.mxdscrp2[row] = arg_ds.Object.mxdscrp2[i]
  1186. // dw_fx_outware_mx.Object.mtrlcuscode[row] = arg_ds.Object.mtrlcuscode[i]
  1187. //// dw_fx_outware_mx.Object.plancode[row] = arg_ds.Object.plancode[i]
  1188. // dw_fx_outware_mx.Object.cus_mtrldef_senddays[row] = arg_ds.Object.cus_mtrldef_senddays[i]
  1189. //// dw_fx_outware_mx.Object.mxdscrp[
  1190. // dw_fx_outware_mx.Object.earliestsenddate[row] = arg_ds.Object.earliestsenddate[i]
  1191. // dw_fx_outware_mx.Object.tid[row] = arg_ds.Object.tid[i]
  1192. // dw_fx_outware_mx.Object.taskcode[row] = arg_ds.Object.taskcode[i]
  1193. // dw_fx_outware_mx.Object.unit[row] = arg_ds.Object.unit[i]
  1194. // dw_fx_outware_mx.Object.fx_saletaskmx_saletask_mxid[row] = arg_ds.Object.saletask_mxid[i]
  1195. //
  1196. // dw_fx_outware_mx.Object.tempqty[row] = arg_ds.Object.outqty[i] //临时发货数,判断限制使用
  1197. NEXT
  1198. dw_fx_outware_mx.SetRedraw(True)
  1199. END IF
  1200. end event
  1201. type cb_delete_mx from commandbutton within w_fx_check_bill
  1202. integer x = 347
  1203. integer y = 1452
  1204. integer width = 306
  1205. integer height = 84
  1206. integer taborder = 40
  1207. boolean bringtotop = true
  1208. integer textsize = -9
  1209. integer weight = 400
  1210. fontcharset fontcharset = gb2312charset!
  1211. fontpitch fontpitch = variable!
  1212. string facename = "宋体"
  1213. boolean enabled = false
  1214. string text = "删明细"
  1215. end type
  1216. event clicked;IF dw_fx_outware_mx.RowCount() <= 0 THEN
  1217. MessageBox('提示', '请先添加明细!')
  1218. RETURN
  1219. END IF
  1220. Long i, Index
  1221. Index = 0
  1222. IF dw_fx_outware_mx.GetRow() > 0 THEN
  1223. dw_fx_outware_mx.DeleteRow(dw_fx_outware_mx.GetRow() )
  1224. END IF
  1225. //IF index = 0 THEN
  1226. // MessageBox('提示', '请先勾选要删除的发货明细!')
  1227. //END IF
  1228. end event
  1229. type cb_modify from uo_imflatbutton within w_fx_check_bill
  1230. integer x = 325
  1231. integer width = 165
  1232. integer height = 164
  1233. integer taborder = 20
  1234. boolean bringtotop = true
  1235. string text = "修改"
  1236. string normalpicname = "open.bmp"
  1237. integer picsize = 16
  1238. toolbaralignment pic_align = alignattop!
  1239. boolean border = false
  1240. end type
  1241. event clicked;call super::clicked;if dw_edit_mode then
  1242. if MessageBox('提示','是否放弃新建/修改操作?',Question! ,OKCancel! , 1 ) = 1 then
  1243. wf_change_taborder(0)
  1244. dw_edit_mode = false
  1245. if_modify_mode = false
  1246. wf_btn_enabled()
  1247. wf_retrieve_outware()
  1248. end if
  1249. else
  1250. long ll_row, ll_status
  1251. ll_row = dw_fx_outware.GetRow()
  1252. IF ll_row <= 0 THEN
  1253. messagebox('提示', '请选择当前行,不能修改!')
  1254. end if
  1255. ll_status = dw_fx_outware.Object.flag[ll_row]
  1256. if ll_status <> 0 then
  1257. messagebox('提示', '不是待审核单据,不能修改!')
  1258. return
  1259. end if
  1260. wf_change_taborder(1)
  1261. dw_edit_mode = true
  1262. if_modify_mode = true
  1263. wf_btn_enabled()
  1264. end if
  1265. end event
  1266. type dw_fx_outware from u_dw_rbtnfilter within w_fx_check_bill
  1267. integer x = 1842
  1268. integer y = 276
  1269. integer width = 1714
  1270. integer height = 1148
  1271. integer taborder = 20
  1272. boolean bringtotop = true
  1273. boolean titlebar = true
  1274. string dataobject = "dw_fx_check_bill_index"
  1275. boolean controlmenu = true
  1276. boolean maxbox = true
  1277. boolean hscrollbar = true
  1278. boolean vscrollbar = true
  1279. boolean resizable = true
  1280. boolean border = false
  1281. boolean hsplitscroll = true
  1282. borderstyle borderstyle = styleshadowbox!
  1283. boolean rbutton_filter_use = true
  1284. boolean rbutton_setposition_use = true
  1285. boolean titleclick_sort_use = true
  1286. boolean autosave_setlayout_use = false
  1287. boolean autosave_columnvisible_use = false
  1288. end type
  1289. event rowfocuschanged;call super::rowfocuschanged;if IsNull(currentrow) then
  1290. IF THIS.rowcount() > 0 then
  1291. THIS.SelectRow(0,FALSE)
  1292. THIS.SelectRow(1,TRUE)
  1293. THIS.setrow(1)
  1294. currentrow =1
  1295. end if
  1296. end if
  1297. if IsNull(currentrow) then return
  1298. if (currentrow <= 0) then return
  1299. this.SelectRow(0, false)
  1300. this.SelectRow(currentrow, true)
  1301. dw_fx_outware_free.Reset( )
  1302. this.RowsCopy(currentrow, currentrow, Primary!, dw_fx_outware_free, 1, Primary!)
  1303. long ll_billid
  1304. ll_billid = this.Object.billid[currentrow]
  1305. wf_retrieve_outware_itemmx(ll_billid)
  1306. wf_retrieve_outware_mx(ll_billid)
  1307. end event
  1308. type dw_fx_outware_mx from u_dw_rbtnfilter within w_fx_check_bill
  1309. integer x = 27
  1310. integer y = 1564
  1311. integer width = 2624
  1312. integer height = 828
  1313. integer taborder = 20
  1314. boolean bringtotop = true
  1315. boolean titlebar = true
  1316. string title = "单据明细"
  1317. string dataobject = "dw_fx_check_bill_mx"
  1318. boolean hscrollbar = true
  1319. boolean vscrollbar = true
  1320. boolean livescroll = false
  1321. boolean rbutton_filter_use = true
  1322. boolean rbutton_setposition_use = true
  1323. boolean titleclick_sort_use = true
  1324. end type
  1325. event clicked;call super::clicked;if (row > 0) then
  1326. this.SelectRow(0, false)
  1327. this.SelectRow(row, true)
  1328. this.setrow(row)
  1329. wf_filtermx()
  1330. end if
  1331. end event
  1332. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  1333. This.SelectRow(0, False)
  1334. This.SelectRow(currentrow, True)
  1335. This.SetRow(currentrow)
  1336. wf_filtermx()
  1337. END IF
  1338. end event
  1339. type cb_1 from uo_imflatbutton within w_fx_check_bill
  1340. boolean visible = false
  1341. integer x = 1161
  1342. integer y = 4
  1343. integer width = 274
  1344. integer height = 164
  1345. integer taborder = 30
  1346. boolean bringtotop = true
  1347. string text = "唛头打印"
  1348. string normalpicname = "print.bmp"
  1349. integer picsize = 16
  1350. toolbaralignment pic_align = alignattop!
  1351. boolean border = false
  1352. end type
  1353. event clicked;call super::clicked;if (dw_edit_mode) then return
  1354. long ll_row, ll_status
  1355. ll_row = dw_fx_outware.GetRow()
  1356. IF ll_row <= 0 THEN
  1357. messagebox('提示', '请选择当前行,不能打印!')
  1358. end if
  1359. ll_status = dw_fx_outware.Object.status[ll_row]
  1360. if ll_status = 0 then
  1361. messagebox('提示', '待审核单据,不能打印!')
  1362. return
  1363. end if
  1364. Parent.TriggerEvent('ue_print_outware_all_mt')
  1365. end event
  1366. type dw_itemmx from u_dw_rbtnfilter within w_fx_check_bill
  1367. integer x = 2711
  1368. integer y = 1564
  1369. integer width = 2624
  1370. integer height = 828
  1371. integer taborder = 30
  1372. boolean bringtotop = true
  1373. boolean titlebar = true
  1374. string title = "质检项目明细"
  1375. string dataobject = "dw_fx_check_bill_itemmx"
  1376. boolean hscrollbar = true
  1377. boolean vscrollbar = true
  1378. boolean livescroll = false
  1379. boolean rbutton_filter_use = true
  1380. boolean rbutton_setposition_use = true
  1381. boolean titleclick_sort_use = true
  1382. end type
  1383. event clicked;call super::clicked;if (row > 0) then
  1384. this.SelectRow(0, false)
  1385. this.SelectRow(row, true)
  1386. end if
  1387. end event
  1388. type st_1 from statictext within w_fx_check_bill
  1389. integer x = 23
  1390. integer y = 204
  1391. integer width = 288
  1392. integer height = 60
  1393. boolean bringtotop = true
  1394. integer textsize = -9
  1395. integer weight = 400
  1396. fontcharset fontcharset = gb2312charset!
  1397. fontpitch fontpitch = variable!
  1398. string facename = "宋体"
  1399. long textcolor = 33554432
  1400. long backcolor = 16777215
  1401. string text = "状态"
  1402. alignment alignment = center!
  1403. boolean focusrectangle = false
  1404. end type
  1405. event constructor;this.backcolor = parent.backcolor
  1406. end event
  1407. type cb_input from commandbutton within w_fx_check_bill
  1408. integer x = 677
  1409. integer y = 1452
  1410. integer width = 384
  1411. integer height = 84
  1412. integer taborder = 50
  1413. boolean bringtotop = true
  1414. integer textsize = -9
  1415. integer weight = 400
  1416. fontcharset fontcharset = gb2312charset!
  1417. fontpitch fontpitch = variable!
  1418. string facename = "宋体"
  1419. string text = "录入质检结果"
  1420. end type
  1421. event clicked;//IF dw_fx_outware_mx.RowCount() <= 0 THEN
  1422. // MessageBox('提示', '请先添加明细!')
  1423. // RETURN
  1424. //END IF
  1425. //
  1426. //Long i, Index
  1427. //Index = 0
  1428. //
  1429. //
  1430. //IF dw_fx_outware_mx.GetRow() > 0 THEN
  1431. // dw_fx_outware_mx.DeleteRow(dw_fx_outware_mx.GetRow() )
  1432. //END IF
  1433. //
  1434. Long ll_row
  1435. Long cnt,i
  1436. IF dw_fx_outware_free.GetRow() > 0 THEN
  1437. IF dw_fx_outware_free.Object.flag[dw_fx_outware_free.GetRow()] <> 1 THEN
  1438. MessageBox('提示', '单据不是质检中状态,不能录入质检结果!')
  1439. RETURN
  1440. END IF
  1441. END IF
  1442. ll_row = dw_fx_outware_mx.GetRow()
  1443. IF ll_row <= 0 THEN
  1444. MessageBox('提示', '请选择明细!')
  1445. RETURN
  1446. END IF
  1447. s_check_bill_mx s_mx
  1448. s_mx.billid = dw_fx_outware_mx.Object.billid[ll_row]
  1449. s_mx.printid = dw_fx_outware_mx.Object.printid[ll_row]
  1450. s_mx.taskcode = dw_fx_outware_mx.Object.taskcode[ll_row]
  1451. s_mx.reltaskid = dw_fx_outware_mx.Object.reltaskid[ll_row]
  1452. s_mx.relprintid = dw_fx_outware_mx.Object.relprintid[ll_row]
  1453. s_mx.forqty = dw_fx_outware_mx.Object.forqty[ll_row]
  1454. s_mx.passqty = dw_fx_outware_mx.Object.passqty[ll_row]
  1455. s_mx.checktype = dw_fx_outware_mx.Object.checktype[ll_row]
  1456. s_mx.checkqty = dw_fx_outware_mx.Object.checkqty[ll_row]
  1457. s_mx.goodqty = dw_fx_outware_mx.Object.goodqty[ll_row]
  1458. s_mx.badqty = dw_fx_outware_mx.Object.badqty[ll_row]
  1459. s_mx.finishflag = dw_fx_outware_mx.Object.finishflag[ll_row]
  1460. s_mx.checkemp = dw_fx_outware_mx.Object.checkemp[ll_row]
  1461. s_mx.checkdate = dw_fx_outware_mx.Object.checkdate[ll_row]
  1462. s_mx.mxdscrp = dw_fx_outware_mx.Object.mxdscrp[ll_row]
  1463. s_mx.mtrlcode = dw_fx_outware_mx.Object.mtrlcode[ll_row]
  1464. s_mx.mtrlname = dw_fx_outware_mx.Object.mtrlname[ll_row]
  1465. s_mx.mtrlmode = dw_fx_outware_mx.Object.mtrlmode[ll_row]
  1466. s_mx.status = dw_fx_outware_mx.Object.status[ll_row]
  1467. s_mx.woodcode = dw_fx_outware_mx.Object.woodcode[ll_row]
  1468. s_mx.pcode = dw_fx_outware_mx.Object.pcode[ll_row]
  1469. cnt = 0
  1470. FOR i = 1 To dw_itemmx.RowCount()
  1471. IF dw_itemmx.Object.fx_check_bill_itemmx_printid[i] = s_mx.printid THEN
  1472. cnt++
  1473. s_mx.itemmx[cnt].billid = dw_itemmx.Object.fx_check_bill_itemmx_billid[i]
  1474. s_mx.itemmx[cnt].printid = dw_itemmx.Object.fx_check_bill_itemmx_printid[i]
  1475. s_mx.itemmx[cnt].mxid = dw_itemmx.Object.fx_check_bill_itemmx_mxid[i]
  1476. s_mx.itemmx[cnt].itemid_erp = dw_itemmx.Object.fx_check_bill_itemmx_itemid_erp[i]
  1477. s_mx.itemmx[cnt].qcresult = dw_itemmx.Object.fx_check_bill_itemmx_qcresult[i]
  1478. s_mx.itemmx[cnt].goodqty = dw_itemmx.Object.fx_check_bill_itemmx_goodqty[i]
  1479. s_mx.itemmx[cnt].badqty = dw_itemmx.Object.fx_check_bill_itemmx_badqty[i]
  1480. s_mx.itemmx[cnt].itemname = dw_itemmx.Object.fx_checkitem_itemname[i]
  1481. END IF
  1482. NEXT
  1483. IF cnt = 0 THEN
  1484. MessageBox('提示', '没有质检明细!')
  1485. RETURN
  1486. END IF
  1487. openwithparm(w_fx_check_bill_result,s_mx )
  1488. wf_retrieve_outware_itemmx(s_mx.billid)
  1489. wf_retrieve_outware_mx(s_mx.billid)
  1490. end event