detail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="bulkWarehousingOrderDetail-wrap">
  3. <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderDetail-cont" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="bulkWarehousingOrderDetail-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.sparePartsPurchaseSn) || '' }}</p>
  8. </template>
  9. <template slot="tags">
  10. <a-tag color="purple" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>
  11. <a-tag color="orange" v-if="basicInfoData&&basicInfoData.settleStateDictValue">{{ basicInfoData.settleStateDictValue }}</a-tag>
  12. </template>
  13. <!-- 操作区,位于 title 行的行尾 -->
  14. <template slot="extra">
  15. <a-button key="2" id="bulkWarehousingOrderDetail-preview-btn">打印预览</a-button>
  16. <a-button key="1" type="primary" id="bulkWarehousingOrderDetail-print-btn">快速打印</a-button>
  17. </template>
  18. </a-page-header>
  19. <!-- 基础信息 -->
  20. <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
  21. <a-collapse :activeKey="['1']">
  22. <a-collapse-panel key="1" header="基础信息">
  23. <a-descriptions :column="3">
  24. <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
  25. <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
  26. <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
  27. <a-descriptions-item label="联系人">
  28. {{ (basicInfoData&&basicInfoData.supplierContactPerson) || '--' }}
  29. <span v-if="basicInfoData&&basicInfoData.supplierContactTel">({{ basicInfoData.supplierContactTel }})</span>
  30. </a-descriptions-item>
  31. <a-descriptions-item label="联系地址">
  32. {{ (basicInfoData&&basicInfoData.supplierProvinceName) || '' }}
  33. {{ (basicInfoData&&basicInfoData.supplierCityName) || '' }}
  34. {{ (basicInfoData&&basicInfoData.supplierCountyName) || '' }}
  35. {{ (basicInfoData&&basicInfoData.supplierAddress) || '' }}
  36. </a-descriptions-item>
  37. </a-descriptions>
  38. </a-collapse-panel>
  39. </a-collapse>
  40. </a-card>
  41. <!-- 产品详情 -->
  42. <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
  43. <a-collapse :activeKey="['1']">
  44. <a-collapse-panel key="1" header="产品详情">
  45. <!-- 总计 -->
  46. <a-alert type="info" showIcon style="margin-bottom:15px">
  47. <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
  48. </a-alert>
  49. <!-- 列表 -->
  50. <s-table
  51. class="sTable"
  52. ref="table"
  53. size="small"
  54. :rowKey="(record) => record.id"
  55. :columns="columns"
  56. :data="loadData"
  57. :scroll="{ x: 1280 }"
  58. bordered>
  59. <!-- 采购数量 -->
  60. <template slot="purchaseNum" slot-scope="text, record">
  61. <span>{{ record.purchaseNum }}</span>
  62. </template>
  63. <!-- 缺货数量 -->
  64. <template slot="outOfStockNum" slot-scope="text, record">
  65. <span>{{ record.outOfStockNum }}</span>
  66. </template>
  67. </s-table>
  68. </a-collapse-panel>
  69. </a-collapse>
  70. </a-card>
  71. <!-- 单据记录 -->
  72. <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
  73. <a-collapse :activeKey="['1']">
  74. <a-collapse-panel key="1" header="单据记录">
  75. <a-timeline class="timeline-box">
  76. <a-timeline-item>2021-02-01 15:22:38 王凯 审核通过</a-timeline-item>
  77. <a-timeline-item>
  78. <p>2021-02-01 15:22:38 王凯 审核通过</p>
  79. <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
  80. <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
  81. </a-timeline-item>
  82. <a-timeline-item>Technical testing 2015-09-01</a-timeline-item>
  83. <a-timeline-item>Network problems being solved 2015-09-01</a-timeline-item>
  84. </a-timeline>
  85. </a-collapse-panel>
  86. </a-collapse>
  87. </a-card>
  88. </div>
  89. </template>
  90. <script>
  91. import { STable, VSelect } from '@/components'
  92. import { getOperationalPrecision } from '@/libs/tools.js'
  93. import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount } from '@/api/sparePartsPur'
  94. export default {
  95. components: { STable, VSelect },
  96. data () {
  97. return {
  98. // 表头
  99. columns: [
  100. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  101. { title: '产品编码', dataIndex: 'productCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
  102. { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
  103. { title: '采购单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  104. { title: '采购数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  105. { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  106. { title: '采购金额', dataIndex: 'purchaseAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  107. { title: '仓库', dataIndex: 'warehouseName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
  108. { title: '仓位', dataIndex: 'warehouseLocationName', width: 200, align: 'center', customRender: function (text) { return text || '--' } }
  109. ],
  110. // 加载数据方法 必须为 Promise 对象
  111. loadData: parameter => {
  112. this.disabled = true
  113. return sparePartsPurDetailList(Object.assign(parameter, { sparePartsPurchaseSn: this.$route.params.sn })).then(res => {
  114. const data = res.data
  115. const no = (data.pageNo - 1) * data.pageSize
  116. for (var i = 0; i < data.list.length; i++) {
  117. data.list[i].no = no + i + 1
  118. // 采购金额 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
  119. data.list[i].purchaseAmount = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
  120. }
  121. this.disabled = false
  122. return data
  123. })
  124. },
  125. basicInfoData: null, // 基本信息
  126. productTotal: null // 合计
  127. }
  128. },
  129. methods: {
  130. // 返回列表
  131. handleBack () {
  132. this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
  133. },
  134. // 基本信息
  135. getDetail () {
  136. sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
  137. if (res.status == 200) {
  138. this.basicInfoData = res.data
  139. } else {
  140. this.basicInfoData = null
  141. }
  142. })
  143. },
  144. // 合计
  145. getDetailCount () {
  146. sparePartsPurDetailCount({ sparePartsPurchaseSn: this.$route.params.sn }).then(res => {
  147. if (res.status == 200) {
  148. this.productTotal = res.data
  149. } else {
  150. this.productTotal = null
  151. }
  152. })
  153. }
  154. },
  155. beforeRouteEnter (to, from, next) {
  156. next(vm => {
  157. vm.getDetail()
  158. vm.getDetailCount()
  159. })
  160. }
  161. }
  162. </script>
  163. <style lang="less">
  164. .bulkWarehousingOrderDetail-cont{
  165. margin-bottom: 15px;
  166. .timeline-box{
  167. margin-top: 30px;
  168. .auxiliary-txt{
  169. color: #808695;
  170. }
  171. }
  172. }
  173. </style>