|
|
@@ -59,7 +59,10 @@
|
|
59
|
59
|
</u-col>
|
|
60
|
60
|
<u-col span="6">
|
|
61
|
61
|
<view class="info-label">核价价格</view>
|
|
62
|
|
- <view class="info-value">¥{{ currentReceipt.inquiryPrice || 0 }}</view>
|
|
|
62
|
+ <view class="info-value">
|
|
|
63
|
+ ¥{{ currentReceipt.inquiryPrice || 0 }}
|
|
|
64
|
+ <text v-if="hasMorePricingPrice" class="pricing-more" @click.stop="handlePricing">更多</text>
|
|
|
65
|
+ </view>
|
|
63
|
66
|
</u-col>
|
|
64
|
67
|
</u-row>
|
|
65
|
68
|
</view>
|
|
|
@@ -153,9 +156,10 @@
|
|
153
|
156
|
confirmText="确认并继续付款" :show="riskWarningModalVisible" title="付款警示" :content="'湖南耒阳地区身份证号请确认!'">
|
|
154
|
157
|
</u-modal>
|
|
155
|
158
|
|
|
156
|
|
- <!-- 核价对话框 -->
|
|
|
159
|
+ <!-- 核价对话框:与公海询价一致,不传 isShowHistory(不显示核价历史),编辑用 editForm(不显示价格/备注输入栏) -->
|
|
157
|
160
|
<add-inquiry-dialog ref="pricingDialog" :clueId="pricingClueId" :editOrAdd="pricingEditOrAdd"
|
|
158
|
|
- :editInfo="pricingEditInfo" :type="2" title="询价" />
|
|
|
161
|
+ :editInfo="pricingEditInfo" :type="2" title="核价" :isShowChart="pricingIsShowChart"
|
|
|
162
|
+ @submitSuccess="onPricingSuccess" />
|
|
159
|
163
|
|
|
160
|
164
|
<u-modal :show="payNowModalVisible" title="确认支付信息" :showConfirmButton="false">
|
|
161
|
165
|
<view class="modal-content">
|
|
|
@@ -245,7 +249,8 @@ export default {
|
|
245
|
249
|
// 核价相关
|
|
246
|
250
|
pricingClueId: '',
|
|
247
|
251
|
pricingEditOrAdd: 'receptFormAdd',
|
|
248
|
|
- pricingEditInfo: {}
|
|
|
252
|
+ pricingEditInfo: {},
|
|
|
253
|
+ pricingIsShowChart: false
|
|
249
|
254
|
}
|
|
250
|
255
|
},
|
|
251
|
256
|
computed: {
|
|
|
@@ -273,9 +278,15 @@ export default {
|
|
273
|
278
|
bankAccountPlaceholder() {
|
|
274
|
279
|
return this.isAlipayPayment ? '请输入支付宝账号' : '请输入银行账号'
|
|
275
|
280
|
},
|
|
276
|
|
- // 是否有核价信息
|
|
|
281
|
+ // 是否有核价信息(至少一人出价时才展示卡片)
|
|
277
|
282
|
hasInquiryInfo() {
|
|
278
|
|
- return this.currentReceipt && (this.currentReceipt.inquiryCount || this.currentReceipt.inquiryPrice)
|
|
|
283
|
+ const n = this.currentReceipt && this.currentReceipt.inquiryCount
|
|
|
284
|
+ return n != null && Number(n) > 0
|
|
|
285
|
+ },
|
|
|
286
|
+ // 是否有多人核价出价(显示「更多」)
|
|
|
287
|
+ hasMorePricingPrice() {
|
|
|
288
|
+ const n = this.currentReceipt && this.currentReceipt.inquiryCount
|
|
|
289
|
+ return (n != null && Number(n) > 1)
|
|
279
|
290
|
}
|
|
280
|
291
|
},
|
|
281
|
292
|
watch: {
|
|
|
@@ -833,12 +844,10 @@ export default {
|
|
833
|
844
|
},
|
|
834
|
845
|
|
|
835
|
846
|
/**
|
|
836
|
|
- * 核价
|
|
|
847
|
+ * 核价:与公海询价一致逻辑。count 为 null → 未提出,新增;count 为 0 → 已提出无人出价,回显不显示柱状图;count > 0 → 显示柱状图。多人出价时核价信息区显示「更多」点击也走此处并带柱状图。
|
|
837
|
848
|
*/
|
|
838
|
849
|
async handlePricing() {
|
|
839
|
|
- const brandList = await this.$getDicts("crm_form_brand");
|
|
840
|
|
-
|
|
841
|
|
-
|
|
|
850
|
+ const brandList = await this.$getDicts('crm_form_brand')
|
|
842
|
851
|
if (!this.currentReceipt || !this.currentReceipt.clueId) {
|
|
843
|
852
|
uni.$u.toast('缺少线索ID')
|
|
844
|
853
|
return
|
|
|
@@ -852,67 +861,77 @@ export default {
|
|
852
|
861
|
return
|
|
853
|
862
|
}
|
|
854
|
863
|
|
|
855
|
|
- //我这里询价要用receiptid来询价
|
|
856
|
864
|
this.pricingClueId = this.currentReceipt.id
|
|
857
|
|
-
|
|
858
|
|
- // brand 是品牌的 id(dictValue),itemBrand 是品牌的 label(dictLabel)
|
|
859
|
865
|
const brandDictLabel = this.currentReceipt.brand
|
|
860
|
|
- const brandDictValue = brandList.find(item => item.dictLabel === this.currentReceipt.brand).dictValue;
|
|
861
|
|
-
|
|
862
|
|
- // 将图片转换为 imgsUrl 格式
|
|
|
866
|
+ const brandDictValue = brandList.find(item => item.dictLabel === this.currentReceipt.brand)?.dictValue
|
|
863
|
867
|
const imgsUrl = this.displayImages.map(item => item.fileUrl).filter(url => url)
|
|
864
|
868
|
|
|
865
|
|
- // 检查是否已有核价记录
|
|
866
|
|
- try {
|
|
867
|
|
- const data = {
|
|
868
|
|
- clueId: this.pricingClueId,
|
|
869
|
|
- type: 2
|
|
|
869
|
+ const count = this.currentReceipt.inquiryCount != null ? Number(this.currentReceipt.inquiryCount) : null
|
|
|
870
|
+
|
|
|
871
|
+ if (count === null) {
|
|
|
872
|
+ // 未提出核价:新增
|
|
|
873
|
+ this.pricingIsShowChart = false
|
|
|
874
|
+ this.pricingEditOrAdd = 'receptFormAdd'
|
|
|
875
|
+ this.pricingEditInfo = {
|
|
|
876
|
+ dictLabel: brandDictLabel,
|
|
|
877
|
+ dictValue: brandDictValue,
|
|
|
878
|
+ imgsUrl,
|
|
|
879
|
+ model: this.currentReceipt.model,
|
|
|
880
|
+ code: this.currentReceipt.code || '',
|
|
|
881
|
+ price: ''
|
|
870
|
882
|
}
|
|
|
883
|
+ this.$nextTick(() => this.$refs.pricingDialog.showDialog())
|
|
|
884
|
+ return
|
|
|
885
|
+ }
|
|
|
886
|
+
|
|
|
887
|
+ // 已提出核价(count 为 0 或 >0):拉详情回显
|
|
|
888
|
+ try {
|
|
|
889
|
+ const data = { clueId: this.pricingClueId, type: 2 }
|
|
871
|
890
|
const res = await uni.$u.api.inquiryDetail(data)
|
|
872
|
891
|
if (res.code === 200 && res.data) {
|
|
873
|
|
- // 编辑模式:保留原有数据,但更新品牌和图片
|
|
874
|
|
- this.pricingEditOrAdd = 'edit'
|
|
|
892
|
+ this.pricingEditOrAdd = 'editForm'
|
|
|
893
|
+ this.pricingIsShowChart = (res.data.count != null && Number(res.data.count) > 0)
|
|
875
|
894
|
this.pricingEditInfo = {
|
|
876
|
895
|
...res.data,
|
|
877
|
|
- dictLabel: brandDictLabel || res.data.dictLabel,
|
|
878
|
|
- dictValue: brandDictValue || res.data.dictValue,
|
|
879
|
|
- imgsUrl: imgsUrl.length > 0 ? imgsUrl : (res.data.imgsUrl || [])
|
|
|
896
|
+ // dictLabel: brandDictLabel || res.data.dictLabel,
|
|
|
897
|
+ // dictValue: brandDictValue || res.data.dictValue,
|
|
|
898
|
+ // imgsUrl: imgsUrl.length > 0 ? imgsUrl : (res.data.imgsUrl || [])
|
|
880
|
899
|
}
|
|
881
|
|
- this.$nextTick(() => {
|
|
882
|
|
- this.$refs.pricingDialog.showDialog()
|
|
883
|
|
- })
|
|
|
900
|
+ this.$nextTick(() => this.$refs.pricingDialog.showDialog())
|
|
884
|
901
|
} else {
|
|
885
|
|
- // 新增模式:设置品牌和图片
|
|
|
902
|
+ this.pricingIsShowChart = false
|
|
886
|
903
|
this.pricingEditOrAdd = 'receptFormAdd'
|
|
887
|
904
|
this.pricingEditInfo = {
|
|
888
|
905
|
dictLabel: brandDictLabel,
|
|
889
|
906
|
dictValue: brandDictValue,
|
|
890
|
|
- imgsUrl: imgsUrl,
|
|
|
907
|
+ imgsUrl,
|
|
891
|
908
|
model: this.currentReceipt.model,
|
|
892
|
|
- code: '',
|
|
|
909
|
+ code: this.currentReceipt.code || '',
|
|
893
|
910
|
price: ''
|
|
894
|
911
|
}
|
|
895
|
|
- this.$nextTick(() => {
|
|
896
|
|
- this.$refs.pricingDialog.showDialog()
|
|
897
|
|
- })
|
|
|
912
|
+ this.$nextTick(() => this.$refs.pricingDialog.showDialog())
|
|
898
|
913
|
}
|
|
899
|
|
- } catch (error) {
|
|
900
|
|
- // 如果没有记录,则新增
|
|
901
|
|
- this.pricingEditOrAdd = 'add'
|
|
|
914
|
+ } catch (e) {
|
|
|
915
|
+ this.pricingIsShowChart = false
|
|
|
916
|
+ this.pricingEditOrAdd = 'receptFormAdd'
|
|
902
|
917
|
this.pricingEditInfo = {
|
|
903
|
918
|
dictLabel: brandDictLabel,
|
|
904
|
919
|
dictValue: brandDictValue,
|
|
905
|
|
- imgsUrl: imgsUrl,
|
|
|
920
|
+ imgsUrl,
|
|
906
|
921
|
model: this.currentReceipt.model,
|
|
907
|
|
- code: '',
|
|
|
922
|
+ code: this.currentReceipt.code || '',
|
|
908
|
923
|
price: ''
|
|
909
|
924
|
}
|
|
910
|
|
- this.$nextTick(() => {
|
|
911
|
|
- this.$refs.pricingDialog.showDialog()
|
|
912
|
|
- })
|
|
|
925
|
+ this.$nextTick(() => this.$refs.pricingDialog.showDialog())
|
|
913
|
926
|
}
|
|
914
|
927
|
},
|
|
915
|
928
|
|
|
|
929
|
+ /** 核价提交成功后刷新当前回单,以便核价人数/价格更新 */
|
|
|
930
|
+ onPricingSuccess() {
|
|
|
931
|
+ this.$refs.pricingDialog.closeDialog()
|
|
|
932
|
+ this.$emit('price-updated')
|
|
|
933
|
+ },
|
|
|
934
|
+
|
|
916
|
935
|
}
|
|
917
|
936
|
}
|
|
918
|
937
|
</script>
|
|
|
@@ -951,6 +970,15 @@ export default {
|
|
951
|
970
|
display: block;
|
|
952
|
971
|
}
|
|
953
|
972
|
|
|
|
973
|
+.pricing-more {
|
|
|
974
|
+ margin-left: 12rpx;
|
|
|
975
|
+ font-size: 24rpx;
|
|
|
976
|
+ color: #3c9cff;
|
|
|
977
|
+ border: 1rpx solid #3c9cff;
|
|
|
978
|
+ border-radius: 10rpx;
|
|
|
979
|
+ padding: 4rpx 12rpx;
|
|
|
980
|
+}
|
|
|
981
|
+
|
|
954
|
982
|
.info-input {
|
|
955
|
983
|
border-radius: 8rpx;
|
|
956
|
984
|
border: 1rpx solid #e5e7eb;
|