DDDW重复行的选择问题
出库datawindow明细dw_1,名称列关联子窗口dwc_xmmc,过滤后的子窗口只要有名称重复但规格、编码不同的商品列表,通过上下键或者鼠标单击选择任意一个再选择其他,DW_1数据行都不能相应改变。如何解决?谢谢!
如:输入TG,子窗口会出现
铁锅 1211 18cm TG
铁锅 1211 24cm TG
铁锅 1212 18cm TG
//w_main open事件
if dw_1.getchild('ware_name',dwc_xmmc) = 1 then
dwc_xmmc.SetTransobject(sqlca)
dwc_xmmc.Retrieve(gs_unit_id)
end if
//dw_1 的itemchanged
this.accepttext()
setnull(ls_null)
setnull(ldc_null)
if dwo.name = 'ware_name' then
li_row = dwc_xmmc.GetSelectedRow(0)
if li_row = 0 then
this.object.ware_name[row] = ls_null
this.object.ware_code[row] = ls_null //项目编码
this.object.ware_spec[row] = ls_null //规格
else
this.object.ware_name[row] = dwc_xmmc.GetItemString(li_row, "stockhouse_ware_name")
this.object.ware_code[row] = dwc_xmmc.GetItemString(li_row, "stockhouse_ware_code")
end if
end if
//dw_1的ue_enter
if this.getcolumnname() = 'ware_name' then
LONG LL_ROW
LL_ROW=dwc_xmmc.GetSelectedRow(0)
this.object.ware_name[li_row] = dwc_xmmc.GetItemString(LL_ROW, "stockhouse_ware_name") //项目编码
this.object.ware_code[li_row]= dwc_xmmc.GetItemString(LL_ROW, "stockhouse_ware_code") //规格
this.object.ware_spec[li_row]= dwc_xmmc.GetItemString(LL_ROW, "stockhouse_ware_spec") //单位
end if
if this.getcolumnname() = 'pquantity' then
if this.getrow() = this.rowcount() then
cb_1.triggerevent(clicked!)//自动增加新的明细
return
end if
end if
//enter代替tab事件
send(handle(this), 256, 9, long(0, 0))
return 1
//dw_1的editchanged
if dwo.name = 'ware_name' then
if data <> '' then
dwc_xmmc.setfilter('')
dwc_xmmc.filter()
ls_sql ="(upper(trim(input_code)) like" + "'%" + upper(data) + "%') "
dwc_xmmc.setfilter(ls_sql)
dwc_xmmc.filter()
else
ls_sql ="ware_name <> ' ' "
dwc_xmmc.setfilter(ls_sql)
dwc_xmmc.filter()
dwc_xmmc.setsort('ware_name A')
dwc_xmmc.sort()
end if
end if