w_spt_price_change_fx.srw 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625
  1. $PBExportHeader$w_spt_price_change_fx.srw
  2. $PBExportComments$(采购)供应商询价单-协同系统
  3. forward
  4. global type w_spt_price_change_fx from w_publ_base_style
  5. end type
  6. type cb_retrieve from uo_imflatbutton within w_spt_price_change_fx
  7. end type
  8. type cb_new from uo_imflatbutton within w_spt_price_change_fx
  9. end type
  10. type cb_edit from uo_imflatbutton within w_spt_price_change_fx
  11. end type
  12. type cb_del from uo_imflatbutton within w_spt_price_change_fx
  13. end type
  14. type cb_audit from uo_imflatbutton within w_spt_price_change_fx
  15. end type
  16. type cb_caudit from uo_imflatbutton within w_spt_price_change_fx
  17. end type
  18. type em_pagesize from editmask within w_spt_price_change_fx
  19. end type
  20. type cb_toppage from uo_imflatbutton within w_spt_price_change_fx
  21. end type
  22. type cb_page_ch from uo_imflatbutton within w_spt_price_change_fx
  23. end type
  24. type st_4 from statictext within w_spt_price_change_fx
  25. end type
  26. type sle_likestr from u_sleedit within w_spt_price_change_fx
  27. end type
  28. type dw_sptprice_change from datawindow within w_spt_price_change_fx
  29. end type
  30. type st_2 from statictext within w_spt_price_change_fx
  31. end type
  32. type em_datea from editmask within w_spt_price_change_fx
  33. end type
  34. type st_3 from statictext within w_spt_price_change_fx
  35. end type
  36. type em_datez from editmask within w_spt_price_change_fx
  37. end type
  38. type dw_sptprice_change_list from u_dw_rbtnfilter within w_spt_price_change_fx
  39. end type
  40. type cb_mx from uo_imflatbutton within w_spt_price_change_fx
  41. end type
  42. type p_ljfieb from picture within w_spt_price_change_fx
  43. end type
  44. type dw_sptprice_changemx from u_dw_rbtnfilter within w_spt_price_change_fx
  45. end type
  46. end forward
  47. global type w_spt_price_change_fx from w_publ_base_style
  48. integer width = 4384
  49. integer height = 2236
  50. string title = "销售报价单"
  51. boolean maxbox = true
  52. boolean resizable = true
  53. long backcolor = 16777215
  54. string icon = "graphics\chain_link_128px.ico"
  55. event ue_addmx ( )
  56. event ue_delmx ( )
  57. event ue_page_next ( )
  58. event ue_page_before ( )
  59. event ue_page_end ( )
  60. event ue_send_ljfieb ( )
  61. cb_retrieve cb_retrieve
  62. cb_new cb_new
  63. cb_edit cb_edit
  64. cb_del cb_del
  65. cb_audit cb_audit
  66. cb_caudit cb_caudit
  67. em_pagesize em_pagesize
  68. cb_toppage cb_toppage
  69. cb_page_ch cb_page_ch
  70. st_4 st_4
  71. sle_likestr sle_likestr
  72. dw_sptprice_change dw_sptprice_change
  73. st_2 st_2
  74. em_datea em_datea
  75. st_3 st_3
  76. em_datez em_datez
  77. dw_sptprice_change_list dw_sptprice_change_list
  78. cb_mx cb_mx
  79. p_ljfieb p_ljfieb
  80. dw_sptprice_changemx dw_sptprice_changemx
  81. end type
  82. global w_spt_price_change_fx w_spt_price_change_fx
  83. type variables
  84. long ins_cur_pageNum = 1 // 用于记录当前页码
  85. long ins_totalPages = 1 // 用于记录总页数
  86. boolean ins_edit_mode = false // 编辑模式
  87. uo_fx_pz uo_pz // 协同配置UO
  88. end variables
  89. forward prototypes
  90. public subroutine wf_retrieve_list ()
  91. public function integer wf_retrieve_mx (readonly long arg_billid)
  92. public subroutine wf_face ()
  93. public subroutine wf_taborder ()
  94. public function integer wf_chk_before_save (ref string arg_msg)
  95. public function integer wf_save ()
  96. public subroutine wf_new ()
  97. public subroutine wf_retrieve_pz ()
  98. end prototypes
  99. event ue_addmx();//
  100. if (not ins_edit_mode) then return
  101. long row
  102. row = dw_sptprice_change.GetRow()
  103. if (row <= 0) then return
  104. long sptcomid
  105. sptcomid = dw_sptprice_change.Object.sptcomid[row]
  106. if (sptcomid <= 0) then
  107. MessageBox('提示', '请先选择供应商')
  108. return
  109. end if
  110. s_fx_mtrldef s_tran
  111. OpenWithParm(w_mtrl_ch_by_sptcomid_fx, sptcomid)
  112. s_tran = Message.PowerObjectParm
  113. if not IsValid(s_tran) then return
  114. if IsNull(s_tran) then return
  115. if (not s_tran.ifselect) then return
  116. long i
  117. for i = 1 to UpperBound(s_tran.fxmtrlid)
  118. row = dw_sptprice_changemx.InsertRow(0)
  119. dw_sptprice_changemx.Object.billid[row] = 0
  120. dw_sptprice_changemx.Object.printid[row] = 0
  121. dw_sptprice_changemx.Object.mtrlid[row] = s_tran.fxmtrlid[i]
  122. dw_sptprice_changemx.Object.mtrlid_erp[row] = s_tran.mtrlid[i]
  123. dw_sptprice_changemx.Object.price[row] = 0
  124. dw_sptprice_changemx.Object.dscrp[row] = ''
  125. dw_sptprice_changemx.Object.enprice[row] = 0
  126. dw_sptprice_changemx.Object.rebate[row] = 1
  127. dw_sptprice_changemx.Object.qty_min[row] = 0
  128. dw_sptprice_changemx.Object.qty_max[row] = 0
  129. dw_sptprice_changemx.Object.unit[row] = s_tran.unit[i]
  130. dw_sptprice_changemx.Object.jgdscrp[row] = ''
  131. dw_sptprice_changemx.Object.status[row] = ''
  132. dw_sptprice_changemx.Object.woodcode[row] = ''
  133. dw_sptprice_changemx.Object.pcode[row] = ''
  134. dw_sptprice_changemx.Object.requiredate[row] = DateTime(RelativeDate(Today(), 1), Time('00:00:00'))
  135. dw_sptprice_changemx.Object.buydays[row] = 0
  136. // dw_sptprice_changemx.Object.replydate[row] = s_tran.replydate[i]
  137. dw_sptprice_changemx.Object.mtrlcode[row] = s_tran.mtrlcode[i]
  138. dw_sptprice_changemx.Object.mtrlname[row] = s_tran.mtrlname[i]
  139. dw_sptprice_changemx.Object.mtrlmode[row] = s_tran.mtrlmode[i]
  140. dw_sptprice_changemx.Object.mtrlsectype[row] = s_tran.mtrlsectype[i]
  141. dw_sptprice_changemx.Object.zxmtrlmode[row] = s_tran.zxmtrlmode[i]
  142. dw_sptprice_changemx.Object.usermtrlmode[row] = s_tran.usermtrlmode[i]
  143. dw_sptprice_changemx.Object.statusflag[row] = s_tran.statusflag[i]
  144. dw_sptprice_changemx.Object.statustype[row] = s_tran.statustype[i]
  145. dw_sptprice_changemx.Object.woodcodeflag[row] = s_tran.woodcodeflag[i]
  146. dw_sptprice_changemx.Object.woodcodetype[row] = s_tran.woodcodetype[i]
  147. dw_sptprice_changemx.Object.pcodeflag[row] = s_tran.pcodeflag[i]
  148. dw_sptprice_changemx.Object.pcodetype[row] = s_tran.pcodetype[i]
  149. dw_sptprice_changemx.Object.configcodetype[row] = s_tran.configcodetype[i]
  150. next
  151. end event
  152. event ue_delmx();//
  153. if (not ins_edit_mode) then return
  154. if (dw_sptprice_changemx.RowCount() <= 0) then return
  155. long row
  156. row = dw_sptprice_changemx.GetRow()
  157. if (row <= 0) then return
  158. if (not dw_sptprice_changemx.IsSelected(row)) then return
  159. dw_sptprice_changemx.DeleteRow(row)
  160. if (row > dw_sptprice_changemx.RowCount()) then
  161. row = dw_sptprice_changemx.RowCount()
  162. end if
  163. dw_sptprice_changemx.SelectRow(0, false)
  164. dw_sptprice_changemx.SelectRow(row, true)
  165. dw_sptprice_changemx.SetRow(row)
  166. end event
  167. event ue_page_next();//
  168. if (ins_cur_pageNum = ins_totalPages) then
  169. MessageBox('提示', '已经是最后一页')
  170. return
  171. end if
  172. ins_cur_pageNum ++
  173. wf_retrieve_list( )
  174. end event
  175. event ue_page_before();//
  176. if (ins_cur_pageNum = 1) then
  177. MessageBox('提示', '已经是第一页')
  178. return
  179. end if
  180. ins_cur_pageNum --
  181. wf_retrieve_list( )
  182. end event
  183. event ue_page_end();//
  184. if (ins_cur_pageNum = ins_totalPages) then return
  185. ins_cur_pageNum = ins_totalPages
  186. wf_retrieve_list( )
  187. end event
  188. event ue_send_ljfieb();long row
  189. row = dw_sptprice_change_list.GetRow()
  190. if (row <= 0) then return
  191. if (not dw_sptprice_change_list.IsSelected(row)) then return
  192. long flag
  193. flag = dw_sptprice_change_list.Object.flag[row]
  194. if (flag > 0) then
  195. MessageBox('提示', '该询价单已经审核,无法发送')
  196. return
  197. end if
  198. string arg_msg
  199. OpenWithParm(w_packet_msg_edit_fx, arg_msg)
  200. s_open_packet s_ret
  201. s_ret = Message.PowerObjectParm
  202. if (s_ret.returnflag = 0) then
  203. MessageBox('提示', '操作取消')
  204. return
  205. end if
  206. string postscript
  207. postscript = s_ret.postscript
  208. if IsNull(postscript) then
  209. postscript = ''
  210. end if
  211. if (Len(postscript) > 500) then
  212. MessageBox('提示', '留言板信息超长(500),请进行删减')
  213. return
  214. end if
  215. long billid
  216. billid = dw_sptprice_change_list.Object.billid[row]
  217. oleobject parm
  218. parm = FXAppCom.CreatePbDictionary()
  219. parm.SetString('token', app_token_fx)
  220. parm.SetInt('billid', billid)
  221. parm.SetString('postscript', postscript)
  222. FXAppCom.SendSptPrice(parm, ref arg_msg)
  223. if (arg_msg <> '') then
  224. MessageBox('提示', '发送失败:' + arg_msg)
  225. return
  226. end if
  227. MessageBox('提示', '成功添加至发送队列')
  228. end event
  229. public subroutine wf_retrieve_list ();// 获取询价单列表
  230. if (ins_edit_mode) then return
  231. int rslt = 1
  232. string arg_msg
  233. long pageSize
  234. pageSize = Integer(em_pagesize.Text)
  235. if (pageSize <= 0) then
  236. rslt = 0
  237. arg_msg = '每页显示行数必须大于0'
  238. em_pagesize.SetFocus( )
  239. em_pagesize.SelectText(1, Len(em_pagesize.Text))
  240. goto ext
  241. end if
  242. long pageNum
  243. pageNum = ins_cur_pageNum
  244. datetime dateA, dateZ
  245. dateA = DateTime(Date(em_dateA.Text), Time(0))
  246. dateZ = DateTime(Date(em_dateZ.Text), Time('23:59:59'))
  247. string likeStr
  248. likeStr = Trim(sle_likestr.Text)
  249. oleobject obj
  250. obj = FXAppCom.GetSptPriceChange(app_token_fx, pageSize, pageNum, 2, string(dateA), string(dateZ), likestr, ref arg_msg)
  251. if (arg_msg <> '') then
  252. rslt = 0
  253. goto ext
  254. end if
  255. dw_sptprice_change.Reset()
  256. dw_sptprice_change_list.Reset()
  257. dw_sptprice_changemx.Reset()
  258. dw_sptprice_change_list.SetRedraw(false)
  259. long i, row
  260. ins_totalPages = obj.GetInt('totalPages')
  261. oleobject list, item
  262. list = obj.GetArrOfPBDictionary('sptpricechanges')
  263. for i = 1 to list.Count
  264. item = list.GetItem(i - 1)
  265. dw_sptprice_change_list.Object.billid[i] = item.GetInt('billid')
  266. dw_sptprice_change_list.Object.billcode[i] = item.GetString('billcode')
  267. if not IsNull(item.GetDateTime('billdate')) then
  268. dw_sptprice_change_list.Object.billdate[i] = item.GetDateTime('billdate')
  269. end if
  270. dw_sptprice_change_list.Object.cuscomid[i] = item.GetInt('cuscomid')
  271. dw_sptprice_change_list.Object.sptcomid[i] = item.GetInt('sptcomid')
  272. dw_sptprice_change_list.Object.dscrp[i] = item.GetString('dscrp')
  273. dw_sptprice_change_list.Object.flag[i] = item.GetInt('flag')
  274. dw_sptprice_change_list.Object.auditemp[i] = item.GetString('auditemp')
  275. // 1899-12-30 00:00:00
  276. if not IsNull(item.GetDateTime('auditdate')) then
  277. dw_sptprice_change_list.Object.auditdate[i] = item.GetDateTime('auditdate')
  278. end if
  279. if not IsNull(item.GetDateTime('opdate')) then
  280. dw_sptprice_change_list.Object.opdate[i] = item.GetDateTime('opdate')
  281. end if
  282. dw_sptprice_change_list.Object.opemp[i] = item.GetString('opemp')
  283. if not IsNull(item.GetDateTime('moddate')) then
  284. dw_sptprice_change_list.Object.moddate[i] = item.GetDateTime('moddate')
  285. end if
  286. dw_sptprice_change_list.Object.modemp[i] = item.GetString('modemp')
  287. dw_sptprice_change_list.Object.inrep[i] = item.GetString('inrep')
  288. dw_sptprice_change_list.Object.billtype[i] = item.GetInt('billtype')
  289. dw_sptprice_change_list.Object.senduser[i] = item.GetString('senduser')
  290. if not IsNull(item.GetDateTime('sendtime')) then
  291. dw_sptprice_change_list.Object.sendtime[i] = item.GetDateTime('sendtime')
  292. end if
  293. dw_sptprice_change_list.Object.sendcnt[i] = item.GetInt('sendcnt')
  294. dw_sptprice_change_list.Object.sptname[i] = item.GetString('sptname')
  295. next
  296. dw_sptprice_change_list.SetRedraw(true)
  297. ext:
  298. if (rslt = 1) then
  299. if (dw_sptprice_change_list.RowCount() > 0) then
  300. dw_sptprice_change_list.SelectRow(0, false)
  301. dw_sptprice_change_list.SelectRow(1, true)
  302. dw_sptprice_change_list.SetRow(1)
  303. dw_sptprice_change_list.post event RowFocusChanged(1)
  304. end if
  305. else
  306. MessageBox('提示', arg_msg)
  307. end if
  308. end subroutine
  309. public function integer wf_retrieve_mx (readonly long arg_billid);int rslt = 1
  310. if (ins_edit_mode) then return 0
  311. if IsNull(arg_billid) then return 0
  312. dw_sptprice_changemx.Reset()
  313. string arg_msg = ''
  314. oleobject list, item
  315. list = FXAppCom.GetSptPriceChangemx(app_token_fx, arg_billid, ref arg_msg)
  316. if (arg_msg <> '') then
  317. rslt = 0
  318. goto ext
  319. end if
  320. dw_sptprice_changemx.SetRedraw(false)
  321. long i
  322. for i = 1 to list.Count
  323. item = list.GetItem(i - 1)
  324. dw_sptprice_changemx.Object.billid[i] = item.GetInt('billid')
  325. dw_sptprice_changemx.Object.printid[i] = item.GetInt('printid')
  326. dw_sptprice_changemx.Object.mtrlid[i] = item.GetInt('mtrlid')
  327. dw_sptprice_changemx.Object.mtrlid_erp[i] = item.GetInt('mtrlid_erp')
  328. dw_sptprice_changemx.Object.price[i] = item.GetDouble('price')
  329. dw_sptprice_changemx.Object.dscrp[i] = item.GetString('dscrp')
  330. dw_sptprice_changemx.Object.enprice[i] = item.GetDouble('enprice')
  331. dw_sptprice_changemx.Object.rebate[i] = item.GetDouble('rebate')
  332. dw_sptprice_changemx.Object.qty_min[i] = item.GetDouble('qty_min')
  333. dw_sptprice_changemx.Object.qty_max[i] = item.GetDouble('qty_max')
  334. dw_sptprice_changemx.Object.unit[i] = item.GetString('unit')
  335. dw_sptprice_changemx.Object.jgdscrp[i] = item.GetString('jgdscrp')
  336. dw_sptprice_changemx.Object.status[i] = item.GetString('status')
  337. dw_sptprice_changemx.Object.woodcode[i] = item.GetString('woodcode')
  338. dw_sptprice_changemx.Object.pcode[i] = item.GetString('pcode')
  339. if not IsNull(item.GetDateTime('requiredate')) then
  340. dw_sptprice_changemx.Object.requiredate[i] = item.GetDateTime('requiredate')
  341. end if
  342. if not IsNull(item.GetDateTime('replydate')) then
  343. dw_sptprice_changemx.Object.replydate[i] = item.GetDateTime('replydate')
  344. end if
  345. dw_sptprice_changemx.Object.mtrlcode[i] = item.GetString('mtrlcode')
  346. dw_sptprice_changemx.Object.mtrlname[i] = item.GetString('mtrlname')
  347. dw_sptprice_changemx.Object.mtrlmode[i] = item.GetString('mtrlmode')
  348. dw_sptprice_changemx.Object.mtrlsectype[i] = item.GetString('mtrlsectype')
  349. dw_sptprice_changemx.Object.zxmtrlmode[i] = item.GetString('zxmtrlmode')
  350. dw_sptprice_changemx.Object.usermtrlmode[i] = item.GetString('usermtrlmode')
  351. dw_sptprice_changemx.Object.statusflag[i] = item.GetInt('statusflag')
  352. dw_sptprice_changemx.Object.statustype[i] = item.GetInt('statustype')
  353. dw_sptprice_changemx.Object.woodcodeflag[i] = item.GetInt('woodcodeflag')
  354. dw_sptprice_changemx.Object.woodcodetype[i] = item.GetInt('woodcodetype')
  355. dw_sptprice_changemx.Object.pcodeflag[i] = item.GetInt('pcodeflag')
  356. dw_sptprice_changemx.Object.pcodetype[i] = item.GetInt('pcodetype')
  357. dw_sptprice_changemx.Object.configcodetype[i] = item.GetInt('configcodetype')
  358. dw_sptprice_changemx.Object.buydays[i] = item.GetDouble('buydays')
  359. next
  360. dw_sptprice_changemx.SetRedraw(true)
  361. ext:
  362. if (rslt = 0) then
  363. MessageBox('提示', arg_msg)
  364. end if
  365. return rslt
  366. end function
  367. public subroutine wf_face ();string arg_msg
  368. if (ins_edit_mode) then // 编辑状态
  369. cb_retrieve.Enabled = false
  370. cb_del.Enabled = false
  371. cb_audit.Enabled = false
  372. cb_caudit.Enabled = false
  373. cb_mx.Enabled = true
  374. cb_exit.Enabled = false
  375. em_pagesize.Enabled = false
  376. cb_toppage.Enabled = false
  377. cb_page_ch.Enabled = false
  378. em_datea.Enabled = false
  379. em_datez.Enabled = false
  380. sle_likestr.Enabled = false
  381. cb_new.Text = "保存"
  382. cb_new.normalpicname = "Save.bmp"
  383. cb_edit.Text = "放弃"
  384. cb_edit.normalpicname = "Undo.bmp"
  385. else
  386. cb_retrieve.Enabled = true
  387. if (f_find_fx_user_power(43, ref arg_msg) = 1) then // 43-供应商询价单删除
  388. cb_del.Enabled = true
  389. end if
  390. if (f_find_fx_user_power(44, ref arg_msg) = 1) then // 44-供应商询价单审核
  391. cb_audit.Enabled = true
  392. end if
  393. if (f_find_fx_user_power(45, ref arg_msg) = 1) then // 45-供应商询价单撤审
  394. cb_caudit.Enabled = true
  395. end if
  396. cb_mx.Enabled = false
  397. cb_exit.Enabled = true
  398. em_pagesize.Enabled = true
  399. cb_toppage.Enabled = true
  400. cb_page_ch.Enabled = true
  401. em_datea.Enabled = true
  402. em_datez.Enabled = true
  403. sle_likestr.Enabled = true
  404. cb_new.Text = "新建"
  405. cb_new.normalpicname = "new.bmp"
  406. cb_edit.Text = "修改"
  407. cb_edit.normalpicname = "open.bmp"
  408. end if
  409. cb_new.of_init_draw()
  410. cb_edit.of_init_draw()
  411. cb_new.of_paint()
  412. cb_edit.of_paint()
  413. cb_new.TriggerEvent('ue_textchange')
  414. cb_edit.TriggerEvent('ue_textchange')
  415. end subroutine
  416. public subroutine wf_taborder ();//
  417. if (ins_edit_mode) then
  418. dw_sptprice_change.SetTabOrder('inrep', 10)
  419. dw_sptprice_change.SetTabOrder('dscrp', 20)
  420. dw_sptprice_changemx.SetTabOrder('enprice', 10)
  421. dw_sptprice_changemx.SetTabOrder('rebate', 20)
  422. dw_sptprice_changemx.SetTabOrder('unit', 30)
  423. dw_sptprice_changemx.SetTabOrder('qty_min', 40)
  424. dw_sptprice_changemx.SetTabOrder('qty_max', 50)
  425. dw_sptprice_changemx.SetTabOrder('jgdscrp', 60)
  426. dw_sptprice_changemx.SetTabOrder('status', 70)
  427. dw_sptprice_changemx.SetTabOrder('woodcode', 80)
  428. dw_sptprice_changemx.SetTabOrder('pcode', 90)
  429. dw_sptprice_changemx.SetTabOrder('dscrp', 100)
  430. dw_sptprice_changemx.SetTabOrder('buydays', 110)
  431. dw_sptprice_changemx.SetTabOrder('requiredate', 120)
  432. else
  433. dw_sptprice_change.SetTabOrder('inrep', 0)
  434. dw_sptprice_change.SetTabOrder('dscrp', 0)
  435. dw_sptprice_changemx.SetTabOrder('enprice', 0)
  436. dw_sptprice_changemx.SetTabOrder('rebate', 0)
  437. dw_sptprice_changemx.SetTabOrder('unit', 0)
  438. dw_sptprice_changemx.SetTabOrder('qty_min', 0)
  439. dw_sptprice_changemx.SetTabOrder('qty_max', 0)
  440. dw_sptprice_changemx.SetTabOrder('jgdscrp', 0)
  441. dw_sptprice_changemx.SetTabOrder('status', 0)
  442. dw_sptprice_changemx.SetTabOrder('woodcode', 0)
  443. dw_sptprice_changemx.SetTabOrder('pcode', 0)
  444. dw_sptprice_changemx.SetTabOrder('dscrp', 0)
  445. dw_sptprice_changemx.SetTabOrder('buydays', 0)
  446. dw_sptprice_changemx.SetTabOrder('requiredate', 0)
  447. end if
  448. end subroutine
  449. public function integer wf_chk_before_save (ref string arg_msg);//
  450. int rslt = 1
  451. dw_sptprice_change.AcceptText()
  452. dw_sptprice_changemx.AcceptText()
  453. string msg_sum, temp
  454. long row
  455. row = dw_sptprice_change.GetRow()
  456. if Trim(dw_sptprice_change.Object.inrep[row]) = '' then
  457. rslt = 0
  458. msg_sum += '请填写经手人~r~n'
  459. end if
  460. long sptcomid
  461. sptcomid = dw_sptprice_change.Object.sptcomid[row]
  462. if (sptcomid <= 0) then
  463. rslt = 0
  464. msg_sum += '请选择供应商~r~n'
  465. end if
  466. long i, j
  467. long mtrlid_i
  468. decimal qty_min_i, qty_max_i
  469. string jgdscrp_i, status_i, woodcode_i, pcode_i
  470. long mtrlid_j
  471. decimal qty_min_j, qty_max_j
  472. string jgdscrp_j, status_j, woodcode_j, pcode_j
  473. if (dw_sptprice_changemx.RowCount() <= 0) then
  474. rslt = 0
  475. msg_sum += '没有明细内容~r~n'
  476. else
  477. for i = 1 to dw_sptprice_changemx.RowCount()
  478. temp = ''
  479. if (Trim(dw_sptprice_changemx.Object.unit[i]) = '') then
  480. rslt = 0
  481. temp += '单位有误;'
  482. end if
  483. // ...
  484. if (temp <> '') then
  485. msg_sum += '第' + string(i) + '行明细:' + temp + '~r~n'
  486. end if
  487. next
  488. // 去重检查
  489. for i = 1 to dw_sptprice_changemx.RowCount() - 1
  490. mtrlid_i = dw_sptprice_changemx.Object.mtrlid[i]
  491. qty_min_i = dw_sptprice_changemx.Object.qty_min[i]
  492. qty_max_i = dw_sptprice_changemx.Object.qty_max[i]
  493. jgdscrp_i = dw_sptprice_changemx.Object.jgdscrp[i]
  494. status_i = dw_sptprice_changemx.Object.status[i]
  495. woodcode_i = dw_sptprice_changemx.Object.woodcode[i]
  496. pcode_i = dw_sptprice_changemx.Object.pcode[i]
  497. for j = i + 1 to dw_sptprice_changemx.RowCount()
  498. mtrlid_j = dw_sptprice_changemx.Object.mtrlid[j]
  499. qty_min_j = dw_sptprice_changemx.Object.qty_min[j]
  500. qty_max_j = dw_sptprice_changemx.Object.qty_max[j]
  501. jgdscrp_j = dw_sptprice_changemx.Object.jgdscrp[j]
  502. status_j = dw_sptprice_changemx.Object.status[j]
  503. woodcode_j = dw_sptprice_changemx.Object.woodcode[j]
  504. pcode_j = dw_sptprice_changemx.Object.pcode[j]
  505. if (mtrlid_i = mtrlid_j &
  506. and qty_min_i = qty_min_j &
  507. and qty_max_i = qty_max_j &
  508. and jgdscrp_i = jgdscrp_j &
  509. and status_i = status_j &
  510. and woodcode_i = woodcode_j &
  511. and pcode_i = pcode_j) then
  512. msg_sum += '第' + string(i) + '行与第' + string(j) + '行出现重复明细(物料,数量,配置)~r~n'
  513. rslt = 0
  514. end if
  515. next
  516. next
  517. end if
  518. arg_msg = msg_sum
  519. return rslt
  520. end function
  521. public function integer wf_save ();int rslt = 1
  522. dw_sptprice_changemx.SetFilter('')
  523. dw_sptprice_changemx.Filter()
  524. string arg_msg
  525. if (wf_chk_before_save(ref arg_msg) <> 1) then
  526. rslt = 0
  527. OpenWithParm(w_message_err, arg_msg)
  528. goto ext
  529. end if
  530. long row
  531. row = dw_sptprice_change.GetRow()
  532. if (row <= 0) then
  533. rslt = 0
  534. MessageBox('提示', '获取主表信息失败')
  535. goto ext
  536. end if
  537. oleobject sptprice, sptpriceMxs, item
  538. // 主表
  539. sptprice = FXAppCom.CreatePbDictionary()
  540. sptprice.SetInt('billid', dw_sptprice_change.Object.billid[row])
  541. //sptprice.SetString('billcode', Trim(dw_sptprice_change.Object.billcode[row]))
  542. //sptprice.SetDateTime('billdate', dw_sptprice_change.Object.billdate[row])
  543. sptprice.SetInt('cuscomid', dw_sptprice_change.Object.cuscomid[row])
  544. sptprice.SetInt('sptcomid', dw_sptprice_change.Object.sptcomid[row])
  545. sptprice.SetString('dscrp', Trim(dw_sptprice_change.Object.dscrp[row]))
  546. //sptprice.SetInt('flag', dw_sptprice_change.Object.flag[row])
  547. //sptprice.SetString('auditemp', Trim(dw_sptprice_change.Object.auditemp[row]))
  548. //sptprice.SetDateTime('auditdate', dw_sptprice_change.Object.auditdate[row])
  549. //sptprice.SetDateTime('opdate', dw_sptprice_change.Object.opdate[row])
  550. //sptprice.SetString('opemp', Trim(dw_sptprice_change.Object.opemp[row]))
  551. //sptprice.SetDateTime('moddate', dw_sptprice_change.Object.moddate[row])
  552. //sptprice.SetString('modemp', Trim(dw_sptprice_change.Object.modemp[row]))
  553. sptprice.SetString('inrep', Trim(dw_sptprice_change.Object.inrep[row]))
  554. sptprice.SetInt('billtype', 2) // [2]询价单
  555. //sptprice.SetString('senduser', Trim(dw_sptprice_change.Object.senduser[row]))
  556. //sptprice.SetDateTime('sendtime', dw_sptprice_change.Object.sendtime[row])
  557. //sptprice.SetInt('sendcnt', dw_sptprice_change.Object.sendcnt[row])
  558. // 明细表
  559. sptpriceMxs = FXAppCom.CreArrOfPbDictionary()
  560. long i
  561. decimal price, enprice, rebate
  562. for i = 1 to dw_sptprice_changemx.RowCount()
  563. item = FXAppCom.CreatePbDictionary()
  564. // item.SetInt('billid', dw_sptprice_changemx.Object.billid[i])
  565. item.SetInt('printid', i)
  566. item.SetInt('mtrlid', dw_sptprice_changemx.Object.mtrlid[i])
  567. item.SetInt('mtrlid_erp', dw_sptprice_changemx.Object.mtrlid_erp[i])
  568. item.SetDouble('price', dw_sptprice_changemx.Object.price[i]) // null
  569. item.SetString('dscrp', dw_sptprice_changemx.Object.dscrp[i])
  570. item.SetDouble('enprice', dw_sptprice_changemx.Object.enprice[i])
  571. item.SetDouble('rebate', dw_sptprice_changemx.Object.rebate[i])
  572. item.SetDouble('qty_min', dw_sptprice_changemx.Object.qty_min[i])
  573. item.SetDouble('qty_max', dw_sptprice_changemx.Object.qty_max[i])
  574. item.SetString('unit', dw_sptprice_changemx.Object.unit[i])
  575. item.SetString('jgdscrp', dw_sptprice_changemx.Object.jgdscrp[i])
  576. item.SetString('status', dw_sptprice_changemx.Object.status[i])
  577. item.SetString('woodcode', dw_sptprice_changemx.Object.woodcode[i])
  578. item.SetString('pcode', dw_sptprice_changemx.Object.pcode[i])
  579. item.SetDateTime('requiredate', dw_sptprice_changemx.Object.requiredate[i])
  580. item.SetDateTime('replydate', dw_sptprice_changemx.Object.replydate[i]) // null
  581. item.SetDouble('buydays', dw_sptprice_changemx.Object.buydays[i])
  582. sptpriceMxs.Add(item)
  583. next
  584. FxAppCom.AddSptPriceChange(app_token_fx, sptprice, sptpriceMxs, ref arg_msg)
  585. if (arg_msg <> '') then
  586. rslt = 0
  587. MessageBox('提示', '保存失败:' + arg_msg)
  588. else
  589. MessageBox('提示', '保存成功')
  590. end if
  591. ext:
  592. return rslt
  593. end function
  594. public subroutine wf_new ();long row
  595. row = dw_sptprice_change_list.InsertRow(1)
  596. dw_sptprice_change_list.SelectRow(0, false)
  597. dw_sptprice_change_list.SelectRow(row, true)
  598. dw_sptprice_change_list.SetRow(row)
  599. dw_sptprice_change.Reset()
  600. row = dw_sptprice_change.InsertRow(0)
  601. dw_sptprice_change.Object.billid[row] = 0
  602. dw_sptprice_change.Object.billdate[row] = Today()
  603. dw_sptprice_change.Object.cuscomid[row] = 0
  604. dw_sptprice_change.Object.sptcomid[row] = 0
  605. dw_sptprice_change.Object.dscrp[row] = ''
  606. dw_sptprice_change.Object.inrep[row] = ''
  607. dw_sptprice_change.Object.opemp[row] = app_username
  608. dw_sptprice_changemx.Reset()
  609. cb_edit.Enabled = true
  610. end subroutine
  611. public subroutine wf_retrieve_pz ();// 修改状态下使用(新建单据的情况已有相应的获取配置步骤)
  612. if (not ins_edit_mode) then return
  613. long row
  614. row = dw_sptprice_change_list.GetRow()
  615. if (row <= 0) then return
  616. if (not dw_sptprice_change_list.IsSelected(row)) then return
  617. string arg_msg
  618. boolean ifNeedInit = false
  619. long sptcomid
  620. sptcomid = dw_sptprice_change_list.Object.sptcomid[row]
  621. if (not IsNull(uo_pz.ins_comid)) then
  622. if (uo_pz.ins_comid <> sptcomid) then
  623. ifNeedInit = true
  624. else
  625. if (not uo_pz.ins_isReady) then
  626. uo_pz.uof_get_ready(ref arg_msg)
  627. if (arg_msg <> '') then
  628. MessageBox('提示', '获取配置失败:' + arg_msg)
  629. return
  630. end if
  631. end if
  632. end if
  633. else
  634. ifNeedInit = true
  635. end if
  636. if (ifNeedInit) then
  637. uo_pz.init()
  638. uo_pz.ins_comid = sptcomid
  639. if (uo_pz.uof_before_ready(ref arg_msg) <> 1) then
  640. MessageBox('提示', arg_msg)
  641. end if
  642. end if
  643. end subroutine
  644. on w_spt_price_change_fx.create
  645. int iCurrent
  646. call super::create
  647. this.cb_retrieve=create cb_retrieve
  648. this.cb_new=create cb_new
  649. this.cb_edit=create cb_edit
  650. this.cb_del=create cb_del
  651. this.cb_audit=create cb_audit
  652. this.cb_caudit=create cb_caudit
  653. this.em_pagesize=create em_pagesize
  654. this.cb_toppage=create cb_toppage
  655. this.cb_page_ch=create cb_page_ch
  656. this.st_4=create st_4
  657. this.sle_likestr=create sle_likestr
  658. this.dw_sptprice_change=create dw_sptprice_change
  659. this.st_2=create st_2
  660. this.em_datea=create em_datea
  661. this.st_3=create st_3
  662. this.em_datez=create em_datez
  663. this.dw_sptprice_change_list=create dw_sptprice_change_list
  664. this.cb_mx=create cb_mx
  665. this.p_ljfieb=create p_ljfieb
  666. this.dw_sptprice_changemx=create dw_sptprice_changemx
  667. iCurrent=UpperBound(this.Control)
  668. this.Control[iCurrent+1]=this.cb_retrieve
  669. this.Control[iCurrent+2]=this.cb_new
  670. this.Control[iCurrent+3]=this.cb_edit
  671. this.Control[iCurrent+4]=this.cb_del
  672. this.Control[iCurrent+5]=this.cb_audit
  673. this.Control[iCurrent+6]=this.cb_caudit
  674. this.Control[iCurrent+7]=this.em_pagesize
  675. this.Control[iCurrent+8]=this.cb_toppage
  676. this.Control[iCurrent+9]=this.cb_page_ch
  677. this.Control[iCurrent+10]=this.st_4
  678. this.Control[iCurrent+11]=this.sle_likestr
  679. this.Control[iCurrent+12]=this.dw_sptprice_change
  680. this.Control[iCurrent+13]=this.st_2
  681. this.Control[iCurrent+14]=this.em_datea
  682. this.Control[iCurrent+15]=this.st_3
  683. this.Control[iCurrent+16]=this.em_datez
  684. this.Control[iCurrent+17]=this.dw_sptprice_change_list
  685. this.Control[iCurrent+18]=this.cb_mx
  686. this.Control[iCurrent+19]=this.p_ljfieb
  687. this.Control[iCurrent+20]=this.dw_sptprice_changemx
  688. end on
  689. on w_spt_price_change_fx.destroy
  690. call super::destroy
  691. destroy(this.cb_retrieve)
  692. destroy(this.cb_new)
  693. destroy(this.cb_edit)
  694. destroy(this.cb_del)
  695. destroy(this.cb_audit)
  696. destroy(this.cb_caudit)
  697. destroy(this.em_pagesize)
  698. destroy(this.cb_toppage)
  699. destroy(this.cb_page_ch)
  700. destroy(this.st_4)
  701. destroy(this.sle_likestr)
  702. destroy(this.dw_sptprice_change)
  703. destroy(this.st_2)
  704. destroy(this.em_datea)
  705. destroy(this.st_3)
  706. destroy(this.em_datez)
  707. destroy(this.dw_sptprice_change_list)
  708. destroy(this.cb_mx)
  709. destroy(this.p_ljfieb)
  710. destroy(this.dw_sptprice_changemx)
  711. end on
  712. event open;call super::open;string arg_msg // 39-供应商询价单查看 40-供应商询价单查看(含单价)
  713. if (f_find_fx_user_power(39, ref arg_msg) <> 1 &
  714. and f_find_fx_user_power(40, ref arg_msg) <> 1) then
  715. MessageBox('权限提示', arg_msg)
  716. Close(this)
  717. return
  718. end if
  719. em_datea.Text = String(RelativeDate(Today(), - 30))
  720. em_datez.Text = String(Today())
  721. uo_pz = create uo_fx_pz
  722. wf_retrieve_list( )
  723. wf_face()
  724. if (f_find_fx_user_power(43, ref arg_msg) <> 1) then // 43-供应商询价单删除
  725. cb_del.Enabled = false
  726. end if
  727. if (f_find_fx_user_power(44, ref arg_msg) <> 1) then // 44-供应商询价单审核
  728. cb_audit.Enabled = false
  729. end if
  730. if (f_find_fx_user_power(45, ref arg_msg) <> 1) then // 45-供应商询价单撤审
  731. cb_caudit.Enabled = false
  732. end if
  733. if (f_find_fx_user_power(40, ref arg_msg) <> 1) then // 40-供应商询价单查看(含单价)
  734. dw_sptprice_changemx.Modify('destroy enprice_t ~r~n destroy enprice ~r~n')
  735. dw_sptprice_changemx.Modify('destroy rebate_t ~r~n destroy rebate ~r~n')
  736. dw_sptprice_changemx.Modify('destroy compute_1_t ~r~n destroy compute_1 ~r~n')
  737. dw_sptprice_changemx.Modify('destroy price_t ~r~n destroy price ~r~n')
  738. end if
  739. end event
  740. event close;call super::close;destroy uo_pz
  741. end event
  742. event resize;call super::resize;if (this.Width < 4300) then this.Width = 4300
  743. if (this.Height < 2100) then this.Height = 2100
  744. dw_sptprice_change_list.Width = this.workspacewidth( ) - dw_sptprice_change_list.X
  745. dw_sptprice_changemx.Width = this.workspacewidth( )
  746. dw_sptprice_changemx.Height = this.workspaceheight( ) - dw_sptprice_changemx.Y
  747. p_ljfieb.X = this.workspacewidth( ) - p_ljfieb.Width - 20
  748. // 按钮靠右
  749. cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  750. cb_page_ch.X = cb_exit.X - cb_page_ch.Width - 5
  751. cb_toppage.X = cb_page_ch.X - cb_toppage.Width - 5
  752. em_pagesize.X = cb_toppage.X - em_pagesize.Width - 5
  753. end event
  754. type cb_func from w_publ_base_style`cb_func within w_spt_price_change_fx
  755. boolean visible = false
  756. end type
  757. type cb_exit from w_publ_base_style`cb_exit within w_spt_price_change_fx
  758. integer x = 3557
  759. end type
  760. type ln_bar from w_publ_base_style`ln_bar within w_spt_price_change_fx
  761. end type
  762. type ln_bar2 from w_publ_base_style`ln_bar2 within w_spt_price_change_fx
  763. end type
  764. type r_bar from w_publ_base_style`r_bar within w_spt_price_change_fx
  765. end type
  766. type cb_retrieve from uo_imflatbutton within w_spt_price_change_fx
  767. integer width = 151
  768. integer height = 164
  769. integer taborder = 30
  770. boolean bringtotop = true
  771. string text = "刷新"
  772. string normalpicname = "refresh.bmp"
  773. integer picsize = 16
  774. toolbaralignment pic_align = alignattop!
  775. boolean border = false
  776. end type
  777. event clicked;call super::clicked;wf_retrieve_list( )
  778. end event
  779. type cb_new from uo_imflatbutton within w_spt_price_change_fx
  780. integer x = 155
  781. integer width = 151
  782. integer height = 164
  783. integer taborder = 10
  784. boolean bringtotop = true
  785. string text = "新建"
  786. string normalpicname = "new.bmp"
  787. integer picsize = 16
  788. toolbaralignment pic_align = alignattop!
  789. boolean border = false
  790. end type
  791. event clicked;call super::clicked;boolean ifSaveAndPass = false
  792. if (not ins_edit_mode) then // 进入新建操作
  793. string arg_msg
  794. if (f_find_fx_user_power(41, ref arg_msg) <> 1) then // 41-供应商询价单新建
  795. MessageBox('权限提示', arg_msg)
  796. return
  797. end if
  798. wf_new()
  799. else // 保存操作
  800. if (wf_save() <> 1) then return
  801. ifSaveAndPass = true
  802. end if
  803. ins_edit_mode = not ins_edit_mode
  804. wf_face()
  805. wf_taborder()
  806. if (ifSaveAndPass) then
  807. wf_retrieve_list( )
  808. end if
  809. end event
  810. type cb_edit from uo_imflatbutton within w_spt_price_change_fx
  811. integer x = 311
  812. integer width = 151
  813. integer height = 164
  814. integer taborder = 30
  815. boolean bringtotop = true
  816. string text = "修改"
  817. string normalpicname = "open.bmp"
  818. integer picsize = 16
  819. toolbaralignment pic_align = alignattop!
  820. boolean border = false
  821. end type
  822. event clicked;call super::clicked;long row
  823. row = dw_sptprice_change_list.GetRow()
  824. if (row <= 0) then return
  825. if (not dw_sptprice_change_list.IsSelected(row)) then return
  826. ins_edit_mode = not ins_edit_mode
  827. long billid
  828. if (ins_edit_mode) then // 修改
  829. string arg_msg
  830. if (f_find_fx_user_power(42, ref arg_msg) <> 1) then // 42-供应商询价单修改
  831. MessageBox('权限提示', arg_msg)
  832. ins_edit_mode = not ins_edit_mode
  833. return
  834. end if
  835. wf_face()
  836. wf_taborder()
  837. wf_retrieve_pz()
  838. else // 放弃
  839. row = dw_sptprice_change_list.GetRow()
  840. billid = dw_sptprice_change_list.Object.billid[row]
  841. if (billid > 0) then
  842. dw_sptprice_change_list.post event RowFocusChanged(row)
  843. else
  844. dw_sptprice_change_list.DeleteRow(row)
  845. wf_retrieve_list( )
  846. end if
  847. wf_face()
  848. wf_taborder()
  849. end if
  850. end event
  851. type cb_del from uo_imflatbutton within w_spt_price_change_fx
  852. integer x = 466
  853. integer width = 151
  854. integer height = 164
  855. integer taborder = 20
  856. boolean bringtotop = true
  857. string text = "删除"
  858. string normalpicname = "delete.bmp"
  859. integer picsize = 16
  860. toolbaralignment pic_align = alignattop!
  861. boolean border = false
  862. end type
  863. event clicked;call super::clicked;if (ins_edit_mode) then return
  864. string arg_msg
  865. if (f_find_fx_user_power(43, ref arg_msg) <> 1) then // 43-供应商询价单删除
  866. MessageBox('权限提示', arg_msg)
  867. return
  868. end if
  869. long row
  870. row = dw_sptprice_change_list.GetRow()
  871. if (row <= 0) then return
  872. if (not dw_sptprice_change_list.IsSelected(row)) then return
  873. long billid, flag, sendcnt
  874. flag = dw_sptprice_change_list.Object.flag[row]
  875. if (flag > 0) then
  876. MessageBox('提示', '该单据已经审核,无法删除')
  877. return
  878. end if
  879. sendcnt = dw_sptprice_change_list.Object.sendcnt[row]
  880. if (sendcnt > 0) then
  881. if (MessageBox('提示', '该单据发送次数不为零,确认删除?', Question!, YesNoCancel!) <> 1) then return
  882. end if
  883. billid = dw_sptprice_change_list.Object.billid[row]
  884. if (billid <= 0) then return
  885. oleobject parm
  886. parm = FXAppCom.CreatePbDictionary()
  887. parm.SetString('token', app_token_fx)
  888. parm.SetInt('billid', billid)
  889. FXAppCom.DelSptPriceChange(parm, ref arg_msg)
  890. if (arg_msg <> '') then
  891. MessageBox('提示', arg_msg)
  892. return
  893. end if
  894. MessageBox('提示', '删除成功')
  895. wf_retrieve_list( )
  896. end event
  897. type cb_audit from uo_imflatbutton within w_spt_price_change_fx
  898. integer x = 622
  899. integer width = 151
  900. integer height = 164
  901. integer taborder = 40
  902. boolean bringtotop = true
  903. string text = "审核"
  904. string normalpicname = "audit.bmp"
  905. integer picsize = 16
  906. toolbaralignment pic_align = alignattop!
  907. boolean border = false
  908. end type
  909. event clicked;call super::clicked;if (ins_edit_mode) then return
  910. string arg_msg
  911. if (f_find_fx_user_power(44, ref arg_msg) <> 1) then // 44-供应商询价单审核
  912. MessageBox('权限提示', arg_msg)
  913. return
  914. end if
  915. long row
  916. row = dw_sptprice_change_list.GetRow()
  917. if (row <= 0) then return
  918. if (not dw_sptprice_change_list.IsSelected(row)) then return
  919. long billid, flag
  920. flag = dw_sptprice_change_list.Object.flag[row]
  921. if (flag > 0) then
  922. MessageBox('提示', '该单据已经审核')
  923. return
  924. end if
  925. billid = dw_sptprice_change_list.Object.billid[row]
  926. if (billid <= 0) then return
  927. oleobject parm
  928. parm = FXAppCom.CreatePbDictionary()
  929. parm.SetString('token', app_token_fx)
  930. parm.SetInt('billid', billid)
  931. parm.SetInt('flag', 1)
  932. FXAppCom.AuditSptPriceChange(parm, ref arg_msg)
  933. if (arg_msg <> '') then
  934. MessageBox('提示', arg_msg)
  935. return
  936. end if
  937. MessageBox('提示', '操作成功')
  938. dw_sptprice_change_list.Object.flag[row] = 1
  939. dw_sptprice_change_list.Object.auditemp[row] = app_username
  940. dw_sptprice_change_list.Object.auditdate[row] = DateTime(Today(), Now())
  941. row = dw_sptprice_change.GetRow()
  942. dw_sptprice_change.Object.flag[row] = 1
  943. dw_sptprice_change.Object.auditemp[row] = app_username
  944. dw_sptprice_change.Object.auditdate[row] = DateTime(Today(), Now())
  945. // 修改 删除 审核 撤审
  946. cb_edit.Enabled = false
  947. cb_del.Enabled = false
  948. cb_audit.Enabled = false
  949. if (f_find_fx_user_power(45, ref arg_msg) = 1) then // 45-供应商询价单撤审
  950. cb_caudit.Enabled = true
  951. end if
  952. end event
  953. type cb_caudit from uo_imflatbutton within w_spt_price_change_fx
  954. integer x = 777
  955. integer width = 151
  956. integer height = 164
  957. integer taborder = 30
  958. boolean bringtotop = true
  959. string text = "撤审"
  960. string normalpicname = "caudit.bmp"
  961. integer picsize = 16
  962. toolbaralignment pic_align = alignattop!
  963. boolean border = false
  964. end type
  965. event clicked;call super::clicked;if (ins_edit_mode) then return
  966. string arg_msg
  967. if (f_find_fx_user_power(45, ref arg_msg) <> 1) then // 45-供应商询价单撤审
  968. MessageBox('权限提示', arg_msg)
  969. return
  970. end if
  971. long row
  972. row = dw_sptprice_change_list.GetRow()
  973. if (row <= 0) then return
  974. if (not dw_sptprice_change_list.IsSelected(row)) then return
  975. long billid, flag
  976. flag = dw_sptprice_change_list.Object.flag[row]
  977. if (flag = 0) then
  978. MessageBox('提示', '该单据未审核')
  979. return
  980. end if
  981. billid = dw_sptprice_change_list.Object.billid[row]
  982. if (billid <= 0) then return
  983. oleobject parm
  984. parm = FXAppCom.CreatePbDictionary()
  985. parm.SetString('token', app_token_fx)
  986. parm.SetInt('billid', billid)
  987. parm.SetInt('flag', 0)
  988. FXAppCom.AuditSptPriceChange(parm, ref arg_msg)
  989. if (arg_msg <> '') then
  990. MessageBox('提示', arg_msg)
  991. return
  992. end if
  993. datetime dtnull
  994. SetNull(dtnull)
  995. MessageBox('提示', '操作成功')
  996. dw_sptprice_change_list.Object.flag[row] = 0
  997. dw_sptprice_change_list.Object.auditemp[row] = ''
  998. dw_sptprice_change_list.Object.auditdate[row] = dtnull
  999. row = dw_sptprice_change.GetRow()
  1000. dw_sptprice_change.Object.flag[row] = 0
  1001. dw_sptprice_change.Object.auditemp[row] = ''
  1002. dw_sptprice_change.Object.auditdate[row] = dtnull
  1003. // 修改 删除 审核 撤审
  1004. cb_edit.Enabled = true
  1005. if (f_find_fx_user_power(43, ref arg_msg) = 1) then // 43-供应商询价单删除
  1006. cb_del.Enabled = true
  1007. end if
  1008. if (f_find_fx_user_power(44, ref arg_msg) = 1) then // 44-供应商询价单审核
  1009. cb_audit.Enabled = true
  1010. end if
  1011. cb_caudit.Enabled = false
  1012. end event
  1013. type em_pagesize from editmask within w_spt_price_change_fx
  1014. integer x = 3008
  1015. integer y = 40
  1016. integer width = 302
  1017. integer height = 84
  1018. integer taborder = 50
  1019. boolean bringtotop = true
  1020. integer textsize = -9
  1021. integer weight = 400
  1022. fontcharset fontcharset = gb2312charset!
  1023. fontpitch fontpitch = variable!
  1024. string facename = "宋体"
  1025. long textcolor = 33554432
  1026. string text = "100"
  1027. alignment alignment = right!
  1028. borderstyle borderstyle = stylelowered!
  1029. string mask = "#####0"
  1030. boolean spin = true
  1031. double increment = 1
  1032. string minmax = "1~~"
  1033. end type
  1034. type cb_toppage from uo_imflatbutton within w_spt_price_change_fx
  1035. integer x = 3314
  1036. integer width = 151
  1037. integer height = 164
  1038. integer taborder = 40
  1039. boolean bringtotop = true
  1040. string text = "首页"
  1041. boolean border = false
  1042. end type
  1043. event clicked;call super::clicked;ins_cur_pageNum = 1
  1044. wf_retrieve_list( )
  1045. end event
  1046. type cb_page_ch from uo_imflatbutton within w_spt_price_change_fx
  1047. integer x = 3470
  1048. integer width = 82
  1049. integer height = 164
  1050. integer taborder = 20
  1051. boolean bringtotop = true
  1052. string text = "▼"
  1053. toolbaralignment pic_align = alignattop!
  1054. boolean border = false
  1055. end type
  1056. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1057. string menustr
  1058. menustr="Text=下页~tEvent=ue_page_next"
  1059. menustr = menustr + "|" + "Text=上页~tEvent=ue_page_before"
  1060. menustr = menustr + "|" + "Text=末页~tEvent=ue_page_end"
  1061. if len(trim(menustr))<>0 then
  1062. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1063. dmPopupMenu.mf_BuildMenu(This, menustr)
  1064. dmPopupMenu.mf_PopMenu()
  1065. Destroy dmPopupMenu
  1066. end if
  1067. end event
  1068. type st_4 from statictext within w_spt_price_change_fx
  1069. integer x = 1111
  1070. integer y = 200
  1071. integer width = 224
  1072. integer height = 48
  1073. boolean bringtotop = true
  1074. integer textsize = -9
  1075. integer weight = 400
  1076. fontcharset fontcharset = gb2312charset!
  1077. fontpitch fontpitch = variable!
  1078. string facename = "宋体"
  1079. long textcolor = 33554432
  1080. long backcolor = 16777215
  1081. string text = "单号含"
  1082. alignment alignment = center!
  1083. boolean focusrectangle = false
  1084. end type
  1085. type sle_likestr from u_sleedit within w_spt_price_change_fx
  1086. integer x = 1321
  1087. integer y = 184
  1088. integer height = 84
  1089. integer taborder = 90
  1090. boolean bringtotop = true
  1091. end type
  1092. event keydown;call super::keydown;//if (key = KeyEnter!) then
  1093. // ins_cur_pageNum = 1
  1094. // wf_retrieve_saletask( )
  1095. //end if
  1096. end event
  1097. type dw_sptprice_change from datawindow within w_spt_price_change_fx
  1098. integer y = 280
  1099. integer width = 1751
  1100. integer height = 796
  1101. integer taborder = 100
  1102. boolean bringtotop = true
  1103. string title = "none"
  1104. string dataobject = "dw_fx_spt_price_change_ff"
  1105. boolean livescroll = true
  1106. borderstyle borderstyle = stylelowered!
  1107. end type
  1108. event doubleclicked;if (not ins_edit_mode) then return
  1109. if (row <= 0) then return
  1110. if ((dwo.Type = 'column' and dwo.Name = 'sptname') or (dwo.Type = 'text' and dwo.Name = 'sptname_t')) then
  1111. long ori_sptcomid, new_sptcomid
  1112. ori_sptcomid = this.Object.sptcomid[row]
  1113. s_fx_company s_ret
  1114. Open(w_spt_ch_fx)
  1115. s_ret = Message.PowerObjectParm
  1116. if not IsNull(s_ret) then
  1117. if (s_ret.ifselect) then
  1118. new_sptcomid = s_ret.comid[1]
  1119. if (ori_sptcomid <> new_sptcomid) then
  1120. dw_sptprice_changemx.Reset() // 重选供应商,清空明细物料
  1121. if (new_sptcomid > 0) then
  1122. uo_pz.init()
  1123. uo_pz.ins_comid = new_sptcomid
  1124. string arg_msg
  1125. if (uo_pz.uof_before_ready(ref arg_msg) <> 1) then
  1126. MessageBox('提示', arg_msg)
  1127. end if
  1128. end if
  1129. end if
  1130. this.Object.sptcomid[row] = new_sptcomid
  1131. this.Object.sptname[row] = s_ret.comname[1]
  1132. end if
  1133. end if
  1134. end if
  1135. end event
  1136. type st_2 from statictext within w_spt_price_change_fx
  1137. integer y = 200
  1138. integer width = 183
  1139. integer height = 48
  1140. boolean bringtotop = true
  1141. integer textsize = -9
  1142. integer weight = 400
  1143. fontcharset fontcharset = gb2312charset!
  1144. fontpitch fontpitch = variable!
  1145. string facename = "宋体"
  1146. long textcolor = 33554432
  1147. long backcolor = 16777215
  1148. string text = "日期从"
  1149. alignment alignment = center!
  1150. boolean focusrectangle = false
  1151. end type
  1152. type em_datea from editmask within w_spt_price_change_fx
  1153. integer x = 187
  1154. integer y = 184
  1155. integer width = 389
  1156. integer height = 84
  1157. integer taborder = 70
  1158. boolean bringtotop = true
  1159. integer textsize = -9
  1160. integer weight = 400
  1161. fontcharset fontcharset = gb2312charset!
  1162. fontpitch fontpitch = variable!
  1163. string facename = "宋体"
  1164. long textcolor = 33554432
  1165. string text = "0000-00-00"
  1166. borderstyle borderstyle = stylelowered!
  1167. maskdatatype maskdatatype = datemask!
  1168. string mask = "yyyy-mm-dd"
  1169. boolean spin = true
  1170. end type
  1171. type st_3 from statictext within w_spt_price_change_fx
  1172. integer x = 581
  1173. integer y = 200
  1174. integer width = 96
  1175. integer height = 48
  1176. boolean bringtotop = true
  1177. integer textsize = -9
  1178. integer weight = 400
  1179. fontcharset fontcharset = gb2312charset!
  1180. fontpitch fontpitch = variable!
  1181. string facename = "宋体"
  1182. long textcolor = 33554432
  1183. long backcolor = 16777215
  1184. string text = "到"
  1185. alignment alignment = center!
  1186. boolean focusrectangle = false
  1187. end type
  1188. type em_datez from editmask within w_spt_price_change_fx
  1189. integer x = 672
  1190. integer y = 184
  1191. integer width = 389
  1192. integer height = 84
  1193. integer taborder = 80
  1194. boolean bringtotop = true
  1195. integer textsize = -9
  1196. integer weight = 400
  1197. fontcharset fontcharset = gb2312charset!
  1198. fontpitch fontpitch = variable!
  1199. string facename = "宋体"
  1200. long textcolor = 33554432
  1201. string text = "0000-00-00"
  1202. borderstyle borderstyle = stylelowered!
  1203. maskdatatype maskdatatype = datemask!
  1204. string mask = "yyyy-mm-dd"
  1205. boolean spin = true
  1206. end type
  1207. type dw_sptprice_change_list from u_dw_rbtnfilter within w_spt_price_change_fx
  1208. integer x = 1751
  1209. integer y = 280
  1210. integer width = 2583
  1211. integer height = 796
  1212. integer taborder = 20
  1213. boolean bringtotop = true
  1214. boolean titlebar = true
  1215. string title = "单据摘要内容"
  1216. string dataobject = "dw_fx_spt_price_change"
  1217. boolean controlmenu = true
  1218. boolean maxbox = true
  1219. boolean hscrollbar = true
  1220. boolean vscrollbar = true
  1221. boolean resizable = true
  1222. boolean border = false
  1223. boolean hsplitscroll = true
  1224. boolean rbutton_filter_use = true
  1225. boolean rbutton_setposition_use = true
  1226. boolean titleclick_sort_use = true
  1227. end type
  1228. event clicked;call super::clicked;if (ins_edit_mode) then return
  1229. if (row > 0) then
  1230. this.SelectRow(0, false)
  1231. this.SelectRow(row, true)
  1232. this.SetRow(row)
  1233. end if
  1234. end event
  1235. event rowfocuschanged;call super::rowfocuschanged;if (ins_edit_mode) then return
  1236. if IsNull(currentrow) then return
  1237. if (currentrow <= 0) then return
  1238. this.SelectRow(0, false)
  1239. this.SelectRow(currentrow, true)
  1240. this.SetRow(currentrow)
  1241. dw_sptprice_change.Reset()
  1242. this.RowsCopy(currentrow, currentrow, Primary!, dw_sptprice_change, 1, Primary!)
  1243. // 修改 删除 审核 撤审
  1244. string arg_msg
  1245. if (this.Object.flag[currentrow] = 1) then // 已审
  1246. cb_edit.Enabled = false
  1247. cb_del.Enabled = false
  1248. cb_audit.Enabled = false
  1249. if (f_find_fx_user_power(45, ref arg_msg) = 1) then // 45-供应商询价单撤审
  1250. cb_caudit.Enabled = true
  1251. end if
  1252. elseif (this.Object.flag[currentrow] = 0) then // 未审
  1253. cb_edit.Enabled = true
  1254. if (f_find_fx_user_power(43, ref arg_msg) = 1) then // 43-供应商询价单删除
  1255. cb_del.Enabled = true
  1256. end if
  1257. if (f_find_fx_user_power(44, ref arg_msg) = 1) then // 44-供应商询价单审核
  1258. cb_audit.Enabled = true
  1259. end if
  1260. cb_caudit.Enabled = false
  1261. end if
  1262. long billid
  1263. billid = this.Object.billid[currentrow]
  1264. wf_retrieve_mx(billid)
  1265. end event
  1266. type cb_mx from uo_imflatbutton within w_spt_price_change_fx
  1267. integer x = 933
  1268. integer width = 274
  1269. integer height = 164
  1270. integer taborder = 20
  1271. boolean bringtotop = true
  1272. string text = "明细功能"
  1273. string normalpicname = "mx.bmp"
  1274. integer picsize = 16
  1275. toolbaralignment pic_align = alignattop!
  1276. boolean border = false
  1277. end type
  1278. event clicked;call super::clicked;//
  1279. if (not ins_edit_mode) then return
  1280. string menuStr = 'Text=增明细~tEvent=ue_addmx' + '|' + 'Text=删明细~tEvent=ue_delmx'
  1281. m_Dfc_Control_PopupMenu dmPopupMenu
  1282. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  1283. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  1284. dmPopupMenu.mf_PopMenu()
  1285. DESTROY dmPopupMenu
  1286. end event
  1287. type p_ljfieb from picture within w_spt_price_change_fx
  1288. integer x = 2126
  1289. integer y = 192
  1290. integer width = 73
  1291. integer height = 64
  1292. boolean bringtotop = true
  1293. string pointer = "HAND.CUR"
  1294. boolean originalsize = true
  1295. string picturename = "graphics\ljfieb.bmp"
  1296. boolean focusrectangle = false
  1297. string powertiptext = "协作"
  1298. end type
  1299. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1300. string menustr
  1301. string arg_msg
  1302. if (f_find_fx_user_power(46, ref arg_msg) = 1) then // 46-供应商询价单发送单据
  1303. menustr="Text=发送单据~tEvent=ue_send_ljfieb"
  1304. end if
  1305. if len(trim(menustr))<>0 then
  1306. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1307. dmPopupMenu.mf_BuildMenu(This, menustr)
  1308. dmPopupMenu.mf_PopMenu()
  1309. Destroy dmPopupMenu
  1310. end if
  1311. end event
  1312. type dw_sptprice_changemx from u_dw_rbtnfilter within w_spt_price_change_fx
  1313. event ue_dwndropdown pbm_dwndropdown
  1314. integer y = 1084
  1315. integer width = 4347
  1316. integer height = 992
  1317. integer taborder = 20
  1318. boolean bringtotop = true
  1319. boolean titlebar = true
  1320. string dataobject = "dw_fx_spt_price_changemx"
  1321. boolean controlmenu = true
  1322. boolean maxbox = true
  1323. boolean hscrollbar = true
  1324. boolean vscrollbar = true
  1325. boolean resizable = true
  1326. boolean border = false
  1327. boolean hsplitscroll = true
  1328. boolean rbutton_filter_use = true
  1329. boolean rbutton_setposition_use = true
  1330. boolean titleclick_sort_use = true
  1331. end type
  1332. event ue_dwndropdown;//
  1333. if (not ins_edit_mode) then return
  1334. long row
  1335. row = this.GetRow()
  1336. if (row <= 0) then return
  1337. string arg_msg
  1338. if (not uo_pz.ins_isReady) then
  1339. uo_pz.uof_get_ready(ref arg_msg)
  1340. if (arg_msg <> '') then
  1341. MessageBox('提示', '获取配置失败:' + arg_msg)
  1342. return
  1343. end if
  1344. end if
  1345. s_fx_pzwin_open s_tran
  1346. s_tran.arg_mtrlid = this.Object.mtrlid[row]
  1347. s_tran.arg_mtrlid_erp = this.Object.mtrlid_erp[row]
  1348. s_tran.arg_statusflag = this.Object.statusflag[row]
  1349. s_tran.arg_statustype = this.Object.statustype[row]
  1350. s_tran.arg_woodcodeflag = this.Object.woodcodeflag[row]
  1351. s_tran.arg_woodcodetype = this.Object.woodcodetype[row]
  1352. s_tran.arg_pcodeflag = this.Object.pcodeflag[row]
  1353. s_tran.arg_pcodetype = this.Object.pcodetype[row]
  1354. s_tran.arg_colname = this.GetColumnName()
  1355. s_tran.arg_x = parent.X + this.X + this.Pointerx()
  1356. s_tran.arg_y = parent.Y + this.Y + this.Pointery()
  1357. string ret
  1358. ret = uo_pz.uof_open_pzwin(s_tran, ref arg_msg)
  1359. if (arg_msg <> '') then
  1360. MessageBox('提示', arg_msg)
  1361. end if
  1362. this.SetItem(row, s_tran.arg_colname, ret)
  1363. end event
  1364. event doubleclicked;call super::doubleclicked;// 双击空白处
  1365. if (not ins_edit_mode) then return
  1366. if (dwo.Type <> 'datawindow') then return
  1367. parent.post event ue_addmx( )
  1368. end event
  1369. event rowfocuschanged;call super::rowfocuschanged;if (currentrow > 0) then
  1370. this.SelectRow(0, false)
  1371. this.SelectRow(currentrow, true)
  1372. this.SetRow(currentrow)
  1373. end if
  1374. end event
  1375. event itemfocuschanged;call super::itemfocuschanged;if (row > 0) then
  1376. this.SelectRow(0, false)
  1377. this.SelectRow(row, true)
  1378. this.SetRow(row)
  1379. string colName
  1380. colName = this.GetColumnName()
  1381. if (colName = 'requiredate') then
  1382. this.SelectText(1, Len(this.GetText()))
  1383. end if
  1384. end if
  1385. end event
  1386. event clicked;call super::clicked;if (row > 0) then
  1387. this.SelectRow(0, false)
  1388. this.SelectRow(row, true)
  1389. this.SetRow(row)
  1390. end if
  1391. end event