| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> |
| | | <!--<ul class="layui-tab-title"> |
| | | <li class="layui-this">åºæ¬ä¿¡æ¯</li>--> |
| | | <!--<li>å
¶ä»ä¿¡æ¯</li>--> |
| | | <!--</ul>--> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">åºæ¬ä¿¡æ¯</li> |
| | | <li>éä»¶ä¿¡æ¯</li> |
| | | <li>å¶åä¿¡æ¯</li> |
| | | </ul> |
| | | <h1 style="text-align: center; padding: 10px 0;"><b>设å¤ä¿å
»è®°å½å</b></h1> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æç»ç»è®º</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="radio" name="HLastResult" id="HLastResult" value="OK" title="OK" checked> |
| | | <input type="radio" name="HLastResult" id="HLastResult" value="NG" title="NG"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--éä»¶ä¿¡æ¯--> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item" style="padding-top: 10px;"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn" id="testList">éæ©æä»¶</button><input class="layui-upload-file" type="file" accept="" name="file" multiple=""> |
| | | <div class="layui-upload-list"> |
| | | <table class="layui-table" lay-filter="fileTable"> |
| | | <thead> |
| | | <tr> |
| | | <th>æä»¶å</th> |
| | | <th>å¾ç</th> |
| | | <th>大å°</th> |
| | | <th>ç¶æ</th> |
| | | <th>æä½</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="ProImgByList" class="ProImgByList"> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--å¶åä¿¡æ¯--> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å¶å人</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å®¡æ ¸äºº</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å
³é人</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä¿®æ¹äºº</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å¶åæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å®¡æ ¸æ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å
³éæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä¿®æ¹æ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä½åºäºº</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä½åºæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script> |
| | | <script src="../../layuiadmin/Scripts/webConfig.js"></script> |
| | | <script src="../../layuiadmin/PubCustom.js"></script> |
| | | <script src="../../layuiadmin/zgqCustom/zgqCustom.js"></script> |
| | | <script> |
| | | var OptionData = []; |
| | | //è·ååæ° |
| | |
| | | base: '../../layuiadmin/' //éæèµæºæå¨è·¯å¾ |
| | | }).extend({ |
| | | index: 'lib/index' //主å
¥å£æ¨¡å |
| | | }).use(['index', 'form', 'laydate', 'table', 'element'], function () { |
| | | }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () { |
| | | //#region å
Œ
±åé |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , laydate = layui.laydate |
| | | , upload = layui.upload |
| | | , element = layui.element; |
| | | //æ¥è¯¢æ¡ä»¶ |
| | | var option = [];//ä¿å
» |
| | |
| | | //夿æä½ç±»å |
| | | if (OperationType == 1) {//æ æºæ°å¢ |
| | | set_AddFNew(); |
| | | //æä»¶éæ©åå§å |
| | | PicUpload(); |
| | | } |
| | | else if (OperationType == 3) {//ç¼è¾ |
| | | set_EditFromGrid(linterid); |
| | | //æä»¶éæ©åå§å |
| | | PicUpload(); |
| | | getFile(); |
| | | } |
| | | else { |
| | | layer.alert("æªç¥æä½ç±»åï¼", { icon: 5 }); |
| | |
| | | set_GridCellCheck1(obj); //è¡å
å¿«æ·é®çé |
| | | }); |
| | | |
| | | //è¡éæ©å¤çï¼ç¹æ£ç»æï¼ |
| | | form.on('select(HMaintainResult)', function (data) { |
| | | //è·å䏿æ¡éä¸çå¼ |
| | | var elem = data.othis.parents('tr'); |
| | | var dataindex = elem.attr("data-index"); |
| | | $.each(option.data, function (index, value) { |
| | | if (value.LAY_TABLE_INDEX == dataindex) { |
| | | value.HMaintainResult = data.value;//æéä¸ä¸ææ¡idå¼èµå¼ç»è¡¨æ ¼ç¼å |
| | | } |
| | | }); |
| | | |
| | | console.log(table.cache['mainTable']); |
| | | |
| | | var HQty = 0;//表ä½è¡ä¸åæ ¼æ°é |
| | | for (let i = 0; i < table.cache['mainTable'].length; i++) { |
| | | if (table.cache['mainTable'][i].HMaintainResult == "X") { |
| | | HQty++; |
| | | } |
| | | } |
| | | if (HQty > 0) { |
| | | document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } else { |
| | | document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } |
| | | form.render('radio'); |
| | | }); |
| | | |
| | | //表头信æ¯è®¾å¤å¼¹çª |
| | | form.on('submit(ProductModulList)', function () { |
| | | //页é¢å±-èªå®ä¹ |
| | |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true |
| | | , content: ['../设å¤ç®¡ç/è®¾å¤æ¡£æ¡/Gy_EquipFileMainList.html', 'yes'] |
| | | , content: ['../设å¤ç®¡ç/è®¾å¤æ¡£æ¡/Gy_EquipFileMainList.html?openType=2', 'yes'] |
| | | , btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | //æé®ãæé®ä¸ãçåè° |
| | |
| | | shift: 2, |
| | | area: ['90%', '90%'], |
| | | maxmin: true, |
| | | content: ['../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Gy_MaintainLev.html', 'yes'], |
| | | content: ['../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Gy_MaintainLev.html?openType=2', 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | |
| | |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../设å¤ç®¡ç/设å¤è§ç¨å/Sb_EquipMaintainRuleList.html', 'yes'], |
| | | content: ['../设å¤ç®¡ç/设å¤è§ç¨å/Sb_EquipMaintainRuleList.html?openType=2', 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | //æé®ãæé®ä¸ãçåè° |
| | |
| | | var rowdate1 = layui.table.cache["mainTable"]; |
| | | var rowdate2 = layui.table.cache["mainTable1"]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y"}]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y" }]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | |
| | |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | | table.reload("mainTable", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | option.data = buttonArr; |
| | | table.render(option); |
| | | //table.reload("mainTable", { |
| | | // data: option.data //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | //}) |
| | | } |
| | | |
| | | |
| | |
| | | }; |
| | | buttonArr.push(checkrow); //å°ä¹åçæ°æ®åå¨ |
| | | } |
| | | table.reload("mainTable1", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | option1.data = buttonArr; |
| | | table.render(option1); |
| | | //table.reload("mainTable1", { |
| | | // data: option1.data //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | //}) |
| | | } |
| | | |
| | | } else { |
| | |
| | | var rowdate1 = layui.table.cache["mainTable"]; |
| | | var rowdate2 = layui.table.cache["mainTable1"]; |
| | | option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y"}]; |
| | | option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "", "HMaintainResult": "Y" }]; |
| | | table.render(option); |
| | | table.render(option1); |
| | | |
| | |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../设å¤ç®¡ç/Sb_EquipMaintainPlanBillList.html', 'yes'], |
| | | content: ['../设å¤ç®¡ç/Sb_EquipMaintainPlanBillList.html?openType=2', 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | //æé®ãæé®ä¸ãçåè° |
| | |
| | | data: { |
| | | "HID": linterid |
| | | }, |
| | | async: false, |
| | | success: function (result) { |
| | | //console.log(result.code) |
| | | if (result.code == 1) { // 说æéªè¯æåäºï¼ |
| | | //console.log(result) |
| | | var data = result.data.h_v_Sb_EquipMaintainBillList[0]; |
| | | var data = result.data.h_v_Sb_EquipMaintainBill_Edit[0]; |
| | | form.val("component-form-group", { //formTest å³ class="layui-form" æå¨å
ç´ å±æ§ lay-filter="" 对åºçå¼ |
| | | "HBillNo": data.åæ®å· |
| | | , "HDate": formatDate(data.æ¥æ) |
| | |
| | | , "HEquipMaintainRuleInterNo": data.设å¤ä¿å
»è§ç¨ //夿³¨ |
| | | , "HMaintainLevID": data.HMaintainLevID |
| | | , "HMaintainLevName": data.ä¿å
»çº§å«åç§° |
| | | , "HMaker": data.å¶å人 |
| | | , "HMakeDate": data.å¶åæ¥æ == null ? "" : Format(new Date(data.å¶åæ¥æ), "yyyy-MM-dd") |
| | | , "HChecker": data.å®¡æ ¸äºº |
| | | , "HCheckDate": data.å®¡æ ¸æ¥æ == null ? "" : Format(new Date(data.å®¡æ ¸æ¥æ), "yyyy-MM-dd") |
| | | , "HUpDater": data.ä¿®æ¹äºº |
| | | , "HUpDateDate": data.ä¿®æ¹æ¥æ == null ? "" : Format(new Date(data.ä¿®æ¹æ¥æ), "yyyy-MM-dd") |
| | | , "HCloseMan": data.å
³é人 |
| | | , "HCloseDate": data.å
³éæ¥æ == null ? "" : Format(new Date(data.å
³éæ¥æ), "yyyy-MM-dd") |
| | | , "HDeleteMan": data.ä½åºäºº |
| | | , "HDeleteDate": data.ä½åºæ¥æ == null ? "" : Format(new Date(data.ä½åºæ¥æ), "yyyy-MM-dd") |
| | | }); |
| | | |
| | | if (data.æç»ç»è®º == "ä¸åæ ¼") { |
| | | document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } else { |
| | | document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //å é¤éæ©å±æ§ |
| | | $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //æ·»å 鿩屿§ |
| | | } |
| | | form.render('radio'); |
| | | |
| | | } else { |
| | | layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | |
| | | //console.log('gouba' + result); |
| | | if (result.count == 1) { |
| | | option.data = result.list[0]; |
| | | for (let i = 0; i < option.data.length; i++) { |
| | | if (option.data[i].HMaintainResult == "åæ ¼") { |
| | | option.data[i].HMaintainResult = "Y"; |
| | | } else { |
| | | option.data[i].HMaintainResult = "X"; |
| | | } |
| | | } |
| | | table.render(option); |
| | | option1.data = result.list[1]; |
| | | table.render(option1); |
| | | |
| | | for (let j = 0; j < result.list.length; j++) { |
| | | $("#HMaintainResult" + (j + 1)).val(result.list[j].ä¿å
»ç»æ == "åæ ¼" ? 'Y' : 'X') |
| | | for (let j = 0; j < result.list[0].length; j++) { |
| | | $("#HMaintainResult" + (j + 1)).val(result.list[0][j].HMaintainResult == "åæ ¼" ? 'Y' : (result.list[0][j].HMaintainResult == 'Y' ? 'Y' : 'X')) |
| | | } |
| | | form.render('select'); |
| | | } else { |
| | |
| | | } |
| | | //å¢å ä¸è¡ |
| | | function btnAddLine(NewRow) { |
| | | var tableBak = table.cache["mainTable"]; //è·åä¹åç¼è¾è¿çè¡¨æ ¼æ°æ® |
| | | buttonArr = [];//æ¸
空æ°ç» |
| | | for (var i = 0; i < tableBak.length; i++) { |
| | | buttonArr.push(tableBak[i]); //å°ä¹åçæ°æ®åå¨ |
| | | table.cache["mainTable"].push(NewRow); |
| | | option.data = table.cache["mainTable"]; |
| | | table.render(option); |
| | | |
| | | for (var i = 1; i <= option.data.length; i++) { |
| | | $('#HMaintainResult' + i + '').find("option[value='" + option.data[i - 1].HMaintainResult + "']").attr("selected", true); |
| | | } |
| | | buttonArr.push(NewRow); //å¨å°¾é¨å ä¸è¡ |
| | | table.reload("mainTable", { |
| | | data: buttonArr //å°æ°æ®éæ°è½½å
¥è¡¨æ ¼ |
| | | }) |
| | | form.render('select'); |
| | | } |
| | | //å¢å ä¸è¡1 |
| | | function btnAddLine1(NewRow) { |
| | |
| | | table.cache["mainTable"].push(JSON.parse(copyrow));//å°å¤å¶çè¡å¼ºè½¬æjson追å å°è¡¨æ ¼ä¸ |
| | | option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ |
| | | table.render(option);//å°æ°æ®æ¸²æå°è¡¨æ ¼ä¸ |
| | | |
| | | for (var i = 1; i <= option.data.length; i++) { |
| | | $('#HMaintainResult' + i + '').find("option[value='" + option.data[i - 1].HMaintainResult + "']").attr("selected", true); |
| | | } |
| | | form.render('select'); |
| | | } |
| | | } |
| | | //å¤å¶ä¸è¡1 |
| | |
| | | layer.alert(sMsg, { icon: 5 }); |
| | | |
| | | } |
| | | |
| | | //#region æä»¶ä¸ä¼ |
| | | function PicUpload() { |
| | | //å¤å¾çä¸ä¼ |
| | | //夿件åè¡¨ç¤ºä¾ |
| | | var ProImgByList = $('#ProImgByList') |
| | | , uploadListIns = upload.render({ |
| | | elem: '#testList' |
| | | |
| | | , url: GetWEBURL() + "/Sb_EquipMaintainBill/UploadFile" |
| | | , accept: 'file' |
| | | , multiple: true |
| | | , auto: false |
| | | //, bindAction: '#testListAction' //ææç»å® |
| | | , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] } |
| | | , choose: function (obj) { |
| | | var files = this.files = obj.pushFile(); //å°æ¯æ¬¡éæ©çæä»¶è¿½å å°æä»¶éå |
| | | //è¯»åæ¬å°æä»¶ |
| | | obj.preview(function (index, file, result) { |
| | | var tr = $(['<tr id="upload-' + index + '">' |
| | | , '<td>' + file.name + '</td>' |
| | | , '<td>' + '<img onclick=\"previewImg(this)\" id="showImg" class="ImgClass" style="width: 150px; margin:10px;cursor:pointer;"src="' + result + '" alt="' + file.name + '">' + '</td>' |
| | | , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>' |
| | | , '<td>çå¾
ä¸ä¼ </td>' |
| | | , '<td>' |
| | | , '<button class="layui-btn layui-btn-xs demo-reload ">ä¸ä¼ </button>' |
| | | , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">å é¤</button>' |
| | | , '</td>' |
| | | , '</tr>'].join('')); |
| | | |
| | | |
| | | //å个éä¼ |
| | | tr.find('.demo-reload').on('click', function () { |
| | | obj.upload(index, file); |
| | | return false; |
| | | }); |
| | | |
| | | //å é¤ |
| | | tr.find('.demo-delete').on('click', function () { |
| | | delete files[index]; //å é¤å¯¹åºçæä»¶ |
| | | tr.remove(); |
| | | uploadListIns.config.elem.next()[0].value = ''; //æ¸
空 input file å¼ï¼ä»¥å
å é¤ååºç°ååæä»¶ä¸å¯é |
| | | }); |
| | | |
| | | ProImgByList.append(tr); |
| | | |
| | | }); |
| | | } |
| | | , done: function (res, index, upload) { |
| | | if (res.code == 1) { //ä¸ä¼ æå |
| | | var tr = ProImgByList.find('tr#upload-' + index) |
| | | , tds = tr.children(); |
| | | tds.eq(3).html('<span style="color: #5FB878;">ä¸ä¼ æå</span>'); |
| | | tds.eq(4).html(''); //æ¸
空æä½ |
| | | |
| | | return delete this.files[index]; //å 餿件éåå·²ç»ä¸ä¼ æåçæä»¶ |
| | | } |
| | | this.error(index, upload); |
| | | } |
| | | , error: function (index, upload) { |
| | | var tr = ProImgByList.find('tr#upload-' + index) |
| | | , tds = tr.children(); |
| | | tds.eq(2).html('<span style="color: #FF5722;">ä¸ä¼ 失败[æ£æ¥æä»¶ååæä»¶æ ¼å¼]</span>'); |
| | | tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //æ¾ç¤ºä¸ä¼ |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region ç¼è¾æ¶,è·åå·²ä¸ä¼ çæä»¶å表 |
| | | function getFile() { |
| | | var ProImgByList = $('#ProImgByList') |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Sb_EquipMaintainBill/Filelist', |
| | | type: "GET", |
| | | data: { "HBillNo": $("#HBillNo").val() }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var index = 0; |
| | | for (var i = 0; i < data1.data.length; i++) { |
| | | var tr = $(['<tr id="upload-' + i + '">' |
| | | , '<td style="display:none">' + data1.data[i].HItemID + '</td>' |
| | | , '<td style="display:none">' + data1.data[i].HSourceBillNo + '</td>' |
| | | , '<td>' + data1.data[i].HFileName + '</td>' |
| | | , '<td>' + '<img onclick=\"previewImg(this)\" id="showImg' + i + '" class="ImgClass" style="width: 150px; margin:10px;cursor:pointer;"src="' + data1.data[i].HFilePath + '" alt="' + data1.data[i].HFileName + '">' + '</td>' |
| | | , '<td>' + (data1.data[i].HFileSize / 1014).toFixed(1) + 'kb</td>' |
| | | , '<td style="color: #5FB878;">ä¸ä¼ æå</td>' |
| | | , '<td style="display:none">' + data1.data[i].url + '</td>' |
| | | , '<td>' |
| | | , '<button class="layui-btn layui-btn-xs demo-dowload" type="button" id="deltefile" onclick="javascript:dowload(this)"><i class="layui-icon layui-icon-download-circle layuiadmin-button-btn"></i>ä¸è½½</button>' |
| | | , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" type="button" id="deltefile" onclick="javascript:toManager(this)"><i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>å é¤</button>' |
| | | , '</td>' |
| | | , '</tr>'].join('')); |
| | | |
| | | $('#ProImgByList').append(tr); |
| | | } |
| | | |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //#endregion |
| | | }); |
| | | |
| | |
| | | function GetMaterValue(obj) { |
| | | OptionData = obj; |
| | | } |
| | | |
| | | function previewImg(obj) { |
| | | var img = new Image(); |
| | | img.src = obj.src; |
| | | var height = img.height * 1.2; //è·åå¾çé«åº¦ |
| | | var width = img.width * 1.2; //è·åå¾ç宽度 |
| | | var imgHtml = "<img src='" + obj.src + "' width='100%' height='100%'/>"; |
| | | //å¼¹åºå± |
| | | layer.open({ |
| | | type: 1, |
| | | shade: 0.8, |
| | | offset: 'auto', |
| | | area: ['80%', '80%'], |
| | | shadeClose: true, |
| | | scrollbar: false, |
| | | title: "å¾çé¢è§", //䏿¾ç¤ºæ é¢ |
| | | content: imgHtml, //æè·çå
ç´ ï¼æ³¨æï¼æå¥½è¯¥æå®çå
ç´ è¦åæ¾å¨bodyæå¤å±ï¼å¦åå¯è½è¢«å
¶å®çç¸å¯¹å
ç´ æå½±å |
| | | cancel: function () { |
| | | //layer.msg('æè·å°±æ¯ä»é¡µé¢å·²ç»åå¨çå
ç´ ä¸ï¼å
裹layerçç»æ', { time: 5000, icon: 6 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //#region ä¸è½½å·²ä¸ä¼ çæä»¶ |
| | | function dowload(r) { |
| | | //å¾å°å½åæå¨è¡ |
| | | var rows = r.parentNode.parentNode.rowIndex; |
| | | //å¾å°æå¨è¡ç第äºåçå
容:æä»¶å°å |
| | | var url = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(6)").html(); |
| | | /*window.location.href = url;*/ |
| | | window.open(url) |
| | | } |
| | | //#endregion |
| | | |
| | | //#region å é¤å·²ä¸ä¼ çæä»¶ |
| | | function toManager(r) { |
| | | //å¾å°å½åæå¨è¡ |
| | | var rows = r.parentNode.parentNode.rowIndex; |
| | | //å¾å°æå¨è¡ç第ä¸åçå
容:主é®ID |
| | | var HItemID = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(0)").html(); |
| | | //å¾å°æå¨è¡ç第äºåçå
容:åæ®å· |
| | | var HSourceBillNo = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(1)").html(); |
| | | //å¾å°æå¨è¡ç第ä¸åçå
容:æä»¶åç§° |
| | | var HFileName = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(2)").html(); |
| | | layer.confirm("确认è¦å é¤åï¼å é¤åä¸è½æ¢å¤", { title: "å é¤ç¡®è®¤" }, function (index) { |
| | | |
| | | //å é¤å·²ä¸ä¼ æä»¶ |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Sb_EquipMaintainBill/DeleteFilelist', |
| | | type: "GET", |
| | | data: { "HItemID": HItemID, "HSourceBillNo": HSourceBillNo, "HFileName": HFileName }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.alert(data1.Message, { icon: 1 }); |
| | | $("#ProImgByList tr").eq((rows - 1)).remove(); |
| | | } |
| | | else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |