Merge branch 'dev-songyang'

This commit is contained in:
songyang 2023-12-12 09:23:53 +08:00
commit 164f4d64d3
8 changed files with 820 additions and 796 deletions

1
.gitignore vendored
View File

@ -29,3 +29,4 @@ coverage
*.sw?
.prettierrc.js
auto-imports.d.ts
components.d.ts

4
components.d.ts vendored
View File

@ -12,11 +12,15 @@ declare module 'vue' {
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElRow: typeof import('element-plus/es')['ElRow']
ElTag: typeof import('element-plus/es')['ElTag']
EquipCard: typeof import('./src/components/equipCard.vue')['default']
EquipDetailTable: typeof import('./src/components/equipDetailTable.vue')['default']
FooterInfo: typeof import('./src/components/FooterInfo/index.vue')['default']

View File

@ -4,11 +4,11 @@
const navMenuList = [
{ name: '首页', routerName: 'home' },
{ name: '自选直租', routerName: 'equipList' },
{ name: '寻源比价', routerName: '/home' },
{ name: '寻源比价', routerName: 'parity' },
{ name: '二手交易', routerName: '/home' },
{ name: '保险业务', routerName: '/home' },
{ name: '检验业务', routerName: '/home' },
{ name: '企业专区', routerName: '/home' }
{ name: '企业专区', routerName: 'enterpriseZone' }
]
const navMenuClick = (name: any) => {

View File

@ -87,7 +87,7 @@
<span v-if="!isShowLogout">
<a class="a-border-none" @click="$router.push('/login')">登录</a>
<span style="margin: 0 3px">/</span>
<a>注册</a>
<a @click="$router.push('/register')">注册</a>
</span>
<span v-else>
<a @click="handlerLogout">退出登录</a>

View File

@ -122,6 +122,28 @@ const routes: Array<RouteRecordRaw> = [
},
component: () => import('views/collect/index.vue')
},
// 寻源比价页面
{
path: '/parity',
name: 'parity',
meta: {
title: '寻源比较',
isLogin: true,
AuthFlag: false
},
component: () => import('views/parity/index.vue')
},
// 企业专区页面
{
path: '/enterpriseZone',
name: 'enterpriseZone',
meta: {
title: '企业专区',
isLogin: true,
AuthFlag: false
},
component: () => import('views/enterpriseZone/index.vue')
},
// 个人中心
{
path: '/myuser', // 主路由地址

View File

@ -0,0 +1,7 @@
<script setup lang="ts"></script>
<template>
<div>企业专区---</div>
</template>
<style></style>

View File

@ -9,20 +9,26 @@
<div class="equipInfo">
<div class="left">
<div class="title">
<div class="name">{{ pageData.modelName }}{{ pageData.deviceName }}</div>
<div class="name">
{{ pageData.modelName }}{{ pageData.deviceName }}
</div>
<div class="tag">
<div class="item otherItem">{{ pageData.maStatusStr }}</div>
<div class="item ">已审核</div>
<div class="item">已审核</div>
</div>
</div>
<div class="viewNnum">浏览{{ pageData.searchNum }}</div>
<div class="infoBox">
<div class="item" v-for="(v, i) in equipBaseInfoList" :key="i">
<div class="label">{{ v.label }}</div>
<div class="value">{{
v.key.split(',').map(key => {
<div class="value">
{{
v.key
.split(',')
.map((key) => {
return pageData[key]
}).join('')
})
.join('')
}}
</div>
</div>
@ -35,29 +41,27 @@
<span>{{ pageData.monthLeasePrice }}</span>
/
</div>
<div class="collect" v-authBtn="()=>collectChange" >
<div class="collect" v-authBtn="() => collectChange">
<el-icon class="no" v-show="!isCollect">
<Star/>
<Star />
</el-icon>
<el-icon class="yes" v-show="isCollect">
<StarFilled/>
<StarFilled />
</el-icon>
{{ isCollect ? '装备已收藏' : '收藏装备' }}
</div>
</div>
<div class="options">
<div class="item contact" @click="openPhone">联系商家</div>
<div class="item applyFor" v-authBtn="()=>openLease">我要租</div>
<div class="item applyFor" v-authBtn="() => openLease">我要租</div>
</div>
</div>
</div>
<div class="businessInfo">
<img class="bgCar" src="@/assets/img/equipDetail/gouwu.png"/>
<img class="bgCar" src="@/assets/img/equipDetail/gouwu.png" />
<div class="business">
<img
src="@/assets/img/bns-logo.png"
class="avatar"/>
<img src="@/assets/img/bns-logo.png" class="avatar" />
<div class="fonts">
<div class="name">{{ pageData.companyName }}</div>
<div class="other">
@ -78,9 +82,10 @@
<div class="list publicContent">
<div class="item" v-for="(v, i) in equipDetailKeyList" :key="i">
<div class="label">{{ v.label }}</div>
<div :class="v.fn ? 'fnValue' : 'value'" @click="handelDetailListClick(v.fn,pageData[v.arg])">{{
pageData[v.key]
}}
<div
:class="v.fn ? 'fnValue' : 'value'"
@click="handelDetailListClick(v.fn, pageData[v.arg])">
{{ pageData[v.key] }}
</div>
</div>
</div>
@ -89,7 +94,7 @@
<div class="publicTitle">装备外观</div>
<div class="publicLine"></div>
<div class="urlList publicContent">
<img :src="v" v-for="(v, i) in (pageData.pictures || [])" :key="i"/>
<img :src="v" v-for="(v, i) in pageData.pictures || []" :key="i" />
</div>
</div>
<div class="recommend">
@ -99,13 +104,14 @@
<div class="change" @click="randomHotList">换一批</div>
</div>
<div class="content">
<equip-card class="item"
<equip-card
class="item"
@on-click="goDetail"
v-for="(v, i) in hotList"
:key="i"
:url="v.picUrl"
:name="`${v.modelName}${v.deviceName}`"
:tags="[v.maStatusStr,v.cityStr]"
:tags="[v.maStatusStr, v.cityStr]"
:company="v.companyName"
:price="v.monthLeasePrice"
timeUnit="月"
@ -118,8 +124,7 @@
title="填写租赁信息"
lock-scroll
class="dialoglease"
width="60%"
>
width="60%">
<el-config-provider :locale="zhCn">
<el-form
ref="ruleFormRef"
@ -127,20 +132,20 @@
:rules="rules"
label-width="120px"
class="demo-ruleForm"
status-icon
>
status-icon>
<el-row>
<el-col :span="15">
<el-form-item label="设备进场地址" prop="address">
<el-cascader :props="addressCascader" v-model="ruleForm.address"/>
<el-cascader :props="addressCascader" v-model="ruleForm.address" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item label="详细地址" prop="detailAddress">
<el-input placeholder="请输入地址" v-model="ruleForm.detailAddress"></el-input>
<el-input
placeholder="请输入地址"
v-model="ruleForm.detailAddress"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -151,20 +156,25 @@
v-model="ruleForm.entryTime"
value-format="YYYY-MM-DD"
type="date"
placeholder="请选择"
/>
placeholder="请选择" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item label="工期时长" prop="duration">
<el-input v-model.number="ruleForm.duration" type="number" placeholder="请输入工期时长">
<el-input
v-model.number="ruleForm.duration"
type="number"
placeholder="请输入工期时长">
<template #append>
<el-select v-model="ruleForm.durationUnit" placeholder="Select"
style="width: 85px" @change="priceChange">
<el-option label="天" value="0"/>
<el-option label="月" value="1"/>
<el-select
v-model="ruleForm.durationUnit"
placeholder="Select"
style="width: 85px"
@change="priceChange">
<el-option label="天" value="0" />
<el-option label="月" value="1" />
</el-select>
</template>
</el-input>
@ -178,24 +188,16 @@
<el-radio-button :label="1" :disabled="!pageData.isOperator">
</el-radio-button>
<el-radio-button :label="0">
</el-radio-button>
<el-radio-button :label="0"></el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发票类型" prop="invoiceType">
<el-radio-group v-model="ruleForm.invoiceType">
<el-radio-button label="">
不需要
</el-radio-button>
<el-radio-button :label="1">
增值税普票
</el-radio-button>
<el-radio-button :label="2">
增值税专票
</el-radio-button>
<el-radio-button label="">不需要</el-radio-button>
<el-radio-button :label="1">增值税普票</el-radio-button>
<el-radio-button :label="2">增值税专票</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
@ -203,7 +205,10 @@
<el-row>
<el-col :span="15">
<el-form-item label="项目说明" prop="projectDescription">
<el-input placeholder="请填写项目说明" rows="5" type="textarea"
<el-input
placeholder="请填写项目说明"
rows="5"
type="textarea"
v-model="ruleForm.projectDescription"></el-input>
</el-form-item>
</el-col>
@ -211,71 +216,73 @@
</el-form>
</el-config-provider>
<equipDetailTable
:price="`${ruleForm.durationUnit == '1' ? pageData.monthLeasePrice : pageData.dayLeasePrice }`"
:price="`${
ruleForm.durationUnit == '1' ? pageData.monthLeasePrice : pageData.dayLeasePrice
}`"
:name="`${pageData.modelName}${pageData.deviceName}`"
:company="pageData.companyName"
:url="pageData.picUrl"
:brand="pageData.brand"
:code="pageData.code"
:group="pageData.groupName"
:position="`${pageData.provinceStr}${pageData.cityStr || ''}${pageData.areaStr || ''}`"
:position="`${pageData.provinceStr}${pageData.cityStr || ''}${
pageData.areaStr || ''
}`"
:specifications="pageData.specification"
:type="pageData.typeName"
:unit="ruleForm.durationUnit == '1' ? '月' : '天'"
></equipDetailTable>
:unit="ruleForm.durationUnit == '1' ? '月' : '天'"></equipDetailTable>
<div class="countPrice">
合计总价<span>{{ priceChange }}</span>
合计总价
<span>{{ priceChange }}</span>
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="submit(ruleFormRef)">
提交
</el-button>
<el-button type="primary" @click="submit(ruleFormRef)">提交</el-button>
</span>
</template>
</el-dialog>
<el-dialog
v-model="dialogPhone"
title="服务电话"
width="30%"
>
<div style="font-size: 16px;font-weight: 600;">
<el-dialog v-model="dialogPhone" title="服务电话" width="30%">
<div style="font-size: 16px; font-weight: 600">
{{ pageData.authPhone }}
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="openPhone">
确认
</el-button>
<el-button type="primary" @click="openPhone">确认</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import ShowImg from './comoonents/showImg.vue'
import {computed, reactive, ref} from 'vue'
import EquipCard from 'components/equipCard.vue'
import {getDetail, getHotList, equipCollect, apiSubmitLease, apiGetAddressList} from "@/http/api/equip"
import {useRoute, useRouter} from "vue-router";
import Navmenu from '@/components/Navmenu/index.vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import equipDetailTable from '@/components/equipDetailTable.vue'
import {ElMessage} from "element-plus";
import ShowImg from './comoonents/showImg.vue'
import { computed, reactive, ref } from 'vue'
import EquipCard from 'components/equipCard.vue'
import {
getDetail,
getHotList,
equipCollect,
apiSubmitLease,
apiGetAddressList
} from '@/http/api/equip'
import { useRoute, useRouter } from 'vue-router'
import Navmenu from '@/components/Navmenu/index.vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import equipDetailTable from '@/components/equipDetailTable.vue'
import { ElMessage } from 'element-plus'
import {mainStore} from '@/store/main'
import { mainStore } from '@/store/main'
const router = useRouter()
const route = useRoute()
const router = useRouter()
const route = useRoute()
const ruleFormRef = ref()
const ruleFormRef = ref()
const store = mainStore()
const store = mainStore()
const pageParams = route.params
//
const equipBaseInfoList = reactive([
const pageParams = route.params
//
const equipBaseInfoList = reactive([
{
label: '设备规格',
key: 'specification'
@ -296,9 +303,9 @@ const equipBaseInfoList = reactive([
label: '更新时间',
key: 'updateTime'
}
])
//
const businessList = reactive([
])
//
const businessList = reactive([
{
label: '入驻时间',
key: 'companyCreateTime',
@ -309,10 +316,10 @@ const businessList = reactive([
key: 'companyUpNum',
unit: '台'
}
])
])
//map
const equipDetailKeyList = reactive([
//map
const equipDetailKeyList = reactive([
{
label: '装备编号',
key: 'code',
@ -385,27 +392,26 @@ const equipDetailKeyList = reactive([
fn: 'openPdf',
arg: 'insurancePdf'
}
])
])
//
const dialogPhone = ref(false)
//
const dialogPhone = ref(false)
//
const pageData = ref({})
//
const pageData = ref({})
//
const dialoglease = ref(false)
//
const dialoglease = ref(false)
//
const isCollect = ref(false)
//
const isCollect = ref(false)
//
const hotList = ref([])
//
const showHotList = ref([])
//
const hotList = ref([])
//
const showHotList = ref([])
const checkDuration = (rule, value, callback) => {
const checkDuration = (rule, value, callback) => {
if ((value == '' || value == null) && value !== 0) {
return callback(new Error('请输入工期时长'))
} else if (value <= 0) {
@ -413,51 +419,35 @@ const checkDuration = (rule, value, callback) => {
} else {
return callback()
}
}
}
//
const ruleForm = ref({
address: [],//
detailAddress: '',//
entryTime: '',//
duration: null,//
durationUnit: '0',// 0 > 1 ->
machinist: 0,//
invoiceType: '',//
projectDescription: ''//
})
const rules = reactive({
address: [
{required: true, message: '请输入进场地址', trigger: 'blur'}
],
detailAddress: [
{required: true, message: '请输入详细地址', trigger: 'blur'}
],
entryTime: [
{required: true, message: '请选择进场时间', trigger: 'blur'},
],
duration: [
{validator: checkDuration, trigger: 'blur'}
//
const ruleForm = ref({
address: [], //
detailAddress: '', //
entryTime: '', //
duration: null, //
durationUnit: '0', // 0 > 1 ->
machinist: 0, //
invoiceType: '', //
projectDescription: '' //
})
const rules = reactive({
address: [{ required: true, message: '请输入进场地址', trigger: 'blur' }],
detailAddress: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
entryTime: [{ required: true, message: '请选择进场时间', trigger: 'blur' }],
duration: [{ validator: checkDuration, trigger: 'blur' }],
machinist: [{ required: true, message: '请输入进场地址', trigger: 'blur' }],
invoiceType: [],
projectDescription: [{ required: true, message: '请输入项目说明', trigger: 'blur' }]
})
],
machinist: [
{required: true, message: '请输入进场地址', trigger: 'blur'}
],
invoiceType: [
],
projectDescription: [
{required: true, message: '请输入项目说明', trigger: 'blur'}
],
})
//
const openLease = () => {
//
const openLease = () => {
dialoglease.value = true
}
//
const collectChange = async () => {
}
//
const collectChange = async () => {
isCollect.value = !isCollect.value
const params = {
maId: pageData.value.maId,
@ -471,10 +461,10 @@ const collectChange = async () => {
message: `装备${isCollect.value ? '收藏' : '取消收藏'}成功`
})
}
}
}
//
const priceChange = computed(() => {
//
const priceChange = computed(() => {
//
let count = 0
//
@ -500,31 +490,29 @@ const priceChange = computed(() => {
count = unitPrice * duration + jsPrice * duration
return Math.round(count * 100) / 100 || 0
})
})
//
const openPhone = () => {
//
const openPhone = () => {
dialogPhone.value = !dialogPhone.value
}
}
// pdf
const openPdf = (name) => {
// pdf
const openPdf = (name) => {
if (name) {
window.open(name)
}
}
const that = {
}
const that = {
openPdf
}
}
const addressCascader = {
const addressCascader = {
lazy: true,
label: 'name',
value: 'code',
lazyLoad: async (node, resolve) => {
const {level, data} = node
const { level, data } = node
let nodes = []
if (level == 0) {
const arr = await getAddressData()
@ -541,29 +529,28 @@ const addressCascader = {
}
resolve(nodes)
}
}
}
//
const getAddressData = async (code = '') => {
//
const getAddressData = async (code = '') => {
let params = {}
if (code) {
params = {code}
params = { code }
}
const res = await apiGetAddressList(params)
return res.data || []
}
}
const handelDetailListClick = (fnName, arg) => {
const handelDetailListClick = (fnName, arg) => {
if (fnName) {
that[fnName](arg)
}
}
}
//
const getData = async () => {
//
const getData = async () => {
const res = await getDetail(pageParams.id)
res.data.isOperatorCn = res.data.isOperator ? '是' : '否'
res.data.isInsurancePdf = res.data.insurancePdf ? '点击查看' : '暂无'
@ -571,10 +558,10 @@ const getData = async () => {
isCollect.value = res.data.collectId ? true : false
pageData.value = res.data
}
}
//
const gethotList = async () => {
//
const gethotList = async () => {
const params = {
pageNum: 1,
pageSize: 10
@ -582,36 +569,36 @@ const gethotList = async () => {
const res = await getHotList(params)
hotList.value = res.rows
randomHotList()
}
}
const randomHotList = () => {
showHotList.value = random().map(key => {
const randomHotList = () => {
showHotList.value = random().map((key) => {
return hotList.value[key]
})
}
const random = () => {
let numbers = new Set();
while (numbers.size < 3) {
numbers.add(Math.floor(Math.random() * 10));
}
return Array.from(numbers);
}
//
const goDetail = (val) => {
const random = () => {
let numbers = new Set()
while (numbers.size < 3) {
numbers.add(Math.floor(Math.random() * 10))
}
return Array.from(numbers)
}
//
const goDetail = (val) => {
router.push({
path: `/equipDetail/${val.id}`
})
}
}
//
const submit = async (Ref) => {
if(!Ref){
//
const submit = async (Ref) => {
if (!Ref) {
return
}
await Ref.validate( async(valid, fields) => {
if(valid){
await Ref.validate(async (valid, fields) => {
if (valid) {
const params = {
provinceId: ruleForm.value.address[0],
cityId: ruleForm.value.address[1],
@ -625,7 +612,7 @@ const submit = async (Ref) => {
durationType: ruleForm.value.durationUnit,
cost: priceChange.value,
maId: pageData.value.maId,
orderCompany:store.userInfo.companyId
orderCompany: store.userInfo.companyId
}
const res = await apiSubmitLease(params)
@ -638,36 +625,33 @@ const submit = async (Ref) => {
})
}
dialoglease.value = false
}else {
} else {
}
})
}
}
const init = async () => {
const init = async () => {
await gethotList()
await getData()
}
init()
}
init()
</script>
<style scoped lang="scss">
:deep(.dialoglease) {
:deep(.dialoglease) {
margin: 10px auto 0 !important;
min-width: 855px !important;
}
}
:deep(.el-form-item) {
:deep(.el-form-item) {
display: flex;
width: 100%;
.el-form-item__content {
flex: 1;
}
}
}
.countPrice {
.countPrice {
padding: 10px;
text-align: right;
@ -675,9 +659,9 @@ init()
color: red;
font-weight: 600;
}
}
}
.equipDetail {
.equipDetail {
user-select: none;
margin-top: 20px;
@ -707,7 +691,6 @@ init()
width: 62%;
.title {
.name {
font-size: 24px;
font-family: PingFangSC, PingFang SC;
@ -1006,5 +989,5 @@ init()
}
}
}
}
}
</style>

View File

@ -0,0 +1,7 @@
<script setup lang="ts"></script>
<template>
<div>寻源比价---</div>
</template>
<style></style>