承租方订单管理

This commit is contained in:
jjLv 2024-12-01 13:17:34 +08:00
parent 7758014fa1
commit 3d165b3a13
4 changed files with 209 additions and 112 deletions

View File

@ -62,6 +62,20 @@ const getStepTitle = (stepId:number)=> {
return ''; // return ''; //
} }
//
const isExpired=(goods:any)=> {
//
const today = new Date();
today.setHours(0, 0, 0, 0);
// endtimeDate
const endTime = new Date(goods.endTime.replace(/-/g, "/"));
// endtime
return endTime < today;
}
const getId = ()=>{ const getId = ()=>{
orderStatusTemp.value = Number(route.query.orderStatusTemp) orderStatusTemp.value = Number(route.query.orderStatusTemp)
idTemp.value = String(route.query.idTemp) idTemp.value = String(route.query.idTemp)
@ -70,7 +84,7 @@ const getId = ()=>{
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
let params = { let params = {
id: idTemp.value orderId: idTemp.value
} }
const res: any = await getOrderListInfoApi(params) const res: any = await getOrderListInfoApi(params)
@ -174,66 +188,90 @@ const time = ref([])
</div> </div>
</div> </div>
<div class="cart-tbody" > <el-row class="cart-listAll" :style="{background: cardList.orderStatus=='6' ? '#EBEEF5':'white'}">
<el-row class="cart-list" v-for="(goods, j) in cardList.detailsList" :key="j"> <el-col :span="1" >
<el-col :span="9" class="goods-info"> <!-- <div style="text-align: center">
<el-checkbox :key="numberTemp" v-model="goods.isChecked" @change="onChangeGoods(index)" :disabled="goods.orderStatus!='2'">
</el-checkbox>
</div> -->
</el-col>
<el-col :span="7" >
<el-row class="cart-list" v-for="(goods, j) in cardList.detailsList" :key="j" >
<el-col class="goods-info">
<el-col :span="7"> <el-col :span="7">
<img :src="goods.url" alt="" /> <img :src="goods.url" alt="" />
</el-col> </el-col>
<div class="goods-code"> <div class="goods-code">
<div style="font-size: 10px; font-weight: bold">{{ goods.deviceName }}</div> <div style="font-size: 10px; font-weight: bold">{{ goods.deviceName }}</div>
<div>租期{{ goods.days }}{{ ' ' + '天' }}</div> <div>租期{{ goods.days }}{{ ' ' + '天' }}</div>
<div>租金{{ goods.dayLeasePrice }}{{ ' ' + '元/天' }}</div> <div style="display:flex;justify-content:space-between;width:100%;">
<div>数量{{ goods.num }}{{ ' ' + '台' }}</div> <div style="flex:1;text-align:left;width:220px">租金{{ goods.dayLeasePrice }}{{ ' ' + '元/天' }}</div>
<div style="flex:1;text-align:left;">数量{{ goods.num }}{{ ' ' + '台' }}</div>
</div>
</div> </div>
</el-col>
</el-row>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="4">
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px"> <div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">
总费用 总费用
</div> </div>
<div class="red-font">{{goods.costs}}</div> <div class="red-font">{{cardList.cost}}</div>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">租期</div> <div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">租期</div>
<div style="color: black; font-weight: bold"> <div style="color: black; font-weight: bold">
{{ goods.rentBeginTime }} {{ cardList.startTime }}
</div> </div>
<div style="margin-top:3px;margin-bottom:3px">{{ '至' }}</div> <div style="margin-top:3px;margin-bottom:3px">{{ '至' }}</div>
<div style="color: black; font-weight: bold">{{ goods.rentEndTime }}</div> <div style="color: black; font-weight: bold">{{ cardList.endTime }}</div>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="4" >
<div v-if="goods.orderStatus=='0'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"未下单"}}</div> <div
<div v-if="goods.orderStatus=='1'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"已下单"}}</div> v-if="cardList.orderStatus == '2'"
<div v-if="goods.orderStatus=='2'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"待出库"}}</div> style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: blue"
<div v-if="goods.orderStatus=='3'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"待收货"}}</div> >
<div v-if="goods.orderStatus=='4'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"租赁中"}}</div> {{ '待出库' }}
<div v-if="goods.orderStatus=='5'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"已退租"}}</div>
<div v-if="goods.orderStatus=='6'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"已完成"}}</div>
<div v-if="goods.orderStatus=='7'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"已驳回"}}</div>
</el-col>
<!-- <el-col :span="3">
<div>
<el-button
@click="handleViewOrder(j)"
type="text"
size="mini"
style="color: #blue; font-weight: bold"
>
出库
</el-button>
<el-button
@click="handleViewOrder(j)"
type="text"
size="mini"
style="color: #blue; font-weight: bold"
>
驳回
</el-button>
</div> </div>
</el-col> --> <div
</el-row> v-if="cardList.orderStatus == '3'"
</div> style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #C76F60"
>
{{ '待收货' }}
</div>
<div
v-if="cardList.orderStatus == '4' && isExpired(cardList)"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #008D06"
>
{{ '租赁中' }}
<span style="color: red">(已过期)</span>
</div>
<div
v-if="cardList.orderStatus == '4' && !isExpired(cardList)"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #008D06"
>
{{ '租赁中' }}
</div>
<div
v-if="cardList.orderStatus == '5'"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #5B33CC"
>
{{ '已退租' }}
</div>
<div
v-if="cardList.orderStatus == '6'"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #C00017"
>
{{ '已完成' }}
</div>
<div
v-if="cardList.orderStatus == '7'"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #797979"
>
{{ '已驳回' }}
</div>
</el-col>
</el-row>
</div> </div>
</div> </div>
</template> </template>
@ -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;
}
}
} }
</style> </style>

