w_quote_fx.srw 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754
  1. $PBExportHeader$w_quote_fx.srw
  2. $PBExportComments$供应商协同(主动)销售报价单
  3. forward
  4. global type w_quote_fx from w_publ_base_style
  5. end type
  6. type cb_retrieve from uo_imflatbutton within w_quote_fx
  7. end type
  8. type cb_toppage from uo_imflatbutton within w_quote_fx
  9. end type
  10. type cb_page_ch from uo_imflatbutton within w_quote_fx
  11. end type
  12. type em_pagesize from editmask within w_quote_fx
  13. end type
  14. type cb_1 from uo_imflatbutton within w_quote_fx
  15. end type
  16. type st_3 from statictext within w_quote_fx
  17. end type
  18. type sle_likestr from singlelineedit within w_quote_fx
  19. end type
  20. type dw_main_ff from datawindow within w_quote_fx
  21. end type
  22. type cb_neworsave from uo_imflatbutton within w_quote_fx
  23. end type
  24. type cb_editorundo from uo_imflatbutton within w_quote_fx
  25. end type
  26. type cb_del from uo_imflatbutton within w_quote_fx
  27. end type
  28. type cb_mxfun from uo_imflatbutton within w_quote_fx
  29. end type
  30. type dw_main from u_dw_rbtnfilter within w_quote_fx
  31. end type
  32. type dw_mx from u_dw_rbtnfilter within w_quote_fx
  33. end type
  34. type cb_ljfieb from uo_imflatbutton within w_quote_fx
  35. end type
  36. type tab_1 from tab within w_quote_fx
  37. end type
  38. type tabpage_1 from userobject within tab_1
  39. end type
  40. type dw_quote_his from u_dw_rbtnfilter within tabpage_1
  41. end type
  42. type tabpage_1 from userobject within tab_1
  43. dw_quote_his dw_quote_his
  44. end type
  45. type tab_1 from tab within w_quote_fx
  46. tabpage_1 tabpage_1
  47. end type
  48. type st_split from u_lbs_stsplitbar within w_quote_fx
  49. end type
  50. type st_1 from statictext within w_quote_fx
  51. end type
  52. type ddlb_status from dropdownlistbox within w_quote_fx
  53. end type
  54. end forward
  55. global type w_quote_fx from w_publ_base_style
  56. integer width = 4713
  57. integer height = 2604
  58. string title = "供应商询价单"
  59. boolean maxbox = true
  60. boolean resizable = true
  61. long backcolor = 16777215
  62. string icon = "graphics\chain_link_128px.ico"
  63. event ue_page_next ( )
  64. event ue_page_before ( )
  65. event ue_page_end ( )
  66. event type integer ue_add_mx ( )
  67. event type integer ue_del_mx ( )
  68. event type integer ue_send_ljfieb ( )
  69. event ue_quote_his_fx ( )
  70. cb_retrieve cb_retrieve
  71. cb_toppage cb_toppage
  72. cb_page_ch cb_page_ch
  73. em_pagesize em_pagesize
  74. cb_1 cb_1
  75. st_3 st_3
  76. sle_likestr sle_likestr
  77. dw_main_ff dw_main_ff
  78. cb_neworsave cb_neworsave
  79. cb_editorundo cb_editorundo
  80. cb_del cb_del
  81. cb_mxfun cb_mxfun
  82. dw_main dw_main
  83. dw_mx dw_mx
  84. cb_ljfieb cb_ljfieb
  85. tab_1 tab_1
  86. st_split st_split
  87. st_1 st_1
  88. ddlb_status ddlb_status
  89. end type
  90. global w_quote_fx w_quote_fx
  91. type variables
  92. long ins_cur_pageNum = 1 // 用于记录当前页码
  93. long ins_totalPages = 1 // 用于记录总页数
  94. long ins_flag = 0
  95. //dw_fx_cust_ch
  96. //datastore ins_ds_cust
  97. end variables
  98. forward prototypes
  99. public function integer wf_retrieve_quote ()
  100. public function integer wf_retrieve_quotemx (readonly long a_quoteid)
  101. public subroutine wf_face ()
  102. public subroutine wf_taborder ()
  103. public function integer wf_save_quote ()
  104. public function integer wf_chk (ref string arg_msg)
  105. public function integer wf_retrieve_quote_his (long a_row_mx)
  106. public subroutine wf_init_split ()
  107. end prototypes
  108. event ue_page_next();// 下页
  109. if (ins_cur_pageNum = ins_totalPages) then return
  110. ins_cur_pageNum ++
  111. wf_retrieve_quote()
  112. end event
  113. event ue_page_before();// 上页
  114. if (ins_cur_pageNum = 1) then return
  115. ins_cur_pageNum --
  116. wf_retrieve_quote()
  117. end event
  118. event ue_page_end();// 末页
  119. if (ins_cur_pageNum = ins_totalPages) then return
  120. ins_cur_pageNum = ins_totalPages
  121. wf_retrieve_quote()
  122. end event
  123. event type integer ue_add_mx();int rslt = 1
  124. string arg_msg
  125. if (not if_modify_mode) then return 0
  126. long row
  127. row = dw_main_ff.GetRow()
  128. if (row <= 0) then
  129. rslt = 0
  130. arg_msg = '当前没有编辑的单据'
  131. goto ext
  132. end if
  133. long cuscomid
  134. cuscomid = dw_main_ff.Object.cuscomid[row]
  135. if (cuscomid <= 0) then
  136. rslt = 0
  137. arg_msg ='请双击"客户简称"选择客户'
  138. goto ext
  139. end if
  140. long i, insertRow, findRow
  141. string findStr
  142. s_fx_mtrldef s_tran, s_ret
  143. s_tran.ifrelation = true
  144. s_tran.myreltype = 1 // 我是供应商
  145. s_tran.partner_comid = cuscomid
  146. OpenWithParm(w_mtrl_ch_by_comid_fx, s_tran)
  147. s_ret = Message.PowerObjectParm
  148. if (not IsNull(s_ret)) then
  149. if (IsValid(s_ret)) then
  150. if (s_ret.ifselect) then
  151. dw_mx.SetRedraw(false)
  152. for i = 1 to UpperBound(s_ret.fxmtrlid)
  153. findStr = 'fxmtrlid = ' + string(s_ret.fxmtrlid[i]) + ' and status = "" and woodcode = "" and pcode = "" and qty = 0 and qty1 = 0'
  154. findRow = dw_mx.Find(findStr, 1, dw_mx.RowCount())
  155. if (findRow > 0) then continue
  156. insertRow = dw_mx.InsertRow(0)
  157. dw_mx.Object.ch[insertRow] = 0
  158. dw_mx.Object.quoteid[insertRow] = dw_main_ff.Object.quoteid[row]
  159. dw_mx.Object.printid[insertRow] = 0
  160. dw_mx.Object.fxmtrlid[insertRow] = s_ret.fxmtrlid[i]
  161. dw_mx.Object.mtrlid[insertRow] = s_ret.mtrlid[i]
  162. dw_mx.Object.mtrlcode[insertRow] = s_ret.mtrlcode[i]
  163. dw_mx.Object.mtrlname[insertRow] = s_ret.mtrlname[i]
  164. dw_mx.Object.mtrlmode[insertRow] = s_ret.mtrlmode[i]
  165. // requiredate perfinishdate
  166. dw_mx.Object.sumprice[insertRow] = 0
  167. dw_mx.Object.sumprice_1[insertRow] = 0
  168. dw_mx.Object.rebate[insertRow] = 1
  169. dw_mx.Object.rebuydays[insertRow] = 0
  170. dw_mx.Object.buydays[insertRow] = 0
  171. dw_mx.Object.taxrate[insertRow] = 0
  172. dw_mx.Object.unit[insertRow] = s_ret.unit[i]
  173. dw_mx.Object.status[insertRow] = ''
  174. dw_mx.Object.woodcode[insertRow] = ''
  175. dw_mx.Object.pcode[insertRow] = ''
  176. dw_mx.Object.jgdscrp[insertRow] = ''
  177. // configcodetype
  178. dw_mx.Object.statusflag[insertRow] = s_ret.statusflag[i]
  179. dw_mx.Object.statustype[insertRow] = s_ret.statustype[i]
  180. dw_mx.Object.woodcodeflag[insertRow] = s_ret.woodcodeflag[i]
  181. dw_mx.Object.woodcodetype[insertRow] = s_ret.woodcodetype[i]
  182. dw_mx.Object.pcodeflag[insertRow] = s_ret.pcodeflag[i]
  183. dw_mx.Object.pcodetype[insertRow] = s_ret.pcodetype[i]
  184. dw_mx.Object.qty[insertRow] = 0
  185. dw_mx.Object.qty1[insertRow] = 0
  186. dw_mx.Object.mxdscrp[insertRow] = '' //'[' + s_tran.mtrlsectype[i] + '],[' + s_tran.zxmtrlmode[i] + '],[' + s_tran.usermtrlmode[i] + ']'
  187. dw_mx.Object.mxdscrp2[insertRow] = ''
  188. dw_mx.Object.latestquoteprice[insertRow] = 0
  189. dw_mx.Object.latestquoterebate[insertRow] = 0
  190. dw_mx.Object.latestacceptprice[insertRow] = 0
  191. dw_mx.Object.latestacceptrebate[insertRow] = 0
  192. next
  193. dw_mx.AcceptText()
  194. if (dw_mx.RowCount() > 0) then
  195. dw_mx.SelectRow(0, false)
  196. dw_mx.SelectRow(dw_mx.RowCount(), false)
  197. dw_mx.SetRow(dw_mx.RowCount())
  198. dw_mx.post event rowfocuschanged(dw_mx.RowCount())
  199. end if
  200. dw_mx.SetRedraw(true)
  201. end if
  202. end if
  203. end if
  204. ext:
  205. if (rslt <> 1) then
  206. MessageBox('提示', arg_msg)
  207. end if
  208. return rslt
  209. end event
  210. event type integer ue_del_mx();int rslt = 1
  211. if (not if_modify_mode) then return 0
  212. if (dw_mx.RowCount() <= 0) then return 0
  213. string arg_msg
  214. long findRow, index = 0
  215. long rows[]
  216. findRow = dw_mx.Find('ch = 1', 1, dw_mx.RowCount())
  217. if (findRow > 0) then // 多选删除
  218. do while findRow > 0
  219. index++
  220. rows[index] = findRow
  221. if (findRow >= dw_mx.RowCount()) then exit
  222. findRow = dw_mx.Find('ch = 1', findRow + 1, dw_mx.RowCount())
  223. loop
  224. else // 单选
  225. findRow = dw_mx.GetRow()
  226. if (findRow > 0) then
  227. if (dw_mx.IsSelected(findRow)) then
  228. index++
  229. rows[index] = findRow
  230. end if
  231. end if
  232. end if
  233. if (index <= 0) then
  234. rslt = 0
  235. arg_msg = '请选中/勾选需要删除的明细项'
  236. goto ext
  237. end if
  238. long i
  239. for i = UpperBound(rows) to 1 step - 1
  240. dw_mx.DeleteRow(rows[i])
  241. next
  242. ext:
  243. if (rslt <> 1) then
  244. MessageBox('提示', arg_msg)
  245. end if
  246. return rslt
  247. end event
  248. event type integer ue_send_ljfieb();int rslt = 1
  249. string arg_msg
  250. long row
  251. row = dw_main.GetRow()
  252. if (row <= 0) then
  253. rslt = 0
  254. arg_msg = '请选择单据'
  255. goto ext
  256. end if
  257. if (not dw_main.IsSelected(row)) then
  258. rslt = 0
  259. arg_msg = '请选择单据'
  260. goto ext
  261. end if
  262. long quoteid
  263. quoteid = dw_main.Object.quoteid[row]
  264. oleobject parm, response
  265. parm = FXAppCom.CreatePbDictionary()
  266. parm.SetString('token', app_token_fx)
  267. parm.SetInt('quoteid', quoteid)
  268. response = FXAppCom.DoExecute('SendQuote', parm)
  269. arg_msg = response.GetString('ErrMsg')
  270. if (arg_msg <> '') then
  271. rslt = 0
  272. goto ext
  273. end if
  274. ext:
  275. if (rslt <> 1) then
  276. MessageBox('提示', '操作失败:' + arg_msg)
  277. else
  278. MessageBox('提示', '发送成功!')
  279. wf_retrieve_quote()
  280. // dw_main.Object.responseemp[row] = app_username
  281. // dw_main.Object.responsedate[row] = DateTime(Today(), Now())
  282. // row = dw_main_ff.GetRow()
  283. // if (row > 0) then
  284. // dw_main_ff.Object.responseemp[row] = app_username
  285. // dw_main_ff.Object.responsedate[row] = DateTime(Today(), Now())
  286. // end if
  287. end if
  288. return rslt
  289. //int rslt = 1
  290. //
  291. //string arg_msg
  292. //long row
  293. //row = dw_main.GetRow()
  294. //if (row <= 0) then
  295. // rslt = 0
  296. // arg_msg = '请选择单据'
  297. // goto ext
  298. //end if
  299. //
  300. //if (not dw_main.IsSelected(row)) then
  301. // rslt = 0
  302. // arg_msg = '请选择单据'
  303. // goto ext
  304. //end if
  305. //
  306. //if (dw_main.Object.flag[row] <> 1) then
  307. // rslt = 0
  308. // arg_msg = '当前单据不处于审核状态,不能发送'
  309. // goto ext
  310. //end if
  311. //
  312. //OpenWithParm(w_packet_msg_edit_fx, arg_msg)
  313. //s_open_packet s_ret
  314. //s_ret = Message.PowerObjectParm
  315. //if (s_ret.returnflag = 0) then
  316. // MessageBox('提示', '操作取消')
  317. // return 0
  318. //end if
  319. //
  320. //string postscript
  321. //postscript = s_ret.postscript
  322. //if IsNull(postscript) then
  323. // postscript = ''
  324. //end if
  325. //if (Len(postscript) > 500) then
  326. // rslt = 0
  327. // arg_msg = '留言板信息超长(500),请进行删减'
  328. // goto ext
  329. //end if
  330. //
  331. //long quoteid
  332. //quoteid = dw_main.Object.quoteid[row]
  333. //oleobject parm
  334. //parm = FXAppCom.CreatePbDictionary()
  335. //parm.SetString('token', app_token_fx)
  336. //parm.SetInt('quoteid', quoteid)
  337. //parm.SetString('postscript', postscript)
  338. //FXAppCom.SendSaleQuote(parm, ref arg_msg)
  339. //if (arg_msg <> '') then
  340. // rslt = 0
  341. // goto ext
  342. //end if
  343. //
  344. //ext:
  345. //if (rslt <> 1) then
  346. // MessageBox('提示', '操作失败:' + arg_msg)
  347. //else
  348. // MessageBox('提示', '成功添加至发送队列')
  349. // dw_main.Object.sendemp[row] = app_username
  350. // dw_main.Object.senddate[row] = DateTime(Today(), Now())
  351. // row = dw_main_ff.GetRow()
  352. // if (row > 0) then
  353. // dw_main_ff.Object.sendemp[row] = app_username
  354. // dw_main_ff.Object.senddate[row] = DateTime(Today(), Now())
  355. // end if
  356. //end if
  357. //
  358. //return rslt
  359. //
  360. //
  361. end event
  362. event ue_quote_his_fx();Open(w_quote_his_fx)
  363. end event
  364. public function integer wf_retrieve_quote ();int rslt = 1
  365. if (if_modify_mode) then return 0
  366. long oriRow
  367. oriRow = dw_main.GetRow()
  368. string arg_msg
  369. long pageSize
  370. pageSize = long(em_pagesize.Text)
  371. if (pageSize <= 0) then
  372. rslt = 0
  373. arg_msg = '每页显示行数必须大于0'
  374. em_pagesize.SetFocus( )
  375. em_pagesize.SelectText(1, Len(em_pagesize.Text))
  376. goto ext
  377. end if
  378. long pageNum
  379. pageNum = ins_cur_pageNum
  380. //datetime dateA, dateZ
  381. //dateA = DateTime(Date(em_dateA.Text), Time(0))
  382. //dateZ = DateTime(Date(em_dateZ.Text), Time('23:59:59'))
  383. string likeStr
  384. likeStr = Trim(sle_likestr.Text)
  385. oleobject obj, parm, list, item
  386. parm = FxAppCom.CreatePbDictionary()
  387. parm.SetString('token', app_token_fx)
  388. parm.SetInt('pageSize', pageSize)
  389. parm.SetInt('pageNum', pageNum)
  390. IF ins_flag <> -1 THEN
  391. parm.SetInt('flag', ins_flag)
  392. END IF
  393. //parm.SetDateTime('dateA', dateA)
  394. //parm.SetDateTime('dateZ', dateZ)
  395. parm.SetString('likeStr', likeStr)
  396. obj = FXAppCom.DoExecute('GetQuote', parm)
  397. arg_msg = obj.GetString('ErrMsg')
  398. if (arg_msg <> '') then
  399. rslt = 0
  400. goto ext
  401. end if
  402. dw_main.Reset()
  403. dw_main_ff.Reset()
  404. dw_mx.Reset()
  405. dw_main.SetRedraw(false)
  406. long i, row
  407. list = obj.GetPBArray('list')
  408. for i = 1 to list.Count
  409. item = list.GetPBDictionary(i - 1)
  410. row = dw_main.InsertRow(0)
  411. dw_main.Object.quoteid[row] = item.GetInt("quoteid")
  412. dw_main.Object.quotecode[row] = item.GetString("quotecode")
  413. dw_main.Object.billcode_cus[row] = item.GetString("billcode_cus")
  414. dw_main.Object.sptcomid[row] = item.GetInt("sptcomid")
  415. dw_main.Object.cuscomid[row] = item.GetInt("cuscomid")
  416. dw_main.Object.moneyname[row] = item.GetString("moneyname")
  417. dw_main.Object.flag[row] = item.GetInt("flag")
  418. dw_main.Object.billtype[row] = item.GetInt("billtype")
  419. dw_main.Object.simplename[row] = item.GetString("simplename")
  420. dw_main.Object.comname[row] = item.GetString("comname")
  421. dw_main.Object.assign_emp[row] = item.GetString("assign_emp")
  422. dw_main.Object.dscrp[row] = item.GetString("dscrp")
  423. dw_main.Object.sendemp[row] = item.GetString("sendemp")
  424. if (not IsNull(item.GetDateTime("senddate"))) then
  425. dw_main.Object.senddate[row] = item.GetDateTime("senddate")
  426. end if
  427. if (not IsNull(item.GetDateTime("requiredate"))) then
  428. dw_main.Object.requiredate[row] = item.GetDateTime("requiredate")
  429. end if
  430. dw_main.Object.modemp[row] = item.GetString("modemp")
  431. if (not IsNull(item.GetDateTime("moddate"))) then
  432. dw_main.Object.moddate[row] = item.GetDateTime("moddate")
  433. end if
  434. dw_main.Object.responseemp[row] = item.GetString("responseemp")
  435. if (not IsNull(item.GetDateTime("responsedate"))) then
  436. dw_main.Object.responsedate[row] = item.GetDateTime("responsedate")
  437. end if
  438. next
  439. dw_main.SetRedraw(true)
  440. if (not IsNull(obj.GetInt('totalPages'))) then
  441. if (obj.GetInt('totalPages') > 0) then
  442. ins_totalPages = obj.GetInt('totalPages')
  443. else
  444. ins_totalPages = 1
  445. end if
  446. else
  447. ins_totalPages = 1
  448. end if
  449. ext:
  450. if (rslt = 1) then
  451. if (dw_main.RowCount() > 0) then
  452. dw_main.SelectRow(0, false)
  453. if (oriRow > 0 and oriRow <= dw_main.RowCount()) then
  454. dw_main.SelectRow(oriRow, true)
  455. dw_main.SetRow(oriRow)
  456. dw_main.post event RowFocusChanged(oriRow)
  457. else
  458. dw_main.SelectRow(1, true)
  459. dw_main.SetRow(1)
  460. dw_main.post event RowFocusChanged(1)
  461. end if
  462. end if
  463. else
  464. MessageBox('提示', arg_msg)
  465. end if
  466. return rslt
  467. end function
  468. public function integer wf_retrieve_quotemx (readonly long a_quoteid);int rslt = 1
  469. if (IsNull(a_quoteid)) then return 0
  470. if (a_quoteid <= 0) then return 0
  471. string arg_msg = ''
  472. oleobject obj, parm, list, item
  473. parm = FxAppCom.CreatePbDictionary()
  474. parm.SetString('token', app_token_fx)
  475. parm.SetString('quoteid', a_quoteid)
  476. obj = FXAppCom.DoExecute('GetQuoteMx', parm)
  477. arg_msg = obj.GetString('ErrMsg')
  478. if (arg_msg <> '') then
  479. rslt = 0
  480. goto ext
  481. end if
  482. dw_mx.Reset()
  483. dw_mx.SetRedraw(false)
  484. long i, row
  485. list = obj.GetPBArray('list')
  486. for i = 1 to list.Count
  487. item = list.GetPBDictionary(i - 1)
  488. row = dw_mx.InsertRow(0)
  489. dw_mx.Object.quoteid[row] = item.GetInt("quoteid")
  490. dw_mx.Object.printid[row] = item.GetInt("printid")
  491. dw_mx.Object.fxmtrlid[row] = item.GetInt("fxmtrlid")
  492. dw_mx.Object.sumprice[row] = item.GetDouble("sumprice")
  493. dw_mx.Object.rebate[row] = item.GetDouble("rebate")
  494. dw_mx.Object.status[row] = item.GetString("status")
  495. dw_mx.Object.woodcode[row] = item.GetString("woodcode")
  496. dw_mx.Object.pcode[row] = item.GetString("pcode")
  497. dw_mx.Object.qty[row] = item.GetDouble("qty")
  498. dw_mx.Object.qty1[row] = item.GetDouble("qty1")
  499. dw_mx.Object.unit[row] = item.GetString("unit")
  500. dw_mx.Object.mxdscrp[row] = item.GetString("mxdscrp")
  501. if (not IsNull(item.GetDateTime("effdate"))) then
  502. dw_mx.Object.effdate[row] = item.GetDateTime("effdate")
  503. end if
  504. if (not IsNull(item.GetDateTime("effdate_end"))) then
  505. dw_mx.Object.effdate_end[row] = item.GetDateTime("effdate_end")
  506. end if
  507. dw_mx.Object.mtrlid[row] = item.GetInt("mtrlid")
  508. dw_mx.Object.mtrlcode[row] = item.GetString("mtrlcode")
  509. dw_mx.Object.mtrlname[row] = item.GetString("mtrlname")
  510. dw_mx.Object.mtrlmode[row] = item.GetString("mtrlmode")
  511. next
  512. //if (f_find_fx_user_power(11, ref arg_msg) <> 1) then // 11-供应商询价单查看(单价)
  513. // dw_mx.Modify('destroy sumprice_1_t ~r~n destroy sumprice_1 ~r~n')
  514. // dw_mx.Modify('destroy sumprice_t ~r~n destroy sumprice ~r~n')
  515. // dw_mx.Modify('destroy rebate_t ~r~n destroy rebate ~r~n')
  516. // dw_mx.Modify('destroy compute_3_t ~r~n destroy compute_3 ~r~n')
  517. // dw_mx.Modify('destroy taxrate_t ~r~n destroy taxrate ~r~n')
  518. // dw_mx.Modify('destroy latestquoteprice_t ~r~n destroy latestquoteprice ~r~n')
  519. // dw_mx.Modify('destroy latestquoterebate_t ~r~n destroy latestquoterebate ~r~n')
  520. // dw_mx.Modify('destroy compute_4_t ~r~n destroy compute_4 ~r~n')
  521. // dw_mx.Modify('destroy latestacceptprice_t ~r~n destroy latestacceptprice ~r~n')
  522. // dw_mx.Modify('destroy latestacceptrebate_t ~r~n destroy latestacceptrebate ~r~n')
  523. // dw_mx.Modify('destroy compute_5_t ~r~n destroy compute_5 ~r~n')
  524. //end if
  525. dw_mx.AcceptText()
  526. dw_mx.SetRedraw(true)
  527. if (dw_mx.RowCount() > 0) then
  528. dw_mx.post event rowfocuschanged(1)
  529. ELSE
  530. wf_retrieve_quote_his(0)
  531. end if
  532. ext:
  533. if (rslt <> 1) then
  534. MessageBox('提示', arg_msg)
  535. end if
  536. return rslt
  537. end function
  538. public subroutine wf_face ();string arg_msg
  539. long row, billtype
  540. boolean ifProtectOriData
  541. row = dw_main.GetRow()
  542. if (row > 0) then
  543. billtype = dw_main.Object.billtype[row]
  544. end if
  545. if (row > 0 and billtype = 0) then // 被动报价单-保护原始数据
  546. ifProtectOriData = true
  547. else
  548. ifProtectOriData = false
  549. end if
  550. if (if_modify_mode) then
  551. cb_retrieve.Enabled = false
  552. cb_neworsave.Enabled = true
  553. // cb_neworsave.Text = '保存'
  554. // cb_neworsave.normalpicname = 'Save.bmp'
  555. cb_editorundo.Text = '放弃'
  556. cb_editorundo.normalpicname = 'Undo.bmp'
  557. // cb_del.Enabled = false
  558. // cb_audit.Enabled = false
  559. cb_exit.Enabled = false
  560. em_pagesize.Enabled = false
  561. cb_toppage.Enabled = false
  562. cb_page_ch.Enabled = false
  563. // em_datea.Enabled = false
  564. // em_datez.Enabled = false
  565. sle_likestr.Enabled = false
  566. if (not ifProtectOriData) then
  567. cb_mxfun.Enabled = true
  568. end if
  569. cb_ljfieb.Enabled = false
  570. else
  571. cb_retrieve.Enabled = true
  572. cb_neworsave.Enabled = false
  573. // cb_neworsave.Text = '新建'
  574. // cb_neworsave.normalpicname = 'new.bmp'
  575. cb_editorundo.Text = '修改'
  576. cb_editorundo.normalpicname = 'open.bmp'
  577. // if (f_find_fx_user_power(16, ref arg_msg) = 1) then // 16-销售报价单删除
  578. // cb_del.Enabled = true
  579. // end if
  580. // if (f_find_fx_user_power(17, ref arg_msg) = 1) then // 17-销售报价单审核
  581. // cb_audit.Enabled = true
  582. // end if
  583. cb_exit.Enabled = true
  584. em_pagesize.Enabled = true
  585. cb_toppage.Enabled = true
  586. cb_page_ch.Enabled = true
  587. // em_datea.Enabled = true
  588. // em_datez.Enabled = true
  589. sle_likestr.Enabled = true
  590. cb_mxfun.Enabled = false
  591. // if (f_find_fx_user_power(18, ref arg_msg) = 1) then // 18-销售报价单发送
  592. cb_ljfieb.Enabled = true
  593. // end if
  594. end if
  595. cb_neworsave.of_init_draw()
  596. cb_neworsave.of_paint()
  597. cb_neworsave.TriggerEvent('ue_textchange')
  598. cb_editorundo.of_init_draw()
  599. cb_editorundo.of_paint()
  600. cb_editorundo.TriggerEvent('ue_textchange')
  601. end subroutine
  602. public subroutine wf_taborder ();long i = 0
  603. if (if_modify_mode) then
  604. i += 10
  605. dw_mx.SetTabOrder('ch', i)
  606. i += 10
  607. dw_mx.SetTabOrder('sumprice', i)
  608. i += 10
  609. dw_mx.SetTabOrder('rebate', i)
  610. i += 10
  611. dw_mx.SetTabOrder('qty', i)
  612. i += 10
  613. dw_mx.SetTabOrder('qty1', i)
  614. i += 10
  615. dw_mx.SetTabOrder('effdate', i)
  616. i += 10
  617. dw_mx.SetTabOrder('effdate_end', i)
  618. i += 10
  619. dw_mx.SetTabOrder('mxdscrp', i)
  620. else
  621. dw_mx.SetTabOrder('ch', 0)
  622. dw_mx.SetTabOrder('sumprice', 0)
  623. dw_mx.SetTabOrder('rebate', 0)
  624. dw_mx.SetTabOrder('qty', 0)
  625. dw_mx.SetTabOrder('qty1', 0)
  626. dw_mx.SetTabOrder('effdate', 0)
  627. dw_mx.SetTabOrder('effdate_end', 0)
  628. dw_mx.SetTabOrder('mxdscrp', 0)
  629. end if
  630. end subroutine
  631. public function integer wf_save_quote ();int rslt = 1
  632. string arg_msg
  633. if (wf_chk(ref arg_msg) <> 1) then
  634. rslt = 0
  635. goto ext
  636. end if
  637. oleobject parm, main, mx, item, response
  638. parm = FXAppCom.CreatePbDictionary()
  639. main = FXAppCom.CreatePbDictionary()
  640. mx = FXAppCom.NewPBArray()
  641. dw_main_ff.AcceptText()
  642. long row
  643. row = dw_main_ff.GetRow()
  644. main.SetInt('quoteid', dw_main_ff.Object.quoteid[row])
  645. //main.SetInt('cuscomid', dw_main_ff.Object.cuscomid[row])
  646. //main.SetInt('sptcomid', dw_main_ff.Object.sptcomid[row])
  647. //main.SetString('assign_emp', dw_main_ff.Object.assign_emp[row])
  648. //main.SetString('relcode', dw_main_ff.Object.relcode[row])
  649. //main.SetString('dscrp', dw_main_ff.Object.dscrp[row])
  650. long i
  651. for i = 1 to dw_mx.RowCount()
  652. item = FXAppCom.CreatePbDictionary()
  653. item.SetInt('printid', dw_mx.Object.printid[i])
  654. item.SetDouble('sumprice', dw_mx.Object.sumprice[i])
  655. item.SetDouble('rebate', dw_mx.Object.rebate[i])
  656. item.SetDouble('qty', dw_mx.Object.qty[i])
  657. item.SetDouble('qty1', dw_mx.Object.qty1[i])
  658. item.SetDateTime('effdate', dw_mx.Object.effdate[i])
  659. item.SetDateTime('effdate_end', dw_mx.Object.effdate_end[i])
  660. item.SetString('mxdscrp', dw_mx.Object.mxdscrp[i])
  661. // item.SetInt('fxmtrlid', dw_mx.Object.fxmtrlid[i])
  662. //
  663. // item.SetDouble('sumprice', dw_mx.Object.sumprice[i])
  664. // item.SetDouble('rebate', dw_mx.Object.rebate[i])
  665. // item.SetDouble('sumprice_1', dw_mx.Object.sumprice_1[i])
  666. // item.SetDouble('qty', dw_mx.Object.qty[i])
  667. // item.SetDouble('qty1', dw_mx.Object.qty1[i])
  668. // item.SetDouble('rebuydays', dw_mx.Object.rebuydays[i])
  669. // item.SetDouble('buydays', dw_mx.Object.buydays[i])
  670. // item.SetDouble('taxrate', dw_mx.Object.taxrate[i])
  671. //
  672. // item.SetString('unit', dw_mx.Object.unit[i])
  673. // item.SetString('status', dw_mx.Object.status[i])
  674. // item.SetString('woodcode', dw_mx.Object.woodcode[i])
  675. // item.SetString('pcode', dw_mx.Object.pcode[i])
  676. // item.SetString('jgdscrp', dw_mx.Object.jgdscrp[i])
  677. // item.SetString('mxdscrp', dw_mx.Object.mxdscrp[i])
  678. // item.SetString('mxdscrp2', dw_mx.Object.mxdscrp2[i])
  679. //
  680. // item.SetDateTime('requiredate', dw_mx.Object.requiredate[i])
  681. // item.SetDateTime('perfinishdate', dw_mx.Object.perfinishdate[i])
  682. mx.AddObject(item)
  683. next
  684. main.SetObject('mxList', mx)
  685. parm.SetString('token', app_token_fx)
  686. parm.SetObject('quote', main)
  687. //parm.SetObject('mx', mx)
  688. //FXAppCom.AddQuote(parm, ref arg_msg)
  689. response = FXAppCom.DoExecute('SaveQuote', parm)
  690. arg_msg = response.GetString('ErrMsg')
  691. if (arg_msg <> '') then
  692. rslt = 0
  693. goto ext
  694. end if
  695. ext:
  696. if (rslt <> 1) then
  697. MessageBox('提示', '操作失败:' + arg_msg)
  698. else
  699. MessageBox('提示', '操作成功')
  700. end if
  701. return rslt
  702. end function
  703. public function integer wf_chk (ref string arg_msg);int rslt = 1
  704. long row
  705. row = dw_main_ff.GetRow()
  706. if (row <= 0) then
  707. rslt = 0
  708. arg_msg = '获取当前编辑的单据失败'
  709. goto ext
  710. end if
  711. long cuscomid
  712. cuscomid = dw_main_ff.Object.cuscomid[row]
  713. if (cuscomid <= 0) then
  714. rslt = 0
  715. arg_msg = '请双击"客户简称"选择客户'
  716. goto ext
  717. end if
  718. string assign_emp
  719. assign_emp = dw_main_ff.Object.assign_emp[row]
  720. if (Trim(assign_emp) = '') then
  721. rslt = 0
  722. arg_msg = '请填写经手人'
  723. goto ext
  724. end if
  725. dw_mx.SetFilter('')
  726. dw_mx.Filter()
  727. dw_mx.AcceptText()
  728. if (dw_mx.RowCount() <= 0) then
  729. rslt = 0
  730. arg_msg = '当前单据没有明细内容'
  731. goto ext
  732. end if
  733. // 检查重复
  734. long i, findRow
  735. string findStr, msg
  736. for i = 1 to dw_mx.RowCount() - 1
  737. findStr = 'fxmtrlid = ' + string(dw_mx.Object.fxmtrlid[i]) &
  738. + ' and status = "' + dw_mx.Object.status[i] + '" and woodcode = "' + dw_mx.Object.woodcode[i] + '" and pcode = "' + dw_mx.Object.pcode[i] &
  739. + '" and qty = ' + string(dw_mx.Object.qty[i]) + ' and qty1 = ' + string(dw_mx.Object.qty1[i])
  740. findRow = dw_mx.Find(findStr, i + 1, dw_mx.RowCount())
  741. if (findRow > 0) then
  742. rslt = 0
  743. msg += '第' + string(i) + '行物料发现与第' + string(findRow) + '行重复(配置、数量)~r~n'
  744. end if
  745. next
  746. if (rslt <> 1) then
  747. arg_msg = '~r~n' + msg
  748. goto ext
  749. end if
  750. ext:
  751. return rslt
  752. end function
  753. public function integer wf_retrieve_quote_his (long a_row_mx);int rslt = 1
  754. tab_1.tabpage_1.dw_quote_his.Reset()
  755. string arg_msg
  756. //if (f_find_fx_user_power(19, ref arg_msg) <> 1) then // 19-最新报价统计表
  757. // return 0
  758. //end if
  759. if (dw_mx.GetRow() <= 0) then return 0
  760. if (IsNull(a_row_mx)) then return 0
  761. if (a_row_mx <= 0) then return 0
  762. long a_row_main, ll_cuscomid
  763. a_row_main = dw_main_ff.GetRow()
  764. if (a_row_main <= 0) then return 0
  765. ll_cuscomid = dw_main_ff.Object.cuscomid[a_row_main]
  766. if (IsNull(ll_cuscomid)) then return 0
  767. if (ll_cuscomid <= 0) then return 0
  768. long ll_fxmtrlid
  769. ll_fxmtrlid = dw_mx.Object.fxmtrlid[a_row_mx]
  770. if (IsNull(ll_fxmtrlid)) then return 0
  771. if (ll_fxmtrlid <= 0) then return 0
  772. oleobject parm, obj, list, item
  773. parm = FXAppCom.CreatePbDictionary()
  774. parm.SetString('token', app_token_fx)
  775. parm.SetInt('fxmtrlid', ll_fxmtrlid)
  776. parm.SetInt('cuscomid', ll_cuscomid)
  777. obj = FXAppCom.DoExecute('GetMtrlQuoteHistory', parm)
  778. arg_msg = obj.GetString('ErrMsg')
  779. if (arg_msg <> '') then
  780. rslt = 0
  781. goto ext
  782. end if
  783. long i, row
  784. tab_1.tabpage_1.dw_quote_his.SetRedraw(false)
  785. list = obj.GetPBArray('list')
  786. for i = 1 to list.Count
  787. item = list.GetPBDictionary(i - 1)
  788. row = tab_1.tabpage_1.dw_quote_his.InsertRow(0)
  789. tab_1.tabpage_1.dw_quote_his.Object.quoteid[row] = item.GetInt("quoteid")
  790. tab_1.tabpage_1.dw_quote_his.Object.quotecode[row] = item.GetString("quotecode")
  791. tab_1.tabpage_1.dw_quote_his.Object.billcode_cus[row] = item.GetString("billcode_cus")
  792. tab_1.tabpage_1.dw_quote_his.Object.sptcomid[row] = item.GetInt("sptcomid")
  793. tab_1.tabpage_1.dw_quote_his.Object.cuscomid[row] = item.GetInt("cuscomid")
  794. tab_1.tabpage_1.dw_quote_his.Object.moneyname[row] = item.GetString("moneyname")
  795. tab_1.tabpage_1.dw_quote_his.Object.flag[row] = item.GetInt("flag")
  796. tab_1.tabpage_1.dw_quote_his.Object.billtype[row] = item.GetInt("billtype")
  797. if (not IsNull(item.GetDateTime("responsedate"))) then
  798. tab_1.tabpage_1.dw_quote_his.Object.responsedate[row] = item.GetDateTime("responsedate")
  799. end if
  800. tab_1.tabpage_1.dw_quote_his.Object.sumprice[row] = item.GetDouble("sumprice")
  801. tab_1.tabpage_1.dw_quote_his.Object.rebate[row] = item.GetDouble("rebate")
  802. tab_1.tabpage_1.dw_quote_his.Object.qty[row] = item.GetDouble("qty")
  803. tab_1.tabpage_1.dw_quote_his.Object.qty1[row] = item.GetDouble("qty1")
  804. tab_1.tabpage_1.dw_quote_his.Object.unit[row] = item.GetString("unit")
  805. tab_1.tabpage_1.dw_quote_his.Object.status[row] = item.GetString("status")
  806. tab_1.tabpage_1.dw_quote_his.Object.woodcode[row] = item.GetString("woodcode")
  807. tab_1.tabpage_1.dw_quote_his.Object.pcode[row] = item.GetString("pcode")
  808. tab_1.tabpage_1.dw_quote_his.Object.printid[row] = item.GetInt("printid")
  809. tab_1.tabpage_1.dw_quote_his.Object.fxmtrlid[row] = item.GetInt("fxmtrlid")
  810. next
  811. tab_1.tabpage_1.dw_quote_his.AcceptText()
  812. tab_1.tabpage_1.dw_quote_his.SetSort('opdate desc')
  813. tab_1.tabpage_1.dw_quote_his.Sort()
  814. tab_1.tabpage_1.dw_quote_his.SetRedraw(true)
  815. ext:
  816. return rslt
  817. end function
  818. public subroutine wf_init_split ();// 将所有该分割条的上下的object都进行注册
  819. st_split.of_Reset()
  820. st_split.of_Register(dw_mx, st_split.LEFT) // LEFT/RIGHT
  821. st_split.of_Register(tab_1, st_split.RIGHT)
  822. // 定位拖动条--以tv_1为位移基准
  823. st_split.uf_possplitbar(dw_mx)
  824. end subroutine
  825. on w_quote_fx.create
  826. int iCurrent
  827. call super::create
  828. this.cb_retrieve=create cb_retrieve
  829. this.cb_toppage=create cb_toppage
  830. this.cb_page_ch=create cb_page_ch
  831. this.em_pagesize=create em_pagesize
  832. this.cb_1=create cb_1
  833. this.st_3=create st_3
  834. this.sle_likestr=create sle_likestr
  835. this.dw_main_ff=create dw_main_ff
  836. this.cb_neworsave=create cb_neworsave
  837. this.cb_editorundo=create cb_editorundo
  838. this.cb_del=create cb_del
  839. this.cb_mxfun=create cb_mxfun
  840. this.dw_main=create dw_main
  841. this.dw_mx=create dw_mx
  842. this.cb_ljfieb=create cb_ljfieb
  843. this.tab_1=create tab_1
  844. this.st_split=create st_split
  845. this.st_1=create st_1
  846. this.ddlb_status=create ddlb_status
  847. iCurrent=UpperBound(this.Control)
  848. this.Control[iCurrent+1]=this.cb_retrieve
  849. this.Control[iCurrent+2]=this.cb_toppage
  850. this.Control[iCurrent+3]=this.cb_page_ch
  851. this.Control[iCurrent+4]=this.em_pagesize
  852. this.Control[iCurrent+5]=this.cb_1
  853. this.Control[iCurrent+6]=this.st_3
  854. this.Control[iCurrent+7]=this.sle_likestr
  855. this.Control[iCurrent+8]=this.dw_main_ff
  856. this.Control[iCurrent+9]=this.cb_neworsave
  857. this.Control[iCurrent+10]=this.cb_editorundo
  858. this.Control[iCurrent+11]=this.cb_del
  859. this.Control[iCurrent+12]=this.cb_mxfun
  860. this.Control[iCurrent+13]=this.dw_main
  861. this.Control[iCurrent+14]=this.dw_mx
  862. this.Control[iCurrent+15]=this.cb_ljfieb
  863. this.Control[iCurrent+16]=this.tab_1
  864. this.Control[iCurrent+17]=this.st_split
  865. this.Control[iCurrent+18]=this.st_1
  866. this.Control[iCurrent+19]=this.ddlb_status
  867. end on
  868. on w_quote_fx.destroy
  869. call super::destroy
  870. destroy(this.cb_retrieve)
  871. destroy(this.cb_toppage)
  872. destroy(this.cb_page_ch)
  873. destroy(this.em_pagesize)
  874. destroy(this.cb_1)
  875. destroy(this.st_3)
  876. destroy(this.sle_likestr)
  877. destroy(this.dw_main_ff)
  878. destroy(this.cb_neworsave)
  879. destroy(this.cb_editorundo)
  880. destroy(this.cb_del)
  881. destroy(this.cb_mxfun)
  882. destroy(this.dw_main)
  883. destroy(this.dw_mx)
  884. destroy(this.cb_ljfieb)
  885. destroy(this.tab_1)
  886. destroy(this.st_split)
  887. destroy(this.st_1)
  888. destroy(this.ddlb_status)
  889. end on
  890. event open;call super::open;//ins_ds_cust = create datastore
  891. //ins_ds_cust.DataObject = 'dw_fx_cust_ch'
  892. //
  893. //uo_pz = create uo_fx_pz
  894. //uo_pz.init()
  895. //string arg_msg // 10-供应商询价单 11-供应商询价单查看(单价)
  896. //if (f_find_fx_user_power(10, ref arg_msg) <> 1 &
  897. // and f_find_fx_user_power(11, ref arg_msg) <> 1) then
  898. // MessageBox('权限提示', arg_msg)
  899. // Close(this)
  900. // return
  901. //end if
  902. //em_datea.Text = String(RelativeDate(Today(), - 30))
  903. //em_datez.Text = String(Today())
  904. wf_face()
  905. wf_taborder()
  906. wf_retrieve_quote()
  907. wf_init_split()
  908. end event
  909. event close;call super::close;//destroy ins_ds_cust
  910. //destroy uo_pz
  911. end event
  912. event resize;call super::resize;if (this.Width < 4100) then this.Width = 4100
  913. if (this.Height < 2500) then this.Height = 2500
  914. dw_main.Width = this.workspacewidth( ) - dw_main.X
  915. // 下
  916. dw_mx.Height = this.workspaceheight( ) - dw_mx.Y
  917. if (dw_mx.Width + 200 >= this.workspacewidth( )) then
  918. dw_mx.Width = this.workspacewidth( ) / 4 * 3
  919. end if
  920. st_split.X = dw_mx.X + dw_mx.Width
  921. st_split.Height = dw_mx.Height
  922. tab_1.X = st_split.X + st_split.Width
  923. tab_1.Width = this.workspacewidth( ) - st_split.X - st_split.Width
  924. tab_1.Height = dw_mx.Height
  925. tab_1.tabpage_1.dw_quote_his.Width = tab_1.Width - 20
  926. tab_1.tabpage_1.dw_quote_his.Height = tab_1.Height - 110
  927. // 按钮靠右
  928. cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  929. cb_page_ch.X = cb_exit.X - cb_page_ch.Width - 5
  930. cb_toppage.X = cb_page_ch.X - cb_toppage.Width - 5
  931. em_pagesize.X = cb_toppage.X - em_pagesize.Width - 5
  932. end event
  933. type cb_func from w_publ_base_style`cb_func within w_quote_fx
  934. boolean visible = false
  935. integer x = 777
  936. string normalpicname = "setting.BMP"
  937. integer picsize = 16
  938. end type
  939. event cb_func::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  940. string menustr
  941. string arg_msg
  942. if (f_find_fx_user_power(19, ref arg_msg) = 1) then // 19-最新报价统计表
  943. menustr = 'Text=最新报价统计表~tEvent=ue_quote_his_fx'
  944. end if
  945. //menustr += '|' + 'Text=修改~tEvent=ue_del_boundtype'
  946. if len(trim(menustr))<>0 then
  947. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  948. dmPopupMenu.mf_BuildMenu(This, menustr)
  949. dmPopupMenu.mf_PopMenu()
  950. Destroy dmPopupMenu
  951. end if
  952. end event
  953. type cb_exit from w_publ_base_style`cb_exit within w_quote_fx
  954. integer x = 4229
  955. end type
  956. type ln_bar from w_publ_base_style`ln_bar within w_quote_fx
  957. end type
  958. type ln_bar2 from w_publ_base_style`ln_bar2 within w_quote_fx
  959. end type
  960. type r_bar from w_publ_base_style`r_bar within w_quote_fx
  961. end type
  962. type cb_retrieve from uo_imflatbutton within w_quote_fx
  963. integer width = 151
  964. integer height = 164
  965. integer taborder = 20
  966. boolean bringtotop = true
  967. string text = "刷新"
  968. string normalpicname = "refresh.bmp"
  969. integer picsize = 16
  970. toolbaralignment pic_align = alignattop!
  971. boolean border = false
  972. end type
  973. event clicked;call super::clicked;wf_retrieve_quote()
  974. end event
  975. type cb_toppage from uo_imflatbutton within w_quote_fx
  976. integer x = 3986
  977. integer width = 151
  978. integer height = 164
  979. integer taborder = 30
  980. boolean bringtotop = true
  981. string text = "首页"
  982. boolean border = false
  983. end type
  984. event clicked;call super::clicked;ins_cur_pageNum = 1
  985. wf_retrieve_quote()
  986. end event
  987. type cb_page_ch from uo_imflatbutton within w_quote_fx
  988. integer x = 4146
  989. integer width = 82
  990. integer height = 164
  991. integer taborder = 40
  992. boolean bringtotop = true
  993. string text = "▼"
  994. boolean border = false
  995. end type
  996. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  997. string menustr
  998. menustr="Text=下页~tEvent=ue_page_next"
  999. menustr = menustr + "|" + "Text=上页~tEvent=ue_page_before"
  1000. menustr = menustr + "|" + "Text=末页~tEvent=ue_page_end"
  1001. if len(trim(menustr))<>0 then
  1002. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1003. dmPopupMenu.mf_BuildMenu(This, menustr)
  1004. dmPopupMenu.mf_PopMenu()
  1005. Destroy dmPopupMenu
  1006. end if
  1007. end event
  1008. type em_pagesize from editmask within w_quote_fx
  1009. integer x = 3680
  1010. integer y = 44
  1011. integer width = 306
  1012. integer height = 84
  1013. integer taborder = 30
  1014. boolean bringtotop = true
  1015. integer textsize = -9
  1016. integer weight = 400
  1017. fontcharset fontcharset = gb2312charset!
  1018. fontpitch fontpitch = variable!
  1019. string facename = "宋体"
  1020. long textcolor = 33554432
  1021. string text = "100"
  1022. alignment alignment = center!
  1023. borderstyle borderstyle = stylelowered!
  1024. string mask = "#####"
  1025. boolean spin = true
  1026. double increment = 1
  1027. string minmax = "1~~"
  1028. end type
  1029. type cb_1 from uo_imflatbutton within w_quote_fx
  1030. boolean visible = false
  1031. integer x = 2496
  1032. integer width = 151
  1033. integer height = 164
  1034. integer taborder = 20
  1035. boolean bringtotop = true
  1036. boolean enabled = false
  1037. string text = "打印"
  1038. end type
  1039. type st_3 from statictext within w_quote_fx
  1040. integer x = 745
  1041. integer y = 200
  1042. integer width = 178
  1043. integer height = 60
  1044. boolean bringtotop = true
  1045. integer textsize = -9
  1046. integer weight = 400
  1047. fontcharset fontcharset = gb2312charset!
  1048. fontpitch fontpitch = variable!
  1049. string facename = "宋体"
  1050. long textcolor = 33554432
  1051. long backcolor = 16777215
  1052. string text = "单号含"
  1053. boolean focusrectangle = false
  1054. end type
  1055. type sle_likestr from singlelineedit within w_quote_fx
  1056. integer x = 923
  1057. integer y = 184
  1058. integer width = 503
  1059. integer height = 84
  1060. integer taborder = 60
  1061. boolean bringtotop = true
  1062. integer textsize = -9
  1063. integer weight = 400
  1064. fontcharset fontcharset = gb2312charset!
  1065. fontpitch fontpitch = variable!
  1066. string facename = "宋体"
  1067. long textcolor = 33554432
  1068. borderstyle borderstyle = stylelowered!
  1069. end type
  1070. type dw_main_ff from datawindow within w_quote_fx
  1071. integer y = 284
  1072. integer width = 1970
  1073. integer height = 988
  1074. integer taborder = 50
  1075. boolean bringtotop = true
  1076. string title = "none"
  1077. string dataobject = "dw_fx_quote_ff"
  1078. boolean livescroll = true
  1079. borderstyle borderstyle = stylelowered!
  1080. end type
  1081. event doubleclicked;if (not if_modify_mode) then return
  1082. if (row <= 0) then return
  1083. //if ((dwo.Type = 'column' and (dwo.Name = 'simplename' or dwo.Name = 'comname')) &
  1084. // or (dwo.Type = 'text' and (dwo.Name = 'simplename_t' or dwo.Name = 'comname_t'))) then
  1085. // if (this.Object.billtype[row] = 0) then return // 被动报价不能修改客户
  1086. //
  1087. // long ori_cuscomid, new_cuscomid
  1088. // ori_cuscomid = this.Object.cuscomid[row]
  1089. //
  1090. // s_fx_company s_tran, s_ret
  1091. // s_tran.ds = ins_ds_cust
  1092. // OpenWithParm(w_cus_ch_fx, s_tran)
  1093. // s_ret = Message.PowerObjectParm
  1094. // if not IsNull(s_ret) then
  1095. // if (s_ret.ifselect) then
  1096. // new_cuscomid = s_ret.comid[1]
  1097. // if (ori_cuscomid <> new_cuscomid) then
  1098. // dw_mx.Reset() // 重选客户,清空明细物料
  1099. // if (new_cuscomid > 0) then
  1100. // uo_pz.init()
  1101. // uo_pz.ins_comid = new_cuscomid
  1102. // string arg_msg
  1103. // if (uo_pz.uof_before_ready(ref arg_msg) <> 1) then
  1104. // MessageBox('提示', arg_msg)
  1105. // end if
  1106. // end if
  1107. // end if
  1108. //
  1109. // this.Object.cuscomid[row] = new_cuscomid
  1110. // this.Object.comname[row] = s_ret.comname[1]
  1111. // this.Object.simplename[row] = s_ret.simplename[1]
  1112. //
  1113. // this.AcceptText()
  1114. // end if
  1115. // end if
  1116. //end if
  1117. end event
  1118. type cb_neworsave from uo_imflatbutton within w_quote_fx
  1119. integer x = 155
  1120. integer width = 165
  1121. integer height = 164
  1122. integer taborder = 40
  1123. boolean bringtotop = true
  1124. string text = "保存"
  1125. string normalpicname = "Save.bmp"
  1126. integer picsize = 16
  1127. toolbaralignment pic_align = alignattop!
  1128. boolean border = false
  1129. end type
  1130. event clicked;call super::clicked;string arg_msg
  1131. long row
  1132. if (if_modify_mode) then // 保存功能
  1133. if (wf_save_quote() <> 1) then return
  1134. else // 新建功能
  1135. // if (f_find_fx_user_power(14, ref arg_msg) <> 1) then // 14-销售报价单新建
  1136. // MessageBox('权限提示', arg_msg)
  1137. // return
  1138. // end if
  1139. //
  1140. // if (wf_new_quote() <> 1) then return
  1141. end if
  1142. if_modify_mode = not if_modify_mode
  1143. wf_face()
  1144. wf_taborder()
  1145. if (not if_modify_mode) then
  1146. wf_retrieve_quote()
  1147. end if
  1148. end event
  1149. type cb_editorundo from uo_imflatbutton within w_quote_fx
  1150. integer x = 311
  1151. integer width = 151
  1152. integer height = 164
  1153. integer taborder = 50
  1154. boolean bringtotop = true
  1155. string text = "修改"
  1156. string normalpicname = "open.bmp"
  1157. integer picsize = 16
  1158. toolbaralignment pic_align = alignattop!
  1159. boolean border = false
  1160. end type
  1161. event clicked;call super::clicked;long row
  1162. row = dw_main.GetRow()
  1163. if (row <= 0) then
  1164. MessageBox('提示', '请选择单据')
  1165. return
  1166. end if
  1167. string arg_msg
  1168. if (if_modify_mode) then // 放弃
  1169. if (MessageBox('提示', '放弃当前修改?', Question!, YesNo!) <> 1) then return
  1170. if (dw_main.Object.quoteid[row] = 0) then
  1171. dw_main.DeleteRow(row)
  1172. dw_main_ff.Reset()
  1173. dw_mx.Reset()
  1174. if (dw_main.RowCount() > 0) then
  1175. row = 1
  1176. else
  1177. row = 0
  1178. end if
  1179. end if
  1180. else // 修改
  1181. // if (f_find_fx_user_power(15, ref arg_msg) <> 1) then // 15-销售报价单修改
  1182. // MessageBox('权限提示', arg_msg)
  1183. // return
  1184. // end if
  1185. if (dw_main.Object.responseemp[row] <> '') then
  1186. MessageBox('提示', '当前单据已发送,不能修改')
  1187. return
  1188. end if
  1189. // if (uo_pz.ins_comid <> dw_main.Object.cuscomid[row]) then
  1190. // uo_pz.init()
  1191. // uo_pz.ins_comid = dw_main.Object.cuscomid[row]
  1192. // if (uo_pz.uof_before_ready(ref arg_msg) <> 1) then
  1193. // MessageBox('提示', arg_msg)
  1194. // end if
  1195. // end if
  1196. end if
  1197. if_modify_mode = not if_modify_mode
  1198. wf_face()
  1199. wf_taborder()
  1200. if (not if_modify_mode) then
  1201. if (row > 0) then
  1202. dw_main.post event rowfocuschanged(row)
  1203. end if
  1204. end if
  1205. end event
  1206. type cb_del from uo_imflatbutton within w_quote_fx
  1207. boolean visible = false
  1208. integer x = 466
  1209. integer width = 151
  1210. integer height = 164
  1211. integer taborder = 60
  1212. boolean bringtotop = true
  1213. string text = "删除"
  1214. string normalpicname = "delete.bmp"
  1215. integer picsize = 16
  1216. toolbaralignment pic_align = alignattop!
  1217. boolean border = false
  1218. end type
  1219. event clicked;call super::clicked;//long row
  1220. //row = dw_main.GetRow()
  1221. //if (row <= 0) then
  1222. // MessageBox('提示', '请选择单据')
  1223. // return
  1224. //end if
  1225. //
  1226. //string arg_msg
  1227. //if (f_find_fx_user_power(16, ref arg_msg) <> 1) then // 16-销售报价单删除
  1228. // MessageBox('权限提示', arg_msg)
  1229. // return
  1230. //end if
  1231. //
  1232. //if (dw_main.Object.flag[row] <> 0) then
  1233. // MessageBox('提示', '当前单据不处于待审核状态,不能删除')
  1234. // return
  1235. //end if
  1236. //
  1237. //if (MessageBox('提示', '确认进行删除操作?', Question!, YesNo!) <> 1) then return
  1238. //
  1239. //long quoteid
  1240. //quoteid = dw_main.Object.quoteid[row]
  1241. //if (wf_del_quote(quoteid) = 1) then
  1242. // dw_main.DeleteRow(row)
  1243. // dw_main_ff.Reset()
  1244. // dw_mx.Reset()
  1245. // if (dw_main.RowCount() > 0) then
  1246. // if (row <= dw_main.RowCount()) then
  1247. // dw_main.post event rowfocuschanged(row)
  1248. // else
  1249. // dw_main.post event rowfocuschanged(1)
  1250. // end if
  1251. // end if
  1252. //end if
  1253. end event
  1254. type cb_mxfun from uo_imflatbutton within w_quote_fx
  1255. boolean visible = false
  1256. integer x = 933
  1257. integer width = 274
  1258. integer height = 164
  1259. integer taborder = 70
  1260. boolean bringtotop = true
  1261. string text = "明细功能"
  1262. string normalpicname = "mx.bmp"
  1263. integer picsize = 16
  1264. toolbaralignment pic_align = alignattop!
  1265. boolean border = false
  1266. end type
  1267. event clicked;call super::clicked;if (not if_modify_mode) then return
  1268. m_Dfc_Control_PopupMenu dmPopupMenu
  1269. string menustr
  1270. menustr = 'Text=增明细~tEvent=ue_add_mx'
  1271. menustr += '|' + 'Text=删明细~tEvent=ue_del_mx'
  1272. if len(trim(menustr))<>0 then
  1273. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1274. dmPopupMenu.mf_BuildMenu(This, menustr)
  1275. dmPopupMenu.mf_PopMenu()
  1276. Destroy dmPopupMenu
  1277. end if
  1278. end event
  1279. type dw_main from u_dw_rbtnfilter within w_quote_fx
  1280. integer x = 1970
  1281. integer y = 284
  1282. integer width = 2510
  1283. integer height = 988
  1284. integer taborder = 20
  1285. boolean titlebar = true
  1286. string title = "单据列表"
  1287. string dataobject = "dw_fx_quote"
  1288. boolean controlmenu = true
  1289. boolean maxbox = true
  1290. boolean hscrollbar = true
  1291. boolean vscrollbar = true
  1292. boolean resizable = true
  1293. boolean hsplitscroll = true
  1294. boolean rbutton_filter_use = true
  1295. boolean rbutton_setposition_use = true
  1296. boolean titleclick_sort_use = true
  1297. end type
  1298. event rowfocuschanged;call super::rowfocuschanged;if if_modify_mode then return
  1299. if IsNull(currentrow) then
  1300. currentrow = this.GetRow()
  1301. if IsNull(currentrow) then return
  1302. end if
  1303. if (currentrow <= 0) then return
  1304. this.SelectRow(0, false)
  1305. this.SelectRow(currentrow, true)
  1306. dw_main_ff.Reset( )
  1307. this.RowsCopy(currentrow, currentrow, Primary!, dw_main_ff, 1, Primary!)
  1308. long quoteid
  1309. quoteid = this.Object.quoteid[currentrow]
  1310. wf_retrieve_quotemx(quoteid)
  1311. string arg_msg
  1312. if (this.Object.flag[currentrow] <> 0) then
  1313. cb_editorundo.Enabled = false
  1314. cb_ljfieb.Enabled = false
  1315. else
  1316. cb_editorundo.Enabled = true
  1317. cb_ljfieb.Enabled = true
  1318. end if
  1319. end event
  1320. event clicked;call super::clicked;if (if_modify_mode) then return
  1321. if (IsNull(row)) then return
  1322. if (row > 0) then
  1323. this.SelectRow(0, false)
  1324. this.SelectRow(row, true)
  1325. this.SetRow(row)
  1326. end if
  1327. end event
  1328. type dw_mx from u_dw_rbtnfilter within w_quote_fx
  1329. event ue_dwndropdown pbm_dwndropdown
  1330. integer y = 1260
  1331. integer width = 3451
  1332. integer height = 1168
  1333. integer taborder = 20
  1334. boolean bringtotop = true
  1335. boolean titlebar = true
  1336. string title = "明细内容"
  1337. string dataobject = "dw_fx_quotemx"
  1338. boolean controlmenu = true
  1339. boolean maxbox = true
  1340. boolean hscrollbar = true
  1341. boolean vscrollbar = true
  1342. boolean hsplitscroll = true
  1343. boolean rbutton_filter_use = true
  1344. boolean rbutton_setposition_use = true
  1345. boolean titleclick_sort_use = true
  1346. end type
  1347. event ue_dwndropdown;////
  1348. //if (not if_modify_mode) then return
  1349. //
  1350. //long row
  1351. //row = this.GetRow()
  1352. //if (row <= 0) then return
  1353. //
  1354. //string arg_msg
  1355. //if (not uo_pz.ins_isReady) then
  1356. // uo_pz.uof_get_ready(ref arg_msg)
  1357. // if (arg_msg <> '') then
  1358. // MessageBox('提示', '获取配置失败:' + arg_msg)
  1359. // return
  1360. // end if
  1361. //end if
  1362. //
  1363. //s_fx_pzwin_open s_tran
  1364. //s_tran.arg_mtrlid = this.Object.fxmtrlid[row]
  1365. //s_tran.arg_mtrlid_erp = this.Object.mtrlid[row]
  1366. //s_tran.arg_statusflag = this.Object.statusflag[row]
  1367. //s_tran.arg_statustype = this.Object.statustype[row]
  1368. //s_tran.arg_woodcodeflag = this.Object.woodcodeflag[row]
  1369. //s_tran.arg_woodcodetype = this.Object.woodcodetype[row]
  1370. //s_tran.arg_pcodeflag = this.Object.pcodeflag[row]
  1371. //s_tran.arg_pcodetype = this.Object.pcodetype[row]
  1372. //s_tran.arg_colname = this.GetColumnName()
  1373. //s_tran.arg_x = parent.X + this.X + this.Pointerx()
  1374. //s_tran.arg_y = parent.Y + this.Y + this.Pointery()
  1375. //
  1376. //string ret
  1377. //ret = uo_pz.uof_open_pzwin(s_tran, ref arg_msg)
  1378. //if (arg_msg <> '') then
  1379. // MessageBox('提示', arg_msg)
  1380. //end if
  1381. //
  1382. //this.SetItem(row, s_tran.arg_colname, ret)
  1383. //
  1384. //
  1385. //
  1386. end event
  1387. event clicked;call super::clicked;if (row > 0) then
  1388. this.SelectRow(0, false)
  1389. this.SelectRow(row, true)
  1390. this.SetRow(row)
  1391. end if
  1392. end event
  1393. event doubleclicked;call super::doubleclicked;// 双击空白处
  1394. if (not if_modify_mode) then return
  1395. if (dwo.Type <> 'datawindow') then return
  1396. parent.post event ue_add_mx( )
  1397. end event
  1398. event itemfocuschanged;call super::itemfocuschanged;if (row > 0) then
  1399. this.SelectRow(0, false)
  1400. this.SelectRow(row, true)
  1401. this.SetRow(row)
  1402. // string colName
  1403. // colName = this.GetColumnName()
  1404. // if (colName = 'requiredate') then
  1405. // this.SelectText(1, Len(this.GetText()))
  1406. // end if
  1407. end if
  1408. wf_retrieve_quote_his(row)
  1409. end event
  1410. event rowfocuschanged;call super::rowfocuschanged;string arg_msg
  1411. if (currentrow > 0) then
  1412. this.SelectRow(0, false)
  1413. this.SelectRow(currentrow, true)
  1414. this.SetRow(currentrow)
  1415. // if (f_find_fx_user_power(19, ref arg_msg) = 1) then // 19-最新报价统计表
  1416. wf_retrieve_quote_his(currentrow)
  1417. // end if
  1418. end if
  1419. end event
  1420. type cb_ljfieb from uo_imflatbutton within w_quote_fx
  1421. integer x = 466
  1422. integer width = 151
  1423. integer height = 164
  1424. integer taborder = 40
  1425. boolean bringtotop = true
  1426. string text = "发送"
  1427. string normalpicname = "graphics\fx_send.bmp"
  1428. integer picsize = 16
  1429. toolbaralignment pic_align = alignattop!
  1430. boolean border = false
  1431. end type
  1432. event clicked;call super::clicked;Parent.PostEvent('ue_send_ljfieb')
  1433. end event
  1434. type tab_1 from tab within w_quote_fx
  1435. integer x = 3488
  1436. integer y = 1264
  1437. integer width = 1166
  1438. integer height = 1056
  1439. integer taborder = 30
  1440. boolean bringtotop = true
  1441. integer textsize = -9
  1442. integer weight = 400
  1443. fontcharset fontcharset = gb2312charset!
  1444. fontpitch fontpitch = variable!
  1445. string facename = "宋体"
  1446. long backcolor = 16777215
  1447. boolean raggedright = true
  1448. boolean focusonbuttondown = true
  1449. integer selectedtab = 1
  1450. tabpage_1 tabpage_1
  1451. end type
  1452. on tab_1.create
  1453. this.tabpage_1=create tabpage_1
  1454. this.Control[]={this.tabpage_1}
  1455. end on
  1456. on tab_1.destroy
  1457. destroy(this.tabpage_1)
  1458. end on
  1459. type tabpage_1 from userobject within tab_1
  1460. integer x = 18
  1461. integer y = 96
  1462. integer width = 1129
  1463. integer height = 944
  1464. long backcolor = 16777215
  1465. string text = "历史"
  1466. long tabtextcolor = 33554432
  1467. long tabbackcolor = 16777215
  1468. long picturemaskcolor = 536870912
  1469. dw_quote_his dw_quote_his
  1470. end type
  1471. on tabpage_1.create
  1472. this.dw_quote_his=create dw_quote_his
  1473. this.Control[]={this.dw_quote_his}
  1474. end on
  1475. on tabpage_1.destroy
  1476. destroy(this.dw_quote_his)
  1477. end on
  1478. type dw_quote_his from u_dw_rbtnfilter within tabpage_1
  1479. integer width = 1120
  1480. integer height = 800
  1481. integer taborder = 20
  1482. string dataobject = "dw_fx_quote_his_simple"
  1483. boolean hscrollbar = true
  1484. boolean vscrollbar = true
  1485. boolean hsplitscroll = true
  1486. boolean rbutton_filter_use = true
  1487. boolean rbutton_setposition_use = true
  1488. boolean titleclick_sort_use = true
  1489. end type
  1490. type st_split from u_lbs_stsplitbar within w_quote_fx
  1491. integer x = 3461
  1492. integer y = 1264
  1493. integer width = 14
  1494. integer height = 500
  1495. boolean bringtotop = true
  1496. end type
  1497. event clicked;call super::clicked;parent.postevent('resize')
  1498. end event
  1499. type st_1 from statictext within w_quote_fx
  1500. integer x = 14
  1501. integer y = 208
  1502. integer width = 288
  1503. integer height = 48
  1504. boolean bringtotop = true
  1505. integer textsize = -9
  1506. integer weight = 400
  1507. fontcharset fontcharset = gb2312charset!
  1508. fontpitch fontpitch = variable!
  1509. string facename = "宋体"
  1510. long textcolor = 33554432
  1511. long backcolor = 16777215
  1512. string text = "单据状态"
  1513. alignment alignment = center!
  1514. boolean focusrectangle = false
  1515. end type
  1516. type ddlb_status from dropdownlistbox within w_quote_fx
  1517. integer x = 293
  1518. integer y = 188
  1519. integer width = 320
  1520. integer height = 496
  1521. integer taborder = 80
  1522. boolean bringtotop = true
  1523. integer textsize = -9
  1524. integer weight = 400
  1525. fontcharset fontcharset = gb2312charset!
  1526. fontpitch fontpitch = variable!
  1527. string facename = "宋体"
  1528. long textcolor = 33554432
  1529. boolean sorted = false
  1530. boolean vscrollbar = true
  1531. string item[] = {"全部","未报价","已报价"}
  1532. borderstyle borderstyle = stylelowered!
  1533. end type
  1534. event selectionchanged;CHOOSE CASE Index
  1535. CASE 1
  1536. ins_flag = -1
  1537. CASE 2
  1538. ins_flag = 0
  1539. CASE 3
  1540. ins_flag = 1
  1541. END CHOOSE
  1542. cb_retrieve.PostEvent(Clicked!)
  1543. end event
  1544. event constructor;selectItem(2)
  1545. //postEvent('SelectionChanged');
  1546. end event