index.vue 47.8 KB
1 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 51 52 53 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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 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 328 329 330 331 332 333 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 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 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 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 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 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395
订单管理
<template>
  <div class="marketing order-manage">
    <template v-if="showTable">
      <div class="list-tips m-b-10">
        <img class="tips-img" src="@/assets/icon-info.png" />
        <span class="table-tips">
          已生成有效订单
          <span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
          项 累计订单总额:
          <span class="txt-blue">{{ statisticsInfo.payPriceTotal || 0 }}&nbsp;</span>
          元 累计退款总额:
          <span class="txt-blue">{{ statisticsInfo.refundTotal || 0 }}&nbsp;</span>
          元
        </span>
      </div>
      <div class="container">
        <div class="sticky">
          <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData"
            @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
          <div class="flex">
            <div class="flex-default tabs">
              <el-tabs v-model="searchForm.requestSource" @tab-click="handleTabClick">
                <el-tab-pane label="全部订单" name="0"></el-tab-pane>
                <el-tab-pane label="已付款" name="1"></el-tab-pane>
                <el-tab-pane label="未付款" name="2"></el-tab-pane>
                <el-tab-pane label="已退款" name="3"></el-tab-pane>
                <el-tab-pane label="售后订单" name="4"></el-tab-pane>
              </el-tabs>
            </div>
            <el-button v-if="configShow" class="default-blue-btn" :size="size" type="default" @click="handleExport">
              导出
            </el-button>
          </div>
        </div>
        <!-- 表格区域 - 全部订单/售后订单 - 开始 -->
        <div class="order-manage-table">
          <GLTable ref="allOrderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm"
            :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
            @setTableFinishFun="setTableFinishFun">
            <div slot="giveEquityCard" slot-scope="scope" v-if="showGh && scope.scope.giveEquityCard == 1">
              <div class="gold-sign">送会员</div>
            </div>
            <div slot="weChatName" class="flex-align" slot-scope="scope">
              <img v-if="scope.scope.weChatImageUrl" class="img-36 pointer img-circle"
                :src="scope.scope.weChatImageUrl" />
              <span class="m-l-10">{{ scope.scope.weChatName }}</span>
              <span v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span>
            </div>
            <template slot="vinNo" slot-scope="scope">
              {{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }}
              <el-popover popper-class="order-table-popover" placement="right-start" trigger="click">
                <p v-for="(item, index) in scope.scope.vinNo" :key="index">{{ item }}</p>
                <span class="car-no" slot="reference" v-show="Array.isArray(scope.scope.vinNo)">...({{
                  scope.scope.vinNo.length - 1 }})</span>
              </el-popover>
            </template>
            <div slot="orderStatus" slot-scope="scope">
              <span
                :class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
              <span>{{
                baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ?
                baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-'
              }}</span>
            </div>
            <div slot="shareStaffName" class="table-image" slot-scope="scope">
              <div>
                <img v-if="scope.scope.shareStaffImageUrl" class="img-36 pointer img-circle"
                  style="vertical-align: middle" slot="reference" :src="scope.scope.shareStaffImageUrl" />
                <span class="m-l-10">
                  <span>{{ scope.scope.shareStaffName }}</span>
                  <span class="txt-green" v-if="scope.scope.shareStaffSource == 1">@微信</span>
                  <span class="txt-orange" v-if="scope.scope.shareStaffSource == 2">@企微</span>
                  <span class="txt-blue" v-if="scope.scope.shareStaffSource == 3">@员工</span>
                </span>
              </div>
              <span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span>
            </div>
            <div slot="assignName" slot-scope="scope">
              <div>
                <template v-if="scope.scope.assignStaffName">
                  <img class="img-36 pointer img-circle" v-if="scope.scope.assignStaffImageUrl"
                    :src="scope.scope.assignStaffImageUrl" />
                  <span class="m-l-10">
                    <span>{{ scope.scope.assignStaffName }}</span>
                  </span>
                </template>
                <template v-else-if="scope.scope.shareStaffName">
                  <img class="img-36 pointer img-circle" v-if="scope.scope.shareStaffImageUrl"
                    :src="scope.scope.shareStaffImageUrl" />
                  <span class="m-l-10">
                    <span>{{ scope.scope.shareStaffName }}</span>
                  </span>
                </template>
                <template v-else>
                  <span>{{ scope.scope.assignStaffName || scope.scope.shareStaffName || '-' }}</span>
                </template>
                <!-- <span @click="handlerAssign(scope.scope)"
                    class="assignLabel">指派</span> -->
              </div>
            </div>
            <div slot="marketingStatus" slot-scope="scope">
              <template v-if="scope.scope.marketingStatus">
                <span
                  :class="['table-circle', 'm-r-8', [1, 2].includes(scope.scope.marketingStatus) ? 'back-green' : 'back-grey']"></span>
              </template>
              <span>
                {{
                  scope.scope.marketingStatus
                  ? {
                    1: '已完结',
                    2: '已完结',
                    3: '未完结',
                    4: '已取消'
                  }[scope.scope.marketingStatus]
                  : '-'
                }}
              </span>
            </div>
            <div class="table-btns" slot="auth-button" slot-scope="scope">
              <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
            </div>
          </GLTable>
        </div>
        <!-- 表格区域 - 全部订单/售后订单 - end -->
      </div>
    </template>
    <!-- 快递信息 -->
    <GLDialog v-if="isExpressVisible" title="输入快递信息" mode="mid" okText="确定" cancelText="取消"
      :visible.sync="isExpressVisible" @onOk="handleExpressConfirm" @onCancel="handleExpressClose">
      <glsx-combi-form class="small-content m-t-20" ref="expressRef" :isBlock="true" defaultWidth="284px" :isEdit="isEdit"
        :formRef="editChildRef" :formObj="expressForm" :formData="expressFormData"
        :formRules="expressRules"></glsx-combi-form>
    </GLDialog>
    <!-- 订单核销 -->
    <GLDialog v-if="isWriteOffVisible" title="订单核销(请确保用户到店后核销,避免引起不必要问题)" mode="mid" okText="确定" cancelText="取消"
      :visible.sync="isWriteOffVisible" @onOk="handleWriteOffConfirm" @onCancel="handleWriteOffClose">
      <glsx-combi-form class="small-content m-t-20" ref="writeOffRef" :isBlock="true" defaultWidth="284px"
        :formRef="editChildRef" :formObj="writeOffForm" :formData="writeOffFormData"
        :formRules="writeOffRules"></glsx-combi-form>
    </GLDialog>
    <!-- 退款审核 -->
    <GLDialog v-if="isExamineVisible" bigTitle="退款审核" mode="big" :visible.sync="isExamineVisible"
      @onOk="handleExamineConfirm" @onCancel="handleExamineClose">
      <el-form label-width="144px">
        <el-form-item label="售后类型">
          <span>{{ orderInfo.refundTypeName }}</span>
        </el-form-item>
        <el-form-item label="申请金额">
          <span>{{ orderInfo.refundPrice }}</span>
        </el-form-item>
        <el-form-item label="申请时间">
          <span>{{ orderInfo.createdDateStr }}</span>
        </el-form-item>
        <el-form-item label="申请描述">
          <span>{{ orderInfo.remark || '-' }}</span>
        </el-form-item>
        <el-form-item v-if="orderInfo.imgUrls">
          <span v-for="(item, index) in orderInfo.imgUrls" :key="index">
            <el-image class="img-60" :src="item" :preview-src-list="[item]"></el-image>
          </span>
        </el-form-item>
        <el-form-item label="审核是否通过">
          <el-radio-group v-model="examineForm.isAllowed">
            <el-radio label="1">审核通过</el-radio>
            <el-radio label="2">审核不通过</el-radio>
          </el-radio-group>
        </el-form-item>
        <template v-if="orderInfo.refundType == 1 && examineForm.isAllowed == '1'">
          <glsx-combi-form ref="examineRef" :isEdit="isEdit" defaultWidth="284px" :isBlock="true" :formRef="editChildRef"
            :formObj="examineForm" :formData="examineFormData" :formRules="examineRules"></glsx-combi-form>
        </template>
      </el-form>
    </GLDialog>
    <!-- 确认收货 -->
    <GLDialog v-if="isReceivingVisible" bigTitle="确认收货" mode="big" :visible.sync="isReceivingVisible"
      @onOk="handleReceivingConfirm" @onCancel="handleReceivingClose">
      <el-form label-width="140px">
        <el-form-item label="售后类型">
          <span>{{ orderInfo.refundTypeName }}</span>
        </el-form-item>
        <el-form-item label="申请金额">
          <span>{{ orderInfo.refundPrice }}</span>
        </el-form-item>
        <el-form-item label="申请时间">
          <span>{{ orderInfo.createdDateStr }}</span>
        </el-form-item>
        <el-form-item label="申请描述">
          <span>{{ orderInfo.remark || '-' }}</span>
        </el-form-item>
        <el-form-item label="快递公司">
          <span>{{ orderInfo.deliveryCompany }}</span>
        </el-form-item>
        <el-form-item label="快递单号">
          <span>{{ orderInfo.deliveryNumber }}</span>
        </el-form-item>
      </el-form>
    </GLDialog>
    <!-- 退款类型 -->
    <GLDialog mode="mid" class="refund-dialog" title="退款" :visible.sync="refundVisible"
      @onCancel="refundVisible = !refundVisible" @onOk="refundFun">
      <div class="gl-form-page gl-form-min">
        <el-form ref="form" label-width="154px">
          <el-form-item label="退款类型:">
            <el-radio-group v-model="refundParams.afterSaleType">
              <div class="refund-item">
                <el-radio v-model="radio" label="2">退定金</el-radio>
                <div class="refund-tips">选择此项不会扣减实际订单数</div>
              </div>
              <div class="refund-item">
                <el-radio v-model="radio" label="1">退订单</el-radio>
                <div class="refund-tips">选择此项会扣减实际订单数</div>
              </div>
            </el-radio-group>
          </el-form-item>
        </el-form>
      </div>
    </GLDialog>
  </div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { utils } from 'glsx-common'
