| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellClicked(TEvent*, LPARAM p) |
| | | int OnCellClicked(TEvent* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR& dwhdr=*(DWNMHDR*)evt->notify.pnmh; |
| | | int row = dwhdr.row; |
| | | int col = dwhdr.col; |
| | | //xstring col = dwhdr.colname; |
| | |
| | | if (row < startRow + 1) return 1; |
| | | startRow++; |
| | | |
| | | trace(xstring(row) + L"---" + (startRow - 1).toString()); |
| | | trace(xstring(row) + L"---" + xstring(startRow - 1)); |
| | | |
| | | int colItemNo = getItemCol(dw_cell, startRow - 1, L"我司型号,ItemNo"); |
| | | int colCustomerItemNo = getItemCol(dw_cell, startRow - 1, L"客户型号,Customer ItemNo,Customer Item No"); |
| | |
| | | xstring pitems = L""; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | pitems += L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text + L"</数据列></row>"; |
| | | pitems += (xstring)L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text() + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text() + L"</数据列></row>"; |
| | | |
| | | } |
| | | xstring prop = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | xstring prop = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (dw_cell.GetItemString(row, col) == L"") |
| | | dw_cell.SetItemString(row, col, L" "); |
| | | xstring prop2 = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='query' dddwxpageurl='' dddwdataurl='xquery:[Convert.quickcode.xq]?id=Supplier' dddwtemplateurl='dev:sheet[Supplier.v3.tpl/List]' dddwdatacolumn='Name' dddwdisplaycolumn='Name' dddwwidth='' dddwheight='' dddwautoselect='N' dddwshowbutton='否' dddwcanedit='是'/>" + |
| | | "</cellprop>"; |
| | | xstring prop2 = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='query' dddwxpageurl='' dddwdataurl='xquery:[Convert.quickcode.xq]?id=Supplier' dddwtemplateurl='dev:sheet[Supplier.v3.tpl/List]' dddwdatacolumn='Name' dddwdisplaycolumn='Name' dddwwidth='' dddwheight='' dddwautoselect='N' dddwshowbutton='否' dddwcanedit='是'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop2); |
| | | dw_cell.Redraw(); |
| | | } |
| | | else if (col == colTyp1 || col == colTyp || col == colTyp2 || col == colTyp3) |
| | | { |
| | | xstring pitems1 = L""; |
| | | pitems1 += L"<row><显示列>成品</显示列><数据列>" |
| | | pitems1 += (xstring)L"<row><显示列>成品</显示列><数据列>" |
| | | + L"成品</数据列></row>"; |
| | | pitems1 += L"<row><显示列>散货</显示列><数据列>" |
| | | pitems1 += (xstring)L"<row><显示列>散货</显示列><数据列>" |
| | | + L"散货</数据列></row>"; |
| | | pitems1 += L"<row><显示列>包装</显示列><数据列>" |
| | | pitems1 += (xstring)L"<row><显示列>包装</显示列><数据列>" |
| | | + L"包装</数据列></row>"; |
| | | xstring prop1 = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | xstring prop1 = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop1); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | int OnCellClicked1(TEvent*, LPARAM p) |
| | | int OnCellClicked1(TEvent* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR dwhdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = dwhdr.row; |
| | | int col = dwhdr.col; |
| | | //xstring col = dwhdr.colname; |
| | |
| | | if (row < startRow + 1) return 1; |
| | | startRow++; |
| | | |
| | | trace(xstring(row) + L"---" + (startRow - 1).toString()); |
| | | trace(xstring(row) + L"---" + xstring(startRow - 1)); |
| | | |
| | | int colItemNo = getItemCol(dw_cell, startRow - 1, L"我司型号,ItemNo"); |
| | | int colCustomerItemNo = getItemCol(dw_cell, startRow - 1, L"客户型号,Customer ItemNo,Customer Item No"); |
| | |
| | | xstring pitems = L""; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | pitems += L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text + L"</数据列></row>"; |
| | | pitems += (xstring)L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text() + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text() + L"</数据列></row>"; |
| | | |
| | | } |
| | | xstring prop = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | xstring prop = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop); |
| | | } |
| | | if (col == colPackage) |
| | |
| | | xaserverarg argx ; |
| | | argx.setNativePointer(argx.CreateInstance()); |
| | | argx.AddArg(L"GoodsNo", dw_cell.GetItemString(ARow, colItemNo)); |
| | | OpenWindow(L"dev:xpage[CustomerItemNoList.vx]", cast(argx as int)); |
| | | OpenWindow(L"dev:xpage[CustomerItemNoList.vx]", argx); |
| | | if (argx.GetArgString(L"action") != L"ok") |
| | | { |
| | | ARow = row; |
| | |
| | | { |
| | | /*计算体积*/ |
| | | xstring desc = dw_cell.GetItemString(ARow, colVolDesc); |
| | | double v = 0.0; |
| | | if (desc == L"") |
| | | dw_cell.SetItemString(ARow, colVol, L""); |
| | | else |
| | | { |
| | | double v = calcVol(desc) / 1000000.00; |
| | | v = calcVol(desc) / 1000000.00; |
| | | xstring str = xstring(v); |
| | | if (str.find(L".") >= 0) str = str.left(str.find(L".") + 5); |
| | | dw_cell.SetItemString(ARow, colVol, str); |
| | |
| | | if (qty1 != L"") qty = qty1.toDouble(); |
| | | if (qty2 != L"") qty = qty * qty2.toDouble(); |
| | | double ttl = 65.0 * qty / v; |
| | | dw_cell.SetItemString(ARow, col40HQ, ttl.toInt().toString()); |
| | | dw_cell.SetItemString(ARow, col40HQ, xstring((int)ttl)); |
| | | } |
| | | } |
| | | |
| | |
| | | pitems1 += (xstring)L"<row><显示列>包装</显示列><数据列>" |
| | | + L"包装</数据列></row>"; |
| | | xstring prop1 = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop1); |
| | | } |
| | | |
| | |
| | | int OnAttachListon() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent(L"WM_XCOMMAND", OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&QuoteFileView::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent(L"WM_SETFOCUS", OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&QuoteFileView::OnSetFocus); |
| | | |
| | | AttachEvent(L"frame:im1", L"IMG_LDBCLICK", OnImgDBClicked); |
| | | AttachEvent(L"frame:im1", L"IMG_LDBCLICK", (FEvent)&QuoteFileView::OnImgDBClicked); |
| | | |
| | | AttachEvent(L"dw_base", L"DWV_ITEMCHANGED", OnItemChanged); |
| | | AttachEvent(L"dw_goods", L"DWV_ROWFOCUSCHANGED", OnRowChanged); |
| | | AttachEvent(L"dw_base", L"DWV_ITEMCHANGED", (FEvent)&QuoteFileView::OnItemChanged); |
| | | AttachEvent(L"dw_goods", L"DWV_ROWFOCUSCHANGED", (FEvent)&QuoteFileView::OnRowChanged); |
| | | |
| | | AttachEvent(L"dw_cell", L"DWV_CLICKED", OnCellClicked); |
| | | AttachEvent(L"dw_cell", L"CELL_ITEMCHANGED", OnCellItemChanged); |
| | | AttachEvent(L"dw_cell", L"CELL_SELECTCHANGED", OnCellSelectChanged); |
| | | AttachEvent(L"dw_cell", L"DWV_CLICKED", (FEvent)&QuoteFileView::OnCellClicked); |
| | | AttachEvent(L"dw_cell", L"CELL_ITEMCHANGED", (FEvent)&QuoteFileView::OnCellItemChanged); |
| | | AttachEvent(L"dw_cell", L"CELL_SELECTCHANGED", (FEvent)&QuoteFileView::OnCellSelectChanged); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | xstring templ = L""; |
| | | taskid = L""; |
| | | xaserverarg arg; |
| | | if (GetParam()) { |
| | | arg ; |
| | | arg.setNativePointer(GetParam()); |
| | | if (GetWinParam()) { |
| | | arg = GetArg(); |
| | | templ = arg.GetArgString(L"template"); |
| | | entityID = arg.GetArgString(L"EntityID"); |
| | | taskid = arg.GetArgString(L"TaskID"); |
| | |
| | | } |
| | | } |
| | | |
| | | OnAttachEvent(); |
| | | OnAttachListon(); |
| | | filename = L""; |
| | | |
| | | /* #define LayerFlow_None 0x00000001 //not layer space |
| | |
| | | xaserverarg arg ; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg(L"value", content); |
| | | OpenWindow(L"dev:xpage[QuoteSupplierItem.vx]", cast(arg as int)); |
| | | OpenWindow(L"dev:xpage[QuoteSupplierItem.vx]", arg); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | bool hasParty(xstring name) |
| | | { |
| | | xml x ; |
| | | |
| | | xaserverarg arg ; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg(L"Name", name); |
| | | if (getUrl(L"/sale/data/SupplierV3/HasParty", arg.GetString(), x) != 1) |
| | | { |
| | | alert(L"error:" + x.xml()); |
| | | alert((xstring)L"error:" + x.xml()); |
| | | } |
| | | xstring count = x.documentElement.getAttribute(L"count"); |
| | | xstring count = x.documentElement().getAttribute(L"count"); |
| | | if (count != L"0") return true; |
| | | |
| | | return false; |
| | |
| | | |
| | | int LoadPurcher() |
| | | { |
| | | purcher ; |
| | | purcher.setNativePointer(xml::CreateInstance()); |
| | | xml purcher ; |
| | | xaserverarg arg ; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg(L"id", L"采购员"); |
| | | if (getUrl(L"/sale/data/Quote/Purcher", arg.GetString(), purcher) != 1) |
| | | { |
| | | alert(L"error:" + purcher.GetXml()); |
| | | alert((xstring)L"error:" + purcher.xml()); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | LoadPurcher(); |
| | | |
| | | xaserverarg arg; |
| | | if (GetParam()) { |
| | | arg ; |
| | | arg.setNativePointer(GetParam()); |
| | | if (GetWinParam()) { |
| | | arg = GetArg(); |
| | | if (arg.GetArgString(L"bill.purchor") == L"1") OnNextPurch(); |
| | | } |
| | | return 1; |