diff --git a/components/bookingOrderCard.vue b/components/bookingOrderCard.vue
new file mode 100644
index 0000000..6a21048
--- /dev/null
+++ b/components/bookingOrderCard.vue
@@ -0,0 +1,270 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ order.carNo }}
+
+
+ {{ order.carModel }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 客户信息:{{ order.userName }} {{ order.userPhone }}
+
+
+ 预约时间:{{ order.appointDate }}
+
+
+ 服务顾问:{{ order.counselorName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/projectPicker.vue b/components/projectPicker.vue
index fa4e2b1..05c24c3 100644
--- a/components/projectPicker.vue
+++ b/components/projectPicker.vue
@@ -20,9 +20,9 @@
-
- {{ item.typeName }}
+ {{ item.name }}
@@ -39,6 +39,9 @@
+
+ 新增维修项目
+
@@ -68,6 +71,10 @@ export default {
console.log("执行onload")
this.$refs.popup.open()
this.getProjeectList()
+ if (this.typeList && this.typeList.length > 0) {
+ this.typeId = this.typeList[0].id
+ this.getProject()
+ }
// this.selectedProj = JSON.parse(JSON.stringify(selectedProj))
},
removeProj(index) {
@@ -82,46 +89,44 @@ export default {
}
},
chooseType(type) {
- this.groupList = type.groupList
- this.typeId = type.typeId
+ this.typeId = type.id
+ this.getProject()
+ console.log("this.groupList",this.groupList)
+ // this.typeId = type.typeId
+ },
+ addProject() {
+ uni.navigateTo({
+ url: `/pages/project/project?typeId=${this.typeId}`
+ })
},
getProjeectList() {
- const categoryList = []
- console.log("执行")
const params = {
pageNo: 1,
pageSize: 10000,
type: '03'
}
request({
- url: '/admin-api/repair/project/getRepairProjectAndCateGory',
+ // url: '/admin-api/repair/project/getRepairProjectAndCateGory',
+ url: '/admin-api/conf/baseType/list',
method: 'GET',
params: params
}).then(res => {
console.log("分类",res);
this.typeList = res.data
- // categoryList.push(...res.data)
- // console.log("categoryList",categoryList)
- //
- // categoryList.forEach(item => {
- // let a = {
- // name: item.name,
- // id: item.id,
- // groupList: [
- //
- // ]
- // }
- // this.typeList.push(a)
- // })
- // console.log("typeList",this.typeList)
})
+ },
+ getProject() {
request({
url: '/admin-api/repair/project/page',
method: 'GET',
- params: params
+ params: {
+ pageNo: 1,
+ pageSize: 10000,
+ type: this.typeId
+ }
}).then(res => {
console.log("项目",res);
- this.projectList = res.data.records
+ this.groupList = res.data.records
})
},
diff --git a/pages-order/addOrder/addOrder.vue b/pages-order/addOrder/addOrder.vue
index 38e0c24..304c050 100644
--- a/pages-order/addOrder/addOrder.vue
+++ b/pages-order/addOrder/addOrder.vue
@@ -10,7 +10,7 @@
@@ -37,16 +37,21 @@
车辆信息
-
- activeCarIndex = index">
-
- {{ item.licenseNumber }}
+
+
+ activeCarIndex = index">
+
+ {{ item.licenseNumber }}
+
+
+ +
+
-
+
@@ -383,6 +383,11 @@ export default {
current: index
});
},
+ submit (){
+ uni.navigateTo({
+ url: '/pages-home/home/home'
+ })
+ },
afterRead(file) {
for (let i = 0; i < file.tempFilePaths.length; i++) {
upload({
diff --git a/pages.json b/pages.json
index f949df4..c44dc60 100644
--- a/pages.json
+++ b/pages.json
@@ -63,6 +63,13 @@
"style": {
"navigationBarTitleText": ""
}
+ },
+ {
+ "path": "pages/project/project",
+ "style": {
+ "navigationBarTitleText": "新增维修项目",
+ "enablePullDownRefresh": true
+ }
}
],
"subPackages": [
diff --git a/pages/myCar/carDetail.vue b/pages/myCar/carDetail.vue
index 33a446d..3c06531 100644
--- a/pages/myCar/carDetail.vue
+++ b/pages/myCar/carDetail.vue
@@ -177,6 +177,7 @@ export default {
if (options.car) {
// 有数据为编辑 或 删除
this.car = JSON.parse(decodeURIComponent(options.car));
+ this.brandId = this.car.carBrand
console.log('初始化页面数据', this.car)
this.bo1 = true;
this.bo2 = false;
@@ -199,6 +200,7 @@ export default {
brandSelect(e) {
console.log('e', e)
this.brandId = e.value
+ this.car.brandStr = e.name
// this.getCarModule()
},
getBrandList() {
@@ -238,8 +240,24 @@ export default {
this.datePickerShow = true
},
datePickerConfirm({value}, field, picker) {
- const date = new Date(value)
+ let date;
+
+ // 检查 value 是否为时间戳
+ if (typeof value === 'number') {
+ // 如果是时间戳,确保是毫秒单位
+ date = new Date(value);
+ } else if (typeof value === 'string') {
+ // 如果是日期字符串,尝试解析
+ date = new Date(value);
+ }
+
+ // 检查日期是否有效
+ if (isNaN(date.getTime())) {
+ console.error('Invalid date:', value);
+ return;
+ }
this.car[this.pickerConfirmField] = date.getFullYear() + '-' + (Number(date.getMonth()) + 1 + '').padStart(2, '0') + '-' + (date.getDate() + '').padStart(2, '0')
+ console.log("this.car[this.pickerConfirmField]",this.car[this.pickerConfirmField])
this.datePickerCancel(picker)
},
datePickerCancel(picker) {
@@ -264,11 +282,17 @@ export default {
// bus.$emit('updateCarInfo', this.car)
this.car.brandAndModel = [this.brandId, this.car.carModel]
console.log("car",this.car)
+ //将日期转为时间戳
+ this.car.inspectionDate = new Date(this.car.inspectionDate).getTime()
+ this.car.insuranceDate = new Date(this.car.insuranceDate).getTime()
+ this.car.carRegisterDate = new Date(this.car.carRegisterDate).getTime()
if (this.car.id != null) {
request({
url: '/admin-api/base/carMain/update',
method: 'PUT',
data: this.car,
+ }).then(res => {
+ uni.navigateBack();
})
} else {
request({
diff --git a/pages/project/project.vue b/pages/project/project.vue
new file mode 100644
index 0000000..37dd2f4
--- /dev/null
+++ b/pages/project/project.vue
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/utils/utils.js b/utils/utils.js
index 67e3e5c..1a40c58 100644
--- a/utils/utils.js
+++ b/utils/utils.js
@@ -170,6 +170,34 @@ export function formatTimestamp(timestamp) {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
+/**
+ * 将时间戳转换为指定格式的日期字符串
+ * @param {number} timestamp - 时间戳(毫秒)
+ * @param {string} [format='YYYY-MM-DD'] - 日期格式,默认为 'YYYY-MM-DD'
+ * @returns {string} - 格式化的日期字符串
+ */
+export function formatTimestampCustom(timestamp, format = 'YYYY-MM-DD') {
+ const date = new Date(timestamp);
+
+ const year = date.getFullYear();
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
+ const day = date.getDate().toString().padStart(2, '0');
+ const hour = date.getHours().toString().padStart(2, '0');
+ const minute = date.getMinutes().toString().padStart(2, '0');
+ const second = date.getSeconds().toString().padStart(2, '0');
+
+ const replaceMap = {
+ 'YYYY': year,
+ 'MM': month,
+ 'DD': day,
+ 'HH': hour,
+ 'mm': minute,
+ 'ss': second
+ };
+
+ return format.replace(/YYYY|MM|DD|HH|mm|ss/g, match => replaceMap[match]);
+}
+
/**
* 组装订单对象
* @param order