123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 |
- $PBExportHeader$w_rp_mstpay_fx.srw
- $PBExportComments$供应商对账单(协同)
- forward
- global type w_rp_mstpay_fx from w_publ_base_style
- end type
- type cb_retrieve from uo_imflatbutton within w_rp_mstpay_fx
- end type
- type cb_1 from uo_imflatbutton within w_rp_mstpay_fx
- end type
- type st_1 from statictext within w_rp_mstpay_fx
- end type
- type em_datea from editmask within w_rp_mstpay_fx
- end type
- type st_2 from statictext within w_rp_mstpay_fx
- end type
- type em_datez from editmask within w_rp_mstpay_fx
- end type
- type dw_mstpay_ff from datawindow within w_rp_mstpay_fx
- end type
- type dw_mstpay from u_dw_rbtnfilter within w_rp_mstpay_fx
- end type
- type dw_mstpay_data from datawindow within w_rp_mstpay_fx
- end type
- type cb_2 from commandbutton within w_rp_mstpay_fx
- end type
- type st_4 from statictext within w_rp_mstpay_fx
- end type
- type em_heightedit from editmask within w_rp_mstpay_fx
- end type
- type cb_read from uo_imflatbutton within w_rp_mstpay_fx
- end type
- end forward
- global type w_rp_mstpay_fx from w_publ_base_style
- integer width = 4713
- integer height = 2768
- string title = "供应商对账表"
- boolean maxbox = true
- boolean resizable = true
- long backcolor = 16777215
- event ue_page_next ( )
- event ue_page_before ( )
- event ue_page_end ( )
- cb_retrieve cb_retrieve
- cb_1 cb_1
- st_1 st_1
- em_datea em_datea
- st_2 st_2
- em_datez em_datez
- dw_mstpay_ff dw_mstpay_ff
- dw_mstpay dw_mstpay
- dw_mstpay_data dw_mstpay_data
- cb_2 cb_2
- st_4 st_4
- em_heightedit em_heightedit
- cb_read cb_read
- end type
- global w_rp_mstpay_fx w_rp_mstpay_fx
- type variables
- long ins_cur_pageNum = 1 // 用于记录当前页码
- long ins_totalPages = 1 // 用于记录总页数
- end variables
- forward prototypes
- public function integer wf_retrieve ()
- public function integer wf_retrieve_data (long a_row)
- public function integer wf_delete_local_data (boolean a_ifsilence)
- end prototypes
- event ue_page_next();// 下页
- if (ins_cur_pageNum = ins_totalPages) then return
- ins_cur_pageNum ++
- end event
- event ue_page_before();// 上页
- if (ins_cur_pageNum = 1) then return
- ins_cur_pageNum --
- end event
- event ue_page_end();// 末页
- if (ins_cur_pageNum = ins_totalPages) then return
- ins_cur_pageNum = ins_totalPages
- end event
- public function integer wf_retrieve ();int rslt = 1
- string arg_msg
- long oriRow
- oriRow = dw_mstpay.GetRow()
- datetime dateA, dateZ
- dateA = DateTime(Date(em_dateA.Text), Time(0))
- dateZ = DateTime(Date(em_dateZ.Text), Time('23:59:59'))
- oleobject obj, parm, list, item
- parm = FxAppCom.CreatePbDictionary()
- parm.SetString('token', app_token_fx)
- parm.SetDateTime('dateA', dateA)
- parm.SetDateTime('dateZ', dateZ)
- obj = FXAppCom.GetRpMstpay(parm, ref arg_msg)
- if (arg_msg <> '') then
- rslt = 0
- goto ext
- end if
- dw_mstpay.Reset()
- dw_mstpay_ff.Reset()
- dw_mstpay_data.Reset()
- long i, row
- list = obj.GetPBArray('list')
- dw_mstpay.SetRedraw(false)
- for i = 1 to list.Count
- item = list.GetPBDictionary(i - 1)
- row = dw_mstpay.InsertRow(0)
-
- dw_mstpay.Object.ch[row] = 0
- dw_mstpay.Object.SerialNum[row] = item.GetString('SerialNum')
- dw_mstpay.Object.SendSCcode[row] = item.GetString('SendSCcode')
- dw_mstpay.Object.AddUser[row] = item.GetString('AddUser')
- if (not IsNull(item.GetDateTime('AddTime'))) then
- dw_mstpay.Object.AddTime[row] = item.GetDateTime('AddTime')
- end if
- // dw_mstpay.Object.Summary[row] = item.GetString('Summary')
- dw_mstpay.Object.Postscript[row] = item.GetString('Postscript')
- // dw_mstpay.Object.Remark[row] = item.GetString('Remark')
- if (not IsNull(item.GetDateTime('effectDateA'))) then
- dw_mstpay.Object.effectDateA[row] = item.GetDateTime('effectDateA')
- end if
- if (not IsNull(item.GetDateTime('effectDateZ'))) then
- dw_mstpay.Object.effectDateZ[row] = item.GetDateTime('effectDateZ')
- end if
- dw_mstpay.Object.flag[row] = item.GetInt('flag')
- dw_mstpay.Object.opemp[row] = item.GetString('opemp')
- if (not IsNull(item.GetDateTime('opdate'))) then
- dw_mstpay.Object.opdate[row] = item.GetDateTime('opdate')
- end if
- dw_mstpay.Object.withdrawEmp[row] = item.GetString('withdrawEmp')
- if (not IsNull(item.GetDateTime('withdrawDate'))) then
- dw_mstpay.Object.withdrawDate[row] = item.GetDateTime('withdrawDate')
- end if
- dw_mstpay.Object.filename[row] = item.GetString('filename')
- dw_mstpay.Object.extension[row] = item.GetString('extension')
- dw_mstpay.Object.comname[row] = item.GetString('comname')
- if (item.GetInt('Status') = 5) then // [5]接收未处理
- dw_mstpay.Object.unread[row] = 1
- else
- dw_mstpay.Object.unread[row] = 0
- end if
- next
- dw_mstpay.AcceptText()
- dw_mstpay.SetRedraw(true)
- //wf_delete_local_data(true)
- ext:
- if (rslt = 1) then
- if (dw_mstpay.RowCount() > 0) then
- dw_mstpay.SelectRow(0, false)
- if (oriRow > 0 and oriRow <= dw_mstpay.RowCount()) then
- dw_mstpay.SelectRow(oriRow, true)
- dw_mstpay.SetRow(oriRow)
- dw_mstpay.post event RowFocusChanged(oriRow)
- else
- dw_mstpay.SelectRow(1, true)
- dw_mstpay.SetRow(1)
- dw_mstpay.post event RowFocusChanged(1)
- end if
- end if
- else
- MessageBox('提示', arg_msg)
- end if
- return rslt
- end function
- public function integer wf_retrieve_data (long a_row);int rslt = 1
- string arg_msg
- if (IsNull(a_row)) then return 0
- if (a_row <= 0) then return 0
- dw_mstpay_data.Reset()
- dw_mstpay.Accepttext( )
- long flag // 0-不可读 1-可读 2-被撤回
- flag = dw_mstpay.Object.flag[a_row]
- if (flag = 0 or flag = 2) then return 0
- string sn, filename, extension, exePath, fileDir
- sn = dw_mstpay.Object.SerialNum[a_row]
- filename = dw_mstpay.Object.filename[a_row]
- extension = dw_mstpay.Object.extension[a_row]
- exePath = GetCurrentDirectory()
- fileDir = exePath + '\cache\mstpay\'
- IF ISNULL(sn) THEN RETURN 0
- long insertRow
- oleobject parm
- dw_mstpay_data.SetRedraw(false)
- if (FileExists(fileDir + filename + extension)) then // 先查找本地是否存在文件
- insertRow = dw_mstpay_data.InsertRow(0)
- dw_mstpay_data.Object.filepath[insertRow] = fileDir + filename + extension
- else
- parm = FxAppCom.CreatePbDictionary()
- parm.SetString('token', app_token_fx)
- parm.SetString('sn', sn)
- // parm.SetString('exePath', exePath)
- parm.SetString('fileDir', fileDir)
- parm.SetString('filename',filename)
- parm.SetString('extension',extension)
- FXAppCom.GetRpMstpayData(parm, ref arg_msg)
- IF NOT ISNULL(arg_msg) AND Len(arg_msg) > 0 THEN
- rslt = 0
- GOTO ext
- END IF
- // TODO
- insertRow = dw_mstpay_data.InsertRow(0)
- dw_mstpay_data.Object.filepath[insertRow] = fileDir + filename + extension
- end if
- dw_mstpay_data.SetRedraw(true)
- ext:
- IF rslt <> 1 AND NOT ISNULL(arg_msg) AND Len(arg_msg) > 0 THEN
- MessageBox('提示','获取对账单图片失败,'+arg_msg)
- END IF
- return rslt
- end function
- public function integer wf_delete_local_data (boolean a_ifsilence);// 删除本地超期/被撤回的对账表
- // a_ifsilence = true不弹出错误信息
- int rslt = 1
- datetime ldt_now
- ldt_now = datetime(today(), now())
- long findRow
- findRow = dw_mstpay.Find('', 1, dw_mstpay.RowCount())
- // TODO
- return rslt
- end function
- on w_rp_mstpay_fx.create
- int iCurrent
- call super::create
- this.cb_retrieve=create cb_retrieve
- this.cb_1=create cb_1
- this.st_1=create st_1
- this.em_datea=create em_datea
- this.st_2=create st_2
- this.em_datez=create em_datez
- this.dw_mstpay_ff=create dw_mstpay_ff
- this.dw_mstpay=create dw_mstpay
- this.dw_mstpay_data=create dw_mstpay_data
- this.cb_2=create cb_2
- this.st_4=create st_4
- this.em_heightedit=create em_heightedit
- this.cb_read=create cb_read
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_retrieve
- this.Control[iCurrent+2]=this.cb_1
- this.Control[iCurrent+3]=this.st_1
- this.Control[iCurrent+4]=this.em_datea
- this.Control[iCurrent+5]=this.st_2
- this.Control[iCurrent+6]=this.em_datez
- this.Control[iCurrent+7]=this.dw_mstpay_ff
- this.Control[iCurrent+8]=this.dw_mstpay
- this.Control[iCurrent+9]=this.dw_mstpay_data
- this.Control[iCurrent+10]=this.cb_2
- this.Control[iCurrent+11]=this.st_4
- this.Control[iCurrent+12]=this.em_heightedit
- this.Control[iCurrent+13]=this.cb_read
- end on
- on w_rp_mstpay_fx.destroy
- call super::destroy
- destroy(this.cb_retrieve)
- destroy(this.cb_1)
- destroy(this.st_1)
- destroy(this.em_datea)
- destroy(this.st_2)
- destroy(this.em_datez)
- destroy(this.dw_mstpay_ff)
- destroy(this.dw_mstpay)
- destroy(this.dw_mstpay_data)
- destroy(this.cb_2)
- destroy(this.st_4)
- destroy(this.em_heightedit)
- destroy(this.cb_read)
- end on
- event open;call super::open;//
- //dw_mstpay_dada.InsertRow(0)
- string arg_msg // 70-供应商对账表
- if (f_find_fx_user_power(70, ref arg_msg) <> 1) then
- MessageBox('权限提示', arg_msg)
- Close(this)
- return
- end if
- em_datea.Text = String(RelativeDate(Today(), - 120))
- em_datez.Text = String(Today())
- wf_retrieve()
- end event
- event resize;call super::resize;if (this.Width < 4100) then this.Width = 4100
- if (this.Height < 2600) then this.Height = 2600
- dw_mstpay_ff.Width = this.workspacewidth( ) * 0.4
- dw_mstpay.X = dw_mstpay_ff.Width + 5
- dw_mstpay.Width = this.workspacewidth( ) - dw_mstpay_ff.Width - 10
- dw_mstpay_data.Width = this.workspacewidth( )
- dw_mstpay_data.Height = this.workspaceheight( ) - dw_mstpay_data.Y
- // 按钮靠右
- cb_exit.X = this.workspacewidth( ) - cb_exit.Width
- end event
- type cb_func from w_publ_base_style`cb_func within w_rp_mstpay_fx
- boolean visible = false
- integer x = 3113
- boolean enabled = false
- end type
- type cb_exit from w_publ_base_style`cb_exit within w_rp_mstpay_fx
- integer x = 3607
- end type
- type ln_bar from w_publ_base_style`ln_bar within w_rp_mstpay_fx
- end type
- type ln_bar2 from w_publ_base_style`ln_bar2 within w_rp_mstpay_fx
- end type
- type r_bar from w_publ_base_style`r_bar within w_rp_mstpay_fx
- end type
- type cb_retrieve from uo_imflatbutton within w_rp_mstpay_fx
- integer width = 151
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- string text = "刷新"
- string normalpicname = "refresh.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;wf_retrieve()
- end event
- type cb_1 from uo_imflatbutton within w_rp_mstpay_fx
- boolean visible = false
- integer x = 2496
- integer width = 151
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- boolean enabled = false
- string text = "打印"
- end type
- type st_1 from statictext within w_rp_mstpay_fx
- integer x = 14
- integer y = 204
- integer width = 183
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "日期从"
- boolean focusrectangle = false
- end type
- type em_datea from editmask within w_rp_mstpay_fx
- integer x = 192
- integer y = 188
- integer width = 389
- integer height = 84
- integer taborder = 40
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "0000-00-00"
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- type st_2 from statictext within w_rp_mstpay_fx
- integer x = 599
- integer y = 204
- integer width = 87
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 16777215
- string text = "到"
- boolean focusrectangle = false
- end type
- type em_datez from editmask within w_rp_mstpay_fx
- integer x = 672
- integer y = 188
- integer width = 389
- integer height = 84
- integer taborder = 50
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "0000-00-00"
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- type dw_mstpay_ff from datawindow within w_rp_mstpay_fx
- integer y = 284
- integer width = 1856
- integer height = 692
- integer taborder = 50
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_fieb_rp_mstpay_ff"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type dw_mstpay from u_dw_rbtnfilter within w_rp_mstpay_fx
- integer x = 1851
- integer y = 284
- integer width = 2258
- integer height = 692
- integer taborder = 20
- boolean bringtotop = true
- boolean titlebar = true
- string title = "对账表列表"
- string dataobject = "dw_fieb_rp_mstpay"
- boolean controlmenu = true
- boolean minbox = true
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean resizable = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event rowfocuschanged;call super::rowfocuschanged;if IsNull(currentrow) then
- IF THIS.rowcount() > 0 then
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(1,TRUE)
- THIS.setrow(1)
- currentrow =1
- end if
- end if
- if IsNull(currentrow) then
- currentrow = this.GetRow()
- if IsNull(currentrow) then return
- end if
- if (currentrow <= 0) then return
- this.SelectRow(0, false)
- this.SelectRow(currentrow, true)
- dw_mstpay_ff.Reset( )
- this.RowsCopy(currentrow, currentrow, Primary!, dw_mstpay_ff, 1, Primary!)
- string arg_msg // 71-供应商对账表确认
- if (f_find_fx_user_power(71, ref arg_msg) = 1 and this.Object.unread[currentrow] = 1) then
- cb_read.Enabled = true
- else
- cb_read.Enabled = false
- end if
- wf_retrieve_data(currentrow)
- end event
- event clicked;call super::clicked;if (row > 0) then
- this.SelectRow(0, false)
- this.SelectRow(row, true)
- THIS.SetRow(row)
- end if
- end event
- type dw_mstpay_data from datawindow within w_rp_mstpay_fx
- integer y = 972
- integer width = 4105
- integer height = 1236
- integer taborder = 60
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_fieb_rp_mstpay_data"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_2 from commandbutton within w_rp_mstpay_fx
- integer x = 1609
- integer y = 188
- integer width = 247
- integer height = 84
- integer taborder = 70
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string pointer = "Arrow!"
- string text = "调整"
- end type
- event clicked;//dw_mstpay_dada
- //dw_mstpay_dada.Modify("DataWindow.detail.height = 1000")
- Long ll_height
- ll_height = Long(em_heightedit.Text)
- IF ISNULL(ll_height) OR ll_height <= 0 THEN
- RETURN
- END IF
- dw_mstpay_data.Modify("pic.height = '" + String(ll_height) + "'")
- end event
- type st_4 from statictext within w_rp_mstpay_fx
- integer x = 1115
- integer y = 204
- integer width = 265
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "图片高度;"
- boolean focusrectangle = false
- end type
- type em_heightedit from editmask within w_rp_mstpay_fx
- integer x = 1376
- integer y = 188
- integer width = 201
- integer height = 84
- integer taborder = 90
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "600"
- borderstyle borderstyle = stylelowered!
- string mask = "######"
- end type
- type cb_read from uo_imflatbutton within w_rp_mstpay_fx
- integer x = 155
- integer width = 256
- integer height = 164
- integer taborder = 70
- boolean bringtotop = true
- string text = "标记已读"
- string normalpicname = "ok.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;long findRow, index = 0
- long rows[]
- findRow = dw_mstpay.Find('ch = 1', 1, dw_mstpay.RowCount())
- if (findRow > 0) then // 多选
- do while findRow > 0
- index++
- rows[index] = findRow
-
- if (findRow >= dw_mstpay.RowCount()) then exit
- findRow = dw_mstpay.Find('ch = 1', findRow + 1, dw_mstpay.RowCount())
- loop
- else // 单选
- findRow = dw_mstpay.GetRow()
- if (findRow > 0) then
- if (dw_mstpay.IsSelected(findRow)) then
- index++
- rows[index] = findRow
- end if
- end if
- end if
- if (index <= 0) then
- MessageBox('提示', '请选中/勾选需要标记已读的项')
- return
- end if
- string tmp_serialnum
- long ll_i
- oleobject strList, parm
- strList = FXAppCom.NewPBArray()
- for ll_i = 1 to UpperBound(rows)
- if (dw_mstpay.Object.unread[rows[ll_i]] = 0) then continue
-
- tmp_serialnum = Trim(dw_mstpay.Object.serialnum[rows[ll_i]])
-
- strList.AddString(tmp_serialnum)
- next
- string arg_msg
- if (strList.Count > 0) then
- parm = FxAppCom.CreatePbDictionary()
- parm.SetString('token', app_token_fx)
- parm.SetObject('list', strList)
- FxAppCom.ReadRpMstpay(parm, ref arg_msg)
- if (arg_msg <> '') then
- MessageBox('提示', arg_msg)
- end if
- end if
- cb_retrieve.post event clicked()
- end event
|