<script>
import orderApi from "@/api/business/purchase/purchase-order";
export default {
  name: "CGXJ",
  props: {
    // v-model
    value: {
      type: [Object],
      require: true,
    },
  },
  data() {
    return {
      title: "采购询价",
    };
  },
  methods: {
    async useClick() {
      try {
        this.$modal.loading("处理中，请稍后...");
        let { value } = this.$props;
        console.log(value, "value");
        let { code, data, msg } = await orderApi.getPrice({
          ...value,
          action: "price",
        });
        if (code == 200) {
          this.$notify.success(msg);
          this.$emit("update:source", data);
          this.$emit("success", data);
        }
      } catch (error) {
      } finally {
        this.$modal.closeLoading();
      }
    },
  },
  created() {},
};
</script>
<template>
  <el-button v-bind="$attrs" :size="$attrs.size" @click="useClick">{{
    title
  }}</el-button>
</template>
