代码优化
This commit is contained in:
parent
a47974425a
commit
98a864868c
|
|
@ -24,7 +24,6 @@ declare module 'vue' {
|
||||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||||
ElForm: typeof import('element-plus/es')['ElForm']
|
ElForm: typeof import('element-plus/es')['ElForm']
|
||||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
|
||||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||||
ElImage: typeof import('element-plus/es')['ElImage']
|
ElImage: typeof import('element-plus/es')['ElImage']
|
||||||
ElInput: typeof import('element-plus/es')['ElInput']
|
ElInput: typeof import('element-plus/es')['ElInput']
|
||||||
|
|
@ -32,7 +31,6 @@ declare module 'vue' {
|
||||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
|
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||||
|
|
@ -40,8 +38,6 @@ declare module 'vue' {
|
||||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
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']
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
ElTag: typeof import('element-plus/es')['ElTag']
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
|
|
@ -3,6 +3,7 @@ import $bus from '@/utils/bus'
|
||||||
import { mainStore } from 'store/main'
|
import { mainStore } from 'store/main'
|
||||||
import { useStore } from 'store/user'
|
import { useStore } from 'store/user'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import headerLogo from 'assets/img/zulinlogo.png'
|
||||||
const store: any = mainStore()
|
const store: any = mainStore()
|
||||||
const userStore = useStore()
|
const userStore = useStore()
|
||||||
userStore.editMenuList(1)
|
userStore.editMenuList(1)
|
||||||
|
|
@ -121,6 +122,18 @@ const onCarts = () => {
|
||||||
name: 'cart',
|
name: 'cart',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMyInfoPage = () => {
|
||||||
|
if (
|
||||||
|
route.path.indexOf('cart') !== -1 ||
|
||||||
|
route.path.indexOf('demand-details') !== -1 ||
|
||||||
|
route.path.indexOf('order-confirm') !== -1
|
||||||
|
) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -128,6 +141,21 @@ const onCarts = () => {
|
||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
<div class="header-user-info">
|
<div class="header-user-info">
|
||||||
<div class="header-box wapper">
|
<div class="header-box wapper">
|
||||||
|
<!-- <img
|
||||||
|
v-if="isMyInfoPage()"
|
||||||
|
:src="headerLogo"
|
||||||
|
style="height: 35px; cursor: pointer"
|
||||||
|
alt=""
|
||||||
|
|
||||||
|
/> -->
|
||||||
|
|
||||||
|
<el-image
|
||||||
|
style="width: 190px; cursor: pointer; margin-right: 50%"
|
||||||
|
v-if="isMyInfoPage()"
|
||||||
|
:src="headerLogo"
|
||||||
|
fit="contain"
|
||||||
|
@click="$router.push('/home')"
|
||||||
|
/>
|
||||||
<div class="header-item" v-if="isShowLogout">
|
<div class="header-item" v-if="isShowLogout">
|
||||||
<!-- <img src="../assets/img/home/star.png" alt="" /> -->
|
<!-- <img src="../assets/img/home/star.png" alt="" /> -->
|
||||||
<a class="user-name">{{ store.userInfo.nickName }}</a>
|
<a class="user-name">{{ store.userInfo.nickName }}</a>
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||||
name: 'equipDetail',
|
name: 'equipDetail',
|
||||||
component: () => import('views/equip/detail.vue'),
|
component: () => import('views/equip/detail.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '',
|
title: '装备详情',
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
AuthFlag: false,
|
AuthFlag: false,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Header />
|
<Header />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/" class="primary-lease">
|
||||||
<el-breadcrumb-item :to="{ name: 'parity' }">租赁需求大厅</el-breadcrumb-item>
|
<el-breadcrumb-item :to="{ path: backPath }">{{ backName }}</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item>需求详情</el-breadcrumb-item>
|
<el-breadcrumb-item>需求详情</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
|
||||||
|
|
@ -89,6 +89,7 @@
|
||||||
"
|
"
|
||||||
@click="onAcceptOrders"
|
@click="onAcceptOrders"
|
||||||
:disabled="userId == leaseDetails.publishUser"
|
:disabled="userId == leaseDetails.publishUser"
|
||||||
|
v-if="leaseDetails.leaseStatus !== 1"
|
||||||
>
|
>
|
||||||
立即接单
|
立即接单
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -108,6 +109,8 @@ import { getLeaseInfoByIdApi, setAcceptByIdApi } from 'http/api/home/index'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { mainStore } from 'store/main'
|
import { mainStore } from 'store/main'
|
||||||
|
const backPath = ref<any>('')
|
||||||
|
const backName = ref<any>('')
|
||||||
|
|
||||||
const leaseDetails = reactive<any>({})
|
const leaseDetails = reactive<any>({})
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
@ -159,6 +162,28 @@ const equipBaseInfoList = reactive([
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if (router.options.history.state.back) {
|
||||||
|
backPath.value = router.options.history.state.back
|
||||||
|
const previousRoute: any = []
|
||||||
|
|
||||||
|
router.options.routes.forEach((route: any) => {
|
||||||
|
if (route.path === router.options.history.state.back) {
|
||||||
|
previousRoute.push(route)
|
||||||
|
} else {
|
||||||
|
if (route.children && route.children.length > 0) {
|
||||||
|
route.children.forEach((r: any) => {
|
||||||
|
if (r.path === router.options.history.state.back) {
|
||||||
|
previousRoute.push(r)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (previousRoute.length > 0) {
|
||||||
|
backName.value = previousRoute[0].meta.title
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 获取详情数据
|
// 获取详情数据
|
||||||
const getLeaseInfoByIdData = async () => {
|
const getLeaseInfoByIdData = async () => {
|
||||||
const res: any = await getLeaseInfoByIdApi({ id: route.query.id })
|
const res: any = await getLeaseInfoByIdApi({ id: route.query.id })
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<Header />
|
<Header />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/" class="primary-lease">
|
||||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item>提交订单</el-breadcrumb-item>
|
<el-breadcrumb-item>提交订单</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,16 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" label="序号" type="index" width="80" />
|
<el-table-column align="center" label="序号" type="index" width="80" />
|
||||||
<el-table-column align="center" prop="leaseCode" label="需求编号" />
|
<el-table-column align="center" label="需求编号">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<a
|
||||||
|
style="cursor: pointer; color: #00a288; text-decoration: underline"
|
||||||
|
@click="router.push({ name: 'demand-details', query: { id: row.id } })"
|
||||||
|
>
|
||||||
|
{{ row.leaseCode }}
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="leaseName" label="需求名称" />
|
<el-table-column align="center" prop="leaseName" label="需求名称" />
|
||||||
<el-table-column align="center" prop="areaName" label="项目所在地" />
|
<el-table-column align="center" prop="areaName" label="项目所在地" />
|
||||||
<el-table-column align="center" prop="publishUser" label="发布人" />
|
<el-table-column align="center" prop="publishUser" label="发布人" />
|
||||||
|
|
@ -381,6 +390,7 @@ import { getCompanyListApi, getGoodsClassListApi, getAreaApi } from 'http/api/ho
|
||||||
import { getAcceptOrdersListApi } from 'http/api/sourcing/index'
|
import { getAcceptOrdersListApi } from 'http/api/sourcing/index'
|
||||||
import { InfoFilled } from '@element-plus/icons-vue'
|
import { InfoFilled } from '@element-plus/icons-vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
|
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
|
||||||
const addOrEditDialogVisible = ref(false)
|
const addOrEditDialogVisible = ref(false)
|
||||||
const companyOptions = ref<any>([])
|
const companyOptions = ref<any>([])
|
||||||
|
|
@ -396,10 +406,7 @@ const areaList = ref<any>([])
|
||||||
const releaseTime = ref([])
|
const releaseTime = ref([])
|
||||||
const dialogTitle = ref('新增')
|
const dialogTitle = ref('新增')
|
||||||
const fileListTemp = ref<any>([])
|
const fileListTemp = ref<any>([])
|
||||||
const props2 = {
|
const router = useRouter()
|
||||||
multiple: true,
|
|
||||||
checkStrictly: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchParams = reactive({
|
const searchParams = reactive({
|
||||||
leaseName: '',
|
leaseName: '',
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,10 @@ const submitBtn = () => {
|
||||||
insurancePdf: insurancePdf.value, //合格证
|
insurancePdf: insurancePdf.value, //合格证
|
||||||
examinationPdf: examinationPdf.value, //检测证明
|
examinationPdf: examinationPdf.value, //检测证明
|
||||||
}
|
}
|
||||||
if(equipmentDeploymentParams.value.maId&&equipmentDeploymentParams.value.maId!=""){
|
if (
|
||||||
|
equipmentDeploymentParams.value.maId &&
|
||||||
|
equipmentDeploymentParams.value.maId != ''
|
||||||
|
) {
|
||||||
const res: any = await equipmentEditApi(param)
|
const res: any = await equipmentEditApi(param)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
|
@ -496,7 +499,6 @@ const submitBtn = () => {
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -817,7 +819,16 @@ const handleRemove = (list: any, index: Number) => {
|
||||||
:header-cell-style="{ background: '#00a288', color: '#fff' }"
|
:header-cell-style="{ background: '#00a288', color: '#fff' }"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
width="55"
|
||||||
|
align="center"
|
||||||
|
:selectable="
|
||||||
|
(row:any) => {
|
||||||
|
return row.maStatus != 0
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
|
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
|
||||||
<el-table-column align="center" prop="deviceName" label="装备名称" />
|
<el-table-column align="center" prop="deviceName" label="装备名称" />
|
||||||
<el-table-column align="center" prop="code" label="装备编号" />
|
<el-table-column align="center" prop="code" label="装备编号" />
|
||||||
|
|
@ -831,7 +842,7 @@ const handleRemove = (list: any, index: Number) => {
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="typeName" label="装备型号" />
|
<el-table-column align="center" prop="typeName" label="装备型号" />
|
||||||
|
|
||||||
<el-table-column align="center" label="装备状态" width="80px">
|
<el-table-column align="center" label="装备状态">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag>
|
<el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag>
|
||||||
<el-tag v-if="row.maStatus == 1" size="small" type="warning">下架</el-tag>
|
<el-tag v-if="row.maStatus == 1" size="small" type="warning">下架</el-tag>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 寻源需求 -->
|
|
||||||
<el-form
|
<el-form
|
||||||
:inline="true"
|
:inline="true"
|
||||||
size="default"
|
size="default"
|
||||||
|
|
@ -101,12 +100,23 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" label="序号" type="index" width="80" />
|
<el-table-column align="center" label="序号" type="index" width="80" />
|
||||||
<el-table-column align="center" prop="leaseCode" label="需求编号" />
|
<el-table-column align="center" label="需求编号">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<a
|
||||||
|
style="cursor: pointer; color: #00a288; text-decoration: underline"
|
||||||
|
@click="router.push({ name: 'demand-details', query: { id: row.id } })"
|
||||||
|
>
|
||||||
|
{{ row.leaseCode }}
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="leaseName" label="需求名称" />
|
<el-table-column align="center" prop="leaseName" label="需求名称" />
|
||||||
<el-table-column align="center" prop="operateAddress" label="需求所在地" />
|
<el-table-column align="center" prop="operateAddress" label="需求所在地" />
|
||||||
<el-table-column align="center" prop="publishUser" label="发布人" />
|
<el-table-column align="center" prop="publishUser" label="发布人" />
|
||||||
<el-table-column align="center" prop="endTime" label="需求截止日期" />
|
<el-table-column align="center" prop="endTime" label="需求截止日期" width="120" />
|
||||||
<el-table-column align="center" prop="startTime" label="发布时间" />
|
<el-table-column align="center" prop="startTime" label="发布时间" />
|
||||||
|
<el-table-column align="center" prop="orderUser" label="接单人" />
|
||||||
|
<el-table-column align="center" prop="" label="接单人联系方式" width="140" />
|
||||||
<el-table-column align="center" prop="leaseStatusName" label="需求状态" />
|
<el-table-column align="center" prop="leaseStatusName" label="需求状态" />
|
||||||
<el-table-column align="center" label="操作" :width="220">
|
<el-table-column align="center" label="操作" :width="220">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
@ -124,8 +134,8 @@
|
||||||
size="small"
|
size="small"
|
||||||
class="primary-lease"
|
class="primary-lease"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="row.leaseStatus === 2"
|
v-if="row.leaseStatus === 2 || row.leaseStatus === 0"
|
||||||
@click="onRepublish(row.id, true)"
|
@click="onRepublish(row.id, true, row.leaseStatus)"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -400,7 +410,9 @@
|
||||||
>
|
>
|
||||||
保存
|
保存
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button class="primary-lease" @click="onSubmit(true)"> 提交 </el-button>
|
<el-button class="primary-lease" type="primary" @click="onSubmit(true)">
|
||||||
|
提交
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
@ -419,6 +431,7 @@ import {
|
||||||
} from 'http/api/sourcing/index'
|
} from 'http/api/sourcing/index'
|
||||||
import { InfoFilled } from '@element-plus/icons-vue'
|
import { InfoFilled } from '@element-plus/icons-vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
|
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
|
||||||
const addOrEditDialogVisible = ref(false)
|
const addOrEditDialogVisible = ref(false)
|
||||||
const companyOptions = ref<any>([])
|
const companyOptions = ref<any>([])
|
||||||
|
|
@ -434,10 +447,7 @@ const areaList = ref<any>([])
|
||||||
const releaseTime = ref([])
|
const releaseTime = ref([])
|
||||||
const dialogTitle = ref('新增')
|
const dialogTitle = ref('新增')
|
||||||
const fileListTemp = ref<any>([])
|
const fileListTemp = ref<any>([])
|
||||||
const props2 = {
|
const router = useRouter()
|
||||||
multiple: true,
|
|
||||||
checkStrictly: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchParams = reactive({
|
const searchParams = reactive({
|
||||||
leaseName: '',
|
leaseName: '',
|
||||||
|
|
@ -560,10 +570,11 @@ const onDelete = async (id: any) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 重新发布
|
// 重新发布
|
||||||
const onRepublish = async (id: any, type: any) => {
|
const onRepublish = async (id: any, type: any, leaseStatus: any) => {
|
||||||
dialogTitle.value = '编辑'
|
dialogTitle.value = '编辑'
|
||||||
isRepublish.value = false
|
isRepublish.value = false
|
||||||
isSave.value = type
|
isSave.value = type
|
||||||
|
if (leaseStatus === 0) isSave.value = false
|
||||||
const res: any = await getLeaseDetailsByIdApi({ id })
|
const res: any = await getLeaseDetailsByIdApi({ id })
|
||||||
const {
|
const {
|
||||||
leaseName,
|
leaseName,
|
||||||
|
|
@ -610,7 +621,6 @@ const onSubmit = (type: boolean) => {
|
||||||
addOrEditForm.value.isSubmit = type
|
addOrEditForm.value.isSubmit = type
|
||||||
addOrEditForm.value.typeId =
|
addOrEditForm.value.typeId =
|
||||||
addOrEditForm.value.typeIds[addOrEditForm.value.typeIds.length - 1]
|
addOrEditForm.value.typeIds[addOrEditForm.value.typeIds.length - 1]
|
||||||
|
|
||||||
addOrEditForm.value.fileInfoList.push(...fileListTemp.value)
|
addOrEditForm.value.fileInfoList.push(...fileListTemp.value)
|
||||||
const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi
|
const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi
|
||||||
const res: any = await SUBMIT_API(addOrEditForm.value)
|
const res: any = await SUBMIT_API(addOrEditForm.value)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue