setPriceModal.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <a-modal
  3. v-model="opened"
  4. title="提交"
  5. centered
  6. :maskClosable="false"
  7. :confirmLoading="confirmLoading"
  8. width="30%"
  9. :footer="null"
  10. @cancel="cancel"
  11. >
  12. <a-spin :spinning="spinning" tip="Loading...">
  13. <div style="display:flex;align-items:center;justify-content:center;">
  14. <a-icon type="warning" theme="twoTone" two-tone-color="#D9001b" style="font-size:60px;margin-right:30px;"/>
  15. <div>
  16. <div>销售单部分产品价格发生变更,请确认</div>
  17. <a-radio-group v-model="priceVal">
  18. <a-radio value="0" :style="radioStyle">
  19. 以之前价格为准
  20. </a-radio>
  21. <a-radio value="1" :style="radioStyle">
  22. 以当前价格为准
  23. </a-radio>
  24. </a-radio-group>
  25. </div>
  26. </div>
  27. <div style="margin-top:30px;text-align:center;">
  28. <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
  29. <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
  30. </div>
  31. </a-spin>
  32. </a-modal>
  33. </template>
  34. <script>
  35. import { commonMixin } from '@/utils/mixin'
  36. export default {
  37. name: 'SetPriceModal',
  38. mixins: [commonMixin],
  39. props: {
  40. show: [Boolean]
  41. },
  42. data () {
  43. return {
  44. opened: this.show,
  45. spinning: false,
  46. priceVal: undefined,
  47. confirmLoading: false,
  48. radioStyle: {
  49. display: 'block',
  50. height: '30px',
  51. lineHeight: '30px'
  52. }
  53. }
  54. },
  55. methods: {
  56. // 保存
  57. handleSubmit () {
  58. this.$emit('ok', this.priceVal)
  59. },
  60. cancel () {
  61. this.opened = false
  62. this.$emit('cancel')
  63. }
  64. },
  65. watch: {
  66. show (newValue, oldValue) {
  67. this.opened = newValue
  68. if (!newValue) {
  69. this.priceVal = undefined
  70. }
  71. }
  72. }
  73. }
  74. </script>