/** * 材料服务 * 冯海夫 * 20201008 */ var ServiceMaterial={ // 待入库材料 getWatingInList:function(){ return getService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getWatingInList"); // const materialList = []; // materialList.push({ // vendorName:"A公司", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // arriveSum:"10", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"B公司", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // arriveSum:"20", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"C公司", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // arriveSum:"30", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"D公司", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // arriveSum:"40", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"E公司", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // arriveSum:"50", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"F公司", // materialCode:"10006", // materialName:"物料F", // specs:"3*4", // arriveSum:"60", // arriveDate:"09月18日", // memo:"" // }); // var i = 1; // $.each(materialList, function(index,item){ // item.index = i++; // }) // return materialList; }, // 已入库数量 getInSum:function(){ return getService.methodPost("/fbsPuArrivalvouch/fbsPuArrivalvouch/getInSum"); // return 8; }, // 待检材料 getWatingCheckList:function(){ return getService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getWatingCheckList"); // const materialList = []; // materialList.push({ // vendorName:"A公司", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // arriveSum:"10", // arriveDate:"09月18日" // }); // materialList.push({ // vendorName:"B公司", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // arriveSum:"20", // arriveDate:"09月18日" // }); // materialList.push({ // vendorName:"C公司", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // arriveSum:"30", // arriveDate:"09月18日" // }); // materialList.push({ // vendorName:"D公司", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // arriveSum:"40", // arriveDate:"09月18日" // }); // materialList.push({ // vendorName:"E公司", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // arriveSum:"50", // arriveDate:"09月18日" // }); // materialList.push({ // vendorName:"F公司", // materialCode:"10006", // materialName:"物料F", // specs:"3*4", // arriveSum:"60", // arriveDate:"09月18日" // }); // return materialList; }, // 已检数量 getCheckSum:function(){ return getService.methodPost("/fbsPuArrivalvouch/fbsPuArrivalvouch/getCheckSum"); // return 10; }, // 安全库存 getStockList:function(){ return getService.methodGet("/fbsInventory/fbsInventory/getStockList"); // const materialList = []; // materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // }); // materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // });materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // });materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // });materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // });materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // });materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // materialList.push({ // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // realStockSum:"100", // safeStockSum:"80" // }); // materialList.push({ // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // realStockSum:"10", // safeStockSum:"20" // }); // return materialList; }, getOrderDetailList:function(){ var orderDetailList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getOrderDetailList"); orderDetailList.forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.invcode element.materialName=element.cinvname//element.cinvname element.specs=""//element.cinvstd element.needSum=element.qtys element.stockSum=element.issQty // element.shortageQuantity=element.shortageQuantity }); return orderDetailList; }, getMoallocateList:function(){ var moallocateList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getMoallocateList"); // if(moallocateList){ // var orderSheetCode=""; // moallocateList.forEach(element => { // element.orderSheetCode=element.mocode // element.materialCode=element.minvCode // element.materialName=element.mcinvname // element.specs=""//element.cinvstd // // element.needSum=element.qtys // element.needSum=element.qtys // element.stockSum=element.issQty // element.materialPreparationTotal=element.materialPreparationTotal // element.isShow="0" // if(orderSheetCode!=element.mocode){ // orderSheetCode=element.mocode // element.isShow="1" // } // }); // } return moallocateList; }, getMoallocateListGroupCount:function(){ return MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getMoallocateListGroupCount"); }, // 工单备料 getListByOrderSheet:function(type){ // const materialList = []; // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // needSum:"20", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // needSum:"10", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10002", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // needSum:"40", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10004", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // needSum:"20", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // needSum:"20", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10004", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // needSum:"20", // stockSum:"20" // }); // var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheet?type=3"); var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheetNow?type=1"); // materialList.forEach(element => { // element.orderSheetCode=element.mocode // element.materialCode=element.cinvcode // element.materialName=element.cinvname//element.cinvname // element.specs=""//element.cinvstd // element.needSum=element.qtys // element.stockSum=element.issQty // element.shortageQuantity=element.shortageQuantity // }); return materialList; }, getListByOrderSheet1:function(materialList){ materialList["1"].forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.cinvcode element.materialName=element.cinvname//element.cinvname element.specs=""//element.cinvstd element.needSum=element.qtys element.stockSum=element.issQty element.shortageQuantity=element.shortageQuantity }); return materialList["1"]; }, getListByOrderSheet2:function(materialList){ materialList["2"].forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.cinvcode element.materialName=element.cinvname element.specs=""//element.cinvstd element.needSum=element.qtys element.stockSum=element.issQty }); return materialList["2"]; }, getListByOrderSheet3:function(materialList){ if(materialList["3"]){ materialList["3"].forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.mcinvcode element.materialName=element.mcinvname element.specs=""//element.cinvstd // element.needSum=element.qtys element.needSum=element.shortageQuantity element.stockSum=element.issQty }); } return materialList["3"]; }, // 工单缺料 getListByOrderSheetNotEnough:function(){ // const materialList = []; // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // needSum:"30", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // needSum:"55", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10002", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // needSum:"40", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"40", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10004", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // needSum:"25", // stockSum:"20" // }); // var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheet?type=2"); // var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheetNotEnough"); var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheetNow?type=3"); console.log(materialList) if(materialList){ materialList.forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.mcinvcode element.materialName=element.mcinvname element.specs=""//element.cinvstd // element.needSum=element.qtys element.needSum=element.shortageQuantity element.stockSum=element.issQty }); } return materialList; }, // 工单齐套 getListByOrderSheetEnough:function(){ // const materialList = []; // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // needSum:"10", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // needSum:"15", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10002", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // needSum:"20", // stockSum:"20" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // needSum:"30", // stockSum:"30" // }); // materialList.push({ // orderSheetCode:"G10004", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // needSum:"15", // stockSum:"20" // }); // var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheet?type=1"); var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getListByOrderSheetNow?type=2"); materialList.forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.cinvcode element.materialName=element.cinvname element.specs=""//element.cinvstd element.needSum=element.qtys element.stockSum=element.issQty }); return materialList; }, // 领料申请通知 getApplyList:function(){ // const materialList = []; // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // applyPerson:"张三", // applysum:"20" // }); // materialList.push({ // orderSheetCode:"G10001", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // applyPerson:"张三", // applysum:"20" // }); // materialList.push({ // orderSheetCode:"G10002", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // applyPerson:"张三", // applysum:"20" // }); // materialList.push({ // orderSheetCode:"G10003", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // applyPerson:"张三", // applysum:"20" // }); // materialList.push({ // orderSheetCode:"G10004", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // applyPerson:"张三", // applysum:"20" // }); var materialList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getApplyList?type=2"); materialList.forEach(element => { element.orderSheetCode=element.mocode element.materialCode=element.cinvcode element.materialName=element.cinvname element.specs=""//element.cinvstd element.applyPerson=element.cmaker element.applysum=element.unfinishedQuantity element.cdepName=element.cdepName element.ddate=element.ddate }); return materialList; }, // 领料申请完成数量 getApplyCompleteSum:function(){ return MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getApplyCompleteSum"); }, // 未来几天内到货计划 getWillArriveList:function(days){ return getService.methodGet("/fbsPuArrivalvouch/fbsArrivalVouchs/getWillArriveList"); // const materialList = []; // materialList.push({ // vendorName:"A公司", // materialCode:"10001", // materialName:"物料A", // specs:"3*4", // arriveSum:"10", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"B公司", // materialCode:"10002", // materialName:"物料B", // specs:"3*4", // arriveSum:"20", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"C公司", // materialCode:"10003", // materialName:"物料C", // specs:"3*4", // arriveSum:"30", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"D公司", // materialCode:"10004", // materialName:"物料D", // specs:"3*4", // arriveSum:"40", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"E公司", // materialCode:"10005", // materialName:"物料E", // specs:"3*4", // arriveSum:"50", // arriveDate:"09月18日", // memo:"" // }); // materialList.push({ // vendorName:"F公司", // materialCode:"10006", // materialName:"物料F", // specs:"3*4", // arriveSum:"60", // arriveDate:"09月18日", // memo:"" // }); // var i = 1; // $.each(materialList, function(index,item){ // item.index = i++; // }) // return materialList; }, // 当天到货批数 getTodayArriveSum:function(){ // return 100; return MethodGetService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getTodayArriveSum"); }, // 未来几天到货批数 getWillArriveSum:function(days){ // return 300; return MethodGetService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getWillArriveSum"); }, // 当月到货批数 getThisMonthArriveSum:function(){ // return 7882; return MethodGetService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getThisMonthArriveSum"); }, // 未入库总批数 getNotInSum:function(){ // return 90; return MethodGetService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getNotInSum"); }, // 近6个月质量目标合格率比较(品质管理看板) getLastSixMonthQualityTargetCompare: function () { //U8 // return getService.methodGet("/fbsPuArrivalvouch/fbsArrivalVouchs/getLastSixMonthQualityTargetCompare"); //后台维护 var list=MethodGetService.methodGet("/fbsPuArrivalvouch/fbsArrivalVouchs/getLastSixMonthQualityTargetCompareWeb"); $.each(list, function (index, item) { item.label = item.month; item.label1 = "质量目标 "+item.target+"%"; item.sum1 = item.target; item.label2 = "合格率"; item.sum2 = item.real; }); return list; // const list = []; // list.push({ // month: "04", // target: 98, // real: 33 // }); // list.push({ // month: "05", // target: 98, // real: 96 // }); // list.push({ // month: "06", // target: 98, // real: 95 // }); // list.push({ // month: "07", // target: 98, // real: 99 // }); // list.push({ // month: "08", // target: 98, // real: 100 // }); // list.push({ // month: "09", // target: 98, // real: 98 // }); // $.each(list, function (index, item) { // item.label = item.month; // item.label1 = "质量目标"; // item.sum1 = item.target; // item.label2 = "合格率"; // item.sum2 = item.real; // }); // return list; }, // 当月供应商合格率 getPassRateByVendor: function () { // return { // "供应商A":98, // "供应商B":95, // "供应商C":94, // "供应商D":93, // "供应商E":99, // "供应商F":97 // } return MethodGetService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getPassRateByVendor"); }, // 当月检验合格率 getCheckRateByBatchno: function () { // return { // "07001":98, // "07002":95, // "07003":94, // "07004":93, // "07005":99, // "07006":97 // } var map=MethodGetService.methodGet("/fbsPuArrivalvouch/fbsPuArrivalvouch/getCheckRateByBatchno"); //补上最后不足7 if(map){ var remainingQuantity=7-(Object.keys(map).length%7); if(remainingQuantity!=7){ for(var i=0;i { element.vendorName=element.cvencode; element.materialCode=element.cinvcode; element.materialName=element.cinvName; element.arriveSum=element.fquantity; element.checkSum=element.fdtquantity; element.unpassSum=element.fdisquantity; element.checkDate=element.ddate; element.images=element.images; // element.images=[ // "/images/quality/13.png", // "/images/quality/12.png" // ] }); var i = 1; $.each(materialList, function(index,item){ if(!item.checkSum){ item.checkSum=0 } item.index = i++; if(!item.unpassSum){ item.unpassSum=0 item.passRate="100%"; }else{ // item.passRate = ((item.checkSum-item.unpassSum)/item.checkSum*100).toFixed(0)+"%"; if(item.checkSum-item.unpassSum===0){ item.passRate="0%"; }else{ item.passRate = (item.checkSum-item.unpassSum/item.checkSum*100).toFixed(0)+"%"; } } }) return materialList; }, }