diff --git a/public/js/ctrl/r.ctrl.js b/public/js/ctrl/r.ctrl.js index 0a9863cc5410d7332e383d6b1815f38ac019a60f..c5502179b2810c648a2210f1367057b534b1965b 100644 --- a/public/js/ctrl/r.ctrl.js +++ b/public/js/ctrl/r.ctrl.js @@ -806,27 +806,23 @@ wmsCtrl.controller('reservoirCtrl',['$scope','reservoirService','dropDownService .controller('roleCtrl.dialog',['$scope','$timeout','roleService',function(scope,timeout,roleService){ //角色 ctrl dialog if(scope.ngDialogData.permissions){ - timeout(function(){ - if(scope.ngDialogData.rolePermiss){ //判断是否是更新时候传递的用户所属角色 - for(var i = 0; i < scope.ngDialogData.permissions.length; i++){ - for(var j = 0; j < scope.ngDialogData.rolePermiss.length;j++){ - //判断权限是否相等默认选中 - if(scope.ngDialogData.permissions[i].id == scope.ngDialogData.rolePermiss[j].id){ - scope.ngDialogData.permissions[i].checked = true; - //判断权限下的子权限是否相等默认选中 - if(scope.ngDialogData.rolePermiss[j].childPermissionsBOList && scope.ngDialogData.rolePermiss[j].childPermissionsBOList.length > 0){ - for(var iChild = 0;iChild < scope.ngDialogData.permissions[i].childPermissionsBOList.length;iChild++){ - for(var jChild = 0;jChild < scope.ngDialogData.rolePermiss[j].childPermissionsBOList.length;jChild++){ - if(scope.ngDialogData.permissions[i].childPermissionsBOList[iChild].id == scope.ngDialogData.rolePermiss[j].childPermissionsBOList[jChild].id){ - scope.ngDialogData.permissions[i].childPermissionsBOList[iChild].checked = true; - } - } - } - } - } + //递归循环赋值 + scope.recursivePermissions = function(permiss,rolePermiss){ + for(var i = 0; i < permiss.length; i++){ + for(var j = 0; j < rolePermiss.length;j++){ + if(permiss[i].id == rolePermiss[j].id){ + permiss[i].checked = true; + } + if(rolePermiss[j].childPermissionsBOList){ + scope.recursivePermissions(permiss[i].childPermissionsBOList,rolePermiss[j].childPermissionsBOList); } } } + } + timeout(function(){ + if(scope.ngDialogData.rolePermiss){ //判断是否是更新时候传递的用户所属角色 + scope.recursivePermissions(scope.ngDialogData.permissions,scope.ngDialogData.rolePermiss); + } scope.permissionsZtree = $.fn.zTree.init( $('.permissionsZtree'), diff --git a/public/js/ctrl/w.ctrl.js b/public/js/ctrl/w.ctrl.js index 5d5d99121d597bdee0ca69292b55eaceb01fa793..e0a31f4dbe36914e98db81f20176cc2f0c3eca5e 100644 --- a/public/js/ctrl/w.ctrl.js +++ b/public/js/ctrl/w.ctrl.js @@ -277,6 +277,72 @@ wmsCtrl.controller('warehouseCtrl',['$scope','warehouseService','dropDownService scope : scope }) } + + //任务取消 + scope.cancelTaskClick = function(){ + var indexArr = scope.Tools.getTableSelectItemIndex('.warehouseTable'); //获取table所选的下标 + + if(indexArr.length == 0){ + scope.Tools.alert('请选择一条数据'); + return; + } + + if(indexArr.length > 1){ + scope.Tools.alert('只能选择一条数据'); + return; + } + + if(scope.warehouseList[indexArr[0]].otStatus == scope.constant.warehouse.finish || scope.warehouseList[indexArr[0]].otStatus == scope.constant.warehouse.cancel){ + scope.Tools.alert('只能选择未完成前的数据'); + return; + } + + scope.Tools.dialog({ + controller : 'warehouseCtrl.dialog', + template : 'templates/warehouseManagement/warehouse/cancel-task-form.html', + closeByDocument : false, + closeByEscape : false, + data : { + warehouse : scope.warehouseList[indexArr[0]] //选择的 出库数据 + }, + width : 500, + title : '任务取消', + scope : scope + }) + } + + //备料退库 click + scope.quitTaskClick = function(){ + var indexArr = scope.Tools.getTableSelectItemIndex('.warehouseTable'); //获取table所选的下标 + + if(indexArr.length == 0){ + scope.Tools.alert('请选择一条数据'); + return; + } + + if(indexArr.length > 1){ + scope.Tools.alert('只能选择一条数据'); + return; + } + + if(scope.warehouseList[indexArr[0]].otStatus != scope.constant.warehouse.finish){ + scope.Tools.alert('只能选择已完成的数据'); + return; + } + + scope.Tools.dialog({ + controller : 'warehouseCtrl.dialog', + template : 'templates/warehouseManagement/warehouse/quit-task-form.html', + closeByDocument : false, + closeByEscape : false, + data : { + warehouse : scope.warehouseList[indexArr[0]] //选择的 出库数据 + }, + width : 500, + title : '备料退库', + scope : scope + }) + } }]) .controller('warehouseCtrl.dialog',['$scope','warehouseService',function(scope,warehouseService){ //出库作业管理 dialog @@ -402,6 +468,41 @@ wmsCtrl.controller('warehouseCtrl',['$scope','warehouseService','dropDownService } } + //任务取消 click + scope.saveCancelTaskClick = function(){ + var obj = { + otId : scope.ngDialogData.warehouse.otId, //id + cancleReason : scope.ngDialogData.cancleReason //取消原因 + } + warehouseService.cancleTaskForCq(obj) + .then(function(result){ + if(result.success){ + scope.Tools.alert('任务取消成功'); + scope.list(scope.listParam()); + scope.closeThisDialog(); + }else{ + scope.Tools.alert(result.message); + } + }) + } + + //备料退库 click + scope.saveQuitTaskClick = function(){ + var obj = { + otId : scope.ngDialogData.warehouse.otId, //id + cancleReason : scope.ngDialogData.cancleReason //退库原因 + } + warehouseService.quitTaskForCq(obj) + .then(function(result){ + if(result.success){ + scope.Tools.alert('备料退库成功'); + scope.list(scope.listParam()); + scope.closeThisDialog(); + }else{ + scope.Tools.alert(result.message); + } + }) + } }]) .controller('warehouseMaintenanceCtrl',['$scope','warehouseMaintenanceService',function(scope,warehouseMaintenanceService){ //仓库维护 diff --git a/public/js/wms-constant.js b/public/js/wms-constant.js index d1371a18eb5ee4948a221b2d54793a344811149f..2baf2dc630073549c9f1549737bd7f862ed73484 100644 --- a/public/js/wms-constant.js +++ b/public/js/wms-constant.js @@ -7,7 +7,8 @@ angular.module('wms.constant',[]) billsType : { //单据类型 systemSchedul : '1', //TMS推送 manualEntry : '2', //WMS业务产生库内返工、委外返工 - add : '3' //WMS新增 + add : '3', //WMS新增 + exit : '7' //备料退库 }, inspectionResults : { //检验结果 asnOrderPass : '10', //合格 @@ -23,7 +24,8 @@ angular.module('wms.constant',[]) billsTypeName : { //单据类型名称 systemSchedul : 'TMS推送', manualEntry : 'WMS业务产生库内返工、委外返工', - add : 'WMS新增' + add : 'WMS新增', + exit : '备料退库' }, inspectionResultsName : { //检验结果名称 asnOrderPass : '合格', @@ -95,13 +97,15 @@ angular.module('wms.constant',[]) unprocessed : 10, //未出库 execution : 20, //已出库 haveOutbound : 30, //进行中 - finish : 40 //已完成 + finish : 40, //已完成 + cancel : 50 //已取消 }, warehouseName : { //出库状态 name unprocessed : '未出库', execution : '已出库', haveOutbound : '进行中', - finish : '已完成' + finish : '已完成', + cancel : '已取消' }, defaultDropDownNullData : { //空数据 name : '', @@ -195,13 +199,15 @@ angular.module('wms.constant',[]) unStart : 10, //未开始 planned : 20, //已计划 confirmed : 30, //已备料 - finish : 40 //已完成 + finish : 40, //已完成 + cancel : 50 //已取消 }, outboundStatusName : { //备料单 status name unStart : '未开始', planned : '已计划', confirmed : '已备料', - finish : '已完成' + finish : '已完成', + cancel : '已取消' }, outboundType : { //出库类型 dispatcherOutbound : 10, //调拨出库 @@ -225,11 +231,13 @@ angular.module('wms.constant',[]) }, outboundOutStatus : { //备料出库状态 notOut : 10, //未出库 - out : 20 //已出库 + out : 20, //已出库 + exit : 30 //已退库 }, outboundOutStatusName : { //备料出库状态 name notOut : '未出库', //未出库 - out : '已出库' //已出库 + out : '已出库', //已出库 + exit : '已退库' }, shipmentPlanStatus : { //发运状态 untreated : '0', //未处理 diff --git a/public/js/wms-filter.js b/public/js/wms-filter.js index 0f5901d6b76c0540142a46bd4e7fe2db49c23494..a25ff59ae84f4580f55ac37c3d059a851f85dbcb 100644 --- a/public/js/wms-filter.js +++ b/public/js/wms-filter.js @@ -9,6 +9,10 @@ var wmsFilter = angular.module('wms.filter', []) return constant.billsTypeName.systemSchedul; }else if(input == constant.billsType.manualEntry){ //手工录入 return constant.billsTypeName.manualEntry; + }else if(input == constant.billsType.add){ //wms新增 + return constant.billsTypeName.add; + }else if(input == constant.billsType.exit){ //备料退库 + return constant.billsTypeName.exit; } return input; } @@ -93,6 +97,8 @@ var wmsFilter = angular.module('wms.filter', []) return constant.warehouseName.haveOutbound; }else if(input == constant.warehouse.finish){ //已完成 return constant.warehouseName.finish; + }else if(input == constant.warehouse.cancel){ //已取消 + return constant.warehouseName.cancel; } return input; } @@ -197,6 +203,8 @@ var wmsFilter = angular.module('wms.filter', []) return constant.outboundStatusName.confirmed; }else if(input == constant.outboundStatus.finish){ //已完成 return constant.outboundStatusName.finish; + }else if(input == constant.outboundStatus.cancel){ //已取消 + return constant.outboundStatusName.cancel; } return input; } @@ -231,6 +239,8 @@ var wmsFilter = angular.module('wms.filter', []) return constant.outboundOutStatusName.notOut; }else if(input == constant.outboundOutStatus.out){ //已出库 return constant.outboundOutStatusName.out; + }else if(input == constant.outboundOutStatus.exit){ //已退库 + return constant.outboundOutStatusName.exit; } return input; } diff --git a/public/js/wms-service.js b/public/js/wms-service.js index 9add52a404421a06cbdd2c950d4744d51cc12c37..d7bc7fb9df74e24ad4e9eccda326a8b6f562e267 100644 --- a/public/js/wms-service.js +++ b/public/js/wms-service.js @@ -257,6 +257,12 @@ var wmsService = angular.module('wms.services', []) }, outConfirm : function(data){ //出库确认 return httpService.customPOST('outboundTask/outConfirm',data); + }, + cancleTaskForCq : function(data){ //任务取消 + return httpService.customPOST('outboundTask/cancleTaskForCq',data); + }, + quitTaskForCq : function(data){ //备料退库 + return httpService.customPOST('outboundTask/quitTaskForCq',data); } } }]) diff --git a/public/js/wms-tools.js b/public/js/wms-tools.js index 6479d46c6401640563fe82002683e0668aa9bc53..7d022d5bc2c4b549d569b1bad2c24d691aab4932 100644 --- a/public/js/wms-tools.js +++ b/public/js/wms-tools.js @@ -35,6 +35,10 @@ wmsService.service('Tools',['ngDialog','constant','$timeout',function(ngDialog,c { name:constant.billsTypeName.add, //wms新增 value:constant.billsType.add + }, + { + name:constant.billsTypeName.exit, //备料退库 + value:constant.billsType.exit } ], orderStatusDropDown : [ //订单状态下拉 @@ -141,6 +145,10 @@ wmsService.service('Tools',['ngDialog','constant','$timeout',function(ngDialog,c { name : constant.warehouseName.finish, //已完成 value : constant.warehouse.finish + }, + { + name : constant.warehouseName.cancel, //已取消 + value : constant.warehouse.cancel } ], stockUnitStatusDropDown : [ //库位状态下拉 @@ -289,6 +297,10 @@ wmsService.service('Tools',['ngDialog','constant','$timeout',function(ngDialog,c { name : constant.outboundStatusName.finish, //已完成 value : constant.outboundStatus.finish + }, + { + name : constant.outboundStatusName.cancel, //已取消 + value : constant.outboundStatus.cancel } ], sexDropDown : [ //性别 @@ -309,6 +321,10 @@ wmsService.service('Tools',['ngDialog','constant','$timeout',function(ngDialog,c { name : constant.outboundOutStatusName.out, //已出库 value : constant.outboundOutStatus.out + }, + { + name : constant.outboundOutStatusName.exit, //已退库 + value : constant.outboundOutStatus.exit } ], shipmentPlanStatusDropDown : [ //发运计划状态 diff --git a/public/templates/inStorageManagement/inputWork/input-work-list.html b/public/templates/inStorageManagement/inputWork/input-work-list.html index c9ad1375dbbf768a57c9f5860a4dc1044176777e..8865329c893cddedd17b809cfcd5ea5223cb1171 100644 --- a/public/templates/inStorageManagement/inputWork/input-work-list.html +++ b/public/templates/inStorageManagement/inputWork/input-work-list.html @@ -180,6 +180,7 @@