/** * 生产任务 * 冯海夫 * 20201008 */ document.write(""); var ServiceProduceTask = { // 计划完成情况 getCompleteInfo: function () { // return { // "已完成": 150, // "未完成": 250 // }; return MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getFbsMomOrderdetailSum"); }, // 日计划完成情况 getDayCompleteInfo: function () { // return { // "已完成": 150, // "未完成": 250 // }; return MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getAchievementRate"); }, // 月度生产计划 getMonthList: function () { const taskList = []; taskList.push({ projectName: "项目1", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectName: "项目1", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); $.each(taskList, function (index, item) { item.incompleteSum = item.planSum - item.completeSum; if (item.incompleteSum < 0) item.incompleteSum = 0; item.completePercent = (item.completeSum / item.planSum * 100).toFixed(0); item.incompletePercent = (100 - item.completePercent) + "%"; item.completePercent = item.completePercent + "%"; }); return taskList; }, // 日生产计划 getDayList: function () { const taskList = []; taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", planSum: 30, workHour: 60, completeSum: 15 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", planSum: 20, workHour: 50, completeSum: 18 }); taskList.push({ projectCode:"项目001", orderSheetCode: "G10003", materialCode: "10003", materialName: "物料C", specs: "3*4", planSum: 90, workHour: 10, completeSum: 60 }); $.each(taskList, function (index, item) { item.incompleteSum = item.planSum - item.completeSum; if (item.incompleteSum < 0) item.incompleteSum = 0; item.completePercent = (item.completeSum / item.planSum * 100).toFixed(0); item.incompletePercent = (100 - item.completePercent) + "%"; item.completePercent = item.completePercent + "%"; }); return taskList; }, // 获取到现在为止在进行订单或者项目 getDoingListByOrder: function () { // const taskList = []; // taskList.push({ // materialName: "节能灯", // specs: "HID 200W with Osram", // planSum: 30, // completeSum: 15, // projectName:"", // orderCode:"O0001", // planCompleteDate:"2020-10-1" // }); // taskList.push({ // materialName: "节能灯", // specs: "HID 100W with Osram", // planSum: 40, // completeSum: 10, // projectName:"希望小学工程", // orderCode:"", // planCompleteDate:"2020-10-20" // }); // taskList.push({ // materialName: "节能灯", // specs: "HID 500W", // planSum: 50, // completeSum: 40, // projectName:"", // orderCode:"O0002", // planCompleteDate:"2020-10-20" // }); // taskList.push({ // materialName: "节能灯", // specs: "HID 13W", // planSum: 50, // completeSum: 30, // projectName:"市政工程", // orderCode:"", // planCompleteDate:"2020-10-20" // }); // taskList.push({ // materialName: "节能灯", // specs: "HID 100W with Osram", // planSum: 40, // completeSum: 20, // projectName:"", // orderCode:"O0003", // planCompleteDate:"2020-10-20" // }); // taskList.push({ // materialName: "节能灯", // specs: "HID 100W with Osram", // planSum: 40, // completeSum: 10, // projectName:"希望小学工程", // orderCode:"", // planCompleteDate:"2020-10-20" // }); let taskList=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getDoingListByOrder"); taskList.forEach(element => { element.materialName=element.product; if(element.cinvstd){ element.specs=element.cinvstd; }else{ element.specs=""; } element.planSum=element.numberOfTasks; if(element.qualifiedNumber){ element.completeSum=element.qualifiedNumber; }else{ element.completeSum=0; } element.projectName=element.productionOrderNumberName; element.orderCode=element.productionOrderNumberName; if(element.endDate){ element.planCompleteDate=element.endDate; }else{ element.planCompleteDate=""; } }); console.log(JSON.parse(JSON.stringify(taskList)) ); $.each(taskList, function (index, item) { item.incompleteSum = item.planSum - item.completeSum; if (item.incompleteSum < 0) item.incompleteSum = 0; item.completePercent = (item.completeSum / item.planSum * 100).toFixed(0); item.incompletePercent = (100 - item.completePercent) + "%"; item.completePercent = item.completePercent + "%"; const dateNow = DateOperation.formatDate(new Date(), "YYYY-mm-dd"); if(item.planCompleteDate){ item.bgcss = DateOperation.subtraction(item.planCompleteDate, dateNow, "s")>0?"task-block-timeout":"task-block-normal"; }else{ item.bgcss="task-block-timeout"; } item.displayName = item.projectName == "" ? item.orderCode : item.projectName; }); return taskList; }, // 日生产计划 getEsopTaskList: function () { const taskList = []; taskList.push({ orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", ProjectName: "项目A", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/1.pdf"} ] }); taskList.push({ orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", ProjectName: "项目B", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/2.pdf"} ] }); taskList.push({ orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", ProjectName: "项目A", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/1.pdf"} ] }); taskList.push({ orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", ProjectName: "项目B", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/2.pdf"} ] }); taskList.push({ orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", ProjectName: "项目A", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/1.pdf"} ] }); taskList.push({ orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", ProjectName: "项目B", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/2.pdf"} ] }); taskList.push({ orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", ProjectName: "项目A", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/1.pdf"} ] }); taskList.push({ orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", ProjectName: "项目B", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/2.pdf"} ] }); taskList.push({ orderSheetCode: "G10001", materialCode: "10001", materialName: "物料A", specs: "3*4", ProjectName: "项目A", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/1.pdf"} ] }); taskList.push({ orderSheetCode: "G10002", materialCode: "10002", materialName: "物料B", specs: "3*4", ProjectName: "项目B", files:[ {name:"物料A操作手册",type:"pdf",path:"/files/opratefile/2.pdf"} ] }); return taskList; }, //文件列表 getEsopFileList:function(){ return getService.methodGet("/workingStatistics/fbsWorkingStatistics/getEsopFileList"); } }