代码优化

This commit is contained in:
BianLzhaoMin 2024-12-09 13:10:06 +08:00
parent 6792becdbb
commit acc00f3887
7 changed files with 52 additions and 21 deletions

11
components.d.ts vendored
View File

@ -9,6 +9,8 @@ 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']
@ -16,21 +18,30 @@ declare module 'vue' {
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']
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']

View File

@ -23,14 +23,20 @@ const isShowLogout = computed(() => {
return store.token
})
if (userStore.companyList.length === 0) {
getCompanyList()
} else {
const setActiveCompanyName = () => {
const companyList = userStore.companyList
const activeCompany: any = companyList.filter(
(e: any) => e.companyId == store.userInfo.companyId,
)
activeLoginCompanyName.value = activeCompany[0].companyName
activeLoginCompanyName.value = activeCompany[0]?.companyName
}
if (userStore.companyList.length === 0) {
getCompanyList().then((res) => {
setActiveCompanyName()
})
} else {
setActiveCompanyName()
}
const placeholderText = ref('搜索设备关键词')

View File

@ -30,15 +30,20 @@ const isShowLogout = computed(() => {
return store.token
})
if (userStore.companyList.length === 0) {
getCompanyList()
} else {
const setActiveCompanyName = () => {
const companyList = userStore.companyList
const activeCompany: any = companyList.filter(
(e: any) => e.companyId == store.userInfo.companyId,
)
activeLoginCompanyName.value = activeCompany[0].companyName
console.log(activeCompany, '用户信息')
activeLoginCompanyName.value = activeCompany[0]?.companyName
}
if (userStore.companyList.length === 0) {
getCompanyList().then((res) => {
setActiveCompanyName()
})
} else {
setActiveCompanyName()
}
const placeholderText = ref('搜索设备关键词')
@ -180,7 +185,8 @@ const onJumpUser = () => {
if (roles?.length > 0) {
const isAdmin = roles.some((e: any) => e.roleKey == 'admin')
if (isAdmin) {
window.location.replace(`http://192.168.0.244:17788?token=${store.token}`)
// window.location.href = `http://192.168.137.101:80/?token=${store.token}`
window.open(`http://192.168.137.101:80/?token=${store.token}`)
} else {
router.push({ name: 'my-user' })
}

View File

@ -228,7 +228,7 @@ if (props.orderStatus == 7) {
stepList.value[3].title = '租赁结束'
stepList.value[4].title = '退租已结算'
stepList.value[5].title = '结算已确认'
currentActive.value = 6
currentActive.value = 7
}
</script>

View File

@ -324,7 +324,11 @@ const confirmFail = async (index: number) => {
.catch(() => {})
}
const onViewOverhaulDetails = () => {}
const onViewOverhaulDetails = (orderId: any) => {
settleListTitle.value = '检修详情'
currentOrderId.value = orderId
getOverhaulDetails(orderId)
}
//
const handleViewList = async (orderId: any) => {
@ -717,14 +721,14 @@ const costSubmit = () => {
>
费用清单
</el-button>
<!-- <el-button
v-if="item.orderStatus == 6 && item.isLeaseContent == 1"
@click="onViewOverhaulDetails()"
<el-button
v-if="item.orderStatus == 7 && item.isLeaseContent == 1"
@click="onViewOverhaulDetails(item.orderId)"
type="primary"
size="small"
>
检修详情
</el-button> -->
</el-button>
<el-button
v-if="item.orderStatus == 6 && item.isLeaseContent == 1"
@click="onCostConfirm(item.orderId)"

View File

@ -231,7 +231,7 @@ if (props.orderStatus == 7) {
stepList.value[3].title = '租赁结束'
stepList.value[4].title = '退租已结算'
stepList.value[5].title = '结算已确认'
currentActive.value = 6
currentActive.value = 7
}
</script>

View File

@ -548,8 +548,12 @@ const dialogFormVisibleSettleRepair: any = ref(false)
const handleViewRepair = (item: any) => {
viewOrderDetailsOrderId.value = ''
viewOrderDetailsOrderId.value = item.orderId
viewOrderDetailsType.value = 2
addOrEditDialogVisible.value = true
addOrEditDialogCostStatus.value = item.orderStatus
addOrEditDialogCostVisible.value = true
// viewOrderDetailsOrderId.value = ''
// viewOrderDetailsOrderId.value = item.orderId
// viewOrderDetailsType.value = 2
// addOrEditDialogVisible.value = true
// settleListTitle.value = ''
// moneyParams1.value = {
@ -934,7 +938,7 @@ const handleViewWord = () => {
费用结算
</el-button>
<el-button
v-if="item.orderStatus == '6'"
v-if="item.orderStatus == '6' || item.orderStatus == '7'"
@click="handleViewRepair(item)"
type="primary"
size="small"
@ -942,7 +946,7 @@ const handleViewWord = () => {
检修详情
</el-button>
<el-button
v-if="item.orderStatus == '6'"
v-if="item.orderStatus == '6' || item.orderStatus == '7'"
@click="handleViewList(item)"
type="primary"
size="small"