screen.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view>
  3. <u-popup :show="show" closeOnClickOverlay mode="top" @close="closePopup">
  4. <view class="search_list">
  5. <u-form labelPosition="left" :model="form" labelWidth="180" labelAlign="left" class="baseForm">
  6. <u-form-item label="列表维度:" class="required-form" borderBottom prop="assetType">
  7. <zxz-uni-data-select :localdata="option.dimension" v-model="form.dimension" dataValue='type'
  8. dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  9. </u-form-item>
  10. <u-form-item label="资产类型:" class="required-form" borderBottom prop="categoryLevelId">
  11. <zxz-uni-data-select :localdata="option.code" v-model="form.categoryLevelId" dataValue='id'
  12. dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  13. </u-form-item>
  14. <u-form-item label="所属仓库:" class="required-form" borderBottom prop="warehouseId">
  15. <zxz-uni-data-select :localdata="option.warehouseId" v-model="form.warehouseId" dataValue='id'
  16. dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  17. </u-form-item>
  18. </u-form>
  19. </view>
  20. <view class="operate_box rx-bc">
  21. <u-button size="small" class="u-reset-button" @click="reset">
  22. 重置
  23. </u-button>
  24. <u-button type="success" size="small" class="u-reset-button" @click="submit">
  25. 确定
  26. </u-button>
  27. </view>
  28. </u-popup>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. getWarehouseList,
  34. getProduceTreeByPid
  35. } from '@/api/warehouseManagement'
  36. import {
  37. post,
  38. get
  39. } from '@/utils/api.js'
  40. export default {
  41. components: {},
  42. props: ['dimension', 'categoryLevelId', 'warehouseId'],
  43. data() {
  44. return {
  45. infoData: '',
  46. show: false,
  47. form: {
  48. // 列表维度
  49. dimension: 1,
  50. /* 资产类型 */
  51. categoryLevelId: '',
  52. /* 所属仓库 */
  53. warehouseId: ''
  54. },
  55. option: {
  56. dimension: [{
  57. name: '物品维度',
  58. type: 1
  59. },
  60. {
  61. name: '批次维度',
  62. type: 2
  63. },
  64. {
  65. name: '包装维度',
  66. type: 3
  67. }
  68. ],
  69. code: [],
  70. warehouseId: []
  71. }
  72. }
  73. },
  74. created() {
  75. this.getwarehouseList()
  76. this.getClassify()
  77. },
  78. methods: {
  79. open() {
  80. this.show = true
  81. for (let key of Object.keys(this.form)) {
  82. this.form[key] = this[key]
  83. }
  84. },
  85. closePopup() {
  86. this.show = false
  87. },
  88. reset() {
  89. this.form = {
  90. dimension: 1,
  91. categoryLevelId: '',
  92. warehouseId: ''
  93. }
  94. this.$emit('succeed', this.form)
  95. this.closePopup()
  96. },
  97. submit() {
  98. this.$emit('succeed', this.form)
  99. this.closePopup()
  100. },
  101. //获取仓库
  102. getwarehouseList() {
  103. getWarehouseList().then(res => {
  104. this.option.warehouseId = res.data
  105. })
  106. // post(this.apiUrl + '/warehouseGoodsshelves/select/warehouseList').then(
  107. // res => {
  108. // if (res.success) {
  109. // this.option.warehouseId = res.data
  110. // .filter(i => !i.isDelete && !!i.status)
  111. // .map(n => {
  112. // return {
  113. // name: n.name,
  114. // id: n.id
  115. // }
  116. // })
  117. // }
  118. // }
  119. // )
  120. },
  121. // 获取资产类型
  122. getClassify() {
  123. getProduceTreeByPid({
  124. type: 2
  125. }).then(res => {
  126. this.option.code = res
  127. })
  128. // get(this.apiUrl + '/classify/getClassify?id=0').then(res => {
  129. // if (res.success) {
  130. // this.option.code = res.data.map(n => {
  131. // return {
  132. // name: n.name,
  133. // type: n.type
  134. // }
  135. // })
  136. // this.form.code = this.option.code[0].type
  137. // this.submit()
  138. // }
  139. // })
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .search_list {
  146. min-height: 100rpx;
  147. /deep/ .baseForm {
  148. padding: 0 20rpx;
  149. }
  150. }
  151. .operate_box {
  152. padding: 10rpx 32rpx;
  153. /deep/ .u-button {
  154. width: 40%;
  155. }
  156. }
  157. </style>