index.vue 28.3 KB
Newer Older
潘自豪's avatar
潘自豪 committed
1
<template>
xuzhuo's avatar
xuzhuo committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
  <div class="main">
    <div class="middle">
      <display-board class="trade_left" title="营业情况">
        <div
          style="height: 100%; display: flex; flex-direction: column; justify-content: space-around; padding: 0 1rem 0 1rem;">
          <contrast-card :mouseHand="true" v-for="data in yyqk" style="height: 28%;"
                         @click.native="routerTo('/turnover-detail',paths[data.title])">
            <title-content-mark style="width: 40%;color: #369afa;float: left;" :title="data.title"
                                :content="data.amount" :mark="data.unit"/>
            <div
              style="width: 60%; height: 100%; float:left; padding: 4% 4% 0 12%; line-height: 26px;; display: flex; align-items: center;">
              <table-column style="float: left;width: 25%;" :data="data.hb" name="title"/>
              <table-column style="float: left;width: 40%;" :data="data.hb" name="amount"/>
              <table-column style="float: left;width: 35%;" :data="data.hb" name="rate"
                            :cell-style-function="cellStyleFunction"/>
              <!--              <table-column style="float: left;width: 35%;" :data="data.hb" name="rate" cell-style-js="var res = {color: '#5eeef4'};  if(data.indexOf('+') !== -1){res.color = '#fee064'} res; "/>-->
            </div>
          </contrast-card>
        </div>
      </display-board>
      <display-board class="trade_middle" title="应收款情况" corner_size="large">
        <div style="height: 36%;display: flex;justify-content: space-evenly;padding-top: 1.5rem">
          <simple-card v-for="data in arSummary" style="width: 30%;height: 100%">
            <title-content-mark style="color: #5eeef4;" :title="data.title" :content="data.value" :mark="'万元'"
                                isCenter isBold/>
          </simple-card>
        </div>
        <ar-summary-bar ref="arSummaryBar" style="width: 100%; height: 64%;"></ar-summary-bar>
      </display-board>
      <display-board class="trade_right" title="账款情况">
        <div
          style="height: 100%; display: flex; flex-direction: column; justify-content: space-around; padding: 0 1rem 0 1rem;">
          <contrast-card v-for="data in zkqk" style="height: 28%;">
            <title-content-mark style="width: 40%;color: #369afa;float: left;" v-if="data.title == '应收账款'"  @click.native="goAccRevSearch"  :title="data.title"
                                :content="data.amount" :mark="data.unit"/>
            <title-content-mark v-else style="width: 40%;color: #369afa;float: left;" :title="data.title"
                                :content="data.amount" :mark="data.unit"/>
            <div
              style="width: 60%; height: 100%; float:left; padding: 4% 4% 0 12%; line-height: 26px;; display: flex; align-items: center;">
              <table-column style="float: left;width: 25%;" :data="data.hb" name="title"/>
              <table-column style="float: left;width: 40%;" :data="data.hb" name="amount"/>
              <table-column style="float: left;width: 35%;" :data="data.hb" name="rate"
                            :cell-style-function="cellStyleFunction"/>
            </div>
          </contrast-card>
        </div>
      </display-board>
    </div>
    <div class="middle">
张恒's avatar
张恒 committed
51
      <display-board class="trade_left" title="已开票未收款">
Inner peace's avatar
Inner peace committed
52
        <winners-list style="height: 96%;overflow: auto;" :mouseHand="true" @click.native="goArBar" id="ar_company_list" :rows="arCompanyList"/>
张恒's avatar
张恒 committed
53
      </display-board>
