master
yuan 7 years ago
parent 2a48f5a6aa
commit 72244fef3b

@ -9,7 +9,7 @@
AND o.type = 0 AND o.type = 0
]]> ]]>
<if test="org_id!=null and org_ids==null">and m.org_id=#{org_id}</if> <if test="org_id!=null and org_ids==null">and m.org_id=#{org_id}</if>
<if test="org_ids!=null">and org_id in <if test="org_ids!=null">and m.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</select> </select>
<select id="listAvailable" resultType="com.alibaba.fastjson.JSONObject"> <select id="listAvailable" resultType="com.alibaba.fastjson.JSONObject">

@ -1984,24 +1984,35 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
app.controller('partnerChooseBDUserDialogCtrl', ['$scope', '$http', '$filter', 'partner', 'bdUsers', 'type', function ($scope, $http, $filter, partner, bdUsers, type) { app.controller('partnerChooseBDUserDialogCtrl', ['$scope', '$http', '$filter', 'partner', 'bdUsers', 'type', function ($scope, $http, $filter, partner, bdUsers, type) {
$scope.bdUsers = bdUsers.data; $scope.bdUsers = bdUsers.data;
$scope.data = {}; $scope.data = {};
$scope.params = {};
$scope.chooseOrg = {}; $scope.chooseOrg = {};
$scope.chooseOrg.org_name = null; $scope.chooseOrg.org_name = null;
if (($scope.currentUser.role & parseInt('1000011', 2)) > 0 && !$scope.currentUser.org_id) { if (($scope.currentUser.role & parseInt('1000011', 2)) > 0 && !$scope.currentUser.org_id) {
$scope.showOrg = 'Organization'; /* $scope.showOrg = 'Organization';*/
$http.get('/sys/orgs', {params: {}}).then(function (resp) { $http.get('/sys/orgs', {params: {}}).then(function (resp) {
$scope.orgs = resp.data; $scope.orgs = resp.data;
}); });
} }
$scope.chooseOrgFun = function (org) {
$scope.loadOrgs = function () {
var params = angular.copy($scope.params);
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$scope.orgs_child = resp.data;
})
};
/* $scope.chooseOrgFun = function (org) {
if (org == 'all') { if (org == 'all') {
$scope.chooseOrg.org_name = null; $scope.chooseOrg.org_name = null;
$scope.showOrg = 'All' $scope.showOrg = 'All'
} else { } else {
$scope.chooseOrg.org_name = org.name; $scope.chooseOrg.org_name = org.name;
$scope.showOrg = org.name; $scope.showOrg = org.name;
$scope.params.org_id = org.org_id;
$scope.loadOrgs();
} }
}; };*/
function initBD() { function initBD() {
$http.get('/sys/partners/' + partner.client_moniker + '/bd_user/current').then(function (resp) { $http.get('/sys/partners/' + partner.client_moniker + '/bd_user/current').then(function (resp) {
@ -2011,7 +2022,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if (m.manager_id == e.bd_id) { if (m.manager_id == e.bd_id) {
m.choose = true; m.choose = true;
m.proportion = e.proportion; m.proportion = e.proportion;
$scope.chooseOrgFun({org_id: m.org_id, name: m.org_name}); /* $scope.chooseOrgFun({org_id: m.org_id, name: m.org_name});*/
if(($scope.currentUser.role & parseInt('1000000000000', 2))>0){
$scope.params.org_ids = m.org_id;
$scope.params.org_id = m.org_id;
$scope.loadOrgs();
}else {
$scope.params.org_id = m.org_id;
$scope.loadOrgs();
}
} }
}); });
}); });

@ -16,8 +16,23 @@
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div> <div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<form novalidate name="bd_form"> <form novalidate name="bd_form">
<div style="display: flex"> <div style="display: flex">
<div style="flex:1" ng-if="orgs"> <div style="flex:1;margin-right: 16px;">
<div uib-dropdown class="btn-group"> <div ng-if="orgs" style="margin-bottom: 16px">
<select id="org-clild" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.type for org in orgs"
ng-change="loadOrgs()">
<option value="">All</option>
</select>
</div>
<div ng-if="((orgs_child.length > 1) && ('1000011'|withRole)) || ((orgs_child.length > 0) && ('1000000000000'|withRole))">
<select id="org-select" class="form-control" ng-model="params.org_ids"
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child">
<option value="">All</option>
</select>
</div>
<!-- <div uib-dropdown class="btn-group">
<button id="single-button" type="button" class="btn btn-default" <button id="single-button" type="button" class="btn btn-default"
uib-dropdown-toggle ng-disabled="disabled"> uib-dropdown-toggle ng-disabled="disabled">
{{showOrg}} <span class="caret"></span> {{showOrg}} <span class="caret"></span>
@ -28,12 +43,13 @@
<li ng-repeat="org in orgs"><a ng-click="chooseOrgFun(org)">{{org.name}}</a> <li ng-repeat="org in orgs"><a ng-click="chooseOrgFun(org)">{{org.name}}</a>
</li> </li>
</ul> </ul>
</div>-->
</div> </div>
</div>
<div style="flex: 3"> <div style="flex: 3">
<div class="form-group"> <div class="form-group">
<ui class="list-group"> <ui class="list-group">
<li class="list-group-item" ng-repeat="user in bdUsers|propsFilter:{org_name:chooseOrg.org_name}:true"> <li class="list-group-item" ng-repeat="user in bdUsers|bdOrgSelect:params">
<!--<button class="list-group-item" type="button" ng-repeat="user in bdUsers" ng-click="choose(user)" ng-bind="user.display_name"></button>--> <!--<button class="list-group-item" type="button" ng-repeat="user in bdUsers" ng-click="choose(user)" ng-bind="user.display_name"></button>-->
<span><input ng-click="!user.choose" type="checkbox" ng-init= "user.choose=user.choose" ng-model="user.choose"></span> <span><input ng-click="!user.choose" type="checkbox" ng-init= "user.choose=user.choose" ng-model="user.choose"></span>
<span ng-bind="user.display_name"></span> <span ng-bind="user.display_name"></span>

@ -407,7 +407,7 @@
<th>End Date</th> <th>End Date</th>
<th>BD Name</th> <th>BD Name</th>
<th>Proportion</th> <th>Proportion</th>
<th ng-if="('00010'|withRole)">Operation <th ng-if="('00010'|withRole) || (('1000000000000'|withRole) && partner.show_all_permission)">Operation
</th> </th>
</tr> </tr>
</thead> </thead>
@ -417,7 +417,7 @@
<td ng-bind="bd.end_date|date:'yyyy-MM-dd'"></td> <td ng-bind="bd.end_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="bd.bd_name"></td> <td ng-bind="bd.bd_name"></td>
<td ng-bind="bd.proportion"></td> <td ng-bind="bd.proportion"></td>
<td ng-if="('00010'|withRole)"> <td ng-if="('00010'|withRole) || (('1000000000000'|withRole) && partner.show_all_permission) ">
<a role="button" ng-click="editBDUser()" ng-if="bd.end_date==null"> <a role="button" ng-click="editBDUser()" ng-if="bd.end_date==null">
<i class="fa fa-pencil-square-o"></i> <i class="fa fa-pencil-square-o"></i>
</a> </a>

Loading…
Cancel
Save