tzdZjCtrl.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. angular.module('app.business').controller("tzdZjCtrl",
  2. function($scope, $rootScope, $uibModalInstance, $filter, $http, $uibModal,deliveryStorageNoticeService, storeWareDetailService, jsglService, commonUtilService, APP_CONFIG, items) {
  3. $scope.pageInfo = {pageNum : 1, pageSize : 10};
  4. $scope.searchCondition = {orgId : $rootScope.orgInfo.orgId, billType : 1}; //查询入库的
  5. // 获取列表数据
  6. $scope.loadData = function() {
  7. $scope.searchCondition.billType = 1;
  8. deliveryStorageNoticeService.getPassPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $scope.searchCondition).then(function(data){
  9. $scope.pageInfo = data;
  10. },function(data){
  11. console.log(data);
  12. });
  13. }
  14. if (items != undefined && items != null) {
  15. if (items.billType != undefined && items.billType != null) {
  16. $scope.searchCondition.billType = items.ywtype;
  17. }
  18. if (items.orgId != undefined && items.orgId != null) {
  19. $scope.searchCondition.orgId = items.orgId;
  20. }
  21. }
  22. $scope.loadData();
  23. // 翻页
  24. $scope.goPage = function(pageNum) {
  25. if ($scope.pageInfo.pageNum != pageNum && pageNum > 0) {
  26. $scope.pageInfo.pageNum = pageNum;
  27. $scope.loadData();
  28. }
  29. }
  30. $scope.selected = [];
  31. // 选择一条数据
  32. $scope.selectData = function(check) {
  33. var datas = {billNumber: check.billNumber, shipingCount: check.shipingCount};
  34. storeWareDetailService.getStoreWareDetailList(check.id, 'notice').then(function(data) {
  35. datas.id = data[0].zid;
  36. datas.houseId = data[0].houseId;
  37. datas.warehouseId = data[0].warehouseId;
  38. datas.lypz = data[0].grainKind;
  39. datas.mxpz = data[0].grainDetailKind;
  40. datas.lyxz = data[0].grainAttribute;
  41. datas.dj = data[0].inPrice;
  42. //查询已结算数量
  43. var conditions = {htbh:check.billNumber};
  44. jsglService.getPageInfo(null, null, '0', conditions).then(function(jsdata) {
  45. var yjssl = 0;
  46. if (jsdata.list != null) {
  47. for (var i = 0; i < jsdata.list.length; i++) {
  48. if (jsdata.list[i].dataStatus=='1') {
  49. yjssl = commonUtilService.accAdd(yjssl, jsdata.list[i].bcjssl);
  50. }
  51. }
  52. }
  53. datas.yjssl = yjssl;
  54. $uibModalInstance.close(datas);
  55. },function(jsdata){
  56. console.log(jsdata);
  57. });
  58. },function(data){
  59. console.log(data);
  60. });
  61. }
  62. // 关闭模态窗口
  63. $scope.cancel = function() {
  64. $uibModalInstance.close();
  65. }
  66. })