huwhois преди 4 години
родител
ревизия
20596800d5

+ 3 - 1
application/index/controller/Commission.php

@ -57,9 +57,9 @@ class Commission extends Controller
57 57
58 58
    public function handleData(&$value)
59 59
    {
60
        $value['price_rate'] = round($value['price'] / $value['base_price'], 4);
61 60
        switch ($value['type']) {
62 61
            case 1:
62
                $value['price_rate'] = round($value['price'] / $value['base_price'], 4);
63 63
                if ($value['price_rate'] < 1.05) {
64 64
                    $value['c_rate'] = 0.01;
65 65
                } elseif ($value['price_rate'] < 1.1) {
@ -71,11 +71,13 @@ class Commission extends Controller
71 71
                $value['c_money'] = ($value['actual_value'] - $value['shipping']) * $value['c_rate'];
72 72
                break;
73 73
            case 2:
74
                $value['price_rate'] = round($value['price'] / $value['base_price'], 4);
74 75
                $value['c_rate'] = floor(((($value['price_rate'] - 1) / 0.1) * 0.01 + 0.01) * 100) / 100;
75 76
                $value['actual_value'] = $value['contract_value'] - $value['agency'];
76 77
                $value['c_money'] = ($value['actual_value'] - $value['shipping']) * $value['c_rate'];
77 78
                break;
78 79
            default:
80
                $value['price_rate'] = 0;
79 81
                $value['c_rate'] = 0;
80 82
                $value['base_value'] = $value['amount'] * $value['base_price'];
81 83
                $value['total_profit'] = $value['contract_value'] - $value['agency'] - $value['base_value'] - $value['shipping'];

+ 1 - 1
application/index/model/Sales.php

@ -63,7 +63,7 @@ class Sales
63 63
64 64
    private function getSalesData()
65 65
    {
66
        $curSheet = $this->excel->getSheet(1);
66
        $curSheet = $this->excel->getSheet(0);
67 67
        // 调用 PHPExcel_Worksheet toArray 方法
68 68
        // return $curSheet->toArray(); // 数据量大时太慢,太卡
69 69

+ 1 - 1
application/index/view/commission/index.html

@ -56,7 +56,7 @@
56 56
            <div class="col-md-12 lin-height text_center"><a href="/index/seller">销售员管理</a></div>
57 57
            <div class="col-md-12 lin-height text_center"><a href="/index/company">销售单位管理</a></div>
58 58
        </div>
59
        <div class="content" style="width:1400px;">
59
        <div class="content" style="width:1300px;">
60 60
            <div class="time row">
61 61
                <div class="col-md-3">
62 62
                    请选择月份 :

+ 12 - 2
application/index/view/commission/input.html

@ -385,7 +385,7 @@ function updatePeriodBalance() {
385 385
    $.post('/index/commission/perbalance', {
386 386
        'company': dataForm.company
387 387
    }, function(res) {
388
        console.log(res);
388
        // console.log(res);
389 389
        if (res.code == 0) {
390 390
            dataForm.period_balance = res.data;
391 391
            $("#period_balance").val(dataForm.period_balance)
@ -407,11 +407,18 @@ $('#conpany_sales_data').change(function(){
407 407
        $("#market-form")[0].reset();
408 408
    } else {
409 409
        var data = conpanySalesData[k];
410
        console.log(data);
410 411
        dataForm.contract_no = data.contract_no;
411 412
        dataForm.goods_category = data.goods_category;
412 413
        dataForm.goods_type = data.goods_type;
413 414
        dataForm.amount = data.amount;
414
        dataForm.price = data.price;
415
        if (data.price.indexOf('(') != -1) {
416
            var price = ltrim(data.price, '(');
417
            price = rtrim(price, ')');
418
            dataForm.price = Number(-price);
419
        } else {
420
            dataForm.price = data.price;
421
        }
415 422
        dataForm.seller = data.seller;
416 423
        dataForm.shipping = data.shipping;
417 424
        dataForm.former_id = data.former_id;
@ -426,6 +433,9 @@ $('#conpany_sales_data').change(function(){
426 433
        $("#goods_category").val(dataForm.goods_category);
427 434
        $("#goods_type").val(dataForm.goods_type);
428 435
        $("#amount").val(Number(dataForm.amount));
436
        if (dataForm.price<0) {
437
            $("#price").css('color', 'red');
438
        }
429 439
        $("#price").val(Number(dataForm.price));
430 440
        if (dataForm.contract_value<0) {
431 441
            $("#contract_value").css('color', 'red');

BIN
db/mysqlitedb.db