Przeglądaj źródła

物流查询新增条件

zhoufan 4 lat temu
rodzic
commit
2add1660c7

+ 21 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/MaterialManageController.cs

21
         BLL.T_Sys_DictionaryValue dvBLL = new BLL.T_Sys_DictionaryValue();
21
         BLL.T_Sys_DictionaryValue dvBLL = new BLL.T_Sys_DictionaryValue();
22
         BLL.T_Sys_UserAccount userBLL = new BLL.T_Sys_UserAccount();
22
         BLL.T_Sys_UserAccount userBLL = new BLL.T_Sys_UserAccount();
23
         // 获取物料列表
23
         // 获取物料列表
24
-        public ActionResult GetList(string MaterialCode, string MaterialName,int pageindex = 1, int pagesize = 10)
24
+        public ActionResult GetList(string MaterialCode, string MaterialName, string Model, string Specs, string Brand, string Pipeline, int pageindex = 1, int pagesize = 10)
25
         {
25
         {
26
             string sql = " and F_IsDelete=0";
26
             string sql = " and F_IsDelete=0";
27
             #region 筛选
27
             #region 筛选
35
             {
35
             {
36
                 sql += " and F_MaterialName like '%" + MaterialName + "%'";
36
                 sql += " and F_MaterialName like '%" + MaterialName + "%'";
37
             }
37
             }
38
+
39
+            if (!string.IsNullOrWhiteSpace(Model))
40
+            {
41
+                sql += " and F_Model like '%" + Model + "%'";
42
+            }
43
+
44
+            if (!string.IsNullOrWhiteSpace(Specs))
45
+            {
46
+                sql += " and F_Specs like '%" + Specs + "%'";
47
+            }
48
+
49
+            if (!string.IsNullOrWhiteSpace(Brand))
50
+            {
51
+                sql += " and F_Brand like '%" + Brand + "%'";
52
+            }
53
+
54
+            if (!string.IsNullOrWhiteSpace(Pipeline))
55
+            {
56
+                sql += " and F_Pipeline like '%" + Pipeline + "%'";
57
+            }
38
             #endregion
58
             #endregion
39
             int recordCount = 0;
59
             int recordCount = 0;
40
             DataTable dt = BLL.PagerBLL.GetListPager(
60
             DataTable dt = BLL.PagerBLL.GetListPager(

+ 162 - 154
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

2452
                         dt.Columns.Add("工单来源");
2452
                         dt.Columns.Add("工单来源");
2453
                         dt.Columns.Add("工单类型");
2453
                         dt.Columns.Add("工单类型");
2454
                         dt.Columns.Add("工单状态");
2454
                         dt.Columns.Add("工单状态");
2455
-                     
2455
+                        dt.Columns.Add("生产单位");
2456
+
2456
                         if (type ==1|| type == 4)
2457
                         if (type ==1|| type == 4)
2457
                         {
2458
                         {
2458
                             dt.Columns.Add("问题类别");
2459
                             dt.Columns.Add("问题类别");
2544
                         {
2545
                         {
2545
                             DataRow drNew = dt.NewRow();
2546
                             DataRow drNew = dt.NewRow();
2546
 
2547
 
2547
-                          
2548
-
2548
+                            drNew["生产单位"] = it.F_Production;//生产单位
2549
                             drNew["工单编号"] = it.F_WorkOrderCode;//工单编号
2549
                             drNew["工单编号"] = it.F_WorkOrderCode;//工单编号
2550
                             #region
2550
                             #region
2551
                             if (it.F_Source == "1")
2551
                             if (it.F_Source == "1")
6375
         /// </summary>
6375
         /// </summary>
6376
         /// <returns></returns>
6376
         /// <returns></returns>
6377
         [Authority]
6377
         [Authority]
6378
-        public ActionResult AssignWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,string F_Files, int isvisit=1,
6379
-            int  overtime =0,int sms=0,int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
6378
+        public ActionResult AssignWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment, string F_Files, int isvisit = 1,
6379
+            int overtime = 0, int sms = 0, int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
6380
         {
6380
         {
6381
             int userId = CurrentUser.UserData.F_UserId;
6381
             int userId = CurrentUser.UserData.F_UserId;
6382
             string usercode = CurrentUser.UserData.F_UserCode;
6382
             string usercode = CurrentUser.UserData.F_UserCode;
6383
             if (userId != 0)
6383
             if (userId != 0)
6384
             {
6384
             {
6385
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
6385
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
6386
+                if (ua == null)
6387
+                {
6388
+                    return Error("无操作权限!");
6389
+                }
6386
                 Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
6390
                 Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
6387
-                if (model .F_State !=0)
6391
+                if (model == null)
6392
+                {
6393
+                    return Error("工单不存在!");
6394
+                }
6395
+                if (model.F_State == 1 && model.F_CreateBy == ua.F_UserCode)
6396
+                {
6397
+                    return Error("工单已转派请勿重复操作!");
6398
+                }
6399
+
6400
+                if (model.F_State != 0)
6388
                 {
6401
                 {
6389
                     var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + " and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6402
                     var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + " and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6390
                     if (modellist != null)
6403
                     if (modellist != null)
6393
                             return Error("非接单人不可操作工单");
6406
                             return Error("非接单人不可操作工单");
6394
                     }
6407
                     }
6395
                 }
6408
                 }
6396
-               
6409
+
6397
                 WorkOrderNewInput input = new WorkOrderNewInput();
6410
                 WorkOrderNewInput input = new WorkOrderNewInput();
6398
                 if (clid != 0)
6411
                 if (clid != 0)
6399
                 {
6412
                 {
6400
                     Model.T_Sys_UserAccount clus = sysUserAccountBll.GetModel(clid);
6413
                     Model.T_Sys_UserAccount clus = sysUserAccountBll.GetModel(clid);
6401
 
6414
 
6402
-                  
6403
                     if (clus != null)
6415
                     if (clus != null)
6404
                     {
6416
                     {
6405
-                       if (clus.F_WorkNumber =="7000")
6417
+                        if (clus.F_WorkNumber == "7000")
6406
                             return Error("不能转派到市场管理员");
6418
                             return Error("不能转派到市场管理员");
6407
                         else if (clus.F_RoleId == 1 || clus.F_RoleId == 4)
6419
                         else if (clus.F_RoleId == 1 || clus.F_RoleId == 4)
6408
                             return Error("不能转派到话务人员");
6420
                             return Error("不能转派到话务人员");
6412
                             return Error("不能转派到分公司经理");
6424
                             return Error("不能转派到分公司经理");
6413
                         else if (clus.F_RoleId == 62)
6425
                         else if (clus.F_RoleId == 62)
6414
                             return Error("不能转派到大区经理");
6426
                             return Error("不能转派到大区经理");
6415
-                      
6416
                     }
6427
                     }
6428
+                }
6417
 
6429
 
6418
-
6430
+                if (hclid == 0 && hclbm == 0 && isApprovalp != 0)
6431
+                {
6432
+                    return Error("请选择接收部门");
6419
                 }
6433
                 }
6420
-                if (ua != null)
6434
+                if (clbm == 0 && clid == 0)
6421
                 {
6435
                 {
6422
-                    if (hclid == 0 && hclbm == 0&& isApprovalp!=0)
6423
-                    {
6424
-                        return Error("请选择接收部门");
6425
-                    }
6426
-                    if (clbm == 0 && clid == 0)
6427
-                    {
6428
-                        return Error("请选择接收部门");
6429
-                    }
6430
-                    else
6436
+                    return Error("请选择接收部门");
6437
+                }
6438
+                else
6439
+                {
6440
+                    var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
6441
+                    if (deptmodel != null)
6431
                     {
6442
                     {
6432
-                        var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
6433
-                        if (deptmodel != null)
6443
+                        if (model != null)
6434
                         {
6444
                         {
6435
-                            if (model != null)
6445
+                            if (model.F_Type == "2")
6436
                             {
6446
                             {
6437
-                                if (model.F_Type  == "2")
6447
+                                if (deptmodel.F_DeptId == 37)
6438
                                 {
6448
                                 {
6439
-                                    if (deptmodel.F_DeptId  == 37)
6440
-                                    {
6441
-                                       // input. F_SC_QualityMonth = QualityMonth;//市场管理科-超出质保期限
6442
-                                        input.F_SC_PreliminaryOpinion = deptment. PreliminaryOpinion;//市场管理科-初审意见:退货、换货、补偿、自行处理
6443
-                                    }
6444
-                                    else if (deptmodel.F_DeptId  == 12)
6445
-                                    {
6446
-                                        input.F_IsVisit = isvisit.ToString();
6447
-                                        input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
6448
-                                        input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6449
-                                        input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
6450
-                                        input.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
6451
-                                        input.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
6452
-                                        input.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
6453
-                                        input.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
6454
-                                        input.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
6455
-                                        input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6456
-                                        input.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;//  质量管理科-改进要求
6457
-                                        input.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
6458
-
6459
-                                    }
6460
-
6449
+                                    // input. F_SC_QualityMonth = QualityMonth;//市场管理科-超出质保期限
6450
+                                    input.F_SC_PreliminaryOpinion = deptment.PreliminaryOpinion;//市场管理科-初审意见:退货、换货、补偿、自行处理
6461
                                 }
6451
                                 }
6462
-                                else if (model.F_Type == "3")
6452
+                                else if (deptmodel.F_DeptId == 12)
6463
                                 {
6453
                                 {
6464
-                                    if (deptmodel.F_DeptId == 37)
6465
-                                    {
6466
-                                     
6467
-                                        input.F_SC_CJ_SpotResult = deptment.SpotResult;//市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
6468
-                                        input.F_SC_CJ_SelfResult = deptment.SelfResult;//市场管理科-抽检-自检结果
6469
-                                        input.F_SC_CJ_ApprovalNo = deptment.ApprovalNo;//市场管理科-抽检-对应审批工作流单号
6470
-                                        input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//市场管理科-抽检-确认返账金额
6471
-                                    }
6472
-                                    else if (deptmodel.F_DeptId == 12)
6473
-                                    {
6474
-                                        input.F_IsVisit = isvisit.ToString();
6475
-                                        input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
6476
-                                        input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6477
-                                    }
6454
+                                    input.F_IsVisit = isvisit.ToString();
6455
+                                    input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
6456
+                                    input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6457
+                                    input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
6458
+                                    input.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
6459
+                                    input.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
6460
+                                    input.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
6461
+                                    input.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
6462
+                                    input.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
6463
+                                    input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6464
+                                    input.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;//  质量管理科-改进要求
6465
+                                    input.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
6466
+
6478
                                 }
6467
                                 }
6479
-                                if (deptmodel.F_DeptId == 25)
6468
+
6469
+                            }
6470
+                            else if (model.F_Type == "3")
6471
+                            {
6472
+                                if (deptmodel.F_DeptId == 37)
6480
                                 {
6473
                                 {
6481
 
6474
 
6482
-                                    input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
6475
+                                    input.F_SC_CJ_SpotResult = deptment.SpotResult;//市场管理科-抽检-抽检结果(视同合格、合格、不合格、复检后合格、未送检)
6476
+                                    input.F_SC_CJ_SelfResult = deptment.SelfResult;//市场管理科-抽检-自检结果
6477
+                                    input.F_SC_CJ_ApprovalNo = deptment.ApprovalNo;//市场管理科-抽检-对应审批工作流单号
6478
+                                    input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//市场管理科-抽检-确认返账金额
6483
                                 }
6479
                                 }
6484
-                                else if (deptmodel.F_DeptId == 36)
6480
+                                else if (deptmodel.F_DeptId == 12)
6485
                                 {
6481
                                 {
6486
-                                    input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6482
+                                    input.F_IsVisit = isvisit.ToString();
6483
+                                    input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
6484
+                                    input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6487
                                 }
6485
                                 }
6488
                             }
6486
                             }
6489
-                            else
6490
-                                return Error("工单不存在!");
6491
-                        }
6492
-                        else
6493
-                        {
6494
-                            return Error("请选择接收部门");
6495
-                        }
6496
-                    }
6487
+                            if (deptmodel.F_DeptId == 25)
6488
+                            {
6497
 
6489
 
6498
-                    if (model != null)
6499
-                    {
6500
-                        if (model.F_State == 1)
6501
-                        {
6502
-                            return Error("工单已转派请勿重复操作!");
6490
+                                input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
6491
+                            }
6492
+                            else if (deptmodel.F_DeptId == 36)
6493
+                            {
6494
+                                input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6495
+                            }
6503
                         }
6496
                         }
6504
                         else
6497
                         else
6505
-                        {
6506
-                            var res = AssignWO(ua, model, input, cont, F_Files, clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
6507
-                            if (res)
6508
-                                return Success("转派成功");
6509
-                            else
6510
-                                return Error("转派失败!");
6511
-                        }
6512
-                       
6498
+                            return Error("工单不存在!");
6513
                     }
6499
                     }
6514
                     else
6500
                     else
6515
-                        return Error("工单不存在!");
6516
-
6501
+                    {
6502
+                        return Error("请选择接收部门");
6503
+                    }
6517
                 }
6504
                 }
6505
+
6506
+                var res = AssignWO(ua, model, input, cont, F_Files, clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
6507
+                if (res)
6508
+                    return Success("转派成功");
6509
+                else
6510
+                    return Error("转派失败!");
6518
             }
6511
             }
6519
             return Error("无操作权限!");
6512
             return Error("无操作权限!");
6520
         }
6513
         }
6514
+
6521
         /// <summary>
6515
         /// <summary>
6522
         /// 接单 - 确认工单
6516
         /// 接单 - 确认工单
6523
         /// </summary>
6517
         /// </summary>
6621
         /// <returns></returns>
6615
         /// <returns></returns>
6622
         [Authority]
6616
         [Authority]
6623
         public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
6617
         public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
6624
-     string   F_Files, string uncont="",
6625
-          int isvisit=1,  int isover = 0)
6618
+     string F_Files, string uncont = "",
6619
+          int isvisit = 1, int isover = 0)
6626
         {
6620
         {
6627
             int userId = CurrentUser.UserData.F_UserId;
6621
             int userId = CurrentUser.UserData.F_UserId;
6628
             if (userId != 0)
6622
             if (userId != 0)
6633
                 WorkOrderNewInput input = new WorkOrderNewInput();
6627
                 WorkOrderNewInput input = new WorkOrderNewInput();
6634
                 if (ua != null)
6628
                 if (ua != null)
6635
                 {
6629
                 {
6636
-                    
6637
-                   
6638
                     Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
6630
                     Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
6639
-                    var deptmodel = departmentBLL.GetModel(ua.F_DeptId );
6640
-                    if (deptmodel != null)
6631
+                    if (model != null)
6641
                     {
6632
                     {
6642
-                        if (model != null)
6633
+                        if (model.F_State == (int)EnumWorkOrderState.neworder)
6643
                         {
6634
                         {
6644
-                            var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + "and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6645
-                            if (modellist != null)
6646
-                            {
6647
-                                if (modellist.F_NextUser != ua.F_UserCode)
6648
-                                    return Error("非接单人不可操作工单");
6649
-                            }
6650
-                            if (model.F_Type == "2")
6635
+                            var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
6636
+                            if (deptmodel != null)
6651
                             {
6637
                             {
6652
-                                if (deptmodel.F_DeptId == 37)
6638
+
6639
+                                var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + "and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6640
+                                if (modellist != null)
6653
                                 {
6641
                                 {
6654
-                                    input.F_SC_ProductBase = deptment. ProductBase;//
6642
+                                    if (modellist.F_NextUser != ua.F_UserCode)
6643
+                                        return Error("非接单人不可操作工单");
6644
+                                }
6645
+                                if (model.F_Type == "2")
6646
+                                {
6647
+                                    if (deptmodel.F_DeptId == 37)
6648
+                                    {
6649
+                                        input.F_SC_ProductBase = deptment.ProductBase;//
6650
+
6651
+                                    }
6652
+                                    else if (deptmodel.F_DeptId == 12)
6653
+                                    {
6654
+                                        input.F_IsVisit = isvisit.ToString();
6655
+                                        input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
6656
+                                        input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6657
+                                        input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
6658
+                                        input.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
6659
+                                        input.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
6660
+                                        input.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
6661
+                                        input.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
6662
+                                        input.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
6663
+                                        input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6664
+                                        input.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;//  质量管理科-改进要求
6665
+                                        input.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
6666
+                                    }
6655
 
6667
 
6656
                                 }
6668
                                 }
6657
-                                else if (deptmodel.F_DeptId ==12)
6669
+                                else if (model.F_Type == "3")
6658
                                 {
6670
                                 {
6659
-                                    input.F_IsVisit = isvisit.ToString();
6660
-                                    input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
6661
-                                    input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
6662
-                                    input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
6663
-                                    input.F_ZL_ApprovalOpinions = deptment.ApprovalOpinions;// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
6664
-                                    input.F_ZL_ApprovalDisagree = deptment.ApprovalDisagree;// 质量管理科-审批不同意意见
6665
-                                    input.F_ZL_CompensationMethod = deptment.CompensationMethod;// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
6666
-                                    input.F_ZL_CompensationMoney = deptment.CompensationMoney;// 质量管理科-补偿钱款
6667
-                                    input.F_ZL_CResponsibleUnits = deptment.CResponsibleUnits;//质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
6668
-                                    input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6669
-                                    input.F_ZL_ImprovementRequirements = deptment.ImprovementRequirements;//  质量管理科-改进要求
6670
-                                    input.F_ZL_CApprovalNo = deptment.CApprovalNo;// 质量管理科-对应审批工作流单号
6671
+                                    if (deptmodel.F_DeptId == 37)
6672
+                                    {
6673
+                                        input.F_SC_ProductBase = deptment.ProductBase;//
6674
+                                    }
6675
+                                    else if (deptmodel.F_DeptId == 12)
6676
+                                    {
6677
+                                        input.F_IsVisit = isvisit.ToString();
6678
+                                        input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
6679
+                                    }
6671
                                 }
6680
                                 }
6672
-
6673
-                            }
6674
-                            else if (model.F_Type =="3")
6675
-                            {
6676
-                                if (deptmodel.F_DeptId ==37)
6681
+                                if (deptmodel.F_DeptId == 25)
6677
                                 {
6682
                                 {
6678
-                                    input.F_SC_ProductBase = deptment.ProductBase;//
6683
+
6684
+                                    input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
6679
                                 }
6685
                                 }
6680
-                                else if (deptmodel.F_DeptId == 12)
6686
+                                else if (deptmodel.F_DeptId == 36)
6681
                                 {
6687
                                 {
6682
-                                    input.F_IsVisit = isvisit.ToString();
6683
-                                    input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
6688
+                                    input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6684
                                 }
6689
                                 }
6685
                             }
6690
                             }
6686
-                            if (deptmodel.F_DeptId == 25)
6691
+                            else
6692
+                                return Error("工单不存在!");
6693
+                        }
6694
+                        else
6695
+                        {
6696
+                            return Error("请选择接收部门");
6697
+                        }
6698
+                        if (model != null)
6699
+                        {
6700
+                            if (model.F_State == 10)
6701
+                                return Error("工单已处理请勿重复操作!");
6702
+                            else
6687
                             {
6703
                             {
6688
 
6704
 
6689
-                                input.F_SC_CJ_ReturnAccount = deptment.ReturnAccount;//销售内勤-确认返账金额
6690
-                            }
6691
-                            else if (deptmodel.F_DeptId == 36)
6692
-                            {
6693
-                                input.F_ZL_Fquantity = deptment.Fquantity;//质量管理科-确认实收数量(吨)
6705
+                                var res = DealWO(ua, model, input, cont, F_Files, isover, uncont);
6706
+
6707
+                                if (res)
6708
+                                    return Success("处理成功");
6709
+                                else
6710
+                                    return Error("处理失败!");
6694
                             }
6711
                             }
6712
+
6713
+
6695
                         }
6714
                         }
6696
                         else
6715
                         else
6697
-                            return Error("工单不存在!");
6698
-                    }
6699
-                    else
6700
-                    {
6701
-                        return Error("请选择接收部门");
6702
-                    }
6703
-                    if (model != null)
6704
-                    {
6705
-                        if (model.F_State ==10)
6706
-                            return Error("工单已处理请勿重复操作!");
6707
-                        else
6708
                         {
6716
                         {
6709
-
6710
-                            var res = DealWO(ua, model, input, cont, F_Files, isover,  uncont);
6711
-
6712
-                            if (res)
6713
-                                return Success("处理成功");
6714
-                            else
6715
-                                return Error("处理失败!");
6717
+                            return Error("已经指派过了!");
6716
                         }
6718
                         }
6717
-                       
6718
                     }
6719
                     }
6719
                     else
6720
                     else
6720
                         return Error("工单不存在!");
6721
                         return Error("工单不存在!");
6736
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
6737
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
6737
                 if (ua != null)
6738
                 if (ua != null)
6738
                 {
6739
                 {
6739
-                    Model.T_Wo_WorkOrder model = workOrder  .GetModel(orderid);
6740
+                    Model.T_Wo_WorkOrder model = workOrder.GetModel(orderid);
6740
                     //验证信息
6741
                     //验证信息
6741
                     if (model != null)
6742
                     if (model != null)
6742
                     {
6743
                     {
6817
                     //验证信息 
6818
                     //验证信息 
6818
                     if (model != null)
6819
                     if (model != null)
6819
                     {
6820
                     {
6820
-                       
6821
+                        //if (model.F_State != (int)EnumWorkOrderState.assign)
6822
+                        //{
6823
+                        //    return Error("此工单状态已经过时,请刷新");
6824
+                        //}
6821
                             var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + "and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6825
                             var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + model.F_ID + "and F_IsUsed=0 order by   F_ID desc ").FirstOrDefault();
6822
                            
6826
                            
6823
                             if (modellist != null)
6827
                             if (modellist != null)
6859
                     //验证信息
6863
                     //验证信息
6860
                     if (model != null)
6864
                     if (model != null)
6861
                     {
6865
                     {
6866
+                        //if (model.F_State != (int)EnumWorkOrderState.dealed)
6867
+                        //{
6868
+                        //    return Error("此工单状态已经过时,请刷新");
6869
+                        //}
6862
                         var res = Retu(ua, model, cont, reason, F_VisitRemarks, call, isOver, sms);
6870
                         var res = Retu(ua, model, cont, reason, F_VisitRemarks, call, isOver, sms);
6863
                         if (res)
6871
                         if (res)
6864
                             return Success("回访成功");
6872
                             return Success("回访成功");