uo_fx_saletask_custom_tab.sru 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. $PBExportHeader$uo_fx_saletask_custom_tab.sru
  2. forward
  3. global type uo_fx_saletask_custom_tab from tab
  4. end type
  5. type tabpage_fj from userobject within uo_fx_saletask_custom_tab
  6. end type
  7. type cb_fj_commit from commandbutton within tabpage_fj
  8. end type
  9. type dw_fj from u_dw_rbtnfilter within tabpage_fj
  10. end type
  11. type cb_fj_del from commandbutton within tabpage_fj
  12. end type
  13. type cb_fj_upload from commandbutton within tabpage_fj
  14. end type
  15. type cbx_fj_ch_all from checkbox within tabpage_fj
  16. end type
  17. type tabpage_fj from userobject within uo_fx_saletask_custom_tab
  18. cb_fj_commit cb_fj_commit
  19. dw_fj dw_fj
  20. cb_fj_del cb_fj_del
  21. cb_fj_upload cb_fj_upload
  22. cbx_fj_ch_all cbx_fj_ch_all
  23. end type
  24. type tabpage_fymx from userobject within uo_fx_saletask_custom_tab
  25. end type
  26. type dw_fymx from u_dw_rbtnfilter within tabpage_fymx
  27. end type
  28. type tabpage_fymx from userobject within uo_fx_saletask_custom_tab
  29. dw_fymx dw_fymx
  30. end type
  31. type tabpage_sfxm from userobject within uo_fx_saletask_custom_tab
  32. end type
  33. type dw_sfxm from u_dw_rbtnfilter within tabpage_sfxm
  34. end type
  35. type tabpage_sfxm from userobject within uo_fx_saletask_custom_tab
  36. dw_sfxm dw_sfxm
  37. end type
  38. type tabpage_barcode from userobject within uo_fx_saletask_custom_tab
  39. end type
  40. type dw_barcode from u_dw_rbtnfilter within tabpage_barcode
  41. end type
  42. type tabpage_barcode from userobject within uo_fx_saletask_custom_tab
  43. dw_barcode dw_barcode
  44. end type
  45. type tabpage_log from userobject within uo_fx_saletask_custom_tab
  46. end type
  47. type dw_log from u_dw_rbtnfilter within tabpage_log
  48. end type
  49. type tabpage_log from userobject within uo_fx_saletask_custom_tab
  50. dw_log dw_log
  51. end type
  52. end forward
  53. global type uo_fx_saletask_custom_tab from tab
  54. integer width = 2542
  55. integer height = 1160
  56. integer textsize = -9
  57. integer weight = 400
  58. fontcharset fontcharset = gb2312charset!
  59. fontpitch fontpitch = variable!
  60. string facename = "宋体"
  61. long backcolor = 16777215
  62. boolean raggedright = true
  63. boolean focusonbuttondown = true
  64. integer selectedtab = 1
  65. tabpage_fj tabpage_fj
  66. tabpage_fymx tabpage_fymx
  67. tabpage_sfxm tabpage_sfxm
  68. tabpage_barcode tabpage_barcode
  69. tabpage_log tabpage_log
  70. event ue_resize ( )
  71. event ue_init ( long a_taskid, long a_status, window a_parent )
  72. event ue_tab_fj_del ( long a_printid )
  73. event ue_init_with_tid ( long a_taskid, long a_status, string a_tid, window a_parent )
  74. end type
  75. global uo_fx_saletask_custom_tab uo_fx_saletask_custom_tab
  76. type variables
  77. long ins_taskid, ins_status
  78. string ins_tid
  79. window ins_parent
  80. end variables
  81. forward prototypes
  82. public subroutine wf_retr (boolean a_ifforce)
  83. public subroutine wf_retr_fj ()
  84. public subroutine wf_retr_fymx ()
  85. public subroutine wf_retr_sfxm ()
  86. public subroutine wf_retr_barcode ()
  87. public subroutine wf_retr_log ()
  88. public subroutine wf_open ()
  89. end prototypes
  90. event ue_resize();// 附件
  91. tabpage_fj.dw_fj.Width = tabpage_fj.Width
  92. tabpage_fj.dw_fj.Height = tabpage_fj.Height - tabpage_fj.dw_fj.Y
  93. // 费用明细
  94. tabpage_fymx.dw_fymx.Width = tabpage_fymx.Width
  95. tabpage_fymx.dw_fymx.Height = tabpage_fymx.Height - tabpage_fymx.dw_fymx.Y
  96. // 收费项目
  97. tabpage_sfxm.dw_sfxm.Width = tabpage_sfxm.Width
  98. tabpage_sfxm.dw_sfxm.Height = tabpage_sfxm.Height - tabpage_sfxm.dw_sfxm.Y
  99. // 条码
  100. tabpage_barcode.dw_barcode.Width = tabpage_barcode.Width
  101. tabpage_barcode.dw_barcode.Height = tabpage_barcode.Height - tabpage_barcode.dw_barcode.Y
  102. // 日志
  103. tabpage_log.dw_log.Width = tabpage_log.Width
  104. tabpage_log.dw_log.Height = tabpage_log.Height - tabpage_log.dw_log.Y
  105. end event
  106. event ue_init(long a_taskid, long a_status, window a_parent);post event ue_init_with_tid(a_taskid, a_status, '', a_parent)
  107. end event
  108. event ue_tab_fj_del(long a_printid);// 删除订单明细,触发删除对应附件事件
  109. // a_printid--订单明细printid
  110. long ll_findRow, ll_index = 0
  111. long ll_arr_rows[]
  112. string ls_findStr = 'mxprintid = ' + string(a_printid)
  113. ls_findStr = 'mxprintid = ' + string(a_printid)
  114. ll_findRow = tabpage_fj.dw_fj.Find(ls_findStr, 1, tabpage_fj.dw_fj.RowCount())
  115. do while (ll_findRow > 0)
  116. ll_index++
  117. ll_arr_rows[ll_index] = ll_findRow
  118. if (ll_findRow + 1 > tabpage_fj.dw_fj.RowCount()) then exit
  119. ll_findRow = tabpage_fj.dw_fj.Find(ls_findStr, ll_findRow + 1, tabpage_fj.dw_fj.RowCount())
  120. loop
  121. if (ll_index > 0) then
  122. // 退回状态,删除明细,重新添加明细,添加附件,不需要删除fx_saletask_fj,保存接口会处理
  123. for ll_index = UpperBound(ll_arr_rows) to 1 step - 1
  124. tabpage_fj.dw_fj.DeleteRow(ll_arr_rows[ll_index])
  125. next
  126. end if
  127. end event
  128. event ue_init_with_tid(long a_taskid, long a_status, string a_tid, window a_parent);ins_taskid = a_taskid
  129. ins_status = a_status
  130. ins_tid = a_tid
  131. ins_parent = a_parent
  132. wf_retr(true)
  133. end event
  134. public subroutine wf_retr (boolean a_ifforce);// 刷新当前tabpage
  135. // a_ifforce是否强制刷新
  136. long ll_i, ll_index
  137. if (a_ifforce) then
  138. for ll_i = 1 to UpperBound(this.Control)
  139. this.Control[ll_i].tag = ''
  140. next
  141. end if
  142. if (IsNull(ins_taskid)) then return
  143. ll_index = this.SelectedTab
  144. string ls_tabtext, ls_tag
  145. ls_tabtext = Trim(this.Control[ll_index].text)
  146. ls_tag = Trim(this.Control[ll_index].tag)
  147. if (ls_tag <> string(ins_taskid)) then
  148. //附件,费用明细,收费项目,条码,日志,包件立方
  149. this.Control[ll_index].tag = string(ins_taskid)
  150. if (ls_tabtext = '附件') then
  151. wf_retr_fj()
  152. elseif (ls_tabtext = '费用明细') then
  153. wf_retr_fymx()
  154. elseif (ls_tabtext = '收费项目') then
  155. wf_retr_sfxm()
  156. elseif (ls_tabtext = '条码') then
  157. wf_retr_barcode()
  158. elseif (ls_tabtext = '日志') then
  159. wf_retr_log()
  160. // elseif (ls_tabtext = '包件立方') then
  161. end if
  162. end if
  163. end subroutine
  164. public subroutine wf_retr_fj ();// 刷新 附件 tab
  165. tabpage_fj.dw_fj.Reset()
  166. tabpage_fj.cb_fj_commit.Enabled = false
  167. if (IsNull(ins_tid)) then return
  168. if (Trim(ins_tid) = '') then return
  169. string arg_msg
  170. oleobject req, ret
  171. req = FXAppCom.CreatePbDictionary()
  172. req.SetString('token', app_token_fx)
  173. req.SetString('tid', ins_tid)
  174. ret = FXAppCom.DoExecute('GetTaskFjListByTid', req)
  175. arg_msg = ret.GetString('ErrMsg')
  176. if (arg_msg <> '') then
  177. MessageBox('提示', arg_msg)
  178. return
  179. end if
  180. oleobject list, item
  181. list = ret.GetPBArray('list')
  182. long ll_i, ll_insertRow
  183. tabpage_fj.dw_fj.SetRedraw(false)
  184. for ll_i = 1 to list.Count
  185. item = list.GetPBDictionary(ll_i - 1)
  186. ll_insertRow = tabpage_fj.dw_fj.InsertRow(0)
  187. tabpage_fj.dw_fj.Object.ch[ll_insertRow] = 0
  188. tabpage_fj.dw_fj.Object.mxprintid[ll_insertRow] = item.GetInt('mxprintid')
  189. tabpage_fj.dw_fj.Object.fjType[ll_insertRow] = item.GetInt('fjType')
  190. tabpage_fj.dw_fj.Object.fileName[ll_insertRow] = item.GetString('fileName')
  191. tabpage_fj.dw_fj.Object.dscrp[ll_insertRow] = item.GetString('dscrp')
  192. tabpage_fj.dw_fj.Object.opemp[ll_insertRow] = item.GetString('opemp')
  193. if (not IsNull(item.GetString('opdate'))) then
  194. tabpage_fj.dw_fj.Object.opdate[ll_insertRow] = item.GetDateTime('opdate')
  195. end if
  196. tabpage_fj.dw_fj.Object.taskid[ll_insertRow] = item.GetInt('taskid')
  197. tabpage_fj.dw_fj.Object.fjprintid[ll_insertRow] = item.GetInt('fjprintid')
  198. tabpage_fj.dw_fj.Object.fileType[ll_insertRow] = item.GetString('fileType')
  199. tabpage_fj.dw_fj.Object.filemd5[ll_insertRow] = item.GetString('filemd5')
  200. tabpage_fj.dw_fj.Object.filepath[ll_insertRow] = ''
  201. next
  202. tabpage_fj.dw_fj.AcceptText()
  203. tabpage_fj.dw_fj.SetRedraw(true)
  204. end subroutine
  205. public subroutine wf_retr_fymx ();// 刷新 费用明细 tab
  206. tabpage_fymx.dw_fymx.Reset()
  207. if (IsNull(ins_taskid)) then return
  208. if (ins_taskid <= 0) then return
  209. string arg_msg
  210. oleobject req, ret
  211. req = FXAppCom.CreatePbDictionary()
  212. req.SetString('token', app_token_fx)
  213. req.SetString('taskid', ins_taskid)
  214. ret = FXAppCom.DoExecute('GetCostItem', req)
  215. arg_msg = ret.GetString('ErrMsg')
  216. if (arg_msg <> '') then
  217. MessageBox('提示', arg_msg)
  218. return
  219. end if
  220. oleobject list, item
  221. list = ret.GetPBArray('items')
  222. long ll_i, ll_insertRow
  223. tabpage_fymx.dw_fymx.SetRedraw(false)
  224. for ll_i = 1 to list.Count
  225. item = list.GetPBDictionary(ll_i - 1)
  226. ll_insertRow = tabpage_fymx.dw_fymx.InsertRow(0)
  227. tabpage_fymx.dw_fymx.Object.printid[ll_insertRow] = item.GetInt('printid')
  228. tabpage_fymx.dw_fymx.Object.itemcode[ll_insertRow] = item.GetString('itemcode')
  229. tabpage_fymx.dw_fymx.Object.itemname[ll_insertRow] = item.GetString('itemname')
  230. tabpage_fymx.dw_fymx.Object.itemtype[ll_insertRow] = item.GetString('itemtype')
  231. tabpage_fymx.dw_fymx.Object.amt[ll_insertRow] = item.GetDouble('amt')
  232. tabpage_fymx.dw_fymx.Object.mxdscrp[ll_insertRow] = item.GetString('mxdscrp')
  233. tabpage_fymx.dw_fymx.Object.taskid[ll_insertRow] = item.GetInt('taskid')
  234. next
  235. tabpage_fymx.dw_fymx.AcceptText()
  236. tabpage_fymx.dw_fymx.SetRedraw(true)
  237. end subroutine
  238. public subroutine wf_retr_sfxm ();// 刷新 收费项目 tab
  239. tabpage_sfxm.dw_sfxm.Reset()
  240. if (IsNull(ins_taskid)) then return
  241. if (ins_taskid <= 0) then return
  242. string arg_msg
  243. oleobject req, ret
  244. req = FXAppCom.CreatePbDictionary()
  245. req.SetString('token', app_token_fx)
  246. req.SetString('taskid', ins_taskid)
  247. ret = FXAppCom.DoExecute('GetSaletaskPriceItemmx', req)
  248. arg_msg = ret.GetString('ErrMsg')
  249. if (arg_msg <> '') then
  250. MessageBox('提示', arg_msg)
  251. return
  252. end if
  253. oleobject list, item
  254. list = ret.GetPBArray('list')
  255. long ll_i, ll_insertRow
  256. tabpage_sfxm.dw_sfxm.SetRedraw(false)
  257. for ll_i = 1 to list.Count
  258. item = list.GetPBDictionary(ll_i - 1)
  259. ll_insertRow = tabpage_sfxm.dw_sfxm.InsertRow(0)
  260. tabpage_sfxm.dw_sfxm.Object.pid[ll_insertRow] = item.GetInt('pid')
  261. tabpage_sfxm.dw_sfxm.Object.itemcode[ll_insertRow] = item.GetString('itemcode')
  262. tabpage_sfxm.dw_sfxm.Object.itemname[ll_insertRow] = item.GetString('itemname')
  263. tabpage_sfxm.dw_sfxm.Object.subitemname[ll_insertRow] = item.GetString('subitemname')
  264. tabpage_sfxm.dw_sfxm.Object.calcType[ll_insertRow] = item.GetInt('calcType')
  265. tabpage_sfxm.dw_sfxm.Object.qty[ll_insertRow] = item.GetDouble('qty')
  266. tabpage_sfxm.dw_sfxm.Object.itemvalue[ll_insertRow] = item.GetDouble('itemvalue')
  267. tabpage_sfxm.dw_sfxm.Object.unit[ll_insertRow] = item.GetString('unit')
  268. tabpage_sfxm.dw_sfxm.Object.taskid[ll_insertRow] = item.GetInt('taskid')
  269. tabpage_sfxm.dw_sfxm.Object.printid[ll_insertRow] = item.GetInt('printid')
  270. tabpage_sfxm.dw_sfxm.Object.ifdft[ll_insertRow] = item.GetInt('ifdft')
  271. tabpage_sfxm.dw_sfxm.Object.p1[ll_insertRow] = item.GetString('p1')
  272. tabpage_sfxm.dw_sfxm.Object.p2[ll_insertRow] = item.GetString('p2')
  273. tabpage_sfxm.dw_sfxm.Object.p3[ll_insertRow] = item.GetString('p3')
  274. tabpage_sfxm.dw_sfxm.Object.rate[ll_insertRow] = item.GetDouble('rate')
  275. tabpage_sfxm.dw_sfxm.Object.dscrp[ll_insertRow] = item.GetString('dscrp')
  276. tabpage_sfxm.dw_sfxm.Object.priceDscrp[ll_insertRow] = item.GetString('priceDscrp')
  277. tabpage_sfxm.dw_sfxm.Object.method[ll_insertRow] = item.GetString('method')
  278. next
  279. tabpage_sfxm.dw_sfxm.AcceptText()
  280. tabpage_sfxm.dw_sfxm.SetRedraw(true)
  281. end subroutine
  282. public subroutine wf_retr_barcode ();// 刷新 条码 tab
  283. tabpage_barcode.dw_barcode.Reset()
  284. if (IsNull(ins_taskid)) then return
  285. if (ins_taskid <= 0) then return
  286. string arg_msg
  287. oleobject req, ret
  288. req = FXAppCom.CreatePbDictionary()
  289. req.SetString('token', app_token_fx)
  290. req.SetString('taskid', ins_taskid)
  291. ret = FXAppCom.DoExecute('GetOutwareBarcode', req)
  292. arg_msg = ret.GetString('ErrMsg')
  293. if (arg_msg <> '') then
  294. MessageBox('提示', arg_msg)
  295. return
  296. end if
  297. oleobject list, item
  298. list = ret.GetPBArray('barcodes')
  299. long ll_i, ll_insertRow
  300. tabpage_barcode.dw_barcode.SetRedraw(false)
  301. for ll_i = 1 to list.Count
  302. item = list.GetPBDictionary(ll_i - 1)
  303. ll_insertRow = tabpage_barcode.dw_barcode.InsertRow(0)
  304. tabpage_barcode.dw_barcode.Object.barcode[ll_insertRow] = item.GetString('barcode')
  305. tabpage_barcode.dw_barcode.Object.flag[ll_insertRow] = item.GetInt('flag')
  306. tabpage_barcode.dw_barcode.Object.ifcheck[ll_insertRow] = item.GetInt('ifcheck')
  307. tabpage_barcode.dw_barcode.Object.mtrlcode[ll_insertRow] = item.GetString('mtrlcode')
  308. tabpage_barcode.dw_barcode.Object.mtrlname[ll_insertRow] = item.GetString('mtrlname')
  309. tabpage_barcode.dw_barcode.Object.mtrlmode[ll_insertRow] = item.GetString('mtrlmode')
  310. tabpage_barcode.dw_barcode.Object.status[ll_insertRow] = item.GetString('status')
  311. tabpage_barcode.dw_barcode.Object.woodcode[ll_insertRow] = item.GetString('woodcode')
  312. tabpage_barcode.dw_barcode.Object.pcode[ll_insertRow] = item.GetString('pcode')
  313. tabpage_barcode.dw_barcode.Object.qty[ll_insertRow] = item.GetDouble('qty')
  314. tabpage_barcode.dw_barcode.Object.packqty[ll_insertRow] = item.GetDouble('packqty')
  315. tabpage_barcode.dw_barcode.Object.outwarecode[ll_insertRow] = item.GetString('outwarecode')
  316. if (not IsNull(item.GetDateTime('outwaredate'))) then
  317. tabpage_barcode.dw_barcode.Object.outwaredate[ll_insertRow] = item.GetDateTime('outwaredate')
  318. end if
  319. tabpage_barcode.dw_barcode.Object.freight_emp[ll_insertRow] = item.GetString('freight_emp')
  320. tabpage_barcode.dw_barcode.Object.freight_phone[ll_insertRow] = item.GetString('freight_phone')
  321. tabpage_barcode.dw_barcode.Object.taskid[ll_insertRow] = ins_taskid
  322. next
  323. tabpage_barcode.dw_barcode.AcceptText()
  324. tabpage_barcode.dw_barcode.SetRedraw(true)
  325. end subroutine
  326. public subroutine wf_retr_log ();// 刷新 日志 tab
  327. tabpage_log.dw_log.Reset()
  328. if (IsNull(ins_taskid)) then return
  329. if (ins_taskid <= 0) then return
  330. string arg_msg
  331. oleobject req, ret
  332. req = FXAppCom.CreatePbDictionary()
  333. req.SetString('token', app_token_fx)
  334. req.SetString('taskid', ins_taskid)
  335. ret = FXAppCom.DoExecute('GetTaskLogs', req)
  336. arg_msg = ret.GetString('ErrMsg')
  337. if (arg_msg <> '') then
  338. MessageBox('提示', arg_msg)
  339. return
  340. end if
  341. oleobject list, item
  342. list = ret.GetPBArray('logs')
  343. long ll_i, ll_insertRow
  344. tabpage_log.dw_log.SetRedraw(false)
  345. for ll_i = 1 to list.Count
  346. item = list.GetPBDictionary(ll_i - 1)
  347. ll_insertRow = tabpage_log.dw_log.InsertRow(0)
  348. tabpage_log.dw_log.Object.opemp[ll_insertRow] = item.GetString('opemp')
  349. tabpage_log.dw_log.Object.opLog[ll_insertRow] = item.GetString('opLog')
  350. if (not IsNull(item.GetDateTime('opdate'))) then
  351. tabpage_log.dw_log.Object.opdate[ll_insertRow] = item.GetDateTime('opdate')
  352. end if
  353. next
  354. tabpage_log.dw_log.AcceptText()
  355. tabpage_log.dw_log.SetRedraw(true)
  356. end subroutine
  357. public subroutine wf_open ();oleobject parm
  358. parm = FXAppCom.CreatePbDictionary()
  359. FXAppCom.SaveFileFromFxFileMap(parm)
  360. end subroutine
  361. on uo_fx_saletask_custom_tab.create
  362. this.tabpage_fj=create tabpage_fj
  363. this.tabpage_fymx=create tabpage_fymx
  364. this.tabpage_sfxm=create tabpage_sfxm
  365. this.tabpage_barcode=create tabpage_barcode
  366. this.tabpage_log=create tabpage_log
  367. this.Control[]={this.tabpage_fj,&
  368. this.tabpage_fymx,&
  369. this.tabpage_sfxm,&
  370. this.tabpage_barcode,&
  371. this.tabpage_log}
  372. end on
  373. on uo_fx_saletask_custom_tab.destroy
  374. destroy(this.tabpage_fj)
  375. destroy(this.tabpage_fymx)
  376. destroy(this.tabpage_sfxm)
  377. destroy(this.tabpage_barcode)
  378. destroy(this.tabpage_log)
  379. end on
  380. event selectionchanged;wf_retr(false)
  381. end event
  382. type tabpage_fj from userobject within uo_fx_saletask_custom_tab
  383. event create ( )
  384. event destroy ( )
  385. integer x = 18
  386. integer y = 96
  387. integer width = 2505
  388. integer height = 1048
  389. long backcolor = 16777215
  390. string text = "附件"
  391. long tabtextcolor = 33554432
  392. long picturemaskcolor = 536870912
  393. cb_fj_commit cb_fj_commit
  394. dw_fj dw_fj
  395. cb_fj_del cb_fj_del
  396. cb_fj_upload cb_fj_upload
  397. cbx_fj_ch_all cbx_fj_ch_all
  398. end type
  399. on tabpage_fj.create
  400. this.cb_fj_commit=create cb_fj_commit
  401. this.dw_fj=create dw_fj
  402. this.cb_fj_del=create cb_fj_del
  403. this.cb_fj_upload=create cb_fj_upload
  404. this.cbx_fj_ch_all=create cbx_fj_ch_all
  405. this.Control[]={this.cb_fj_commit,&
  406. this.dw_fj,&
  407. this.cb_fj_del,&
  408. this.cb_fj_upload,&
  409. this.cbx_fj_ch_all}
  410. end on
  411. on tabpage_fj.destroy
  412. destroy(this.cb_fj_commit)
  413. destroy(this.dw_fj)
  414. destroy(this.cb_fj_del)
  415. destroy(this.cb_fj_upload)
  416. destroy(this.cbx_fj_ch_all)
  417. end on
  418. type cb_fj_commit from commandbutton within tabpage_fj
  419. integer x = 864
  420. integer width = 302
  421. integer height = 84
  422. integer taborder = 30
  423. integer textsize = -9
  424. integer weight = 400
  425. fontcharset fontcharset = gb2312charset!
  426. fontpitch fontpitch = variable!
  427. string facename = "宋体"
  428. boolean enabled = false
  429. string text = "确认上传"
  430. end type
  431. event clicked;if (IsNull(ins_taskid)) then return
  432. if (ins_taskid <= 0) then return
  433. if (ins_status = 2) then return
  434. dw_fj.AcceptText()
  435. long ll_findRow, ll_i = 0
  436. long ll_rows[]
  437. string ls_findStr, arg_msg
  438. ls_findStr = 'fjprintid <= 0'
  439. ll_findRow = dw_fj.Find(ls_findStr, 1, dw_fj.RowCount())
  440. do while (ll_findRow > 0)
  441. ll_i++
  442. ll_rows[ll_i] = ll_findRow
  443. if (ll_findRow + 1 > dw_fj.RowCount()) then exit
  444. ll_findRow = dw_fj.Find(ls_findStr, ll_findRow + 1, dw_fj.RowCount())
  445. loop
  446. if (UpperBound(ll_rows) <= 0) then
  447. MessageBox('提示', '没有需要提交的附件')
  448. this.Enabled = false
  449. return
  450. end if
  451. // 1-先上传新增附件的md5,与服务器对比,2-返回服务器没有的md5,再上传附件数据
  452. string ls_arr_1_md5[], ls_arr_1_filepath[]
  453. for ll_i = 1 to UpperBound(ll_rows)
  454. ls_arr_1_md5[ll_i] = dw_fj.Object.filemd5[ll_rows[ll_i]]
  455. ls_arr_1_filepath[ll_i] = dw_fj.Object.filepath[ll_rows[ll_i]]
  456. next
  457. if (UpperBound(ls_arr_1_md5) > 0) then
  458. if (f_chkfxfilemapwithmd5andupload(ls_arr_1_md5, ls_arr_1_filepath, ref arg_msg) <> 1) then
  459. MessageBox('提示', '上传失败:' + arg_msg)
  460. return
  461. end if
  462. end if
  463. // PC端需提供fjType、dscrp、fileName、fileType、filemd5
  464. oleobject files, item
  465. files = FXAppCom.NewPBArray()
  466. for ll_i = 1 to UpperBound(ll_rows)
  467. ll_findRow = ll_rows[ll_i]
  468. item = FXAppCom.CreatePbDictionary()
  469. item.SetInt('fjType', dw_fj.Object.fjtype[ll_findRow])
  470. item.SetString('dscrp', Trim(dw_fj.Object.dscrp[ll_findRow]))
  471. item.SetString('fileName', dw_fj.Object.filename[ll_findRow])
  472. item.SetString('fileType', dw_fj.Object.fileType[ll_findRow])
  473. item.SetString('filemd5', dw_fj.Object.filemd5[ll_findRow])
  474. files.AddObject(item)
  475. next
  476. // 更新到fx_saletask_fj
  477. oleobject req, rsp
  478. req = FXAppCom.CreatePbDictionary()
  479. req.SetString('token', app_token_fx)
  480. req.SetInt('taskid', ins_taskid)
  481. req.SetInt('printid', 1) // 定制产品订单只有一个明细
  482. req.SetInt('clientMode', 2) // 客户端 0-手机 1-ERP 2-PB客户端
  483. req.SetObject('files', files)
  484. rsp = FXAppCom.DoExecute('UploadSaletaskFiles', req)
  485. arg_msg = rsp.GetString('ErrMsg')
  486. if (arg_msg <> '') then
  487. MessageBox('提示', arg_msg)
  488. return
  489. else
  490. wf_retr_fj()
  491. end if
  492. end event
  493. type dw_fj from u_dw_rbtnfilter within tabpage_fj
  494. integer y = 88
  495. integer width = 2267
  496. integer height = 784
  497. integer taborder = 40
  498. string dataobject = "dw_fx_buytask_custom_fj"
  499. boolean hscrollbar = true
  500. boolean vscrollbar = true
  501. boolean hsplitscroll = true
  502. borderstyle borderstyle = stylebox!
  503. boolean rbutton_filter_use = true
  504. boolean rbutton_setposition_use = true
  505. boolean titleclick_sort_use = true
  506. end type
  507. event clicked;call super::clicked;string ls_name, ls_filepath, ls_fileName, ls_fileType, ls_filemd5
  508. string arg_msg, ls_retPath
  509. oleobject parm, ret
  510. if (row > 0) then
  511. this.SetRow(row)
  512. this.SelectRow(0, false)
  513. this.SelectRow(row, true)
  514. ls_name = dwo.Name
  515. if (ls_name = 'compute_1') then
  516. ls_filepath = Trim(this.Object.filepath[row])
  517. ls_fileName = Trim(this.Object.fileName[row])
  518. ls_fileType = Trim(this.Object.fileType[row])
  519. ls_filemd5 = Trim(this.Object.filemd5[row])
  520. parm = FXAppCom.CreatePbDictionary()
  521. parm.SetString('token', app_token_fx)
  522. parm.SetString('filepath', ls_filepath)
  523. parm.SetString('filemd5', ls_filemd5)
  524. parm.SetString('initialDirectory', '')
  525. parm.SetString('filter', '')
  526. parm.SetString('defaultExt', '')
  527. parm.SetString('fileName', ls_fileName)
  528. parm.SetInt('ifOpenAfterDownload', 1)
  529. ret = FXAppCom.SaveFileFromFxFileMap(parm)
  530. arg_msg = ret.GetString('ErrMsg')
  531. if (arg_msg <> '') then
  532. MessageBox('提示', arg_msg)
  533. return
  534. end if
  535. ls_retPath = ret.GetString('fullFilePath')
  536. if (ls_retPath <> '') then
  537. this.Object.filepath[row] = ls_retPath
  538. this.AcceptText()
  539. end if
  540. end if
  541. end if
  542. end event
  543. event rowfocuschanged;call super::rowfocuschanged;if (currentrow > 0) then
  544. this.SetRow(currentrow)
  545. this.SelectRow(0, false)
  546. this.SelectRow(currentrow, true)
  547. end if
  548. end event
  549. type cb_fj_del from commandbutton within tabpage_fj
  550. integer x = 539
  551. integer width = 302
  552. integer height = 84
  553. integer taborder = 30
  554. integer textsize = -9
  555. integer weight = 400
  556. fontcharset fontcharset = gb2312charset!
  557. fontpitch fontpitch = variable!
  558. string facename = "宋体"
  559. string text = "删除"
  560. end type
  561. event clicked;dw_fj.AcceptText()
  562. long ll_findRow, ll_index = 0
  563. long ll_arr_rows[]
  564. string ls_findStr
  565. ls_findStr = '(ch = 1) and (fjtype = 0 or fjtype = 2) and (opemp = "' + app_username + '")'
  566. ll_findRow = dw_fj.Find(ls_findStr, 1, dw_fj.RowCount())
  567. if (ll_findRow > 0) then // 多选
  568. do while (ll_findRow > 0)
  569. ll_index++
  570. ll_arr_rows[ll_index] = ll_findRow
  571. if (ll_findRow + 1 > dw_fj.RowCount()) then exit
  572. ll_findRow = dw_fj.Find(ls_findStr, ll_findRow + 1, dw_fj.RowCount())
  573. loop
  574. else // 单选
  575. ll_findRow = dw_fj.GetRow()
  576. if (ll_findRow > 0) then
  577. if ((dw_fj.Object.fjtype[ll_findRow] = 0 or dw_fj.Object.fjtype[ll_findRow] = 2) &
  578. and (dw_fj.Object.opemp[ll_findRow] = app_username)) then
  579. ll_index++
  580. ll_arr_rows[ll_index] = ll_findRow
  581. end if
  582. end if
  583. end if
  584. if (ll_index <= 0) then
  585. MessageBox('提示', '请选中/勾选需要删除的附件~r~n只支持删除类型是"付款凭证"或"下单附件",且为当前账号上传的附件')
  586. return
  587. end if
  588. long ll_fjprintid, ll_i
  589. oleobject deletePrintids
  590. deletePrintids = FXAppCom.NewPBArray()
  591. for ll_index = UpperBound(ll_arr_rows) to 1 step - 1
  592. ll_fjprintid = dw_fj.Object.fjprintid[ll_arr_rows[ll_index]]
  593. if ((ins_taskid > 0 and ins_status <> 2) and ll_fjprintid > 0) then // 非新建/退回状态的订单,删除附件操作需要即时提交
  594. deletePrintids.AddInt(ll_fjprintid)
  595. end if
  596. dw_fj.DeleteRow(ll_arr_rows[ll_index])
  597. next
  598. // 提交需要即时删除的附件,更新到fx_saletask_fj
  599. oleobject req, rsp
  600. string arg_msg
  601. if (deletePrintids.Count > 0) then
  602. if (MessageBox('提示', '确认删除当前已上传的附件?', Question!, YesNo!) <> 1) then
  603. wf_retr_fj()
  604. return
  605. end if
  606. req = FXAppCom.CreatePbDictionary()
  607. req.SetString('token', app_token_fx)
  608. req.SetInt('taskid', ins_taskid)
  609. req.SetInt('printid', 1) // 定制产品订单只有一个明细
  610. req.SetInt('clientMode', 2) // 客户端 0-手机 1-ERP 2-PB客户端
  611. req.SetObject('deletePrintids', deletePrintids)
  612. rsp = FXAppCom.DoExecute('UploadSaletaskFiles', req)
  613. arg_msg = rsp.GetString('ErrMsg')
  614. if (arg_msg <> '') then
  615. MessageBox('提示', arg_msg)
  616. return
  617. else
  618. wf_retr_fj()
  619. end if
  620. end if
  621. end event
  622. type cb_fj_upload from commandbutton within tabpage_fj
  623. integer x = 215
  624. integer width = 302
  625. integer height = 84
  626. integer taborder = 20
  627. integer textsize = -9
  628. integer weight = 400
  629. fontcharset fontcharset = gb2312charset!
  630. fontpitch fontpitch = variable!
  631. string facename = "宋体"
  632. string text = "上传..."
  633. end type
  634. event clicked;// 新建状态可以选多个订单明细,上传附件需要对应当前的明细
  635. ins_parent.PostEvent('ue_tab_fj_upload')
  636. // 非新建、非退回状态的订单,需要手动提交附件
  637. if (ins_taskid > 0 and ins_status <> 2) then
  638. cb_fj_commit.Enabled = true
  639. end if
  640. end event
  641. type cbx_fj_ch_all from checkbox within tabpage_fj
  642. integer x = 9
  643. integer y = 12
  644. integer width = 192
  645. integer height = 60
  646. integer taborder = 10
  647. integer textsize = -9
  648. integer weight = 400
  649. fontcharset fontcharset = gb2312charset!
  650. fontpitch fontpitch = variable!
  651. string facename = "宋体"
  652. long textcolor = 33554432
  653. long backcolor = 16777215
  654. string text = "全选"
  655. end type
  656. event clicked;long ll_ch, ll_i
  657. if (this.Checked) then
  658. ll_ch = 1
  659. else
  660. ll_ch = 0
  661. end if
  662. for ll_i = 1 to dw_fj.RowCount()
  663. dw_fj.Object.ch[ll_i] = ll_ch
  664. next
  665. dw_fj.AcceptText()
  666. end event
  667. type tabpage_fymx from userobject within uo_fx_saletask_custom_tab
  668. event create ( )
  669. event destroy ( )
  670. integer x = 18
  671. integer y = 96
  672. integer width = 2505
  673. integer height = 1048
  674. long backcolor = 16777215
  675. string text = "费用明细"
  676. long tabtextcolor = 33554432
  677. long tabbackcolor = 16777215
  678. long picturemaskcolor = 536870912
  679. dw_fymx dw_fymx
  680. end type
  681. on tabpage_fymx.create
  682. this.dw_fymx=create dw_fymx
  683. this.Control[]={this.dw_fymx}
  684. end on
  685. on tabpage_fymx.destroy
  686. destroy(this.dw_fymx)
  687. end on
  688. type dw_fymx from u_dw_rbtnfilter within tabpage_fymx
  689. integer width = 2126
  690. integer height = 700
  691. integer taborder = 20
  692. string dataobject = "dw_fx_buytask_itemmx"
  693. boolean hscrollbar = true
  694. boolean vscrollbar = true
  695. boolean hsplitscroll = true
  696. borderstyle borderstyle = stylebox!
  697. boolean rbutton_filter_use = true
  698. boolean rbutton_setposition_use = true
  699. boolean titleclick_sort_use = true
  700. end type
  701. event clicked;call super::clicked;if (row > 0) then
  702. this.SetRow(row)
  703. this.SelectRow(0, false)
  704. this.SelectRow(row, true)
  705. end if
  706. end event
  707. event rowfocuschanged;call super::rowfocuschanged;if (currentrow > 0) then
  708. this.SetRow(currentrow)
  709. this.SelectRow(0, false)
  710. this.SelectRow(currentrow, true)
  711. end if
  712. end event
  713. type tabpage_sfxm from userobject within uo_fx_saletask_custom_tab
  714. event create ( )
  715. event destroy ( )
  716. integer x = 18
  717. integer y = 96
  718. integer width = 2505
  719. integer height = 1048
  720. long backcolor = 16777215
  721. string text = "收费项目"
  722. long tabtextcolor = 33554432
  723. long tabbackcolor = 16777215
  724. long picturemaskcolor = 536870912
  725. dw_sfxm dw_sfxm
  726. end type
  727. on tabpage_sfxm.create
  728. this.dw_sfxm=create dw_sfxm
  729. this.Control[]={this.dw_sfxm}
  730. end on
  731. on tabpage_sfxm.destroy
  732. destroy(this.dw_sfxm)
  733. end on
  734. type dw_sfxm from u_dw_rbtnfilter within tabpage_sfxm
  735. integer width = 1947
  736. integer height = 780
  737. integer taborder = 20
  738. string dataobject = "dw_fx_saletask_price_itemmx"
  739. boolean hscrollbar = true
  740. boolean vscrollbar = true
  741. boolean hsplitscroll = true
  742. borderstyle borderstyle = stylebox!
  743. boolean rbutton_filter_use = true
  744. boolean rbutton_setposition_use = true
  745. boolean titleclick_sort_use = true
  746. end type
  747. type tabpage_barcode from userobject within uo_fx_saletask_custom_tab
  748. event create ( )
  749. event destroy ( )
  750. integer x = 18
  751. integer y = 96
  752. integer width = 2505
  753. integer height = 1048
  754. long backcolor = 16777215
  755. string text = "条码"
  756. long tabtextcolor = 33554432
  757. long tabbackcolor = 16777215
  758. long picturemaskcolor = 536870912
  759. dw_barcode dw_barcode
  760. end type
  761. on tabpage_barcode.create
  762. this.dw_barcode=create dw_barcode
  763. this.Control[]={this.dw_barcode}
  764. end on
  765. on tabpage_barcode.destroy
  766. destroy(this.dw_barcode)
  767. end on
  768. type dw_barcode from u_dw_rbtnfilter within tabpage_barcode
  769. integer width = 2117
  770. integer height = 788
  771. integer taborder = 20
  772. string dataobject = "dw_fx_outware_barcode"
  773. boolean hscrollbar = true
  774. boolean vscrollbar = true
  775. boolean hsplitscroll = true
  776. borderstyle borderstyle = stylebox!
  777. boolean rbutton_filter_use = true
  778. boolean rbutton_setposition_use = true
  779. boolean titleclick_sort_use = true
  780. end type
  781. type tabpage_log from userobject within uo_fx_saletask_custom_tab
  782. event create ( )
  783. event destroy ( )
  784. integer x = 18
  785. integer y = 96
  786. integer width = 2505
  787. integer height = 1048
  788. long backcolor = 16777215
  789. string text = "日志"
  790. long tabtextcolor = 33554432
  791. long tabbackcolor = 16777215
  792. long picturemaskcolor = 536870912
  793. dw_log dw_log
  794. end type
  795. on tabpage_log.create
  796. this.dw_log=create dw_log
  797. this.Control[]={this.dw_log}
  798. end on
  799. on tabpage_log.destroy
  800. destroy(this.dw_log)
  801. end on
  802. type dw_log from u_dw_rbtnfilter within tabpage_log
  803. integer width = 2281
  804. integer height = 796
  805. integer taborder = 20
  806. string dataobject = "dw_fx_saletask_log"
  807. boolean hscrollbar = true
  808. boolean vscrollbar = true
  809. boolean hsplitscroll = true
  810. borderstyle borderstyle = stylebox!
  811. boolean rbutton_filter_use = true
  812. boolean rbutton_setposition_use = true
  813. boolean titleclick_sort_use = true
  814. end type