diff --git a/components.d.ts b/components.d.ts index 26f3f36..6aa057d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -3,7 +3,7 @@ // @ts-nocheck // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 -export {} +export { } declare module 'vue' { export interface GlobalComponents { @@ -13,8 +13,34 @@ declare module 'vue' { ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] 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'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] + ElInput: typeof import('element-plus/es')['ElInput'] + ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] + 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'] + ElSteps: typeof import('element-plus/es')['ElSteps'] + ElTable: typeof import('element-plus/es')['ElTable'] + ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTag: typeof import('element-plus/es')['ElTag'] + ElUpload: typeof import('element-plus/es')['ElUpload'] EquipCard: typeof import('./src/components/equipCard.vue')['default'] EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default'] EquipCardNew: typeof import('./src/components/equipCardNew/index.vue')['default'] diff --git a/src/router/index.ts b/src/router/index.ts index af14fd3..5342016 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -308,29 +308,29 @@ const routes: Array = [ // }, // }, // /* 订单管理(订单详情承租) */ - // { - // path: 'orderManagementInfo', - // name: 'orderManagementInfo', - // component: () => import('@/views/user/orderManagement/detail.vue'), - // meta: { - // title: '订单详情', - // keepAlive: true, - // AuthFlag: false, - // isLogin: false - // }, - // }, + { + path: 'orderManagementInfo', + name: 'orderManagementInfo', + component: () => import('@/views/user/orderManagement/detail.vue'), + meta: { + title: '订单详情', + keepAlive: true, + AuthFlag: false, + isLogin: false + }, + }, // /* 订单管理(退租) */ - // { - // path: 'rentinTermination', - // name: 'rentinTermination', - // component: () => import('views/user/orderManagement/orderCom/rentinTermination.vue'), - // meta: { - // title: '订单管理(退租)', - // keepAlive: true, - // AuthFlag: false, - // isLogin: true - // }, - // }, + { + path: 'rentinTermination', + name: 'rentinTermination', + component: () => import('views/user/orderManagement/orderCom/rentinTermination.vue'), + meta: { + title: '订单管理(退租)', + keepAlive: true, + AuthFlag: false, + isLogin: true + }, + }, // /* 订单管理(续租) */ // { // path: 'renewalOfLease', diff --git a/src/views/user/index.vue b/src/views/user/index.vue index 8e62106..f362284 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -47,6 +47,8 @@ import imgSrc from '@/assets/img/logo.png' const handleSelect = (name: any, path: any) => { // store.editcurrentMenuItem(name) + + store.editcurrentMenuItem(name) router.push({ name, }) diff --git a/src/views/user/orderManagementCz/index.vue b/src/views/user/orderManagementCz/index.vue index 171e765..6fa4693 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() @@ -45,8 +45,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 { @@ -72,7 +72,7 @@ onMounted(() => { // 查询按钮 const queryTableList = () => { - queryParams.value.pageNum=1 + queryParams.value.pageNum = 1 getList() } @@ -86,81 +86,117 @@ 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) => { +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 { ElMessageBox.confirm('是否确定出库?', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', - }).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(() => { + return passApi({ ids: ids, orderStatus: 3 }) + // return removeDeviceApi([row.maId]) }) - numberTemp.value = numberTemp.value+1; - getList() - } - }).catch(() => {}) - + .then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '出库成功', + }) + numberTemp.value = numberTemp.value + 1 + getList() + } + }) + .catch(() => {}) } +} // 驳回按钮 - const confirmFail = async (index: number) => { - - ElMessageBox.confirm('是否确定取消?', { +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('是否确定驳回?', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', - }).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(() => { + return failApi({ ids: ids, orderStatus: 7 }) + // return removeDeviceApi([row.maId]) }) - numberTemp.value = numberTemp.value+1; - getList() - } - }).catch(() => {}) - + .then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '驳回成功', + }) + 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.endTime.replace(/-/g, "/")); + // 将endtime转为Date对象 + const endTime = new Date(goods.rentEndTime.replace(/-/g, '/')) - // 判断endtime是否早于今天 - return endTime < today; + // 判断endtime是否早于今天 + return endTime < today } /* 退租按钮 */ @@ -270,71 +306,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: [] - } - // 打开退组检修弹框 - dialogFormVisibleSettlein.value = true +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 +} const settlemoneyTitle = ref('') const moneyParams1: any = ref({ @@ -359,34 +395,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:'测试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: '测试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', + }, ]) const partItems1: any = ref([{}]) @@ -395,221 +431,206 @@ const partItems3: any = ref([{}]) // 费用结算弹框显示隐藏 const dialogFormVisibleSettlemoney: any = ref(false) //费用结算 - 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 +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 +} - //维修费用 - 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:'测试2', - name2:'测试2-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', + }, ]) const tableData2: any = ref([ - { - 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-1', + name3: '3台', + jy1: '类型1', + 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-2', - 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', + }, ]) const tableData4: any = ref([ - { - name1:'测试4', - name2:'测试4-1', - name3:'3台', - jy1:'1400', - }, { - name1:'测试4', - name2:'测试4-2', - name3:'3台', - jy1:'1400', - } + name1: '测试4', + name2: '测试4-1', + name3: '3台', + jy1: '1400', + }, + { + name1: '测试4', + name2: '测试4-2', + name3: '3台', + jy1: '1400', + }, ]) //费用清单 - const handleViewList = () => { - settleListTitle.value = '费用清单' - moneyParams1.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [] - } - // 打开费用清单弹框 - dialogFormVisibleSettleList.value = true +const handleViewList = () => { + settleListTitle.value = '费用清单' + moneyParams1.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [], } + // 打开费用清单弹框 + 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:'测试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: '测试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', + }, ]) - const settleRepairTitle = ref('') +const settleRepairTitle = ref('') // 检修详情弹框显示隐藏 const dialogFormVisibleSettleRepair: any = ref(false) - //检修详情 - const handleViewRepair = () => { - settleListTitle.value = '检修详情' - moneyParams1.value = { - /* 设备状态 */ - maStatus: 15, - detectionList: [], - insureList: [], - picList: [] - } - // 打开检修详情弹框 - dialogFormVisibleSettleRepair.value = true +//检修详情 +const handleViewRepair = () => { + settleListTitle.value = '检修详情' + moneyParams1.value = { + /* 设备状态 */ + maStatus: 15, + detectionList: [], + insureList: [], + picList: [], } - - -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 - } - - - + // 打开检修详情弹框 + dialogFormVisibleSettleRepair.value = true +}