import {
  businessType,
  orderManageStatusList,
  afterSaleStatusList,
  orderSourceList,
  deliveryTypeList,
  exportFn
} from '@/common/constant'

export default {
  name: 'orderManage',
  data() {
    return {
      isHmd: true,
      showGh: false,
      size: 'small',
      url: url,
      isEdit: true,
      orderCode: '',
      oldVal: {
        orderStatuses: [],
        afterSaleStatuses: []
      },
      refundVisible: false,
      refundParams: {},
      searchForm: {
        orderCode: '',
        orderStatuses: [],
        afterSaleStatuses: [],
        merchantName: '',
        customerName: '',
        createDate: [],
        orderSource: '',
        deliveryType: '',
        vin: '',
        shareStaffName: '',
        shareStaffSource: '',
        activityName: '',
        goodsName: '',
        requestSource: '0'
      },
      tableSearchForm: {},
      statisticsInfo: {
        orderCount: '',
        payPriceTotal: '',
        refundTotal: ''
      },
      // 搜索
      searchFormData: [],
      // 快递信息
      isExpressVisible: false,
      editChildRef: 'editChildRef',
      expressForm: {
        deliveryCompany: '',
        deliveryNumber: ''
      },
      expressRules: {
        deliveryCompany: [{ required: true, message: '快递公司是必填项', trigger: 'change' }],
        deliveryNumber: [{ required: true, message: '快递单号是必填项', trigger: 'change' }]
      },
      expressFormData: [
        {
          label: '快递公司',
          name: 'deliveryCompany',
          type: 'input',
          maxlength: 20
        },
        {
          label: '快递单号',
          name: 'deliveryNumber',
          type: 'input',
          maxlength: 20
        }
      ],
      // 订单核销
      isWriteOffVisible: false,
      writeOffForm: {
        verificationCode: ''
      },
      writeOffRules: {
        verificationCode: [{ required: true, message: '核销码是必填项', trigger: 'change' }]
      },
      writeOffFormData: [
        {
          label: '核销码',
          name: 'verificationCode',
          type: 'input',
          maxlength: 32
        }
      ],
      // 退款审核
      isExamineVisible: false,
      orderInfo: {},
      examineForm: {
        isAllowed: '1',
        contactAddress: '',
        contactName: '',
        contactPhone: ''
      },
      examineRules: {
        contactAddress: [{ required: true, message: '退货地址是必填项', trigger: 'change' }],
        contactName: [{ required: true, message: '联系人是必填项', trigger: 'change' }],
        contactPhone: [
          { required: true, message: '手机号是必填项', trigger: 'change' },
          {
            validator: (rule, value, callback) => {
              let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
              return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
            },
            trigger: 'blur'
          }
        ]
      },
      examineFormData: [
        {
          label: '退货地址',
          name: 'contactAddress',
          type: 'input',
          maxlength: 50
        },
        {
          label: '联系人',
          name: 'contactName',
          type: 'input',
          maxlength: 10
        },
        {
          label: '手机号',
          name: 'contactPhone',
          type: 'input',
          maxlength: 11
        }
      ],
      // 确认收获
      isReceivingVisible: false,
      // 表格按钮
      tableButtonList: [
        {
          type: 'GLButton',
          name: '查看订单',
          attrs: {
            type: 'text',
            fn: '查看订单'
          },
          listeners: {
            click: this.handleDetail
          }
        },
        {
          type: 'GLButton',
          name: '退款',
          attrs: {
            type: 'text',
            fn: '退款'
          },
          condition: row => {
            // return row.orderSource == 4 && [2, 6, 21, 22].includes(+row.orderStatus) && row.isOffline != 0
            return row.showRefund == 1 && (row.orderSource !== 6 && row.orderSource !== 7)//是否展示退款按钮 1:是 0:否
          },
          listeners: {
            click: row => {
              if (row.paymentModel == 3) {
                this.refundVisible = true
                this.refundParams = {
                  orderCode: row.orderCode,
                  afterSaleType: '2'
                }
              } else this.secondConfirm('退款', '请确定是否发起退款?', 'orderManage', 'crowdFundRefundApi', {
                orderCode: row.orderCode,
                afterSaleType: '1'
              }, () => {
              }, this.searchForm.requestSource != 0)
            }
          }
        },
        {
          type: 'GLButton',
          name: '订单核销',
          attrs: {
            type: 'text',
            fn: '订单核销'
          },
          condition: row => {
            // return row.deliveryType == 1 && row.orderStatus == 21
            return row.showVerf == 1 && (row.orderSource !== 6 && row.orderSource !== 7) //是否展示核销按钮 1:是 0:否
          },
          listeners: {
            click: this.handleWriteOff
          }
        },
        {
          type: 'GLButton',
          // name: '输入快递信息',
          name: '商品发货',
          attrs: {
            type: 'text',
            fn: '商品发货'
          },
          condition: row => {
            return row.deliveryType == 2 && row.orderStatus == 6 && (row.orderSource !== 6 && row.orderSource !== 7)
          },
          listeners: {
            click: this.handleExpressInfo
          }
        },
        {
          type: 'GLButton',
          name: '退款审核',
          attrs: {
            type: 'text',
            fn: '退款审核'
          },
          condition: row => {
            return row.afterSaleStatus == 1 && (row.orderSource !== 6 && row.orderSource !== 7)
          },
          listeners: {
            click: this.handleExamine
          }
        },
        {
          type: 'el-button',
          name: '确认收货',
          attrs: {
            type: 'text'
          },
          condition: row => {
            return row.afterSaleStatus == 4 && (row.orderSource !== 6 && row.orderSource !== 7)
          },
          listeners: {
            click: this.handleReceiving
          }
        },
        {
          type: 'el-button',
          name: '设为已完结',
          attrs: {
            type: 'text'
          },
          condition: row => {
            return row.marketingStatus && row.marketingStatus == 3 && (row.orderSource !== 6 && row.orderSource !== 7)
          },
          listeners: {
            click: row => {
              this.secondConfirm('设为已完结', '请确定将此订单营销状态设为已完结?', 'orderManage', 'finishOrderStatus', { subOrderCode: row.orderCode }, false)
            }
          }
        }
      ],
      // 表格
      getListApi: this.$apis.orderManage.getListApi,
      tableParams: {
        listName: 'list',
        tableOption: true,
        tableColumns: []
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
      // 基本数据
      baseData: {
        searchOrderStatusList: orderManageStatusList.filter(item => ['1', '3', '21', '22', '6', '9'].includes(item.confId)),
        searchAfterSaleStatusList: afterSaleStatusList.filter(item => ['1', '6', '7'].includes(item.confId)),
        orderStatusList: orderManageStatusList,
        afterSaleStatusList: afterSaleStatusList,
        orderSourceList: orderSourceList,
        deliveryTypeList: deliveryTypeList,
        refundTypeList: [
          { confId: '1', confName: '退款退货' },
          { confId: '2', confName: '我要退款(无需退货)' },
          { confId: '3', confName: '众筹订单退款' }
        ],
        shareStaffSourceList: [
          { confId: '1', confName: '个微' },
          { confId: '2', confName: '企微' },
          { confId: '3', confName: '员工' }
        ],
        testSheetTypeList: [
          { confId: '0', confName: '否' },
          { confId: '1', confName: '是' }
        ],
        isOffSheetTypeList: [
          { confId: '0', confName: '是' },
          { confId: '1', confName: '否' }
        ],
        businessTypeList: utils.deepClone(businessType),
        marketingStatusList: [
          { confId: '1', confName: '已完结' },
          { confId: '3', confName: '未完结' },
          { confId: '4', confName: '已取消' }
        ]
      },
      showTable: false,
      configShow: false
    }
  },
  created() {
    // this.checkMerchant()
    if (window.__POWERED_BY_QIANKUN__) {
      this.merchantId = this.$globalState.session.merchantId
      this.merchantModel = this.$globalState.session.merchantModel
      this.accountLevel = this.$globalState.session.accountLevel
      if (this.merchantModel == 2 && this.accountLevel == 4) {
        this.initParams()
      }
    }
     // 判断是否是海马刀
     this.isHmd = this.merchantId == this.$hmdMerchantId
    let href = window.location.host
    this.showGh = href.indexOf('cgacar') !== -1
  },
  mounted() {
    this.getCrowdfundingOrderConfig()
    // this.getCount()
  },
  methods: {
    async getCrowdfundingOrderConfig() {
      const { channelType } = this.$globalState.session
      let tableColumns = [
        {
          label: '客户名称',
          prop: 'customerName',
          width: 160,
          formatter: cellValue => {
            return cellValue.customerName || '-'
          }
        },
        {
          label: '手机号',
          prop: 'customerPhone',
          width: 160,
          formatter: cellValue => {
            return cellValue.customerPhone || '-'
          }
        },
        {
          label: '其他',
          prop: 'otherInformation',
          width: 210
        },
        {
          label: '微信名称',
          prop: 'weChatName',
          addHtml: 'weChatName',
          width: 210
        },
        {
          label: '推荐人',
          prop: 'shareStaffName',
          width: 210,
          addHtml: 'shareStaffName'
        },
        {
          label: '推荐人ID',
          name: 'shareStaffId',
          prop: 'shareStaffId',
          width: 210
        },
        {
          label: '指派人',
          prop: 'assignName',
          width: 210,
          addHtml: 'assignName'
        },
        {
          label: '推荐人手机号',
          prop: 'shareStaffPhone',
          width: 160,
          formatter: cellValue => {
            return cellValue.shareStaffPhone || '-'
          }
        },
        {
          label: '订单时间',
          prop: 'createdDate',
          width: '180',
          formatter: cellValue => {
            return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
          }
        },
        {
          label: '支付时间',
          prop: 'payDate',
          width: '180',
          formatter: cellValue => {
            return cellValue.payDate ? dayjs(cellValue.payDate).format('YYYY-MM-DD HH:mm:ss') : '-'
          }
        },
        {
          label: '核销时间',
          prop: 'verificationDate',
          width: '180',
          formatter: cellValue => {
            return cellValue.verificationDate ? dayjs(cellValue.verificationDate).format('YYYY-MM-DD HH:mm:ss') : '-'
          }
        },
        {
          label: '车架号',
          prop: 'vinNo',
          width: 130,
          addHtml: 'vinNo'
        },
        {
          label: '订单状态',
          prop: 'orderStatus',
          addHtml: 'orderStatus',
          width: 160
        },
        {
          label: '业务场景',
          prop: 'businessType',
          width: 120,
          formatter: cellValue => {
            let type = cellValue.businessType
            if (type) {
              return businessType.find(item => item.optionId == type).optionLabel
            } else {
              return '-'
            }
          }
        },
        {
          label: '商品名称',
          prop: '',
          width: '120',
          formatter: cellValue => {
            return cellValue.orderGoods&&cellValue.orderGoods.length ? cellValue.orderGoods.map(item => item.goodsName).join(',') : '-'
          }
        },
        {
          label: '',
          addHtml: 'giveEquityCard',
          width: 80
        },
        {
          label: channelType == 2 ? '付款金额/元' : '支付定金/元',
          prop: 'payPrice',
          width: '120',
          formatter: cellValue => {
            return cellValue.payPrice || '0'
          }
        },
        {
          label: '活动名称',
          prop: 'activityName',
          width: '120'
        },
        {
          label: '门店信息',
          prop: 'merchantName',
          line: 1,
          width: 280
        },
        {
          label: '赠送积分',
          prop: 'giveIntegral',
          line: 1,
          width: 150
        },
        {
          label: '订单类型',
          prop: 'orderSource',
          width: '100',
          formatter: cellValue => {
            return this.baseData.orderSourceList.map(item => item.confId).includes(cellValue.orderSource + '') ? this.baseData.orderSourceList.find(item => item.confId == cellValue.orderSource).confName : '-'
          }
        },
        {
          label: '测试单',
          prop: 'orderType',
          width: '100',
          // addHtml: 'orderType'
          formatter: cellValue => {
            return cellValue.orderType == 1 ? '是' : '否'
          }
        },
        {
          label: '退款类型',
          prop: 'afterSaleType',
          width: 100,
          formatter: cellValue => {
            return { 1: '退订单', 2: '退定金' }[cellValue.afterSaleType] || '-'
          }
        },
        {
          label: '营销状态',
          name: 'marketingStatus',
          width: 180,
          addHtml: 'marketingStatus'
        },
        {
          label: '售后状态',
          prop: 'afterSaleStatus',
          width: '100',
          formatter: cellValue => {
            return this.baseData.afterSaleStatusList.map(item => item.confId).includes(cellValue.afterSaleStatus + '') ? this.baseData.afterSaleStatusList.find(item => item.confId == cellValue.afterSaleStatus).confName : '-'
          }
        },
        {
          label: '结算方式',
          prop: 'deliveryType',
          width: '100',
          formatter: cellValue => {
            return this.baseData.deliveryTypeList.map(item => item.confId).includes(cellValue.deliveryType + '') ? this.baseData.deliveryTypeList.find(item => item.confId == cellValue.deliveryType).confName : '-'
          }
        },
        {
          label: '订单编号',
          prop: 'orderCode',
          width: '180'
        },
        {
          label: '商户订单号',
          prop: 'outTradeNo',
          width: '160',
          formatter: cellValue => {
            return cellValue.outTradeNo || '-'
          }
        }
      ],
        searchFormData = [
          {
            label: '订单编号',
            name: 'orderCode',
            type: 'input'
          },
          {
            label: '订单状态',
            name: 'orderStatuses',
            type: 'select',
            multiple: true,
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'searchOrderStatusList',
            changeAttr: (value, targetItem) => {
              var isAdd = value.length > this.oldVal.orderStatuses.length
              var targetVal = value[value.length - 1]
              var formIdx = this.searchFormData.findIndex(item => item.label == '订单状态')
              if (!isAdd) {
                for (var i = 0; i < this.oldVal.orderStatuses.length; i++) {
                  if (!value.includes(this.oldVal.orderStatuses[i])) {
                    targetVal = this.oldVal.orderStatuses[i]
                    break
                  }
                }
              }
              !targetVal && (this.searchForm.orderStatuses = isAdd ? this.searchFormData[formIdx].optionList.map(item => item.confId) : [])
              if (targetVal) {
                var idx = value.findIndex(item => item == '')
                if (idx != -1 && this.searchForm.orderStatuses.length < this.searchFormData[formIdx].optionList.length) {
                  this.searchForm.orderStatuses.splice(idx, 1)
                } else if (idx == -1 && this.searchForm.orderStatuses.length == this.searchFormData[formIdx].optionList.length - 1) {
                  this.searchForm.orderStatuses.push('')
                }
              }
              this.oldVal.orderStatuses = this.$common.utils.deepClone(this.searchForm.orderStatuses)
            }
          },
          {
            label: '售后状态',
            name: 'afterSaleStatuses',
            type: 'select',
            labelWidth: 72,
            multiple: true,
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'searchAfterSaleStatusList',
            changeAttr: (value, targetItem) => {
              var isAdd = value.length > this.oldVal.afterSaleStatuses.length
              var targetVal = value[value.length - 1]
              var formIdx = this.searchFormData.findIndex(item => item.label == '售后状态')
              if (!isAdd) {
                for (var i = 0; i < this.oldVal.afterSaleStatuses.length; i++) {
                  if (!value.includes(this.oldVal.afterSaleStatuses[i])) {
                    targetVal = this.oldVal.afterSaleStatuses[i]
                    break
                  }
                }
              }
              !targetVal && (this.searchForm.afterSaleStatuses = isAdd ? this.searchFormData[formIdx].optionList.map(item => item.confId) : [])
              if (targetVal) {
                var idx = value.findIndex(item => item == '')
                if (idx != -1 && this.searchForm.afterSaleStatuses.length < this.searchFormData[formIdx].optionList.length) {
                  this.searchForm.afterSaleStatuses.splice(idx, 1)
                } else if (idx == -1 && this.searchForm.afterSaleStatuses.length == this.searchFormData[formIdx].optionList.length - 1) {
                  this.searchForm.afterSaleStatuses.push('')
                }
              }
              this.oldVal.afterSaleStatuses = this.$common.utils.deepClone(this.searchForm.afterSaleStatuses)
            }
          },
          {
            label: '门店',
            name: 'merchantName',
            type: 'input',
            labelWidth: 56
          },
          {
            label: '客户姓名',
            name: 'customerName',
            type: 'input'
          },
          {
            label: '订单日期',
            name: 'createDate',
            type: 'datePicker',
            labelWidth: 72,
            isClear: true,
            pickerOptions: 'beforeRangePickerOptions'
          },
          {
            label: '订单类型',
            name: 'orderSource',
            type: 'select',
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'orderSourceList'
          },
          {
            label: '结算方式',
            name: 'deliveryType',
            type: 'select',
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'deliveryTypeList'
          },
          {
            label: '商户订单号',
            name: 'outTradeNo',
            type: 'input',
            maxlength: 50
          },
          {
            label: '车架号',
            name: 'vin',
            labelWidth: 56,
            type: 'input',
            maxlength: 50
          },
          {
            label: '推荐人',
            name: 'shareStaffName',
            labelWidth: 56,
            type: 'input',
            maxlength: 100
          },
          {
            label: '推荐人类型',
            name: 'shareStaffSource',
            type: 'select',
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'shareStaffSourceList'
          },
          {
            label: '活动名称',
            name: 'activityName',
            labelWidth: 56,
            type: 'input',
            maxlength: 100
          },
          {
            label: '商品名称',
            name: 'goodsName',
            labelWidth: 56,
            type: 'input',
            maxlength: 100
          },
          {
            label: '手机号',
            name: 'customerPhone',
            labelWidth: 56,
            type: 'input',
            maxlength: 11
          },
          {
            label: '推荐人手机号',
            name: 'shareStaffPhone',
            labelWidth: 56,
            type: 'input',
            maxlength: 11
          },
          {
            label: '测试单',
            name: 'orderType',
            type: 'select',
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'testSheetTypeList'
          },
          {
            label: '退款类型',
            name: 'afterSaleType',
            type: 'select',
            optionList: [
              {
                confId: null,
                confName: '全部'
              },
              {
                confId: '2',
                confName: '退定金'
              },
              {
                confId: '1',
                confName: '退订单'
              }
            ],
            optionId: 'confId',
            optionLabel: 'confName'
          },
          {
            label: '业务场景',
            name: 'businessType',
            type: 'select',
            optionList: [],
            optionId: 'optionId',
            optionLabel: 'optionLabel',
            optionsName: 'businessTypeList'
          },
          {
            label: '营销状态',
            name: 'marketingStatus',
            type: 'select',
            optionList: [],
            optionId: 'confId',
            optionLabel: 'confName',
            optionsName: 'marketingStatusList'
          }
        ]
      try {
        const res = await this.$apis.common.getCrowdfundingOrderConfig(),
          filterTableList = ['shareStaffName', 'otherInformation', 'assignName', 'shareStaffPhone', 'verificationDate', 'vinNo', 'afterSaleStatus'],
          filterFormList = ['afterSaleStatuses', 'shareStaffName', 'vin', 'shareStaffSource', 'shareStaffPhone']
          if(!this.isHmd){
            filterTableList.push('customerPhone')
            filterFormList.push('customerPhone')
          }
        this.configShow = res != 1||this.isHmd
        if (res == 1||this.isHmd) {
          for (let i = 0; i < tableColumns.length; i++) {
            if (filterTableList.includes(tableColumns[i].prop)) {
              tableColumns.splice(i, 1)
              i--
            }
          }
          for (let i = 0; i < searchFormData.length; i++) {
            if (filterFormList.includes(searchFormData[i].name)) {
              searchFormData.splice(i, 1)
              i--
            }
          }
        }
      } catch (error) {
        console.log(error)
      }
      this.tableParams.tableColumns = tableColumns
      this.searchFormData = searchFormData
      this.showTable = true
      this.getOptionsList('searchFormData')
    },
    initParams() {
      const cell = {
        label: '线下订单',
        prop: 'isOffline',
        width: 120,
        formatter: cellValue => {
          return cellValue.isOffline == 1 ? '否' : cellValue.isOffline == 0 ? '是' : '-'
        }
      }
      const searchCell = {
        label: '线下订单',
        name: 'isOffline',
        type: 'select',
        optionList: [],
        optionId: 'confId',
        optionLabel: 'confName',
        optionsName: 'isOffSheetTypeList'
      }
      this.tableParams.tableColumns.splice(12, 0, cell)
      this.searchFormData.splice(17, 0, searchCell)
    },
    getParams() {
      var params = JSON.parse(JSON.stringify(this.searchForm))
      if (this.searchForm.createDate.length) {
        params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
        params.createdEndDateStr = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
      }
      if(this.searchForm.orderSource ==''){
        params.orderSource =0
      }
      if (params.orderStatuses.includes('3') && params.requestSource == '0') delete params.requestSource
      delete params.createDate
      return params
    },
    beforeSearchFn() {
      return new Promise(resolve => {
        this.tableSearchForm = this.getParams()
        delete this.tableSearchForm.createDate
        resolve()
      })
    },
    getOptionsList(formName, hasAll = true, refreshSigle) {
      if (refreshSigle) {
        var item = this[formName].find(k => k.name == refreshSigle)
        var index = this[formName].findIndex(k => k.name == refreshSigle)
        this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
        if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
          const temp = {}
          temp[this[formName][index].optionId] = ''
          temp[this[formName][index].optionLabel] = '全部'
          this[formName][index].optionList.unshift(temp)
        }
      } else {
        this[formName].forEach((item, index) => {
          if (item.type === 'select' && this.baseData[item.optionsName] && this.baseData[item.optionsName].length) {
            this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
            if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
              const temp = {}
              temp[this[formName][index].optionId] = ''
              temp[this[formName][index].optionLabel] = '全部'
              this[formName][index].optionList.unshift(temp)
            }
          }
        })
      }
    },
    showOrHideAttr(formName, label, isHide) {
      let idx = this[formName].findIndex(item => item.label == label)
      this[formName][idx].isHide = isHide
    },
    deleteAttr(labelList) {
      labelList.forEach(i => {
        console.log(i)
        let idx = this.tableParams.tableColumns.findIndex(item => item.label == i)
        this.tableParams.tableColumns.splice(idx, 1)
      })
    },
    async refundFun() {
      let { refundParams } = this
      const res = this.$apis.orderManage.crowdFundRefundApi(refundParams)
      this.refundVisible = false
      this.searchForm.requestSource != 0 ? this.handleSearch() : this.$refs.allOrderRef.refreshTable(false)
    },
    // checkMerchant () {
    //   this.$apis.orderManage.checkMerchartApi({}).then(res => {
    //     this.isSpecialMerchat = res
    //     var hideList = ['售后状态', '订单类型', '结算方式', '商户订单号', '车架号', '推荐人', '推荐人类型', '手机号', '推荐人手机号']
    //     if (this.isSpecialMerchat) {
    //       hideList.forEach(item => {
    //         this.showOrHideAttr('searchFormData', item, true)
    //       })
    //       this.deleteAttr(['手机号', '其他', '微信名称', '推荐人', '推荐人手机号', '车架号', '商户订单号'])
    //     }
    //   })
    // },
    secondConfirm(title, txt, apiModule, apiName, apiParams, fn, isResetPage = true) {
      this.$confirm(txt, title, {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        callback: action => {
          if (action == 'confirm') {
            this.$apis[apiModule][apiName](apiParams).then(res => {
              this.$message({
                message: res.code == '0' ? '操作成功' : res.message,
                type: res.code == '0' ? 'success' : 'error'
              })
              if (res.code == '0') {
                fn && fn()
                isResetPage ? this.handleSearch() : this.$refs.allOrderRef.refreshTable(false)
              }
            })
          }
        }
      })
    },
    getCount() {
      var params = this.getParams()
      delete params.createDate
      // if(params.orderStatuses.includes('3')) return
      this.$apis.orderManage.getCountApi(params).then(res => {
        this.statisticsInfo = res || { orderCount: '', payPriceTotal: '', refundTotal: '' }
      })
    },
    handleDetail(row) {
      this.$router.push({
        path: '/orderManage/orderDetail',
        query: {
          orderCode: row.orderCode
        }
      })
    },
    // 输入快递信息 - start
    handleExpressClose() {
      this.isExpressVisible = !this.isExpressVisible
      this.orderCode = ''
      this.expressForm = {
        deliveryCompany: '',
        deliveryNumber: ''
      }
    },
    handleExpressConfirm() {
      this.$refs.expressRef.$refs[this.editChildRef].validate(valid => {
        if (valid) {
          var params = this.$common.utils.deepClone(this.expressForm)
          params.orderCode = this.orderCode
          this.$apis.orderManage.addDeliveryApi(params).then(res => {
            this.$message({
              message: res.code == '0' ? '操作成功' : '操作失败',
              type: res.code == '0' ? 'success' : 'error',
              customClass: 'message-Z-zinde'
            })
            if (res.code == '0') {
              this.handleExpressClose()
              this.handleSearch()
            }
          })
        }
      })
    },
    handleExpressInfo(row) {
      this.isExpressVisible = !this.isExpressVisible
      this.orderCode = row.orderCode
    },
    // 输入快递信息 - end
    // 订单核销 - start
    handleWriteOffClose() {
      this.isWriteOffVisible = !this.isWriteOffVisible
      this.orderCode = ''
      this.writeOffForm = {
        verificationCode: ''
      }
    },
    handleWriteOffConfirm() {
      this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => {
        if (valid) {
          var params = this.$common.utils.deepClone(this.writeOffForm)
          params.orderCode = this.orderCode
          this.$apis.orderManage.writeOffApi(params).then(res => {
            this.$message({
              message: res.code == '0' ? '操作成功' : '操作失败',
              type: res.code == '0' ? 'success' : 'error',
              customClass: 'message-Z-zinde'
            })
            if (res.code == '0') {
              this.handleWriteOffClose()
              this.searchForm.requestSource == 0 ? this.$refs.allOrderRef.refreshTable(false) : this.handleSearch()
            }
          })
        }
      })
    },
    handleWriteOff(row) {
      if (row.orderSource == 4) {
        this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode }, () => {
        }, this.searchForm.requestSource != 0)
        return true
      }
      this.isWriteOffVisible = !this.isWriteOffVisible
      this.orderCode = row.orderCode
    },
    // 订单核销 - end
    // 退款审核 - start
    handleExamineClose() {
      this.isExamineVisible = !this.isExamineVisible
      this.orderCode = ''
      this.orderInfo = {}
      this.examineForm = {
        isAllowed: '1',
        contactAddress: '',
        contactName: '',
        contactPhone: ''
      }
    },
    submitExamine(params) {
      this.$apis.orderManage.examineAllowApi(params).then(res => {
        this.$message({
          message: res.code == '0' ? '操作成功' : res.message,
          type: res.code == '0' ? 'success' : 'error',
          customClass: 'message-Z-zinde'
        })
        if (res.code == '0') {
          this.handleExamineClose()
          this.searchForm.requestSource == 0 ? this.$refs.allOrderRef.refreshTable(false) : this.handleSearch()
        }
      })
    },
    handleExamineConfirm() {
      var params = {
        id: this.orderInfo.id
      }
      if (this.orderInfo.refundType == 1 && this.examineForm.isAllowed == '1') {
        this.$refs.examineRef.$refs[this.editChildRef].validate(valid => {
          if (valid) {
            params = this.$common.utils.deepClone(this.examineForm)
            params.id = this.orderInfo.id
            params.isAllowed = true
            this.submitExamine(params)
          }
        })
      } else {
        params.isAllowed = this.examineForm.isAllowed == '1'
        this.submitExamine(params)
      }
    },
    handleExamine(row) {
      this.orderCode = row.orderCode
      this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
        this.orderInfo = res || {}
        this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-'
        this.orderInfo.createdDateStr = this.orderInfo.createdDate ? dayjs(this.orderInfo.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
        this.isExamineVisible = !this.isExamineVisible
      })
    },
    // 退款审核 - end
    // 确认收货 - start
    handleReceivingClose() {
      this.isReceivingVisible = !this.isReceivingVisible
      this.orderCode = ''
      this.orderInfo = {}
    },
    handleReceivingConfirm() {
      var params = {
        id: this.orderInfo.id
      }
      this.$apis.orderManage.confirmReceiptGoodsApi(params).then(res => {
        this.$message({
          message: res.code == '0' ? '操作成功' : '操作失败',
          type: res.code == '0' ? 'success' : 'error',
          customClass: 'message-Z-zinde'
        })
        if (res.code == '0') {
          this.handleReceivingClose()
          this.handleSearch()
        }
      })
    },
    handleReceiving(row) {
      this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
        this.orderInfo = res || {}
        this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-'
        this.orderInfo.createdDateStr = this.orderInfo.createdDate ? dayjs(this.orderInfo.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
        this.isReceivingVisible = !this.isReceivingVisible
      })
    },
    // 确认收货 - end
    setTableFinishFun() {
      this.$refs.allOrderRef.data.forEach(item => {
        item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-'
      })
      //接收到的数据为空
      this.$refs.allOrderRef.data.length ? (this.$refs.allOrderRef.tableHeightValues = '') : this.$refs.allOrderRef.setTableHeightFun()
      this.getCount()
    },
    handleSearch() {
      this.$refs.allOrderRef.refreshTable()
    },
    handleTabClick() {
      // if (this.isSpecialMerchat) {
      //   return true
      // }
      this.handleSearch()
    },
    handleExport(row) {
      var params = this.getParams()
      this.$apis.orderManage.orderExportApi(params).then(res => {
        exportFn(res)
      })
    },
    handleReset() {
      this.searchForm = this.$options.data.call(this).searchForm
      this.handleSearch()
    }
  }
}
</script>
<style lang="scss">
.order-table-popover {
  min-width: 80px !important;
  padding: 8px 12px !important;
}

