index.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <script>
  2. import { toSaleOrder } from "@/api/expend/customerExpend";
  3. export default {
  4. name: "ResaleOrder",
  5. props: {
  6. selectData: {
  7. type: Array,
  8. default: () => [],
  9. },
  10. },
  11. data() {
  12. return {
  13. title: "转销售订单",
  14. loading: false,
  15. };
  16. },
  17. computed: {
  18. disabled: {
  19. get() {
  20. const { selectData } = this;
  21. if (selectData.length < 1) {
  22. return true;
  23. }
  24. return false;
  25. },
  26. set() {},
  27. },
  28. },
  29. methods: {
  30. //转销售订单
  31. useClick() {
  32. let that = this;
  33. this.$modal.confirm('确认转销售订单吗?').then(async function() {
  34. that.loading = true;
  35. return await toSaleOrder(that.selectData);
  36. }).then(() => {
  37. that.$modal.msgSuccess("成功");
  38. that.loading = false;
  39. }).catch(() => {
  40. that.loading = false;
  41. });
  42. },
  43. },
  44. created() {},
  45. };
  46. </script>
  47. <template>
  48. <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
  49. title
  50. }}</el-button>
  51. </template>