承租方订单管理

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 ''; //
}
//
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 = ()=>{
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([])
</div>
</div>
<div class="cart-tbody" >
<el-row class="cart-list" v-for="(goods, j) in cardList.detailsList" :key="j">
<el-col :span="9" class="goods-info">
<el-row class="cart-listAll" :style="{background: cardList.orderStatus=='6' ? '#EBEEF5':'white'}">
<el-col :span="1" >
<!-- <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">
<img :src="goods.url" alt="" />
</el-col>
<div class="goods-code">
<div style="font-size: 10px; font-weight: bold">{{ goods.deviceName }}</div>
<div>租期{{ goods.days }}{{ ' ' + '天' }}</div>
<div>租金{{ goods.dayLeasePrice }}{{ ' ' + '元/天' }}</div>
<div>数量{{ goods.num }}{{ ' ' + '台' }}</div>
<div style="display:flex;justify-content:space-between;width:100%;">
<div style="flex:1;text-align:left;width:220px">租金{{ goods.dayLeasePrice }}{{ ' ' + '元/天' }}</div>
<div style="flex:1;text-align:left;">数量{{ goods.num }}{{ ' ' + '台' }}</div>
</div>
</div>
</el-col>
</el-row>
</el-col>
<el-col :span="2">
<el-col :span="4">
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">
总费用
</div>
<div class="red-font">{{goods.costs}}</div>
<div class="red-font">{{cardList.cost}}</div>
</el-col>
<el-col :span="7">
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">租期</div>
<div style="color: black; font-weight: bold">
{{ goods.rentBeginTime }}
{{ cardList.startTime }}
</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 :span="2">
<div v-if="goods.orderStatus=='0'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"未下单"}}</div>
<div v-if="goods.orderStatus=='1'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"已下单"}}</div>
<div v-if="goods.orderStatus=='2'" style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color:blue">{{"待出库"}}</div>
<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>
<el-col :span="4" >
<div
v-if="cardList.orderStatus == '2'"
style="font-size: 14px; font-weight: bold; margin-bottom: 10px; color: blue"
>
{{ '待出库' }}
</div>
</el-col> -->
</el-row>
</div>
<div
v-if="cardList.orderStatus == '3'"
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>
</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>

View File

@ -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);
// endtimeDate
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
}
</script>
<template>
@ -434,7 +436,7 @@ const tableData4: any = ref([
<el-col :span="4">
<div style="flex-shrink: 0; margin-bottom: 1px; font-size: 7px; display: flex;justify-content: center; margin-top: 5px;">
<el-button
v-if="item.czOrderStatus == '3'"
v-if="item.orderStatus == '3'"
class="item"
type="success"
size="mimi"
@ -506,15 +508,15 @@ const tableData4: any = ref([
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">
总费用
</div>
<div class="red-font">{{ item.orderTime }}</div>
<div class="red-font">{{ item.cost }}</div>
</el-col>
<el-col :span="4" >
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">租期</div>
<div style="color: black; font-weight: bold">
{{ item.orderTime }}
{{ item.startTime }}
</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 :span="4">
<div
@ -564,7 +566,7 @@ const tableData4: any = ref([
<el-col :span="5">
<div>
<el-button
@click="handleViewOrder(j, item.detailsList[j])"
@click="handleViewOrder(j, item)"
type="primary"
size="small"
style="color: #blue; font-weight: bold"
@ -572,7 +574,7 @@ const tableData4: any = ref([
订单详情
</el-button>
<el-button
@click="handleViewOrder(j)"
@click="handleViewWord(j)"
type="primary"
size="small"
style="color: #blue; font-weight: bold"
@ -580,8 +582,8 @@ const tableData4: any = ref([
租赁协议
</el-button>
<el-button
v-if="goods.orderStatus=='4'"
@click="handleViewBack(j,item.detailsList[j])"
v-if="item.orderStatus=='4'"
@click="handleViewBack(item)"
type="primary"
size="small"
style="color: #blue; font-weight: bold"
@ -589,7 +591,7 @@ const tableData4: any = ref([
发起退租
</el-button>
<el-button
v-if="goods.orderStatus=='6'"
v-if="item.orderStatus=='6'"
@click="handleViewList(j)"
type="primary"
size="small"
@ -762,6 +764,26 @@ const tableData4: any = ref([
</template>
</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>
<style lang="scss" scoped>

View File

@ -220,7 +220,7 @@ const time = ref([])
</el-col>
</el-row>
</el-col>
<el-col :span="2">
<el-col :span="4">
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px">
总费用
</div>
@ -248,14 +248,14 @@ const time = ref([])
{{ '待收货' }}
</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"
>
{{ '租赁中' }}
<span style="color: red">(已过期)</span>
</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"
>
{{ '租赁中' }}

View File

@ -107,27 +107,12 @@ const onChangeGoods = (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('是否确定出库?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
return passApi({'ids':ids,'orderStatus':3})
return passApi({'orderId':cardList.value[index].orderId,'orderStatus':3})
// return removeDeviceApi([row.maId])
}).then((res) => {
if (res.code === 200) {
@ -139,44 +124,30 @@ const onChangeGoods = (index: number) => {
getList()
}
}).catch(() => {})
}
}
//
const confirmFail = async (index: number) => {
let ids: number[] = [];
cardList.value[index].detailsList.forEach((item:any)=>{
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('是否确定驳回?', {
ElMessageBox.confirm('是否确定取消?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
return failApi({'ids':ids,'orderStatus':7})
return failApi({'orderId':cardList.value[index].orderId,'orderStatus':7})
// return removeDeviceApi([row.maId])
}).then((res) => {
if (res.code === 200) {
ElMessage({
type: 'success',
message: '驳回成功'
message: '取消成功'
})
numberTemp.value = numberTemp.value+1;
getList()
}
}).catch(() => {})
}
}
//