auditModal.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <a-modal
  3. centered
  4. class="productPricingAudit-modal"
  5. :footer="null"
  6. :maskClosable="false"
  7. title="定价审核"
  8. v-model="isShow"
  9. @cancel="isShow=false"
  10. :width="800">
  11. <a-spin :spinning="spinning" tip="Loading...">
  12. <!-- 定价审核 -->
  13. <div>
  14. <a-descriptions bordered :column="1">
  15. <a-descriptions-item label="成本价">
  16. <div v-if="detailsData && detailsData.supplierProductList" style="margin-top: 8px;">
  17. <p v-for="(item, index) in detailsData.supplierProductList" :key="index" style="margin: 0;">{{ ((item.cost || item.cost==0) ? toThousands(item.cost) : '--') + ' -- ' + (item.supplierName||'') + ';' }}</p>
  18. </div>
  19. <span v-else>--</span>
  20. </a-descriptions-item>
  21. <a-descriptions-item label="省级价">
  22. {{ detailsData && (detailsData.afterProvincePrice || detailsData.afterProvincePrice==0) ? toThousands(detailsData.afterProvincePrice) : '--' }}
  23. <span v-if="detailsData && (detailsData.afterProvincePrice != detailsData.beforeProvincePrice)">
  24. (原{{ (detailsData.beforeProvincePrice || detailsData.beforeProvincePrice==0) ? toThousands(detailsData.beforeProvincePrice) : '--' }})
  25. </span>
  26. </a-descriptions-item>
  27. <a-descriptions-item label="市级价">
  28. {{ detailsData && (detailsData.afterCityPrice || detailsData.afterCityPrice==0) ? toThousands(detailsData.afterCityPrice) : '--' }}
  29. <span v-if="detailsData && (detailsData.afterCityPrice != detailsData.beforeCityPrice)">
  30. (原{{ (detailsData.beforeCityPrice || detailsData.beforeCityPrice==0) ? toThousands(detailsData.beforeCityPrice) : '--' }})
  31. </span>
  32. </a-descriptions-item>
  33. <a-descriptions-item label="特约价">
  34. {{ detailsData && (detailsData.afterSpecialPrice || detailsData.afterSpecialPrice==0) ? toThousands(detailsData.afterSpecialPrice) : '--' }}
  35. <span v-if="detailsData && (detailsData.afterSpecialPrice != detailsData.beforeSpecialPrice)">
  36. (原{{ (detailsData.beforeSpecialPrice || detailsData.beforeSpecialPrice==0) ? toThousands(detailsData.beforeSpecialPrice) : '--' }})
  37. </span>
  38. </a-descriptions-item>
  39. <a-descriptions-item label="终端价">
  40. {{ detailsData && (detailsData.afterTerminalPrice || detailsData.afterTerminalPrice==0) ? toThousands(detailsData.afterTerminalPrice) : '--' }}
  41. <span v-if="detailsData && (detailsData.afterTerminalPrice != detailsData.beforeTerminalPrice)">
  42. (原{{ (detailsData.beforeTerminalPrice || detailsData.beforeTerminalPrice==0) ? toThousands(detailsData.beforeTerminalPrice) : '--' }})
  43. </span>
  44. </a-descriptions-item>
  45. <a-descriptions-item label="车主价">
  46. {{ detailsData && (detailsData.afterCarOwnersPrice || detailsData.afterCarOwnersPrice==0) ? toThousands(detailsData.afterCarOwnersPrice) : '--' }}
  47. <span v-if="detailsData && (detailsData.afterCarOwnersPrice != detailsData.beforeCarOwnersPrice)">
  48. (原{{ (detailsData.beforeCarOwnersPrice || detailsData.beforeCarOwnersPrice==0) ? toThousands(detailsData.beforeCarOwnersPrice) : '--' }})
  49. </span>
  50. </a-descriptions-item>
  51. <a-descriptions-item label="变更原因">{{ detailsData && detailsData.changeReason || '--' }}</a-descriptions-item>
  52. <a-descriptions-item label="是否显示">
  53. <a-radio-group v-model="priceShow">
  54. <a-radio value="1">
  55. 显示
  56. </a-radio>
  57. <a-radio value="0">
  58. 不显示
  59. </a-radio>
  60. </a-radio-group>
  61. </a-descriptions-item>
  62. </a-descriptions>
  63. <div class="btn-cont">
  64. <a-button type="primary" id="productPricingAudit-back" @click="handleAudit('AUDIT_REJECT')" style="margin-right: 15px;">审核不通过</a-button>
  65. <a-button type="primary" class="button-info" id="productPricingAudit-save" @click="handleAudit('PRICED')">审核通过</a-button>
  66. </div>
  67. </div>
  68. </a-spin>
  69. </a-modal>
  70. </template>
  71. <script>
  72. import { toThousands } from '@/libs/tools.js'
  73. // 接口
  74. import { productPricingSnDetail, productPricingAudit } from '@/api/product'
  75. export default {
  76. name: 'ProductPricingAuditModal',
  77. props: {
  78. openModal: { // 弹框显示状态
  79. type: Boolean,
  80. default: false
  81. },
  82. itemSn: {// 审核sn
  83. type: [Number, String],
  84. default: ''
  85. }
  86. },
  87. data () {
  88. return {
  89. spinning: false,
  90. toThousands, // 金额 截取到两位函数 3位添加‘,’
  91. isShow: this.openModal, // 是否打开弹框
  92. detailsData: null, // 详情数据
  93. priceShow: undefined
  94. }
  95. },
  96. methods: {
  97. // 获取详情数据
  98. getDetail () {
  99. productPricingSnDetail({ sn: this.itemSn }).then(res => {
  100. if (res.status == 200) {
  101. this.detailsData = res.data
  102. this.priceShow = this.detailsData.FirstPriceFlag == 1 ? '1' : '0'
  103. } else {
  104. this.detailsData = null
  105. }
  106. })
  107. },
  108. // 审核 type =='AUDIT_REJECT'?'不通过':'通过(PRICED)'
  109. handleAudit (type) {
  110. if (this.priceShow == undefined) {
  111. this.$message.warning('请选择是否显示')
  112. return
  113. }
  114. const ajaxData = {
  115. id: this.detailsData.id,
  116. productSn: this.detailsData.productSn,
  117. auditState: type,
  118. enabledFlag: this.priceShow
  119. }
  120. this.spinning = true
  121. productPricingAudit(ajaxData).then(res => {
  122. if (res.status == 200) {
  123. this.isShow = false
  124. this.$emit('ok')
  125. this.spinning = false
  126. } else {
  127. this.spinning = false
  128. }
  129. })
  130. }
  131. },
  132. watch: {
  133. // 父页面传过来的弹框状态
  134. openModal (newValue, oldValue) {
  135. this.isShow = newValue
  136. },
  137. // 重定义的弹框状态
  138. isShow (newValue, oldValue) {
  139. if (!newValue) {
  140. this.$emit('close')
  141. }
  142. },
  143. itemSn (newValue, oldValue) {
  144. if (this.isShow && newValue) {
  145. this.getDetail()
  146. }
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="less">
  152. .productPricingAudit-modal{
  153. .ant-modal-body {
  154. padding: 40px 40px 24px;
  155. }
  156. .btn-cont {
  157. text-align: center;
  158. margin: 35px 0 30px;
  159. }
  160. }
  161. </style>