From 3d165b3a139f16a2c87bfa3af0e8f492514a7a9d Mon Sep 17 00:00:00 2001
From: jjLv <1981429112@qq.com>
Date: Sun, 1 Dec 2024 13:17:34 +0800
Subject: [PATCH] =?UTF-8?q?=E6=89=BF=E7=A7=9F=E6=96=B9=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/user/orderManagement/detail.vue | 188 +++++++++++++++-----
src/views/user/orderManagement/index.vue | 84 +++++----
src/views/user/orderManagementCz/detail.vue | 6 +-
src/views/user/orderManagementCz/index.vue | 43 +----
4 files changed, 209 insertions(+), 112 deletions(-)
diff --git a/src/views/user/orderManagement/detail.vue b/src/views/user/orderManagement/detail.vue
index ca5afe8..1366702 100644
--- a/src/views/user/orderManagement/detail.vue
+++ b/src/views/user/orderManagement/detail.vue
@@ -62,6 +62,20 @@ const getStepTitle = (stepId:number)=> {
return ''; // 默认返回空描述
}
+// 计算是否过期
+const isExpired=(goods:any)=> {
+ // 获取当前日期并去掉时间部分
+ const today = new Date();
+ today.setHours(0, 0, 0, 0);
+
+ // 将endtime转为Date对象
+ const endTime = new Date(goods.endTime.replace(/-/g, "/"));
+
+ // 判断endtime是否早于今天
+ return endTime < today;
+}
+
+
const getId = ()=>{
orderStatusTemp.value = Number(route.query.orderStatusTemp)
idTemp.value = String(route.query.idTemp)
@@ -70,7 +84,7 @@ const getId = ()=>{
/** 查询列表 */
const getList = async () => {
let params = {
- id: idTemp.value
+ orderId: idTemp.value
}
const res: any = await getOrderListInfoApi(params)
@@ -174,66 +188,90 @@ const time = ref([])
-
-
-
+
+
+
+
+
+
+
{{ goods.deviceName }}
租期:{{ goods.days }}{{ ' ' + '天' }}
-
租金:{{ goods.dayLeasePrice }}{{ ' ' + '元/天' }}
-
数量:{{ goods.num }}{{ ' ' + '台' }}
+
+
租金:{{ goods.dayLeasePrice }}{{ ' ' + '元/天' }}
+
数量:{{ goods.num }}{{ ' ' + '台' }}
+
+
+
-
+
总费用
- {{goods.costs}}
+ {{cardList.cost}}
租期
- {{ goods.rentBeginTime }}
+ {{ cardList.startTime }}
{{ '至' }}
- {{ goods.rentEndTime }}
+ {{ cardList.endTime }}
-
- {{"未下单"}}
- {{"已下单"}}
- {{"待出库"}}
- {{"待收货"}}
- {{"租赁中"}}
- {{"已退租"}}
- {{"已完成"}}
- {{"已驳回"}}
-
-
-
-
-
+
+ {{ '待收货' }}
+
+
+ {{ '租赁中' }}
+ (已过期)
+
+
+ {{ '租赁中' }}
+
+
+ {{ '已退租' }}
+
+
+ {{ '已完成' }}
+
+
+ {{ '已驳回' }}
+
+
+
@@ -319,5 +357,71 @@ const time = ref([])
}
}
}
+ .cart-listAll{
+ margin: 15px 0;
+ display: flex;
+ align-items: center;
+ font-size: 13px;
+
+ div {
+ text-align: center;
+ }
+ .cart-list {
+ margin: 15px 0;
+ display: flex;
+ align-items: center;
+ font-size: 13px;
+
+ div {
+ text-align: center;
+ }
+
+ .goods-info {
+ display: flex;
+ align-content: center;
+
+ img {
+ width: 180px;
+ height: 80px;
+ }
+
+ .goods-code {
+ margin-left: 110px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
+
+ div {
+ text-align: left;
+ }
+ }
+ }
+
+ .lease-date {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ font-size: 12px;
+ }
+
+ .red-font {
+ color: #ff4800;
+ font-weight: bold;
+ }
+ }
+ .lease-date {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ font-size: 12px;
+ }
+
+ .red-font {
+ color: #ff4800;
+ font-weight: bold;
+ }
+ }
}
diff --git a/src/views/user/orderManagement/index.vue b/src/views/user/orderManagement/index.vue
index 087ba71..be45b9e 100644
--- a/src/views/user/orderManagement/index.vue
+++ b/src/views/user/orderManagement/index.vue
@@ -77,7 +77,7 @@ const getList = async () => {
const handleViewOrder = (index: Number, row: any) => {
router.push({
name: 'orderManagementInfo',
- query: { orderStatusTemp: Number(row.orderStatus), idTemp: row.id },
+ query: { orderStatusTemp: Number(row.orderStatus), idTemp: row.orderId },
})
}
@@ -123,26 +123,12 @@ const onChangeGoods = (index: number) => {
// 确认收获按钮
const confirmReceipt = async (index: number) => {
- let ids: number[] = [];
- cardList.value[index].detailsList.forEach((item:any)=>{
- if(item.orderStatus=="3"&&item.isChecked==true){
- ids.push(item.id)
- }
- })
- if(ids.length==0){
- ElMessage({
- showClose: false,
- message: '请选择装备',
- type: 'error',
- })
- return
- }else{
ElMessageBox.confirm('是否确定收获?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
- return passApi({'ids':ids,'orderStatus':4})
+ return passApi({'orderId':cardList.value[index].orderId,'orderStatus':4})
}).then((res) => {
if (res.code === 200) {
ElMessage({
@@ -153,7 +139,7 @@ const onChangeGoods = (index: number) => {
getList()
}
}).catch(() => {})
- }
+
}
@@ -164,7 +150,7 @@ const isExpired=(goods:any)=> {
today.setHours(0, 0, 0, 0);
// 将endtime转为Date对象
- const endTime = new Date(goods.rentEndTime.replace(/-/g, "/"));
+ const endTime = new Date(goods.endTime.replace(/-/g, "/"));
// 判断endtime是否早于今天
return endTime < today;
@@ -179,15 +165,13 @@ const dialogVisible: any = ref(false)
const dialogImageUrl = ref('')
// 发起退租
-const handleViewBack = async (index: Number, row: any) => {
- let ids: number[] = [];
- ids.push(row.id)
+const handleViewBack = async (row:any) => {
ElMessageBox.confirm('是否确定发起退租?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
- return passApi({'ids':ids,'orderStatus':5})
+ return passApi({'orderId':row.orderId,'orderStatus':5})
}).then((res) => {
if (res.code === 200) {
ElMessage({
@@ -292,6 +276,24 @@ const tableData4: any = ref([
dialogFormVisibleSettleList.value = true
}
+const settleWordTitle = ref('')
+const dialogFormVisibleSettleWord: any = ref(false)
+ //租赁协议
+ const handleViewWord = () => {
+ settleWordTitle.value = '租赁协议'
+ console.log(12313131)
+ moneyParams1.value = {
+ /* 设备状态 */
+ maStatus: 15,
+ detectionList: [],
+ insureList: [],
+ picList: []
+ }
+ // 打开租赁协议弹框
+ dialogFormVisibleSettleWord.value = true
+ }
+
+
@@ -434,7 +436,7 @@ const tableData4: any = ref([
总费用
- {{ item.orderTime }}
+ {{ item.cost }}
租期
- {{ item.orderTime }}
+ {{ item.startTime }}
{{ '至' }}
- {{ item.orderTime }}
+ {{ item.endTime }}
+
+
+
+

+
+
+
+
+