这是我获取ToolRequests列表的表。单击Assign Button后,我将隐藏该表并显示另一个表。
这是我的表 addUser ,其中我获取了特定行的所有先前数据。这里是如何获得具有给定工具编号的资产的复选框
这是我的Html页面。 `
<html>
<head>
<style>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
/* padding: 15px 32px; */
text-align: center;
text-decoration: none;
display: inline-block;
/* font-size: 16px;
margin: 4px 2px; */
cursor: pointer;
}
.button2 {background-color: #008CBA;} /* Blue */
.button3 {background-color: #f44336;} /* Red */
</style>
</head>
<body ng-app="myApp" ng-controller="myController7">
<div class="container-fluid">
<div class="card">
<div class="header">
<h4 class="title">UnassignedTool Requests List</h4>
<p class="category">Details of Requests for Tools</p>
</div>
<div class="content table-responsive table-full-width">
<table class="table table-striped" ng-show="table">
<thead>
<th>Order Number</th>
<th>Customer Request Number</th>
<th>Field Engineer Name</th>
<th>Tool Number</th>
<th>Tool Name</th>
<th>Tool Quantity</th>
<th>Details</th>
<th>Action1</th>
<th>Action2</th>
</thead>
<tbody>
<tr ng-repeat="request in Unassignedrequests">
<td>{{request.orderNumber}}</td>
<td>{{request.customerRequestNo}}</td>
<td>{{request.user.userName}}</td>
<td>{{request.tool.toolNumber}}</td>
<td>{{request.tool.toolName}}</td>
<td>{{request.quantity}}</td>
<td>{{request.details}}</td>
<td><button class="btn btn-info btn-fill btn-wd" ng-click="edit(request)" >Assign</button> </td>
<td><button class="btn btn-info btn-fill btn-wd" ng-click="deleteUser(user.customer_id)" >Reject</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<pre>
<form ng-show="addUser">
<label> ORDER NUMBER </label> <input type="text" ng-model="request.orderNumber"> <br>
<label> CUSTOMER REQUEST NUMBER</label> <input type="text" ng-model="request.customerRequestNo"> <br>
<label> FIELD ENGINEER NAME</label> <input type="text" ng-model="request.user.userName"> <br>
<label> TOOL NUMBER</label> <input type="text" ng-model="request.tool.toolNumber"> <br>
<label> TOOL NAME</label> <input type="text" ng-model="request.tool.toolName"> <br>
<label> QUANTITY</label> <input type="text" ng-model="request.quantity"><br>
<label> DETAILS</label> <input type="text" ng-model="request.details"> <br>
<label> REQUIRED FROM DATE</label> <input type="date" id="myDate">
<!-- <button ng-click="insertUser(user)" ng-show="insert">insert</button> -->
<button ng-click="updateUser(request)" ng-show="edit" > ✎submit</button>
</form>
</pre>
</div>
</body>
</html>
`
这是我的角度控制器
myApp.controller("myController7", function($scope, $http, $state,UnassignedRequests) {
$scope.table=true;
$scope.addUser=false;
UnassignedRequests.getAllUnassignedRequests().then(function(response) {
if (response != undefined) {
$scope.Unassignedrequests = response.data;
}
});
$scope.edit=function(request){
$scope.table=false;
$scope.addUser=true;
$scope.update=true;
$scope.insert=false;
$scope.request=request;
} ; });
这是我的角色服务
myApp.factory('UnassignedRequests',function($http) {
return {
getAllUnassignedRequests : function() {
return $http
.get('/Tool_Management/WareHouseManager/getAllUnassignedRequests',
{
'Content-Type' : 'application/json'
}).then(function(response) {
return response;
});
}
}});
如何获取所选工具编号的资产