detail.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. <a-card size="small" :bordered="false" class="chainTransferOutDetail-cont">
  15. <!-- 总计 -->
  16. <a-alert type="info" showIcon style="margin-bottom:15px">
  17. <div slot="message">审核状态: <strong>支持市级</strong>,完结状态: <strong>支持市级</strong>,调出对象: <strong>支持市级</strong>,调入单号: <strong>2121212</strong>,总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> </div>
  18. </a-alert>
  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. :scroll="{ x: 1085 }"
  28. bordered>
  29. <!-- 成本小计 -->
  30. <template slot="totalCost" slot-scope="text, record">
  31. <span>{{ (record.outCost * record.outQty) || 0 }}</span>
  32. </template>
  33. </s-table>
  34. </a-card>
  35. </div>
  36. </template>
  37. <script>
  38. import { allocLinkageOutDetailList } from '@/api/allocLinkageOut'
  39. import { STable, VSelect } from '@/components'
  40. export default {
  41. components: { STable, VSelect },
  42. data () {
  43. return {
  44. queryParam: {
  45. allocationLinkageOutSn: this.$route.params.sn
  46. },
  47. disabled: false, // 查询、重置按钮是否可操作
  48. brandData: [], // 产品品牌 下拉数据
  49. typeData: [], // 产品类别 下拉数据
  50. // 表头
  51. columns: [
  52. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  53. { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  54. { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
  55. { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  56. { title: '成本价(¥)', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  57. { title: '调出仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  58. { title: '调出数量', dataIndex: 'outQty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  59. { title: '成本小计(¥)', scopedSlots: { customRender: 'totalCost' }, width: 135, align: 'center' }
  60. ],
  61. // 加载数据方法 必须为 Promise 对象
  62. loadData: parameter => {
  63. this.disabled = true
  64. return allocLinkageOutDetailList(Object.assign(parameter, this.queryParam)).then(res => {
  65. const data = res.data
  66. const no = (data.pageNo - 1) * data.pageSize
  67. for (var i = 0; i < data.list.length; i++) {
  68. data.list[i].no = no + i + 1
  69. }
  70. this.disabled = false
  71. return data
  72. })
  73. }
  74. }
  75. },
  76. methods: {
  77. // 重置
  78. resetSearchForm () {
  79. this.queryParam.orderBundleNo = ''
  80. this.queryParam.orderBundle.custMobile = ''
  81. this.queryParam.bundleName = ''
  82. this.queryParam.itemName = ''
  83. this.oldTime = undefined
  84. this.newTime = undefined
  85. this.$refs.table.refresh(true)
  86. },
  87. // 提交
  88. handleSubmit () {},
  89. // 返回列表
  90. handleBack () {
  91. this.$router.push({ path: '/allocationManagement/chainTransferOut/list' })
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="less">
  97. .chainTransferOutDetail-wrap{
  98. .chainTransferOutDetail-back{
  99. margin-bottom: 15px;
  100. }
  101. .chainTransferOutDetail-cont{
  102. margin-bottom: 15px;
  103. }
  104. }
  105. </style>