categoryPopup.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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">
  69. *修改库位后,经过erp后台审核后方可生效
  70. </view>
  71. </view>
  72. </u-popup>
  73. </template>
  74. <script>
  75. export default {
  76. name: "locationEditPopup",
  77. props: {
  78. show: {
  79. type: Boolean,
  80. default: false,
  81. },
  82. originalLocation: {
  83. type: String,
  84. default: "",
  85. },
  86. },
  87. data() {
  88. return {
  89. formData: {
  90. originLocation: "",
  91. newLocation: "",
  92. },
  93. // rules: {
  94. // newLocation: {
  95. // type: "string",
  96. // required: true,
  97. // message: "请输入新库位",
  98. // trigger: ["blur", "change"],
  99. // },
  100. // },
  101. };
  102. },
  103. watch: {
  104. show(newVal) {
  105. if (newVal) {
  106. this.formData.originLocation = this.originalLocation;
  107. this.formData.newLocation = "";
  108. }
  109. },
  110. originalLocation(val) {
  111. this.formData.originLocation = val;
  112. },
  113. },
  114. methods: {
  115. close() {
  116. this.$emit("update:show", false);
  117. },
  118. open() {},
  119. onCancel() {
  120. this.close();
  121. this.$emit("cancel");
  122. },
  123. onConfirm() {
  124. console.log(999000);
  125. if (!this.formData.newLocation) {
  126. uni.$u.toast("请输入新库存");
  127. return;
  128. }
  129. this.$emit("confirm", this.formData.newLocation);
  130. },
  131. },
  132. };
  133. </script>
  134. <style lang="scss" scoped>
  135. .location-edit-popup {
  136. padding: 30rpx;
  137. width: 580rpx;
  138. .popup-header {
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. margin-bottom: 30rpx;
  143. .popup-title {
  144. font-size: 36rpx;
  145. font-weight: 500;
  146. color: #333333;
  147. }
  148. }
  149. .mt-20 {
  150. margin-top: 20rpx;
  151. }
  152. .btn-group {
  153. display: flex;
  154. justify-content: space-between;
  155. margin-top: 40rpx;
  156. .btn {
  157. flex: 1;
  158. height: 88rpx;
  159. display: flex;
  160. align-items: center;
  161. justify-content: center;
  162. font-size: 32rpx;
  163. &.cancel-btn {
  164. margin-right: 20rpx;
  165. color: #666666;
  166. border-color: #dddddd;
  167. }
  168. &.confirm-btn {
  169. background-color: #2979ff;
  170. }
  171. }
  172. }
  173. .tips-box {
  174. color: #BFC8DB;
  175. font-size: 24rpx;
  176. font-weight: 400;
  177. margin-top: 24rpx;
  178. }
  179. }
  180. </style>