<template>
    <div class='onlyReturnMoneyOrder' data-key="EDIT_ONLY_RETURN">
      <div class="quickOperation">
        快捷操作：
        <Button
          type="fcdefault"
          v-if='(showSaveBtn && VIRSTATUS == 0) || (showSaveBtn && VIRSTATUS != 0 && VIRSTATUS != 3 && OFFLINE_REMIT_STATUS == 0)'
          style="margin-right:8px"
          @click="saveAll"
        >
          保存
        </Button>
        <Button type="fcdefault" style="margin-right:8px" @click="refreshParams">刷新</Button>
        <Button type="fcdefault"
        @click="closePage"
        >
          关闭
        </Button>
      </div>
      <div class="content">
        <div
          v-for="(item,tabId) in tabList"
          :key="tabId"
          class="block"
        >
          <foldPanel
            v-model="item.blockShow"
            :title="item.tabtext"
            :explain="item.explainText"
          >
            <div
              slot="content"
              class="block"
            >
              <div class="item">
                <Row>
                <div
                  v-for="(i,cindex) in tabList[tabId].list"
                  :key="cindex"
                  class="form"
                >
                  <Col span="6" v-if="i.standard">
                      <div
                        v-if="i.title"
                        :class="{'title':true,'order-setting-input-error':i.required}"
                      >{{ i.title }}
                       <Tooltip
                        max-width="200"
                        :content="i.explainContent"
                        placement="bottom"
                      >
                        <img
                        v-if="i.explain"
                        class="img-framelanflag"
                        src="../../assets/icon/help.png"
                        >
                      </Tooltip>
                      </div>
                      <div v-if='i.SKEY=="attch_url"'>
                        <arkDocfile
                            v-if="showDocfile"
                            v-model="attchUrlList"
                            :dataitem="dataitemOne"
                            :service-id="localHost"
                            @on-change="changeFile"
                        ></arkDocfile>
                        <!-- <Upload
                          multiple
                          type="drag"
                          name='files'
                          readonly
                          action="/p/cs/batchUpload"
                          :disabled="i.disabled"
                          :default-file-list="attchUrlList"
                          :on-success='changeSuccessAttch'
                          :on-remove="removefile">
                          <div>
                              <Icon type="ios-cloud-upload" size="26" style="color: var(--primary-color)"></Icon>
                              <span style='color: var(--primary-color)'>上传附件</span>
                          </div>
                        </Upload> -->
                        <!-- <Upload action="/p/cs/batchUpload">
                          <Button icon="ios-cloud-upload-outline">Upload files</Button>
                        </Upload> -->
                      </div>
                      <DatePicker v-if='i.SKEY=="out_time"' :disabled="i.disabled" v-model="i.VALUE" v-model-format format='yyyy-MM-dd HH:mm:ss' type="datetime" placeholder="请输入申请时间" style="width:100%;max-width: 400px;min-width: 180px;"></DatePicker>
                      <DatePicker v-if='i.SKEY=="PAYTIME"' :disabled="i.disabled" v-model="i.VALUE" v-model-format format='yyyy-MM-dd HH:mm:ss' type="datetime" placeholder="请输入支付时间" style="width:100%;max-width: 400px;min-width: 180px;"></DatePicker>
                      <div v-if='i.SKEY=="refund_imgUrl"'>
                        <ImageUpload
                          multiple
                          :disabled="i.disabled"
                          :dataitem="dataitem"
                          @uploadFileChangeSuccess='changeSuccess'
                          @deleteImg="deleteImg"
                        ></ImageUpload>
                      </div>
                      <DropDownSelectFilter
                              :single="true"
                              v-if="(i.SKEY=='refund_reason') || (i.SKEY=='PAYTYPE') || (i.SKEY=='shop_name') ||(i.SKEY=='PLATFORM')"
                              class="input_box"
                              :disabled="i.disabled"
                              :data="i.shopData"
                              :total-row-count="i.shopData.totalRowCount"
                              :show-colname-key="'isak'"
                              :default-selected="i.defaultSelected"
                              @on-page-change="changePageShop($event,i)"
                              @on-input-value-change="InputValueChangeShop($event,i)"
                              @on-popper-show="searchShopData(i)"
                              @on-fkrp-selected="checkDataShop($event,i)"
                              @on-focus="focusInputValueChangeShop($event,i)"
                              @on-blur="changeDataShop($event,i)"
                              @on-clear="clearDataShop(i)"
                              :data-empty-message="i.dataEmptyMessage"
                              :columns="i.columns"
                              :auto-data="i.AutoData">
                      </DropDownSelectFilter>
                      <!-- :filterable="(i.SKEY=='shop_name')?true:false" -->
                    <Select v-model="i.VALUE" clearable :disabled="i.disabled" class="input_box" v-else-if="(i.SKEY=='buyer_province')||(i.SKEY=='buyer_city')||(i.SKEY=='buyer_area')
                      ||(i.SKEY=='refund_pay_type')
                      ||(i.SKEY=='refund_type')
                      ||(i.SKEY=='OFFLINE_REMIT_STATUS')
                      ||(i.SKEY=='VIRSTATUS')" @on-change="checkInput(i)" @on-query-change="checkInputSKU($event,i)">
                        <Option v-for="d in i.optionList" :value="d.value" :key="d.value">{{ d.label }}</Option>
                    </Select>
                    <Input
                      v-else-if="
                      (i.SKEY=='ONLYREFUNDID')
                      ||(i.SKEY=='return_all_amount')
                      ||(i.SKEY=='original_platform_number')
                      ||(i.SKEY=='original_platform_refund_number')
                      ||(i.SKEY=='burerNick')
                      ||(i.SKEY=='burerName')
                      ||(i.SKEY=='burerMobile')
                      ||(i.SKEY=='PAYEE_RECEIVER')
                      ||(i.SKEY=='PAYEE_RECEIVER_NO')
                      ||(i.SKEY=='ALIPAYACCOUNTNO')
                      ||(i.SKEY=='OFFLINE_REMIT_REMARK') 
                      ||(i.SKEY=='BUSINESSORDERNUMBER') 
                      ||(i.SKEY=='ALIPAY_REMIT_NO') 
                      ||(i.SKEY=='ALIPAY_PAY_FLOW_NO')
                      ||(i.SKEY=='REFUNDSHIPAMOUNT')
                      ||(i.SKEY=='REFUNDTOTALAMOUNT')
                      ||(i.SKEY=='TMALL_MCARD_PZ_SP') 
                      ||(i.SKEY=='EMPLOYEE_NAME')
                      ||(i.SKEY=='EMPLOYEE_NUMBER')
                      ||(i.SKEY=='REJECT_REASON')
                      "
                      class="input_box"
                      v-model="i.VALUE"
                      placeholder="请输入内容"
                      :regx='i.regx'
                      :disabled="i.disabled"
                      @on-keypress='noSpaces($event,i)'
                    />
                    <Input
                      v-else-if="i.SKEY=='original_order_number'"
                      class="input_box"
                      v-model.trim="i.VALUE"
                      placeholder="输入后请按enter"
                      :disabled="i.disabled"
                      :regx='i.regx'
                      @on-enter='checkOriginalNum'
                      @on-keypress='noSpaces($event,i)'
                    />
                    <img
                        v-if="i.search"
                        style="width:16px;margin-left:8px"
                        src="../../assets/icon/search.png"
                        @click="searchMsg(i)"
                        >
                  </Col>
                  <Col span="24" v-else-if="i.all" :class="i.required?'order-setting-input-error':null">
                    <div class="refund-content" v-if="i.SKEY=='refund_amount'" data-desc="这里其实不存在">
                      <div
                        class="count-part"
                        style="display:flex;"
                      >
                        <div class="item">
                          <div class="text">
                            商品应退总金额
  
                            <Tooltip
                              max-width="200"
                              content="新增时根据商品的申请数量来计算,入库后根据入库数量计算.公式:商品单价*申请(入库)数量+调整金额"
                              placement="bottom"
                            >
                              <img
                                class="img-framelanflag"
                                src="../../assets/icon/help.png"
                              >
                            </Tooltip>
                          </div>
                          <Input
                            v-model="refundableAmount"
                            class="input-money"
                            disabled
                          />
                          <div class="text">
                            元
                          </div>
                          <div class="plus">
                            +
                          </div>
                        </div>
                        <div class="item">
                          <div class="text">
                            应退邮费
                            <Tooltip
                              max-width="200"
                              content="由卖家原因导致需要退运费给买家的。"
                              placement="bottom"
                            >
                              <img
                                class="img-framelanflag"
                                placeholder="请输入"
                                src="../../assets/icon/help.png"
                              >
                            </Tooltip>
                          </div>
                          <Input
                            v-model="refundablePostage"
                            class="input-money"
                            @on-blur="checkMoney('refundablePostage')"
                            @on-keyup="($event)=> commonKeyupHandle({$event, calcType: 'refundablePostage'})"
                          />
                          <div class="text">
                            元
                          </div>
                          <div class="plus">
                            -
                          </div>
                        </div>
                        <div class="item">
                          <div class="text">
                            换货金额
                            <Tooltip
                              max-width="200"
                              content="计算公式：换货商品数量*单价+调整金额。请确保金额正确，否则影响新生成换货单的金额。"
                              placement="bottom"
                            >
                              <img
                                class="img-framelanflag"
                                placeholder="请输入"
                                src="../../assets/icon/help.png"
                              >
                            </Tooltip>
                          </div>
                          <Input
                            v-model="exchangeAmount"
                            class="input-money"
                            disabled
                          />
                          <div class="text">
                            元
                          </div>
                        </div>
                      </div>
                      <div class="total-part">
                        退货单总金额
                        <span
                          style="font-size: 24px;font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;color: #FD8B2E;"
                        >￥{{ total }}</span>
                      </div>
                    </div>
                  </Col>
                  <Col span="24" v-else-if="i.remark" style="align-items: flex-start;">
                    <div
                        v-if="i.title"
                        :class="{'title':true,'order-setting-input-error':i.required}"
                        style="margin-top: 6px;"
                      >{{ i.title }}
                       <Tooltip
                        max-width="200"
                        :content="i.explainContent"
                        placement="bottom"
                      >
                        <img
                        v-if="i.explain"
                        class="img-framelanflag"
                        src="../../assets/icon/help.png"
                        >
                      </Tooltip>
                    </div>
                    <Input
                      style="max-width: 1000px;"
                      :rows="2"
                      v-model="i.VALUE"
                      :disabled="i.disabled"
                      type="textarea"
                      v-if="(i.SKEY=='return_desc')||(i.SKEY=='remark')||(i.SKEY=='sysremark')||(i.SKEY=='buyer_message')"
                      placeholder="请输入内容" />
                  </Col>
                  <Col span="16" v-else>
                      <div
                        v-if="i.title"
                        :class="{'title':true,'order-setting-input-error':i.required}"
                      >{{ i.title }}
  
                       <Tooltip
                        max-width="200"
                        :content="i.explainContent"
                        placement="bottom"
                      >
                        <img
                        v-if="i.explain"
                        class="img-framelanflag"
                        src="../../assets/icon/help.png"
                        >
                      </Tooltip>
  
                      </div>
                    <Input style="width:620px;"
                    :autosize='{minRows:2,maxRows: 5}'
                    v-model="i.VALUE"
                    type="textarea"
                    v-if="i.SKEY=='consignee_address'"
                    placeholder="请输入内容" />
                  </Col>
                </div>
                </Row>
              </div>
            </div>
          </foldpanel>
        </div>
      </div>
      <div class="tableArea">
        <Tabs type="card">
          <TabPane label="仅退款单明细" v-if="showDetailTable">
              <Row style="display: flex;
                  justify-content: space-around;
                  align-items: center;
                  height: 48px;
                  margin-bottom: 16px;
                  background: #F8F8F8;">
                <Col span="4">
                <div style="display: flex;align-items: center;">
                  <label style="width: 30px;"><span style='color: red;'>*</span>SKU</label>
                  <Select
                    ref="returnSelect"
                    style="width:240px"
                    v-model="selectReturnSKUID"
                    @on-query-change="getReturnSkuList"
                    @on-change="selectReturnGoods"
                    @on-enter="addReturnGoods"
                    filterable
                    clearable
                  >
                    <Option v-for="(option,index) in SKUArrReturn" :key="index" :value="option.value">{{ option.label }}</Option>
                  </Select>
                  <img
                    style="width:16px;margin-left:8px"
                    src="../../assets/icon/search.png"
                    @click="searchGoods('return')"
                    >
                </div>
                </Col>
                <Col span="4">
                <div style="display: flex;align-items: center;">
                  <label style="width: 120px;"><span style='color: red;'>*</span>订单购买数量</label>
                  <Input style="width:240px" :regx='regx' v-model="returnGoodsNum" @on-enter="addReturnGoods"></Input>
                </div>
                </Col>
                <Col span="4">
                <div style="display: flex;align-items: center;">
                  <label style="width: 120px;">订单成交金额</label>
                  <Input style="width:240px" :regx='regx1' v-model="TRUEPRICE" @on-enter="addReturnGoods"></Input>
                </div>
                </Col>
                <Col span="4">
                <div style="display: flex;align-items: center;">
                  <label style="width: 80px;"><span style='color: red;'>*</span>退款金额</label>
                  <Input style="width:240px" :regx='regx1' v-model="REFUNDTRUEPRICE" @on-enter="addReturnGoods"></Input>
                </div>
                </Col>
                <!-- <Col span="2" >
                <Button type="primary" icon="md-return-left" @click="addReturnGoods">添加</Button>
                </Col> -->
              </Row>
              <div class="handleBtn">
                <div class="handleItem"  @click="addReturnGoods" v-if='VIRSTATUS==0 && showSaveBtn'>【保存】</div>
                <div class="handleItem"  @click="deleteReturnGoods" v-if='VIRSTATUS==0 && showSaveBtn'>【删除】</div>
                <div class="handleItem"  @click="importReturnGoods" v-if='VIRSTATUS==0 && showSaveBtn'>【导入】</div>
                <div class="handleItem" @click="exportOnlyReturnMoneyOrderDetailExcel('detail')">【导出】</div>
              </div>
             <Table height="300"
              :columns="returnColumns"
              :data="currentReturnData"
              @on-select="selectReturnData"
              @on-select-cancel="selectReturnCancel"
              @on-select-all="selectReturnDataAll"
              @on-select-all-cancel="selectReturnDataCancel"
             ></Table>
             <div class="pageContent">
                <Page
                  size="small"
                  :current="returnCurrentPage"
                  show-elevator
                  :total="totalReturn"
                  show-total
                  show-sizer
                  @on-change="changePageReturn"
                  @on-page-size-change="changeSizeReturn"
                />
              </div>
          </TabPane>
          <TabPane label="仅退款日志">
              <div class="handleBtn" style='margin-top: 16px;'>
                <div class="handleItem" @click="exportOnlyReturnMoneyOrderDetailExcel('log')">【导出】</div>
              </div>
             <Table height="300"
              :columns="logsColumns"
              :data="currentLogsData"
             ></Table>
             <!--  @on-select="selectLogsData"
              @on-select-cancel="selectLogsCancel"
              @on-select-all="selectLogsDataAll"
              @on-select-all-cancel="selectLogsDataCancel" -->
             <div class="pageContent">
                <Page
                  size="small"
                  :current="LogsCurrentPage"
                  show-elevator
                  :total="totalLogs"
                  show-total
                  show-sizer
                  @on-change="changePageLogs"
                  @on-page-size-change="changeSizeLogs"
                />
              </div>
          </TabPane>
        </Tabs>
      </div>
      <Modal
        v-model="originalModal"
        title="选择原始订单编号"
        width="900"
        :mask="mask"
        :closable="closable"
        :mask-closable="maskClosable"
        :footer-hide="hideFoot"
        @on-cancel="cancel">
           <div class="conditionContent">
            <div class="itemContent">
              <div class="itemLabel">
                订单编号
              </div>
              <Input
                v-model="originalOrderData.ID"
                clearable
              ></Input>
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                平台单号
              </div>
              <Input
                v-model="originalOrderData.TID"
                clearable
              ></Input>
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                系统单号
              </div>
              <Input
                v-model="originalOrderData.SOURCECODE"
                clearable
              ></Input>
            </div>
             <div class="itemContent">
              <div class="itemLabel">
                物流单号
              </div>
              <Input
                v-model="originalOrderData.LOGISTICSNUMBER"
                clearable
              ></Input>
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                所有SKU
              </div>
              <Input
                v-model="originalOrderData.ALLSKU"
                clearable
              ></Input>
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                收件人手机号码
              </div>
              <Input
                v-model="originalOrderData.RECEIVMOBILE"
                clearable
              />
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                收件人
              </div>
              <Input
                v-model="originalOrderData.RECEIVNAME"
                clearable
              />
            </div>
  
            <div class="itemContent">
              <div class="itemLabel">
                买家昵称
              </div>
              <Input
                style="width:240px"
                v-model="originalOrderData.USERNICK"
                clearable
              />
            </div>
          </div>
          <ShrinkOrExtend
            :form-data="originalOrderData"
            :height="shrinkHeight"
            :current-value="currentValue"
            @click="upOrDown(shrinkHeight)"
            @on-reset="reset"
            @on-query="queryBtn(nowTab)"
          />
          <Tabs type="card" v-model="nowTab">
            <TabPane label="订单详情" name="all">
                <tableFaker
                  ref="getAllDeliver"
                  :table-height="tableHeight"
                  :table-head="deliverColumns"
                  :table-name="'T_V_OMSONLINEORDER'"
                  :fixedcolumns="allFixOne"
                  :isdroplistsearch="true"
                  :highlight-row="highlightRow"
                  :searchcols="['ID','TID','SOURCECODE','ALLSKU','ALLNUM','ACTUALAMOUNT','RECEIVMOBILE','RECEIVNAME','USERNICK']"
                  @on-selectData="selectOneData"
                />
              </TabPane>
          </Tabs>
  
  
        <footer style="display: flex; justify-content: center; margin-top: 12px;padding-top: 16px;border-top: 1px solid #DEDEDE;;">
          <Button
            type="fcdefault"
            @click="cancel"
          >
            取消
          </Button>
          <Button
            type="posdefault"
            style="margin-left: 16px"
            @click="okSelectId"
          >
            确认
          </Button>
        </footer>
      </Modal>
       <Modal
        v-model="selectGoodsModal"
        title="选择商品"
        width="900"
        :mask="mask"
        :closable="closable"
        :mask-closable="maskClosable"
        :footer-hide="hideFoot"
        @on-cancel="cancelSelectGoods">
          <div class="conditionContent">
            <div class="itemContent">
              <div class="itemLabel">
                商品名称
              </div>
              <Input
                style="width:240px"
                v-model="selectGoodsData.PRODUCTNAME"
                clearable
              />
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                商品编码
              </div>
              <Input
                style="width:240px"
                v-model="selectGoodsData.PRODUCTCODE"
                clearable
              />
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                SKU
              </div>
              <Input
                v-model="selectGoodsData.SKU"
                clearable
              />
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                国标码
              </div>
              <Input
                v-model="selectGoodsData.GBCODE"
                clearable
              ></Input>
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                颜色
              </div>
              <Input
                v-model="selectGoodsData.NORMS1NAME"
                clearable
              ></Input>
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                尺寸
              </div>
              <Input
                v-model="selectGoodsData.NORMS2NAME"
                clearable
              ></Input>
            </div>
            <!-- <div class="itemContent">
              <div class="itemLabel">
                销售价
              </div>
              <Input
                v-model="selectGoodsData.SELLPRICE"
                clearable
              />
            </div>
            <div class="itemContent">
              <div class="itemLabel">
                成本价
              </div>
              <Input
                v-model="selectGoodsData.BASEPRICE"
                clearable
              />
            </div> -->
  
          </div>
          <ShrinkOrExtend
            :form-data="originalOrderData"
            :height="shrinkHeight"
            :current-value="currentValue"
            @click="upOrDown(shrinkHeight)"
            @on-reset="resetGoodsData"
            @on-query="searchGoodsData"
          />
          <Table
          :height="tableHeight"
          :columns="SKUColumns"
          :data="GoodsData"
          highlight-row
          @on-current-change="selectGoods"
          ></Table>
          <div class="pageContent">
            <Page
              size="small"
              :current="GoodsCurrentPage"
              show-elevator
              :total="totalGoods"
              show-total
              show-sizer
              @on-change="changePageGoods"
              @on-page-size-change="changeSizeGoods"
            />
          </div>
        <footer style="display: flex; justify-content: center; margin-top: 12px;padding-top: 16px;border-top: 1px solid #DEDEDE;;">
          <Button
            type="fcdefault"
            @click="cancelSelectGoods"
          >
            取消
          </Button>
          <Button
            type="posdefault"
            style="margin-left: 16px"
            @click="okSelectGoods"
          >
            确认
          </Button>
        </footer>
      </Modal>
      <Modal
        v-model="showTip"
        mask
        :mask-closable="maskClosable"
        title="警告"
        title-align="left"
        class-name="showTipModel"
        width="400px"
        @on-ok="resetData"
      >
        <p><i class="iconfont iconbj_doubt fcWarning " />修改的数据未保存，确定刷新？</p>
      </Modal>
      <OnlyReturnMoneyOrderDetailImport :visible='OnlyReturnMoneyDetailvisible' @closeActionDialog='closeActionDialog' :page-msg-id='pageMsgId'></OnlyReturnMoneyOrderDetailImport>
    </div>
  </template>
  <script>
    import foldPanel from '../customizedContent/FoldPanel.vue'; // 折叠面板组件
    import ShrinkOrExtend from '../customizedContent/shrinkOrExtend' //收缩伸展搜索条件组件
    import tableFaker from '../customizedContent/tableFaker.vue'; //表格组件
    import OnlyReturnMoneyOrderDetailImport from '../modal/OnlyReturnMoneyOrderDetailImport.vue';

    import { DispatchEvent, R3_IMPORT } from '../../assets/js/__utils__/dispatchEvent';
  
    // import R3 from '../../../static/r3/r3.publish/r3.min';
    const R3 = window.R3;
    const { network, urlSearchParams, store } = R3;
    export default {
      data() {
        return {
          OnlyReturnMoneyDetailvisible: false, // 明细导入
          ReturnAllAmount:'', // 退款总金额
          OfflineRemitRemark: '', // 打款备注
          saveArr:{
            REFUNDTYPE:'2',//单据类型
            ORIGINALORDERNO:'',//原订单编号
            OMSREASONTYPEID:'',//退款原因
            LOGISTICSCOMPANYID:'',//退回物流公司ID
            // COMPANY_NAME:'',//退回物流公司名称
            RECEIVPROVINCE:'',//省id
            RECEIVPROVINCENAME:'',//省
            RECEIVCITY:'', //市id
            RECEIVCITYNAME:'',//市
            RECEIVAREA:'', //区id
            RECEIVAREANAME:'',//区
            RECEIVADDRESS:'',//换货/收货人地址
            RECEIVNAME:'', //换货/收货人
            RECEIVMOBILE:'', //换货/收货人手机
            RECEIVPHONE:'', //换货/收货人电话
  
            VIRSTATUS:10,//退款状态
            ORDERFROM:'手工新增',
            ISRESERVEDSTOCK:0,//换货预留库存
          },//最终保存入参
          // returnSKU:'',//退货商品SKU
          SKUArrReturn:[],//退货商品SKU下拉框列表
          SKUAllDataReturn:[],//退货商品SKU下拉框列表完整数据
          selectReturnSKUData:{},//退货商品选中的SKU数据
          selectReturnSKUID:'',//退货商品sku下拉框双向数据绑定
          returnGoodsNum:'',//退货商品数量
          TRUEPRICE: '', //订单成交金额
          REFUNDTRUEPRICE: '',//退款金额
          regx: /^\d{0,15}?$/, // 正整数
          regx1: /^-?\d{0,15}(\.[0-9]{0,2})?$/,
  
          refundableAmount: '0.0000', // 应退总金额
          refundablePostage: '0.0000', // 应退邮费
          otherAmount: '0.0000', // 其他金额
          exchangeAmount: '0.0000', // 换货金额
          SYSREMARK: '', //系统备注
          BUYERMESSAGE: '',//买家备注
          total: 0, // 退货单总金额
          tabList: [
            {
              tabId: '1',
              tabtext: '基本信息',
              blockShow: true,
              list: [
                {
                  ID: '',
                  SKEY: 'original_order_number',
                  title: '订单编号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  regx: /^\d{0,100}?$/,
                  disabled:true,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                  required: true, // 是否为必填项
                  explain:false, //是否有解释
                  search:false,//是否有搜索弹窗
                  enterPending: false, //是否可以输入enter调取接口
                  explainContent:'系统中的订单编号，非平台单号；如果不知道，请点击 放大镜查找，只有已经发货或交易完成的订单才能退货。',//解释文字
                },
                {
                  ID: '',
                  SKEY: 'ONLYREFUNDID',
                  title: '仅退款单编号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: true,
                  required: true, // 是否为必填项
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY:'PLATFORM', //字段
                  title:'平台', //字段名称
                  VALUE: '', //字段值
                  clearable:true,
                  tableName:'',//表名
                  currentIndex:0,//当前页码
                  dataEmptyMessage: '数据加载中...', // 无数据的提示
                  columns:['name','value'],// 展现的组
                  AutoData:[],//模糊搜索
                  defaultSelected:[],//默认数据
                  shopData:{},
                  disabled: true,
                  standard:true,//标准输入框长度
                },
                // {
                //   ID: '',
                //   SKEY: 'PLATFORM',
                //   title: '平台',
                //   VALUE: '',
                //   defaultvalue: '',
                //   company: '',
                //   tips: '',
                //   disabled:true,
                //   flag: true, // 控制必填校验样式展示
                //   required: true, // 是否为必填项
                //   standard:true,//标准输入框长度
                //   optionList:[]
                // },
                // {
                //   ID: 'T_V_IESSHOP',
                //   SKEY: 'shop_name',
                //   title: '店铺',
                //   VALUE: '',
                //   defaultvalue: '',
                //   company: '',
                //   tips: '',
                //   disabled:false,
                //   flag: true, // 控制必填校验样式展示
                //   required: true, // 是否为必填项
                //   standard:true,//标准输入框长度
                //   optionList:[]
                // },
                {
                  ID: '',
                  SKEY:'shop_name', //字段
                  title:'店铺', //字段名称
                  VALUE: '', //字段值
                  clearable:true,
                  tableName:'',//表名
                  currentIndex:0,//当前页码
                  dataEmptyMessage: '数据加载中...', // 无数据的提示
                  columns:['name','value'],// 展现的组
                  AutoData:[],//模糊搜索
                  defaultSelected:[],//默认数据
                  shopData:{},
                  disabled: false,
                  standard:true,//标准输入框长度
                },
                {
                  SKEY: 'refund_pay_type',
                  title: '退款方式',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:false,
                  required: true, // 是否为必填项
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                  optionList:[
                    { label: '线上退款',value: '1' },
                    { label: '线下打款',value: '2' }
                  ]
                },
                {
                  SKEY: 'OFFLINE_REMIT_STATUS',
                  title: '线下打款状态',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:true,
                  required: true, // 是否为必填项
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                  optionList:[
                    { label: '未打款',value: '0' },
                    { label: '已打款',value: '1' }
                  ]
                },
                {
                  SKEY: 'refund_type',
                  title: '退费类型',
                  VALUE: '1',
                  defaultvalue: '',
                  explain: true, //是否有解释
                  company: '',
                  tips: '',
                  disabled:true,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                  explainContent:'选择订单费用时，无需指定商品，请同财务确认，如您业务结算时需要必须以商品维度结算，请不要选择订单退费 ',//解释文字
                  optionList:[
                    { label: '商品退费',value: '1' },
                    { label: '订单费用',value: '2' }
                  ]
                },
                {
                  ID: '',
                  SKEY: 'original_platform_number',
                  title: '平台单号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  required: true, // 是否为必填项
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'original_platform_refund_number',
                  title: '平台退款单号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'EMPLOYEE_NAME',
                  title: '员工姓名',
                  VALUE: '',
                  company: '',
                  tips: '',
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'EMPLOYEE_NUMBER',
                  title: '员工工号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  SKEY: 'VIRSTATUS',
                  title: '状态',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled: true,
                  required: true, // 是否为必填项
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                  optionList:[
                    { label: '未审核',value: '0' },
                    { label: '已客审',value: '1' },
                    { label: '已复核',value: '4' },
                    { label: '已财审',value: '2' },
                    { label: '已作废',value: '3' },
                  ]
                },
                {
                  ID: '',
                  SKEY: 'REJECT_REASON',
                  title: '驳回原因',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: true,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
              ]
            },
            {
              tabId: '2',
              tabtext: '买家信息',
              blockShow: true,
              list: [
                {
                  ID: '',
                  SKEY: 'burerNick',
                  title: '平台买家昵称',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'burerName',
                  title: '顾客姓名',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'burerMobile',
                  title: '顾客电话',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
              ]
            },
            {
              tabId: '4',
              tabtext: '退款信息',
              blockShow: true,
              list: [
                {
                  SKEY: 'REFUNDTOTALAMOUNT',
                  title: '退款总金额',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:true,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  SKEY: 'TMALL_MCARD_PZ_SP',
                  title: '权益金',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:true,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY:'refund_reason', //字段
                  title:'退款原因', //字段名称
                  VALUE: '', //字段值
                  clearable:true,
                  tableName:'',//表名
                  currentIndex:0,//当前页码
                  dataEmptyMessage: '数据加载中...', // 无数据的提示
                  columns:['name','value'],// 展现的组
                  AutoData:[],//模糊搜索
                  defaultSelected:[],//默认数据
                  shopData:{},
                  disabled: false,
                  standard:true,//标准输入框长度
                },
                {
                  SKEY: 'out_time',
                  title: '申请时间',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:true,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  SKEY: 'REFUNDSHIPAMOUNT',
                  title: '应退邮费',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  regx: /^-?\d{0,15}(\.[0-9]{0,4})?$/,
                  disabled: true,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  SKEY: 'attch_url',
                  title: '附件',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:false,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'return_desc',
                  title: '退款说明',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:false,//标准输入框长度
                  remark:true,//备注栏
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'buyer_message',
                  title: '买家备注',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  standard:false,//标准输入框长度
                  remark:true,//备注栏
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'remark',
                  title: '内部备注',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:false,//标准输入框长度
                  remark:true,//备注栏
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'sysremark',
                  title: '系统备注',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:false,//标准输入框长度
                  remark:true,//备注栏
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'refund_imgUrl',
                  title: '图片',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  remark:true,//备注栏
                  flag: false, // 控制必填校验样式展示
                },
              ]
            },
          ],
          addTabList: {
              tabId: '3',
              tabtext: '支付信息',
              blockShow: true,
              list: [
                {
                  ID: '',
                  SKEY: 'PAYEE_RECEIVER',
                  title: '收款人姓名',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'PAYEE_RECEIVER_NO',
                  title: '收款人账号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY:'PAYTYPE', //字段
                  title:'支付方式', //字段名称
                  VALUE: '', //字段值
                  clearable:true,
                  tableName:'',//表名
                  currentIndex:0,//当前页码
                  dataEmptyMessage: '数据加载中...', // 无数据的提示
                  columns:['name','value'],// 展现的组
                  AutoData:[],//模糊搜索
                  defaultSelected:[],//默认数据
                  shopData:{},
                  disabled: false,
                  standard:true,//标准输入框长度
                },
                {
                  ID: '',
                  SKEY: 'ALIPAYACCOUNTNO',
                  title: '支付账号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  SKEY: 'PAYTIME',
                  title: '付款时间',
                  VALUE: '',
                  defaultvalue: '',
                  company: '',
                  tips: '',
                  disabled:false,
                  standard:true,//标准输入框长度
                  flag: true, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'OFFLINE_REMIT_REMARK',
                  title: '线下打款备注',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: false,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'BUSINESSORDERNUMBER',
                  title: '商户订单号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: true,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'ALIPAY_REMIT_NO',
                  title: '支付宝打款订单号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: true,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
                {
                  ID: '',
                  SKEY: 'ALIPAY_PAY_FLOW_NO',
                  title: '支付宝支付资金流水号',
                  VALUE: '',
                  company: '',
                  tips: '',
                  disabled: true,
                  standard:true,//标准输入框长度
                  flag: false, // 控制必填校验样式展示
                },
              ]
          },
          giftOptions:[ //是否赠品
            {
              name: '否',
              value: 0
            },
            {
              name: '是',
              value: 1
            },
          ],
          groupOptions:[ //是否组合商品
            {
              name: '否',
              value: 0
            },
            {
              name: '是',
              value: 1
            },
          ],
          returnColumns: [ //退货商品
              {
                type: 'selection',
                width: 60,
                align: 'center'
              },
              {
                type: 'index',
                align: 'center',
                title: '序号',
              },
              {
                  title: '商品编码',
                align: 'center',
                  key: 'PRODUCTCODE'
              },
              {
                  title: 'SKU',
                align: 'center',
                  key: 'SKU'
              },
              {
                  title: '规格名称',
                align: 'center',
                  key: 'NORMSDETAILNAMES'
              },
              // 新增字段
              {
                title: '订单购买数量',
                align: 'center',
                key: 'ORDERPRODUCTNUM',
                render: (h, params) => {
                  let this_=this
                  return h(
                    'Input',
                    {
                      style: {
                        width:'66px'
                      },
                      props: {
                        value: params.row.ORDERPRODUCTNUM,
                        number: true,
                        disabled: this.VIRSTATUS==0?false:true
                      },
                      on: {
                        'on-blur': (event) => {
                          let chengeData=this.currentReturnData[params.index]
                          this.returnData[params.index].ORDERPRODUCTNUM = event.target.value
  
                          this.totalReturn=this.returnData.length;
                          let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
                          let endIndex=startIndex+this.pageSizeReturn
                          this.currentReturnData=this.returnData.slice(startIndex,endIndex) //当前页面显示明细
                        }
                      }
                    },
                  );
                },
              },
              {
                title: '标准价',
                align: 'center',
                key: 'PRICE'
              },
              {
                title: '订单成交金额',
                align: 'center',
                key: 'ORDERPRODUCAMOUNT',
                render: (h, params) => {
                  let this_=this
                  return h(
                    'Input',
                    {
                      style: {
                        width:'66px'
                      },
                      props: {
                        value: params.row.ORDERPRODUCAMOUNT,
                        disabled: this.VIRSTATUS==0?false:true
                      },
                      on: {
                        'on-blur': (event) => {
                            let chengeData=this.currentReturnData[params.index]
                            const tempVal = event.target.value;
                            const endVal = this.$comUtils.globalCarryAppend(tempVal, this.carryMethod);
                            event.target.value = endVal;
                            this.returnData[params.index].ORDERPRODUCAMOUNT = endVal;
                            this.totalReturn=this.returnData.length;
                            let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
                            let endIndex=startIndex+this.pageSizeReturn
                            this.currentReturnData=this.returnData.slice(startIndex,endIndex) //当前页面显示明细
                        },
                        'on-keyup': (event) => {
                          const tempVal = event.target.value;
                          const endVal = this.$comUtils.globalCarryMethod(tempVal, this.carryMethod);
                          event.target.value = endVal;
                        }
                      }
                    },
                  );
                },
              },
              {
                  title: '是否赠品',
                  align:'center',
                  key: 'ISGIFT'
              },
              {
                  title: '组合条码',
                  align:'center',
                  key: 'GROUPNAME'
              },
              {
                title: '退款金额',
                align: 'center',
                key: 'REFUND_FEE',
                render: (h, params) => {
                  return h(
                    'Input',
                    {
                      style: {
                        width:'66px'
                      },
                      props: {
                        value: params.row.REFUND_FEE,
                        disabled: this.VIRSTATUS==0?false:true
                      },
                      on: {
                        'on-blur': (event) => {
                          let chengeData=this.currentReturnData[params.index]
                          const tempVal = event.target.value;
                          const endVal = this.$comUtils.globalCarryAppend(tempVal, this.carryMethod);
                          event.target.value = endVal;
                          this.returnData[params.index].REFUND_FEE = endVal;
                          this.totalReturn=this.returnData.length;
                          let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
                          let endIndex=startIndex+this.pageSizeReturn
                          this.currentReturnData=this.returnData.slice(startIndex,endIndex) //当前页面显示明细
                        },
                        'on-keyup': (event) => {
                          const tempVal = event.target.value;
                          const endVal = this.$comUtils.globalCarryMethod(tempVal, this.carryMethod, false);
                          event.target.value = endVal;
                        }
                      }
                    },
                  );
                },
              },
          ],
  
          highlightRow:true,//支持单选
          selectTableData:{},//选中的数据
          nowTab:'all',//默认当前tab页为全部
          lastTab:'',//上一个tab页
          deliverColumns: [
              {
                  title: '订单编号',
                  key: 'ID'
              },
              {
                  title: '平台单号',
                  key: 'TID'
              },
              {
                  title: '系统单号',
                  key: 'SOURCECODE'
              },
              {
                  title: '所有SKU',
                  key: 'ALLSKU'
              },
              {
                  title: '商品数量',
                  key: 'ALLNUM'
              },
              {
                  title: '订单总额',
                  key: 'ACTUALAMOUNT'
              }
          ],
          allFixOne:{
            OrderStatus:["=1","=2","=3","=4","=5","=6","=7","=21","=50"]
          },//订单明细表格过滤条件
          warehouseFix:{ //仓库发货表格过滤条件
            OrderStatus: "=5"
          },
          platformFix:{ //平台发货表格过滤条件
            OrderStatus: "=6"
          },
          tableHeight:'200',//表格高度
          currentReturnData:[],//当前显示退款明细
          returnData:[],
          returnDataNoSame:[],//弹窗中没有的退货商品
          submitArrReturn:[],//选中的退货商品
          returnDataOld: [], // 记录原始的仅退款单明细，方便后面保存修改
          // 退货商品page
          returnCurrentPage:1,
          totalReturn: 0, // 总条数
          currentPageReturn: 0, // 页码
          pageSizeReturn: 10, // 每页的条数

          logsColumns: [
            {
              type: 'index',
              align: 'center',
              title: '序号',
            },
            {
              title: '日志类型',
              align: 'center',
              key: 'LOGTYPE'
            },
            {
              title: '日志内容',
              align: 'center',
              key: 'LOGMESSAGE'
            },
            {
              title: '创建人',
              align: 'center',
              key: 'OWNERID'
            },
            {
              title: '创建时间',
              align: 'center',
              key: 'CREATIONDATE'
            },
          ],
          logsData:[],
          currentLogsData: [],
          LogsCurrentPage:1,
          totalLogs: 0, // 总条数
          currentPageLogs: 0, // 页码
          pageSizeLogs: 10, // 每页的条数
  
          originalModal:false,//原始清单编号弹窗
          mask:true,
          closable: true,
          maskClosable: false,
          hideFoot: true,
          shrinkHeight: '58px',
          currentValue: false,//默认收缩
          originalOrderData:{
            ID:'',//订单编号
            TID:'',//平台单号SOURCECODE
            SOURCECODE: '', //系统单号
            LOGISTICSNUMBER: '', //物流单号
            ALLSKU:'',//所有SKU
            RECEIVMOBILE:'',//收件人手机号码
            RECEIVNAME:'',//收件人
            USERNICK:'',//买家昵称
          },
          selectGoodsModal:false,//选择商品弹窗
          nowGoodsType:'',//当前商品表类型
          selectGoodsData:{//选择商品搜索条件
            NORMS1NAME:'',//颜色
            NORMS2NAME:'',//尺寸
            SKU:'',//SKU
            GBCODE:'',//国标码
            PRODUCTCODE:'',//商品编码
            PRODUCTNAME:''//商品名称
          },
          submitArrGoods:[],//选择商品表格选中项
          SKUColumns:[
            {
              title: 'SKU',
              key: 'SKU'
            },
            {
              title: '销售价',
              key: 'SELLPRICE'
            },
            {
              title: '商品名称',
              key: 'PRODUCTNAME'
            },
            {
              title: '颜色',
              key: 'NORMS1NAME'
            },
            {
              title: '尺寸',
              key: 'NORMS2NAME'
            },
            {
              title: '重量',
              key: 'WEIGHT'
            },
            {
              title: '库位',
              key: 'STORESITE'
            },
            {
              title: '国标码',
              key: 'GBCODE'
            },
            {
              title:'图片地址',
               key: 'PICTUREURL',
                render: (h, params) => {
                  return h(
                    'div',
                    {
                      class:{
                        imgBox:true
                      },
                      style: {
                        zIndex: 999,
                        width:'60px',
                        height:'60px',
                        position:'relative'
                      },
  
                    },
                    [
                      h('Img',
                      {
                         style: {
                            width:'60px',
                            height:'60px'
                          },
                        attrs: {
                          src:params.row.PICTUREURL==''?'../../../static/img/camera.jpg':params.row.PICTUREURL,
                        },
                        on:{
                          'mouseenter':(e)=>{
                            let txt3=document.createElement("img");
                            txt3.id='enlargeImg'
                            txt3.src=params.row.PICTUREURL==''?'../../../static/img/camera.jpg':params.row.PICTUREURL
                            txt3.style.height='120px'
                            txt3.style.width='120px'
                            txt3.style.position='fixed'
                            if(this.currentValue){
                              txt3.style.top=`${($(".imgBox")[params.index].offsetParent.offsetHeight + $(".imgBox")[params.index].offsetTop - $(".imgBox")[params.index].offsetParent.scrollTop + 30)-100}px`;
                            }else{
                              txt3.style.top=`${$(".imgBox")[params.index].offsetParent.offsetHeight + $(".imgBox")[params.index].offsetTop - $(".imgBox")[params.index].offsetParent.scrollTop + 30}px`;
                            }
                            txt3.style.left=`${$(".imgBox")[0].offsetLeft-$(".imgBox")[params.index].offsetParent.scrollLeft + 60 + 30}px`
                            $(".imgBox")[params.index].append(txt3)
                          },
                          'mouseleave':(e)=>{
                            $("#enlargeImg").remove();
                          }
                        }
                      },)
                    ]
  
                  )
                }
            },
            {
              title: 'SKU是否有效',
              key: 'ISVALID',
              render: (h, params) => {
                const vm = this;
                return h(
                  'div',
                  {
                    style: {
                     color:params.row.ISVALID==1?'#63A4FE':'#D70017'
                    },
                  },
                  [params.row.ISVALID==1?'是':'否']
                );
              },
            },
            {
              title: '安全库存数',
              key: 'SECURITYSTOCK'
            },
          ],
          GoodsData:[],//选择商品数据
  
          // 换货商品page
          totalGoods: 0, // 总条数
          currentGoodsPage:0, // 页码
          pageSizeGoods: 10, // 每页的条数
          GoodsCurrentPage: 1,
  
          dataitem: {
              url: '/p/cs/upload2', // 上传地址
              sendData: {}, // 上传参数
              width: 100,
              height: 100,
              readonly: false,
              valuedata: [],
              name: '上传' //点击上传按钮名称
          },
          dataitemOne: {
            readonly: false, //控制字段是否可编辑
            url:'/p/cs/batchUpload',
            filesLength:3,
            filesize:2*1024*1024,
            sendData:{
                path: '',
            },
            },
          attchUrlList: [], //附件上传列表
          localHost: '', 
          showTip: false,
          showDocfile: true,
          showSaveBtn:true, // 保存按钮是否显示
          showDetailTable: true, // 展示商品明细
          VIRSTATUS: '',
          OFFLINE_REMIT_STATUS: '', // 打款状态
          platformId: '', // 原订单编号 平台ID
          carryMethod: 4, // 金额进位方式，保留2位小数还是4位小数,这里动态很麻烦，写死是4
        };
      },
      components: {
        foldPanel,
        ShrinkOrExtend,
        tableFaker,
        OnlyReturnMoneyOrderDetailImport
      },
      created(){
        // this.getQuery('T_V_OMSLOGISTICSCOMPANY')// 初始查询物流公司列表
        // this.getQuery('T_V_IESSHOP')// 初始查询店铺名称列表
        // this.getQuery('T_OMSREASONTYPE',{REFUNDTYPE:2})// 初始查询退款原因
        // this.getQuery('T_IESWAREHOUSE')// 初始查询退货仓库
        this.pageMsgId = this.$route.params.customizedModuleId; // this.$route.params.customizedModuleId;
        this.getOnlyReturnMoneyOrderDetail(); // 获取仅退款单主表信息
        this.getOnlyReturnMoneyOrderSKU(); // 获取仅退款单明细
        this.getOnlyReturnMoneyOrderLogs(); // 获取仅退款日志
        // this.getobjectTab()
      },
      methods: {
        getobjectTab(){
        // 获取元数据的配置权限
        console.log(this.$route.params)
       const customizedModuleId = this.$route.params.customizedModuleId;
        network.post('/p/cs/objectTab', urlSearchParams({
          table:'T_V_OMSINCIDENTALSRECORD',
          objid:customizedModuleId,
          ismaintable:'y'
        })).then((res) => {
            if(res.data.code == 0){
              const {tabcmd} = res.data.data;     
              if (tabcmd && tabcmd.cmds) {
                const index = tabcmd.cmds.findIndex(cmd => cmd === "actionMODIFY");
                if (index !== -1) {
                  this.showSaveBtn = tabcmd.prem[index] === true;
                } else {
                  this.showSaveBtn = true;
                }
              }
            
             
            }
         })

      },
        /**
         * 获取电商平台档案中订单发货流程校验省市区匹配系统地址
         * @param {*} str 
         * @returns 
         */
        async getPlatformInfo(option) {
          const { shopId } = option;
          if (!shopId) {
            return;
          }
          const params = {
            table: 'T_OMSPLATFORM',
            objid: shopId
          };
          const res = await network.post('/p/cs/getObject ', urlSearchParams(params))
          const resData = res.data || {};
          const { code, data } = resData || {};
          if (code == 0) {
            const forms = data.addcolums[0].childs;
            // 进位方式
            const calcItem = forms.find(item => item.colname === 'AMOUNT_SCALE');
            if (calcItem) {
              const calcVal = calcItem.valuedata;
              if (this.carryMethod !== calcVal) {
                this.carryMethod = calcVal;
              }
              console.log(this.carryMethod, 'wjf_carryMethod_02')
            }
          }
        },
        // 获取仅退款单主表信息
        getOnlyReturnMoneyOrderDetail() {
            let virtual = {
                "table":"T_V_OMSINCIDENTALSRECORD",
                "startindex":0,
                "range":1000,
                "fixedcolumns":{"ID":[`=${this.pageMsgId}`]}
            }
            network.get(`/p/cs/returnmoney/info?id=${this.pageMsgId}`).then(res => {
              const resData = res.data || {};
              const { data:resultData } = resData;
              const { PLATFORM } = resultData || {};
                this.tabList[0].list.find(item=>item.SKEY=='original_order_number').VALUE = res.data.data.ONLINEORDERID; // 订单编号
                this.tabList[0].list.find(item=>item.SKEY=='ONLYREFUNDID').VALUE = res.data.data.ONLYREFUNDID; // 仅退款单编号
                this.tabList[0].list.find(item=>item.SKEY=='shop_name').defaultSelected = [{
                    ID:String(res.data.data.SHOPID),
                    Label:res.data.data.SHOPTITLE 
                }]; // 店铺
                this.tabList[0].list.find(item=>item.SKEY=='shop_name').VALUE = res.data.data.SHOPID; // 店铺
                // this.tabList[0].list.find(item=>item.SKEY=='shop_name').VALUE = String(res.data.data.SHOPID); // 店铺   
                // this.tabList[0].list.find(item=>item.SKEY=='PLATFORM').VALUE = String(res.data.data.PLATFORM); // 平台  
                this.tabList[0].list.find(item=>item.SKEY=='PLATFORM').defaultSelected = [{
                    ID:String(res.data.data.PLATFORM),
                    Label:res.data.data.PLATFORMNAME 
                }]; // 店铺
                this.tabList[0].list.find(item=>item.SKEY=='PLATFORM').VALUE = res.data.data.PLATFORMNAME; // 店铺
                this.tabList[0].list.find(item=>item.SKEY=='refund_pay_type').VALUE = String(res.data.data.REFUNDPAYTYPE); // 退款方式
                this.tabList[0].list.find(item=>item.SKEY=='OFFLINE_REMIT_STATUS').VALUE = String(res.data.data.OFFLINE_REMIT_STATUS); //线下打款状态
                this.OFFLINE_REMIT_STATUS = String(res.data.data.OFFLINE_REMIT_STATUS); //线下打款状态
                this.tabList[0].list.find(item=>item.SKEY=='refund_type').VALUE = String(res.data.data.REFUNDTYPE); // 退费类型
                console.log(2222,res.data.data.REFUNDTYPE) 
                if(res.data.data.REFUNDTYPE == 2){
                  this.showDetailTable = false;
                }
                this.tabList[0].list.find(item=>item.SKEY=='original_platform_number').VALUE = res.data.data.TID; // 平台单号
                this.tabList[0].list.find(item=>item.SKEY=='original_platform_refund_number').VALUE = res.data.data.REFUND_ID; // 平台退款单号 
                this.tabList[0].list.find(item=>item.SKEY=='EMPLOYEE_NAME').VALUE = res.data.data.EMPLOYEE_NAME; // 员工姓名
                this.tabList[0].list.find(item=>item.SKEY=='EMPLOYEE_NUMBER').VALUE = res.data.data.EMPLOYEE_NUMBER; // 员工工号
                this.tabList[0].list.find(item=>item.SKEY=='REJECT_REASON').VALUE = res.data.data.REJECT_REASON; // 驳回原因
                this.tabList[0].list.find(item=>item.SKEY=='VIRSTATUS').VALUE = String(res.data.data.VIRSTATUS); //状态 
                this.VIRSTATUS = String(res.data.data.VIRSTATUS); //状态
                
                this.tabList[1].list.find(item=>item.SKEY=='burerNick').VALUE = res.data.data.BUYERNIKE; // 买家昵称
                this.tabList[1].list.find(item=>item.SKEY=='burerName').VALUE = res.data.data.BUYERNAME; // 顾客姓名
                this.tabList[1].list.find(item=>item.SKEY=='burerMobile').VALUE = res.data.data.BUYERMOBILE; // 顾客电话
                // 审核状态=0是未审核,未审核的能编辑，其他禁用
                if (this.VIRSTATUS == 0) {
                  const canEditorKeys = ['REFUNDSHIPAMOUNT'];
                  this.tabList.forEach(tab => {
                    tab.list.forEach(item => {
                      if(canEditorKeys.includes(item.SKEY)){
                        item.disabled = false;
                      }
                    })
                  })
                }
                if(res.data.data.REFUNDPAYTYPE == '2') {
                    if(this.tabList.length == 3){
                      this.tabList.splice(2, 0, this.addTabList);
                    }
                    if(res.data.data.VIRSTATUS != 0){
                      this.tabList.forEach(tab => {
                        tab.list.forEach(item => {
                          if(item.SKEY=='BUSINESSORDERNUMBER' || item.SKEY=='ALIPAY_REMIT_NO' || item.SKEY=='ALIPAY_PAY_FLOW_NO'){
                            item.disabled = false;
                          }else {
                            item.disabled = true;
                          }
                        })
                      })
                    }
                    console.log(2222,this.tabList)
                    // 支付信息
                    this.tabList[2].list.find(item=>item.SKEY=='PAYEE_RECEIVER').VALUE = res.data.data.PAYEE_RECEIVER; // 收款人姓名
                    this.tabList[2].list.find(item=>item.SKEY=='PAYEE_RECEIVER_NO').VALUE = res.data.data.PAYEE_RECEIVER_NO; // 收款人账号
                    this.tabList[2].list.find(item=>item.SKEY=='PAYTYPE').defaultSelected = [{
                        ID:String(res.data.data.PAYTYPE),
                        Label:res.data.data.PAYTYPENAME
                    }]; // 支付方式
                    this.tabList[2].list.find(item=>item.SKEY=='PAYTYPE').VALUE = res.data.data.PAYTYPE; // 支付方式
                    this.tabList[2].list.find(item=>item.SKEY=='ALIPAYACCOUNTNO').VALUE = res.data.data.ALIPAYACCOUNTNO; // 支付账号
                    this.tabList[2].list.find(item=>item.SKEY=='PAYTIME').VALUE = res.data.data.PAYTIME; // 付款时间
                    this.tabList[2].list.find(item=>item.SKEY=='OFFLINE_REMIT_REMARK').VALUE = res.data.data.OFFLINE_REMIT_REMARK; // 线下打款备注
                    this.tabList[2].list.find(item=>item.SKEY=='BUSINESSORDERNUMBER').VALUE = res.data.data.BUSINESSORDERNUMBER; // 商户订单号
                    this.tabList[2].list.find(item=>item.SKEY=='ALIPAY_REMIT_NO').VALUE = res.data.data.ALIPAY_REMIT_NO; // 支付宝打款订单号
                    this.tabList[2].list.find(item=>item.SKEY=='ALIPAY_PAY_FLOW_NO').VALUE = res.data.data.ALIPAY_PAY_FLOW_NO; // 支付宝支付资金流水号

                    // 退款信息
                    this.tabList[3].list.find(item=>item.SKEY=='REFUNDSHIPAMOUNT').VALUE = res.data.data.REFUNDSHIPAMOUNT; // 应退邮费
                    console.log(this.tabList[3].list)
                    this.tabList[3].list.find(item=>item.SKEY=="REFUNDTOTALAMOUNT").VALUE = res.data.data.REFUNDTOTALAMOUNT?res.data.data.REFUNDTOTALAMOUNT:''; // 退款总金额
                    this.tabList[3].list.find(item=>item.SKEY=='TMALL_MCARD_PZ_SP').VALUE = res.data.data.TMALL_MCARD_PZ_SP; // 权益金
                    this.tabList[3].list.find(item=>item.SKEY=='refund_reason').defaultSelected = res.data.data.REFUNDREASONID?[{
                        ID:res.data.data.REFUNDREASONID,
                        Label:res.data.data.REASONTYPENAME
                    }]:[{ID:'',Label:''}]; // 退款原因
                    this.tabList[3].list.find(item=>item.SKEY=='refund_reason').VALUE = res.data.data.REFUNDREASONID?res.data.data.REFUNDREASONID:''; // 退款原因
                    this.tabList[3].list.find(item=>item.SKEY=='out_time').VALUE = res.data.data.OUTTIME; // 申请时间
                    this.tabList[3].list.find(item=>item.SKEY=='return_desc').VALUE = res.data.data.RETURNDESC; // 退款说明
                    this.tabList[3].list.find(item=>item.SKEY=='buyer_message').VALUE = res.data.data.BUYERMESSAGE; // 买家备注
                    this.tabList[3].list.find(item=>item.SKEY=='remark').VALUE = res.data.data.REMARK; // 内部备注
                    this.tabList[3].list.find(item=>item.SKEY=='sysremark').VALUE = res.data.data.SYSREMARK; // 系统备注
                    this.tabList[3].list.find(item=>item.SKEY=='refund_imgUrl').VALUE = res.data.data.PICTUREURL?JSON.parse(res.data.data.PICTUREURL):''; // 图片
                    this.dataitem.valuedata = res.data.data.ATTACHURL?JSON.parse(res.data.data.PICTUREURL):[]; // 图片
                    this.tabList[3].list.find(item=>item.SKEY=='attch_url').VALUE = res.data.data.ATTACHURL?JSON.parse(res.data.data.ATTACHURL):''; // 附件
                    this.attchUrlList = res.data.data.ATTACHURL?JSON.parse(res.data.data.ATTACHURL):[]; // 附件
                } else {
                    if(this.tabList.length == 4){
                        this.tabList.splice(2, 1);
                    }
                    this.tabList[2].list.find(item=>item.SKEY=='REFUNDSHIPAMOUNT').VALUE = res.data.data.REFUNDSHIPAMOUNT; // 应退邮费
                    this.tabList[2].list.find(item=>item.SKEY=='REFUNDTOTALAMOUNT').VALUE = res.data.data.REFUNDTOTALAMOUNT?res.data.data.REFUNDTOTALAMOUNT:''; // 退款总金额
                    this.tabList[2].list.find(item=>item.SKEY=='TMALL_MCARD_PZ_SP').VALUE = res.data.data.TMALL_MCARD_PZ_SP; // 权益金
                    this.tabList[2].list.find(item=>item.SKEY=='refund_reason').VALUE = res.data.data.REFUNDREASONID?String(res.data.data.REFUNDREASONID):''; // 退款原因
                    this.tabList[2].list.find(item=>item.SKEY=='out_time').VALUE = res.data.data.OUTTIME; // 申请时间
                    this.tabList[2].list.find(item=>item.SKEY=='return_desc').VALUE = res.data.data.RETURNDESC; // 退款说明
                    this.tabList[2].list.find(item=>item.SKEY=='buyer_message').VALUE = res.data.data.BUYERMESSAGE; // 买家备注
                    this.tabList[2].list.find(item=>item.SKEY=='remark').VALUE = res.data.data.REMARK; // 内部备注
                    this.tabList[2].list.find(item=>item.SKEY=='sysremark').VALUE = res.data.data.SYSREMARK; // 系统备注
                    this.tabList[2].list.find(item=>item.SKEY=='refund_imgUrl').VALUE = res.data.data.PICTUREURL?JSON.parse(res.data.data.PICTUREURL):''; // 图片
                    this.dataitem.valuedata = res.data.data.PICTUREURL?JSON.parse(res.data.data.PICTUREURL):[]; // 图片
                    this.tabList[2].list.find(item=>item.SKEY=='attch_url').VALUE = res.data.data.ATTACHURL?JSON.parse(res.data.data.ATTACHURL):''; // 附件
                    this.attchUrlList = res.data.data.ATTACHURL?JSON.parse(res.data.data.ATTACHURL):[]; // 附件
                }
                if(res.data.data.VIRSTATUS != 0){
                    this.tabList.forEach(tab => {
                        tab.list.forEach(item => {
                            if(res.data.data.VIRSTATUS!=0 && item.SKEY != 'BUSINESSORDERNUMBER' && item.SKEY != 'ALIPAY_REMIT_NO' && item.SKEY != 'ALIPAY_PAY_FLOW_NO'){ //  || (item.SKEY != 'PAYEE_RECEIVER' && item.SKEY != 'PAYEE_RECEIVER_NO' && item.SKEY != 'OFFLINE_REMIT_REMARK' && item.SKEY != 'refund_reason')){
                                item.disabled = true;
                                this.dataitem.readonly = true;
                                this.dataitemOne.readonly = true;
                            // }else if(res.data.data.OFFLINE_REMIT_STATUS == 1){
                                // item.disabled = true;
                            }
                        })
                    })
                }
                // this.refreshParams();
                // 根据平台号获取对应字段值
                this.platformId = PLATFORM;
                this.getPlatformInfo({ shopId: this.platformId });
            })
        },
        getOnlyReturnMoneyOrderSKU() {
          let params = {
            table: 'T_OMSSHOPEXTRASDETAIL',
            objid: this.pageMsgId,
            refcolid: 195783,
            mainTableName: 'T_V_OMSINCIDENTALSRECORD',
            searchdata: {
"column_include_uicontroller":true,"startindex":0,"range":10000,"fixedcolumns":{}
}
          }
          network.post('/p/cs/objectTableItem',urlSearchParams(params)).then(res => {
            if(res.data.code == 0){
              let rows = [];
              res.data.data.row.forEach((item) => {
                let itemOne = {
                  ID: item.ID.val,
                  PRODUCTCODE: item.PRODUCTCODE.val,
                  SKU: item.IESSKUID.val,
                  SKUID: item.IESSKUID.refobjid,
                  NORMSDETAILNAMES: item.NORMSNAME.val,
                  ORDERPRODUCTNUM: item.NUM.val,
                  ORDERPRODUCAMOUNT: item.TRUEPRICE.val,
                  PRICE: item.STANDARDPRICE.val,
                  ISGIFT: item.ISGIFT.val,
                  GROUPNAME: item.GROUPNAME.val,
                  REFUND_FEE: item.REFUNDTRUEPRICE.val,
                };
                rows.push(itemOne)
              })
              this.totalReturn=res.data.data.rowCount
              this.returnData = rows
              this.returnDataOld = JSON.parse(JSON.stringify(rows))
              // 截取数组
              let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
              let endIndex=startIndex+this.pageSizeReturn
              this.currentReturnData=this.returnData.slice(startIndex,endIndex) //当前页面显示明细
            }
          })
        },
        getOnlyReturnMoneyOrderLogs() {
          let params = {
            table: 'T_OMSINCIDENTALORDERLOG',
            objid: this.pageMsgId,
            refcolid: 203334,
            mainTableName: 'T_V_OMSINCIDENTALSRECORD',
            searchdata: {
"column_include_uicontroller":true,"startindex":0,"range":10000,"fixedcolumns":{}
}
          }
          network.post('/p/cs/objectTableItem',urlSearchParams(params)).then(res => {
            if(res.data.code == 0){
              let rows = [];
              res.data.data.row.forEach((item) => {
                let itemOne = {};
                Object.keys(item).forEach(key => {
                  itemOne[key] = item[key].val;
                })
                rows.push(itemOne)
              })
              this.totalLogs=res.data.data.rowCount
              this.LogsData = rows
              // 截取数组
              let startIndex=this.pageSizeLogs*(this.LogsCurrentPage-1)
              let endIndex=startIndex+this.pageSizeLogs
              this.currentLogsData=this.LogsData.slice(startIndex,endIndex) //当前页面显示明细
            }
          })
        },
        refreshParams() {
          this.getOnlyReturnMoneyOrderDetail(); // 获取仅退款单主表信息
          this.getOnlyReturnMoneyOrderSKU(); // 获取仅退款单明细
          this.getOnlyReturnMoneyOrderLogs(); // 获取仅退款日志
        },
        changeSuccessAttch(e) {
          if(this.attchUrlList.length > 0){
            e.data.forEach(item => {
              this.attchUrlList.push(item)
            })
          }else {
            this.attchUrlList = e.data;
          }
        },
        removefile(file, fileList) {
          let nowfileList = [];
          fileList.forEach(item => {
            let obj = item.response.data[0]
            nowfileList.push(obj)
          })
          this.attchUrlList = nowfileList;
        },
        changeFile(e) {
          this.attchUrlList = JSON.parse(JSON.stringify(this.attchUrlList))
          this.saveAll();
        },
        changeSuccess(e) {
          let obj = {
            NAME: e.data.Name,
            URL: e.data.Url,
          }
          this.dataitem.valuedata.push(obj);
        }, //图片上传成功回调函数
        deleteImg(e) {
          this.dataitem.valuedata.forEach((item,index)=>{
            if(item.URL == e.URL){
              this.dataitem.valuedata.splice(index,1)
            }
          })
        }, //t图片删除回调函数
        // 判断字符串
        judgeStr(str){
          let judge=true
          if(str.indexOf('~~')==-1){
            if(str.indexOf('$$')==-1){
                if(str.indexOf('##')==-1){
                  if(str.indexOf('&&')==-1){
                    judge=true
                  }else{
                    judge=false
                  }
                }else{
                   judge=false
                }
            }else{
              judge=false
            }
          }else{
            judge=false
          }
          return judge
        },
        // 重置数据
        resetData(){
          this.tabList.forEach(item=>{
            item.list.forEach(i=>{
              if(i.SKEY == 'refund_type'){
                i.VALUE='1'
              }else {
                i.VALUE=''
              }
            })
          })
          let index = this.tabList[0].list.findIndex(item=>item.SKEY == 'return_all_amount');
          if(index >= 0) {
            this.tabList[0].list.splice(index, 1);
          }
          let indexOne = this.tabList[0].list.findIndex(item=>item.SKEY == 'OFFLINE_REMIT_REMARK');
          if(indexOne >= 0) {
            this.tabList[0].list.splice(indexOne, 1);
          }
          if(this.tabList.length == 3){
            this.clearDataShop(this.tabList[2].list[0]); // 清除选中的退款原因
          }else {
            this.clearDataShop(this.tabList[2].list[2]); // 清除选中的支付方式
            this.clearDataShop(this.tabList[3].list[0]); // 清除选中的退款原因
            this.tabList.splice(2, 1);
          }
          this.showDetailTable = true;
          this.dataitem.valuedata = []; // 上传的图片置空
          this.returnData = []; // 退款明细置空
          this.currentReturnData = []; // 仅退款明细置空
          this.refundableAmount='0.0000'// 应退总金额
          this.refundablePostage='0.0000' // 应退邮费
          this.otherAmount='0.0000' // 其他金额
          this.exchangeAmount='0.0000'// 换货金额
          this.total=0 // 退货单总金额
          // 退回明细搜索栏重置
          // this.returnGoodsNum=1
          if(this.$refs.returnSelect){
            this.$refs.returnSelect.clearSingleSelect()
          }
        },
        // 关闭当前页面
        closePage(){
          const { fullPath } = this.$route;
          const {
            keepAliveModuleName,tableName
          } = this.$store.state.global.activeTab;
          this.$store.commit('global/tabCloseAppoint', {
            tableName,
            routeFullPath: fullPath,
            keepAliveModuleName,
            stopRouterPush: true,
          });
           // 跳转
          setTimeout(()=>{
            R3.store.commit('global/tabOpen', {
              type: 'S',
              tableName:'T_V_OMSINCIDENTALSRECORD',
              tableId:'10573',
              back:true
            });
          },0)
        },
        // 获取退货表格所有SKU
        getReturnSkuList(val){
           let virtual={sku: val}
            network.post('/p/cs/getIesSku', virtual).then((res) => {
              if(res.data.Code==0){
                this.SKUArrReturn=res.data.Rows.map(i=>{
                  return {
                    label:i.SKU,
                    value:i.ID
                  }
                })
                this.SKUAllDataReturn=res.data.Rows
                if(this.SKUAllDataReturn.length == 1){
                  this.selectReturnSKUData=this.SKUAllDataReturn[0] //添加的数据
                  this.selectReturnSKUID=this.selectReturnSKUData.ID //双向数据绑定
                }
              }else{
                this.SKUArrReturn=[]
                this.SKUAllDataReturn=[]
              }
            })
        },
        selectReturnGoods(val){
          if(this.selectReturnSKUID){
            this.selectReturnSKUData=this.SKUAllDataReturn.find(item=>{
              return item.ID==val
            })
          }else{
            this.selectReturnSKUData={}
          }
        },
        // 添加退货商品到表格
        addReturnGoods(){
            let changeList = this.judgeReturnData();
            if(changeList.length == 0){
              if(JSON.stringify(this.selectReturnSKUData)=='{}'){
                this.$Message.warning('添加条码不能为空');
                return
              }
              if(!this.returnGoodsNum){
                this.$Message.warning('订单购买数量不能为空');
                return
              }
              if(!this.REFUNDTRUEPRICE){
                this.$Message.warning('退款金额不能为空');
                return
              }
              let obj=this.selectReturnSKUData
              if (this.REFUNDTRUEPRICE && this.returnGoodsNum) {
                this.$Modal.fcWarning({
                  title: '警告',
                  mask: true,
                  showCancel: true,
                  content: '添加操作数据库数据会同时发生变化，是否确认添加？',
                  onOk:()=>{
                    let params = {
                      T_V_OMSINCIDENTALSRECORD: {"ID":this.pageMsgId},
                      T_OMSSHOPEXTRASDETAIL: [{
"IESSKUID":obj.ID,"NUM":this.returnGoodsNum,"TRUEPRICE":this.TRUEPRICE,"REFUNDTRUEPRICE":this.REFUNDTRUEPRICE,"ID":-1
}],
                      after:{"T_V_OMSINCIDENTALSRECORD":{}},
                      before:{"T_V_OMSINCIDENTALSRECORD":{}}
                    }
                    network.post('/p/cs/returnmoney/update',params).then(res => {
                      if(res.data.code == 0){
                        this.selectReturnSKUData={};//退货商品选中的SKU数据
                        this.selectReturnSKUID='';//退货商品sku下拉框双向数据绑定
                        this.returnGoodsNum='';//退货商品数量
                        this.TRUEPRICE=''; //订单成交金额
                        this.REFUNDTRUEPRICE='';//退款金额
                        this.$Message.success('修改明细成功！')
                        this.getOnlyReturnMoneyOrderSKU();
                      }
                    })
                  }
                })
              }
            }else {
              let obj=this.selectReturnSKUData
              if (JSON.stringify(this.selectReturnSKUData)=='{}' && this.REFUNDTRUEPRICE && this.returnGoodsNum) {
                this.$Modal.fcWarning({
                  title: '警告',
                  mask: true,
                  showCancel: true,
                  content: '添加操作数据库数据会同时发生变化，是否确认添加？',
                  onOk:()=>{
                    let params = {
                      T_V_OMSINCIDENTALSRECORD: {"ID":this.pageMsgId},
                      T_OMSSHOPEXTRASDETAIL: [{
"IESSKUID":obj.ID,"NUM":this.returnGoodsNum,"TRUEPRICE":this.TRUEPRICE,"REFUNDTRUEPRICE":this.REFUNDTRUEPRICE,"ID":-1
}].concat(changeList),
                      after:{"T_V_OMSINCIDENTALSRECORD":{}},
                      before:{"T_V_OMSINCIDENTALSRECORD":{}}
                    }
                    network.post('/p/cs/returnmoney/update',params).then(res => {
                      if(res.data.code == 0){
                        this.selectReturnSKUData={};//退货商品选中的SKU数据
                        this.selectReturnSKUID='';//退货商品sku下拉框双向数据绑定
                        this.returnGoodsNum='';//退货商品数量
                        this.TRUEPRICE=''; //订单成交金额
                        this.REFUNDTRUEPRICE='';//退款金额
                        this.$Message.success('添加明细成功！')
                        this.getOnlyReturnMoneyOrderSKU();
                      }
                    })
                  }
                })
              }else {
                this.$Modal.fcWarning({
                  title: '警告',
                  mask: true,
                  showCancel: true,
                  content: '添加操作数据库数据会同时发生变化，是否确认添加？',
                  onOk:()=>{
                    let params = {
                      T_V_OMSINCIDENTALSRECORD: {"ID":this.pageMsgId},
                      T_OMSSHOPEXTRASDETAIL: changeList,
                      after:{"T_V_OMSINCIDENTALSRECORD":{}},
                      before:{"T_V_OMSINCIDENTALSRECORD":{}}
                    }
                    network.post('/p/cs/returnmoney/update',params).then(res => {
                      if(res.data.code == 0){
                        this.selectReturnSKUData={};//退货商品选中的SKU数据
                        this.selectReturnSKUID='';//退货商品sku下拉框双向数据绑定
                        this.returnGoodsNum='';//退货商品数量
                        this.TRUEPRICE=''; //订单成交金额
                        this.REFUNDTRUEPRICE='';//退款金额
                        this.$Message.success('修改明细成功！')
                        this.getOnlyReturnMoneyOrderSKU();
                      }
                    })
                  }
                })
              }
            }
        },
        // 判断仅退款单明细是否发生变化
        judgeReturnData() {
          let changeList = [];
          this.returnDataOld.forEach(item => {
            this.returnData.forEach(itemOne => {
              if(item.ID == itemOne.ID){
                let obj = {};
                if(item.ORDERPRODUCTNUM != itemOne.ORDERPRODUCTNUM || item.PRICE != itemOne.PRICE || item.REFUND_FEE != itemOne.REFUND_FEE){
                  if(item.ORDERPRODUCTNUM != itemOne.ORDERPRODUCTNUM){
                    obj.ID = item.ID
                    obj.NUM = itemOne.ORDERPRODUCTNUM
                  }
                  if(item.ORDERPRODUCAMOUNT != itemOne.ORDERPRODUCAMOUNT){
                    obj.ID = item.ID
                    obj.TRUEPRICE = itemOne.PRICE
                  }
                  if(item.REFUND_FEE != itemOne.REFUND_FEE){
                    obj.ID = item.ID
                    obj.REFUNDTRUEPRICE = itemOne.REFUND_FEE
                  }
                  changeList.push(obj);
                }
              }
            })
          })
          return changeList;
        },
        //初始查询标准下拉框数据
        getQuery(tableName,fixed){
          let virtual={
            fixedcolumns: fixed?fixed:{},
            range: 1000,
            startindex: 0,
            table: tableName
          }
            network.post('/p/cs/list/query', virtual).then((res) => {
              this.tabList[0].list.forEach(item=>{
                if(item.ID==tableName){
                  if(tableName=='T_V_IESSHOP'){
                    item.optionList= res.data.rows.map(i=>{
                      return {
                        label:i.SHOPTITLE.val,
                        value:i.ID.val
                      }
                    })
                  }else if(tableName=='T_IESWAREHOUSE'){
                    item.optionList= res.data.rows.map(i=>{
                      return {
                        label:i.WAREHOUSENAME.val,
                        value:i.ID.val
                      }
                    })
                  }else{
                    item.optionList= res.data.rows.map(i=>{
                      return {
                        label:i.NAME.val,
                        value:i.ID.val
                      }
                    })
                  }
                }
              })
            })
        },
  
        // 选择商品 在单选下有效，选中某一项时触发
        selectGoods(selection){
          this.submitArrGoods=[selection]
        },
  
        // 选择商品页码改变时触发
        changePageGoods(val) {
          // 1=>0 2=>10 3=>20
          this.currentGoodsPage = (val - 1) * 10;
          this.searchGoodsData();
        },
        // 选择商品页数改变时触发
        changeSizeGoods(val) {
          this.pageSizeGoods = val;
          this.currentGoodsPage = 1;
          this.searchGoodsData();
        },
        // 打开选择商品弹窗
        searchGoods(name){
          this.nowGoodsType=name
          this.searchGoodsData()
          this.selectGoodsModal=true
        },
        // 关闭选择商品弹窗
        cancelSelectGoods(){
          this.selectGoodsData={
            NORMS1NAME:'',//颜色
            NORMS2NAME:'',//尺寸
            SKU:'',//SKU
            GBCODE:'',//国标码
            // SELLPRICE:'',//销售价
            // BASEPRICE:'',//成本价
            PRODUCTCODE:'',//商品编码
            PRODUCTNAME:''//商品名称
          }
          this.submitArrGoods=[]
          this.selectGoodsModal=false
        },
        okSelectGoods(){
          if(!this.submitArrGoods.length){
            this.$Message.warning('请选择商品');
            return
          }
          if(this.nowGoodsType=='exchange'){
              network.post('/p/cs/getIesSku', {sku: this.submitArrGoods[0].SKU}).then((res) => {
                if(res.data.Code==0){
                  if(!res.data.Rows.length){
                    this.$Message.warning('该SKU无法添加，请重新选择');
                    return
                  }
                  this.SKUArr=res.data.Rows.map(i=>{
                    return {
                      label:i.SKU,
                      value:i.ID
                    }
                  })
                  this.SKUAllData=res.data.Rows
                }else{
                  this.SKUArr=[]
                  this.SKUAllData=[]
                }
                this.selectSKUData=this.SKUAllData.find(item=>{
                  return item.ID==this.submitArrGoods[0].ID
                }) //添加的数据
                this.selectSKUID=this.selectSKUData.ID //双向数据绑定
                this.cancelSelectGoods()
              })
          }else if(this.nowGoodsType=='return'){
            network.post('/p/cs/getIesSku', {sku: this.submitArrGoods[0].SKU}).then((res) => {
              if(res.data.Code==0){
                if(!res.data.Rows.length){
                  this.$Message.warning('该SKU无法添加，请重新选择');
                  return
                }
                this.SKUArrReturn=res.data.Rows.map(i=>{
                  return {
                    label:i.SKU,
                    value:i.ID
                  }
                })
                this.SKUAllDataReturn=res.data.Rows
              }else{
                this.SKUArrReturn=[]
                this.SKUAllDataReturn=[]
              }
              this.selectReturnSKUData=this.SKUAllDataReturn.find(item=>{
                return item.ID==this.submitArrGoods[0].ID
              }) //添加的数据
              this.selectReturnSKUID=this.selectReturnSKUData.ID //双向数据绑定
              this.cancelSelectGoods()
            })
          }
        },
        // 重置选择商品搜索条件
        resetGoodsData(){
          this.selectGoodsData={
            NORMS1NAME:'',//颜色
            NORMS2NAME:'',//尺寸
            SKU:'',//SKU
            GBCODE:'',//国标码
            // SELLPRICE:'',//销售价
            // BASEPRICE:'',//成本价
            PRODUCTCODE:'',//商品编码
            PRODUCTNAME:''//商品名称
          }
          this.submitArrGoods=[]
          this.searchGoodsData()
        },
        // 查询符合搜索条件的商品
        searchGoodsData(){
          let virtual = {
            fixedcolumns: this.selectGoodsData ? this.selectGoodsData : {},
            isdroplistsearch: false,
            range: this.pageSizeGoods,
            startindex: this.currentGoodsPage,
            table: 'T_V_IESNOGROUPSKU',
          };
            network.post('/p/cs/list/query', virtual).then((res) => {
              this.totalGoods = res.data.total;
              let data = [];
              for (let i = 0; i < res.data.rows.length; i++) {
                for (let j = 0; j < Object.keys(res.data.rows[i]).length; j++) {
                  let keyName = Object.keys(res.data.rows[i])[j];
                  res.data.rows[i][keyName] = res.data.rows[i][keyName].val;
                }
                data.push(res.data.rows[i]);
              }
              this.GoodsData = data;
              this.GoodsData.forEach(i => {
                i.ISGIFT = 0;
                i.ISGROUP = 0;
              })
              if(this.nowGoodsType=='exchange'){
                 if(this.exchangeData.length){
                    let sameArr = [...this.GoodsData].filter((x) => [...this.exchangeData].some((y) => y.SKU == x.SKU));
                    this.exchangeDataNoSame = [...this.exchangeData].filter((x) => [...this.GoodsData].every((y) => y.SKU != x.SKU));
                    if(sameArr.length){
                      this.GoodsData.forEach(item=>{
                        sameArr.forEach(i=>{
                          if(i.SKU==item.SKU){
                              item._checked=true
                              item.isSame=true //标记是否为之前选择项
                          }
                        })
                      })
                      this.submitArrGoods=[...this.submitArrGoods,...sameArr]
                    }
                  }else{
                    this.GoodsData.forEach(item=>{
                      item.NUM=1
                      item.REFUND_FEE=this.standardMoney(item.BASEPRICE * item.NUM)
                      item.REFUNDNUM=1
                      item.ADJUSTAMOUNT=(item.BASEPRICE - item.SELLPRICE) * item.NUM
                    })
                  }
              }else if(this.nowGoodsType=='return'){
                if(this.returnData.length){
                  let sameArr = [...this.GoodsData].filter((x) => [...this.returnData].some((y) => y.SKU == x.SKU));
                  this.returnDataNoSame= [...this.returnData].filter((x) => [...this.GoodsData].every((y) => y.SKU != x.SKU));
                  if(sameArr.length){
                    this.GoodsData.forEach(item=>{
                      sameArr.forEach(i=>{
                        if(i.SKU==item.SKU){
                            item._checked=true
                            item.isSame=true //标记是否为之前选择项
                        }
                      })
                    })
                    this.submitArrGoods=[...this.submitArrGoods,...sameArr]
                  }
                }else{
                  this.GoodsData.forEach(item=>{
                    item.NUM=1
                    item.REFUND_FEE=this.standardMoney(item.BASEPRICE * item.NUM)
                    item.REFUNDNUM=1
                    // item.ADJUSTAMOUNT=(item.BASEPRICE - item.SELLPRICE) * item.NUM
                    // item.PRODUCTMARK=1 //商品标记
                  })
                }
              }
            });
        },
        // 删除
        deleteReturnGoods(){
          // let idArray=this.submitArrReturn.map(item=>item.ID)
          // this.returnData = this.returnData.filter(i =>{
          //  return !idArray.includes(i.ID)
          // });
          // this.refundableAmount=0
          // this.returnData.forEach(i=>{
          //     this.refundableAmount = this.standardMoney(this.parser(this.refundableAmount)+this.parser(i.REFUND_FEE)); //应退总金额
          // })
          // this.checkMoney()
          // this.totalReturn=this.returnData.length //总条数
          // // 截取数组
          // let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
          // let endIndex=startIndex+this.pageSizeReturn
          // this.currentReturnData=this.returnData.slice(startIndex,endIndex) //当前页面显示明细
          if(this.submitArrReturn.length > 0){
            this.$Modal.fcWarning({
                title: '提示',
                mask: true,
                showCancel: true,
                content: '确认执行删除?',
                onOk:()=>{
                  let idArray=this.submitArrReturn.map(item=>item.ID)
                  // this.returnData = this.returnData.filter(i =>{
                  //   return !idArray.includes(i.ID)
                  // });
                  // this.totalReturn=this.returnData.length //总条数
                  // // 截取数组
                  // let startIndex=this.pageSizeReturn*(this.ReturnCurrentPage-1)
                  // let endIndex=startIndex+this.pageSizeReturn
                  // this.currentReturnData=this.ReturnData.slice(startIndex,endIndex) //当前页面显示明细

                  let T_OMSSHOPEXTRASDETAIL = [];
                  idArray.forEach(item => {
                    let obj = {
                      "ID": item
                    }
                    T_OMSSHOPEXTRASDETAIL.push(obj)
                  })
                  let params = {
                    "T_V_OMSINCIDENTALSRECORD":{"ID":this.pageMsgId,"isdelmtable":false},
                    "T_OMSSHOPEXTRASDETAIL":T_OMSSHOPEXTRASDETAIL
                  }
                  network.post('/p/cs/returnmoney/delete', params).then(res => {
                    if (res.data.code == 0) {
                      this.$Message.success('删除明细成功！');
                      this.ReturnCurrentPage = 1;
                      this.getOnlyReturnMoneyOrderSKU();
                    }
                  });
                }
            })
          }
        },

        // 日志页码改变时触发
        changePageLogs(val){
           // 1=>0 2=>10 3=>20
          this.LogsCurrentPage=val
          // 截取数组
          let startIndex=this.pageSizeLogs*(this.LogsCurrentPage-1)
          let endIndex=startIndex+this.pageSizeLogs
          this.currentLogsData=this.LogsData.slice(startIndex,endIndex)
        },
        // 日志页数改变时触发
        changeSizeLogs(val){
          this.pageSizeLogs = val;
          this.LogsCurrentPage=1;
          // this.currentReturnPage = 0;
          // 截取数组
          let startIndex=this.pageSizeLogs*(this.LogsCurrentPage-1)
          let endIndex=startIndex+this.pageSizeLogs
          this.currentLogsData=this.LogsData.slice(startIndex,endIndex)
        },
  
        // 退货页码改变时触发
        changePageReturn(val){
           // 1=>0 2=>10 3=>20
           this.returnCurrentPage=val
          // 截取数组
          let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
          let endIndex=startIndex+this.pageSizeReturn
          this.currentReturnData=this.returnData.slice(startIndex,endIndex)
        },
        // 退货页数改变时触发
        changeSizeReturn(val){
          this.pageSizeReturn = val;
          this.returnCurrentPage=1;
          // this.currentReturnPage = 0;
          // 截取数组
          let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
          let endIndex=startIndex+this.pageSizeReturn
          this.currentReturnData=this.returnData.slice(startIndex,endIndex)
        },
        // 退货表格选中某项时触发
        selectReturnData(selection, row) {
          this.submitArrReturn = selection;
        },
        // 退货表格取消某项时触发
        selectReturnCancel(selection, row) {
          this.submitArrReturn = selection;
        },
        // 退货表格全选
        selectReturnDataAll(selection) {
          this.submitArrReturn = selection;
        },
        // 退货表格取消全选
        selectReturnDataCancel(selection) {
          this.submitArrReturn = selection;
        },
        commonKeyupHandle(option) {
          const { $event, calcType } = option;
          const tempVal = $event.target.value;
          const endVal = this.$comUtils.globalCarryMethod(tempVal, this.carryMethod, true);
          if (calcType === 'refundablePostage') {
            this.refundablePostage = endVal;
          }
        },
        checkMoney(str) {
          let num;
          if (str == 'refundablePostage') {
            // 是否要补充.00|.0000
            this.refundablePostage = this.$comUtils.globalCarryAppend(this.refundablePostage, this.carryMethod);
            num = (+this.parser(this.refundableAmount)) + (+this.parser(this.refundablePostage)) + (+this.parser(this.otherAmount)) -this.parser(this.exchangeAmount);
          } else if (str == 'otherAmount') { //其他金额暂时注释掉
            this.otherAmount = this.standardMoney(this.otherAmount);
            num = (+this.parser(this.refundableAmount)) + (+this.parser(this.refundablePostage)) + (+this.parser(this.otherAmount))-this.parser(this.exchangeAmount);
          }else{
            num = (+this.parser(this.refundableAmount)) + (+this.parser(this.refundablePostage)) + (+this.parser(this.otherAmount)) -this.parser(this.exchangeAmount);
          }
  
          this.total = this.standardMoney(num);
        },
        standardMoney(number) {
          number = (`${number}`).replace(/[^0-9+-Ee.]/g, '');
          // eslint-disable-next-line no-restricted-globals
          let n = !isFinite(+number) ? 0 : +number;
          // eslint-disable-next-line no-restricted-globals
          let prec = !isFinite(+4) ? 0 : Math.abs(this.carryMethod); // 保留几位小数
          let sep = ','; // 千分位符号
          let dec = '.'; // 小数点符号
          let s = '';
          // eslint-disable-next-line func-names
          let toFixedFix = function (n, prec) {
            // eslint-disable-next-line no-restricted-properties
            let k = Math.pow(10, prec); //10的prec次方
            // return `${Math.ceil(n * k) / k}`;
            return `${Math.ceil(Math.floor(n * k * 100) / 100) / k}`;
          };
  
          s = (prec ? toFixedFix(n, prec) : `${Math.round(n)}`).split('.');
          let re = /(-?\d+)(\d{3})/;
          while (re.test(s[0])) {
            s[0] = s[0].replace(re, `$1${sep}$2`);
          }
  
          if ((s[1] || '').length < prec) {
            s[1] = s[1] || '';
            s[1] += new Array(prec - s[1].length + 1).join('0');
          }
          return s.join(dec);
        },
        parser(value) {
          if((typeof value=='string')){
            return parseFloat(value.replace(/[^\d\.-]/g, ''));
          }
            return value
        },
  
        checkInputSKU(e,i){
          // if(i.SKEY=='refund_type') {
          
          // }else 
          if(i.VALUE){
              let tableName=i.ID
              if(tableName=='T_V_IESSHOP'){
                this.getQuery(tableName)
              }else if(tableName=='T_IESWAREHOUSE'){
                this.getQuery(tableName)
              }else if(tableName=='T_V_OMSLOGISTICSCOMPANY'||tableName=='T_OMSREASONTYPE'){
                this.getQuery(tableName)
              }
          }else {
              let tableName=i.ID
              if(tableName=='T_V_IESSHOP'){
                this.getQuery(tableName,{SHOPTITLE:e})
              }else if(tableName=='T_IESWAREHOUSE'){
                this.getQuery(tableName,{WAREHOUSENAME:e})
              }else if(tableName=='T_V_OMSLOGISTICSCOMPANY'){
                this.getQuery(tableName,{NAME:e})
              }else if(tableName=='T_OMSREASONTYPE'){
                this.getQuery(tableName,{NAME:e,REFUNDTYPE:2})
              }
          }
        },
        checkInput(i){ //下拉框选中事件
          let skey = i.SKEY;
          let inputValue = i.VALUE; //refund_type
          if(skey == 'refund_type' && inputValue == '2'){
            this.showDetailTable = false;
            let obj = {
              ID: '',
              SKEY: 'return_all_amount',
              title: '退款总金额',
              VALUE: this.ReturnAllAmount,
              company: '',
              tips: '',
              regx: /^\d{0,15}(\.[0-9]{0,4})?$/,
              disabled:false,
              standard:true,//标准输入框长度
              flag: false, // 控制必填校验样式展示
              required: false, // 是否为必填项
            }
            let index = this.tabList[0].list.findIndex(item=>item.SKEY == 'refund_type');
            this.tabList[0].list.splice(index + 3, 0, obj);
          }else if(skey == 'refund_type' && inputValue == '1'){
            this.showDetailTable = true
            let index = this.tabList[0].list.findIndex(item=>item.SKEY == 'return_all_amount');
            if(index >= 0) {
              this.tabList[0].list.splice(index, 1);
            }
          }
          if(skey == 'refund_pay_type' && inputValue == '2') {
            this.tabList.splice(2, 0, this.addTabList);
          }else if(this.tabList.length == 4 && skey == 'refund_pay_type' && inputValue == '1'){
            this.tabList.splice(2, 1);
          }
        },
        // 平台单号，退款单号(换货单没有)，退回物流单号禁止输入空格
        noSpaces(e,i){
          if(i.SKEY=='original_platform_number'||i.SKEY=='return_logistics_num'){
            if(e.keyCode == 32) e.returnValue = false
          }
        },
        searchMsg(i){ //原始订单编号弹窗
          let skey = i.SKEY;
          let inputValue = +i.VALUE;
          // eslint-disable-next-line no-restricted-globals
          if(!isNaN(inputValue)){
            if(skey=='original_order_number'){ //退款原因
              this.originalModal=true
            }
          }else{
            i.VALUE=''
            this.$Message.error('订单编号输入格式不正确，请重新输入');
          }
        },
        // 关闭弹窗
        cancel(){
          this.originalOrderData = {
            ID:'',//订单编号
            TID:'',//平台单号SOURCECODE
            SOURCECODE: '', //系统单号
            ALLSKU:'',//所有SKU
            RECEIVMOBILE:'',//收件人手机号码
            RECEIVNAME:'',//收件人
            USERNICK:'',//买家昵称
          }
          // 初始化过滤条条件
          this.allFixOne={//全部发货表格过滤条件
            OrderStatus:["=1","=2","=3","=4","=5","=6","=7","=21","=50"]
          }
          this.warehouseFix={ //仓库发货表格过滤条件
            OrderStatus: "=5"
          }
          this.platformFix={ //平台发货表格过滤条件
            OrderStatus: "=6"
          }
          this.nowTab='all'
          this.originalModal=false
        },
        okSelectId(){
          this.ReturnAllAmount = this.selectTableData.ACTUALAMOUNT;
          this.tabList[0].list.forEach(item=>{
            if(item.SKEY=='original_order_number'){
              item.VALUE=this.selectTableData.ID
              if(item.VALUE){
                let virtual = {
                  id: +item.VALUE,
                };
              let virtual1 = {
                    table: 'T_V_OMSONLINEORDER',
                    objid: +item.VALUE,
                    // columns: ['RECEIVPHONE', 'RECEIVNAME', 'RECEIVMOBILE', 'RECEIVADDRESS'],
                    type: 0,
                    isrefundorder: 1,
              };
              network.post('/p/cs/showProtectData', virtual1).then((res) => {
                if (res.data.code == 0) {
                  if(res.data.message !== 'SUCCESS'){
                    this.$Modal.fcError({
                      title: '提示',
                      mask:true,
                      content: res.data.message
                    });
                  }
                    let showData = res.data.data;
                    this.ok(virtual,showData)
                }else if(res.data.code == 10){
                    // this.$Message.warning('获取原单收件人信息失败，请手工填写收货人信息！')
                    // let showData = res.data.data?res.data.data:'';
                    let showData = this.selectTableData // 解密失败直接用原单信息
                    this.ok(virtual,showData)
                }else if(res.data.code == -3){
                  this.$Modal.fcError({
                      title: '提示',
                      mask:true,
                      content: '您没有查看敏感信息的权限，无法手工新增退换货单，如需使用请联系管理员至【用户档案】中开通【可查看客户敏感信息】权限。'
                  });
                  this.reset()
                }else{
                  this.reset()
                }
              })
              }else{
                this.$Message.warning('至少选择一条订单')
              }
            }
          })
        },
        checkOriginalNum(){
          let params = {
            objid: this.tabList[0].list[0].VALUE
          }
          network.post('/p/cs/order/available', params).then((res) => {
            if(res.data.code == 0){
              if(res.data.data == 0){
                return this.$Message.error('没有查询到当前订单编号！');
              }if(res.data.data == 1){
                this.originalNumEnter();
              }
            }
          })
        },
        originalNumEnter(){
          this.tabList[0].list.forEach(item=>{
            if(item.SKEY=='original_order_number'){
              if(item.VALUE){
                let virtual = {
                  id: +item.VALUE,
                };
              let virtual1 = {
                    table: 'T_V_OMSONLINEORDER',
                    objid: +item.VALUE,
                    // columns: ['RECEIVPHONE', 'RECEIVNAME', 'RECEIVMOBILE', 'RECEIVADDRESS'],
                    type: 0,
                    isrefundorder: 1,
              };
              network.post('/p/cs/showProtectData', virtual1).then((res) => {
                if (res.data.code == 0) {
                  if(res.data.message !== 'SUCCESS'){
                    this.$Modal.fcError({
                      title: '提示',
                      mask:true,
                      content: res.data.message
                    });
                  }
                    let showData = res.data.data;
                    this.ok(virtual,showData)
                }else if(res.data.code == 10){
                    this.searchOrder(item.VALUE).then(data => {
                       // this.$Message.warning('获取原单收件人信息失败，请手工填写收货人信息！')
                      let showData = data
                      this.ok(virtual,showData)
                    })
                }else if(res.data.code == -3){
                  this.$Modal.fcError({
                      title: '提示',
                      mask:true,
                      content: '您没有查看敏感信息的权限，无法手工新增退换货单，如需使用请联系管理员至【用户档案】中开通【可查看客户敏感信息】权限。'
                  });
                  this.reset()
                }else{
                  this.reset()
                }
              })
              }else{
                this.$Message.warning('至少选择一条订单')
              }
            }
          })
        },
  
        // 查询订单
        searchOrder(id) {
          const params = {
            fixedcolumns: {
              ALLSKU: '',
              ID: String(id),
              LOGISTICSNUMBER: '',
              OrderStatus:["=1","=2","=3","=4","=5","=6","=7","=21","=50"],
              RECEIVMOBILE: '',
              RECEIVNAME: '',
              SOURCECODE: '',
              TID: '',
              USERNICK: ''
            },
            isdroplistsearch: true,
            range: 10,
            startindex: 0,
            table: 'T_V_OMSONLINEORDER',
            fkdrplist: {
              searchcols: ['ID','TID','SOURCECODE','ALLSKU','ALLNUM','ACTUALAMOUNT','RECEIVMOBILE','RECEIVNAME','USERNICK']
            }
          }
          return network.post('/p/cs/list/query', params).then(res => {
            const data = res.data.rows[0]
            Object.keys(data).forEach(key => {
              data[key] = data[key].val
            })
            return data
          })
        },
  
        ok(virtual,showData){
          this.resetData()
          network.post('/p/cs/findOrderByParam', virtual).then((res) => {
            if(res.data.code==0){
              let data=res.data.data
              this.returnData=data.DETAILS
              if(this.returnData.length){
                this.returnData.forEach(i=>{
                  i.ISGIFT=i.ISGIFT?'是':'否'
                  i.ISGROUP=i.GROUPNAME?'是':'否'
                  i.REFUND_FEE=i.REFUND_FEE?this.parser(i.REFUND_FEE):0
                })
              }
              this.totalReturn=this.returnData.length
              // 截取数组
              let startIndex=this.pageSizeReturn*(this.returnCurrentPage-1)
              let endIndex=startIndex+this.pageSizeReturn
              this.currentReturnData=this.returnData.slice(startIndex,endIndex) //当前页面显示明细
                this.tabList[0].list.forEach(item=>{
                  if(item.SKEY=='original_order_number'){
                    item.VALUE=data.ID
                  }else if(item.SKEY=='original_platform_number'){
                    item.VALUE=data.TID // SOURCECODE
                  }else if(item.SKEY=='shop_name'){
                    item.VALUE=data.ORDERSHOPID.toString()
                  }
                })
                this.tabList[1].list.forEach(item=>{
                  if(item.SKEY=='burerNick'){
                    item.VALUE=showData.USERNICK?showData.USERNICK:''
                  }else if(item.SKEY=='burerName'){
                    item.VALUE=showData.RECEIVNAME?showData.RECEIVNAME:''
                  }else if(item.SKEY=='burerMobile'){
                    item.VALUE=showData.RECEIVMOBILE?showData.RECEIVMOBILE:''
                  }
                })
                this.refundableAmount=data.RECEIVEDAMOUNT
                this.checkMoney()
            }
            if(this.originalModal){
              this.cancel()
            }
          })
        },
         // 重置
        reset() {
          this.originalOrderData={
            ID:'',//订单编号
            TID:'',//平台单号 SOURCECODE
            SOURCECODE: '', //系统单号
            ALLSKU:'',//所有SKU
            RECEIVMOBILE:'',//收件人手机号码
            RECEIVNAME:'',//收件人
            USERNICK:'',//买家昵称
          }
          this.queryBtn(this.nowTab)
        },
        // 查询按钮点击
        queryBtn(nowTab) {
          if(nowTab=='all'){
            this.allFixOne=this.originalOrderData
            this.allFixOne.OrderStatus=["=1","=2","=3","=4","=5","=6","=7","=21","=50"]
            setTimeout(()=>{
              this.$refs.getAllDeliver.currentPage = 1;
              this.$refs.getAllDeliver.currentPageOfferInfo=0
              this.$refs.getAllDeliver.getInfoData()
            },200)
          }else if(nowTab=='warehouse'){
            this.warehouseFix=this.originalOrderData
            this.warehouseFix.OrderStatus="=5"
            setTimeout(()=>{
              this.$refs.getWarehouseDeliver.currentPage = 1;
              this.$refs.getWarehouseDeliver.currentPageOfferInfo=0
              this.$refs.getWarehouseDeliver.getInfoData();
            },200)
          }else if(nowTab=='platform'){
            this.platformFix=this.originalOrderData
            this.platformFix.OrderStatus="=6"
            setTimeout(()=>{
              this.$refs.getPlatformDeliver.currentPage = 1;
              this.$refs.getPlatformDeliver.currentPageOfferInfo=0
              this.$refs.getPlatformDeliver.getInfoData();
            },200)
          }
        },
        // 表格单选一项
        selectOneData(val){
          this.selectTableData=val
        },
        upOrDown(height) {
          this.currentValue = !this.currentValue;
          document.getElementsByClassName('conditionContent')[0].style.maxHeight = this.currentValue ? height : '';
          this.tableHeight = this.currentValue ? '250' : '200';
        },
        // 下拉分页模糊搜索框
        // 外键下拉框
          searchShopData(i){
               let virtual={}
              if(i.SKEY==='shop_name'){
                  virtual={
                      searchdata:{
                          "isdroplistsearch":true,
                          "refcolid":194840,
                          "startindex":i.currentIndex,
                          "range":10,
                      }
                  }
              }else if(i.SKEY==='PLATFORM'){
                  virtual={
                      searchdata:{
                          "isdroplistsearch":true,
                          "refcolid":198043,
                          "startindex":i.currentIndex,
                          "range":10,
                      }
                  }
              } else if(i.SKEY==='refund_reason'){
                  virtual={
                      searchdata:{
                          "isdroplistsearch":true,
                          "refcolid":201356,
                          "fixedcolumns":{"REFUNDTYPE":["=1","=3"]},
                          "startindex":i.currentIndex,
                          "range":10,
                      }
                  }
              } else if(i.SKEY==='PAYTYPE') {
                  virtual={
                      searchdata:{
                          "isdroplistsearch":true,
                          "refcolid":193123,
                          "startindex":i.currentIndex,
                          "range":10,
                      }
                  }
              }
              network.post('/p/cs/QueryList',urlSearchParams(virtual)).then((res) => {
                   if(res.data.code==0){
                      if(i.SKEY==='shop_name'){
                        this.tabList[0].list.forEach(item => {
                          if(item.SKEY===i.SKEY){
                              item.shopData=res.data.data
                              item.currentIndex=0
                          }
                        });
                      } else if(i.SKEY==='PLATFORM'){
                        this.tabList[0].list.forEach(item => {
                          if(item.SKEY===i.SKEY){
                              item.shopData=res.data.data
                              item.currentIndex=0
                          }
                        });
                      } else if(i.SKEY==='refund_reason') {
                        if(this.tabList.length == 3){
                          this.tabList[2].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.shopData=res.data.data
                                item.currentIndex=0
                            }
                          });
                        }else if(this.tabList.length == 4){
                          this.tabList[3].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.shopData=res.data.data
                                item.currentIndex=0
                            }
                          });
                        }
                      }else if(i.SKEY==='PAYTYPE'){
                        this.tabList[2].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.shopData=res.data.data
                                item.currentIndex=0
                            }
                        });
                      }
                   }
               })
          },
          // 单选下拉选中
          checkDataShop(val,i){
            let index = 0
            if(i.SKEY==='shop_name') {
              index = 0;
            }else if(i.SKEY==='PLATFORM') {
              index = 0;
            }else if(i.SKEY==='refund_reason'){
              if(this.tabList.length == 3){
                index = 2;
              }else if(this.tabList.length ==4){
                index = 3;
              }
            }else if(i.SKEY==='PAYTYPE'){
              index = 2;
            }
            this.tabList[index].list.forEach(item => {
              if(item.SKEY===i.SKEY){
                  item.VALUE=val[0].ID
                  item.NAME=val[0].Label
              }
            });
          },
          // 单选框失去焦点事件
          changeDataShop(e,i){
              let index = 0
              if(i.SKEY==='shop_name') {
                index = 0;
              } else if(i.SKEY==='PLATFORM') {
                index = 0;
              } else if(i.SKEY==='refund_reason'){
                if(this.tabList.length == 3){
                  index = 2;
                }else if(this.tabList.length ==4){
                  index = 3;
                }
              } else if(i.SKEY==='PAYTYPE'){
                index = 2;
              }
              if(!e.target.value){
                this.tabList[index].list.forEach(item => {
                    if(item.SKEY===i.SKEY){
                        item.VALUE=''
                        item.NAME=''
                    }
                });
              }else{
                  this.tabList[index].list.forEach(item => {
                      if(item.SKEY===i.SKEY){
                          if(item.AutoData.length){
                              item.AutoData.forEach(v=>{
                                  if(e.target.value==v.value){
                                      item.VALUE=v.id
                                      item.NAME=v.value
                                  }
                              })
                          }
                          e.target.value=item.NAME?item.NAME:''
                      }
                  });
              }
          },
          // 清空选中项
          clearDataShop(i){
              let index = 0
              if(i.SKEY==='shop_name') {
                index = 0;
              }else if(i.SKEY==='PLATFORM') {
                index = 0;
              }else if(i.SKEY==='refund_reason'){
                if(this.tabList.length == 3){
                  index = 2;
                }else if(this.tabList.length ==4){
                  index = 3;
                }
              } else if(i.SKEY==='PAYTYPE'){
                index = 2;
              }
              this.tabList[index].list.forEach(item => {
                  if(item.SKEY==i.SKEY){
                      item.VALUE=''
                      item.NAME=''
                  }
              });
              this.tabList = JSON.parse(JSON.stringify(this.tabList))
          },
          // 单选下拉分页改变
          changePageShop(e,i){
            let index = 0
              if(i.SKEY==='shop_name') {
                index = 0;
              }else if(i.SKEY==='PLATFORM') {
                index = 0;
              }else if(i.SKEY==='refund_reason'){
                if(this.tabList.length == 3){
                  index = 2;
                }else if(this.tabList.length ==4){
                  index = 3;
                }
              } else if(i.SKEY==='PAYTYPE'){
                index = 2;
              }
              this.tabList[index].list.forEach(item => {
                  if(item.SKEY===i.SKEY){
                      item.currentIndex=(e-1)*10
                      this.searchShopData(item)
                  }
              });
          },
          focusInputValueChangeShop(e,i){
              let virtual={}
              if(i.SKEY==='shop_name'){
                  virtual={
                      ak: e.target.value,
                      colid: 194840,
                      fixedcolumns: {}
                  }
              }else if(i.SKEY==='PLATFORM') {
                virtual={
                    ak: e.target.value,
                    colid: 198043,
                    fixedcolumns: {}
                }
              }else if(i.SKEY==='refund_reason'){
                  virtual={
                      ak: e.target.value,
                      colid: 201356,
                      fixedcolumns: {"REFUNDTYPE":["=1","=3"]}
                  }
              }else if(i.SKEY==='PAYTYPE'){
                  virtual={
                      ak: e.target.value,
                      colid: 193123,
                      fixedcolumns: {}
                  }
              }
              network.post('/p/cs/fuzzyquerybyak',urlSearchParams(virtual)).then((res) => {
                  if(res.data.code==0){
                      if(i.SKEY==='shop_name'){
                        this.tabList[0].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                        });
                      }else if(i.SKEY==='PLATFORM') {
                        this.tabList[0].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                        });
                      }else if(i.SKEY==='refund_reason') {
                        if(this.tabList.length == 3){
                          this.tabList[2].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                          });
                        }else if(this.tabList.length == 4){
                          this.tabList[3].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                          });
                        }
                      }else if(i.SKEY==='PAYTYPE'){
                        this.tabList[2].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                        });
                      }
                  }
              })
          },
          // 单选下拉模糊搜索数据
          InputValueChangeShop(e,i){
               let virtual={}
              if(i.SKEY==='shop_name'){
                  virtual={
                      ak: e,
                      colid: 194840,
                      fixedcolumns: {}
                  }
              }else if(i.SKEY==='PLATFORM') {
                virtual={
                    ak: e,
                    colid: 198043,
                    fixedcolumns: {}
                }
              }else if(i.SKEY==='refund_reason'){
                  virtual={
                      ak: e,
                      colid: 201356,
                      fixedcolumns: {"REFUNDTYPE":["=1","=3"]}
                  }
              }else if(i.SKEY==='PAYTYPE'){
                  virtual={
                      ak: e,
                      colid: 193123,
                      fixedcolumns: {}
                  }
              }
              network.post('/p/cs/fuzzyquerybyak',urlSearchParams(virtual)).then((res) => {
                  if(res.data.code==0){
                      if(i.SKEY==='shop_name'){
                        this.tabList[0].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                        });
                      }else if(i.SKEY==='PLATFORM') {
                        this.tabList[0].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                        });
                      }else if(i.SKEY==='refund_reason') {
                        if(this.tabList.length == 3){
                          this.tabList[2].list.forEach(item => {
                              if(item.SKEY===i.SKEY){
                                  item.AutoData=res.data.data
                              }
                          });
                        }else if(this.tabList.length == 4){
                          this.tabList[3].list.forEach(item => {
                              if(item.SKEY===i.SKEY){
                                  item.AutoData=res.data.data
                              }
                          });
                        }
                      }else if(i.SKEY==='PAYTYPE'){
                        this.tabList[2].list.forEach(item => {
                            if(item.SKEY===i.SKEY){
                                item.AutoData=res.data.data
                            }
                        });
                      }
                  }
              })
          },
          // 保存
          saveAll() {
            this.showDocfile = false;
            let baseMsg = this.tabList[0]; //基本信息
            let buyerMsg = this.tabList[1]; //买家信息
            let alipayMsg = {}; // 支付信息
            let refundMsg = {}; // 退款信息
            if(this.tabList.length == 3){
              refundMsg = this.tabList[2]; //退款信息
            }else if(this.tabList.length == 4){
              alipayMsg = this.tabList[2]; // 支付信息
              refundMsg = this.tabList[3]; //退款信息
            }
  
            // 图片信息
            let PICTUREURL = JSON.stringify(this.dataitem.valuedata);
            // 附件信息
            let attachUrl = [];
            this.attchUrlList.forEach(item => {
              let obj = {
                name:item.name,
                url:item.url,
                Size:item.Size
              }
              attachUrl.push(obj)
            })
            let ATTACHURL= JSON.stringify(attachUrl);
  
            // if(!baseMsg.list.find(item=>item.SKEY=='original_order_number').VALUE){
            //   return this.$Message.warning('订单编号不能为空！');
            // }
            if(!baseMsg.list.find(item=>item.SKEY=='shop_name').VALUE){
              return this.$Message.warning('店铺不能为空！');
            }
            if(!baseMsg.list.find(item=>item.SKEY=='refund_pay_type').VALUE){
              return this.$Message.warning('退款方式不能为空！');
            }
            // if(!baseMsg.list.find(item=>item.SKEY=='original_platform_number').VALUE){
            //   return this.$Message.warning('平台单号不能为空！');
            // }
            // console.log(refundMsg.list.find(item=>item.SKEY=='refund_reason'))
            let T_V_OMSINCIDENTALSRECORD = {
              ID: this.pageMsgId,
              ONLINEORDERID: baseMsg.list.find(item=>item.SKEY=='original_order_number').VALUE, // 订单编号
              SHOPID: baseMsg.list.find(item=>item.SKEY=='shop_name').VALUE, // 店铺   
              REFUNDPAYTYPE: baseMsg.list.find(item=>item.SKEY=='refund_pay_type').VALUE, // 退款方式
              REFUNDTYPE:baseMsg.list.find(item=>item.SKEY=='refund_type').VALUE, // 退费类型 
              TID: baseMsg.list.find(item=>item.SKEY=='original_platform_number').VALUE?baseMsg.list.find(item=>item.SKEY=='original_platform_number').VALUE.trim():'', // 平台单号
              REFUND_ID: baseMsg.list.find(item=>item.SKEY=='original_platform_refund_number').VALUE?baseMsg.list.find(item=>item.SKEY=='original_platform_refund_number').VALUE.trim():'', // 平台退款单号 
              EMPLOYEE_NAME: baseMsg.list.find(item=>item.SKEY=='EMPLOYEE_NAME').VALUE?baseMsg.list.find(item=>item.SKEY=='EMPLOYEE_NAME').VALUE.trim():'', // 员工姓名
              EMPLOYEE_NUMBER: baseMsg.list.find(item=>item.SKEY=='EMPLOYEE_NUMBER').VALUE?baseMsg.list.find(item=>item.SKEY=='EMPLOYEE_NUMBER').VALUE.trim():'', // 员工工号 
               
  
              BUYERNIKE: buyerMsg.list.find(item=>item.SKEY=='burerNick').VALUE?buyerMsg.list.find(item=>item.SKEY=='burerNick').VALUE.trim():'', // 买家昵称burerNick
              BUYERNAME: buyerMsg.list.find(item=>item.SKEY=='burerName').VALUE?buyerMsg.list.find(item=>item.SKEY=='burerName').VALUE.trim():'', // 顾客姓名
              BUYERMOBILE: buyerMsg.list.find(item=>item.SKEY=='burerMobile').VALUE?buyerMsg.list.find(item=>item.SKEY=='burerMobile').VALUE.trim():'', // 顾客电话
  
              REFUNDSHIPAMOUNT: refundMsg.list.find(item=>item.SKEY=='REFUNDSHIPAMOUNT').VALUE, // 应退邮费 
              REFUNDREASONID: refundMsg.list.find(item=>item.SKEY=='refund_reason').VALUE, // 退款原因
              OUTTIME: refundMsg.list.find(item=>item.SKEY=='out_time').VALUE, // 申请时间
              RETURNDESC: refundMsg.list.find(item=>item.SKEY=='return_desc').VALUE?refundMsg.list.find(item=>item.SKEY=='return_desc').VALUE.trim():'', // 退款说明
              BUYERMESSAGE: refundMsg.list.find(item=>item.SKEY=='buyer_message').VALUE?refundMsg.list.find(item=>item.SKEY=='buyer_message').VALUE.trim():'', // 买家备注
              REMARK: refundMsg.list.find(item=>item.SKEY=='remark').VALUE?refundMsg.list.find(item=>item.SKEY=='remark').VALUE.trim():'', // 内部备注
              SYSREMARK: refundMsg.list.find(item=>item.SKEY=='sysremark').VALUE?refundMsg.list.find(item=>item.SKEY=='sysremark').VALUE.trim():'', // 系统备注
              PICTUREURL, // 图片："[{\"NAME\":\"default@2x.png\",\"URL\":\"https://yunque-cs.oss-cn-hangzhou.aliyuncs.com/r3-lark-app/uat/36547d63-4433-45db-8a76-a6acf5dc13d3.png\"}]"
              ATTACHURL, // 附件："[{\"name\":\"Arrow.png\",\"url\":\"https://yunque-cs.oss-cn-hangzhou.aliyuncs.com/r3-lark-app/uat/Arrow.png\",\"Size\":\"508B\"}]"
            }
  
            if(baseMsg.list.find(item=>item.SKEY=='refund_type').VALUE == 2){ 
              T_V_OMSINCIDENTALSRECORD.REFUNDTOTALAMOUNT = baseMsg.list.find(item=>item.SKEY=='return_all_amount')?baseMsg.list.find(item=>item.SKEY=='return_all_amount').VALUE:''
            }
  
            if(baseMsg.list.find(item=>item.SKEY=='refund_pay_type').VALUE == 2){
              // fix热修:商户订单号,支付宝打款订单号,支付宝支付资金流水号
              const storeOrderItem = alipayMsg.list.find(item=>item.SKEY=='BUSINESSORDERNUMBER') || {};
              const alipayMoneyItem = alipayMsg.list.find(item=>item.SKEY=='ALIPAY_REMIT_NO') || {};
              const waterItem = alipayMsg.list.find(item=>item.SKEY=='ALIPAY_PAY_FLOW_NO') || {};
              T_V_OMSINCIDENTALSRECORD.BUSINESSORDERNUMBER = (storeOrderItem.VALUE || '').trim() || '';
              T_V_OMSINCIDENTALSRECORD.ALIPAY_REMIT_NO = (alipayMoneyItem.VALUE || '').trim() || '';
              T_V_OMSINCIDENTALSRECORD.ALIPAY_PAY_FLOW_NO = (waterItem.VALUE || '').trim() || '';
              T_V_OMSINCIDENTALSRECORD.PAYEE_RECEIVER = alipayMsg.list.find(item=>item.SKEY=='PAYEE_RECEIVER').VALUE?alipayMsg.list.find(item=>item.SKEY=='PAYEE_RECEIVER').VALUE.trim():''; // 收款人姓名
              T_V_OMSINCIDENTALSRECORD.PAYEE_RECEIVER_NO = alipayMsg.list.find(item=>item.SKEY=='PAYEE_RECEIVER_NO').VALUE?alipayMsg.list.find(item=>item.SKEY=='PAYEE_RECEIVER_NO').VALUE.trim():''; // 收款人账号
              T_V_OMSINCIDENTALSRECORD.PAYTYPE = alipayMsg.list.find(item=>item.SKEY=='PAYTYPE').VALUE; // 支付方式
              T_V_OMSINCIDENTALSRECORD.ALIPAYACCOUNTNO = alipayMsg.list.find(item=>item.SKEY=='ALIPAYACCOUNTNO').VALUE?alipayMsg.list.find(item=>item.SKEY=='ALIPAYACCOUNTNO').VALUE.trim():''; // 支付账号
              T_V_OMSINCIDENTALSRECORD.PAYTIME = alipayMsg.list.find(item=>item.SKEY=='PAYTIME').VALUE; // 付款时间
              T_V_OMSINCIDENTALSRECORD.OFFLINE_REMIT_REMARK = alipayMsg.list.find(item=>item.SKEY=='OFFLINE_REMIT_REMARK').VALUE?alipayMsg.list.find(item=>item.SKEY=='OFFLINE_REMIT_REMARK').VALUE.trim():'';//线下打款备注
            }
  
            let T_OMSSHOPEXTRASDETAIL = []
            // this.currentReturnData
            this.returnData.forEach(item => {
              let obj = {
                ID: item.ID?item.ID:-1, //
                IESSKUID: item.SKUID,
                NUM: Number(item.ORDERPRODUCTNUM),//NUM
                REFUNDTRUEPRICE: this.parser(item.REFUND_FEE),//ORDERPRODUCAMOUNT
                TRUEPRICE: this.parser(item.ORDERPRODUCAMOUNT),//PRICE
                GROUPNAME: item.GROUPNAME?item.GROUPNAME:'',
                ISGIFT: (item.ISGIFT=='是'||item.ISGIFT=='1')?1:0,
              }
              T_OMSSHOPEXTRASDETAIL.push(obj)
            })
            let fixedData = {
              T_V_OMSINCIDENTALSRECORD
            }
            // if(baseMsg.list.find(item=>item.SKEY=='refund_type').VALUE == '1' && T_OMSSHOPEXTRASDETAIL.length>0){
            //   fixedData.T_OMSSHOPEXTRASDETAIL = T_OMSSHOPEXTRASDETAIL;
            // }
            let params = {
              // objId: this.pageMsgId,
              T_V_OMSINCIDENTALSRECORD
              // fixedData: fixedData
            }
            network.post('/p/cs/returnmoney/update',params).then(res => { ///p/cs/objectSave
              if(res.data.code == 0){
                this.showDocfile = true;
                this.getOnlyReturnMoneyOrderDetail(); // 获取仅退款单主表信息
                this.getOnlyReturnMoneyOrderSKU(); // 获取仅退款单明细
                this.getOnlyReturnMoneyOrderLogs(); // 获取仅退款日志
                this.$Message.success('修改仅退款单成功！');
              }else {
                this.showDocfile = true;
                this.$Modal.fcError({
                  title: '提示',
                  mask:true,
                  content: res.data.message
                })
              }
            })
          },

          importReturnGoods() {
            this.OnlyReturnMoneyDetailvisible = true;
          },

          // 仅退款明细表导出
          async exportOnlyReturnMoneyOrderDetailExcel(type) {
            let userId = JSON.parse(localStorage.getItem('userInfo')).id;
            let data = await network.get(`/p/cs/judge/export_the_verification_code?tableName='T_IESSKUPRICESTRATEGYITEM'`);
            if (data.data.data) {
              let virtual = {
                table: 'V_USERS', // USERS
                objid: userId,
              };
              this.$network.post('/p/cs/object/query', virtual).then((res) => {
                let str = res.data.MOBIL;
                let a = /^1\d{10}$/;
                if (str && a.test(str)) {
                  let MOBIL = str;
                  let refresh = this.searchClickData;
                  this.$R3Dialog({
                    dialogComponentName: 'exportValidate', // 自定义的弹框组件
                    title: '导出校验', // 弹框标题
                    footerHide: true,
                    externalOptions: {
                      massage: MOBIL,
                      refresh
                    }
                  }, () => {
                    this.batchExport(type); // 调用框架导出
                  });
                } else {
                  this.$Modal.fcError({
                    title: '错误',
                    content: '当前用户手机号为空或格式不正确，请联系管理员在【用户档案】中进行修改',
                    mask: true,
                  });
                }
              });
            }else {
              this.batchExport(type); // 调用框架导出
            }
          },
          batchExport(type) {
            let params = {};
            if(type == 'detail'){
              params = {
                searchdata: {
                  table: 'T_OMSSHOPEXTRASDETAIL',
                  startIndex: 0,
                  range: 1000,
                  fixedcolumns: {
                    ID: null
                  },
                  objectIds:`195783=${this.pageMsgId}`,
                  column_include_uicontroller: true,
                },
                filename: '仅退款单明细',
                filetype: '.xlsx',
                showColumnName: true,
                menu: '仅退款单明细',
              }
            }else if(type == 'log'){
              params = {
                searchdata: {
"table":"T_OMSINCIDENTALORDERLOG","column_include_uicontroller":true,"fixedcolumns":{"ID":null},"objectIds":`203334=${this.pageMsgId}`,"startindex":0,"range":10
},
                filename: '仅退款日志',
                filetype: '.xlsx',
                showColumnName: true,
                menu: '仅退款日志',
              }
            }
            network.post('/p/cs/export', urlSearchParams(params)).then(res => {
              if(res.data.code === 0) {
                this.$Message.success({
                  content: res.data.message,
                  duration: 3
                })
                const asyncTaskScheme = () => (window.ProjectConfig && window.ProjectConfig.asyncTaskScheme ? window.ProjectConfig.asyncTaskScheme : ''); // 异步导出设计方案
                if(asyncTaskScheme() === 'skq') {
                  const params = {
                    detail: {
                      type: 'notice'
                    }
                  }
                  DispatchEvent(R3_IMPORT, params)
                  this.$R3loading.hide(this.loadingName);
                  // this.closeDialog()
                }
              }
            })
          },

          // 策略明细表导入弹框关闭
          closeActionDialog() {
            this.OnlyReturnMoneyDetailvisible = false;
          },
      }
    };
  </script>
  <style lang="less">
  
  .quickOperation{
    height: 64px;
    border-bottom: 1px solid #D8D8D8;
    display: flex;
    align-items: center;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #333333;
  }
  .content{
    .block{
      padding-top: 24px;
    }
    .ark-col{
      display: flex;
      align-items: center;
      // justify-content: flex-end;
      margin-bottom: 16px;
      .input_box{
        max-width: 400px;
        min-width: 180px;
      }
  
     .ark-input-wrapper /deep/ textarea{
        resize: none;
        min-height: 36px!important;
      }
      .title{
        min-width: 110px;
        display: flex;
        justify-content: flex-end;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #333333;
        display: flex;
        align-items: center;
        margin-right: 8px;
        img{
          margin-left: 5px;
          width: 16px;
        }
      }
    }
  
  }
  .refund-content{
      margin:0 auto;
      display: flex;
      flex-direction: column;
      align-items: center;
  
      .count-part{
          height: 60px;
          margin-bottom: 16px;
          border-bottom: 1px solid #D8D8D8;
          .item{
              display: flex;
              align-items: center;
              .text{
                  font-size: 14px;
                  font-family: PingFangSC-Regular, PingFang SC;
                  font-weight: 400;
                  color: #333333;
              }
          }
          .img-framelanflag{
              cursor: pointer;
              vertical-align: middle;
              margin-top: -3px;
              margin-left: 5px;
              width: 16px;
          }
          .input-money{
              width: 80px;margin:0 8px
          }
          .plus{
              margin: 0 16px;
              font-size: 14px;
              font-family: PingFangSC-Regular, PingFang SC;
              font-weight: 400;
              color: #979797;
          }
      }
      .total-part{
          display: flex;
          align-items: center;
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #333333;
      }
  }
  
  .onlyReturnMoneyOrder .ark-upload-drag {
    border: none;
  
  }
  
  </style>
  <style lang="less" scoped>
   .pageContent {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
    }
    .order-setting-input-error:before{
      content: '*';
      color: red;
      // position: absolute;
      // left: 8px;
    }
    .conditionContent {
      width: 100%;
      display: flex;
      max-height: 3000px;
      overflow: hidden;
      flex-wrap: wrap;
      padding-top: 8px;
      // padding-right: 51px;
      // justify-content: space-between;
      .itemContent {
        width: calc((100% - 120px) / 3);
        display: flex;
        align-items: center;
        margin:0 20px 24px;
        .itemLabel {
          min-width: 84px;
          font-size: 12px;
          font-weight: 500;
          color: #4C4C4C;
          line-height: 17px;
          margin-right: 8px;
          text-align: right;
        }
        .posterType {
          width: calc(100% - 84px);
        }
      }
    }
    .tableArea /deep/ .ark-tabs-bar{
      margin-bottom: 0px;
      .ark-tabs-tab{
        line-height: 22px !important;
      }
    }
    .tableArea{
      padding-top:24px;
      .handleBtn{
          height:16px;
          margin-bottom:16px;
          display:flex;
          .handleItem{
            width: 48px;
            height: 16px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: var(--primary-color);
            line-height: 16px;
            margin: 0 2px;
            cursor: pointer;
          }
      }
    }
    .content /deep/ .ark-select-input[disabled]{
        color: #575757;
    }
  </style>
