wangning 7 years ago
parent 78688d7330
commit 51fdf932c1

@ -37,6 +37,25 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}); });
}; };
$scope.loadRecords(1); $scope.loadRecords(1);
$scope.edit = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_new_rate.html',
controller: 'RiskRecordEditCtrl',
resolve: {
rate: function () {
return {rate_name: name, clean_days: 3};
},
sys_common_rate: function () {
return $http.get('/sys/partners/sys_rates');
},
clientMoniker: function () {
return $scope.partner.client_moniker;
}
}
}).result.then(function () {
$scope.getRates();
});
};
$scope.jumpDetail = function (record_id,client_moniker) { $scope.jumpDetail = function (record_id,client_moniker) {
var param = {}; var param = {};
param.client_moniker = client_moniker; param.client_moniker = client_moniker;
@ -55,47 +74,9 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}; };
$scope.loadOrders(1); $scope.loadOrders(1);
$scope.edit = function () {
}
}]); }]);
app.controller('vipCustomerDetailCtrl', ['$scope', '$http','$filter','$state', '$uibModal', 'commonDialog', 'vipcustomer', function ($scope, $http,$filter, $state, $uibModal, commonDialog, vipcustomer) {
$scope.vipcustomer = vipcustomer.data;
$scope.params = {vip_customer_id:$scope.vipcustomer.vip_customer_id};
$scope.loadVipOrders = function () {
var params = angular.copy($scope.params);
$http.get('/partner/vip/payment/orders', {params: params}).then(function (resp) {
$scope.vip_orders = resp.data.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.loadVipOrders();
}]); app.controller('RiskRecordEditCtrl', ['$scope', '$http', function ($scope, $http) {
app.controller('vipCustomerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'vipcustomer',
function ($scope, $http, $state, Upload, commonDialog, vipcustomer) {
$scope.vipcustomer = vipcustomer.data;
$scope.updateVipCustomer = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
$http.put('/partner/vip/' + $scope.vipcustomer.vip_code, $scope.vipcustomer).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Update vip customer information successfully',
type: 'success'
});
$scope.loadVipCustomers();
$state.go('^.detail', {vip_code: $scope.vipcustomer.vip_code}, {reload: true});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
}]); }]);

@ -32,6 +32,9 @@
<a class="text-primary" role="button" title="Detail" ng-click="jumpDetail(record.id,record.client_moniker)"> <a class="text-primary" role="button" title="Detail" ng-click="jumpDetail(record.id,record.client_moniker)">
<i class="fa fa-search" ></i> <i class="fa fa-search" ></i>
</a> </a>
<a class="text-primary" role="button" title="Detail" ng-click="edit()">
<i class="fa fa-edit"></i>
</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -0,0 +1,170 @@
<div class="modal-header">
<h4>New Client Rate</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="row">
<div class="col-sm-12">
<form class="form-horizontal" novalidate name="rate_form">
<div class="form-group">
<label class="control-label col-sm-4">Clean Days</label>
<div class="col-sm-6">
<div class="input-group">
<select class="form-control" ng-model="rate.clean_days" id="citySelect" ng-change="changeDays()">
<option value="1">T+1</option>
<option value="2">T+2</option>
<option value="3">T+3</option>
</select>
<div>{{rateConfig}}</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.wechat_rate_value.$invalid && rate_form.wechat_rate_value.$dirty}">
<label class="control-label col-sm-4" for="wechat_rate_value_input">Wechat Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="wechat_rate_value" stringToNumber2 class="form-control" ng-model="rate.wechat_rate_value"
min="0.6" max="2.2" step="0.1" id="wechat_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.wechat_rate_value.$error" ng-if="rate_form.wechat_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.alipay_rate_value.$invalid && rate_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-4" for="alipay_rate_value_input">Alipay Rate Value(Retail)</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="alipay_rate_value" stringToNumber2 class="form-control" ng-model="rate.alipay_rate_value"
min="0.6" max="2.2" step="0.1" id="alipay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.alipay_rate_value.$error" ng-if="rate_form.alipay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.alipayonline_rate_value.$invalid && rate_form.alipayonline_rate_value.$dirty}">
<label class="control-label col-sm-4" for="alipayonline_rate_value_input">Alipay Rate Value(Online)</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="alipayonline_rate_value" stringToNumber2 class="form-control" ng-model="rate.alipayonline_rate_value"
min="0.6" max="2.2" step="0.1" id="alipayonline_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.alipayonline_rate_value.$error" ng-if="rate_form.alipayonline_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.bestpay_rate_value.$invalid && rate_form.bestpay_rate_value.$dirty}">
<label class="control-label col-sm-4" for="bestpay_rate_value_input">Bestpay Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="bestpay_rate_value" stringToNumber2 class="form-control" ng-model="rate.bestpay_rate_value"
min="0.6" max="2.2" step="0.1" id="bestpay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.bestpay_rate_value.$error" ng-if="rate_form.bestpay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.jd_rate_value.$invalid && rate_form.jd_rate_value.$dirty}">
<label class="control-label col-sm-4" for="jd_rate_value_input">JD Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="jd_rate_value" stringToNumber2 class="form-control" ng-model="rate.jd_rate_value"
min="0.6" max="2.2" step="0.1" id="jd_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.bestpay_rate_value.$error" ng-if="rate_form.jd_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="active_time_input">Active Date</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.active_time" id="active_time_input"
uib-datepicker-popup size="10" placeholder="Active Date"
is-open="activeDate.open" ng-click="activeDate.open=true"
datepicker-options="{maxDate:rate.expiry_time}" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="expire_time_input">Expire Date</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.expiry_time" id="expire_time_input"
uib-datepicker-popup size="10" placeholder="Expire Date"
is-open="expireDate.open" ng-click="expireDate.open=true"
datepicker-options="{minDate:rate.active_time}" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="remark_text">Remark</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.remark" id="remark_text" type="text">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="saveRate(rate_form)" ng-disabled="ctrl.sending">Submit</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>

@ -26,11 +26,6 @@
<td>{{order.amount}}</td> <td>{{order.amount}}</td>
<td>{{order.channel}}</td> <td>{{order.channel}}</td>
<td>{{order.risk_types}}</td> <td>{{order.risk_types}}</td>
<td>
<a class="text-primary" role="button" title="Detail" ng-click="edit">
<i class="fas fa-edit"></i>
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

Loading…
Cancel
Save