lifan
3 天以前 7d373af1a34ede50b72367be462a0ce1ed6b5baf
jrj/project/business/SO/Apply.SOItem.cpp
@@ -182,46 +182,62 @@
      //命令发布函数
      int OnCmdDispatch(xstring comdid)
      {
         xstring positionname = publiccode::GetUser().positionname;
         if (comdid == L"xmCancel")
         {
            CloseWindow();
            return 1;
         }
         else if (comdid == L"xmAskGoodsNo")
         if (comdid == L"xmCancel")
         {
            OnAskGoodsNo();
            CloseWindow();
            return 1;
         }
         //else if(comdid==L"xmApply") return OnApply();
         else if (comdid.find(L"action:", 0) >= 0)
         if (comdid.find(L"action:bill.workflow.lognew", 0) >= 0)
         {
            xstring GoodsNo = dw_list.GetItemString(dw_list.GetRow(), L"GoodsNo");
            xstring GoodsNo2 = GoodsNo.mid(0, 2);
            xstring GoodsNo4 = GoodsNo.mid(2, 1);
            if (GoodsNo == L"")
            {
               alert(L"公司货号未指定");
               return 0;
            }
            if (GoodsNo.find(L"N") >= 0 || GoodsNo.find(L"n") >= 0) {
               alert(L"公司货号带有N");
               return 0;
            }
            if (GoodsNo4 >= L"A" && GoodsNo4 <= L"z" && GoodsNo2 >= L"22" && GoodsNo2 <= L"99")
            {
               alert(L"公司货号为新品货号");
               return 0;
            }
            xstring CType = dw_list.GetItemString(dw_list.GetRow(), L"CType");
            if (CType == L"")
            {
               alert(L"客户合同附件未上传!");
               return 0;
            }
            int ret = ProcessFlowAction(comdid, 1);
            return ret;
            int ret1 = ProcessFlowAction(comdid, 1);
            return ret1;
         }
         if (positionname.find(L"跟单") < 0)
         {
            if (comdid == L"xmAskGoodsNo")
            {
               OnAskGoodsNo();
            }
            //else if(comdid==L"xmApply") return OnApply();
            else if (comdid.find(L"action:", 0) >= 0)
            {
               xstring GoodsNo = dw_list.GetItemString(dw_list.GetRow(), L"GoodsNo");
               xstring GoodsNo2 = GoodsNo.mid(0, 2);
               xstring GoodsNo4 = GoodsNo.mid(2, 1);
               if (GoodsNo == L"")
               {
                  alert(L"公司货号未指定");
                  return 0;
               }
               if (GoodsNo.find(L"N") >= 0 || GoodsNo.find(L"n") >= 0) {
                  alert(L"公司货号带有N");
                  return 0;
               }
               if (GoodsNo4 >= L"A" && GoodsNo4 <= L"z" && GoodsNo2 >= L"22" && GoodsNo2 <= L"99")
               {
                  alert(L"公司货号为新品货号");
                  return 0;
               }
               xstring CType = dw_list.GetItemString(dw_list.GetRow(), L"CType");
               if (CType == L"")
               {
                  alert(L"客户合同附件未上传!");
                  return 0;
               }
               int ret = ProcessFlowAction(comdid, 1);
               return ret;
            }
         }
         return 0;
      }