Procházet zdrojové kódy

feat:仓库添加弹窗查看信息

zhangxin před 1 měsícem
rodič
revize
e3b9f96390
2 změnil soubory, kde provedl 49 přidání a 35 odebrání
  1. 45 33
      pages/wareHouse/components/moreInfo.vue
  2. 4 2
      pages/wareHouse/index.vue

+ 45 - 33
pages/wareHouse/components/moreInfo.vue

@@ -1,36 +1,38 @@
1 1
 <template>
2
-    <u-modal :show="show">
3
-        <div class="more-info">
4
-            <view class="modal-item">
5
-                <text>品牌:</text>
6
-                <text>{{ moreOptions.dictLabel || '-' }}</text>
7
-            </view>
8
-            <view class="modal-item">
9
-                <text>来源:</text>
10
-                <text>{{ moreOptions.origin || '-' }}</text>
11
-            </view>
12
-            <view class="modal-item">
13
-                <text>实价:</text>
14
-                <text>¥{{ moreOptions.costPrice || '-' }}</text>
15
-            </view>
16
-            <view class="modal-item">
17
-                <text>型号:</text>
18
-                <text>{{ moreOptions.model || '-' }}</text>
19
-            </view>
20
-            <view class="modal-item">
21
-                <text>编码:</text>
22
-                <text>{{ moreOptions.indentifyCode || '-' }}</text>
23
-            </view>
24
-            <view class="modal-item">
25
-                <text>日期:</text>
26
-                <text>{{ recycleTimeFormatter(moreOptions.recycleTime) || '-' }}</text>
27
-            </view>
28
-            <view class="modal-item">
29
-                <text>备注:</text>
30
-                <text>{{ moreOptions.productDesc || '-' }}</text>
31
-            </view>
32
-        </div>
33
-    </u-modal>
2
+    <view class="more-info-wrapper">
3
+        <u-modal :show="show" @confirm="closeModal">
4
+            <div class="more-info">
5
+                <view class="modal-item">
6
+                    <text>品牌:</text>
7
+                    <text>{{ moreOptions.dictLabel || '-' }}</text>
8
+                </view>
9
+                <view class="modal-item">
10
+                    <text>来源:</text>
11
+                    <text>{{ moreOptions.origin || '-' }}</text>
12
+                </view>
13
+                <view class="modal-item">
14
+                    <text>实价:</text>
15
+                    <text>¥{{ moreOptions.costPrice || '-' }}</text>
16
+                </view>
17
+                <view class="modal-item">
18
+                    <text>型号:</text>
19
+                    <text>{{ moreOptions.model || '-' }}</text>
20
+                </view>
21
+                <view class="modal-item">
22
+                    <text>编码:</text>
23
+                    <text>{{ moreOptions.indentifyCode || '-' }}</text>
24
+                </view>
25
+                <view class="modal-item">
26
+                    <text>日期:</text>
27
+                    <text>{{ recycleTimeFormatter(moreOptions.recycleTime) || '-' }}</text>
28
+                </view>
29
+                <view class="modal-item">
30
+                    <text>备注:</text>
31
+                    <text>{{ moreOptions.productDesc || '-' }}</text>
32
+                </view>
33
+            </div>
34
+        </u-modal>
35
+    </view>
34 36
 </template>
35 37
 
36 38
 <script>
@@ -51,6 +53,9 @@ export default {
51 53
         showMoreInfo() {
52 54
             this.show = true;
53 55
         },
56
+        closeModal() {
57
+            this.show = false;
58
+        },
54 59
         recycleTimeFormatter(val) {
55 60
             if (val) {
56 61
                 return this.$dayjs(val).format('YYYY-MM-DD HH:mm:ss')
@@ -61,4 +66,11 @@ export default {
61 66
 }
62 67
 </script>
63 68
 
64
-<style lang="scss" scoped></style>
69
+<style lang="scss" scoped>
70
+.more-info-wrapper {
71
+    position: absolute;
72
+    width: 0;
73
+    height: 0;
74
+    overflow: hidden;
75
+}
76
+</style>

+ 4 - 2
pages/wareHouse/index.vue

@@ -100,7 +100,9 @@
100 100
 						</view> -->
101 101
 					</view>
102 102
 					<view class="more">
103
-						<u-icon name="more-dot-fill" size="16" color="#666666" @click="showMoreOptions(goods)"></u-icon>
103
+						<view @click.stop="showMoreOptions(goods)">
104
+							<u-icon name="more-dot-fill" size="16" color="#666666"></u-icon>
105
+						</view>
104 106
 						<text class="goods-stock">数量:{{ goods.stock}}</text>
105 107
 					</view>
106 108
 				</view>
@@ -110,7 +112,7 @@
110 112
 		<view class="add-button" @click="handleEdit">
111 113
 			<u-icon name="plus" size="36" color="#ffffff"></u-icon>
112 114
 		</view>
113
-		<!-- <moreInfo ref="moreInfoRef" :moreOptions="moreOptions"></moreInfo> -->
115
+		<moreInfo ref="moreInfoRef" :moreOptions="moreOptions"></moreInfo>
114 116
 	</view>
115 117
 </template>
116 118
 <script>