detail.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.sparePartsPurchaseNo) || '--' }}</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="供应商">箭冠营销中心</a-descriptions-item>
  21. <a-descriptions-item label="入库时间">箭冠营销中心</a-descriptions-item>
  22. <a-descriptions-item label="采购单号">箭冠营销中心</a-descriptions-item>
  23. </a-descriptions>
  24. <a-descriptions :column="3" bordered>
  25. <a-descriptions-item label="采购总款数">2</a-descriptions-item>
  26. <a-descriptions-item label="采购总数量">20</a-descriptions-item>
  27. <a-descriptions-item label="采购总成本">¥120.36</a-descriptions-item>
  28. <a-descriptions-item label="入库总款数">{{ (bizInfo&&bizInfo.productTotalCategory!=0) ? bizInfo.productTotalCategory : 0 }}</a-descriptions-item>
  29. <a-descriptions-item label="入库总数量">{{ (bizInfo&&bizInfo.productTotalQty!=0) ? bizInfo.productTotalQty : 0 }}</a-descriptions-item>
  30. <a-descriptions-item label="入库总成本">¥{{ (bizInfo&&bizInfo.productTotalCost!=0) ? bizInfo.productTotalCost : 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="default"
  44. :rowKey="(record) => record.id"
  45. :columns="columns"
  46. :data="loadData"
  47. :scroll="{ x: 1290 }"
  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 { stockPutBizInfo } from '@/api/stockPut'
  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: 'productCode', width: 160, align: 'center' },
  67. { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
  68. { title: '原厂编码', dataIndex: 'productOrigCode', width: 200, align: 'center' },
  69. { title: '采购数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  70. { title: '入库数量', dataIndex: 'qtsy', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  71. { title: '成本价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  72. { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' },
  73. { title: '入库小计', dataIndex: 'warehousingSubtotal', width: 100, align: 'center' },
  74. { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  75. { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
  76. ],
  77. // 加载数据方法 必须为 Promise 对象
  78. loadData: parameter => {
  79. this.disabled = true
  80. // return customerBundleDelayList(Object.assign(parameter, this.queryParam)).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. // const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
  86. // const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
  87. // const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
  88. // const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
  89. // data.list[i].productCode = productCode || '--'
  90. // data.list[i].productName = productName || '--'
  91. // data.list[i].productOrigCode = productOrigCode || '--'
  92. // data.list[i].productOrigUnit = productOrigUnit || '--'
  93. // data.list[i].warehouseName = data.list[i].warehouseEntity && data.list[i].warehouseEntity.name || '--'
  94. // data.list[i].warehouseLocationName = data.list[i].warehouseLocationEntity && data.list[i].warehouseLocationEntity.name || '--'
  95. // // 入库小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
  96. // data.list[i].warehousingSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
  97. // }
  98. // this.disabled = false
  99. // return data
  100. // })
  101. const _this = this
  102. return new Promise(function (resolve, reject) {
  103. const data = {
  104. pageNo: 1,
  105. pageSize: 10,
  106. list: [
  107. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  108. ],
  109. count: 10
  110. }
  111. const no = (data.pageNo - 1) * data.pageSize
  112. for (var i = 0; i < data.list.length; i++) {
  113. data.list[i].no = no + i + 1
  114. }
  115. _this.disabled = false
  116. resolve(data)
  117. })
  118. },
  119. basicInfoData: null, // 基本信息
  120. bizInfo: null
  121. }
  122. },
  123. methods: {
  124. // 返回列表
  125. handleBack () {
  126. this.$router.push({ path: '/financialManagement/warehousingAudit/list' })
  127. },
  128. getBizInfoDetail () {
  129. stockPutBizInfo({ putBizSn: this.$route.params.sn, putBizType: this.$route.params.type }).then(res => {
  130. if (res.status == 200) {
  131. this.bizInfo = res.data
  132. } else {
  133. this.bizInfo = null
  134. }
  135. })
  136. }
  137. },
  138. beforeRouteEnter (to, from, next) {
  139. next(vm => {
  140. vm.getBizInfoDetail()
  141. })
  142. }
  143. }
  144. </script>
  145. <style lang="less">
  146. .warehousingAuditDetail-cont{
  147. margin-bottom: 15px;
  148. }
  149. </style>