setPriceModal.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 style="margin-bottom:10px;font-weight:bold;">销售单部分产品价格发生变更,请确认</div>
  17. <a-radio-group v-model="priceVal">
  18. <a-radio value="0" :style="radioStyle">
  19. 以【当前】价格为准,总金额:{{ totalRealAmount }}元
  20. </a-radio>
  21. <a-radio value="1" :style="radioStyle">
  22. 以【最新】价格为准,总金额:{{ totalAmount }}元
  23. </a-radio>
  24. </a-radio-group>
  25. </div>
  26. </div>
  27. <div style="margin-top:36px;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. totalRealAmount: {
  42. type: [String, Number],
  43. default: ''
  44. },
  45. totalAmount: {
  46. type: [String, Number],
  47. default: ''
  48. }
  49. },
  50. data () {
  51. return {
  52. opened: this.show,
  53. spinning: false,
  54. priceVal: undefined,
  55. confirmLoading: false,
  56. radioStyle: {
  57. display: 'block',
  58. height: '30px',
  59. lineHeight: '30px'
  60. }
  61. }
  62. },
  63. methods: {
  64. // 保存
  65. handleSubmit () {
  66. if (!this.priceVal) {
  67. this.$message.warning('请选择价格变更类型!')
  68. return
  69. }
  70. this.$emit('ok', this.priceVal)
  71. },
  72. cancel () {
  73. this.opened = false
  74. this.$emit('cancel')
  75. }
  76. },
  77. watch: {
  78. show (newValue, oldValue) {
  79. this.opened = newValue
  80. if (!newValue) {
  81. this.priceVal = undefined
  82. }
  83. }
  84. }
  85. }
  86. </script>