From 542f2f5f4e8097bd9d436a52119feeeec63bdfaa Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Thu, 21 Mar 2024 10:52:05 +0800
Subject: [PATCH] 二手交易提交页面必填校验无效问题修复,地址自动回填

---
 api/reporting/reporting.js |    2 +-
 subPackage/label/form.vue  |   47 ++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/api/reporting/reporting.js b/api/reporting/reporting.js
index f5ab196..ae5a86e 100644
--- a/api/reporting/reporting.js
+++ b/api/reporting/reporting.js
@@ -106,7 +106,7 @@
 //获取打金店、二手车交易、二手手机维修详情
 export const getLabelReportingDetail = (params) => {
 	return http.request({
-		url: '/blade-taskLabelReportingEvent/taskLabelReportingEvent/detail',
+		url: '/blade-taskLabelReportingEvent/taskLabelReportingEvent/getDetail',
 		method: 'get',
 		params: {
 			...params
diff --git a/subPackage/label/form.vue b/subPackage/label/form.vue
index dd9a29e..c9e4f1c 100644
--- a/subPackage/label/form.vue
+++ b/subPackage/label/form.vue
@@ -96,6 +96,9 @@
 		getLabelReportingDetail,
 		setLabelReporting
 	} from "@/api/reporting/reporting";
+	import {
+		getPlaceDetail
+	} from "@/api/place/place"
 	export default {
 		mixins: [uploadMixin],
 		data() {
@@ -116,22 +119,30 @@
 					reportType: ""
 				},
 				rules: {
-					'info.districtName': {
+					districtName: {
 						required: true,
 						message: '请输入场所名称',
 						trigger: ['blur', 'change']
 					},
-					'info.transactionObject': {
+					transactionObject: {
 						required: true,
 						message: '请输入物品名称',
 						trigger: ['blur', 'change']
 					},
-					'info.owner': {
+					owner: {
 						required: true,
 						message: '请输入交易人姓名',
 						trigger: ['blur', 'change']
 					},
-					'info.phoneNumber': [{
+					goodsNums:[
+						{
+								type: 'number',
+								required: true,
+								message: '请输入物品数量',
+								trigger: ['blur', 'change']
+							}
+					],
+					phoneNumber: [{
 							type: 'number',
 							required: true,
 							message: '请输入交易人手机号',
@@ -145,7 +156,7 @@
 							trigger: ['change', 'blur']
 						}
 					],
-					'info.idCard': [{
+					idCard: [{
 							type: 'string',
 							required: false,
 							message: '请输入身份证号码',
@@ -163,18 +174,18 @@
 						}
 					],
 
-					'info.transactionMoney': {
+					transactionMoney: {
 						required: true,
 						message: '请输入交易金额',
 						trigger: ['blur', 'change']
 					},
-					'info.localtion': {
+					localtion: {
 						type: 'string',
 						required: true,
 						message: '请输入交易位置',
 						trigger: ['blur', 'change']
 					},
-					'info.transactionProcess': {
+					transactionProcess: {
 						type: 'string',
 						required: false,
 						message: '请输入交易过程',
@@ -190,7 +201,8 @@
 			}
 		},
 		onLoad(option) {
-			console.log(option);
+			console.log(option,99999);
+			const {houseCode} = option;
 			if (option.id) {
 				this.isEdit = true;
 				this.id = option.id;
@@ -217,10 +229,23 @@
 				this.$set(this.info, "districtName", siteInfo.name);
 				this.$set(this.info, "userId", userInfo.user_id);
 			}
-
+			
+			if(houseCode){
+				// 获取地址
+				this.getPlaceDetail(houseCode)
+			}
 		},
 		methods: {
-
+			getPlaceDetail(houseCode){
+				getPlaceDetail({
+					houseCode: houseCode
+				}).then(res => {
+					if (res.code == 200) {
+						let data = res.data;
+						this.info.localtion = data.location;
+					}
+				})
+			},
 			getDetail(id) {
 				getLabelReportingDetail({
 					taskId: id

--
Gitblit v1.9.3