* The budget will no longer be divided by ten thousand in the javescript.

This commit is contained in:
liumengyi
2024-01-22 10:45:30 +08:00
parent c3994a6197
commit 5cfab183d0
5 changed files with 7 additions and 11 deletions
+5 -6
View File
@@ -246,14 +246,13 @@ function checkProjectInfo()
if(typeof(data.availableBudget) != 'undefined')
{
const budget = $('[name=budget]').val() * budgetUnitValue;
const budget = $('[name=budget]').val();
const currency = currencySymbol[data.budgetUnit];
const availableBudget = data.availableBudget.toFixed(2);
$('[name=budget]').attr('placeholder', parentBudget + currency + availableBudget);
if(budget != 0 && budget !== null && budget > data.availableBudget)
{
const currency = currencySymbol[data.budgetUnit];
const availableBudget = (data.availableBudget / budgetUnitValue).toFixed(2);
const budgetTip = budgetOverrun.replace('%s', currency + availableBudget);
$('[name=budget]').attr('placeholder', budgetTip);
$('#budgetTip').html(budgetTip);
$('#budgetTip').html(budgetOverrun.replace('%s', currency + availableBudget));
$('#budgetTip').append($('<span id="ignoreBudget" class="underline">' + ignore + '</span>'));
$('#budgetTip').removeClass('hidden');
$('#budgetTip').off('click', '#ignoreBudget').on('click', '#ignoreBudget', function(){ignoreTip('budgetTip')});
+1 -1
View File
@@ -101,7 +101,7 @@ $fields->field('budget')
->foldable()
->checkbox(array('text' => $lang->project->future, 'name' => 'future', 'checked' => $budgetFuture))
->control('inputControl', array('control' => 'input', 'name' => 'budget', 'prefix' => array('control' => 'dropdown', 'name' => 'budgetUnit', 'items' => $budgetItemList, 'widget' => true, 'text' => zget($lang->project->currencySymbol, data('project.budgetUnit') ? data('project.budgetUnit') : $currency), 'className' => 'btn ghost' . ($budgetFuture ? ' disabled pointer-events-none' : '')), 'prefixWidth' => 34, 'disabled' => $budgetFuture))
->tip(sprintf($lang->project->budgetOverrun, zget($lang->project->currencySymbol, $currency) . data('program.budget')))
->tip(sprintf($lang->project->parentBudget, zget($lang->project->currencySymbol, $currency) . data('paretnProgram.budget')))
->tipProps(array('id' => 'budgetTip'))
->tipClass('text-warning hidden');
-1
View File
@@ -18,7 +18,6 @@ jsVar('budgetOverrun', $lang->project->budgetOverrun);
jsVar('currencySymbol', $lang->project->currencySymbol);
jsVar('parentBudget', $lang->project->parentBudget);
jsVar('budgetUnitLabel', $lang->project->tenThousandYuan);
jsVar('budgetUnitValue', $config->project->budget->tenThousand);
jsVar('+projectID', $copyProjectID);
jsVar('LONG_TIME', LONG_TIME);
jsVar('weekend', $config->execution->weekend);
-1
View File
@@ -18,7 +18,6 @@ jsVar('budgetOverrun', $lang->project->budgetOverrun);
jsVar('currencySymbol', $lang->project->currencySymbol);
jsVar('parentBudget', $lang->project->parentBudget);
jsVar('budgetUnitLabel', $lang->project->tenThousandYuan);
jsVar('budgetUnitValue', $config->project->budget->tenThousand);
jsVar('unmodifiableProducts', $unmodifiableProducts);
jsVar('unmodifiableBranches', $unmodifiableBranches);
jsVar('unmodifiableMainBranches', $unmodifiableMainBranches);
+1 -2
View File
@@ -420,7 +420,7 @@ class projectZen extends project
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
$this->view->project = $project;
$this->view->programList = $programList;
$this->view->program = $program;
$this->view->parentProgram = $program;
$this->view->projectID = $projectID;
$this->view->allProducts = $allProducts;
$this->view->multiBranchProducts = $this->product->getMultiBranchPairs();
@@ -433,7 +433,6 @@ class projectZen extends project
$this->view->unmodifiableMainBranches = $unmodifiableMainBranches;
$this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs();
$this->view->parentProject = $parentProject;
$this->view->parentProgram = $this->program->getByID($project->parent);
$this->view->availableBudget = $parentProject ? $this->program->getBudgetLeft($parentProject) + (float)$project->budget : $project->budget;
$this->view->budgetUnitList = $this->project->getBudgetUnitList();
$this->view->model = $project->model;