<template>
    <div>
      <div>
        <p style="line-height: 20px; font-size:14px;">
            操作后，猫超平台会回告平台缺货，由平台联系消费者取消订单；京东到家平台会自动调整订单，将调整后的订单信息（去掉缺货商品）回告平台，此单将会作废，等待调整后的新订单下发，请确认是否继续？
        </p>
      </div>
      <div class="bottomBtnBox">
        <Button
            type="primary"
            size="small"
            class="sureBtn"
            @click="sureStockback"
        >
            确定
        </Button>
        <Button
            size="small"
            class="cancelBtn"
            ghost
            @click="close()"
        >
            取消
        </Button>
        </div>
    </div>
  </template>
  <script>
    const R3 = window.R3;

    const { network } = R3;
    export default {
      props: {
        idArray: {// 可获取明细表勾选的明细ID
            type: [Array, Object],
            default: () => {}
        },
      },
      data() {
        return {};
      },
      methods: {
        close() {
          // 成功关闭弹框
            this.$emit('closeActionDialog', true);
        },
        sureStockback() {
            let params = {
                "tableName": "T_V_OMSONLINEORDER",
                "actionName": "outofstockback",
                "ids": this.idArray
            };
            network.post('/p/cs/ali/outofstockback', params).then((res) => {
                if (res.data.code == 0) {
                    this.$Message.success(res.data.message);
                    this.$emit('closeActionDialog', true);
                } else {
                    this.$Message.error(res.data.message);
                }
            });
        }
      }
      
    };
  </script>
<style lang='less' scoped>
    .bottomBtnBox {
        width: calc(100% - 48px);
        margin: 16px auto 0px;
        text-align: center;
        .cancelBtn,.sureBtn {
            width: 72px;
            height: 32px;
            font-size: 12px;
        }
        .sureBtn {
            margin-right: 8px;
        }
        .cancelBtn {
            color: #909399;
            border: 1px solid #DADADA;
        }
    }
</style>
  