<template>
  <div>
    <div class="app-container">
      <div class="filter-container">
        <el-form :inline="true" class="demo-form-inline">
          <el-form-item label="收货日期">
            <div class="block">
              <el-date-picker
                v-model="pagerDto._Range_ReceiveTime"
                type="daterange"
                range-separator="~"
                value-format="yyyy-MM-dd"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </div>
          </el-form-item>
          <el-form-item label="客户名称">
            <el-select
              v-model="pagerDto._Eq_CustomerId"
              placeholder="所属客户"
              clearable
              filterable
            >
              <el-option
                v-for="item in Customers"
                :key="item.Id"
                :label="item.CompanyName"
                :value="item.Id"
              />
            </el-select>
          </el-form-item>

          <el-form-item label="单号">
            <MultipleNumber @getNumber="getNumber" />
          </el-form-item>
          <el-form-item label="渠道">
            <el-select
              v-model="pagerDto._Eq_CreateOrderChannelId"
              placeholder="下单渠道"
              clearable
              filterable
            >
              <el-option
                v-for="item in publicChannel"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="国家">
            <el-select
              v-model="pagerDto._Eq_ReceiverCountryCode"
              clearable
              filterable
              auto-complete="false"
              style="width: 290px"
              fillter
            >
              <el-option
                v-for="(item, index) in serachCountryList"
                :key="index"
                :label="item.CnName + ' ' + item.Code + ' ' + item.EnName"
                :value="item.Code"
              >
                <span style="float: left"
                  >{{ item.CnName }}
                  <span style="color: #8492a6; font-size: 10px">{{
                    item.EnName
                  }}</span>
                </span>
                <span style="float: right">{{ item.Code }}</span>
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="销售">
            <el-select
              v-model="pagerDto._Eq_SalesmanUserId"
              placeholder="所属销售"
              clearable
              filterable
            >
              <el-option
                v-for="item in Users"
                :key="item.Id"
                :label="item.NickName"
                :value="item.Id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="是否确认">
            <el-select
              v-model="pagerDto._Eq_IsConfim"
              placeholder="是否确认"
              clearable
              filterable
            >
              <el-option
                v-for="item in SimpleChoice"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="状态">
            <el-select
              v-model="pagerDto._Eq_Status"
              placeholder="状态"
              clearable
              filterable
            >
              <el-option
                v-for="item in StatusList"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id"
              />
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button
              icon="el-icon-search"
              size="small"
              type="primary"
              :loading="serachLadding"
              @click="search"
              >搜索</el-button
            >
          </el-form-item>
        </el-form>
        <div class="batch-warp">
          <el-button type="success" size="small" plain @click="hanleSurcharges"
            >批量修改附加费</el-button
          >
          <el-button
            type="primary"
            size="small"
            plain
            @click="hanleHeavyBilling"
            >批量修改计费重</el-button
          >
          <el-button
            type="primary"
            size="small"
            plain
            :loading="saveLadding"
            @click="hanleExportWaitConfirm"
            >导出待确认数据</el-button
          >
          <el-button
            type="success"
            size="small"
            plain
            :loading="saveLadding"
            @click="hanleToSettlement"
            >转入结算</el-button
          >
          <el-button
            type="warning"
            size="small"
            @click="hanleModifyOrderChannel"
            plain>
            修改FBA订单创建渠道
          </el-button>
        </div>
        <el-table
          :data="sData"
          border
          row-key="Id"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55" />
          <el-table-column label="收货日期" prop="ReceiveTimeStr" />
          <el-table-column label="客户名称" prop="CompanyName" />
          <el-table-column label="客户单号" prop="CustomerOrderNo" />
          <el-table-column label="行运易" prop="SystemNo" />
          <el-table-column label="渠道" prop="PublicName" />
          <el-table-column label="国家" prop="ReceiverCountryCode" />
          <el-table-column label="收件人邮编" prop="ReceiverZipCode" />
          <el-table-column label="转单号" prop="OrderNumber" />
          <el-table-column label="收货件数" prop="BoxQty" />
          <el-table-column label="收货实重" prop="OPInputWeight" />
          <el-table-column label="收货泡重" prop="OPVolumeWeight" />
          <el-table-column label="分泡系数" prop="SplitWeightRate" width="78" />
          <el-table-column label="收货计费重" prop="OpBillWeight" />
          <el-table-column
            label="确认计费重"
            prop="CustomerConfirmBillWeight"
          />
          <el-table-column label="单价" prop="CustomerConfirmUnitPrice" />
          <el-table-column
            label="附加费总计"
            prop="CustomerConfirmTotalSurcharges"
          />
          <el-table-column label="应收总额" prop="CustomerConfirmTotal" />
          <el-table-column label="业务员" prop="NickName" />
          <el-table-column
            label="关注标识"
            prop="Identification"
            min-width="78"
          >
            <template slot-scope="scope">
              <el-tag :type="scope.row.Identification ? 'success' : 'danger'">
                {{ scope.row.Identification ? "是" : "否" }}
              </el-tag>
              <div
                v-if="
                  scope.row.GoodsNamesArry != null &&
                  scope.row.GoodsNamesArry.length > 0
                "
              >
                <el-tag
                  type="danger"
                  v-for="item in scope.row.GoodsNamesArry"
                  :key="item"
                >
                  {{ item }}
                </el-tag>
              </div>
              <el-tag v-show="scope.row.SalesmanConfirmFee == true">
                销售确认
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column label="状态" prop="Status" width="56">
            <template slot-scope="scope">
              <el-tag type="success" size="mini">
                {{ scope.row.Status | getStatusText }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column label="操作" fixed="right" width="70">
            <template slot-scope="scope">
              <el-button
                type="text"
                size="mini"
                :loading="scope.row.detailLoading"
                @click="openDetails(scope.row)"
              >
                明细
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          :page-sizes="[20, 50, 100, 150, 200]"
          :current-page="pagerDto.PageIndex"
          :page-size="pagerDto.PageSize"
          background
          layout="prev, pager, next ,total ,jumper,sizes,slot "
          :total="pagerDto.total"
          @current-change="pagerSerach"
          @size-change="sizeChange"
        />
      </div>
    </div>
    <!-- 编辑 -->
    <DetailIconme
      title="详情"
      :dialog-visible.sync="showDetails"
      :order-id="OrderId"
      :items-data="itemsData"
      :customer-data="customerData"
      :surcharge-data="surchargeData"
      :total-receivable-data="totalReceivableData"
      surcharge-type="收入"
      @detailEdit="handleEdit"
      @detailClose="handleDetailClose"
      @confirmSell="hanleConfirmSell"
    />
    <!-- 查看 -->
    <ViewDetailIconme
      title="详情"
      :dialog-visible.sync="showViewDetails"
      :items-data="itemsData"
      :customer-data="customerData"
      :surcharge-data="surchargeData"
      :total-receivable-data="totalReceivableData"
      surcharge-type="收入"
      @detailClose="handleDetailClose"
    />
    <SurchargesList
      title="批量修改附加费"
      :dialog-visible.sync="surchargesVisible"
      :table-data="surchargesData"
      :table-column="SurchargesColumn"
      @close="hanleCloseSurcharges"
      @edit="hanleEditSurcharges"
    />
    <HeavyBillingList
      title="批量修改计费"
      :dialog-visible.sync="heavyBillingVisible"
      :table-data="heavyBillingData"
      :table-column="HeavyBillingColumn"
      @close="hanleCloseHeavyBilling"
      @edit="hanleEditHeavyBilling"
    />
    <el-dialog
      width="38%"
      title="修改FBA创建渠道"
      :visible.sync="dialogModifyCreateOrderChannelVisible"
    >
      <el-form>
        <el-form-item label="选择下单渠道">
           <el-select v-model="createOrderChannelId" filterable>
            <el-option
              v-for="item in FBACreateOrderChannels"
              :key="item.Id"
              :label="item.Name"
              :value="item.Id"
            />
          </el-select>
           </el-form-item>
        <div class="text-right">
          <el-button
            type="primary"
            :loading="saveChannelLoading"
            @click="saveModifyCreateOrderChannel"
            >保存修改</el-button
          >
        </div>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
import { getToken } from "@/utils/auth";
import {
  _getCustomerConfirmList,
  _getCustomerConfirm,
  _updateCustomerConfirm,
  _getUnitPrice,
  _goToSettlement,
  _getBatchConfirmWeight,
  _updateBatchConfirmWeight,
  _getBatchConfirmIncidenta,
  _updateBatchConfirmIncidenta,
  _getSalesmanConfirmFee,
  _saveModifyCreateOrderChannelId
} from "@/api/fba/Receiving";
import { addDays, DateFormat } from "@/api/timehelp";
import {
  _getCountries,
  _getAllPublic,
  _getDeliverChannel,
  _getCustomers,
  _getFBAChannel,
  _getAllUsers,
} from "@/api/baseInfo";
import DetailIconme from "./components/DetailIconme.vue";
import ViewDetailIconme from "./components/ViewDetailIconme.vue";
import SurchargesList from "./components/SurchargesList.vue";
import HeavyBillingList from "./components/HeavyBillingList.vue";
import { mapGetters } from "vuex";
import axios from "axios";
import MultipleNumber from './components/multipleNumber.vue'

export default {
  name: "Income",
  components: { DetailIconme, ViewDetailIconme, SurchargesList, HeavyBillingList, MultipleNumber },
  computed: {
    ...mapGetters(["roles"]),
  },
  filters: {
    // 状态文本
    getStatusText(val) {
      switch (val) {
        case 3:
          return '收入'
        case 5:
          return '结算'
        default:
          return ''
      }
    }
  },
  data() {
    return {
      sData: [],
      showFbaImportExcel: false,
      dialogImportFbaBoxInfo: false,
      ImportOrderBoxApi:
        process.env.VUE_APP_9518_API +
        "/GetMoreThanOneTicketMps/ImportMpsBoxInfo",
      header: { Authorization: "token " + getToken() },
      updateTHOrderLoading: false,

      showBtn: false,
      serachLadding: false,
      saveLadding: false,
      SimpleChoice: [
        { Id: 1, Name: "是" },
        { Id: 2, Name: "否" },
      ],
      StatusList: [
        { Id: 3, Name: "收入" },
        { Id: 5, Name: "结算" },
      ],
      Customers: [],
      publicChannel: [],
      serachCountryList: [],
      Users: [],
      pagerDto: {
        PageIndex: 1,
        PageSize: 20,
        total: 0,
        QuerySort: [{ Field: "Id", IsDesc: true }],
        _Range_ReceiveTime: [],
      },
      OrderId: 0,
      ids: [],
      // 详情
      showDetails: false, // 收入明细
      showViewDetails: false, // 只查看明细
      itemsData: {
        ReceiveTimeStr: "",
        CompanyName: "",
        CustomerOrderNo: "",
        SystemNo: "",
        PublicName: "",
        ReceiverCountryCode: "",
        BoxQty: 0,
      },
      storehouseData: [], // 仓库收货数据
      customerData: [], // 客户确认数据
      surchargeData: [], // 附加费
      totalReceivableData: [
        {
          SettlementConfirmInputWeight: 0.0,
          CustomerConfirmUnitPrice: 0.0,
          CustomerConfirmTotalSurcharges: 0.0,
          CustomerConfirmTotal: 0.0,
          CustomerConfirmBillWeight: 0.0,
          SplitWeightRate: 0.0,
          DeclarationMethod: undefined,
        },
      ], // 应收总额
      currentInput: {
        value: "",
        field: "",
      }, //
      multipleCustomer: [], // 客户确认数据选中数据
      surchargesVisible: false, // 附加费弹窗
      surchargesData: [], // 附加费列表数据
      heavyBillingVisible: false,
      heavyBillingData: [],
      HeavyBillingColumn: [
        { key: 1, type: "checkbox", field: "OrderId", width: 45 },
        { key: "OrderNo", field: "OrderNo", title: "订单号", width: 180 },
        {
          key: "Weight",
          field: "Weight",
          title: "最终计费重",
          editRender: { autofocus: ".vxe-input--inner" },
        },
        {
          key: "UnitPrice",
          field: "UnitPrice",
          title: "单价",
          editRender: { autofocus: ".vxe-input--inner" },
        },
      ], // 收入批量修改计费-key需唯一值
      SurchargesColumn: [
        { key: "OrderNo", field: "OrderNo", title: "订单号", width: 180 },
        {
          key: "FBAOtherFeeId",
          field: "FBAOtherFeeId",
          title: "附加费项",
          isSelect: true,
          editRender: {},
        },
        {
          key: "CustomerRemark",
          field: "CustomerRemark",
          title: "附加费标准",
          editRender: { autofocus: ".define-input .vxe-input--inner" },
        },
        {
          key: "Fee",
          field: "Fee",
          title: "整票附加费",
          editRender: { autofocus: ".define-input .vxe-input--inner" },
        },
        {
          key: "Remark",
          field: "Remark",
          title: "备注",
          editRender: { autofocus: ".define-input .vxe-input--inner" },
        },
        {
          key: "SysncJS",
          field: "SysncJS",
          title: "是否记入结算价",
          deCheckbox: true,
          width: 130,
        },
        { key: "4Actions", field: null, title: "操作", width: 80 },
      ], // 收入批量修改附加费-key需唯一值
      // 修改FBA创建渠道
      dialogModifyCreateOrderChannelVisible: false,
      createOrderChannelId: undefined,
      saveChannelLoading: false,
      FBACreateOrderChannels:[],
      selectionList: []
    };
  },
  created() {
    this.showFbaImportExcel = this.roles.includes("FBA末端重量修改");
    var end = addDays(new Date(), 0);
    var start = addDays(end, -1);
    this.pagerDto._Range_ReceiveTime = [
      DateFormat(start, "yyyy-MM-dd"),
      DateFormat(end, "yyyy-MM-dd"),
    ];

    _getCountries().then((r) => {
      this.countryList = r;
      this.serachCountryList = Object.assign(r);
    });
    _getAllPublic().then((r) => {
      this.publicChannel = r;
    });
    _getCustomers().then((r) => {
      this.Customers = r;
    });
    _getAllUsers().then((r) => {
      this.Users = r;
    });
    _getFBAChannel().then((res)=>{
      this.FBACreateOrderChannels = res;
    })
  },
  methods: {
    handleSelectionChange(val) {
      this.selectionList = val
      this.ids = [];
      for (var i = 0; i < val.length; i++) {
        this.ids.push(val[i].Id);
      }
    },
    getData() {
      this.serachLadding = true;
      _getCustomerConfirmList(this.pagerDto)
        .then((response) => {
          this.sData = response.Result;
          this.pagerDto.total = response.TotalCount;
          this.serachLadding = false;
        })
        .finally((response) => {
          this.serachLadding = false;
        });
    },
    search(pageIndex) {
      if (pageIndex && pageIndex > 0) {
        this.pagerDto.PageIndex = pageIndex;
      } else {
        this.pagerDto.PageIndex = 1;
      }
      this.getData();
    },
    pagerSerach(page) {
      // if (page === 1) return;
      this.pagerDto.PageIndex = page;
      this.getData();
    },
    sizeChange(pageSize) {
      this.pagerDto.PageIndex = 1;
      this.pagerDto.PageSize = pageSize;
      this.getData();
    },
    // 批量修改附加费
    hanleSurcharges() {
      if (this.ids.length === 0) {
        this.$message({ type: "warning", message: "请选择修改订单！" });
        return;
      }
      _getBatchConfirmIncidenta(this.ids).then((res) => {
        this.surchargesData = res;
        this.surchargesVisible = true;
      });

      // this.surchargesData = [
      //   {
      //     MpsOrderId: 2954,
      //     CustomerOrderNumber: "FBA1XJR1MHtest21",
      //     BoxNumber: "FBA1XJR1MHtest21U1",
      //     BoxServiceNumber: "A029277440001",
      //     BoxSerialNo: 0,
      //     Length: 20,
      //     Width: 10,
      //     Height: 9,
      //     BillWidth: 10,
      //     BillHeight: 88,
      //     BillLenght: 20,
      //     BillWeight: 50,
      //     Id: 11092,
      //   },
      // ];
    },
    // 批量修改计费重
    hanleHeavyBilling() {
      if (this.ids.length === 0) {
        this.$message({ type: "warning", message: "请选择修改订单！" });
        return;
      }
      _getBatchConfirmWeight(this.ids).then((res) => {
        this.heavyBillingData = res;
        this.heavyBillingVisible = true;
      });
    },
    //导出客户确认数据
    hanleExportWaitConfirm() {
      if (this.ids.length === 0) {
        this.$message({ type: "warning", message: "请选择订单！" });
        return;
      }
      const that = this;
      that.saveLadding = true;
      axios({
        method: "post",
        url: "http://120.24.149.148:9518/api/FBAOrder/ExportWaitConfirm",
        data: this.ids,
        responseType: "blob",
        headers: {
          "Content-Type": "application/json",
          Authorization: "token 132A7468DE079C6CEB59F383A661E612",
        },
      })
        .then((res) => {
          that.saveLadding = false;
          const _res = res.data;
          const blob = new Blob([res.data], { type: res.data.type });

          var url = window.URL.createObjectURL(blob);
          var a = document.createElement("a");
          a.href = url;
          a.download = `boxNumbers.xlsx`;
          a.click();
        })
        .catch((err) => {
          this.$message({ type: "error", message: "下载excel出错" + err });
        })
        .finally(() => {
          this.saveLadding = false;
        });

      return;
    },
    hanleCloseSurcharges() {
      this.surchargesVisible = false;
    }, // 附加费弹窗取消
    hanleCloseHeavyBilling() {
      this.heavyBillingVisible = false;
    },
    // 附加费修改
    hanleEditSurcharges(data) {
      _updateBatchConfirmIncidenta(data).then(() => {
        this.$message({ type: "success", message: "保存成功！" });
        this.hanleCloseSurcharges();
      });
    },
    hanleEditHeavyBilling(data) {
      _updateBatchConfirmWeight(data).then(() => {
        this.$message({ type: "success", message: "保存成功！" });
        this.hanleCloseHeavyBilling();
      });
    },
    // 打开明细
    openDetails(data) {
      this.OrderId = 0;
      this.$set(data, 'detailLoading', true)
      if (
        !data.CustomerConfirmUnitPrice ||
        data.CustomerConfirmUnitPrice == 0
      ) {
        const paramsData = {
          OrderId: data.Id,
          PublicExpressId: data.CreateOrderChannelId,
          CustomerId: data.CustomerId,
          TransactionTime: data.ReceiveTime,
          gWeight: data.CustomerConfirmBillWeight,
          ZipCode: data.ReceiverZipCode
        }
        _getUnitPrice(paramsData)
          .then((res) => {
            const price = typeof res === 'number' && isFinite(res) ? res : 0
            if(Number(price) >= 0) data.CustomerConfirmUnitPrice = price;
          })
          .finally(() => {
            this.GetCustomerConfirm(data);
          });
      } else {
        this.GetCustomerConfirm(data);
      }
    },
    GetCustomerConfirm(data) {
      _getCustomerConfirm(data.Id)
        .then((res) => {
          this.customerData = res.mpsOrderBoxes;
          this.surchargeData = res.incidentals;
        })
        .finally(() => {
          this.itemsData = data;
          this.OrderId = data.Id;
          this.totalReceivableData = [];
          this.totalReceivableData.push({
            SettlementConfirmInputWeight: data.SettlementConfirmInputWeight,
            CustomerConfirmUnitPrice: data.CustomerConfirmUnitPrice,
            CustomerConfirmTotalSurcharges: data.CustomerConfirmTotalSurcharges,
            CustomerConfirmTotal: data.CustomerConfirmTotal,
            CustomerConfirmBillWeight: data.CustomerConfirmBillWeight,
            ApprovalNumber: data.ApprovalNumber,
            SplitWeightRate: data.SplitWeightRate,
            DeclarationMethod: data.DeclarationMethod,
          });
          // Status=5 只查看
          data.Status === 5 ? this.showViewDetails = true : this.showDetails = true;
          this.$set(data, 'detailLoading', false)
          if(!data.detailLoading) delete data.detailLoading
        });
    },
    // 取消明细弹窗
    handleDetailClose() {
      this.showDetails = false;
      this.showViewDetails = false
      this.customerData = []
    },
    // 确定保存明细
    handleEdit(params, cancelLoading) {
      var data = {
        OrderId: params.OrderId,
        mpsOrderBoxes: params.customerData,
        incidentals: params.surchargeData,
        customerConfirmOrderDtos: params.totalReceivableData,
      };
      _updateCustomerConfirm(data)
        .then(() => {
          this.$message({ type: "success", message: "保存成功！" });
          this.showDetails = false;
          this.getData();
        })
        .finally(() => {
          cancelLoading();
        });
    },
    // 销售确认
    hanleConfirmSell(Id, cancelLoading) {
      _getSalesmanConfirmFee(Id).then(() => {
        this.$message({ type: "success", message: "操作成功！" });
          this.showDetails = false;
          this.search()
      }).finally(() => {
        cancelLoading();
      });
    },
    // 下单号计算失败提示
    getOrderBillingPrompt(list) {
      const content = `
        <table style="width: 100%; border-collapse: collapse;">
          <thead>
            <tr>
              <th style="border: 1px solid #ddd; padding: 8px; max-width: 224px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">单号</th>
              <th style="border: 1px solid #ddd; padding: 8px; max-width: 304px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">错误信息</th>
            </tr>
          </thead>
          <tbody>
            ${list.map(item => `
              <tr>
                <td style="border: 1px solid #ddd; padding: 8px; max-width: 264px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="${item.SystemNo}">${item.SystemNo}</td>
                <td style="border: 1px solid #ddd; padding: 8px; max-width: 304px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="${item.ResultMessage}">${item.ResultMessage}</td>
              </tr>
            `).join('')}
          </tbody>
        </table>
      `;
      this.$alert(content, '部分数据计算成功，以下单号计算失败！', {
        customClass: 'info-systemNo',
        showClose: false,
        dangerouslyUseHTMLString: true,
        confirmButtonText: '确定'
      }).then(() => {
        this.search()
      })
    },
    // 转入结算
    hanleToSettlement() {
      if (this.ids.length === 0) {
        this.$message({ type: "warning", message: "请选择订单！" });
        return;
      }
      this.$confirm(
        "请确认订单有末端单号后再操作，确认后无法退回",
        "确认操作"
      ).then((r) => {
        this.saveLadding = true;
        _goToSettlement(this.ids)
          .then((res) => {
            // this.$message({ type: "success", message: "已转入结算！" });
            // this.search();
            if (res && res.length > 0) {
              const allIsSucceed = res.every(item => item.isSucceed)
              if (allIsSucceed) {
                this.$message({ type: 'success', message: '已全部计算成功！' })
                this.search()
                return
              }
              const filterList = res.filter(item => !item.isSucceed)
              this.getOrderBillingPrompt(filterList)
              return
            }
            this.$message({ type: 'success', message: '已全部计算成功！' })
            this.search()
          })
          .finally(() => {
            this.saveLadding = false;
          });
      });
    },
    // 修改FBA订单创建渠道
    hanleModifyOrderChannel() {
      const ids = this.ids;
      if (ids.length === 0) {
        this.$alert("请勾选需要操作的明细", "错误", { type: "warning" });
        return;
      }
      if (ids.length > 1) {
        this.$alert("此操作不可批量处理！请逐单操作", "错误提示", {
          type: "warning",
        });
        return;
      }
      const currentSelectId = this.selectionList[0]
      if(currentSelectId.Status === 5) {
        this.$alert("此（结算）状态操作不可处理！", "错误提示", {
          type: "warning",
        });
        return;
      }
      this.createorderIds = ids.join(",");
      this.dialogModifyCreateOrderChannelVisible = true;
    },
    //fba修改创建渠道 start
    saveModifyCreateOrderChannel() {
      const that = this
      if (that.createOrderChannelId > 0) {
        that.saveChannelLoading = true;
        const data = {
          OrderId: that.createorderIds,
          CreateOrderChannelId: that.createOrderChannelId,
        };
        _saveModifyCreateOrderChannelId(data)
          .then((res) => {
            this.$message({ type: "success", message: "修改成功" });
            that.dialogModifyCreateOrderChannelVisible = false;
            that.search();
          })
          .finally(() => {
            this.saveChannelLoading = false;
          });
      } else {
        this.$message({ type: "warning", message: "请选择创建渠道" });
      }
    },
    //fba修改创建渠道 end
    inputTHOrderSuccess(response, file, fileList) {
      this.$message("上传成功");
      this.updateTHOrderLoading = false;
    },
    inputThOrderError(response) {
      var msg = JSON.parse(response.message);
      this.$confirm(msg.message, "错误提示");
      // this.$message(msg.message);
      this.updateTHOrderLoading = false;
    },
    ImportOrderBoxLoadd() {
      if (this.updateTHOrderLoading) {
        this.$message("上传中，请勿重复上传");
        return false;
      } else {
        this.updateTHOrderLoading = true;
      }
    },
    // 获取多个单号
    getNumber(numbers) {
      this.pagerDto._Eq_SystemNo = numbers
    }
  },
};
</script>
<style lang="less">
.batch-warp {
  margin-bottom: 6px;
}
.text-right {
  text-align: right;
}
.info-systemNo {
  position: relative;
  width: 560px;
  max-height: 95vh;
  overflow-y: auto;
}
</style>
