Browse Source

no message

master
Jujie 3 years ago
parent
commit
9edb9adb5b
  1. 63
      WMS-BS/NFine.Application/WMS/ICSRCVIQCsApp.cs
  2. 21
      WMS-BS/NFine.Application/WMS/PrintApp.cs
  3. 34
      WMS-BS/NFine.Web/Areas/WMS/Controllers/ICSRCVIQCsController.cs
  4. 115
      WMS-BS/NFine.Web/Areas/WMS/Views/ICSRCVIQCs/ICSInspectionDetail.cshtml
  5. 29
      WMS-BS/NFine.Web/Areas/WMS/Views/ICSRCVIQCs/ICSRCVIQCs.cshtml
  6. 1
      WMS-BS/NFine.Web/NFine.Web.csproj

63
WMS-BS/NFine.Application/WMS/ICSRCVIQCsApp.cs

@ -660,5 +660,68 @@ namespace NFine.Application.WMS
return msg;
}
public DataTable GetInventoryInspection(ref Pagination jqgridparam, string InvCode)
{
string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
DataTable dt = new DataTable();
List<DbParameter> parameter = new List<DbParameter>();
string sql = @"select c.ID,a.GroupCode,a.GroupName,c.InspectionID,b.ListCode, b.ListName,b.Unit,b.SetValueMax,b.SetValueMin,c.SetValue,c.Result
from ICSInventoryInspectionGroup a
left join ICSInventoryInspectionList b on a.ID=b.InvGroupID and a.WorkPoint=b.WorkPoint
left join ICSInspectionDetail c on b.ListCode=c.ListCode and b.ListName=c.ListName and b.WorkPoint=c.WorkPoint
where a.InvCode='{0}' and b.Enable='1' and a.WorkPoint='{1}' ";
sql = string.Format(sql, InvCode, WorkPoint);
return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam);
}
public string SaveICSInspectionDetail(string ICSMTDOC, string InvCode)
{
string msg = "";
try
{
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName;
string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
string sql = string.Empty;
JArray res = (JArray)JsonConvert.DeserializeObject(ICSMTDOC);
foreach (var item in res)
{
JObject jo = (JObject)item;
if (jo["ID"].ToString()==""|| jo["ID"].ToString()==null)
{
sql += @"
INSERT INTO dbo.ICSInspectionDetail
( ID ,InspectionID ,ListCode ,ListName ,
Unit ,SetValueMax ,SetValueMin ,SetValue ,Result, MUSER ,MUSERName ,MTIME, WorkPoint,GroupCode,GroupName)
values(newid(),'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}',getdate(),'{10}','{11}','{12}')";
sql = string.Format(sql, jo["InspectionID"].ToString(), jo["ListCode"].ToString(), jo["ListName"].ToString(), jo["Unit"].ToString(), jo["SetValueMax"].ToString(), jo["SetValueMin"].ToString(), jo["SetValue"].ToString(), jo["Result"].ToString(), MUSER, MUSERNAME, WorkPoint, jo["GroupCode"].ToString(), jo["GroupName"].ToString());
}
else
{
sql += @" update ICSInspectionDetail set InspectionID='{0}',ListCode='{1}',ListName='{2}', Unit='{3}' ,SetValueMax='{4}' ,SetValueMin='{5}' ,SetValue='{6}' ,Result='{7}', MUSER='{8}' ,MUSERName='{9}' ,MTIME=getdate(), WorkPoint='{10}', GroupCode='{11}', GroupName='{12}' where ID='{13}'";
sql = string.Format(sql, jo["InspectionID"].ToString(), jo["ListCode"].ToString(), jo["ListName"].ToString(), jo["Unit"].ToString(), jo["SetValueMax"].ToString(), jo["SetValueMin"].ToString(), jo["SetValue"].ToString(), jo["Result"].ToString(), MUSER, MUSERNAME, WorkPoint, jo["GroupCode"].ToString(), jo["GroupName"].ToString(), jo["ID"].ToString());
}
}
if (SqlHelper.CmdExecuteNonQueryLi(sql) > 0)
{
}
else
{
msg = "绑定失败";
}
}
catch (Exception ex)
{
msg = ex.Message;
}
return msg;
}
}
}

21
WMS-BS/NFine.Application/WMS/PrintApp.cs

