w_spt_mtrl_view_fx.srw 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  1. $PBExportHeader$w_spt_mtrl_view_fx.srw
  2. $PBExportComments$供应商产品浏览
  3. forward
  4. global type w_spt_mtrl_view_fx from w_publ_base
  5. end type
  6. type ddlb_spt from dropdownlistbox within w_spt_mtrl_view_fx
  7. end type
  8. type st_1 from statictext within w_spt_mtrl_view_fx
  9. end type
  10. type tv_1 from uo_tv_fx_mtrltype within w_spt_mtrl_view_fx
  11. end type
  12. type st_2 from statictext within w_spt_mtrl_view_fx
  13. end type
  14. type dw_1 from datawindow within w_spt_mtrl_view_fx
  15. end type
  16. type st_3 from statictext within w_spt_mtrl_view_fx
  17. end type
  18. type pb_1 from picturebutton within w_spt_mtrl_view_fx
  19. end type
  20. type sle_filter from singlelineedit within w_spt_mtrl_view_fx
  21. end type
  22. type cbx_all from checkbox within w_spt_mtrl_view_fx
  23. end type
  24. type p_shopcart from picture within w_spt_mtrl_view_fx
  25. end type
  26. type st_shopcart_cnt from statictext within w_spt_mtrl_view_fx
  27. end type
  28. type em_pagesize from editmask within w_spt_mtrl_view_fx
  29. end type
  30. type pb_uppage from picturebutton within w_spt_mtrl_view_fx
  31. end type
  32. type pb_dnpage from picturebutton within w_spt_mtrl_view_fx
  33. end type
  34. type st_4 from statictext within w_spt_mtrl_view_fx
  35. end type
  36. type em_cur_page from editmask within w_spt_mtrl_view_fx
  37. end type
  38. type st_allpages from statictext within w_spt_mtrl_view_fx
  39. end type
  40. type pb_page_top from picturebutton within w_spt_mtrl_view_fx
  41. end type
  42. type pb_page_end from picturebutton within w_spt_mtrl_view_fx
  43. end type
  44. end forward
  45. global type w_spt_mtrl_view_fx from w_publ_base
  46. integer width = 4366
  47. integer height = 2784
  48. string title = "供应商产品浏览"
  49. boolean maxbox = true
  50. boolean resizable = true
  51. long backcolor = 16777215
  52. ddlb_spt ddlb_spt
  53. st_1 st_1
  54. tv_1 tv_1
  55. st_2 st_2
  56. dw_1 dw_1
  57. st_3 st_3
  58. pb_1 pb_1
  59. sle_filter sle_filter
  60. cbx_all cbx_all
  61. p_shopcart p_shopcart
  62. st_shopcart_cnt st_shopcart_cnt
  63. em_pagesize em_pagesize
  64. pb_uppage pb_uppage
  65. pb_dnpage pb_dnpage
  66. st_4 st_4
  67. em_cur_page em_cur_page
  68. st_allpages st_allpages
  69. pb_page_top pb_page_top
  70. pb_page_end pb_page_end
  71. end type
  72. global w_spt_mtrl_view_fx w_spt_mtrl_view_fx
  73. type variables
  74. datastore ins_ds_spt // 存放供应商列表
  75. long ins_pagenum = 1
  76. long ins_allpages = 1
  77. end variables
  78. forward prototypes
  79. public subroutine wf_retrieve_mtrltype (readonly long arg_comid)
  80. public subroutine wf_retrieve_mtrl (readonly long a_mtrltypeid, readonly long a_sonflag)
  81. public subroutine wf_download_pic_async ()
  82. public subroutine wf_retrieve_pic ()
  83. public subroutine wf_add_shopcart (readonly long arg_mode)
  84. public subroutine wf_retrieve_price ()
  85. end prototypes
  86. public subroutine wf_retrieve_mtrltype (readonly long arg_comid);string arg_msg
  87. oleobject mtrltypes
  88. mtrltypes = FXAppCom.GetSptMtrltypeBySptcomid(app_token_fx, arg_comid, ref arg_msg)
  89. IF (arg_msg <> '') THEN
  90. MessageBox('提示', '获取物料类别失败:' + arg_msg)
  91. RETURN
  92. END IF
  93. if (mtrltypes.Count <= 0) then return
  94. datastore ds
  95. ds = create datastore
  96. ds.DataObject = 'ds_fx_mtrltype'
  97. long i, row
  98. oleobject mtrltype
  99. for i = 1 to mtrltypes.Count
  100. mtrltype = mtrltypes.GetItem(i - 1)
  101. row = ds.InsertRow(0)
  102. ds.Object.comid[row] = mtrltype.GetInt('comid')
  103. ds.Object.mtrltypeid[row] = mtrltype.GetInt('mtrltypeid')
  104. ds.Object.mtrltype[row] = mtrltype.GetString('mtrltype')
  105. ds.Object.handtype[row] = mtrltype.GetString('handtype')
  106. ds.Object.sonflag[row] = mtrltype.GetInt('sonflag')
  107. ds.Object.parentid[row] = mtrltype.GetInt('parentid')
  108. ds.Object.mtrltypeid_erp[row] = mtrltype.GetInt('mtrltypeid_erp')
  109. next
  110. tv_1.uof_init(ds)
  111. end subroutine
  112. public subroutine wf_retrieve_mtrl (readonly long a_mtrltypeid, readonly long a_sonflag);dw_1.Reset()
  113. string arg_msg
  114. //if (f_find_fx_user_power(48, ref arg_msg) <> 1) then // 48-供应商产品浏览
  115. // MessageBox('权限提示', arg_msg)
  116. // return
  117. //end if
  118. cbx_all.Checked = false
  119. long pagesize
  120. pagesize = long(em_pagesize.Text)
  121. oleobject parm, rslt
  122. parm = FXAppCom.CreatePbDictionary()
  123. parm.SetString('token', app_token_fx)
  124. parm.SetInt('mtrltypeid', a_mtrltypeid)
  125. parm.SetInt('sonflag', a_sonflag)
  126. parm.SetInt('pagesize', pagesize)
  127. parm.SetInt('pagenum', ins_pagenum)
  128. parm.SetString('likeStr', Trim(sle_filter.Text))
  129. rslt = FXAppCom.GetSptMtrlWithPageSize(parm, ref arg_msg)
  130. if (arg_msg <> '') then
  131. MessageBox('提示', '获取产品信息失败:' + arg_msg)
  132. return
  133. end if
  134. oleobject mtrls, mtrl
  135. mtrls = rslt.GetArrOfPBDictionary('list')
  136. ins_allpages = rslt.GetInt('allpages')
  137. em_cur_page.Text = string(ins_pagenum)
  138. st_allpages.Text = '/' + string(ins_allpages)
  139. long i, cnt, row
  140. cnt = mtrls.Count
  141. string exePath
  142. exePath = GetCurrentDirectory()
  143. dw_1.SetRedraw(false)
  144. for i = 1 to cnt
  145. mtrl = mtrls.GetItem(i - 1)
  146. row = dw_1.InsertRow(0)
  147. dw_1.Object.ch[row] = 0
  148. dw_1.Object.fxmtrlid[row] = mtrl.GetInt('fxmtrlid')
  149. dw_1.Object.comid[row] = mtrl.GetInt('comid')
  150. dw_1.Object.mtrlid[row] = mtrl.GetInt('mtrlid')
  151. dw_1.Object.mtrlcode[row] = mtrl.GetString('mtrlcode')
  152. dw_1.Object.mtrlname[row] = mtrl.GetString('mtrlname')
  153. dw_1.Object.mtrlmode[row] = mtrl.GetString('mtrlmode')
  154. dw_1.Object.mtrlsectype[row] = mtrl.GetString('mtrlsectype')
  155. dw_1.Object.zxmtrlmode[row] = mtrl.GetString('zxmtrlmode')
  156. dw_1.Object.usermtrlmode[row] = mtrl.GetString('usermtrlmode')
  157. // dw_1.Object.statusflag[row] = mtrl.GetInt('statusflag')
  158. // dw_1.Object.statustype[row] = mtrl.GetInt('statustype')
  159. // dw_1.Object.woodcodeflag[row] = mtrl.GetInt('woodcodeflag')
  160. // dw_1.Object.woodcodetype[row] = mtrl.GetInt('woodcodetype')
  161. // dw_1.Object.pcodeflag[row] = mtrl.GetInt('pcodeflag')
  162. // dw_1.Object.pcodetype[row] = mtrl.GetInt('pcodetype')
  163. // dw_1.Object.configcodetype[row] = mtrl.GetInt('configcodetype')
  164. dw_1.Object.unit[row] = mtrl.GetString('unit')
  165. dw_1.Object.filetype[row] = mtrl.GetString('fileType')
  166. dw_1.Object.shopcart_pic_path[row] = exePath + '\graphics\shopcart_add.png'
  167. next
  168. dw_1.SetRedraw(true)
  169. if (dw_1.RowCount() > 0) then
  170. wf_retrieve_pic()
  171. wf_download_pic_async()
  172. wf_retrieve_price()
  173. end if
  174. end subroutine
  175. public subroutine wf_download_pic_async ();if (dw_1.RowCount() <= 0) then return
  176. string exePath
  177. exePath = GetCurrentDirectory()
  178. oleobject parm, list, item
  179. parm = FXAppCom.CreatePbDictionary()
  180. list = FXAppCom.CreArrOfPbDictionary()
  181. long i
  182. for i = 1 to dw_1.RowCount()
  183. item = FXAppCom.CreatePbDictionary()
  184. item.SetInt('comid', dw_1.Object.comid[i])
  185. item.SetInt('relid_erp', dw_1.Object.mtrlid[i])
  186. list.Add(item)
  187. next
  188. parm.SetString('token', app_token_fx)
  189. parm.SetString('exePath', exePath)
  190. parm.SetObject('list', list)
  191. string arg_msg
  192. FXAppCom.DownloadPicFilesAsync(parm, ref arg_msg)
  193. if (arg_msg <> '') then
  194. Timer(0)
  195. MessageBox('提示', '请求产品图片失败:' + arg_msg)
  196. else
  197. Timer(0.8)
  198. end if
  199. end subroutine
  200. public subroutine wf_retrieve_pic ();if (dw_1.RowCount() <= 0) then return
  201. long i
  202. long comid, mtrlid
  203. string picFilePath, exePath, filetype
  204. exePath = GetCurrentDirectory()
  205. dw_1.SetRedraw(false)
  206. for i = 1 to dw_1.RowCount()
  207. comid = dw_1.Object.comid[i]
  208. mtrlid = dw_1.Object.mtrlid[i]
  209. filetype = Trim(dw_1.Object.filetype[i])
  210. picFilePath = exePath + '\cache\mtrlpic\c_' + string(comid) + '_m_' + string(mtrlid) + '.' + filetype
  211. if (FileExists(picFilePath)) then
  212. dw_1.Object.filepath[i] = picFilePath
  213. else
  214. dw_1.Object.filepath[i] = exePath + '\graphics\mtrl_view.png'
  215. end if
  216. next
  217. dw_1.SetRedraw(true)
  218. end subroutine
  219. public subroutine wf_add_shopcart (readonly long arg_mode);// arg_mode 0-单选 1-多选
  220. s_fx_mtrldef s_ch
  221. long comid, mtrlid
  222. decimal price, qty
  223. long row, i
  224. long index = 1
  225. if (arg_mode = 0) then // 单选
  226. row = dw_1.GetRow()
  227. if (row > 0) then
  228. s_ch.comid[index] = dw_1.Object.comid[row]
  229. s_ch.mtrlid[index] = dw_1.Object.mtrlid[row]
  230. s_ch.price[index] = dw_1.Object.hisprice[row]
  231. s_ch.fxmtrlid[index] = dw_1.Object.fxmtrlid[row]
  232. s_ch.qty[index] = 1
  233. else
  234. return
  235. end if
  236. elseif (arg_mode = 1) then // 多选
  237. for i = 1 to dw_1.RowCount()
  238. if (dw_1.Object.ch[i] = 0) then continue
  239. s_ch.comid[index] = dw_1.Object.comid[i]
  240. s_ch.mtrlid[index] = dw_1.Object.mtrlid[i]
  241. s_ch.price[index] = dw_1.Object.hisprice[i]
  242. s_ch.fxmtrlid[index] = dw_1.Object.fxmtrlid[row]
  243. s_ch.qty[index] = 1
  244. index ++
  245. next
  246. if (UpperBound(s_ch.comid) <= 0) then return
  247. else
  248. return
  249. end if
  250. oleobject list, item
  251. list = FXAppCom.CreArrOfPbDictionary()
  252. for i = 1 to UpperBound(s_ch.comid)
  253. item = FXAppCom.CreatePbDictionary()
  254. item.SetInt('comid', s_ch.comid[i])
  255. item.SetInt('mtrlid', s_ch.mtrlid[i])
  256. item.SetDouble('price', s_ch.price[index])
  257. item.SetDouble('qty', s_ch.qty[index])
  258. item.SetInt('fxmtrlid', s_ch.fxmtrlid[i])
  259. list.Add(item)
  260. next
  261. oleobject parm
  262. parm = FXAppCom.CreatePbDictionary()
  263. parm.SetString('token', app_token_fx)
  264. parm.SetObject('list', list)
  265. oleobject ret
  266. string arg_msg
  267. ret = FXAppCom.AddShopcart(parm, ref arg_msg)
  268. if (arg_msg <> '') then
  269. MessageBox('提示', '添加购物车操作失败:' + arg_msg)
  270. return
  271. end if
  272. long cnt
  273. cnt = ret.GetInt('cnt')
  274. if (cnt <= 999) then
  275. st_shopcart_cnt.Text = string(cnt)
  276. else
  277. st_shopcart_cnt.Text = '...'
  278. end if
  279. s_toast_parm s_parm
  280. s_parm.Width = 1000
  281. s_parm.Height = 200
  282. s_parm.msg = '成功添加至购物车'
  283. s_parm.showtime = 0.5
  284. OpenWithParm(w_toast, s_parm)
  285. end subroutine
  286. public subroutine wf_retrieve_price ();string arg_msg
  287. //if (f_find_fx_user_power(49, ref arg_msg) <> 1) then // 49-供应商产品浏览(可获取最新报价)
  288. // dw_1.Modify('destroy hisprice_1 ~r~n destroy hisprice ~r~n')
  289. // return
  290. //end if
  291. if (dw_1.RowCount() <= 0) then return
  292. oleobject ReqList, item
  293. ReqList = FXAppCom.CreArrOfPbDictionary()
  294. long i
  295. for i = 1 to dw_1.RowCount()
  296. item = FXAppCom.CreatePbDictionary()
  297. item.SetInt('mtrlid', dw_1.Object.fxmtrlid[i])
  298. ReqList.Add(item)
  299. next
  300. oleobject parm, retParm
  301. parm = FXAppCom.CreatePbDictionary()
  302. parm.SetString('token', app_token_fx)
  303. parm.SetObject('reqlist', ReqList)
  304. retParm = FXAppCom.GetAuditSptPriceByFxmtrlid(parm, ref arg_msg)
  305. if (arg_msg <> '') then
  306. MessageBox('提示', arg_msg)
  307. return
  308. end if
  309. long mtrlid, row
  310. decimal price
  311. oleobject RspList
  312. RspList = retParm.GetArrOfPBDictionary('rsplist')
  313. dw_1.SetRedraw(false)
  314. for i = 1 to RspList.Count
  315. item = RspList.GetItem(i - 1)
  316. mtrlid = item.GetInt('mtrlid')
  317. row = dw_1.Find('fxmtrlid = ' + string(mtrlid), 1, dw_1.RowCount())
  318. if (row > 0) then
  319. price = item.GetDouble('price')
  320. dw_1.Object.hisprice[row] = price
  321. end if
  322. next
  323. dw_1.SetRedraw(true)
  324. end subroutine
  325. on w_spt_mtrl_view_fx.create
  326. int iCurrent
  327. call super::create
  328. this.ddlb_spt=create ddlb_spt
  329. this.st_1=create st_1
  330. this.tv_1=create tv_1
  331. this.st_2=create st_2
  332. this.dw_1=create dw_1
  333. this.st_3=create st_3
  334. this.pb_1=create pb_1
  335. this.sle_filter=create sle_filter
  336. this.cbx_all=create cbx_all
  337. this.p_shopcart=create p_shopcart
  338. this.st_shopcart_cnt=create st_shopcart_cnt
  339. this.em_pagesize=create em_pagesize
  340. this.pb_uppage=create pb_uppage
  341. this.pb_dnpage=create pb_dnpage
  342. this.st_4=create st_4
  343. this.em_cur_page=create em_cur_page
  344. this.st_allpages=create st_allpages
  345. this.pb_page_top=create pb_page_top
  346. this.pb_page_end=create pb_page_end
  347. iCurrent=UpperBound(this.Control)
  348. this.Control[iCurrent+1]=this.ddlb_spt
  349. this.Control[iCurrent+2]=this.st_1
  350. this.Control[iCurrent+3]=this.tv_1
  351. this.Control[iCurrent+4]=this.st_2
  352. this.Control[iCurrent+5]=this.dw_1
  353. this.Control[iCurrent+6]=this.st_3
  354. this.Control[iCurrent+7]=this.pb_1
  355. this.Control[iCurrent+8]=this.sle_filter
  356. this.Control[iCurrent+9]=this.cbx_all
  357. this.Control[iCurrent+10]=this.p_shopcart
  358. this.Control[iCurrent+11]=this.st_shopcart_cnt
  359. this.Control[iCurrent+12]=this.em_pagesize
  360. this.Control[iCurrent+13]=this.pb_uppage
  361. this.Control[iCurrent+14]=this.pb_dnpage
  362. this.Control[iCurrent+15]=this.st_4
  363. this.Control[iCurrent+16]=this.em_cur_page
  364. this.Control[iCurrent+17]=this.st_allpages
  365. this.Control[iCurrent+18]=this.pb_page_top
  366. this.Control[iCurrent+19]=this.pb_page_end
  367. end on
  368. on w_spt_mtrl_view_fx.destroy
  369. call super::destroy
  370. destroy(this.ddlb_spt)
  371. destroy(this.st_1)
  372. destroy(this.tv_1)
  373. destroy(this.st_2)
  374. destroy(this.dw_1)
  375. destroy(this.st_3)
  376. destroy(this.pb_1)
  377. destroy(this.sle_filter)
  378. destroy(this.cbx_all)
  379. destroy(this.p_shopcart)
  380. destroy(this.st_shopcart_cnt)
  381. destroy(this.em_pagesize)
  382. destroy(this.pb_uppage)
  383. destroy(this.pb_dnpage)
  384. destroy(this.st_4)
  385. destroy(this.em_cur_page)
  386. destroy(this.st_allpages)
  387. destroy(this.pb_page_top)
  388. destroy(this.pb_page_end)
  389. end on
  390. event open;call super::open;string arg_msg // 48-供应商产品浏览(附购物车功能) 49-供应商产品浏览(可获取历史报价)
  391. //if (f_find_fx_user_power(48, ref arg_msg) <> 1 &
  392. // and f_find_fx_user_power(49, ref arg_msg) <> 1) then
  393. // MessageBox('权限提示', arg_msg)
  394. // Close(this)
  395. // return
  396. //end if
  397. ins_ds_spt = create datastore
  398. ins_ds_spt.DataObject = 'dw_fx_spt_ch'
  399. ins_ds_spt.Reset()
  400. oleobject list, item
  401. list = FXAppCom.GetMySptList(app_token_fx, ref arg_msg)
  402. if (arg_msg <> '') then
  403. MessageBox('提示', '获取供应商列表失败:' + arg_msg)
  404. return
  405. end if
  406. long i, row, index
  407. string temp_comname
  408. if (list.Count > 0) then
  409. for i = 1 to list.Count
  410. row = ins_ds_spt.InsertRow(0)
  411. item = list.GetItem(i - 1)
  412. temp_comname = item.GetString('comname')
  413. index = ddlb_spt.InsertItem(temp_comname, 0)
  414. ins_ds_spt.Object.ch[row] = index // ch字段记录index
  415. ins_ds_spt.Object.comid[row] = item.GetInt('comid')
  416. ins_ds_spt.Object.comname[row] = temp_comname
  417. ins_ds_spt.Object.simplename[row] = item.GetString('simplename')
  418. // ins_ds_spt.Object.custype[row] = item.GetString('custype')
  419. // ins_ds_spt.Object.tele[row] = item.GetString('tele')
  420. ins_ds_spt.Object.address[row] = item.GetString('address')
  421. ins_ds_spt.Object.freight[row] = item.GetString('freight')
  422. ins_ds_spt.Object.freight_tele[row] = item.GetString('freight_tele')
  423. next
  424. ins_ds_spt.AcceptText()
  425. ddlb_spt.SelectItem(1)
  426. ddlb_spt.post event selectionchanged(1)
  427. else
  428. ddlb_spt.InsertItem('-=没有供应商=-', 0)
  429. end if
  430. oleobject parm
  431. parm = FXAppCom.CreatePbDictionary()
  432. parm.SetString('token', app_token_fx)
  433. oleobject ret
  434. ret = FXAppCom.AddShopcart(parm, ref arg_msg)
  435. if (arg_msg <> '') then
  436. MessageBox('提示', '刷新购物车数量失败:' + arg_msg)
  437. return
  438. end if
  439. long cnt
  440. cnt = ret.GetInt('cnt')
  441. if (cnt <= 999) then
  442. st_shopcart_cnt.Text = string(cnt)
  443. else
  444. st_shopcart_cnt.Text = '...'
  445. end if
  446. end event
  447. event timer;call super::timer;string arg_msg
  448. long ret
  449. ret = FXAppCom.DownloadPicFilesTimer(ref arg_msg)
  450. if (arg_msg <> '') then
  451. Timer(0)
  452. MessageBox('提示', arg_msg)
  453. return
  454. end if
  455. if (ret = 0) then // 继续等待
  456. Timer(0.8)
  457. elseif (ret = 1) then // 下载完成
  458. Timer(0)
  459. elseif (ret = -1) then
  460. Timer(0)
  461. MessageBox('提示', '请求过于频繁,请稍后再试')
  462. else
  463. Timer(0)
  464. end if
  465. end event
  466. event resize;call super::resize;if this.width < 4320 then this.Width = 4320
  467. if this.Height < 2680 then this.Height = 2680
  468. tv_1.Height = this.workspaceheight( ) - tv_1.Y
  469. dw_1.Height = this.workspaceheight( ) - dw_1.Y
  470. dw_1.Width = this.workspacewidth( ) - dw_1.X
  471. pb_page_end.X = this.workspacewidth( ) - 80 - pb_page_end.Width // 80
  472. pb_dnpage.X = pb_page_end.X - 12 - pb_dnpage.Width
  473. pb_uppage.X = pb_dnpage.X - 12 - pb_uppage.Width
  474. pb_page_top.X = pb_uppage.X - 12 - pb_page_top.Width
  475. st_allpages.X = pb_page_top.X - 20 - st_allpages.Width
  476. em_cur_page.X = st_allpages.X - 2 - em_cur_page.Width
  477. st_4.X = em_cur_page.X - 2 - st_4.Width
  478. p_shopcart.X = this.workspacewidth( ) - 80 - p_shopcart.Width // 80
  479. st_shopcart_cnt.X = p_shopcart.X + 64
  480. end event
  481. event key;call super::key;if (key = KeyF12!) then
  482. s_toast_parm s_parm
  483. s_parm.Width = 1000
  484. s_parm.Height = 200
  485. s_parm.msg = 'qweasd'
  486. s_parm.showtime = 0.4
  487. OpenWithParm(w_toast, s_parm)
  488. end if
  489. end event
  490. type cb_func from w_publ_base`cb_func within w_spt_mtrl_view_fx
  491. boolean visible = false
  492. integer y = 2280
  493. boolean enabled = false
  494. end type
  495. type cb_exit from w_publ_base`cb_exit within w_spt_mtrl_view_fx
  496. boolean visible = false
  497. integer y = 2280
  498. boolean enabled = false
  499. boolean cancel = false
  500. end type
  501. type ddlb_spt from dropdownlistbox within w_spt_mtrl_view_fx
  502. integer x = 18
  503. integer y = 112
  504. integer width = 965
  505. integer height = 300
  506. integer taborder = 10
  507. boolean bringtotop = true
  508. integer textsize = -9
  509. integer weight = 400
  510. fontcharset fontcharset = gb2312charset!
  511. fontpitch fontpitch = variable!
  512. string facename = "宋体"
  513. long textcolor = 33554432
  514. borderstyle borderstyle = stylelowered!
  515. end type
  516. event selectionchanged;if (this.Text = '-=没有供应商=-') then return
  517. long comid, findRow
  518. if (index > 0) then
  519. findRow = ins_ds_spt.Find('ch = ' + string(index), 1, ins_ds_spt.RowCount())
  520. if (findRow > 0) then
  521. comid = ins_ds_spt.Object.comid[findRow]
  522. wf_retrieve_mtrltype(comid)
  523. end if
  524. end if
  525. end event
  526. type st_1 from statictext within w_spt_mtrl_view_fx
  527. integer x = 325
  528. integer y = 36
  529. integer width = 343
  530. integer height = 48
  531. boolean bringtotop = true
  532. integer textsize = -9
  533. integer weight = 400
  534. fontcharset fontcharset = gb2312charset!
  535. fontpitch fontpitch = variable!
  536. string facename = "宋体"
  537. long textcolor = 33554432
  538. long backcolor = 16777215
  539. string text = "-供应商列表-"
  540. alignment alignment = center!
  541. boolean focusrectangle = false
  542. end type
  543. type tv_1 from uo_tv_fx_mtrltype within w_spt_mtrl_view_fx
  544. integer x = 18
  545. integer y = 300
  546. integer width = 965
  547. integer height = 1900
  548. integer taborder = 20
  549. boolean bringtotop = true
  550. integer textsize = -9
  551. fontcharset fontcharset = gb2312charset!
  552. fontfamily fontfamily = anyfont!
  553. string facename = "宋体"
  554. string picturename[] = {"StaticText!","Structure5!"}
  555. end type
  556. event selectionchanged;call super::selectionchanged;wf_retrieve_mtrl(this.ins_cur_info.mtrltypeid[1], this.ins_cur_info.sonflag[1])
  557. end event
  558. type st_2 from statictext within w_spt_mtrl_view_fx
  559. integer x = 352
  560. integer y = 220
  561. integer width = 288
  562. integer height = 48
  563. boolean bringtotop = true
  564. integer textsize = -9
  565. integer weight = 400
  566. fontcharset fontcharset = gb2312charset!
  567. fontpitch fontpitch = variable!
  568. string facename = "宋体"
  569. long textcolor = 33554432
  570. long backcolor = 16777215
  571. string text = "-产品类别-"
  572. alignment alignment = center!
  573. boolean focusrectangle = false
  574. end type
  575. type dw_1 from datawindow within w_spt_mtrl_view_fx
  576. integer x = 997
  577. integer y = 300
  578. integer width = 3259
  579. integer height = 1896
  580. integer taborder = 30
  581. boolean bringtotop = true
  582. string title = "none"
  583. string dataobject = "dw_fx_spt_mtrl_view"
  584. boolean vscrollbar = true
  585. boolean livescroll = true
  586. end type
  587. event clicked;if (row > 0) then
  588. this.SelectRow(0, false)
  589. // this.SelectRow(row, true)
  590. this.SetRow(row)
  591. if (dwo.Name = 'shopcart_pic_path') then
  592. wf_add_shopcart(0)
  593. end if
  594. end if
  595. end event
  596. event rowfocuschanged;if (currentrow > 0) then
  597. this.SelectRow(0, false)
  598. // this.SelectRow(currentrow, true)
  599. this.SetRow(currentrow)
  600. end if
  601. end event
  602. event scrollhorizontal;this.object.DataWindow.HorizontalScrollPosition = 0
  603. end event
  604. type st_3 from statictext within w_spt_mtrl_view_fx
  605. integer x = 1765
  606. integer y = 220
  607. integer width = 562
  608. integer height = 48
  609. boolean bringtotop = true
  610. integer textsize = -9
  611. integer weight = 400
  612. fontcharset fontcharset = gb2312charset!
  613. fontpitch fontpitch = variable!
  614. string facename = "宋体"
  615. long textcolor = 33554432
  616. long backcolor = 16777215
  617. string text = "编码/名称/规格 筛选:"
  618. boolean focusrectangle = false
  619. end type
  620. type pb_1 from picturebutton within w_spt_mtrl_view_fx
  621. boolean visible = false
  622. integer x = 137
  623. integer y = 2408
  624. integer width = 110
  625. integer height = 96
  626. integer taborder = 20
  627. boolean bringtotop = true
  628. integer textsize = -9
  629. integer weight = 400
  630. fontcharset fontcharset = gb2312charset!
  631. fontpitch fontpitch = variable!
  632. string facename = "宋体"
  633. string pointer = "HAND.CUR"
  634. boolean enabled = false
  635. string picturename = "OutputPrevious!"
  636. end type
  637. event clicked;if (this.PictureName = 'OutputPrevious!') then
  638. dw_1.SetSort('hisprice asc')
  639. dw_1.Sort()
  640. this.PictureName = 'OutputNext!'
  641. else
  642. dw_1.SetSort('hisprice desc')
  643. dw_1.Sort()
  644. this.PictureName = 'OutputPrevious!'
  645. end if
  646. end event
  647. type sle_filter from singlelineedit within w_spt_mtrl_view_fx
  648. integer x = 2313
  649. integer y = 204
  650. integer width = 699
  651. integer height = 84
  652. integer taborder = 20
  653. boolean bringtotop = true
  654. integer textsize = -9
  655. integer weight = 400
  656. fontcharset fontcharset = gb2312charset!
  657. fontpitch fontpitch = variable!
  658. string facename = "宋体"
  659. long textcolor = 33554432
  660. borderstyle borderstyle = stylelowered!
  661. end type
  662. event modified;this.Text = Trim(this.Text)
  663. ins_pagenum = 1
  664. wf_retrieve_mtrl(tv_1.ins_cur_info.mtrltypeid[1], tv_1.ins_cur_info.sonflag[1])
  665. //if (str <> '') then
  666. // //filter = 'mtrlcode like "%' + str + '%" or mtrlname like "%' + str + '%" or mtrlmode like "%' + str + '%"'
  667. // filter = ' (mtrlcode like ~'%' + str + '%~') '
  668. // filter += ' or (mtrlname like ~'%' + str + '%~') '
  669. // filter += ' or (mtrlmode like ~'%' + str + '%~') '
  670. // dw_1.SetFilter(filter)
  671. // dw_1.Filter()
  672. //else
  673. // dw_1.SetFilter('')
  674. // dw_1.Filter()
  675. //end if
  676. end event
  677. type cbx_all from checkbox within w_spt_mtrl_view_fx
  678. integer x = 1033
  679. integer y = 216
  680. integer width = 224
  681. integer height = 60
  682. boolean bringtotop = true
  683. integer textsize = -9
  684. integer weight = 400
  685. fontcharset fontcharset = gb2312charset!
  686. fontpitch fontpitch = variable!
  687. string facename = "宋体"
  688. long textcolor = 33554432
  689. long backcolor = 16777215
  690. string text = "全选"
  691. end type
  692. event clicked;long ch
  693. if (this.Checked) then
  694. ch = 1
  695. else
  696. ch = 0
  697. end if
  698. long i
  699. for i = 1 to dw_1.RowCount()
  700. dw_1.Object.ch[i] = ch
  701. next
  702. end event
  703. type p_shopcart from picture within w_spt_mtrl_view_fx
  704. integer x = 4027
  705. integer y = 16
  706. integer width = 219
  707. integer height = 160
  708. boolean bringtotop = true
  709. string pointer = "HAND.CUR"
  710. string picturename = "graphics\shopcart_empty.png"
  711. boolean focusrectangle = false
  712. end type
  713. event clicked;if (IsValid(s_win_open[50].win)) then // 50-我的购物车
  714. Close(s_win_open[50].win)
  715. end if
  716. Open(w_shopcart_fx)
  717. end event
  718. type st_shopcart_cnt from statictext within w_spt_mtrl_view_fx
  719. integer x = 4091
  720. integer y = 60
  721. integer width = 123
  722. integer height = 48
  723. boolean bringtotop = true
  724. integer textsize = -9
  725. integer weight = 400
  726. fontcharset fontcharset = gb2312charset!
  727. fontpitch fontpitch = variable!
  728. string facename = "宋体"
  729. string pointer = "HAND.CUR"
  730. long backcolor = 16777215
  731. string text = "0"
  732. alignment alignment = center!
  733. boolean focusrectangle = false
  734. end type
  735. event clicked;p_shopcart.post event clicked()
  736. end event
  737. type em_pagesize from editmask within w_spt_mtrl_view_fx
  738. boolean visible = false
  739. integer x = 265
  740. integer y = 2412
  741. integer width = 247
  742. integer height = 84
  743. integer taborder = 20
  744. boolean bringtotop = true
  745. integer textsize = -9
  746. integer weight = 400
  747. fontcharset fontcharset = gb2312charset!
  748. fontpitch fontpitch = variable!
  749. string facename = "宋体"
  750. long textcolor = 33554432
  751. boolean enabled = false
  752. string text = "5"
  753. alignment alignment = right!
  754. borderstyle borderstyle = stylelowered!
  755. string mask = "#"
  756. boolean spin = true
  757. double increment = 50
  758. string minmax = "1~~1000"
  759. end type
  760. type pb_uppage from picturebutton within w_spt_mtrl_view_fx
  761. integer x = 3899
  762. integer y = 196
  763. integer width = 110
  764. integer height = 96
  765. integer taborder = 10
  766. boolean bringtotop = true
  767. integer textsize = -9
  768. integer weight = 400
  769. fontcharset fontcharset = gb2312charset!
  770. fontpitch fontpitch = variable!
  771. string facename = "宋体"
  772. string pointer = "HAND.CUR"
  773. string picturename = "graphics\page_up.BMP"
  774. string disabledname = "graphics\page_up.BMP"
  775. alignment htextalign = right!
  776. string powertiptext = "上一页"
  777. end type
  778. event clicked;if (ins_pagenum <= 1) then return
  779. ins_pagenum --
  780. wf_retrieve_mtrl(tv_1.ins_cur_info.mtrltypeid[1], tv_1.ins_cur_info.sonflag[1])
  781. end event
  782. type pb_dnpage from picturebutton within w_spt_mtrl_view_fx
  783. integer x = 4023
  784. integer y = 196
  785. integer width = 110
  786. integer height = 96
  787. integer taborder = 30
  788. boolean bringtotop = true
  789. integer textsize = -9
  790. integer weight = 400
  791. fontcharset fontcharset = gb2312charset!
  792. fontpitch fontpitch = variable!
  793. string facename = "宋体"
  794. string pointer = "HAND.CUR"
  795. string picturename = "graphics\page_dn.BMP"
  796. string disabledname = "graphics\page_dn.BMP"
  797. alignment htextalign = right!
  798. string powertiptext = "下一页"
  799. end type
  800. event clicked;if (ins_pagenum >= ins_allpages) then return
  801. ins_pagenum ++
  802. wf_retrieve_mtrl(tv_1.ins_cur_info.mtrltypeid[1], tv_1.ins_cur_info.sonflag[1])
  803. end event
  804. type st_4 from statictext within w_spt_mtrl_view_fx
  805. integer x = 3237
  806. integer y = 220
  807. integer width = 183
  808. integer height = 48
  809. boolean bringtotop = true
  810. integer textsize = -9
  811. integer weight = 400
  812. fontcharset fontcharset = gb2312charset!
  813. fontpitch fontpitch = variable!
  814. string facename = "宋体"
  815. long backcolor = 16777215
  816. string text = "当前页"
  817. alignment alignment = center!
  818. boolean focusrectangle = false
  819. end type
  820. type em_cur_page from editmask within w_spt_mtrl_view_fx
  821. integer x = 3429
  822. integer y = 212
  823. integer width = 128
  824. integer height = 68
  825. integer taborder = 10
  826. boolean bringtotop = true
  827. integer textsize = -9
  828. integer weight = 400
  829. fontcharset fontcharset = gb2312charset!
  830. fontpitch fontpitch = variable!
  831. string facename = "宋体"
  832. long textcolor = 33554432
  833. string text = "1"
  834. alignment alignment = center!
  835. string mask = "#####"
  836. string minmax = "1~~999"
  837. end type
  838. event modified;long page
  839. if IsNumber(this.Text) then
  840. page = long(this.Text)
  841. if (page >=1 and page <= ins_allpages) then
  842. ins_pagenum = page
  843. wf_retrieve_mtrl(tv_1.ins_cur_info.mtrltypeid[1], tv_1.ins_cur_info.sonflag[1])
  844. else
  845. this.Text = string(ins_pagenum)
  846. end if
  847. else
  848. this.Text = string(ins_pagenum)
  849. end if
  850. end event
  851. type st_allpages from statictext within w_spt_mtrl_view_fx
  852. integer x = 3566
  853. integer y = 220
  854. integer width = 178
  855. integer height = 48
  856. boolean bringtotop = true
  857. integer textsize = -9
  858. integer weight = 400
  859. fontcharset fontcharset = gb2312charset!
  860. fontpitch fontpitch = variable!
  861. string facename = "宋体"
  862. long backcolor = 16777215
  863. string text = "/1"
  864. boolean focusrectangle = false
  865. end type
  866. type pb_page_top from picturebutton within w_spt_mtrl_view_fx
  867. integer x = 3776
  868. integer y = 196
  869. integer width = 110
  870. integer height = 96
  871. integer taborder = 10
  872. boolean bringtotop = true
  873. integer textsize = -9
  874. integer weight = 400
  875. fontcharset fontcharset = gb2312charset!
  876. fontpitch fontpitch = variable!
  877. string facename = "宋体"
  878. string picturename = "graphics\page_top.BMP"
  879. string disabledname = "graphics\page_top.BMP"
  880. alignment htextalign = right!
  881. string powertiptext = "首页"
  882. end type
  883. event clicked;ins_pagenum = 1
  884. wf_retrieve_mtrl(tv_1.ins_cur_info.mtrltypeid[1], tv_1.ins_cur_info.sonflag[1])
  885. end event
  886. type pb_page_end from picturebutton within w_spt_mtrl_view_fx
  887. integer x = 4146
  888. integer y = 196
  889. integer width = 110
  890. integer height = 96
  891. integer taborder = 10
  892. boolean bringtotop = true
  893. integer textsize = -9
  894. integer weight = 400
  895. fontcharset fontcharset = gb2312charset!
  896. fontpitch fontpitch = variable!
  897. string facename = "宋体"
  898. string picturename = "graphics\page_end.BMP"
  899. string disabledname = "graphics\page_end.BMP"
  900. alignment htextalign = right!
  901. string powertiptext = "末页"
  902. end type
  903. event clicked;ins_pagenum = ins_allpages
  904. wf_retrieve_mtrl(tv_1.ins_cur_info.mtrltypeid[1], tv_1.ins_cur_info.sonflag[1])
  905. end event