|
|
@@ -1,6 +1,6 @@
|
|
|
-define([ 'toaster', 'charts', 'ngTable', 'common/services', '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'], 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'], function() {
|
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', [ 'toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices', 'AccountServices', 'AlertServices', 'ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'CheckTelModule', 'ProductServices', 'CartServices', 'ApprvoalFlowService', 'DeputyOrderService']);
|
|
|
+ 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']);
|
|
|
app.init = function() {
|
|
|
angular.bootstrap(document, [ 'myApp' ]);
|
|
|
};
|
|
|
@@ -458,14 +458,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}).state('baseInfo.businessGroups', {
|
|
|
url : '/businessGroups',
|
|
|
controller : 'BusinessGroupsCtrl'
|
|
|
- }).state('baseInfo.inquiryList', {
|
|
|
- url : '/inquiryList',
|
|
|
- templateUrl : "static/tpl/index/baseInfo/inquiry_list.html",
|
|
|
- controller : 'PublicInquiryListCtrl'
|
|
|
- }).state('baseInfo.inquiryListDetail', {
|
|
|
- url : '/inquiryList/:id',
|
|
|
- templateUrl : "static/tpl/index/baseInfo/inquiryItem_detail.html",
|
|
|
- controller : 'PublicInquiryListDetailCtrl'
|
|
|
}).state('qc', {
|
|
|
url : "/qc",
|
|
|
views : {
|
|
|
@@ -815,7 +807,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.tableParams.page(1);
|
|
|
$scope.tableParams.reload();
|
|
|
});
|
|
|
- $scope.checks.checked = false;
|
|
|
};
|
|
|
|
|
|
// 搜索框回车
|
|
|
@@ -2784,8 +2775,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.inquiry = {
|
|
|
code: 'XJ' + $filter('date')(new Date(), 'yyMMddsss'),
|
|
|
showdate: $filter('date')(new Date, 'yyyy-MM-dd'),
|
|
|
- priceType: '采购',
|
|
|
- isOpen: 0
|
|
|
+ priceType: '采购'
|
|
|
};
|
|
|
|
|
|
$scope.currentDay = function() {
|
|
|
@@ -2902,7 +2892,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
// 保存
|
|
|
$scope.save = function() {
|
|
|
- console.log($scope.inquiry);
|
|
|
// var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
|
|
|
// $upload.upload({
|
|
|
// url: 'product/baseInfo/updateProdInfo',
|
|
|
@@ -2923,76 +2912,36 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
// $scope.loadingShow = false;
|
|
|
// toaster.pop('error', '操作失败', data.error);
|
|
|
// });
|
|
|
- if($scope.inquiry.isOpen == 0) {
|
|
|
- if( $scope.vendors.length > 0) { // 指定询价
|
|
|
- PurchaseInquiry.save({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
|
|
|
- if(data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- $timeout(function() {
|
|
|
- window.location.hash = "#/purc/inquiry_unapply";
|
|
|
- }, 500);
|
|
|
- }
|
|
|
- if(data.error) {
|
|
|
- toaster.pop('error', '提示', data.error);
|
|
|
- }
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- });
|
|
|
- } else {
|
|
|
- toaster.pop('info', '提示', '请先选择供应商');
|
|
|
- }
|
|
|
- } else {
|
|
|
- PurchaseInquiry.saveWithoutVendor({inquiry: $scope.inquiry}, {}, function(data) {
|
|
|
- if(data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- $timeout(function() {
|
|
|
- window.location.hash = "#/purc/inquiry_unapply";
|
|
|
- }, 500);
|
|
|
- }
|
|
|
- if(data.error) {
|
|
|
- toaster.pop('error', '提示', data.error);
|
|
|
- }
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
+ PurchaseInquiry.save({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
|
|
|
+ if(data.success) {
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
+ $timeout(function() {
|
|
|
+ window.loaction.hash = "#/purc/inquiry_unapply";
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ if(data.error) {
|
|
|
+ toaster.pop('error', '提示', data.error);
|
|
|
+ }
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 保存并提交
|
|
|
$scope.submit = function() {
|
|
|
- if( $scope.inquiry.isOpen == 0) { // 指定询价
|
|
|
- if($scope.vendors.length > 0) {
|
|
|
- PurchaseInquiry.submit({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
|
|
|
- if(data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- $timeout(function() {
|
|
|
- window.location.hash = "#/purc/purchaseinquiry";
|
|
|
- }, 500);
|
|
|
- }
|
|
|
- if(data.error) {
|
|
|
- toaster.pop('error', '提示', data.error);
|
|
|
- }
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- });
|
|
|
- } else {
|
|
|
- toaster.pop('info', '提示', '请先选择供应商');
|
|
|
+ PurchaseInquiry.submit({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
|
|
|
+ if(data.success) {
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
+ $timeout(function() {
|
|
|
+ window.location.hash = "#/purc/inquiry_unapply";
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ if(data.error) {
|
|
|
+ toaster.pop('error', '提示', data.error);
|
|
|
}
|
|
|
- } else {
|
|
|
- PurchaseInquiry.saveAndSubmitWithoutVendor({inquiry: $scope.inquiry}, {}, function(data) {
|
|
|
- if(data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- $timeout(function() {
|
|
|
- window.location.hash = "#/purc/purchaseinquiry";
|
|
|
- }, 500);
|
|
|
- }
|
|
|
- if(data.error) {
|
|
|
- toaster.pop('error', '提示', data.error);
|
|
|
- }
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
@@ -3170,193 +3119,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
toaster.pop('error', '提示', response.data);
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- // 发布公共询价
|
|
|
- $scope.publish = function(id) {
|
|
|
- PurchaseInquiry.publishInquiry({id: id}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- })
|
|
|
- }
|
|
|
- }]);
|
|
|
-
|
|
|
- // 公共询价列表
|
|
|
- app.controller('PublicInquiryListCtrl', ['$scope', '$stateParams', 'PurchaseInquiry','$filter', 'toaster', 'BaseService', 'ngTableParams', function($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams) {
|
|
|
- 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.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;
|
|
|
- // if($scope.tableParams.page() == 1)
|
|
|
- // $scope.tableParams.reload();
|
|
|
- // else
|
|
|
- // $scope.tableParams.page(1);
|
|
|
- // }
|
|
|
- // };
|
|
|
-
|
|
|
- $scope.nowdate = new Date().getTime();
|
|
|
- var getOpenState = function(active) {
|
|
|
- var fn = 'getOpenAll';
|
|
|
- switch(active) {
|
|
|
- case 'all':
|
|
|
- fn = 'getOpenAll';break;
|
|
|
- case 'todo':
|
|
|
- fn = 'getOpenTodo';break;
|
|
|
- case 'end':
|
|
|
- fn = 'getOpenEnd';break;
|
|
|
- }
|
|
|
- return fn;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.tableParams = new ngTableParams({
|
|
|
- page : 1,
|
|
|
- count : 10,
|
|
|
- sorting: {
|
|
|
-// 'tender.endDate': 'desc',
|
|
|
-// 'tender.enterprise.enName': 'asc',
|
|
|
-// 'tender.code': 'asc'
|
|
|
- }
|
|
|
- }, {
|
|
|
- total : 0,
|
|
|
- counts: [10, 25, 50, 100],
|
|
|
- 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.loading = false;
|
|
|
-// $scope.currentEn = data;
|
|
|
-// });
|
|
|
- PurchaseInquiry.publicInquiryItem.call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
- $scope.loading = false;
|
|
|
- if(page) {
|
|
|
- params.total(page.totalElement);
|
|
|
- $defer.resolve(page.content);
|
|
|
- // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
- }
|
|
|
- }, function(response){
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '数据加载失败', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $scope.toDetail = function(id) {
|
|
|
- window.location.hash = '#/baseInfo/inquiryList/' + id;
|
|
|
- };
|
|
|
-
|
|
|
- // 搜索框回车
|
|
|
- $scope.onSearch = function() {
|
|
|
- $scope.tableParams.page(1);
|
|
|
- $scope.tableParams.reload();
|
|
|
- };
|
|
|
-
|
|
|
- }]);
|
|
|
-
|
|
|
- /**
|
|
|
- * 公共询价详情
|
|
|
- */
|
|
|
- app.controller('PublicInquiryListDetailCtrl', ['$scope', '$stateParams', 'PurchaseInquiry','$filter', 'toaster', 'BaseService', 'ngTableParams', 'AccountEnterprise', function($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams, AccountEnterprise) {
|
|
|
- BaseService.scrollBackToTop();
|
|
|
- var loadData = function() {
|
|
|
- PurchaseInquiry.inquiryItemDetail({id: $stateParams.id}, function(data) {
|
|
|
- $scope.inquiryItem = data;
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
- loadData();
|
|
|
-
|
|
|
- // 当前时间
|
|
|
- $scope.nowdate = new Date().getTime();
|
|
|
-
|
|
|
- // 当前企业
|
|
|
- AccountEnterprise.get({}, function(data){
|
|
|
- $scope.loading = false;
|
|
|
- $scope.enterprise = data;
|
|
|
- });
|
|
|
-
|
|
|
- // 转客户询价
|
|
|
- $scope.transtoInquiry = function(id) {
|
|
|
- PurchaseInquiry.transtoInquiry({id: id}, {}, function(data) {
|
|
|
- if(data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
- }
|
|
|
- if(data.error) {
|
|
|
- toaster.pop('error', '提示', data.error);
|
|
|
- }
|
|
|
- if(data.info) {
|
|
|
- toaster.pop('info', '提示', data.info);
|
|
|
- }
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '提示', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
}]);
|
|
|
-
|
|
|
// 询价单明细
|
|
|
app.controller('PurcInquiryDetailCtrl', ['$scope', '$stateParams', 'PurcInquiry','$filter', 'toaster', function($scope, $stateParams, PurcInquiry,$filter, toaster){
|
|
|
var loadData = function() {
|
|
|
@@ -6288,27 +6051,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
//未对账单据列表
|
|
|
app.controller('PurchaseApCheckListCtrl',['$scope', 'FaApCheck', 'toaster', '$state','$filter', '$modal', function($scope, FaApCheck, toaster, $state, $filter, $modal){
|
|
|
- $scope.data = {};// 列表数据
|
|
|
- $scope.loading = true;
|
|
|
-// $scope.getData = function(){
|
|
|
-// FaApCheck.getAll(function(data){
|
|
|
-// $scope.data = data;
|
|
|
-// angular.forEach($scope.data, function(item) {
|
|
|
-// item:{
|
|
|
-// $selected:true;
|
|
|
-// }
|
|
|
-// });
|
|
|
-// $scope.loading = false;
|
|
|
-// });
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
- document.getElementById('suuorname').focus();//光标默认在客户
|
|
|
-
|
|
|
-// $scope.getData();
|
|
|
+ $scope.data = [];// 列表数据
|
|
|
|
|
|
$scope.condition = {
|
|
|
- $fromOpened:false
|
|
|
+ $fromOpened: false
|
|
|
}
|
|
|
|
|
|
$scope.openDatePicker = function($event, item, openParam) {
|
|
|
@@ -6319,7 +6065,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
//查找客户
|
|
|
$scope.searchCust = function(suuorname) {
|
|
|
- console.log('eeee');
|
|
|
var modalInstance = $modal.open({
|
|
|
animation: true,
|
|
|
templateUrl: 'static/tpl/index/fa/custInfo.html',
|
|
|
@@ -6338,8 +6083,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
// 点击筛选根据条件选择数据
|
|
|
$scope.suuorname = '';
|
|
|
- $scope.sdateFrom = '';
|
|
|
- $scope.sdateTo = '';
|
|
|
+ // 默认本月
|
|
|
+ $scope.sdateTo = new Date();
|
|
|
+ $scope.sdateFrom = new Date($scope.sdateTo.getFullYear(), $scope.sdateTo.getMonth(), 1);
|
|
|
$scope.vuuorname = '';
|
|
|
$scope.factory = '';
|
|
|
$scope.prodTitle = '';
|
|
|
@@ -6353,10 +6099,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.condition.prodSpec = '';
|
|
|
|
|
|
$scope.searchOrder = function(check) {
|
|
|
- angular.forEach($scope.data, function(item) {
|
|
|
- $scope.checkboxes.checked = false;
|
|
|
- item.$selected = false;
|
|
|
- });
|
|
|
+ $scope.data = [];
|
|
|
+ $scope.checkboxes.checked = false;
|
|
|
$scope.totalMoney = 0;
|
|
|
$scope.condition.uuorname = $scope.suuorname;
|
|
|
$scope.condition.factory = $scope.factory
|
|
|
@@ -6370,14 +6114,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.condition.dateTo = ($scope.sdateTo || 0);
|
|
|
}
|
|
|
$scope.condition.venduuorname = $scope.vuuorname;
|
|
|
-// //物料名称和物料规格存在特殊符号,用|作分割符
|
|
|
-// $scope.keywordXls = angular.copy(($scope.condition.uuorname == null ? "" : $scope.condition.uuorname)
|
|
|
-// + "|"+ ($scope.condition.venduuorname == null ? "" : $scope.condition.venduuorname)
|
|
|
-// + "|"+ ($scope.condition.factory == null ? "" : $scope.condition.factory)
|
|
|
-// + "|"+ ($scope.condition.prodTitle == null ? "" : $scope.condition.prodTitle)
|
|
|
-// + "|"+ ($scope.condition.prodSpec == null ? "" : $scope.condition.prodSpec));//保存当前取值的关键词
|
|
|
-// $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
|
|
|
-// $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
|
|
|
if($scope.condition.dateFrom != null || $scope.condition.dateTo != null || $scope.keywordXls != null) {
|
|
|
|
|
|
$scope.fromDate =$scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
|
|
|
@@ -6389,19 +6125,25 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
+ "|"+ ($scope.condition.prodSpec == null ? "" : $scope.condition.prodSpec));//保存当前取值的关键词
|
|
|
$scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
|
|
|
$scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
|
|
|
- if($scope.suuorname == '') {
|
|
|
- toaster.pop('info','提示', '请先选择客户');
|
|
|
+ if(!$scope.suuorname) {
|
|
|
+ toaster.pop('warning','提示', '请先选择客户');
|
|
|
document.getElementById('suuorname').focus();//光标默认在客户
|
|
|
} else {
|
|
|
+ $scope.loading = true;
|
|
|
FaApCheck.getAllByKeywords({fromDate: $scope.fromDate, endDate: $scope.endDate, keyword:$scope.keywordXls}, function(data) {
|
|
|
- $scope.data = data;
|
|
|
- angular.forEach($scope.data, function(item) {
|
|
|
- item:{
|
|
|
- $selected:true;
|
|
|
- }
|
|
|
- });
|
|
|
+ if(data.length > 0) {
|
|
|
+ angular.forEach(data, function(item) {
|
|
|
+ item.$selected = true;
|
|
|
+ });
|
|
|
+ $scope.data = data;
|
|
|
+ $scope.checkboxes.checked = true;
|
|
|
+ $scope.getTotalMoney();
|
|
|
+ } else {
|
|
|
+ toaster.pop('info', '提示', '当前没有需要对账记录');
|
|
|
+ }
|
|
|
$scope.loading = false;
|
|
|
}, function(response) {
|
|
|
+ $scope.loading = false;
|
|
|
toaster.pop('error', '提示', response.data);
|
|
|
});
|
|
|
}
|
|
|
@@ -8486,6 +8228,17 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
return str.substring(0, 1);
|
|
|
};
|
|
|
});
|
|
|
+ app.filter('summary', function(){
|
|
|
+ return function(data, field) {
|
|
|
+ var sum = 0;
|
|
|
+ if (data) {
|
|
|
+ angular.forEach(data, function(d){
|
|
|
+ sum += d[field];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return sum;
|
|
|
+ };
|
|
|
+ });
|
|
|
/**
|
|
|
* 搜索框,回车触发
|
|
|
*/
|
|
|
@@ -10172,23 +9925,17 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
* 财务对账时,企业进行筛选操作
|
|
|
*/
|
|
|
app.controller('SearchCustInfoCtrl', ['$scope', '$modalInstance', 'suuorname', 'FaApCheck', function($scope, $modalInstance, suuorname, FaApCheck) {
|
|
|
- $scope.getData = function(){
|
|
|
+ var getData = function(){
|
|
|
+ $scope.loading = true;
|
|
|
FaApCheck.getAllCustomers(function(data) {
|
|
|
- console.log(data);
|
|
|
- $scope.custs= data;
|
|
|
- angular.forEach($scope.data, function(item) {
|
|
|
- item:{
|
|
|
- $selected: true;
|
|
|
- }
|
|
|
- });
|
|
|
+ $scope.custs = data;
|
|
|
$scope.loading = false;
|
|
|
});
|
|
|
-
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
- $scope.getData();
|
|
|
+ getData();
|
|
|
|
|
|
- $scope.CustName= function(suuorname) {
|
|
|
+ $scope.select = function(suuorname) {
|
|
|
$modalInstance.close(suuorname);
|
|
|
}
|
|
|
|
|
|
@@ -11125,7 +10872,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
fn = 'getMyWaiting';break;
|
|
|
}
|
|
|
return fn;
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page : 1,
|
|
|
@@ -11207,7 +10954,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
ShipAddress.shipAddList({}, function(data) {
|
|
|
$scope.ships = data;
|
|
|
$scope.tender.shipadd = $scope.ships[0];
|
|
|
- console.log($scope.ships);
|
|
|
});
|
|
|
};
|
|
|
loadShipAddress();
|
|
|
@@ -11449,7 +11195,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
date: new Date(),
|
|
|
unit: 'PCS',
|
|
|
currency: 'RMB',
|
|
|
- ifOpen: 1,
|
|
|
+ ifOpen: 0,
|
|
|
ifTax: 1,
|
|
|
invoiceType: 2,
|
|
|
tenderAttachs:[{}]
|
|
|
@@ -11499,30 +11245,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- // 新增供应商联系人
|
|
|
- $scope.addContact = function(uu) {
|
|
|
- var modalInstance = $modal.open({
|
|
|
- animation: true,
|
|
|
- templateUrl: 'static/tpl/index/purc/modal/contact_person_modal.html',
|
|
|
- controller: 'AddContacCtrl',
|
|
|
- resolve: {
|
|
|
- }
|
|
|
- });
|
|
|
- modalInstance.result.then(function(data) {
|
|
|
- $scope.contact = data;
|
|
|
- $scope.contact.venduu = uu;
|
|
|
- Vendor.saveContact({}, $scope.contact, function(data) {
|
|
|
- Vendor.contacts({venduu: $scope.order.cust.uu}, {}, function(data) {
|
|
|
- $scope.contacts = data;
|
|
|
- $scope.order.vendor = $scope.contacts[0];
|
|
|
- });
|
|
|
- toaster.pop('success', '提示', '联系人保存成功');
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '失败', response.data);
|
|
|
- });
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
// 已存在id的为查看招标单(用于在录入的招标单的发布和删除)
|
|
|
if( ! angular.isUndefined($stateParams.id)) {
|
|
|
$scope.loading = true;
|
|
|
@@ -11760,7 +11482,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
// 切换为在平台公开招标时,清除掉已添加的供应商信息
|
|
|
$scope.removeChecked = function() {
|
|
|
- if ($scope.tenderProd.enterpriseBaseInfo && $scope.tenderProd.enterpriseBaseInfo.length > 0) {
|
|
|
+ if ($scope.tenderProd.enterpriseBaseInfo.size > 0) {
|
|
|
$scope.tenderProd.enterpriseBaseInfo = [];
|
|
|
}
|
|
|
};
|