您好,登录后才能下订单哦!
1)主页面 addNewCombine.jsp
<%@ include file="../common/h.jsp"%>
<body ng-controller="addCombineCtrl" class="ng-cloak">
<div id="content">
<div class="container-fluid">
<form name="addNewProdCombineForm">
<div id="combineProdBaseInfoDiv" ng-show="ctrl.combineProdBaseInfoCtrl" ng-controller="CombineProdBaseInfoCtrl">
<%@ include file="./combineProdBaseInfo.jsp"%>
</div>
<div id="combineProdPackageDiv" ng-show="ctrl.combineProdPackageCtrl" ng-controller="CombineProdPackageCtrl">
<%@ include file="./combineProdPackage.jsp"%>
</div>
<div id="combineProdRuleDiv" ng-show="ctrl.combineProdRuleCtrl" ng-controller="CombineProdRuleCtrl">
<%@ include file="./combineProdRule.jsp"%>
</div>
<div id="combineProdDepartmentDiv" ng-show="ctrl.combineProdDepartmentCtrl" ng-controller="CombineProdDepartmentCtrl">
<%@ include file="./combineProdDepartment.jsp"%>
</div>
</form>
</div>
</div>
<%@ include file="../common/script.jsp" %>
<!-- 这里是加载对应的js资源 -->
<script type="text/javascript" src="../../js/product/combineProdBaseInfo.js"></script>
<script type="text/javascript" src="../../js/product/combineProdPackage.js"></script>
<script type="text/javascript" src="../../js/product/combineProdRule.js"></script>
<script type="text/javascript" src="../../js/product/combineProdDepartment.js"></script>
<script language="javascript">
//加载模块
seajs.use("../../js/product/addNewCombine");
</script>
</body>
1.1)主页面对应的js
define(function (require) {
var Utils = require('utils');
require('../../js/common/ums.base').init();
require('../../js/common/ums.view').init();
var addNewCombine = angular.module('addNewCombine', ['ng.ui','ums.base','ums.view']);
//这样就可以解耦,将对应的子页面的js引入进来,所有的js都定义在同一个module中;
//加载子controller
require('combineProdBaseInfo').extend(addNewCombine);
require('combineProdPackage').extend(addNewCombine);
require('combineProdRule').extend(addNewCombine);
require('combineProdDepartment').extend(addNewCombine);
addNewCombine.controller('addCombineCtrl', function ($scope, uiValid,uiPortalUtils,umsBaseService,uiTips,safeApply) {
$scope.ctrl={
combineProdBaseInfoCtrl : true,
combineProdPackageCtrl : false,
combineProdRuleCtrl : false,
combineProdDepartmentCtrl : false,
showCurrPackageDiv : false,
showPlanDutyInfoCol : false
};
$scope.showCurrentDiv = function(curCtrl){
};
});
window.angular.bootstrap(document,['addNewCombine']);
});
2)子module,combineProdBaseInfo对应的js文件
define('combineProdBaseInfo', function(require, exports, module){
var PFConstants = require('../../js/componentDefine/productConstants.js');
//向外部提供接口
exports.extend = function(md){
md.controller('CombineProdBaseInfoCtrl', function($scope, uiValid,uiPortalUtils,uiTips,safeApply){
$scope.tecProductList = [];
$scope.marketProductList = [];
$scope.idMarketProduct = '';
$scope.productList = [];
var productDescMap = PFConstants.MANAGE_TYPE_MAP;
$scope.productClass00List = [];//有无的产品大类列表
//删除产品
$scope.deleteMarketProduct = function(obj){
if(obj){
var selectObj = _.findWhere($scope.combindProduct.productList,{id : obj.id});
if(selectObj){
$scope.combindProduct.productList.splice($scope.combindProduct.productList.indexO(selectObj),1);
}//if
}//if
};
//显示产品类型描述
$scope.getProductTypeDesc = function(productType){
var desc = productType;
if("1" == productType){
desc = "标准产品";
}else if("2" == productType){
desc = "自选产品";
}
return desc;
};
});
};
});
3)其他相关的js同combineProdBaseInfo.js内容相同,不再叙述
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。