makeInventoryDetail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div class="makeInventoryDetail-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" class="makeInventoryDetail-back">
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="makeInventoryDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. <!-- 操作区,位于 title 行的行尾 -->
  9. <!-- <template slot="extra">
  10. <a-button key="1" type="primary" id="makeInventoryDetail-print-btn">快速打印</a-button>
  11. </template> -->
  12. </a-page-header>
  13. <!-- 基础信息 -->
  14. <a-card size="small" :bordered="false" class="makeInventoryDetail-cont">
  15. <a-collapse :activeKey="['1']">
  16. <a-collapse-panel key="1" header="基础信息">
  17. <a-descriptions :column="3">
  18. <a-descriptions-item label="盘点单号">箭冠营销中心</a-descriptions-item>
  19. <a-descriptions-item label="监盘审核状态">箭冠营销中心</a-descriptions-item>
  20. <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
  21. </a-descriptions>
  22. </a-collapse-panel>
  23. </a-collapse>
  24. </a-card>
  25. <!-- 详情 -->
  26. <a-card size="small" :bordered="false" class="makeInventoryDetail-cont">
  27. <a-collapse :activeKey="['1']">
  28. <a-collapse-panel key="1" header="详情">
  29. <!-- 总计 -->
  30. <a-alert type="info" style="margin-bottom:10px">
  31. <div slot="message">库存总数量: <strong>6</strong> ,盈亏总数量: <strong>6</strong></div>
  32. </a-alert>
  33. <!-- 筛选条件 -->
  34. <div class="table-page-search-wrapper">
  35. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  36. <a-row :gutter="15">
  37. <a-col :md="6" :sm="24">
  38. <a-form-item label="类型">
  39. <a-select placeholder="请选择" id="makeInventoryDetail-type" allowClear v-model="queryParam.dataSourceNo">
  40. <a-select-option v-for="item in brandData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
  41. </a-select>
  42. </a-form-item>
  43. </a-col>
  44. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  45. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="makeInventoryDetail-refresh">查询</a-button>
  46. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="makeInventoryDetail-reset">重置</a-button>
  47. </a-col>
  48. </a-row>
  49. </a-form>
  50. </div>
  51. <!-- 列表 -->
  52. <s-table
  53. class="sTable"
  54. ref="table"
  55. size="small"
  56. :rowKey="(record) => record.id"
  57. :columns="columns"
  58. :data="loadData"
  59. bordered>
  60. <!-- 采购数量 -->
  61. <template slot="purchaseNum" slot-scope="text, record">
  62. <span>{{record.purchaseNum}}</span>
  63. </template>
  64. <!-- 缺货数量 -->
  65. <template slot="outOfStockNum" slot-scope="text, record">
  66. <span>{{record.outOfStockNum}}</span>
  67. </template>
  68. </s-table>
  69. </a-collapse-panel>
  70. </a-collapse>
  71. </a-card>
  72. </div>
  73. </template>
  74. <script>
  75. import { STable, VSelect } from '@/components'
  76. export default{
  77. components: { STable, VSelect },
  78. data(){
  79. return{
  80. queryParam: {
  81. dataSourceNo: undefined
  82. },
  83. exportLoading: false, // 导出loading
  84. disabled: false, // 查询、重置按钮是否可操作
  85. // 表头
  86. columns: [
  87. { title: '序号', dataIndex: 'no', align: 'center' },
  88. { title: '产品编码', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
  89. { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
  90. { title: '单位', dataIndex: 'mementPay', align: 'center', customRender: function (text) { return text || '--' } },
  91. { title: '库存数量', scopedSlots: { customRender: 'outOfStockNum' }, align: 'center' },
  92. { title: '盘点数量', dataIndex: 'tostalP', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  93. { title: '盈亏数量', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  94. ],
  95. // 加载数据方法 必须为 Promise 对象
  96. loadData: parameter => {
  97. this.disabled = true
  98. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  99. // const data = res.data
  100. // const no = (data.pageNo - 1) * data.pageSize
  101. // for (var i = 0; i < data.list.length; i++) {
  102. // data.list[i].no = no + i + 1
  103. // }
  104. // this.disabled = false
  105. // return data
  106. // })
  107. const _this = this
  108. return new Promise(function(resolve, reject){
  109. const data = {
  110. pageNo: 1,
  111. pageSize: 10,
  112. list: [
  113. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  114. ],
  115. count: 10
  116. }
  117. const no = (data.pageNo - 1) * data.pageSize
  118. for (var i = 0; i < data.list.length; i++) {
  119. data.list[i].no = no + i + 1
  120. }
  121. _this.disabled = false
  122. resolve(data)
  123. })
  124. },
  125. brandData: []
  126. }
  127. },
  128. methods: {
  129. // 重置
  130. resetSearchForm(){},
  131. // 返回列表
  132. handleBack(){
  133. this.$router.push({ path: '/inventoryManagement/inventoryChecking/list', query: { closeLastOldTab: true }})
  134. },
  135. }
  136. }
  137. </script>
  138. <style lang="less">
  139. .makeInventoryDetail-cont, .makeInventoryDetail-back{
  140. margin-bottom: 10px;
  141. }
  142. </style>