warehouseDetail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <a-card :bordered="false" class="inventoryQueryWarehouseDetail-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  6. <a-row :gutter="48">
  7. <a-col :lg="6" :sm="12">
  8. <a-form-item label="变动类型">
  9. <a-select id="inventoryQueryWarehouseDetail-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
  10. <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
  11. </a-select>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :lg="6" :sm="12">
  15. <a-form-item label="单据类型">
  16. <a-select id="inventoryQueryWarehouseDetail-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
  17. <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
  18. </a-select>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :lg="6" :sm="12">
  22. <a-form-item label="仓库">
  23. <a-select id="inventoryQueryWarehouseDetail-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
  24. <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
  25. </a-select>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :lg="6" :sm="12">
  29. <a-form-item label="单据审核时间">
  30. <a-range-picker
  31. style="width:100%"
  32. id="inventoryQueryWarehouseDetail-bundleNamesss"
  33. :disabledDate="disabledDate"
  34. v-model="queryParam.brand"
  35. :format="dateFormat"
  36. :placeholder="['开始时间', '结束时间']" />
  37. </a-form-item>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :lg="6" :sm="12">
  41. <a-form-item label="单位名称">
  42. <a-input id="inventoryQueryWarehouseDetail-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入单位名称"/>
  43. </a-form-item>
  44. </a-col>
  45. <a-col :lg="6" :sm="12">
  46. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryWarehouseDetail-refresh">查询</a-button>
  47. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryWarehouseDetail-reset">重置</a-button>
  48. </a-col>
  49. </a-row>
  50. </a-form>
  51. </div>
  52. <!-- 合计 -->
  53. <a-alert type="info" showIcon style="margin-bottom:15px">
  54. <div class="ftext" slot="message">当前库存总数量(个):<strong>998</strong>;当前库存总成本(¥):<strong>2009.00</strong>。</div>
  55. </a-alert>
  56. <!-- 列表 -->
  57. <s-table
  58. ref="table"
  59. size="default"
  60. :rowKey="(record) => record.id"
  61. :columns="columns"
  62. :data="loadData"
  63. :showPagination="false"
  64. bordered>
  65. </s-table>
  66. <div class="footer-box">
  67. <!-- 返回列表 -->
  68. <a-button type="primary" @click="goList" id="inventoryQueryWarehouseDetail-goback-btn">返回列表</a-button>
  69. </div>
  70. </a-card>
  71. </template>
  72. <script>
  73. import moment from 'moment'
  74. // import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
  75. import { STable } from '@/components'
  76. export default {
  77. components: { STable },
  78. data () {
  79. return {
  80. labelCol: { span: 10 },
  81. wrapperCol: { span: 14 },
  82. queryParam: { // 查询条件
  83. orderBundleNo: '', // 订单编号
  84. orderBundle: {
  85. custMobile: '' // 客户手机
  86. },
  87. bundleName: '', // 套餐名称
  88. itemName: '', // 服务名称
  89. brand: undefined, // 产品品牌
  90. inventoryNum: false // 库存数量是否为0
  91. },
  92. exportLoading: false, // 导出loading
  93. disabled: false, // 查询、重置按钮是否可操作
  94. brandData: [], // 产品品牌下拉数据
  95. typeData: [], // 产品类别下拉数据
  96. dateFormat: 'YYYY-MM-DD',
  97. columns: [
  98. { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
  99. { title: '产品编码', dataIndex: 'productNum', width: 160, align: 'center' },
  100. { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true },
  101. { title: '原厂编码', dataIndex: 'productOldNum', width: 160, align: 'center' },
  102. { title: '入库批次时间', dataIndex: 'productBrand', width: 200, align: 'center' },
  103. { title: '单据类型', dataIndex: 'productBrand', width: 200, align: 'center' },
  104. { title: '单据审核时间', dataIndex: 'productBrand', width: 200, align: 'center' },
  105. { title: '单位名称', dataIndex: 'productBrand', width: 200, align: 'center' },
  106. { title: '仓库', dataIndex: 'productBrand', width: 200, align: 'center' },
  107. { title: '仓位', dataIndex: 'productBrand', width: 200, align: 'center' },
  108. { title: '数量', dataIndex: 'inventoryNum', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  109. { title: '总成本', dataIndex: 'inventoryMoney', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  110. { title: '总售价', dataIndex: 'inventoryMoneys', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  111. ],
  112. // 加载数据方法 必须为 Promise 对象
  113. loadData: parameter => {
  114. this.disabled = true
  115. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  116. // const data = res.data
  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. // return data
  123. // })
  124. const _this = this
  125. return new Promise(function(resolve, reject){
  126. console.log(111)
  127. const data = {
  128. pageNo: 1,
  129. pageSize: 10,
  130. list: [
  131. { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
  132. ]
  133. }
  134. const no = (data.pageNo - 1) * data.pageSize
  135. for (var i = 0; i < data.list.length; i++) {
  136. data.list[i].no = no + i + 1
  137. }
  138. _this.disabled = false
  139. resolve(data)
  140. })
  141. }
  142. }
  143. },
  144. methods: {
  145. // 不可选日期
  146. disabledDate (date, dateStrings) {
  147. return date && date.valueOf() > Date.now()
  148. },
  149. // 重置
  150. resetSearchForm () {
  151. this.queryParam.orderBundleNo = ''
  152. this.queryParam.orderBundle.custMobile = ''
  153. this.queryParam.bundleName = ''
  154. this.queryParam.itemName = ''
  155. this.oldTime = undefined
  156. this.newTime = undefined
  157. this.$refs.table.refresh(true)
  158. },
  159. // 返回库存查询列表
  160. goList(){
  161. this.$router.push({ path: '/inventoryManagement/inventoryQuery/list' })
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang="less">
  167. .inventoryQueryWarehouseDetail-wrap{
  168. .footer-box{
  169. margin: 50px auto 20px;
  170. text-align: center;
  171. }
  172. }
  173. </style>