|
|
@@ -1,6 +1,6 @@
|
|
|
-define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers', 'service/File', 'service/PublicInquiry', 'service/Customer'], function () {
|
|
|
+define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives', 'service/Purc', 'service/Make', 'service/Fa', 'service/Account', 'service/Alert', 'service/CheckTel', 'ui.router', 'ui.bootstrap', 'file-upload', 'ngSanitize', 'service/BaseInfo', 'service/Cart', 'service/ApprovalFlow', 'service/DeputyOrder', 'service/Product', 'service/Token', 'service/ProductUsers', 'service/File', 'service/PublicInquiry', 'service/Customer', 'service/PurcChange'], function () {
|
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour', 'FileService', 'publicInquiryService', 'CustomerService']);
|
|
|
+ var app = angular.module('myApp', ['toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'common.directives', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService', 'ProductInfoServices', 'TokenService', 'ProductUserService', 'ui.tour', 'FileService', 'publicInquiryService', 'CustomerService', 'changeService']);
|
|
|
app.init = function () {
|
|
|
angular.bootstrap(document, ['myApp']);
|
|
|
};
|
|
|
@@ -128,6 +128,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
url: "/deputy/:id",
|
|
|
templateUrl: "static/tpl/index/purc/deputyOrder_detail.html",
|
|
|
controller: 'DeputyOrderDetailCtrl'
|
|
|
+ }).state('purc.changeList', {// 新增采购变更单
|
|
|
+ url: "/change",
|
|
|
+ templateUrl: "static/tpl/index/purc/changeList.html",
|
|
|
+ controller: 'PurcChangeListCtrl'
|
|
|
+ /* 招标列表 */
|
|
|
+ }).state('purc.changeNew', {// 新增采购变更单
|
|
|
+ url: "/change_new",
|
|
|
+ templateUrl: "static/tpl/index/purc/change_new.html",
|
|
|
+ controller: 'PurcChangeNewCtrl'
|
|
|
/* 招标列表 */
|
|
|
}).state('purc.tenderlist', {
|
|
|
url: "/tender",
|
|
|
@@ -23858,6 +23867,279 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
|
|
|
}]);
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 采购变更单列表
|
|
|
+ *
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-06-25 17:13
|
|
|
+ */
|
|
|
+ app.controller('PurcChangeListCtrl', ['$scope', '$filter', 'change', 'ngTableParams', 'toaster', 'BaseService', 'CurrentRole', function ($scope, $filter, change, ngTableParams, toaster, BaseService, CurrentRole) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+
|
|
|
+ $scope.active = 'todo';
|
|
|
+ $scope.agreedText = '全部';
|
|
|
+ $scope.dateZoneText = '一个月内';
|
|
|
+ $scope.condition = {dateZone: 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.changeAgreed = function (agreed) {
|
|
|
+ $scope.condition.agreed = agreed;
|
|
|
+ $scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
|
|
|
+ $scope.condition.$agreedOpen = false;
|
|
|
+ };
|
|
|
+ $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.setActive = function (state) {
|
|
|
+ if ($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if ($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var getService = function () {
|
|
|
+ return change;
|
|
|
+ };
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
+ page: 1,
|
|
|
+ count: 20,
|
|
|
+ sorting: {
|
|
|
+ date: 'desc'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData: function ($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.searchFilter = {
|
|
|
+ keyword: $scope.keyword,
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
+ endDate: getDateTime($scope.condition.dateTo)
|
|
|
+ };
|
|
|
+ getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
|
|
|
+ }
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $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.onSearch = function (keyword) {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 导出
|
|
|
+ $scope.exportXls = function () {
|
|
|
+ PurcChange.exportXls({}, {}, function (data) {
|
|
|
+ if (data.success){
|
|
|
+ window.location.href = 'sale/changes/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
|
|
|
+ }
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增采购变更单
|
|
|
+ *
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-06-25 16:38
|
|
|
+ */
|
|
|
+ app.controller('PurcChangeNewCtrl', ['$scope', 'toaster', 'BaseService', 'AuthenticationService', '$modal',
|
|
|
+ function ($scope, toaster, BaseService, AuthenticationService, $modal) {
|
|
|
+ // 获取登录人员信息
|
|
|
+ AuthenticationService.getAuthentication().success(function (data) {
|
|
|
+ $scope.user = data;
|
|
|
+ $scope.change = {
|
|
|
+ date: new Date(),
|
|
|
+ recorder: $scope.user.userName
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.getEnableOrders = function() {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/search/enterpirseInfo.html',
|
|
|
+ controller: 'EnableChangeListCtrl',
|
|
|
+ resolve: {
|
|
|
+ enname: function () {
|
|
|
+ return name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function (data) {
|
|
|
+ InvitationRecord.invite({formStore: data}, {}, function (data) {
|
|
|
+ if (data.success) {
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
+ }
|
|
|
+ if (data.error) {
|
|
|
+ toaster.pop('error', '提示', data.error);
|
|
|
+ }
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取课已作为采购变更单的采购单
|
|
|
+ *
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-06-25 18:41
|
|
|
+ */
|
|
|
+ app.controller('EnableChangeListCtrl', ['$scope', 'change', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance',
|
|
|
+ function ($scope, change, BaseService, ngTableParams, toaster, $modalInstance) {
|
|
|
+
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
+ page: 1,
|
|
|
+ count: 5,
|
|
|
+ sorting: {
|
|
|
+ 'id': 'desc'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ counts: [],
|
|
|
+ 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)
|
|
|
+ };
|
|
|
+ change.getEnableOrderList.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (page) {
|
|
|
+ params.total(page.totalElements);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.close = function () {
|
|
|
+ $modalInstance.close();
|
|
|
+ window.location.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ $scope.checks = {
|
|
|
+ checked: false
|
|
|
+ };// 全选框
|
|
|
+
|
|
|
+ $scope.checkAll = function () {
|
|
|
+ angular.forEach($scope.tableParams.data, function (message) {
|
|
|
+ message.checked = $scope.checks.checked;
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 单选
|
|
|
+ $scope.checkOne = function (vendor) {
|
|
|
+ vendor.checked = true;
|
|
|
+
|
|
|
+ var checked = true;
|
|
|
+ angular.forEach($scope.tableParams.data, function (message) { // 单选全部时,全选选中
|
|
|
+ if (!message.checked) {
|
|
|
+ checked = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $scope.checks.checked = checked;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 单反选
|
|
|
+ $scope.unCheckOne = function (vendor) {
|
|
|
+ vendor.checked = false;
|
|
|
+ $scope.checks.checked = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当前页标为已读
|
|
|
+ */
|
|
|
+ $scope.setRead = function () {
|
|
|
+ $scope.loading = true;
|
|
|
+ var messageIds = [];
|
|
|
+ angular.forEach($scope.tableParams.data, function(message) {
|
|
|
+ messageIds.push(message.id);
|
|
|
+ });
|
|
|
+ PagingRelease.setPageRead({}, messageIds, function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (data.success) {
|
|
|
+ toaster.pop("success", "设置已读成功");
|
|
|
+ }
|
|
|
+ if (data.error) {
|
|
|
+ toaster.pop("error", "设置已读失败");
|
|
|
+ }
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 点击内容连接之后,信息标为已读
|
|
|
+ $scope.setOneRead = function (id) {
|
|
|
+ $scope.loading = true;
|
|
|
+ $modalInstance.close();
|
|
|
+ PagingRelease.setMessageRead({id: id}, {}, function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function () {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
return app;
|
|
|
});
|