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.
396 lines
18 KiB
396 lines
18 KiB
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<!--引入 element-ui 的样式,-->
|
|
<link rel="stylesheet" href="~/Content/element-ui/lib/theme-chalk/index.css">
|
|
<script src="~/Content/vue/dist/vue.js"></script>
|
|
<script src="~/Content/element-ui/lib/index.js"></script>
|
|
|
|
<script src="~/Content/axios.min.js"></script>
|
|
<style >
|
|
</style>
|
|
<form id="form1">
|
|
<div id="app">
|
|
<div class="topPanel" style="height:100px;">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
<input id="FileUp" name="FileUp" type="file" style="display:none;" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
|
|
|
|
<a id="NF-Add" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Add()"><i class="fa fa-pencil-square-o"></i>新增</a>
|
|
<a id="NF-Remove" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Remove()"><i class="fa fa-trash-o"></i>删除</a>
|
|
<a id="NF-Edit" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Edit()"><i class="fa fa-pencil-square-o"></i>修改</a>
|
|
<a href="~/File/IQC/东辉AQL导入.xlsx" id="NF-IntroductionMould" authorize="no" class="btn btn-primary dropdown-text"><i class="fa fa-file-excel-o"></i>导入模板下载</a>
|
|
<a id="NF-Introduction" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_UPload()">导入</a>
|
|
<a id="NF-ExportAll" authorize="no" class="btn btn-primary"><i class="fa fa-download"></i>导出</a>
|
|
<a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
|
|
|
|
</div>
|
|
<div class="btn-group" style="display:block;padding-left:2px;">
|
|
<a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
|
|
</div>
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_MoCode"> AQL编码</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_RulesCode" type="text" class="form-control HideItems" style="width: 200px;">
|
|
</div>
|
|
</td>
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_MoCode"> AQL名称</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_RulesName" type="text" class="form-control HideItems" style="width: 200px;">
|
|
</div>
|
|
</td>
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_MoCode"> 是否启用</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<select id="txt_Enable" class="form-control select2" style="width: 135px; height: 20px;">
|
|
<option value="" selected>全部</option>
|
|
<option value="1">是</option>
|
|
<option value="0">否</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function btn_UPload() {
|
|
$("#FileUp").click();
|
|
|
|
}
|
|
$(function () {
|
|
|
|
var service = {
|
|
isCanEditDate: false,
|
|
Init: function () {
|
|
var that = this;
|
|
$("#txt_CheckFixtureNo").val('');
|
|
|
|
|
|
that.initControl();
|
|
that.loadGrid();
|
|
that.loadEvent();
|
|
//that.loadViewGrid();
|
|
|
|
},
|
|
initControl: function () {
|
|
let that = this;
|
|
let orgName = '';
|
|
|
|
let userName = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserName';
|
|
|
|
},
|
|
loadGrid: function () {
|
|
var that = this;
|
|
|
|
var queryJson = {
|
|
RulesCode: $("#txt_RulesCode").val(),
|
|
RulesName: $("#txt_RulesName").val(),
|
|
Enable: $("#txt_Enable").val(),
|
|
}
|
|
|
|
var $gridList = $("#gridList");
|
|
$gridList.dataGrid({
|
|
url: "/DHAY/IQCQuality/GetGridJsonChengPing" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
mtype: "POST",
|
|
height: $(window).height() - 200,
|
|
width: $(window).width() - 300,
|
|
cellEdit: true,
|
|
cellsubmit: "clientArray",
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: 'Aql代码', name: 'RulesCode', width: 100, align: 'left' },
|
|
{ label: 'Aql名称', name: 'RulesName', width: 100, align: 'left' },
|
|
//{ label: 'Aql描述', name: 'RulesDesc', width: 100, align: 'left' },
|
|
//{ label: '类别', name: 'Type', width: 100, align: 'left' },
|
|
{ label: '最后操作时间', name: 'MTIME', width: 100, align: 'left' },
|
|
{ label: '维护人', name: 'MUSERName', width: 100, align: 'left' },
|
|
{ label: '是否启用', name: 'EnableText', width: 100, align: 'left' },
|
|
],
|
|
shrinkToFit: true,//宽度自适应
|
|
width: "100%",
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
//if (!that.isCanEditDate) {
|
|
// var obj_Item1 = $("#gridList");
|
|
// var rowIds_Item1 = obj_Item1.getDataIDs();
|
|
|
|
// for (var i = 0; i < rowIds_Item1.length; i++) {
|
|
// $("#gridList").jqGrid('setCell', rowIds_Item1[i], "PlanStartDate", '', 'not-editable-cell');
|
|
// $("#gridList").jqGrid('setCell', rowIds_Item1[i], "PlanEndDate", '', 'not-editable-cell');
|
|
// $("#gridList").jqGrid('setCell', rowIds_Item1[i], "ApsOrderDate", '', 'not-editable-cell');
|
|
// }
|
|
//}
|
|
},
|
|
pager: "#gridPager",
|
|
sortname: 'MTIME',
|
|
sortorder: "desc",
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
subGrid: true, // (1)开启子表格支持
|
|
subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
// console.log(subgrid_id, rowid);
|
|
//
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
that.bindSubGrid3(subgrid_id, rowid);
|
|
}
|
|
});
|
|
},
|
|
query: function () {
|
|
//console.log("点击查询");
|
|
var queryJson = {
|
|
RulesCode: $("#txt_RulesCode").val(),
|
|
RulesName: $("#txt_RulesName").val(),
|
|
Enable: $("#txt_Enable").val(),
|
|
}
|
|
// that.loadGrid(queryJson);
|
|
|
|
$("#gridList").jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
},
|
|
bindSubGrid3: function (subgrid_id, rowid) {
|
|
//
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var MOCode = $("#gridList").jqGrid('getRowData', rowid).ID;
|
|
// var MoSeq = $("#gridList").jqGrid('getRowData', rowid).MoSeq;
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
mtype: "GET",
|
|
url: "/DHAY/IQCQuality/GetAqlSubGridJsonList?id=" + MOCode + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: '批量下限', name: 'SetValueMin', width: 150, align: 'left' },
|
|
{ label: '批量上限', name: 'SetValueMax', width: 150, align: 'left' },
|
|
{ label: '取样数量', name: 'SampleQuantity', width: 150, align: 'left' },
|
|
{ label: '允许不良数', name: 'EATTRIBUTE1', width: 150, align: 'left' },
|
|
{ label: '类别', name: 'Type', width: 100, align: 'left' },
|
|
{ label: '类别', name: 'EATTRIBUTE2', width: 150, align: 'left', hidden: true },
|
|
//{ label: '允许不良数(次要)', name: 'EATTRIBUTE3', width: 150, align: 'left' },
|
|
{ label: '维护人', name: 'MUSERName', width: 100, align: 'left' },
|
|
{ label: '维护时间', name: 'MTIME', width: 100, align: 'left' },
|
|
],
|
|
//colModel: ColModelSub,
|
|
shrinkToFit: true,//宽度自适应
|
|
multiselect: true,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
//rowNum: 20,
|
|
//pager: subgrid_pager_id,
|
|
|
|
});
|
|
},
|
|
loadEvent: function () {
|
|
var that = this;
|
|
$("#btn_search").click(function () {
|
|
that.query();
|
|
});
|
|
$("#NF-Add").click(function () {
|
|
// debugger;
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
|
|
$.modalOpen({
|
|
id: "Form",
|
|
title: "新增Aql",
|
|
url: "/DHAY/IQCQuality/AqlEdit?ids=",
|
|
width: "1200px",
|
|
height: "800px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
|
|
|
|
});
|
|
|
|
$("#NF-Print").click(function () {
|
|
console.log("打印条码");
|
|
// debugger;
|
|
var objArr = '';
|
|
var arr = [];
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
objArr += "'" + rowData.CheckFixtureNo + "',";
|
|
|
|
}
|
|
objArr = objArr.slice(0, objArr.length - 1);
|
|
if (objArr == "") {
|
|
$.modalAlertNew("WMS00003");
|
|
return;
|
|
}
|
|
objArr = "" + objArr + "|";
|
|
arr.push(objArr);
|
|
|
|
|
|
$.modalOpen({
|
|
id: "PrintLot",
|
|
title: "打印",
|
|
url: "/DHAY/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=JY0001&" + Math.random(),
|
|
width: "550px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
|
|
});
|
|
$("#NF-Edit").click(function () {
|
|
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
if (ids.length != 1) {
|
|
$.modalMsg("请选择一条数据", "warning");
|
|
return;
|
|
}
|
|
|
|
let obj = {
|
|
ids: ids[0],
|
|
};
|
|
//debugger;
|
|
//if (!obj.orderDate) {
|
|
// obj.orderDate = new Date().toLocaleDateString();
|
|
//}
|
|
// consol.log();
|
|
$.modalOpen({
|
|
id: "Form",
|
|
title: "编辑Aql",
|
|
url: "/DHAY/IQCQuality/AqlEdit?ids=" + ids[0]+"",
|
|
width: "1200px",
|
|
height: "800px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
});
|
|
$("#txt_SSName").change(function (event,handle) {
|
|
//console.log( $("#txt_SSName").val());
|
|
// console.log(val);
|
|
// console.log("值改变了");
|
|
let val = $("#txt_SSName").val();
|
|
if (!val) {
|
|
$("#NF-PrintLabel").attr("disabled", "disabled");
|
|
}
|
|
else {
|
|
$("#NF-PrintLabel").removeAttr("disabled");
|
|
}
|
|
});
|
|
$("#NF-Remove").click(function () {
|
|
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
if (ids.length < 1) {
|
|
$.modalMsg("请选择数据", "warning");
|
|
return;
|
|
}
|
|
let keyList = [];
|
|
for (var i = 0; i < ids.length; i++) {
|
|
keyList.push(ids[i]);
|
|
}
|
|
|
|
//let obj = {
|
|
// ids: ids[0],
|
|
//};
|
|
|
|
|
|
$.ajax({
|
|
url: "/DHAY/IQCQuality/DeleteAql",
|
|
type: "POST",
|
|
dataType: "json",
|
|
async: false,
|
|
data: {
|
|
keyValue: JSON.stringify(keyList)
|
|
},
|
|
success: function (data) {
|
|
//
|
|
// console.log(data);
|
|
if (data.state == "success") {
|
|
$.modalMsg("操作成功", "success");
|
|
that.query();
|
|
}
|
|
else
|
|
$.modalMsg(data.message, "warning");
|
|
}
|
|
});
|
|
});
|
|
$("#NF-ExportAll").click(function () {
|
|
let queryJson = {
|
|
RulesCode: $("#txt_RulesCode").val(),
|
|
RulesName: $("#txt_RulesName").val(),
|
|
Enable: $("#txt_Enable").val(),
|
|
};
|
|
var postData = "&id=" + queryJson.RulesCode + "";
|
|
postData += "&CheckFixtureName=" + queryJson.RulesName;
|
|
postData += "&Status=" + queryJson.Enable;
|
|
|
|
$.download("/DHAY/IQCQuality/ExportAllAqlList" + "?" + Math.random(), postData, 'post');
|
|
});
|
|
$("#FileUp").on("change", function (up) {
|
|
// let that = this;
|
|
var form = new FormData(document.getElementById("form1"));
|
|
$.ajax({
|
|
url: "/DHAY/IQCQuality/UploadFileInspectionAQL?" + Math.random(),
|
|
type: "post",
|
|
data: form,
|
|
contentType: false,
|
|
processData: false,
|
|
success: function (data) {
|
|
if (data == "true" || data == true) {
|
|
$.modalMsg("导入成功", "success");
|
|
that.query();
|
|
}
|
|
else {
|
|
$.modalMsg(data, "warning");
|
|
}
|
|
},
|
|
error: function (aa) {
|
|
$.modalMsg("导入失败:" + aa, "warning");
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
}
|
|
service.Init();
|
|
|
|
|
|
})
|
|
|
|
</script>
|