Просмотр исходного кода

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

zhangxin 1 месяц назад
Родитель
Сommit
7fbb11311c

+ 4 - 2
manifest.json

@@ -2,7 +2,7 @@
2 2
     "name" : "小葫芦",
3 3
     "appid" : "__UNI__DDAE2E0",
4 4
     "description" : "",
5
-    "versionName" : "1.2.3",
5
+    "versionName" : "1.2.5",
6 6
     "versionCode" : 123,
7 7
     "transformPx" : false,
8 8
     "app-plus" : {
@@ -206,7 +206,9 @@
206 206
                     "target" : "https://crm.nanjingshiyu.com",
207 207
                     "changeOrigin" : true,
208 208
                     "secure" : false,
209
-                    "pathRewrite": { "^/prod-api": "" }
209
+                    "pathRewrite" : {
210
+                        "^/prod-api" : ""
211
+                    }
210 212
                 }
211 213
             }
212 214
         },

+ 30 - 49
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">
@@ -770,63 +770,44 @@ export default {
770 770
                 const brandId = brandObj ? brandObj.dictValue : ''
771 771
 
772 772
                 //建立入库data
773
+                // 获取 PageThree 的高清实物图的 fileUrl 数组
774
+                // 直接使用 imageUpload 获取图片列表,与 PageThree 保持一致
775
+                let goodPicFileUrls = []
776
+                if (this.currentReceipt.id && this.orderDetail.itemBrand) {
777
+                  try {
778
+                    const list = await imageUpload.getFileList(
779
+                      '2',
780
+                      '3',
781
+                      this.currentReceipt.id,
782
+                      this.orderDetail.itemBrand,
783
+                      this.currentReceipt.clueId
784
+                    )
785
+                    // 获取前6个图片的 fileUrl(与 PageThree 的 displayImages 保持一致)
786
+                    // goodPicFileUrls = (list || []).slice(0, 6).map(item => item.fileUrl).filter(url => url)
787
+                    goodPicFileUrls = (list || []).map(item => item.fileUrl).filter(url => url)
788
+                  } catch (error) {
789
+                    console.error('获取高清实物图失败:', error)
790
+                  }
791
+                }
792
+                
773 793
                 const warehouseData = {
774
-                  // goodPicFileList: [''],//商品图片 必填
775
-                  // desc: '',//商品描述 必填  
794
+                  goodPicFileList: goodPicFileUrls,//商品图片 page3的高清实物图的url数组
776 795
                   type: this.warehouseInfo.category || '',//商品分类 
777
-                  dictLabel: this.currentReceipt.brand || '',//品牌名称 必填
778
-                  dictValue: brandId || '',//品牌id 必填
779
-                  // series: '',//系列
780
-                  // model: this.warehouseInfo.model||'',//型号
781
-                  // dialType: '',//机芯类型
782
-                  // caseMaterial: '',//表壳材质
783
-                  // dialDiameter: '',//表盘直径
784
-                  // material: '',//材质
785
-                  // size: '',//尺寸
786
-                  // yardage: '',//尺码
787
-                  // price: '',//官方指导价
788
-                  // productCondition: '',//商品成色 必填 1-闲置未使用 2-二手 
789
-                  // detailPicFileList: [''],//细节图片
790
-                  // title: '',//商品标题
791
-                  // productNo: '',//商品货号
792
-                  // productAttribute: '1',//商品属性 必填 1-自有商品 2-寄卖商品 3-质押商品 4-其它
793
-                  // stock: '',//库存数量 必填
796
+                  dictLabel: this.currentReceipt.brand || '',//品牌名称 
797
+                  dictValue: brandId || '',//品牌id 
798
+                  indentifyCode:this.warehouseInfo.codeStorage|| '',//独立编码
794 799
                   costPrice: this.computedTotalCost || '',//总成本价
795
-                  // peerPrice: '',//同行价格
796
-                  // agentPrice: '',//代理价格
797
-                  // salePrice: '',//销售价格
798
-                  // productPosition: '',//商品位置
799
-                  // watchYear: '',//手表年份
800
-                  // identifyingPerson: '',//鉴定人员
801
-                  // identifyingPersonId: '',//鉴定人员id
802
-                  // recycleType: '1',//回收类型 1-线上 2-同行 3-门店 4-其它
803
-                  // label: '1', 1-完美 2-普通 3-瑕疵 4-假货 5-亏损
804
-                  // recyclePerson: '',//回收人员
805
-                  // recyclePersonId: '',//回收人员id
806
-                  // recycleBottomDesc: '',//回收留底图描述
807
-                  // recycleBottomFileList: [' '],//回收留底图
808 800
                   recycleTime: dayjs().format('YYYY-MM-DD'),//回收时间 必填
809
-                  // indentifyCode: '',//独立编码
810
-                  // targetAudience: 'general',// general-通用 man-男 woman-女
811
-                  // productCard: '',//商品保卡 has-有 no-无
812
-                  // cardYear: '',//保卡年份 如果有商品保卡就有这个字段,如果没有商品保卡,这个字段为空
813
-                  // productCardPicFileList: [''],//商品保卡图片留底
814
-                  // productTag: '',//商品标签  
815
-                  // productAttachment: '',//商品附件
816
-                  // productDesc: '',//商品备注
817
-                  // productDescPicFileList: [''],//商品备注图片
818
-                  // payType: '1',//付款方式 1:微信 2:支付宝 3:银行卡 4:现金 5:数字货币 6:挂账
819
-                  // submitType: 'inAndUp',//提交类型 onlyIn:仅入库 inAndUp:入库并上架
820
-                  // continuousWarehousing: '0',//是否连续入库 1:是 0:否
821
-
801
+                  stockStatus:0,//库存状态,0待入库,1已入库,因为是我们是预入库,所以是0
802
+                  origin:this.orderDetail.website//来源
822 803
                 }
823 804
                 if (!this.currentReceipt.warehouseId) {
824 805
                   //当没有仓库id的时候调用新增仓库接口
825
-                  await uni.$u.api.addWarehouse(warehouseData)
806
+                  await uni.$u.api.wareHouseAdd(warehouseData)
826 807
                 } else {
827 808
                   //当有仓库id的时候调用编辑仓库接口
828 809
                   warehouseData.id = this.currentReceipt.warehouseId
829
-                  await uni.$u.api.updateWarehouse(warehouseData)
810
+                  await uni.$u.api.wareHouseUpdate(warehouseData)
830 811
                 }
831 812
               } else if (this.isWarehouse == '2') {
832 813
                 //等于2的时候不放入仓库表

+ 144 - 10
pages/orderDetailRefactored/components/PageThree.vue

@@ -12,14 +12,14 @@
12 12
         <u-col span="5.8">
13 13
           <view class="info-label">银行名称</view>
14 14
           <u-input v-model="paymentInfo.bankName" placeholder="请输入银行名称" class="info-input"
15
-            @blur="handleBankNameInput" />
15
+            :disabled="isAlipayPayment" @blur="handleBankNameInput" />
16 16
         </u-col>
17 17
       </u-row>
18 18
       <u-row class="info-row">
19 19
         <u-col span="12">
20
-          <view class="info-label">银行账号</view>
21
-          <u-input v-model="paymentInfo.bankAccount" placeholder="请输入银行账号" class="info-input" type="number"
22
-            @input="handleBankAccountInput" />
20
+          <view class="info-label">{{ bankAccountLabel }}</view>
21
+          <u-input v-model="paymentInfo.bankAccount" :placeholder="bankAccountPlaceholder" class="info-input"
22
+            :type="isAlipayPayment ? 'text' : 'number'" @input="handleBankAccountInput" />
23 23
         </u-col>
24 24
       </u-row>
25 25
       <u-row class="info-row">
@@ -35,6 +35,7 @@
35 35
           <u-radio-group iconPlacement="left" v-model="paymentMethodRadio" placement="row"
36 36
             @change="handlePaymentMethodRadioChange">
37 37
             <u-radio shape="circle" label="小葫芦线上支付" name="online" />
38
+            <u-radio shape="circle" label="小葫芦线上支付宝" name="online_alipay" />
38 39
             <u-radio shape="circle" label="线下支付" name="offline" />
39 40
           </u-radio-group>
40 41
         </u-col>
@@ -42,7 +43,7 @@
42 43
       <u-row class="info-row">
43 44
         <u-col span="12">
44 45
           <view class="info-label">支付方式</view>
45
-          <u-input :disabled="paymentMethodRadio === 'online'" v-model="paymentMethod" placeholder="请输入支付方式"
46
+          <u-input :disabled="paymentMethodRadio === 'online'||paymentMethodRadio === 'online_alipay'" v-model="paymentMethod" placeholder="请输入支付方式"
46 47
             class="info-input" />
47 48
         </u-col>
48 49
       </u-row>
@@ -72,6 +73,11 @@
72 73
               <u-icon name="plus" size="40rpx" color="#999" />
73 74
             </view>
74 75
           </view>
76
+          <view v-if="displayImages.length > 0" class="pricing-button-wrap">
77
+            <view class="pay-now-button pricing-button" @click.stop="handlePricing">
78
+              <text class="button-text">核价</text>
79
+            </view>
80
+          </view>
75 81
         </view>
76 82
       </view>
77 83
     </view>
@@ -126,6 +132,10 @@
126 132
       confirmText="确认并继续付款" :show="riskWarningModalVisible" title="付款警示" :content="'湖南耒阳地区身份证号请确认!'">
127 133
     </u-modal>
128 134
 
135
+    <!-- 核价对话框 -->
136
+    <add-inquiry-dialog ref="pricingDialog" :clueId="pricingClueId" :editOrAdd="pricingEditOrAdd"
137
+      :editInfo="pricingEditInfo" :type="2" />
138
+
129 139
     <u-modal :show="payNowModalVisible" title="确认支付信息" :showConfirmButton="false">
130 140
       <view class="modal-content">
131 141
         <view class="payment-amount-display">¥{{ paymentAmount }}</view>
@@ -162,11 +172,13 @@
162 172
 <script>
163 173
 import PicComp from './PicComp.vue'
164 174
 import imageUpload from '../utils/imageUpload.js'
175
+import addInquiryDialog from '@/components/add-inquiry-dialog/index.vue'
165 176
 
166 177
 export default {
167 178
   name: 'PageThree',
168 179
   components: {
169
-    PicComp
180
+    PicComp,
181
+    addInquiryDialog
170 182
   },
171 183
   props: {
172 184
     orderDetail: {
@@ -207,7 +219,11 @@ export default {
207 219
       payNowModalVisible: false,
208 220
       riskWarningModalVisible: false,
209 221
       unpaidRating: 0,
210
-      followUpNotes: ''
222
+      followUpNotes: '',
223
+      // 核价相关
224
+      pricingClueId: '',
225
+      pricingEditOrAdd: 'receptFormAdd',
226
+      pricingEditInfo: {}
211 227
     }
212 228
   },
213 229
   computed: {
@@ -222,6 +238,18 @@ export default {
222 238
         transform: `translate(${this.currentX - this.startX}px, ${this.currentY - this.startY}px)`,
223 239
         zIndex: 1000
224 240
       }
241
+    },
242
+    // 是否为支付宝支付
243
+    isAlipayPayment() {
244
+      return this.paymentMethodRadio === 'online_alipay'
245
+    },
246
+    // 银行账号标签
247
+    bankAccountLabel() {
248
+      return this.isAlipayPayment ? '支付宝账号' : '银行账号'
249
+    },
250
+    // 银行账号占位符
251
+    bankAccountPlaceholder() {
252
+      return this.isAlipayPayment ? '请输入支付宝账号' : '请输入银行账号'
225 253
     }
226 254
   },
227 255
   watch: {
@@ -303,6 +331,10 @@ export default {
303 331
       if (value === '小葫芦线上支付') {
304 332
         this.paymentMethod = '小葫芦线上支付'
305 333
         this.paymentMethodRadio = 'online'
334
+      } else if (value === '小葫芦线上支付宝') {
335
+        this.paymentMethod = '小葫芦线上支付宝'
336
+        this.paymentMethodRadio = 'online_alipay'
337
+        this.paymentInfo.bankName = '支付宝'
306 338
       } else {
307 339
         this.paymentMethod = value || ''
308 340
         this.paymentMethodRadio = 'offline'
@@ -315,8 +347,20 @@ export default {
315 347
     handlePaymentMethodRadioChange(value) {
316 348
       if (value === 'online') {
317 349
         this.paymentMethod = '小葫芦线上支付'
350
+        // 恢复银行名称输入框
351
+        if (this.paymentInfo.bankName === '支付宝') {
352
+          this.paymentInfo.bankName = ''
353
+        }
354
+      } else if (value === 'online_alipay') {
355
+        this.paymentMethod = '小葫芦线上支付宝'
356
+        // 自动设置银行名称为支付宝
357
+        this.paymentInfo.bankName = '支付宝'
318 358
       } else {
319 359
         this.paymentMethod = ''
360
+        // 恢复银行名称输入框
361
+        if (this.paymentInfo.bankName === '支付宝') {
362
+          this.paymentInfo.bankName = ''
363
+        }
320 364
       }
321 365
     },
322 366
 
@@ -579,8 +623,8 @@ export default {
579 623
         id: this.orderDetail.id,
580 624
         paymentMethod: this.paymentMethod || ''
581 625
       })
582
-      //如果是小葫芦线上刚支付就调用接口,如果不是小葫芦线上支付就不要调用接口,直接点击下一步
583
-      if (this.paymentMethod === '小葫芦线上支付') {
626
+      //如果是小葫芦线上支付或者小葫芦线上支付宝就调用接口,如果不是小葫芦线上支付就不要调用接口,直接点击下一步
627
+      if (this.paymentMethod === '小葫芦线上支付' || this.paymentMethod === '小葫芦线上支付宝') {
584 628
         this.$emit('confirm-pay')
585 629
       } else {
586 630
         this.handleNext()
@@ -658,7 +702,88 @@ export default {
658 702
           ...this.paymentInfo
659 703
         }
660 704
       })
661
-    }
705
+    },
706
+
707
+    /**
708
+     * 核价
709
+     */
710
+    async handlePricing() {
711
+      const brandList = await this.$getDicts("crm_form_brand");
712
+
713
+
714
+      if (!this.currentReceipt || !this.currentReceipt.clueId) {
715
+        uni.$u.toast('缺少线索ID')
716
+        return
717
+      }
718
+      if (!this.currentReceipt.brand) {
719
+        uni.$u.toast('缺少品牌信息')
720
+        return
721
+      }
722
+      if (!this.displayImages || this.displayImages.length === 0) {
723
+        uni.$u.toast('请先上传图片')
724
+        return
725
+      }
726
+
727
+      this.pricingClueId = this.currentReceipt.clueId
728
+
729
+      // brand 是品牌的 id(dictValue),itemBrand 是品牌的 label(dictLabel)
730
+      const brandDictLabel = this.currentReceipt.brand
731
+      const brandDictValue = brandList.find(item => item.dictLabel === this.currentReceipt.brand).dictValue;
732
+
733
+      // 将图片转换为 imgsUrl 格式
734
+      const imgsUrl = this.displayImages.map(item => item.fileUrl).filter(url => url)
735
+
736
+      // 检查是否已有核价记录
737
+      try {
738
+        const data = {
739
+          clueId: this.currentReceipt.clueId,
740
+          type: 2
741
+        }
742
+        const res = await uni.$u.api.inquiryDetail(data)
743
+        if (res.code === 200 && res.data) {
744
+          // 编辑模式:保留原有数据,但更新品牌和图片
745
+          this.pricingEditOrAdd = 'editForm'
746
+          this.pricingEditInfo = {
747
+            ...res.data,
748
+            dictLabel: brandDictLabel || res.data.dictLabel,
749
+            dictValue: brandDictValue || res.data.dictValue,
750
+            imgsUrl: imgsUrl.length > 0 ? imgsUrl : (res.data.imgsUrl || [])
751
+          }
752
+          this.$nextTick(() => {
753
+            this.$refs.pricingDialog.showDialog()
754
+          })
755
+        } else {
756
+          // 新增模式:设置品牌和图片
757
+          this.pricingEditOrAdd = 'editForm'
758
+          this.pricingEditInfo = {
759
+            dictLabel: brandDictLabel,
760
+            dictValue: brandDictValue,
761
+            imgsUrl: imgsUrl,
762
+            model: '',
763
+            code: '',
764
+            price: ''
765
+          }
766
+          this.$nextTick(() => {
767
+            this.$refs.pricingDialog.showDialog()
768
+          })
769
+        }
770
+      } catch (error) {
771
+        // 如果没有记录,则新增
772
+        this.pricingEditOrAdd = 'receptFormAdd'
773
+        this.pricingEditInfo = {
774
+          dictLabel: brandDictLabel,
775
+          dictValue: brandDictValue,
776
+          imgsUrl: imgsUrl,
777
+          model: '',
778
+          code: '',
779
+          price: ''
780
+        }
781
+        this.$nextTick(() => {
782
+          this.$refs.pricingDialog.showDialog()
783
+        })
784
+      }
785
+    },
786
+
662 787
   }
663 788
 }
664 789
 </script>
@@ -794,6 +919,15 @@ export default {
794 919
   cursor: pointer;
795 920
 }
796 921
 
922
+.pricing-button-wrap {
923
+  width: 100%;
924
+  margin-top: 20rpx;
925
+}
926
+
927
+.pricing-button {
928
+  margin-top: 0;
929
+}
930
+
797 931
 .payment-card {
798 932
   margin-top: 20rpx;
799 933
 }

+ 0 - 4
utils/api.js

@@ -148,10 +148,6 @@ const install = (Vue, vm) => {
148 148
 
149 149
 
150 150
 
151
-		//新增仓库接口
152
-		addWarehouse: (data) => http.post(store.state.user.path + '/wareHouse/wareHouseAdd', data), 
153
-		//编辑仓库接口
154
-		updateWarehouse: (data) => http.post(store.state.user.path + '/wareHouse/wareHouseUpdate', data), 
155 151
 
156 152
 	}
157 153
 }