xj qian
2024-11-18 a468bd6b4866e7d02df525e7cb077a3753438905
jrj/project/business/QuoteFile.cpp
@@ -1853,7 +1853,7 @@
                  }
                  dw_cell.SetRowColumn(lastrow, 1);
                  dw_cell.SetAnchorRowColumn(lastrow, 1);
                  SendCtrlCmd(dw_cell, L"xmFormatCellDeleteRow");
                  //SendCtrlCmd(dw_cell, L"xmFormatCellDeleteRow");
                  drow++;
               }
            }
@@ -2145,16 +2145,16 @@
            SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            //SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            //SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            //SendCtrlCmd(cell1, L"xmFormatCellInsertCol");
            cell1.SetItemString(headrow, purchremarkcol + 1, L"供应商");
            cell1.SetItemString(headrow, purchremarkcol + 2, L"类型");
            cell1.SetItemString(headrow, purchremarkcol + 3, L"价格");
            cell1.SetItemString(headrow, purchremarkcol + 4, L"供应商1");
            cell1.SetItemString(headrow, purchremarkcol + 5, L"类型1");
            cell1.SetItemString(headrow, purchremarkcol + 6, L"价格1");
            //cell1.SetItemString(headrow, purchremarkcol + 4, L"供应商1");
            //cell1.SetItemString(headrow, purchremarkcol + 5, L"类型1");
            //cell1.SetItemString(headrow, purchremarkcol + 6, L"价格1");
            int colRemark = getItemCol(cell1, headrow, L"Remarks");
            cell1.SetRowColumn(1, colRemark);
@@ -2220,11 +2220,15 @@
   {
      trace(L"BusinessItemID:" + id);
      xml x = ViewObject::RetrieveData(L"/sale/data/TO/business/document", L"BusinessItemID", id);
      BSTR str;
      x.get_xml(str);
      ::SysFreeString(str);
      /*
      xml sheet ;
      sheet.setNativePointer(x.CreateInstance());
      sheet.loadXML(x.selectSingleNode(L"data/*").xml);
      wangushendi xiuluowushen taigukuangmo
      */
      //trace(x.xml());
@@ -2802,17 +2806,157 @@
      return 1;
   }
   int OnCellItemChanged(TEvent* evt, int p)
   int ReCalcPOPrice()
   {
      int startRow = getItemHeadRow(dw_cell);
      if (startRow < 1) return 1;
      startRow++;
      int sRow = dw_cell.GetRow();
      int eRow = dw_cell.GetAnchorRow();
      int sCol = dw_cell.GetColumn();
      int eCol = dw_cell.GetAnchorCol();
      auto Exchange = [](int& first, int& second)
         {
            int tmp = first;first = second;second = tmp;
         };
      if (sRow > eRow)Exchange(sRow, eRow);
      if (sCol > eCol)Exchange(sCol, eCol);
      if (action != L"purch") return 1;
      if (sRow < startRow  && eRow < startRow) return 1;
      if (sRow < startRow) sRow = startRow;
      int colPrice0 = getItemCol(dw_cell, startRow - 1, L"价格");
      int colPrice1 = getItemCol(dw_cell, startRow - 1, L"价格1");
      int colPrice2 = getItemCol(dw_cell, startRow - 1, L"价格2");
      int colPrice3 = getItemCol(dw_cell, startRow - 1, L"价格3");
      int colPrice = getItemCol(dw_cell, startRow - 1, L"采购价");
      int colSKUID = getItemCol(dw_cell, startRow - 1, L"SKUID");
      bool shouldRedraw = false;
      if ((colPrice0 >= sCol && colPrice0 <= eCol) || (colPrice1 >= sCol && colPrice1 <= eCol)
         || (colPrice2 >= sCol && colPrice2 <= eCol) || (colPrice3 >= sCol && colPrice3 <= eCol))
      {
         for (int row = sRow; row <= eRow; row++)
         {
            if (dw_cell.GetItemString(row, colSKUID) == L"")continue;
            for (int col = sCol; col <= eCol; col++)
            {
               if (colPrice0 == col || colPrice1 == col || colPrice2 == col || colPrice3 == col)
               {
                  xstring pricea = L"";
                  xstring priceb = L"";
                  xstring pricec = L"";
                  xstring price0 = dw_cell.GetItemString(row, colPrice0);
                  xstring price1 = dw_cell.GetItemString(row, colPrice1);
                  xstring price2 = L"";
                  if (colPrice2 > 0) price2 = dw_cell.GetItemString(row, colPrice2);
                  xstring price3 = L"";
                  if (colPrice3 > 0) price3 = dw_cell.GetItemString(row, colPrice3);
                  xstring price = L"";
                  if (price0 != L"")
                  {
                     price = price0;
                     if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1)
                     {
                        alert(L"价格中没指定ABC");
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     }
                     else if (price.find(L"A") > 0 || price.find(L"a") > 0)
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     else if (price.find(L"B") > 0 || price.find(L"b") > 0)
                        if (priceb == L"") priceb = price; else priceb += L"+" + price;
                     else if (price.find(L"C") > 0 || price.find(L"c") > 0)
                        if (pricec == L"") pricec = price; else pricec += L"+" + price;
                  }
                  if (price1 != L"")
                  {
                     price = price1;
                     if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1)
                     {
                        alert(L"价格中没指定ABC");
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     }
                     else if (price.find(L"A") > 0 || price.find(L"a") > 0)
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     else if (price.find(L"B") > 0 || price.find(L"b") > 0)
                        if (priceb == L"") priceb = price; else priceb += L"+" + price;
                     else if (price.find(L"C") > 0 || price.find(L"c") > 0)
                        if (pricec == L"") pricec = price; else pricec += L"+" + price;
                  }
                  if (price2 != L"")
                  {
                     price = price2;
                     if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1)
                     {
                        alert(L"价格中没指定ABC");
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     }
                     else if (price.find(L"A") > 0 || price.find(L"a") > 0)
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     else if (price.find(L"B") > 0 || price.find(L"b") > 0)
                        if (priceb == L"") priceb = price; else priceb += L"+" + price;
                     else if (price.find(L"C") > 0 || price.find(L"c") > 0)
                        if (pricec == L"") pricec = price; else pricec += L"+" + price;
                  }
                  if (price3 != L"")
                  {
                     price = price3;
                     if (price.find(L"A") < 1 && price.find(L"B") < 1 && price.find(L"C") < 1 && price.find(L"a") < 1 && price.find(L"b") < 1 && price.find(L"b") < 1)
                     {
                        alert(L"价格中没指定ABC");
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     }
                     else if (price.find(L"A") > 0 || price.find(L"a") > 0)
                        if (pricea == L"") pricea = price; else pricea += L"+" + price;
                     else if (price.find(L"B") > 0 || price.find(L"b") > 0)
                        if (priceb == L"") priceb = price; else priceb += L"+" + price;
                     else if (price.find(L"C") > 0 || price.find(L"c") > 0)
                        if (pricec == L"") pricec = price; else pricec += L"+" + price;
                  }
                  price = pricec;
                  if (priceb != L"")
                  {
                     if (price == L"")
                        price = priceb;
                     else
                        price += L"+" + priceb;
                  }
                  if (pricea != L"")
                  {
                     if (price == L"")
                        price = pricea;
                     else
                        price += L"+" + pricea;
                  }
                  dw_cell.SetItemString(row, colPrice, price);
                  shouldRedraw = true;
               }
            }
         }
      }
      if(shouldRedraw)dw_cell.Redraw();
      return 1;
   }
   int OnCellItemChanged(TEvent* evt, LPARAM p)
   {
      CELLNMHDR&  hdr = *(CELLNMHDR*)evt->notify.pnmh;
      xstring value = hdr.data;
      int row = hdr.currentrow;
      int col = hdr.currentcol;
      trace(L"\r\n----row:" + xstring(row) + L"--col:" + xstring(col));
      trace(L"\r\n----row:" + xstring(row) + L"--col:" + xstring(col));
      trace(L"\r\n--value:" + dw_cell.GetItemString(row, col) + L"--orig:" + orivalue);
      if (row == ARow && col == ACol && dw_cell.GetItemString(row, col) == orivalue) return 1;
      //if (row == ARow && col == ACol && dw_cell.GetItemString(row, col) == orivalue) return 1;
      trace(L"\r\n--enter:");
      ARow = row;
@@ -3382,14 +3526,31 @@
      startRow++;
      int row = dw_cell.GetRow();
      int colPurchPrice = getItemCol(dw_cell, headrow, L"价格");
      int colPurchPrice1 = getItemCol(dw_cell, headrow, L"价格1");
      int colPurchPrice2 = getItemCol(dw_cell, headrow, L"价格2");
      int colPurchPrice3 = getItemCol(dw_cell, headrow, L"价格3");
      if (colPurchPrice3 > 0) return  1;
      if (colPurchPrice2 < 1)
      if (colPurchPrice1 < 1)
      {
         //dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         //dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);
         dw_cell.SetRowColumn(row, colPurchPrice + 1);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice + 1);
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         dw_cell.SetItemString(headrow, colPurchPrice + 1, L"供应商1");
         dw_cell.SetItemString(headrow, colPurchPrice + 2, L"类型1");
         dw_cell.SetItemString(headrow, colPurchPrice + 3, L"价格1");
         dw_cell.SetColumnWidth(colPurchPrice + 2, 0);
      }
      else if (colPurchPrice2 < 1)
      {
         dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         //dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);
         dw_cell.SetRowColumn(row, colPurchPrice1 + 1);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice1 + 1);
