Ver código fonte

fix:提交

zhangxin 1 mês atrás
pai
commit
850680bce3

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

@@ -178,13 +178,13 @@ export default {
178
                 })
178
                 })
179
                 return
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
             const data = {
188
             const data = {
189
                 clueId: this.clueId,
189
                 clueId: this.clueId,
190
                 dictValue: this.info.dictValue,
190
                 dictValue: this.info.dictValue,

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

@@ -1,12 +1,14 @@
1
 .brand_list_page {
1
 .brand_list_page {
2
     width: 100vw;
2
     width: 100vw;
3
-    // height: 100vh;
3
+    height: 100vh;
4
     display: flex;
4
     display: flex;
5
     flex-direction: column;
5
     flex-direction: column;
6
+    overflow: hidden;
7
+    position: relative;
8
+    
6
     .brand_list {
9
     .brand_list {
7
         background-color: #fff;
10
         background-color: #fff;
8
         padding: 20rpx;
11
         padding: 20rpx;
9
-        flex-shrink: 0;
10
 
12
 
11
         .u-nav-slot {
13
         .u-nav-slot {
12
             display: flex;
14
             display: flex;
@@ -26,7 +28,7 @@
26
                 align-items: center;
28
                 align-items: center;
27
 
29
 
28
                 .brand_img {
30
                 .brand_img {
29
-                    width: 160rpx;
31
+                    width: 140rpx;
30
                     height: 80rpx;
32
                     height: 80rpx;
31
                 }
33
                 }
32
 
34
 
@@ -38,19 +40,26 @@
38
         }
40
         }
39
 
41
 
40
     }
42
     }
43
+    
41
     .index_list{
44
     .index_list{
42
         flex: 1;
45
         flex: 1;
43
-        overflow: auto;
46
+        overflow: hidden;
47
+        
44
         ::v-deep uni-scroll-view{
48
         ::v-deep uni-scroll-view{
45
-            height: calc(100vh - 216rpx);
49
+            height: 100%;
50
+            overflow: auto;
51
+            
46
             .uni-scroll-view-content{
52
             .uni-scroll-view-content{
47
                 padding-bottom: 120rpx;
53
                 padding-bottom: 120rpx;
48
             }
54
             }
49
         }
55
         }
50
     }
56
     }
57
+    
51
     .u-index-list{
58
     .u-index-list{
52
         height: 100%;
59
         height: 100%;
60
+        overflow: hidden;
53
     }
61
     }
62
+    
54
     .no_brand{
63
     .no_brand{
55
         position:fixed;
64
         position:fixed;
56
         bottom:0;
65
         bottom:0;
@@ -59,11 +68,22 @@
59
         padding: 20rpx;
68
         padding: 20rpx;
60
         background-color: #fff;
69
         background-color: #fff;
61
         z-index: 1;
70
         z-index: 1;
71
+        
62
         ::v-deep .u-button__text{
72
         ::v-deep .u-button__text{
63
             color: #108cff;
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
 ::v-deep .u-index-anchor{
87
 ::v-deep .u-index-anchor{
68
     background-color: #efefef !important;
88
     background-color: #efefef !important;
69
 }
89
 }
@@ -78,7 +98,7 @@
78
     padding: 16rpx;
98
     padding: 16rpx;
79
     border-bottom: 1rpx solid #f0eded;
99
     border-bottom: 1rpx solid #f0eded;
80
     .brand_img{
100
     .brand_img{
81
-        width: 160rpx;
101
+        width: 140rpx;
82
         height: 80rpx;
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
     methods: {
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
         handleBrandClick(brand) {
73
         handleBrandClick(brand) {
@@ -91,14 +96,61 @@ export default {
91
             this.indexList = processedData.indexList
96
             this.indexList = processedData.indexList
92
         },
97
         },
93
         processBrandData(data) {
98
         processBrandData(data) {
94
-            // 1. 首先按 isDefault 排序(true 的排在前面),然后按 dictLabel 字母排序
99
+            // 1. 按每个字符的拼音首字母排序
95
             const sortedData = data.sort((a, b) => {
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
             // 2. 按首字母分组
156
             // 2. 按首字母分组
@@ -109,21 +161,22 @@ export default {
109
                 let firstLetter
161
                 let firstLetter
110
                 const label = item.dictLabel || ''
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
                             firstLetter = pinyin.charAt(0).toUpperCase()
173
                             firstLetter = pinyin.charAt(0).toUpperCase()
121
                         } else {
174
                         } else {
122
                             firstLetter = '#'
175
                             firstLetter = '#'
123
                         }
176
                         }
124
-                    } catch (error) {
125
-                        firstLetter = '#'
126
                     }
177
                     }
178
+                } catch (error) {
179
+                    firstLetter = '#'
127
                 }
180
                 }
128
 
181
 
129
                 // 创建字母分组
182
                 // 创建字母分组

BIN
components/brand-list/lv.jpg


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

@@ -31,7 +31,6 @@
31
                     </view>
31
                     </view>
32
                 </view>
32
                 </view>
33
             </view>
33
             </view>
34
-            <show-empty v-if="list.length === 0"></show-empty>
35
         </scroll-view>
34
         </scroll-view>
36
 
35
 
37
         <add-inquiry-dialog ref="addInquiryDialog" editOrAdd="edit" :editInfo="editInfo" :type="type" @submitSuccess="onRefresh"/>
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
 .inquiry_wrap {
1
 .inquiry_wrap {
2
     background-color: #f9fafb;
2
     background-color: #f9fafb;
3
-    // height: 100vh;
3
+    height: 100vh;
4
     display: flex;
4
     display: flex;
5
     flex-direction: column;
5
     flex-direction: column;
6
     box-sizing: border-box;
6
     box-sizing: border-box;
7
+    overflow: hidden;
7
 
8
 
8
     .list_wrap {
9
     .list_wrap {
9
         flex: 1;
10
         flex: 1;
11
+        height: 100%;
12
+        overflow: hidden;
13
+        padding: 20rpx 0;
10
 
14
 
11
         ::v-deep .uni-scroll-view {
15
         ::v-deep .uni-scroll-view {
12
-            height: calc(100vh - 250rpx);
16
+            height: 100%;
13
         }
17
         }
14
 
18
 
15
         .list_item {
19
         .list_item {
16
             margin: 0 20rpx;
20
             margin: 0 20rpx;
21
+            margin-bottom:20rpx;
17
             padding: 30rpx;
22
             padding: 30rpx;
18
             background-color: #fff;
23
             background-color: #fff;
19
             border-radius: 20rpx;
24
             border-radius: 20rpx;
20
-            margin-bottom: 20rpx;
21
             box-shadow: 2px 2px 11px 1px #e7e7e7;
25
             box-shadow: 2px 2px 11px 1px #e7e7e7;
22
 
26
 
23
             .list_item_top {
27
             .list_item_top {

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

@@ -41,16 +41,41 @@ export default {
41
               values,
41
               values,
42
               picker = this.$refs.uPicker
42
               picker = this.$refs.uPicker
43
           } = e
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
     recyclePersonClick() {
81
     recyclePersonClick() {

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

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

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

@@ -295,20 +295,17 @@ export default {
295
                 id: this.goodsId,
295
                 id: this.goodsId,
296
                 lockStatus: this.lockStatus === '1' ? '0' : '1',
296
                 lockStatus: this.lockStatus === '1' ? '0' : '1',
297
             }).then(res => {
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
         showRecyclePersonPicker() {
311
         showRecyclePersonPicker() {
@@ -405,6 +402,11 @@ export default {
405
                     icon: 'success'
402
                     icon: 'success'
406
                 })
403
                 })
407
                 this.getGoodsDetail();
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
                 identifyingPerson: info.identifyingPerson,
475
                 identifyingPerson: info.identifyingPerson,
474
                 identifyingPersonId: info.identifyingPersonId,
476
                 identifyingPersonId: info.identifyingPersonId,
475
             }
477
             }
476
-            console.log('修改图片',data);
477
-            
478
             uni.$u.api.wareHouseUpdate(data).then(res => {
478
             uni.$u.api.wareHouseUpdate(data).then(res => {
479
                 uni.showToast({
479
                 uni.showToast({
480
                     title: '编辑成功',
480
                     title: '编辑成功',
@@ -482,6 +482,11 @@ export default {
482
                 });
482
                 });
483
                 this.getGoodsDetail();
483
                 this.getGoodsDetail();
484
                 this.$emit('editSuccess')
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
                   payTypeProofPicFileList: this.payTypeProofPicFileList,
260
                   payTypeProofPicFileList: this.payTypeProofPicFileList,
261
                   amountReceived: Number(this.openOrderForm.dealPrice) * Number(this.openOrderForm.quantity),
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
 .page{
2
 .page{
3
   width: 100%;
3
   width: 100%;
4
+  height: 100vh;
4
   background-color: #fff;
5
   background-color: #fff;
6
+  display: flex;
7
+  flex-direction: column;
5
 }
8
 }
6
 .page-container {
9
 .page-container {
7
-  // padding: 8rpx 15rpx;
10
+  flex: 1;
11
+  display: flex;
12
+  flex-direction: column;
8
   background-color: #f9fafb;
13
   background-color: #f9fafb;
9
-  // min-height: 100vh;
10
   padding-bottom:20rpx;
14
   padding-bottom:20rpx;
15
+  overflow: hidden;
11
 }
16
 }
12
 .nav-bar{
17
 .nav-bar{
13
   border-bottom: 1px solid #f7f6f6 !important;
18
   border-bottom: 1px solid #f7f6f6 !important;
@@ -234,12 +239,15 @@
234
 
239
 
235
 /* 商品列表 */
240
 /* 商品列表 */
236
 .goods-list {
241
 .goods-list {
242
+  flex: 1;
237
   display: flex;
243
   display: flex;
238
   flex-direction: column;
244
   flex-direction: column;
239
   gap: 10rpx;
245
   gap: 10rpx;
240
   background-color: #f9fafb;
246
   background-color: #f9fafb;
247
+  overflow: hidden;
248
+  height: 100%;
241
   ::v-deep .uni-scroll-view{
249
   ::v-deep .uni-scroll-view{
242
-    height: calc(100vh - 850rpx);
250
+    height: 100%;
243
   }
251
   }
244
   .goods-item {
252
   .goods-item {
245
     margin: 10rpx 15rpx;
253
     margin: 10rpx 15rpx;

+ 2 - 2
store/modules/user.js

@@ -28,8 +28,8 @@ export default {
28
 		netConfig: {
28
 		netConfig: {
29
 			// http://59.42.9.166:9520/proxy
29
 			// http://59.42.9.166:9520/proxy
30
 			// http://10.0.7.100:9500
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
 			// ip : "/api", // 测试环境ip
33
 			// ip : "/api", // 测试环境ip
34
 			// ip : "http://47.113.184.101", // 测试环境ip
34
 			// ip : "http://47.113.184.101", // 测试环境ip
35
 			// ip: "http://172.16.7.200", // ip
35
 			// ip: "http://172.16.7.200", // ip