detail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="chainTransferOutDetail-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" class="chainTransferOutDetail-back">
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="chainTransferOutDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. <!-- 操作区,位于 title 行的行尾 -->
  9. <template slot="extra">
  10. <a-button key="2" id="chainTransferOutDetail-preview-btn">打印预览</a-button>
  11. <a-button key="1" type="primary" id="chainTransferOutDetail-print-btn">快速打印</a-button>
  12. </template>
  13. </a-page-header>
  14. <!-- 总计 -->
  15. <a-alert type="info" showIcon style="margin-bottom:15px">
  16. <div slot="message">审核状态: <strong>支持市级</strong>,完结状态: <strong>支持市级</strong>,调出对象: <strong>支持市级</strong>,调入单号: <strong>2121212</strong>,总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> </div>
  17. </a-alert>
  18. <a-card :bordered="false" class="chainTransferOutDetail-cont">
  19. <!-- 列表 -->
  20. <s-table
  21. class="sTable"
  22. ref="table"
  23. size="default"
  24. :rowKey="(record) => record.id"
  25. :columns="columns"
  26. :data="loadData"
  27. bordered>
  28. <!-- 成本小计 -->
  29. <template slot="costSubtotal" slot-scope="text, record">
  30. <span>{{(record.outCost * record.outQty) || 0}}</span>
  31. </template>
  32. </s-table>
  33. </a-card>
  34. </div>
  35. </template>
  36. <script>
  37. import { allocLinkageOutDetailList } from '@/api/allocLinkageOut'
  38. import { STable, VSelect } from '@/components'
  39. export default{
  40. components: { STable, VSelect },
  41. data(){
  42. return{
  43. queryParam: {
  44. allocationLinkageOutSn: this.$route.params.sn
  45. },
  46. disabled: false, // 查询、重置按钮是否可操作
  47. brandData: [], // 产品品牌 下拉数据
  48. typeData: [], // 产品类别 下拉数据
  49. // 表头
  50. columns: [
  51. { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
  52. { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
  53. { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
  54. { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' } },
  55. { title: '成本价', dataIndex: 'outCost', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  56. { title: '调出仓库', dataIndex: 'warehouseName', align: 'center', customRender: function (text) { return text || '--' } },
  57. { title: '调出数量', dataIndex: 'outQty', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  58. { title: '成本小计(¥)', scopedSlots: { customRender: 'costSubtotal' }, align: 'center' },
  59. ],
  60. // 加载数据方法 必须为 Promise 对象
  61. loadData: parameter => {
  62. this.disabled = true
  63. return allocLinkageOutDetailList( Object.assign(parameter, this.queryParam) ).then(res => {
  64. const data = res.data
  65. const no = (data.pageNo - 1) * data.pageSize
  66. for (var i = 0; i < data.list.length; i++) {
  67. data.list[i].no = no + i + 1
  68. }
  69. this.disabled = false
  70. return data
  71. })
  72. },
  73. }
  74. },
  75. methods: {
  76. // 重置
  77. resetSearchForm () {
  78. this.queryParam.orderBundleNo = ''
  79. this.queryParam.orderBundle.custMobile = ''
  80. this.queryParam.bundleName = ''
  81. this.queryParam.itemName = ''
  82. this.oldTime = undefined
  83. this.newTime = undefined
  84. this.$refs.table.refresh(true)
  85. },
  86. // 提交
  87. handleSubmit(){},
  88. // 返回列表
  89. handleBack(){
  90. this.$router.push({ path: '/allocationManagement/chainTransferOut/list'})
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="less">
  96. .chainTransferOutDetail-wrap{
  97. .chainTransferOutDetail-back{
  98. margin-bottom: 15px;
  99. }
  100. .chainTransferOutDetail-cont{
  101. margin-bottom: 15px;
  102. }
  103. }
  104. </style>