@ -74,12 +74,13 @@ order by cast(EATTRIBUTE1 as int)";
{
try
{
object MultipleLanguageSetting = GetMultipleLanguageSetting();
string content = "";
string sql = string.Format(@"select CnValue from Sys_Language where Code='{0}'", Code);
string sql = string.Format(@"select {1} from Sys_Language where Code='{0}'", Code, MultipleLanguageSetting);
DataTable dt = SqlHelper.GetDataTableBySql(sql);
if (dt != null && dt.Rows.Count > 0)
{
content = dt.Rows[0]["CnValue"].ToString().ToUpper();
content = dt.Rows[0]["" + MultipleLanguageSetting + ""].ToString().ToUpper();
}
else
{
@ -92,5 +93,21 @@ order by cast(EATTRIBUTE1 as int)";
throw new Exception(ex.Message.ToString());
}
}
public object GetMultipleLanguageSetting()
{
try
{
string sql = string.Format(@"select top 1 b.F_Define1
from Sys_SRM_Items a left join Sys_SRM_ItemsDetail b on a.F_Id=b.F_ItemId
where a.F_EnCode='LGG0001' and b.F_EnabledMark='1' order by b.F_ItemCode");
object MultipleLanguageSetting = SqlHelper.ExecuteScalar(sql);
return MultipleLanguageSetting;
}
catch (Exception ex)
{
throw new Exception(ex.Message.ToString());
}
}
}
}

34
WMS-BS/NFine.Web/Areas/WMS/Controllers/ICSRCVIQCsController.cs

@ -32,7 +32,11 @@ namespace NFine.Web.Areas.WMS.Controllers
{
return View();
}
public ActionResult ICSInspectionDetail()
{
return View();
}
//采购
[HttpGet]
@ -178,7 +182,33 @@ namespace NFine.Web.Areas.WMS.Controllers
}
}
[HttpGet]
public ActionResult GetInventoryInspection(Pagination pagination, string InvCode)
{
DataTable ListData = App.GetInventoryInspection(ref pagination, InvCode);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpPost]
[HandlerAjaxOnly]
public ActionResult SaveICSInspectionDetail(string ICSMTDOC, string InvCode)
{
string msg = App.SaveICSInspectionDetail(ICSMTDOC, InvCode);
if (!string.IsNullOrEmpty(msg))
{
return Error(msg);
}
else
{
return Success("保存成功!");
}
}
}
}

115
WMS-BS/NFine.Web/Areas/WMS/Views/ICSRCVIQCs/ICSInspectionDetail.cshtml

@ -0,0 +1,115 @@
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index.cshtml";
}
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
<script src="~/Content/js/select2/select2.min.js"></script>
<script>
var InvCode = decodeURI($.request("InvCode"));
var JYID = decodeURI($.request("JYID"));
$(function () {
debugger;
gridList();
})
function gridList() {
debugger;
var $gridList = $("#gridList");
$gridList.dataGrid({
url: "/WMS/ICSRCVIQCs/GetInventoryInspection?InvCode=" + InvCode + "&" + Math.random(),
height: 400,
width: $(window).height() - 200,
cellEdit: true,
colModel: [
{ label: "主键", name: "ID", hidden: true, key: true },
{ label: '检验ID', name: 'InspectionID', hidden: true },
{ label: "检验项目组代码", name: "GroupCode", width: 100, align: 'left' },
{ label: "检验项目组名称", name: "GroupName", width: 100, align: 'left' },
{ label: "检验项目代码", name: "ListCode", width: 100, align: 'left' },
{ label: "检验项目名称", name: "ListName", width: 100, align: 'left' },
{ label: "单位", name: "Unit", width: 100, align: 'left' },
{ label: '标准上限', name: 'SetValueMax', width: 80, align: 'left' },
{ label: '标准下限', name: 'SetValueMin', width: 80, align: 'left' },
{ label: '实际值', name: 'SetValue', width: 150, align: 'left', editable: true, editrules: { number: true } },
],
//pager: "#gridPager",
cellsubmit: "clientArray",
sortname: 'ListCode',
viewrecords: true,
rowNum: 200
});
}
function submitForm() {
debugger;
var ICSMTDOC = [];
var obj_Item1 = $("#gridList");
var Result = '';
var rowIds_Item1 = obj_Item1.getDataIDs();
if (rowIds_Item1.length > 0) {
for (var i = 0; i < rowIds_Item1.length; i++) {
var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]);
if (RowData_Item1.SetValue=='') {
$.modalAlertNew("WMS00105");
return;
}
if (Number(RowData_Item1.SetValueMin)<Number(RowData_Item1.SetValue)&&Number(RowData_Item1.SetValue)<Number(RowData_Item1.SetValueMax)) {
Result='1';
}else {
Result='0';
}
var obj = {
ID: RowData_Item1.ID,
InspectionID: JYID,
GroupCode: RowData_Item1.GroupCode,
GroupName: RowData_Item1.GroupName,
ListCode: RowData_Item1.ListCode,
ListName: RowData_Item1.ListName,
Unit: RowData_Item1.Unit,
SetValueMax: RowData_Item1.SetValueMax,
SetValueMin: RowData_Item1.SetValueMin,
SetValue: RowData_Item1.SetValue,
Result: Result,
};
ICSMTDOC.push(obj);
}
}
debugger;
$.modalConfirm("确定保存吗?", function (r) {
if (r) {
$.submitForm({
url: "/WMS/ICSRCVIQCs/SaveICSInspectionDetail?InvCode=" + InvCode + "&" + Math.random(),
param: { ICSMTDOC: JSON.stringify(ICSMTDOC) },
success: function () {
$.currentWindow().$("#gridList").trigger("reloadGrid");
}
})
}
});
}
</script>
<form id="form1">
<div class="gridPanel">
<table id="gridList"></table>
@*<div id="gridPager"></div>*@
</div>
</form>

