@@ -348,6 +318,7 @@ import SchoolCourseOrderForm from '@/views/drivingSchool/DriveSchoolPay/form/Sch
import AssignmentCoach from "@/views/drivingSchool/DriveSchoolPay/form/assignmentCoach.vue";
import EndOrder from "@/views/drivingSchool/DriveSchoolPay/form/endOrder.vue";
import SchoolCourseOrderFastAddForm from "@/views/drivingSchool/DriveSchoolPay/form/SchoolCourseOrderFastAddForm.vue";
+import { getSourceUserById } from '@/views/drivingSchool/DriveSchoolPay/api'
export default {
name: "SchoolCourseOrder",
components: {
@@ -398,7 +369,9 @@ export default {
loading: false,
// 学员信息
studentInfo: {}
- }
+ },
+ sourceList: this.getDictDatas("drive_school_channel"),
+ sourceUser:null
};
},
created() {
@@ -452,6 +425,14 @@ export default {
if (!photoStr) return [];
return photoStr.split(',').map(item => this.baseImageUrl + item.trim());
},
+ getSourceLabel(value) {
+ const item = this.sourceList.find(item => item.value === value);
+ return item ? item.label : value; // 如果找不到匹配项,显示原始值
+ },
+ getDictLabel(dictType, value) {
+ const dict = this.getDictDatas(dictType).find(item => item.value === value);
+ return dict ? dict.label : value;
+ },
/* async viewContract(row) {
try {
this.loading = true;
@@ -464,6 +445,19 @@ export default {
this.loading = false;
}
}, */
+ getSourceUserId(userId){
+ getSourceUserById(userId).then(res => {
+ console.log(res)
+ this.sourceUser = res.data.name
+ })
+ },
+ formatReceiptReview(row, column, value) {
+ const map = {
+ 1: '待审核',
+ 0: '已审核'
+ };
+ return map[value] ?? '未知类型';
+ },
async viewContract(row) {
try {
this.loading = true;
@@ -488,6 +482,9 @@ export default {
// 这里调用API获取学员详细信息
const res = await SchoolCourseOrderApi.getStudentDetail(row.userId)
this.studentDialog.studentInfo = res.data
+ if(this.studentDialog.studentInfo.sourceUserId != null){
+ this.getSourceUserId(this.studentDialog.studentInfo.sourceUserId)
+ }
console.log('res',res.data)
} finally {
this.studentDialog.loading = false
@@ -515,6 +512,40 @@ export default {
this.exportLoading = false;
}
},
+ formatDate(row, column, cellValue) {
+ return this.formatTimestampToDate(cellValue);
+ },
+ formatTimestampToDate(timestamp) {
+ if (!timestamp) return '';
+ const date = new Date(timestamp);
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+
+ return `${year}-${month}-${day}`;
+ },
+
+
}
};
+
+
diff --git a/src/views/index.vue b/src/views/index.vue
index d823a61..161a178 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -80,6 +80,11 @@
+