|
|
@@ -3326,10 +3326,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
var str = '';
|
|
|
angular.forEach($scope.tableParams.data, function (order) {
|
|
|
if (order.$selected == true) {
|
|
|
- angular.forEach(order.orderItems, function (item) {
|
|
|
- str += item.id;
|
|
|
- str += ',';
|
|
|
- });
|
|
|
+ str += order.id;
|
|
|
+ str += ',';
|
|
|
}
|
|
|
});
|
|
|
if (!(str == '')) {
|
|
|
@@ -3459,12 +3457,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.isUser = data.isUser;
|
|
|
});
|
|
|
|
|
|
+ var existFile = false;
|
|
|
var loadData = function () {
|
|
|
PurcOrder.get({id: $stateParams.id}, function (data) {
|
|
|
$scope.order = data;
|
|
|
var sum = 0;
|
|
|
angular.forEach($scope.order.orderItems, function (item) {
|
|
|
sum += item.qty * item.price;
|
|
|
+ if (item.attachs.length > 0) {
|
|
|
+ existFile = true;
|
|
|
+ }
|
|
|
});
|
|
|
$scope.order.total = sum;
|
|
|
if ($scope.order.display == 1) {//未查看的设为已查看
|
|
|
@@ -3565,10 +3567,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 下载附件
|
|
|
$scope.fileDownload = function (id) {
|
|
|
- window.open("file/batch/" + id);
|
|
|
+ if (!existFile) {
|
|
|
+ toaster.pop('error', '提示', "当前采购单不存在附件信息");
|
|
|
+ } else {
|
|
|
+ window.open("file/batch/" + id);
|
|
|
+ }
|
|
|
}
|
|
|
}]);
|
|
|
+
|
|
|
app.controller('SaleChangeCtrl', ['$scope', '$filter', 'PurcChange', 'PurcChanges', 'ngTableParams', 'toaster', 'BaseService', 'PurcChangeHis', 'CurrentRole', function ($scope, $filter, PurcChange, PurcChanges, ngTableParams, toaster, BaseService, PurcChangeHis, CurrentRole) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
|
|
|
@@ -7141,7 +7149,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/* 时间筛选初始化*/
|
|
|
var fromDate = new Date();
|
|
|
var toDate = new Date();
|
|
|
- fromDate.setMonth(fromDate.getMonth() - 1);
|
|
|
+ fromDate.setMonth(fromDate.getMonth() - 6);
|
|
|
fromDate.setHours(0, 0, 0, 0);
|
|
|
toDate.setHours(23, 59, 59, 999);
|
|
|
$scope.condition.dateFrom = fromDate;
|