From 660353b1d72702b79f6fea67c1bd15175de879b7 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 2 Dec 2024 16:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 12 +- env/.env.dev | 4 +- src/router/index.ts | 28 +- src/views/user/orderManagement/detail.vue | 553 ++++++++---- src/views/user/orderManagementCz/detail.vue | 553 ++++++++---- src/views/user/orderManagementCz/index.vue | 948 +++++++++----------- 6 files changed, 1169 insertions(+), 929 deletions(-) diff --git a/components.d.ts b/components.d.ts index 6aa057d..9412a02 100644 --- a/components.d.ts +++ b/components.d.ts @@ -3,20 +3,23 @@ // @ts-nocheck // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 -export { } +export {} declare module 'vue' { export interface GlobalComponents { Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] ElBadge: typeof import('element-plus/es')['ElBadge'] + ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] + ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] + ElCascader: typeof import('element-plus/es')['ElCascader'] + ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] - ElCountdown: typeof import('element-plus/es')['ElCountdown'] 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'] ElHeader: typeof import('element-plus/es')['ElHeader'] @@ -27,12 +30,9 @@ declare module 'vue' { ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] 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'] diff --git a/env/.env.dev b/env/.env.dev index 3fe5b11..b46887f 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -7,8 +7,8 @@ VITE_API_URL = '/proxyApi' # 开发环境接口地址 # VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭 -VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 -# VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 +# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅 +VITE_proxyTarget = 'http://192.168.0.244:28580' # 马帅 # VITE_proxyTarget = 'http://192.168.2.129:18080' # 马帅 # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) diff --git a/src/router/index.ts b/src/router/index.ts index 5342016..d92eb0f 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -295,21 +295,21 @@ const routes: Array = [ // isLogin: true // }, // }, - // /* 订单管理(订单详情出租) */ - // { - // path: 'orderManagementInfoBuy', - // name: 'orderManagementInfoBuy', - // component: () => import('@/views/user/orderManagementCz/detail.vue'), - // meta: { - // title: '订单详情', - // keepAlive: true, - // AuthFlag: false, - // isLogin: false - // }, - // }, + /* 订单管理(订单详情出租) */ + { + path: '/orderManagementInfoBuy', + name: 'orderManagementInfoBuy', + component: () => import('@/views/user/orderManagementCz/detail.vue'), + meta: { + title: '订单详情', + keepAlive: true, + AuthFlag: false, + isLogin: false + }, + }, // /* 订单管理(订单详情承租) */ { - path: 'orderManagementInfo', + path: '/orderManagementInfo', name: 'orderManagementInfo', component: () => import('@/views/user/orderManagement/detail.vue'), meta: { @@ -321,7 +321,7 @@ const routes: Array = [ }, // /* 订单管理(退租) */ { - path: 'rentinTermination', + path: '/rentinTermination', name: 'rentinTermination', component: () => import('views/user/orderManagement/orderCom/rentinTermination.vue'), meta: { diff --git a/src/views/user/orderManagement/detail.vue b/src/views/user/orderManagement/detail.vue index 7054aee..65448be 100644 --- a/src/views/user/orderManagement/detail.vue +++ b/src/views/user/orderManagement/detail.vue @@ -10,73 +10,99 @@ const orderStatusTemp = ref(0) const idTemp = ref('') const titleStaus = ref('') //描述信息 -const operationDetails = ref({ - 1: { title: '已出库', preOutboundUser: '', preOutboundTime: '' }, - 2: { title: '已收货', takeOverUser: '', takeOverTime: '' }, - 3: { title: '租赁结束', rentOverUser: '', rentOverTime: '' }, - }) - // 根据步骤的 Id 返回对应的标题 -const getStepTitle = (stepId:number)=> { - if (orderStatusTemp.value === 2) { - titleStaus.value= '待出库' ; - return stepId === 1 ? '待出库' : ''; - } else if (orderStatusTemp.value === 3) { - titleStaus.value= '待收货' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '待收货' : ''; - } else if (orderStatusTemp.value === 4) { - titleStaus.value= '租赁中' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁中' : ''; - } else if (orderStatusTemp.value === 5) { - titleStaus.value= '已退租' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁结束' : stepId === 4 ? '已退租' : ''; - } else if (orderStatusTemp.value === 6) { - titleStaus.value= '已完成' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁结束' : stepId === 4 ? '已退租' : stepId === 5 ? '已完成' : ''; - } else if(orderStatusTemp.value === 7) { - titleStaus.value= '已驳回' ; - return stepId === 1 ? '已驳回' : ''; - } - titleStaus.value='' - return ''; // 默认返回空字符串 - } - - // 根据步骤的 Id 返回对应的描述 - const getDescription=(desId:number)=>{ - const operation = operationDetails.value[desId]; - if (operation.title=="已出库" && titleStaus.value!= "待出库" ) { - return ` - 操作人:${operation.preOutboundUser==null ? ' ': operation.preOutboundUser} - 操作时间:${operation.preOutboundTime==null ? ' ': operation.preOutboundTime} - `; - }else if(operation.title=="已收货" && titleStaus.value!= "待收货" && titleStaus.value!= "待出库"){ - return ` - 操作人:${operation.takeOverUser==null ? ' ': operation.takeOverUser} - 操作时间:${operation.takeOverTime==null ? ' ': operation.takeOverTime} - `; - }else if(operation.title=="租赁结束" && (titleStaus.value!= "待收货" && titleStaus.value!= "待出库" && titleStaus.value!= "租赁中")){ - return ` - 操作人:${operation.rentOverUser==null ? ' ': operation.rentOverUser} - 操作时间:${operation.rentOverTime==null ? ' ': operation.rentOverTime} - `; - } - return ''; // 默认返回空描述 +const operationDetails = ref({ + 1: { title: '已出库', preOutboundUser: '', preOutboundTime: '' }, + 2: { title: '已收货', takeOverUser: '', takeOverTime: '' }, + 3: { title: '租赁结束', rentOverUser: '', rentOverTime: '' }, +}) +// 根据步骤的 Id 返回对应的标题 +const getStepTitle = (stepId: number) => { + if (orderStatusTemp.value === 2) { + titleStaus.value = '待出库' + return stepId === 1 ? '待出库' : '' + } else if (orderStatusTemp.value === 3) { + titleStaus.value = '待收货' + return stepId === 1 ? '已出库' : stepId === 2 ? '待收货' : '' + } else if (orderStatusTemp.value === 4) { + titleStaus.value = '租赁中' + return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁中' : '' + } else if (orderStatusTemp.value === 5) { + titleStaus.value = '已退租' + return stepId === 1 + ? '已出库' + : stepId === 2 + ? '已收货' + : stepId === 3 + ? '租赁结束' + : stepId === 4 + ? '已退租' + : '' + } else if (orderStatusTemp.value === 6) { + titleStaus.value = '已完成' + return stepId === 1 + ? '已出库' + : stepId === 2 + ? '已收货' + : stepId === 3 + ? '租赁结束' + : stepId === 4 + ? '已退租' + : stepId === 5 + ? '已完成' + : '' + } else if (orderStatusTemp.value === 7) { + titleStaus.value = '已驳回' + return stepId === 1 ? '已驳回' : '' } - -// 计算是否过期 -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; + titleStaus.value = '' + return '' // 默认返回空字符串 } +// 根据步骤的 Id 返回对应的描述 +const getDescription = (desId: number) => { + const operation = operationDetails.value[desId] + if (operation.title == '已出库' && titleStaus.value != '待出库') { + return ` + 操作人:${operation.preOutboundUser == null ? ' ' : operation.preOutboundUser} + 操作时间:${operation.preOutboundTime == null ? ' ' : operation.preOutboundTime} + ` + } else if ( + operation.title == '已收货' && + titleStaus.value != '待收货' && + titleStaus.value != '待出库' + ) { + return ` + 操作人:${operation.takeOverUser == null ? ' ' : operation.takeOverUser} + 操作时间:${operation.takeOverTime == null ? ' ' : operation.takeOverTime} + ` + } else if ( + operation.title == '租赁结束' && + titleStaus.value != '待收货' && + titleStaus.value != '待出库' && + titleStaus.value != '租赁中' + ) { + return ` + 操作人:${operation.rentOverUser == null ? ' ' : operation.rentOverUser} + 操作时间:${operation.rentOverTime == null ? ' ' : operation.rentOverTime} + ` + } + return '' // 默认返回空描述 +} -const getId = ()=>{ +// 计算是否过期 +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) } @@ -85,10 +111,10 @@ const getId = ()=>{ const getList = async () => { let params = { orderId: idTemp.value, - flag:false + flag: false, } - const res: any = await getOrderListInfoApi(params) + const res: any = await getOrderListInfoApi(params) cardList.value = res.data operationDetails.value[1].preOutboundUser = res.data.detailsList[0].preOutboundUser operationDetails.value[1].preOutboundTime = res.data.detailsList[0].preOutboundTime @@ -96,120 +122,230 @@ const getList = async () => { operationDetails.value[2].takeOverTime = res.data.detailsList[0].takeOverTime operationDetails.value[3].rentOverUser = res.data.detailsList[0].rentOverUser operationDetails.value[3].rentOverTime = res.data.detailsList[0].rentOverTime - } -onBeforeMount(()=>{ - getId() +onBeforeMount(() => { + getId() }) onMounted(() => { getList() }) - const time = ref([]) diff --git a/src/views/user/orderManagementCz/detail.vue b/src/views/user/orderManagementCz/detail.vue index 0eba937..ace61ad 100644 --- a/src/views/user/orderManagementCz/detail.vue +++ b/src/views/user/orderManagementCz/detail.vue @@ -11,11 +11,11 @@ const idTemp = ref('') const titleStaus = ref('') //描述信息 -const operationDetails = ref({ - 1: { title: '已出库', preOutboundUser: '', preOutboundTime: '' }, - 2: { title: '已收货', takeOverUser: '', takeOverTime: '' }, - 3: { title: '租赁结束', rentOverUser: '', rentOverTime: '' }, - }) +const operationDetails = ref({ + 1: { title: '已出库', preOutboundUser: '', preOutboundTime: '' }, + 2: { title: '已收货', takeOverUser: '', takeOverTime: '' }, + 3: { title: '租赁结束', rentOverUser: '', rentOverTime: '' }, +}) // 获取数据列表 // const getList = async () => { // const res: any = await getOrderListApi() @@ -24,68 +24,94 @@ const operationDetails = ref({ // total.value = res.total // } - // 根据步骤的 Id 返回对应的标题 -const getStepTitle = (stepId:number)=> { - if (orderStatusTemp.value === 2) { - titleStaus.value= '待出库' ; - return stepId === 1 ? '待出库' : ''; - } else if (orderStatusTemp.value === 3) { - titleStaus.value= '待收货' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '待收货' : ''; - } else if (orderStatusTemp.value === 4) { - titleStaus.value= '租赁中' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁中' : ''; - } else if (orderStatusTemp.value === 5) { - titleStaus.value= '已退租' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁结束' : stepId === 4 ? '已退租' : ''; - } else if (orderStatusTemp.value === 6) { - titleStaus.value= '已完成' ; - return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁结束' : stepId === 4 ? '已退租' : stepId === 5 ? '已完成' : ''; - } else if(orderStatusTemp.value === 7) { - titleStaus.value= '已驳回' ; - return stepId === 1 ? '已驳回' : ''; - } - titleStaus.value='' - return ''; // 默认返回空字符串 - } - - // 根据步骤的 Id 返回对应的描述 - const getDescription=(desId:number)=>{ - const operation = operationDetails.value[desId]; - if (operation.title=="已出库" && titleStaus.value!= "待出库" ) { - return ` - 操作人:${operation.preOutboundUser==null ? ' ': operation.preOutboundUser} - 操作时间:${operation.preOutboundTime==null ? ' ': operation.preOutboundTime} - `; - }else if(operation.title=="已收货" && titleStaus.value!= "待收货" && titleStaus.value!= "待出库"){ - return ` - 操作人:${operation.takeOverUser==null ? ' ': operation.takeOverUser} - 操作时间:${operation.takeOverTime==null ? ' ': operation.takeOverTime} - `; - }else if(operation.title=="租赁结束" && (titleStaus.value!= "待收货" && titleStaus.value!= "待出库" && titleStaus.value!= "租赁中")){ - return ` - 操作人:${operation.rentOverUser==null ? ' ': operation.rentOverUser} - 操作时间:${operation.rentOverTime==null ? ' ': operation.rentOverTime} - `; - } - return ''; // 默认返回空描述 +// 根据步骤的 Id 返回对应的标题 +const getStepTitle = (stepId: number) => { + if (orderStatusTemp.value === 2) { + titleStaus.value = '待出库' + return stepId === 1 ? '待出库' : '' + } else if (orderStatusTemp.value === 3) { + titleStaus.value = '待收货' + return stepId === 1 ? '已出库' : stepId === 2 ? '待收货' : '' + } else if (orderStatusTemp.value === 4) { + titleStaus.value = '租赁中' + return stepId === 1 ? '已出库' : stepId === 2 ? '已收货' : stepId === 3 ? '租赁中' : '' + } else if (orderStatusTemp.value === 5) { + titleStaus.value = '已退租' + return stepId === 1 + ? '已出库' + : stepId === 2 + ? '已收货' + : stepId === 3 + ? '租赁结束' + : stepId === 4 + ? '已退租' + : '' + } else if (orderStatusTemp.value === 6) { + titleStaus.value = '已完成' + return stepId === 1 + ? '已出库' + : stepId === 2 + ? '已收货' + : stepId === 3 + ? '租赁结束' + : stepId === 4 + ? '已退租' + : stepId === 5 + ? '已完成' + : '' + } else if (orderStatusTemp.value === 7) { + titleStaus.value = '已驳回' + return stepId === 1 ? '已驳回' : '' } - -// 计算是否过期 -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; + titleStaus.value = '' + return '' // 默认返回空字符串 } +// 根据步骤的 Id 返回对应的描述 +const getDescription = (desId: number) => { + const operation = operationDetails.value[desId] + if (operation.title == '已出库' && titleStaus.value != '待出库') { + return ` + 操作人:${operation.preOutboundUser == null ? ' ' : operation.preOutboundUser} + 操作时间:${operation.preOutboundTime == null ? ' ' : operation.preOutboundTime} + ` + } else if ( + operation.title == '已收货' && + titleStaus.value != '待收货' && + titleStaus.value != '待出库' + ) { + return ` + 操作人:${operation.takeOverUser == null ? ' ' : operation.takeOverUser} + 操作时间:${operation.takeOverTime == null ? ' ' : operation.takeOverTime} + ` + } else if ( + operation.title == '租赁结束' && + titleStaus.value != '待收货' && + titleStaus.value != '待出库' && + titleStaus.value != '租赁中' + ) { + return ` + 操作人:${operation.rentOverUser == null ? ' ' : operation.rentOverUser} + 操作时间:${operation.rentOverTime == null ? ' ' : operation.rentOverTime} + ` + } + return '' // 默认返回空描述 +} -const getId = ()=>{ +// 计算是否过期 +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) } @@ -94,10 +120,10 @@ const getId = ()=>{ const getList = async () => { let params = { orderId: idTemp.value, - flag:true + flag: true, } - const res: any = await getOrderListInfoApi(params) + const res: any = await getOrderListInfoApi(params) cardList.value = res.data operationDetails.value[1].preOutboundUser = res.data.detailsList[0].preOutboundUser operationDetails.value[1].preOutboundTime = res.data.detailsList[0].preOutboundTime @@ -107,117 +133,228 @@ const getList = async () => { operationDetails.value[3].rentOverTime = res.data.detailsList[0].rentOverTime } -onBeforeMount(()=>{ - getId() +onBeforeMount(() => { + getId() }) onMounted(() => { getList() }) - const time = ref([]) diff --git a/src/views/user/orderManagementCz/index.vue b/src/views/user/orderManagementCz/index.vue index 3be55e5..a18838e 100644 --- a/src/views/user/orderManagementCz/index.vue +++ b/src/views/user/orderManagementCz/index.vue @@ -2,10 +2,10 @@ import { ref } from 'vue' import PagingComponent from 'components/PagingComponent/index.vue' import { useRouter } from 'vue-router' -import { getOrderListApi, passApi, failApi } from 'http/api/usercenter/seekorder' +import { getOrderListApi,passApi,failApi } from 'http/api/usercenter/seekorder' import uploadComponent from 'components/uploadComponent/index.vue' import previewImg from './previewImg/index.vue' -import { ElMessage, ElMessageBox } from 'element-plus' +import { ElMessage,ElMessageBox } from 'element-plus' import type { FormInstance } from 'element-plus' import { useStore } from 'store/user' const store = useStore() @@ -49,8 +49,8 @@ const statusList = [ /** 查询列表 */ const getList = async () => { if (time.value.length > 0) { - const dateStart = new Date(time.value[0]) - const dateEnd = new Date(time.value[1]) + const dateStart = new Date(time.value[0]); + const dateEnd = new Date(time.value[1]); queryParams.value.startTime = dateStart.toLocaleDateString('en-CA') queryParams.value.endTime = dateEnd.toLocaleDateString('en-CA') } else { @@ -76,7 +76,7 @@ onMounted(() => { // 查询按钮 const queryTableList = () => { - queryParams.value.pageNum = 1 + queryParams.value.pageNum=1 getList() } @@ -90,117 +90,81 @@ const resetTableList = (formEl: FormInstance | undefined) => { // 全选事件 const onChangeCompany = (e: boolean, index: number, item: any) => { - cardList.value[index].detailsList.forEach((item: any) => { - if (item.orderStatus == '2') { - item.isChecked = e + cardList.value[index].detailsList.forEach((item:any)=>{ + if(item.orderStatus=="2"){ + item.isChecked = e; } }) } // 单选事件 const onChangeGoods = (index: number) => { - let flag = true + let flag = true; for (let item of cardList.value[index].detailsList) { - if (item.orderStatus == '2' && item.isChecked != true) { - flag = false - break + if (item.orderStatus == "2" && item.isChecked != true) { + flag = false; + break; } } - cardList.value[index].isChecked = flag + cardList.value[index].isChecked = flag; } // 出库按钮 -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) - } - }) - console.log('ids', ids) - if (ids.length == 0) { - ElMessage({ - showClose: false, - message: '请选择装备', - type: 'error', - }) - return - } else { + const confirmPass = async (index: number) => { ElMessageBox.confirm('是否确定出库?', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', - }) - .then(() => { - return passApi({ ids: ids, orderStatus: 3 }) - // return removeDeviceApi([row.maId]) + }).then(() => { + return passApi({'orderId':cardList.value[index].orderId,'orderStatus':3}) + // return removeDeviceApi([row.maId]) + }).then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '出库成功' }) - .then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '出库成功', - }) - numberTemp.value = numberTemp.value + 1 - getList() - } - }) - .catch(() => {}) + numberTemp.value = numberTemp.value+1; + 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('是否确定驳回?', { + const confirmFail = async (index: number) => { + + ElMessageBox.confirm('是否确定取消?', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', - }) - .then(() => { - return failApi({ ids: ids, orderStatus: 7 }) - // return removeDeviceApi([row.maId]) + }).then(() => { + return failApi({'orderId':cardList.value[index].orderId,'orderStatus':7}) + // return removeDeviceApi([row.maId]) + }).then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '取消成功' }) - .then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '驳回成功', - }) - numberTemp.value = numberTemp.value + 1 - getList() - } - }) - .catch(() => {}) - } + numberTemp.value = numberTemp.value+1; + getList() + } + }).catch(() => {}) + } // 计算是否过期 -const isExpired = (goods: any) => { - // 获取当前日期并去掉时间部分 - const today = new Date() - today.setHours(0, 0, 0, 0) +const isExpired=(goods:any)=> { + // 获取当前日期并去掉时间部分 + const today = new Date(); + today.setHours(0, 0, 0, 0); - // 将endtime转为Date对象 - const endTime = new Date(goods.rentEndTime.replace(/-/g, '/')) + // 将endtime转为Date对象 + const endTime = new Date(goods.endTime.replace(/-/g, "/")); - // 判断endtime是否早于今天 - return endTime < today + // 判断endtime是否早于今天 + return endTime < today; } /* 退租按钮 */ @@ -310,71 +274,71 @@ const handleFileSuccess2 = (response: any) => { } } //退租检修 -const handleViewBack = () => { - settleinTitle.value = '退租检修' - isEditDisabled.value = true - equipmentDeploymentParams.value = { - /* 企业Id */ - // ownCo: mainStore().userInfo.companyId, - /* 租赁范围 */ - leaseScope: '', - /* 设备所在地 */ - location: '', - /* 省 */ - provinceId: '', - /* 市 */ - cityId: '', - /* 区 */ - areaId: '', - /* 设备所在地 省 */ - addressEconomize: '', - /* 设备所在地 市 */ - addressProvince: '', - /* 设备所在地 区 */ - addressArea: '', - /* 设备类型 */ - typeId: '', - /* 设备类型大类 */ - deviceType: '', - /* 设备类型子类 */ - deviceTypeSon: '', - /* 设备类型小类*/ - deviceTypeSun: '', - /* 设备品牌 */ - brand: '', - /* 设备型号 */ - modelName: '', - /* 出场日期 */ - productionDate: '', - /* 工作小时数 */ - workingHours: '', - /* 整机序列号 */ - serialNumber: '', - /* 月租金 */ - monthLeasePrice: '', - /* 日租金 */ - dayLeasePrice: '', - /* 是否提供机手 */ - isOperator: '', - /* 机手月费用 */ - jsMonthPrice: '', - /* 机手日费用 */ - jsDayPrice: '', - /* 详细说明 */ - description: '', - /* 设备主图片 */ - picUrl: '', - /* 检测信息 ,保险信息*/ - fileList: [], - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [], + const handleViewBack = () => { + settleinTitle.value = '退租检修' + isEditDisabled.value = true + equipmentDeploymentParams.value = { + /* 企业Id */ + // ownCo: mainStore().userInfo.companyId, + /* 租赁范围 */ + leaseScope: '', + /* 设备所在地 */ + location: '', + /* 省 */ + provinceId: '', + /* 市 */ + cityId: '', + /* 区 */ + areaId: '', + /* 设备所在地 省 */ + addressEconomize: '', + /* 设备所在地 市 */ + addressProvince: '', + /* 设备所在地 区 */ + addressArea: '', + /* 设备类型 */ + typeId: '', + /* 设备类型大类 */ + deviceType: '', + /* 设备类型子类 */ + deviceTypeSon: '', + /* 设备类型小类*/ + deviceTypeSun: '', + /* 设备品牌 */ + brand: '', + /* 设备型号 */ + modelName: '', + /* 出场日期 */ + productionDate: '', + /* 工作小时数 */ + workingHours: '', + /* 整机序列号 */ + serialNumber: '', + /* 月租金 */ + monthLeasePrice: '', + /* 日租金 */ + dayLeasePrice: '', + /* 是否提供机手 */ + isOperator: '', + /* 机手月费用 */ + jsMonthPrice: '', + /* 机手日费用 */ + jsDayPrice: '', + /* 详细说明 */ + description: '', + /* 设备主图片 */ + picUrl: '', + /* 检测信息 ,保险信息*/ + fileList: [], + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [] + } + // 打开退组检修弹框 + dialogFormVisibleSettlein.value = true } - // 打开退组检修弹框 - dialogFormVisibleSettlein.value = true -} const settlemoneyTitle = ref('') const moneyParams1: any = ref({ @@ -399,34 +363,34 @@ const moneyParams3: any = ref({ unitName: '', }) const tableData: any = ref([ + { + name1:'测试1', + name2:'测试1-1', + name3:'测试1-2', + jy1:'外观1-1', + jy2:'故障1-2', + jy3:'外观1-2', + jy4:'故障1-2', + jy5:'外观1-3', + jy6:'故障1-3', + jy7:'', + jy8:'', + remark:'备注1', + }, { - name1: '测试1', - name2: '测试1-1', - name3: '测试1-2', - jy1: '外观1-1', - jy2: '故障1-2', - jy3: '外观1-2', - jy4: '故障1-2', - jy5: '外观1-3', - jy6: '故障1-3', - jy7: '', - jy8: '', - remark: '备注1', - }, - { - name1: '测试2', - name2: '测试2-1', - name3: '测试2-2', - jy1: '外观2-1', - jy2: '故障2-2', - jy3: '外观2-2', - jy4: '故障2-2', - jy5: '外观2-3', - jy6: '故障2-3', - jy7: '', - jy8: '', - remark: '备注2', - }, + name1:'测试2', + name2:'测试2-1', + name3:'测试2-2', + jy1:'外观2-1', + jy2:'故障2-2', + jy3:'外观2-2', + jy4:'故障2-2', + jy5:'外观2-3', + jy6:'故障2-3', + jy7:'', + jy8:'', + remark:'备注2', + } ]) const partItems1: any = ref([{}]) @@ -435,206 +399,221 @@ const partItems3: any = ref([{}]) // 费用结算弹框显示隐藏 const dialogFormVisibleSettlemoney: any = ref(false) //费用结算 -const handleViewMoney = () => { - settlemoneyTitle.value = '费用结算' - moneyParams1.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [], + const handleViewMoney = () => { + settlemoneyTitle.value = '费用结算' + moneyParams1.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [] + } + moneyParams2.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [] + } + moneyParams3.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [] + } + // 打开退组检修弹框 + dialogFormVisibleSettlemoney.value = true } - moneyParams2.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [], - } - moneyParams3.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [], - } - // 打开退组检修弹框 - dialogFormVisibleSettlemoney.value = true -} -//维修费用 -const addPartItem1 = () => { - partItems1.value.push({ partType: '', num: '', isCharge: '' }) -} -const removePartItem1 = (index: number) => { - if (partItems1.value.length > 1) { - partItems1.value.splice(index, 1) + //维修费用 + const addPartItem1=()=> { + partItems1.value.push({ partType: "", num: "", isCharge: "" }); + } + const removePartItem1 =(index:number)=> { + if (partItems1.value.length > 1) { + partItems1.value.splice(index, 1); + } } -} -//报废费用 -const addPartItem2 = () => { - partItems2.value.push({ partType: '', num: '', isCharge: '' }) -} -const removePartItem2 = (index: number) => { - if (partItems2.value.length > 1) { - partItems2.value.splice(index, 1) + //报废费用 + const addPartItem2=()=> { + partItems2.value.push({ partType: "", num: "", isCharge: "" }); + } + const removePartItem2 =(index:number)=> { + if (partItems2.value.length > 1) { + partItems2.value.splice(index, 1); + } } -} -//报废费用 修改 -const addPartItem3 = () => { - partItems3.value.push({ partType: '', num: '', isCharge: '' }) -} -const removePartItem3 = (index: number) => { - if (partItems3.value.length > 1) { - partItems3.value.splice(index, 1) + //报废费用 修改 + const addPartItem3=()=> { + partItems3.value.push({ partType: "", num: "", isCharge: "" }); + } + const removePartItem3 =(index:number)=> { + if (partItems3.value.length > 1) { + partItems3.value.splice(index, 1); + } } -} const settleListTitle = ref('') // 费用清单弹框显示隐藏 const dialogFormVisibleSettleList: any = ref(false) const tableData1: any = ref([ + { + name1:'测试1', + name2:'测试1-1', + name3:'3台', + jy1:'100', + jy2:'31', + jy3:'2024-11-25 至2024-12-25', + jy4:'1600', + }, { - name1: '测试1', - name2: '测试1-1', - name3: '3台', - jy1: '100', - jy2: '31', - jy3: '2024-11-25 至2024-12-25', - jy4: '1600', - }, - { - name1: '测试2', - name2: '测试2-1', - name3: '3台', - jy1: '100', - jy2: '31', - jy3: '2024-11-25 至2024-12-25', - jy4: '1600', - }, + name1:'测试2', + name2:'测试2-1', + name3:'3台', + jy1:'100', + jy2:'31', + jy3:'2024-11-25 至2024-12-25', + jy4:'1600', + } ]) const tableData2: any = ref([ + { + name1:'测试2', + name2:'测试2-1', + name3:'3台', + jy1:'类型1', + jy2:'维修中', + jy3:'1500', + }, { - name1: '测试2', - name2: '测试2-1', - name3: '3台', - jy1: '类型1', - jy2: '维修中', - jy3: '1500', - }, - { - name1: '测试2', - name2: '测试2-2', - name3: '3台', - jy1: '类型2', - jy2: '维修中', - jy3: '1500', - }, + name1:'测试2', + name2:'测试2-2', + name3:'3台', + jy1:'类型2', + jy2:'维修中', + jy3:'1500', + } ]) const tableData3: any = ref([ + { + name1:'测试3', + name2:'测试3-1', + name3:'3台', + jy1:'轻度维修', + jy2:'1400', + }, { - name1: '测试3', - name2: '测试3-1', - name3: '3台', - jy1: '轻度维修', - jy2: '1400', - }, - { - name1: '测试3', - name2: '测试3-2', - name3: '3台', - jy1: '轻度维修', - jy2: '1400', - }, + name1:'测试3', + name2:'测试3-2', + name3:'3台', + jy1:'轻度维修', + jy2:'1400', + } ]) const tableData4: any = ref([ + { + name1:'测试4', + name2:'测试4-1', + name3:'3台', + jy1:'1400', + }, { - name1: '测试4', - name2: '测试4-1', - name3: '3台', - jy1: '1400', - }, - { - name1: '测试4', - name2: '测试4-2', - name3: '3台', - jy1: '1400', - }, + name1:'测试4', + name2:'测试4-2', + name3:'3台', + jy1:'1400', + } ]) //费用清单 -const handleViewList = () => { - settleListTitle.value = '费用清单' - moneyParams1.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [], + const handleViewList = () => { + settleListTitle.value = '费用清单' + moneyParams1.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [] + } + // 打开费用清单弹框 + dialogFormVisibleSettleList.value = true } - // 打开费用清单弹框 - dialogFormVisibleSettleList.value = true -} const tableData5: any = ref([ + { + name1:'测试1', + name2:'测试1-1', + name3:'测试1-2', + jy1:'外观1-1', + jy2:'故障1-2', + jy3:'外观1-2', + jy4:'故障1-2', + jy5:'外观1-3', + jy6:'故障1-3', + jy7:'', + jy8:'', + remark:'备注1', + }, { - name1: '测试1', - name2: '测试1-1', - name3: '测试1-2', - jy1: '外观1-1', - jy2: '故障1-2', - jy3: '外观1-2', - jy4: '故障1-2', - jy5: '外观1-3', - jy6: '故障1-3', - jy7: '', - jy8: '', - remark: '备注1', - }, - { - name1: '测试2', - name2: '测试2-1', - name3: '测试2-2', - jy1: '外观2-1', - jy2: '故障2-2', - jy3: '外观2-2', - jy4: '故障2-2', - jy5: '外观2-3', - jy6: '故障2-3', - jy7: '', - jy8: '', - remark: '备注2', - }, + name1:'测试2', + name2:'测试2-1', + name3:'测试2-2', + jy1:'外观2-1', + jy2:'故障2-2', + jy3:'外观2-2', + jy4:'故障2-2', + jy5:'外观2-3', + jy6:'故障2-3', + jy7:'', + jy8:'', + remark:'备注2', + } ]) -const settleRepairTitle = ref('') + const settleRepairTitle = ref('') // 检修详情弹框显示隐藏 const dialogFormVisibleSettleRepair: any = ref(false) -//检修详情 -const handleViewRepair = () => { - settleListTitle.value = '检修详情' - moneyParams1.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [], + //检修详情 + const handleViewRepair = () => { + settleListTitle.value = '检修详情' + moneyParams1.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [] + } + // 打开检修详情弹框 + dialogFormVisibleSettleRepair.value = true } - // 打开检修详情弹框 - dialogFormVisibleSettleRepair.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 + } + + + - - + -
- + :close-on-click-modal="false"> +
+
- +