detailModal.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <a-modal
  3. centered
  4. class="confirmationDetail-modal"
  5. :footer="null"
  6. :maskClosable="false"
  7. title="详情"
  8. v-model="isShow"
  9. @cancel="isShow=false"
  10. width="80%">
  11. <div>
  12. <!-- <div style="padding: 0 12px;text-align: right;">
  13. <a-button id="outboundOrderDetail-preview-btn" style="margin-right: 15px;">打印预览</a-button>
  14. <a-button type="primary" id="outboundOrderDetail-print-btn">快速打印</a-button>
  15. </div> -->
  16. <!-- 基础信息 -->
  17. <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
  18. <a-collapse :activeKey="['1']">
  19. <a-collapse-panel key="1" header="基础信息">
  20. <a-descriptions size="small" :column="3" style="margin-bottom: 10px;">
  21. <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="销退单号">{{ detailData&&detailData.salesReturnBillNo || '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="申请退货数量">{{ detailData&&(detailData.totalInitialQty || detailData.totalInitialQty==0) ? detailData.totalInitialQty : '--' }}</a-descriptions-item>
  25. <a-descriptions-item label="仓库实收数量">{{ detailData&&(detailData.totalReceiveQty || detailData.totalReceiveQty==0) ? detailData.totalReceiveQty : '--' }}</a-descriptions-item>
  26. <a-descriptions-item label="坏件数量">{{ detailData&&(detailData.totalBadQty || detailData.totalBadQty==0) ? detailData.totalBadQty : '--' }}</a-descriptions-item>
  27. <a-descriptions-item label="良品数量">{{ detailData&&(detailData.totalGoodQty || detailData.totalGoodQty==0) ? detailData.totalGoodQty : '--' }}</a-descriptions-item>
  28. <a-descriptions-item label="返库数量">{{ detailData&&(detailData.totalBackStockQty || detailData.totalBackStockQty==0) ? detailData.totalBackStockQty : '--' }}</a-descriptions-item>
  29. <a-descriptions-item label="实际退货金额" v-if="$hasPermissions('B_isShowPrice')">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</a-descriptions-item>
  30. </a-descriptions>
  31. </a-collapse-panel>
  32. </a-collapse>
  33. </a-card>
  34. <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
  35. <s-table
  36. class="sTable"
  37. ref="table"
  38. size="small"
  39. :rowKey="(record) => record.id"
  40. :scroll="{ y: 400 }"
  41. :columns="columns"
  42. :data="loadData"
  43. :defaultLoadData="false"
  44. bordered>
  45. </s-table>
  46. </a-card>
  47. <div class="btn-cont"><a-button id="confirmationDetail-modal-back" @click="isShow = false">返回列表</a-button></div>
  48. </div>
  49. </a-modal>
  50. </template>
  51. <script>
  52. import { STable } from '@/components'
  53. import { salesReturnFinancialDetailList, salesReturnDetail } from '@/api/salesReturn'
  54. export default {
  55. name: 'ConfirmationDetailModal',
  56. components: { STable },
  57. props: {
  58. openModal: { // 弹框显示状态
  59. type: Boolean,
  60. default: false
  61. },
  62. itemSn: {
  63. type: [Number, String],
  64. default: ''
  65. }
  66. },
  67. data () {
  68. return {
  69. isShow: this.openModal, // 是否打开弹框
  70. detailsData: null, // 详情数据
  71. // 加载数据方法 必须为 Promise 对象
  72. loadData: parameter => {
  73. return salesReturnFinancialDetailList(Object.assign(parameter, { salesReturnBillSn: this.itemSn })).then(res => {
  74. let data
  75. if (res.status == 200) {
  76. data = res.data
  77. const no = (data.pageNo - 1) * data.pageSize
  78. for (var i = 0; i < data.list.length; i++) {
  79. data.list[i].no = no + i + 1
  80. }
  81. this.disabled = false
  82. }
  83. return data
  84. })
  85. },
  86. detailData: null // 详情数据
  87. }
  88. },
  89. computed: {
  90. columns () {
  91. const arr = [
  92. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  93. { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
  94. { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
  95. { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
  96. { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  97. { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  98. { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  99. { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  100. { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  101. { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  102. { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
  103. ]
  104. if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
  105. arr.splice(10, 0, { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
  106. arr.splice(11, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
  107. }
  108. return arr
  109. }
  110. },
  111. methods: {
  112. getDetail () {
  113. salesReturnDetail({ sn: this.itemSn }).then(res => {
  114. if (res.status == 200) {
  115. this.detailData = res.data
  116. } else {
  117. this.detailData = null
  118. }
  119. })
  120. }
  121. },
  122. watch: {
  123. // 父页面传过来的弹框状态
  124. openModal (newValue, oldValue) {
  125. this.isShow = newValue
  126. },
  127. // 重定义的弹框状态
  128. isShow (newValue, oldValue) {
  129. if (!newValue) {
  130. this.$emit('close')
  131. this.detailData = null
  132. this.$refs.table.clearTable()
  133. }
  134. },
  135. itemSn (newValue, oldValue) {
  136. if (this.isShow && newValue) {
  137. const _this = this
  138. _this.getDetail()
  139. setTimeout(() => {
  140. _this.$refs.table.refresh(true)
  141. }, 200)
  142. }
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="less">
  148. .confirmationDetail-modal{
  149. .ant-modal-body {
  150. padding: 10px 10px 20px;
  151. }
  152. .btn-cont {
  153. text-align: center;
  154. margin: 5px 0 10px;
  155. }
  156. }
  157. </style>