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.
234 lines
8.4 KiB
234 lines
8.4 KiB
|
|
@{
|
|
ViewBag.Title = "Form";
|
|
Layout = "~/Views/Shared/_Form.cshtml";
|
|
}
|
|
|
|
|
|
<link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
|
|
<script src="~/Content/js/CommonReport/CommonReport.js"></script>
|
|
<link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
|
|
<script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
|
|
<style>
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|
|
<script>
|
|
debugger;
|
|
//var Arguments = decodeURI($.request("Arguments"));
|
|
//var Arguments = '{"name":"wust", "url":"www.wust.edu.cn", "age":120}';
|
|
var ID = $.request("ID");
|
|
//var mold = $.request("mold");
|
|
var mold = "MBY001";
|
|
if (mold == 'YLJL00001' || mold == 'HYJL00001') {
|
|
|
|
var Arguments = sessionStorage.getItem("Arguments"); // 获取参数
|
|
} else {
|
|
var Arguments = decodeURI($.request("Arguments"));
|
|
}
|
|
|
|
|
|
$(function () {
|
|
debugger;
|
|
InitControl();
|
|
$("#sel_LableType").val(mold).trigger("change");
|
|
$("#sel_LableType").attr("disabled", "disabled");
|
|
InitContro2();
|
|
$("#sel_LableType").change(function () {
|
|
InitContro2();
|
|
});
|
|
|
|
});
|
|
|
|
//function GetTXT() {
|
|
// if (!!ID) {
|
|
// $.ajax({
|
|
// url: "/WMS/BasicSettings/GetLabelTXT?ID=" + ID + "&" + Math.random(),
|
|
// dataType: "json",
|
|
// async: false,
|
|
// success: function (data) {
|
|
// debugger;
|
|
// $("#txtLableCode").val(data.rows[0].LableCode);
|
|
// $("#txtLableName").val(data.rows[0].LableName);
|
|
// $("#sel_LableType").val(data.rows[0].LableType).trigger("change");
|
|
// $("#sel_LableSourceID").val(data.rows[0].LableSourceID).trigger("change");
|
|
// }
|
|
// });
|
|
// }
|
|
//};
|
|
|
|
|
|
function InitControl() {
|
|
var $LableType = $("#sel_LableType");
|
|
$LableType.select2({
|
|
allowClear: true,
|
|
escapeMarkup: function (m) {
|
|
return m;
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/WMS/Print/GetLableType" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$.each(data, function (index, item) {
|
|
$LableType.append("<option value='" + item.F_ItemCode + "'> " + item.F_ItemName + "</option>");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function InitContro2() {
|
|
$("#Sys_LablesID").empty();
|
|
var LableType= $("#sel_LableType").val();
|
|
var $Sys_LablesID = $("#Sys_LablesID");
|
|
$Sys_LablesID.select2({
|
|
allowClear: true,
|
|
escapeMarkup: function (m) {
|
|
return m;
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/WMS/Print/GetSys_LablesID?LableType=" + LableType + "&" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$.each(data, function (index, item) {
|
|
$Sys_LablesID.append("<option value='" + item.ID + "'> " + item.LableName + "</option>");
|
|
});
|
|
$("#Sys_LablesID").val([data[1].ID]).trigger("change");
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
function submitForm() {
|
|
|
|
var strPrintData;
|
|
var bIsInstallPrintControl;
|
|
var strPrintControlCookie;
|
|
var objArr = {
|
|
Sys_LablesID: $("#Sys_LablesID").val(),
|
|
};
|
|
//判断是否下载
|
|
const GGID = localStorage.getItem("GGID");
|
|
if (GGID == '' || GGID == null || GGID == undefined) {
|
|
//if (confirm("打印控件未安装!已为你下载至浏览器,请自行安装!")) {
|
|
document.getElementById("downPrintControl").click();
|
|
localStorage.setItem("GGID", "1234567899");
|
|
$.modalAlert("<span style='color: red;font-size:18px'>请自行确认打印控件是否安装,打印控件已为你下载至<br/> ** 浏览器的下载目录下** 。<br/>若未安装请自行安装,只有成功安装打印控件后才能进行打印!</span>", "warning");
|
|
return;
|
|
//}
|
|
}
|
|
if (mold == 'YLJL00001' ) {
|
|
var params = {
|
|
Url : "/WMS/Print/YLPrintItemLot",
|
|
keyValue: JSON.stringify(objArr),
|
|
Arguments: Arguments
|
|
};
|
|
}
|
|
else if (mold == 'HYJL00001') {
|
|
var params = {
|
|
Url: "/WMS/Print/PrintItemLot",
|
|
keyValue: JSON.stringify(objArr),
|
|
Arguments: Arguments
|
|
};
|
|
}
|
|
else {
|
|
var params = {
|
|
Url: "/WMS/Print/PrintItemLot",
|
|
keyValue: JSON.stringify(objArr),
|
|
Arguments: JSON.stringify(Arguments)
|
|
};
|
|
}
|
|
$.ajax({
|
|
url: params.Url,
|
|
type: "post",
|
|
data: { keyValue: params.keyValue, Parameter: params.Arguments },
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
strPrintData = data.strPrintData_1;
|
|
bIsInstallPrintControl = data.bIsInstallPrintControl_1;
|
|
strPrintControlCookie = data.strPrintControlCookie_1;
|
|
}
|
|
});
|
|
if (strPrintData != '') {
|
|
var test = "ChuLinPrint:" + strPrintData;
|
|
$("#ifrm")[0].src = "ChuLinPrint:" + strPrintData;
|
|
}
|
|
//if (bIsInstallPrintControl == 'False') {
|
|
// if (confirm("检测到打印控件未安装,您是否下载安装?")) {
|
|
// $("#downPrintControl").click();
|
|
// }
|
|
//}
|
|
|
|
|
|
if (bIsInstallPrintControl == 'True') {
|
|
var strPrintControlCookie = strPrintControlCookie;
|
|
if (strPrintControlCookie != '') { //延时3秒后再次检测打印控件是否安装
|
|
setTimeout("checkPrintControlInstall()", 8000);
|
|
function checkPrintControlInstall() {
|
|
$.ajax({
|
|
url: "/WMS/WMSCreateItemLot/IsCheckInstall?checkInstall=" + strPrintControlCookie,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (strResult) {
|
|
if (strResult.indexOf("PrintControlInstall") == -1) {
|
|
if (confirm("检测到打印控件未安装,您是否下载安装?")) {
|
|
$("#downPrintControl").click();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
<iframe id="ifrm" src="" width="0" height="0"></iframe>
|
|
<div class="btn-group" style="display:block;padding-left:2px;">
|
|
<a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
|
|
@*<a id="DeleteLog" authorize="yes" class="btn btn-primary dropdown-text" ><i class="fa fa-download"></i>打印控件不工作点我后重试</a>*@
|
|
|
|
</div>
|
|
<form id="form1">
|
|
<div class="widget-body">
|
|
|
|
<div style="padding-top: 5px; ">
|
|
<div class="step-content" id="wizard-steps" style="border-left: none; border-bottom: none; border-right: none;">
|
|
<div class="step-pane active" id="step-1" style="padding-left: 5px; padding-top: 20px; margin-right: 20px;">
|
|
|
|
<table class="form">
|
|
<tr>
|
|
<th class="formTitle">标签类型: </th>
|
|
<td class="formValue">
|
|
<select id="sel_LableType" name="sel_LableType" class="form-control select2" style="width: 230px" placeholder="请选择标签类型..."></select>
|
|
<input type="hidden" id="hidetext" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">打印模板:</th>
|
|
<td class="formValue">
|
|
<select id="Sys_LablesID" name="Sys_LablesID" class="form-control select2" style="width: 230px" placeholder="请选择标签类型..."></select>
|
|
<input type="hidden" id="hidetext" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|