detail.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="warehousingAuditDetail-wrap">
  3. <a-page-header :ghost="false" :backIcon="false" class="warehousingAuditDetail-cont" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="warehousingAuditDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  7. <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.receivingBillNo) || '--' }}</p>
  8. </template>
  9. <!-- 操作区,位于 title 行的行尾 -->
  10. <template slot="extra">
  11. <a-button key="2" id="warehousingAuditDetail-preview-btn">打印预览</a-button>
  12. <a-button key="1" type="primary" id="warehousingAuditDetail-print-btn">快速打印</a-button>
  13. </template>
  14. </a-page-header>
  15. <!-- 基础信息 -->
  16. <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
  17. <a-collapse :activeKey="['1']">
  18. <a-collapse-panel key="1" header="基础信息">
  19. <a-descriptions :column="3">
  20. <a-descriptions-item label="供应商">{{ basicInfoData&&basicInfoData.dealerName ? basicInfoData.dealerName : '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="入库时间">{{ basicInfoData&&basicInfoData.stockPutTime ? basicInfoData.stockPutTime : '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="采购单号">{{ basicInfoData&&basicInfoData.purchaseBillNo ? basicInfoData.purchaseBillNo : '--' }}</a-descriptions-item>
  23. </a-descriptions>
  24. <a-descriptions :column="3" bordered>
  25. <a-descriptions-item label="采购总款数">{{ (basicInfoData&&basicInfoData.totalCategory!=0) ? basicInfoData.totalCategory : 0 }}</a-descriptions-item>
  26. <a-descriptions-item label="采购总数量">{{ (basicInfoData&&basicInfoData.totalQty!=0) ? basicInfoData.totalQty : 0 }}</a-descriptions-item>
  27. <a-descriptions-item label="采购总成本">¥{{ (basicInfoData&&basicInfoData.totalAmount!=0) ? basicInfoData.totalAmount : 0 }}</a-descriptions-item>
  28. <a-descriptions-item label="入库总款数">{{ (basicInfoData&&basicInfoData.totalQty!=0) ? basicInfoData.totalQty : 0 }}</a-descriptions-item>
  29. <a-descriptions-item label="入库总数量">{{ (basicInfoData&&basicInfoData.totalQty!=0) ? basicInfoData.totalQty : 0 }}</a-descriptions-item>
  30. <a-descriptions-item label="入库总成本">¥{{ (basicInfoData&&basicInfoData.totalPutAmount!=0) ? basicInfoData.totalPutAmount : 0 }}</a-descriptions-item>
  31. </a-descriptions>
  32. </a-collapse-panel>
  33. </a-collapse>
  34. </a-card>
  35. <!-- 入库明细 -->
  36. <a-card size="small" :bordered="false" class="warehousingAuditDetail-cont">
  37. <a-collapse :activeKey="['1']">
  38. <a-collapse-panel key="1" header="入库明细">
  39. <!-- 列表 -->
  40. <s-table
  41. class="sTable"
  42. ref="table"
  43. size="small"
  44. :rowKey="(record) => record.id"
  45. :columns="columns"
  46. :data="loadData"
  47. :scroll="{ x: 1520 }"
  48. bordered>
  49. </s-table>
  50. </a-collapse-panel>
  51. </a-collapse>
  52. </a-card>
  53. </div>
  54. </template>
  55. <script>
  56. import { getOperationalPrecision } from '@/libs/tools.js'
  57. import { STable, VSelect } from '@/components'
  58. import { receivingDetailList, receivingDetailSn } from '@/api/receiving'
  59. export default {
  60. components: { STable, VSelect },
  61. data () {
  62. return {
  63. // 表头
  64. columns: [
  65. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  66. { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center' },
  67. { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
  68. { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center' },
  69. { title: '采购数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  70. { title: '入库数量', dataIndex: 'putQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  71. { title: '成本价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  72. { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center' },
  73. { title: '入库小计', dataIndex: 'totalAmount', width: 100, align: 'center' },
  74. { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  75. { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
  76. ],
  77. // 加载数据方法 必须为 Promise 对象
  78. loadData: parameter => {
  79. this.disabled = true
  80. return receivingDetailList(Object.assign(parameter, { receivingBillSn: this.$route.params.sn })).then(res => {
  81. const data = res.data
  82. const no = (data.pageNo - 1) * data.pageSize
  83. for (var i = 0; i < data.list.length; i++) {
  84. data.list[i].no = no + i + 1
  85. // 入库小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
  86. data.list[i].warehousingSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
  87. }
  88. this.disabled = false
  89. return data
  90. })
  91. },
  92. basicInfoData: null // 基本信息
  93. }
  94. },
  95. methods: {
  96. // 返回列表
  97. handleBack () {
  98. this.$router.push({ path: '/financialManagement/warehousingAudit/list' })
  99. },
  100. getDetail () {
  101. receivingDetailSn({ sn: this.$route.params.sn }).then(res => {
  102. if (res.status == 200) {
  103. this.basicInfoData = res.data
  104. } else {
  105. this.basicInfoData = null
  106. }
  107. })
  108. }
  109. },
  110. beforeRouteEnter (to, from, next) {
  111. next(vm => {
  112. vm.getDetail()
  113. })
  114. }
  115. }
  116. </script>
  117. <style lang="less">
  118. .warehousingAuditDetail-cont{
  119. margin-bottom: 15px;
  120. }
  121. </style>