w_oppose_spt.srw 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  1. $PBExportHeader$w_oppose_spt.srw
  2. forward
  3. global type w_oppose_spt from w_publ_1ton_share_detail
  4. end type
  5. type ddlb_status from dropdownlistbox within w_oppose_spt
  6. end type
  7. type st_2 from statictext within w_oppose_spt
  8. end type
  9. end forward
  10. global type w_oppose_spt from w_publ_1ton_share_detail
  11. integer height = 2300
  12. string title = "供应商投诉单"
  13. boolean maxbox = true
  14. windowstate windowstate = maximized!
  15. event insert_childrow ( )
  16. event insert_childrow1 ( )
  17. event ue_fj_edit ( )
  18. event ue_fj_view ( )
  19. ddlb_status ddlb_status
  20. st_2 st_2
  21. end type
  22. global w_oppose_spt w_oppose_spt
  23. type variables
  24. int cur_flag=-1
  25. uo_oppose uo_ware
  26. end variables
  27. forward prototypes
  28. public function integer wf_refresh_curuc (long arg_billid)
  29. public subroutine wf_check_billfj ()
  30. public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg)
  31. public function integer wf_print_retrievedata (ref s_print_pic_list arg_s_pic, ref string arg_msg)
  32. end prototypes
  33. event insert_childrow();long li_row
  34. li_row=dw_child.insertrow(0)
  35. dw_child.scrolltorow(li_row)
  36. dw_child.SetColumn ('u_mtrldef_mtrlcode')
  37. end event
  38. event ue_fj_edit();IF dw_edit_mode THEN
  39. MessageBox('提示','编辑状态下不可用', Information!, OK! )
  40. RETURN
  41. END IF
  42. //IF NOT f_power_ind(1446) THEN
  43. // MessageBox(publ_operator,'你没有使用权限!')
  44. // RETURN
  45. //END IF
  46. s_edit_index_tran s_pic
  47. Long ll_ConnectionID
  48. String arg_msg
  49. Long ls_row
  50. ls_row = dw_pageretr.GetRow()
  51. IF ls_row <= 0 THEN
  52. RETURN
  53. END IF
  54. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  55. MessageBox('提示','没有指定附件数据库连接'+arg_msg, Information!, OK! )
  56. RETURN
  57. END IF
  58. s_pic.f_long = 406 //采购订单的mainID
  59. s_pic.f_string = dw_pageretr.Object.billcode[ls_row]
  60. s_pic.g_long = dw_pageretr.Object.billid[ls_row]
  61. s_pic.e_long = 0
  62. s_pic.sqltransaction = sys_filedb_sqlca
  63. OpenWithParm(w_fj_bill_mng,s_pic)
  64. //wf_check_billfj()
  65. end event
  66. event ue_fj_view();IF dw_edit_mode THEN
  67. MessageBox('提示','编辑状态下不可用', Information!, OK! )
  68. RETURN
  69. END IF
  70. s_edit_index_tran s_pic
  71. Long ll_ConnectionID
  72. String arg_msg
  73. Long ls_row
  74. ls_row = dw_pageretr.GetRow()
  75. IF ls_row <= 0 THEN
  76. RETURN
  77. END IF
  78. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  79. MessageBox('提示','没有指定附件数据库连接'+arg_msg, Information!, OK! )
  80. RETURN
  81. END IF
  82. s_pic.f_long = 406 //采购订单的mainID
  83. s_pic.f_string = dw_pageretr.Object.billcode[ls_row]
  84. s_pic.g_long = dw_pageretr.Object.billid[ls_row]
  85. s_pic.e_long = 0
  86. s_pic.sqltransaction = sys_filedb_sqlca
  87. OpenWithParm(w_fj_bill_view,s_pic)
  88. end event
  89. public function integer wf_refresh_curuc (long arg_billid);//====================================================================
  90. // Function: wf_refresh_curuc(arg_scid,arg_inwareid)
  91. //--------------------------------------------------------------------
  92. // Description: 刷新dw_pageretr
  93. //--------------------------------------------------------------------
  94. // Arguments:
  95. // value long arg_scid
  96. // value long arg_inwareid
  97. //--------------------------------------------------------------------
  98. // Returns: integer
  99. //--------------------------------------------------------------------
  100. // Author: yyx Date: 2003.11.14
  101. //--------------------------------------------------------------------
  102. // Modify History:
  103. //
  104. //====================================================================
  105. if arg_billid<=0 or isnull(arg_billid) then return 0
  106. long uc_row
  107. uc_row=dw_pageretr.getrow()
  108. if uc_row<=0 then return 0
  109. datetime billdate
  110. string opposedept
  111. string billcode
  112. datetime opdate
  113. string opemp
  114. string modemp
  115. datetime moddate
  116. int flag
  117. datetime Auditingdate
  118. string Auditingrep
  119. string threason
  120. long relid
  121. string sptcode
  122. string improveidea
  123. long printnum_1
  124. int itemid
  125. SELECT
  126. u_oppose.billdate,
  127. u_oppose.opposedept,
  128. u_oppose.threason,
  129. u_oppose.relid,
  130. u_spt.sptcode,
  131. u_oppose.manageridea,
  132. u_oppose.billcode,
  133. u_oppose.opdate,
  134. u_oppose.opemp,
  135. u_oppose.moddate,
  136. u_oppose.modemp,
  137. u_oppose.flag,
  138. u_oppose.auditdate,
  139. u_oppose.auditemp,
  140. u_oppose.printnum,
  141. u_oppose.improveidea,
  142. u_oppose.itemid
  143. into :billdate,
  144. :opposedept,
  145. :threason,
  146. :relid,
  147. :sptcode,
  148. :improveidea,
  149. :billcode,
  150. :opdate,
  151. :opemp,
  152. :moddate,
  153. :modemp,
  154. :flag,
  155. :auditingdate,
  156. :auditingrep,
  157. :printnum_1,
  158. :improveidea,
  159. :itemid
  160. FROM u_oppose LEFT OUTER JOIN u_spt ON u_oppose.relid = u_spt.sptid
  161. WHERE u_oppose.billid =:arg_billid ;
  162. if sqlca.sqlcode<>0 then
  163. messagebox('提示',"查询操作失败(错误单据唯一码)", Information!, OK! )
  164. return 0
  165. end if
  166. dw_pageretr.object.printnum[uc_row]=printnum_1
  167. dw_pageretr.object.billid[uc_row]=arg_billid
  168. dw_pageretr.object.opposedept[uc_row]=opposedept
  169. dw_pageretr.object.threason[uc_row]=threason
  170. dw_pageretr.object.u_oppose_relid[uc_row]=relid
  171. dw_pageretr.object.u_spt_sptcode[uc_row]= sptcode
  172. dw_pageretr.object.improveidea[uc_row]= improveidea
  173. dw_pageretr.object.billcode[uc_row]= billcode
  174. dw_pageretr.object.opdate[uc_row]= opdate
  175. dw_pageretr.object.opemp[uc_row]= opemp
  176. dw_pageretr.object.moddate[uc_row]= moddate
  177. dw_pageretr.object.modemp[uc_row]=modemp
  178. dw_pageretr.object.flag[uc_row]=flag
  179. dw_pageretr.object.auditdate[uc_row]=auditingdate
  180. dw_pageretr.object.auditemp[uc_row]=auditingrep
  181. dw_pageretr.object.u_oppose_itemid[uc_row]=itemid
  182. dw_uc.Reset()
  183. dw_pageretr.RowsCopy(dw_pageretr.GetRow(), dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!)
  184. dw_uc.ResetUpdate()
  185. dw_uc.SetRedraw(TRUE)
  186. return 1
  187. end function
  188. public subroutine wf_check_billfj ();String arg_msg
  189. Long ll_ConnectionID
  190. Long cur_billtype
  191. long ll_relid,ll_relid_mx,ll_scid
  192. Long ls_filecount = 0
  193. Int rslt = 1
  194. uo_fj_mng_billtype ls_uo_fjbt
  195. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  196. Long row,uc_relid
  197. row = dw_pageretr.GetRow()
  198. IF row > 0 THEN
  199. ll_relid = dw_pageretr.Object.billid[row]
  200. ll_scid = 0
  201. ll_relid_mx = 0
  202. ELSE
  203. rslt = 0
  204. GOTO ext
  205. END IF
  206. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  207. rslt = 0
  208. GOTO ext
  209. END IF
  210. cur_billtype = 406 //客户投拆单的 mainiD
  211. ls_uo_fjbt.uf_check_billfj( cur_billtype, ll_relid,ll_relid_mx,ll_scid, sys_fileDB_sqlca, arg_msg, ls_filecount)
  212. IF ls_filecount > 0 THEN
  213. rslt = 1
  214. GOTO ext
  215. ELSE
  216. rslt = 0
  217. GOTO ext
  218. END IF
  219. ext:
  220. wf_encl(rslt)
  221. DESTROY ls_uo_fjbt
  222. end subroutine
  223. public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg);//==============================================================================
  224. // 函数: w_publ_1ton_share_detail::wf_xls_retrievedata()
  225. //------------------------------------------------------------------------------
  226. // 描述: 此函数需要 重载,复制祖先范例代码,然后修改retrieve参数部分两处即可
  227. //------------------------------------------------------------------------------
  228. Long LS_ROW,ll_id,i,ll_scid
  229. LS_ROW = dw_uc.GetRow()
  230. IF LS_ROW <= 0 THEN
  231. arg_msg = '没有目标单据!'
  232. RETURN 0
  233. END IF
  234. //修改点:获取 指定retriev参数
  235. ll_id = dw_uc.Object.#1[LS_ROW]
  236. ll_scid = 0
  237. //查询所选模版是否含有图片信息
  238. Long ll_ifpic
  239. Long ll_classid
  240. SELECT ifpic
  241. INTO :ll_ifpic
  242. FROM U_XLS_Templates
  243. Where id = :ll_xls_Templatesid;
  244. IF sqlca.SQLCode <> 0 THEN
  245. ll_ifpic = 0
  246. END IF
  247. Long ll_i,ll_j
  248. Long ll_mtrlid
  249. Long ll_fileid
  250. Blob ls_filedata
  251. SetNull(ls_filedata)
  252. String Pathname,ls_filename,ls_filetype
  253. String errmsg
  254. uo_fj_mng_billtype ls_uo_fjbt
  255. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  256. s_xls_pic_list s_pic //结构数组-用于保存图片路径
  257. IF ll_ifpic = 1 THEN //如果含有图片信息,则查询本类型单据需要带出哪类附件
  258. SELECT classid
  259. INTO :ll_classid
  260. FROM u_billpic_fileclass
  261. Where (billtype = 406);
  262. IF sqlca.SQLCode <> 0 THEN
  263. ll_classid = 0
  264. END IF
  265. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  266. FOR ll_i = 1 TO dw_child.RowCount()
  267. ll_mtrlid = dw_child.Object.mtrlid[ll_i]
  268. //取该附件类型中的第一个附件.
  269. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  270. FROM u_file
  271. WHERE relid = :ll_mtrlid
  272. AND classid = :ll_classid
  273. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  274. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  275. USING sys_fileDB_sqlca;
  276. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  277. ll_fileid = 0
  278. END IF
  279. IF ll_fileid > 0 THEN
  280. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  281. IF Trim(Pathname) <> '' THEN
  282. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  283. RETURN 0
  284. END IF
  285. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  286. RETURN 0
  287. ELSE
  288. s_pic.path[ll_i] = Pathname
  289. //记录临时文件位置,本窗口退出后删除
  290. wf_addlog_tempfilepathname(Pathname)
  291. END IF
  292. ELSE
  293. s_pic.path[ll_i] = ''
  294. END IF
  295. ELSE
  296. s_pic.path[ll_i] = ''
  297. END IF
  298. NEXT
  299. END IF
  300. //
  301. END IF
  302. ////可选设置///
  303. arg_obj_st.uo_const.create_new_pwd( ) //创建随机密码
  304. if sys_option_xls_ifuse_passwd = 1 then arg_obj_st.uo_const.pwd = trim(sys_option_xls_user_passwd) //默认加密密码 默认为随即密码
  305. boolean xls_locked
  306. xls_locked = not (sys_option_xls_lock = 1)
  307. /// Excel 的可选设置
  308. if arg_obj_st.of_setoption(arg_ationid, xls_locked,true,arg_msg) <> 1 then
  309. return 0
  310. end if
  311. for i = 1 to arg_str_billlist.count
  312. ////可选操作///
  313. arg_str_billlist.bill[i].ds_data = create datastore //
  314. arg_str_billlist.bill[i].ds_data.dataobject = arg_str_billlist.bill[i].datawindow //
  315. arg_str_billlist.bill[i].ds_data.settransobject(sqlca)
  316. //修改点:注意retrieve 参数与上文对应
  317. arg_str_billlist.bill[i].ds_data.retrieve(ll_scid,ll_id)
  318. next
  319. return 1
  320. end function
  321. public function integer wf_print_retrievedata (ref s_print_pic_list arg_s_pic, ref string arg_msg);Long LS_ROW,ll_id,i,ll_scid
  322. LS_ROW = dw_pageretr.GetRow()
  323. IF LS_ROW <= 0 THEN
  324. arg_msg = '没有目标单据!'
  325. RETURN 0
  326. END IF
  327. //修改点:获取 指定retriev参数
  328. ll_id = dw_pageretr.Object.#1[LS_ROW]
  329. ll_scid = 0
  330. Long ll_i,ll_j
  331. Long ll_mtrlid
  332. Long ll_fileid
  333. Blob ls_filedata
  334. SetNull(ls_filedata)
  335. String Pathname,ls_filename,ls_filetype
  336. String errmsg
  337. uo_fj_mng_billtype ls_uo_fjbt
  338. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  339. Long ll_classid
  340. SELECT classid
  341. INTO :ll_classid
  342. FROM u_billpic_fileclass
  343. Where (billtype = 102);
  344. IF sqlca.SQLCode <> 0 THEN
  345. ll_classid = 0
  346. END IF
  347. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  348. FOR ll_i = 1 TO dw_child.RowCount()
  349. ll_mtrlid = dw_child.Object.mtrlid[ll_i]
  350. arg_s_pic.mtrlid[ll_i] = ll_mtrlid
  351. //取该附件类型中的第一个附件.
  352. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  353. FROM u_file
  354. WHERE relid = :ll_mtrlid
  355. AND classid = :ll_classid
  356. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  357. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  358. USING sys_fileDB_sqlca;
  359. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  360. ll_fileid = 0
  361. END IF
  362. IF ll_fileid > 0 THEN
  363. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  364. IF Trim(Pathname) <> '' THEN
  365. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  366. RETURN 0
  367. END IF
  368. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  369. RETURN 0
  370. ELSE
  371. arg_s_pic.path[ll_i] = Pathname
  372. //记录临时文件位置,本窗口退出后删除
  373. wf_addlog_tempfilepathname(Pathname)
  374. END IF
  375. ELSE
  376. arg_s_pic.path[ll_i] = ''
  377. END IF
  378. ELSE
  379. arg_s_pic.path[ll_i] = ''
  380. END IF
  381. NEXT
  382. END IF
  383. RETURN 1
  384. end function
  385. on w_oppose_spt.create
  386. int iCurrent
  387. call super::create
  388. this.ddlb_status=create ddlb_status
  389. this.st_2=create st_2
  390. iCurrent=UpperBound(this.Control)
  391. this.Control[iCurrent+1]=this.ddlb_status
  392. this.Control[iCurrent+2]=this.st_2
  393. end on
  394. on w_oppose_spt.destroy
  395. call super::destroy
  396. destroy(this.ddlb_status)
  397. destroy(this.st_2)
  398. end on
  399. event retrieve_pageretr;
  400. Boolean cb_nextpage_enabled,cb_retrieveall_enabled
  401. Boolean cb_func_enabled,cb_retrieve_enabled
  402. cb_nextpage_enabled = cb_nextpage.Enabled
  403. cb_retrieveall_enabled = cb_retrieveall.Enabled
  404. cb_func_enabled = cb_func.Enabled
  405. cb_nextpage.Enabled = FALSE
  406. cb_retrieveall.Enabled = FALSE
  407. cb_func.Enabled = FALSE
  408. dw_uc.Retrieve() //dw_uc的dw改左select top 0 并肯不带参数
  409. dw_pageretr.retrieve(cur_flag,sys_user_spttype)
  410. IF dw_pageretr.RowCount() > 0 THEN
  411. dw_pageretr.SetRow(1)
  412. dw_pageretr.triggerevent(rowfocuschanged!)
  413. end if
  414. this.triggerevent('retrieve_childdw')
  415. this.triggerevent("retrieve_dw1")
  416. cb_nextpage.Enabled = cb_nextpage_enabled
  417. cb_retrieveall.Enabled = cb_retrieveall_enabled
  418. cb_func.Enabled = cb_func_enabled
  419. end event
  420. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  421. if trim(sle_usual_query.text)<>'' then
  422. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  423. obj_expr=obj_expr+'( billcode LIKE "%'+trim(sle_usual_query.text)+'%" )'
  424. ELSE
  425. obj_expr=obj_expr+'( billcode LIKE "'+trim(sle_usual_query.text)+'" )'
  426. END IF
  427. end if
  428. dw_pageretr.setfilter(obj_expr)
  429. dw_pageretr.SetRedraw(False)
  430. dw_pageretr.filter()
  431. if dw_pageretr.rowcount()>=1 then
  432. dw_pageretr.selectrow(0,false)
  433. dw_pageretr.selectrow(1,true)
  434. dw_pageretr.SetRow(1)
  435. dw_pageretr.triggerevent(rowfocuschanged!)
  436. end if
  437. dw_pageretr.SetRedraw(TRUE)
  438. end event
  439. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  440. ls_newselect=lower(ori_oldselect)
  441. if trim(sle_usual_query.text)<>'' then
  442. if pos(trim(sle_usual_query.text),'%')=0 then
  443. ls_querystrpart="(u_oppose.billcode like '%"+trim(sle_usual_query.text)+"%')"
  444. else
  445. ls_querystrpart="(u_oppose.billcode like '"+trim(sle_usual_query.text)+"')"
  446. end if
  447. if Pos(ls_newselect," where ") <> 0 then
  448. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  449. else
  450. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  451. end if
  452. end if
  453. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  454. this.triggerevent('retrieve_pageretr')
  455. end event
  456. event refresh_interface;call super::refresh_interface;ddlb_status.enabled=not dw_edit_mode
  457. end event
  458. event close;call super::close;destroy uo_ware
  459. wf_del_tempfilepathname()
  460. end event
  461. event ue_f8;call super::ue_f8;//用于选择明细内容,被F8[默认]\dw_child.doubleclicked调用
  462. IF NOT dw_edit_mode THEN RETURN
  463. Long child_row
  464. child_row = dw_child.GetRow()
  465. IF NOT IsValid(W_mtrldef_edit) THEN
  466. s_edit_index_tran s_ch_tran //传递参数使用
  467. s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行
  468. s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  469. s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  470. s_ch_tran.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  471. s_ch_tran.if_select_all = TRUE
  472. s_ch_tran.b_long = 2
  473. Long chc = 1,ls_j
  474. dw_child.AcceptText()
  475. IF dw_child.GetRow() > 0 THEN s_ch_tran.arg_string_code = Trim(dw_child.Object.u_mtrldef_mtrlcode[dw_child.GetRow()])
  476. OpenWithParm(W_mtrldef_edit,s_ch_tran)
  477. s_mtrldef_array S_INSCUST
  478. S_INSCUST = Message.PowerObjectParm
  479. FOR ls_j = 1 TO UpperBound(S_INSCUST.mtrlid)
  480. IF S_INSCUST.mtrlid[ls_j] > 0 THEN
  481. IF dw_child.GetRow() > 0 THEN
  482. IF dw_child.Object.u_opposemx_mtrl_mtrlid[child_row] <> 0 THEN
  483. child_row = dw_child.InsertRow (0)
  484. ELSE
  485. child_row = dw_child.GetRow()
  486. END IF
  487. ELSE
  488. child_row = dw_child.InsertRow (0)
  489. END IF
  490. dw_child.Object.u_mtrldef_mtrlcode[child_row] = S_INSCUST.mtrlcode[ls_j]
  491. dw_child.Object.u_opposemx_mtrl_mtrlid[child_row] = S_INSCUST.mtrlid[ls_j]
  492. dw_child.Object.u_mtrldef_mtrlname[child_row] = S_INSCUST.mtrlname[ls_j]
  493. dw_child.Object.u_mtrldef_mtrlmode[child_row] = S_INSCUST.mtrlmode[ls_j]
  494. dw_child.Object.u_mtrldef_statusflag[child_row] = S_INSCUST.statusflag[ls_j]
  495. dw_child.Object.u_mtrldef_woodcodeflag[child_row] = S_INSCUST.woodcodeflag[ls_j]
  496. dw_child.Object.u_mtrldef_pcodeflag[child_row] = S_INSCUST.pcodeflag[ls_j]
  497. END IF
  498. NEXT
  499. dw_child.SetFocus()
  500. this.triggerevent('ue_allowedit')
  501. END IF
  502. end event
  503. event retrieve_childdw;call super::retrieve_childdw;long row,uc_relid
  504. row=dw_pageretr.getrow()
  505. if row>0 then
  506. uc_relid=dw_pageretr.object.billid[row]
  507. dw_child.SetRedraw (false)
  508. dw_child.retrieve(uc_relid)
  509. dw_child.SetRedraw (true)
  510. else
  511. dw_child.reset()
  512. end if
  513. end event
  514. event open;call super::open;uc_column_int = 6 //uc dw前7列可以编辑
  515. child_column_int = 8 //子dw前8列可以编辑
  516. uo_ware = CREATE uo_oppose
  517. uo_ware.commit_transaction = sqlca
  518. s_hide_col s_col_mtrlsectype
  519. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  520. f_hide_col(1308,dw_child,s_col_mtrlsectype)
  521. s_hide_col s_col_zxmtrlmode
  522. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  523. f_hide_col(1309,dw_child,s_col_zxmtrlmode)
  524. end event
  525. event ue_viewprint;call super::ue_viewprint;IF NOT f_power_ind(109) THEN
  526. MessageBox('提示','你没有使用权限!', Information!, OK! )
  527. RETURN
  528. END IF
  529. LONG LS_ROW
  530. LS_ROW=dw_pageretr.getrow()
  531. IF LS_ROW<=0 THEN
  532. MESSAGEBOX('提示','没有打印目标单据!', Information!, OK! )
  533. RETURN
  534. END IF
  535. S_print_MSG LS_PRMSG
  536. IF ls_newname <> '' THEN
  537. IF li_auditprint = 1 THEN
  538. IF dw_pageretr.Object.flag[dw_pageretr.GetRow()] = 0 THEN
  539. MessageBox('提示','目标单据还未审核,不能打印!', Information!, OK! )
  540. RETURN
  541. END IF
  542. END IF
  543. ls_prmsg.obj_dwNAME = ls_newname
  544. ELSE
  545. ls_prmsg.obj_dwNAME = 'dw_rp_oppsoe_spt_edit'
  546. END IF
  547. LS_PRMSG.TAG_TEXT='供应商投诉单'
  548. LS_PRMSG.FILTER_STRING = ''
  549. LS_PRMSG.retr_pram_falg=2
  550. LS_PRMSG.PAGECH_FLAG=0
  551. LS_PRMSG.retr_pramnmb=dw_pageretr.object.billid[LS_ROW]
  552. IF ifpic = 1 THEN
  553. String ls_msg
  554. IF wf_print_retrievedata(LS_PRMSG.s_pic,ls_msg) = 0 THEN
  555. MessageBox('提示','下载图片失败!',information!,OK!)
  556. RETURN
  557. END IF
  558. END IF
  559. Openwithparm(w_publ_preview,LS_PRMSG)
  560. IF ifpic = 1 THEN
  561. Long li
  562. FOR li = 1 TO UpperBound(LS_PRMSG.s_pic.path)
  563. IF Len(Trim(LS_PRMSG.s_pic.path[li])) > 0 THEN
  564. FileDelete(LS_PRMSG.s_pic.path[li])
  565. END IF
  566. NEXT
  567. END IF
  568. //**更新打印次料
  569. String arg_msg
  570. printnum = Message.DoubleParm
  571. f_update_printnum('u_oppose',printnum,0,dw_pageretr.Object.billid[LS_ROW],'','',arg_msg,TRUE)
  572. end event
  573. event ue_print;call super::ue_print;//--直接打印
  574. IF NOT f_power_ind(109) THEN
  575. MessageBox('提示','你没有使用权限!', Information!, OK! )
  576. RETURN
  577. END IF
  578. uo_print_preview uo_print
  579. S_print_MSG LS_PRMSG
  580. if dw_pageretr.rowcount()=0 then
  581. Messagebox('提示','没有可打印的单据!', Information!, OK! )
  582. return
  583. end if
  584. IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  585. IF ls_newname <> '' THEN
  586. IF li_auditprint = 1 THEN
  587. IF dw_pageretr.Object.flag[dw_pageretr.GetRow()] = 0 THEN
  588. MessageBox('提示','目标单据还未审核,不能打印!', Information!, OK! )
  589. RETURN
  590. END IF
  591. END IF
  592. ls_prmsg.obj_dwNAME = ls_newname
  593. ELSE
  594. ls_prmsg.obj_dwNAME = 'dw_rp_oppsoe_spt_edit'
  595. END IF
  596. LS_PRMSG.retr_pram_falg=2
  597. LS_PRMSG.TAG_TEXT='供应商投诉单'
  598. LS_PRMSG.FILTER_STRING = ''
  599. LS_PRMSG.PAGECH_FLAG=0
  600. LS_PRMSG.retr_pramnmb=dw_pageretr.object.billid[dw_pageretr.getrow()]
  601. IF ifpic = 1 THEN
  602. String ls_msg
  603. IF wf_print_retrievedata(LS_PRMSG.s_pic,ls_msg) = 0 THEN
  604. MessageBox('提示','下载图片失败!',information!,OK!)
  605. RETURN
  606. END IF
  607. END IF
  608. uo_print.FACT_PRINT_MSG=LS_PRMSG
  609. string arg_msg
  610. if uo_print.uof_print_begin(arg_msg)=0 then
  611. messagebox("提示",arg_msg, Information!, OK! )
  612. return
  613. end if
  614. uo_print.ds_print()
  615. IF ifpic = 1 THEN
  616. Long li
  617. FOR li = 1 TO UpperBound(LS_PRMSG.s_pic.path)
  618. IF Len(Trim(LS_PRMSG.s_pic.path[li])) > 0 THEN
  619. FileDelete(LS_PRMSG.s_pic.path[li])
  620. END IF
  621. NEXT
  622. END IF
  623. //**更新打印次料
  624. f_update_printnum('',1,0,dw_pageretr.object.billid[dw_pageretr.getrow()],'','',arg_msg,true)
  625. end event
  626. event ue_f9;call super::ue_f9;//用于选择明细内容,被F9[默认]
  627. if not dw_edit_mode then return
  628. long uc_row
  629. uc_row=dw_pageretr.getrow()
  630. if uc_row=0 then
  631. messagebox('提示','请选定进仓单!', Information!, OK! )
  632. return
  633. end if
  634. dw_uc.accepttext()
  635. if not isvalid(W_spt_edit) then
  636. s_edit_index_tran s_ch_tran //传递参数使用
  637. s_ch_tran.if_retrieve_all=false //是否一次RETRIEVE所有行
  638. s_ch_tran.work_mode=1 //0-单纯编辑模式 1-选择\编辑模式
  639. s_ch_tran.arg_pkid=0 //目标定位PKID (备用)
  640. //查询列(物料编码)部分内容,用于初步筛选
  641. s_ch_tran.arg_string_code=upper(trim(dw_uc.object.u_spt_sptcode[dw_uc.getrow()]))
  642. OPENwithparm(W_spt_edit,s_ch_tran) //调用
  643. S_spt S_INSCUST
  644. S_INSCUST=Message.PowerObjectParm //接受返回结构
  645. IF S_INSCUST.sptid>0 THEN //正常返回值则可以取以下值
  646. dw_uc.setredraw(false)
  647. dw_uc.object.u_oppose_relid[uc_row]=S_INSCUST.sptid
  648. dw_uc.object.u_oppose_opposedept[uc_row]=S_INSCUST.name
  649. dw_uc.object.u_spt_sptcode[uc_row]=S_INSCUST.sptcode
  650. dw_uc.setredraw(true)
  651. dw_uc.setcolumn("threason")
  652. END IF
  653. end if
  654. end event
  655. event ue_addzy;call super::ue_addzy;IF dw_edit_mode THEN
  656. MessageBox('提示',"编辑状态下不可以使用!", Information!, OK! )
  657. return
  658. END IF
  659. IF NOT f_power_ind(784) THEN
  660. MessageBox('提示','你没有使用权限!', Information!, OK! )
  661. RETURN
  662. END IF
  663. string arg_msg='',LS_STR
  664. long uc_row
  665. s_inputbox S_SREU
  666. uc_row=dw_pageretr.getrow()
  667. if uc_row<=0 then
  668. messagebox('提示','请选定当前目标订单!', Information!, OK! )
  669. return
  670. end if
  671. S_SREU.TITLE='请输入要补充到备注的内容'
  672. S_SREU.OLD_TEXT=''
  673. openwithparm(w_inputbox,S_SREU)
  674. LS_STR=Message.StringParm
  675. if trim(LS_STR)='' or isnull(LS_STR) then return
  676. if uo_ware.add_improveidea(dw_pageretr.object.billid[uc_row],LS_STR,arg_msg,true)=0 then
  677. messagebox('Error!',arg_msg)
  678. return
  679. else
  680. messagebox('提示','添加操作成功!', Information!, OK! )
  681. wf_refresh_curuc(dw_pageretr.object.billid[uc_row])
  682. end if
  683. end event
  684. event ue_rpt_print;call super::ue_rpt_print;IF NOT f_power_ind(109) THEN
  685. MessageBox('提示','你没有使用权限!', Information!, OK! )
  686. RETURN
  687. END IF
  688. Long row,uc_relid,ll_scid
  689. row = dw_pageretr.GetRow()
  690. IF row = 0 THEN RETURN
  691. uo_rpt_print_preview uo_print
  692. S_rpt_print_MSG LS_PRMSG
  693. IF dw_pageretr.RowCount() = 0 THEN
  694. MessageBox('提示','没有可打印的单据!', Information!, OK! )
  695. RETURN
  696. END IF
  697. IF ls_rpname = '' THEN RETURN
  698. IF li_auditprint = 1 THEN
  699. IF dw_pageretr.Object.flag[row] = 0 THEN
  700. MessageBox('提示','目标单据还未审核,不能打印!', Information!, OK! )
  701. RETURN
  702. END IF
  703. END IF
  704. IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  705. LS_PRMSG.retr_pram_falg = 2
  706. LS_PRMSG.TAG_TEXT = '供应商投诉单'
  707. LS_PRMSG.rpname = ls_rpname
  708. LS_PRMSG.FILTER_STRING = ''
  709. LS_PRMSG.PAGECH_FLAG = 0
  710. LS_PRMSG.rpid = ls_msgprintid_rpt
  711. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.billid[row]
  712. LS_PRMSG.rowcnt = dw_child.RowCount()
  713. uo_print.FACT_PRINT_MSG = LS_PRMSG
  714. String arg_msg
  715. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  716. MessageBox("系统提示",arg_msg, Information!, OK! )
  717. RETURN
  718. END IF
  719. uo_print.ds_print()
  720. //**更新打印次料
  721. f_update_printnum('',1,0,dw_pageretr.object.billid[dw_pageretr.getrow()],'','',arg_msg,true)
  722. end event
  723. event ue_rpt_viewprint;call super::ue_rpt_viewprint;IF NOT f_power_ind(109) THEN
  724. MessageBox('提示','你没有使用权限!', Information!, OK! )
  725. RETURN
  726. END IF
  727. Long row,uc_relid,ll_scid
  728. row = dw_pageretr.GetRow()
  729. IF row = 0 THEN RETURN
  730. IF ls_rpname = '' THEN RETURN
  731. IF li_auditprint = 1 THEN
  732. IF dw_pageretr.Object.flag[row] = 0 THEN
  733. MessageBox('提示','目标单据还未审核,不能打印!', Information!, OK! )
  734. RETURN
  735. END IF
  736. END IF
  737. s_rpt_print_msg s_print
  738. s_print.retr_pram_falg = 2
  739. s_print.rpid = ls_msgprintid_rpt
  740. s_print.retr_flag = TRUE
  741. s_print.tag_text = THIS.Title
  742. s_print.rpname = ls_rpname
  743. s_print.retr_pramnmb = dw_pageretr.Object.billid[row]
  744. s_print.rowcnt = dw_child.RowCount()
  745. OpenWithParm(w_rpt_preview,s_print)
  746. //**更新打印次料
  747. string arg_msg
  748. f_update_printnum('',1,0,dw_pageretr.object.billid[dw_pageretr.getrow()],'','',arg_msg,true)
  749. end event
  750. type cb_func from w_publ_1ton_share_detail`cb_func within w_oppose_spt
  751. end type
  752. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_oppose_spt
  753. end type
  754. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_oppose_spt
  755. integer x = 206
  756. integer y = 188
  757. integer width = 549
  758. end type
  759. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_oppose_spt
  760. integer x = 3040
  761. end type
  762. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_oppose_spt
  763. integer x = 2711
  764. integer y = 28
  765. integer width = 320
  766. end type
  767. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_oppose_spt
  768. integer x = 2007
  769. integer width = 1531
  770. integer height = 880
  771. string dataobject = "dw_oppsoe_spt_index"
  772. end type
  773. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_check_billfj()
  774. //IF dw_edit_mode THEN RETURN
  775. //IF currentrow <=0 THEN RETURN
  776. //this.selectrow(0,false)
  777. //this.selectrow(currentrow,true)
  778. //DW_UC.SETROW(currentrow)
  779. //DW_UC.ScrollToRow (currentrow)
  780. if currentrow<=0 then dw_child.reset()
  781. IF NOT dw_edit_mode THEN
  782. parent.triggerevent('retrieve_dw1')
  783. END IF
  784. end event
  785. type st_1 from w_publ_1ton_share_detail`st_1 within w_oppose_spt
  786. integer x = 14
  787. integer y = 208
  788. end type
  789. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_oppose_spt
  790. integer x = 3191
  791. end type
  792. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_oppose_spt
  793. integer width = 2002
  794. integer height = 872
  795. string dataobject = "dw_oppsoe_spt_edit"
  796. end type
  797. event dw_uc::dwnkey;parent.triggerevent('user_key')
  798. if key = KeyDownArrow! then return 1
  799. if dw_edit_mode then
  800. if dw_uc.GetColumnName ( )='improveidea' and key = KeyEnter! then
  801. dw_child.setfocus()
  802. dw_child.scrolltorow(dw_child.rowcount())
  803. dw_child.SetColumn ('u_mtrldef_mtrlcode')
  804. return 1
  805. elseif dw_uc.GetColumnName ( )='u_spt_sptcode' and key = KeyEnter! then
  806. string ls_code,ls_name
  807. long ls_sptid
  808. dw_uc.accepttext()
  809. ls_code=upper(trim(dw_uc.object.u_spt_sptcode[dw_uc.getrow()]))
  810. SELECT u_spt.sptid,
  811. u_spt.name
  812. INTO :ls_sptid,:ls_name
  813. FROM u_spt
  814. WHERE (sptcode=:ls_code);
  815. if sqlca.sqlcode<>0 then
  816. parent.triggerevent('ue_f9')
  817. return 1
  818. else
  819. dw_uc.setredraw(false)
  820. dw_uc.object.u_oppose_relid[dw_uc.getrow()]=ls_sptid
  821. dw_uc.object.u_oppose_opposedept[dw_uc.getrow()]=ls_name
  822. dw_uc.setredraw(true)
  823. dw_uc.setcolumn("threason")
  824. return 1
  825. end if
  826. else
  827. if key = KeyEnter! Then //
  828. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  829. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  830. Return 1
  831. end If
  832. end if
  833. end if
  834. end event
  835. event dw_uc::clicked;call super::clicked;if not dw_edit_mode then return
  836. if row <= 0 then return
  837. if dwo.name='p_p' then
  838. parent.TRIGGEREVENT('ue_f9')
  839. end if
  840. end event
  841. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_oppose_spt
  842. end type
  843. type dw_child from w_publ_1ton_share_detail`dw_child within w_oppose_spt
  844. integer y = 1176
  845. integer height = 780
  846. string dataobject = "dw_oppsoemx_spt_index"
  847. boolean resizable = false
  848. boolean border = false
  849. end type
  850. event dw_child::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key')
  851. String ls_mtrlcode,ls_mtrlname,ls_unit,ls_mtrlmode
  852. Long ls_mtrlid
  853. Int li_statusflag,li_woodcodeflag,li_pcodeflag
  854. Long child_row
  855. Long ls_null
  856. SetNull(ls_null)
  857. IF dw_edit_mode THEN
  858. IF KeyDown(Keydownarrow!) THEN
  859. Long li_row
  860. IF dw_child.GetRow() = dw_child.RowCount() THEN
  861. PARENT.TriggerEvent("insert_childrow")
  862. END IF
  863. ELSE
  864. If (KeyDown(KeyEnter!) OR KeyDown(KeyTab!)) AND NOT KeyDown(KeyControl!) AND NOT KeyDown(KeyShift!) THEN
  865. IF dw_child.GetColumnName() = 'u_mtrldef_mtrlcode' THEN
  866. dw_child.AcceptText()
  867. child_row = dw_child.GetRow()
  868. ls_mtrlcode = dw_child.Object.u_mtrldef_mtrlcode[child_row]
  869. SELECT u_mtrldef.mtrlid,
  870. u_mtrldef.mtrlname,
  871. u_mtrldef.unit,
  872. u_mtrldef.mtrlmode,
  873. u_mtrldef.statusflag,
  874. u_mtrldef.woodcodeflag,
  875. u_mtrldef.pcodeflag
  876. INTO :ls_mtrlid,:ls_mtrlname,:ls_unit,
  877. :ls_mtrlmode,
  878. :li_statusflag,:li_woodcodeflag,:li_pcodeflag
  879. FROM u_mtrldef
  880. Where ( u_mtrldef.mtrlcode = :ls_mtrlcode);
  881. IF sqlca.SQLCode = 100 THEN
  882. PARENT.TriggerEvent('ue_f8')
  883. RETURN
  884. END IF
  885. dw_child.Object.u_opposemx_mtrl_mtrlid[child_row] = ls_mtrlid
  886. dw_child.Object.u_mtrldef_mtrlname[child_row] = ls_mtrlname
  887. dw_child.Object.u_mtrldef_mtrlmode[child_row] = ls_mtrlmode
  888. dw_child.Object.u_mtrldef_unit[child_row] = ls_unit
  889. dw_child.Object.u_mtrldef_statusflag[child_row] = li_statusflag
  890. dw_child.Object.u_mtrldef_woodcodeflag[child_row] = li_woodcodeflag
  891. dw_child.Object.u_mtrldef_pcodeflag[child_row] = li_pcodeflag
  892. PARENT.TriggerEvent('ue_allowedit')
  893. IF Key = KeyEnter! THEN
  894. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  895. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  896. RETURN 1
  897. END IF
  898. ELSEIF dw_child.GetColumnName( ) = 'u_opposemx_mtrl_mxdscrp' AND dw_child.GetRow() = dw_child.RowCount() THEN
  899. PARENT.TriggerEvent("insert_childrow")
  900. RETURN 1
  901. ELSE
  902. IF Key = KeyEnter! THEN
  903. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  904. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  905. RETURN 1
  906. END IF
  907. END IF
  908. END IF
  909. END IF
  910. END IF
  911. //u_mtrldef_mtrlcode
  912. //u_mtrldef_unit
  913. //u_inwaremx_mtrlid
  914. //u_inwaremx_planprice
  915. //u_inwaremx_price
  916. //u_mtrldef_mtrlname
  917. end event
  918. event dw_child::doubleclicked;if dw_edit_mode and dw_child.getcolumnname()='u_mtrldef_mtrlcode' then
  919. parent.triggerevent('ue_f8')
  920. end if
  921. end event
  922. event dw_child::constructor;call super::constructor;f_title_change(this)
  923. end event
  924. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_oppose_spt
  925. end type
  926. type cb_print from w_publ_1ton_share_detail`cb_print within w_oppose_spt
  927. end type
  928. type cb_add from w_publ_1ton_share_detail`cb_add within w_oppose_spt
  929. end type
  930. event cb_add::clicked;IF NOT f_power_ind(110) THEN
  931. MessageBox('提示','你没有使用权限!', Information!, OK! )
  932. RETURN
  933. END IF
  934. String arg_msg = ''
  935. Long uc_row,i
  936. IF dw_edit_mode THEN
  937. dw_uc.AcceptText()
  938. dw_child.AcceptText()
  939. uc_row = dw_uc.GetRow()
  940. IF uc_row <= 0 THEN
  941. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  942. RETURN
  943. END IF
  944. IF NOT dw_uc.Object.billdate[uc_row] > DateTime(2000-01-01,Now()) THEN
  945. MessageBox('提示','不合理发生时间!', Information!, OK! )
  946. dw_uc.SetFocus()
  947. dw_uc.SetColumn("billdate")
  948. RETURN
  949. END IF
  950. IF dw_uc.Object.u_oppose_itemid[uc_row] = 0 THEN
  951. MessageBox('提示','请选择投诉项目!', Information!, OK! )
  952. dw_uc.SetFocus()
  953. dw_uc.SetColumn("u_oppose_itemid")
  954. RETURN
  955. END IF
  956. IF dw_uc.Object.u_oppose_relid[uc_row] = 0 THEN
  957. MessageBox('提示','请选择供应商!', Information!, OK! )
  958. dw_uc.SetFocus()
  959. dw_uc.SetColumn("u_spt_sptcode")
  960. RETURN
  961. END IF
  962. uo_ware.billdate = dw_uc.Object.billdate[uc_row]
  963. uo_ware.opposedept = dw_uc.Object.u_oppose_opposedept[uc_row] // 经手人
  964. uo_ware.relid = dw_uc.Object.u_oppose_relid[uc_row]
  965. uo_ware.improveidea = dw_uc.Object.improveidea[uc_row]
  966. uo_ware.threason = dw_uc.Object.threason[uc_row]
  967. uo_ware.itemid = dw_uc.Object.u_oppose_itemid[uc_row]
  968. FOR i = 1 TO dw_child.RowCount()
  969. IF dw_child.Object.u_opposemx_mtrl_mtrlid[i] > 0 THEN
  970. IF uo_ware.acceptmx(dw_child.Object.u_opposemx_mtrl_mtrlid[i],&
  971. dw_child.Object.u_opposemx_mtrl_status[i],&
  972. dw_child.Object.u_opposemx_mtrl_qty[i],&
  973. dw_child.Object.u_opposemx_mtrl_mxdscrp[i],0,0,0,0,&
  974. arg_msg ) = 0 THEN
  975. MessageBox('错误',arg_msg, StopSign!, OK! )
  976. RETURN
  977. END IF
  978. END IF
  979. NEXT
  980. IF uo_ware.Save(TRUE,arg_msg) = 0 THEN
  981. MessageBox('错误',arg_msg, StopSign!, OK! )
  982. RETURN
  983. END IF
  984. // MessageBox('提示','保存操作成功!')
  985. long ll_row
  986. ll_row = dw_pageretr.getrow()
  987. dw_pageretr.SelectRow(0,FALSE)
  988. dw_pageretr.SelectRow(ll_row,TRUE)
  989. wf_refresh_curuc(uo_ware.billid)
  990. ELSE
  991. IF uo_ware.newbegin(1,arg_msg) = 0 THEN
  992. MessageBox('错误',arg_msg, StopSign!, OK! )
  993. RETURN
  994. END IF
  995. END IF
  996. CALL SUPER::Clicked
  997. //read ini
  998. IF dw_edit_mode THEN
  999. PARENT.TriggerEvent("insert_childrow")
  1000. dw_uc.SetRedraw(FALSE)
  1001. dw_uc.SetColumn("billdate")
  1002. dw_uc.SetRedraw(TRUE)
  1003. ELSE
  1004. parent.triggerevent("retrieve_childdw")
  1005. END IF
  1006. //
  1007. end event
  1008. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_oppose_spt
  1009. end type
  1010. event cb_edit::clicked;if not f_power_ind(110) then
  1011. messagebox('提示','你没有使用权限!', Information!, OK! )
  1012. return
  1013. end if
  1014. string arg_msg=''
  1015. long uc_row
  1016. uc_row=dw_pageretr.getrow()
  1017. if uc_row<=0 then
  1018. messagebox('提示','请选定当前目标单据!', Information!, OK! )
  1019. return
  1020. end if
  1021. if not dw_edit_mode then
  1022. if uo_ware.updatebegin(dw_pageretr.object.billid[uc_row],arg_msg)=0 then
  1023. messagebox('错误',arg_msg, StopSign!, OK! )
  1024. return
  1025. end if
  1026. parent.triggerevent('ue_allowedit')
  1027. end if
  1028. call super::clicked
  1029. end event
  1030. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_oppose_spt
  1031. end type
  1032. event cb_delet::clicked;call super::clicked;
  1033. IF NOT f_power_ind(615) THEN
  1034. MessageBox('提示','你没有使用权限!', Information!, OK! )
  1035. RETURN
  1036. END IF
  1037. IF dw_edit_mode THEN RETURN
  1038. String arg_msg = ''
  1039. Long uc_row
  1040. uc_row = dw_pageretr.GetRow()
  1041. IF uc_row <= 0 THEN
  1042. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  1043. RETURN
  1044. END IF
  1045. IF MessageBox ("询问","是否确定要删除当前单据?",question!,yesno! ) = 2 THEN RETURN
  1046. IF uo_ware.del(dw_pageretr.Object.billid[uc_row],arg_msg,TRUE) = 0 THEN
  1047. MessageBox('提示',arg_msg, Information!, OK! )
  1048. ELSE
  1049. //日志
  1050. Long ls_id
  1051. String ls_code
  1052. ls_id = dw_pageretr.Object.billid[uc_row]
  1053. ls_code = dw_pageretr.Object.billcode[uc_row]
  1054. f_setsysoplog('供应商投诉单','删除,id:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE)
  1055. //--
  1056. MessageBox('提示','删除单据'+String(dw_pageretr.Object.billcode[uc_row])+'成功!', Information!, OK! )
  1057. dw_pageretr.DeleteRow(uc_row)
  1058. dw_pageretr.PostEvent(RowFocusChanged!)
  1059. END IF
  1060. end event
  1061. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_oppose_spt
  1062. end type
  1063. event cb_addzy::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1064. string menustr
  1065. menustr="Text=增加备注~tEvent=ue_addzy"
  1066. menustr = menustr + "|" + "Text=-"
  1067. menustr = menustr + "|" + "Text=查看附件~tEvent=ue_fj_view"
  1068. menustr = menustr + "|" + "Text=添加附件~tEvent=ue_fj_edit"
  1069. if len(trim(menustr))<>0 then
  1070. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1071. dmPopupMenu.mf_BuildMenu(This, menustr)
  1072. dmPopupMenu.mf_PopMenu()
  1073. Destroy dmPopupMenu
  1074. end if
  1075. end event
  1076. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_oppose_spt
  1077. end type
  1078. event cb_auditing::clicked;call super::clicked;IF NOT f_power_ind(111) THEN
  1079. MessageBox('提示','你没有使用权限!', Information!, OK! )
  1080. RETURN
  1081. END IF
  1082. IF dw_edit_mode THEN RETURN
  1083. String arg_msg = ''
  1084. Long pagerert_row
  1085. pagerert_row = dw_pageretr.GetRow()
  1086. IF pagerert_row <= 0 THEN
  1087. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  1088. RETURN
  1089. END IF
  1090. IF MessageBox ("询问","是否确定要审核当前单据?",question!,yesno! ) = 2 THEN RETURN
  1091. IF uo_ware.auditing(dw_pageretr.Object.billid[pagerert_row],TRUE,arg_msg) = 0 THEN
  1092. MessageBox('错误',arg_msg, StopSign!, OK! )
  1093. ELSE
  1094. MessageBox('提示','审核成功!', Information!, OK! )
  1095. wf_refresh_curuc(dw_pageretr.Object.billid[pagerert_row])
  1096. END IF
  1097. end event
  1098. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_oppose_spt
  1099. end type
  1100. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_oppose_spt
  1101. end type
  1102. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_oppose_spt
  1103. end type
  1104. type cb_help from w_publ_1ton_share_detail`cb_help within w_oppose_spt
  1105. end type
  1106. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_oppose_spt
  1107. end type
  1108. event cb_auditing_cancel::clicked;call super::clicked;IF NOT f_power_ind(885) THEN
  1109. MessageBox('提示','你没有使用权限!', Information!, OK! )
  1110. RETURN
  1111. END IF
  1112. IF dw_edit_mode THEN RETURN
  1113. String arg_msg = ''
  1114. Long pagerert_row
  1115. pagerert_row = dw_pageretr.GetRow()
  1116. IF pagerert_row <= 0 THEN
  1117. MessageBox('提示','请选定当前目标单据!', Information!, OK! )
  1118. RETURN
  1119. END IF
  1120. IF MessageBox ("询问","是否确定要撤消审核当前单据?",question!,yesno! ) = 2 THEN RETURN
  1121. IF uo_ware.c_auditing(dw_pageretr.Object.billid[pagerert_row],TRUE,arg_msg) = 0 THEN
  1122. MessageBox('错误',arg_msg, StopSign!, OK! )
  1123. ELSE
  1124. //日志
  1125. Long ls_id
  1126. String ls_code
  1127. ls_id = dw_pageretr.Object.billid[pagerert_row]
  1128. ls_code = dw_pageretr.Object.billcode[pagerert_row]
  1129. f_setsysoplog('供应商投诉单','撤审,id:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE)
  1130. //--
  1131. MessageBox('提示','撤消审核成功!', Information!, OK! )
  1132. wf_refresh_curuc(dw_pageretr.Object.billid[pagerert_row])
  1133. END IF
  1134. end event
  1135. type p_msg from w_publ_1ton_share_detail`p_msg within w_oppose_spt
  1136. end type
  1137. type p_help from w_publ_1ton_share_detail`p_help within w_oppose_spt
  1138. end type
  1139. type p_encl from w_publ_1ton_share_detail`p_encl within w_oppose_spt
  1140. end type
  1141. type p_other from w_publ_1ton_share_detail`p_other within w_oppose_spt
  1142. end type
  1143. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_oppose_spt
  1144. end type
  1145. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_oppose_spt
  1146. end type
  1147. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_oppose_spt
  1148. end type
  1149. type r_bar from w_publ_1ton_share_detail`r_bar within w_oppose_spt
  1150. end type
  1151. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_oppose_spt
  1152. end type
  1153. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_oppose_spt
  1154. end type
  1155. type ddlb_status from dropdownlistbox within w_oppose_spt
  1156. integer x = 960
  1157. integer y = 188
  1158. integer width = 549
  1159. integer height = 300
  1160. integer taborder = 30
  1161. boolean bringtotop = true
  1162. integer textsize = -9
  1163. integer weight = 400
  1164. fontcharset fontcharset = gb2312charset!
  1165. fontpitch fontpitch = variable!
  1166. string facename = "宋体"
  1167. long textcolor = 33554432
  1168. string text = "[全部]"
  1169. boolean sorted = false
  1170. string item[] = {"[全部]","待审核","已审核"}
  1171. borderstyle borderstyle = stylelowered!
  1172. end type
  1173. event selectionchanged;if index=1 then
  1174. cur_flag=-1
  1175. elseif index=2 then
  1176. cur_flag=0
  1177. elseif index=3 then
  1178. cur_flag=1
  1179. end if
  1180. parent.triggerevent('retrieve_pageretr')
  1181. end event
  1182. type st_2 from statictext within w_oppose_spt
  1183. integer x = 786
  1184. integer y = 208
  1185. integer width = 219
  1186. integer height = 48
  1187. integer textsize = -9
  1188. integer weight = 400
  1189. fontcharset fontcharset = gb2312charset!
  1190. fontpitch fontpitch = variable!
  1191. string facename = "宋体"
  1192. long textcolor = 33554432
  1193. long backcolor = 134217739
  1194. string text = "状 态"
  1195. boolean focusrectangle = false
  1196. end type