You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
242 lines
7.4 KiB
242 lines
7.4 KiB
using NFine.Application;
|
|
using NFine.Application.ProductManage;
|
|
using NFine.Code;
|
|
using NFine.Domain.Entity.ProductManage;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web.Mvc;
|
|
|
|
namespace NFine.Web.Areas.SRM.Controllers
|
|
{
|
|
public class CAAddController : ControllerBase
|
|
{
|
|
private CAManageApp App = new CAManageApp();
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJson(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetGridJson(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 对账单新增明细 二级界面
|
|
/// </summary>
|
|
/// <param name="queryJson"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
//[HttpGet]
|
|
//[HandlerAjaxOnly]
|
|
//public ActionResult GetSubGridJson(string queryJson, Pagination pagination)
|
|
//{
|
|
// DataTable ListData = App.GetSubGridJson_Add(queryJson, ref pagination);
|
|
// var JsonData = new
|
|
// {
|
|
// total = pagination.total,
|
|
// page = pagination.page,
|
|
// records = pagination.records,
|
|
// rows = ListData,SaveItemCode
|
|
// };
|
|
// return Content(JsonData.ToJson());
|
|
//}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
//public ActionResult GetSubGridJson(string queryJson, string CartonNo, Pagination pagination)
|
|
//{
|
|
// DataTable ListData = App.GetSubGridJson(CartonNo, ref pagination);
|
|
// var JsonData = new
|
|
// {
|
|
// total = pagination.total,
|
|
// page = pagination.page,
|
|
// records = pagination.records,
|
|
// rows = ListData,
|
|
// };
|
|
// return Content(JsonData.ToJson());
|
|
//}
|
|
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult SubmitForm(string POCode, string PORow, string keyValue)
|
|
{
|
|
int i = App.CreateItemLotNo(POCode, PORow, keyValue);
|
|
if (i > 0)
|
|
{
|
|
return Success("发布成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error("发布失败!");
|
|
}
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetSubGridJsonByCreate(string POCode, string PORow)
|
|
{
|
|
DataTable ListData = App.GetSubGridJsonByCreate(POCode, PORow);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetVendorLotNo(string VenCode, string WorkPoint)
|
|
{
|
|
DataTable ListData = App.GetVendorLotNo(VenCode, WorkPoint);
|
|
var JsonData = new
|
|
{
|
|
VendorLotNo = ListData.Rows[0][0].ToString(),
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetDocNo(string Tax, string WorkPoint, string Vendor)
|
|
{
|
|
string cDocNo = App.GetDocNo(Tax, WorkPoint, Vendor);
|
|
var JsonData = new
|
|
{
|
|
DocNo = cDocNo,
|
|
VenCode = NFine.Code.OperatorProvider.Provider.GetCurrent().VenCode
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetDocNoByPerson(string SupplierCode, string Tax, string WorkPoint)
|
|
{
|
|
string cDocNo = App.GetDocNoByPerson(SupplierCode, Tax, WorkPoint);
|
|
var JsonData = new
|
|
{
|
|
DocNo = cDocNo,
|
|
VenCode = NFine.Code.OperatorProvider.Provider.GetCurrent().VenCode
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 对账单添加,保存到明细表
|
|
/// </summary>
|
|
/// <param name="queryJson"></param>
|
|
/// <param name="DocNo"></param>
|
|
/// <param name="WorkPoint"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult SaveItemCode(string queryJson, string DocNo, string WorkPoint)
|
|
{
|
|
queryJson = queryJson.Substring(1, queryJson.Length - 2);
|
|
string msg = App.CheckSTNO_ItemCode(queryJson, DocNo, WorkPoint);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DeleteInfo(string keyValue, string WorkPoint)
|
|
{
|
|
keyValue = keyValue.Substring(1, keyValue.Length - 2);
|
|
WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
|
|
string msg = App.DeleteInfo(keyValue, WorkPoint);
|
|
if (string.IsNullOrEmpty(msg))
|
|
{
|
|
return Success("删除成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error(msg);
|
|
}
|
|
}
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DeleteDocNoSuit(string keyValue, string DeleteFlag, string WorkPoint,string Tax)
|
|
{
|
|
try
|
|
{
|
|
if (DeleteFlag == "1")
|
|
{
|
|
string msg = App.DeleteDocNoSuit(keyValue, WorkPoint);
|
|
}
|
|
else
|
|
{
|
|
string msg = App.UpdateSTNO(keyValue, WorkPoint, Tax);
|
|
}
|
|
return Success("操作成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
return Error("操作失败!:"+ex.Message);
|
|
}
|
|
|
|
}
|
|
public ActionResult DeleteDocNoSuitBYX(string keyValue, string DeleteFlag, string WorkPoint)
|
|
{
|
|
|
|
string msg = App.DeleteDocNoSuit(keyValue, WorkPoint);
|
|
return Success("操作成功!");
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DeleteDocNo(string keyValue, string DeleteFlag, string WorkPoint)
|
|
{
|
|
if (DeleteFlag == "1")
|
|
{
|
|
string msg = App.DeleteDocNo(keyValue, WorkPoint);
|
|
}
|
|
return Success("操作成功!");
|
|
|
|
}
|
|
public ActionResult ISCA(string queryJson, string WorkPoint)
|
|
{
|
|
try
|
|
{
|
|
App.ISCA(queryJson, WorkPoint);
|
|
return Success("修改成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
}
|
|
public ActionResult GetVendorWorkPoint(string WorkPoint)
|
|
{
|
|
string VenCode = App.GetVendorWorkPoint(WorkPoint);
|
|
|
|
return Content(VenCode);
|
|
}
|
|
|
|
}
|
|
}
|