代码完善

This commit is contained in:
BianLzhaoMin 2024-11-28 19:07:24 +08:00
parent 2d18d62583
commit 45a2f0424a
11 changed files with 345 additions and 131 deletions

4
components.d.ts vendored
View File

@ -20,11 +20,9 @@ declare module 'vue' {
ElCountdown: typeof import('element-plus/es')['ElCountdown']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
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']
@ -40,8 +38,6 @@ declare module 'vue' {
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

@ -1,9 +1,6 @@
<template>
<div class="equipCard" @click="cardClick">
<img
src="https://fc1tn.baidu.com/it/u=4185529537,1682541874&fm=202&src=766&fc=tdmatt&mola=new&crop=v1"
alt=""
/>
<img :src="url" alt="" />
<div class="title">{{ name }}</div>
@ -88,7 +85,7 @@ const onHandelLessee = () => {
const onAddCart = async () => {
const addParams = {
maId: props.id,
orderCompany: props.companyId
orderCompany: props.companyId,
}
const res = await addBookCarApi(addParams)
if (res.code === 200) {
@ -105,7 +102,6 @@ const onAddCart = async () => {
})
}
}
</script>
<style lang="scss" scoped>
.equipCard {

View File

@ -13,7 +13,7 @@
:multiple="props.multiple"
:limit="props.maxLimit"
:on-exceed="handleExceed"
:file-list="props.fileList"
:file-list="fileListNew"
:disabled="props.disabledFlag"
:on-change="changeFileFn"
:on-remove="(file:any, fileList:any) => removeFile(file, fileList)"
@ -42,9 +42,19 @@ const headerInfo = reactive({
Authorization: store.token,
})
const fileListNew: any = ref([])
const emit = defineEmits(['onFileChange'])
// console.log('tmpUploadUrl', tmpUploadUrl)
// const actionUrl = ref(tmpUploadUrl)
const props = defineProps({
fileListN: {
type: Array,
default: () => {
return []
},
},
actionUrl: {
//
type: String,
@ -161,11 +171,20 @@ let loadProcess = ref(0) //进度条的刻度值
const successUpload = (response: any, file: any) => {
console.log('successUpload', response, file)
if (response.code === 200) {
props.fileList.push({
url: response.data,
name: file.name,
})
props.successResultCallBack(response)
// props.fileList.push({
// url: response.data,
// name: file.name,
// })
// 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 {
ElMessage({
type: 'warning',
@ -209,8 +228,8 @@ const handleExceed = (files: any, fileList: any) => {
}
//
const removeFile = (file: any, data: any) => {
console.log(file, data)
// props.fileList = data
fileListNew.value = fileListNew.value.filter((e: any) => e.uid != file.uid)
emit('onFileChange', fileListNew.value)
}
//
const preview = (data: any) => {

View File

@ -11,8 +11,8 @@ export const getDeviceListApi = (data: any) => {
}
//获取装备详情
export const getDetail = (id = '') => {
return get(`/material-mall/dev/getInfo/${id}`)
export const getDetail = (id = '', isHome: any) => {
return get(`/material-mall/dev/getInfo/${id}?isHome=${isHome}`)
}
//加入预约车
export const addBookCarApi = (data: object) => {

View File

@ -258,8 +258,8 @@ const onLeaseDateChange = (e: any, item: any) => {
//
const onDeleteGoods = async (id: number | string) => {
const res: any = deleteCartByIdApi({ id })
if (res.code === 200) {
const res: any = await deleteCartByIdApi({ id })
if (res.code == 200) {
ElMessage({
showClose: false,
message: '删除成功',

View File

@ -38,7 +38,11 @@
<div class="label">参考图片/样式</div>
</el-col>
<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-row>
</div>
@ -527,4 +531,23 @@ onMounted(() => {
color: #dd2323;
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>

View File

@ -365,11 +365,11 @@ import {
addBookCarApi,
apiSubmitLease,
apiGetAddressList,
} from '@/http/api/equip'
} from 'http/api/equip'
import { useRoute, useRouter } from 'vue-router'
// import Navmenu from '@/components/Navmenu/index.vue'
import equipDetailTable from '@/components/equipDetailTable.vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainStore } from '@/store/main'
const router = useRouter()
@ -775,7 +775,7 @@ const handelDetailListClick = (fnName, arg) => {
//
const getData = async () => {
const res = await getDetail(pageParams.id)
const res = await getDetail(pageParams.id, true)
res.data.isOperatorCn = res.data.isOperator ? '是' : '否'
res.data.isInsurancePdf = res.data.insurancePdf ? '点击查看' : '暂无'
res.data.isExaminationPdf = res.data.examinationPdf ? '点击查看' : '暂无'
@ -871,20 +871,29 @@ const onAddCart = async () => {
maId: pageData.value.maId,
orderCompany: pageData.value.companyId,
}
const res = await addBookCarApi(addParams)
if (res.code === 200) {
ElMessage({
type: 'success',
duration: 1000,
message: `预约车加入成功`,
ElMessageBox.confirm('是否确定加入预约车?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
})
.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 {
ElMessage({
type: 'error',
duration: 1000,
message: res.msg,
})
}
.catch(() => {})
}
</script>
<style scoped lang="scss">

View File

@ -5,21 +5,34 @@
<div class="screen">
<div class="choose">
<template v-for="(v, i) in screenChooseList" :key="i">
<div class="line">
<div class="line" v-if="v.isShow">
<div class="label">
{{ v.name }}
</div>
<div class="select">
<div
class="item"
:class="{
active: val.isChecked,
}"
@click="selectScreen(v.type, val, i)"
v-for="(val, index) in v.list"
:key="index"
>
{{ val.name }}
<template v-for="(val, index) in v.list" :key="index">
<div
class="item"
@click="selectScreen(v.type, val, i)"
:class="{
active: val.isChecked,
}"
>
{{ 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>
@ -152,15 +165,51 @@ import {
import { getCompanyListApi } from '@/http/api/home'
import $bus from '@/utils/bus'
import NavMenu from '@/components/Navmenu/index.vue'
import { ElMessage } from 'element-plus'
const router = useRouter()
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([
{
name: '使用年限:',
type: 'userYear',
isShow: true,
list: [
{
isChecked: true,
@ -203,6 +252,7 @@ const screenChooseList: any = reactive([
{
type: 'deviceClass',
name: '装备分类:',
isShow: true,
list: [
{
name: '全部',
@ -215,54 +265,63 @@ const screenChooseList: any = reactive([
{
type: 'leasePrice',
name: '租金(天/元)',
isShow: true,
list: [
{
name: '全部',
value: '',
isChecked: true,
index: 2,
isShow: true,
},
{
name: '0-500',
value: [0, 500],
isChecked: false,
index: 2,
isShow: true,
},
{
name: '500-1000',
value: [500, 1000],
isChecked: false,
index: 2,
isShow: true,
},
{
name: '1000-1500',
value: [1000, 1500],
isChecked: false,
index: 2,
isShow: true,
},
{
name: '1500-2000',
value: [1500, 2000],
isChecked: false,
index: 2,
isShow: true,
},
{
name: '2000-2500',
value: [2000, 2500],
isChecked: false,
index: 2,
isShow: true,
},
{
name: '2500-3000',
value: [2500, 3000],
isChecked: false,
index: 2,
isShow: true,
},
],
},
{
type: 'companyId',
name: '设备所在地:',
isShow: true,
list: [
{
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
const screenTags = computed(() => {
const selectTagList: any = []
screenChooseList.forEach((e: any) => {
e.list.forEach((j: any) => {
if (j.isChecked && j.name !== '全部') {
console.log(j, '******')
selectTagList.push(j)
}
})
@ -328,7 +408,6 @@ const getTypeListData = async () => {
})
screenChooseList[1].list.push(...typeList)
}
getTypeListData()
//
const getCompanyAddressListData = async () => {
@ -338,7 +417,6 @@ const getCompanyAddressListData = async () => {
})
screenChooseList[3].list.push(...addressList)
}
getCompanyAddressListData()
//
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) {
searchParams.typeId = j.value
searchParams.level = j.value ? 1 : ''
}
if (index === 2 && j.isChecked && j.value.length > 0) {
searchParams.dayLeasePriceMin = j.value[0]
@ -373,7 +452,6 @@ const getDeviceListData = async (params: any = null, keyWord: any = null) => {
}
if (index === 3 && j.isChecked) {
searchParams.companyId = j.value
searchParams.level = j.value ? 1 : ''
}
})
})
@ -393,11 +471,20 @@ const getDeviceListData = async (params: any = null, keyWord: any = null) => {
//
const onClearTags = () => {
screenChooseList.forEach((e: any) => {
screenChooseList.forEach((e: any, i: any) => {
e.list.forEach((j: any, index: number) => {
j.isChecked = false
if (index === 0) {
j.isChecked = true
if (i != 4) {
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) => {
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()
}
@ -458,7 +555,30 @@ onMounted(() => {
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(() => {

View File

@ -45,20 +45,22 @@ const getCompanyListData = async () => {
getCompanyListData()
//
const onSharedHall = (level: number, typeId: any) => {
const onSharedHall = (level: number, typeId: any, name: any) => {
router.push({
name: 'equipList',
query: {
level,
typeId,
name,
},
})
}
const onSharedHallByCompany = (companyId: any) => {
const onSharedHallByCompany = (companyId: any, name: any) => {
router.push({
name: 'equipList',
query: {
companyId,
name,
},
})
}
@ -103,8 +105,7 @@ const hotDeviceList: any = ref([])
/* 获取热搜装备 */
const getHotDeviceList = async () => {
const res: any = await getHotList({ pageSize: 3 })
hotDeviceList.value = res.rows
console.log(res, '热搜装备111')
hotDeviceList.value = res.data
}
getHotDeviceList()
@ -149,14 +150,14 @@ const onSelectItem = (type: number) => {
<template v-if="selectOptionsValue === '分类筛选'">
<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 }}
<ul class="sub-goods">
<!-- 级联框内 类别名称 -->
<li
v-for="child in item.children"
:key="child.id"
@click="onSharedHall(2, child.id)"
@click.stop="onSharedHall(2, child.id, child.name)"
>
<!-- 第二级 -->
<span class="second-name">
@ -168,7 +169,7 @@ const onSelectItem = (type: number) => {
v-for="son in child.children"
:key="son.id"
style="font-size: 14px; font-weight: normal"
@click="onSharedHall(3, son.id)"
@click.stop="onSharedHall(3, son.id, son.name)"
>
{{ son.name }}
</a>
@ -230,7 +231,10 @@ const onSelectItem = (type: number) => {
:key="item.companyId"
class="item-container"
>
<li class="item-nav" @click="onSharedHallByCompany(item.companyId)">
<li
class="item-nav"
@click="onSharedHallByCompany(item.companyId, item.companyName)"
>
{{ item.companyName }}
</li>
</div>
@ -265,32 +269,38 @@ const onSelectItem = (type: number) => {
<a>查看更多</a>
</div>
<ul class="equip-pic">
<li v-for="item in hotDeviceList" :key="item.maId" style="cursor: pointer">
<!-- <EquipCardNew
<div v-for="item in hotDeviceList" :key="item.typeName" style="margin-top: 15px">
<div class="hot-title">
{{ item.typeName }}
</div>
<ul class="equip-pic">
<li v-for="g in item.devInfoList" :key="g.maId" style="cursor: pointer">
<!-- <EquipCardNew
@onClick="onClick"
:company="item.companyName || '安徽博诺斯有限公司'"
:price="item.dayLeasePrice"
:tags="[item.maStatusStr || '待租', item.cityStr || '合肥']"
:name="item.modelName + item.deviceName"
:url="item.picUrl"
:id="item.maId"
/> -->
<EquipCardNew
@onClick="onClick"
:id="item.maId"
:companyId="item.companyId"
:company="item.companyName"
:name="item.deviceName"
:price="item.dayLeasePrice"
/>
</li>
</ul>
<EquipCardNew
@onClick="onClick"
:id="g.maId"
:companyId="g.companyId"
:company="g.companyName"
:name="g.deviceName"
:price="g.dayLeasePrice"
:url="g.picUrl"
/>
</li>
</ul>
</div>
</div>
<!-- 专题咨询 -->
<div class="hot-equip">
<!-- <div class="hot-equip">
<span>专题资讯</span>
<a></a>
</div>
@ -308,13 +318,13 @@ const onSelectItem = (type: number) => {
<li>
<a>保险</a>
</li>
</ul>
</ul> -->
<div class="consult-content">
<!-- 左侧背景图片 -->
<!-- <div class="consult-content">
<div class="left-bg"></div>
<!-- 右侧信息 -->
<div class="right-consult">
<div
class="consult-box"
@ -332,7 +342,7 @@ const onSelectItem = (type: number) => {
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
</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 {
display: flex;
flex-wrap: wrap;

View File

@ -279,7 +279,7 @@ const optionActive = ref(0)
//
const pageData = reactive({
pageNum: 1,
pageSize: 20,
pageSize: 10,
})
//
@ -318,12 +318,10 @@ const getLeaseListData = async () => {
companyId: '',
typeId: '',
level: '',
startTime: '',
leaseDay: '',
endTime: '',
leaseNum: '',
pageNum: 1,
pageSize: 1,
startTime: optionActive.value == 0 ? screenOptionList[optionActive.value].sort : '',
rentDay: optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '',
endTime: optionActive.value == 2 ? screenOptionList[optionActive.value].sort : '',
rentNum: optionActive.value == 3 ? screenOptionList[optionActive.value].sort : '',
}
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)
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
}
@ -394,6 +365,7 @@ const handleClose = (tag: any) => {
tag.isChecked = false
screenChooseList[tag.index].list[0].isChecked = true
// getDeviceListData()
getLeaseListData()
}
//
@ -405,6 +377,7 @@ const changeOption = (val: any) => {
console.log(screenOptionList, 'screenOptionList')
optionActive.value = val.id
// getDeviceListData()
getLeaseListData()
}
// select
@ -421,6 +394,7 @@ const selectScreen = (type: any, item: any, index: number) => {
const onCurrentChange = (val: number) => {
pageData.pageNum = val
// getDeviceListData()
getLeaseListData()
}
onMounted(() => {

View File

@ -78,6 +78,7 @@
() => {
addOrEditDialogVisible = true
isRepublish = true
dialogTitle = '新增'
}
"
style="background-color: #17907f; color: #fff"
@ -130,6 +131,7 @@
icon-color="#626AEF"
title="确定删除该项需求吗?"
@confirm="onDelete(row.id)"
v-if="row.leaseStatus != 1"
>
<template #reference>
<el-button size="small" text type="danger"> 删除 </el-button>
@ -169,11 +171,12 @@
<!-- 新增修改对话框 -->
<el-dialog
title="新增"
:title="dialogTitle"
width="60%"
align-center
destroy-on-close
v-model="addOrEditDialogVisible"
@close="onClose"
>
<el-form
label-width="auto"
@ -292,6 +295,15 @@
<el-row :gutter="20">
<el-col :span="24">
<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
:maxSize="2"
:maxLimit="4"
@ -299,10 +311,11 @@
height="120px"
:autoUpload="true"
:multiple="true"
:fileListN="addOrEditForm.fileInfoList"
listType="picture-card"
:acceptTypeList="['.jpg', '.png']"
:actionUrl="uploadUrl"
:successResultCallBack="successResultCallBackFnDevicePic"
@onFileChange="onFileChange"
>
<template v-slot:default>
<el-icon size="48" color="#aaa"><Plus /></el-icon>
@ -359,6 +372,7 @@ const isSave = ref(false)
const total = ref(0)
const endTime = ref([])
const releaseTime = ref([])
const dialogTitle = ref('新增')
const searchParams = reactive({
leaseName: '',
leaseCode: '',
@ -370,7 +384,21 @@ const searchParams = reactive({
pageSize: 10,
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: '',
typeId: '',
typeIds: [],
@ -463,6 +491,7 @@ const onDelete = async (id: any) => {
}
//
const onRepublish = async (id: any, type: any) => {
dialogTitle.value = '编辑'
isRepublish.value = false
isSave.value = type
const res: any = await getLeaseDetailsByIdApi({ id })
@ -477,9 +506,10 @@ const onRepublish = async (id: any, type: any) => {
endTime,
description,
typeIds,
fileInfoList,
} = res.data
Object.assign(addOrEditForm, {
Object.assign(addOrEditForm.value, {
leaseName,
typeId,
companyId,
@ -491,9 +521,10 @@ const onRepublish = async (id: any, type: any) => {
description,
typeIds,
id,
fileInfoList,
})
addOrEditForm.typeIds = addOrEditForm.typeIds.map((e: any) => {
addOrEditForm.value.typeIds = addOrEditForm.value.typeIds.map((e: any) => {
return (e *= 1)
})
@ -504,16 +535,17 @@ const onRepublish = async (id: any, type: any) => {
const onSubmit = (type: boolean) => {
addOrEditFormRef.value.validate(async (valid: any) => {
if (valid) {
addOrEditForm.isSubmit = type
addOrEditForm.typeId = addOrEditForm.typeIds[addOrEditForm.typeIds.length - 1]
addOrEditForm.value.isSubmit = type
addOrEditForm.value.typeId =
addOrEditForm.value.typeIds[addOrEditForm.value.typeIds.length - 1]
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) {
ElMessage({
type: 'success',
message: '提交成功',
})
addOrEditFormRef.value.resetFields()
addOrEditDialogVisible.value = false
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 = () => {
addOrEditFormRef.value.resetFields()
addOrEditDialogVisible.value = false
}
const onClose = () => {
addOrEditFormRef.value.resetFields()
addOrEditForm.value = JSON.parse(JSON.stringify(addOrEditFormTemp.value))
}
onMounted(() => {
getClassAndCompanyData()
@ -548,4 +593,20 @@ onMounted(() => {
margin-right: 6px;
width: 95%;
}
.img-list {
display: flex;
align-items: center;
.img-items {
width: 120px;
height: 120px;
margin-right: 8px;
img {
width: 100%;
height: 100%;
}
}
}
</style>