代码完善
This commit is contained in:
parent
2d18d62583
commit
45a2f0424a
|
|
@ -20,11 +20,9 @@ declare module 'vue' {
|
||||||
ElCountdown: typeof import('element-plus/es')['ElCountdown']
|
ElCountdown: typeof import('element-plus/es')['ElCountdown']
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
|
||||||
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']
|
||||||
|
|
@ -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']
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="equipCard" @click="cardClick">
|
<div class="equipCard" @click="cardClick">
|
||||||
<img
|
<img :src="url" alt="" />
|
||||||
src="https://fc1tn.baidu.com/it/u=4185529537,1682541874&fm=202&src=766&fc=tdmatt&mola=new&crop=v1"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="title">{{ name }}</div>
|
<div class="title">{{ name }}</div>
|
||||||
|
|
||||||
|
|
@ -88,7 +85,7 @@ const onHandelLessee = () => {
|
||||||
const onAddCart = async () => {
|
const onAddCart = async () => {
|
||||||
const addParams = {
|
const addParams = {
|
||||||
maId: props.id,
|
maId: props.id,
|
||||||
orderCompany: props.companyId
|
orderCompany: props.companyId,
|
||||||
}
|
}
|
||||||
const res = await addBookCarApi(addParams)
|
const res = await addBookCarApi(addParams)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
|
@ -105,7 +102,6 @@ const onAddCart = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.equipCard {
|
.equipCard {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
:multiple="props.multiple"
|
:multiple="props.multiple"
|
||||||
:limit="props.maxLimit"
|
:limit="props.maxLimit"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
:file-list="props.fileList"
|
:file-list="fileListNew"
|
||||||
:disabled="props.disabledFlag"
|
:disabled="props.disabledFlag"
|
||||||
:on-change="changeFileFn"
|
:on-change="changeFileFn"
|
||||||
:on-remove="(file:any, fileList:any) => removeFile(file, fileList)"
|
:on-remove="(file:any, fileList:any) => removeFile(file, fileList)"
|
||||||
|
|
@ -42,9 +42,19 @@ const headerInfo = reactive({
|
||||||
Authorization: store.token,
|
Authorization: store.token,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const fileListNew: any = ref([])
|
||||||
|
|
||||||
|
const emit = defineEmits(['onFileChange'])
|
||||||
|
|
||||||
// console.log('tmpUploadUrl', tmpUploadUrl)
|
// console.log('tmpUploadUrl', tmpUploadUrl)
|
||||||
// const actionUrl = ref(tmpUploadUrl)
|
// const actionUrl = ref(tmpUploadUrl)
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
fileListN: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
},
|
||||||
actionUrl: {
|
actionUrl: {
|
||||||
//上传的地址
|
//上传的地址
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -161,11 +171,20 @@ let loadProcess = ref(0) //进度条的刻度值
|
||||||
const successUpload = (response: any, file: any) => {
|
const successUpload = (response: any, file: any) => {
|
||||||
console.log('successUpload', response, file)
|
console.log('successUpload', response, file)
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
props.fileList.push({
|
// props.fileList.push({
|
||||||
url: response.data,
|
// url: response.data,
|
||||||
name: file.name,
|
// name: file.name,
|
||||||
})
|
// })
|
||||||
props.successResultCallBack(response)
|
// props.successResultCallBack(response)
|
||||||
|
|
||||||
|
const fileInfo = {
|
||||||
|
uid: file.uid,
|
||||||
|
}
|
||||||
|
Object.assign(fileInfo, response.data)
|
||||||
|
fileListNew.value.push(fileInfo)
|
||||||
|
emit('onFileChange', fileListNew.value)
|
||||||
|
|
||||||
|
// console.log(fileListNew.value, '-----------3333333333333')
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
|
@ -209,8 +228,8 @@ const handleExceed = (files: any, fileList: any) => {
|
||||||
}
|
}
|
||||||
// 移除文件
|
// 移除文件
|
||||||
const removeFile = (file: any, data: any) => {
|
const removeFile = (file: any, data: any) => {
|
||||||
console.log(file, data)
|
fileListNew.value = fileListNew.value.filter((e: any) => e.uid != file.uid)
|
||||||
// props.fileList = data
|
emit('onFileChange', fileListNew.value)
|
||||||
}
|
}
|
||||||
// 预览
|
// 预览
|
||||||
const preview = (data: any) => {
|
const preview = (data: any) => {
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ export const getDeviceListApi = (data: any) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取装备详情
|
//获取装备详情
|
||||||
export const getDetail = (id = '') => {
|
export const getDetail = (id = '', isHome: any) => {
|
||||||
return get(`/material-mall/dev/getInfo/${id}`)
|
return get(`/material-mall/dev/getInfo/${id}?isHome=${isHome}`)
|
||||||
}
|
}
|
||||||
//加入预约车
|
//加入预约车
|
||||||
export const addBookCarApi = (data: object) => {
|
export const addBookCarApi = (data: object) => {
|
||||||
|
|
|
||||||
|
|
@ -258,8 +258,8 @@ const onLeaseDateChange = (e: any, item: any) => {
|
||||||
|
|
||||||
// 删除按钮
|
// 删除按钮
|
||||||
const onDeleteGoods = async (id: number | string) => {
|
const onDeleteGoods = async (id: number | string) => {
|
||||||
const res: any = deleteCartByIdApi({ id })
|
const res: any = await deleteCartByIdApi({ id })
|
||||||
if (res.code === 200) {
|
if (res.code == 200) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
showClose: false,
|
showClose: false,
|
||||||
message: '删除成功',
|
message: '删除成功',
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,11 @@
|
||||||
<div class="label">参考图片/样式:</div>
|
<div class="label">参考图片/样式:</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<div>999</div>
|
<div class="img-list">
|
||||||
|
<div v-for="item in leaseDetails.fileInfoList" :key="item.id">
|
||||||
|
<img :src="item.fileUrl" alt="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -527,4 +531,23 @@ onMounted(() => {
|
||||||
color: #dd2323;
|
color: #dd2323;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.img-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
div {
|
||||||
|
width: calc((100% - 15px) / 2);
|
||||||
|
height: 120px;
|
||||||
|
margin: 0 15px 15px 0;
|
||||||
|
|
||||||
|
&:nth-child(2n) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -365,11 +365,11 @@ import {
|
||||||
addBookCarApi,
|
addBookCarApi,
|
||||||
apiSubmitLease,
|
apiSubmitLease,
|
||||||
apiGetAddressList,
|
apiGetAddressList,
|
||||||
} from '@/http/api/equip'
|
} from 'http/api/equip'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
// import Navmenu from '@/components/Navmenu/index.vue'
|
// import Navmenu from '@/components/Navmenu/index.vue'
|
||||||
import equipDetailTable from '@/components/equipDetailTable.vue'
|
import equipDetailTable from '@/components/equipDetailTable.vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { mainStore } from '@/store/main'
|
import { mainStore } from '@/store/main'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
@ -775,7 +775,7 @@ const handelDetailListClick = (fnName, arg) => {
|
||||||
|
|
||||||
//获取页面数据
|
//获取页面数据
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const res = await getDetail(pageParams.id)
|
const res = await getDetail(pageParams.id, true)
|
||||||
res.data.isOperatorCn = res.data.isOperator ? '是' : '否'
|
res.data.isOperatorCn = res.data.isOperator ? '是' : '否'
|
||||||
res.data.isInsurancePdf = res.data.insurancePdf ? '点击查看' : '暂无'
|
res.data.isInsurancePdf = res.data.insurancePdf ? '点击查看' : '暂无'
|
||||||
res.data.isExaminationPdf = res.data.examinationPdf ? '点击查看' : '暂无'
|
res.data.isExaminationPdf = res.data.examinationPdf ? '点击查看' : '暂无'
|
||||||
|
|
@ -871,20 +871,29 @@ const onAddCart = async () => {
|
||||||
maId: pageData.value.maId,
|
maId: pageData.value.maId,
|
||||||
orderCompany: pageData.value.companyId,
|
orderCompany: pageData.value.companyId,
|
||||||
}
|
}
|
||||||
const res = await addBookCarApi(addParams)
|
ElMessageBox.confirm('是否确定加入预约车?', '温馨提示', {
|
||||||
if (res.code === 200) {
|
confirmButtonText: '确定',
|
||||||
ElMessage({
|
cancelButtonText: '取消',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 1000,
|
})
|
||||||
message: `预约车加入成功`,
|
.then(async () => {
|
||||||
|
const res: any = await addBookCarApi(addParams)
|
||||||
|
if (res.code === 200) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
duration: 1000,
|
||||||
|
message: `预约车加入成功`,
|
||||||
|
})
|
||||||
|
getData()
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
type: 'error',
|
||||||
|
duration: 1000,
|
||||||
|
message: res.msg,
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
.catch(() => {})
|
||||||
ElMessage({
|
|
||||||
type: 'error',
|
|
||||||
duration: 1000,
|
|
||||||
message: res.msg,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,34 @@
|
||||||
<div class="screen">
|
<div class="screen">
|
||||||
<div class="choose">
|
<div class="choose">
|
||||||
<template v-for="(v, i) in screenChooseList" :key="i">
|
<template v-for="(v, i) in screenChooseList" :key="i">
|
||||||
<div class="line">
|
<div class="line" v-if="v.isShow">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
{{ v.name }}
|
{{ v.name }}
|
||||||
</div>
|
</div>
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<div
|
<template v-for="(val, index) in v.list" :key="index">
|
||||||
class="item"
|
<div
|
||||||
:class="{
|
class="item"
|
||||||
active: val.isChecked,
|
@click="selectScreen(v.type, val, i)"
|
||||||
}"
|
:class="{
|
||||||
@click="selectScreen(v.type, val, i)"
|
active: val.isChecked,
|
||||||
v-for="(val, index) in v.list"
|
}"
|
||||||
:key="index"
|
>
|
||||||
>
|
{{ val.name }}
|
||||||
{{ val.name }}
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div v-if="i == 2" style="display: flex; align-items: center">
|
||||||
|
<el-input v-model="startPrice" style="width: 60px" size="small" />
|
||||||
|
<span style="margin: 0 5px">-</span>
|
||||||
|
<el-input v-model="endPrice" style="width: 60px" size="small" />
|
||||||
|
<el-button
|
||||||
|
@click.stop="onConfirmPrice"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
style="margin-left: 20px"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -152,15 +165,51 @@ import {
|
||||||
import { getCompanyListApi } from '@/http/api/home'
|
import { getCompanyListApi } from '@/http/api/home'
|
||||||
import $bus from '@/utils/bus'
|
import $bus from '@/utils/bus'
|
||||||
import NavMenu from '@/components/Navmenu/index.vue'
|
import NavMenu from '@/components/Navmenu/index.vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route: any = useRoute()
|
const route: any = useRoute()
|
||||||
|
const startPrice: any = ref(0)
|
||||||
|
const endPrice: any = ref(0)
|
||||||
|
|
||||||
|
const onConfirmPrice = () => {
|
||||||
|
ElMessage.closeAll()
|
||||||
|
let rex = /^[1-9][0-9]*$/
|
||||||
|
if (!rex.test(startPrice.value) || !rex.test(endPrice.value)) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'warning',
|
||||||
|
message: '请输入大于0且不能以0开头的正整数',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parseInt(endPrice.value) < parseInt(startPrice.value)) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'warning',
|
||||||
|
message: '结束值不可小于起始值',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemInfo = {
|
||||||
|
name: `${parseInt(startPrice.value)}-${parseInt(endPrice.value)}`,
|
||||||
|
value: [parseInt(startPrice.value), parseInt(endPrice.value)],
|
||||||
|
isChecked: true,
|
||||||
|
index: 2,
|
||||||
|
isShow: false,
|
||||||
|
isAdd: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
screenChooseList[2].list[0].isChecked = false
|
||||||
|
screenChooseList[2].list.push(itemInfo)
|
||||||
|
}
|
||||||
|
|
||||||
//筛选条件列表数据
|
//筛选条件列表数据
|
||||||
const screenChooseList: any = reactive([
|
const screenChooseList: any = reactive([
|
||||||
{
|
{
|
||||||
name: '使用年限:',
|
name: '使用年限:',
|
||||||
type: 'userYear',
|
type: 'userYear',
|
||||||
|
isShow: true,
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
isChecked: true,
|
isChecked: true,
|
||||||
|
|
@ -203,6 +252,7 @@ const screenChooseList: any = reactive([
|
||||||
{
|
{
|
||||||
type: 'deviceClass',
|
type: 'deviceClass',
|
||||||
name: '装备分类:',
|
name: '装备分类:',
|
||||||
|
isShow: true,
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: '全部',
|
name: '全部',
|
||||||
|
|
@ -215,54 +265,63 @@ const screenChooseList: any = reactive([
|
||||||
{
|
{
|
||||||
type: 'leasePrice',
|
type: 'leasePrice',
|
||||||
name: '租金(天/元):',
|
name: '租金(天/元):',
|
||||||
|
isShow: true,
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: '全部',
|
name: '全部',
|
||||||
value: '',
|
value: '',
|
||||||
isChecked: true,
|
isChecked: true,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '0-500',
|
name: '0-500',
|
||||||
value: [0, 500],
|
value: [0, 500],
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '500-1000',
|
name: '500-1000',
|
||||||
value: [500, 1000],
|
value: [500, 1000],
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '1000-1500',
|
name: '1000-1500',
|
||||||
value: [1000, 1500],
|
value: [1000, 1500],
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '1500-2000',
|
name: '1500-2000',
|
||||||
value: [1500, 2000],
|
value: [1500, 2000],
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '2000-2500',
|
name: '2000-2500',
|
||||||
value: [2000, 2500],
|
value: [2000, 2500],
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '2500-3000',
|
name: '2500-3000',
|
||||||
value: [2500, 3000],
|
value: [2500, 3000],
|
||||||
isChecked: false,
|
isChecked: false,
|
||||||
index: 2,
|
index: 2,
|
||||||
|
isShow: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'companyId',
|
type: 'companyId',
|
||||||
name: '设备所在地:',
|
name: '设备所在地:',
|
||||||
|
isShow: true,
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
isChecked: true,
|
isChecked: true,
|
||||||
|
|
@ -272,14 +331,35 @@ const screenChooseList: any = reactive([
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'temp',
|
||||||
|
name: '',
|
||||||
|
isShow: false,
|
||||||
|
list: [],
|
||||||
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if (route.query.level == 1) {
|
||||||
|
screenChooseList[1].list[0].isChecked = false
|
||||||
|
}
|
||||||
|
if (route.query.companyId) {
|
||||||
|
const item = {
|
||||||
|
isChecked: true,
|
||||||
|
name: route.query.name,
|
||||||
|
value: route.query.companyId,
|
||||||
|
index: 4,
|
||||||
|
}
|
||||||
|
screenChooseList[4].list = []
|
||||||
|
screenChooseList[4].list.push(item)
|
||||||
|
}
|
||||||
|
|
||||||
// 已选条件的tag标签
|
// 已选条件的tag标签
|
||||||
const screenTags = computed(() => {
|
const screenTags = computed(() => {
|
||||||
const selectTagList: any = []
|
const selectTagList: any = []
|
||||||
screenChooseList.forEach((e: any) => {
|
screenChooseList.forEach((e: any) => {
|
||||||
e.list.forEach((j: any) => {
|
e.list.forEach((j: any) => {
|
||||||
if (j.isChecked && j.name !== '全部') {
|
if (j.isChecked && j.name !== '全部') {
|
||||||
|
console.log(j, '******')
|
||||||
selectTagList.push(j)
|
selectTagList.push(j)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -328,7 +408,6 @@ const getTypeListData = async () => {
|
||||||
})
|
})
|
||||||
screenChooseList[1].list.push(...typeList)
|
screenChooseList[1].list.push(...typeList)
|
||||||
}
|
}
|
||||||
getTypeListData()
|
|
||||||
|
|
||||||
// 获取设备所在地
|
// 获取设备所在地
|
||||||
const getCompanyAddressListData = async () => {
|
const getCompanyAddressListData = async () => {
|
||||||
|
|
@ -338,7 +417,6 @@ const getCompanyAddressListData = async () => {
|
||||||
})
|
})
|
||||||
screenChooseList[3].list.push(...addressList)
|
screenChooseList[3].list.push(...addressList)
|
||||||
}
|
}
|
||||||
getCompanyAddressListData()
|
|
||||||
|
|
||||||
// 查询装备列表数据
|
// 查询装备列表数据
|
||||||
const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
||||||
|
|
@ -366,6 +444,7 @@ const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
||||||
}
|
}
|
||||||
if (index === 1 && j.isChecked) {
|
if (index === 1 && j.isChecked) {
|
||||||
searchParams.typeId = j.value
|
searchParams.typeId = j.value
|
||||||
|
searchParams.level = j.value ? 1 : ''
|
||||||
}
|
}
|
||||||
if (index === 2 && j.isChecked && j.value.length > 0) {
|
if (index === 2 && j.isChecked && j.value.length > 0) {
|
||||||
searchParams.dayLeasePriceMin = j.value[0]
|
searchParams.dayLeasePriceMin = j.value[0]
|
||||||
|
|
@ -373,7 +452,6 @@ const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
||||||
}
|
}
|
||||||
if (index === 3 && j.isChecked) {
|
if (index === 3 && j.isChecked) {
|
||||||
searchParams.companyId = j.value
|
searchParams.companyId = j.value
|
||||||
searchParams.level = j.value ? 1 : ''
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -393,11 +471,20 @@ const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
||||||
|
|
||||||
// 清除筛选条件
|
// 清除筛选条件
|
||||||
const onClearTags = () => {
|
const onClearTags = () => {
|
||||||
screenChooseList.forEach((e: any) => {
|
screenChooseList.forEach((e: any, i: any) => {
|
||||||
e.list.forEach((j: any, index: number) => {
|
e.list.forEach((j: any, index: number) => {
|
||||||
j.isChecked = false
|
j.isChecked = false
|
||||||
if (index === 0) {
|
if (i != 4) {
|
||||||
j.isChecked = true
|
if (index === 0) {
|
||||||
|
j.isChecked = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (j.isAdd) {
|
||||||
|
startPrice.value = 0
|
||||||
|
endPrice.value = 0
|
||||||
|
screenChooseList[2].list = screenChooseList[2].list.filter(
|
||||||
|
(e: any) => e.isAdd != true,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -407,7 +494,17 @@ const onClearTags = () => {
|
||||||
//删除条件
|
//删除条件
|
||||||
const handleClose = (tag: any) => {
|
const handleClose = (tag: any) => {
|
||||||
tag.isChecked = false
|
tag.isChecked = false
|
||||||
screenChooseList[tag.index].list[0].isChecked = true
|
if (tag.index != 4) {
|
||||||
|
screenChooseList[tag.index].list[0].isChecked = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tag.isAdd) {
|
||||||
|
startPrice.value = 0
|
||||||
|
endPrice.value = 0
|
||||||
|
}
|
||||||
|
screenChooseList[tag.index].list = screenChooseList[tag.index].list.filter(
|
||||||
|
(e: any) => e.isAdd != true,
|
||||||
|
)
|
||||||
getDeviceListData()
|
getDeviceListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -458,7 +555,30 @@ onMounted(() => {
|
||||||
keyWord: route.query.keyWord,
|
keyWord: route.query.keyWord,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getDeviceListData(routeParams, null)
|
|
||||||
|
Promise.all([getCompanyAddressListData(), getTypeListData()]).then(() => {
|
||||||
|
if (route.query.level == 1) {
|
||||||
|
screenChooseList[1].list.forEach((e: any) => {
|
||||||
|
if (route.query.typeId == e.typeId) {
|
||||||
|
e.isChecked = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (route.query.level == 2 || route.query.level == 3) {
|
||||||
|
{
|
||||||
|
const item = {
|
||||||
|
isChecked: true,
|
||||||
|
name: route.query.name,
|
||||||
|
value: route.query.typeId,
|
||||||
|
index: 4,
|
||||||
|
}
|
||||||
|
screenChooseList[4].list = []
|
||||||
|
screenChooseList[4].list.push(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getDeviceListData(routeParams, null)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -45,20 +45,22 @@ const getCompanyListData = async () => {
|
||||||
getCompanyListData()
|
getCompanyListData()
|
||||||
|
|
||||||
// 点击跳转装备共享大厅
|
// 点击跳转装备共享大厅
|
||||||
const onSharedHall = (level: number, typeId: any) => {
|
const onSharedHall = (level: number, typeId: any, name: any) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'equipList',
|
name: 'equipList',
|
||||||
query: {
|
query: {
|
||||||
level,
|
level,
|
||||||
typeId,
|
typeId,
|
||||||
|
name,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const onSharedHallByCompany = (companyId: any) => {
|
const onSharedHallByCompany = (companyId: any, name: any) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'equipList',
|
name: 'equipList',
|
||||||
query: {
|
query: {
|
||||||
companyId,
|
companyId,
|
||||||
|
name,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -103,8 +105,7 @@ const hotDeviceList: any = ref([])
|
||||||
/* 获取热搜装备 */
|
/* 获取热搜装备 */
|
||||||
const getHotDeviceList = async () => {
|
const getHotDeviceList = async () => {
|
||||||
const res: any = await getHotList({ pageSize: 3 })
|
const res: any = await getHotList({ pageSize: 3 })
|
||||||
hotDeviceList.value = res.rows
|
hotDeviceList.value = res.data
|
||||||
console.log(res, '热搜装备111')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getHotDeviceList()
|
getHotDeviceList()
|
||||||
|
|
@ -149,14 +150,14 @@ const onSelectItem = (type: number) => {
|
||||||
|
|
||||||
<template v-if="selectOptionsValue === '分类筛选'">
|
<template v-if="selectOptionsValue === '分类筛选'">
|
||||||
<div v-for="item in classList" :key="item.name" class="item-container">
|
<div v-for="item in classList" :key="item.name" class="item-container">
|
||||||
<li class="item-nav" @click="onSharedHall(1, item.id)">
|
<li class="item-nav" @click="onSharedHall(1, item.id, item.name)">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
<ul class="sub-goods">
|
<ul class="sub-goods">
|
||||||
<!-- 级联框内 类别名称 -->
|
<!-- 级联框内 类别名称 -->
|
||||||
<li
|
<li
|
||||||
v-for="child in item.children"
|
v-for="child in item.children"
|
||||||
:key="child.id"
|
:key="child.id"
|
||||||
@click="onSharedHall(2, child.id)"
|
@click.stop="onSharedHall(2, child.id, child.name)"
|
||||||
>
|
>
|
||||||
<!-- 第二级 -->
|
<!-- 第二级 -->
|
||||||
<span class="second-name">
|
<span class="second-name">
|
||||||
|
|
@ -168,7 +169,7 @@ const onSelectItem = (type: number) => {
|
||||||
v-for="son in child.children"
|
v-for="son in child.children"
|
||||||
:key="son.id"
|
:key="son.id"
|
||||||
style="font-size: 14px; font-weight: normal"
|
style="font-size: 14px; font-weight: normal"
|
||||||
@click="onSharedHall(3, son.id)"
|
@click.stop="onSharedHall(3, son.id, son.name)"
|
||||||
>
|
>
|
||||||
{{ son.name }}
|
{{ son.name }}
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -230,7 +231,10 @@ const onSelectItem = (type: number) => {
|
||||||
:key="item.companyId"
|
:key="item.companyId"
|
||||||
class="item-container"
|
class="item-container"
|
||||||
>
|
>
|
||||||
<li class="item-nav" @click="onSharedHallByCompany(item.companyId)">
|
<li
|
||||||
|
class="item-nav"
|
||||||
|
@click="onSharedHallByCompany(item.companyId, item.companyName)"
|
||||||
|
>
|
||||||
{{ item.companyName }}
|
{{ item.companyName }}
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -265,32 +269,38 @@ const onSelectItem = (type: number) => {
|
||||||
<a>查看更多</a>
|
<a>查看更多</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="equip-pic">
|
<div v-for="item in hotDeviceList" :key="item.typeName" style="margin-top: 15px">
|
||||||
<li v-for="item in hotDeviceList" :key="item.maId" style="cursor: pointer">
|
<div class="hot-title">
|
||||||
<!-- <EquipCardNew
|
{{ item.typeName }}
|
||||||
|
</div>
|
||||||
|
<ul class="equip-pic">
|
||||||
|
<li v-for="g in item.devInfoList" :key="g.maId" style="cursor: pointer">
|
||||||
|
<!-- <EquipCardNew
|
||||||
@onClick="onClick"
|
@onClick="onClick"
|
||||||
:company="item.companyName || '安徽博诺斯有限公司'"
|
:company="item.companyName || '安徽博诺斯有限公司'"
|
||||||
:price="item.dayLeasePrice"
|
:price="item.dayLeasePrice"
|
||||||
:tags="[item.maStatusStr || '待租', item.cityStr || '合肥']"
|
:tags="[item.maStatusStr || '待租', item.cityStr || '合肥']"
|
||||||
:name="item.modelName + item.deviceName"
|
:name="item.modelName + item.deviceName"
|
||||||
:url="item.picUrl"
|
|
||||||
:id="item.maId"
|
:id="item.maId"
|
||||||
/> -->
|
/> -->
|
||||||
<EquipCardNew
|
<EquipCardNew
|
||||||
@onClick="onClick"
|
@onClick="onClick"
|
||||||
:id="item.maId"
|
:id="g.maId"
|
||||||
:companyId="item.companyId"
|
:companyId="g.companyId"
|
||||||
:company="item.companyName"
|
:company="g.companyName"
|
||||||
:name="item.deviceName"
|
:name="g.deviceName"
|
||||||
:price="item.dayLeasePrice"
|
:price="g.dayLeasePrice"
|
||||||
/>
|
:url="g.picUrl"
|
||||||
</li>
|
/>
|
||||||
</ul>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 专题咨询 -->
|
<!-- 专题咨询 -->
|
||||||
|
|
||||||
<div class="hot-equip">
|
<!-- <div class="hot-equip">
|
||||||
<span>专题资讯</span>
|
<span>专题资讯</span>
|
||||||
<a></a>
|
<a></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -308,13 +318,13 @@ const onSelectItem = (type: number) => {
|
||||||
<li>
|
<li>
|
||||||
<a>保险</a>
|
<a>保险</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul> -->
|
||||||
|
|
||||||
<div class="consult-content">
|
<!-- <div class="consult-content">
|
||||||
<!-- 左侧背景图片 -->
|
|
||||||
<div class="left-bg"></div>
|
<div class="left-bg"></div>
|
||||||
|
|
||||||
<!-- 右侧信息 -->
|
|
||||||
<div class="right-consult">
|
<div class="right-consult">
|
||||||
<div
|
<div
|
||||||
class="consult-box"
|
class="consult-box"
|
||||||
|
|
@ -332,7 +342,7 @@ const onSelectItem = (type: number) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -525,6 +535,12 @@ const onSelectItem = (type: number) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hot-title {
|
||||||
|
padding: 15px 0 10px 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
.equip-pic {
|
.equip-pic {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ const optionActive = ref(0)
|
||||||
//分页参数
|
//分页参数
|
||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 10,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 总条数
|
// 总条数
|
||||||
|
|
@ -318,12 +318,10 @@ const getLeaseListData = async () => {
|
||||||
companyId: '',
|
companyId: '',
|
||||||
typeId: '',
|
typeId: '',
|
||||||
level: '',
|
level: '',
|
||||||
startTime: '',
|
startTime: optionActive.value == 0 ? screenOptionList[optionActive.value].sort : '',
|
||||||
leaseDay: '',
|
rentDay: optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '',
|
||||||
endTime: '',
|
endTime: optionActive.value == 2 ? screenOptionList[optionActive.value].sort : '',
|
||||||
leaseNum: '',
|
rentNum: optionActive.value == 3 ? screenOptionList[optionActive.value].sort : '',
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 1,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
screenChooseList.forEach((e: any, index: number) => {
|
screenChooseList.forEach((e: any, index: number) => {
|
||||||
|
|
@ -342,37 +340,10 @@ const getLeaseListData = async () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(searchParams, 'searchParams')
|
Object.assign(searchParams, pageData)
|
||||||
const { data: res }: any = await getLeaseListApi(searchParams)
|
const { data: res }: any = await getLeaseListApi(searchParams)
|
||||||
|
|
||||||
leaseList.value = res.rows
|
leaseList.value = res.rows
|
||||||
}
|
|
||||||
|
|
||||||
// 查询装备列表数据
|
|
||||||
const getDeviceListData = async (params: any = null, keyWord: any = null) => {
|
|
||||||
// 组装查询参数
|
|
||||||
const searchParams: any = {
|
|
||||||
companyId: '',
|
|
||||||
typeId: '',
|
|
||||||
level: '',
|
|
||||||
startTime: '',
|
|
||||||
leaseDay: '',
|
|
||||||
endTime: '',
|
|
||||||
leaseNum: '',
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params) {
|
|
||||||
searchParams.level = params.level ? params.level : ''
|
|
||||||
searchParams.typeId = params.typeId ? params.typeId : ''
|
|
||||||
searchParams.companyId = params.companyId ? params.companyId : ''
|
|
||||||
searchParams.keyWord = params.keyWord ? params.keyWord : ''
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.assign(searchParams, pageData)
|
|
||||||
const { data: res }: any = await getDeviceListApi(searchParams)
|
|
||||||
equipList.value = res.rows
|
|
||||||
total.value = res.total
|
total.value = res.total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -394,6 +365,7 @@ const handleClose = (tag: any) => {
|
||||||
tag.isChecked = false
|
tag.isChecked = false
|
||||||
screenChooseList[tag.index].list[0].isChecked = true
|
screenChooseList[tag.index].list[0].isChecked = true
|
||||||
// getDeviceListData()
|
// getDeviceListData()
|
||||||
|
getLeaseListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 排序操作
|
// 排序操作
|
||||||
|
|
@ -405,6 +377,7 @@ const changeOption = (val: any) => {
|
||||||
console.log(screenOptionList, 'screenOptionList')
|
console.log(screenOptionList, 'screenOptionList')
|
||||||
optionActive.value = val.id
|
optionActive.value = val.id
|
||||||
// getDeviceListData()
|
// getDeviceListData()
|
||||||
|
getLeaseListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
//选中后添加到 大类中的select字段
|
//选中后添加到 大类中的select字段
|
||||||
|
|
@ -421,6 +394,7 @@ const selectScreen = (type: any, item: any, index: number) => {
|
||||||
const onCurrentChange = (val: number) => {
|
const onCurrentChange = (val: number) => {
|
||||||
pageData.pageNum = val
|
pageData.pageNum = val
|
||||||
// getDeviceListData()
|
// getDeviceListData()
|
||||||
|
getLeaseListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@
|
||||||
() => {
|
() => {
|
||||||
addOrEditDialogVisible = true
|
addOrEditDialogVisible = true
|
||||||
isRepublish = true
|
isRepublish = true
|
||||||
|
dialogTitle = '新增'
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
style="background-color: #17907f; color: #fff"
|
style="background-color: #17907f; color: #fff"
|
||||||
|
|
@ -130,6 +131,7 @@
|
||||||
icon-color="#626AEF"
|
icon-color="#626AEF"
|
||||||
title="确定删除该项需求吗?"
|
title="确定删除该项需求吗?"
|
||||||
@confirm="onDelete(row.id)"
|
@confirm="onDelete(row.id)"
|
||||||
|
v-if="row.leaseStatus != 1"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button size="small" text type="danger"> 删除 </el-button>
|
<el-button size="small" text type="danger"> 删除 </el-button>
|
||||||
|
|
@ -169,11 +171,12 @@
|
||||||
|
|
||||||
<!-- 新增修改对话框 -->
|
<!-- 新增修改对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="新增"
|
:title="dialogTitle"
|
||||||
width="60%"
|
width="60%"
|
||||||
align-center
|
align-center
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
v-model="addOrEditDialogVisible"
|
v-model="addOrEditDialogVisible"
|
||||||
|
@close="onClose"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
label-width="auto"
|
label-width="auto"
|
||||||
|
|
@ -292,6 +295,15 @@
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="参考图片/样式">
|
<el-form-item label="参考图片/样式">
|
||||||
|
<!-- <div class="img-list">
|
||||||
|
<div
|
||||||
|
v-for="item in addOrEditForm.fileInfoList || []"
|
||||||
|
:key="item.id"
|
||||||
|
class="img-items"
|
||||||
|
>
|
||||||
|
<img :src="item.fileUrl" alt="" />
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
<UploadComponentNew
|
<UploadComponentNew
|
||||||
:maxSize="2"
|
:maxSize="2"
|
||||||
:maxLimit="4"
|
:maxLimit="4"
|
||||||
|
|
@ -299,10 +311,11 @@
|
||||||
height="120px"
|
height="120px"
|
||||||
:autoUpload="true"
|
:autoUpload="true"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
|
:fileListN="addOrEditForm.fileInfoList"
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
:acceptTypeList="['.jpg', '.png']"
|
:acceptTypeList="['.jpg', '.png']"
|
||||||
:actionUrl="uploadUrl"
|
:actionUrl="uploadUrl"
|
||||||
:successResultCallBack="successResultCallBackFnDevicePic"
|
@onFileChange="onFileChange"
|
||||||
>
|
>
|
||||||
<template v-slot:default>
|
<template v-slot:default>
|
||||||
<el-icon size="48" color="#aaa"><Plus /></el-icon>
|
<el-icon size="48" color="#aaa"><Plus /></el-icon>
|
||||||
|
|
@ -359,6 +372,7 @@ const isSave = ref(false)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const endTime = ref([])
|
const endTime = ref([])
|
||||||
const releaseTime = ref([])
|
const releaseTime = ref([])
|
||||||
|
const dialogTitle = ref('新增')
|
||||||
const searchParams = reactive({
|
const searchParams = reactive({
|
||||||
leaseName: '',
|
leaseName: '',
|
||||||
leaseCode: '',
|
leaseCode: '',
|
||||||
|
|
@ -370,7 +384,21 @@ const searchParams = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
})
|
})
|
||||||
const addOrEditForm = reactive<any>({
|
const addOrEditForm = ref<any>({
|
||||||
|
leaseName: '',
|
||||||
|
typeId: '',
|
||||||
|
typeIds: [],
|
||||||
|
companyId: '',
|
||||||
|
person: '',
|
||||||
|
personPhone: '',
|
||||||
|
leaseDay: 1,
|
||||||
|
leaseNum: 1,
|
||||||
|
endTime: '',
|
||||||
|
description: '',
|
||||||
|
isSubmit: '',
|
||||||
|
fileInfoList: [],
|
||||||
|
})
|
||||||
|
const addOrEditFormTemp = ref<any>({
|
||||||
leaseName: '',
|
leaseName: '',
|
||||||
typeId: '',
|
typeId: '',
|
||||||
typeIds: [],
|
typeIds: [],
|
||||||
|
|
@ -463,6 +491,7 @@ const onDelete = async (id: any) => {
|
||||||
}
|
}
|
||||||
// 重新发布
|
// 重新发布
|
||||||
const onRepublish = async (id: any, type: any) => {
|
const onRepublish = async (id: any, type: any) => {
|
||||||
|
dialogTitle.value = '编辑'
|
||||||
isRepublish.value = false
|
isRepublish.value = false
|
||||||
isSave.value = type
|
isSave.value = type
|
||||||
const res: any = await getLeaseDetailsByIdApi({ id })
|
const res: any = await getLeaseDetailsByIdApi({ id })
|
||||||
|
|
@ -477,9 +506,10 @@ const onRepublish = async (id: any, type: any) => {
|
||||||
endTime,
|
endTime,
|
||||||
description,
|
description,
|
||||||
typeIds,
|
typeIds,
|
||||||
|
fileInfoList,
|
||||||
} = res.data
|
} = res.data
|
||||||
|
|
||||||
Object.assign(addOrEditForm, {
|
Object.assign(addOrEditForm.value, {
|
||||||
leaseName,
|
leaseName,
|
||||||
typeId,
|
typeId,
|
||||||
companyId,
|
companyId,
|
||||||
|
|
@ -491,9 +521,10 @@ const onRepublish = async (id: any, type: any) => {
|
||||||
description,
|
description,
|
||||||
typeIds,
|
typeIds,
|
||||||
id,
|
id,
|
||||||
|
fileInfoList,
|
||||||
})
|
})
|
||||||
|
|
||||||
addOrEditForm.typeIds = addOrEditForm.typeIds.map((e: any) => {
|
addOrEditForm.value.typeIds = addOrEditForm.value.typeIds.map((e: any) => {
|
||||||
return (e *= 1)
|
return (e *= 1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -504,16 +535,17 @@ const onRepublish = async (id: any, type: any) => {
|
||||||
const onSubmit = (type: boolean) => {
|
const onSubmit = (type: boolean) => {
|
||||||
addOrEditFormRef.value.validate(async (valid: any) => {
|
addOrEditFormRef.value.validate(async (valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addOrEditForm.isSubmit = type
|
addOrEditForm.value.isSubmit = type
|
||||||
addOrEditForm.typeId = addOrEditForm.typeIds[addOrEditForm.typeIds.length - 1]
|
addOrEditForm.value.typeId =
|
||||||
|
addOrEditForm.value.typeIds[addOrEditForm.value.typeIds.length - 1]
|
||||||
const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi
|
const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi
|
||||||
const res: any = await SUBMIT_API(addOrEditForm)
|
const res: any = await SUBMIT_API(addOrEditForm.value)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '提交成功',
|
message: '提交成功',
|
||||||
})
|
})
|
||||||
addOrEditFormRef.value.resetFields()
|
|
||||||
addOrEditDialogVisible.value = false
|
addOrEditDialogVisible.value = false
|
||||||
getLeaseListData()
|
getLeaseListData()
|
||||||
}
|
}
|
||||||
|
|
@ -521,11 +553,24 @@ const onSubmit = (type: boolean) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 自定义事件
|
||||||
|
const onFileChange = (fileList: any) => {
|
||||||
|
addOrEditForm.value.fileInfoList = fileList.map((e: any) => {
|
||||||
|
return {
|
||||||
|
fileName: e.name,
|
||||||
|
fileUrl: e.url,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
addOrEditFormRef.value.resetFields()
|
|
||||||
addOrEditDialogVisible.value = false
|
addOrEditDialogVisible.value = false
|
||||||
}
|
}
|
||||||
|
const onClose = () => {
|
||||||
|
addOrEditFormRef.value.resetFields()
|
||||||
|
addOrEditForm.value = JSON.parse(JSON.stringify(addOrEditFormTemp.value))
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getClassAndCompanyData()
|
getClassAndCompanyData()
|
||||||
|
|
@ -548,4 +593,20 @@ onMounted(() => {
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
width: 95%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.img-list {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.img-items {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
margin-right: 8px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue