|
|
@ -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
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|