xuzhuo's avatar
xuzhuo committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
      <div class="trade_middle" style="border: none;box-shadow: none;">
        <div style="display: flex; justify-content: space-between; height: 50%;">
          <display-board style="width: 32%;" title="每日目标情况" :mouseHand="true" @click.native="routerTo('/target-achievement','day')">
            <div
              style="width: 100%; height: 100%; float:left; padding: 2%; line-height: 33px; display: flex; align-items: center; font-size: 10px;">
              <table-column style="float: left;width: 35%;" :data="targetAchievement.day" name="title" show-head/>
              <table-column
                style="float: left;width: 45%;font-size: 24px;font-weight: bold;color: #5eeef4;text-align: center;"
                :data="targetAchievement.day" name="actualValue" title="实时值" show-head/>
              <table-column style="float: left;width: 20%;" :data="targetAchievement.day" name="targetValue" title="目标值"
                            show-head/>
            </div>
          </display-board>
          <display-board style="width: 32%;" title="月度目标情况" :mouseHand="true" @click.native="routerTo('/target-achievement','month')">
            <div
              style="width: 100%; height: 100%; float:left; padding: 2%; line-height: 33px; display: flex; align-items: center; font-size: 10px;">
              <table-column style="float: left;width: 35%;" :data="targetAchievement.month" name="title" show-head/>
              <table-column
                style="float: left;width: 45%;font-size: 24px;font-weight: bold;color: #5eeef4;text-align: center;"
                :data="targetAchievement.month" name="actualValue" title="实时值" show-head/>
              <table-column style="float: left;width: 20%;" :data="targetAchievement.month" name="targetValue" title="目标值"
                            show-head/>
            </div>
          </display-board>
          <display-board style="width: 32%;" title="年度目标情况" :mouseHand="true" @click.native="routerTo('/target-achievement','year')">
            <div
              style="width: 100%; height: 100%; float:left; padding: 2%; line-height: 33px; display: flex; align-items: center; font-size: 10px;">
              <table-column style="float: left;width: 35%;" :data="targetAchievement.year" name="title" show-head/>
              <table-column
                style="float: left;width: 45%;font-size: 24px;font-weight: bold;color: #5eeef4;text-align: center;"
                :data="targetAchievement.year" name="actualValue" title="实时值" show-head/>
              <table-column style="float: left;width: 20%;" :data="targetAchievement.year" name="targetValue" title="目标值"
                            show-head/>
            </div>
          </display-board>
        </div>
        <div style="display: flex; justify-content: space-between; height: 50%; padding-top: 2rem;" >
          <showcase style="width: 16%;" title="当日订单量">
            <title-content-mark
              style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;font-size: 16px;"
              content-style="font-size: 14px;" mark-style="font-size: 10px;" :content="drddl.weight+ ' 万吨'"
            />
            <title-content-mark style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;"
                                content-style="font-size: 14px;" mark-style="font-size: 10px;"
                                :content="drddl.amount+' 万元'" />
          </showcase>
          <showcase style="width: 16%;" title="当日运单量" :mouseHand="true" @click.native="routerTo('/department-shipment')">
            <title-content-mark
              style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;font-size: 16px;"
              content-style="font-size: 14px;" mark-style="font-size: 10px;" :content="drydl.count + ' 车'"
            />
            <title-content-mark style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;"
                                content-style="font-size: 14px;" mark-style="font-size: 10px;"
                                :content="drydl.weight + ' 万吨'" />
          </showcase>
          <showcase style="width: 16%;" title="当日完成量">
            <title-content-mark
              style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;font-size: 16px;"
              content-style="font-size: 14px;" mark-style="font-size: 10px;" :content="drwcl.weight+ ' 万吨'"
            />
            <title-content-mark style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;"
                                content-style="font-size: 14px;" mark-style="font-size: 10px;"
                                :content="drwcl.amount+ ' 万元'" />
          </showcase>
          <showcase style="width: 16%;" title="余量">
            <title-content-mark
              style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;font-size: 16px;"
              content-style="font-size: 14px;" mark-style="font-size: 10px;" :content="yl.weight+ ' 万吨'" />
            <title-content-mark style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;"
                                content-style="font-size: 14px;" mark-style="font-size: 10px;"
                                :content="yl.amount+ ' 万元'" />
          </showcase>
          <showcase style="width: 16%;" title="流失客户" :mouseHand="true" @click.native="routerTo('/lost-add-customer',2)">
            <title-content-mark
              style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;font-size: 16px;"
              content-style="font-size: 14px;" mark-style="font-size: 10px;" :content="lskh.weight+' 万吨'"
            />
            <title-content-mark style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;"
                                content-style="font-size: 14px;" mark-style="font-size: 10px;"
                                :content="lskh.amount+ ' 万元'" />
          </showcase>
          <showcase style="width: 16%;" title="新增客户" :mouseHand="true" @click.native="routerTo('/lost-add-customer',1)">
            <title-content-mark
              style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;font-size: 16px;"
              content-style="font-size: 14px;" mark-style="font-size: 10px;" :content="xzkh.weight+ ' 万吨'"
            />
            <title-content-mark style="float:left;width: 100%;height: 50%;color: #5eeef4;padding: 0 15%;"
                                content-style="font-size: 14px;" mark-style="font-size: 10px;"
                                :content="xzkh.amount + ' 万元'" />
          </showcase>
