w_spt_price_receive_ljfieb.srw 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  1. $PBExportHeader$w_spt_price_receive_ljfieb.srw
  2. forward
  3. global type w_spt_price_receive_ljfieb from w_publ_base
  4. end type
  5. type dw_uc from datawindow within w_spt_price_receive_ljfieb
  6. end type
  7. type dw_child from u_dw_rbtnfilter within w_spt_price_receive_ljfieb
  8. end type
  9. type mle_1 from multilineedit within w_spt_price_receive_ljfieb
  10. end type
  11. type st_1 from statictext within w_spt_price_receive_ljfieb
  12. end type
  13. type st_2 from statictext within w_spt_price_receive_ljfieb
  14. end type
  15. type sle_scname from singlelineedit within w_spt_price_receive_ljfieb
  16. end type
  17. type cb_accept from uo_imflatbutton within w_spt_price_receive_ljfieb
  18. end type
  19. type cb_feedback from uo_imflatbutton within w_spt_price_receive_ljfieb
  20. end type
  21. type cb_reject from uo_imflatbutton within w_spt_price_receive_ljfieb
  22. end type
  23. type mle_2 from multilineedit within w_spt_price_receive_ljfieb
  24. end type
  25. type st_3 from statictext within w_spt_price_receive_ljfieb
  26. end type
  27. type ln_bar from line within w_spt_price_receive_ljfieb
  28. end type
  29. type ln_bar2 from line within w_spt_price_receive_ljfieb
  30. end type
  31. type ln_1 from line within w_spt_price_receive_ljfieb
  32. end type
  33. type ln_2 from line within w_spt_price_receive_ljfieb
  34. end type
  35. type r_bar from rectangle within w_spt_price_receive_ljfieb
  36. end type
  37. end forward
  38. global type w_spt_price_receive_ljfieb from w_publ_base
  39. integer width = 3611
  40. integer height = 2380
  41. string title = "客户询价单"
  42. boolean minbox = false
  43. windowtype windowtype = response!
  44. windowstate windowstate = maximized!
  45. event ue_quote ( )
  46. dw_uc dw_uc
  47. dw_child dw_child
  48. mle_1 mle_1
  49. st_1 st_1
  50. st_2 st_2
  51. sle_scname sle_scname
  52. cb_accept cb_accept
  53. cb_feedback cb_feedback
  54. cb_reject cb_reject
  55. mle_2 mle_2
  56. st_3 st_3
  57. ln_bar ln_bar
  58. ln_bar2 ln_bar2
  59. ln_1 ln_1
  60. ln_2 ln_2
  61. r_bar r_bar
  62. end type
  63. global w_spt_price_receive_ljfieb w_spt_price_receive_ljfieb
  64. type variables
  65. Transaction tr_eb_sqlca
  66. s_packet_ljfieb s_inscust
  67. long ins_scid,ins_cusid
  68. string ins_sn
  69. uo_quote uo_quote_mtrl
  70. uo_ljfieb uo_fieb
  71. long ins_sendid,ins_receid
  72. string ins_sendsccode,ins_reccesccode
  73. string ins_RelatedCode
  74. datetime ins_addtime
  75. string ins_adduser
  76. string ins_relquotecode
  77. end variables
  78. forward prototypes
  79. public function integer wf_retrieve (string arg_sn, long arg_sendcuscommid, string arg_sendsccode, ref string arg_msg)
  80. public function integer wf_importnewbj (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
  81. public function integer wf_importnewprice (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
  82. public function integer wf_add_quote ()
  83. end prototypes
  84. public function integer wf_retrieve (string arg_sn, long arg_sendcuscommid, string arg_sendsccode, ref string arg_msg);Int rslt = 1
  85. String ls_cuscode
  86. Long uc_row
  87. Long ll_i, ll_rowcnt,ll_row
  88. Long ll_moneyid,ll_banktypeid
  89. long li_CusType
  90. Decimal ls_1stnewprice,ls_1stzqrate
  91. dw_uc.Retrieve(arg_sn)
  92. dw_child.Retrieve(arg_sn)
  93. uc_row = dw_uc.GetRow()
  94. IF uc_row <= 0 THEN
  95. rslt = 0
  96. arg_msg = '没有对应的单据信息'
  97. GOTO ext
  98. END IF
  99. SELECT CusCode,CusType
  100. INTO :ls_cuscode,:li_CusType
  101. FROM LJFIEB_CusComm
  102. Where CusCommID = :arg_sendcuscommid Using tr_eb_sqlca;
  103. IF tr_eb_sqlca.SQLCode <> 0 THEN
  104. ls_cuscode = ''
  105. END IF
  106. If li_CusType = 5 Then
  107. Select cuscode Into :ls_cuscode
  108. From u_cust
  109. Where cusid = :ins_cusid Using sqlca;
  110. If sqlca.SQLCode <> 0 Then
  111. ls_cuscode = ''
  112. End If
  113. End If
  114. IF Trim(ls_cuscode) = '' THEN
  115. rslt = 0
  116. arg_msg = '客户信息不明确,请检查'
  117. GOTO ext
  118. END IF
  119. Long cusid
  120. String CusCode, Name
  121. SELECT cusid,
  122. cuscode,
  123. name
  124. INTO
  125. :cusid,
  126. :cuscode,
  127. :Name
  128. From u_cust
  129. Where (commcode = :ls_cuscode And commsccode = :arg_SendSCcode and :li_CusType <> 5
  130. or cuscode = :ls_cuscode and :li_custype = 5 ) Using sqlca;
  131. IF sqlca.SQLCode <> 0 THEN
  132. rslt = 0
  133. arg_msg = '查询客户信息失败,请检查通信设置是否正确,'+sqlca.SQLErrText
  134. GOTO ext
  135. END IF
  136. dw_uc.Object.cusid[uc_row] = cusid
  137. dw_uc.Object.CusCode[uc_row] = CusCode
  138. dw_uc.Object.cusname[uc_row] = Name
  139. ext:
  140. RETURN rslt
  141. end function
  142. public function integer wf_importnewbj (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
  143. IF arg_moneyid = 0 THEN
  144. rslt = 0
  145. arg_msg = '请先选择币种'
  146. GOTO ext
  147. END IF
  148. IF IsNull(arg_cusid) THEN arg_cusid = 0
  149. IF arg_cusid = 0 THEN
  150. rslt = 0
  151. arg_msg = "请选择销售客户!"
  152. GOTO ext
  153. END IF
  154. SELECT u_cus_price.fprice_bj,u_cus_price.zqrate_bj
  155. INTO :arg_price,:arg_rebate
  156. FROM u_cus_price
  157. WHERE ( u_cus_price.cusid = :arg_cusid ) AND
  158. ( u_cus_price.mtrlid = :arg_mtrlid ) AND
  159. ( u_cus_price.status = :arg_status ) AND
  160. ( u_cus_price.pcode = :arg_pcode ) AND
  161. ( u_cus_price.woodcode = :arg_woodcode ) and
  162. ( u_cus_price.moneyid = :arg_moneyid);
  163. IF sqlca.SQLCode <> 0 THEN
  164. rslt = 0
  165. arg_msg = "没有最新销售价!"
  166. GOTO ext
  167. END IF
  168. ext:
  169. IF rslt = 0 THEN
  170. arg_price = 0
  171. arg_rebate = 0
  172. END IF
  173. RETURN rslt
  174. end function
  175. public function integer wf_importnewprice (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
  176. IF arg_moneyid = 0 THEN
  177. rslt = 0
  178. arg_msg = '请先选择币种'
  179. GOTO ext
  180. END IF
  181. IF IsNull(arg_cusid) THEN arg_cusid = 0
  182. IF arg_cusid = 0 THEN
  183. rslt = 0
  184. arg_msg = "请选择销售客户!"
  185. GOTO ext
  186. END IF
  187. SELECT u_cus_price.fprice,u_cus_price.zqrate
  188. INTO :arg_price,:arg_rebate
  189. FROM u_cus_price
  190. WHERE ( u_cus_price.cusid = :arg_cusid ) AND
  191. ( u_cus_price.mtrlid = :arg_mtrlid ) AND
  192. ( u_cus_price.status = :arg_status ) AND
  193. ( u_cus_price.pcode = :arg_pcode ) AND
  194. ( u_cus_price.woodcode = :arg_woodcode ) and
  195. ( u_cus_price.moneyid = :arg_moneyid);
  196. IF sqlca.SQLCode <> 0 THEN
  197. rslt = 0
  198. arg_msg = "没有最新销售价!"
  199. GOTO ext
  200. END IF
  201. ext:
  202. IF rslt = 0 THEN
  203. arg_price = 0
  204. arg_rebate = 0
  205. END IF
  206. RETURN rslt
  207. end function
  208. public function integer wf_add_quote ();String arg_msg
  209. Long uc_row
  210. DateTime server_dt
  211. Long i
  212. Long ll_mtrlid
  213. String ls_mtrlcode
  214. Long ll_mess
  215. String ls_relquotecode
  216. Long ll_moneyid
  217. String ls_moneyname
  218. uc_row = dw_uc.GetRow()
  219. IF uc_row <= 0 THEN
  220. MessageBox('系统提示','没有可保存的内容')
  221. RETURN 0
  222. END IF
  223. dw_uc.AcceptText()
  224. dw_child.AcceptText()
  225. SELECT Top 1 getdate() Into :server_dt From u_user Using sqlca;
  226. //取得系统时间,借用操作员表
  227. IF sqlca.SQLCode <> 0 THEN
  228. MessageBox('Error',"查询操作失败,日期 ")
  229. RETURN 0
  230. END IF
  231. //ls_moneyname = dw_uc.Object.moneyname[uc_row]
  232. //
  233. //SELECT moneyid
  234. // INTO :ll_moneyid
  235. // FROM cw_currency
  236. // Where Name = :ls_moneyname Using sqlca;
  237. //IF sqlca.SQLCode <> 0 THEN
  238. // MessageBox('Error','查询币种信息失败,'+sqlca.SQLErrText)
  239. // RETURN 0
  240. //END IF
  241. //ll_moneyid = dw_uc.Object.moneyid[uc_row]
  242. //IF ll_moneyid <= 0 THEN
  243. // MessageBox('Error',"请选择币种 ")
  244. // RETURN 0
  245. //END IF
  246. IF uo_quote_mtrl.newbegin(ins_scid,arg_msg) = 0 THEN //生产令领料
  247. MessageBox('Error!',arg_msg)
  248. RETURN 0
  249. END IF
  250. uo_quote_mtrl.quotedate = server_dt // 发生时间
  251. uo_quote_mtrl.Assign_emp = publ_operator
  252. uo_quote_mtrl.relcode = dw_uc.Object.billcode[uc_row] //相关号码
  253. uo_quote_mtrl.dscrp = dw_uc.Object.dscrp[uc_row] //备注
  254. uo_quote_mtrl.custid = dw_uc.Object.cusid[uc_row] //客户ID
  255. //uo_quote_mtrl.moneyid = ll_moneyid
  256. uo_quote_mtrl.fiebrelcode = ins_RelatedCode
  257. //uo_quote_mtrl.sendtime = ins_addtime
  258. //uo_quote_mtrl.senduser = ins_adduser
  259. //
  260. FOR i = 1 To dw_child.RowCount()
  261. IF dw_child.Object.sptmtrlcode[i] <> '' THEN
  262. ls_mtrlcode = dw_child.Object.sptmtrlcode[i]
  263. SELECT mtrlid INTO :ll_mtrlid
  264. FROM u_mtrldef
  265. Where mtrlcode = :ls_mtrlcode Using sqlca;
  266. IF sqlca.SQLCode <> 0 THEN
  267. ll_mess = MessageBox('Error','第'+String(i)+'行,查询产品信息失败,是否忽略?',question!,yesno!)
  268. IF ll_mess = 1 THEN
  269. CONTINUE
  270. ELSEIF ll_mess = 2 THEN
  271. RETURN 0
  272. END IF
  273. END IF
  274. IF uo_quote_mtrl.acceptmx(ll_mtrlid,&
  275. dw_child.Object.sptmtrlcode[i],&
  276. '',&
  277. '',&
  278. '',&
  279. dw_child.Object.dscrp[i],&
  280. arg_msg,&
  281. i,&
  282. dw_child.Object.price[i],&
  283. dw_child.Object.price[i],&
  284. dw_child.Object.status[i],&
  285. dw_child.Object.woodcode[i],&
  286. dw_child.Object.pcode[i],&
  287. 0,&
  288. 0,&
  289. 0,&
  290. 0,&
  291. 0,&
  292. 0,&
  293. 0,&
  294. dw_child.Object.qty[i],&
  295. dw_child.Object.qty1[i],&
  296. 1,0,'','') = 0 THEN
  297. MessageBox('Error!',arg_msg)
  298. RETURN 0
  299. END IF
  300. END IF
  301. NEXT
  302. IF uo_quote_mtrl.Save(publ_operator,arg_msg,True) = 0 THEN
  303. MessageBox('Error!',arg_msg)
  304. RETURN 0
  305. END IF
  306. ls_relquotecode = uo_quote_mtrl.quotecode
  307. ins_relquotecode = ls_relquotecode
  308. UPDATE LJFIEB_tempspt_price_change
  309. SET relquotecode = :ls_relquotecode,
  310. flag = 1,
  311. ConfirmTime = getdate(),
  312. ConfirmUser = :publ_operator
  313. Where SerialNum = :ins_sn Using tr_eb_sqlca;
  314. IF tr_eb_sqlca.SQLCode <> 0 THEN
  315. ROLLBACK Using tr_eb_sqlca;
  316. MessageBox('Error','更新客户询价单相关报价单号失败,'+tr_eb_sqlca.SQLErrText)
  317. RETURN 0
  318. END IF
  319. dw_uc.Object.relquotecode[uc_row] = ls_relquotecode
  320. dw_uc.Object.flag[uc_row] = 1
  321. //更新本地通信记录
  322. UPDATE LJFIEB_packet
  323. SET status = 6,
  324. Complete = 1,
  325. ConfirmTime = getdate(),
  326. ConfirmUser = :publ_operator
  327. Where SerialNum = :ins_sn Using tr_eb_sqlca;
  328. IF tr_eb_sqlca.SQLCode <> 0 THEN
  329. ROLLBACK Using tr_eb_sqlca;
  330. MessageBox('Error','更新本地通信记录失败,'+tr_eb_sqlca.SQLErrText)
  331. RETURN 0
  332. END IF
  333. RETURN 1
  334. end function
  335. on w_spt_price_receive_ljfieb.create
  336. int iCurrent
  337. call super::create
  338. this.dw_uc=create dw_uc
  339. this.dw_child=create dw_child
  340. this.mle_1=create mle_1
  341. this.st_1=create st_1
  342. this.st_2=create st_2
  343. this.sle_scname=create sle_scname
  344. this.cb_accept=create cb_accept
  345. this.cb_feedback=create cb_feedback
  346. this.cb_reject=create cb_reject
  347. this.mle_2=create mle_2
  348. this.st_3=create st_3
  349. this.ln_bar=create ln_bar
  350. this.ln_bar2=create ln_bar2
  351. this.ln_1=create ln_1
  352. this.ln_2=create ln_2
  353. this.r_bar=create r_bar
  354. iCurrent=UpperBound(this.Control)
  355. this.Control[iCurrent+1]=this.dw_uc
  356. this.Control[iCurrent+2]=this.dw_child
  357. this.Control[iCurrent+3]=this.mle_1
  358. this.Control[iCurrent+4]=this.st_1
  359. this.Control[iCurrent+5]=this.st_2
  360. this.Control[iCurrent+6]=this.sle_scname
  361. this.Control[iCurrent+7]=this.cb_accept
  362. this.Control[iCurrent+8]=this.cb_feedback
  363. this.Control[iCurrent+9]=this.cb_reject
  364. this.Control[iCurrent+10]=this.mle_2
  365. this.Control[iCurrent+11]=this.st_3
  366. this.Control[iCurrent+12]=this.ln_bar
  367. this.Control[iCurrent+13]=this.ln_bar2
  368. this.Control[iCurrent+14]=this.ln_1
  369. this.Control[iCurrent+15]=this.ln_2
  370. this.Control[iCurrent+16]=this.r_bar
  371. end on
  372. on w_spt_price_receive_ljfieb.destroy
  373. call super::destroy
  374. destroy(this.dw_uc)
  375. destroy(this.dw_child)
  376. destroy(this.mle_1)
  377. destroy(this.st_1)
  378. destroy(this.st_2)
  379. destroy(this.sle_scname)
  380. destroy(this.cb_accept)
  381. destroy(this.cb_feedback)
  382. destroy(this.cb_reject)
  383. destroy(this.mle_2)
  384. destroy(this.st_3)
  385. destroy(this.ln_bar)
  386. destroy(this.ln_bar2)
  387. destroy(this.ln_1)
  388. destroy(this.ln_2)
  389. destroy(this.r_bar)
  390. end on
  391. event open;call super::open;tr_eb_sqlca = sys_email_sqlca // 电子商务连接
  392. IF sys_email_sqlca.DBHandle() = 0 THEN
  393. MessageBox('Error','电子商务数据库连接失败,请检查')
  394. RETURN
  395. END IF
  396. dw_uc.settransobject(tr_eb_sqlca)
  397. dw_child.settransobject(tr_eb_sqlca)
  398. //DataWindowChild dwc
  399. //IF dw_uc.GetChild('moneyid', Ref dwc) = 1 THEN
  400. // dwc.SetTransObject(sqlca)
  401. // dwc.Retrieve()
  402. //END IF
  403. uo_quote_mtrl = CREATE uo_quote
  404. uo_quote_mtrl.commit_transaction = sqlca
  405. uo_fieb = Create uo_ljfieb
  406. uo_fieb.commit_transaction = tr_eb_sqlca
  407. s_inscust = Message.PowerObjectParm
  408. ins_sn = s_inscust.serialnum
  409. ins_sendid = s_inscust.sendcuscommid
  410. ins_receid = s_inscust.receivecuscommid
  411. ins_sendsccode = s_inscust.sendsccode
  412. ins_reccesccode = s_inscust.receivesccode
  413. ins_RelatedCode = s_inscust.RelatedCode
  414. ins_addtime = s_inscust.addtime
  415. ins_adduser = s_inscust.adduser
  416. String ls_sccode,ls_scname
  417. String arg_msg
  418. ls_sccode = s_inscust.receivesccode
  419. SELECT scid,scname
  420. INTO :ins_scid,:ls_scname
  421. FROM u_scdef
  422. Where sccode = :ls_sccode;
  423. IF sqlca.SQLCode <> 0 THEN
  424. MessageBox('Error','查询分部信息失败,'+sqlca.SQLErrText)
  425. RETURN
  426. END IF
  427. sle_scname.Text = ls_scname
  428. mle_1.Text = s_inscust.postscript
  429. mle_2.Text = s_inscust.remark
  430. long ll_status
  431. SELECT status,cusid INTO :ll_status,:ins_cusid
  432. FROM LJFIEB_packet
  433. Where serialnum = :ins_sn Using tr_eb_sqlca;
  434. IF tr_eb_sqlca.SQLCode <> 0 THEN
  435. MessageBox('Error','查询通信数据失败,'+sqlca.SQLErrText)
  436. RETURN
  437. END IF
  438. if ll_status <> 5 then
  439. cb_accept.enabled = false
  440. cb_reject.enabled = false
  441. end if
  442. IF wf_retrieve(ins_sn,ins_sendid,ins_sendsccode,arg_msg) = 0 THEN
  443. MessageBox('Error',arg_msg)
  444. RETURN
  445. END IF
  446. //更新对方状态-已打开
  447. string ls_SerialNum
  448. SELECT TOP 1 NEWID() INTO :ls_SerialNum
  449. From u_user Using sqlca;
  450. IF sqlca.SQLCode <> 0 THEN
  451. return
  452. END IF
  453. IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
  454. IF ls_SerialNum = '' THEN
  455. return
  456. END IF
  457. IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,5,'打开消息','','',ins_sn,'',0,arg_msg,True) = 0 THEN
  458. return
  459. END IF
  460. end event
  461. event resize;call super::resize;ln_bar.endx = this.width
  462. ln_bar2.endx = this.width
  463. r_bar.width = this.width
  464. ln_1.endx = this.width
  465. ln_2.endx = this.width
  466. dw_child.width = this.WorkSpaceWidth() - 10
  467. mle_1.width = dw_child.width - dw_uc.width - 4
  468. mle_2.width = mle_1.width
  469. dw_child.height = this.workspaceheight() - dw_child.y - 30
  470. end event
  471. event close;call super::close;destroy uo_fieb
  472. destroy uo_quote_mtrl
  473. closewithreturn(this,ins_relquotecode)
  474. end event
  475. type cb_func from w_publ_base`cb_func within w_spt_price_receive_ljfieb
  476. boolean visible = false
  477. end type
  478. type cb_exit from w_publ_base`cb_exit within w_spt_price_receive_ljfieb
  479. integer x = 1111
  480. integer width = 183
  481. integer height = 164
  482. integer picsize = 16
  483. toolbaralignment pic_align = alignattop!
  484. boolean border = false
  485. end type
  486. type dw_uc from datawindow within w_spt_price_receive_ljfieb
  487. integer y = 296
  488. integer width = 1966
  489. integer height = 716
  490. integer taborder = 30
  491. boolean bringtotop = true
  492. string title = "none"
  493. string dataobject = "dw_spt_price_change_ljfieb"
  494. boolean livescroll = true
  495. borderstyle borderstyle = stylelowered!
  496. end type
  497. type dw_child from u_dw_rbtnfilter within w_spt_price_receive_ljfieb
  498. integer y = 1016
  499. integer width = 3584
  500. integer height = 1240
  501. integer taborder = 20
  502. boolean bringtotop = true
  503. boolean titlebar = true
  504. string title = "单据明细内容"
  505. string dataobject = "dw_spt_price_changemx_ljfieb"
  506. boolean maxbox = true
  507. boolean hscrollbar = true
  508. boolean vscrollbar = true
  509. boolean hsplitscroll = true
  510. end type
  511. event rowfocuschanged;call super::rowfocuschanged; IF currentrow <= 0 THEN RETURN
  512. THIS.SelectRow(0,FALSE)
  513. THIS.SelectRow(currentrow,TRUE)
  514. this.setrow(currentrow)
  515. end event
  516. event clicked;call super::clicked; IF row <= 0 THEN RETURN
  517. THIS.SelectRow(0,FALSE)
  518. THIS.SelectRow(row,TRUE)
  519. this.setrow(row)
  520. end event
  521. event rbuttondown;call super::rbuttondown;Long ll_row,ll_column
  522. ll_row = This.GetRow()
  523. ll_column = This.GetColumn()
  524. IF ll_row <= 0 THEN RETURN
  525. IF ll_column <= 0 THEN RETURN
  526. IF Left( This.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  527. s_calender_arg s_calender
  528. s_calender.PointerX = This.PointerX()
  529. s_calender.PointerY = This.PointerY()
  530. s_calender.X = This.X + Parent.X
  531. s_calender.Y = This.Y + Parent.Y
  532. OpenWithParm(w_calendar,s_calender)
  533. This.SetItem(ll_row,ll_column,id_date_selected)
  534. END IF
  535. end event
  536. type mle_1 from multilineedit within w_spt_price_receive_ljfieb
  537. integer x = 1970
  538. integer y = 360
  539. integer width = 1595
  540. integer height = 408
  541. integer taborder = 40
  542. boolean bringtotop = true
  543. integer textsize = -9
  544. integer weight = 400
  545. fontcharset fontcharset = gb2312charset!
  546. fontpitch fontpitch = variable!
  547. string facename = "宋体"
  548. long textcolor = 33554432
  549. boolean vscrollbar = true
  550. boolean autovscroll = true
  551. boolean displayonly = true
  552. borderstyle borderstyle = stylelowered!
  553. end type
  554. type st_1 from statictext within w_spt_price_receive_ljfieb
  555. integer x = 1979
  556. integer y = 300
  557. integer width = 142
  558. integer height = 56
  559. boolean bringtotop = true
  560. integer textsize = -9
  561. integer weight = 400
  562. fontcharset fontcharset = gb2312charset!
  563. fontpitch fontpitch = variable!
  564. string facename = "宋体"
  565. long textcolor = 33554432
  566. long backcolor = 134217739
  567. string text = "附言"
  568. boolean focusrectangle = false
  569. end type
  570. type st_2 from statictext within w_spt_price_receive_ljfieb
  571. integer x = 23
  572. integer y = 204
  573. integer width = 155
  574. integer height = 48
  575. boolean bringtotop = true
  576. integer textsize = -9
  577. integer weight = 400
  578. fontcharset fontcharset = gb2312charset!
  579. fontpitch fontpitch = variable!
  580. string facename = "宋体"
  581. long textcolor = 33554432
  582. long backcolor = 134217739
  583. string text = "分部"
  584. alignment alignment = right!
  585. boolean focusrectangle = false
  586. end type
  587. type sle_scname from singlelineedit within w_spt_price_receive_ljfieb
  588. integer x = 210
  589. integer y = 188
  590. integer width = 443
  591. integer height = 84
  592. integer taborder = 30
  593. boolean bringtotop = true
  594. integer textsize = -9
  595. integer weight = 400
  596. fontcharset fontcharset = gb2312charset!
  597. fontpitch fontpitch = variable!
  598. string facename = "宋体"
  599. long textcolor = 33554432
  600. boolean displayonly = true
  601. borderstyle borderstyle = stylelowered!
  602. end type
  603. type cb_accept from uo_imflatbutton within w_spt_price_receive_ljfieb
  604. integer width = 439
  605. integer height = 164
  606. integer taborder = 30
  607. boolean bringtotop = true
  608. string text = "转为销售报价单"
  609. string normalpicname = "ok.bmp"
  610. integer picsize = 16
  611. toolbaralignment pic_align = alignattop!
  612. boolean border = false
  613. end type
  614. event clicked;call super::clicked;IF Not f_power_ind(3166) THEN
  615. MessageBox(publ_operator,sys_msg_pow)
  616. RETURN
  617. END IF
  618. IF MessageBox('询问','确定要接受当前订单,转为正式销售报价单吗?',question!,yesno!) = 2 THEN RETURN
  619. IF wf_add_quote() = 0 THEN RETURN
  620. String arg_msg
  621. String ls_SerialNum
  622. SELECT TOP 1 NEWID() INTO :ls_SerialNum
  623. From u_user Using sqlca;
  624. IF sqlca.SQLCode <> 0 THEN
  625. ROLLBACK Using sqlca;
  626. MessageBox('Error','生成序列号失败,'+sqlca.SQLErrText)
  627. RETURN
  628. END IF
  629. IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
  630. IF ls_SerialNum = '' THEN
  631. MessageBox('Error','错误的发送序列号')
  632. RETURN
  633. END IF
  634. IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,6,'安排报价','','',ins_sn,ins_RelatedCode,0,arg_msg,True) = 0 THEN
  635. MessageBox('系统提示','发送确认指令失败 '+arg_msg)
  636. RETURN
  637. END IF
  638. IF MessageBox('系统提示','成功生成销售报价单:'+ins_relquotecode+',是否马上打开?',question!,yesno!) = 2 THEN ins_relquotecode = ''
  639. Close(Parent)
  640. end event
  641. type cb_feedback from uo_imflatbutton within w_spt_price_receive_ljfieb
  642. integer x = 439
  643. integer width = 439
  644. integer height = 164
  645. integer taborder = 10
  646. boolean bringtotop = true
  647. string text = "相关销售报价单"
  648. string normalpicname = "open.BMP"
  649. integer picsize = 16
  650. toolbaralignment pic_align = alignattop!
  651. boolean border = false
  652. end type
  653. event clicked;call super::clicked;Long ll_row
  654. String ls_code
  655. Long cnt
  656. ll_row = dw_uc.GetRow()
  657. IF ll_row <= 0 THEN RETURN
  658. IF dw_uc.Object.flag[ll_row] = 0 THEN
  659. MessageBox('系统提示','本客户询价单尚未进行报价处理')
  660. RETURN
  661. END IF
  662. ls_code = dw_uc.Object.relquotecode[ll_row]
  663. SELECT count(*)
  664. INTO :cnt
  665. FROM u_quote
  666. Where quotecode = :ls_code Using sqlca;
  667. IF sqlca.SQLCode <> 0 THEN
  668. MessageBox('Error','查询销售报价单信息失败,'+sqlca.SQLErrText)
  669. RETURN
  670. END IF
  671. IF cnt = 0 THEN
  672. IF MessageBox('询问','无法查询相关销售报价单,可能已被删除,是否重新生成新的销售报价单?',question!,yesno!) = 2 THEN RETURN
  673. wf_add_quote()
  674. ELSE
  675. f_open_win(ins_scid,ls_code)
  676. END IF
  677. end event
  678. type cb_reject from uo_imflatbutton within w_spt_price_receive_ljfieb
  679. integer x = 882
  680. integer width = 219
  681. integer height = 164
  682. integer taborder = 30
  683. boolean bringtotop = true
  684. string text = "拒绝"
  685. string normalpicname = "DELETE.BMP"
  686. integer picsize = 16
  687. toolbaralignment pic_align = alignattop!
  688. boolean border = false
  689. end type
  690. event clicked;call super::clicked;IF Not f_power_ind(3167) THEN
  691. MessageBox(publ_operator,sys_msg_pow)
  692. RETURN
  693. END IF
  694. String arg_summary,arg_postscript,arg_remark
  695. String arg_msg
  696. String ls_SerialNum
  697. SELECT TOP 1 NEWID() INTO :ls_SerialNum
  698. From u_user Using sqlca;
  699. IF sqlca.SQLCode <> 0 THEN
  700. ROLLBACK Using sqlca;
  701. MessageBox('Error','生成序列号失败,'+sqlca.SQLErrText)
  702. RETURN
  703. END IF
  704. IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
  705. IF ls_SerialNum = '' THEN
  706. MessageBox('Error','错误的发送序列号')
  707. RETURN
  708. END IF
  709. s_packet_ljfieb s_pack,s_return
  710. //s_pack.summary = '拒绝订单:'+ins_RelatedCode
  711. OpenWithParm(w_dscrp_edit_ljfieb,s_pack)
  712. s_return = Message.PowerObjectParm
  713. IF s_return.returnflag <> 1 THEN RETURN
  714. //arg_summary = s_return.summary
  715. arg_postscript = s_return.postscript
  716. arg_remark = s_return.remark
  717. UPDATE LJFIEB_tempspt_price_change
  718. SET flag = 2
  719. Where SerialNum = :ins_sn Using tr_eb_sqlca;
  720. IF tr_eb_sqlca.SQLCode <> 0 THEN
  721. ROLLBACK Using tr_eb_sqlca;
  722. MessageBox('Error','更新客户询价单状态失败,'+tr_eb_sqlca.SQLErrText)
  723. RETURN 0
  724. END IF
  725. //更新本地通信记录
  726. UPDATE LJFIEB_packet
  727. SET status = 10,
  728. Complete = 1
  729. Where SerialNum = :ins_sn Using tr_eb_sqlca;
  730. IF tr_eb_sqlca.SQLCode <> 0 THEN
  731. ROLLBACK Using tr_eb_sqlca;
  732. MessageBox('Error', '更新本地通信记录失败,'+tr_eb_sqlca.SQLErrText)
  733. RETURN
  734. END IF
  735. IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,11,arg_summary,arg_postscript,arg_remark,ins_sn,ins_RelatedCode,0,arg_msg,True) = 0 THEN
  736. MessageBox('系统提示','发送确认指令失败 '+arg_msg)
  737. RETURN
  738. END IF
  739. MessageBox('系统提示','操作成功')
  740. Close(Parent)
  741. end event
  742. type mle_2 from multilineedit within w_spt_price_receive_ljfieb
  743. integer x = 1970
  744. integer y = 840
  745. integer width = 1595
  746. integer height = 164
  747. integer taborder = 50
  748. boolean bringtotop = true
  749. integer textsize = -9
  750. integer weight = 400
  751. fontcharset fontcharset = gb2312charset!
  752. fontpitch fontpitch = variable!
  753. string facename = "宋体"
  754. long textcolor = 33554432
  755. boolean vscrollbar = true
  756. boolean autovscroll = true
  757. boolean displayonly = true
  758. borderstyle borderstyle = stylelowered!
  759. end type
  760. type st_3 from statictext within w_spt_price_receive_ljfieb
  761. integer x = 1979
  762. integer y = 780
  763. integer width = 128
  764. integer height = 48
  765. boolean bringtotop = true
  766. integer textsize = -9
  767. integer weight = 400
  768. fontcharset fontcharset = gb2312charset!
  769. fontpitch fontpitch = variable!
  770. string facename = "宋体"
  771. long textcolor = 33554432
  772. long backcolor = 134217739
  773. string text = "备注"
  774. boolean focusrectangle = false
  775. end type
  776. type ln_bar from line within w_spt_price_receive_ljfieb
  777. long linecolor = 268435456
  778. integer linethickness = 4
  779. integer beginy = 172
  780. integer endx = 3200
  781. integer endy = 172
  782. end type
  783. type ln_bar2 from line within w_spt_price_receive_ljfieb
  784. long linecolor = 16777215
  785. integer linethickness = 4
  786. integer beginx = 9
  787. integer beginy = 176
  788. integer endx = 3273
  789. integer endy = 176
  790. end type
  791. type ln_1 from line within w_spt_price_receive_ljfieb
  792. long linecolor = 268435456
  793. integer linethickness = 4
  794. integer beginy = 284
  795. integer endx = 3250
  796. integer endy = 284
  797. end type
  798. type ln_2 from line within w_spt_price_receive_ljfieb
  799. long linecolor = 16777215
  800. integer linethickness = 4
  801. integer beginy = 288
  802. integer endx = 3282
  803. integer endy = 288
  804. end type
  805. type r_bar from rectangle within w_spt_price_receive_ljfieb
  806. long linecolor = 16777215
  807. integer linethickness = 4
  808. long fillcolor = 1073741824
  809. integer x = 3351
  810. integer width = 87
  811. integer height = 68
  812. end type
  813. event constructor;this.fillcolor = 14215660
  814. this.linecolor = 14215660
  815. this.x = -1
  816. this.y = -1
  817. this.height = ln_bar.beginy - 5
  818. end event