ソースを参照

提交文件后清除文件名

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9372 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 年 前
コミット
d07bdd8c69

+ 16 - 0
src/main/webapp/resources/js/index/app.js

@@ -10200,6 +10200,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	 */
 	app.controller('UploadByBatchCtrl', ['$scope', '$upload', 'toaster', 'BaseService', function($scope, $upload, toaster, BaseService) {
 		BaseService.scrollBackToTop();
+		$scope.$watch('myFiles', function(){
+			if($scope.myFiles) {
+				var file = $scope.myFiles[0];
+				$scope.fileName = file.name;
+			}
+		})
 		// 通过excel批量上传物料
 		$scope.upload = function() {
 			if($scope.myFiles) {
@@ -10220,6 +10226,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						$scope.alters = $scope.result.alters;
 						$scope.infos = $scope.result.infos;
 						$scope.myFiles[0] = "";
+						$scope.fileName = "";
 					}).error(function(response) {
 						toaster.pop('error', response.data || response);
 					});
@@ -16685,8 +16692,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	 */
 	app.controller('UploadProductCtrl', ['$scope', '$upload', 'toaster', 'BaseService', function($scope, $upload, toaster, BaseService) {
 		BaseService.scrollBackToTop();
+		
+		$scope.$watch('myFiles', function(){
+			if($scope.myFiles) {
+				var file = $scope.myFiles[0];
+				$scope.fileName = file.name;
+			}
+		})
 		// 通过excel批量上传物料
 		$scope.upload = function() {
+			var file = $scope.myFiles[0];
 			if($scope.myFiles) {
 				var file = $scope.myFiles[0];
 				if(file.name) {
@@ -16705,6 +16720,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						$scope.alters = $scope.result.alters;
 						$scope.infos = $scope.result.infos;
 						$scope.myFiles[0] = "";
+						$scope.fileName = "";
 					}).error(function(response) {
 						toaster.pop('error', response.data || response);
 					});

+ 1 - 0
src/main/webapp/resources/tpl/index/baseInfo/uploadByBatch.html

@@ -295,6 +295,7 @@ table.table.table-striped  thead {
 						ng-model="myFiles" type="file" ng-multiple="false"
 						class="form-control input-sm" id="xlsFile" name="xlsFile"
 						placeholder="请上传.xls或.xlsx文件" />
+					<span>{{fileName}}</span>
 				</div>
 				<div class="col-xs-4">
 					<button ng-click="upload()" class="btn btn-success btn-sm">

+ 1 - 0
src/main/webapp/resources/tpl/index/purc/uploadByBatch.html

@@ -295,6 +295,7 @@ table.table.table-striped  thead {
 						ng-model="myFiles" type="file" ng-multiple="false"
 						class="form-control input-sm" id="xlsFile" name="xlsFile"
 						placeholder="请上传.xls或.xlsx文件" />
+					<span>{{fileName}}</span>
 				</div>
 				<div class="col-xs-4">
 					<button ng-click="upload()" class="btn btn-success btn-sm">