Commit bc8e9e6c authored by Administrator's avatar Administrator

添加余证页面

parent 462b149e
......@@ -117,13 +117,12 @@ public class YingxinApi {
*添加余证
*
* */
@RequestMapping("addRemainingCardInfo")
@RequestMapping("addRemainCard")
public String addRemainingCardInfo(@RequestParam("acceptNo")List accept_Number,HttpServletResponse resp){
List<SpecialCardEntity> list=addRemainingCardService.getRemainingCardData(accept_Number);
YXJSONResponse yxjsonResponse =new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(list);
Map map=new HashMap();
return yxjsonResponse.toJSONString();
}
/*
......
......@@ -154,6 +154,18 @@ angular.module('app')
}]
}
})
.state('layout.addRemainCard', {
url: '/addFailedCard',
templateUrl: 'tpl/layout/addRemainCard/addRemainCard.html',
cache:false,
controller:'addRemainCardCtrl',
resolve: {
deps: ['uiLoad',
function( uiLoad ){
return uiLoad.load( ['tpl/layout/addRemainCard/addRemainCard.js'] );
}]
}
})
}
]
......
......@@ -527,6 +527,23 @@ app.service('MessageService', function (ngDialog) {
})
},
addRemainCard:function(success){
$http({
method: 'GET',
url: "../yingxin/addRemainCard" + urlTimeStamp(),
params:{
idNo:idNo
}
}).then(function successCallback(response) {
console.log(response.data,"-------------response.data------")
success(response.data)
},function(err){
var errA = {Error:true, ReturnCode:err.status, ReturnMsg:"API访问返回错误"}
MessageService.httpRequestFailed(JSON.stringify(errA))
})
},
getprintReceipt:function(startDate,endDate,success) {
$http({
method: 'GET',
......
......@@ -22,70 +22,70 @@
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="1">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="2">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="3">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="4">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="5">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="6">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="7">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="8">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
<li id="9">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
废证类型:
<select style="height: 30px;border-radius: 4px;">
<option value="{{type.failed_Card_Reason_Id}}" ng-repeat="type in failedTypeList">{{type.failed_Card_Reason}}</option>
<option value="{{type.failedCardReasonId}}" ng-repeat="type in failedTypeList">{{type.failedCardReason}}</option>
</select>
</li>
</ul>
......
<!--<div class="row" style="font-size: 1.3em;border-bottom:1px solid #CCCCCC;margin-bottom:10px;padding-top:10px;">-->
<!---->
<!--</div>-->
<!--<div style="padding: 10px;background-color: #fff;border: 1px solid #CCC;border-radius: 10px;">-->
<!---->
<!--</div>-->
<div class="col-md-12">
<p>余证添加</p>
</div>
<div id="cardsDiv">
<form ng-submit="createInputs()">
<span style="font-size:20px;">填写余证数:</span>
<input style="margin-top:20px;height: 30px;" type="text" class="failedcount">
<input type="submit" class="btn btn-primary" value="确定">
<span style="font-size:14px;color: red;" ng-if="errMsglb">{{errMsglb}}</span>
</form>
<form ng-show="showH5==1" ng-submit="saveRemainCards()">
<div style="padding-top:10px;padding-bottom:10px;">请填写余证受理号:</div>
<ul id="cardsUl" style="padding: 0;margin-bottom:10px;">
<li id="0">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="1">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="2">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="3">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="4">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="5">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="6">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="7">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="8">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
<li id="9">
身份证号:<input style="height: 30px;" type="text" placeholder="受理号/身份证号"/>
</li>
</ul>
<p style="font-size:14px;color: red;text-align: left;" ng-if="alertLb">{{alertLb}}</p>
<div style="text-align: right;">
<input type="submit" class="btn btn-primary" value="保存">
<input type="button" class="btn btn-danger" ng-click="cancelAddFailed()" value="取消">
</div>
</form>
</div>
app.controller('addRemainCardCtrl', ['$scope', '$rootScope', '$http', '$state', '$filter', '$localStorage', 'HttpService', 'ngDialog', function ($scope, $rootScope, $http, $state, $filter, $localStorage, HttpService, ngDialog) {
if ($rootScope.loginData.login === false) {
$state.go("signin")
} else {
$state.go("layout.addRemainCard")
}
$rootScope.showH5 = 0;
$scope.createInputs = function () {
for (var i=0;i<10;i++){
document.getElementById(i).style.display = 'none';
document.getElementById(i).style.marginBottom = '10px';
}
$scope.failedCount = $(".failedcount").val();
console.log($scope.failedCount)
if ($scope.failedCount == '' || parseInt($scope.failedCount) <= 0 || parseInt($scope.failedCount) > 10) {
$scope.errMsglb = "数量应在0和10之间且不能为空!";
} else {
$scope.errMsglb = "";
$rootScope.showH5 = 1;
for (var i = 0; i <$scope.failedCount; i++) {
document.getElementById(i).style.display = 'block';
}
}
}
$rootScope.emptyForm = function(){
for (var i = 0; i < $scope.failedCount; i++) {
document.getElementById(i).getElementsByTagName("input")[0].value = "";
document.getElementById(i).getElementsByTagName("input")[1].value = "";
}
}
$scope.saveRemainCards = function () {
$rootScope.arr = [];
var checkArr = [];
var jsonStr = {};
var valueArr = [];
var checkValueArr = [];
for (var i = 0; i < $scope.failedCount; i++) {
var json = {};
var checkJson = {};
json.acceptNo = $('#' + i + ' input:eq(0)').val();
json.reson = $('#' + i + ' select').val();
valueArr.push(json);
if(checkValueArr.indexOf($('#' + i + ' input:eq(0)').val())==-1){
checkValueArr.push($('#' + i + ' input:eq(0)').val());
}
}
if(checkValueArr.length == $scope.failedCount){
checkJson.list = checkValueArr;
jsonStr.list = valueArr;
jsonStr.workshop = $rootScope.loginData.workshop;
$rootScope.arr.push(jsonStr);
checkArr.push(checkJson);
console.log($rootScope.arr)
var myFailedcount = 0;
for (var i = 0; i < $rootScope.arr.length; i++) {
for (var j = 0; j < $rootScope.arr[i].list.length; j++) {
if ($rootScope.arr[i].list[j].acceptNo.length == 18 || $rootScope.arr[i].list[j].acceptNo.length == 10) {
myFailedcount++;
}
else {
continue;
}
}
}
var str = "";
if (myFailedcount == (checkArr.length * valueArr.length)) {
HttpService.selectProdCard(checkArr, function (data) {
ngDialog.open({
template: 'dialogs/confirmFailedCardsInfo.html' + urlTimeStamp(),
width: '40%',
cache: false,
controller: ['$scope', '$rootScope', 'HttpService', function ($scope, $rootScope, HttpService) {
$scope.dataInfo = data.respData;
console.log($scope.dataInfo,"-=====$scope.dataInfo====")
var count = 0;
for(var i=0;i<$scope.dataInfo.size;i++){
if($scope.dataInfo[i].name!=null){
count+=1;
}else{
continue;
}
}
$scope.isShowSuccess = 0;
$scope.confirmFailedInfo = function () {
console.log($rootScope.arr)
$(".confirmBtn").attr("disabled", true);
if(count==$scope.dataInfo.length){
HttpService.addRemainCard($rootScope.arr,function(data){
$scope.isShowSuccess = 1;
$scope.AddSuccess = data.respData.string;
$rootScope.emptyForm();
})
}else{
$scope.alertError = "请将您输入有误的受理号修改后再添加!";
}
}
$scope.cancelThisDialog = function(){
$rootScope.showH5 = 0;
$scope.closeThisDialog();
}
}]
})
})
} else {
$scope.alertLb = "请检查您输入的废证受理号和身份证号是否全部正确!";
}
}else{
$scope.alertLb("废证受理号或身份证号存在空值或重复,请检查后再提交。")
}
}
$scope.cancelAddFailed = function () {
$rootScope.showH5 = 0;
$scope.alertLb = "";
$rootScope.emptyForm();
}
}]);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment