需求列表功能完善

This commit is contained in:
BianLzhaoMin 2024-11-27 18:22:35 +08:00
parent f73ff35633
commit 0c70fbdac4
8 changed files with 68 additions and 48 deletions

25
components.d.ts vendored
View File

@ -8,16 +8,12 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default']
<<<<<<< HEAD
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']
=======
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
>>>>>>> 3e9ad09a2819e350266aaac04c776f0f461c9e79
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
@ -25,34 +21,23 @@ declare module 'vue' {
ElDialog: typeof import('element-plus/es')['ElDialog']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
<<<<<<< HEAD
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']
=======
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']
>>>>>>> 3e9ad09a2819e350266aaac04c776f0f461c9e79
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
<<<<<<< HEAD
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']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
=======
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']
>>>>>>> 3e9ad09a2819e350266aaac04c776f0f461c9e79
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']

View File

@ -10,7 +10,9 @@ userStore.editMenuList(1)
const route = useRoute()
const router = useRouter()
const isRolesSelect = ref<boolean>(false)
const rolesName = ref<string>('出租方')
const rolesName = ref<any>('1')
rolesName.value = localStorage.getItem('rolesType') || 1
// 退
const isShowLogout = computed(() => {
@ -95,10 +97,12 @@ const onSelectRoles = (type: number) => {
rolesName.value = '出租方'
userStore.editMenuList(1)
userStore.editUserMenuList(1)
localStorage.setItem('rolesType', '1')
} else {
rolesName.value = '承租方'
userStore.editMenuList(2)
userStore.editUserMenuList(2)
localStorage.setItem('rolesType', '2')
}
isRolesSelect.value = false
}
@ -137,7 +141,7 @@ const onCarts = () => {
<div class="header-item roles-check" @click="onRolesCheck" v-if="isShowLogout">
<!-- <img src="../assets/img/home/star.png" alt="" /> -->
<a style="display: flex; justify-content: center; padding-right: 10px">
{{ rolesName }}
{{ rolesName == 1 ? '出租方' : '承租方' }}
<el-icon style="margin-left: 10px"><ArrowDownBold /></el-icon>
</a>

View File

@ -43,7 +43,7 @@ service.interceptors.response.use(
ElMessage.error(data.msg)
router.push('/login')
} else if (data.code == '500') {
ElMessage.error('请求失败')
ElMessage.error(data.msg)
}
else {
return data

View File

@ -12,7 +12,9 @@ userStore.editMenuList(1)
const route = useRoute()
const router = useRouter()
const isRolesSelect = ref<boolean>(false)
const rolesName = ref<string>('出租方')
const rolesName = ref<any>('1')
rolesName.value = localStorage.getItem('rolesType') || 1
// 退
const isShowLogout = computed(() => {
@ -107,10 +109,12 @@ const onSelectRoles = (type: number) => {
rolesName.value = '出租方'
userStore.editMenuList(1)
userStore.editUserMenuList(1)
localStorage.setItem('rolesType', '1')
} else {
rolesName.value = '承租方'
userStore.editMenuList(2)
userStore.editUserMenuList(2)
localStorage.setItem('rolesType', '2')
}
isRolesSelect.value = false
}
@ -149,7 +153,7 @@ const onCarts = () => {
<div class="header-item roles-check" @click="onRolesCheck" v-if="isShowLogout">
<!-- <img src="../assets/img/home/star.png" alt="" /> -->
<a style="display: flex; justify-content: center; padding-right: 10px">
{{ rolesName }}
{{ rolesName == 1 ? '出租方' : '承租方' }}
<el-icon style="margin-left: 10px"><ArrowDownBold /></el-icon>
</a>

View File

@ -32,6 +32,19 @@ export const useStore = defineStore('myUser', {
{ title: '寻源竞价', name: 'sourcingBidding' },
{ title: '专区管理', name: 'zoneManag' },
],
isType: 1,
leaseUserList: [
{ title: '订单管理', name: 'orderManagementCz' },
{ title: '商品管理', name: 'goodsManagement' },
{ title: '商品上下架', name: 'goodsUpdown' },
{ title: '机手管理', name: 'operatorManagement' },
{ title: '寻源竞价', name: 'sourcingBidding' },
{ title: '专区管理', name: 'zoneManag' },
],
lesseeUserList: [
{ title: '寻源需求', name: 'sourcingNeed' },
{ title: '订单管理', name: 'orderManagement' },
]
}
},
getters: {
@ -121,9 +134,11 @@ export const useStore = defineStore('myUser', {
]
if (type == 1) {
this.leaseAndLesseeList = baseList
this.isType = 1
} else {
this.leaseAndLesseeList = baseList
this.leaseAndLesseeList.splice(3, 1)
this.isType = 2
}
},
editUserMenuList(type: number) {
@ -153,9 +168,9 @@ export const useStore = defineStore('myUser', {
{
// 自定义存储的 key默认是 store.$id
key: 'myUser',
storage: sessionStorage, //缓存模式 可选 localStorage sessionStorage
storage: localStorage, //缓存模式 可选 localStorage sessionStorage
// state 中的字段名,按组打包储存
paths: ['currentMenuType', 'currentMenuItem', 'menuList', 'leaseAndLesseeList'] //需要缓存的字段 与 state中相关联
paths: ['currentMenuType', 'currentMenuItem', 'menuList', 'leaseAndLesseeList', 'isType'] //需要缓存的字段 与 state中相关联
}
]
}

View File

@ -55,6 +55,8 @@ const handlerLogin = async () => {
// "https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2023/12/09/815629f192564db98ac55a643b46f853gouwu.png",
// });
// }
localStorage.setItem('rolesType', '1')
//
if (route.query && route.query.redirect) {
router.push(decodeURIComponent(route.query.redirect))

View File

@ -661,7 +661,6 @@ const rules = reactive({
// dialoglease.value = true
// }
const openLease = () => {
console.log(pageData.value)
onAddCart()
@ -1237,7 +1236,7 @@ const onAddCart = async () => {
cursor: pointer;
width: calc(100% / 3);
font-size: 14px;
font-family: PingFangSC, PingFang SC;
// font-family: PingFangSC, PingFang SC;
// font-weight: 600;
display: flex;
margin-bottom: 35px;
@ -1251,12 +1250,12 @@ const onAddCart = async () => {
color: #333333;
flex: 1;
word-break: break-all;
font-family: 'fangsong';
// font-family: 'fangsong';
}
.fnValue {
color: #0087cd;
font-family: 'fangsong';
// font-family: 'fangsong';
}
}
}

View File

@ -104,17 +104,26 @@
<el-table-column align="center" prop="endTime" label="需求截止日期" />
<el-table-column align="center" prop="startTime" label="发布时间" />
<el-table-column align="center" prop="leaseStatusName" label="需求状态" />
<el-table-column align="center" label="操作" width="160">
<el-table-column align="center" label="操作" :width="220">
<template #default="{ row }">
<el-button
text
size="small"
type="primary"
v-if="row.leaseStatus === 2"
@click="onRepublish(row.id)"
@click="onRepublish(row.id, false)"
>
重新发布
</el-button>
<el-button
text
size="small"
type="primary"
v-if="row.leaseStatus === 2"
@click="onRepublish(row.id, true)"
>
编辑
</el-button>
<el-popconfirm
width="220"
:icon="InfoFilled"
@ -151,11 +160,11 @@
size="small"
:total="total"
:page-sizes="[10, 20, 50, 100]"
:page-size="searchParams.pageSize"
:current-page="searchParams.pageNum"
v-model:page-size="searchParams.pageSize"
v-model:current-page="searchParams.pageNum"
layout="total, prev, pager, next,sizes"
@size-change="onCurrentChange"
@current-change="onCurrentChange"
@size-change="getLeaseListData"
@current-change="getLeaseListData"
/>
<!-- 新增修改对话框 -->
@ -319,7 +328,8 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit()"> 提交 </el-button>
<el-button type="primary" @click="onSubmit(false)" v-if="isSave"> 保存 </el-button>
<el-button type="primary" @click="onSubmit(true)"> 提交 </el-button>
</div>
</template>
</el-dialog>
@ -345,6 +355,7 @@ const addOrEditFormRef = ref<any>(null)
const searchFormRef = ref<any>(null)
const leaseList = ref<any>([])
const isRepublish = ref(true)
const isSave = ref(false)
const total = ref(0)
const endTime = ref([])
const releaseTime = ref([])
@ -411,10 +422,6 @@ const getClassAndCompanyData = async () => {
companyOptions.value = companyResult.data
}
const onCurrentChange = (val: any) => {
console.log(val)
}
//
const getLeaseListData = async () => {
if (endTime.value.length > 0) {
@ -438,6 +445,8 @@ const onReset = () => {
searchParams.finishEndTime = ''
searchParams.publishStartTime = ''
searchParams.publishEndTime = ''
searchParams.pageNum = 1
searchParams.pageSize = 10
searchFormRef.value.resetFields()
getLeaseListData()
}
@ -453,8 +462,9 @@ const onDelete = async (id: any) => {
}
}
//
const onRepublish = async (id: any) => {
const onRepublish = async (id: any, type: any) => {
isRepublish.value = false
isSave.value = type
const res: any = await getLeaseDetailsByIdApi({ id })
const {
leaseName,
@ -486,14 +496,15 @@ const onRepublish = async (id: any) => {
addOrEditForm.typeIds = addOrEditForm.typeIds.map((e: any) => {
return (e *= 1)
})
addOrEditDialogVisible.value = true
}
//
const onSubmit = () => {
const onSubmit = (type: boolean) => {
addOrEditFormRef.value.validate(async (valid: any) => {
if (valid) {
addOrEditForm.isSubmit = isRepublish.value
addOrEditForm.isSubmit = type
addOrEditForm.typeId = addOrEditForm.typeIds[addOrEditForm.typeIds.length - 1]
const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi
const res: any = await SUBMIT_API(addOrEditForm)
@ -530,7 +541,7 @@ onMounted(() => {
justify-content: flex-end;
padding: 5px 0;
}
:deep.el-pagination.is-background .el-pager li.is-active {
background-color: #3cb4a6;
}
// :deep.el-pagination.is-background .el-pager li.is-active {
// background-color: #3cb4a6;
// }
</style>