123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- $PBExportHeader$w_saletask_edit.srw
- forward
- global type w_saletask_edit from w_publ_base
- end type
- type dw_1 from datawindow within w_saletask_edit
- end type
- type cb_1 from uo_imflatbutton within w_saletask_edit
- end type
- type dw_2 from datawindow within w_saletask_edit
- end type
- type cb_5 from uo_imflatbutton within w_saletask_edit
- end type
- end forward
- global type w_saletask_edit from w_publ_base
- boolean visible = false
- integer width = 2793
- integer height = 1800
- boolean titlebar = false
- string title = ""
- boolean controlmenu = false
- boolean minbox = false
- windowtype windowtype = child!
- long backcolor = 16777215
- event ue_addmx ( )
- event ue_delmx ( )
- dw_1 dw_1
- cb_1 cb_1
- dw_2 dw_2
- cb_5 cb_5
- end type
- global w_saletask_edit w_saletask_edit
- type variables
- string ins_tid
- long ins_column = 9
- long ins_confirm = 0
- end variables
- forward prototypes
- public subroutine wf_face ()
- public subroutine wf_save ()
- end prototypes
- event ue_addmx();Long row
- row = dw_2.GetRow()
- IF row <= 0 THEN
- FOR row = 1 To dw_2.RowCount()
- IF dw_2.Object.path[row] = '' THEN EXIT
- NEXT
- ELSEIF dw_2.Object.path[row] <> '' THEN
- FOR row = 1 To dw_2.RowCount()
- IF dw_2.Object.path[row] = '' THEN EXIT
- NEXT
- END IF
- IF row > dw_2.RowCount() THEN
- row = dw_2.InsertRow(0)
- END IF
- String ls_max = ''
- long j, newid
- IF dw_2.Object.mxcode[row] = '' THEN
- FOR j = 1 To dw_2.RowCount()
- IF dw_2.Object.mxcode[j] > ls_max THEN
- ls_max = dw_2.Object.mxcode[j]
- END IF
- NEXT
- IF ls_max = '' THEN
- dw_2.Object.mxcode[row] = dw_1.Object.tid[dw_1.GetRow()] + '_01'
- ELSE
- newid = long(right(ls_max,2)) + 1
- if newid > 99 then
- MessageBox('ERROR', '当前明细编号过大')
- return
- end if
- dw_2.Object.mxcode[row] = dw_1.Object.tid[dw_1.GetRow()] + '_' + string(newid, '00')
- END IF
- END IF
- String Pathname,Filename,FileType
- Integer i
- FileType = '所有文件,*.*'
- i = GetFileOpenName("请选择文件", Pathname,Filename, "All", FileType)
- IF i = 1 And Trim(Pathname) <> '' And Trim(Filename) <> "" THEN
- IF Pathname = '' Or Not FileExists(Pathname) THEN
- MessageBox('系统提示','请选择文件!')
- RETURN
- END IF
- dw_2.Object.path[row] = Pathname
- dw_2.Object.fjname[row] = Filename
- END IF
- end event
- event ue_delmx();long row
- row = dw_2.GetRow()
- if row <= 0 then return
- dw_2.Deleterow(row)
- if dw_2.rowcount() = 0 then
- triggerevent('ue_addmx')
- end if
- end event
- public subroutine wf_face ();long i
- if dw_edit_mode then
- for i = 1 to ins_column
- dw_1.SetTabOrder(i, i * 10)
- next
- else
- for i = 1 to ins_column
- dw_1.SetTabOrder(i, 0)
- next
- end if
- end subroutine
- public subroutine wf_save ();Long row
- String arg_msg = ''
- dw_1.AcceptText()
- dw_2.AcceptText()
- row = dw_1.GetRow()
- IF row <= 0 THEN RETURN
- long dw2Count, i
- dw2Count = dw_2.RowCount()
- IF dw2Count <= 0 THEN
- MessageBox('提示', '请选择明细')
- RETURN
- END IF
- for i = 1 to dw2Count
- if dw_2.Object.mtrltype[ i ] = "" then
- MessageBox('提示', '请在附件明细内选择产品类型')
- RETURN
- END IF
- next
- oleobject task, fjs, fj
- task = AppCom.CreatePbDictionary()
- fjs = AppCom.CreArrOfPbDictionary()
- task.SetString("token", app_token)
- task.SetString("tid", dw_1.Object.tid[row])
- task.SetString("cus_rep", dw_1.Object.cus_rep[row])
- task.SetString("cus_tele", dw_1.Object.cus_tele[row])
- task.SetString("cus_address", dw_1.Object.cus_address[row])
- task.SetString("freight", dw_1.Object.freight[row])
- task.SetString("freight_tele", dw_1.Object.freight_tele[row])
- task.SetString("buyer_name", dw_1.Object.buyer_name[row])
- task.SetString("buyer_tele", dw_1.Object.buyer_tele[row])
- task.SetDateTime("requiredate", dw_1.Object.requiredate[row])
- task.SetString("temp1", dw_1.Object.temp1[row])
- task.SetString("temp2", dw_1.Object.temp2[row])
- task.SetString("temp3", dw_1.Object.temp3[row])
- task.SetString("temp4", dw_1.Object.temp4[row])
- task.SetString("temp5", dw_1.Object.temp5[row])
- task.SetString("temp6", dw_1.Object.temp6[row])
- task.SetInt('confirm', ins_confirm)
- FOR i = 1 To dw_2.RowCount()
- fj = AppCom.CreatePbDictionary()
- fj.SetInt("printid", i)
- fj.SetString("mxcode", dw_2.Object.mxcode[i])
- fj.SetDouble("price_ls", dw_2.Object.price_ls[i])
- fj.SetString("mtrltype", dw_2.Object.mtrltype[i])
- fj.SetString("fjdscrp", dw_2.Object.fjdscrp[i])
- fj.SetString("path", dw_2.Object.path[i])
- fjs.Add(fj)
- NEXT
- AppCom.AddTaskAsync(task, fjs, Ref arg_msg)
- IF arg_msg <> '' THEN
- MessageBox('ERROR', arg_msg)
- RETURN
- END IF
- Close(this)
- end subroutine
- on w_saletask_edit.create
- int iCurrent
- call super::create
- this.dw_1=create dw_1
- this.cb_1=create cb_1
- this.dw_2=create dw_2
- this.cb_5=create cb_5
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_1
- this.Control[iCurrent+2]=this.cb_1
- this.Control[iCurrent+3]=this.dw_2
- this.Control[iCurrent+4]=this.cb_5
- end on
- on w_saletask_edit.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.cb_1)
- destroy(this.dw_2)
- destroy(this.cb_5)
- end on
- event open;call super::open;Long row
- row = dw_1.InsertRow(0)
- dw_1.SetItem(row, 'cuscode', app_cuscode)
- dw_1.SetItem(row, 'cusname', app_cusname)
- dw_1.SetItem(row, 'cus_rep', app_custype)
- dw_1.SetItem(row, 'cus_tele', app_tele)
- dw_1.SetItem(row, 'cus_address', app_address)
- dw_1.SetItem(row, 'freight', app_freight)
- dw_1.SetItem(row, 'freight_tele', app_freight_tele)
- String arg_msg = ''
- ins_tid = AppCom.GetNewTid(app_token, Ref arg_msg)
- IF ins_tid = '' THEN
- MessageBox('ERROR', arg_msg)
- RETURN
- END IF
- dw_edit_mode = True
- wf_face()
- dw_1.SetItem(row, 'tid', ins_tid)
- dw_2.InsertRow(0)
- datawindowchild dw_child
- oleobject mtrltypes
- oleobject mtrltype
- Long cnt, i
- IF dw_2.GetChild('mtrltype', Ref dw_child) = 1 THEN
- mtrltypes = AppCom.GetMtrltypes(app_token, Ref arg_msg)
- IF arg_msg = '' THEN
- cnt = mtrltypes.Count
- FOR i = 1 To cnt
- mtrltype = mtrltypes.GetItem(i - 1)
- row = dw_child.InsertRow(0)
- dw_child.SetItem(row, 'typename', mtrltype.GetString('typename'))
- NEXT
- END IF
- END IF
- end event
- event close;call super::close;ParentWindow().TriggerEvent('ue_childclose')
- end event
- type cb_func from w_publ_base`cb_func within w_saletask_edit
- boolean visible = false
- integer x = 23
- integer y = 892
- end type
- type cb_exit from w_publ_base`cb_exit within w_saletask_edit
- integer x = 2437
- integer y = 1660
- end type
- type dw_1 from datawindow within w_saletask_edit
- integer width = 2770
- integer height = 1640
- integer taborder = 10
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_saletask_edit"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_1 from uo_imflatbutton within w_saletask_edit
- boolean visible = false
- integer x = 2048
- integer y = 1660
- integer width = 370
- integer taborder = 20
- boolean bringtotop = true
- string text = "保存询价"
- string normalpicname = "save.bmp"
- end type
- event clicked;call super::clicked;ins_confirm = 0
- wf_save()
- end event
- type dw_2 from datawindow within w_saletask_edit
- integer x = 23
- integer y = 672
- integer width = 2670
- integer height = 308
- integer taborder = 20
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_saletask_edit_fj"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event clicked;string ls_name
- ls_name = dwo.name
- if row > 0 then dw_2.SetRow(row)
- if ls_name = 'addbtn' then
- parent.triggerevent('ue_addmx')
- elseif ls_name = 'delbtn' then
- parent.triggerevent('ue_delmx')
- end if
- end event
- type cb_5 from uo_imflatbutton within w_saletask_edit
- integer x = 151
- integer y = 1660
- integer width = 370
- integer taborder = 40
- boolean bringtotop = true
- string text = "询价确认"
- string normalpicname = "ok.bmp"
- end type
- event clicked;call super::clicked;ins_confirm = 1
- wf_save()
- end event
|