@@ -3401,10 +3562,11 @@
         dw_cell.SetItemString(headrow, colPurchPrice1 + 1, L"供应商2");
         dw_cell.SetItemString(headrow, colPurchPrice1 + 2, L"类型2");
         dw_cell.SetItemString(headrow, colPurchPrice1 + 3, L"价格2");
         dw_cell.SetColumnWidth(colPurchPrice1 + 2, 0);
      }
      else
      else if(colPurchPrice3 < 1)
      {
         //dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         dw_cell.SetColumnCount(dw_cell.GetColumnCount()+3);
         //dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);
         dw_cell.SetRowColumn(row, colPurchPrice2 + 1);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice2 + 1);
@@ -3416,6 +3578,61 @@
         dw_cell.SetItemString(headrow, colPurchPrice2 + 1, L"供应商3");
         dw_cell.SetItemString(headrow, colPurchPrice2 + 2, L"类型3");
         dw_cell.SetItemString(headrow, colPurchPrice2 + 3, L"价格3");
         dw_cell.SetColumnWidth(colPurchPrice2 + 2, 0);
      }
      return 1;
   }
   int OnDelBOMItem()
   {
      int startRow = getItemHeadRow(dw_cell);
      int headrow = startRow;
      if (startRow < 1) return 1;
      startRow++;
      int row = dw_cell.GetRow();
      int colPurchPrice1 = getItemCol(dw_cell, headrow, L"价格1");
      int colPurchPrice2 = getItemCol(dw_cell, headrow, L"价格2");
      int colPurchPrice3 = getItemCol(dw_cell, headrow, L"价格3");
      if (colPurchPrice3 > 0)
      {
         dw_cell.SetRowColumn(row, colPurchPrice3 - 2);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice3 - 2);
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         dw_cell.SetColumnCount(dw_cell.GetColumnCount() - 3);
         return 1;
      }
      if (colPurchPrice2 > 0)
      {
         dw_cell.SetRowColumn(row, colPurchPrice2 -2);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice2 -2);
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         dw_cell.SetColumnCount(dw_cell.GetColumnCount() - 3);
         return 1;
      }
      if (colPurchPrice1 > 0)
      {
         dw_cell.SetRowColumn(row, colPurchPrice1 - 2);
         dw_cell.SetAnchorRowColumn(row, colPurchPrice1 - 2);
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         dw_cell.SetColumnCount(dw_cell.GetColumnCount() - 3);
         return 1;
      }
      return 1;
   }
@@ -3424,6 +3641,7 @@
   int OnCmdDispatch(xstring comdid)
   {
      if (comdid == L"xmAddBOMItem") return OnAddBOMItem();
      if (comdid == L"xmDelBOMItem") return OnDelBOMItem();
      if (comdid == L"xmQuoteBill")
      {
         if (dw_base.GetItemString(1, L"CustomerID") == L"")
@@ -3458,6 +3676,7 @@
      else if (comdid == L"xmPurched")
      {
         //if(makeMessage(L"/task/quote/purchar/backtosaler")==-1) return 1;
         //dw_cell.SetRowColumn(dw_cell.GetRow(), dw_cell.GetColumn());
         return OnSaleBack();
      }
      else if (comdid == L"xmPurch2")
@@ -3566,6 +3785,7 @@
            }
         }
         SendCtrlCmd(dw_cell, cmd);
         if (comdid == L"IK_xmEditCut"|| comdid == L"IK_xmEditCut")ReCalcPOPrice();
         return 1;
      }
      else if (comdid == L"xmFormatCellDeleteRow")