.refund-dialog {
  .refund-item {
    padding-top: 14px;
  }

  .refund-tips {
    font-size: 14px;
    margin: 8px 0 6px 0;
    color: #999999;
  }

  .refund-dialog-tips-close {
    margin-left: auto;
    cursor: pointer;
  }

  .tips-img {
    margin: 0 8px 0 0 !important;
  }
}

.order-manage {
  .container {
    padding: 20px 14px;
  }

  .table-tips {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
  }

  .car-no {
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #e8e8ea;
    padding: 2px 4px;
    line-height: 25px;
  }

  .txt-blue {
    color: #5850ff;
  }

  .list-tips {
    background: #e4e3ff;
    border-radius: 4px;
    border: none;
  }

  .order-manage-table {
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 0 4px 4px 4px;
  }

  .flex-default.tabs {
    border-bottom: 1px solid #e5e5e5;
    border-bottom: 0;

    .el-tabs__item {
      background: #fafafa;
      border: 1px solid #e5e5e5 !important;
      border-radius: 4px 4px 0 0;
      border-bottom: 0;
    }

    .is-active {
      border-bottom: 1px solid #fff !important;
      font-weight: 500;
    }
  }
}

.gold-sign {
  width: 48px;
  height: 20px;
  background: #fee9cc;
  border-radius: 2px;
  white-space: nowrap;
  font-size: 12px;
  color: #fdb757;
  text-align: center;
  line-height: 20px;
}</style>