| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 |
- @using ShwasherSys
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Models.Modal
- @{
- ViewBag.ActiveMenu = PermissionNames.PagesProductInspectInspectReport; //The menu item will be active for this page.
- ViewBag.Title = "检验报告确认";
- List<SelectListItem> inspectResult = new List<SelectListItem>()
- {
- new SelectListItem(){Text = @"合格",Value = "1"},
- new SelectListItem(){Text = @"不合格",Value = "0"},
- },confirmStatus= new List<SelectListItem>()
- {
- new SelectListItem(){Text = @"未确认",Value = InspectConfirmStateDefinition.New+""},
- new SelectListItem(){Text = @"已确认",Value = InspectConfirmStateDefinition.Confirm+""},
- }
- ;
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("productionOrderNo","排产单号"),
- new SearchItem("semiProductName","半成品名称"),
- new SearchItem("model","规格"),
- new SearchItem("material","材质"),
- new SearchItem("surfaceColor","表色"),
- new SearchItem("confirmDate","确认时间",FiledType.Dnull,ExpType.GreaterOrEqual),
- new SearchItem("confirmDate","至",FiledType.Dnull,ExpType.LessOrEqual),
- new SearchItem("semiProductNo","半成品编码"),
- new SearchItem("confirmStatus","确认状态",FiledType.I,ExpType.Equal).SetSearchItem(confirmStatus),
- new SearchItem("confirmUser","检验人员"),
- }, false);
- }
- @section CSS{
- @*<link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
- <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker-wr.css" rel="stylesheet" />*@
- <link href="~/Content/Plugins/kindeditor/themes/default/default.css" rel="stylesheet" />
- <link href="~/Content/Plugins/PrintPreView/print-preview.css" rel="stylesheet" />
- <link href="~/Content/Css/report-table.css" rel="stylesheet" media="all" />
- <style>
- .inspect-box {
- display: block;
- }
- .attach {
- display: block;
- float: left;
- padding-right: 20px;
- }
- .attach img {
- width: 22px;
- height: 22px;
- margin-right: 5px;
- }
- .attach a {
- color: #666;
- font-weight: 400;
- line-height: 32px;
- padding: 0;
- }
- .attach a:hover {
- color: #583d9c;
- }
- .attach .delete {
- color: #aaa;
- font-weight: 600;
- margin-left: 5px;
- cursor: pointer;
- }
- .attach .delete:hover {
- color: red;
- }
- </style>
- <div id="exportCss">
- <style>
- #ReportTable table {
- border: 1px solid #000;
-
- }
- #ReportTable table .edit-input {
- padding: 3px 5px;
- border: 1px solid #3c3c3c;
- font-weight: 400;
- color: red;
- width: calc(100% - 10px)
- }
- #ReportTable table thead td img {
- width: 600px;
- }
- #ReportTable table tr td {
- padding: 5px 2px;
- font-size: 12px;
- font-weight: 500;
- text-align: center;
- border-left: 1px solid #000;
- border-top: 1px solid #000;
- background: #f5f5f5;
- word-wrap: break-word;
- word-break: break-all;
- }
- #ReportTable table tr:last-of-type td {
- border-bottom: 1px solid #000;
- height: 28px;
- }
- #ReportTable table tr td:last-of-type {
- border-right: 1px solid #000;
- }
- #ReportTable table td span {
- cursor: pointer;
- display: inline-block;
- min-width: 10px;
- min-height: 10px;
- }
- #ReportTable table .td-count {
- padding-right: 6px;
- }
- #ReportTable table .td-input {
- font-weight: 400;
- background: #fefefe;
- }
- </style>
- </div>
- }
- <section style="display: none">
- @Html.DropDownList("hide-inspectResult", inspectResult)
- @Html.DropDownList("hide-confirmStatus", confirmStatus)
- </section>
- <div class="table-box iwb-bootstrap-table">
- @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
- <table id="table"
- data-url="/api/services/app/ProductInspect/GetAllReport" data-id-field="id" data-unique-id="id"
- data-striped="true" data-click-to-select="true" data-single-select="true"
- data-method="post" data-side-pagination="server" data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
- data-cache="false" data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]"
- data-pagination-h-align="left" data-pagination-detail-h-align="right"
- data-query-params="QueryParams" data-response-handler="ResponseHandler">
- <thead>
- <tr class="row" id="header">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="productInspectReportNo">报告编号</th>
- <th data-align="center" data-field="productionOrderNo">排产单号</th>
- <th data-align="center" data-field="semiProductNo">半成品编码</th>
- <th data-align="center" data-field="semiProductName">半成品名称</th>
- <th data-align="center" data-field="inspectCount">检验次数</th>
- <th data-align="center" data-field="confirmStatus" data-formatter="ConfirmStatusFormatter">确认状态</th>
- <th data-align="center" data-field="surfaceColor">表色</th>
- <th data-align="center" data-field="model">规格</th>
- <th data-align="center" data-field="material">材质</th>
- <th data-align="center" data-field="rigidity">硬度</th>
- <th data-align="center" data-field="partNo">零件号</th>
- <th data-align="center" data-field="confirmDate">确认时间</th>
- <th data-align="center" data-field="confirmUser">确认人员</th>
- </tr>
-
- </thead>
- </table>
- </div>
- @section modal{
- <!--Main Modal-->
- <section>
- <div class="modal fade" id="modal" role="dialog" tabindex="-1" aria-labelledby="ModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered" role="document" style="width:1000px">
- <div class="modal-content">
- @Html.Partial("Modals/_ModalHeader", new ModalHeaderViewModel("检验报告", ""))
- <div class="modal-body container-fluid" style="padding-top: 15px;padding-bottom: 0;">
- <form class="pr-3 pl-3 form-horizontal " id="form">
- <div class="table-box inspect-box iwb-bootstrap-table">
- <table id="table1"
- data-url="/api/services/app/ProductInspect/GetAll" data-id-field="id" data-unique-id="id"
- data-striped="true" data-click-to-select="true" data-single-select="true"
- data-method="post" data-side-pagination="server" data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
- data-cache="false" data-pagination="true" data-page-size="30" data-page-number="1" data-page-list="[30,50,100,200]"
- data-pagination-h-align="left" data-pagination-detail-h-align="right"
- data-query-params="QueryParams" data-response-handler="ResponseHandler">
- <thead>
- <tr class="row">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="productionOrderNo">排产单号</th>
- <th data-align="center" data-field="semiProductNo">半成品编码</th>
- <th data-align="center" data-field="semiProductName">半成品名称</th>
- <th data-align="center" data-field="inspectResult" data-formatter="InspectResultFormatter">检验结果</th>
- @*<th data-align="center" data-field="surfaceColor">表色</th>
- <th data-align="center" data-field="model">规格</th>
- <th data-align="center" data-field="material">材质</th>
- <th data-align="center" data-field="rigidity">硬度</th>
- <th data-align="center" data-field="partNo">零件号</th>*@
- <th data-align="center" data-field="inspectDate">检验时间</th>
- <th data-align="center" data-field="inspectMember">检验人员</th>
- </tr>
- </thead>
- </table>
- </div>
- <div class="row ">
- <div class="form-group-sm col-md-12">
- <label class="iwb-label col-md-1 control-label" for="inspectContent">附件列表:</label>
- <div class="col-md-11 attach-list">
- <div class="attach">暂无附件</div>
- </div>
- </div>
- </div>
- <div class="form-group-sm">
- <input id="id" name="id" type="hidden" value="">
- <input id="productInspectReportNo" name="productInspectReportNo" type="hidden" value="">
- <input id="reportContent" name="reportContent" type="hidden" value="">
- </div>
- <div class="inspect-box row">
- <div class="form-group-sm col-md-6">
- <label class="iwb-label col-md-2 control-label iwb-label-required" for="productionOrderNo">排产单号</label>
- <div class="col-md-10">
- <input class="form-control" id="productionOrderNo" name="productionOrderNo" required="" type="text" placeholder="" value="" style="">
- </div>
- </div>
- <div class="form-group-sm col-md-6">
- <label class="iwb-label col-md-2 control-label iwb-label-required" for="semiProductNo">半成品编码</label>
- <div class="col-md-10">
- <input class="form-control" id="semiProductNo" name="semiProductNo" required="" type="text" placeholder="" value="" style="">
- </div>
- </div>
- <div class="form-group-sm col-md-12">
- <label class="iwb-label col-md-1 control-label" for="inspectContent">最终检验详情</label>
- <div class="col-md-11">
- <textarea class="form-control" id="inspectContent" name="inspectContent" type="text" placeholder="请输入检验详情..." value="" style="" disabled=""></textarea>
- </div>
- </div>
- @*<div class="form-group-sm col-md-6">
- <label class="iwb-label col-md-2 control-label iwb-label-required" for="inspectResult">检验结果</label>
- <div class="col-md-10">
- @Html.DropDownList("inspectResult", inspectResult, new {style = "width:100%", required = ""})
- </div>
- </div>
- <div class="form-group-sm col-md-6">
- <label class="iwb-label col-md-2 control-label iwb-label-required" for="inspectDate">检验时间</label>
- <div class="col-md-10">
- <input class="form-control datetime" id="inspectDate" name="inspectDate" required="" type="text" placeholder="请输入检验时间..." value="" style="" disabled="">
- </div>
- </div>
- <div class="form-group-sm col-md-6">
- <label class="iwb-label col-md-2 control-label iwb-label-required" for="inspectMember">检验人员</label>
- <div class="col-md-10">
- <input class="form-control" id="inspectMember" name="inspectMember" required="" type="text" placeholder="请输入检验人员..." value="" style="" disabled="">
- </div>
- </div>*@
- <div class="form-group-sm col-md-12">
- <div class=" col-md-2" style="float: right;">
- <button type="button" class="btn btn-sm btn-danger" style="width: 100%; background-color: #583d9c; border-color: #583d9c;" onclick="AddAttach()">添加附件</button>
- </div>
- </div>
- <div class="attach-unit"></div>
- </div>
- <div class="form-group-sm" id="reportContentArea">
- <div class="col-md-12 report-content" id="ReportTable"></div>
- </div>
- </form>
- </div>
- @Html.Partial("Modals/_ModalFooter", "0")
- </div>
- </div>
- </div>
- </section>
- }
- @section scripts
- {
- @*<script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
- <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>*@
- <script src="~/Content/Plugins/PrintPreView/print-preView.js"></script>
- <script src="~/Content/Scripts/MyScript/ExportExcel.js"></script>
- <script type="text/javascript">
- var $table1=$('#table1');
- $(function () {
- var datePickerOpt = {
- language: 'zh-CN',
- format: "yyyy-mm-dd",
- todayBtn: true,
- autoclose: true,
- startView: 2,
- minView: 2,
- maxView: 4,
- showSecond: false,
- showHours: false,
- minuteStep: 10
- };
- //$("#KeyWords-6").datetimepicker(datePickerOpt);
- //$("#KeyWords-7").datetimepicker(datePickerOpt);
- //$(".datetime").datetimepicker(datePickerOpt).on('show',
- // function (event) {
- // event.preventDefault();
- // event.stopPropagation();
- // }).on('hide',
- // function (event) {
- // event.preventDefault();
- // event.stopPropagation();
- // });
- LoadTable();
- var funs = window.funs || { none: function () { console.log("No type"); } };
- $("#modal .save-btn")
- .after(
- "<button type=\"button\" id=\"printReport\" class=\"btn btn-info waves-effect\" style=\"min-width:100px;border:1px solid #DDDDDD;\">打印</button><button type=\"button\" id=\"exportReport\" class=\"btn btn-info waves-effect\" style=\"min-width:100px;border:1px solid #DDDDDD;\">导出</button>");
- funs["btnConfirmReport"] = function (url) {
- var rows = config.table.bootstrapTable("getSelections");
-
- if (rows.length === 1) {
- GetOldReport(rows[0].productionOrderNo);
- $(".inspect-box").css("display", "block");
- //$(".attach-list").css("display", "block");
- $("#modal .save-btn").css("display", "inline-block");
- $(".attach-unit").html('');
- $table1.bootstrapTable('destroy');
- LoadTable({
- table: $table1,
- queryParams: function(params) {
- var sorting = '';
- if (params.sort) {
- sorting = params.sort;
- if (params.order) {
- sorting += ' ' + params.order;
- }
- }
- return {
- //limit: params.limit, //页面大小
- //page: (params.offset / params.limit) + 1, //页码
- MaxResultCount: params.limit,
- SkipCount: params.offset,
- Sorting: sorting, //排序列名
- sortOrder: params.order, //排位命令(desc,asc)
- SearchList: [
- {
- KeyWords: rows[0].productionOrderNo,
- KeyField: "ProductionOrderNo",
- FieldType: "0",
- ExpType: "0"
- }
- ]
- };
- },
- //onLoadSuccess: ICheckTableInit_SingleSelect
- onLoadSuccess: function (data) {
-
- $('#inspectContent').val(data.rows[0].inspectContent);
- OnLoadSuccess(data, $table1);
- },
- onPostBody: function(data) {
- OnPostBody(data, $table1);
- }
- });
- QueryAttach(rows[0].productionOrderNo);
- BtnUpdate({
- data: rows[0],
- disabled: "productionOrderNo,semiProductNo",
- save: function() {
- if (rows[0].confirmStatus === @(InspectConfirmStateDefinition.Confirm)) {
- abp.message.warn("检测报告已确认,请勿重复操作!");
- return;
- }
- SaveReport(url);
- }
- });
-
- //QueryAttach(rows[0].productInspectNo, true);
- $("#printReport").hide();
- $("#exportReport").hide();
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- };
- funs["btnQueryReport"] = function () {
- console.log("QueryReport");
- var rows = config.table.bootstrapTable("getSelections");
- if (rows.length === 1) {
- GetOldReport(rows[0].productionOrderNo, true);
- $(".inspect-box").css("display", "none");
- $(".attach-list").css("display", "block");
- $("#modal .save-btn").css("display", "none");
-
- $table1.bootstrapTable('destroy');
-
- QueryAttach(rows[0].productionOrderNo);
- $("#printReport").show();
- $("#exportReport").show();
- ShowModal("modal");
- } else {
- abp.message.warn(abp.localization.localize("ChooseOneToOp"));
- }
- };
- $("#printReport").printPreview({
- printBody: "#reportContentArea",
- modalWidth: 1080
- });
- $("#exportReport").on('click',
- function(e) {
- var urlPath = window.document.location.href; //浏览器显示地址 http://10.15.5.83:5555/ISV/demo.aspx?a=1&b=2
- var docPath = window.document.location.pathname; //文件在服务器相对地址 /ISV/demo.aspx
- var index = urlPath.indexOf(docPath);
- var serverPath = urlPath.substring(0, index); //服务器地址 http://10.15.5.83:5555
- var imgTr = $("#reportContentArea").find('table thead tr:first').clone();
- var img = $("#reportContentArea").find('table thead tr:first img')
- .attr("src", serverPath + "/Content/Images/excle/report2.png");
- $("#reportContentArea").find('table thead tr:first td')
- .css({ "height": "130px", "text-align": "center" });
- ExportExcel('reportContentArea', '检查报告', 'exportCss');
- $("#reportContentArea").find('table thead tr:first').remove();
- $("#reportContentArea").find('table thead').prepend(imgTr);
- });
-
- $("#Tool1").append(
- '<div class="tool-radio"><input name="proType" type="radio" id="allProduction" checked value=""/><label for="allProduction">全部</label></div>' +
- '<div class="tool-radio"><input name="proType" type="radio" id="outPurchase" value="1"/><label for="outPurchase">外购</label></div>' +
- '<div class="tool-radio"><input name="proType" type="radio" id="machineShop" value="0"/><label for="machineShop">车间加工</label></div>' +
- '<div class="tool-radio"><input name="proType" type="radio" id="outProduct" value="2"/><label for="outProduct">外协</label></div>');
- $(".tool-radio input[type='radio']").on('click',function(e) {
- //var outType = $(this).val();
- document.getElementById("SearchForm").reset();
- GetSearchList();
- RefreshTable();
- });
- });
- function GetSearchList() {
- var count = $("#SearchForm").find(".KeyWords").length;
- window._searchList = [];
-
- var outType = $('input[name="proType"]:checked').val();
- switch (outType) {
- case "1":
- case "0":
- window._searchList.push({
- KeyWords: outType,
- KeyField: "ProductionType",
- FieldType: "0",
- ExpType: "0"
- });
- break;
- case "2":
- window._searchList.push({
- KeyWords: "2",
- KeyField: "ProcessingLevel",
- FieldType: "0",
- ExpType: "0"
- });
- break;
- default:
- break;
- }
-
- for (var i = 1; i <= count; i++) {
- var keyWords = $("#KeyWords-" + i).val();
- if (keyWords) {
- var keyField = $("#KeyField-" + i).val();
- var fieldType = $("#FieldType-" + i).val();
- var expType = $("#ExpType-" + i).val();
- _searchList.push({
- KeyWords: keyWords,
- KeyField: keyField,
- FieldType: fieldType,
- ExpType: expType
- });
- }
- }
- }
- </script>
- <script>
- function AddAttach() {
- var id = Math.floor(Math.random() * 9999);
- $(".attach-unit").append(
- '<div class="form-group-sm"><div class="col-md-6"><label class="iwb-label col-md-2 control-label iwb-label-required" for="">附件名称</label><div class="col-md-10"><input class="form-control" name="fileTitle" required="" placeholder="请输入附件名称" type="text"></div> </div><div class="col-md-6"><div class="col-md-10"><input class="form-control" name="fileInfo" id="fileInfo-' +
- id +
- '" type="hidden"><input class="form-control" name="fileName" id="fileName-' +
- id +
- '" type="hidden"><input class="form-control" name="fileExt" id="fileExt-' +
- id +
- '" type="hidden"><div class="custom-file "><input class="custom-file-input" id="customFile-' +
- id +
- '" type="file" onchange="FileCheck(this,' +
- id +
- ')" onclick="OpenUploadWindow()"><label class="custom-file-label" for="customFile-' +
- id +
- '">选择文件</label></div></div><div class="col-md-2" style="float: right;padding-left: 0;"><button type="button" class="btn btn-sm btn-danger" style="width: 100%;" onclick="RemoveAttach(this)">移除</button></div></div></div>');
- var topHeight = $(window).height() - $("#modal").find('.modal-dialog').height() - 50;
- if (topHeight < 30) {
- topHeight = 30;
- }
- $("#modal").find('.modal-dialog').animate({ 'marginTop': topHeight / 2 + "px" });
- }
- function RemoveAttach(that) {
- $(that).closest(".form-group-sm").remove();
- }
- function GetAttachFilesDate() {
- var data = {
- id: $("#modal #id").val(),
- productInspectReportNo: $("#modal #productInspectReportNo").val(),
- reportContent: $("#modal #reportContent").val(),
- productionOrderNo: $("#modal #productionOrderNo").val(),
- inspectContent: $("#modal #inspectContent").val(),
- attachFiles: []
- };
- $(".attach-unit .form-group-sm").each(function (i, v) {
- var fileTitle = $(v).find("input[name='fileTitle']").val();
- var fileInfo = $(v).find("input[name='fileInfo']").val();
- var fileName = $(v).find("input[name='fileName']").val();
- var fileExt = $(v).find("input[name='fileExt']").val();
- data.attachFiles.push(
- { fileTitle: fileTitle, fileInfo: fileInfo, fileName: fileName, fileExt: fileExt });
- });
- return data;
- }
- function FileCheck(that, id) {
- FileInputCheck(that,
- 'fileInfo-' + id,
- false,
- 100,
- function (fileName) {
- var name = fileName.substring(0, fileName.lastIndexOf("."));
- var ext = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length);
- $("#fileName-" + id).val(name);
- $("#fileExt-" + id).val(ext);
- });
- }
- </script>
- <script>
- function QueryAttach(no, hasDelete) {
- SaveAjax({
- url: window.appUrl + 'ProductInspect/QueryAttach',
- data: { TableName: 'Product', ColName: 'Inspect', Key: no },
- isValidate: false,
- isAlert: false,
- success: function (res) {
- FormatterAttach(res, hasDelete);
- }
- });
- }
- function FormatterAttach(data, hasDelete) {
- var str = '';
- if (data) {
- for (var i = 0; i < data.length; i++) {
- var item = data[i];
- var fileType = item.fileExt;
- var img = 'attach';
- if (fileType.indexOf('doc') >= 0)
- img = 'word';
- else if (fileType.indexOf('xls') >= 0) {
- img = 'excel';
- } else if (fileType.indexOf('zip') >= 0 || fileType.indexOf('rar') >= 0) {
- img = 'zip';
- }
- str += ' <div class="attach"><a href="' + item.filePath + '" title="下载查看" target="_blank"><img src="/Content/Images/attach/' + img + '.png" />' + item.fileTitle + '.' +
- item.fileExt + '</a>';
- if (hasDelete) {
- str += '<span class="iconfont icon-delete1 delete" title="删除附件" onclick="DeleteAttach(this,\'' +
- item.attachNo +
- '\')"></span>';
- }
- str += '</div>';
- }
- }
- str = str ? str : '<div class="attach">暂无附件</div>';
- if (hasDelete) {
- $('.attach-box').html(str);
- } else {
- $('.attach-list').html(str);
- }
- };
- function DeleteAttach(that, attachNo) {
- abp.message.confirm("附件删除后不可恢复,确认删除附件?", "删除附件", function () {
- SaveAjax({
- url: window.appUrl + 'ProductInspect/DeleteAttach?attachNo=' + attachNo,
- data: { attachNo: attachNo },
- isValidate: false,
- success: function () {
- $(that).closest('.attach').remove();
- }
- });
- });
- }
- </script>
- <script>
- function SaveReport(url, isTemplate) {
- $("#reportContent").val($(".report-content").html());
- var data = isTemplate ? { ReportTemplate: $("#reportContent").val() } : GetAttachFilesDate();
- isTemplate = !isTemplate;
- SaveAjax({
- url: url,
- data: data,
- isValidate: isTemplate,
- success: function () {
- $("#modal").modal('hide');
- RefreshTable();
- }
- });
- }
- function GetOldReport(productNo, isQuery) {
- SaveAjax({
- url: window.appUrl + 'ProductInspect/QueryReport?no=' + productNo + '&isProduct=1',
- data: {
- no: productNo,
- isProduct: 1
- },
- isValidate: false,
- isAlert: false,
- success: function (res) {
- if (res) {
- $("#reportContent").val(res);
- $(".report-content").html(res);
- if (!isQuery) {
- $(".report-content td.td-input").off('click.report').on('click.report',
- function tdClick() {
- var $that = $(this);
- $that.off('click.report');
- var text = $(this).text();
- var $input = $('<input type="text"/ class="edit-input"/> ');
- $that.text('');
- $that.append($input);
- $input.focus().val(text);
- $input.on('blur',
- function (e) {
- e.preventDefault();
- e.stopPropagation();
- $(this).parent('td.td-input').text($(this).val());
- $(this).remove();
- $that.on('click.report', tdClick);
- });
- });
- }
- }
- }
- });
- }
- </script>
- <script id="">
- function InspectResultFormatter(v) {
- var name = $("#hide-inspectResult option[value='" + v + "']").text();
- if (v === 0) {
- return '<span class="label label-danger">' + name + '</span>';
- } else {
- return '<span class="label label-success">' + name + '</span>';
- }
- }
- function ConfirmStatusFormatter(v) {
- var name = $("#hide-confirmStatus option[value='" + v + "']").text();
- if (v === 1) {
- return '<span class="label label-danger">' + name + '</span>';
- } else {
- return '<span class="label label-success">' + name + '</span>';
- }
- }
- </script>
- }
|