123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685 |
- /**
- * 生产任务
- * 冯海夫
- * 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
- // };
- var map=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getAchievementRate");
-
- if(!map||Object.keys(map).length<=0){
- map={
- "未完成":100
- }
- }
- return map;
- },
- // 月度生产计划
- 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
- // });
- var taskList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getMonthList");
- taskList.forEach(element=>{
- element.projectName= "项目1",
- element.orderSheetCode= element.mocode,
- element.materialCode=element.cinvcode,
- element.materialName=element.cinvname,
- element.specs=element.cinvstd,
- element.planSum=element.qty,
- element.workHour= (element.cinvDefine13*element.qty).toFixed(2),
- element.completeSum=element.qualifiedinqty,
- element.manHoursInvested=element.manHoursInvested
- })
-
- $.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
- // });
- // var taskList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getDayList");
- var taskList=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getListNotStarted");
- taskList.forEach(element=>{
- element.orderSheetCode= element.productionOrderNumberName
- element.materialCode=element.productId
- element.materialName=element.product
- // element.specs=element.cinvstd,
- element.planSum=element.numberOfTasks
- element.workHour= element.standardWorkingHours
- // element.completeSum=element.qualifiedinqty
- if(element.state==='0'){
- element.stateName="派工";
- element.color="yellow";
- }
- if(element.state==='1'){
- element.stateName="上岗";
- element.color="green";
- }
- if(element.state==='2'){
- element.stateName="暂停";
- element.color="red";
- }
- if(element.state==='3'&&element.latestCompletedQuantity!==element.numberOfTasks){
- element.stateName="进行中";
- element.color="green";
- }
- })
- $.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 + "%";
- //当天的
- //达成率处理
- if(!item.achievementRate){
- item.achievementRate=0
- }
- //生产率处理
- if(!item.productionEfficiency||Number(item.latestCompletedQuantity)===0){
- item.productionEfficiency=0.00
- }
- });
- return taskList;
- },
- //项目进度完工百分比
- getProjectScheduleCompletion:function(){
- // var projectScheduleCompletionList=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getProjectScheduleCompletion");
- var projectScheduleCompletionList=MethodGetService.methodGet("/fbsMomOrder/fbsMomOrderdetail/getMonthListGroupDefine12");
- projectScheduleCompletionList.forEach(item => {
- // if(!item.numberOfTasks){
- // item.numberOfTasks=0;
- // }
- // if(!item.latestCompletedQuantity){
- // item.latestCompletedQuantity=0;
- // }
- // item.incompleteSum = item.numberOfTasks - item.latestCompletedQuantity;
- // if (item.incompleteSum < 0)
- // item.incompleteSum = 0;
- // item.completePercent = (item.latestCompletedQuantity / item.numberOfTasks * 100).toFixed(0);
- // item.incompletePercent = (100 - item.completePercent) + "%";
- // item.completePercent = item.completePercent + "%";
- });
- projectScheduleCompletionList.forEach(element=>{
- element.projectName= "项目1",
- element.orderSheetCode= element.mocode,
- element.materialCode=element.cinvcode,
- element.materialName=element.cinvname,
- element.specs=element.cinvstd,
- element.planSum=element.qty,
- element.workHour= element.cinvDefine13,
- element.completeSum=element.qualifiedinqty,
- element.manHoursInvested=element.manHoursInvested
- })
-
- $.each(projectScheduleCompletionList, 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 projectScheduleCompletionList;
- },
- // 获取到现在为止在进行订单或者项目
- 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"
- // });
- Date.prototype.Format = function (fmt) { //author: meizz
- var o = {
- "M+": this.getMonth() + 1, //月份
- "d+": this.getDate(), //日
- "h+": this.getHours(), //小时
- "m+": this.getMinutes(), //分
- "s+": this.getSeconds(), //秒
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
- "S": this.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- }
- let taskList=MethodGetService.methodGet("/fbsWorkshopDispatchList/fbsWorkshopDispatchList/getDoingListByOrder");
- taskList.forEach(element => {
- element.materialName=element.product;
- element.productId=element.productId;
- if(element.cinvstd){
- element.specs=element.cinvstd;
- }else{
- element.specs="";
- }
- element.planSum=element.numberOfTasks;
- if(element.latestCompletedQuantity){
- element.completeSum=element.latestCompletedQuantity;
- }else{
- element.completeSum=0;
- }
- element.projectName=element.productionOrderNumberName;
- element.orderCode=element.productionOrderNumberName;
- if(element.plannedStartTime&&element.plannedEndTime){
- var s = new Date(element.plannedStartTime);//计划开工时间
- var e = new Date(element.plannedEndTime);//计划完成时间
- element.planCompleteDate=s.Format("MM-dd")+"至"+e.Format("MM-dd");
- }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.plannedEndTime){
- item.bgcss = DateOperation.subtraction(item.plannedEndTime, dateNow, "s")>0?"task-block-timeout":"task-block-normal";
- }else{
- item.bgcss="task-block-normal";
- }
- item.displayName = item.projectName == "" ? item.orderCode : item.projectName;
- // item.technologicalList=[{aa:"工单",bb:"1"},{aa:"工单",bb:"1"},{aa:"工单",bb:"2"}]
- });
- return taskList;
- },
-
- // 日生产计划
- getEsopTaskList: function () {
- return getService.methodGet("/fbsMomOrder/fbsMomOrder/getEsopTaskList");
- // 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"}
- // ]
- // });
- // 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(code,moCode){
- return getService.methodGet("/workingStatistics/fbsWorkingStatistics/getEsopFileList?code="+code+"&moCode="+moCode);
- },
- //视频自动播放
- getVedioFileList:function(){
- return getService.methodGet("/workingStatistics/fbsWorkingStatistics/getVedioFileList");
- }
- }
|