潘自豪's avatar
潘自豪 committed
144 145
        </div>
      </div>
xuzhuo's avatar
xuzhuo committed
146 147 148 149 150 151 152 153 154 155 156
      <display-board class="trade_right" title="当日订单量占比">
        <div
          style="height: 100%; display: flex; flex-direction: column; justify-content: space-around; padding: 0 1rem 0 1rem;">
          <ring-pie-chart ref="transportTypeChart" style="width: 100%;height: 50%;z-index: 999" name="运输类型占比"
                          :data="transportTypeOrderFinishPie" @click.native="routerTo('/order-proportion')"
                          :value-formatter="pieDataValueFormatter" :formatter="pieDataFormatter"/>
          <ring-pie-chart ref="customerChart" style="width: 100%;height: 50%;" name="公司占比"
                          :data="customerOrderFinishPie" @click.native="routerTo('/order-proportion')"
                          :value-formatter="pieDataValueFormatter" :formatter="pieDataFormatter"/>
        </div>
      </display-board>
潘自豪's avatar
潘自豪 committed
157 158 159 160
    </div>
  </div>
</template>
<script>
张恒's avatar
张恒 committed
161 162
import DisplayBoard from "./components/container/display-board.vue";
import Showcase from "./components/container/showcase.vue";
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
163
import ContrastCard from "./components/card/contrast-card.vue";
张恒's avatar
张恒 committed
164
import SimpleCard from "./components/card/simple-card.vue";
张恒's avatar
张恒 committed
165
import ArSummaryBar from "./components/chart/ar-summary-bar.vue";
张恒's avatar
张恒 committed
166
import WinnersList from "./components/card/winners-list.vue";
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
167 168 169
import TitleContentMark from "./components/layout/title-content-mark.vue";
import TableColumn from "./components/table/table-column.vue";
import RingPieChart from "./components/chart/ring-pie-chart.vue";
170 171
import {
  arSummaryBar,
Inner peace's avatar
Inner peace committed
172
  getAccountSituation,
173 174 175 176 177
  arCompanyList,
  getBusinessConditionDatas,
  getOrderLoseAddCustomer,
  getOrderBusinessConditionData
} from "../api/apiList"
178
import {calc_hb_str, calc_tb_str, conver_amont, conver_num_retain} from "../utils/numUtil";
179
import {getTransportTypeOrderFinishPie, getCustomerOrderFinishPie} from "./databoard/js/indexPieData";
潘自豪's avatar
潘自豪 committed
180
import moment from 'moment'
181
import {getTargetOrderDataByConditionCount} from "./databoard/js/targetAchievementData";
潘自豪's avatar
潘自豪 committed
182
export default {
张恒's avatar
张恒 committed
183
  components: {
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
184 185 186
    RingPieChart,
    TableColumn,
    TitleContentMark,
张恒's avatar
张恒 committed
187 188 189 190
    Showcase,
    DisplayBoard,
    ContrastCard,
    SimpleCard,
张恒's avatar
张恒 committed
191
    ArSummaryBar,
张恒's avatar
张恒 committed
192 193
    WinnersList
  },
潘自豪's avatar
潘自豪 committed
194 195
  data() {
    return {
Inner peace's avatar
Inner peace committed
196
      today: moment().format("yyyy-MM-DD"),
潘自豪's avatar
潘自豪 committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
      yyqk: {
        yye: {
          title: "营业额",
          amount: "20,303",
          unit: "万元",
          hb: [
            {
              title: "昨天",
              amount: "21,000",
              rate: "-3.32%",
            },
            {
              title: "上月",
              amount: "20,000",
              rate: "+4.92%",
            },
          ],
        },
        cb: {
          title: "成本",
          amount: "10,303",
          unit: "万元",
          hb: [
            {
              title: "昨日",
              amount: "11,000",
              rate: "-2.68%",
            },
            {
              title: "上月",
              amount: "10,000",
              rate: "+5.71%",
            },
          ],
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
231
        },
潘自豪's avatar
潘自豪 committed
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
        ml: {
          title: "毛利",
          amount: "10,000",
          unit: "万元",
          hb: [
            {
              title: "昨日",
              amount: "10,000",
              rate: "0.00%",
            },
            {
              title: "上月",
              amount: "10,000",
              rate: "0.00%",
            },
          ],
        },
      },
张恒's avatar
张恒 committed
250 251 252 253 254
      arSummary: [
        {title: '累计营业收入(当年)', value: '20,303'},
        {title: '应收款(财务)', value: '20,303'},
        {title: '应收款(营销)', value: '20,303',},
      ],
潘自豪's avatar
潘自豪 committed
255 256 257 258 259 260 261 262
      lskh: {
        weight: "2,000",
        amount: "20,000",
      },
      xzkh: {
        weight: "2,000",
        amount: "20,000",
      },
263 264 265 266
      drddl: {
        weight: "2,000",
        amount: "20,000",
      },
xuzhuo's avatar
xuzhuo committed
267 268 269 270
      drydl: {
        count: "2,000",
        weight: "20,000",
      },
271 272 273 274
      drwcl: {
        weight: "2,000",
        amount: "20,000",
      },
Inner peace's avatar
Inner peace committed
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
      zkqk: {
        yszk: {
          title: "应收账款",
          amount: "20,303",
          unit: "万元",
          hb: [
            {
              title: "昨天",
              amount: "21,000",
              rate: "-3.32%",
            },
            {
              title: "上月",
              amount: "20,000",
              rate: "+4.92%",
            },
          ],
        },
        yfzk: {
          title: "应付账款",
          amount: "10,303",
          unit: "万元",
          hb: [
            {
              title: "昨日",
              amount: "11,000",
              rate: "-2.68%",
            },
            {
              title: "上月",
              amount: "10,000",
              rate: "+5.71%",
            },
          ],
        },
        zsye: {
          title: "账上余额",
          amount: "10,000",
          unit: "万元",
          hb: [
            {
              title: "昨日",
              amount: "10,000",
              rate: "0.00%",
            },
            {
              title: "上月",
              amount: "10,000",
              rate: "0.00%",
            },
          ],
        },
      },
328 329 330 331
      yl: {
        weight: "2,000",
        amount: "20,000",
      },
潘自豪's avatar
潘自豪 committed
332 333
      mockData: {
        zqk: {
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
          yszk: {
            title: "应收账款",
            amount: "20,303",
            unit: "万元",
            hb: [
              {
                title: "昨天",
                amount: "21,000",
                rate: "-3.32%",
              },
              {
                title: "上月",
                amount: "20,000",
                rate: "+4.92%",
              },
            ],
          },
          yfzk: {
            title: "应付账款",
            amount: "10,303",
            unit: "万元",
            hb: [
              {
                title: "昨日",
                amount: "11,000",
                rate: "-2.68%",
              },
              {
                title: "上月",
                amount: "10,000",
                rate: "+5.71%",
              },
            ],
          },
          zsye: {
            title: "账上余额",
            amount: "10,000",
            unit: "万元",
            hb: [
              {
                title: "昨日",
                amount: "10,000",
                rate: "0.00%",
              },
              {
                title: "上月",
                amount: "10,000",
                rate: "0.00%",
              },
            ],
          },
        },
        sr: [
          {
            title: '累计营业收入(当年)',
            value: '20,303',
          },
          {
            title: '应收款(财务)',
            value: '20,303',
          },
          {
            title: '应收款(营销)',
            value: '20,303',
          },
        ],
        mrmbqk: [
          {
            title: "吨位(万吨)",
            actualValue: "20,303",
            currentValue: "21,000",
          },
          {
            title: "营业额(万元)",
            actualValue: "32,342",
            currentValue: "21,000",
          },
          {
            title: "净利润(万元)",
            actualValue: "32,342",
            currentValue: "21,000",
          },
        ],
        ydmbqk: [
          {
            title: "吨位(万吨)",
            actualValue: "20,303",
            currentValue: "21,000",
          },
          {
            title: "营业额(万元)",
            actualValue: "32,342",
            currentValue: "21,000",
          },
          {
            title: "净利润(万元)",
            actualValue: "32,342",
            currentValue: "21,000",
          },
        ],
        drddl: {
          weight: "2,000",
          amount: "20,000",
        },
        drwcl: {
          weight: "2,000",
          amount: "20,000",
        },
        yl: {
          weight: "2,000",
          amount: "20,000",
        },
        lskh: {
          weight: "2,000",
          amount: "20,000",
        },
        xzkh: {
          weight: "2,000",
          amount: "20,000",
        },
        ndmbqk: [
          {
            title: "吨位(万吨)",
            actualValue: "20,303",
            currentValue: "21,000",
          },
          {
            title: "营业额(万元)",
            actualValue: "32,342",
            currentValue: "21,000",
          },
          {
            title: "净利润(万元)",
            actualValue: "32,342",
            currentValue: "21,000",
          },
        ],
潘自豪's avatar
潘自豪 committed
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
        zkqk: {
          yszk: {
            title: "应收账款",
            amount: "20,303",
            unit: "万元",
            hb: [
              {
                title: "昨天",
                amount: "21,000",
                rate: "-3.32%",
              },
              {
                title: "上月",
                amount: "20,000",
                rate: "+4.92%",
              },
            ],
          },
          yfzk: {
            title: "应付账款",
            amount: "10,303",
            unit: "万元",
            hb: [
              {
                title: "昨日",
                amount: "11,000",
                rate: "-2.68%",
              },
              {
                title: "上月",
                amount: "10,000",
                rate: "+5.71%",
              },
            ],
          },
          zsye: {
            title: "账上余额",
            amount: "10,000",
            unit: "万元",
            hb: [
              {
                title: "昨日",
                amount: "10,000",
                rate: "0.00%",
              },
              {
                title: "上月",
                amount: "10,000",
                rate: "0.00%",
              },
            ],
          },
        },
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552
        barChart: {
          textStyle: {color: "#fff"},
          tooltip: {},
          xAxis: {
            data: ['未结算未开票', '已结算未开票', '已开票未收款', '应收款', '已开票已收款']
          },
          yAxis: {},
          series: [
            {
              name: '开票详情',
              type: 'bar',
              data: [500, 300, 500, 1001, 319],
              color: "#7f83f7",
              label: {
                show: true,
                position: 'top',
                color: "#fff",
              },
            }
          ]
        },
        drddlzb: {
          transportType: [
            {value: 2500, name: '汽运'},
            {value: 100, name: '码头/仓库'},
            {value: 500, name: '铁运'},
            {value: 484, name: '水运'},
          ],
          customer: [
553 554 555
            {value: 500, name: '上海欧冶物流股份有限公司'},
            {value: 2500, name: '宝钢运输部'},
            {value: 1100, name: '宝山钢铁股份有限公司'},
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
556 557 558
          ]
        },
      },
559
      paths: {
潘自豪's avatar
潘自豪 committed
560 561 562
        "营业额": "yye",
        "成本": "cb",
        "毛利": "ml",
563
      },
564 565 566 567
      dataset: {},
      transportTypeOrderFinishPie: [],
      customerOrderFinishPie: [],
      arCompanyList: [],
568 569 570 571 572 573
      charts: {},
      targetAchievement:{
        day: null,
        month: null,
        year: null,
      }
张恒's avatar
张恒 committed
574
    }
潘自豪's avatar
潘自豪 committed
575
  },
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
576
  methods: {
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
577
    cellStyleFunction(data) {
潘自豪's avatar
潘自豪 committed
578 579 580
      let res = {color: '#33ff66'};
      if (data.indexOf('-') !== -1) {
        res.color = '#ff3300'
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
581 582 583 584 585 586 587 588
      }
      return res;
    },
    resizeChart() {
      for (let chartsKey in this.charts) {
        this.charts[chartsKey].resize();
      }
    },
589
    routerTo(path, code) {
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
590
      this.$router.push({path: path, query: {code: code}});
591 592 593
    },
    //营业情况
    showBusinessConditionDatas() {
潘自豪's avatar
潘自豪 committed
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
      let res = getBusinessConditionDatas(this.today)
      res.then(data => {
        data = data.data;
        //营业额
        this.yyqk.yye.amount = conver_amont(data.cur_sell_settle_amount);
        this.yyqk.yye.hb[0].amount = conver_amont(data.pre_sell_settle_amount);
        this.yyqk.yye.hb[0].rate = calc_hb_str(data.cur_sell_settle_amount, data.pre_sell_settle_amount);
        this.yyqk.yye.hb[1].amount = conver_amont(data.pre_month_sell_settle_amount);
        this.yyqk.yye.hb[1].rate = calc_tb_str(data.cur_sell_settle_amount, data.pre_month_sell_settle_amount);
        //成本
        this.yyqk.cb.amount = conver_amont(data.cur_buy_settle_amount);
        this.yyqk.cb.hb[0].amount = conver_amont(data.pre_buy_settle_amount);
        this.yyqk.cb.hb[0].rate = calc_hb_str(data.cur_buy_settle_amount, data.pre_buy_settle_amount);
        this.yyqk.cb.hb[1].amount = conver_amont(data.pre_month_buy_settle_amount);
        this.yyqk.cb.hb[1].rate = calc_tb_str(data.cur_buy_settle_amount, data.pre_month_buy_settle_amount);
        //毛利
        this.yyqk.ml.amount = conver_amont(data.cur_gross_profit_amount);
        this.yyqk.ml.hb[0].amount = conver_amont(data.pre_gross_profit_amount);
        this.yyqk.ml.hb[0].rate = calc_hb_str(data.cur_gross_profit_amount, data.pre_gross_profit_amount);
        this.yyqk.ml.hb[1].amount = conver_amont(data.pre_month_gross_profit_amount);
        this.yyqk.ml.hb[1].rate = calc_tb_str(data.cur_gross_profit_amount, data.pre_month_gross_profit_amount);
      })
616
    },
617 618 619 620
    // 跳转已开票未收款页面
    goArBar() {
      this.$router.push('/ar_bar')
    },
Inner peace's avatar
Inner peace committed
621 622
    // 跳转到应收账款汇总表
    goAccRevSearch() {
Inner peace's avatar
Inner peace committed
623
      parent.window.location = '/#/l/accounts_receivable_statistics_search'
Inner peace's avatar
Inner peace committed
624
    },
625 626
    // 获取应收账款数据
    getArSummaryBar() {
627
      arSummaryBar().then(res => {
张恒's avatar
张恒 committed
628
        let data = res.data
629
        let seriesData = []
630 631 632 633 634
        seriesData.push(data.unsettled_amount)
        seriesData.push(data.settled_amount)
        seriesData.push(data.unregister_amount)
        seriesData.push(data.receivable_amount)
        seriesData.push(data.cancelled_amount)
潘自豪's avatar
潘自豪 committed
635 636 637
        this.arSummary[0].value = conver_num_retain(data.total_amount)
        this.arSummary[1].value = conver_num_retain(data.unregister_amount)
        this.arSummary[2].value = conver_num_retain(data.receivable_amount)
Inner peace's avatar
Inner peace committed
638
        this.zkqk.yszk.amount = conver_num_retain(data.receivable_amount)
639 640 641 642 643
        this.$refs.arSummaryBar.drawArSummaryBar(seriesData)
      }).catch(err => {
        console.log(err);
      });
    },
Inner peace's avatar
Inner peace committed
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669
    //获取账款情况
    getAccountSituation(){
      getAccountSituation(this.today).then(res => {
        let data = res.data
        this.zkqk.yszk.hb[0].amount = conver_amont(data.per_day_receivable_amount);
        this.zkqk.yszk.hb[0].rate = calc_hb_str(this.zkqk.yszk.amount, data.per_day_receivable_amount);
        this.zkqk.yszk.hb[1].amount = conver_amont(data.per_month_receivable_amount);
        this.zkqk.yszk.hb[1].rate = calc_tb_str(this.zkqk.yszk.amount, data.per_month_receivable_amount);

        this.zkqk.yfzk.amount = conver_amont(data.payable_amount)
        this.zkqk.yfzk.hb[0].amount = conver_amont(data.per_day_payable_amount);
        this.zkqk.yfzk.hb[0].rate = calc_hb_str(data.payable_amount, data.per_day_receivable_amount);
        this.zkqk.yfzk.hb[1].amount = conver_amont(data.per_month_payable_amount);
        this.zkqk.yfzk.hb[1].rate = calc_tb_str(data.payable_amount, data.per_month_payable_amount);

        this.zkqk.zsye.amount = conver_amont(data.acc_bla)
        this.zkqk.zsye.hb[0].amount = conver_amont(data.per_day_acc_bla);
        this.zkqk.zsye.hb[0].rate = calc_hb_str(data.acc_bla, data.per_day_acc_bla);
        this.zkqk.zsye.hb[1].amount = conver_amont(data.per_month_acc_bla);
        this.zkqk.zsye.hb[1].rate = calc_tb_str(data.acc_bla, data.per_month_acc_bla);

      }).catch(err => {
        console.log(err);
      });

    },
670 671
    // 获取已开票未收款排行
    getArCompanyList() {
672
      arCompanyList().then(res => {
张恒's avatar
张恒 committed
673 674
        if (res.data.length) {
          this.arCompanyList = res.data
675 676 677 678
        }
      }).catch(err => {
        console.log(err);
      });
679
    },
680
    refreshData() {
xuzhuo's avatar
xuzhuo committed
681 682 683 684 685 686 687 688 689
      getTransportTypeOrderFinishPie(res => this.transportTypeOrderFinishPie = res, this.today);
      getCustomerOrderFinishPie(res => this.customerOrderFinishPie = res, this.today);
      this.showBusinessConditionDatas();
      this.getArSummaryBar();
      this.getAccountSituation();
      this.getArCompanyList();
      this.getLoseAndAdd();
      this.getOrderBusinessCondition();
      this.getTargetOrderDataByConditionCount();
690
    },
691
    pieDataValueFormatter(param) {
692
      return conver_amont(param) + "万吨";
693
    },
694
    pieDataFormatter(param) {
695
      return param.name + '\r\n' + this.pieDataValueFormatter(param.value);
696
    },
潘自豪's avatar
潘自豪 committed
697 698 699 700 701 702 703 704
    getLoseAndAdd() {
      getOrderLoseAddCustomer(this.today).then(res => {
        let data = res.data
        this.lskh.amount = conver_amont(data.lost_sell_settle_amount_sum);
        this.lskh.weight = conver_amont(data.lost_weight_sum);
        this.xzkh.amount = conver_amont(data.add_sell_settle_amount_sum);
        this.xzkh.weight = conver_amont(data.add_weight_sum);
      })
705 706 707 708 709 710
    },
    getOrderBusinessCondition() {
      getOrderBusinessConditionData(this.today).then(res => {
        let data = res.data
        this.drddl.amount = conver_amont(data.cur_sell_settle_amount);
        this.drddl.weight = conver_amont(data.cur_unit_weight);
xuzhuo's avatar
xuzhuo committed
711

xuzhuo's avatar
xuzhuo committed
712
        this.drydl.count = data.drydl_count;
xuzhuo's avatar
xuzhuo committed
713 714
        this.drydl.weight = conver_amont(data.drydl_weight);

715 716 717 718 719
        this.drwcl.amount = conver_amont(data.cur_finish_sell_settle_amount);
        this.drwcl.weight = conver_amont(data.cur_finish_unit_weight);
        this.yl.amount = conver_amont(data.cur_unfinish_sell_settle_amount);
        this.yl.weight = conver_amont(data.cur_unfinish_unit_weight);
      })
720 721 722 723 724
    },
    getTargetOrderDataByConditionCount() {
      getTargetOrderDataByConditionCount({cur_day: this.today,time_type:"day",group_type:"01"},(res) => {this.targetAchievement.day = res;})
      getTargetOrderDataByConditionCount({cur_day: this.today,time_type:"month",group_type:"01"},(res) => {this.targetAchievement.month = res;})
      getTargetOrderDataByConditionCount({cur_day: this.today,time_type:"year",group_type:"01"},(res) => {this.targetAchievement.year = res;})
潘自豪's avatar
潘自豪 committed
725
    }
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
726 727
  },
  mounted() {
728
    this.refreshData();
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
729
  },
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
730 731
  beforeDestroy() {
    window.removeEventListener("resize", this.resizeChart);
732 733 734 735 736 737 738 739 740 741 742 743
  },
  watch:{
    countDown(n,o){
      if (n === 1){
        this.refreshData();
      }
    },
  },
  props:{
    countDown:{
      type: Number
    }
王礼鸿 Baimax Wang's avatar
王礼鸿 Baimax Wang committed
744
  }
潘自豪's avatar
潘自豪 committed
745 746
};
</script>
747

xuzhuo's avatar
xuzhuo committed
748
<style scoped>
749 750 751 752 753
#ar_company_list:hover {
  background-color: #19EBFF10;
  transform: scale(101%);
}
</style>