|
@@ -80,6 +80,8 @@ angular.module('app.storage').controller("keepTotalAccountCtrl",
|
80
|
80
|
$scope.loadData();
|
81
|
81
|
}
|
82
|
82
|
|
|
83
|
+ $scope.butType = $stateParams.butType;
|
|
84
|
+
|
83
|
85
|
//页面跳转
|
84
|
86
|
$scope.edit = function(account, butType) {
|
85
|
87
|
var obj_str = angular.toJson(account);
|
|
@@ -88,12 +90,7 @@ angular.module('app.storage').controller("keepTotalAccountCtrl",
|
88
|
90
|
if (butType != 3) { //记账、审核、查看
|
89
|
91
|
keepAccountService.accountingRecord(null, null, $scope.fcbgz.lspz, $scope.fcbgz.hwxz, rq, $scope.fcbgz.wjh, $scope.fcbgz.remark, 1).then(function(data){
|
90
|
92
|
$scope.account = data.obj;
|
91
|
|
- if (butType == 0) { //记账
|
92
|
|
- if (data.obj.id != null || data.obj.id != undefined) {
|
93
|
|
- alert("当前记录已记账!");
|
94
|
|
- return;
|
95
|
|
- }
|
96
|
|
- } else if (butType == 1) { //审核
|
|
93
|
+ if (butType == 1) { //审核
|
97
|
94
|
if (data.obj.id == null || data.obj.id == undefined) {
|
98
|
95
|
alert("当前记录还尚未记账,请先记账!");
|
99
|
96
|
return;
|
|
@@ -109,6 +106,9 @@ angular.module('app.storage').controller("keepTotalAccountCtrl",
|
109
|
106
|
return;
|
110
|
107
|
}
|
111
|
108
|
}
|
|
109
|
+
|
|
110
|
+ account.id === data.obj.id;
|
|
111
|
+
|
112
|
112
|
$state.go('app.storage.account.keepTotalAccount.keepTotalAccountEdit',{account:angular.toJson(account), butType:butType});
|
113
|
113
|
},function(data){
|
114
|
114
|
console.log(data);
|
|
@@ -129,11 +129,13 @@ angular.module('app.storage').controller("keepTotalAccountCtrl",
|
129
|
129
|
// 获取列表日数据
|
130
|
130
|
$scope.edit = function() {
|
131
|
131
|
$scope.fcbgz = angular.fromJson($stateParams.account);
|
132
|
|
- $scope.fcbgz.lcmc = $rootScope.depotInfo.orgName;
|
133
|
132
|
var rq = $filter('date')($scope.fcbgz.rq, "yyyy-MM");
|
134
|
133
|
keepAccountService.accountingRecord($scope.fcbgz.ch, $scope.fcbgz.hwh, $scope.fcbgz.lspz, $scope.fcbgz.hwxz, rq, $scope.fcbgz.wjh, $scope.fcbgz.remark, 1).then(function(data){
|
135
|
134
|
$scope.account = data.obj;
|
136
|
|
-
|
|
135
|
+ //初始分仓保管账表对象数据
|
|
136
|
+ $scope.fcbgz.lcmc = $rootScope.depotInfo.orgName;
|
|
137
|
+ $scope.fcbgz.rq = rq;
|
|
138
|
+
|
137
|
139
|
if ($stateParams.butType == 0) { //记账
|
138
|
140
|
//初始化数据记账表对象数据
|
139
|
141
|
$scope.account.lspz = $scope.fcbgz.lspz;
|
|
@@ -142,6 +144,8 @@ angular.module('app.storage').controller("keepTotalAccountCtrl",
|
142
|
144
|
$scope.account.srsl = $scope.fcbgz.srsl;
|
143
|
145
|
$scope.account.zcsl = $scope.fcbgz.zcsl;
|
144
|
146
|
$scope.account.kcsl = $scope.fcbgz.kcsl;
|
|
147
|
+ $scope.account.sssh = $scope.fcbgz.sssh; //损失损耗
|
|
148
|
+ $scope.account.zbszsl = $scope.fcbgz.zbszsl; //折标水杂数量
|
145
|
149
|
$scope.account.accountingPerson = $rootScope.userInfo.realName; //记账人
|
146
|
150
|
$scope.account.accountingDate = $filter('date')(new Date(), "yyyy-MM-dd"); //记账时间
|
147
|
151
|
$scope.account.remark = $scope.fcbgz.remark; //摘要
|
|
@@ -172,11 +176,9 @@ angular.module('app.storage').controller("keepTotalAccountCtrl",
|
172
|
176
|
//提交按钮影藏
|
173
|
177
|
$scope.isNotEdit = true;
|
174
|
178
|
}
|
175
|
|
- //初始分仓保管账表对象数据
|
176
|
179
|
$scope.fcbgz.hwxz = $rootScope.dicData[$scope.fcbgz.hwxz];
|
177
|
|
- $scope.fcbgz.lspz = $rootScope.dicData[$scope.fcbgz.lspz];
|
|
180
|
+ $scope.fcbgz.pz = $rootScope.dicData[$scope.fcbgz.pz];
|
178
|
181
|
$scope.fcbgz.dj = $rootScope.dicData[$scope.fcbgz.dj];
|
179
|
|
- $scope.fcbgz.rq = rq;
|
180
|
182
|
},function(data){
|
181
|
183
|
console.log(data);
|
182
|
184
|
});
|