@@ -3617,9 +3837,10 @@
      arg.AddArg(L"EntityID", entityID);
      OpenWindow(L"dev:xpage[QuoteFilePurch2Select.vx]", arg);
      xstring taskID = arg.GetArgString(L"TaskID");
      xstring reason = arg.GetArgString(L"Reason");
      if (taskID != L"")
      {
         ProcessSendMessage(L"/task/quote/repurch", taskID, L"", L"", true);
         ProcessSendMessage(L"/task/quote/repurch", taskID, reason, L"", true);
      }
      return 1;
   }
@@ -3930,6 +4151,7 @@
      ensureRowID();
      xstring content = dw_cell.GetData();
      string val = content.c_str();
      content = content.mid(content.find(L"<xsheet"), 9999999);
      while (true)
      {
@@ -4235,6 +4457,8 @@
         else if (col == colTyp1 || col == colTyp || col == colTyp2 || col == colTyp3)
         {
            xstring pitems1 = L"";
            pitems1 += (xstring)L"&lt;row&gt;&lt;显示列&gt;&lt;/显示列&gt;&lt;数据列&gt;"
               + L"&lt;/数据列&gt;&lt;/row&gt;";
            pitems1 += (xstring)L"&lt;row&gt;&lt;显示列&gt;成品&lt;/显示列&gt;&lt;数据列&gt;"
               + L"成品&lt;/数据列&gt;&lt;/row&gt;";
            pitems1 += (xstring)L"&lt;row&gt;&lt;显示列&gt;散货&lt;/显示列&gt;&lt;数据列&gt;"
@@ -4489,6 +4713,8 @@
         else if (col == colTyp1 || col == colTyp)
         {
            xstring pitems1 = L"";
            pitems1 += (xstring)L"&lt;row&gt;&lt;显示列&gt;&lt;/显示列&gt;&lt;数据列&gt;"
               + L"&lt;/数据列&gt;&lt;/row&gt;";
            pitems1 += (xstring)L"&lt;row&gt;&lt;显示列&gt;成品&lt;/显示列&gt;&lt;数据列&gt;"
               + L"成品&lt;/数据列&gt;&lt;/row&gt;";
            pitems1 += (xstring)L"&lt;row&gt;&lt;显示列&gt;散货&lt;/显示列&gt;&lt;数据列&gt;"
@@ -4774,6 +5000,167 @@
      return str.mid(pos, epos - pos);
   }
   int AdjustView(xcell& dw_cell)
   {
      int startRow = getItemHeadRow(dw_cell);
      //没有找到商品行的标题
      if (startRow < 1) return 0;
      startRow++;
      int colItemDesc = getItemCol(dw_cell, startRow - 1, L"产品信息");
      int colPhoto = getItemCol(dw_cell, startRow - 1, L"Photo");
      bool newItemDesc = false;
      if (colItemDesc < 0)
      {
         dw_cell.SetRowColumn(1, colPhoto+1);
         dw_cell.SetAnchorRowColumn(1, colPhoto+1);
         SendCtrlCmd(dw_cell, L"xmFormatCellInsertCol");
         colItemDesc = colPhoto + 1;
         dw_cell.SetItemString(startRow - 1, colItemDesc, L"产品信息");
         newItemDesc = true;
      }
      if (newItemDesc)
      {
         int colSKUID = getItemCol(dw_cell, startRow - 1, L"SKUID");
         int colItemNo = getItemCol(dw_cell, startRow - 1, L"我司型号,ItemNo");
         int colCustomerItemNo = getItemCol(dw_cell, startRow - 1, L"客户型号,Customer ItemNo,Customer Item No");
         int colItemName = getItemCol(dw_cell, startRow - 1, L"Product Description,Product Name,Item Name");
         int colItemCName = getItemCol(dw_cell, startRow - 1, L"中文品名");
         int colItemSpec = getItemCol(dw_cell, startRow - 1, L"Specifications,规格,产品规格");
         int colBuyerPrice = getItemCol(dw_cell, startRow - 1, L"采购价,采购价格");
         int colBuyer = getItemCol(dw_cell, startRow - 1, L"采购人员");
         int colQty = getItemCol(dw_cell, startRow - 1, L"Qty");
         int colPackage = getItemCol(dw_cell, startRow - 1, L"Package");
         int colInnerOuter = getItemCol(dw_cell, startRow - 1, L"装箱数(内/外)");
         int colBuyerMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ");
         int colBuyerRemark = getItemCol(dw_cell, startRow - 1, L"采购To业务备注");
         int colFactoryImage = getItemCol(dw_cell, startRow - 1, L"工厂图片");
         int colGWT = getItemCol(dw_cell, startRow - 1, L"毛重,毛重(KG)");
         int colNWT = getItemCol(dw_cell, startRow - 1, L"净重,净重(KG)");
         int colVolDesc = getItemCol(dw_cell, startRow - 1, L"体积描述,长X宽X高,长X宽X高(CM)");
         int colVol = getItemCol(dw_cell, startRow - 1, L"体积,体积(M3)");
         int col40HQ = getItemCol(dw_cell, startRow - 1, L"40HQ,QTY(40HQ)");
         int colPurchedDate = getItemCol(dw_cell, startRow - 1, L"采购提交业务时间");
         int colPhoto1 = getItemCol(dw_cell, startRow - 1, L"工厂图片");
         int colProductInfo = getItemCol(dw_cell, startRow - 1, L"业务部产品信息");
         int colProductInfo1 = getItemCol(dw_cell, startRow - 1, L"采购部产品信息");
         int colBOMType = getItemCol(dw_cell, startRow - 1, L"类型");
         int colBOMType1 = getItemCol(dw_cell, startRow - 1, L"类型1");
         int colSaler = getItemCol(dw_cell, startRow - 1, L"业务员");
         int colSaletoBuyerRemark = getItemCol(dw_cell, startRow - 1, L"业务To采购备注");
         int colSupplier1 = getItemCol(dw_cell, startRow - 1, L"供应商1");
         int colBuyPrice1 = getItemCol(dw_cell, startRow - 1, L"价格1");
         dw_cell.SetColumnWidth(colSKUID, 0);
         dw_cell.SetColumnWidth(colItemNo, 0);
         dw_cell.SetColumnWidth(colCustomerItemNo, 0);
         dw_cell.SetColumnWidth(colItemName, 0);
         dw_cell.SetColumnWidth(colItemCName, 0);
         //dw_cell.SetColumnWidth(colBuyerRemark, 0);
         dw_cell.SetColumnWidth(colPackage, 0);
         dw_cell.SetColumnWidth(colQty, 0);
         dw_cell.SetColumnWidth(col40HQ, 0);
         dw_cell.SetColumnWidth(colInnerOuter, 0);
         dw_cell.SetColumnWidth(colSaler, 0);
         dw_cell.SetColumnWidth(colSaletoBuyerRemark, 0);
         dw_cell.SetColumnWidth(colProductInfo, 0);
         dw_cell.SetColumnWidth(colSaler, 0);
         dw_cell.SetColumnWidth(colBOMType, 0);
         dw_cell.SetColumnWidth(colBOMType1, 0);
         dw_cell.SetColumnWidth(colItemDesc, 160);
         bool bPrice1 = false;
         for (int row = startRow; row <= dw_cell.GetValidRow(); row++)
         {
            if (dw_cell.GetItemString(row, colSKUID) != L"")
            {
               xstring itemDesc = L"SKUID:" + dw_cell.GetItemString(row, colSKUID);
               if (dw_cell.GetItemString(row, colItemNo) != L"")
                  itemDesc += L"\r\nItem No: " + dw_cell.GetItemString(row, colItemNo);
               if (dw_cell.GetItemString(row, colItemNo) != L"")
                  itemDesc += L"\r\nCustomer Item No: " + dw_cell.GetItemString(row, colCustomerItemNo);
               if (dw_cell.GetItemString(row, colItemName) != L"")
                  itemDesc +=  L"\r\nItem Name:" + dw_cell.GetItemString(row, colItemName);
               if (dw_cell.GetItemString(row, colItemCName) != L"")
                  itemDesc += L"\r\n产品名称:" + dw_cell.GetItemString(row, colItemCName);
               if (dw_cell.GetItemString(row, colQty) != L"")
                  itemDesc += L"\r\n数量:" + dw_cell.GetItemString(row, colQty);
               if (dw_cell.GetItemString(row, colPackage) != L"")
                  itemDesc += L"\r\n包装:" + dw_cell.GetItemString(row, colPackage);
               if (dw_cell.GetItemString(row, colInnerOuter) != L"")
                  itemDesc += L"\r\n装箱数(内/外):" + dw_cell.GetItemString(row, colInnerOuter);
               if (dw_cell.GetItemString(row, colProductInfo) != L"")
                  itemDesc += L"\r\n\r\n规格:\r\n" + dw_cell.GetItemString(row, colProductInfo);
               if (dw_cell.GetItemString(row, colSaletoBuyerRemark) != L"")
                  itemDesc += L"\r\n\r\n采购要求:\r\n" + dw_cell.GetItemString(row, colSaletoBuyerRemark);
               dw_cell.SetItemString(row, colItemDesc, itemDesc);
               if (!bPrice1)
               {
                  if (dw_cell.GetItemString(row, colSupplier1) != L"") bPrice1 = true;
                  else if (dw_cell.GetItemString(row, colBuyPrice1) != L"") bPrice1 = true;
               }
            }
         }
         if (!bPrice1 && colSupplier1 > 0)
         {
            dw_cell.SetRowColumn(1, colSupplier1);
            dw_cell.SetAnchorRowColumn(1, colSupplier1);
            SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
            SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
            SendCtrlCmd(dw_cell, L"xmFormatCellDeleteCol");
         }
         dw_cell.SetRowColumn(1, 1);
         dw_cell.SetAnchorRowColumn(startRow - 2, 1);
         SendCtrlCmd(dw_cell, L"xmEditCopy");
         dw_cell.SetRowColumn(1, colPhoto);
         dw_cell.SetAnchorRowColumn(startRow - 2, colPhoto);
         SendCtrlCmd(dw_cell, L"xmEditPaste");
         dw_cell.SetRowColumn(1, 2);
         dw_cell.SetAnchorRowColumn(startRow - 2, 2);
         SendCtrlCmd(dw_cell, L"xmEditCopy");
         dw_cell.SetRowColumn(1, colPhoto+1);
         dw_cell.SetAnchorRowColumn(startRow - 2, colPhoto+1);
         SendCtrlCmd(dw_cell, L"xmEditPaste");
         int colSaleSendDate = getItemCol(dw_cell, startRow - 1, L"业务发送采购时间");
         dw_cell.SetItemString(2, colBuyerPrice, L"业务员");
         dw_cell.SetItemString(3, colBuyerPrice, L"发送日期:");
         dw_cell.SetItemString(2, colBuyerPrice+1, dw_cell.GetItemString(startRow, colSaler));
         dw_cell.SetItemString(3, colBuyerPrice+1, dw_cell.GetItemString(startRow, colSaleSendDate));
         dw_cell.SetColumnWidth(colSaleSendDate, 0);
         int colMOQ = getItemCol(dw_cell, startRow - 1, L"MOQ");
         int colSupplier = getItemCol(dw_cell, startRow - 1, L"供应商");
         int colBuyPrice = getItemCol(dw_cell, startRow - 1, L"价格");
         dw_cell.SetRowColumn(startRow, colSupplier);
         dw_cell.SetAnchorRowColumn(startRow, colSupplier);
         dw_cell.SetColumnWidth(colBuyerPrice, 50);
         dw_cell.SetColumnWidth(colMOQ, 50);
         dw_cell.SetColumnWidth(colBuyPrice, 50);
      }
      return 1;
   }
   int onload()
   {
      SetArg();
@@ -4914,7 +5301,9 @@
      {
         xnode anode = GetAgentNode(L"tabheader");
         anode.SetLayerFlow(0x00000100);
         dw_cell.SetColumnCount(dw_cell.GetValidCol() + 6);
         dw_cell.SetColumnCount(dw_cell.GetValidCol() + 9);
         //dw_cell.SetFixedCols(7);
         AdjustView(dw_cell);
      }
      else
         dw_cell.SetColumnCount(dw_cell.GetValidCol()+3);