categoryPopup.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <u-popup
  3. :show="show"
  4. mode="center"
  5. @close="close"
  6. @open="open"
  7. :round="10"
  8. :closeOnClickOverlay="false"
  9. :safeAreaInsetBottom="false"
  10. width="580rpx"
  11. >
  12. <view class="location-edit-popup">
  13. <view class="popup-header">
  14. <text class="popup-title">修改库位</text>
  15. <u-icon name="close" size="20" @click="close"></u-icon>
  16. </view>
  17. <u-form
  18. :model="formData"
  19. ref="locationForm"
  20. labelPosition="top"
  21. labelWidth="100%"
  22. :borderBottom="false"
  23. >
  24. <u-form-item label="原库位" prop="originLocation" :borderBottom="false">
  25. <u--input
  26. v-model="formData.originLocation"
  27. border="surround"
  28. placeholder="请输入原库位"
  29. height="80rpx"
  30. disabled
  31. fontSize="28rpx"
  32. color="#333333"
  33. ></u--input>
  34. </u-form-item>
  35. <u-form-item
  36. label="新库位"
  37. prop="newLocation"
  38. :borderBottom="false"
  39. class="mt-20"
  40. >
  41. <u--input
  42. v-model="formData.newLocation"
  43. border="surround"
  44. placeholder="请输入新库位"
  45. height="80rpx"
  46. clearable
  47. fontSize="28rpx"
  48. color="#333333"
  49. ></u--input>
  50. </u-form-item>
  51. </u-form>
  52. <view class="btn-group">
  53. <u-button
  54. class="btn cancel-btn"
  55. :plain="true"
  56. shape="square"
  57. @click="onCancel"
  58. >取消</u-button
  59. >
  60. <u-button
  61. class="btn confirm-btn"
  62. type="primary"
  63. shape="square"
  64. @click="onConfirm"
  65. >确认</u-button
  66. >
  67. </view>
  68. <view class="tips-box"> *修改库位后,经过erp后台审核后方可生效 </view>
  69. </view>
  70. </u-popup>
  71. </template>
  72. <script>
  73. export default {
  74. name: "locationEditPopup",
  75. props: {
  76. show: {
  77. type: Boolean,
  78. default: false,
  79. },
  80. originalLocation: {
  81. type: String,
  82. default: "",
  83. },
  84. },
  85. data() {
  86. return {
  87. formData: {
  88. originLocation: "",
  89. newLocation: "",
  90. },
  91. // rules: {
  92. // newLocation: {
  93. // type: "string",
  94. // required: true,
  95. // message: "请输入新库位",
  96. // trigger: ["blur", "change"],
  97. // },
  98. // },
  99. };
  100. },
  101. watch: {
  102. show(newVal) {
  103. if (newVal) {
  104. this.formData.originLocation = this.originalLocation;
  105. this.formData.newLocation = "";
  106. }
  107. },
  108. originalLocation(val) {
  109. this.formData.originLocation = val;
  110. },
  111. },
  112. methods: {
  113. close() {
  114. this.$emit("update:show", false);
  115. },
  116. open() {},
  117. onCancel() {
  118. this.close();
  119. this.$emit("cancel");
  120. },
  121. onConfirm() {
  122. console.log(999000);
  123. if (!this.formData.newLocation) {
  124. uni.$u.toast("请输入新库位");
  125. return;
  126. }
  127. this.$emit("confirm", this.formData.newLocation);
  128. },
  129. },
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. .location-edit-popup {
  134. padding: 30rpx;
  135. width: 580rpx;
  136. .popup-header {
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. margin-bottom: 30rpx;
  141. .popup-title {
  142. font-size: 36rpx;
  143. font-weight: 500;
  144. color: #333333;
  145. }
  146. }
  147. .mt-20 {
  148. margin-top: 20rpx;
  149. }
  150. .btn-group {
  151. display: flex;
  152. justify-content: space-between;
  153. margin-top: 40rpx;
  154. .btn {
  155. flex: 1;
  156. height: 88rpx;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. font-size: 32rpx;
  161. &.cancel-btn {
  162. margin-right: 20rpx;
  163. color: #666666;
  164. border-color: #dddddd;
  165. }
  166. &.confirm-btn {
  167. background-color: #2979ff;
  168. }
  169. }
  170. }
  171. .tips-box {
  172. color: #bfc8db;
  173. font-size: 24rpx;
  174. font-weight: 400;
  175. margin-top: 24rpx;
  176. }
  177. }
  178. </style>