| | |
| | | , form = layui.form |
| | | , element = layui.element; |
| | | var sBillType = '1201' |
| | | var option = {}; |
| | | //æ¸
空çé¢ new |
| | | |
| | | //卿å è½½æºåç±»åå表 new |
| | |
| | | //å·æ° |
| | | form.on('submit(cmdRefresh)', function () {// |
| | | var sBillType = '1201' |
| | | //卿å-å·æ°ç¼åå表 |
| | | table.render(option); |
| | | table.render({ |
| | | elem: '#dj-table' |
| | | , url: GetWEBURL() + '/Web/DisBillEntryList_Mate_Webs_Json' |
| | | elem: '#yd-table' |
| | | , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json' |
| | | , toolbar: '#toolbarDemo' |
| | | , where: { HBillType: sBillType, sWhere: '' } |
| | | , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] } |
| | | , page: true // å¼å¯å页 |
| | | , limits: [20, 40, 80, 100] |
| | | , limit: 20 |
| | | , cols: [[ |
| | | { type: 'radio' } |
| | | , { field: 'HInterID', title: 'åæ®å
ç ', width: 120 } |
| | | , { field: 'HBillNo', title: 'åæ®å·', width: 150 } |
| | | , { field: 'HMaker', title: 'å¶å人', width: 120 } |
| | | , { field: 'HMakeDate', title: 'å¶åæ¥æ', width: 150 } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ', width: 150 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 150 } |
| | | , { field: 'HMaterModel', title: 'è§æ ¼åå·', width: 150 } |
| | | , { field: 'HQty', title: 'æ°é', width: 100 } |
| | | , { field: 'HSourceBillNo', title: 'æºååå·', width: 150 } |
| | | , { field: 'HRedBlueFlag', title: '红èå', width: 120 } |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100 } |
| | | , { field: 'HOrgID', title: 'ç»ç»', width: 120 } |
| | | ]] |
| | | , height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | | , height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | | }) |
| | | }); |
| | | table.render({ |
| | | elem: '#yd-table' |
| | | , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json' |
| | | , toolbar: '#toolbarDemo' |
| | | , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] } |
| | | , page: true // å¼å¯å页 |
| | | , limits: [20, 40, 80, 100] |
| | | , limit: 20 |
| | | , cols: [[ |
| | | { type: 'radio' } |
| | | , { field: 'HInterID', title: 'åæ®å
ç ', width: 120 } |
| | | , { field: 'HBillNo', title: 'åæ®å·', width: 150 } |
| | | , { field: 'HMaker', title: 'å¶å人', width: 120 } |
| | | , { field: 'HMakeDate', title: 'å¶åæ¥æ', width: 150 } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ', width: 150 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 150 } |
| | | , { field: 'HMaterModel', title: 'è§æ ¼åå·', width: 150 } |
| | | , { field: 'HQty', title: 'æ°é', width: 100 } |
| | | , { field: 'HSourceBillNo', title: 'æºååå·', width: 150 } |
| | | , { field: 'HOrgID', title: 'ç»ç»', width: 120 } |
| | | ]] |
| | | , height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | //æ¤éåè½ |
| | | form.on('submit(cmdRescind)', function () { |
| | | var checkStatus = table.checkStatus('yd-table'); |
| | | var checkStatus2 = table.checkStatus('sy-table'); |
| | | var data = ""; |
| | | if (checkStatus.data.length != 0) { |
| | | data = checkStatus.data; |
| | | } else if (checkStatus2.data.length != 0) { |
| | | data = checkStatus2.data; |
| | | } else { |
| | | return layer.msg("è¯·éæ©ä¸æ¡æ°æ®"); |
| | | } |
| | | }) |
| | | }); |
| | | //æ¤éåè½ |
| | | form.on('submit(cmdRescind)', function () { |
| | | var checkStatus = table.checkStatus('yd-table'); |
| | | var checkStatus2 = table.checkStatus('sy-table'); |
| | | var data = ""; |
| | | if (checkStatus.data.length != 0) { |
| | | data = checkStatus.data; |
| | | } else if (checkStatus2.data.length != 0) { |
| | | data = checkStatus2.data; |
| | | } else { |
| | | return layer.msg("è¯·éæ©ä¸æ¡æ°æ®"); |
| | | } |
| | | var sInterID = data[0].HInterID |
| | | var sBillNo = data[0].HBillNo |
| | | var sBillType = '1201' |
| | | $.ajax( |
| | | { |
| | | type: "Get", |
| | | url: GetWEBURL() + "/Web/Rescind_Json", |
| | | async: true, |
| | | data: { "sHInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说æéªè¯æåäºï¼ |
| | | layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | | // å¾å°frameç´¢å¼ |
| | | var index = layer.getFrameIndex(window.name); |
| | | //å
³éå½åframe |
| | | layer.close(index); |
| | | //ä¿®æ¹ä¸ºååå·æ°çé¢ |
| | | window.location.reload(); |
| | | }); |
| | | var sInterID = data[0].HInterID |
| | | var sBillNo = data[0].HBillNo |
| | | var sBillType = '1201' |
| | | $.ajax( |
| | | { |
| | | type: "Get", |
| | | url: GetWEBURL() + "/Web/Rescind_Json", |
| | | async: true, |
| | | data: { "sHInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说æéªè¯æåäºï¼ |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | | // å¾å°frameç´¢å¼ |
| | | var index = layer.getFrameIndex(window.name); |
| | | //å
³éå½åframe |
| | | layer.close(index); |
| | | //ä¿®æ¹ä¸ºååå·æ°çé¢ |
| | | window.location.reload(); |
| | | }); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 2 }); |
| | |
| | | var checkStatus = table.checkStatus('dj-table') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | var sInterID = data[0].HInterID |
| | | var sInterID = data[0].HInterID = 'undefined' ? data[0].åæ®å
ç : data[0].HInterID; |
| | | //é»è¾å 餿¹æ³ |
| | | layer.confirm("确认è¦å é¤åï¼å é¤åä¸è½æ¢å¤", { title: "å é¤ç¡®è®¤" }, function (index) { |
| | | $.ajax( |
| | |
| | | }); |
| | | }); |
| | | |
| | | ////ç¼åå表 |
| | | //table.render({ |
| | | // elem: '#dj-table' |
| | | // , url: GetWEBURL() + '/Web/DisBillEntryList_Mate_Webs_Json' |
| | | // , toolbar: '#toolbarDemo' |
| | | // , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] } |
| | | // , cols: [[ |
| | | // { type: 'radio' } |
| | | // , { field: 'HInterID', title: 'åæ®å
ç ', width: 120 } |
| | | // , { field: 'HBillNo', title: 'åæ®å·', width: 150 } |
| | | // , { field: 'HMaker', title: 'å¶å人', width: 120 } |
| | | // , { field: 'HMakeDate', title: 'å¶åæ¥æ', width: 150 } |
| | | // , { field: 'HQty', title: 'æ°é', width: 100 } |
| | | // , { field: 'HSourceBillNo', title: 'æºååå·', width: 150 } |
| | | // , { field: 'HRedBlueFlag', title: '红èå', width: 120 } |
| | | // , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100 } |
| | | // ]] |
| | | // , height: 500 |
| | | // , done: function () { |
| | | // layer.closeAll("loading"); |
| | | // } |
| | | //}) |
| | | |
| | | //ç¼åå表 |
| | | table.render({ |
| | | elem: '#dj-table' |
| | | , url: GetWEBURL() + '/Web/chanpinruk' |
| | | , toolbar: '#toolbarDemo' |
| | | , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] } |
| | | , cols: [[ |
| | | { type: 'radio' } |
| | | , { field: 'HInterID', title: 'åæ®å
ç ', width: 120 } |
| | | , { field: 'HBillNo', title: 'åæ®å·', width: 150 } |
| | | , { field: 'HMaker', title: 'å¶å人', width: 120 } |
| | | , { field: 'HMakeDate', title: 'å¶åæ¥æ', width: 150 } |
| | | , { field: 'HQty', title: 'æ°é', width: 100 } |
| | | , { field: 'HSourceBillNo', title: 'æºååå·', width: 150 } |
| | | , { field: 'HRedBlueFlag', title: '红èå', width: 120 } |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100 } |
| | | ]] |
| | | , height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | |
| | | |
| | | //卿å-ç¼åå表 |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Web/DisBillEntryList_Mate_Webs_Json", |
| | | type: "GET", |
| | | async: false, |
| | | data: { HBillType: sBillType, sWhere: '' }, |
| | | //async: false, |
| | | success: function (data1) { |
| | | |
| | | if (data1.count == 1) { |
| | | |
| | | var data = []; |
| | | var col = []; |
| | | //ç»ç©ºçæ°ç»èµå¼ |
| | | for (var key in data1.list) { |
| | | data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); |
| | | } |
| | | //å¨å表左边添å å¾éæ¡ |
| | | col.push({ type: 'radio', fixed: 'left' }); |
| | | for (var i = 0; i < data.length; i++) { |
| | | if ($.inArray(data[i].name, "") > -1) { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //éèidå |
| | | } |
| | | else { |
| | | switch (data[i].Type) { |
| | | //int |
| | | case 'DateTime': |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 }); |
| | | break; |
| | | default: |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | option = { |
| | | elem: '#dj-table' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 500 |
| | | , page: true //å¼å¯å页 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , cols: [col] |
| | | , data: data1.data |
| | | }; |
| | | table.render(option); |
| | | } else { |
| | | option = { |
| | | elem: '#dj-table' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 500 |
| | | , page: true //å¼å¯å页 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , cols: [[ |
| | | { type: 'radio' } |
| | | , { field: 'HMakeDate', title: 'å¶åæ¥æ', width: 150 } |
| | | , { field: 'HBillNo', title: 'åæ®å·', width: 150 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 150 } |
| | | , { field: 'HQty', title: 'æ°é', width: 100 } |
| | | ]] |
| | | , data: [] |
| | | }; |
| | | table.render(option); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | layer.msg('é误' + err, { |
| | | icon: 5, |
| | | time: 20000 |
| | | }, function () { |
| | | //do something |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | |
| | | //å·²ä¸ä¼ å表 |
| | | table.render({ |
| | | elem: '#yd-table' |