View File

@ -77,7 +77,7 @@ const getList = async () => {
const handleViewOrder = (index: Number, row: any) => { const handleViewOrder = (index: Number, row: any) => {
router.push({ router.push({
name: 'orderManagementInfo', 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) => { 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('是否确定收获?', { ElMessageBox.confirm('是否确定收获?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
return passApi({'ids':ids,'orderStatus':4}) return passApi({'orderId':cardList.value[index].orderId,'orderStatus':4})
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage({ ElMessage({
@ -153,7 +139,7 @@ const onChangeGoods = (index: number) => {
getList() getList()
} }
}).catch(() => {}) }).catch(() => {})
}
} }
@ -164,7 +150,7 @@ const isExpired=(goods:any)=> {
today.setHours(0, 0, 0, 0); today.setHours(0, 0, 0, 0);
// endtimeDate // endtimeDate
const endTime = new Date(goods.rentEndTime.replace(/-/g, "/")); const endTime = new Date(goods.endTime.replace(/-/g, "/"));
// endtime // endtime
return endTime < today; return endTime < today;
@ -179,15 +165,13 @@ const dialogVisible: any = ref(false)
const dialogImageUrl = ref('') const dialogImageUrl = ref('')
// 退 // 退
const handleViewBack = async (index: Number, row: any) => { const handleViewBack = async (row:any) => {
let ids: number[] = [];
ids.push(row.id)
ElMessageBox.confirm('是否确定发起退租?', { ElMessageBox.confirm('是否确定发起退租?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
return passApi({'ids':ids,'orderStatus':5}) return passApi({'orderId':row.orderId,'orderStatus':5})
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage({ ElMessage({
@ -292,6 +276,24 @@ const tableData4: any = ref([
dialogFormVisibleSettleList.value = true 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
}
</script> </script>
<template> <template>
@ -434,7 +436,7 @@ const tableData4: any = ref([
<el-col :span="4"> <el-col :span="4">
<div style="flex-shrink: 0; margin-bottom: 1px; font-size: 7px; display: flex;justify-content: center; margin-top: 5px;"> <div style="flex-shrink: 0; margin-bottom: 1px; font-size: 7px; display: flex;justify-content: center; margin-top: 5px;">
<el-button <el-button
v-if="item.czOrderStatus == '3'" v-if="item.orderStatus == '3'"
class="item" class="item"
type="success" type="success"
size="mimi" size="mimi"
@ -506,15 +508,15 @@ const tableData4: any = ref([
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px"> <div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">
总费用 总费用
</div> </div>
<div class="red-font">{{ item.orderTime }}</div> <div class="red-font">{{ item.cost }}</div>
</el-col> </el-col>
<el-col :span="4" > <el-col :span="4" >
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">租期</div> <div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">租期</div>
<div style="color: black; font-weight: bold"> <div style="color: black; font-weight: bold">
{{ item.orderTime }} {{ item.startTime }}
</div> </div>
<div style="margin-top: 3px; margin-bottom: 3px">{{ '至' }}</div> <div style="margin-top: 3px; margin-bottom: 3px">{{ '至' }}</div>
<div style="color: black; font-weight: bold">{{ item.orderTime }}</div> <div style="color: black; font-weight: bold">{{ item.endTime }}</div>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<div <div
@ -564,7 +566,7 @@ const tableData4: any = ref([
<el-col :span="5"> <el-col :span="5">
<div> <div>
<el-button <el-button
@click="handleViewOrder(j, item.detailsList[j])" @click="handleViewOrder(j, item)"
type="primary" type="primary"
size="small" size="small"
style="color: #blue; font-weight: bold" style="color: #blue; font-weight: bold"
@ -572,7 +574,7 @@ const tableData4: any = ref([
订单详情 订单详情
</el-button> </el-button>
<el-button <el-button
@click="handleViewOrder(j)" @click="handleViewWord(j)"
type="primary" type="primary"
size="small" size="small"
style="color: #blue; font-weight: bold" style="color: #blue; font-weight: bold"
@ -580,8 +582,8 @@ const tableData4: any = ref([
租赁协议 租赁协议
</el-button> </el-button>
<el-button <el-button
v-if="goods.orderStatus=='4'" v-if="item.orderStatus=='4'"
@click="handleViewBack(j,item.detailsList[j])" @click="handleViewBack(item)"
type="primary" type="primary"
size="small" size="small"
style="color: #blue; font-weight: bold" style="color: #blue; font-weight: bold"
@ -589,7 +591,7 @@ const tableData4: any = ref([
发起退租 发起退租
</el-button> </el-button>
<el-button <el-button
v-if="goods.orderStatus=='6'" v-if="item.orderStatus=='6'"
@click="handleViewList(j)" @click="handleViewList(j)"
type="primary" type="primary"
size="small" size="small"
@ -762,6 +764,26 @@ const tableData4: any = ref([
</template> </template>
</el-dialog> </el-dialog>
<!-- 租赁协议 -->
<el-dialog
v-model="dialogFormVisibleSettleWord"
:title="settleWordTitle"
width="50%"
:close-on-click-modal="false">
<div >
<img src="@/assets/img/zuLin.png" style="
width: 600px;
height: 600px;
margin-left: 160px;
margin-right: 10px; "/>
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="closeDialogBtn"> </el-button>
<el-button @click="submitBtn" type="success"> 下载 </el-button>
</span>
</template>
</el-dialog>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -220,7 +220,7 @@ const time = ref([])
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="4">
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px"> <div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">
总费用 总费用
</div> </div>
@ -248,14 +248,14 @@ const time = ref([])
{{ '待收货' }} {{ '待收货' }}
</div> </div>
<div <div
v-if="cardList.orderStatus == '4' && isExpired(item)" v-if="cardList.orderStatus == '4' && isExpired(cardList)"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #008D06" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #008D06"
> >
{{ '租赁中' }} {{ '租赁中' }}
<span style="color: red">(已过期)</span> <span style="color: red">(已过期)</span>
</div> </div>
<div <div
v-if="cardList.orderStatus == '4' && !isExpired(item)" v-if="cardList.orderStatus == '4' && !isExpired(cardList)"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #008D06" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: #008D06"
> >
{{ '租赁中' }} {{ '租赁中' }}

View File

@ -107,27 +107,12 @@ const onChangeGoods = (index: number) => {
// //
const confirmPass = async (index: number) => { const confirmPass = async (index: number) => {
let ids: number[] = [];
cardList.value[index].detailsList.forEach((item:any)=>{
if(item.orderStatus=="2" && item.isChecked==true){
console.log(2222222222)
ids.push(item.id)
}
})
if(ids.length==0){
ElMessage({
showClose: false,
message: '请选择装备',
type: 'error',
})
return
}else{
ElMessageBox.confirm('是否确定出库?', { ElMessageBox.confirm('是否确定出库?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
return passApi({'ids':ids,'orderStatus':3}) return passApi({'orderId':cardList.value[index].orderId,'orderStatus':3})
// return removeDeviceApi([row.maId]) // return removeDeviceApi([row.maId])
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
@ -139,44 +124,30 @@ const onChangeGoods = (index: number) => {
getList() getList()
} }
}).catch(() => {}) }).catch(() => {})
}
} }
// //
const confirmFail = async (index: number) => { const confirmFail = async (index: number) => {
let ids: number[] = [];
cardList.value[index].detailsList.forEach((item:any)=>{ ElMessageBox.confirm('是否确定取消?', {
if(item.orderStatus=="2" && item.isChecked==true){
ids.push(item.id)
}
})
console.log('ids',ids)
if(ids.length==0){
ElMessage({
showClose: false,
message: '请选择装备',
type: 'error',
})
return
}else{
ElMessageBox.confirm('是否确定驳回?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
return failApi({'ids':ids,'orderStatus':7}) return failApi({'orderId':cardList.value[index].orderId,'orderStatus':7})
// return removeDeviceApi([row.maId]) // return removeDeviceApi([row.maId])
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '驳回成功' message: '取消成功'
}) })
numberTemp.value = numberTemp.value+1; numberTemp.value = numberTemp.value+1;
getList() getList()
} }
}).catch(() => {}) }).catch(() => {})
}
} }
// //