<template>
  <!-- <Modal
    v-model="model1"
    title="提示"
    :mask="mask"
    @on-ok="toBatchAudit"
  >
    
  </Modal> -->
  <div>
    <div>
      <p v-html="OneMsg" />
    </div>
    <div
      class="pop-btn"
      style="display:flex;justify-content: flex-end;"
    >
      <Button
        type="fcdefault"
        class="sav-btn"
        @click="toBatchAudit"
      >
        确定
      </Button>
      <Button
        class="cancel-btn"
        style="margin-left:8px"
        @click="close"
      >
        取消
      </Button>
    </div>
  </div>
</template>
<script>
  const R3 = window.R3;
  const { network, urlSearchParams, store } = R3;
  export default {
    props: {
      externalOptions: {
        type: Object,
        default: ()=>{}
      },
    },
    data() {
      return {
        OneMsg: '',
        model1: true,
        MyStr: '',
        flag: 'one',
        orderids: [],
      };
    },
    created() {
      this.OneMsg = `${this.externalOptions.msg}:</br>订单[${this.externalOptions.massage.orderids.join(',')}]${this.externalOptions.massage.msg}`;
      this.orderids = this.externalOptions.massage.orderids;
    },
    methods: {
      toBatchAudit() {
        // let str = this.externalOptions.massage.substring(this.externalOptions.massage.indexOf('[') + 1, this.externalOptions.massage.indexOf(']'));
        let arr = [];
        arr = this.orderids;
        // arr = str.split(',');
        let data = {
          tableName: 'T_V_OMSONLINEORDER', 
          ids: arr, 
          actionName: 'T_V_OMSONLINEORDER_恢复拦截_sp_2' 
        };
        network.post('/p/cs/exeAction', data).then((res) => {
          if (res.data.code == 0) {
            this.$Message.success(res.data.message);
          }
          // 成功关闭弹框
          // this.externalOptions.refresh();// 手动刷新页面
          // this.$emit('cancel');
          this.close();
        });
      },
      close() {
        // 成功关闭弹框
        document.querySelector('#refresh').click(); // 标准列表刷新按钮
        this.$emit('cancel');
      }
    }
    
  };
</script>
