generated from Leo_Ding/web-template
11
This commit is contained in:
parent
29ec1c8c4b
commit
d0f4b84c51
16
src/apis/modules/raffleProduct.js
Normal file
16
src/apis/modules/raffleProduct.js
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 区域模块接口
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获取项目列表
|
||||
export const getProjectList = (params) => request.basic.get('/api/v1/raffle-products', params)
|
||||
// 获取单挑数据
|
||||
export const getItem = (id) => request.basic.get(`/api/v1/raffle-products/${id}`)
|
||||
// 添加条目
|
||||
export const createProject = (params) => request.basic.post('/api/v1/raffle-products', params)
|
||||
// 更新role
|
||||
export const updateItem = (id, params) => request.basic.put(`/api/v1/raffle-products/${id}`, params)
|
||||
// 删除数据
|
||||
export const delItem = (id) => request.basic.delete(`/api/v1/raffle-products/${id}`)
|
||||
//获取抽奖记录
|
||||
export const getRaffleOrders = (params) => request.basic.get('/api/v1/raffle-orders', params)
|
||||
@ -80,6 +80,6 @@ export default {
|
||||
houseProduct:'案场礼品',
|
||||
prizeDraw:'抽奖模块',
|
||||
lotteryRules:'抽奖规则',
|
||||
lotteryProduct:'抽奖产品',
|
||||
lotteryProduct:'奖品列表',
|
||||
lotteryOrders:'抽奖记录',
|
||||
}
|
||||
|
||||
@ -1,612 +0,0 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="800" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-spin :spinning="spining">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="基本信息">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘名称'" name="name">
|
||||
<a-input :placeholder="'请输入楼盘名称'" v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘地址'" name="address">
|
||||
<a-input :placeholder="'请输入楼盘地址'" v-model:value="formData.address"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'主力户型'" name="masterType">
|
||||
<a-input :placeholder="'请输入主力户型'" v-model:value="formData.masterType"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'开盘时间'" name="openAt">
|
||||
<a-input :placeholder="'请输入开盘时间'" v-model:value="formData.openAt"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘均价'" name="price">
|
||||
<a-input :placeholder="'请输入均价'" v-model:value="formData.price"
|
||||
style="width:100%"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘类型'" name="type">
|
||||
<a-input :placeholder="'请输入楼盘类型'" v-model:value="formData.type"
|
||||
style="width:100%"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'待售状态'" name="daiShowStatus">
|
||||
<a-input :placeholder="'请输入待售状态'" v-model:value="formData.daiShowStatus"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'所属区域'" name="areaId">
|
||||
<a-select ref="select" v-model:value="formData.areaId">
|
||||
<a-select-option v-for="item in areaEnum.getAll()" :value="item.value">{{
|
||||
item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘特点'" name="title">
|
||||
<a-input :placeholder="'请输入楼盘特点'" v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘经度'" name="longitude">
|
||||
<a-input-number :placeholder="'请输入经度'" style="width: 100%;" :precision="2"
|
||||
v-model:value="formData.longitude"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘纬度'" name="latitude">
|
||||
<a-input-number :placeholder="'请输入纬度'" style="width: 100%;" :precision="2"
|
||||
v-model:value="formData.latitude"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'展厅地址'" name="showAddress">
|
||||
<a-input :placeholder="'请输入展厅地址'"
|
||||
v-model:value="formData.showAddress"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'楼盘标签'" name="labels">
|
||||
<div
|
||||
style="display: flex;justify-content: space-around;gap:5px 20px;flex-wrap: wrap;">
|
||||
<div v-for="(item, index) in formData.labels" :key="index"
|
||||
style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;flex: 1; min-width: calc(50% - 10px);">
|
||||
<a-input :placeholder="'请输入标签'" :value="item"
|
||||
@change="(e) => updateLabel(index, e.target.value)">
|
||||
</a-input>
|
||||
<div
|
||||
style="width: 50px;display: flex;justify-content: flex-end;align-items: center;">
|
||||
<a-button v-if="index === formData.labels.length - 1" type="primary"
|
||||
:icon="h(PlusOutlined)" @click="addLabel" />
|
||||
<a-button v-else danger :icon="h(MinusOutlined)"
|
||||
@click="removeLabel(index)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘图片'">
|
||||
<gx-upload v-model="formData.imgList" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="20" @uploadSuccess="uploadSuccess" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘视频'">
|
||||
<gx-upload v-model="formData.videos" accept-types=".avi,.mp4,.mov,.wmv,.mkv,.m4v"
|
||||
:fileNumber="20" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="户型信息">
|
||||
<div style="width: 100%;margin-bottom: 10px; display: flex;justify-content: flex-end;">
|
||||
<a-button type="primary" @click="addLayout">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
户型
|
||||
</a-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-around;gap:20px;flex-wrap: wrap;">
|
||||
<a-card hoverable style="flex: 1; min-width: calc(30% - 10px);"
|
||||
v-for="(child, index) of formData.layOuts" :key="index">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'标题'" name="title">
|
||||
<a-input :placeholder="'请输入标题'" v-model:value="child.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'单价'">
|
||||
<a-input :placeholder="'请输入单价'" v-model:value="child.price"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'朝向'" name="direction">
|
||||
<a-input :placeholder="'请输入朝向'" v-model:value="child.direction"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'面积'" name="area">
|
||||
<a-input :placeholder="'请输入建筑面积'" v-model:value="child.area"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'">
|
||||
<gx-upload v-model="child.layImgList" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="1" @uploadSuccess="uploadSuccess" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template #actions>
|
||||
<a-button type="text" @click="delLayOut(index)">删 除</a-button>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="楼盘周边">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'公交'" name="busNum">
|
||||
<a-input-number :placeholder="'请输入公交个数'" v-model:value="formData.busNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'医院'" name="hospitalNum">
|
||||
<a-input-number :placeholder="'请输入医院个数'" v-model:value="formData.hospitalNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'生活'" name="lifeNum">
|
||||
<a-input-number :placeholder="'请输入公交个数'" v-model:value="formData.lifeNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'地铁'" name="metroNum">
|
||||
<a-input-number :placeholder="'请输入地铁个数'" v-model:value="formData.metroNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'学校'" name="schoolNum">
|
||||
<a-input-number :placeholder="'请输入学校个数'" v-model:value="formData.schoolNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="4" tab="楼盘顾问">
|
||||
<div style="width: 100%;margin-bottom: 10px; display: flex;justify-content: flex-end;">
|
||||
<a-button type="primary" @click="addAdviser">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
顾问
|
||||
</a-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-around;gap:20px;flex-wrap: wrap;">
|
||||
<a-card hoverable style="flex: 1; min-width: calc(30% - 10px);"
|
||||
v-for="(child, index) of formData.advisers" :key="index">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'姓名'" name="adviserName">
|
||||
<a-input :placeholder="'请输入顾问姓名'"
|
||||
v-model:value="child.adviserName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'手机号'">
|
||||
<a-input :placeholder="'请输入手机号'"
|
||||
v-model:value="child.adviserPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'头像'">
|
||||
<gx-upload v-model="child.adviserImg" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template #actions>
|
||||
<a-button type="text" @click="delLayOut(index)">删 除</a-button>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="5" tab="销售信息">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘状态'" name="louPanStatus">
|
||||
<a-input :placeholder="'请输入楼盘状态'"
|
||||
v-model:value="formData.louPanStatus"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'产权年限'" name="duration">
|
||||
<a-input :placeholder="'请输入产权年限'" v-model:value="formData.duration"
|
||||
style="width: 100%;"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'在售户型'" name="salesType">
|
||||
<a-input :placeholder="'请输入在售户型'" v-model:value="formData.salesType"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'售楼地址'" name="salesAddress">
|
||||
<a-input :placeholder="'请输入售楼地址'"
|
||||
v-model:value="formData.salesAddress"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'售楼电话'" name="salesPhone">
|
||||
<a-input :placeholder="'请输入售楼电话'" v-model:value="formData.salesPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="6" tab="小区概况">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'车位数量'" name="packingNum">
|
||||
<a-input :placeholder="'请输入车位数量'" v-model:value="formData.packingNum"
|
||||
style="width: 100%;"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'总户数'" name="roomNum">
|
||||
<a-input :placeholder="'请输入总户数'" v-model:value="formData.roomNum"
|
||||
style="width: 100%;"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'绿化率'" name="greeningRate">
|
||||
<a-input :placeholder="'请输入绿化率'"
|
||||
v-model:value="formData.greeningRate"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'车位比'" name="carRatio">
|
||||
<a-input :placeholder="'请输入车位比'"
|
||||
v-model:value="formData.carRatio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'容积率'" name="ratio">
|
||||
<a-input :placeholder="'请输入容积率'"
|
||||
v-model:value="formData.ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'R19009容积率'" name="r19009Ratio">
|
||||
<a-input :placeholder="'请输入R19009容积率'"
|
||||
v-model:value="formData.r19009Ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'R19010容积率'" name="r19009Ratio">
|
||||
<a-input :placeholder="'请输入R19010容积率'"
|
||||
v-model:value="formData.r19010Ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'R19011容积率'" name="r19011Ratio">
|
||||
<a-input :placeholder="'请输入R19011容积率'"
|
||||
v-model:value="formData.r19011Ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'物业类型'" name="propertyType">
|
||||
<a-input :placeholder="'请输入物业类型'"
|
||||
v-model:value="formData.propertyType"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'物业公司'" name="propertyName">
|
||||
<a-input :placeholder="'请输入物业公司'"
|
||||
v-model:value="formData.propertyName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'物业费用'" name="propertyPrice">
|
||||
<a-input :placeholder="'请输入物业费用'"
|
||||
v-model:value="formData.propertyPrice"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
</a-card>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, h, onBeforeMount } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal, useSpining } from '@/hooks'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { PlusOutlined, MinusOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
||||
import dayjs from 'dayjs'
|
||||
import { customersEnum, areaEnum } from "@/enums/useEnum"
|
||||
import {spliceUrl} from "@/utils/util.js"
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const { spining, showSpining, hideSpining } = useSpining()
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
const layImgList = []
|
||||
const activeKey = ref('1')
|
||||
formRules.value = {
|
||||
name: { required: true, message: '请输入楼盘名称' },
|
||||
address: { required: true, message: '请输入楼盘地址' },
|
||||
masterType: { required: true, message: '请输入主力户型' },
|
||||
openAt: { required: true, message: '请输入开盘时间' },
|
||||
price: { required: true, message: '请输入楼盘均价' },
|
||||
status: [{ required: true, message: '请输入状态' }],
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新增楼盘',
|
||||
})
|
||||
// initData()
|
||||
formData.value.labels = ['', '']
|
||||
formData.value.areaId = 1
|
||||
formData.value.layOuts = [
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
]
|
||||
formData.value.advisers = [
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑楼盘',
|
||||
})
|
||||
try {
|
||||
showSpining()
|
||||
const { data, success } = await apis.house.getItem(record.id).catch()
|
||||
if (!success) {
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
hideSpining()
|
||||
formData.value = {
|
||||
id:data.id,
|
||||
address: data.address,
|
||||
areaId: data.areaId,//所属区域
|
||||
imgList: data.images?data.images.map(item => config('http.apiBasic') + item):[],
|
||||
labels: data.labels,
|
||||
latitude: data.latitude,
|
||||
longitude: data.longitude,
|
||||
masterType: data.masterType,
|
||||
name: data.name,
|
||||
openAt: data.openAt,
|
||||
price: data.price,
|
||||
status: data.status,
|
||||
|
||||
title: data.title,
|
||||
videos: data.videos? data.videos.map(item => config('http.apiBasic') + item):[],
|
||||
advisers: data.advisers?data.advisers.map(item=>({adviserName:item.name,adviserPhone:item.phone,adviserImg:item.avatar?[config('http.apiBasic')+item.avatar]:[]})):[{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },],
|
||||
address: data.detail.basicInfo.address,
|
||||
houseArea: data.detail.basicInfo.area,
|
||||
buildingarea: data.detail.basicInfo.buildingarea,
|
||||
showAddress: data.detail.basicInfo.showAddress,
|
||||
daiShowStatus:data.detail.basicInfo.status,
|
||||
type: data.detail.basicInfo.type,
|
||||
louPanStatus: data.detail.salesInfo.status,
|
||||
duration: data.detail.salesInfo.duration,
|
||||
salesType: data.detail.salesInfo.salesType,
|
||||
salesPhone: data.detail.salesInfo.salesPhone,
|
||||
salesAddress:data.detail.salesInfo.salesAddress,
|
||||
greeningRate: data.detail.communityInfo.greeningRate,
|
||||
packingNum: data.detail.communityInfo.packingNum,
|
||||
propertyName: data.detail.communityInfo.propertyName,
|
||||
propertyPrice: data.detail.communityInfo.propertyPrice,
|
||||
propertyType: data.detail.communityInfo.propertyType,
|
||||
r19009Ratio: data.detail.communityInfo.r19009Ratio,
|
||||
r19010Ratio: data.detail.communityInfo.r19010Ratio,
|
||||
r19011Ratio: data.detail.communityInfo.r19011Ratio,
|
||||
roomNum: data.detail.communityInfo.roomNum,
|
||||
carRatio:data.detail.communityInfo.carRatio,
|
||||
ratio:data.detail.communityInfo.ratio,
|
||||
layOuts: data.layOuts ? data.layOuts.map(item => ({ area: item.area, direction: item.direction, layImgList: item.img?[config('http.apiBasic') + item.img]:[], price: item.price, title: item.title })):[{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },],
|
||||
busNum: data.surroundings&&data.surroundings.busNum,
|
||||
hospitalNum: data.surroundings&&data.surroundings.hospitalNum,
|
||||
lifeNum: data.surroundings&&data.surroundings.lifeNum,
|
||||
metroNum: data.surroundings&&data.surroundings.metroNum,
|
||||
schoolNum: data.surroundings&&data.surroundings.schoolNum,
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
hideSpining()
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
function handleOk() {
|
||||
formRef.value.validateFields().then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
console.log(formData.value)
|
||||
const params = {
|
||||
address: formData.value.address,
|
||||
areaId: formData.value.areaId,//所属区域
|
||||
cover: formData.value.imgList && spliceUrl(formData.value.imgList[0]),
|
||||
images: formData.value.imgList && formData.value.imgList.map(item=>spliceUrl(item)),
|
||||
labels: formData.value.labels,
|
||||
latitude: formData.value.latitude,
|
||||
longitude: formData.value.longitude,
|
||||
masterType: formData.value.masterType,
|
||||
name: formData.value.name,
|
||||
openAt: formData.value.openAt,
|
||||
price: formData.value.price,
|
||||
status: formData.value.status,
|
||||
title: formData.value.title,
|
||||
videos: formData.value.videos&&formData.value.videos.map(item=>spliceUrl(item)),
|
||||
advisers: formData.value.advisers&&formData.value.advisers.map(item=>({name:item.adviserName,phone:item.adviserPhone,avatar:item.adviserImg[0]&&spliceUrl(item.adviserImg[0])})),
|
||||
detail: {
|
||||
basicInfo: {
|
||||
address: formData.value.address,//楼盘地址
|
||||
area: formData.value.houseArea,//占地面积
|
||||
buildingarea: formData.value.buildingarea,//建筑面积
|
||||
masterType: formData.value.masterType,//主力户型
|
||||
status: formData.value.daiShowStatus,//待售状态
|
||||
showAddress: formData.value.showAddress,//展厅位置
|
||||
type: formData.value.type,//楼盘类型
|
||||
},
|
||||
salesInfo: {
|
||||
status: formData.value.louPanStatus,//楼盘状态
|
||||
duration: formData.value.duration,//产权年限
|
||||
salesType: formData.value.salesType,//在售户型
|
||||
salesAddress: formData.value.salesAddress,//售楼地址
|
||||
salesPhone: formData.value.salesPhone//售楼电话
|
||||
},
|
||||
communityInfo: {
|
||||
greeningRate: formData.value.greeningRate,
|
||||
packingNum: formData.value.packingNum,
|
||||
propertyName: formData.value.propertyName,
|
||||
propertyPrice: formData.value.propertyPrice,
|
||||
propertyType: formData.value.propertyType,
|
||||
r19009Ratio: formData.value.r19009Ratio,
|
||||
r19010Ratio: formData.value.r19010Ratio,
|
||||
r19011Ratio: formData.value.r19011Ratio,
|
||||
roomNum: formData.value.roomNum,
|
||||
carRatio:formData.value.carRatio,
|
||||
ratio:formData.value.ratio
|
||||
}
|
||||
},
|
||||
layOuts: formData.value.layOuts && formData.value.layOuts.map(item => ({ area: item.area, direction: item.direction, img: item.layImgList[0]&&spliceUrl(item.layImgList[0]), price: item.price, title: item.title })),
|
||||
surroundings: {
|
||||
busNum: formData.value.busNum,
|
||||
hospitalNum: formData.value.hospitalNum,
|
||||
lifeNum: formData.value.lifeNum,
|
||||
metroNum: formData.value.metroNum,
|
||||
schoolNum: formData.value.schoolNum,
|
||||
}
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.house.createProject(params).catch((error) => {
|
||||
console.log(error.message)
|
||||
throw new Error(error)
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
|
||||
result = await apis.house.updateItem(formData.value.id, params).catch(() => {
|
||||
console.log(error.message)
|
||||
throw new Error(error)
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (config('http.code.success') === result?.success) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
// 在 setup 中添加这些方法
|
||||
const updateLabel = (index, value) => {
|
||||
formData.value.labels[index] = value;
|
||||
};
|
||||
|
||||
const addLabel = () => {
|
||||
formData.value.labels.push('');
|
||||
};
|
||||
|
||||
const removeLabel = (index) => {
|
||||
formData.value.labels.splice(index, 1);
|
||||
};
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
function handleCancel() {
|
||||
|
||||
hideModal()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭后
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleCreate,
|
||||
handleEdit,
|
||||
})
|
||||
//新增户型
|
||||
const addLayout = () => {
|
||||
const params = { layImgList: [], area: '', price: '', direction: '', title: '' }
|
||||
formData.value.layOuts.push(params)
|
||||
}
|
||||
//新增顾问
|
||||
const addAdviser=()=>{
|
||||
const params={ adviserName: '', adviserPhone: '', adviserImg: [] }
|
||||
formData.value.advisers.push(params)
|
||||
}
|
||||
//删除户型
|
||||
const delLayOut = (index) => {
|
||||
formData.value.layOuts.splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@ -33,32 +33,11 @@
|
||||
<a-row :gutter="8" :wrap="false">
|
||||
<a-col flex="auto">
|
||||
<a-card type="flex">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新增楼盘
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
|
||||
<template v-if="column.dataIndex === 'price'">
|
||||
<span>{{ record.price+'(元/平)' }}</span>
|
||||
</template>
|
||||
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
||||
<edit-outlined /> </a-tooltip></x-action-button>
|
||||
|
||||
<x-action-button @click="handleDelete(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||
<template v-if="column.dataIndex === 'createdAt'">
|
||||
<span>{{ dayjs(record.createdAt).format('YYYY-MM-DD HH:mm') }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -66,7 +45,6 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -75,22 +53,20 @@ import { ref } from 'vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import dayjs from 'dayjs'
|
||||
defineOptions({
|
||||
name: 'lotteryOrders',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '楼盘名称', dataIndex: 'name' },
|
||||
{ title: '主力户型', dataIndex: 'masterType', width: 120, align: 'center' },
|
||||
{ title: '开盘时间', dataIndex: 'openAt', width: 100, align: 'center' },
|
||||
{ title: '楼盘地址', dataIndex: 'address', align: 'center',ellipsis: true, },
|
||||
{ title: '楼盘均价', dataIndex: 'price', align: 'center', width: 110 },
|
||||
// { title: '待售状态', dataIndex: 'status', key: 'introduce', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
{ title: '奖品名称', dataIndex: 'productName' },
|
||||
{ title: '所属规则', dataIndex: 'raffleName', align: 'center' },
|
||||
{ title: '中奖人', dataIndex: 'customerName', align: 'center' },
|
||||
{ title: '客户手机号', dataIndex: 'customerPhone', align: 'center' },
|
||||
{ title: '中奖时间', dataIndex: 'createdAt', width: 180, align: 'center' },
|
||||
|
||||
]
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
||||
const editDialogRef = ref()
|
||||
@ -103,8 +79,8 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.house
|
||||
.getProjectList({
|
||||
const { success, data, total } = await apis.raffleProduct
|
||||
.getRaffleOrders({
|
||||
pageSize,
|
||||
page: current,
|
||||
...searchFormData.value,
|
||||
|
||||
@ -4,338 +4,46 @@
|
||||
<a-spin :spinning="spining">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="基本信息">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘名称'" name="name">
|
||||
<a-input :placeholder="'请输入楼盘名称'" v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘地址'" name="address">
|
||||
<a-input :placeholder="'请输入楼盘地址'" v-model:value="formData.address"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'主力户型'" name="masterType">
|
||||
<a-input :placeholder="'请输入主力户型'" v-model:value="formData.masterType"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'开盘时间'" name="openAt">
|
||||
<a-input :placeholder="'请输入开盘时间'" v-model:value="formData.openAt"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘均价'" name="price">
|
||||
<a-input :placeholder="'请输入均价'" v-model:value="formData.price"
|
||||
style="width:100%"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘类型'" name="type">
|
||||
<a-input :placeholder="'请输入楼盘类型'" v-model:value="formData.type"
|
||||
style="width:100%"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'待售状态'" name="daiShowStatus">
|
||||
<a-input :placeholder="'请输入待售状态'" v-model:value="formData.daiShowStatus"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'所属区域'" name="areaId">
|
||||
<a-select ref="select" v-model:value="formData.areaId">
|
||||
<a-select-option v-for="item in areaEnum.getAll()" :value="item.value">{{
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'所属规则'" name="raffleId">
|
||||
<a-select ref="select" v-model:value="formData.raffleId">
|
||||
<a-select-option v-for="item in listData" :value="item.id">{{
|
||||
item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘特点'" name="title">
|
||||
<a-input :placeholder="'请输入楼盘特点'" v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘经度'" name="longitude">
|
||||
<a-input-number :placeholder="'请输入经度'" style="width: 100%;" :precision="2"
|
||||
v-model:value="formData.longitude"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘纬度'" name="latitude">
|
||||
<a-input-number :placeholder="'请输入纬度'" style="width: 100%;" :precision="2"
|
||||
v-model:value="formData.latitude"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'展厅地址'" name="showAddress">
|
||||
<a-input :placeholder="'请输入展厅地址'"
|
||||
v-model:value="formData.showAddress"></a-input>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'奖品名称'" name="name">
|
||||
<a-input :placeholder="'请输入奖品名称'" v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'楼盘标签'" name="labels">
|
||||
<div
|
||||
style="display: flex;justify-content: space-around;gap:5px 20px;flex-wrap: wrap;">
|
||||
<div v-for="(item, index) in formData.labels" :key="index"
|
||||
style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;flex: 1; min-width: calc(50% - 10px);">
|
||||
<a-input :placeholder="'请输入标签'" :value="item"
|
||||
@change="(e) => updateLabel(index, e.target.value)">
|
||||
</a-input>
|
||||
<div
|
||||
style="width: 50px;display: flex;justify-content: flex-end;align-items: center;">
|
||||
<a-button v-if="index === formData.labels.length - 1" type="primary"
|
||||
:icon="h(PlusOutlined)" @click="addLabel" />
|
||||
<a-button v-else danger :icon="h(MinusOutlined)"
|
||||
@click="removeLabel(index)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-form-item :label="'最大中奖数'" name="maxNum">
|
||||
<a-input-number :placeholder="'请输入最大中奖数'"
|
||||
v-model:value="formData.maxNum" style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘图片'">
|
||||
<gx-upload v-model="formData.imgList" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="20" @uploadSuccess="uploadSuccess" />
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'中奖率'" name="probability">
|
||||
<a-input-number :placeholder="'请输入中奖率'" v-model:value="formData.probability"
|
||||
addon-after="%" style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘视频'">
|
||||
<gx-upload v-model="formData.videos" accept-types=".avi,.mp4,.mov,.wmv,.mkv,.m4v"
|
||||
:fileNumber="20" />
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'状态'" name="status">
|
||||
<a-radio-group v-model:value="formData.status" :options="[
|
||||
{ label: '启用', value: 'enabled' },
|
||||
{ label: '停用', value: 'disabled' },
|
||||
]"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'奖品图片'">
|
||||
<gx-upload v-model="formData.imgList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="户型信息">
|
||||
<div style="width: 100%;margin-bottom: 10px; display: flex;justify-content: flex-end;">
|
||||
<a-button type="primary" @click="addLayout">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
户型
|
||||
</a-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-around;gap:20px;flex-wrap: wrap;">
|
||||
<a-card hoverable style="flex: 1; min-width: calc(30% - 10px);"
|
||||
v-for="(child, index) of formData.layOuts" :key="index">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'标题'" name="title">
|
||||
<a-input :placeholder="'请输入标题'" v-model:value="child.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'单价'">
|
||||
<a-input :placeholder="'请输入单价'" v-model:value="child.price"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'朝向'" name="direction">
|
||||
<a-input :placeholder="'请输入朝向'" v-model:value="child.direction"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'面积'" name="area">
|
||||
<a-input :placeholder="'请输入建筑面积'" v-model:value="child.area"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'">
|
||||
<gx-upload v-model="child.layImgList" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="1" @uploadSuccess="uploadSuccess" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template #actions>
|
||||
<a-button type="text" @click="delLayOut(index)">删 除</a-button>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="楼盘周边">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'公交'" name="busNum">
|
||||
<a-input-number :placeholder="'请输入公交个数'" v-model:value="formData.busNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'医院'" name="hospitalNum">
|
||||
<a-input-number :placeholder="'请输入医院个数'" v-model:value="formData.hospitalNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'生活'" name="lifeNum">
|
||||
<a-input-number :placeholder="'请输入公交个数'" v-model:value="formData.lifeNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'地铁'" name="metroNum">
|
||||
<a-input-number :placeholder="'请输入地铁个数'" v-model:value="formData.metroNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'学校'" name="schoolNum">
|
||||
<a-input-number :placeholder="'请输入学校个数'" v-model:value="formData.schoolNum"
|
||||
style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="4" tab="楼盘顾问">
|
||||
<div style="width: 100%;margin-bottom: 10px; display: flex;justify-content: flex-end;">
|
||||
<a-button type="primary" @click="addAdviser">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
顾问
|
||||
</a-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-around;gap:20px;flex-wrap: wrap;">
|
||||
<a-card hoverable style="flex: 1; min-width: calc(30% - 10px);"
|
||||
v-for="(child, index) of formData.advisers" :key="index">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'姓名'" name="adviserName">
|
||||
<a-input :placeholder="'请输入顾问姓名'"
|
||||
v-model:value="child.adviserName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'手机号'">
|
||||
<a-input :placeholder="'请输入手机号'"
|
||||
v-model:value="child.adviserPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'头像'">
|
||||
<gx-upload v-model="child.adviserImg" accept-types=".jpg,.png,.webp"
|
||||
:fileNumber="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template #actions>
|
||||
<a-button type="text" @click="delLayOut(index)">删 除</a-button>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="5" tab="销售信息">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'楼盘状态'" name="louPanStatus">
|
||||
<a-input :placeholder="'请输入楼盘状态'"
|
||||
v-model:value="formData.louPanStatus"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'产权年限'" name="duration">
|
||||
<a-input :placeholder="'请输入产权年限'" v-model:value="formData.duration"
|
||||
style="width: 100%;"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'在售户型'" name="salesType">
|
||||
<a-input :placeholder="'请输入在售户型'" v-model:value="formData.salesType"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'售楼地址'" name="salesAddress">
|
||||
<a-input :placeholder="'请输入售楼地址'"
|
||||
v-model:value="formData.salesAddress"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'售楼电话'" name="salesPhone">
|
||||
<a-input :placeholder="'请输入售楼电话'" v-model:value="formData.salesPhone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="6" tab="小区概况">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'车位数量'" name="packingNum">
|
||||
<a-input :placeholder="'请输入车位数量'" v-model:value="formData.packingNum"
|
||||
style="width: 100%;"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'总户数'" name="roomNum">
|
||||
<a-input :placeholder="'请输入总户数'" v-model:value="formData.roomNum"
|
||||
style="width: 100%;"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'绿化率'" name="greeningRate">
|
||||
<a-input :placeholder="'请输入绿化率'"
|
||||
v-model:value="formData.greeningRate"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'车位比'" name="carRatio">
|
||||
<a-input :placeholder="'请输入车位比'"
|
||||
v-model:value="formData.carRatio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'容积率'" name="ratio">
|
||||
<a-input :placeholder="'请输入容积率'"
|
||||
v-model:value="formData.ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'R19009容积率'" name="r19009Ratio">
|
||||
<a-input :placeholder="'请输入R19009容积率'"
|
||||
v-model:value="formData.r19009Ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'R19010容积率'" name="r19009Ratio">
|
||||
<a-input :placeholder="'请输入R19010容积率'"
|
||||
v-model:value="formData.r19010Ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'R19011容积率'" name="r19011Ratio">
|
||||
<a-input :placeholder="'请输入R19011容积率'"
|
||||
v-model:value="formData.r19011Ratio"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'物业类型'" name="propertyType">
|
||||
<a-input :placeholder="'请输入物业类型'"
|
||||
v-model:value="formData.propertyType"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'物业公司'" name="propertyName">
|
||||
<a-input :placeholder="'请输入物业公司'"
|
||||
v-model:value="formData.propertyName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item :label="'物业费用'" name="propertyPrice">
|
||||
<a-input :placeholder="'请输入物业费用'"
|
||||
v-model:value="formData.propertyPrice"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
</a-card>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
@ -349,10 +57,7 @@ import apis from '@/apis'
|
||||
import { useForm, useModal, useSpining } from '@/hooks'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { PlusOutlined, MinusOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
||||
import dayjs from 'dayjs'
|
||||
import { customersEnum, areaEnum } from "@/enums/useEnum"
|
||||
import {spliceUrl} from "@/utils/util.js"
|
||||
import { spliceUrl } from "@/utils/util.js"
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
@ -360,38 +65,37 @@ const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const { spining, showSpining, hideSpining } = useSpining()
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
const layImgList = []
|
||||
const activeKey = ref('1')
|
||||
const listData = ref([])
|
||||
formRules.value = {
|
||||
name: { required: true, message: '请输入楼盘名称' },
|
||||
address: { required: true, message: '请输入楼盘地址' },
|
||||
masterType: { required: true, message: '请输入主力户型' },
|
||||
openAt: { required: true, message: '请输入开盘时间' },
|
||||
price: { required: true, message: '请输入楼盘均价' },
|
||||
status: [{ required: true, message: '请输入状态' }],
|
||||
raffleId: { required: true, message: '请选择规则' },
|
||||
name: { required: true, message: '请输入奖品名称' },
|
||||
maxNum: { required: true, message: '请输入最大中奖数' },
|
||||
probability: { required: true, message: '请中奖率', trigger: 'change' },
|
||||
status: [{ required: true, message: '请输入状态', trigger: 'change' }],
|
||||
}
|
||||
const getData = async () => {
|
||||
const { success, data, total } = await apis.raffles
|
||||
.getProjectList({
|
||||
pageSize: 99,
|
||||
page: 1,
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
listData.value = data.map(item => ({ id: item.id, name: item.title }))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
getData()
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新增楼盘',
|
||||
title: '新增奖品',
|
||||
})
|
||||
// initData()
|
||||
formData.value.labels = ['', '']
|
||||
formData.value.areaId = 1
|
||||
formData.value.layOuts = [
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
]
|
||||
formData.value.advisers = [
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
]
|
||||
formData.value.status = 'enabled'
|
||||
}
|
||||
|
||||
/**
|
||||
@ -400,65 +104,21 @@ function handleCreate() {
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑楼盘',
|
||||
title: '编辑奖品',
|
||||
})
|
||||
try {
|
||||
showSpining()
|
||||
const { data, success } = await apis.house.getItem(record.id).catch()
|
||||
getData()
|
||||
const { data, success } = await apis.raffleProduct.getItem(record.id).catch()
|
||||
if (!success) {
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
hideSpining()
|
||||
formData.value = {
|
||||
id:data.id,
|
||||
address: data.address,
|
||||
areaId: data.areaId,//所属区域
|
||||
imgList: data.images?data.images.map(item => config('http.apiBasic') + item):[],
|
||||
labels: data.labels,
|
||||
latitude: data.latitude,
|
||||
longitude: data.longitude,
|
||||
masterType: data.masterType,
|
||||
name: data.name,
|
||||
openAt: data.openAt,
|
||||
price: data.price,
|
||||
status: data.status,
|
||||
|
||||
title: data.title,
|
||||
videos: data.videos? data.videos.map(item => config('http.apiBasic') + item):[],
|
||||
advisers: data.advisers?data.advisers.map(item=>({adviserName:item.name,adviserPhone:item.phone,adviserImg:item.avatar?[config('http.apiBasic')+item.avatar]:[]})):[{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },
|
||||
{ adviserName: '', adviserPhone: '', adviserImg: [] },],
|
||||
address: data.detail.basicInfo.address,
|
||||
houseArea: data.detail.basicInfo.area,
|
||||
buildingarea: data.detail.basicInfo.buildingarea,
|
||||
showAddress: data.detail.basicInfo.showAddress,
|
||||
daiShowStatus:data.detail.basicInfo.status,
|
||||
type: data.detail.basicInfo.type,
|
||||
louPanStatus: data.detail.salesInfo.status,
|
||||
duration: data.detail.salesInfo.duration,
|
||||
salesType: data.detail.salesInfo.salesType,
|
||||
salesPhone: data.detail.salesInfo.salesPhone,
|
||||
salesAddress:data.detail.salesInfo.salesAddress,
|
||||
greeningRate: data.detail.communityInfo.greeningRate,
|
||||
packingNum: data.detail.communityInfo.packingNum,
|
||||
propertyName: data.detail.communityInfo.propertyName,
|
||||
propertyPrice: data.detail.communityInfo.propertyPrice,
|
||||
propertyType: data.detail.communityInfo.propertyType,
|
||||
r19009Ratio: data.detail.communityInfo.r19009Ratio,
|
||||
r19010Ratio: data.detail.communityInfo.r19010Ratio,
|
||||
r19011Ratio: data.detail.communityInfo.r19011Ratio,
|
||||
roomNum: data.detail.communityInfo.roomNum,
|
||||
carRatio:data.detail.communityInfo.carRatio,
|
||||
ratio:data.detail.communityInfo.ratio,
|
||||
layOuts: data.layOuts ? data.layOuts.map(item => ({ area: item.area, direction: item.direction, layImgList: item.img?[config('http.apiBasic') + item.img]:[], price: item.price, title: item.title })):[{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },
|
||||
{ area: '', price: '', direction: '', title: '', layImgList: [] },],
|
||||
busNum: data.surroundings&&data.surroundings.busNum,
|
||||
hospitalNum: data.surroundings&&data.surroundings.hospitalNum,
|
||||
lifeNum: data.surroundings&&data.surroundings.lifeNum,
|
||||
metroNum: data.surroundings&&data.surroundings.metroNum,
|
||||
schoolNum: data.surroundings&&data.surroundings.schoolNum,
|
||||
...data,
|
||||
probability:data.probability*100,
|
||||
imgList:data.img?[config('http.apiBasic')+data.img]:[]
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
@ -473,74 +133,22 @@ function handleOk() {
|
||||
formRef.value.validateFields().then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
console.log(formData.value)
|
||||
const params = {
|
||||
address: formData.value.address,
|
||||
areaId: formData.value.areaId,//所属区域
|
||||
cover: formData.value.imgList && spliceUrl(formData.value.imgList[0]),
|
||||
images: formData.value.imgList && formData.value.imgList.map(item=>spliceUrl(item)),
|
||||
labels: formData.value.labels,
|
||||
latitude: formData.value.latitude,
|
||||
longitude: formData.value.longitude,
|
||||
masterType: formData.value.masterType,
|
||||
name: formData.value.name,
|
||||
openAt: formData.value.openAt,
|
||||
price: formData.value.price,
|
||||
status: formData.value.status,
|
||||
title: formData.value.title,
|
||||
videos: formData.value.videos&&formData.value.videos.map(item=>spliceUrl(item)),
|
||||
advisers: formData.value.advisers&&formData.value.advisers.map(item=>({name:item.adviserName,phone:item.adviserPhone,avatar:item.adviserImg[0]&&spliceUrl(item.adviserImg[0])})),
|
||||
detail: {
|
||||
basicInfo: {
|
||||
address: formData.value.address,//楼盘地址
|
||||
area: formData.value.houseArea,//占地面积
|
||||
buildingarea: formData.value.buildingarea,//建筑面积
|
||||
masterType: formData.value.masterType,//主力户型
|
||||
status: formData.value.daiShowStatus,//待售状态
|
||||
showAddress: formData.value.showAddress,//展厅位置
|
||||
type: formData.value.type,//楼盘类型
|
||||
},
|
||||
salesInfo: {
|
||||
status: formData.value.louPanStatus,//楼盘状态
|
||||
duration: formData.value.duration,//产权年限
|
||||
salesType: formData.value.salesType,//在售户型
|
||||
salesAddress: formData.value.salesAddress,//售楼地址
|
||||
salesPhone: formData.value.salesPhone//售楼电话
|
||||
},
|
||||
communityInfo: {
|
||||
greeningRate: formData.value.greeningRate,
|
||||
packingNum: formData.value.packingNum,
|
||||
propertyName: formData.value.propertyName,
|
||||
propertyPrice: formData.value.propertyPrice,
|
||||
propertyType: formData.value.propertyType,
|
||||
r19009Ratio: formData.value.r19009Ratio,
|
||||
r19010Ratio: formData.value.r19010Ratio,
|
||||
r19011Ratio: formData.value.r19011Ratio,
|
||||
roomNum: formData.value.roomNum,
|
||||
carRatio:formData.value.carRatio,
|
||||
ratio:formData.value.ratio
|
||||
}
|
||||
},
|
||||
layOuts: formData.value.layOuts && formData.value.layOuts.map(item => ({ area: item.area, direction: item.direction, img: item.layImgList[0]&&spliceUrl(item.layImgList[0]), price: item.price, title: item.title })),
|
||||
surroundings: {
|
||||
busNum: formData.value.busNum,
|
||||
hospitalNum: formData.value.hospitalNum,
|
||||
lifeNum: formData.value.lifeNum,
|
||||
metroNum: formData.value.metroNum,
|
||||
schoolNum: formData.value.schoolNum,
|
||||
}
|
||||
...values,
|
||||
probability:formData.value.probability/100,
|
||||
img:formData.value.imgList && spliceUrl(formData.value.imgList[0]),
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.house.createProject(params).catch((error) => {
|
||||
result = await apis.raffleProduct.createProject(params).catch((error) => {
|
||||
console.log(error.message)
|
||||
throw new Error(error)
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
|
||||
result = await apis.house.updateItem(formData.value.id, params).catch(() => {
|
||||
result = await apis.raffleProduct.updateItem(formData.value.id, params).catch(() => {
|
||||
console.log(error.message)
|
||||
throw new Error(error)
|
||||
})
|
||||
@ -593,20 +201,7 @@ defineExpose({
|
||||
handleCreate,
|
||||
handleEdit,
|
||||
})
|
||||
//新增户型
|
||||
const addLayout = () => {
|
||||
const params = { layImgList: [], area: '', price: '', direction: '', title: '' }
|
||||
formData.value.layOuts.push(params)
|
||||
}
|
||||
//新增顾问
|
||||
const addAdviser=()=>{
|
||||
const params={ adviserName: '', adviserPhone: '', adviserImg: [] }
|
||||
formData.value.advisers.push(params)
|
||||
}
|
||||
//删除户型
|
||||
const delLayOut = (index) => {
|
||||
formData.value.layOuts.splice(index, 1)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@ -38,17 +38,20 @@
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新增楼盘
|
||||
新增奖品
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
|
||||
<template v-if="column.dataIndex === 'price'">
|
||||
<span>{{ record.price+'(元/平)' }}</span>
|
||||
<template v-if="column.dataIndex === 'img'">
|
||||
<a-image :width="60" :src="config('http.apiBasic') + record.img || $imageErr.imgErr" />
|
||||
</template>
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
@ -84,12 +87,13 @@ defineOptions({
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '楼盘名称', dataIndex: 'name' },
|
||||
{ title: '主力户型', dataIndex: 'masterType', width: 120, align: 'center' },
|
||||
{ title: '开盘时间', dataIndex: 'openAt', width: 100, align: 'center' },
|
||||
{ title: '楼盘地址', dataIndex: 'address', align: 'center',ellipsis: true, },
|
||||
{ title: '楼盘均价', dataIndex: 'price', align: 'center', width: 110 },
|
||||
// { title: '待售状态', dataIndex: 'status', key: 'introduce', width: 100, align: 'center' },
|
||||
{ title: '奖品图片', dataIndex: 'img', width: 120 , align: 'center'},
|
||||
{ title: '奖品名称', dataIndex: 'name' },
|
||||
{ title: '抽中限制', dataIndex: 'maxNum', width: 120, align: 'center' },
|
||||
{ title: '中奖率', dataIndex: 'probability', width: 100, align: 'center' },
|
||||
{ title: '已抽中数', dataIndex: 'realNum', align: 'center', ellipsis: true, },
|
||||
{ title: '所属规则', dataIndex: 'raffleName', align: 'center', width: 110 },
|
||||
{ title: '奖品状态', dataIndex: 'status', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
|
||||
@ -103,7 +107,7 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.house
|
||||
const { success, data, total } = await apis.raffleProduct
|
||||
.getProjectList({
|
||||
pageSize,
|
||||
page: current,
|
||||
@ -134,7 +138,7 @@ function handleDelete({ id }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.house.delItem(id).catch(() => {
|
||||
const { success } = await apis.raffleProduct.delItem(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
|
||||
@ -70,42 +70,48 @@
|
||||
v-for="(child, index) of formData.roles" :key="index">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'每周几'" name="weekday">
|
||||
<a-select ref="select" v-model:value="formData.weekday">
|
||||
<a-select ref="select" v-model:value="child.weekday">
|
||||
<a-select-option v-for="item in weekDays" :value="item.value">{{
|
||||
item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'开始时间'" name="startH">
|
||||
<a-select ref="select" v-model:value="formData.startH">
|
||||
<a-select-option v-for="item in hoursArray" :value="item">{{
|
||||
item }}</a-select-option>
|
||||
<div style="display: flex;justify-content: space-around;">
|
||||
<a-select ref="select" v-model:value="child.startH">
|
||||
<a-select-option v-for="item in hoursArray" :value="item.value">{{
|
||||
item.name }}</a-select-option>
|
||||
|
||||
</a-select>
|
||||
<a-select ref="select" v-model:value="formData.startM">
|
||||
<a-select-option v-for="item in minutesArray" :value="item">{{
|
||||
item }}</a-select-option>
|
||||
|
||||
<a-select ref="select" v-model:value="child.startM">
|
||||
<a-select-option v-for="item in minutesArray" :value="item.value">{{
|
||||
item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'结束时间'" name="endTime">
|
||||
<a-select ref="select" v-model:value="formData.endH">
|
||||
<a-select-option v-for="item in hoursArray" :value="item">{{
|
||||
item }}</a-select-option>
|
||||
<div style="display: flex;justify-content: space-around;">
|
||||
<a-select ref="select" v-model:value="child.endH">
|
||||
<a-select-option v-for="item in hoursArray" :value="item.value">{{
|
||||
item.name }}</a-select-option>
|
||||
|
||||
</a-select>
|
||||
<a-select ref="select" v-model:value="formData.endM">
|
||||
<a-select-option v-for="item in minutesArray" :value="item">{{
|
||||
item }}</a-select-option>
|
||||
<a-select ref="select" v-model:value="child.endM">
|
||||
<a-select-option v-for="item in minutesArray" :value="item.value">{{
|
||||
item.name }}</a-select-option>
|
||||
|
||||
</a-select>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'是否激活'" name="isActive">
|
||||
<a-radio-group v-model:value="formData.isActive" :options="[
|
||||
<a-radio-group v-model:value="child.isActive" :options="[
|
||||
{ label: '激活', value: true },
|
||||
{ label: '停用', value: false },
|
||||
]"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template #actions>
|
||||
<a-button type="text" @click="delLayOut(index)">删 除</a-button>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
@ -137,11 +143,11 @@ const okText = ref(t('button.confirm'))
|
||||
const layImgList = []
|
||||
const hoursArray = Array.from({ length: 24 }, (_, i) => ({
|
||||
value: i,
|
||||
name: i === 0 ? "24:00" : `${i}:00`
|
||||
name: i === 0 ? "24点" : `${i}点`
|
||||
}));
|
||||
const minutesArray = Array.from({ length: 60 }, (_, i) => ({
|
||||
value: i,
|
||||
name: `${i.toString().padStart(2, '0')}:00`
|
||||
name: `${i.toString().padStart(2, '0')}分`
|
||||
}));
|
||||
const activeKey = ref('1')
|
||||
const weekDays = ref([
|
||||
@ -168,11 +174,11 @@ formRules.value = {
|
||||
function handleCreate() {
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新增抽奖',
|
||||
title: '新增规则',
|
||||
})
|
||||
formData.value.areaId = 1
|
||||
formData.value.status='enabled'
|
||||
formData.value.roles = [{ weekday:1, isActive: true, startH:0, startM:0,endH:0, endM:0 }]
|
||||
formData.value.roles = [{ weekday:1, isActive: true, startH:1, startM:0,endH:0, endM:0 }]
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,7 +187,7 @@ function handleCreate() {
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑抽奖',
|
||||
title: '编辑规则',
|
||||
})
|
||||
try {
|
||||
showSpining()
|
||||
@ -192,7 +198,10 @@ async function handleEdit(record = {}) {
|
||||
}
|
||||
hideSpining()
|
||||
formData.value = {
|
||||
...data
|
||||
...data,
|
||||
startAt:dayjs(data.startAt),
|
||||
endAt:dayjs(data.endAt)
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
message.error({ content: error.message })
|
||||
@ -208,7 +217,8 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values
|
||||
...values,
|
||||
roles:formData.value.roles
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
@ -275,7 +285,7 @@ defineExpose({
|
||||
})
|
||||
//新增户型
|
||||
const addLayout = () => {
|
||||
const params = { weekday: '', isActive: true, startTime: '', endTime: '' }
|
||||
const params = { weekday:1, isActive: true, startH:1, startM:0,endH:0, endM:0 }
|
||||
formData.value.roles.push(params)
|
||||
}
|
||||
//新增顾问
|
||||
@ -285,7 +295,7 @@ const addAdviser = () => {
|
||||
}
|
||||
//删除户型
|
||||
const delLayOut = (index) => {
|
||||
formData.value.layOuts.splice(index, 1)
|
||||
formData.value.roles.splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新增楼盘
|
||||
新增规则
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
@ -95,7 +95,7 @@ defineOptions({
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '所属区域', dataIndex: 'areaId' },
|
||||
{ title: '规则名称', dataIndex: 'title', width: 120, align: 'center' },
|
||||
{ title: '规则名称', dataIndex: 'title'},
|
||||
{ title: '开始时间', dataIndex: 'startAt', width: 180, align: 'center' },
|
||||
{ title: '结束时间', dataIndex: 'endAt', width: 180, align: 'center' },
|
||||
{ title: '消耗积分', dataIndex: 'price', align: 'center', width: 110 },
|
||||
@ -114,7 +114,7 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.house
|
||||
const { success, data, total } = await apis.raffles
|
||||
.getProjectList({
|
||||
pageSize,
|
||||
page: current,
|
||||
@ -145,7 +145,7 @@ function handleDelete({ id }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.house.delItem(id).catch(() => {
|
||||
const { success } = await apis.raffles.delItem(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user