screenAccess.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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="140" labelAlign="left" class="baseForm"
  6. v-if="dataSources == 0">
  7. <u-form-item label="仓库名称:" class="item-form" borderBottom prop="assetType">
  8. <uni-data-select v-model="form.warehouseId" :clear="false" :localdata="warehouseList">
  9. </uni-data-select>
  10. </u-form-item>
  11. <u-form-item label="物品编码:" class="item-form" borderBottom prop="assetType">
  12. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.categoryCode"
  13. placeholder="请输入">
  14. </uni-easyinput>
  15. </u-form-item>
  16. <u-form-item label="物品名称:" class="item-form" borderBottom prop="assetType">
  17. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.categoryName"
  18. placeholder="请输入">
  19. </uni-easyinput>
  20. </u-form-item>
  21. <u-form-item label="批次号:" class="item-form" borderBottom prop="assetType">
  22. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.batchNo"
  23. placeholder="请输入">
  24. </uni-easyinput>
  25. </u-form-item>
  26. <u-form-item label="刻码:" class="item-form" borderBottom prop="assetType">
  27. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.engrave"
  28. placeholder="请输入">
  29. </uni-easyinput>
  30. </u-form-item>
  31. <u-form-item label="发货码:" class="item-form" borderBottom prop="assetType">
  32. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.barcodes"
  33. placeholder="请输入">
  34. </uni-easyinput>
  35. </u-form-item>
  36. <u-form-item label="牌号:" class="item-form" borderBottom prop="assetType">
  37. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.brandNum"
  38. placeholder="请输入">
  39. </uni-easyinput>
  40. </u-form-item>
  41. </u-form>
  42. <u-form labelPosition="left" :model="mainForm" labelWidth="140" labelAlign="left" class="baseForm"
  43. v-if="dataSources == 1">
  44. <u-form-item label="编码:" class="item-form" borderBottom prop="assetType">
  45. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="mainForm.code"
  46. placeholder="请输入">
  47. </uni-easyinput>
  48. </u-form-item>
  49. <u-form-item label="名称:" class="item-form" borderBottom prop="assetType">
  50. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="mainForm.name"
  51. placeholder="请输入">
  52. </uni-easyinput>
  53. </u-form-item>
  54. <u-form-item label="型号:" class="item-form" borderBottom prop="assetType">
  55. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="mainForm.modelType"
  56. placeholder="请输入">
  57. </uni-easyinput>
  58. </u-form-item>
  59. <u-form-item label="牌号:" class="item-form" borderBottom prop="assetType">
  60. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="mainForm.brandNum"
  61. placeholder="请输入">
  62. </uni-easyinput>
  63. </u-form-item>
  64. <u-form-item label="规格:" class="item-form" borderBottom prop="assetType">
  65. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="mainForm.specification"
  66. placeholder="请输入">
  67. </uni-easyinput>
  68. </u-form-item>
  69. </u-form>
  70. </view>
  71. <view class="operate_box rx-bc">
  72. <u-button size="small" class="u-reset-button" @click="show = false">
  73. 取消
  74. </u-button>
  75. <u-button size="small" class="u-reset-button" @click="reset">
  76. 重置
  77. </u-button>
  78. <u-button type="success" size="small" class="u-reset-button" @click="submit">
  79. 确定
  80. </u-button>
  81. </view>
  82. </u-popup>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. getWarehouseList
  88. } from '@/api/salesServiceManagement/workOrder/index.js'
  89. export default {
  90. components: {},
  91. props: {
  92. dataSources: {
  93. type: String,
  94. default: ''
  95. }
  96. },
  97. data() {
  98. return {
  99. form: {
  100. warehouseId: "",
  101. categoryCode: "",
  102. categoryName: "",
  103. batchNo: '',
  104. engrave: '',
  105. barcodes: '',
  106. brandNum: ''
  107. },
  108. mainForm: {
  109. code: '',
  110. name: '',
  111. modelType: '',
  112. brandNum: '',
  113. specification: ''
  114. },
  115. show: false,
  116. warehouseList: []
  117. }
  118. },
  119. created() {
  120. this.getSearchData();
  121. },
  122. methods: {
  123. getSearchData() {
  124. console.log(this.dataSources, 'dataSources ---')
  125. if (this.dataSources == '1') return
  126. getWarehouseList({}).then((res) => {
  127. this.warehouseList = res.map(item => {
  128. item.text = item.name
  129. item.value = item.id
  130. return item
  131. })
  132. });
  133. },
  134. open() {
  135. this.show = true;
  136. },
  137. closePopup() {
  138. },
  139. reset() {
  140. if (this.dataSources == '1') {
  141. this.mainForm = {
  142. code: '',
  143. name: '',
  144. modelType: '',
  145. brandNum: '',
  146. specification: ''
  147. }
  148. } else {
  149. this.form = {
  150. warehouseId: "",
  151. categoryCode: "",
  152. categoryName: "",
  153. batchNo: '',
  154. engrave: '',
  155. barcodes: '',
  156. brandNum: ''
  157. }
  158. }
  159. this.submit();
  160. },
  161. submit() {
  162. if (this.dataSources == '1') {
  163. this.$emit('succeed', this.mainForm);
  164. } else {
  165. this.$emit('succeed', this.form);
  166. }
  167. this.show = false;
  168. },
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. .search_list {
  174. padding: 0 20rpx;
  175. }
  176. .operate_box {
  177. padding: 10rpx 32rpx;
  178. /deep/ .u-button {
  179. width: 30%;
  180. }
  181. }
  182. .item-form {
  183. /deep/ .u-form-item__body__left__content__label {
  184. font-size: 28rpx;
  185. }
  186. }
  187. </style>