| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- angular.module('app.business').controller("tzdZjCtrl",
- function($scope, $rootScope, $uibModalInstance, $filter, $http, $uibModal,deliveryStorageNoticeService, storeWareDetailService, jsglService, commonUtilService, APP_CONFIG, items) {
- $scope.pageInfo = {pageNum : 1, pageSize : 10};
- $scope.searchCondition = {orgId : $rootScope.orgInfo.orgId, billType : 1}; //查询入库的
- // 获取列表数据
-
- $scope.loadData = function() {
- $scope.searchCondition.billType = 1;
- deliveryStorageNoticeService.getPassPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $scope.searchCondition).then(function(data){
- $scope.pageInfo = data;
- },function(data){
- console.log(data);
- });
- }
- if (items != undefined && items != null) {
- if (items.billType != undefined && items.billType != null) {
- $scope.searchCondition.billType = items.ywtype;
- }
- if (items.orgId != undefined && items.orgId != null) {
- $scope.searchCondition.orgId = items.orgId;
- }
- }
- $scope.loadData();
- // 翻页
- $scope.goPage = function(pageNum) {
- if ($scope.pageInfo.pageNum != pageNum && pageNum > 0) {
- $scope.pageInfo.pageNum = pageNum;
- $scope.loadData();
- }
- }
- $scope.selected = [];
- // 选择一条数据
- $scope.selectData = function(check) {
- var datas = {billNumber: check.billNumber, shipingCount: check.shipingCount};
- storeWareDetailService.getStoreWareDetailList(check.id, 'notice').then(function(data) {
- datas.id = data[0].zid;
- datas.houseId = data[0].houseId;
- datas.warehouseId = data[0].warehouseId;
- datas.lypz = data[0].grainKind;
- datas.mxpz = data[0].grainDetailKind;
- datas.lyxz = data[0].grainAttribute;
- datas.dj = data[0].inPrice;
- //查询已结算数量
- var conditions = {htbh:check.billNumber};
- jsglService.getPageInfo(null, null, '0', conditions).then(function(jsdata) {
- var yjssl = 0;
- if (jsdata.list != null) {
- for (var i = 0; i < jsdata.list.length; i++) {
- if (jsdata.list[i].dataStatus=='1') {
- yjssl = commonUtilService.accAdd(yjssl, jsdata.list[i].bcjssl);
- }
- }
- }
- datas.yjssl = yjssl;
- $uibModalInstance.close(datas);
- },function(jsdata){
- console.log(jsdata);
- });
- },function(data){
- console.log(data);
- });
- }
- // 关闭模态窗口
- $scope.cancel = function() {
- $uibModalInstance.close();
- }
- })
|