w_spt_price_rece_fx.srw 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. $PBExportHeader$w_spt_price_rece_fx.srw
  2. $PBExportComments$分销系统--供应商询价单接收窗口
  3. forward
  4. global type w_spt_price_rece_fx from w_publ_base_style
  5. end type
  6. type cb_accept from uo_imflatbutton within w_spt_price_rece_fx
  7. end type
  8. type dw_main from datawindow within w_spt_price_rece_fx
  9. end type
  10. type st_1 from statictext within w_spt_price_rece_fx
  11. end type
  12. type mle_summary from multilineedit within w_spt_price_rece_fx
  13. end type
  14. type st_2 from statictext within w_spt_price_rece_fx
  15. end type
  16. type mle_postscript from multilineedit within w_spt_price_rece_fx
  17. end type
  18. type st_3 from statictext within w_spt_price_rece_fx
  19. end type
  20. type mle_remark from multilineedit within w_spt_price_rece_fx
  21. end type
  22. type dw_mx from u_dw_rbtnfilter within w_spt_price_rece_fx
  23. end type
  24. end forward
  25. global type w_spt_price_rece_fx from w_publ_base_style
  26. integer width = 4686
  27. integer height = 2104
  28. string title = "接收-询价单"
  29. boolean minbox = false
  30. windowtype windowtype = response!
  31. windowstate windowstate = maximized!
  32. long backcolor = 16777215
  33. string icon = "graphics\chain_link_128px.ico"
  34. boolean center = true
  35. cb_accept cb_accept
  36. dw_main dw_main
  37. st_1 st_1
  38. mle_summary mle_summary
  39. st_2 st_2
  40. mle_postscript mle_postscript
  41. st_3 st_3
  42. mle_remark mle_remark
  43. dw_mx dw_mx
  44. end type
  45. global w_spt_price_rece_fx w_spt_price_rece_fx
  46. type variables
  47. s_open_packet s_tran
  48. long ins_ret = 0 // 1-关闭并打开供应商询价单界面
  49. end variables
  50. forward prototypes
  51. public function integer wf_retrieve ()
  52. public subroutine wf_send (readonly string arg_postscript)
  53. end prototypes
  54. public function integer wf_retrieve ();int rslt = 1
  55. dw_main.ReSet()
  56. dw_mx.ReSet()
  57. oleobject obj, sptPrice, sptPricemx, mxItem
  58. string arg_msg
  59. obj = FXAppCom.GetReceSptPrice(app_token_fx, s_tran.sn, ref arg_msg)
  60. if (arg_msg <> '') then
  61. MessageBox('提示', '获取供应商询价单信息失败:' + arg_msg)
  62. rslt = 0
  63. goto ext
  64. end if
  65. dw_main.SetRedraw(false)
  66. long row
  67. row = dw_main.InsertRow(0)
  68. sptPrice = obj.GetPBDictionary('sptPrice')
  69. dw_main.Object.billcode[row] = sptPrice.GetString('billcode')
  70. if (not IsNull(sptPrice.GetDateTime('billdate'))) then
  71. dw_main.Object.billdate[row] = sptPrice.GetDateTime('billdate')
  72. end if
  73. dw_main.Object.inrep[row] = sptPrice.GetString('inrep')
  74. dw_main.Object.dscrp[row] = sptPrice.GetString('dscrp')
  75. dw_main.Object.moneyname[row] = sptPrice.GetString('moneyname')
  76. dw_main.Object.opemp[row] = sptPrice.GetString('opemp')
  77. if (not IsNull(sptPrice.GetDateTime('opdate'))) then
  78. dw_main.Object.opdate[row] = sptPrice.GetDateTime('opdate')
  79. end if
  80. dw_main.Object.ConfirmUser[row] = sptPrice.GetString('ConfirmUser')
  81. if (not IsNull(sptPrice.GetDateTime('ConfirmTime'))) then
  82. dw_main.Object.ConfirmTime[row] = sptPrice.GetDateTime('ConfirmTime')
  83. end if
  84. dw_main.Object.comname[row] = sptPrice.GetString('comname')
  85. if (not IsNull(sptPrice.GetDateTime('requiredate'))) then
  86. dw_main.Object.requiredate[row] = sptPrice.GetDateTime('requiredate')
  87. end if
  88. dw_main.SetRedraw(true)
  89. dw_mx.SetRedraw(false)
  90. sptPricemx = obj.GetArrOfPBDictionary('sptPricemx')
  91. long i
  92. for i = 1 to sptPricemx.Count
  93. row = dw_mx.InsertRow(0)
  94. mxItem = sptPricemx.GetItem(i - 1)
  95. dw_mx.Object.printid[row] = mxItem.GetInt('printid')
  96. dw_mx.Object.mtrlid[row] = mxItem.GetInt('mtrlid')
  97. dw_mx.Object.sptmtrlcode[row] = mxItem.GetString('sptmtrlcode')
  98. dw_mx.Object.sptmtrlname[row] = mxItem.GetString('sptmtrlname')
  99. dw_mx.Object.sptmtrlmode[row] = mxItem.GetString('sptmtrlmode')
  100. dw_mx.Object.unit[row] = mxItem.GetString('unit')
  101. dw_mx.Object.price[row] = mxItem.GetDouble('price')
  102. // dw_mx.Object.reprice[row] = mxItem.GetDouble('price')
  103. // dw_mx.Object.rebate[row] = 1
  104. dw_mx.Object.qty[row] = mxItem.GetDouble('qty')
  105. dw_mx.Object.qty1[row] = mxItem.GetDouble('qty1')
  106. dw_mx.Object.dscrp[row] = mxItem.GetString('dscrp')
  107. dw_mx.Object.status[row] = mxItem.GetString('status')
  108. dw_mx.Object.woodcode[row] = mxItem.GetString('woodcode')
  109. dw_mx.Object.pcode[row] = mxItem.GetString('pcode')
  110. dw_mx.Object.jgdscrp[row] = mxItem.GetString('jgdscrp')
  111. dw_mx.Object.buydays[row] = mxItem.GetDouble('buydays')
  112. next
  113. dw_mx.SetRedraw(true)
  114. if (f_find_fx_user_power(11, ref arg_msg) <> 1) then // 11-供应商询价单查看(单价)
  115. dw_mx.Modify('destroy price_t ~r~n destroy price ~r~n')
  116. // dw_mx.Modify('destroy reprice_t ~r~n destroy reprice ~r~n')
  117. // dw_mx.Modify('destroy rebate_t ~r~n destroy rebate ~r~n')
  118. // dw_mx.Modify('destroy compute_price_t ~r~n destroy compute_price ~r~n')
  119. end if
  120. if (sptPrice.GetInt('Complete') <> 1 and f_find_fx_user_power(12, ref arg_msg) = 1) then // 12-供应商询价单接收
  121. cb_accept.Enabled = true
  122. else
  123. cb_accept.Enabled = false
  124. end if
  125. ext:
  126. return rslt
  127. end function
  128. public subroutine wf_send (readonly string arg_postscript);//oleobject mxs, mxItem
  129. //mxs = FXAppCom.CreArrOfPbDictionary()
  130. //
  131. //long i
  132. //for i = 1 to dw_mx.RowCount()
  133. // mxItem = FXAppCom.CreatePbDictionary()
  134. //
  135. // mxItem.SetInt('printid', dw_mx.Object.printid[i])
  136. // mxItem.SetInt('mtrlid', dw_mx.Object.mtrlid[i])
  137. // mxItem.SetString('sptmtrlcode', dw_mx.Object.sptmtrlcode[i])
  138. // mxItem.SetString('sptmtrlname', dw_mx.Object.sptmtrlname[i])
  139. // mxItem.SetString('sptmtrlmode', dw_mx.Object.sptmtrlmode[i])
  140. // mxItem.SetString('unit', dw_mx.Object.unit[i])
  141. // mxItem.SetDouble('reprice', dw_mx.Object.reprice[i])
  142. // mxItem.SetDouble('rebate', dw_mx.Object.rebate[i])
  143. // mxItem.SetDouble('qty', dw_mx.Object.qty[i])
  144. // mxItem.SetDouble('qty1', dw_mx.Object.qty1[i])
  145. // mxItem.SetString('dscrp', dw_mx.Object.dscrp[i])
  146. // mxItem.SetString('status', dw_mx.Object.status[i])
  147. // mxItem.SetString('woodcode', dw_mx.Object.woodcode[i])
  148. // mxItem.SetString('pcode', dw_mx.Object.pcode[i])
  149. // mxItem.SetDouble('buydays', dw_mx.Object.buydays[i])
  150. //
  151. // mxs.Add(mxItem)
  152. //next
  153. //
  154. //string arg_msg
  155. //FXAppCom.SendQuote(app_token_fx, s_tran.sn, arg_postscript, mxs, ref arg_msg)
  156. //
  157. //if (arg_msg <> '') then
  158. // MessageBox('提示', '报价失败:' + arg_msg)
  159. //else
  160. // MessageBox('提示', '报价成功!')
  161. // Close(this)
  162. //end if
  163. end subroutine
  164. on w_spt_price_rece_fx.create
  165. int iCurrent
  166. call super::create
  167. this.cb_accept=create cb_accept
  168. this.dw_main=create dw_main
  169. this.st_1=create st_1
  170. this.mle_summary=create mle_summary
  171. this.st_2=create st_2
  172. this.mle_postscript=create mle_postscript
  173. this.st_3=create st_3
  174. this.mle_remark=create mle_remark
  175. this.dw_mx=create dw_mx
  176. iCurrent=UpperBound(this.Control)
  177. this.Control[iCurrent+1]=this.cb_accept
  178. this.Control[iCurrent+2]=this.dw_main
  179. this.Control[iCurrent+3]=this.st_1
  180. this.Control[iCurrent+4]=this.mle_summary
  181. this.Control[iCurrent+5]=this.st_2
  182. this.Control[iCurrent+6]=this.mle_postscript
  183. this.Control[iCurrent+7]=this.st_3
  184. this.Control[iCurrent+8]=this.mle_remark
  185. this.Control[iCurrent+9]=this.dw_mx
  186. end on
  187. on w_spt_price_rece_fx.destroy
  188. call super::destroy
  189. destroy(this.cb_accept)
  190. destroy(this.dw_main)
  191. destroy(this.st_1)
  192. destroy(this.mle_summary)
  193. destroy(this.st_2)
  194. destroy(this.mle_postscript)
  195. destroy(this.st_3)
  196. destroy(this.mle_remark)
  197. destroy(this.dw_mx)
  198. end on
  199. event open;call super::open;s_tran = Message.PowerObjectParm
  200. if IsNUll(s_tran) then
  201. MessageBox('提示', '打开方式有误')
  202. Close(this)
  203. return
  204. end if
  205. if (not IsValid(s_tran)) then
  206. MessageBox('提示', '打开方式无效')
  207. Close(this)
  208. return
  209. end if
  210. string arg_msg // 10-供应商询价单 11-供应商询价单查看(单价)
  211. if (f_find_fx_user_power(10, ref arg_msg) <> 1 &
  212. and f_find_fx_user_power(11, ref arg_msg) <> 1) then
  213. MessageBox('权限提示', arg_msg)
  214. Close(this)
  215. return
  216. end if
  217. mle_summary.Text = s_tran.summary
  218. mle_postscript.Text = s_tran.postscript
  219. mle_remark.Text = s_tran.remark
  220. //if (s_tran.ifread = 1) then
  221. // cb_accept.Enabled = false
  222. //end if
  223. if (wf_retrieve( ) = 0) then
  224. Close(this)
  225. end if
  226. end event
  227. event resize;call super::resize;if (this.Width < 3762) then this.Width = 3762
  228. if (this.Height < 2292) then this.Height = 2292
  229. mle_summary.Width = this.workspacewidth( ) - mle_summary.X - 14
  230. mle_postscript.Width = mle_summary.Width
  231. mle_remark.Width = mle_summary.Width
  232. dw_mx.Width = this.workspacewidth( )
  233. dw_mx.Height = this.workspaceheight( ) - dw_main.Y - dw_main.Height
  234. cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  235. end event
  236. event close;call super::close;CloseWithReturn(this, ins_ret)
  237. end event
  238. type cb_func from w_publ_base_style`cb_func within w_spt_price_rece_fx
  239. boolean visible = false
  240. end type
  241. type cb_exit from w_publ_base_style`cb_exit within w_spt_price_rece_fx
  242. integer x = 3136
  243. end type
  244. type ln_bar from w_publ_base_style`ln_bar within w_spt_price_rece_fx
  245. end type
  246. type ln_bar2 from w_publ_base_style`ln_bar2 within w_spt_price_rece_fx
  247. end type
  248. type r_bar from w_publ_base_style`r_bar within w_spt_price_rece_fx
  249. end type
  250. type cb_accept from uo_imflatbutton within w_spt_price_rece_fx
  251. integer width = 430
  252. integer height = 164
  253. integer taborder = 30
  254. boolean bringtotop = true
  255. string text = "转为销售报价单"
  256. string normalpicname = "ok.bmp"
  257. integer picsize = 16
  258. toolbaralignment pic_align = alignattop!
  259. boolean border = false
  260. end type
  261. event clicked;call super::clicked;dw_mx.SetFilter('')
  262. dw_mx.Filter()
  263. //dw_mx.AcceptText()
  264. if (dw_mx.RowCount() <= 0) then
  265. MessageBox('提示', '没有报价明细,或者是获取询价明细失败')
  266. return
  267. end if
  268. //string sum_msg
  269. //long i
  270. //for i = 1 to dw_mx.RowCount()
  271. // if (dw_mx.Object.reprice[i] <= 0) then
  272. // sum_msg = '第' + string(i) + '行,回复报价为0~r~n'
  273. // end if
  274. //next
  275. string arg_msg
  276. if (f_find_fx_user_power(12, ref arg_msg) <> 1) then // 12-供应商询价单接收
  277. MessageBox('权限提示', arg_msg)
  278. return
  279. end if
  280. //if (MessageBox('提示', sum_msg + '确定发送给客户进行报价?', Question!, YesNoCancel!) <> 1) then return
  281. //Open(w_packet_msg_edit_fx)
  282. //
  283. //s_open_packet s_ret
  284. //s_ret = Message.PowerObjectParm
  285. //
  286. //if (s_ret.returnflag = 0) then
  287. // MessageBox('提示', '操作已取消')
  288. // return
  289. //end if
  290. //
  291. //if (Len(s_ret.postscript) > 500) then
  292. // MessageBox('提示', '留言板信息超长(500),请进行删减')
  293. // return
  294. //end if
  295. //wf_send(s_ret.postscript)
  296. oleobject parm
  297. parm = FXAppCom.CreatePbDictionary()
  298. parm.SetString('token', app_token_fx)
  299. parm.SetString('sn', s_tran.sn)
  300. FXAppCom.AcceptReceSptPrice(parm, ref arg_msg)
  301. if (arg_msg <> '') then
  302. MessageBox('提示', '操作失败:' + arg_msg)
  303. return
  304. else
  305. if (MessageBox('提示', '操作成功,现在需要跳转到供应商询价单界面吗?', Question!, YesNo!) = 1) then
  306. ins_ret = 1
  307. else
  308. ins_ret = 0
  309. end if
  310. Close(parent)
  311. end if
  312. end event
  313. type dw_main from datawindow within w_spt_price_rece_fx
  314. integer y = 172
  315. integer width = 1888
  316. integer height = 780
  317. integer taborder = 20
  318. boolean bringtotop = true
  319. string title = "none"
  320. string dataobject = "dw_tempsptprice"
  321. boolean livescroll = true
  322. end type
  323. type st_1 from statictext within w_spt_price_rece_fx
  324. boolean visible = false
  325. integer x = 1906
  326. integer y = 172
  327. integer width = 146
  328. integer height = 48
  329. boolean bringtotop = true
  330. integer textsize = -9
  331. integer weight = 400
  332. fontcharset fontcharset = gb2312charset!
  333. fontpitch fontpitch = variable!
  334. string facename = "宋体"
  335. long textcolor = 33554432
  336. long backcolor = 16777215
  337. string text = "摘要"
  338. boolean focusrectangle = false
  339. end type
  340. type mle_summary from multilineedit within w_spt_price_rece_fx
  341. boolean visible = false
  342. integer x = 1906
  343. integer y = 232
  344. integer width = 1847
  345. integer height = 300
  346. integer taborder = 30
  347. boolean bringtotop = true
  348. integer textsize = -9
  349. integer weight = 400
  350. fontcharset fontcharset = gb2312charset!
  351. fontpitch fontpitch = variable!
  352. string facename = "宋体"
  353. long textcolor = 33554432
  354. boolean vscrollbar = true
  355. boolean autovscroll = true
  356. end type
  357. type st_2 from statictext within w_spt_price_rece_fx
  358. integer x = 1906
  359. integer y = 176
  360. integer width = 146
  361. integer height = 48
  362. boolean bringtotop = true
  363. integer textsize = -9
  364. integer weight = 400
  365. fontcharset fontcharset = gb2312charset!
  366. fontpitch fontpitch = variable!
  367. string facename = "宋体"
  368. long textcolor = 33554432
  369. long backcolor = 16777215
  370. string text = "附言"
  371. boolean focusrectangle = false
  372. end type
  373. type mle_postscript from multilineedit within w_spt_price_rece_fx
  374. integer x = 1906
  375. integer y = 232
  376. integer width = 1847
  377. integer height = 320
  378. integer taborder = 40
  379. boolean bringtotop = true
  380. integer textsize = -9
  381. integer weight = 400
  382. fontcharset fontcharset = gb2312charset!
  383. fontpitch fontpitch = variable!
  384. string facename = "宋体"
  385. long textcolor = 33554432
  386. boolean vscrollbar = true
  387. boolean autovscroll = true
  388. end type
  389. type st_3 from statictext within w_spt_price_rece_fx
  390. integer x = 1906
  391. integer y = 572
  392. integer width = 146
  393. integer height = 48
  394. boolean bringtotop = true
  395. integer textsize = -9
  396. integer weight = 400
  397. fontcharset fontcharset = gb2312charset!
  398. fontpitch fontpitch = variable!
  399. string facename = "宋体"
  400. long textcolor = 33554432
  401. long backcolor = 16777215
  402. string text = "备注"
  403. boolean focusrectangle = false
  404. end type
  405. type mle_remark from multilineedit within w_spt_price_rece_fx
  406. integer x = 1906
  407. integer y = 632
  408. integer width = 1847
  409. integer height = 320
  410. integer taborder = 40
  411. boolean bringtotop = true
  412. integer textsize = -9
  413. integer weight = 400
  414. fontcharset fontcharset = gb2312charset!
  415. fontpitch fontpitch = variable!
  416. string facename = "宋体"
  417. long textcolor = 33554432
  418. boolean vscrollbar = true
  419. boolean autovscroll = true
  420. end type
  421. type dw_mx from u_dw_rbtnfilter within w_spt_price_rece_fx
  422. integer y = 956
  423. integer width = 4654
  424. integer height = 1060
  425. integer taborder = 20
  426. boolean bringtotop = true
  427. boolean titlebar = true
  428. string title = "单据明细内容"
  429. string dataobject = "dw_tempsptpricemx"
  430. boolean controlmenu = true
  431. boolean maxbox = true
  432. boolean hscrollbar = true
  433. boolean vscrollbar = true
  434. boolean resizable = true
  435. boolean border = false
  436. boolean hsplitscroll = true
  437. boolean rbutton_filter_use = true
  438. boolean rbutton_setposition_use = true
  439. boolean titleclick_sort_use = true
  440. end type
  441. event clicked;call super::clicked;if (row > 0) then
  442. this.SelectRow(0, false)
  443. this.SelectRow(row, true)
  444. this.SetRow(row)
  445. end if
  446. end event
  447. event dwnkey;call super::dwnkey;if (key = KeyDownArrow!) then
  448. //dw_mx.SelectText(1, Len(dw_mx.GetText()))
  449. elseif (key = KeyUpArrow!) then
  450. end if
  451. end event
  452. event rowfocuschanged;call super::rowfocuschanged;if (currentrow > 0) then
  453. string colName
  454. colName = this.GetColumnName()
  455. if (colName = 'reprice' or colName = 'rebate') then
  456. this.SelectText(1, Len(this.GetText()))
  457. end if
  458. end if
  459. end event
  460. event itemfocuschanged;call super::itemfocuschanged;if (row > 0) then
  461. this.SelectRow(0, false)
  462. this.SelectRow(row, true)
  463. this.SetRow(row)
  464. string colName
  465. colName = this.GetColumnName()
  466. if (colName = 'reprice' or colName = 'rebate') then
  467. this.SelectText(1, Len(this.GetText()))
  468. end if
  469. end if
  470. end event