|
|
@@ -131,6 +131,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/tender",
|
|
|
templateUrl: "static/tpl/index/purc/tenderlist.html",
|
|
|
controller: 'PurcTenderCtrl'
|
|
|
+ /* 招标答疑列表 */
|
|
|
+ }).state('purc.tenderanswerlist', {
|
|
|
+ url: "/tender/answer",
|
|
|
+ templateUrl: "static/tpl/index/purc/tender_answer_list.html",
|
|
|
+ controller: 'PurcTenderAnswerListCtrl'
|
|
|
+ /* 招标答疑详情 */
|
|
|
+ }).state('purc.tenderanswerdetail', {
|
|
|
+ url: "/tender/answer/:id",
|
|
|
+ templateUrl: "static/tpl/index/purc/tender_answer_detail.html",
|
|
|
+ controller: 'PurcTenderAnswerDetailCtrl'
|
|
|
}).state('purc.waiting.tenderlist', {
|
|
|
url: "/tender",
|
|
|
templateUrl: "static/tpl/index/purc/tenderlist.html",
|
|
|
@@ -225,6 +235,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/tender",
|
|
|
templateUrl: "static/tpl/index/sale/tenderlist.html",
|
|
|
controller: 'SaleTenderCtrl'
|
|
|
+ /* 招标提问列表 */
|
|
|
+ }).state('sale.tenderquestionlist', {
|
|
|
+ url: "/tender/question",
|
|
|
+ templateUrl: "static/tpl/index/sale/tender_question_list.html",
|
|
|
+ controller: 'SaleTenderQuestionListCtrl'
|
|
|
+ /* 招标提问详情 */
|
|
|
+ }).state('sale.tenderquestiondetail', {
|
|
|
+ url: "/tender/question/:id",
|
|
|
+ templateUrl: "static/tpl/index/sale/tender_question_detail.html",
|
|
|
+ controller: 'SaleTenderQuestionDetailCtrl'
|
|
|
}).state('sale.todo.tenderlist', {
|
|
|
url: "/tender",
|
|
|
templateUrl: "static/tpl/index/sale/tenderlist.html",
|
|
|
@@ -17549,7 +17569,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// var maxDate = angular.copy($scope.tender.publishDate);
|
|
|
// maxDate = maxDate.setDate(maxDate.getDate() - 1);
|
|
|
if ($scope.tender.publishDate instanceof Date) {
|
|
|
- var maxDate = new Date($scope.tender.publishDate.getTime() - 1); // 不能选同一天
|
|
|
+ var maxDate = new Date($scope.tender.publishDate.getTime() - 24 * 60 * 60 * 1000 - 1); // 至少提前两天
|
|
|
}
|
|
|
return $scope.tender.publishDate ? $filter('date')(maxDate, 'yyyy-MM-dd') : "";
|
|
|
};
|
|
|
@@ -18024,6 +18044,445 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
}]);
|
|
|
|
|
|
+ /**
|
|
|
+ * 招标提问列表
|
|
|
+ *
|
|
|
+ */
|
|
|
+ app.controller('SaleTenderQuestionListCtrl', ['$scope', '$filter', 'SaleTenderQuestion', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise',
|
|
|
+ function ($scope, $filter, SaleTenderQuestion, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ if ($rootScope.active) {
|
|
|
+ $scope.active = $rootScope.active;
|
|
|
+ $rootScope.active = null;
|
|
|
+ } else {
|
|
|
+ $scope.active = 'todo';
|
|
|
+ }
|
|
|
+ $scope.searchStatus = false;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 改变类型
|
|
|
+ */
|
|
|
+ var getTypeCondition = function (zone, condition) {
|
|
|
+ if (zone == -1) {
|
|
|
+ condition.ifOpen = null;
|
|
|
+ } else if (zone == 1) {
|
|
|
+ condition.ifOpen = 1;
|
|
|
+ } else {
|
|
|
+ condition.ifOpen = 0;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.dateZoneText = '不限';
|
|
|
+ $scope.typeText = '全部';
|
|
|
+ $scope.deliveryZoneText = '不限';
|
|
|
+ $scope.condition = {dateZone: 1, deliveryZone: -1, type: -1};
|
|
|
+
|
|
|
+ /* 时间筛选初始化*/
|
|
|
+ var fromDate = new Date();
|
|
|
+ var toDate = new Date();
|
|
|
+ fromDate.setMonth(fromDate.getMonth() - 1);
|
|
|
+ fromDate.setHours(0, 0, 0, 0);
|
|
|
+ toDate.setHours(23, 59, 59, 999);
|
|
|
+ $scope.condition.dateFrom = fromDate;
|
|
|
+ $scope.condition.dateTo = toDate;
|
|
|
+
|
|
|
+ $scope.changeDateZone = function (zone) {
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
+ $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+ $scope.changeDeliveryZone = function (zone) {
|
|
|
+ $scope.condition.deliveryZoneText = zone;
|
|
|
+ $scope.deliveryZoneText = typeof zone == 'undefined' ? '不限' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '两个月内'));
|
|
|
+ $scope.condition.$delievryZoneOpen = false;
|
|
|
+ getDelveryCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.changeType = function (type) {
|
|
|
+ $scope.condition.type = type;
|
|
|
+ $scope.typeText = typeof type == 'undefined' ? '全部' : (type == -1 ? '全部' : (type == 1 ? '公开' : '指定'));
|
|
|
+ getTypeCondition(type, $scope.condition);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.setActive = function (state) {
|
|
|
+ if ($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if ($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ //TODO 增加直接从数据库取方法之后修改
|
|
|
+ var getService = function () {
|
|
|
+ if ($scope.searchStatus) {
|
|
|
+ return SaleTenderQuestion;
|
|
|
+ }
|
|
|
+ return SaleTenderQuestion;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
+ page: 1,
|
|
|
+ count: 20,
|
|
|
+ sorting: {
|
|
|
+ 'id': 'desc'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ var realActive = {};
|
|
|
+ pageParams.searchFilter = { // 筛选条件
|
|
|
+ keyword: $scope.keyword,
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
+ endDate: getDateTime($scope.condition.dateTo)
|
|
|
+ };
|
|
|
+ AccountEnterprise.get({}, function (data) {
|
|
|
+ $scope.currentEn = data;
|
|
|
+ });
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //TODO 获得各分类未阅读数量
|
|
|
+
|
|
|
+ //TODO 设置单据已读
|
|
|
+
|
|
|
+ $scope.openDatePicker = function ($event, item, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.openFilterDatePicker = function ($event, item, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
+ if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $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.onSearch = function (keyword) {
|
|
|
+ // 每次搜索重置获取数据方法
|
|
|
+ $scope.searchMethod = false;
|
|
|
+ if(keyword != null && keyword != '') {
|
|
|
+ $scope.searchMethod = true;
|
|
|
+ }
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 投标单提问单详情
|
|
|
+ */
|
|
|
+ app.controller('SaleTenderQuestionDetailCtrl', ['$scope', 'toaster', 'BaseService', 'SaleTenderQuestion', '$stateParams'
|
|
|
+ , function($scope, toaster, BaseService, SaleTenderQuestion, $stateParams){
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+
|
|
|
+ $scope.loading = true;
|
|
|
+ var loadData = function () {
|
|
|
+ SaleTenderQuestion.getDetail({id: $stateParams.id}, function(data){
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.question = data;
|
|
|
+ } , function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ loadData();
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 招标答疑列表
|
|
|
+ *
|
|
|
+ */
|
|
|
+ app.controller('PurcTenderAnswerListCtrl', ['$scope', '$filter', 'SaleTenderQuestion', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise',
|
|
|
+ function ($scope, $filter, SaleTenderQuestion, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ if ($rootScope.active) {
|
|
|
+ $scope.active = $rootScope.active;
|
|
|
+ $rootScope.active = null;
|
|
|
+ } else {
|
|
|
+ $scope.active = 'todo';
|
|
|
+ }
|
|
|
+ $scope.searchStatus = false;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 改变类型
|
|
|
+ */
|
|
|
+ var getTypeCondition = function (zone, condition) {
|
|
|
+ if (zone == -1) {
|
|
|
+ condition.ifOpen = null;
|
|
|
+ } else if (zone == 1) {
|
|
|
+ condition.ifOpen = 1;
|
|
|
+ } else {
|
|
|
+ condition.ifOpen = 0;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当前页面状态按钮过滤
|
|
|
+ */
|
|
|
+ var getAnswer = function (active) {
|
|
|
+ var fn = 'getAllAnswer';
|
|
|
+ switch (active) {
|
|
|
+ case 'done':
|
|
|
+ fn = 'getDoneAnswer';
|
|
|
+ break;
|
|
|
+ case 'todo':
|
|
|
+ fn = 'getTodoAnswer';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return fn;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.dateZoneText = '不限';
|
|
|
+ $scope.typeText = '全部';
|
|
|
+ $scope.deliveryZoneText = '不限';
|
|
|
+ $scope.condition = {dateZone: 1, deliveryZone: -1, type: -1};
|
|
|
+
|
|
|
+ /* 时间筛选初始化*/
|
|
|
+ var fromDate = new Date();
|
|
|
+ var toDate = new Date();
|
|
|
+ fromDate.setMonth(fromDate.getMonth() - 1);
|
|
|
+ fromDate.setHours(0, 0, 0, 0);
|
|
|
+ toDate.setHours(23, 59, 59, 999);
|
|
|
+ $scope.condition.dateFrom = fromDate;
|
|
|
+ $scope.condition.dateTo = toDate;
|
|
|
+
|
|
|
+ $scope.changeDateZone = function (zone) {
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
+ $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+ $scope.changeDeliveryZone = function (zone) {
|
|
|
+ $scope.condition.deliveryZoneText = zone;
|
|
|
+ $scope.deliveryZoneText = typeof zone == 'undefined' ? '不限' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '两个月内'));
|
|
|
+ $scope.condition.$delievryZoneOpen = false;
|
|
|
+ getDelveryCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.changeType = function (type) {
|
|
|
+ $scope.condition.type = type;
|
|
|
+ $scope.typeText = typeof type == 'undefined' ? '全部' : (type == -1 ? '全部' : (type == 1 ? '公开' : '指定'));
|
|
|
+ getTypeCondition(type, $scope.condition);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.setActive = function (state) {
|
|
|
+ if ($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if ($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ //TODO 增加直接从数据库取方法之后修改
|
|
|
+ var getService = function () {
|
|
|
+ if ($scope.searchStatus) {
|
|
|
+ return SaleTenderQuestion;
|
|
|
+ }
|
|
|
+ return SaleTenderQuestion;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
+ page: 1,
|
|
|
+ count: 20,
|
|
|
+ sorting: {
|
|
|
+ 'id': 'desc'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ var realActive = {};
|
|
|
+ pageParams.searchFilter = { // 筛选条件
|
|
|
+ keyword: $scope.keyword,
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
+ endDate: getDateTime($scope.condition.dateTo)
|
|
|
+ };
|
|
|
+ AccountEnterprise.get({}, function (data) {
|
|
|
+ $scope.currentEn = data;
|
|
|
+ });
|
|
|
+ getService()[getAnswer($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //TODO 获得各分类未阅读数量
|
|
|
+
|
|
|
+ //TODO 设置单据已读
|
|
|
+
|
|
|
+ $scope.openDatePicker = function ($event, item, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.openFilterDatePicker = function ($event, item, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
+ if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $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.onSearch = function (keyword) {
|
|
|
+ // 每次搜索重置获取数据方法
|
|
|
+ $scope.searchMethod = false;
|
|
|
+ if(keyword != null && keyword != '') {
|
|
|
+ $scope.searchMethod = true;
|
|
|
+ }
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 招标答疑单详情
|
|
|
+ */
|
|
|
+ app.controller('PurcTenderAnswerDetailCtrl', ['$scope', 'toaster', 'BaseService', 'SaleTenderQuestion', '$stateParams', '$modal'
|
|
|
+ , function($scope, toaster, BaseService, SaleTenderQuestion, $stateParams, $modal){
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+
|
|
|
+ $scope.loading = true;
|
|
|
+ var loadData = function () {
|
|
|
+ SaleTenderQuestion.getAnswerDetail({id: $stateParams.id}, function(data){
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.answer = data;
|
|
|
+ var now = new Date();
|
|
|
+ if ($scope.answer.questionEndDate < now.getTime()) {
|
|
|
+ $scope.answer.questionEnd = 1;
|
|
|
+ } else {
|
|
|
+ $scope.answer.questionEnd = 0;
|
|
|
+ }
|
|
|
+ } , function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ loadData();
|
|
|
+
|
|
|
+ // 回答
|
|
|
+ $scope.sendAnswer = function (){
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/purc/tender_answer.html',
|
|
|
+ controller: 'PurcTenderAnswerCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+ answer: function () {
|
|
|
+ return $scope.answer;
|
|
|
+ } //传递当前答疑单到模态框Controller
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function () {
|
|
|
+ toaster.pop('success', '答疑成功');
|
|
|
+ }, function () {
|
|
|
+
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 招标单答疑
|
|
|
+ */
|
|
|
+ app.controller('PurcTenderAnswerCtrl', ['$scope', 'answer','$modalInstance', '$upload', 'toaster', function($scope, answer, $modalInstance, $upload ,toaster){
|
|
|
+ $scope.answer = answer;
|
|
|
+
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ //确认回答
|
|
|
+ $scope.ok = function (form) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var files = form.attachFile.$viewValue, file = files && files.length > 0 ? files[0] : null;
|
|
|
+ $upload.upload({
|
|
|
+ url: 'tender/question/answer/send',
|
|
|
+ method: 'POST',
|
|
|
+ file: file,
|
|
|
+ data: {
|
|
|
+ json: $scope.answer
|
|
|
+ }
|
|
|
+ }).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ $modalInstance.close('success');
|
|
|
+ }).error(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '错误', '出现异常,答疑失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
/**
|
|
|
* 平台公开招标
|
|
|
*
|
|
|
@@ -18229,6 +18688,46 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
|
});
|
|
|
|
|
|
+ // 提问
|
|
|
+ $scope.sendQuestion = function (){
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/sale/tender_question.html',
|
|
|
+ controller: 'SaleTenderQuestionCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+ saleTender: function () {
|
|
|
+ return $scope.saleTender;
|
|
|
+ } //传递当前投标单到模态框Controller
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function () {
|
|
|
+ toaster.pop('success', '提问成功');
|
|
|
+ }, function () {
|
|
|
+
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // // 提问记录
|
|
|
+ // $scope.showQuestionHistory = function (){
|
|
|
+ // var modalInstance = $modal.open({
|
|
|
+ // animation: true,
|
|
|
+ // templateUrl: 'static/tpl/index/sale/tender_question_history.html',
|
|
|
+ // controller: 'saleTenderQuestionHistoryCtrl',
|
|
|
+ // size: 'lg',
|
|
|
+ // resolve: {
|
|
|
+ // saleTender: function () {
|
|
|
+ // return $scope.saleTender;
|
|
|
+ // } //传递当前投标单到模态框Controller
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // modalInstance.result.then(function () {
|
|
|
+ //
|
|
|
+ // }, function () {
|
|
|
+ //
|
|
|
+ // });
|
|
|
+ // };
|
|
|
+
|
|
|
$scope.upload = function (myFile) { // 上传附件
|
|
|
var file = $scope.myFile, file = file && file.length > 0 ? file : null;
|
|
|
$upload.upload({
|
|
|
@@ -18364,6 +18863,62 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
+ /**
|
|
|
+ * 投标单提问
|
|
|
+ */
|
|
|
+ app.controller('SaleTenderQuestionCtrl', ['$scope', 'saleTender','$modalInstance', '$upload', 'toaster', function($scope, saleTender, $modalInstance, $upload ,toaster){
|
|
|
+ $scope.saleTender = saleTender;
|
|
|
+
|
|
|
+ // 当前日期,用作新增提问
|
|
|
+ $scope.currentDay = new Date();
|
|
|
+
|
|
|
+ $scope.question = {
|
|
|
+ inDate : null,
|
|
|
+ replyDate : null,
|
|
|
+ topic : null,
|
|
|
+ status : null,
|
|
|
+ content : null,
|
|
|
+ questionAttaches : []
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ //确认提问
|
|
|
+ $scope.ok = function (form) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var files = form.attachFile.$viewValue, file = files && files.length > 0 ? files[0] : null;
|
|
|
+ $upload.upload({
|
|
|
+ url: 'tender/question/send/' + $scope.saleTender.id,
|
|
|
+ method: 'POST',
|
|
|
+ file: file,
|
|
|
+ data: {
|
|
|
+ json: $scope.question
|
|
|
+ }
|
|
|
+ }).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ $modalInstance.close('success');
|
|
|
+ }).error(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '错误', '出现异常,提问失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+ // /**
|
|
|
+ // * 当前投标单提问记录
|
|
|
+ // */
|
|
|
+ // app.controller('saleTenderQuestionHistoryCtrl', ['$scope', 'saleTender','$modalInstance', 'toaster', function($scope, saleTender, $modalInstance, toaster){
|
|
|
+ // $scope.saleTender = saleTender;
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // $scope.cancel = function() {
|
|
|
+ // $modalInstance.dismiss();
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // }]);
|
|
|
+
|
|
|
/**
|
|
|
* 公开招标转投标单
|
|
|
*/
|