29
WMS-BS/NFine.Web/Areas/WMS/Views/ICSRCVIQCs/ICSRCVIQCs.cshtml

@ -57,12 +57,15 @@
if (Type == '1') {
var collast = { label: "主键", name: "ID", hidden: true, key: true };
cols.push(collast);
var collast = { label: 'ID', name: 'ID', hidden: true };
cols.push(collast);
var collast = { label: '到货ID', name: 'DHID', hidden: true };
cols.push(collast);
var collast = { label: '检验ID', name: 'JYID', hidden: true };
cols.push(collast);
var collast = { label: '操作', width: 120, align: 'left', formatter: btnLook };
cols.push(collast);
var collast = { label: '到货单号', name: 'DNCode', width: 120, align: 'left' };
cols.push(collast);
var collast = { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' };
@ -137,6 +140,8 @@
cols.push(collast);
var collast = { label: '检验ID', name: 'JYID', hidden: true };
cols.push(collast);
var collast = { label: '操作', width: 120, align: 'left', formatter: btnLook };
cols.push(collast);
var collast = { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' };
cols.push(collast);
var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' };
@ -211,6 +216,8 @@
cols.push(collast);
var collast = { label: '检验ID', name: 'JYID', hidden: true };
cols.push(collast);
var collast = { label: '操作', width: 120, align: 'left', formatter: btnLook };
cols.push(collast);
var collast = { label: '工单单号', name: 'DNCode', width: 120, align: 'left' };
cols.push(collast);
var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' };
@ -778,6 +785,28 @@
});
}
function btnLook(cellvalue, options, rowObject) {
return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadClick('" + rowObject.InvCode + "','" + rowObject.JYID + "')\">查看</ a>";
}
function UpLoadClick(InvCode, JYID) {
debugger;
if (JYID=='') {
$.modalAlertNew("WMS00104");
return;
}
$.modalOpen({
id: "CheckInfo",
title: "查看信息",
url: "/WMS/ICSRCVIQCs/ICSInspectionDetail?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random(),
width: "1000px",
height: "400px",
callBack: function (iframeId) {
top.frames[iframeId].submitForm();
}
});
}
//退回
function btnSendBack() {
debugger;

1
WMS-BS/NFine.Web/NFine.Web.csproj

@ -586,6 +586,7 @@
<Content Include="Areas\WMS\Views\BasicSettings\ICSInventoryInspectionGroup.cshtml" />
<Content Include="Areas\WMS\Views\BasicSettings\ICSInventoryInspectionGroupAdd.cshtml" />
<Content Include="Areas\WMS\Views\BasicSettings\ICSSearchInventory.cshtml" />
<Content Include="Areas\WMS\Views\ICSRCVIQCs\ICSInspectionDetail.cshtml" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<Content Include="Scripts\jquery-1.10.2.js" />
<Content Include="Scripts\jquery-1.10.2.min.js" />

|||||||
100:0
Loading…
Cancel
Save