123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531 |
- /**
- * 生产任务
- * 冯海夫
- * 20201008
- */
- document.write("<script type='text/javascript' src='/js/util/dateoperation.js'></script>");
- 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");
- }
- }
|