浏览代码

fix:提交

zhangxin 1 月之前
父节点
当前提交
850680bce3

+ 7 - 7
components/add-inquiry-dialog/index.vue

@@ -178,13 +178,13 @@ export default {
178 178
                 })
179 179
                 return
180 180
             }
181
-            // if(this.info.imgsUrl.length == 0){
182
-            //     uni.showToast({
183
-            //         title: '请上传图片',
184
-            //         icon: 'none'
185
-            //     })
186
-            //     return
187
-            // }
181
+            if(this.info.imgsUrl.length == 0){
182
+                uni.showToast({
183
+                    title: '请上传图片',
184
+                    icon: 'none'
185
+                })
186
+                return
187
+            }
188 188
             const data = {
189 189
                 clueId: this.clueId,
190 190
                 dictValue: this.info.dictValue,

+ 26 - 6
components/brand-list/index.scss

@@ -1,12 +1,14 @@
1 1
 .brand_list_page {
2 2
     width: 100vw;
3
-    // height: 100vh;
3
+    height: 100vh;
4 4
     display: flex;
5 5
     flex-direction: column;
6
+    overflow: hidden;
7
+    position: relative;
8
+    
6 9
     .brand_list {
7 10
         background-color: #fff;
8 11
         padding: 20rpx;
9
-        flex-shrink: 0;
10 12
 
11 13
         .u-nav-slot {
12 14
             display: flex;
@@ -26,7 +28,7 @@
26 28
                 align-items: center;
27 29
 
28 30
                 .brand_img {
29
-                    width: 160rpx;
31
+                    width: 140rpx;
30 32
                     height: 80rpx;
31 33
                 }
32 34
 
@@ -38,19 +40,26 @@
38 40
         }
39 41
 
40 42
     }
43
+    
41 44
     .index_list{
42 45
         flex: 1;
43
-        overflow: auto;
46
+        overflow: hidden;
47
+        
44 48
         ::v-deep uni-scroll-view{
45
-            height: calc(100vh - 216rpx);
49
+            height: 100%;
50
+            overflow: auto;
51
+            
46 52
             .uni-scroll-view-content{
47 53
                 padding-bottom: 120rpx;
48 54
             }
49 55
         }
50 56
     }
57
+    
51 58
     .u-index-list{
52 59
         height: 100%;
60
+        overflow: hidden;
53 61
     }
62
+    
54 63
     .no_brand{
55 64
         position:fixed;
56 65
         bottom:0;
@@ -59,11 +68,22 @@
59 68
         padding: 20rpx;
60 69
         background-color: #fff;
61 70
         z-index: 1;
71
+        
62 72
         ::v-deep .u-button__text{
63 73
             color: #108cff;
64 74
         }
65 75
     }
66 76
 }
77
+
78
+// 确保整个页面没有滚动条
79
+body {
80
+    overflow: hidden;
81
+}
82
+
83
+// 确保 u-popup 内部也没有滚动条
84
+::v-deep .brand_list_popup {
85
+    overflow: hidden;
86
+}
67 87
 ::v-deep .u-index-anchor{
68 88
     background-color: #efefef !important;
69 89
 }
@@ -78,7 +98,7 @@
78 98
     padding: 16rpx;
79 99
     border-bottom: 1rpx solid #f0eded;
80 100
     .brand_img{
81
-        width: 160rpx;
101
+        width: 140rpx;
82 102
         height: 80rpx;
83 103
     }
84 104
 }

+ 74 - 21
components/brand-list/index.vue

@@ -58,11 +58,16 @@ export default {
58 58
         }
59 59
     },
