w_quote_rece_fx.srw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. $PBExportHeader$w_quote_rece_fx.srw
  2. $PBExportComments$分销系统--供应商报价单接收窗口
  3. forward
  4. global type w_quote_rece_fx from w_publ_base_style
  5. end type
  6. type cb_accept from uo_imflatbutton within w_quote_rece_fx
  7. end type
  8. type cb_reject from uo_imflatbutton within w_quote_rece_fx
  9. end type
  10. type dw_main from datawindow within w_quote_rece_fx
  11. end type
  12. type st_2 from statictext within w_quote_rece_fx
  13. end type
  14. type mle_postscript from multilineedit within w_quote_rece_fx
  15. end type
  16. type st_3 from statictext within w_quote_rece_fx
  17. end type
  18. type mle_remark from multilineedit within w_quote_rece_fx
  19. end type
  20. type dw_mx from u_dw_rbtnfilter within w_quote_rece_fx
  21. end type
  22. type cbx_audit from checkbox within w_quote_rece_fx
  23. end type
  24. end forward
  25. global type w_quote_rece_fx from w_publ_base_style
  26. integer width = 3771
  27. integer height = 2372
  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. cb_accept cb_accept
  35. cb_reject cb_reject
  36. dw_main dw_main
  37. st_2 st_2
  38. mle_postscript mle_postscript
  39. st_3 st_3
  40. mle_remark mle_remark
  41. dw_mx dw_mx
  42. cbx_audit cbx_audit
  43. end type
  44. global w_quote_rece_fx w_quote_rece_fx
  45. type variables
  46. s_open_packet s_tran
  47. long ins_ifmatch // 0-与原询价单不匹配 1-匹配 (-1)-获取原询价单失败
  48. long ins_complete // packet是否被处理 1-已处理 0-未处理
  49. end variables
  50. forward prototypes
  51. public subroutine wf_retrieve ()
  52. end prototypes
  53. public subroutine wf_retrieve ();dw_main.ReSet()
  54. dw_mx.ReSet()
  55. oleobject parm, retParm
  56. parm = FXAppCom.CreatePbDictionary()
  57. parm.SetString('token', app_token_fx)
  58. parm.SetString('sn', s_tran.sn)
  59. string arg_msg
  60. retParm = FXAppCom.GetReceQuote(parm, ref arg_msg)
  61. if (arg_msg <> '') then
  62. MessageBox('提示', '获取供应商报价单失败:' + arg_msg)
  63. return
  64. end if
  65. long row
  66. dw_main.SetRedraw(false)
  67. oleobject quote
  68. quote = retParm.GetPBDictionary('quote')
  69. row = dw_main.InsertRow(0)
  70. dw_main.Object.quotecode[row] = quote.GetString('quotecode')
  71. if (not IsNull(quote.GetDateTime('quotedate'))) then
  72. dw_main.Object.quotedate[row] = quote.GetDateTime('quotedate')
  73. end if
  74. dw_main.Object.assign_emp[row] = quote.GetString('assign_emp')
  75. dw_main.Object.dscrp[row] = quote.GetString('dscrp')
  76. dw_main.Object.opemp[row] = quote.GetString('opemp')
  77. if (not IsNull(quote.GetDateTime('opdate'))) then
  78. dw_main.Object.opdate[row] = quote.GetDateTime('opdate')
  79. end if
  80. dw_main.Object.moneyname[row] = quote.GetString('moneyname')
  81. dw_main.Object.fiebrelcode[row] = quote.GetString('fiebrelcode')
  82. if (not IsNull(quote.GetDateTime('ConfirmTime'))) then
  83. dw_main.Object.ConfirmTime[row] = quote.GetDateTime('ConfirmTime')
  84. end if
  85. dw_main.Object.ConfirmUser[row] = quote.GetString('ConfirmUser')
  86. dw_main.Object.comname[row] = quote.GetString('comname')
  87. dw_main.SetRedraw(true)
  88. long i
  89. dw_mx.SetRedraw(false)
  90. oleobject quotemxs, item
  91. quotemxs = retParm.GetArrOfPBDictionary('quotemxs')
  92. for i = 1 to quotemxs.Count
  93. row = dw_mx.InsertRow(0)
  94. item = quotemxs.GetItem(i - 1)
  95. if (not IsNull(item.GetDateTime('requiredate'))) then
  96. dw_mx.Object.requiredate[row] = item.GetDateTime('requiredate')
  97. dw_mx.Object.ifmatch[row] = 1
  98. else
  99. dw_mx.Object.ifmatch[row] = 0
  100. end if
  101. dw_mx.Object.printid[row] = item.GetInt('printid')
  102. dw_mx.Object.mtrlcode[row] = item.GetString('mtrlcode')
  103. dw_mx.Object.mtrlname[row] = item.GetString('mtrlname')
  104. dw_mx.Object.mtrlmode[row] = item.GetString('mtrlmode')
  105. dw_mx.Object.unit[row] = item.GetString('unit')
  106. dw_mx.Object.price[row] = item.GetDouble('price')
  107. if (not IsNull(item.GetDouble('oriPrice'))) then
  108. dw_mx.Object.oriPrice[row] = item.GetDouble('oriPrice')
  109. end if
  110. dw_mx.Object.qty[row] = item.GetDouble('qty')
  111. dw_mx.Object.qty1[row] = item.GetDouble('qty1')
  112. dw_mx.Object.status[row] = item.GetString('status')
  113. dw_mx.Object.woodcode[row] = item.GetString('woodcode')
  114. dw_mx.Object.pcode[row] = item.GetString('pcode')
  115. dw_mx.Object.reBuyDays[row] = item.GetDouble('reBuyDays')
  116. if (not IsNull(item.GetDouble('buydays'))) then
  117. dw_mx.Object.buydays[row] = item.GetDouble('buydays')
  118. end if
  119. dw_mx.Object.perfinishdate[row] = item.GetDateTime('perfinishdate')
  120. next
  121. dw_mx.SetRedraw(true)
  122. ins_ifmatch = retParm.GetInt('ifmatch') // 0-与原询价单不匹配 1-匹配 (-1)-获取原询价单失败
  123. ins_complete = quote.GetInt('Complete')
  124. if (f_find_fx_user_power(131, ref arg_msg) <> 1) then // 131-销售报价单查看(单价)
  125. dw_mx.Modify('destroy price_t ~r~n destroy price ~r~n')
  126. dw_mx.Modify('destroy oriprice_t ~r~n destroy oriprice ~r~n')
  127. end if
  128. if (ins_complete <> 1 and f_find_fx_user_power(132, ref arg_msg) = 1) then // 132-销售报价单确认
  129. cb_accept.Enabled = true
  130. else
  131. cb_accept.Enabled = false
  132. end if
  133. if (ins_complete <> 1 and f_find_fx_user_power(133, ref arg_msg) = 1) then // 133-销售报价单拒绝
  134. cb_reject.Enabled = true
  135. else
  136. cb_reject.Enabled = false
  137. end if
  138. if (f_find_fx_user_power(138, ref arg_msg) <> 1) then // 138-销售报价单审核
  139. cbx_audit.Enabled = false
  140. end if
  141. end subroutine
  142. on w_quote_rece_fx.create
  143. int iCurrent
  144. call super::create
  145. this.cb_accept=create cb_accept
  146. this.cb_reject=create cb_reject
  147. this.dw_main=create dw_main
  148. this.st_2=create st_2
  149. this.mle_postscript=create mle_postscript
  150. this.st_3=create st_3
  151. this.mle_remark=create mle_remark
  152. this.dw_mx=create dw_mx
  153. this.cbx_audit=create cbx_audit
  154. iCurrent=UpperBound(this.Control)
  155. this.Control[iCurrent+1]=this.cb_accept
  156. this.Control[iCurrent+2]=this.cb_reject
  157. this.Control[iCurrent+3]=this.dw_main
  158. this.Control[iCurrent+4]=this.st_2
  159. this.Control[iCurrent+5]=this.mle_postscript
  160. this.Control[iCurrent+6]=this.st_3
  161. this.Control[iCurrent+7]=this.mle_remark
  162. this.Control[iCurrent+8]=this.dw_mx
  163. this.Control[iCurrent+9]=this.cbx_audit
  164. end on
  165. on w_quote_rece_fx.destroy
  166. call super::destroy
  167. destroy(this.cb_accept)
  168. destroy(this.cb_reject)
  169. destroy(this.dw_main)
  170. destroy(this.st_2)
  171. destroy(this.mle_postscript)
  172. destroy(this.st_3)
  173. destroy(this.mle_remark)
  174. destroy(this.dw_mx)
  175. destroy(this.cbx_audit)
  176. end on
  177. event open;call super::open;s_tran = Message.PowerObjectParm
  178. if IsNUll(s_tran) then
  179. MessageBox('提示', '打开方式有误,SN号为空')
  180. Close(this)
  181. return
  182. end if
  183. cbx_audit.BackColor = 14215660
  184. string arg_msg // 130-销售报价单 131-销售报价单查看(单价)
  185. if (f_find_fx_user_power(130, ref arg_msg) <> 1 &
  186. and f_find_fx_user_power(131, ref arg_msg) <> 1) then
  187. MessageBox('权限提示', arg_msg)
  188. Close(this)
  189. return
  190. end if
  191. mle_postscript.Text = s_tran.postscript
  192. mle_remark.Text = s_tran.remark
  193. ins_ifmatch = 0
  194. wf_retrieve()
  195. end event
  196. event resize;call super::resize;if (this.Width < 3762) then this.Width = 3762
  197. if (this.Height < 2292) then this.Height = 2292
  198. mle_postscript.Width = this.workspacewidth( ) - mle_postscript.X - 14
  199. mle_remark.Width = mle_postscript.Width
  200. dw_mx.Width = this.workspacewidth( )
  201. dw_mx.Height = this.workspaceheight( ) - dw_mx.Y
  202. cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  203. end event
  204. type cb_func from w_publ_base_style`cb_func within w_quote_rece_fx
  205. boolean visible = false
  206. end type
  207. type cb_exit from w_publ_base_style`cb_exit within w_quote_rece_fx
  208. integer x = 2359
  209. end type
  210. type ln_bar from w_publ_base_style`ln_bar within w_quote_rece_fx
  211. end type
  212. type ln_bar2 from w_publ_base_style`ln_bar2 within w_quote_rece_fx
  213. end type
  214. type r_bar from w_publ_base_style`r_bar within w_quote_rece_fx
  215. integer x = 1367
  216. end type
  217. type cb_accept from uo_imflatbutton within w_quote_rece_fx
  218. integer width = 329
  219. integer height = 164
  220. integer taborder = 30
  221. boolean bringtotop = true
  222. string text = "更新询价单"
  223. string normalpicname = "ok.bmp"
  224. integer picsize = 16
  225. toolbaralignment pic_align = alignattop!
  226. boolean border = false
  227. end type
  228. event clicked;call super::clicked;dw_mx.SetFilter('')
  229. dw_mx.Filter()
  230. if (dw_mx.RowCount() <= 0) then
  231. MessageBox('提示', '没有报价明细')
  232. return
  233. end if
  234. string arg_msg
  235. if (f_find_fx_user_power(132, ref arg_msg) <> 1) then // 132-销售报价单确认
  236. MessageBox('权限提示', arg_msg)
  237. return
  238. end if
  239. string fiebrelcode
  240. long row
  241. row = dw_main.GetRow()
  242. if (row > 0) then
  243. fiebrelcode = Trim(dw_main.Object.fiebrelcode[row])
  244. end if
  245. long mode // 1-直接更新 2-新建询价单
  246. mode = 0
  247. if (ins_ifmatch = 1) then // 1-匹配
  248. mode = 1
  249. elseif (ins_ifmatch = 0) then // 0-与原询价单不匹配
  250. if (MessageBox('提示', '该报价单与原询价单在某些明细项存在不匹配的情况,是否以该报价单为准,新建询价单?', Question!, YesNoCancel!) <> 1) then return
  251. mode = 2
  252. elseif (ins_ifmatch = -1) then // (-1)-获取原询价单失败
  253. if (MessageBox('提示', '原询价单[' + fiebrelcode + ']不存在(可能已被删除),是否以该报价单为准,新建询价单?', Question!, YesNoCancel!) <> 1) then return
  254. mode = 2
  255. else
  256. return
  257. end if
  258. if (mode = 2) then
  259. if (f_find_fx_user_power(134, ref arg_msg) <> 1) then // 134-询价单新建
  260. MessageBox('权限提示', arg_msg)
  261. return
  262. end if
  263. end if
  264. long audit
  265. if (cbx_audit.Checked) then
  266. if (f_find_fx_user_power(138, ref arg_msg) <> 1) then // 138-销售报价单审核
  267. MessageBox('权限提示', arg_msg)
  268. return
  269. end if
  270. audit = 1
  271. else
  272. audit = 0
  273. end if
  274. oleobject parm, retParm
  275. parm = FXAppCom.CreatePbDictionary()
  276. parm.SetString('token', app_token_fx)
  277. parm.SetString('sn', s_tran.sn)
  278. parm.SetString('fiebrelcode', fiebrelcode)
  279. parm.SetInt('mode', mode)
  280. parm.SetInt('audit', audit)
  281. retParm = FXAppCom.AcceptQuote(parm, ref arg_msg)
  282. if (arg_msg <> '') then
  283. MessageBox('提示', '更新询价单操作失败:' + arg_msg)
  284. return
  285. end if
  286. MessageBox('提示', '操作成功')
  287. if (mode = 2) then
  288. if (IsValid(s_win_open[130].win)) then // 130-销售报价单
  289. Close(s_win_open[130].win)
  290. end if
  291. Open(w_spt_price_change_fx)
  292. end if
  293. Close(parent)
  294. end event
  295. type cb_reject from uo_imflatbutton within w_quote_rece_fx
  296. integer x = 334
  297. integer width = 165
  298. integer height = 164
  299. integer taborder = 30
  300. boolean bringtotop = true
  301. string text = "拒绝"
  302. string normalpicname = "DELETE.BMP"
  303. integer picsize = 16
  304. toolbaralignment pic_align = alignattop!
  305. boolean border = false
  306. end type
  307. event clicked;call super::clicked;string arg_msg
  308. if (f_find_fx_user_power(133, ref arg_msg) <> 1) then // 133-销售报价单拒绝
  309. MessageBox('权限提示', arg_msg)
  310. return
  311. end if
  312. Open(w_packet_msg_edit_fx)
  313. s_open_packet s_ret
  314. s_ret = Message.PowerObjectParm
  315. if (s_ret.returnflag = 0) then
  316. MessageBox('提示', '操作已取消')
  317. return
  318. end if
  319. oleobject parm
  320. parm = FXAppCom.CreatePbDictionary()
  321. parm.SetString('token', app_token_fx)
  322. parm.SetString('sn', s_tran.sn)
  323. parm.SetString('postscript', s_ret.postscript)
  324. FXAppCom.RejectQuote(parm, ref arg_msg)
  325. if (arg_msg <> '') then
  326. MessageBox('', arg_msg)
  327. return
  328. end if
  329. MessageBox('提示', '操作成功')
  330. Close(parent)
  331. end event
  332. type dw_main from datawindow within w_quote_rece_fx
  333. integer y = 172
  334. integer width = 1801
  335. integer height = 920
  336. integer taborder = 20
  337. boolean bringtotop = true
  338. string title = "none"
  339. string dataobject = "dw_tempquote"
  340. boolean livescroll = true
  341. end type
  342. type st_2 from statictext within w_quote_rece_fx
  343. integer x = 1824
  344. integer y = 172
  345. integer width = 146
  346. integer height = 48
  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. long backcolor = 16777215
  355. string text = "附言"
  356. boolean focusrectangle = false
  357. end type
  358. type mle_postscript from multilineedit within w_quote_rece_fx
  359. integer x = 1824
  360. integer y = 232
  361. integer width = 1929
  362. integer height = 392
  363. integer taborder = 40
  364. boolean bringtotop = true
  365. integer textsize = -9
  366. integer weight = 400
  367. fontcharset fontcharset = gb2312charset!
  368. fontpitch fontpitch = variable!
  369. string facename = "宋体"
  370. long textcolor = 33554432
  371. boolean vscrollbar = true
  372. boolean autovscroll = true
  373. end type
  374. type st_3 from statictext within w_quote_rece_fx
  375. integer x = 1824
  376. integer y = 636
  377. integer width = 146
  378. integer height = 48
  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. long backcolor = 16777215
  387. string text = "备注"
  388. boolean focusrectangle = false
  389. end type
  390. type mle_remark from multilineedit within w_quote_rece_fx
  391. integer x = 1824
  392. integer y = 700
  393. integer width = 1929
  394. integer height = 392
  395. integer taborder = 40
  396. boolean bringtotop = true
  397. integer textsize = -9
  398. integer weight = 400
  399. fontcharset fontcharset = gb2312charset!
  400. fontpitch fontpitch = variable!
  401. string facename = "宋体"
  402. long textcolor = 33554432
  403. boolean vscrollbar = true
  404. boolean autovscroll = true
  405. end type
  406. type dw_mx from u_dw_rbtnfilter within w_quote_rece_fx
  407. integer y = 1096
  408. integer width = 3648
  409. integer height = 1132
  410. integer taborder = 20
  411. boolean bringtotop = true
  412. boolean titlebar = true
  413. string title = "单据明细内容"
  414. string dataobject = "dw_tempquotemx"
  415. boolean controlmenu = true
  416. boolean maxbox = true
  417. boolean hscrollbar = true
  418. boolean vscrollbar = true
  419. boolean resizable = true
  420. boolean border = false
  421. boolean hsplitscroll = true
  422. boolean rbutton_filter_use = true
  423. boolean rbutton_setposition_use = true
  424. boolean titleclick_sort_use = true
  425. end type
  426. type cbx_audit from checkbox within w_quote_rece_fx
  427. integer x = 503
  428. integer y = 52
  429. integer width = 658
  430. integer height = 60
  431. boolean bringtotop = true
  432. integer textsize = -9
  433. integer weight = 400
  434. fontcharset fontcharset = gb2312charset!
  435. fontpitch fontpitch = variable!
  436. string facename = "宋体"
  437. long textcolor = 33554432
  438. long backcolor = 16777215
  439. string text = "更新询价单后审核单据"
  440. end type