setPriceModal.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // 变更前总金额
  42. totalRealAmount: {
  43. type: [String, Number],
  44. default: ''
  45. },
  46. // 变更后总金额
  47. totalAmount: {
  48. type: [String, Number],
  49. default: ''
  50. }
  51. },
  52. data () {
  53. return {
  54. opened: this.show,
  55. spinning: false,
  56. priceVal: undefined, // 价格类型
  57. confirmLoading: false, // 按钮loading
  58. radioStyle: {
  59. display: 'block',
  60. height: '30px',
  61. lineHeight: '30px'
  62. }
  63. }
  64. },
  65. methods: {
  66. // 保存
  67. handleSubmit () {
  68. if (!this.priceVal) {
  69. this.$message.warning('请选择价格变更类型!')
  70. return
  71. }
  72. this.$emit('ok', this.priceVal)
  73. },
  74. cancel () {
  75. this.opened = false
  76. this.$emit('cancel')
  77. }
  78. },
  79. watch: {
  80. show (newValue, oldValue) {
  81. this.opened = newValue
  82. if (!newValue) {
  83. this.priceVal = undefined
  84. }
  85. }
  86. }
  87. }
  88. </script>