stockOrderDetail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="signWarehousingDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="signWarehousingDetail-cont" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="signWarehousingDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. <span class="billno">
  9. 单号:{{ detail&&detail.purchaseBillNo }}
  10. <span v-if="detail&&detail.sendBillNo">(备货单号:{{ detail&&detail.sendBillNo || '--' }})</span>
  11. </span>
  12. </template>
  13. <!-- 操作区,位于 title 行的行尾 -->
  14. <template slot="extra">
  15. <!-- <Print v-if="$hasPermissions('B_purchasePrint')" :disabled="localDataSource.length==0" @handlePrint="handlePrint"></Print> -->
  16. <a-button
  17. key="1"
  18. type="primary"
  19. class="button-warning"
  20. id="signWarehousingDetail-export-btn"
  21. :disabled="localDataSource.length==0"
  22. @click="handleExportProduct()">导出Excel</a-button>
  23. </template>
  24. </a-page-header>
  25. <!-- 基础信息 -->
  26. <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
  27. <a-collapse :activeKey="['1']">
  28. <a-collapse-panel key="1" header="基础信息">
  29. <a-descriptions :column="3">
  30. <a-descriptions-item label="供应商">{{ (detail&&detail.purchaseTargetName) || '--' }}</a-descriptions-item>
  31. <a-descriptions-item label="支付方式">{{ (detail&&detail.settleStyleEntity&&detail.settleStyleEntity.name) || '--' }}</a-descriptions-item>
  32. <a-descriptions-item label="采购员工" v-if="detail&&detail.purchaseBillSource=='PURCHASE'">{{ detail&&detail.operatorName || '--' }}</a-descriptions-item>
  33. <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName || '--' }}<span v-if="detail&&detail.consigneeTel">({{ detail&&detail.consigneeTel }})</span></a-descriptions-item>
  34. <a-descriptions-item label="收货地址">
  35. <div v-if="detail&&(detail.shippingAddressProvinceName || detail.shippingAddressCityName || detail.shippingAddressCountyName || detail.shippingAddress)">
  36. {{ detail&&detail.shippingAddressProvinceName || '' }}
  37. {{ detail&&detail.shippingAddressCityName || '' }}
  38. {{ detail&&detail.shippingAddressCountyName || '' }}
  39. {{ detail&&detail.shippingAddress || '' }}
  40. </div>
  41. <span v-else>--</span>
  42. </a-descriptions-item>
  43. </a-descriptions>
  44. </a-collapse-panel>
  45. </a-collapse>
  46. </a-card>
  47. <a-card size="small" :bordered="false" class="signWarehousingDetail-cont">
  48. <!-- 总计 -->
  49. <a-alert type="info" style="margin-bottom:10px">
  50. <div slot="message">
  51. 产品款数:<strong>{{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }}</strong>,
  52. 本次发货数量合计:<strong>{{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }}</strong>,
  53. 本次发货金额合计:<strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? '¥'+detail.discountedAmount : '--' }}</strong>,
  54. </div>
  55. </a-alert>
  56. <!-- 列表 -->
  57. <s-table
  58. class="sTable"
  59. ref="table"
  60. size="small"
  61. :rowKey="(record) => record.id"
  62. :columns="columns"
  63. :data="loadData"
  64. :defaultLoadData="false"
  65. bordered>
  66. <!-- 采购数量 -->
  67. <template slot="origqty" slot-scope="text, record">
  68. <div>{{ text }}</div>
  69. <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
  70. </template>
  71. <!-- 缺货数量 -->
  72. <template slot="outOfStockNum" slot-scope="text, record">
  73. <span>{{ record.outOfStockNum }}</span>
  74. </template>
  75. </s-table>
  76. </a-card>
  77. </a-spin>
  78. </div>
  79. </template>
  80. <script>
  81. import moment from 'moment'
  82. import { STable, VSelect } from '@/components'
  83. import { purchaseDetailPrint, purchaseDetailExport, purchaseExportDetail } from '@/api/purchase'
  84. import { receivingDetailSn, receivingDetailList, receivingExport } from '@/api/receiving'
  85. import Print from '@/views/common/print.vue'
  86. import { hdPrint } from '@/libs/JGPrint'
  87. export default {
  88. components: { STable, VSelect, Print },
  89. data () {
  90. return {
  91. spinning: false,
  92. // 表头
  93. columns: [
  94. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  95. { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
  96. { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  97. { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
  98. { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  99. { title: '采购数量', dataIndex: 'qty', width: '6%', align: 'center', scopedSlots: { customRender: 'origqty' } },
  100. { title: '本次发货数量', dataIndex: 'shippedQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  101. { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  102. { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  103. { title: '本次入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } }
  104. ],
  105. // 加载数据方法 必须为 Promise 对象
  106. loadData: parameter => {
  107. this.disabled = true
  108. return receivingDetailList(Object.assign(parameter, { receivingBillSn: this.$route.params.sn })).then(res => {
  109. const data = res.data
  110. const no = (data.pageNo - 1) * data.pageSize
  111. for (var i = 0; i < data.list.length; i++) {
  112. data.list[i].no = no + i + 1
  113. }
  114. this.localDataSource = data.list
  115. this.disabled = false
  116. return data
  117. })
  118. },
  119. detail: null, // 详情数据
  120. localDataSource: [],
  121. printerType: 'NEEDLE' // 打印机类型
  122. }
  123. },
  124. methods: {
  125. // 返回列表
  126. handleBack () {
  127. this.$router.push({ path: '/purchasingManagement/signWarehousing/list', query: { closeLastOldTab: true } })
  128. },
  129. // 详情
  130. getDetail () {
  131. receivingDetailSn({ sn: this.$route.params.sn }).then(res => {
  132. if (res.status == 200) {
  133. this.detail = res.data
  134. } else {
  135. this.detail = null
  136. }
  137. })
  138. },
  139. // 打印预览/快捷打印
  140. handlePrint (type, printerType) {
  141. const _this = this
  142. _this.spinning = true
  143. let url = purchaseDetailPrint
  144. let params = { sn: this.$route.params.sn, type: printerType }
  145. if (type == 'export') { // 导出
  146. url = purchaseExportDetail
  147. params = { sn: this.$route.params.sn }
  148. }
  149. // 打印或导出
  150. hdPrint(printerType, type, url, params, '备货单', function () {
  151. _this.spinning = false
  152. })
  153. },
  154. // 导出产品
  155. handleExportProduct () {
  156. const _this = this
  157. _this.spinning = true
  158. // 打印或导出
  159. hdPrint('', 'export', receivingExport, { sn: this.$route.params.sn }, '备货单', function () {
  160. _this.spinning = false
  161. })
  162. }
  163. },
  164. mounted () {
  165. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  166. this.$refs.table.refresh(true)
  167. this.getDetail()
  168. }
  169. },
  170. activated () {
  171. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  172. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  173. this.$refs.table.refresh(true)
  174. this.getDetail()
  175. }
  176. },
  177. beforeRouteEnter (to, from, next) {
  178. next(vm => {})
  179. }
  180. }
  181. </script>
  182. <style lang="less">
  183. .signWarehousingDetail-cont{
  184. margin-bottom: 10px;
  185. .timeline-box{
  186. margin-top: 30px;
  187. .auxiliary-txt{
  188. color: #808695;
  189. }
  190. }
  191. }
  192. .signWarehousingDetail-wrap{
  193. .billno{
  194. font-size: 16px;
  195. font-weight: bold;
  196. margin: 0 15px;
  197. }
  198. }
  199. </style>