60 60
     methods: {
61
-        handleSearch(val) {
62
-            if(val){
63
-                this.filterData(this.list.filter(item => item.dictLabel.includes(this.keyword)))
64
-            }else{
65
-                this.filterData(this.list)
61
+        handleSearch() {
62
+            const keyword = this.keyword.trim().toLowerCase();
63
+            if (keyword) {
64
+                const filteredList = this.list.filter(item => {
65
+                    const brandName = (item.dictLabel || '').toLowerCase();
66
+                    return brandName.includes(keyword);
67
+                });
68
+                this.filterData(filteredList);
69
+            } else {
70
+                this.filterData(this.list);
66 71
             }
67 72
         },
68 73
         handleBrandClick(brand) {
@@ -91,14 +96,61 @@ export default {
91 96
             this.indexList = processedData.indexList
92 97
         },
93 98
         processBrandData(data) {
94
-            // 1. 首先按 isDefault 排序(true 的排在前面),然后按 dictLabel 字母排序
99
+            // 1. 按每个字符的拼音首字母排序
95 100
             const sortedData = data.sort((a, b) => {
96
-                // isDefault 为 true 的排在前面
97
-                if (a.isDefault !== b.isDefault) {
98
-                    return b.isDefault - a.isDefault
101
+                const labelA = a.dictLabel || ''
102
+                const labelB = b.dictLabel || ''
103
+                const maxLength = Math.max(labelA.length, labelB.length)
104
+                
105
+                // 逐个字符比较
106
+                for (let i = 0; i < maxLength; i++) {
107
+                    const charA = labelA[i] || ''
108
+                    const charB = labelB[i] || ''
109
+                    
110
+                    // 检查是否为英文字符
111
+                    const isEnglishA = /[a-zA-Z]/.test(charA)
112
+                    const isEnglishB = /[a-zA-Z]/.test(charB)
113
+                    
114
+                    if (isEnglishA && isEnglishB) {
115
+                        // 都是英文,直接比较(忽略大小写)
116
+                        const upperA = charA.toUpperCase()
117
+                        const upperB = charB.toUpperCase()
118
+                        if (upperA !== upperB) {
119
+                            return upperA.localeCompare(upperB)
120
+                        }
121
+                    } else if (isEnglishA) {
122
+                        // 只有A是英文,英文排在前面
123
+                        return -1
124
+                    } else if (isEnglishB) {
125
+                        // 只有B是英文,英文排在前面
126
+                        return 1
127
+                    } else {
128
+                        // 都不是英文,比较拼音首字母
129
+                        let pinyinA = ''
130
+                        let pinyinB = ''
131
+                        
132
+                        try {
133
+                            pinyinA = chineseToPinYin(charA).charAt(0).toUpperCase()
134
+                        } catch (error) {
135
+                            pinyinA = '#'
136
+                        }
137
+                        
138
+                        try {
139
+                            pinyinB = chineseToPinYin(charB).charAt(0).toUpperCase()
140
+                        } catch (error) {
141
+                            pinyinB = '#'
142
+                        }
143
+                        
144
+                        if (pinyinA !== pinyinB) {
145
+                            if (pinyinA === '#') return 1
146
+                            if (pinyinB === '#') return -1
147
+                            return pinyinA.localeCompare(pinyinB)
148
+                        }
149
+                    }
99 150
                 }
100
-                // 如果 isDefault 相同,则按 dictLabel 字母顺序排序
101
-                return a.dictLabel.localeCompare(b.dictLabel, 'zh-CN')
151
+                
152
+                // 如果所有字符都相同,则按长度排序
153
+                return labelA.length - labelB.length
102 154
             })
103 155
 
104 156
             // 2. 按首字母分组
@@ -109,21 +161,22 @@ export default {
109 161
                 let firstLetter
110 162
                 const label = item.dictLabel || ''
111 163
                 
112
-                if (/[a-zA-Z]/.test(label.charAt(0))) {
113
-                    // 英文字母开头,使用大写首字母
114
-                    firstLetter = label.charAt(0).toUpperCase()
115
-                } else {
116
-                    // 中文字符,使用拼音首字母
117
-                    try {
118
-                        const pinyin = chineseToPinYin(label)
119
-                        if (pinyin && pinyin.length > 0 && /[a-zA-Z]/.test(pinyin.charAt(0).toUpperCase())) {
164
+                try {
165
+                    const firstChar = label.charAt(0) || ''
166
+                    if (/[a-zA-Z]/.test(firstChar)) {
167
+                        // 英文直接使用大写
168
+                        firstLetter = firstChar.toUpperCase()
169
+                    } else {
170
+                        // 中文使用拼音首字母
171
+                        const pinyin = chineseToPinYin(firstChar)
172
+                        if (pinyin && pinyin.length > 0 && /[a-zA-Z]/.test(pinyin.charAt(0))) {
120 173
                             firstLetter = pinyin.charAt(0).toUpperCase()
121 174
                         } else {
122 175
                             firstLetter = '#'
123 176
                         }
124
-                    } catch (error) {
125
-                        firstLetter = '#'
126 177
                     }
178
+                } catch (error) {
179
+                    firstLetter = '#'
127 180
                 }
128 181
 
129 182
                 // 创建字母分组

二进制
components/brand-list/lv.jpg


+ 0 - 1
components/inquiry-verification-list/index.vue

@@ -31,7 +31,6 @@
31 31
                     </view>
32 32
                 </view>
33 33
             </view>
34
-            <show-empty v-if="list.length === 0"></show-empty>
35 34
         </scroll-view>
36 35
 
37 36
         <add-inquiry-dialog ref="addInquiryDialog" editOrAdd="edit" :editInfo="editInfo" :type="type" @submitSuccess="onRefresh"/>

+ 7 - 3
components/inquiry-verification-list/styles/index.scss

@@ -1,23 +1,27 @@
1 1
 .inquiry_wrap {
2 2
     background-color: #f9fafb;
3
-    // height: 100vh;
3
+    height: 100vh;
4 4
     display: flex;
5 5
     flex-direction: column;
6 6
     box-sizing: border-box;
7
+    overflow: hidden;
7 8
 
8 9
     .list_wrap {
9 10
         flex: 1;
11
+        height: 100%;
12
+        overflow: hidden;
13
+        padding: 20rpx 0;
10 14
 
11 15
         ::v-deep .uni-scroll-view {
12
-            height: calc(100vh - 250rpx);
16
+            height: 100%;
13 17
         }
14 18
 
15 19
         .list_item {
16 20
             margin: 0 20rpx;
21
+            margin-bottom:20rpx;
17 22
             padding: 30rpx;
18 23
             background-color: #fff;
19 24
             border-radius: 20rpx;
20
-            margin-bottom: 20rpx;
21 25
             box-shadow: 2px 2px 11px 1px #e7e7e7;
22 26
 
23 27
             .list_item_top {

+ 34 - 9
components/person-picker/index.vue

@@ -41,16 +41,41 @@ export default {
41 41
               values,
42 42
               picker = this.$refs.uPicker
43 43
           } = e
44
-          // 当前项不是用户,且有子级,添加下一层
45
-          if(!value[columnIndex].isUser){
46
-            picker.setColumnValues(columnIndex+1, value[columnIndex].children);
47
-          }else{
48
-            // 当前是用户且同等级的其他项有子级,则添加下一层空数据
49
-            values[columnIndex].forEach((item, index) => {
50
-              if(!item.isUser){
51
-                picker.setColumnValues(columnIndex+1, []);
44
+          
45
+          // 清除当前层级之后的所有层级
46
+          if (this.columns.length > columnIndex + 1) {
47
+              this.columns = this.columns.slice(0, columnIndex + 1);
48
+          }
49
+          
50
+          // 自动展开后续所有层级
51
+          let currentItem = value[columnIndex];
52
+          let currentLevel = columnIndex;
53
+          
54
+          // 循环检查并添加后续层级,直到遇到用户或没有子级
55
+          while (currentItem && !currentItem.isUser && currentItem.children && currentItem.children.length > 0) {
56
+              // 添加下一层级
57
+              picker.setColumnValues(currentLevel + 1, currentItem.children);
58
+              if (this.columns.length <= currentLevel + 1) {
59
+                  this.columns.push(currentItem.children);
60
+              } else {
61
+                  this.columns[currentLevel + 1] = currentItem.children;
62
+              }
63
+              
64
+              // 检查下一层级的第一个元素是否可以继续展开
65
+              // 只自动展开第一个元素的层级,模拟常见的组织架构展开逻辑
66
+              if (currentItem.children[0] && !currentItem.children[0].isUser && currentItem.children[0].children && currentItem.children[0].children.length > 0) {
67
+                  currentItem = currentItem.children[0];
68
+                  currentLevel++;
69
+              } else {
70
+                  break;
71
+              }
72
+          }
73
+          
74
+          // 如果当前是用户或没有子级,确保后续层级为空
75
+          if (currentItem && (currentItem.isUser || !currentItem.children || currentItem.children.length === 0)) {
76
+              if (this.columns.length > currentLevel + 1) {
77
+                  this.columns = this.columns.slice(0, currentLevel + 1);
52 78
               }
53
-            })
54 79
           }
55 80
         },
56 81
     recyclePersonClick() {

+ 3 - 3
pages/wareHouse/components/add.vue

@@ -26,7 +26,7 @@
26 26
                                 @click="handlePasteRecognition(recognitionContent)"></u-button>
27 27
                         </view>
28 28
                     </u-form-item>
29
-                    <u-form-item required label="商品图片" prop="goodPicFileList" borderBottom>
29
+                    <u-form-item label="商品图片" required prop="goodPicFileList" borderBottom>
30 30
                         <view class="imgs_scroll">
31 31
                             <ImgsRowScroll v-if="formData.goodPicFileList.length > 0" :isShowDeleteIcon="true"
32 32
                                 @deleteImgInfo="getDeleteGoodPicInfo" imgMode="aspectFill" :totalWidth="400"
@@ -266,7 +266,7 @@ export default {
266 266
     },
267 267
     data() {
268 268
         return {
269
-            checkboxValue: [],
269
+            checkboxValue: [''],
270 270
             recognitionContent: '',
271 271
             formData: {
272 272
                 goodPicFileList: [],//商品图片
@@ -317,7 +317,7 @@ export default {
317 317
             continuousWarehousing: [],//是否连续入库 1:是 0:否
318 318
             rules: {
319 319
                 goodPicFileList: [
320
-                    { required: true, message: '请上传商品图片', trigger: 'change' },
320
+                    { required: true, message: '请上传商品图片' },
321 321
                 ],
322 322
                 desc: [
323 323
                     { required: true, message: '请输入商品描述', trigger: 'blur' },

+ 21 - 16
pages/wareHouse/components/detail.vue

@@ -295,20 +295,17 @@ export default {
295 295
                 id: this.goodsId,
296 296
                 lockStatus: this.lockStatus === '1' ? '0' : '1',
297 297
             }).then(res => {
298
-                if(res.code === 200){
299
-                    uni.showToast({
300
-                        type: "success",
301
-                        title: this.lockStatus === '1' ? '解锁成功' : '锁单成功',
302
-                        icon: 'success'
303
-                    })
304
-                    this.getGoodsDetail();
305
-                }else{
306
-                    uni.showToast({
307
-                        type: "error",
308
-                        title: res.msg || '操作失败',
309
-                        icon: false
310
-                    })
311
-                }
298
+                uni.showToast({
299
+                    type: "success",
300
+                    title: this.lockStatus === '1' ? '解锁成功' : '锁单成功',
301
+                    icon: 'success'
302
+                })
303
+                this.getGoodsDetail();
304
+            }).catch((error) => {
305
+                uni.showToast({
306
+                    title: error || '操作失败',
307
+                    icon: 'none'
308
+                })
312 309
             })
313 310
         },
314 311
         showRecyclePersonPicker() {
@@ -405,6 +402,11 @@ export default {
405 402
                     icon: 'success'
406 403
                 })
407 404
                 this.getGoodsDetail();
405
+            }).catch(() => {
406
+                uni.showToast({
407
+                    title: '操作失败',
408
+                    icon: 'none'
409
+                })
408 410
             })
409 411
         },
410 412
         // 切换单个字段的编辑状态
@@ -473,8 +475,6 @@ export default {
473 475
                 identifyingPerson: info.identifyingPerson,
474 476
                 identifyingPersonId: info.identifyingPersonId,
475 477
             }
476
-            console.log('修改图片',data);
477
-            
478 478
             uni.$u.api.wareHouseUpdate(data).then(res => {
479 479
                 uni.showToast({
480 480
                     title: '编辑成功',
@@ -482,6 +482,11 @@ export default {
482 482
                 });
483 483
                 this.getGoodsDetail();
484 484
                 this.$emit('editSuccess')
485
+            }).catch(() => {
486
+                uni.showToast({
487
+                    title: '操作失败',
488
+                    icon: 'none'
489
+                })
485 490
             })
486 491
         },
487 492
         // 点击页面其他地方保存所有编辑

+ 9 - 15
pages/wareHouse/components/openOrder.vue

@@ -260,22 +260,16 @@ export default {
260 260
                   payTypeProofPicFileList: this.payTypeProofPicFileList,
261 261
                   amountReceived: Number(this.openOrderForm.dealPrice) * Number(this.openOrderForm.quantity),
262 262
                }
263
-               uni.$u.api.wareHouseOpenOrder(data).then(res => {
264
-                  if (res.code === 200) {
265
-                     uni.$u.toast("开单成功");
266
-                     setTimeout(() => {
267
-                        uni.navigateBack({
268
-                              delta: 2
269
-                        });
270
-                     }, 1000);
271
-                  } else {
272
-                     uni.$u.toast(res.msg);
273
-                  }
274
-               }).catch(() => {
275
-                  uni.$u.toast("开单失败");
263
+               uni.$u.api.wareHouseOpenOrder(data).then(() => {
264
+                  uni.$u.toast("开单成功");
265
+                  setTimeout(() => {
266
+                     uni.navigateBack({
267
+                           delta: 2
268
+                     });
269
+                  }, 1000);
270
+               }).catch((error) => {
271
+                  uni.$u.toast(error);
276 272
                })
277
-               console.log('提交成功', this.openOrderForm);
278
-
279 273
             }
280 274
          })
281 275
       },

+ 11 - 3
pages/wareHouse/styles/index.scss

@@ -1,13 +1,18 @@
1 1
 /* 页面容器 */
2 2
 .page{
3 3
   width: 100%;
4
+  height: 100vh;
4 5
   background-color: #fff;
6
+  display: flex;
7
+  flex-direction: column;
5 8
 }
6 9
 .page-container {
7
-  // padding: 8rpx 15rpx;
10
+  flex: 1;
11
+  display: flex;
12
+  flex-direction: column;
8 13
   background-color: #f9fafb;
9
-  // min-height: 100vh;
10 14
   padding-bottom:20rpx;
15
+  overflow: hidden;
11 16
 }
12 17
 .nav-bar{
13 18
   border-bottom: 1px solid #f7f6f6 !important;
@@ -234,12 +239,15 @@
234 239
 
235 240
 /* 商品列表 */
236 241
 .goods-list {
242
+  flex: 1;
237 243
   display: flex;
238 244
   flex-direction: column;
239 245
   gap: 10rpx;
240 246
   background-color: #f9fafb;
247
+  overflow: hidden;
248
+  height: 100%;
241 249
   ::v-deep .uni-scroll-view{
242
-    height: calc(100vh - 850rpx);
250
+    height: 100%;
243 251
   }
244 252
   .goods-item {
245 253
     margin: 10rpx 15rpx;

+ 2 - 2
store/modules/user.js

@@ -28,8 +28,8 @@ export default {
28 28
 		netConfig: {
29 29
 			// http://59.42.9.166:9520/proxy
30 30
 			// http://10.0.7.100:9500
31
-			ip: "https://crm.nanjingshiyu.com/prod-api", // ip
32
-			// ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
31
+			// ip: "https://crm.nanjingshiyu.com/prod-api", // ip
32
+			ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
33 33
 			// ip : "/api", // 测试环境ip
34 34
 			// ip : "http://47.113.184.101", // 测试环境ip
35 35
 			// ip: "http://172.16.7.200", // ip