93 lines
3.3 KiB
JavaScript
93 lines
3.3 KiB
JavaScript
define(['moment', "module/moduleEPM/program/mrs-epm/epm00/epm00Service"], function (moment) {
|
|
return ['$scope', '$filter', '$stateParams', 'config', 'MMWService', 'DashboardService', 'RouterExtendProvider', '$rootScope', 'epm00Service',"$timeout",
|
|
function ($scope, $filter, $stateParams, config, $MMWService, $DashboardService, $RouterExtendProvider, $rootScope, $epm00Service, $timeout) {
|
|
|
|
ary_invoke = [];
|
|
ary_content = [];
|
|
|
|
Date.prototype.yyyymmdd = function () {
|
|
var mm = this.getMonth() + 1; // getMonth() is zero-based
|
|
var dd = this.getDate();
|
|
|
|
return [this.getFullYear() + '/',
|
|
(mm > 9 ? '' : '0') + mm + '/',
|
|
(dd > 9 ? '' : '0') + dd
|
|
].join('');
|
|
};
|
|
|
|
$scope.init = function () {
|
|
$timeout(function () {
|
|
|
|
//2020-05-07 yenru add.
|
|
//UCD Layout Right Top Menu Button;
|
|
$scope.$root.btnList = [
|
|
{
|
|
//不良輸入
|
|
name: "button",
|
|
icon_scr: 'image/iMES_icon/icon_unusual@1.png',
|
|
class: [], //按鈕額外的class
|
|
disabled: false,
|
|
click: function () {
|
|
|
|
|
|
$epm00Service.init({
|
|
callback: function () {
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
];
|
|
|
|
}, 500);
|
|
}
|
|
|
|
// 保養工單資料
|
|
ary_invoke.push('kcPM.clsPMBasis.LoadPMWoBasis');
|
|
ary_content.push({});
|
|
|
|
// 保養工單Detail資料
|
|
ary_invoke.push('kcPM.clsPMBasis.LoadPMWoDetail');
|
|
ary_content.push({});
|
|
|
|
// 維修任務
|
|
ary_invoke.push('kcPM.clsPMBasis.LoadEQPBreakDownStateByUser');
|
|
ary_content.push({ "userno": config.cache.account });
|
|
|
|
// 保養計畫
|
|
ary_invoke.push('kcPM.clsPMBasis.LoadEQPMaintenancePlan');
|
|
ary_content.push({});
|
|
|
|
console.log(ary_invoke);
|
|
console.log(ary_content);
|
|
|
|
$MMWService.sendToMESSrv_Multi({
|
|
uri: ary_invoke,
|
|
content: ary_content,
|
|
success: function (data) {
|
|
console.log(a = $scope.PMWoBasis = JSON.parse(JSON.parse(data.ResultJson)['kcPM.clsPMBasis.LoadPMWoBasis']).PMWoBasis);
|
|
console.log(b = JSON.parse(JSON.parse(data.ResultJson)['kcPM.clsPMBasis.LoadPMWoDetail']).PMWoDetail);
|
|
console.log($scope.c = JSON.parse(JSON.parse(data.ResultJson)['kcPM.clsPMBasis.LoadEQPBreakDownStateByUser']).PMEQPBreakDownStateByUser);
|
|
console.log($scope.d = JSON.parse(JSON.parse(data.ResultJson)['kcPM.clsPMBasis.LoadEQPMaintenancePlan']).EQPMaintenancePlan);
|
|
|
|
$scope.aa = [];
|
|
for (i = 0; i < 4; i++)
|
|
$scope.aa[i] = [];
|
|
a.forEach(i => {
|
|
b.forEach(j => {
|
|
if (i.WONO == j.WONO) {
|
|
var date = new Date(j.PMESTDATETIME);
|
|
$scope.aa[i.WOTYPE].push({ 'WONO': j.WONO, 'PMESTDATETIME': date.yyyymmdd(), 'EQUIPMENTNO': j.EQUIPMENTNO });
|
|
return false;
|
|
}
|
|
});
|
|
});
|
|
|
|
console.log($scope.aa);
|
|
}
|
|
});
|
|
|
|
},
|
|
];
|
|
});
|