Forráskód Böngészése

Merge branch 'master' of http://106.52.242.177:3000/askqvn/crm-app

zhangxin 1 hónap óta
szülő
commit
c6aa56c4ac

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
2 2
     "name" : "小葫芦",
3 3
     "appid" : "__UNI__DDAE2E0",
4 4
     "description" : "",
5
-    "versionName" : "1.2.6",
5
+    "versionName" : "1.2.7",
6 6
     "versionCode" : 123,
7 7
     "transformPx" : false,
8 8
     "app-plus" : {

+ 116 - 29
pages/orderDetailRefactored/components/PageFour.vue

@@ -148,7 +148,7 @@
148 148
         </u-row>
149 149
 
150 150
         <!-- 是否入库 -->
151
-        <u-row class="info-row">
151
+        <!-- <u-row class="info-row">
152 152
           <u-col span="12">
153 153
             <view @tap="selectIsWarehouse">
154 154
               <u-form-item label="是否入库" prop="isWarehouse">
@@ -160,7 +160,7 @@
160 160
                 @confirm="handleConfirmIsWarehouse" @cancel="showIsWarehousePicker = false" />
161 161
             </view>
162 162
           </u-col>
163
-        </u-row>
163
+        </u-row> -->
164 164
 
165 165
         <!-- 收单备注 -->
166 166
         <u-row class="info-row">
@@ -243,13 +243,22 @@
243 243
       </view>
244 244
     </view>
245 245
 
246
-    <!-- 确认入库按钮 -->
246
+    <!-- 确认收单、确认入库按钮 -->
247 247
     <view class="confirm-button-container">
248
-      <u-button class="next-btn" type="success" @click="confirmWarehouseEntry">
249
-        <u-icon name="checkmark-circle-fill" size="28rpx" color="#fff" />
250
-        <text style="margin-left: 8rpx;" v-show="isWarehouse == '2'">确认收单</text>
251
-        <text style="margin-left: 8rpx;" v-show="isWarehouse == '1'">确认收单并入库</text>
252
-      </u-button>
248
+      <u-row gutter="24">
249
+        <u-col span="6">
250
+          <u-button class="next-btn" type="success" @click="confirmReceiveOrder">
251
+            <u-icon name="checkmark-circle-fill" size="28rpx" color="#fff" />
252
+            <text style="margin-left: 8rpx;">确认收单</text>
253
+          </u-button>
254
+        </u-col>
255
+        <u-col span="6">
256
+          <u-button class="next-btn" type="success" @click="confirmWarehouseEntry">
257
+            <u-icon name="checkmark-circle-fill" size="28rpx" color="#fff" />
258
+            <text style="margin-left: 8rpx;">确认入库</text>
259
+          </u-button>
260
+        </u-col>
261
+      </u-row>
253 262
     </view>
254 263
 
255 264
     <!-- 组织选择器 -->
@@ -723,12 +732,12 @@ export default {
723 732
     },
724 733
 
725 734
     /**
726
-     * 确认入库
735
+     * 确认收单
727 736
      */
728
-    async confirmWarehouseEntry() {
737
+    async confirmReceiveOrder() {
729 738
       uni.showModal({
730
-        title: '确认入库',
731
-        content: `是否确认入库该订单:${this.orderDetail.item}?`,
739
+        title: '确认收单',
740
+        content: `是否确认收单该订单:${this.orderDetail.item}?`,
732 741
         success: async (res) => {
733 742
           if (res.confirm) {
734 743
             try {
@@ -762,11 +771,95 @@ export default {
762 771
               // 上传分成数据
763 772
               await this.addShare()
764 773
 
765
-              //新增仓库或者编辑仓库
766
-              //等于1的时候放入仓库表
767
-              if (this.isWarehouse == '1') {
768
-                // 获取品牌ID
769
-                const brandObj = this.brandList.find(item => item.dictLabel === this.currentReceipt.brand)
774
+              // //新增仓库或者编辑仓库
775
+              // //等于1的时候放入仓库表
776
+              // if (this.isWarehouse == '1') {
777
+              //   // 获取品牌ID
778
+              //   const brandObj = this.brandList.find(item => item.dictLabel === this.currentReceipt.brand)
779
+              //   const brandId = brandObj ? brandObj.dictValue : ''
780
+
781
+              //   //建立入库data
782
+              //   // 获取 PageThree 的高清实物图的 fileUrl 数组
783
+              //   // 直接使用 imageUpload 获取图片列表,与 PageThree 保持一致
784
+              //   let goodPicFileUrls = []
785
+              //   if (this.currentReceipt.id && this.orderDetail.itemBrand) {
786
+              //     try {
787
+              //       const list = await imageUpload.getFileList(
788
+              //         '2',
789
+              //         '3',
790
+              //         this.currentReceipt.id,
791
+              //         this.orderDetail.itemBrand,
792
+              //         this.currentReceipt.clueId
793
+              //       )
794
+              //       // 获取前6个图片的 fileUrl(与 PageThree 的 displayImages 保持一致)
795
+              //       // goodPicFileUrls = (list || []).slice(0, 6).map(item => item.fileUrl).filter(url => url)
796
+              //       goodPicFileUrls = (list || []).map(item => item.fileUrl).filter(url => url)
797
+              //     } catch (error) {
798
+              //       console.error('获取高清实物图失败:', error)
799
+              //     }
800
+              //   }
801
+                
802
+              //   const warehouseData = {
803
+              //     goodPicFileList: goodPicFileUrls,//商品图片 page3的高清实物图的url数组
804
+              //     type: this.warehouseInfo.category || '',//商品分类 
805
+              //     dictLabel: this.currentReceipt.brand || '',//品牌名称 
806
+              //     dictValue: brandId || '',//品牌id 
807
+              //     indentifyCode:this.warehouseInfo.codeStorage|| '',//独立编码
808
+              //     costPrice: this.computedTotalCost || '',//总成本价
809
+              //     recycleTime: dayjs().format('YYYY-MM-DD'),//回收时间 必填
810
+              //     stockStatus:0,//库存状态,0待入库,1已入库,因为是我们是预入库,所以是0
811
+              //     origin:this.orderDetail.website//来源
812
+              //   }
813
+              //   if (!this.currentReceipt.warehouseId) {
814
+              //     //当没有仓库id的时候调用新增仓库接口
815
+              //     await uni.$u.api.wareHouseAdd(warehouseData)
816
+              //   } else {
817
+              //     //当有仓库id的时候调用编辑仓库接口
818
+              //     warehouseData.id = this.currentReceipt.warehouseId
819
+              //     await uni.$u.api.wareHouseUpdate(warehouseData)
820
+              //   }
821
+              // } else if (this.isWarehouse == '2') {
822
+              //   //等于2的时候不放入仓库表
823
+              // }
824
+
825
+              this.$refs.uToast.show({
826
+                type: 'success',
827
+                message: '收单成功',
828
+                complete: () => {
829
+                  uni.navigateBack({
830
+                    delta: 1
831
+                  })
832
+                }
833
+              })
834
+            } catch (error) {
835
+              console.error('收单失败:', error)
836
+              uni.$u.toast('收单失败')
837
+            }
838
+          }
839
+        }
840
+      })
841
+    },
842
+
843
+
844
+    //确认入库
845
+     confirmWarehouseEntry() {
846
+      //点击了入库按钮
847
+      //首先判断该大单的status是否为3,3代表已收单,如果为3,则提示已收单,不能入库
848
+      console.log('xxxxx',this.orderDetail)
849
+      if (this.orderDetail.status != '3') {
850
+        uni.$u.toast('该订单未收单,不能入库')
851
+        return
852
+      }
853
+
854
+      uni.showModal({
855
+        title: '确认入库',
856
+        content: `是否确认入库该订单:${this.orderDetail.item}-${this.currentReceipt.brand}?`,
857
+        success: async (res) => {
858
+          if (res.confirm) {
859
+            //点击了确认入库,执行入库方法
860
+            try {
861
+              // 获取品牌ID
862
+              const brandObj = this.brandList.find(item => item.dictLabel === this.currentReceipt.brand)
770 863
                 const brandId = brandObj ? brandObj.dictValue : ''
771 864
 
772 865
                 //建立入库data
@@ -805,15 +898,12 @@ export default {
805 898
                   //当没有仓库id的时候调用新增仓库接口
806 899
                   await uni.$u.api.wareHouseAdd(warehouseData)
807 900
                 } else {
808
-                  //当有仓库id的时候调用编辑仓库接口
809
-                  warehouseData.id = this.currentReceipt.warehouseId
810
-                  await uni.$u.api.wareHouseUpdate(warehouseData)
901
+                  // //当有仓库id的时候调用编辑仓库接口
902
+                  // warehouseData.id = this.currentReceipt.warehouseId
903
+                  // await uni.$u.api.wareHouseUpdate(warehouseData)
811 904
                 }
812
-              } else if (this.isWarehouse == '2') {
813
-                //等于2的时候不放入仓库表
814
-              }
815 905
 
816
-              this.$refs.uToast.show({
906
+                this.$refs.uToast.show({
817 907
                 type: 'success',
818 908
                 message: '入库成功',
819 909
                 complete: () => {
@@ -1023,15 +1113,12 @@ export default {
1023 1113
 }
1024 1114
 
1025 1115
 .confirm-button-container {
1026
-  display: flex;
1027
-  justify-content: center;
1028
-  align-items: center;
1029 1116
   padding: 40rpx 0;
1030 1117
   margin-top: 20rpx;
1031 1118
 }
1032 1119
 
1033
-.next-btn {
1034
-  width: 95%;
1120
+.confirm-button-container .next-btn {
1121
+  width: 100%;
1035 1122
   height: 80rpx;
1036 1123
   line-height: 80rpx;
1037 1124
   text-align: center;

+ 4 - 4
pages/orderDetailRefactored/components/PageThree.vue

@@ -32,11 +32,11 @@
32 32
       <u-row class="info-row">
33 33
         <u-col span="12">
34 34
           <view class="info-label">支付方式选择</view>
35
-          <u-radio-group iconPlacement="left" v-model="paymentMethodRadio" placement="row"
35
+          <u-radio-group iconPlacement="left" v-model="paymentMethodRadio" placement="column"
36 36
             @change="handlePaymentMethodRadioChange">
37
-            <u-radio shape="circle" label="小葫芦线上支付" name="online" />
38
-            <u-radio shape="circle" label="小葫芦线上支付宝" name="online_alipay" />
39
-            <u-radio shape="circle" label="线下支付" name="offline" />
37
+            <u-radio shape="circle" label="小葫芦线上支付" name="online"  :customStyle="{marginBottom: '16rpx'}"/>
38
+            <u-radio shape="circle" label="小葫芦线上支付宝" name="online_alipay" :customStyle="{marginBottom: '16rpx'}" />
39
+            <u-radio shape="circle" label="线下支付" name="offline"  :customStyle="{marginBottom: '16rpx'}"/>
40 40
           </u-radio-group>
41 41
         </u-col>
42 42
       </u-row>

+ 19 - 1
pages/pagereceivecenter/pagereceivecenter.vue

@@ -174,6 +174,13 @@ export default {
174 174
         },
175 175
         //获取列表数据
176 176
         async getOrderList() {
177
+            // 记录本次请求的筛选条件,用于避免“加载中切换 tab”导致旧请求覆盖新数据
178
+            const requestType = this.activeType;
179
+            const requestStatus = this.activeStatus;
180
+            const requestPageNum = this.activeType === 3
181
+                ? this.commissionQueryParams.pageNum
182
+                : this.queryParams.pageNum;
183
+
177 184
             try {
178 185
                 let result;
179 186
 
@@ -212,9 +219,20 @@ export default {
212 219
                     })
213 220
                 }
214 221
 
222
+                // 若用户在请求期间切换了类型或状态,丢弃本次结果,避免错误显示
223
+                if (this.activeType !== requestType || (this.activeType !== 3 && this.activeStatus !== requestStatus)) {
224
+                    return;
225
+                }
226
+                const currentPageNum = this.activeType === 3
227
+                    ? this.commissionQueryParams.pageNum
228
+                    : this.queryParams.pageNum;
229
+                if (currentPageNum !== requestPageNum) {
230
+                    return;
231
+                }
232
+
215 233
                 // 获取当前使用的查询参数
216 234
                 const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
217
-                
235
+
218 236
                 // 如果是第一页(下拉刷新或初始加载),直接替换列表
219 237
                 if (params.pageNum === 1) {
220 238
                     this.orderList = result.rows;

+ 1 - 1
pages/person/cards/index.vue

@@ -96,7 +96,7 @@
96 96
             </view>
97 97
 
98 98
             <!-- 折线图 -->
99
-            <view class="card_item">
99
+            <view class="card_item" v-if="false">
100 100
                 <view class="chart_header">
101 101
                     <image class="chart_icon" src="../../../static/icons/line.png" alt=""></image>
102 102
                     <text class="card_title">近7天排名折线图</text>

+ 15 - 16
pages/wareHouse/components/edit.vue

@@ -482,27 +482,26 @@ export default {
482 482
     },
483 483
     onLoad(options) {
484 484
         this.getTypeList();
485
-        this.$nextTick(()=>{
485
+        this.$nextTick(async()=>{
486 486
             if(options.formType == 'add'){
487 487
                 this.clearForm()
488 488
             }else if(options.formType == 'edit'){
489
-                uni.$u.api.wareHouseDetail({
489
+                const res = await uni.$u.api.wareHouseDetail({
490 490
                     id: options.id,
491 491
                     userId: this.$store.state.user.userInfo.userId,
492
-                }).then(res => {
493
-                    const keys = Object.keys(res.data)
494
-                    keys.forEach(item => {
495
-                        this.formData[item] = res.data[item]
496
-                    })
497
-                    this.formData.recycleTime = this.$dayjs(res.data.recycleTime).format('YYYY-MM-DD') || ''
498
-                    this.echoInfoType = res.data.type || '1'
499
-                    this.echoInfoProductAttribute = res.data.productAttribute || '1'
500
-                    this.echoInfoProductCondition = res.data.productCondition || '1'
501
-                    this.echoInfoStockStatus = res.data.stockStatus || '0'
502
-                    this.$nextTick(()=>{
503
-                        this.$refs.addForm.resetFields();
504
-                    })
505
-                });
492
+                })
493
+                this.formData = res.data
494
+                this.formData.recycleTime = this.$dayjs(res.data.recycleTime).format('YYYY-MM-DD') || ''
495
+                this.echoInfoType = res.data.type || '1'
496
+                this.formData.type = res.data.type || '1'
497
+                this.echoInfoProductAttribute = res.data.productAttribute || '1'
498
+                this.formData.productAttribute = res.data.productAttribute || '1'
499
+                this.echoInfoProductCondition = res.data.productCondition || '1'
500
+                this.formData.productCondition = res.data.productCondition || '1'
501
+                this.echoInfoStockStatus = res.data.stockStatus || '0'
502
+                this.formData.stockStatus = res.data.stockStatus || '0'
503
+                this.formData.stock = res.data.stock ? res.data.stock : 1
504
+                
506 505
             }
507 506
         })
508 507
     },