Merge branch 'develop'

master
yixian 4 years ago
commit a169d962d1

@ -74,7 +74,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
controller: 'batchAddMerchantsDialogCtrl', controller: 'batchAddMerchantsDialogCtrl',
size: 'lg' size: 'lg'
}).result.then(function (merchants) { }).result.then(function (merchants) {
let arr = $scope.editingTask.whitelist_clients; let arr = $scope.editingTask.whitelist_clients || [];
for (let mch of merchants) { for (let mch of merchants) {
if (arr.filter(wMch => wMch.client_moniker === mch.client_moniker).length < 1) { if (arr.filter(wMch => wMch.client_moniker === mch.client_moniker).length < 1) {
arr.push(mch); arr.push(mch);
@ -108,6 +108,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.currentTasks.push(task); $scope.currentTasks.push(task);
}) })
}; };
$scope.cancelEdit = function () {
$scope.editingTask = null;
}
$scope.submitTasks = function () { $scope.submitTasks = function () {
let tasks = []; let tasks = [];
for (let task of $scope.currentTasks) { for (let task of $scope.currentTasks) {
@ -219,7 +222,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
let arr = $scope.plans.filter(p => p.plan_id === $scope.task.plan) let arr = $scope.plans.filter(p => p.plan_id === $scope.task.plan)
chosenPlan = arr.length ? arr[0] : null; chosenPlan = arr.length ? arr[0] : null;
$scope.$close({ $scope.$close({
plan_id: $scope.plan.remark.replace(' ', '') + randomString(6), plan_id: $scope.task.remark.replace(' ', '') + randomString(6),
settle_date: $filter('date')($scope.task.settle_date, 'yyyy-MM-dd'), settle_date: $filter('date')($scope.task.settle_date, 'yyyy-MM-dd'),
remark: $scope.task.remark, remark: $scope.task.remark,
plan: chosenPlan plan: chosenPlan
@ -236,12 +239,12 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
cleanDays.push(3); cleanDays.push(3);
} }
$scope.$close({ $scope.$close({
plan_id: $scope.plan.remark.replace(' ', '') + randomString(6), plan_id: $scope.task.remark.replace(' ', '') + randomString(6),
disabled_clean_days: cleanDays, disabled_clean_days: cleanDays,
settle_date: $filter('date')($scope.task.settle_date, 'yyyy-MM-dd'), settle_date: $filter('date')($scope.task.settle_date, 'yyyy-MM-dd'),
last_settle_date: $scope.task.last_settle_date != null ? $filter('date')($scope.task.last_settle_date, 'yyyy-MM-dd') : null, last_settle_date: $scope.task.last_settle_date != null ? $filter('date')($scope.task.last_settle_date, 'yyyy-MM-dd') : null,
remark: $scope.task.remark, remark: $scope.task.remark,
follow_sub_partner: $scope.plan.follow_sub_partner follow_sub_partner: $scope.task.follow_sub_partner
}) })
} }

@ -1,8 +1,8 @@
<div class="modal-header">Batch Add Merchants</div> <div class="modal-header">Batch Add Merchants</div>
<div class="modal-body"> <div class="modal-body">
<p>Paste client monikers below</p> <p>Paste client monikers below</p>
<p>Merchants Count: {{$scope.merchantsInfo.length}}</p> <p>Merchants Count: {{merchantsInfo.length}}</p>
<textarea placeholder="Client Monikers" rows="10" ng-change="analysisMerchants()" <textarea class="form-control" placeholder="Client Monikers" rows="10" ng-change="analysisMerchants()"
ng-model="data.client_monikers"></textarea> ng-model="data.client_monikers"></textarea>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

@ -79,7 +79,7 @@
</div> </div>
</div> </div>
<div class="box box-info" ng-if="!progress.processing && editingTask!=null"> <div class="box box-info" ng-if="!progress.processing && editingTask!=null">
<div class="box-header">Editing Task</div> <div class="box-header">Editing Task:{{editingTask.remark}}</div>
<div class="box-body"> <div class="box-body">
<div class="form-group"> <div class="form-group">
<label class="control-label">Settle Date</label> <label class="control-label">Settle Date</label>
@ -116,7 +116,7 @@
</table> </table>
</div> </div>
<div class="box-box-footer"> <div class="box-box-footer">
<button class="btn btn-danger" ng-click="editingTask = null">Cancel</button> <button class="btn btn-danger" ng-click="cancelEdit()">Cancel</button>
</div> </div>
</div> </div>
</section> </section>

@ -10,7 +10,8 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-4" for="planSelect">Plan</label> <label class="control-label col-xs-4" for="planSelect">Plan</label>
<div class="col-xs-6"> <div class="col-xs-6">
<select id="planSelect" ng-model="task.plan" ng-options="plan.plan_id as plan.name for plan in plans"> <select class="form-control" id="planSelect" ng-model="task.plan"
ng-options="plan.plan_id as plan.name for plan in plans">
<option value="">Manual Add</option> <option value="">Manual Add</option>
</select> </select>
</div> </div>
@ -37,14 +38,14 @@
</div> </div>
<div class="form-group" ng-if="!task.plan"> <div class="form-group" ng-if="!task.plan">
<label class="control-label col-xs-4">Enable Clean Days</label> <label class="control-label col-xs-4">Enable Clean Days</label>
<div class="col-xs-6 checkbox-inline"> <div class="col-xs-6">
<label> <label class="checkbox-inline">
<input type="checkbox" ng-model="task.t1">T+1 <input type="checkbox" ng-model="task.t1">T+1
</label> </label>
<label> <label class="checkbox-inline">
<input type="checkbox" ng-model="task.t2">T+2 <input type="checkbox" ng-model="task.t2">T+2
</label> </label>
<label> <label class="checkbox-inline">
<input type="checkbox" ng-model="task.t3">T+3 <input type="checkbox" ng-model="task.t3">T+3
</label> </label>
</div> </div>

Loading…
Cancel
Save