|
|
@@ -1774,27 +1774,27 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * 改变单据日期范围
|
|
|
- */
|
|
|
- var getDateCondition = function(zone, condition) {
|
|
|
- var date = new Date();
|
|
|
- if(zone == -1) {
|
|
|
- condition.dateFrom = null;
|
|
|
- condition.dateTo = null;
|
|
|
- } else if(zone == 1) {
|
|
|
- date.setMonth(date.getMonth() - 1);
|
|
|
- condition.dateFrom = date;
|
|
|
- condition.dateTo = new Date();
|
|
|
- } else if (zone == 6) {
|
|
|
- date.setMonth(date.getMonth() - 6);
|
|
|
- condition.dateFrom = date;
|
|
|
- condition.dateTo = new Date();
|
|
|
- } else {
|
|
|
- date.setMonth(date.getMonth() - 6);
|
|
|
- condition.dateFrom = null;
|
|
|
- condition.dateTo = date;
|
|
|
- }
|
|
|
- };
|
|
|
+ * 改变单据日期范围
|
|
|
+ */
|
|
|
+ var getDateCondition = function(zone, condition) {
|
|
|
+ var date = new Date();
|
|
|
+ if(zone == -1) {
|
|
|
+ condition.dateFrom = null;
|
|
|
+ condition.dateTo = null;
|
|
|
+ } else if(zone == 1) {
|
|
|
+ date.setMonth(date.getMonth() - 1);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ } else if (zone == 6) {
|
|
|
+ date.setMonth(date.getMonth() - 6);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ } else {
|
|
|
+ date.setMonth(date.getMonth() - 6);
|
|
|
+ condition.dateFrom = null;
|
|
|
+ condition.dateTo = date;
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
/**
|
|
|
* 改变单据交货日期范围
|
|
|
@@ -11317,11 +11317,18 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.tender.purchaseTenderProds[i].index = i + 1;
|
|
|
}
|
|
|
$scope.tender.tenderAttaches = $scope.attaches;
|
|
|
- $scope.tender.shipAddress = $scope.tender.shipadd.address + $scope.tender.shipadd.addressdet + ' ' + $scope.tender.shipadd.receiver + ' ' + $scope.tender.shipadd.usertel;
|
|
|
+ if ($scope.tender.shipadd) {
|
|
|
+ $scope.tender.shipAddress = $scope.tender.shipadd.address + $scope.tender.shipadd.addressdet + ' ' + $scope.tender.shipadd.receiver + ' ' + $scope.tender.shipadd.usertel;
|
|
|
+ }
|
|
|
+ angular.forEach($scope.tender.purchaseTenderProds, function(tenderProd){
|
|
|
+ tenderProd.saleTenderItems = []; // 投标相关不用传参,否则会超长
|
|
|
+ });
|
|
|
+
|
|
|
var vendorUUs = [];
|
|
|
- angular.forEach($scope.tenderProd.enterpriseBaseInfo, function(enterpriseBaseInfo){
|
|
|
+ angular.forEach($scope.tenderProd.enterpriseBaseInfo, function(enterpriseBaseInfo){ // 供应商uu号参数
|
|
|
vendorUUs.push(enterpriseBaseInfo.uu);
|
|
|
});
|
|
|
+ console.log($scope);
|
|
|
if (isPublish) { // 发布
|
|
|
toaster.pop('info', '提示', '正在发布,请稍候');
|
|
|
PurcTender.publishSaved({tender: $scope.tender, vendorUUs: vendorUUs}, {}, function(data){
|
|
|
@@ -11335,7 +11342,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
});
|
|
|
} else { // 保存
|
|
|
toaster.pop('info', '提示', '正在保存,请稍候');
|
|
|
- PurcTender.updateSaved({tender: $scope.tender, vendorUUs: vendorUUs}, {}, function(data) {
|
|
|
+ PurcTender.updateSaved({tender: $scope.tender, vendorUUs: vendorUUs}, {}, function(data) {
|
|
|
$scope.loading = false;
|
|
|
sleep(1500); //当前方法暂停1.5秒 给更新索引留点时间
|
|
|
toaster.pop('success', '成功', '保存成功');
|
|
|
@@ -11347,34 +11354,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- $scope.publishSaved = function(tender) {
|
|
|
- var now = new Date() + 1; // 投标截止日为当天的均可以提交
|
|
|
- if (tender.endDate < now) {
|
|
|
- toaster.pop('warning', '警告', '单据已过期,请重新设置日期');
|
|
|
- } else {
|
|
|
- toaster.pop('info', '提示', '正在发布,请稍候');
|
|
|
- PurcTender.publishSaved({tender: tender}, function() {
|
|
|
- sleep(1500); //当前方法暂停1.5秒 给更新索引留点时间
|
|
|
- toaster.pop('success', '提示', '发布成功');
|
|
|
- window.location.hash = '#/purc/tender';
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- // 更新(在录入状态)
|
|
|
- $scope.updateSaved = function(tender) {
|
|
|
- var now = new Date() + 1; // 投标截止日为当天的均可以提交
|
|
|
- if (tender.endDate < now) {
|
|
|
- toaster.pop('warning', '警告', '单据已过期,请重新设置日期');
|
|
|
- } else {
|
|
|
- toaster.pop('info', '提示', '正在保存更新,请稍候');
|
|
|
- PurcTender.updateSaved({tender: tender}, function() {
|
|
|
- sleep(1500); //当前方法暂停1.5秒 给更新索引留点时间
|
|
|
- toaster.pop('success', '提示', '更新成功');
|
|
|
- window.location.hash = '#/purc/tender';
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
$scope.currentDay = function() {
|
|
|
return $filter('date')(new Date(), 'yyyy-MM-dd');
|
|
|
@@ -11805,8 +11784,68 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
*/
|
|
|
app.controller('SaleOpenTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
+ /**
|
|
|
+ * 改变单据日期范围
|
|
|
+ */
|
|
|
+ var getTenderDateCondition = function(zone, condition) {
|
|
|
+ var date = new Date();
|
|
|
+ if(zone == -1) {
|
|
|
+ condition.dateFrom = null;
|
|
|
+ condition.dateTo = null;
|
|
|
+ } else if(zone == 7) { // 一星期内
|
|
|
+ date.setDate(date.getDate() - 7);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ } else if(zone == 1) { // 一个月内
|
|
|
+ date.setMonth(date.getMonth() - 1);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ } else if(zone == 3) { // 三个月内
|
|
|
+ date.setMonth(date.getMonth() - 3);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ } else if (zone == 6) { // 半年内
|
|
|
+ date.setMonth(date.getMonth() - 6);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ } else { // 一年内
|
|
|
+ date.setYear(date.getYear() - 1);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = new Date();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
$scope.active = 'all';
|
|
|
- $scope.condition = {dateZone: 1};
|
|
|
+
|
|
|
+ $scope.dateZoneText = '不限';
|
|
|
+ $scope.deliveryZoneText = '不限';
|
|
|
+ $scope.condition = {dateZone: -1};
|
|
|
+ $scope.changeDateZone = function(zone) {
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
+ getTenderDateCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.parseDate = function(dateStr) {
|
|
|
+ if(dateStr)
|
|
|
+ return Date.parse(dateStr, 'yyyy-MM-dd');
|
|
|
+ return new Date();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ // 选择查找日期
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
// $scope.setActive = function(state) {
|
|
|
// if($scope.active != state) {
|
|
|
// $scope.active = state;
|
|
|
@@ -11851,8 +11890,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
var realActive = {};
|
|
|
pageParams.searchFilter = { // 筛选条件
|
|
|
keyword: $scope.keyword,
|
|
|
- // fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
- // endDate: getDateTime($scope.condition.dateTo)
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
+ endDate: getDateTime($scope.condition.dateTo)
|
|
|
};
|
|
|
AccountEnterprise.get({}, function(data){
|
|
|
$scope.loading = false;
|