warehousing.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="purchaseOrderWarehousing-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="purchaseOrderWarehousing-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. </a-page-header>
  9. <!-- 内容 -->
  10. <a-page-header title="单号:CG2021010100001" ></a-page-header>
  11. <a-card size="small" :bordered="false" class="purchaseOrderWarehousing-cont">
  12. <!-- 搜索条件 -->
  13. <div class="table-page-search-wrapper">
  14. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  15. <a-row :gutter="15">
  16. <a-col :md="6" :sm="24">
  17. <a-form-item label="关键词">
  18. <a-input id="purchaseOrderWarehousing-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="产品名称/产品编码/原厂编码"/>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :md="6" :sm="24">
  22. <a-form-item label="产品品牌">
  23. <a-select
  24. placeholder="请选择"
  25. id="purchaseOrderWarehousing-state"
  26. allowClear
  27. v-model="queryParam.dataSourceNo"
  28. :showSearch="true"
  29. option-filter-prop="children"
  30. :filter-option="filterOption">
  31. <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
  32. </a-select>
  33. </a-form-item>
  34. </a-col>
  35. <a-col :md="6" :sm="24">
  36. <a-form-item label="产品类别">
  37. <a-cascader :options="typeData" expand-trigger="hover" id="purchaseOrderWarehousing-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderWarehousing-refresh">查询</a-button>
  42. <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderWarehousing-reset">重置</a-button>
  43. </a-col>
  44. </a-row>
  45. </a-form>
  46. </div>
  47. <!-- 总计 -->
  48. <a-alert type="info" showIcon style="margin-bottom:15px">
  49. <div slot="message">产品款数 <strong>6</strong> ,采购数量合计 <strong>6</strong> ,采购金额合计¥<strong>6.33</strong></div>
  50. </a-alert>
  51. <!-- 列表 -->
  52. <s-table
  53. class="sTable"
  54. ref="table"
  55. size="default"
  56. :rowKey="(record) => record.id"
  57. :columns="columns"
  58. :data="loadData"
  59. :scroll="{ x: 1360 }"
  60. bordered>
  61. <!-- 入库数量 -->
  62. <template slot="storageQuantity" slot-scope="text, record">
  63. <span>{{ record.storageQuantity }}</span>
  64. <a-input-number
  65. id="purchaseOrderWarehousing-storageQuantity"
  66. :value="record.storageQuantity"
  67. :precision="0"
  68. :min="0"
  69. :max="999999"
  70. placeholder="请输入" />
  71. </template>
  72. <!-- 仓库仓位 -->
  73. <template slot="warehousePosition" slot-scope="text, record">
  74. <a-cascader :options="typeData" expand-trigger="hover" id="purchaseOrderWarehousing-state" placeholder="请选择" allowClear v-model="record.brand" />
  75. </template>
  76. </s-table>
  77. </a-card>
  78. <a-affix :offset-bottom="0">
  79. <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
  80. <a-button type="primary" id="purchaseOrderWarehousing-warehousing" size="large" @click="handleWarehousing" style="padding: 0 60px;">确认入库</a-button>
  81. </div>
  82. </a-affix>
  83. </div>
  84. </template>
  85. <script>
  86. import { STable, VSelect } from '@/components'
  87. export default {
  88. components: { STable, VSelect },
  89. data () {
  90. return {
  91. queryParam: {
  92. },
  93. brandData: [], // 产品品牌 下拉数据
  94. typeData: [], // 产品类别 下拉数据
  95. disabled: false, // 查询、重置按钮是否可操作
  96. // 表头
  97. columns: [
  98. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  99. { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  100. { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
  101. { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  102. { title: '采购单价', dataIndex: 'totalNums', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  103. { title: '采购数量', scopedSlots: { customRender: 'purchaseNum' }, width: 100, align: 'center' },
  104. { title: '缺货数量', scopedSlots: { customRender: 'outOfStockNum' }, width: 100, align: 'center' },
  105. { title: '单位', dataIndex: 'mementPay', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  106. { title: '采购金额', dataIndex: 'shDate', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  107. { title: '入库数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
  108. { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: 150, align: 'center' }
  109. ],
  110. // 加载数据方法 必须为 Promise 对象
  111. loadData: parameter => {
  112. this.disabled = true
  113. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  114. // const data = res.data
  115. // const no = (data.pageNo - 1) * data.pageSize
  116. // for (var i = 0; i < data.list.length; i++) {
  117. // data.list[i].no = no + i + 1
  118. // }
  119. // this.disabled = false
  120. // return data
  121. // })
  122. const _this = this
  123. return new Promise(function (resolve, reject) {
  124. const data = {
  125. pageNo: 1,
  126. pageSize: 10,
  127. list: [
  128. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  129. ],
  130. count: 10
  131. }
  132. const no = (data.pageNo - 1) * data.pageSize
  133. for (var i = 0; i < data.list.length; i++) {
  134. data.list[i].no = no + i + 1
  135. }
  136. _this.disabled = false
  137. resolve(data)
  138. })
  139. }
  140. }
  141. },
  142. methods: {
  143. // 重置
  144. resetSearchForm () {
  145. this.queryParam.orderBundleNo = ''
  146. this.queryParam.orderBundle.custMobile = ''
  147. this.queryParam.bundleName = ''
  148. this.queryParam.itemName = ''
  149. this.oldTime = undefined
  150. this.newTime = undefined
  151. this.$refs.table.refresh(true)
  152. },
  153. // 确认入库
  154. handleWarehousing () {
  155. },
  156. // 返回列表
  157. handleBack () {
  158. this.$router.push({ path: '/purchasingManagement/purchaseOrder/list' })
  159. },
  160. filterOption (input, option) {
  161. return (
  162. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  163. )
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="less">
  169. .purchaseOrderWarehousing-wrap{
  170. .btn-cont {
  171. text-align: center;
  172. margin: 35px 0 10px;
  173. }
  174. }
  175. </style>