订单状态合并

This commit is contained in:
BianLzhaoMin 2024-12-11 18:09:31 +08:00
parent d288f3131f
commit 0a7f44b847
7 changed files with 227 additions and 314 deletions

4
components.d.ts vendored
View File

@ -20,7 +20,6 @@ declare module 'vue' {
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
@ -33,13 +32,10 @@ declare module 'vue' {
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']

2
env/.env.dev vendored
View File

@ -11,7 +11,7 @@ VITE_API_URL = '/proxyApi'
# VITE_proxyTarget = 'http://192.168.2.127:28080' # 梁超
# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务
# VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务
VITE_proxyTarget = 'http://192.168.2.72:28080' # 马帅j
VITE_proxyTarget = 'http://192.168.2.72:28080' # 盛旭
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
# VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证)

View File

@ -15,8 +15,8 @@ export const getRentTerminationListApi = (data: any = {}) => {
* @param orderId 退 ID
* @returns
*/
export const getOrderDetailsByIdApi = (orderId: any) => {
return get(`/material-mall/order/getOrderDetailsById`, { orderId })
export const getOrderDetailsByIdApi = (data: any) => {
return get(`/material-mall/order/getOrderDetailsById`, data)
}
/**
* @param data 退 退 data参数

View File

@ -149,7 +149,7 @@
>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="关联装备" style="width: 100%" prop="maId">
<el-form-item label="查看标签" style="width: 100%" prop="maId">
<el-select
clearable
style="width: 100%"
@ -168,7 +168,10 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-row>
<el-button class="primary-lease" type="primary"> 下载标签 </el-button>
</el-row>
<!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item label="1" style="margin-bottom: 0" class="upload-tip">
支持格式.jpg.png 单个文件大小不能超过2M最多可上传1张
@ -194,7 +197,6 @@
:acceptTypeList="['.jpg', '.png', '.pdf', '.doc']"
>
<template v-slot:default>
<!-- <el-icon size="48" color="#aaa"><Plus /></el-icon> -->
<el-button
:icon="UploadFilled"
type="primary"
@ -206,7 +208,7 @@
</div>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
</el-form>
<template #footer>
<div class="dialog-footer">
@ -342,7 +344,7 @@ const onSubmit = () => {
//
const onViewQualityRecord = (row: any) => {
addOrEditForm.value.maId = row.maId
dialogTitle.value = '证书修改'
dialogTitle.value = '标签查看'
addOrEditDialogVisible.value = true
}

View File

@ -662,107 +662,6 @@ const costSubmit = () => {
orderText(goods.orderStatus)
}}</el-tag>
</div>
<!-- <div
v-if="item.orderStatus == '1'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: blue;
"
>
{{ '待接单' }}
</div>
<div
v-if="item.orderStatus == '2'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: blue;
"
>
{{ '待出库' }}
</div>
<div
v-if="item.orderStatus == '3'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #c76f60;
"
>
{{ '待收货' }}
</div>
<div
v-if="item.orderStatus == '4' && isExpired(item)"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #008d06;
"
>
{{ '租赁中' }}
<span style="color: red">(已过期)</span>
</div>
<div
v-if="item.orderStatus == '4' && !isExpired(item)"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #008d06;
"
>
{{ '租赁中' }}
</div>
<div
v-if="item.orderStatus == '5'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #5b33cc;
"
>
{{ '已退租待结算' }}
</div>
<div
v-if="item.orderStatus == '6'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #c00017;
"
>
{{ '待结算确认' }}
</div>
<div
v-if="item.orderStatus == '7'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #797979;
"
>
{{ '已完成' }}
</div>
<div
v-if="item.orderStatus == '8'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #797979;
"
>
{{ '已驳回' }}
</div> -->
</el-col>
<el-col :span="2" class="order-items-info" v-if="item.orderStatus == 4">
@ -1667,7 +1566,6 @@ const costSubmit = () => {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.el-button {
width: calc((100% - 20px) / 2);

View File

@ -42,22 +42,33 @@ const numberTemp = ref<number>(0)
const cardList = ref<any>([])
const status = 0
const viewOrderDetailsOrderId = ref<any>('')
const viewOrderDetailsMaId = ref<any>('')
const addOrEditDialogCostVisible = ref(false)
const addOrEditDialogCostStatus = ref(1)
const addOrEditDialogCostIsChangePrice = ref(1)
const addOrEditDialogVisible = ref(false)
const viewOrderDetailsType = ref<any>(1)
const statusList = [
const statusList: any = [
{ id: '1', name: '待接单' },
{ id: '2', name: '待出库' },
{ id: '3', name: '已出库' },
{ id: '3', name: '待收货' },
{ id: '4', name: '租赁中' },
{ id: '5', name: '已退租' },
{ id: '6', name: '已完成' },
{ id: '5', name: '已退租待结算' },
{ id: '6', name: '结算待确认' },
{ id: '7', name: '已完成' },
{ id: '8', name: '已驳回' },
]
const orderText = (status: any) => {
return statusList.filter((e: any) => e.id == status)[0].name
}
const orderType = (status: any) => {
if (status == 1 || status == 2 || status == 3 || status == 5) return 'primary'
if (status == 4 || status == 7) return 'success'
if (status == 5 || status == 6) return 'warning'
if (status == 8) return 'danger'
}
/** 查询列表 */
const getList = async () => {
if (time.value.length > 0) {
@ -317,9 +328,10 @@ const handleFileSuccess2 = (response: any) => {
}
}
//退
const handleViewBack = (item: any) => {
const handleViewBack = (item: any, goods: any) => {
viewOrderDetailsOrderId.value = ''
viewOrderDetailsOrderId.value = item.orderId
viewOrderDetailsMaId.value = goods.maId
viewOrderDetailsType.value = 1
addOrEditDialogVisible.value = true
}
@ -583,17 +595,14 @@ const handleViewWord = () => {
dialogFormVisibleSettleWord.value = true
}
const contract = ref({
const contract = ref({
lessor: '公司一',
tenant: '公司二',
rentTime: '2024-01-01'
});
rentTime: '2024-01-01',
})
// Word
const downloadContract = () => {
}
// Word
const downloadContract = () => {}
</script>
<template>
@ -726,6 +735,14 @@ const handleViewWord = () => {
{{ item.czcompanyName }}
</span>
</el-col>
<div class="order-type-box">
<el-tag
style="padding: 6px 12px"
:type="orderType(item.orderStatus)"
effect="light"
>{{ orderText(item.orderStatus) }}</el-tag
>
</div>
</el-row>
<el-row
style="border-bottom: 1px solid #ccc; margin-bottom: 10px"
@ -762,10 +779,12 @@ const handleViewWord = () => {
? 'border-bottom:1px solid #eee'
: ''
"
style="min-height: 140px"
>
<img :src="goods.url" style="width: 160px; height: 120px" alt="" />
<div
style="
min-height: 140px;
flex: 1;
display: flex;
justify-content: space-around;
@ -795,115 +814,88 @@ const handleViewWord = () => {
<div>总费用</div>
<div class="red-font">{{ item.cost }} </div>
</el-col>
<el-col :span="4" class="order-items-info">
<!-- <el-col :span="4" class="order-items-info">
<div>租期</div>
<div style="font-weight: bold; margin-top: 10px">
{{ item.startTime }}{{ item.endTime }}
</div>
</el-col> -->
<el-col :span="4" class="order-items-info">
<div
v-for="(goods, j) in item.detailsList"
:key="j"
class="order-info"
:style="
j != item.detailsList.length - 1
? 'border-bottom:1px solid #eee'
: ''
"
style="min-height: 140px"
>
<div
style="
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
"
>
<div>租期</div>
<div style="font-weight: bold; margin-top: 10px">
{{ goods.rentBeginTime }}{{ goods.rentEndTime }}
</div>
</div>
</div>
</el-col>
<el-col :span="3" class="order-items-info">
<div
v-if="item.orderStatus == '1'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: blue;
v-for="(goods, j) in item.detailsList"
:key="j"
class="order-info"
:style="
j != item.detailsList.length - 1
? 'border-bottom:1px solid #eee'
: ''
"
style="min-height: 140px; width: 95%"
>
{{ '待接单' }}
</div>
<div
v-if="item.orderStatus == '2'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: blue;
"
>
{{ '待出库' }}
</div>
<div
v-if="item.orderStatus == '3'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #c76f60;
"
>
{{ '待收货' }}
</div>
<div
v-if="item.orderStatus == '4' && isExpired(item)"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #008d06;
"
>
{{ '租赁中' }}
<span style="color: red">(已过期)</span>
</div>
<div
v-if="item.orderStatus == '4' && !isExpired(item)"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #008d06;
"
>
{{ '租赁中' }}
</div>
<div
v-if="item.orderStatus == '5'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #5b33cc;
"
>
{{ '已退租待结算' }}
</div>
<div
v-if="item.orderStatus == '6'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #c00017;
"
>
{{ '待结算确认' }}
</div>
<div
v-if="item.orderStatus == '7'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #797979;
"
>
{{ '已完成' }}
</div>
<div
v-if="item.orderStatus == '8'"
style="
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
color: #797979;
"
>
{{ '已驳回' }}
<el-tag :type="orderType(goods.orderStatus)" effect="light">{{
orderText(goods.orderStatus)
}}</el-tag>
</div>
</el-col>
<el-col :span="6" class="handle-btn">
<el-col
:span="2"
class="order-items-info"
v-if="item.orderStatus != 2 && item.orderStatus != 1"
>
<div
v-for="(goods, j) in item.detailsList"
:key="j"
:style="
j != item.detailsList.length - 1
? 'border-bottom:1px solid #eee'
: ''
"
style="min-height: 140px; display: flex; align-items: center"
>
<div class="handle-btn-1">
<el-button
v-if="goods.orderStatus == '5'"
@click="handleViewBack(item, goods)"
type="primary"
size="small"
>
退租检修
</el-button>
</div>
</div>
</el-col>
<el-col :span="4" class="handle-btn" style="display: flex; align-items: center">
<div class="handle-btn-4">
<el-button
v-if="item.orderStatus == '1'"
type="primary"
@ -926,20 +918,16 @@ const handleViewWord = () => {
>取消</el-button
>
<el-button @click="handleViewOrder(j, item)" type="primary" size="small">
<el-button
@click="handleViewOrder(j, item)"
type="primary"
size="small"
>
订单详情
</el-button>
<el-button @click="handleViewWord(j)" type="primary" size="small">
租赁协议
</el-button>
<el-button
v-if="item.orderStatus == '5'"
@click="handleViewBack(item)"
type="primary"
size="small"
>
退租检修
</el-button>
<el-button
v-if="item.orderStatus == '5'"
@click="handleViewMoney(item)"
@ -948,14 +936,6 @@ const handleViewWord = () => {
>
费用结算
</el-button>
<el-button
v-if="item.orderStatus == '6' || item.orderStatus == '7'"
@click="handleViewRepair(item)"
type="primary"
size="small"
>
检修详情
</el-button>
<el-button
v-if="item.orderStatus == '6' || item.orderStatus == '7'"
@click="handleViewList(item)"
@ -964,6 +944,15 @@ const handleViewWord = () => {
>
费用清单
</el-button>
<el-button
v-if="item.orderStatus == '6' || item.orderStatus == '7'"
@click="handleViewRepair(item)"
type="primary"
size="small"
>
检修详情
</el-button>
</div>
</el-col>
</el-row>
</div>
@ -982,6 +971,7 @@ const handleViewWord = () => {
:type="viewOrderDetailsType"
v-model:addOrEditDialogVisible="addOrEditDialogVisible"
:orderId="viewOrderDetailsOrderId"
:maId="viewOrderDetailsMaId"
@onChangeGetList="getList"
/>
<CostSettlementModel
@ -1807,38 +1797,17 @@ const handleViewWord = () => {
destroy-on-close
:close-on-click-modal="false"
>
<!-- <div style="display: flex; justify-content: center">
<div style="display: flex; justify-content: center">
<img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" />
</div> -->
<div class="modal-content">
<h2>租赁合同</h2>
<form @submit.prevent="saveContract">
<div class="form-group">
<label>出租方</label>
<span>{{ contract.lessor }}</span>
</div>
<div class="form-group">
<label>租赁方</label>
<span>{{ contract.tenant }}</span>
</div>
<div class="form-group">
<label>租赁时间</label>
<span>{{ contract.rentTime }}</span>
</div>
<div class="form-group">
<button type="button" @click="downloadContract">下载</button>
<button type="button" @click="dialogFormVisibleSettleWord = false">关闭</button>
</div>
</form>
</div>
<!-- <template #footer>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="submitBtn" type="success"> 下载 </el-button>
</span>
</template> -->
</template>
</el-dialog>
</template>
@ -2129,9 +2098,15 @@ const handleViewWord = () => {
}
.order-title-info {
padding: 6px 4px;
position: relative;
padding: 14px 4px;
font-size: 14px;
color: #999;
.order-type-box {
position: absolute;
top: 0;
right: 0;
}
}
.order-items {
@ -2141,6 +2116,8 @@ const handleViewWord = () => {
.order-info {
display: flex;
padding: 10px 0;
align-items: center;
justify-content: center;
}
.order-items-info {
@ -2158,8 +2135,10 @@ const handleViewWord = () => {
}
.handle-btn {
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
.el-button {
width: calc((100% - 50px) / 4);
@ -2167,6 +2146,30 @@ const handleViewWord = () => {
margin-left: 10px !important;
}
}
.handle-btn-4 {
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
.el-button {
width: calc((100% - 20px) / 2);
margin-left: 10px !important;
margin-bottom: 10px;
}
}
.handle-btn-1 {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
.el-button {
width: 90%;
margin-bottom: 10px;
margin-left: 5% !important;
}
}
.app-container-content {
:deep(.el-dialog) {
display: flex !important;

View File

@ -585,6 +585,10 @@ const props = defineProps({
type: [String, Number],
default: '',
},
maId: {
type: [String, Number],
default: '',
},
type: {
type: Number,
default: 1,
@ -800,11 +804,20 @@ const getOrderDetailsData = async () => {
props.type == 1 ? (dialogTitle.value = '退租检修') : (dialogTitle.value = '检修明细')
if (props.type === 1) {
const { data: res }: any = await getOrderDetailsByIdApi(props.orderId)
const { data: res }: any = await getOrderDetailsByIdApi({
orderId: props.orderId,
maId: props.maId,
})
orderDetails.value = res
repairSelect.value = JSON.parse(JSON.stringify(res.detailsList))
lossSelect.value = JSON.parse(JSON.stringify(res.detailsList))
scrapSelect.value = JSON.parse(JSON.stringify(res.detailsList))
repairSelect.value = JSON.parse(JSON.stringify(res.detailsList)).filter(
(e: any) => e.maId == props.maId,
)
lossSelect.value = JSON.parse(JSON.stringify(res.detailsList)).filter(
(e: any) => e.maId == props.maId,
)
scrapSelect.value = JSON.parse(JSON.stringify(res.detailsList)).filter(
(e: any) => e.maId == props.maId,
)
orderDetails.value.orderId = props.orderId
} else {
const { data: res }: any = await getOverhaulApi(props.orderId)
@ -868,6 +881,7 @@ const onSubmit = async (type: boolean) => {
const res: any = await setAddLeaseRepairApi({
orderId,
code,
maId: props.maId,
repairRecordList: repairFormList.value,
scrapRecordList: scrapFormList.value,
lossRecordList: lossFormList.value,