|
|
@@ -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
|
}
|