lifan
3 小时以前 ffec581757c0ebe703caaaa91370989ba4d2ffaf
update
已修改2个文件
61 ■■■■■ 文件已修改
jrj/project/business/Product.list.cpp 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/ProductSample/ProductLibrary4.cpp 补丁 | 查看 | 原始文档 | blame | 历史
jrj/project/business/Product.list.cpp
@@ -3,7 +3,7 @@
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xdwgrid.hpp>
#include <xcontrol/ximageview.hpp>
#include <win32/xfolder.hpp>
#include "vbusiness/vframe/maint.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
#include "viewobject/saleorder.view.hpp"
@@ -1092,9 +1092,68 @@
                alert(L"添加成功");
            return 1;
        }
        else if (comdid == L"xmExportImage")
        {
            return OnExportImages(dw_list);
            }
        return 0;
    }
    int OnExportImages(xdwgrid dw_obj)
    {
        xstring folder = xfolder::GetFolderForSave();
        if (folder == L"") return 1;
        xstring skunos = L"";
        for (int i = 0; i <= dw_obj.GetRowCount(); i++)
        {
            if (i == 1)skunos = dw_obj.GetItemString(i, L"SKUNo");
            else skunos += L"," + dw_obj.GetItemString(i, L"SKUNo");
        }
        xml x;
        xaserverarg arg;
        arg.AddArg(L"SKUNoList", skunos);
        xstring src = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNoList";
        //trace("SKUNo="+SKUNo);//要有展示图片查询条件内必定要skuno
        if (xurl::get(src, arg.GetString(), x) != 1)
        {
            trace(L"error for download skuno pic!");
            return 1;
        }
        xstring spath = L"";
        xstring path = folder;// GetModuleTmpPath();
        xstring ext = L"jpg";
        trace(x.xml());
        const wchar_t* str = x.xml();
        KXMLDOMNodeList items = x.selectNodes(L"*/*");
        long len = items.length();
        for (int i = 0; i <= len; i++)
        {
            KXMLDOMElement ele = items.item(i);
            if (ele.selectSingleNode(L"FileExt[1]"))
            {
                ext = ele.selectSingleNode(L"FileExt[1]").text();
            }
            xstring SKUNo = L"";
            if (ele.selectSingleNode(L"FullName[1]"))
            {
                SKUNo = ele.selectSingleNode(L"FullName[1]").text();
                xstring filename = SKUNo + L"." + ext;
                if (ele.selectSingleNode(L"PicPath[1]"))
                    spath = ele.selectSingleNode(L"PicPath[1]").text();
                if (spath != L"")
                {
                    xaserver::DownLoadFile(this->GetServerUrl(), spath, L"", path + L"/" + filename);
                }
            }
        }
        alert(L"样品图片生成完成");
        return 1;
    }
    //命令处理事件
    int OnXCommand(TEvent* evt, int param)
    {
jrj/project/business/ProductSample/ProductLibrary4.cpp
Binary files differ