main
parent
4f8d3c1bd0
commit
e5073badd3
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="title">企业审核</div>
|
||||
<el-form
|
||||
ref="searchFormRef"
|
||||
class="form"
|
||||
:inline="true"
|
||||
label-width="98px"
|
||||
:model="queryParams"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="store_name">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
style="width: 220px"
|
||||
v-model="queryParams.store_name"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label-width="100px">
|
||||
<el-button icon="Search" type="primary" @click="handleQuery"> 搜索 </el-button>
|
||||
<el-button icon="RefreshRight" @click="resetQuery"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="margin-bottom: 20px">
|
||||
<!-- <el-button icon="Plus" type="primary" @click="add"> 新建 </el-button> -->
|
||||
</div>
|
||||
<div ref="tableContainerEl" class="table_border table">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
header-row-class-name="table-header"
|
||||
>
|
||||
<el-table-column align="center" label="企业名称" prop="company_name" />
|
||||
<el-table-column align="center" label="姓名" prop="contact_person" />
|
||||
<el-table-column align="center" label="手机号码" prop="contact_phone" />
|
||||
<el-table-column align="center" label="邮箱" prop="contact_email" />
|
||||
<el-table-column align="center" label="地址" prop="address" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
width="180"
|
||||
label="更新日期"
|
||||
prop="updated_at"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ row.updated_at ? dayjs(row.updated_at * 1000).format('YYYY-MM-DD HH:mm:ss') : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="150">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button link type="primary" @click="goDetail(row)"> 查看 </el-button> -->
|
||||
<el-button link type="primary" @click="review(row.id, 2)"> 通过 </el-button>
|
||||
<el-button link type="danger" @click="review(row.id, 3)"> 驳回 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:limit="queryParams.limit"
|
||||
v-model:page="queryParams.page"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<HandleDialog
|
||||
v-if="isShowDialog"
|
||||
:type="rowType"
|
||||
:row="currentRow"
|
||||
:categoryList="categoryList"
|
||||
@closed="isShowDialog = false"
|
||||
@on-success="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useTableRPC } from '@/utils/hook'
|
||||
import dayjs from 'dayjs'
|
||||
import RPC from '@/utils/rpc'
|
||||
import HandleDialog from './HandleDialog.vue'
|
||||
|
||||
const rowType = ref('')
|
||||
const currentRow = ref(null)
|
||||
const add = () => {
|
||||
isShowDialog.value = true
|
||||
currentRow.value = null
|
||||
rowType.value = 'add'
|
||||
}
|
||||
const goDetail = (row) => {
|
||||
isShowDialog.value = true
|
||||
rowType.value = 'edit'
|
||||
currentRow.value = row
|
||||
}
|
||||
|
||||
const review = (id, status) => {
|
||||
if (status === 2) {
|
||||
ElMessageBox.confirm('确认通过?', '通过', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
RPC.post('/enterprise/review', { id, status }).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
ElMessageBox.prompt('请输入驳回原因', '驳回', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
inputErrorMessage: '请输入驳回原因',
|
||||
inputValidator: (value) => {
|
||||
return value.trim() !== ''
|
||||
},
|
||||
})
|
||||
.then(({ value }) => {
|
||||
RPC.post('/enterprise/review', { id, status, note: value }).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
loading,
|
||||
tableData,
|
||||
tableRef,
|
||||
searchFormRef,
|
||||
total,
|
||||
queryParams,
|
||||
getList,
|
||||
handleQuery,
|
||||
resetQuery,
|
||||
handleDelete,
|
||||
isShowDialog,
|
||||
maxHeight,
|
||||
tableContainerEl,
|
||||
} = useTableRPC({
|
||||
queryParams: {},
|
||||
remoteDataFn: '/enterprise/pending',
|
||||
// deleteConfig: {
|
||||
// remote: '/store/pending_list',
|
||||
// key: 'id',
|
||||
// message(row) {
|
||||
// return `确认删除 “${row.underpainting_name}”`
|
||||
// },
|
||||
// },
|
||||
})
|
||||
|
||||
getList()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,124 @@
|
||||
<script setup>
|
||||
import RPC from '@/utils/rpc'
|
||||
import MapSelector from '@/components/MapSelector.vue'
|
||||
import UploadFile from '@/components/UploadFile.vue'
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
row: [Object],
|
||||
categoryList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['closed', 'onSuccess'])
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const isAdd = computed(() => props.type === 'add')
|
||||
|
||||
onMounted(() => {
|
||||
dialogVisible.value = true
|
||||
})
|
||||
|
||||
const formRef = ref(null)
|
||||
const formField = ref({})
|
||||
const formRules = reactive({
|
||||
company_name: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
contact_person: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
contact_phone: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
contact_email: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
address: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const showMapSelector = ref(false)
|
||||
|
||||
function closed() {
|
||||
emit('closed')
|
||||
}
|
||||
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate()
|
||||
const api = isAdd.value ? '/enterprise/apply' : '/enterprise/update'
|
||||
const params = {
|
||||
...formField.value,
|
||||
id: isAdd.value ? null : props.row.id,
|
||||
}
|
||||
RPC.post(api, params)
|
||||
.then((res) => {
|
||||
ElMessage.success('操作成功')
|
||||
emit('onSuccess')
|
||||
emit('closed')
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
if (!isAdd.value) {
|
||||
formField.value = props.row
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
align-center
|
||||
:title="isAdd ? '新增' : '修改'"
|
||||
width="80%"
|
||||
v-model="dialogVisible"
|
||||
@closed="closed"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
:model="formField"
|
||||
:rules="formRules"
|
||||
v-loading="loading"
|
||||
label-width="100"
|
||||
>
|
||||
<el-form-item prop="company_name" label="企业名称">
|
||||
<el-input placeholder="请输入" v-model="formField.company_name" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="contact_person" label="姓名">
|
||||
<el-input placeholder="请输入" v-model="formField.contact_person" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="contact_phone" label="手机号码">
|
||||
<el-input placeholder="请输入" v-model="formField.contact_phone" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="contact_email" label="邮箱">
|
||||
<el-input placeholder="请输入" v-model="formField.contact_email" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="address" label="地址">
|
||||
<el-input placeholder="请输入" v-model="formField.address" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closed"> 取 消 </el-button>
|
||||
<el-button type="primary" :loading="loading" @click="submitForm"> 确 定 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 地图坐标选择器 -->
|
||||
<MapSelector
|
||||
v-model="showMapSelector"
|
||||
:longitude="formField.longitude"
|
||||
:latitude="formField.latitude"
|
||||
@confirm="handleCoordinateConfirm"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main_image_box {
|
||||
width: 370px;
|
||||
height: 130px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="title">企业管理</div>
|
||||
<el-form
|
||||
ref="searchFormRef"
|
||||
class="form"
|
||||
:inline="true"
|
||||
label-width="98px"
|
||||
:model="queryParams"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="company_name">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
style="width: 220px"
|
||||
v-model="queryParams.company_name"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label-width="100px">
|
||||
<el-button icon="Search" type="primary" @click="handleQuery"> 搜索 </el-button>
|
||||
<el-button icon="RefreshRight" @click="resetQuery"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="margin-bottom: 20px">
|
||||
<!-- <el-button icon="Plus" type="primary" @click="add"> 新建 </el-button> -->
|
||||
</div>
|
||||
<div ref="tableContainerEl" class="table_border table">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
header-row-class-name="table-header"
|
||||
>
|
||||
<el-table-column align="center" label="企业名称" prop="company_name" />
|
||||
<el-table-column align="center" label="姓名" prop="contact_person" />
|
||||
<el-table-column align="center" label="手机号码" prop="contact_phone" />
|
||||
<el-table-column align="center" label="邮箱" prop="contact_email" />
|
||||
<el-table-column align="center" label="地址" prop="address" />
|
||||
<el-table-column align="center" label="状态" prop="status" width="70">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status == 1">待审核</span>
|
||||
<span v-if="row.status == 2">通过</span>
|
||||
<span v-if="row.status == 3">驳回</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="更新日期" prop="updated_at">
|
||||
<template #default="{ row }">
|
||||
<span>{{
|
||||
row.updated_at && dayjs(row.updated_at * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="驳回原因" prop="review_note" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="edit(row)"> 修改 </el-button>
|
||||
|
||||
<el-button link type="danger" @click="handleDelete(row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:limit="queryParams.limit"
|
||||
v-model:page="queryParams.page"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<HandleDialog
|
||||
v-if="isShowDialog"
|
||||
:type="rowType"
|
||||
:row="currentRow"
|
||||
@closed="isShowDialog = false"
|
||||
@on-success="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useTableRPC } from '@/utils/hook'
|
||||
import HandleDialog from './HandleDialog.vue'
|
||||
import dayjs from 'dayjs'
|
||||
import RPC from '@/utils/rpc'
|
||||
|
||||
const rowType = ref('')
|
||||
const currentRow = ref(null)
|
||||
const add = () => {
|
||||
isShowDialog.value = true
|
||||
currentRow.value = null
|
||||
rowType.value = 'add'
|
||||
}
|
||||
const edit = (row) => {
|
||||
isShowDialog.value = true
|
||||
rowType.value = 'edit'
|
||||
currentRow.value = row
|
||||
}
|
||||
|
||||
const {
|
||||
loading,
|
||||
tableData,
|
||||
tableRef,
|
||||
searchFormRef,
|
||||
total,
|
||||
queryParams,
|
||||
getList,
|
||||
handleQuery,
|
||||
resetQuery,
|
||||
handleDelete,
|
||||
isShowDialog,
|
||||
maxHeight,
|
||||
tableContainerEl,
|
||||
} = useTableRPC({
|
||||
queryParams: {},
|
||||
remoteDataFn: '/enterprise/list',
|
||||
// deleteConfig: {
|
||||
// remote: '/underpainting/delete',
|
||||
// key: 'id',
|
||||
// message(row) {
|
||||
// return `确认删除 “${row.underpainting_name}”`
|
||||
// },
|
||||
// },
|
||||
})
|
||||
|
||||
getList()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,163 @@
|
||||
<script setup>
|
||||
import RPC from '@/utils/rpc'
|
||||
import MapSelector from '@/components/MapSelector.vue'
|
||||
import UploadFile from '@/components/UploadFile.vue'
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
row: [Object],
|
||||
categoryList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['closed', 'onSuccess'])
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const isAdd = computed(() => props.type === 'add')
|
||||
|
||||
onMounted(() => {
|
||||
dialogVisible.value = true
|
||||
})
|
||||
|
||||
const formRef = ref(null)
|
||||
const formField = ref({})
|
||||
const formRules = reactive({
|
||||
store_name: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
latitude: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
longitude: [{ required: true, message: '不可为空', trigger: 'change' }],
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const showMapSelector = ref(false)
|
||||
|
||||
function closed() {
|
||||
emit('closed')
|
||||
}
|
||||
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate()
|
||||
const params = { store: { ...formField.value }, category_ids: formField.value.category_ids }
|
||||
RPC.post('/store/create', params)
|
||||
}
|
||||
|
||||
if (!isAdd.value) {
|
||||
formField.value = props.row
|
||||
}
|
||||
|
||||
const chooseCoordinates = () => {
|
||||
showMapSelector.value = true
|
||||
}
|
||||
|
||||
RPC.post('/store/detail', { id: props.row.id })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
align-center
|
||||
:title="isAdd ? '新增' : '修改'"
|
||||
width="80%"
|
||||
v-model="dialogVisible"
|
||||
@closed="closed"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
:model="formField"
|
||||
:rules="formRules"
|
||||
v-loading="loading"
|
||||
label-width="100"
|
||||
>
|
||||
<el-form-item prop="store_name" label="门店名称">
|
||||
<el-input placeholder="请输入" v-model="formField.store_name" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="address" label="详细地址">
|
||||
<el-input placeholder="请输入" v-model="formField.address" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="location" label="地址">
|
||||
<el-input placeholder="请输入" v-model="formField.location" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="business_hours" label="工作时间">
|
||||
<el-input placeholder="请输入" v-model="formField.business_hours" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="contact_phone" label="联系电话">
|
||||
<el-input placeholder="请输入" v-model="formField.contact_phone" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="tags" label="分类标签">
|
||||
<el-input placeholder="请输入,多个以,分隔" v-model="formField.tags" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="category_ids" label="分类">
|
||||
<el-select
|
||||
clearable
|
||||
default-first-option
|
||||
filterable
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
v-model="formField.category_ids"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="main_image" label="门店主图">
|
||||
<img
|
||||
:src="formField.main_image"
|
||||
alt=""
|
||||
class="main_image_box"
|
||||
v-if="formField.main_image"
|
||||
/>
|
||||
<UploadFile v-else @on-success="set_main_image"></UploadFile>
|
||||
</el-form-item>
|
||||
<el-form-item prop="longitude" label="经度">
|
||||
<el-input-number
|
||||
style="width: 200px"
|
||||
:controls="false"
|
||||
placeholder="请输入"
|
||||
v-model="formField.longitude"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="latitude" label="纬度">
|
||||
<el-input-number
|
||||
style="width: 200px"
|
||||
:controls="false"
|
||||
placeholder="请输入"
|
||||
v-model="formField.latitude"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="" label="">
|
||||
<el-button type="primary" @click="chooseCoordinates">选择坐标</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closed"> 取 消 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 地图坐标选择器 -->
|
||||
<MapSelector
|
||||
v-model="showMapSelector"
|
||||
:longitude="formField.longitude"
|
||||
:latitude="formField.latitude"
|
||||
@confirm="handleCoordinateConfirm"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main_image_box {
|
||||
width: 370px;
|
||||
height: 130px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue