screen.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view>
  3. <u-popup :show="show" closeOnClickOverlay mode="right" @close="closePopup">
  4. <view class="main">
  5. <view class="title-t1" @click="closePopup">返回</view>
  6. <view class="title-t2">列表维度</view>
  7. <listOption label="name" value="type" :list="option.dimension" v-model="form.dimension"></listOption>
  8. <view class="title-t2">资产类型</view>
  9. <listOption label="name" value="id" :list="option.code" v-model="form.categoryLevelId"></listOption>
  10. <view class="title-t2">所属仓库</view>
  11. <listOption_line class="warehouseList" label="name" value="id" :list="option.warehouseId" v-model="form.warehouseId"></listOption_line>
  12. </view>
  13. <view class="flex-buttom">
  14. <view class="s1 item" @click="reset">重置</view>
  15. <view class="s2 item" @click="submit">筛选</view>
  16. </view>
  17. </u-popup>
  18. </view>
  19. </template>
  20. <script>
  21. import { getWarehouseList, getProduceTreeByPid } from '@/api/warehouseManagement'
  22. import listOption from './listOption'
  23. import listOption_line from './listOption_line'
  24. import { post, get } from '@/utils/api.js'
  25. export default {
  26. components: {
  27. listOption,
  28. listOption_line
  29. },
  30. props: ['dimension', 'categoryLevelId', 'warehouseId'],
  31. data() {
  32. return {
  33. infoData: '',
  34. show: false,
  35. form: {
  36. // 列表维度
  37. dimension: 1,
  38. /* 资产类型 */
  39. categoryLevelId: '',
  40. /* 所属仓库 */
  41. warehouseId: ''
  42. },
  43. option: {
  44. dimension: [
  45. {
  46. name: '物品维度',
  47. type: 1
  48. },
  49. {
  50. name: '批次维度',
  51. type: 2
  52. },
  53. {
  54. name: '包装维度',
  55. type: 3
  56. }
  57. ],
  58. code: [],
  59. warehouseId: []
  60. }
  61. }
  62. },
  63. created() {
  64. this.getwarehouseList()
  65. this.getClassify()
  66. },
  67. methods: {
  68. open() {
  69. this.show = true
  70. for (let key of Object.keys(this.form)) {
  71. this.form[key] = this[key]
  72. }
  73. },
  74. closePopup() {
  75. this.show = false
  76. },
  77. reset() {
  78. this.form = {
  79. dimension: 1,
  80. categoryLevelId: '',
  81. warehouseId: ''
  82. }
  83. this.$emit('succeed', this.form)
  84. this.closePopup()
  85. },
  86. submit() {
  87. this.$emit('succeed', this.form)
  88. this.closePopup()
  89. },
  90. //获取仓库
  91. getwarehouseList() {
  92. getWarehouseList().then(res => {
  93. this.option.warehouseId = res.data
  94. })
  95. // post(this.apiUrl + '/warehouseGoodsshelves/select/warehouseList').then(
  96. // res => {
  97. // if (res.success) {
  98. // this.option.warehouseId = res.data
  99. // .filter(i => !i.isDelete && !!i.status)
  100. // .map(n => {
  101. // return {
  102. // name: n.name,
  103. // id: n.id
  104. // }
  105. // })
  106. // }
  107. // }
  108. // )
  109. },
  110. // 获取资产类型
  111. getClassify() {
  112. getProduceTreeByPid({ type: 2 }).then(res => {
  113. this.option.code = res
  114. })
  115. // get(this.apiUrl + '/classify/getClassify?id=0').then(res => {
  116. // if (res.success) {
  117. // this.option.code = res.data.map(n => {
  118. // return {
  119. // name: n.name,
  120. // type: n.type
  121. // }
  122. // })
  123. // this.form.code = this.option.code[0].type
  124. // this.submit()
  125. // }
  126. // })
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .main {
  133. height: 100vh;
  134. width: 600rpx;
  135. position: relative;
  136. padding-bottom: 80rpx;
  137. box-sizing: border-box;
  138. overflow: hidden;
  139. display: flex;
  140. flex-direction: column;
  141. .warehouseList {
  142. flex: 1;
  143. overflow-y: auto;
  144. }
  145. }
  146. .title-t1 {
  147. font-size: 32rpx;
  148. font-weight: bold;
  149. padding: 30rpx;
  150. }
  151. .title-t2 {
  152. font-size: 28rpx;
  153. font-weight: bold;
  154. padding: 20rpx 30rpx;
  155. }
  156. .flex-buttom {
  157. position: absolute;
  158. bottom: 0;
  159. left: 0;
  160. width: 100%;
  161. display: flex;
  162. background-color: #fff;
  163. box-shadow: 0px -5px 5px rgba(0, 0, 0, 0.0901960784313725);
  164. .item {
  165. flex: 1;
  166. height: 80rpx;
  167. color: #157a2c;
  168. font-size: 28rpx;
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. &.s2 {
  173. background-color: #157a2c;
  174. color: #fff;
  175. }
  176. }
  177. }
  178. </style>