| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">æºåç±»å</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="HSourceBillType" lay-filter="HSourceBillType" id="HSourceBillType"> |
| | | <option value="0" selected="selected">ç产任å¡å</option> |
| | | <option value="1">æå·¥å½å
¥</option> |
| | | <select name="HMainSourceBillType" lay-filter="HMainSourceBillType" id="HMainSourceBillType"> |
| | | <option value="2">ç产任å¡å</option> |
| | | <option value="1" selected="selected">æå·¥å½å
¥</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éåå·</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="HSourceBillNo" id="HSourceBillNo" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HSourceInterID" id="HSourceInterID" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="" style="float:left;width:150px;"> |
| | | <button type="button" lay-submit="" class="layui-btn" lay-filter="XDHList" id="XDHList" style="width:40px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i> |
| | | </button> |
| | |
| | | |
| | | var params = getUrlVars(); |
| | | var hID = params[params[0]];//ç¼è¾æ¥ç |
| | | var Type = params[params[1]] == undefined ? "1" : params[params[1]];//åæ®ç¼è¾ç¶æï¼ 1.æ æºåæ°å¢Â  2.ææºåæ°å¢Â  3.ç¼è¾Â 4.æµè§Â 5.åæ´ |
| | | |
| | | var Sctag = "0"; |
| | | |
| | | layui.config({ |
| | |
| | | , element = layui.element; |
| | | |
| | | |
| | | //å
Œ
±åé |
| | | var option = []; |
| | | |
| | | //常è§ç¨æ³ |
| | | laydate.render({ |
| | | elem: '#HDate' |
| | | |
| | | }); |
| | | //夿æ¯å¦ç»å½ æªç»å½åè·³å°ç»å½é¡µ |
| | | //if (sessionStorage.login != "login") { |
| | | // layer.confirm("ç»å½å¤±æï¼è¯·éæ°ç»å½ï¼", { |
| | | // icon: 4, skin: 'layui-layer-lan', title: "温馨æç¤º", closeBtn: 0, btn: ['éæ°ç»å½'] |
| | | // }, function () { window.location.href = "../../user/login.html"; }); |
| | | //} |
| | | //var tableReload = table.reload; |
| | | var option = { |
| | | id:'mainTable' |
| | | ,elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 500 |
| | | //,url: '/demo/table/user/' //æ°æ®æ¥å£ |
| | | , page: true //å¼å¯å页 |
| | | , cols: [[ //表头 |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe", width: 100 } |
| | | , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HMaterCode', title: 'ç©æä»£ç ', edit: 'text', event: 'HMaterCode', width: 100 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', edit: 'text', width: 100 } |
| | | , { field: 'HMaterSpec', title: 'è§æ ¼åå·', edit: 'text', width: 100 } |
| | | , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HUnitCode', title: 'åä½ä»£ç ', edit: 'text', event: 'HUnitCode', width: 100 } |
| | | , { field: 'HUnitName', title: 'åä½åç§°', edit: 'text', width: 100 } |
| | | , { field: 'HSourceID', title: 'HSourceID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HSourceCode', title: 'èµæºä»£ç ', edit: 'text', event: 'HSourceCode', width: 100 } |
| | | , { field: 'HSourceName', title: 'èµæºåç§°', edit: 'text', width: 100 } |
| | | , { field: 'HWorkerid', title: 'HWorkerid', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HWorkerCode', title: 'æä½å代ç ', edit: 'text', event: 'HWorkerCode', width: 100 } |
| | | , { field: 'HWorkerName', title: 'æä½ååç§°', edit: 'text', width: 100 } |
| | | , { field: 'HQty', title: 'ç产æ°é', edit: 'text', width: 100 } |
| | | , { field: 'HRemark', title: '表ä½å¤æ³¨', edit: 'text', width: 100 } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 150 } |
| | | ]] |
| | | , limit: 500 //æ¯é¡µé»è®¤æ¾ç¤ºçæ°é |
| | | }; |
| | | |
| | | |
| | | //夿æ¯å¦æ°å¢ |
| | | if (hID == null || hID == 0) { |
| | | //åå§å è½½è¡¨æ ¼{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": " ", "HSQProcName": " ","HProcID":0, "HZRProcName": " ", "HMRBChecker": " ", "HRemark": " ", "HPSProcName": " ", "HCloseMan": " " } |
| | | option.data = [TabRow]; |
| | | table.render(option); |
| | | } |
| | | else { |
| | | $("#HInterID").val(hID);//ä¿®æ¹æ¶ä¸»è¡¨ID |
| | | //ç¼è¾å è½½æ°æ® |
| | | $.ajax({ |
| | | url: GetWEBURL() + 'Sc_ICMOReportBill/Sc_ICMOReportBillListProjectDetai', |
| | | type: "GET", |
| | | data: { "sqlWhere": "and hmainid=" + hID }, |
| | | success: function (result) { |
| | | //console.log(result); |
| | | //console.log('gouba' + result); |
| | | if (result.count == 1) { |
| | | option.data = result.data; |
| | | table.render(option); |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(index0); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | //åå§å表åæä»¶ |
| | | set_InitFrom(); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var rowid = 0; |
| | | var rows = 0; |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data;; |
| | | var AddRow = table.cache['mainTable']; |
| | | var NewRow = TabRow; |
| | | switch (obj.event) { |
| | | case 'btn-AddLine': |
| | | //table.cache["mainTable"].push(AddRow[rows]); |
| | | case 'btn-AddLine': btnAddLine(NewRow); |
| | | break; |
| | | case 'btn-CopyLine': btnCopyLine(data); |
| | | |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | //è¡å
äºä»¶ |
| | | table.on('tool(mainTable)', function (obj) { |
| | | set_GridDelete(obj); //è¡å
å é¤ |
| | | set_GridCellCheck(obj); //è¡å
å¿«æ·é®çé |
| | | }); |
| | | |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | |
| | | //å¤ææ¯æºåæ°å¢ãæ æºåæ°å¢ãç¼è¾ |
| | | set_Type(Type); |
| | | |
| | | //夿æ¯å¦æºåæ°å¢ãæè
ç¼è¾ |
| | | set_CheckSelect(); |
| | | |
| | | |
| | | //åå§å表å |
| | | function set_InitFrom() { |
| | | laydate.render({ |
| | | elem: '#HDate' |
| | | |
| | | }); |
| | | } |
| | | |
| | | //è¡¨æ ¼å¢å è¡äºä»¶ |
| | | function btnAddLine(NewRow) { |
| | | table.cache["mainTable"].push(NewRow); |
| | | option.data = table.cache["mainTable"]; |
| | | table.render(option); |
| | | rows++; |
| | | layer.msg('å¢å ä¸è¡æé®ï¼') |
| | | break; |
| | | case 'btn-CopyLine': |
| | | } |
| | | |
| | | //è¡¨æ ¼å¤å¶è¡äºä»¶ |
| | | function btnCopyLine(data) { |
| | | var copydata = JSON.stringify(data); |
| | | if (data.length <= 0) { |
| | | layer.alert("è¯·éæ©éè¦å¤å¶çä¸è¡ï¼"); |
| | |
| | | table.cache["mainTable"].push(JSON.parse(copyrow));//å°å¤å¶çè¡å¼ºè½¬æjson追å å°è¡¨æ ¼ä¸ |
| | | option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ |
| | | table.render(option);//å°æ°æ®æ¸²æå°è¡¨æ ¼ä¸ |
| | | //layer.alert(copyrow); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | //è¡å
äºä»¶ |
| | | table.on('tool(mainTable)', function (obj) { |
| | | |
| | | //è¡¨æ ¼è¡å
äºä»¶å é¤ |
| | | function set_GridDelete(obj) { |
| | | var data = obj.data; |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | if (obj.event === 'del') { |
| | |
| | | option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ |
| | | table.reload(option); |
| | | layer.close(index); |
| | | //obj.del(); |
| | | //layer.close(index); |
| | | |
| | | //var oldData = table.cache["mainTable"]; |
| | | //oldData.splice(obj.tr.data('index'), 1); |
| | | //table.reload('mainTable', { data: oldData }); |
| | | //layer.close(index); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //è¡¨æ ¼è¡å
äºä»¶å¿«æ·é®çé |
| | | function set_GridCellCheck(obj) { |
| | | $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { |
| | | if (event.key == "F7") { |
| | | if (obj.event === 'HMaterCode') //ç©æä¿¡æ¯ |
| | |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //åå§åè¡¨æ ¼ |
| | | function set_InitGrid() { |
| | | var columns = [ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe", width: 100 } |
| | | , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HMaterCode', title: 'ç©æä»£ç ', edit: 'text', event: 'HMaterCode', width: 100 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', edit: 'text', width: 100 } |
| | | , { field: 'HMaterSpec', title: 'è§æ ¼åå·', edit: 'text', width: 100 } |
| | | , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HUnitCode', title: 'åä½ä»£ç ', edit: 'text', event: 'HUnitCode', width: 100 } |
| | | , { field: 'HUnitName', title: 'åä½åç§°', edit: 'text', width: 100 } |
| | | , { field: 'HSourceID', title: 'HSourceID', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HSourceCode', title: 'èµæºä»£ç ', edit: 'text', event: 'HSourceCode', width: 100 } |
| | | , { field: 'HSourceName', title: 'èµæºåç§°', edit: 'text', width: 100 } |
| | | , { field: 'HWorkerid', title: 'HWorkerid', edit: 'text', width: 100, hide: true } |
| | | , { field: 'HWorkerCode', title: 'æä½å代ç ', edit: 'text', event: 'HWorkerCode', width: 100 } |
| | | , { field: 'HWorkerName', title: 'æä½ååç§°', edit: 'text', width: 100 } |
| | | , { field: 'HQty', title: 'ç产æ°é', edit: 'text', width: 100 } |
| | | , { field: 'HRemark', title: '表ä½å¤æ³¨', edit: 'text', width: 100 } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 150 } |
| | | ]; |
| | | option = { |
| | | id: 'mainTable' |
| | | , elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , page: false |
| | | , cellMinWidth: 120 |
| | | , height: 500 |
| | | , cols: [columns] |
| | | , done: function (res, curr, count) { |
| | | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | //è·åæå¤§åæ®å· |
| | | function set_MAXNum() { |
| | | var date = new Date(); |
| | | var day = date.getDate(); |
| | | var month = date.getMonth() + 1; |
| | | var year = date.getFullYear(); |
| | | var shijian = year + "-" + month + "-" + day; |
| | | |
| | | //è·åæå¤§åæ®å· new |
| | | $("#HInterID").val("0"); |
| | | $("#HBillNo").val(""); |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Web/GetMAXNum", |
| | | type: "GET", |
| | | data: { "HBillType": '3711' }, |
| | | success: function (d) { |
| | | //console.log(d.data); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HDate").val(shijian); |
| | | $("#HInterID").val(0); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //å¤ææ¯æºåæ°å¢ãæ æºåæ°å¢ãç¼è¾ |
| | | function set_Type(Type) { |
| | | console.log(Type); |
| | | switch (Type) { |
| | | //æ æºåæ°å¢ |
| | | case '1': set_AddFNew(); |
| | | break; |
| | | //ææºåæ°å¢Â  |
| | | case '2': set_AddNew(); |
| | | break; |
| | | //ç¼è¾Â |
| | | case '3': set_EditFromGrid(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function RoadBillMain(hID)//å 载表头 |
| | | //æ æºåæ°å¢ |
| | | function set_AddFNew() |
| | | { |
| | | |
| | | //è·åæå¤§åæ®å· |
| | | set_MAXNum(); |
| | | $('#HMainSourceBillNo').attr("disabled", false); |
| | | $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true); |
| | | option.data = [TabRow]; |
| | | table.render(option); |
| | | } |
| | | |
| | | //ææºåæ°å¢ |
| | | function set_AddNew() { |
| | | //è·åæå¤§åæ®å· |
| | | set_MAXNum(); |
| | | option.data = [TabRow]; |
| | | table.render(option); |
| | | } |
| | | |
| | | //ç¼è¾è·å表头ãè·åè¡¨ä½ |
| | | function set_EditFromGrid() { |
| | | set_EditForm(hID); //ç¼è¾è·å表头 |
| | | set_EditGrid(hID); //ç¼è¾è·åè¡¨ä½ |
| | | option.data = [TabRow]; |
| | | table.render(option); |
| | | } |
| | | |
| | | //ç¼è¾è·å表头 |
| | | function set_EditForm(hID) { |
| | | |
| | | //æ¥è¯¢æ£éªæ¹æ¡åæ¯å¦åå¨ |
| | | $.ajax({ |
| | |
| | | , "HGroupName": data.çç» //çç»åç§° |
| | | , "HEmpID": data.HEmpID //ç»è®¡åID |
| | | , "HEmpName": data.ç»è®¡å //ç»è®¡ååç§° |
| | | , "HSourceBillType": "" //æºåç±»å |
| | | , "XDH": "" //éåå· |
| | | , "HMainSourceBillNo": data.HMainSourceBillNo |
| | | , "HMainSourceInterID": data.HMainSourceInterID |
| | | , "HMainSourceEntryID": data.HMainSourceEntryID |
| | | , "HExplanation": "" //æè¦ |
| | | , "HRemark": data.è¡¨å¤´å¤æ³¨ //夿³¨ |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | var date = new Date(); |
| | | var day = date.getDate(); |
| | | var month = date.getMonth() + 1; |
| | | var year = date.getFullYear(); |
| | | var shijian = year + "-" + month + "-" + day; |
| | | |
| | | //夿æ¯å¦æ°å¢ |
| | | if (hID == null || hID == 0) { |
| | | //è·åæå¤§åæ®å· new |
| | | $("#HInterID").val("0"); |
| | | $("#HBillNo").val(""); |
| | | //ç¼è¾è·åè¡¨ä½ |
| | | function set_EditGrid(hID) { |
| | | $("#HInterID").val(hID);//ä¿®æ¹æ¶ä¸»è¡¨ID |
| | | //ç¼è¾å è½½æ°æ® |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Web/GetMAXNum", |
| | | url: GetWEBURL() + 'Sc_ICMOReportBill/Sc_ICMOReportBillListProjectDetai', |
| | | type: "GET", |
| | | data: { "HBillType": '3711' }, |
| | | success: function (d) { |
| | | //console.log(d.data); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HDate").val(shijian); |
| | | $("#HInterID").val(0); |
| | | data: { "sqlWhere": "and hmainid=" + hID }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | option.data = result.data; |
| | | table.render(option); |
| | | |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(index0); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | else {//å¦æä¿®æ¹åèµ°ä¸é¢ new |
| | | RoadBillMain(hID); |
| | | /* RoadBillSub(linterid);*/ |
| | | } |
| | | |
| | | |
| | | //çè§ä¸ææ¡æ¯å¦æºå |
| | | function set_CheckSelect() { |
| | | //è·å䏿éä¸å¼ |
| | | form.on('select(HSourceBillType)', function (data) { |
| | | form.on('select(HMainSourceBillType)', function (data) { |
| | | Sctag = data.value; |
| | | form.render('select'); |
| | | if (Sctag != "0") { |
| | | switch (Sctag) { |
| | | //æ æºåæ°å¢ |
| | | case '1': |
| | | $("#HMainSourceInterID").val("0"); |
| | | $("#HMainSourceEntryID").val("0"); |
| | | $('#HMainSourceBillNo').attr("disabled", false); |
| | | $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true); |
| | | } |
| | | else { |
| | | Type = 1; |
| | | break; |
| | | //ææºåæ°å¢Â  |
| | | case '2': |
| | | $("#HMainSourceInterID").val("0"); |
| | | $("#HMainSourceEntryID").val("0"); |
| | | $('#HMainSourceBillNo').attr("disabled", true); |
| | | $('#XDHList').removeClass("layui-btn-disabled").attr("disabled", false); |
| | | Type = 2; |
| | | break; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | //表头信æ¯è½¦é´å¼¹çª |
| | |
| | | //var rowIndex = $("#mainTable").find("tbody tr").attr('data-index');//å½åè¡çç´¢å¼ |
| | | //$(".layui-table-view .layui-table tbody tr[data-index=" + 1+ "]").remove(); |
| | | |
| | | $("#HSourceBillNo").val(checkStatus.data[0].åæ®å·); |
| | | $("#HSourceInterID").val(checkStatus.data[0].hmainid); |
| | | $("#HSourceEntryID").val(checkStatus.data[0].HEntryID); |
| | | $("#HMainSourceBillNo").val(checkStatus.data[0].åæ®å·); |
| | | $("#HMainSourceInterID").val(checkStatus.data[0].hmainid); |
| | | $("#HMainSourceEntryID").val(checkStatus.data[0].HEntryID); |
| | | var list = []; |
| | | for (var i = 0; i <checkStatus.data.length; i++) { |
| | | list.push(checkStatus.data[i].åæ®å·) |
| | | } |
| | | if (isAllEqual(list)) //ç¸ååå· |
| | | { |
| | | if (checkStatus.data.length>1) |
| | | { |
| | | console.log(checkStatus.data); |
| | | if (checkStatus.data.length > 1) { |
| | | for (var i = 0; i < checkStatus.data.length-1; i++) //è¡¥è¡ |
| | | { |
| | | //var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HRemark": "" }; |
| | |
| | | } |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | else |
| | | { |
| | | else { |
| | | layer.msg("è¯·éæ©ç¸ååå·!", { time: 1 * 2000, icon: 5 }); |
| | | } |
| | | |
| | |
| | | }); |
| | | |
| | | |
| | | |
| | | //éåº |
| | | form.on('submit(Exit)', function (data) {// |
| | | var index = parent.layer.getFrameIndex(window.name); //å
å¾å°å½åiframeå±çç´¢å¼ |
| | | parent.layer.close(index); //åæ§è¡å
³é |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | form.on('submit(Cancel)', function () { |
| | | //sessionStorage["SourceFlag"] = false; |
| | | parent.location.href = "../../../views/index.html" |
| | | //window.close();//å
³éå½å页 |
| | | }) |
| | | |
| | | //ç¼è¾è·åè¡¨ä½æ¶æ¶é´æ ¼å¼ç«æ£æ¹å¼ |
| | | function formatDate(date) { |
| | | var d = new Date(date), |
| | | month = '' + (d.getMonth() + 1), |
| | |
| | | return [year, month, day].join('-'); |
| | | } |
| | | |
| | | //æäº¤ä¿å |
| | | form.on('submit(Saver)', function (data) {//ä¿å |
| | | var refSav = ""; |
| | | if (hID == "" || hID == null) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | |
| | | }); |
| | | } |
| | | else { |
| | | |
| | | f_alert(data.Message); |
| | | console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable)); |
| | | layer.alert(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | |
| | | f_alert("é误:" + err); |
| | | console.log("Reason" + sMainStr); |
| | | layer.alert(err.Message, { icon: 5 }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | function f_alert(sMsg) { |
| | | layer.alert(sMsg, { icon: 5 }); |
| | | |
| | | } |
| | | |
| | | //çå¬æäº¤ |
| | | form.verify({ |
| | | numberOrEmpty: function (value, item) { |
| | | // if (value != '') { |
| | | if (!/^\d+$/.test(value)) { |
| | | return 'ä¸è½ä¸ºç©ºææ°åæè
0'; |
| | | } |
| | | //} |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | |
| | | }); |
| | | //夿æ°ç»ä¸ç弿¯å¦ç¸å |
| | | //夿æºåå¸¦åæ°æ®æ°ç»ä¸ç弿¯å¦ç¸å |
| | | function isAllEqual(array) { |
| | | if (array.length > 0) { |
| | | return !array.some(function (value, index) { |
| | |
| | | } |
| | | } |
| | | |
| | | //å®ä¹å
¨å±åé |
| | | var HReasonName, ReasonID, EmpName, SQProcName, |
| | | ProcID, ZRProcName, QRName |
| | | ; |
| | | function GetHReasonValue(obj) //è¿åä¸è¯åå |
| | | { |
| | | HReasonName = obj[0].HName; |
| | | ReasonID = obj[0].HItemID; |
| | | } |
| | | //è¿åç©æ |
| | | function GetHMaterNameValue(obj) { //è¿åç©æ |
| | | $("#HMater").val(obj[0].HName); |
| | | $("#HMaterID").val(obj[0].HItemID); |
| | | $("#HMaterNumber").val(obj[0].HNumber); |
| | | } |
| | | //è¿åå·¥åº |
| | | function GetHProcValue(obj) { //è¿åå·¥åº |
| | | $("#HProcName").val(obj[0].å·¥åº); |
| | | $("#HProcID").val(obj[0].HItemID); |
| | | $("#HProcNumber").val(obj[0].å·¥åºä»£ç ); |
| | | } |
| | | function GetHDeptNameValue(obj) { //è¿åé¨é¨ |
| | | $("#HDepName").val(obj[0].HName); |
| | | $("#HDeptID").val(obj[0].HItemID); |
| | | $("#HDeptNumber").val(obj[0].HNumber); |
| | | } |
| | | //è¿ååä½ |
| | | function GetHUnitNameValue(obj) { |
| | | $("#HUName").val(obj[0].HName); |
| | | $("#HUnitID").val(obj[0].HItemID); |
| | | $("#HUnitNumber").val(obj[0].HNumber); |
| | | } |
| | | |
| | | function GetHKeeperValue(obj) { //è¿å责任人 |
| | | EmpName = obj[0].HName; |
| | | // $("#HEmpName").val(obj[0].HName); |
| | | //$("#HItemID").val(obj[0].HItemID); |
| | | } |
| | | //function GetHProcValue(obj) { //è¿åç³è¯·å·¥åº |
| | | // SQProcName = obj[0].å·¥åº; |
| | | // ProcID = obj[0].HItemID; |
| | | // //$("#HSQProcName").val(obj[0].å·¥åº); |
| | | // //$("#HProcID").val(obj[0].HItemID); |
| | | //} |
| | | function GetHZRValue(obj) { //è¿åè´£ä»»å·¥åº |
| | | ZRProcName = obj[0].å·¥åº; |
| | | //$("#HZRProcName").val(obj[0].å·¥åº); |
| | | //$("#HItemID").val(obj[0].HItemID); |
| | | } |
| | | //HWorker |
| | | function GetHWorkerValue(obj) { //è¿åä¸è¯ç¡®è®¤äºº |
| | | QRName = obj[0].HName; |
| | | //$("#HQRName").val(obj[0].HName); |
| | | //$("#HItemID").val(obj[0].HItemID); |
| | | } |
| | | |
| | | function AllowLoadData(sSubStr) { //é空éªè¯ |
| | | var Result = true; |
| | | if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null) { |