add transaction pos设备筛选条件

master
luoyang 6 years ago
parent b982336f76
commit 8847a3af53

@ -130,6 +130,9 @@
<if test="trans_type==1">and t.transaction_type = 'Credit'</if> <if test="trans_type==1">and t.transaction_type = 'Credit'</if>
<if test="trans_type==2">and t.refund_id is NOT NULL</if> <if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if> <if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
</if>
<if test="channel!=null"> <if test="channel!=null">
and and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan} <foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
@ -198,6 +201,9 @@
<if test="trans_type==1">and t.transaction_type = 'Credit'</if> <if test="trans_type==1">and t.transaction_type = 'Credit'</if>
<if test="trans_type==2">and t.refund_id is NOT NULL</if> <if test="trans_type==2">and t.refund_id is NOT NULL</if>
<if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if> <if test="trans_type==3">and t.transaction_type='Debit' and t.refund_id is NULL</if>
<if test="dev_id!=null">
and o.dev_id = #{dev_id}
</if>
<if test="channel!=null"> <if test="channel!=null">
and and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan} <foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}

@ -368,12 +368,11 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="remark-input">Following <label class="control-label col-sm-2" for="remark-input">Remark</label>
BD</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.remark" <input class="form-control" ng-model="partner.remark"
name="remark" name="remark"
id="remark-input" maxlength="50"> id="remark-input" maxlength="500">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -166,13 +166,13 @@
<p class="form-control-static" ng-bind="partner.description"></p> <p class="form-control-static" ng-bind="partner.description"></p>
</div> </div>
</div> </div>
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-2">Remark</label> <!--<label class="control-label col-sm-2">Remark</label>-->
<div class="col-sm-10"> <!--<div class="col-sm-10">-->
<p class="form-control-static" ng-bind="partner.remark"></p> <!--<p class="form-control-static" ng-bind="partner.remark"></p>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> </div>
</div> </div>
</div> </div>

@ -168,19 +168,19 @@
</div> </div>
</div> </div>
<div class="form-group" <!--<div class="form-group"-->
ng-class="{'has-error':partnerForm.remark.$invalid && partnerForm.remark.$dirty}"> <!--ng-class="{'has-error':partnerForm.remark.$invalid && partnerForm.remark.$dirty}">-->
<label class="control-label col-sm-2" for="desc-input">Remark</label> <!--<label class="control-label col-sm-2" for="desc-input">Remark</label>-->
<div class="col-sm-8"> <!--<div class="col-sm-8">-->
<textarea class="form-control" ng-model="partner.remark" <!--<textarea class="form-control" ng-model="partner.remark"-->
name="remark" id="remark-input" maxlength="200" required></textarea> <!--name="remark" id="remark-input" maxlength="200" required></textarea>-->
<div ng-messages="partnerForm.remark.$error" <!--<div ng-messages="partnerForm.remark.$error"-->
ng-if="partnerForm.remark.$dirty"> <!--ng-if="partnerForm.remark.$dirty">-->
<p class="small text-danger" ng-message="maxlength">Less Than 200 <!--<p class="small text-danger" ng-message="maxlength">Less Than 200-->
Characters(including symbols and spaces)</p> <!--Characters(including symbols and spaces)</p>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> </div>
</div> </div>
</div> </div>

@ -430,7 +430,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">Following BD</label> <label class="control-label col-sm-2">Remark</label>
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.remark"></p> <p class="form-control-static" ng-bind="partner.remark"></p>

@ -343,10 +343,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="remark-input">Following BD</label> <label class="control-label col-sm-2" for="remark-input">Remark</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.remark" name="remark" <input class="form-control" ng-model="partner.remark" name="remark"
id="remark-input" maxlength="50"> id="remark-input" maxlength="500">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -103,6 +103,17 @@
</p> </p>
</div> </div>
</div> </div>
<div class="form-group col-xs-12" ng-if="devices.length">
<label class="control-label col-xs-4 col-sm-2">Devices</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':device_isAll}" ng-click="chooseDevices('all')">All</a>
<label ng-repeat="device in devices">
|&nbsp;<a role="button" ng-class="{'bg-primary':device.dev_id==chooseDevice_id}" ng-click="chooseDevices(device.dev_id)">{{device.remark}}</a>&nbsp;
</label>
</p>
</div>
</div>
<div class="form-group col-xs-12"> <div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label> <label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8"> <div class="col-sm-10 col-xs-8">

@ -17,6 +17,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.pagination = {}; $scope.pagination = {};
$scope.params.clearing_status = -1; $scope.params.clearing_status = -1;
$scope.params.channel = 'ALL' $scope.params.channel = 'ALL'
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.device_isAll = true;
$scope.params.trans_type = 0; $scope.params.trans_type = 0;
$scope.isAll = true; $scope.isAll = true;
$scope.clients = [$scope.currentUser.client]; $scope.clients = [$scope.currentUser.client];
@ -69,6 +71,26 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.params.datefrom = monthBegin; $scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1); $scope.loadTradeLogs(1);
}; };
$scope.listDevices = function () {
var params = angular.copy($scope.dev_params)
$http.get('/client/partner_info/devices', {params: params}).then(function (resp) {
$scope.devices = resp.data.data;
})
};
$scope.chooseDevices = function (dev_id) {
if(dev_id == 'all'){
$scope.chooseDevice_id = '';
$scope.params.dev_id = null;
$scope.device_isAll = true;
$scope.loadTradeLogs(1);
}else {
$scope.chooseDevice_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = false;
$scope.loadTradeLogs(1);
}
};
$scope.listDevices();
$scope.loadTradeLogs = function (page) { $scope.loadTradeLogs = function (page) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
if (params.datefrom) { if (params.datefrom) {
@ -123,6 +145,10 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url += connectSymbol + 'trans_type=' + params.trans_type; url += connectSymbol + 'trans_type=' + params.trans_type;
connectSymbol = '&'; connectSymbol = '&';
} }
if (params.dev_id) {
url += connectSymbol + 'dev_id=' + params.dev_id;
connectSymbol = '&'
}
params.client_ids.forEach(function (i) { params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i; url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&'; connectSymbol = '&';
@ -137,6 +163,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url += connectSymbol + 'dateto=' + params.dateto; url += connectSymbol + 'dateto=' + params.dateto;
connectSymbol = '&'; connectSymbol = '&';
} }
params.page = page || $scope.pagination.page || 1; params.page = page || $scope.pagination.page || 1;
url += connectSymbol + 'page=' + params.page; url += connectSymbol + 'page=' + params.page;
return url; return url;

Loading…
Cancel
Save